docstr: Load Data from variable or file based on the file extension.
  This function is based on pandas and numpy tools, when the file is in a
  standard format. Various file types are supported (.npy, .csv, .json,
  .jsonl, .xls, .xlsx, .tsv, .pickle, .pick)
  
  Args:
      input: vars to the data file
      header (bool): load data with header, default is True
  
  Returns:
      Object
docstr_tok: ["Load","Data","from","variable","or","file","based","on","the","file","extension",".","This","function","is","based","on","pandas","and","numpy","tools",",","when","the","file","is","in","a","standard","format",".","Various","file","types","are","supported","(",".npy",",",".csv",",",".json",",",".jsonl",",",".xls",",",".xlsx",",",".tsv",",",".pickle",",",".pick",")","Args",":","input",":","vars","to","the","data","file","header","(","bool",")",":","load","data","with","header",",","default","is","True","Returns",":","Object"]
code: def load_data(input, *, header=True):
      """
      Load Data from variable or file based on the file extension.
      This function is based on pandas and numpy tools, when the file is in a
      standard format. Various file types are supported (.npy, .csv, .json,
      .jsonl, .xls, .xlsx, .tsv, .pickle, .pick)
  
      Args:
          input: vars to the data file
          header (bool): load data with header, default is True
  
      Returns:
          Object
      """
      if type(input) != str:
          return input
  
      # -- Parse/read if the input is a str --
      path = Path(input)
      extension = path.suffix.lower()
      if extension == ".npy":
          data = np.load(path)
      elif extension == ".json":
          data = pd.read_json(str(path))
      elif extension == ".jsonl":
          data = pd.read_json(str(path), lines=True)
      elif extension == ".dta":
          data = pd.read_stata(str(path))
      elif extension == ".tsv":
          data = pd.read_csv(str(path), sep="\t")
      elif extension in [".xls", ".xlsx"]:
          data = pd.read_excel(str(path))
      elif extension in [".pkl", ".pickle"]:
          data = pd.read_pickle(str(path))
      else:
          if extension != ".csv":
              warnings.warn(
                  message="Warning! unsupported extension %s, "
                  "we default it to be in CSV format." % extension
              )
          if header:
              data = pd.read_csv(str(path))
          else:
              data = pd.read_csv(str(path), header=None)
      return data
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import warnings
  import json
  from enum import Enum
  from importlib import import_module
  from pathlib import Path
  import numpy
  import pandas
  import yaml
  from jsonschema import validate
  from xai.exception import CompilerException
  from xai.formatter import Report
label_desc: Use image node_id 8 for calling the Dict2Obj obj's underlying member method code with example usage: obj.load_data(input) and returns: data, input