def _get_typed_value_descriptor(obj):
  if isinstance(obj, basestring):
    type_name = 'Text'
  elif isinstance(obj, bool):
    type_name = 'Boolean'
  elif isinstance(obj, int):
    type_name = 'Integer'
  elif isinstance(obj, float):
    type_name = 'Float'
  else:
    raise TypeError('Cannot get a type descriptor for %s.' % repr(obj))
  return {'@type': 'http://schema.org/%s' % type_name, 'value': obj}
Converts a character representation in hex to its code.
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/internal/json_value.py/_get_typed_value_descriptor--crossover with--dataset/ETHPy150Open googlei18n/nototools/nototools/generate_sample_text.py/char_rep_to_code