code: def from_json(cls, json):
      
      if json["name"] in _KEYRANGES_CLASSES:
        return _KEYRANGES_CLASSES[json["name"]].from_json(json)
      raise ValueError("Invalid json %s", json)
docs: Deserialize from json.
  
      Args:
        json: a dict of json compatible fields.
  
      Returns:
        a KeyRanges object.
  
      Raises:
        ValueError: if the json is invalid.