code: def _data_to_frame(**kwargs):
      head, body, foot = kwargs.pop("data")
      header = kwargs.pop("header")
      kwargs["skiprows"] = _get_skiprows(kwargs["skiprows"])
      if head:
          body = head + body
  
          # Infer header when there is a <thead> or top <th>-only rows
          if header is None:
              if len(head) == 1:
                  header = 0
              else:
                  # ignore all-empty-text rows
                  header = [
                      i
                      for i, row in enumerate(head)
                      if any(text for text in row)
                  ]
  
      if foot:
          body += foot
  
      # fill out elements of body that are "ragged"
      _expand_elements(body)
      tp = TextParser(body, header=header, **kwargs)
      df = tp.read()
      return df
  
imports: from distutils.version import LooseVersion
  import numbers
  import os
  import re
  import pandas.compat
  from pandas.compat import binary_type, iteritems, lmap, lrange, raise_with_traceback, string_types, u
  from pandas.errors import AbstractMethodError, EmptyDataError
  from pandas.core.dtypes.common import is_list_like
  from pandas import Series
  from pandas.io.common import _is_url, _validate_header_arg, urlopen
  from pandas.io.formats.printing import pprint_thing
  from pandas.io.parsers import TextParser
label_desc: Use image node_id 7 for calling a global function with example usage: _data_to_frame() and returns: df