code: def str_2_obj(obj_str, tg_type=None):
      
      if tg_type is None:
          return obj_str
      f = str
      if is_scalar_type(tg_type):
          if is_numerical_type(tg_type):
              if obj_str in __NO_STR_VALUE:
                  return None
          if is_int_type(tg_type):
              f = int
          elif is_float_type(tg_type):
              f = float
          elif is_bool_type(tg_type):
              f = bool_
      return f(obj_str)
docs: Converts a string into an object according to the given tango type
  
             :param obj_str: the string to be converted
             :type obj_str: :py:obj:`str`
             :param tg_type: tango type
             :type tg_type: :class:`tango.CmdArgType`
             :return: an object calculated from the given string
             :rtype: :py:obj:`object`