OSI Approved license.
348634
def licenses(self):
        """"""
        return {self._acronym_lic(l): l for l in self.resp_text.split('\n')
                if l.startswith(self.prefix_lic)}
738013
private function _sync_addon_license( $addon_id, $background ) {
            $this->_logger->entrance();

            if ( $this->is_addon_activated( $addon_id ) ) {
                // If already installed, use add-on sync.
                $fs_addon = self::get_instance_by_id( $addon_id );
                $fs_addon->_sync_license( $background );

                return;
            }

            // Validate add-on exists.
            $addon = $this->get_addon( $addon_id );

            if ( ! is_object( $addon ) ) {
                return;
            }

            // Add add-on into account add-ons.
            $account_addons = $this->get_account_addons();
            if ( ! is_array( $account_addons ) ) {
                $account_addons = array();
            }
            $account_addons[] = $addon->id;
            $account_addons   = array_unique( $account_addons );
            $this->_store_account_addons( $account_addons );

            // Load add-on licenses.
            $licenses = $this->_fetch_licenses( $addon->id );

            // Sync add-on licenses.
            if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) {
                $this->_update_licenses( $licenses, $addon->id );

                if ( ! $this->is_addon_installed( $addon->id ) && FS_License_Manager::has_premium_license( $licenses ) ) {
                    $plans_result = $this->get_api_site_or_plugin_scope()->get( $this->add_show_pending( "/addons/{$addon_id}/plans.json" ) );

                    if ( ! isset( $plans_result->error ) ) {
                        $plans = array();
                        foreach ( $plans_result->plans as $plan ) {
                            $plans[] = new FS_Plugin_Plan( $plan );
                        }

                        $this->_admin_notices->add_sticky(
                            sprintf(
                                ( FS_Plan_Manager::instance()->has_free_plan( $plans ) ?
                                    $this->get_text_inline( 'Your %s Add-on plan was successfully upgraded.', 'addon-successfully-upgraded-message' ) :
                                    /* translators: %s:product name, e.g. Facebook add-on was successfully... */
                                    $this->get_text_inline( '%s Add-on was successfully purchased.', 'addon-successfully-purchased-message' ) ),
                                $addon->title
                            ) . ' ' . $this->get_latest_download_link(
                                $this->get_text_inline( 'Download the latest version', 'download-latest-version' ),
                                $addon_id
                            ),
                            'addon_plan_upgraded_' . $addon->slug,
                            $this->get_text_x_inline( 'Yee-haw', 'interjection expressing joy or exuberance', 'yee-haw' ) . '!'
                        );
                    }
                }
            }
        }
1312713
def generate_license(args):
    '''
    
    '''

    with open(cwd + licenses_loc + args[2]) as f:
        license = f.read()

    license = license.format(name=args[0],
                             email=args[1],
                             license=args[2],
                             project=args[3],
                             year=args[5])

    with open('LICENSE' + args[4], 'w') as f:
        f.write(license)
        print('licenser: license file added to current directory')
766558
def save_license(license_code):
  
  desc = _get_license_description(license_code)
  fname = "LICENSE"
  if sys.platform == "win32":
    fname += ".txt"  # Windows and file exts
  with open(os.path.join(os.getcwd(), fname), "w") as afile:
    afile.write(desc)
468703
def can_approve(self, user, **data):
        
        service_id = data.get('service_id', self.service_id)

        try:
            service = yield Service.get(service_id)

            is_repo_admin = user.is_org_admin(service.organisation_id)

            is_reseller_preverifying = user.is_reseller() and data.get('pre_verified', False)

            raise Return(is_repo_admin or is_reseller_preverifying)
        except couch.NotFound:
            pass

        raise Return(False)
1222529
def activate_license(self, key):
        
        root = self._create_dynamic_xml('LICENSE', 'RIB_INFO', 'write')
        element = root.find('LOGIN/RIB_INFO/LICENSE')
        etree.SubElement(element, 'ACTIVATE', KEY=key)
        d = self._request_ilo(root)
        self._parse_output(d)
593755
def licenses(family_directory):
  """"""
  found = []
  search_paths = [family_directory]
  gitroot = git_rootdir(family_directory)
  if gitroot and gitroot not in search_paths:
    search_paths.append(gitroot)

  for directory in search_paths:
    if directory:
      for license in ['OFL.txt', 'LICENSE.txt']:
        license_path = os.path.join(directory, license)
        if os.path.exists(license_path):
          found.append(license_path)
  return found
315179
def get_license_manager(service_instance):
    '''
    
    '''

    log.debug('Retrieving license manager')
    try:
        lic_manager = service_instance.content.licenseManager
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{0}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
    return lic_manager
519622
function (options, callback) {
  var licenseSrc = path.join(options.src, 'LICENSE')
  try {
    fs.accessSync(licenseSrc)
  } catch (err) {
    try {
      licenseSrc = path.join(options.src, 'LICENSE.txt')
      fs.accessSync(licenseSrc)
    } catch (err) {
      licenseSrc = path.join(options.src, 'LICENSE.md')
      fs.accessSync(licenseSrc)
    }
  }
  options.logger('Reading license file from ' + licenseSrc)

  fs.readFile(licenseSrc, callback)
}
849807
def select_licence(default_licence = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],
                       _options = {})
      list_license = FalkorLib::Config::Bootstrap::DEFAULTS[:licenses].keys
      idx = list_license.index(default_licence) unless default_licence.nil?
      select_from(list_license,
                  'Select the license index for this project:',
                  (idx.nil?) ? 1 : idx + 1)
      #licence
    end
408171
public function product_valid() {
		if ( false !== ( $license = get_transient( $this->product->get_key() . '_license_data' ) ) ) {
			return;
		}
		$license = $this->check_license();
		set_transient( $this->product->get_key() . '_license_data', $license, 12 * HOUR_IN_SECONDS );
		update_option( $this->product->get_key() . '_license_data', $license );
	}
956101
def licenses(
        self, token: dict = None, owner_id: str = None, prot: str = "https"
    ) -> dict:
        
        # handling request parameters
        payload = {"gid": owner_id}

        # search request
        licenses_url = "{}://v1.{}.isogeo.com/groups/{}/licenses".format(
            prot, self.api_url, owner_id
        )
        licenses_req = self.get(
            licenses_url,
            headers=self.header,
            params=payload,
            proxies=self.proxies,
            verify=self.ssl,
        )

        # checking response
        req_check = checker.check_api_response(licenses_req)
        if isinstance(req_check, tuple):
            return req_check

        # end of method
        return licenses_req.json()
1038773
def approve(self, peer_jid):
        
        self.roster.approve(aioxmpp.JID.fromstr(peer_jid).bare())
1049867
private boolean verifySignature(X509Certificate cert)
        throws CertPathValidatorException {

        try {
            Signature respSignature = Signature.getInstance(sigAlgId.getName());
            respSignature.initVerify(cert.getPublicKey());
            respSignature.update(tbsResponseData);

            if (respSignature.verify(signature)) {
                if (debug != null) {
                    debug.println("Verified signature of OCSP Response");
                }
                return true;

            } else {
                if (debug != null) {
                    debug.println(
                        "Error verifying signature of OCSP Response");
                }
                return false;
            }
        } catch (InvalidKeyException | NoSuchAlgorithmException |
                 SignatureException e)
        {
            throw new CertPathValidatorException(e);
        }
    }
1335950
def get_license(id):
    
    response = utils.checked_api_call(
        pnc_api.licenses, 'get_specific', id= id)
    if response:
        return utils.format_json(response.content)
239546
public static void openLicenses(Context ctx, @XmlRes int configResId){
        openLicenses(ctx, configResId, ctx.getString(R.string.activity_license_label));
    }
388027
def cli(ctx, name, dname, license_key, ips_version, force, enable, ssl, spdy, gzip, cache, install, dev):
    
    assert isinstance(ctx, Context)
    login_session = ctx.get_login()
    log = logging.getLogger('ipsv.new')
    ctx.cache = cache

    # Prompt for our desired license
    def get_license():
        """
        Prompt the user for a license selection
        @rtype: ips_vagrant.scraper.licenses.LicenseMeta
        """
        licenses = Licenses(login_session).get()
        user_license = license_key or ctx.config.get('User', 'LicenseKey')

        # If we already have a license key saved, skip the prompt and use it instead
        if user_license:
            licenses = {license.license_key: license for license in licenses}
            if user_license in licenses:
                return licenses[user_license]

        # Ask the user to select a license key
        opt = choice([
            (key, '{u} ({k})'.format(u=license.community_url, k=license.license_key))
            for key, license in enumerate(licenses)
        ], 1, 'Which license key would you like to use?')
        license = licenses[opt]

        # Should we save this license?
        if click.confirm('Would you like to save and use this license for future requests?', True):
            ctx.log.debug('Saving license key {k}'.format(k=license.license_key))
            ctx.config.set('User', 'LicenseKey', license.license_key)
            with open(ctx.config_path, 'wb') as configfile:
                ctx.config.write(configfile)

        return license

    # Get the latest IPS release
    lmeta = get_license()
    p = Echo('Fetching IPS version information...')
    ips = IpsManager(ctx, lmeta)
    p.done()
    if ips_version:
        if ips_version == 'latest_dev':
            v = ips.dev_version
            if not v:
                click.secho('There is no IPS development release available for download', err=True, fg='red', bold=True)
                raise Exception('There is no IPS development release available for download')
            p = Echo('Downloading IPS development release {vs}...'.format(vs=v.version.vstring))
        else:
            ips_version = Version(ips_version)
            v = ips.versions[ips_version.vtuple]
            p = Echo('Fetching IPS version {iv}'.format(iv=ips_version.vstring))
    else:
        v = ips.latest
        p = Echo('Downloading IPS release {vs}...'.format(vs=v.version.vstring))
    filename = ips.get(v, cache)
    p.done()

    # Parse the specific domain and make sure it's valid
    log.debug('Parsing domain name: %s', dname)
    dname = domain_parse(dname)
    if ssl is None:
        ssl = dname.scheme == 'https'
    log.debug('Domain name parsed: %s', dname)

    domain = Domain.get_or_create(dname)

    # Make sure this site does not already exist
    p = Echo('Constructing site data...')
    site = ctx.db.query(Site).filter(Site.domain == domain).filter(collate(Site.name, 'NOCASE') == name).count()
    if site:
        p.done(p.FAIL)
        log.error('Site already exists')
        click.secho('An installation named "{s}" has already been created for the domain {d}'
                    .format(s=name, d=dname.hostname),
                    err=True, fg='red', bold=True)
        raise click.Abort

    # Create the site database entry
    site = Site(name=name, domain=domain, license_key=lmeta.license_key, version=v.version.vstring, ssl=ssl, spdy=spdy,
                gzip=gzip, enabled=enable, in_dev=dev)

    status = p.OK
    if os.path.exists(site.root):
        if not force:
            p.done(p.FAIL)
            click.secho("Installation path already exists and --force was not passed:\n{p}".format(p=site.root),
                        err=True, fg='red', bold=True)
            log.info('Aborting installation, path already exists: {p}'.format(p=site.root))
            raise click.Abort

        log.warn('Overwriting existing installation path: {p}'.format(p=site.root))
        status = p.WARN

    ctx.db.add(site)
    ctx.db.commit()
    p.done(status)

    # Construct the HTTP path
    p = Echo('Constructing paths and configuration files...')
    site.write_nginx_config()
    p.done()

    # Generate SSL certificates if enabled
    if ssl:
        p = Echo('Generating SSL certificate...')
        ssl_path = os.path.join(ctx.config.get('Paths', 'NginxSSL'), domain.name)
        if not os.path.exists(ssl_path):
            log.debug('Creating new SSL path: %s', ssl_path)
            os.makedirs(ssl_path, 0o755)

        sc = CertificateFactory(site).get()
        site.ssl_key = sc.key
        site.ssl_certificate = sc.certificate

        with open(os.path.join(ssl_path, '{s}.key'.format(s=site.slug)), 'w') as f:
            f.write(sc.key)
        with open(os.path.join(ssl_path, '{s}.pem').format(s=site.slug), 'w') as f:
            f.write(sc.certificate)
        p.done()

    # Create a symlink if this site is being enabled
    if site.enabled:
        site.enable(force)

        # Restart Nginx
        p = Echo('Restarting web server...')
        FNULL = open(os.devnull, 'w')
        subprocess.check_call(['service', 'nginx', 'restart'], stdout=FNULL, stderr=subprocess.STDOUT)
        p.done()

    # Extract IPS setup files
    p = Echo('Extracting setup files to tmp...')
    tmpdir = tempfile.mkdtemp('ips')
    setup_zip = os.path.join(tmpdir, 'setup.zip')
    setup_dir = os.path.join(tmpdir, 'setup')
    os.mkdir(setup_dir)

    log.info('Extracting setup files')
    shutil.copyfile(filename, setup_zip)
    with zipfile.ZipFile(setup_zip) as z:
        namelist = z.namelist()
        if re.match(r'^ips_\w{5}\/?$', namelist[0]):
            log.debug('Setup directory matched: %s', namelist[0])
        else:
            log.error('No setup directory matched, unable to continue')
            raise Exception('Unrecognized setup file format, aborting')

        z.extractall(setup_dir)
        log.debug('Setup files extracted to: %s', setup_dir)
        p.done()
        p = MarkerProgressBar('Copying setup files...')
        setup_tmpdir = os.path.join(setup_dir, namelist[0])
        for dirname, dirnames, filenames in p(os.walk(setup_tmpdir)):
            for filepath in dirnames:
                site_path = os.path.join(site.root, dirname.replace(setup_tmpdir, ''), filepath)
                if not os.path.exists(site_path):
                    log.debug('Creating directory: %s', site_path)
                    os.mkdir(site_path, 0o755)

            for filepath in filenames:
                tmp_path = os.path.join(dirname, filepath)
                site_path = os.path.join(site.root, dirname.replace(setup_tmpdir, ''), filepath)
                shutil.copy(tmp_path, site_path)

        log.info('Setup files copied to: %s', site.root)
    shutil.rmtree(tmpdir)

    # Apply proper permissions
    # p = MarkerProgressBar('Setting file permissions...')
    writeable_dirs = ['uploads', 'plugins', 'applications', 'datastore']
    
    for wdir in writeable_dirs:
        log.debug('Setting file permissions in %s', wdir)
        os.chmod(os.path.join(site.root, wdir), 0o777)
        p = MarkerProgressBar('Setting file permissions...', nl=False)
        for dirname, dirnames, filenames in p(os.walk(os.path.join(site.root, wdir))):
            for filename in filenames:
                os.chmod(os.path.join(dirname, filename), 0o666)

            for filename in dirnames:
                os.chmod(os.path.join(dirname, filename), 0o777)
    Echo('Setting file permissions...').done()

    shutil.move(os.path.join(site.root, 'conf_global.dist.php'), os.path.join(site.root, 'conf_global.php'))
    os.chmod(os.path.join(site.root, 'conf_global.php'), 0o777)

    # Run the installation
    if install:
        p = Echo('Initializing installer...')
        i = installer(v.version, ctx, site, force)
        p.done()
        i.start()
    else:
        db_info = None
        if click.confirm('Would you like to create the database for this installation now?', default=True):
            db_info = create_database(site)

        click.echo('------')

        if db_info:
            db_name, db_user, db_pass = db_info

            log.debug('MySQL Database Name: %s', db_name)
            log.debug('MySQL Database User: %s', db_user)
            log.debug('MySQL Database Password: %s', db_pass)

            click.secho('MySQL Database Name: {dbn}'.format(dbn=db_name), bold=True)
            click.secho('MySQL Database User: {dbu}'.format(dbu=db_user), bold=True)
            click.secho('MySQL Database Password: {dbp}'.format(dbp=db_pass), bold=True)

        click.secho('IPS is now ready to be installed. To proceed with the installation, follow the link below',
                    fg='yellow', bold=True)
        click.echo('{schema}://{host}'.format(schema='https' if site.ssl else 'http', host=site.domain.name))