code: def _fix_range(self, num, isslice=True):
          
  
          nrows = self._info['nrows']
          if isslice:
              # include the end
              if num < 0:
                  num = nrows + (1+num)
              elif num > nrows:
                  num = nrows
          else:
              # single element
              if num < 0:
                  num = nrows + num
              elif num > (nrows-1):
                  num = nrows-1
  
          return num
docs: Ensure the input is within range.
  
          If el=True, then don't treat as a slice element