Construct info about a project from artefact

		:param data:	golang-project-packages artefact
		:type  data:	json/dict
433411
def construct(self, data):
		
		occurrences = {}
		main_occurrences = {}

		# occurrences of devel packages
		for pkg in data["data"]["dependencies"]:
			package = pkg["package"]
			for item in pkg["dependencies"]:
				dep = item["name"]
				if package != ".":
					deps = map(lambda l: "%s/%s" % (package, l), item["location"])
				else:
					deps = item["location"]
				if dep not in occurrences:
					occurrences[dep] = deps
				else:
					occurrences[dep] = occurrences[dep] + deps

		self.occurrences = occurrences

		# occurrences of main packages
		for main in data["data"]["main"]:
			filename = main["filename"]
			for dep in main["dependencies"]:
				if dep not in main_occurrences:
					main_occurrences[dep] = [filename]
				else:
					main_occurrences[dep].append(filename)

		self.main_occurrences = main_occurrences
	
		# test directories
		self.test_directories = sorted(map(lambda l: l["test"], data["data"]["tests"]))

		# provided devel packages
		self.provided_packages = sorted(data["data"]["packages"])

		# imported paths in devel packages
		imported_packages = []
		imported_native_packages = []
		for path in occurrences:
			try:
				self.ipparser.parse(path)
			except ValueError:
				continue

			if self.ipparser.isNative():
				imported_native_packages.append(path)
			else:
				imported_packages.append(path)

		self.imported_packages = sorted(imported_packages)
		self.imported_native_packages = sorted(imported_native_packages)

		# main packages
		self.main_packages = map(lambda l: l["filename"], data["data"]["main"])
194691
def get_project_details(self, project):
        
        result = self.get_project(project.pid)
        if result is None:
            result = {}
        return result
1344228
def update_project(project, opts = {})
      data, _status_code, _headers = update_project_with_http_info(project, opts)
      return data
    end
1271744
def data_json(self, extra_context=None, publish=False):
        
        if not self.project.CREATE_JSON:
            # nothing to see here, but the right mimetype
            return jsonify()

        if not self.data:
            # this sets site.data by spreadsheet or gdoc
            self.get_context(publish)

        return jsonify(self.data)
871303
def json_data(self, instance, default=None):
        
        value = self.get(instance)

        out = []
        for rel in value:
            if rel.isBroken():
                logger.warn("Skipping broken relation {}".format(repr(rel)))
                continue
            obj = rel.to_object
            out.append(api.get_url_info(obj))
        return out
8843
def build_result_metadata(self, data=None, args=None):
        
        data = data if data else self._build_result_metainfo(args)
        if data.get("build_branch"):
            self.build_branch = data.get("build_branch")
        if data.get("buildcommit"):
            self.buildcommit = data.get("buildcommit")
        if data.get("build_git_url"):
            self.build_git_url = data.get("build_git_url")
        if data.get("build_url"):
            self.build_url = data.get("build_url")
        if data.get("campaign"):
            self.campaign = data.get("campaign")
        if data.get("job_id"):
            self.job_id = data.get("job_id")
        if data.get("toolchain"):
            self.toolchain = data.get("toolchain")
        if data.get("build_date"):
            self.build_date = data.get("build_date")
399372
def get_project_details(project):
    
    result = []
    for datastore in _get_datastores():
        value = datastore.get_project_details(project)
        value['datastore'] = datastore.config['DESCRIPTION']
        result.append(value)
    return result
535622
function(data) {

    // Get options
    var composeFiles = data.compose || {};
    var project = data.project || 'kalabox';

    // Create dir to store this stuff
    var tmpDir = path.join(kbox.util.disk.getTempDir(), project);
    fs.mkdirpSync(tmpDir);

    // Colllect our compose files
    var currentCompose = {};

    // Get our composed things
    _.forEach(composeFiles, function(file)  {
      _.extend(currentCompose, kbox.util.yaml.toJson(file));
    });

    // Build our default object
    var defaults = {};

    // Iterate through keys and add defaults
    _.forEach(_.keys(currentCompose), function(key) {
      defaults[key] = {
        environment: {
          'KALABOX': 'ON',
          'KALABOX_HOSTOS': process.platform
        },
        labels: {
          'io.kalabox.container': 'TRUE'
        }
      };
    });

    // Add in our compose file with the defaults
    if (!_.isEmpty(defaults)) {
      var fileName = [project, _.uniqueId()].join('-');
      var defaultComposeFile = path.join(tmpDir, fileName + '.yml');
      kbox.util.yaml.toYamlFile(defaults, defaultComposeFile);
      composeFiles.push(defaultComposeFile);
    }

    // Return our defaults
    return composeFiles;

  }
74088
function(data){
						var name = data.parameters.valueFor("name");
						if(!name){
							return;
						}
						var url = data.parameters.valueFor("url");
						if(!url){
							return;
						}
						var item = forceSingleItem(data.items);
						fileClient.getWorkspace(item.Location).then(function(workspace) {
							progress.progress(projectClient.createProject(workspace.ChildrenLocation, {Name: name, ContentLocation: url}), i18nUtil.formatMessage( messages["Creating project ${0}"], name)).then(function(project){
								dispatchNewProject(workspace, project);
							});
						});
					}
938659
def instantiate_from_data(self, object_data):
        
        if isinstance(object_data, dict) and 'name' in object_data:
            name = object_data['name']
            module = importlib.import_module(name)
            return self.resolve_and_call(module.create, extra_env=object_data)
        if isinstance(object_data, dict) and 'factory' in object_data:
            factory = object_data['factory']
            module = importlib.import_module(factory)
            params = self.resolve_parameters(module.create, extra_env=object_data)
            return GenericFactory(module.create, params)
        elif isinstance(object_data, dict):
            return {k: self.instantiate_from_data(v) for k, v in object_data.items()}
        elif isinstance(object_data, list):
            return [self.instantiate_from_data(x) for x in object_data]
        elif isinstance(object_data, Variable):
            return object_data.resolve(self.parameters)
        else:
            return object_data
234099
def __parse_json_data(self, data):
        
        if isinstance(data, dict) or isinstance(data, list):
            self._raw_data = data
            self._json_data = copy.deepcopy(self._raw_data)
        else:
            raise TypeError("Provided Data is not json")
1101601
def create_from_json(cls, json_data):
        
        block = Block()
        block_info = json_data["block_info"]
        block.block_id = block_info["block_id"]
        block.num_bins = block_info["num_bins"] if "num_bins" in block_info else None
        block.property_type = block_info["property_type"] if "property_type" in block_info else None
        block.meta = json_data["meta"] if "meta" in json_data else None

        block.component_results = _create_component_results(json_data, "block_info")

        return block
457848
def __read_api_project(self):
        

        file_name = join(self.app.static_folder, self.folder_path, 'api_project.json')

        with open(file_name, 'rt') as file:
            data = file.read()

        return json.loads(data)
1241544
def from_json(data):
        
        memfiles = InMemoryFiles()
        memfiles.files = json.loads(data)
        return memfiles
452303
def _build_from_geojson(self, src):
        
        geojson = json.loads(self.read(src))
        idx = index.Index()
        data_store = {}
        for i, feature in enumerate(geojson['features']):
            feature = self._build_obj(feature)
            idx.insert(i, feature['geometry'].bounds)
            data_store[i] = feature
        return data_store, idx
1254049
def corpus(project_id, name, opts = {})
      data, _status_code, _headers = corpus_with_http_info(project_id, name, opts)
      return data
    end
1163447
function getMaterialData (data, materialData) {
  materialData.color.set(data.color);
  materialData.emissive.set(data.emissive);
  materialData.emissiveIntensity = data.emissiveIntensity;
  materialData.fog = data.fog;
  materialData.metalness = data.metalness;
  materialData.roughness = data.roughness;
  materialData.wireframe = data.wireframe;
  materialData.wireframeLinewidth = data.wireframeLinewidth;

  if (data.normalMap) { materialData.normalScale = data.normalScale; }

  if (data.ambientOcclusionMap) {
    materialData.aoMapIntensity = data.ambientOcclusionMapIntensity;
  }

  if (data.displacementMap) {
    materialData.displacementScale = data.displacementScale;
    materialData.displacementBias = data.displacementBias;
  }

  return materialData;
}