deepy/utils/stream_pickler.py
def load(file_obj):
        """
        load contents from file_obj, returning a generator that yields one
        element at a time
        """
        cur_elt = []
        for line in file_obj:
          cur_elt.append(line)

          if line == '\n':
            pickled_elt_str = ''.join(cur_elt)
            cur_elt = []
            try:
                elt = loads(pickled_elt_str)
            except ValueError:
                continue

            yield elt
def load(file_obj):
        cur_elt = []
        for line in file_obj:
          cur_elt.append(line)

          if line == '\n':
            pickled_elt_str = ''.join(cur_elt)
            cur_elt = []
            try:
                elt = loads(pickled_elt_str)
            except ValueError:
                continue

            yield elt
def load ( file_obj ) : cur_elt = [ ] for line in file_obj : cur_elt . append ( line ) if line == '\n' : pickled_elt_str = '' . join ( cur_elt ) cur_elt = [ ] try : elt = loads ( pickled_elt_str ) except ValueError : continue yield elt
load contents from file_obj, returning a generator that yields one
        element at a time
load contents from file_obj returning a generator that yields one element at a time