class_docstr: Factory class for function transforming a string into another object
  (int, float).
  
  After initialization, an instance can be called to transform a string
  into another object. If the string is recognized as representing a
  missing value, a default value is returned.
  
  Attributes
  ----------
  func : function
      Function used for the conversion.
  default : any
      Default value to return when the input corresponds to a missing
      value.
  type : type
      Type of the output.
  _status : int
      Integer representing the order of the conversion.
  _mapper : sequence of tuples
      Sequence of tuples (dtype, function, default value) to evaluate in
      order.
  _locked : bool
      Holds `locked` parameter.
  
  Parameters
  ----------
  dtype_or_func : {None, dtype, function}, optional
      If a `dtype`, specifies the input data type, used to define a basic
      function and a default value for missing data. For example, when
      `dtype` is float, the `func` attribute is set to `float` and the
      default value to `np.nan`.  If a function, this function is used to
      convert a string to another object. In this case, it is recommended
      to give an associated default value as input.
  default : any, optional
      Value to return by default, that is, when the string to be
      converted is flagged as missing. If not given, `StringConverter`
      tries to supply a reasonable default value.
  missing_values : {None, sequence of str}, optional
      ``None`` or sequence of strings indicating a missing value. If ``None``
      then missing values are indicated by empty entries. The default is
      ``None``.
  locked : bool, optional
      Whether the StringConverter should be locked to prevent automatic
      upgrade or not. Default is False.
docstr: Upgrade the mapper of a StringConverter by adding a new function and
  its corresponding default.
  
  The input function (or sequence of functions) and its associated
  default value (if any) is inserted in penultimate position of the
  mapper.  The corresponding type is estimated from the dtype of the
  default value.
  
  Parameters
  ----------
  func : var
      Function, or sequence of functions
  
  Examples
  --------
  >>> import dateutil.parser
  >>> import datetime
  >>> dateparser = dateutil.parser.parse
  >>> defaultdate = datetime.date(2000, 1, 1)
  >>> StringConverter.upgrade_mapper(dateparser, default=defaultdate)
docstr_tok: ["Upgrade","the","mapper","of","a","StringConverter","by","adding","a","new","function","and","its","corresponding","default",".","The","input","function","(","or","sequence","of","functions",")","and","its","associated","default","value","(","if","any",")","is","inserted","in","penultimate","position","of","the","mapper",".","The","corresponding","type","is","estimated","from","the","dtype","of","the","default","value",".","Parameters","--","--","--","--","--","func",":","var","Function",",","or","sequence","of","functions","Examples","--","--","--","--",">",">",">","import","dateutil.parser",">",">",">","import","datetime",">",">",">","dateparser","=","dateutil.parser.parse",">",">",">","defaultdate","=","datetime.date","(","2000",",","1",",","1",")",">",">",">","StringConverter.upgrade_mapper","(","dateparser",",","default=defaultdate",")"]
code: def upgrade_mapper(cls, func, default=None):
      """
      Upgrade the mapper of a StringConverter by adding a new function and
      its corresponding default.
  
      The input function (or sequence of functions) and its associated
      default value (if any) is inserted in penultimate position of the
      mapper.  The corresponding type is estimated from the dtype of the
      default value.
  
      Parameters
      ----------
      func : var
          Function, or sequence of functions
  
      Examples
      --------
      >>> import dateutil.parser
      >>> import datetime
      >>> dateparser = dateutil.parser.parse
      >>> defaultdate = datetime.date(2000, 1, 1)
      >>> StringConverter.upgrade_mapper(dateparser, default=defaultdate)
      """
      # Func is a single functions
      if hasattr(func, "__call__"):
          cls._mapper.insert(
              -1, (cls._getsubdtype(default), func, default)
          )
          return
      elif hasattr(func, "__iter__"):
          if isinstance(func[0], (tuple, list)):
              for _ in func:
                  cls._mapper.insert(-1, _)
              return
          if default is None:
              default = [None] * len(func)
          else:
              default = list(default)
              default.append([None] * (len(func) - len(default)))
          for fct, dft in zip(func, default):
              cls._mapper.insert(-1, (cls._getsubdtype(dft), fct, dft))
  
imports: import numpy
  import numpy._core.numeric
  from numpy._utils import asbytes, asunicode
label_desc: Use image node_id 4 for calling the StringConverter obj's underlying member method code with example usage: obj.upgrade_mapper(cls, func, default) without return types