original_docstring: Returns the offset in a .shp file for a shape based on information
          in the .shx index file.
docstring: Returns the offset in a .shp file for a shape based on information
  in the .shx index file.
docstring_tokens: Returns the offset in a . shp file for a shape based on information in the . shx index file .
code: def __shapeIndex(self, i=None):
          """Returns the offset in a .shp file for a shape based on information
          in the .shx index file."""
          shx = self.shx
          if not shx:
              return None
          if not self._offsets:
              if self.numShapes is None:
                  # File length (16-bit word * 2 = bytes) - header length
                  shx.seek(24)
                  shxRecordLength = (unpack(">i", shx.read(4))[0] * 2) - 100
                  self.numShapes = shxRecordLength // 8
              # Jump to the first record.
              shx.seek(100)
              shxRecords = _Array('i')
              # Each offset consists of two nrs, only the first one matters
              shxRecords.fromfile(shx, 2 * self.numShapes)
              if sys.byteorder != 'big':
                   shxRecords.byteswap()
              self._offsets = [2 * el for el in shxRecords[::2]]
          if not i == None:
              return self._offsets[i]
code_tokens: def __shapeIndex ( self , i = None ) : shx = self . shx if not shx : return None if not self . _offsets : if self . numShapes is None : shx . seek ( 24 ) shxRecordLength = ( unpack ( ">i" , shx . read ( 4 ) ) [ 0 ] * 2 ) - 100 self . numShapes = shxRecordLength // 8 shx . seek ( 100 ) shxRecords = _Array ( 'i' ) shxRecords . fromfile ( shx , 2 * self . numShapes ) if sys . byteorder != 'big' : shxRecords . byteswap ( ) self . _offsets = [ 2 * el for el in shxRecords [ : : 2 ] ] if not i == None : return self . _offsets [ i ]
short_docstring: Returns the offset in a .shp file for a shape based on information
  in the .shx index file.
short_docstring_tokens: Returns the offset in a . shp file for a shape based on information in the . shx index file .
comment: """Returns the offset in a .shp file for a shape based on information
          in the .shx index file."""$SEP$# File length (16-bit word * 2 = bytes) - header length
  $SEP$# Jump to the first record.
  $SEP$# Each offset consists of two nrs, only the first one matters
  