code: def compile(self, ttFont):
      try:
          max_location = max(self.locations)
      except AttributeError:
          self.set([])
          max_location = 0
      if max_location < 0x20000 and all(
          l % 2 == 0 for l in self.locations
      ):
          locations = array.array("H")
          for i in range(len(self.locations)):
              locations.append(self.locations[i] // 2)
          ttFont["head"].indexToLocFormat = 0
      else:
          locations = array.array("I", self.locations)
          ttFont["head"].indexToLocFormat = 1
      if sys.byteorder != "big":
          locations.byteswap()
      return locations.tobytes()
  
file_path: catboost/contrib/python/fonttools/fontTools/ttLib/tables/_l_o_c_a.py
imports: from .None import DefaultTable
  import sys
  import array
  import logging
label_desc: Use image node_id 2 for calling the table__l_o_c_a obj's underlying member method code with example usage: obj.compile(ttFont) and returns: locations