mirror of
https://github.com/status-im/eth2.0-specs.git
synced 2025-02-17 13:06:34 +00:00
Add docstring into get_split_offset
This commit is contained in:
parent
422c607f74
commit
fdcfc91008
@ -779,6 +779,10 @@ def get_permuted_index(index: int, list_size: int, seed: Bytes32) -> int:
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
def get_split_offset(list_length: int, split_count: int, index: int) -> int:
|
def get_split_offset(list_length: int, split_count: int, index: int) -> int:
|
||||||
|
"""
|
||||||
|
Returns a value such that for a list L, chunk count k and index i,
|
||||||
|
split(L, k)[i] == L[get_split_offset(len(L), k, i): get_split_offset(len(L), k, i + 1)]
|
||||||
|
"""
|
||||||
return (list_length * index) // split_count
|
return (list_length * index) // split_count
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user