Download organizations JSON and extract its properties
191272
def download_organizations():
    ""

    response = requests.get(URL)
    data = response.json()
    organizations = [organization["properties"] for organization in data["features"]]
    return rows.import_from_dicts(organizations)
224852
private static String getJsonFromRaw(Context context, int resource) {
        String json;
        try {
            InputStream inputStream = context.getResources().openRawResource(resource);
            int size = inputStream.available();
            byte[] buffer = new byte[size];
            inputStream.read(buffer);
            inputStream.close();
            json = new String(buffer, "UTF-8");
        } catch (IOException ex) {
            ex.printStackTrace();
            return null;
        }
        return json;
    }
1339644
def as_json(options = {})
      result = self.attributes
      result['organization'] = self.organization.try(:name)
      result['environments'] = environments.map { |e| e.try(:name) }
      result['versions'] = versions.map(&:version)
      result['versions_details'] = versions.map do |v|
        {
          :version => v.version,
          :published => v.created_at.to_s,
          :environments => v.environments.map { |e| e.name }
        }
      end

      if options && options[:environment].present?
        result['repositories'] = repos(options[:environment]).map(&:name)
      end

      result
    end
1172814
def getJson(cls, url, method='GET', headers={}, data=None, socket=None, timeout=120):
        
        if not 'Content-Type' in headers:
            headers['Content-Type'] = ['application/json']

        body = yield cls().getBody(url, method, headers, data, socket, timeout)

        defer.returnValue(json.loads(body))
173407
def json_data(self):
        """"""
        return {
            "info_in_id": self.info_in_id,
            "info_out_id": self.info_out_id,
            "node_id": self.node_id,
            "network_id": self.network_id,
        }
1188430
def get_content_json(request):
    """"""
    result = _get_content_json()

    resp = request.response
    resp.status = "200 OK"
    resp.content_type = 'application/json'
    resp.body = json.dumps(result)
    return result, resp
700570
def json(self):
        

        if self.fresh():
            return self.__cached_json
        # noinspection PyAttributeOutsideInit
        self.__last_read_time = time.time()
        self.__cached_json = self._router.get_instance(org_id=self.organizationId, instance_id=self.instanceId).json()

        return self.__cached_json
948664
def download(dataset, node, entityids, products, api_key=None):
    

    payload = {
        "datasetName": dataset,
        "node": node,
        "apiKey": api_key,
        "entityIds": entityids,
        "products": products
    }

    return json.dumps(payload)
319449
def load_json(self, json):
        """"""
        for key in json:
            if key == "wandb_version":
                continue
            self._items[key] = json[key].get('value')
            self._descriptions[key] = json[key].get('desc')
1304887
function downloadNames(src, name, callback) {
    async.waterfall([
        function (callback) {
            request.get({
                url: src
            }, callback);
        },
        function (res, html, callback) {
            var $ = cheerio.load(html);
            callback(null, $);
        },
        function ($, callback) {
            var table = $('#mw-pages').find('.mw-content-ltr table');
            var data = table.find('ul li').toArray()
                .map(function (li) {
                    var a = $(li).find('a');
                    return a.attr('title');
                })
                .filter(function (name) {
                    return !!name;
                });
            callback(null, data);
        },
        function (data, callback) {
            var keys = [name];
            h.saveData(dataDir, keys, {
                keys: keys,
                values: data.map(function (data) {
                    return [data];
                })
            }, callback);
        }
    ], callback)
}
1124026
function getJsonResource(url) {

    var protocol = url.match(/^(.*?):/)
    protocol = (protocol && protocol[1]) || 'file'

    const defaultLoader = defaultOptions.loaders[protocol]
    const loader = options.loaders[protocol]

    return Promise.resolve(cache[url])
    .then(cached => {
      if(cached) {
        return cached
      } else {
        return loader(url, defaultOptions.loaders)
          .then(json => cache[url] = {raw: json, parsed: Array.isArray(json) ? [] : {} })
      }
    })
  }
1139487
def get_json(identifier, namespace='cid', domain='compound', operation=None, searchtype=None, **kwargs):
    """"""
    try:
        return json.loads(get(identifier, namespace, domain, operation, 'JSON', searchtype, **kwargs).decode())
    except NotFoundError as e:
        log.info(e)
        return None
416243
def to_json(self):
        

        result = super(SpaceMembership, self).to_json()
        result.update({
            'admin': self.admin,
            'roles': self.roles
        })
        return result
1010381
function json (opts) {
  return {
    ...opts,
    headers: {
      ...opts.headers,
      'content-type': 'application/json'
    },
    body: JSON.stringify(opts.body)
  }
}
33046
def as_json(_options = {})
      {
        resource_owner_id: resource_owner_id,
        scope: scopes,
        expires_in: expires_in_seconds,
        application: { uid: application.try(:uid) },
        created_at: created_at.to_i,
      }
    end
912426
function downloadArchive(id, call, options, done)
	{
		grunt.log.write('Downloading '.gray + id.yellow + ' ... '.gray);

		request(call, function(err, response, body)
		{
			if (err) return done(err);

			var result = JSON.parse(body);

			if (!result.success) 
			{
				return done(result.error + ' with game "' + id + '"');
			}

			if (options.json)
			{
				grunt.log.write('Writing json ... '.gray);

				var writeStream = fs.createWriteStream(path.join(options.dest, id + '.json'));
				writeStream.write(JSON.stringify(result.data, null, options.debug ? "\t":""));
				writeStream.end();
			}

			grunt.log.write('Installing ... '.gray);

			this.get(result.data.url).run(function(err, files)
			{
				if (err) 
				{
					return done('Unable to download archive for game "' + id + '"');
				}
				grunt.log.writeln('Done.'.green);
				done(null, files);
			});
		}
		.bind(this));
	}
1095955
def read_json(self):
        
        with reading_ancillary_files(self):
            metadata = super(ImpactLayerMetadata, self).read_json()
            if 'provenance' in metadata:
                for provenance_step in metadata['provenance']:
                    try:
                        title = provenance_step['title']
                        if 'IF Provenance' in title:
                            self.append_if_provenance_step(
                                provenance_step['title'],
                                provenance_step['description'],
                                provenance_step['time'],
                                provenance_step['data']
                            )
                        else:
                            self.append_provenance_step(
                                provenance_step['title'],
                                provenance_step['description'],
                                provenance_step['time'],
                            )
                    except KeyError:
                        # we want to get as much as we can without raising
                        # errors
                        pass
            if 'summary_data' in metadata:
                self.summary_data = metadata['summary_data']

        return metadata