class_docstr: Any iterable of (label, text_input) pairs qualifies as a ``Dataset``.
class_docstr_tok: ["Any","iterable","of","(","label",",","text_input",")","pairs","qualifies","as","a","``","Dataset","``","."]
docstr: Convert various data input to list of dict.
  Example::
  
       {'x': [
                'The robustness of deep neural networks has received
                much attention recently',
                'We focus on certified robustness of smoothed classifiers
                in this work',
                ...,
                'our approach exceeds the state-of-the-art.'
            ],
       'y': [
                'neural',
                'positive',
                ...,
                'positive'
            ]
      }
      convert to
      [
          {'x': 'The robustness of deep neural networks has received
          much attention recently', 'y': 'neural'},
          {'x': 'We focus on certified robustness of smoothed classifiers
          in this work', 'y': 'positive'},
          ...,
          {'x': 'our approach exceeds the state-of-the-art.',
          'y': 'positive'}
      ]
  :param list|dict|Sample data_samples:
  :return: Normalized data.
docstr_tok: ["Convert","various","data","input","to","list","of","dict",".","Example",":",":","{","'","x","'",":","[","'The","robustness","of","deep","neural","networks","has","received","much","attention","recently","'",",","'We","focus","on","certified","robustness","of","smoothed","classifiers","in","this","work","'",",","...",",","'our","approach","exceeds","the","state-of-the-art",".","'","]",",","'","y","'",":","[","'neural","'",",","'positive","'",",","...",",","'positive'","]","}","convert","to","[","{","'","x","'",":","'The","robustness","of","deep","neural","networks","has","received","much","attention","recently","'",",","'","y","'",":","'neural","'","}",",","{","'","x","'",":","'We","focus","on","certified","robustness","of","smoothed","classifiers","in","this","work","'",",","'","y","'",":","'positive","'","}",",","...",",","{","'","x","'",":","'our","approach","exceeds","the","state-of-the-art",".","'",",","'","y","'",":","'positive","'","}","]",":","param","list|dict|Sample","data_samples",":",":","return",":","Normalized","data","."]
code: def norm_input(data_samples):
      r"""
      Convert various data input to list of dict.
      Example::
  
           {'x': [
                    'The robustness of deep neural networks has received
                    much attention recently',
                    'We focus on certified robustness of smoothed classifiers
                    in this work',
                    ...,
                    'our approach exceeds the state-of-the-art.'
                ],
           'y': [
                    'neural',
                    'positive',
                    ...,
                    'positive'
                ]
          }
          convert to
          [
              {'x': 'The robustness of deep neural networks has received
              much attention recently', 'y': 'neural'},
              {'x': 'We focus on certified robustness of smoothed classifiers
              in this work', 'y': 'positive'},
              ...,
              {'x': 'our approach exceeds the state-of-the-art.',
              'y': 'positive'}
          ]
      :param list|dict|Sample data_samples:
      :return: Normalized data.
  
      """
      if isinstance(data_samples, list):
          norm_samples = data_samples
      elif isinstance(data_samples, dict):
          keys = list(data_samples.keys())
          data_size = len(data_samples[keys[0]])
          norm_samples = []
  
          for key in keys:
              assert (
                  len(data_samples[key]) == data_size
              ), "Unmatch key length, {0} is {1}, while {2} is {3}!".format(
                  keys[0], data_size, key, len(data_samples[key])
              )
  
          for i in range(data_size):
              norm_samples.append(
                  dict([(key, data_samples[key][i]) for key in keys])
              )
      elif isinstance(data_samples, (Sample, CnSample)):
          norm_samples = [data_samples]
      else:
          raise ValueError(
              "Data from pass is not instance of json, "
              "please check your data type:{0}".format(
                  type(data_samples)
              )
          )
  
      return norm_samples
  
imports: from tqdm import tqdm
  from ...common.utils import logger
  from ..component.sample import Sample, CnSample
  from ...common.utils.load import task_class_load
  from ...common.settings import SAMPLE_PATH, NLP_TASK_MAP
  from ...common.utils.file_io import read_csv, read_json, save_csv, save_json
label_desc: Use image node_id 16 for calling the Dataset obj's underlying member method code with example usage: obj.norm_input(data_samples) and returns: norm_samples