Create a new License
179461
def create_license(**kwargs):
    
    License = create_license_object(**kwargs)
    response = utils.checked_api_call(pnc_api.licenses, 'create_new', body=License)
    if response:
        return utils.format_json(response.content)
388749
private function setLicense() {
		if ( ! $this->getApiKey() ) {
			$license = 'Missing Connect Key';
		} else if ( ! ( $license = $this->getTransient() ) || ! $this->isVersionValid( $license ) ) {
			delete_site_transient( $this->getKey() );
			$license = $this->getRemoteLicense();
		}

		return $this->license = $license;
	}
600172
def _get_licences():
  
  licenses = _LICENSES

  for license in licenses:
    print("{license_name} [{license_code}]".format(
          license_name=licenses[license], license_code=license))
218157
def create(self, product_id, period, csr, software_id, organization_handle,
               approver_email=None, signature_hash_algorithm=None, domain_validation_methods=None,
               hostnames=None, technical_handle=None):
        """"""

        response = self.request(E.createSslCertRequest(
            E.productId(product_id),
            E.period(period),
            E.csr(csr),
            E.softwareId(software_id),
            E.organizationHandle(organization_handle),
            OE('approverEmail', approver_email),
            OE('signatureHashAlgorithm', signature_hash_algorithm),
            OE('domainValidationMethods', domain_validation_methods, transform=_domain_validation_methods),
            OE('hostNames', hostnames, transform=_simple_array),
            OE('technicalHandle', technical_handle),
        ))

        return int(response.data.id)
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)
1219814
static public function install_licenses() {
        $active_licenses = array();

        $license = new stdClass();

        $license->shortname = 'unknown';
        $license->fullname = 'Unknown license';
        $license->source = '';
        $license->enabled = 1;
        $license->version = '2010033100';
        $active_licenses[] = $license->shortname;
        self::add($license);

        $license->shortname = 'allrightsreserved';
        $license->fullname = 'All rights reserved';
        $license->source = 'http://en.wikipedia.org/wiki/All_rights_reserved';
        $license->enabled = 1;
        $license->version = '2010033100';
        $active_licenses[] = $license->shortname;
        self::add($license);

        $license->shortname = 'public';
        $license->fullname = 'Public Domain';
        $license->source = 'http://creativecommons.org/licenses/publicdomain/';
        $license->enabled = 1;
        $license->version = '2010033100';
        $active_licenses[] = $license->shortname;
        self::add($license);

        $license->shortname = 'cc';
        $license->fullname = 'Creative Commons';
        $license->source = 'http://creativecommons.org/licenses/by/3.0/';
        $license->enabled = 1;
        $license->version = '2010033100';
        $active_licenses[] = $license->shortname;
        self::add($license);

        $license->shortname = 'cc-nd';
        $license->fullname = 'Creative Commons - NoDerivs';
        $license->source = 'http://creativecommons.org/licenses/by-nd/3.0/';
        $license->enabled = 1;
        $license->version = '2010033100';
        $active_licenses[] = $license->shortname;
        self::add($license);

        $license->shortname = 'cc-nc-nd';
        $license->fullname = 'Creative Commons - No Commercial NoDerivs';
        $license->source = 'http://creativecommons.org/licenses/by-nc-nd/3.0/';
        $license->enabled = 1;
        $license->version = '2010033100';
        $active_licenses[] = $license->shortname;
        self::add($license);

        $license->shortname = 'cc-nc';
        $license->fullname = 'Creative Commons - No Commercial';
        $license->source = 'http://creativecommons.org/licenses/by-nc/3.0/';
        $license->enabled = 1;
        $license->version = '2013051500';
        $active_licenses[] = $license->shortname;
        self::add($license);

        $license->shortname = 'cc-nc-sa';
        $license->fullname = 'Creative Commons - No Commercial ShareAlike';
        $license->source = 'http://creativecommons.org/licenses/by-nc-sa/3.0/';
        $license->enabled = 1;
        $license->version = '2010033100';
        $active_licenses[] = $license->shortname;
        self::add($license);

        $license->shortname = 'cc-sa';
        $license->fullname = 'Creative Commons - ShareAlike';
        $license->source = 'http://creativecommons.org/licenses/by-sa/3.0/';
        $license->enabled = 1;
        $license->version = '2010033100';
        $active_licenses[] = $license->shortname;
        self::add($license);

        set_config('licenses', implode(',', $active_licenses));
    }
1250968
function activate_license() {
		// listen for our activate button to be clicked.
		if ( ! isset( $_POST[ $this->product->get_key() . '_btn_trigger' ] ) ) {
			return;
		}
		$status = $this->get_license_status();
		// retrieve the license from the database.
		$license    = $_POST[ $this->product->get_key() . '_license' ];
		$api_params = array(
			'license'   => $license,
			'item_name' => rawurlencode( $this->product->get_name() ),
			'url'       => rawurlencode( home_url() ),
		);
		if ( 'valid' != $status ) {
			// data to send in our API request.
			$api_params['edd_action'] = 'activate_license';
		} else {
			$api_params['edd_action'] = 'deactivate_license';
		}
		// Call the custom API.
		$response = wp_remote_get( add_query_arg( $api_params, $this->get_api_url() ) );
		// make sure the response came back okay.
		if ( is_wp_error( $response ) ) {
			$license_data          = new \stdClass();
			$license_data->license = ( 'valid' != $status ) ? 'valid' : 'invalid';

		} else {
			$license_data = json_decode( wp_remote_retrieve_body( $response ) );
			if ( ! is_object( $license_data ) ) {
				$license_data          = new \stdClass();
				$license_data->license = ( 'valid' != $status ) ? 'valid' : 'invalid';
			}
			if ( ! isset( $license_data->license ) ) {
				$license_data->license = 'invalid';
			}
		}
		if ( ! isset( $license_data->key ) ) {
			$license_data->key = $license;
		}
		if ( 'valid' == $license_data->license ) {
			$this->reset_failed_checks();
		}

		if ( isset( $license_data->plan ) ) {
			update_option( $this->product->get_key() . '_license_plan', $license_data->plan );
		}

		update_option( $this->product->get_key() . '_license_data', $license_data );
		set_transient( $this->product->get_key() . '_license_data', $license_data, 12 * HOUR_IN_SECONDS );

	}
839559
function copyLICENSE(pkg) {
  fs.copy(__dirname + '/../LICENSE', __dirname + '/../packages/' + pkg + '/LICENSE', err => {
    errorOnFail(err)
    console.log('LICENSE was successfully copied into the ' + pkg + ' package.')
  })
}
1248530
def license2marc(self, key, value):
    """"""
    return {
        'a': value.get('license'),
        'b': value.get('imposing'),
        'u': value.get('url'),
        '3': value.get('material'),
    }
271367
def get_license(self):
        

        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/license"
        )
        return github.ContentFile.ContentFile(self._requester, headers, data, completed=True)
1034458
function _add_license_action_link() {
            $this->_logger->entrance();

            if ( ! self::is_ajax() ) {
                // Inject license activation dialog UI and client side code.
                add_action( 'admin_footer', array( &$this, '_add_license_activation_dialog_box' ) );
            }

            $link_text = $this->is_free_plan() ?
                $this->get_text_inline( 'Activate License', 'activate-license' ) :
                $this->get_text_inline( 'Change License', 'change-license' );

            $this->add_plugin_action_link(
                $link_text,
                '#',
                false,
                11,
                ( 'activate-license ' . $this->get_unique_affix() )
            );
        }
1354026
def run(self, args):
        
        jlink = self.create_jlink(args)
        if args.list:
            print('Built-in Licenses: %s' % ', '.join(jlink.licenses.split(',')))
            print('Custom Licenses: %s' % ', '.join(jlink.custom_licenses.split(',')))
        elif args.add is not None:
            if jlink.add_license(args.add):
                print('Successfully added license.')
            else:
                print('License already exists.')
        elif args.erase:
            if jlink.erase_licenses():
                print('Successfully erased all custom licenses.')
            else:
                print('Failed to erase custom licenses.')
1304180
public License<ConnectorDescriptor> getOrCreateLicense()
   {
      Node node = model.getOrCreate("license");
      License<ConnectorDescriptor> license = new LicenseImpl<ConnectorDescriptor>(this, "license", model, node);
      return license;
   }
330997
def clear_license(self):
        
        if (self.get_license_metadata().is_read_only() or
                self.get_license_metadata().is_required()):
            raise errors.NoAccess()
        self._my_map['license'] = dict(self._license_default)
1068932
@Override
    protected LicenseProvider createLicenseProvider(String licenseAgreementPrefix, String licenseInformationPrefix,
                                                    String subsystemLicenseType) {
        String featureLicenseAgreementPrefix = this.featureName + "/" + licenseAgreementPrefix;
        String featureLicenseInformationPrefix = licenseInformationPrefix == null ? null : this.featureName + "/" + licenseInformationPrefix;
        if (featureLicenseInformationPrefix == null) {
            LicenseProvider lp = ZipLicenseProvider.createInstance(zip, featureLicenseAgreementPrefix);
            if (lp != null)
                return lp;
        } else {
            wlp.lib.extract.ReturnCode licenseReturnCode = ZipLicenseProvider.buildInstance(zip, featureLicenseAgreementPrefix,
                                                                                            featureLicenseInformationPrefix);
            if (licenseReturnCode == wlp.lib.extract.ReturnCode.OK) {
                // Everything is set up ok so carry on
                return ZipLicenseProvider.getInstance();
            }
        }
        // An error indicates that the IBM licenses could not be found so we can use the subsystem header
        if (subsystemLicenseType != null && subsystemLicenseType.length() > 0) {
            return new ThirdPartyLicenseProvider(featureDefinition.getFeatureName(), subsystemLicenseType);
        }
        return null;
    }
733485
def license(dir = Dir.pwd,
                license = FalkorLib::Config::Bootstrap::DEFAULTS[:metadata][:license],
                authors = '',
                options = {
                  :filename     => 'LICENSE'
                })
      return if ((license.empty?) or (license == 'none') or (license =~ /^CC/))
      return unless FalkorLib::Config::Bootstrap::DEFAULTS[:licenses].keys.include?( license )
      info "Generate the #{license} licence file"
      path = normalized_path(dir)
      use_git = FalkorLib::Git.init?(path)
      rootdir = (use_git) ? FalkorLib::Git.rootdir(path) : path
      Dir.chdir( rootdir ) do
        run %( licgen #{license.downcase} #{authors} )
        run %( mv LICENSE #{options[:filename]} ) if( options[:filename] and options[:filename] != 'LICENSE')
      end
    end
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)