Returns the support_package product.
194636
def get_support_package(tile):
    """"""

    packages = tile.find_products('support_package')
    if len(packages) == 0:
        return None
    elif len(packages) == 1:
        return packages[0]

    raise BuildError("Tile declared multiple support packages, only one is supported", packages=packages)
391936
def items(self) -> Tuple[Tuple[str, "Package"], ...]:  # type: ignore
        
        item_dict = {
            name: self.build_dependencies.get(name) for name in self.build_dependencies
        }
        return tuple(item_dict.items())
175121
def get_product(self, standard, key):
        
        data = {
            'keystandard': standard,
            'keystr': key,
        }
        return self._post('product/get', data=data)
241786
def package(self):
        
        if self.method == 'buildNotification':
            return self.params[1]['name']
        if self.method in ('createImage', 'image', 'livecd'):
            return self.params[0]
        if self.method == 'indirectionimage':
            return self.params[0]['name']
        # params[0] is the source URL for these tasks:
        if self.method not in ('build', 'buildArch', 'buildContainer',
                               'buildMaven', 'buildSRPMFromSCM', 'maven'):
            return None
        # (I wish there was a better way to do this.)
        source = self.params[0]
        o = urlparse(source)
        # build tasks can load an SRPM from a "cli-build" tmpdir:
        if source.endswith('.src.rpm'):
            srpm = os.path.basename(source)
            (name, version, release) = srpm.rsplit('-', 2)
            # Note we're throwing away version and release here. They could be
            # useful eventually, maybe in a "Package" class.
            return name
        # or an allowed SCM:
        elif o.scheme:
            package = os.path.basename(o.path)
            if package.endswith('.git'):
                package = package[:-4]
            if self.method == 'buildContainer':
                package += '-container'
            return package
        raise ValueError('could not parse source "%s"' % source)
1057097
def to_package(self, repo_url):
        """"""
        return Package(name=self.name, url=repo_url + self.name)
99409
def get_product_string(self):
        
        self._check_device_status()
        str_p = ffi.new("wchar_t[]", 255)
        rv = hidapi.hid_get_product_string(self._device, str_p, 255)
        if rv == -1:
            raise IOError("Failed to read product string from HID device: {0}"
                          .format(self._get_last_error_string()))
        return ffi.string(str_p)
1212267
function get_product_from_api() {
		if ( false === ( $products = get_transient( 'themeisle_sdk_products' ) ) ) {
			$products                = array();
			$all_themes              = $this->get_themes_from_wporg( 'themeisle' );
			$all_plugins             = $this->get_plugins_from_wporg( 'themeisle' );
			static $allowed_products = [
				'hestia'              => true,
				'neve'                => true,
				'visualizer'          => true,
				'feedzy-rss-feeds'    => true,
				'wp-product-review'   => true,
				'otter-blocks'        => true,
				'themeisle-companion' => true,
			];
			foreach ( $all_themes as $theme ) {
				if ( $theme->active_installs < 4999 ) {
					continue;
				}
				if ( ! isset( $allowed_products[ $theme->slug ] ) ) {
					continue;
				}
				$products[] = array(
					'name'     => $theme->name,
					'type'     => 'theme',
					'slug'     => $theme->slug,
					'installs' => $theme->active_installs,
				);
			}
			foreach ( $all_plugins as $plugin ) {
				if ( $plugin->active_installs < 4999 ) {
					continue;
				}
				if ( ! isset( $allowed_products[ $plugin->slug ] ) ) {
					continue;
				}
				$products[] = array(
					'name'     => $plugin->name,
					'type'     => 'plugin',
					'slug'     => $plugin->slug,
					'installs' => $plugin->active_installs,
				);
			}
			set_transient( 'themeisle_sdk_products', $products, 6 * HOUR_IN_SECONDS );
		}

		return $products;
	}
1159133
def get_allproductandrelease(self):
        
        logger.info("Get all ProductAndReleases")
        response = self.get(PRODUCTANDRELEASE_RESOURCE_ROOT_URI, headers=self.headers)
        sr_response = response_body_to_dict(response, self.headers[HEADER_CONTENT_TYPE],
                                          xml_root_element_name=PRODUCTANDRELEASE_BODY_ROOT)
        return sr_response, response
541414
def output_package(dist):
        """"""
        if dist_is_editable(dist):
            return '%s (%s, %s)' % (
                dist.project_name,
                dist.version,
                dist.location,
            )
        return '%s (%s)' % (dist.project_name, dist.version)
207904
def search_product(self, limit=100, offset=0, with_price=0, with_supported_software=0,
                       with_description=0):
        """"""

        response = self.request(E.searchProductSslCertRequest(
            E.limit(limit),
            E.offset(offset),
            E.withPrice(int(with_price)),
            E.withSupportedSoftware(int(with_supported_software)),
            E.withDescription(int(with_description)),
        ))
        return response.as_models(SSLProduct)
789485
def get_package(self):
        
        # get and validate package data
        package_data = self._get_data()
        package_data = package_schema.validate(package_data)

        # check compatibility with rez version
        if "requires_rez_version" in package_data:
            ver = package_data.pop("requires_rez_version")

            if _rez_Version < ver:
                raise PackageMetadataError(
                    "Failed reading package definition file: rez version >= %s "
                    "needed (current version is %s)" % (ver, _rez_Version))

        # create a 'memory' package repository containing just this package
        version_str = package_data.get("version") or "_NO_VERSION"
        repo_data = {self.name: {version_str: package_data}}
        repo = create_memory_package_repository(repo_data)

        # retrieve the package from the new repository
        family_resource = repo.get_package_family(self.name)
        it = repo.iter_packages(family_resource)
        package_resource = it.next()

        package = self.package_cls(package_resource)

        # revalidate the package for extra measure
        package.validate_data()
        return package
574316
def _get_packages(add_pckg):
        """

        # Mandatory packages
        pckgs = [numpy, scipy, empymod]

        # Optional packages
        for module in [IPython, numexpr, matplotlib]:
            if module:
                pckgs += [module]

        # Cast and add add_pckg
        if add_pckg is not None:

            # Cast add_pckg
            if isinstance(add_pckg, tuple):
                add_pckg = list(add_pckg)

            if not isinstance(add_pckg, list):
                add_pckg = [add_pckg, ]

            # Add add_pckg
            pckgs += add_pckg

        return pckgs
329566
def get_package_info(package):
    """"""
    url = 'https://pypi.python.org/pypi/{}/json'.format(package)
    r = requests.get(url)
    r.raise_for_status()
    return r.json()
711613
def product(self, *products):
        
        """
        for product in products:
            self._product.append(product)
        return self
129146
def _get_package(auth, owner, package_name):
    
    package = (
        Package.query
        .filter_by(owner=owner, name=package_name)
        .join(Package.access)
        .filter(_access_filter(auth))
        .one_or_none()
    )
    if package is None:
        raise PackageNotFoundException(owner, package_name, auth.is_logged_in)
    return package
917447
def package(self, login, package_name):
        '''
        
        '''
        url = '%s/package/%s/%s' % (self.domain, login, package_name)
        res = self.session.get(url)
        self._check_response(res)
        return res.json()
1222420
def get_package(repo_url, pkg_name, timeout=1):
    """"""
    url = repo_url + "/packages/" + pkg_name
    headers = {'accept': 'application/json'}
    resp = requests.get(url, headers=headers, timeout=timeout)
    if resp.status_code == 404:
        return None
    return resp.json()