Return the service as a JSON string.
176927
def as_text(self, is_pretty=False):
        """"""
        values = {
            'type': self._type,
            self.SERVICE_ENDPOINT: self._service_endpoint,
        }
        if self._consume_endpoint is not None:
            values[self.CONSUME_ENDPOINT] = self._consume_endpoint
        if self._values:
            # add extra service values to the dictionary
            for name, value in self._values.items():
                values[name] = value

        if is_pretty:
            return json.dumps(values, indent=4, separators=(',', ': '))

        return json.dumps(values)
776339
def to_json(self):
        

        result = super(Environment, self).to_json()
        result.update({
            'name': self.name
        })

        return result
446537
def json_obj(self, method, params=None, auth=True):
        """"""
        if params is None:
            params = {}

        obj = {
            'jsonrpc': '2.0',
            'method': method,
            'params': params,
            'auth': self.__auth if auth else None,
            'id': self.id,
        }

        return json.dumps(obj)
1300718
def json(self, **kwargs):
        """"""
        encoding = detect_encoding(self.content[:4])
        value = self.content.decode(encoding)

        return simplejson.loads(value, **kwargs)
1306754
def json_data(self):
        """"""
        return {
            "type": self.type,
            "max_size": self.max_size,
            "full": self.full,
            "role": self.role,
        }
972063
def getJson(url):
    """"""
    site = urllib2.urlopen(url, timeout=300)
    return json.load(site)
917244
def to_json(self):
        
        return {
            'userId': self.user_id,
            'username': self.username,
            'roles': self.roles,
            'authSystem': self.auth_system
        }
359605
def to_json(self):
        """"""
        return {
            'header': self.header.to_json(),
            'values': self._values,
            'datetimes': self.datetimes,
            'validated_a_period': self._validated_a_period
        }
803533
def to_json_basic(self):
        
        return {'name': self.__class__.__name__, 'priority': self.priority,
                'address': self.address, 'rtr': self.rtr}
1040301
def to_json(self):
        """"""
        return {
            'st_month': self.st_month,
            'st_day': self.st_day,
            'st_hour': self.st_hour,
            'end_month': self.end_month,
            'end_day': self.end_day,
            'end_hour': self.end_hour,
            'timestep': self.timestep,
            'is_leap_year': self.is_leap_year
        }
673451
def to_JSON(self):
        
        return json.dumps({"reference_time": self._reference_time,
                           "location": json.loads(self._location.to_JSON()),
                           "interval": self._interval,
                           "co_samples": self._co_samples,
                           "reception_time": self._reception_time,
                           })
677383
def to_json(data, pretty):
    
    if pretty:
        return json.dumps(data, sort_keys=True, indent=4, separators=(',', ': '))
    return json.dumps(data)
315120
def to_json(self):
        """"""
        return {
            'location': self.location.to_json(),
            'design_days': [des_d.to_json() for des_d in self.design_days]
        }
196983
def dump(self):
    """"""
    return json.dumps(
        self.primitive,
        sort_keys=True,
        ensure_ascii=False,
        separators=(',', ':'))
12150
def json(self):
        """"""
        if self.search_results is None:
            return None

        result = []
        for row in self.search_results['rows']:
            obj = {}
            for index in range(0, len(self.search_results['fields'])):
                obj[self.search_results['fields'][index]] = row[index]
            result.append(obj)

        return result
341387
def as_json(self):
        # type: () -> dict
        """"""
        self._config['applyCss'] = self.applyCss
        self._json['config'] = self._config
        return self._json
930489
def get_json(response):
    """"""

    json_field_or_function = getattr(response, 'json', None)
    if callable(json_field_or_function):
        return response.json()
    else:
        return jsonutils.loads(response.content)