Returns the sources for a group of license file contents

 Sources are returned as a single string with sources separated by ", "
975155
def license_content_sources(files)
      paths = Array(files).map do |file|
        next file[:uri] if file[:uri]

        path = dir_path.join(file[:dir], file[:name])
        normalize_source_path(path)
      end

      paths.join(", ")
    end
296099
def id_source(source, full=False):
    
    if source not in source_ids:
        return ''

    if full:
        return source_ids[source][1]
    else:
        return source_ids[source][0]
68660
def source(self):
        """"""
        full_src = self._source[self._slice]

        def is_empty_or_comment(line):
            return line.strip() == '' or line.strip().startswith('#')

        filtered_src = dropwhile(is_empty_or_comment, reversed(full_src))
        return ''.join(reversed(list(filtered_src)))
397157
def license_loader(lic_dir=LIC_DIR):
    """"""
    lics = []
    for ln in os.listdir(lic_dir):
        lp = os.path.join(lic_dir, ln)
        with open(lp) as lf:
            txt = lf.read()
            lic = License(txt)
            lics.append(lic)
    return lics
146199
function getSourceNodes(sourceFile) {
    const nodes = [sourceFile];
    const result = [];
    while (nodes.length > 0) {
        const node = nodes.shift();
        if (node) {
            result.push(node);
            if (node.getChildCount(sourceFile) >= 0) {
                nodes.unshift(...node.getChildren());
            }
        }
    }
    return result;
}
806355
def _parse_license_name(long_name):
    ''' 
    '''
    licenses_path = utils.get_data_dir() / 'license_list.txt'
    with licenses_path.open('rt') as f:
        licenses = [line.strip() for line in f.readlines()]

    if long_name in licenses:
        return long_name, long_name == PRIVATE_LICENSE_NAME

    osi_name = 'OSI Approved :: {}'.format(long_name)
    if osi_name in licenses:
        return osi_name, False

    logging.warn('License "{}" is not a valid PyPI classifier'.format(long_name))

    return long_name, True
1222573
def filenames(self, sources):
        
        filename = []
        for src in sources:
            filename.append(src.split("/")[-1])
        return filename
754134
private String[] getDependencyCells(final Dependency dependency, final License license) {
        final List<String> cells = new ArrayList<>();

        if(decorator.getShowSources()){
            cells.add(dependency.getSourceName());
        }

        if(decorator.getShowSourcesVersion()){
            cells.add(dependency.getSourceVersion());
        }

        if(decorator.getShowTargets()){
            cells.add(dependency.getTarget().getGavc());
        }

        if(decorator.getShowTargetsDownloadUrl()){
            cells.add(dependency.getTarget().getDownloadUrl());
        }

        if(decorator.getShowTargetsSize()){
            cells.add(dependency.getTarget().getSize());
        }

        if(decorator.getShowScopes()){
            cells.add(dependency.getScope().name());
        }

        if(decorator.getShowLicenses()){
            cells.add(license.getName());
        }

        if(decorator.getShowLicensesLongName()){
            cells.add(license.getLongName());
        }

        if(decorator.getShowLicensesUrl()){
            cells.add(license.getUrl());
        }

        if(decorator.getShowLicensesComment()){
            cells.add(license.getComments());
        }

        return cells.toArray(new String[cells.size()]);
    }
1081366
def source_lines(self, filename):
        
        with self.filesystem.open(filename) as f:
            return f.readlines()
1191758
def on_each_source(self):
        
        return (self.info.applytosources and
                self.info.applytosources == self.source_ids)
298797
def _get_groups(self, data):
        
        groups = []
        for attribute in SOURCE_KEYS:
            for k, v in data[attribute].items():
                if k == None:
                    k = 'Sources'
                if k not in groups:
                    groups.append(k)
        for k, v in data['include_files'].items():
            if k == None:
                k = 'Includes'
            if k not in groups:
                groups.append(k)
        return groups
143788
public String toSourceString() {
    return "{namespace "
        + namespace.identifier()
        + (attrs.isEmpty() ? "" : " " + Joiner.on(' ').join(attrs))
        + "}\n";
  }
1205920
def sources(verbose=False):
    '''
    
    '''
    ret = {}
    cmd = 'imgadm sources -j'
    res = __salt__['cmd.run_all'](cmd)
    retcode = res['retcode']
    if retcode != 0:
        ret['Error'] = _exit_status(retcode)
        return ret

    for src in salt.utils.json.loads(res['stdout']):
        ret[src['url']] = src
        del src['url']

    if not verbose:
        ret = list(ret)

    return ret
797925
public final File getLicenseFile(File installLicenseDir, String prefix) throws FileNotFoundException {
        if (!!!prefix.endsWith("_")) {
            prefix = prefix + "_";
        }

        Locale locale = Locale.getDefault();
        String lang = locale.getLanguage();
        String country = locale.getCountry();

        String[] suffixes = new String[] { lang + '_' + country, lang, "en" };
        File[] listOfFiles = installLicenseDir.listFiles();

        File licenseFile = null;

        outer: for (File file : listOfFiles) {
            for (String suffix : suffixes) {
                if (file.getName().startsWith(prefix) && file.getName().endsWith(suffix)) {
                    licenseFile = new File(file.getAbsolutePath());
                    break outer;
                }
            }
        }

        return licenseFile;
    }
573291
def sources(
            self):
        
        sourceResultsList = []
        sourceResultsList[:] = [dict(l) for l in self.sourceResultsList]
        return sourceResultsList
93902
def raw_content
      return if pseudo_license?
      unless File.exist?(path)
        raise Licensee::InvalidLicense, "'#{key}' is not a valid license key"
      end

      @raw_content ||= File.read(path, encoding: 'utf-8')
    end
1297691
def FindSourceFiles(self, node='.'):
        
        node = self.arg2nodes(node, self.fs.Entry)[0]

        sources = []
        def build_source(ss):
            for s in ss:
                if isinstance(s, SCons.Node.FS.Dir):
                    build_source(s.all_children())
                elif s.has_builder():
                    build_source(s.sources)
                elif isinstance(s.disambiguate(), SCons.Node.FS.File):
                    sources.append(s)
        build_source(node.all_children())

        def final_source(node):
            while (node != node.srcnode()):
              node = node.srcnode()
            return node
        sources = list(map( final_source, sources ));
        # remove duplicates
        return list(set(sources))