This method builds our license string for embedding into the compiled file
350401
function () {
        var pkg = require(process.cwd() + '/package.json');
        var licenses = [];
        pkg.licenses.forEach(function (license) {
            licenses.push(license.type);
        });

        return '/*! ' + pkg.name + ' - v' + pkg.version + ' - ' + gutil.date("yyyy-mm-dd") + "\n" +
            (pkg.homepage ? "* " + pkg.homepage + "\n" : "") +
            '* Copyright (c) ' + gutil.date("yyyy") + ' ' + pkg.author.name +
            '; Licensed ' + licenses.join(', ') + ' */\n';
    }
101888
def license_present(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': False,
           'comment': ''}

    if not __salt__['powerpath.has_powerpath']():
        ret['result'] = False
        ret['comment'] = 'PowerPath is not installed.'
        return ret

    licenses = [l['key'] for l in __salt__['powerpath.list_licenses']()]

    if name in licenses:
        ret['result'] = True
        ret['comment'] = 'License key {0} already present'.format(name)
        return ret

    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'License key {0} is set to be added'.format(name)
        return ret

    data = __salt__['powerpath.add_license'](name)
    if data['result']:
        ret['changes'] = {name: 'added'}
        ret['result'] = True
        ret['comment'] = data['output']
        return ret
    else:
        ret['result'] = False
        ret['comment'] = data['output']
        return ret
347521
function precompile(tmpl, outputH, tmplRule) {
  var root = _createAstRoot();

  if (tmpl.quasis) {
    var _tmpl = tmpl,
        quasis = _tmpl.quasis,
        isExpression = _tmpl.isExpression,
        isCss = _tmpl.isCss;
    tmpl = compileStringTmpl.call({
      tmplRule: tmplRule,
      outputH: outputH,
      onlyParse: true,
      isExpression: isExpression,
      isCss: isCss
    }, quasis);
  } else if (isString(tmpl)) {
    tmpl = compileStringTmpl.call({
      tmplRule: tmplRule,
      outputH: outputH,
      onlyParse: true
    }, tmpl);
  }

  checkElem(tmpl._njTmpl, root, tmplRule);
  return buildRuntime(root.content, root, !outputH);
}
658410
def _build_map(self):
        
        if gf.is_py2_narrow_build():
            self.log_warn(u"Running on a Python 2 narrow build: be aware that Unicode chars above 0x10000 cannot be replaced correctly.")
        self.trans_map = {}
        with io.open(self.file_path, "r", encoding="utf-8") as file_obj:
            contents = file_obj.read().replace(u"\t", u" ")
            for line in contents.splitlines():
                # ignore lines starting with "#" or blank (after stripping)
                if not line.startswith(u"#"):
                    line = line.strip()
                    if len(line) > 0:
                        self._process_map_rule(line)
458277
def licenses(source=DEFAULT_LICENSE_FILE):
    ''''''
    if source.startswith('http'):
        json_licenses = requests.get(source).json()
    else:
        with open(source) as fp:
            json_licenses = json.load(fp)

    if len(json_licenses):
        log.info('Dropping existing licenses')
        License.drop_collection()

    for json_license in json_licenses:
        flags = []
        for field, flag in FLAGS_MAP.items():
            if json_license.get(field, False):
                flags.append(flag)

        license = License.objects.create(
            id=json_license['id'],
            title=json_license['title'],
            url=json_license['url'] or None,
            maintainer=json_license['maintainer'] or None,
            flags=flags,
            active=json_license.get('active', False),
            alternate_urls=json_license.get('alternate_urls', []),
            alternate_titles=json_license.get('alternate_titles', []),
        )
        log.info('Added license "%s"', license.title)
    try:
        License.objects.get(id=DEFAULT_LICENSE['id'])
    except License.DoesNotExist:
        License.objects.create(**DEFAULT_LICENSE)
        log.info('Added license "%s"', DEFAULT_LICENSE['title'])
    success('Done')
723299
function checkModuleLicense(folder) {

    var licensePath = folder + "/LICENSE",
        readMePath = folder + "/README.md",
        licenseContent;

    //check for LICENSE File First
    if(fs.existsSync(licensePath)){
        licenseContent = fs.readFileSync(licensePath, "utf-8");
        return { isMIT : isLicense.mit(licenseContent), content : licenseContent };
    }
    //Maybe in the README
    else if(fs.existsSync(readMePath)) {
        licenseContent = fs.readFileSync(readMePath, "utf-8");
        return { isMIT : isLicense.mit(licenseContent), content : "Check the README" };
    }
    else {
        return { isMIT : false, content : "not found" };
    }
}
271367
def get_license(self):
        

        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/license"
        )
        return github.ContentFile.ContentFile(self._requester, headers, data, completed=True)
441293
function streamLicense (grunt, fileData, options) {
    let content = grunt.file.read(options.license);

    // Use JSDoc license tag to preserve file content as
    // comment when minifying.
    if (options.deploy && options.minify) {
        content = `/**@license ${content}*/`;
    } else {
        content = `/*\x0A${content}*/\x0A\x0A`;
    }

    stream.write(content, () => {
        streamWrapperStart(grunt, fileData, options);
    });
}
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
280692
def compile_rich(cls, code, path=None, extra_args=None):
        """"""

        return {
            contract_name: {
                'code': '0x' + contract.get('bin_hex'),
                'info': {
                    'abiDefinition': contract.get('abi'),
                    'compilerVersion': cls.compiler_version(),
                    'developerDoc': contract.get('devdoc'),
                    'language': 'Solidity',
                    'languageVersion': '0',
                    'source': code,
                    'userDoc': contract.get('userdoc')
                },
            }
            for contract_name, contract
            in cls.combined(code, path=path, extra_args=extra_args)
        }
756172
function compile( bundleData, bundleFile, config, callback ) {
	var baseDir = config['path'] || path.dirname(bundleFile);
	var encoder, profileEncoder = [], profileLoader = [], bundleLoader;

	// Compile stages
	var openBundle = function( cb ) {
		return function() {

			// Create encoder
			encoder = new BinaryEncoder(
					bundleFile,
					{
						'name' 			: bundleData['name'],
						'base_dir' 		: baseDir,
						'log'			: config['log'] || 0x00,
						'sparse'		: config['sparse'],
					}
				);

			// Add profiles
			for (var i=0; i<profileEncoder.length; i++) {
				encoder.addProfile( profileEncoder[i] );
			}

			// We are ready
			cb();
		}
	}

	var loadBundles = function( cb ) {
		return function() {
			// Load a bundle by specs
			bundleLoader.addBySpecs( bundleData );
			// Solve dependencies and load resources
			bundleLoader.load( cb );
		}
	}

	var compileExports = function( cb ) {
		return function() {
			// Get the bundle to encode
			var bundle = bundleLoader.bundles[ bundleData['name'] ];

			// Encode resources
			for (var k in bundle.resources) {
				encoder.encode( bundle.resources[k], k );
			}

			// Embed blobs
			for (var k in bundle.blobs) {
				encoder.embedBlob( bundle.blobs[k][0], k, bundle.blobs[k][1] );
			}

			// We are done
			cb();
		}
	}

	var closeBundle = function( cb ) {
		return function() {
			// Close & Complete
			encoder.close();
			cb();
		}
	}

	// Check for profileTable/profileLoader
	if (config['profileEncoder'] || config['profileLoader']) {

		// Check for missing arguments
		if (!config['profileEncoder']) {
			callback( "Got 'profileLoader' but missing 'profileEncoder' in the arguments" );
			return;
		}
		if (!config['profileLoader']) {
			callback( "Got 'profileEncoder' but missing 'profileLoader' in the arguments" );
			return;
		}

		// Fetch
		profileEncoder = config['profileEncoder'];
		profileLoader = config['profileLoader'];

		// Make sure it's array
		if (!(profileEncoder instanceof Array))
			profileEncoder = [ profileEncoder ];
		if (!(profileLoader instanceof Array))
			profileLoader = [ profileLoader ];

	} else {

		// Identify some important information
		var profile = config['profile'] || bundleData['profile'];
		if (!profile) {
			callback( "No jbb profile was specified!");
			return;
		}

		// Make sure it's array
		if (typeof profile === 'string')
			profile = [ profile ];

		// Require
		for (var i=0; i<profile.length; i++) {
			var pname = profile[i];
			if (pname[0] == ".") {
				profileEncoder.push( require( path.join(process.cwd(), pname, '/profile-encode') ) );
				profileLoader.push( require( path.join(process.cwd(), pname, "/profile-loader") ) );
			} else {
				profileEncoder.push( require('jbb-profile-'+pname+'/profile-encode') );
				profileLoader.push( require('jbb-profile-'+pname+"/profile-loader") );
			}
		}

	}

	// Load profile table and compiler helper
	bundleLoader = new BundlesLoader( baseDir );
	for (var i=0; i<profileLoader.length; i++) {
		bundleLoader.addProfileLoader( profileLoader[i] );
	}

	// Chained initialization of profile loaders
	var context = { 'remaining': profileLoader.length }
	var init_callback = (function() {
		if (--this.remaining == 0) {
			openBundle(
				loadBundles(
					compileExports(
						closeBundle( callback || function(){} )
						) 
					) 
			)();
		}
	}).bind(context);

	// Initialize profile compiler with the specs file
	for (var i=0; i<profileLoader.length; i++) {
		if (!profileLoader[i].initialize) {
			init_callback();
		} else {
			profileLoader[i].initialize( init_callback, bundleData );
		}
	}

}
154910
function buildString(file, enc, cb) {
		var currentFilePath = file.path;
		var fileName = getFileName(currentFilePath);

		//don't read the destination path (if in same folder)
		if (fileName === destFileName || file.isNull()) {
			cb();
			return;
		}

		if (file.isStream()) {
			cb(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
			return;
		}

		addImportToList(currentFilePath, file, fileName, opts);
		return cb();
	}
404672
def license(self, license):
        
        allowed_values = ["Public Domain", "PDDL", "CC-0", "CC-BY", "ODC-BY", "CC-BY-SA", "ODC-ODbL", "CC BY-NC", "CC BY-NC-SA", "Other"]
        if license not in allowed_values:
            raise ValueError(
                "Invalid value for `license` ({0}), must be one of {1}"
                .format(license, allowed_values)
            )

        self._license = license
737529
function parse(data, options, next) {
    data = this.get(data);

    if ('function' === typeof options) {
      next = options;
      options = {};
    }

    //
    // We cannot detect a license so we call the callback without any arguments
    // which symbolises a failed attempt.
    //
    if (!data) return next();

    //
    // Optimize the matches by trying to locate where the licensing information
    // starts in the given content. Usually, we, as developers add it at the
    // bottom of our README.md files and prefix it with "LICENSE" as header.
    //
    if (data.file && /readme/i.test(data.file)) {
      data.content.split('\n')
        .some(function some(line, index, lines) {
          if (
            /^.{0,7}\s{0,}(?:licen[cs]e[s]?|copyright).{0,2}\s{0,}$/gim.test(
              line.trim())
          ) {
            data.content = lines.slice(index).join('\n');
            debug('matched %s as license header, slicing data', JSON.stringify(line));
          return true;
        }

        return false;
      });
    }

    var license = this.scan(data.content);
    if (!license) {
      license = this.test(data.content);

      if (license) debug('used regexp to detect %s in content', license);
    } else {
      debug('license file scan resulted in %s as matching license', license);
    }


    next(undefined, this.normalize(license));
  }
1287637
def license_export(data):
    
    resources = config_utils.get_resources("sentieon", data["config"])
    server = resources.get("keyfile")
    if not server:
        server = tz.get_in(["resources", "sentieon", "keyfile"], data)
    if not server:
        raise ValueError("Need to set resources keyfile with URL:port of license server, local license file or "
                         "environmental variables to export \n"
                         "http://bcbio-nextgen.readthedocs.io/en/latest/contents/configuration.html#resources\n"
                         "Configuration: %s" % pprint.pformat(data))
    if isinstance(server, six.string_types):
        return "export SENTIEON_LICENSE=%s && " % server
    else:
        assert isinstance(server, dict), server
        exports = ""
        for key, val in server.items():
            exports += "export %s=%s && " % (key.upper(), val)
        return exports
889923
private License getLicense(final String licenseId) {
        License result = null;
        final Set<DbLicense> matchingLicenses = licenseMatcher.getMatchingLicenses(licenseId);

        if (matchingLicenses.isEmpty()) {
            result = DataModelFactory.createLicense("#" + licenseId + "# (to be identified)", NOT_IDENTIFIED_YET, NOT_IDENTIFIED_YET, NOT_IDENTIFIED_YET, NOT_IDENTIFIED_YET);
            result.setUnknown(true);
        } else {
            if (matchingLicenses.size() > 1 && LOG.isWarnEnabled()) {
                LOG.warn(String.format("%s matches multiple licenses %s. " +
                                "Please run the report showing multiple matching on licenses",
                        licenseId, matchingLicenses.toString()));
            }
            result = mapper.getLicense(matchingLicenses.iterator().next());

        }

        return result;
    }
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)
}