Returns a JSON dict

        @key_caps: Converts all dictionary keys to uppercase
        @value_caps: Converts all dictionary values to uppercase

        @return: JSON item (may be a variable, list or dictionary)
774059
def dict(self, name, key_caps=False, value_caps=False):
        '''
        
        '''
        # Invalid Dictionary
        if not isinstance(self.json_data[name], dict):
            raise InvalidDictionaryException

        # Convert key and/or values of dictionary to uppercase
        output = {}
        for key, value in self.json_data[name].items():
            output[key.upper() if key_caps else key] = value.upper() if value_caps else value

        return output
218921
def json(self):
        
        return {
            "status": self.status,
            "criteria_name": self.criteria_name,
            "warnings": [w.json() for w in self.warnings],
            "settings": self.settings,
        }
624056
def to_json(self):
    
    cursor = self._get_cursor()
    cursor_object = False
    if cursor and isinstance(cursor, datastore_query.Cursor):
      cursor = cursor.to_websafe_string()
      cursor_object = True
    return {"key_range": self._key_range.to_json(),
            "query_spec": self._query_spec.to_json(),
            "cursor": cursor,
            "cursor_object": cursor_object}
508350
def to_dict(self):
        
        return {
            inflection.camelize(k, False): v
            for k, v in self.__dict__.items()
            if v
        }
594434
def capitalize_keys(suspect):
    
    if not isinstance(suspect, dict):
        raise TypeError('you must pass a dict.')

    converted = {}

    for key in list(suspect):
        if not isinstance(key, six.string_types):
            continue

        if key[0].isupper():
            continue

        if '_' in key:
            new_key = ''.join([chunk.capitalize() for index, chunk in enumerate(key.split('_'))])
        else:
            new_key = key.capitalize()

        value = suspect.get(key)
        if type(value) is dict:
            converted[new_key] = capitalize_keys(value)
        elif type(value) is list:
            converted[new_key] = [capitalize_keys(x) if isinstance(x, dict) else x for x in value]
        else:
            converted[new_key] = value

    return converted
494020
def dictionary(self):
        
        output = {}
        for i in range(self.topLevelItemCount() - 1):
            item = self.topLevelItem(i)
            output[nativestring(item.text(1))] = nativestring(item.text(2))
        return output
637068
def _to_dict(self):
        
        if self.all_:
            return {"all": True}

        return {
            "keys": self.keys,
            "ranges": [keyrange._to_dict() for keyrange in self.ranges],
        }
977774
def to_dict(self):
        
        obj = super(EnumType, self).to_dict()
        obj['values'] = self.values
        return obj
218495
def _convert_dict_to_json(array):
    
    return json.dumps(
        array,
        skipkeys=False,
        allow_nan=False,
        indent=None,
        separators=(",", ":"),
        sort_keys=True,
        default=lambda o: o.__dict__,
    )
781380
def to_json(self):
        
        return {
            'resourceType': self.resource.resource_type_id,
            'resourceId': self.id,
            'accountId': self.resource.account_id,
            'account': self.account,
            'location': self.resource.location,
            'properties': {to_camelcase(prop.name): prop.value for prop in self.resource.properties},
            'tags': [{'key': t.key, 'value': t.value} for t in self.resource.tags]
        }
589720
def _to_dict(self):
        """"""
        _dict = {}
        if hasattr(self, 'level') and self.level is not None:
            _dict['level'] = self.level
        if hasattr(self, 'min_size') and self.min_size is not None:
            _dict['min_size'] = self.min_size
        if hasattr(self, 'max_size') and self.max_size is not None:
            _dict['max_size'] = self.max_size
        if hasattr(self, 'bold') and self.bold is not None:
            _dict['bold'] = self.bold
        if hasattr(self, 'italic') and self.italic is not None:
            _dict['italic'] = self.italic
        if hasattr(self, 'name') and self.name is not None:
            _dict['name'] = self.name
        return _dict
486066
def to_json(value, **kwargs):
        
        def _recurse_list(val):
            if val and isinstance(val[0], list):
                return [_recurse_list(v) for v in val]
            return [str(v) if np.isnan(v) or np.isinf(v) else v for v in val]
        return _recurse_list(value.tolist())
1052950
def to_dict(self) -> Dict[str, Any]:
        
        jsn = {
            'kind': self.__class__.__name__,
            'message': self.message
        } # type: Dict[str, Any]
        data = self.data
        if data:
            jsn['data'] = data
        jsn = {'error': jsn}
        return jsn
637877
def to_json_type(self):
        
        document_dict = self._json_safe(self._document)
        self._remove_keys(document_dict, self._private_fields)
        return document_dict
329955
def to_json(self, **kwargs: Mapping) -> str:
        
        content = {
            'Header': dict(self.Header),
            'Reads': self.Reads,
            'Settings': dict(self.Settings),
            'Data': [sample.to_json() for sample in self.samples],
            **{title: dict(getattr(self, title)) for title in self._sections},
        }
        return json.dumps(content, **kwargs)
116593
def to_dict(dictish):
    
    if hasattr(dictish, 'iterkeys'):
        m = dictish.iterkeys
    elif hasattr(dictish, 'keys'):
        m = dictish.keys
    else:
        raise ValueError(dictish)

    return dict((k, dictish[k]) for k in m())
976101
def to_json(self):
        

        result = super(Webhook, self).to_json()
        result.update({
            'name': self.name,
            'url': self.url,
            'topics': self.topics,
            'httpBasicUsername': self.http_basic_username,
            'headers': self.headers
        })

        if self.filters:
            result.update({'filters': self.filters})

        if self.transformation:
            result.update({'transformation': self.transformation})

        return result