Return GlyphData holding data from a list of XML file paths.
7580
def from_files(cls, *glyphdata_files):
        """"""
        name_mapping = {}
        alt_name_mapping = {}
        production_name_mapping = {}

        for glyphdata_file in glyphdata_files:
            glyph_data = xml.etree.ElementTree.parse(glyphdata_file).getroot()
            for glyph in glyph_data:
                glyph_name = glyph.attrib["name"]
                glyph_name_alternatives = glyph.attrib.get("altNames")
                glyph_name_production = glyph.attrib.get("production")

                name_mapping[glyph_name] = glyph.attrib
                if glyph_name_alternatives:
                    alternatives = glyph_name_alternatives.replace(" ", "").split(",")
                    for glyph_name_alternative in alternatives:
                        alt_name_mapping[glyph_name_alternative] = glyph.attrib
                if glyph_name_production:
                    production_name_mapping[glyph_name_production] = glyph.attrib

        return cls(name_mapping, alt_name_mapping, production_name_mapping)
1292369
def _get_file_paths(cur):
    
    out = []
    if isinstance(cur, (list, tuple)):
        for x in cur:
            new = _get_file_paths(x)
            if new:
                out.extend(new)
    elif isinstance(cur, dict):
        if "class" in cur:
            out.append(cur["path"])
        else:
            for k, v in cur.items():
                new = _get_file_paths(v)
                if new:
                    out.extend(new)
    return out
828594
def _getText(nodelist):
    '''
    
    '''
    rc = []
    for node in nodelist:
        if node.nodeType == node.TEXT_NODE:
            rc.append(node.data)
    return ''.join(rc)
958846
def read_varnames(self, path="/"):
        """"""
        if path == "/":
            return self.rootgrp.variables.keys()
        else:
            group = self.path2group[path]
            return group.variables.keys()
147117
def get_ngrams(path):
    """"""
    with open(path, encoding='utf-8') as fh:
        ngrams = [ngram.strip() for ngram in fh.readlines()]
    return ngrams
408150
def glob(self, filename):
        """"""
        if isinstance(filename, six.string_types):
            return [
                # Convert the filenames to string from bytes.
                compat.as_str_any(matching_filename)
                for matching_filename in py_glob.glob(
                    compat.as_bytes(filename))
            ]
        else:
            return [
                # Convert the filenames to string from bytes.
                compat.as_str_any(matching_filename)
                for single_filename in filename
                for matching_filename in py_glob.glob(
                    compat.as_bytes(single_filename))
            ]
947149
def loadXml(self, xdata, filepath=''):
        
        # build options
        opts = {'platform': sys.platform}

        mkpath = lambda x: _mkpath(filepath, x, **opts)

        # lookup environment variables
        xenv = xdata.find('environment')
        if xenv is not None:
            env = {}
            log.info('loading environment...')
            for xkey in xenv:
                text = xkey.text
                if text:
                    env[xkey.tag] = os.path.expandvars(text)
                else:
                    env[xkey.tag] = ''

            self.setEnvironment(env)

        # lookup general settings
        xsettings = xdata.find('settings')
        if xsettings is not None:
            for xsetting in xsettings:
                key = xsetting.tag
                val = xsetting.text
                attr = '_' + key
                if hasattr(self, attr):
                    setattr(self, attr, val)

        # lookup options
        xoptions = xdata.find('options')
        if xoptions is not None:
            options = 0
            for xopt in xoptions:
                key = xopt.tag
                value = xopt.text

                if value.lower() == 'true':
                    try:
                        options |= Builder.Options[key]
                    except KeyError:
                        continue

            self._options = options

        # lookup path options
        xpaths = xdata.find('paths')
        if xpaths is not None:
            for xpath in xpaths:
                key = xpath.tag
                path = xpath.text

                if key.endswith('Paths'):
                    path = map(mkpath, path.split(';'))
                else:
                    path = mkpath(path)

                setattr(self, '_' + key, path)

        # lookup executable options
        xexe = xdata.find('executable')
        if xexe is not None:
            exe_tags = {'runtime': '_runtime',
                        'exe': '_executableName',
                        'cli': '_executableCliName',
                        'product': '_productName'}

            for tag, prop in exe_tags.items():
                xtag = xexe.find(tag)
                if xtag is not None:
                    value = xtag.text
                    if value.startswith('.'):
                        value = mkpath(value)

                    setattr(self, prop, value)

            # load exclude options
            xexcludes = xexe.find('excludes')
            if xexcludes is not None:
                excludes = []
                for xexclude in xexcludes:
                    excludes.append(xexclude.text)
                self.setExecutableExcludes(excludes)

            # load build data
            xexedata = xexe.find('data')
            if xexedata is not None:
                data = []
                for xentry in xexedata:
                    if xentry.tag == 'tree':
                        path = xentry.get('path', '')
                        if path:
                            path = mkpath(path)
                        else:
                            path = self.sourcePath()

                        prefix = xentry.get('prefix', os.path.basename(path))
                        excludes = xentry.get('excludes', '').split(';')

                        if excludes:
                            data.append(('tree', (path, prefix, excludes)))
                    else:
                        for xitem in xentry:
                            data.append((xentry.tag, xitem.attrs))

                self.setExecutableData(data)

            # load hidden imports
            xhiddenimports = xexe.find('hiddenimports')
            if xhiddenimports is not None:
                imports = []
                for ximport in xhiddenimports:
                    imports.append(ximport.text)
                self.setHiddenImports(imports)

            # load options
            xopts = xexe.find('options')
            if xopts is not None:
                for xopt in xopts:
                    if xopt.text.startswith('.'):
                        value = mkpath(xopt.text)
                    else:
                        value = xopt.text
                    self._executableOptions[xopt.tag] = value

        # lookup installer options
        xinstall = xdata.find('installer')
        if xinstall is not None:
            install_tags = {'name': '_installName'}

            for tag, prop in install_tags.items():
                xtag = xinstall.find(tag)
                if xtag is not None:
                    value = xtag.text
                    if value.startswith('.'):
                        value = mkpath(value)
                    setattr(self, prop, value)

            xopts = xinstall.find('options')
            if xopts is not None:
                for xopt in xopts:
                    if xopt.text.startswith('.'):
                        value = mkpath(xopt.text)
                    else:
                        value = xopt.text

                    self._installerOptions[xopt.tag] = value

            xdirectories = xinstall.find('additional_directories')
            if xdirectories is not None:
                for xdir in xdirectories:
                    self._installDirectories[xdir.get('path')] = xdir.get('source', '')
1297116
def data(self):
        """"""
        return NodeData(
            self.foo, get_arguments(self.bound_args), self.hints)
373873
def get_text(nodelist):
    """"""
    value = []
    for node in nodelist:
        if node.nodeType == node.TEXT_NODE:
            value.append(node.data)
    return ''.join(value)
156046
def _gen_glob_data(dir, pattern, child_table):
    """"""
    dir = pathlib.Path(dir)
    matched = False
    used_names = set()  # Used by to_nodename to prevent duplicate names
    # sorted so that renames (if any) are consistently ordered
    for filepath in sorted(dir.glob(pattern)):
        if filepath.is_dir():
            continue
        else:
            matched = True

        # create node info
        node_table = {} if child_table is None else child_table.copy()
        filepath = filepath.relative_to(dir)
        node_table[RESERVED['file']] = str(filepath)
        node_name = to_nodename(filepath.stem, invalid=used_names)
        used_names.add(node_name)
        print("Matched with {!r}: {!r} from {!r}".format(pattern, node_name, str(filepath)))

        yield node_name, node_table

    if not matched:
        print("Warning: {!r} matched no files.".format(pattern))
        return
553894
private List<Glyph> getGlyphsOfPEs(Set<PhysicalEntity> pes, String context) {
		List<Glyph> gs = new ArrayList<Glyph>();

		for (PhysicalEntity pe : pes)
			if (glyphMap.containsKey(convertID(pe.getUri())))
				gs.add(getGlyphToLink(pe, context));

		return gs;
	}
1023470
def _get_result_paths(self,data):
        
        result = {}
        result['Tree'] = ResultPath(Path=splitext(self._input_filename)[0] + \
                                                  '.tree')
        return result
1027787
def get_files_by_path(path):
    '''
    '''
    if os.path.isfile(path):
        return [path]
    if os.path.isdir(path):
        return get_morph_files(path)

    raise IOError('Invalid data path %s' % path)
690842
def data_find(data, path):
    
    path_parts = path.split("/")
    try:
        sub_elm = [
            el
            for el in data
            if isinstance(el, (tuple, list)) and el[0] == path_parts[0]
        ][0]
    except IndexError:
        return None
    else:
        if len(path_parts) > 1:
            return data_find(sub_elm, "/".join(path_parts[1:]))
        return sub_elm
1302553
def _lxml_el_to_data(lxml_el, ns, nsmap, snake=True):
    """"""
    tag_name = _to_colon_ns(lxml_el.tag, default_ns=ns, nsmap=nsmap)
    ret = [tag_name]
    attributes = _get_el_attributes(lxml_el, ns=ns, nsmap=nsmap)
    if attributes:
        ret.append(attributes)
    for sub_el in lxml_el:
        ret.append(_lxml_el_to_data(sub_el, ns, nsmap, snake=snake))
    text = lxml_el.text
    if text:
        ret.append(text)
    return tuple(ret)
172756
def _get_anchor_data(anchor_data, glyphSet, components, anchor_name):
    """"""

    anchors = []
    for component in components:
        for anchor in glyphSet[component.baseGlyph].anchors:
            if anchor.name == anchor_name:
                anchors.append((anchor, component))
                break
    if len(anchors) > 1:
        for i, (anchor, component) in enumerate(anchors):
            t = Transform(*component.transformation)
            name = '%s_%d' % (anchor.name, i + 1)
            anchor_data[name] = t.transformPoint((anchor.x, anchor.y))
    elif anchors:
        anchor, component = anchors[0]
        t = Transform(*component.transformation)
        anchor_data[anchor.name] = t.transformPoint((anchor.x, anchor.y))
986270
def _get_package_data():
    
    moddata = []
    modlist = (
        "click",
        "configobj",
        "cryptography",
        "globus_cli",
        "globus_sdk",
        "jmespath",
        "requests",
        "six",
    )
    if verbosity() < 2:
        modlist = ("globus_cli", "globus_sdk", "requests")

    for mod in modlist:
        cur = [mod]
        try:
            loaded_mod = __import__(mod)
        except ImportError:
            loaded_mod = None

        for attr in ("__version__", "__file__", "__path__"):
            # if loading failed, be sure to pad with error messages
            if loaded_mod is None:
                cur.append("[import failed]")
                continue

            try:
                attrval = getattr(loaded_mod, attr)
            except AttributeError:
                attrval = ""
            cur.append(attrval)
        moddata.append(cur)

    return moddata