class_docstr: Converts a time series field identified by `name` from a list of numbers
  into a numpy array.
  
  Constructor parameters modify the conversion logic in the following way:
  
  If `is_required=True`, throws a `GluonTSDataError` if the field is not
  present in the `Data` dictionary.
  
  If `is_cat=True`, the array type is `np.int32`, otherwise it is
  `np.float32`.
  
  If `is_static=True`, asserts that the resulting array is 1D,
  otherwise asserts that the resulting array is 2D. 2D dynamic arrays of
  shape (T) are automatically expanded to shape (1,T).
  
  Parameters
  ----------
  name
      Name of the field to process.
  is_required
      Whether the field must be present.
  is_cat
      Whether the field refers to categorical (i.e. integer) values.
  is_static
      Whether the field is supposed to have a time dimension.
class_docstr_tok: ["Converts","a","time","series","field","identified","by","`","name","`","from","a","list","of","numbers","into","a","numpy","array",".","Constructor","parameters","modify","the","conversion","logic","in","the","following","way",":","If","`","is_required=True","`",",","throws","a","`","GluonTSDataError","`","if","the","field","is","not","present","in","the","`","Data","`","dictionary",".","If","`","is_cat=True","`",",","the","array","type","is","`","np.int32","`",",","otherwise","it","is","`","np.float32","`",".","If","`","is_static=True","`",",","asserts","that","the","resulting","array","is","1D",",","otherwise","asserts","that","the","resulting","array","is","2D",".","2D","dynamic","arrays","of","shape","(","T",")","are","automatically","expanded","to","shape","(","1",",","T",")",".","Parameters","--","--","--","--","--","name","Name","of","the","field","to","process",".","is_required","Whether","the","field","must","be","present",".","is_cat","Whether","the","field","refers","to","categorical","(","i.e",".","integer",")","values",".","is_static","Whether","the","field","is","supposed","to","have","a","time","dimension","."]
code: def __call__(self, data: DataEntry) -> DataEntry:
      value = data.get(self.name, None)
      if value is not None:
          value = np.asarray(value, dtype=self.dtype)
  
          if self.req_ndim != value.ndim:
              raise GluonTSDataError(
                  f"Array '{self.name}' has bad shape - expected "
                  f"{self.req_ndim} dimensions, got {value.ndim}."
              )
  
          data[self.name] = value
  
          return data
      elif not self.is_required:
          return data
      else:
          raise GluonTSDataError(
              f"Object is missing a required field `{self.name}`"
          )
  
imports: import functools
  import logging
  import shutil
  from pathlib import Path
  from types import ModuleType
  from typing import Callable, List, NamedTuple, Optional, Union, cast
  import numpy
  import pandas
  from pandas.tseries.frequencies import to_offset
  from gluonts import json
  from gluonts.itertools import Cached, Map
  from gluonts.dataset.field_names import FieldName
  from gluonts.dataset.schema import Translator
  from gluonts.exceptions import GluonTSDataError
  from gluonts.pydantic import pydantic
  from .None import Dataset, DatasetCollection, DataEntry, DataBatch
  from .None import jsonl, DatasetWriter
label_desc: Use image node_id 2 for calling the ProcessTimeSeriesField obj's underlying member method code with example usage: obj.__call__(data) and returns: data, data