Return a list containing tuples of
    e.g. ('test_project.utils', 'example/test_project/utils.py')
515166
def get_modules(path, prepend_module_root=True):
    
    module_root = os.path.split(path)[1]
    modules = list()
    for root, directories, filenames in os.walk(path):
        for filename in filenames:
            if _is_python_file(filename):
                directory = os.path.dirname(
                    os.path.realpath(
                        os.path.join(
                            root,
                            filename
                        )
                    )
                ).split(module_root)[-1].replace(
                    os.sep,  # e.g. '/'
                    '.'
                )
                directory = directory.replace('.', '', 1)

                module_name_parts = []
                if prepend_module_root:
                    module_name_parts.append(module_root)
                if directory:
                    module_name_parts.append(directory)

                if filename == '__init__.py':
                    path = root
                else:
                    module_name_parts.append(os.path.splitext(filename)[0])
                    path = os.path.join(root, filename)

                modules.append(('.'.join(module_name_parts), path))

    return modules
727939
def contents_list_pairs(self):
        ''''''
        return (tuple(getattr(self.generator, name) for name in names)
                for names in self.info.get('contents_lists', []))
586661
def _find_input_files(var, out):
    
    if isinstance(var, (list, tuple)):
        for x in var:
            out = _find_input_files(x, out)
    elif isinstance(var, dict):
        if var.get("class") == "File":
            out.append(var["path"])
            out = _find_input_files(var.get("secondaryFiles", []), out)
        for key, val in var.items():
            out = _find_input_files(val, out)
    return out
550345
def get_templates(path: Path) -> List[str]:
    '''
    '''

    result = []

    for item in path.glob('**/*'):
        if item.is_file() and not item.name.startswith('_'):
            result.append(item.relative_to(path.parent).as_posix())

    return result
1154369
def args_as_tuple(self):
        """"""
        result = ("body", )
        result = result + (
            self.arguments["body-transform"], self.arguments["match-type"])
        if self.arguments["key-list"].startswith("["):
            result = result + tuple(
                tools.to_list(self.arguments["key-list"]))
        else:
            result = result + (self.arguments["key-list"].strip('"'),)
        return result
1167688
def path_list(self, sep=os.pathsep):
        '''  '''
        from pathlib import Path
        return [ Path(pathstr) for pathstr in self.split(sep) ]
815757
def dumps(self):
        """"""

        ret_str = []
        for item in self._arg_list:
            if isinstance(item, TikZUserPath):
                ret_str.append(item.dumps())
            elif isinstance(item, TikZCoordinate):
                ret_str.append(item.dumps())
            elif isinstance(item, str):
                ret_str.append(item)

        return ' '.join(ret_str)
967396
def vcl_list(self):
        
        vcls = {}
        for line in self.fetch('vcl.list')[1].splitlines():
            a = line.split()
            vcls[a[2]] = tuple(a[:-1])
        return vcls
964434
def _get_all_lengths(self):
        
        utt_lengths = {}

        for utt_idx in self.utt_ids:
            per_container = [c._file[utt_idx].shape[0] for c in self.containers]
            utt_lengths[utt_idx] = tuple(per_container)

        return utt_lengths
1056372
def get_templates(self):
        
        use = getattr(self, 'use', '')
        if isinstance(use, list):
            return [n.strip() for n in use if n.strip()]

        return [n.strip() for n in use.split(',') if n.strip()]
1308358
def get_cmd_tuple_list(self):
    

    # pattern to find DAGman macros
    pat = re.compile(r'\$\((.+)\)')
    argpat = re.compile(r'\d+')

    # first parse the options and replace macros with values
    options = self.job().get_opts()
    macros = self.get_opts()

    cmd_list = []

    for k in options:
      val = options[k]
      m = pat.match(val)
      if m:
        key = m.group(1)
        value = macros[key]

        cmd_list.append(("--%s" % k, str(value)))
      else:
        cmd_list.append(("--%s" % k, str(val)))

    # second parse the short options and replace macros with values
    options = self.job().get_short_opts()

    for k in options:
      val = options[k]
      m = pat.match(val)
      if m:
        key = m.group(1)
        value = macros[key]

        cmd_list.append(("-%s" % k, str(value)))
      else:
        cmd_list.append(("-%s" % k, str(val)))

    # lastly parse the arguments and replace macros with values
    args = self.job().get_args()
    macros = self.get_args()

    for a in args:
      m = pat.match(a)
      if m:
        arg_index = int(argpat.findall(a)[0])
        try:
          cmd_list.append(("%s" % macros[arg_index], ""))
        except IndexError:
          cmd_list.append("")
      else:
        cmd_list.append(("%s" % a, ""))

    return cmd_list
696059
def _get_protocol_tuple(data: Dict[str, Any]) -> Tuple[str, List, Dict]:
    """"""
    return data['function'], data.get('args', []), data.get('kwargs', {})
491402
def StringizeLibSymlinks(symlinks):
    """"""
    if SCons.Util.is_List(symlinks):
        try:
            return [ (k.get_path(), v.get_path()) for k,v in symlinks ]
        except (TypeError, ValueError):
            return symlinks
    else:
        return symlinks
604302
def _elements(self):
        """"""
        ElementCls, element_dicts = self._element_makings
        return tuple(
            ElementCls(element_dict, idx, element_dicts)
            for idx, element_dict in enumerate(element_dicts)
        )
666749
def mk_path_list(stmt):
    
    resolved_names = []
    def resolve_stmt(stmt, resolved_names):
        if stmt.keyword in ['choice', 'case']:
            resolve_stmt(stmt.parent, resolved_names)
            return
        def qualified_name_elements(stmt):
            """(module name, prefix, name)"""
            return (stmt.i_module.arg, stmt.i_module.i_prefix, stmt.arg)
        if stmt.parent.keyword in ['module', 'submodule']:
            resolved_names.append(qualified_name_elements(stmt))
            return
        else:
            resolve_stmt(stmt.parent, resolved_names)
            resolved_names.append(qualified_name_elements(stmt))
            return
    resolve_stmt(stmt, resolved_names)
    return resolved_names
768399
def get_Tuple_params(tpl):
    
    try:
        return tpl.__tuple_params__
    except AttributeError:
        try:
            if tpl.__args__ is None:
                return None
            # Python 3.6
            if tpl.__args__[0] == ():
                return ()
            else:
                if tpl.__args__[-1] is Ellipsis:
                    return tpl.__args__[:-1] if len(tpl.__args__) > 1 else None
                else:
                    return tpl.__args__
        except AttributeError:
            return None
342686
def matchingfiles(self, projectpath):
        """"""
        results = []

        if projectpath[-1] == '/':
            inputpath = projectpath + 'input/'
        else:
            inputpath = projectpath + '/input/'

        for linkf,realf in clam.common.util.globsymlinks(inputpath + '/.*.INPUTTEMPLATE.' + self.id + '.*'):
            seqnr = int(linkf.split('.')[-1])
            results.append( (seqnr, realf[len(inputpath):], self) )
        results = sorted(results)
        if self.unique and len(results) != 1:
            return []
        else:
            return results