def to_json_value(obj, with_type=False):
  if isinstance(obj, (list, tuple)):
    return extra_types.JsonValue(
        array_value=extra_types.JsonArray(
            entries=[to_json_value(o, with_type=with_type) for o in obj]))
  elif isinstance(obj, dict):
    json_object = extra_types.JsonObject()
    for k, v in obj.iteritems():
      json_object.properties.append(
          extra_types.JsonObject.Property(
              key=k, value=to_json_value(v, with_type=with_type)))
    return extra_types.JsonValue(object_value=json_object)
  elif with_type:
    return to_json_value(_get_typed_value_descriptor(obj), with_type=False)
  elif isinstance(obj, basestring):
    return extra_types.JsonValue(string_value=obj)
  elif isinstance(obj, bool):
    return extra_types.JsonValue(boolean_value=obj)
  elif isinstance(obj, int):
    return extra_types.JsonValue(integer_value=obj)
  elif isinstance(obj, float):
    return extra_types.JsonValue(double_value=obj)
  else:
    raise TypeError('Cannot convert %s to a JSON value.' % repr(obj))
Each instance of :class:'Bottle' is a WSGI application.
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/internal/json_value.py/to_json_value--crossover with--dataset/ETHPy150Open adampresley/bottlepy-bootstrap/app/bottle.py/Bottle.__call__