def _get_files(file_patterns, top=HERE):
if not isinstance(file_patterns, (list, tuple)):<EOL><INDENT>file_patterns = [file_patterns]<EOL><DEDENT>for i, p in enumerate(file_patterns):<EOL><INDENT>if os.path.isabs(p):<EOL><INDENT>file_patterns[i] = os.path.relpath(p, top)<EOL><DEDENT><DEDENT>matchers = [_compile_pattern(p) for p in file_patterns]<EOL>files = set()<EOL>for root, dirnames, filenames in os.walk(top):<EOL><INDENT>if '<STR_LIT>' in dirnames:<EOL><INDENT>dirnames.remove('<STR_LIT>')<EOL><DEDENT>for m in matchers:<EOL><INDENT>for filename in filenames:<EOL><INDENT>fn = os.path.relpath(pjoin(root, filename), top)<EOL>if m(fn):<EOL><INDENT>files.add(fn.replace(os.sep, '<STR_LIT:/>'))<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return list(files)<EOL>
Expand file patterns to a list of paths.

    Parameters
    -----------
    file_patterns: list or str
        A list of glob patterns for the data file locations.
        The globs can be recursive if they include a `**`.
        They should be relative paths from the top directory or
        absolute paths.
    top: str
        the directory to consider for data files

    Note:
    Files in `node_modules` are ignored.