code: def from_records(
      data,
      index=None,
      exclude=None,
      columns=None,
      coerce_float=False,
      nrows=None,
      gpu=None,
      sparse=False,
      **kw,
  ):
      if isinstance(data, np.ndarray):
          from .dataframe import from_pandas
  
          return from_pandas(
              pd.DataFrame.from_records(
                  data,
                  index=index,
                  exclude=exclude,
                  columns=columns,
                  coerce_float=coerce_float,
                  nrows=nrows,
              ),
              **kw,
          )
      elif isinstance(data, TENSOR_TYPE):
          if data.dtype.names is None:
              raise TypeError(
                  "Not a tensor with structured dtype {0}", data.dtype
              )
          if data.ndim != 1:
              raise ValueError(
                  "Not a tensor with non 1-D structured dtype {0}",
                  data.shape,
              )
  
          op = DataFrameFromRecords(
              index=None,
              exclude=exclude,
              columns=columns,
              coerce_float=coerce_float,
              nrows=nrows,
              gpu=gpu,
              sparse=sparse,
              **kw,
          )
          return op(data)
      else:
          raise TypeError(
              "Not support create DataFrame from {0}", type(data)
          )
  
file_path: mars/mars/dataframe/datasource/from_records.py
imports: import numpy
  import pandas
  from ...None import opcodes
  from ...core import OutputType
  from ...serialization.serializables import BoolField, ListField, Int32Field
  from ...tensor.core import TENSOR_TYPE
  from ..operands import DataFrameOperand, DataFrameOperandMixin
  from ..utils import parse_index
label_desc: Use image node_id 1 for calling a global function with example usage: from_records(data, index, exclude, columns, coerce_float, nrows, gpu, sparse) and returns: from_pandas, op