code: def obj_gen(lines, object_hook=None):
      """Return a generator of JSON objects loaded from ``lines``."""
      first_line = next(lines)
      if first_line.startswith("\x1e"):
  
          def gen():
              buffer = first_line.strip("\x1e")
              for line in lines:
                  if line.startswith("\x1e"):
                      if buffer:
                          yield json.loads(
                              buffer, object_hook=object_hook
                          )
                      buffer = line.strip("\x1e")
                  else:
                      buffer += line
              else:
                  yield json.loads(buffer, object_hook=object_hook)
  
      else:
  
          def gen():
              yield json.loads(first_line, object_hook=object_hook)
              for line in lines:
                  yield json.loads(line, object_hook=object_hook)
  
      return gen()
  
file_path: Fiona/fiona/fio/helpers.py
imports: from functools import partial
  import json
  import math
  import warnings
  from fiona.model import Geometry, to_dict
  from fiona._vendor.munch import munchify
label_desc: Use image node_id 1 for calling a global function with example usage: obj_gen(lines, object_hook) and returns: gen