License agreement page.
433700
public function licenseAgreementAction()
    {
        $this->title("License Agreement");

        // Get license
        $license = file_get_contents(dirname(dirname(__DIR__)) . '/COPYING');
        $this->set("license", $license);

        return $this->render("license_agreement.phtml");
    }
856845
def fix(license = '')
      xml = Nokogiri::XML(File.open(@path), &:noblanks)
      unless license.empty?
        xml.xpath('/comment()').remove
        xml.children.before(
          Nokogiri::XML::Comment.new(xml, "\n#{license.strip}\n")
        )
      end
      ideal = xml.to_xml(indent: 2)
      File.write(@path, ideal)
    end
757579
function _sync_licenses( $site_license_id = false, $blog_id = null ) {
            $this->_logger->entrance();

            $is_network_admin = fs_is_network_admin();

            if ( $is_network_admin && is_null( $blog_id ) ) {
                $all_licenses = self::get_all_licenses( $this->_module_id );
            } else {
                $all_licenses = $this->get_user_licenses( $this->_user->id );
            }

            $foreign_licenses = array(
                'ids'          => array(),
                'license_keys' => array()
            );

            $all_licenses_map = array();
            foreach ( $all_licenses as $license ) {
                $all_licenses_map[ $license->id ] = true;
                if ( $license->user_id == $this->_user->id || $license->id == $site_license_id ) {
                    continue;
                }

                $foreign_licenses['ids'][]          = $license->id;
                $foreign_licenses['license_keys'][] = $license->secret_key;
            }

            if ( empty( $foreign_licenses['ids'] ) ) {
                $foreign_licenses = array();
            }

            $licenses = $this->_fetch_licenses( false, $site_license_id, $foreign_licenses, $blog_id );

            if ( $this->is_array_instanceof( $licenses, 'FS_Plugin_License' ) ) {
                $licenses_map = array();
                foreach ( $licenses as $license ) {
                    $licenses_map[ $license->id ] = true;
                }

//                $license_ids_to_keep = $this->get_license_ids_associated_with_installs();
//                foreach ( $license_ids_to_keep as $license_id ) {
//                    if ( isset( $licenses_map[ $license_id ] ) ) {
//                        continue;
//                    }
//
//                    $missing_license = self::_get_license_by_id( $license_id, false );
//                    if ( is_object( $missing_license ) ) {
//                        $licenses[]                           = $missing_license;
//                        $licenses_map[ $missing_license->id ] = true;
//                    }
//                }

                $user_license_ids = $this->get_user_linked_license_ids( $this->_user->id );

                foreach ( $user_license_ids as $key => $license_id ) {
                    if ( ! isset( $licenses_map[ $license_id ] ) ) {
                        // Remove access to licenses that no longer exist.
                        unset( $user_license_ids[ $key ] );
                    }
                }

                if ( ! empty( $user_license_ids ) ) {
                    foreach ( $licenses_map as $license_id => $value ) {
                        if ( ! isset( $all_licenses_map[ $license_id ] ) ) {
                            // Associate new licenses with the user who triggered the license syncing.
                            $user_license_ids[] = $license_id;
                        }
                    }

                    $user_license_ids = array_unique( $user_license_ids );
                } else {
                    $user_license_ids = array_keys( $licenses_map );
                }

                if ( ! $is_network_admin || ! is_null( $blog_id ) ) {
                    $user_licenses = array();
                    foreach ( $licenses as $license ) {
                        if ( ! in_array( $license->id, $user_license_ids ) ) {
                            continue;
                        }

                        $user_licenses[] = $license;
                    }

                    $this->_licenses = $user_licenses;
                } else {
                    $this->_licenses = $licenses;
                }

                $this->set_user_linked_license_ids( $this->_user->id, $user_license_ids );

                $this->_store_licenses( true, $this->_module_id, $licenses );
            }

            // Update current license.
            if ( is_object( $this->_license ) ) {
                $this->_license = $this->_get_license_by_id( $this->_license->id );
            }

            return $this->_licenses;
        }
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)
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)
126004
def copyright(self, key, value):
    """"""
    MATERIAL_MAP = {
        'Article': 'publication',
        'Published thesis as a book': 'publication',
    }

    material = value.get('e') or value.get('3')

    return {
        'holder': value.get('d'),
        'material': MATERIAL_MAP.get(material),
        'statement': value.get('f'),
        'url': value.get('u'),
        'year': maybe_int(value.get('g')),
    }
123211
def print_licences(params, metadata):
    
    if hasattr(params, 'licenses'):
        if params.licenses:
            _pp(metadata.licenses_desc())
        sys.exit(0)
749292
def showLicense():
    
    print("Trying to recover the contents of the license...\n")
    try:
        # Grab the license online and print it.
        text = urllib.urlopen(LICENSE_URL).read()
        print("License retrieved from " + emphasis(LICENSE_URL) + ".")
        raw_input("\n\tPress " + emphasis("<ENTER>") + " to print it.\n")
        print(text)
    except:
        print(warning("The license could not be downloaded and printed."))
69795
private void generateLicenses(final Metadata m, final Element e) {
        for (final License license : m.getLicenses()) {
            final Element licenseElement = new Element("license", NS);
            addNotNullAttribute(licenseElement, "type", license.getType());
            addNotNullAttribute(licenseElement, "href", license.getHref());
            if (license.getValue() != null) {
                licenseElement.addContent(license.getValue());
            }
            if (licenseElement.hasAttributes() || !licenseElement.getTextTrim().isEmpty()) {
                e.addContent(licenseElement);
            }
        }
    }
120502
def build_license_file(directory, spec):
    
    name, text = '', ''

    try:
        name = spec['LICENSE']
        text = spec['X_MSI_LICENSE_TEXT']
    except KeyError:
        pass # ignore this as X_MSI_LICENSE_TEXT is optional

    if name!='' or text!='':
        file = open( os.path.join(directory.get_path(), 'License.rtf'), 'w' )
        file.write('{\\rtf')
        if text!='':
             file.write(text.replace('\n', '\\par '))
        else:
             file.write(name+'\\par\\par')
        file.write('}')
        file.close()
1148115
def license_contents
      matched_files.reject { |f| f == package_file }
                   .group_by(&:content)
                   .map { |content, files| { "sources" => license_content_sources(files), "text" => content } }
    end
1116851
def hacking_has_license(physical_line, filename, lines, line_number):
    
    # don't work about init files for now
    # TODO(sdague): enforce license in init file if it's not empty of content
    license_found = False

    # skip files that are < 10 lines, which isn't enough for a license to fit
    # this allows us to handle empty files, as well as not fail on the Okay
    # doctests.
    if line_number is 1 and len(lines) > 10 and _project_is_apache():
        for idx, line in enumerate(lines):
            # if it's more than 10 characters in, it's probably not in the
            # header
            if 0 <= line.find('Licensed under the Apache License') < 10:
                    license_found = True
            if 0 <= line.find('SPDX-License-Identifier:') < 10:
                    license_found = True
        if not license_found:
            return (0, "H102: Apache 2.0 license header not found")
1308005
public void postLicense(final License license, final String user, final String password) throws GrapesCommunicationException, AuthenticationException {
        final Client client = getClient(user, password);
        final WebResource resource = client.resource(serverURL).path(RequestUtils.licenseResourcePath());
        final ClientResponse response = resource.type(MediaType.APPLICATION_JSON).post(ClientResponse.class, license);

        client.destroy();
        if(ClientResponse.Status.CREATED.getStatusCode() != response.getStatus()){
            final String message = "Failed to POST license";
            if(LOG.isErrorEnabled()) {
                LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus()));
            }
            throw new GrapesCommunicationException(message, response.getStatus());
        }
    }
1242902
def activate_license(self, key):
        
        manager, uri = self._get_ilo_details()
        try:
            lic_uri = manager['Oem']['Hp']['links']['LicenseService']['href']
        except KeyError:
            msg = ('"LicenseService" section in Manager/Oem/Hp does not exist')
            raise exception.IloCommandNotSupportedError(msg)

        lic_key = {}
        lic_key['LicenseKey'] = key

        # Perform POST to activate license
        status, headers, response = self._rest_post(lic_uri, None, lic_key)

        if status >= 300:
            msg = self._get_extended_error(response)
            raise exception.IloError(msg)
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')
179440
def match(license):
    ''''''
    if license not in VALID_LICENSES:
        for l1 in _split_license(license):
            if l1 in VALID_LICENSES:
                continue
            for l2 in _split_license(l1):
                if l2 not in VALID_LICENSES:
                    return False
                    valid_license = False
    return True
331700
function show_notice() {
		if ( ! is_admin() ) {
			return false;
		}
		$status                = $this->get_license_status();
		$no_activations_string = apply_filters( $this->product->get_key() . '_lc_no_activations_string', 'No activations left for %s !!!. You need to upgrade your plan in order to use %s on more websites. Please ask the %s Staff for more details.' );
		$no_valid_string       = apply_filters( $this->product->get_key() . '_lc_no_valid_string', 'In order to benefit from updates and support for %s, please add your license code from your  <a href="%s" target="_blank">purchase history</a> and validate it <a href="%s">here</a>. ' );
		$expiration_string     = apply_filters( $this->product->get_key() . '_lc_expiration_string', 'Your license is about to expire for %s. You can go to %s and renew it   ' );

		// No activations left for this license.
		if ( 'valid' != $status && $this->check_activation() ) {
			?>
			<div class="error">
				<p><strong>
						<?php
						echo sprintf(
							$no_activations_string,
							$this->product->get_name(),
							$this->product->get_name(),
							'<a href="' . $this->get_api_url() . '" target="_blank">' . $this->get_distributor_name() . '</a>'
						);
						?>
					</strong>
				</p>
			</div>
			<?php
			return false;
		}
		// Invalid license key.
		if ( 'valid' != $status ) {
			?>
			<div class="error">
				<p>
					<strong><?php echo sprintf( $no_valid_string, $this->product->get_name() . ' ' . $this->product->get_type(), $this->get_api_url(), admin_url( 'options-general.php' ) . '#' . $this->product->get_key() ); ?> </strong>
				</p>
			</div>
			<?php

			return false;
		}

		// Expired and soon to expire license.
		if ( 'valid' == $status && $this->check_expiration() ) {
			?>
			<div class="update-nag">
				<p>
					<strong>
						<?php
						echo sprintf(
							$expiration_string,
							$this->product->get_name() . ' ' . $this->product->get_type(),
							'<a href="' . $this->renew_url() . '" target="_blank">' . $this->get_distributor_name() . '</a>'
						);
						?>
					</strong>
				</p>
			</div>
			<?php
			return false;
		}

		return true;
	}