Creates a BoundingBox from json data.
        
        :param json_data: The raw json data to parse
        :type json_data: dict
        :returns: BoundingBox
519315
def _from_json(json_data):
        
        if len(json_data) >= 6:
            return BoundingBox(
                        Coordinate(_parse_float(json_data[0]),
                                   _parse_float(json_data[1]),
                                   _parse_float(json_data[2])),
                        Coordinate(_parse_float(json_data[3]),
                                   _parse_float(json_data[4]),
                                   _parse_float(json_data[5])))
        else:
            raise USGSException("The bounding box information was incomplete.")
441052
def ppj(json_data):
    
    return str(json.dumps(
                json_data,
                sort_keys=True,
                indent=4,
                separators=(',', ': ')))
925080
def json_data(self):
        
        def stringify_keys(d):
            if not isinstance(d, dict):
                return d
            return dict((str(k), stringify_keys(v)) for k, v in d.items())
        data = self.make_data()
        json_data = json.dumps(stringify_keys(data))
        return json_data
1349816
def from_json(cls, data, json_schema_class=None):
        
        schema = cls.json_schema if json_schema_class is None else json_schema_class()
        return super(InfinityVertex, cls).from_json(data=data, json_schema_class=schema.__class__)
227225
def from_json(cls, json_graph):
        
        obj = json.loads(json_graph)

        vertices = [
            AnnotatedVertex(
                id=vertex["id"],
                annotation=vertex["annotation"],
            )
            for vertex in obj["vertices"]
        ]

        edges = [
            AnnotatedEdge(
                id=edge["id"],
                annotation=edge["annotation"],
                head=edge["head"],
                tail=edge["tail"],
            )
            for edge in obj["edges"]
        ]

        return cls(vertices=vertices, edges=edges)
1183964
def load_json(cls, data, default_rule=None, raise_error=False):
        """"""

        rules = {k: _parser.parse_rule(v, raise_error)
                 for k, v in json.loads(data).items()}

        return cls(rules, default_rule)
728168
def unwrap_json(self, type, json_data):
        ''''''
        # Parse the data
        try:
            data = json.loads(json_data)
        except ValueError:
            # If parsing failed, then raise the string which likely contains an error message instead of data
            raise RedmineError(json_data)
        # Check to see if there is a data wrapper
        # Some replies will have {'issue':{<data>}} instead of just {<data>}
        try:
            data = data[type]
        except KeyError:
            pass
        return data
718214
def from_json(cls, json_string):
        
        input_dict = json.loads(json_string)
        # convert index to tuple if required
        if input_dict['index'] and isinstance(input_dict['index'][0], list):
            input_dict['index'] = [tuple(x) for x in input_dict['index']]
        # convert index_name to tuple if required
        if isinstance(input_dict['meta_data']['index_name'], list):
            input_dict['meta_data']['index_name'] = tuple(input_dict['meta_data']['index_name'])
        data = input_dict['data'] if input_dict['data'] else None
        return cls(data=data, index=input_dict['index'], **input_dict['meta_data'])
1293130
def json_decode(data):
    
    if isinstance(data, six.binary_type):
        data = data.decode('utf-8')

    return json.loads(data)
876207
def as_json(data, **kwargs):
    

    if 'sort_keys' not in kwargs:
        kwargs['sort_keys'] = False
    if 'ensure_ascii' not in kwargs:
        kwargs['ensure_ascii'] = False

    data = json.dumps(data, **kwargs)

    return data
1365611
def from_json(cls, json):
    
    # Strip out unrecognized parameters, as introduced by b/5960884.
    params = dict((str(k), v) for k, v in json.iteritems()
                  if k in cls._PARAMS)

    # This is not symmetric with to_json() wrt. PROTOTYPE_REQUEST_PARAM because
    # the constructor parameters need to be JSON-encodable, so the decoding
    # needs to happen there anyways.
    if cls._OFFSET_PARAM in params:
      params[cls._OFFSET_PARAM] = base64.b64decode(params[cls._OFFSET_PARAM])
    return cls(**params)
1330497
def from_json(cls, data):
        
        required_keys = ('location', 'design_days')
        for key in required_keys:
            assert key in data, 'Required key "{}" is missing!'.format(key)

        return cls(Location.from_json(data['location']),
                   [DesignDay.from_json(des_day) for des_day in data['design_days']])
747671
def from_json(cls, json_data):
        """"""
        # Example Data:
        # { "grpId": "11817", "grpName": "7603_Digi", "grpDescription": "7603_Digi root group",
        #   "grpPath": "\/7603_Digi\/", "grpParentId": "1"}
        return cls(
            group_id=json_data["grpId"],
            name=json_data["grpName"],
            description=json_data.get("grpDescription", ""),
            path=json_data["grpPath"],
            parent_id=json_data["grpParentId"],
        )
743720
def _fromJSON(cls, jsonobject):
        
        newInstance = cls(None, None)
        newInstance.__dict__.update(jsonobject)
        return newInstance
791251
def from_json(cls, json):
    
    if json[cls.KEY_RANGE_PARAM] is None:
      # pylint: disable=redefined-outer-name
      key_ranges = None
    else:
      key_ranges = []
      for k in json[cls.KEY_RANGE_PARAM]:
        if k:
          key_ranges.append(key_range.KeyRange.from_json(k))
        else:
          key_ranges.append(None)

    if json[cls.NAMESPACE_RANGE_PARAM] is None:
      ns_range = None
    else:
      ns_range = namespace_range.NamespaceRange.from_json_object(
          json[cls.NAMESPACE_RANGE_PARAM])

    if json[cls.CURRENT_KEY_RANGE_PARAM] is None:
      current_key_range = None
    else:
      current_key_range = key_range.KeyRange.from_json(
          json[cls.CURRENT_KEY_RANGE_PARAM])

    return cls(
        json[cls.ENTITY_KIND_PARAM],
        key_ranges,
        ns_range,
        json[cls.BATCH_SIZE_PARAM],
        current_key_range,
        filters=json.get(cls.FILTERS_PARAM))
489677
def from_json(cls, json):
    
    return cls(json[cls.BLOB_KEY_PARAM],
               json[cls.START_INDEX_PARAM],
               json[cls.END_INDEX_PARAM])
154087
def json_data(self, instance, default=None):
        
        value = self.get(instance)
        return value or default