def text_blocks_to_pandas(reader, block_lists, header, head, kwargs, collection=True, enforce=False):
 dtypes = head.dtypes.to_dict()
 columns = list(head.columns)
 delayed_pandas_read_text = delayed(pandas_read_text)
 dfs = []
 for blocks in block_lists:
  if (not blocks):
   continue
  df = delayed_pandas_read_text(reader, blocks[0], header, kwargs, dtypes, columns, write_header=False, enforce=enforce)
  dfs.append(df)
  for b in blocks[1:]:
   dfs.append(delayed_pandas_read_text(reader, b, header, kwargs, dtypes, columns, enforce=enforce))
 if collection:
  head = clear_known_categories(head)
  return from_delayed(dfs, head)
 else:
  return dfs

def text_blocks_to_pandas ( reader , block_lists , header , head , kwargs , collection = True , enforce = False ) : dtypes = head . dtypes . to_dict ( ) columns = list ( head . columns ) delayed_pandas_read_text = delayed ( pandas_read_text ) dfs = [ ] for blocks in block_lists : if ( not blocks ) : continue df = delayed_pandas_read_text ( reader , blocks [ 0 ] , header , kwargs , dtypes , columns , write_header = False , enforce = enforce ) dfs . append ( df ) for b in blocks [ 1 : ] : dfs . append ( delayed_pandas_read_text ( reader , b , header , kwargs , dtypes , columns , enforce = enforce ) ) if collection : head = clear_known_categories ( head ) return from_delayed ( dfs , head ) else : return dfs
convert blocks of bytes to a dask .