parameters: (self, start, end)
return_statement: return start, end
docstring: Validate start and end and return them as positive bit positions.
docstring_summary: Validate start and end and return them as positive bit positions.
docstring_tokens: Validate start and end and return them as positive bit positions .
function: def _validate_slice(self, start, end):
          """Validate start and end and return them as positive bit positions."""
          if start is None:
              start = 0
          elif start < 0:
              start += self.len
          if end is None:
              end = self.len
          elif end < 0:
              end += self.len
          if not 0 <= end <= self.len:
              raise ValueError("end is not a valid position in the bitstring.")
          if not 0 <= start <= self.len:
              raise ValueError("start is not a valid position in the bitstring.")
          if end < start:
              raise ValueError("end must not be less than start.")
          return start, end
function_tokens: def _validate_slice ( self , start , end ) : if start is None : start = 0 elif start < 0 : start += self . len if end is None : end = self . len elif end < 0 : end += self . len if not 0 <= end <= self . len : raise ValueError ( "end is not a valid position in the bitstring." ) if not 0 <= start <= self . len : raise ValueError ( "start is not a valid position in the bitstring." ) if end < start : raise ValueError ( "end must not be less than start." ) return start , end