def find_tests(tests):
    """Find test files given list of arguments which may be files,
    directories or modules."""
    files = []
    for test in tests:
        if isfile(test):
            files.append(test)
        elif isdir(test):
            files.extend(get_tests_in_dir(test))
        else:
            # A module.
            try:
                # Import the module
                components = test.split('.')
                if len(components) > 1:
                    modname = '.'.join(components[:-1])
                    symbol = components[-1]
                    mod = __import__(modname, globals(), locals(), [symbol])
                    s = getattr(mod, symbol)
                    d = dirname(s.__file__)
                else:
                    modname = components[0]
                    mod = __import__(modname, globals(), locals(), [])
                    d = dirname(mod.__file__)

                files.extend(get_tests_in_dir(d))
            except __HOLE__:
                msg = 'Warning: %s is neither a file/directory or '\
                      'module. Ignoring.'%test
                print(msg)
    return files
dataset/ETHPy150Open enthought/mayavi/mayavi/tests/runtests.py/find_tests