class_docstr: Base Data type class
class_docstr_tok: ["Base","Data","type","class"]
docstr: Generates InputData from the set of ``JSON`` files with different fields
  
  Args:
      files_path: path the folder with ``json`` files
      fields_to_use: ``list`` of fields that will be considered as a features
      label: name of field with target variable
      task: :obj:`Task` to solve
      data_type: data type in fields (as well as type for obtained :obj:`InputData`)
      export_to_meta: combine extracted field and save to ``CSV``
      is_multilabel: if ``True``, creates multilabel target
      shuffle: if ``True``, shuffles data
  
  Returns:
      An instance of :class:`InputData`.
code: def from_json_files(
      files_path: str,
      fields_to_use: List,
      label: str = "label",
      task: Task = Task(TaskTypesEnum.classification),
      data_type: DataTypesEnum = DataTypesEnum.table,
      export_to_meta=False,
      is_multilabel=False,
      shuffle=True,
  ) -> InputData:
      """Generates InputData from the set of ``JSON`` files with different fields
  
      Args:
          files_path: path the folder with ``json`` files
          fields_to_use: ``list`` of fields that will be considered as a features
          label: name of field with target variable
          task: :obj:`Task` to solve
          data_type: data type in fields (as well as type for obtained :obj:`InputData`)
          export_to_meta: combine extracted field and save to ``CSV``
          is_multilabel: if ``True``, creates multilabel target
          shuffle: if ``True``, shuffles data
  
      Returns:
          An instance of :class:`InputData`.
      """
  
      if os.path.isfile(files_path):
          raise ValueError(
              """Path to the directory expected but got file"""
          )
  
      df_data = JSONBatchLoader(
          path=files_path,
          label=label,
          fields_to_use=fields_to_use,
          shuffle=shuffle,
      ).extract(export_to_meta)
  
      if len(fields_to_use) > 1:
          fields_to_combine = []
          for field_to_use in fields_to_use:
              fields_to_combine.append(np.array(df_data[field_to_use]))
              # Unite if the element of text data is divided into strings
              if isinstance(df_data[field_to_use][0], list):
                  df_data[field_to_use] = [
                      " ".join(piece) for piece in df_data[field_to_use]
                  ]
  
          features = np.column_stack(tuple(fields_to_combine))
      else:
          field_to_use = df_data[fields_to_use[0]]
          # process field_to_use with nested list
          if isinstance(field_to_use[0], list):
              field_to_use = [" ".join(piece) for piece in field_to_use]
          features = np.array(field_to_use)
  
      if is_multilabel:
          target = df_data[label]
          classes = set()
          for el in target:
              for label in el:
                  classes.add(label)
          count_classes = list(sorted(classes))
          multilabel_target = np.zeros(
              (len(features), len(count_classes))
          )
  
          for i in range(len(target)):
              for el in target[i]:
                  multilabel_target[i][count_classes.index(el)] = 1
          target = multilabel_target
      else:
          target = np.array(df_data[label])
  
      idx = [index for index in range(len(target))]
  
      return InputData(
          idx=idx,
          features=features,
          target=target,
          task=task,
          data_type=data_type,
      )
  
imports: from __future__ import annotations
  import glob
  import os
  from copy import copy, deepcopy
  from dataclasses import dataclass, field
  from typing import Any, Iterable, List, Optional, Tuple, Union
  import numpy
  import pandas
  from golem.core.log import default_log
  from golem.utilities.requirements_notificator import warn_requirement
  from fedot.core.data.array_utilities import atleast_2d
  from fedot.core.data.load_data import JSONBatchLoader, TextBatchLoader
  from fedot.core.data.supplementary_data import SupplementaryData
  from fedot.core.repository.dataset_types import DataTypesEnum
  from fedot.core.repository.tasks import Task, TaskTypesEnum
label_desc: Use image node_id 10 for calling the Data obj's underlying member method code with example usage: obj.from_json_files(files_path, fields_to_use, label, task, data_type, export_to_meta, is_multilabel, shuffle) and returns: InputData