Export a set of organizations.

        Method to export organizations from the registry. Organizations schema
        will follow Sorting Hat JSON format.

        :returns: a JSON formatted str
768994
def export(self):
        
        organizations = {}

        orgs = api.registry(self.db)

        for org in orgs:
            domains = [{'domain': dom.domain,
                        'is_top': dom.is_top_domain}
                       for dom in org.domains]
            domains.sort(key=lambda x: x['domain'])

            organizations[org.name] = domains

        obj = {'time': str(datetime.datetime.now()),
               'blacklist': [],
               'organizations': organizations,
               'uidentities': {}}

        return json.dumps(obj, default=self._json_encoder,
                          indent=4, separators=(',', ': '),
                          sort_keys=True)
1158751
def organization_fields(self, organization):
        
        return self._query_zendesk(self.endpoint.organization_fields, 'organization_field', id=organization)
321683
def to_json(self):
        
        data = dict()
        data['name'] = self.name
        data['language'] = self.language
        data['fancy_name'] = self.fancy_name
        data['scenario'] = self.scenario
        return data
1254211
def to_json(self):
        
        return json.dumps(self.to_dict(), sort_keys=True, indent=2, separators=(',', ': '))
958683
def to_dict(self):
        
        org = {}
        if self._display_name:
            org["display_name"] = self._display_name
        if self._name:
            org["name"] = self._name
        if self._url:
            org["url"] = self._url
        return {"organization": org} if org else {}
401034
def export(self):
        
        return {'id' : self.id, 'name' : self.name, 'artist' : self._artist_name, 'artist_id' : self._artist_id, 'cover' : self._cover_url}
480759
def export_json_object(dict_obj, filename=None):
    
    try:
        if filename:
            try:
                with open(filename, 'w') as handle:
                    handle.write(json.dumps(dict_obj, indent=4, sort_keys=True))
                    logger.info(
                        '%s: Wrote %s to local filesystem location' %
                        (inspect.stack()[0][3], filename))
                handle.close()
            except TypeError as e:
                logger.warning(
                    '%s: object in dict not serializable: %s' %
                    (inspect.stack()[0][3], str(e)))
        else:
            json_str = json.dumps(dict_obj, indent=4, sort_keys=True)
            print(highlight(json_str, lexers.JsonLexer(), formatters.TerminalFormatter()))
            logger.info('%s: successful export to stdout' % inspect.stack()[0][3])
            return True
    except IOError as e:
        logger.critical(
            '%s: export_file_object: error writing to %s to filesystem. Error: %s' %
            (inspect.stack()[0][3], filename, str(e)))
        return False
    else:
        logger.info('export_file_object: successful export to %s' % filename)
        return True
1064573
def to_json(self, is_admin=False):
        
        if is_admin:
            return {
                'accountId': self.account_id,
                'accountName': self.account_name,
                'accountType': self.account_type,
                'contacts': self.contacts,
                'enabled': True if self.enabled == 1 else False,
                'requiredRoles': self.required_roles,
                'properties': {to_camelcase(prop.name): prop.value for prop in self.account.properties}
            }
        else:
            return {
                'accountId': self.account_id,
                'accountName': self.account_name,
                'contacts': self.contacts
            }
519921
def __getOrganizations(self, web):
        
        orgsElements = web.find_all("a", {"class": "avatar-group-item"})
        self.organizations = len(orgsElements)
1204078
def to_json(self):
        
        res = dict()
        res['Handle'] = ''
        res['Name'] = self.name
        res['ImageUrl'] = self.url
        res['Description'] = self.desc
        res["EntityOptions"] = self.options
        return res
767539
def get_organization(self, **kwargs):
        
        resp = self._get(self._u(self._ORGANIZATION_ENDPOINT_SUFFIX),
                         **kwargs)
        resp.raise_for_status()
        return resp.json()
1298
def export_jwks_as_json(self, private=False, issuer=""):
        
        return json.dumps(self.export_jwks(private, issuer))
346945
def to_report_json(self):
        

        return self.reporter.json(self.n_lines, self.n_assocs, self.skipped)
705291
def to_json(self):
        
        return {
            'name': self.name,
            'segments': [segment.to_json() for segment in self.segments],
            'meta': self.meta
            }
643748
def export_for_schema(self):
        
        ret = "{'class': 'NetworkTopologyStrategy'"
        for dc, repl_factor in sorted(self.dc_replication_factors.items()):
            ret += ", '%s': '%d'" % (dc, repl_factor)
        return ret + "}"
208436
def to_json(self):
        
        capsule = {}
        capsule["Hierarchy"] = []
        for (
            dying,
            (persistence, surviving, saddle),
        ) in self.merge_sequence.items():
            capsule["Hierarchy"].append(
                {
                    "Persistence": persistence,
                    "Dying": dying,
                    "Surviving": surviving,
                    "Saddle": saddle,
                }
            )
        capsule["Partitions"] = []
        base = np.array([None] * len(self.Y))
        for label, items in self.base_partitions.items():
            base[items] = label
        capsule["Partitions"] = base.tolist()

        return json.dumps(capsule, separators=(",", ":"))
211320
def _to_json(self, sort_keys=False, indent=4):
        
        return json.dumps(self, sort_keys=sort_keys, indent=indent, cls=CtabAtomBondEncoder)