Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _check_parameters(self, size, start, step):
"""Checks if parameters are data slice offsets."""
if not isinstance(size, DataSliceStep):
size = DataSliceStep(size)
start = start or self._df.index[0]
if not isinstance(start, DataSliceOffset):
start = DataSliceOffset(start)
step = step or size
if not isinstance(step, DataSliceStep):
step = DataSliceStep(step)
info = 'offset must be positive'
assert size._is_positive, info
assert step._is_positive, info
if any(offset._is_offset_period for offset in (size, start, step)):
info = 'offset by time requires a time index'
assert self._is_time_index, info
def _check_parameters(self, size, start, step):
"""Checks if parameters are data slice offsets."""
if not isinstance(size, DataSliceStep):
size = DataSliceStep(size)
start = start or self._df.index[0]
if not isinstance(start, DataSliceOffset):
start = DataSliceOffset(start)
step = step or size
if not isinstance(step, DataSliceStep):
step = DataSliceStep(step)
info = 'offset must be positive'
assert size._is_positive, info
assert step._is_positive, info
if any(offset._is_offset_period for offset in (size, start, step)):
info = 'offset by time requires a time index'
assert self._is_time_index, info
return size, start, step
def _check_parameters(self, size, start, step):
"""Checks if parameters are data slice offsets."""
if not isinstance(size, DataSliceStep):
size = DataSliceStep(size)
start = start or self._df.index[0]
if not isinstance(start, DataSliceOffset):
start = DataSliceOffset(start)
step = step or size
if not isinstance(step, DataSliceStep):
step = DataSliceStep(step)
info = 'offset must be positive'
assert size._is_positive, info
assert step._is_positive, info
if any(offset._is_offset_period for offset in (size, start, step)):
info = 'offset by time requires a time index'
assert self._is_time_index, info
return size, start, step
def _check_parameters(self, size, start, step):
"""Checks if parameters are data slice offsets."""
if not isinstance(size, DataSliceStep):
size = DataSliceStep(size)
start = start or self._df.index[0]
if not isinstance(start, DataSliceOffset):
start = DataSliceOffset(start)
step = step or size
if not isinstance(step, DataSliceStep):
step = DataSliceStep(step)
info = 'offset must be positive'
assert size._is_positive, info
assert step._is_positive, info
if any(offset._is_offset_period for offset in (size, start, step)):
info = 'offset by time requires a time index'