def ListFiles(directory):
from six.moves.urllib.parse import urlparse<EOL>directory_url = urlparse(directory)<EOL>if _UrlIsLocal(directory_url):<EOL><INDENT>if not os.path.isdir(directory):<EOL><INDENT>return None<EOL><DEDENT>return os.listdir(directory)<EOL><DEDENT>elif directory_url.scheme == '<STR_LIT>':<EOL><INDENT>from ._exceptions import NotImplementedProtocol<EOL>raise NotImplementedProtocol(directory_url.scheme)<EOL><DEDENT>else:<EOL><INDENT>from ._exceptions import NotImplementedProtocol<EOL>raise NotImplementedProtocol(directory_url.scheme)<EOL><DEDENT>
Lists the files in the given directory

:type directory: unicode | unicode
:param directory:
    A directory or URL

:rtype: list(unicode) | list(unicode)
:returns:
    List of filenames/directories found in the given directory.
    Returns None if the given directory does not exists.

    If `directory` is a unicode string, all files returned will also be unicode

:raises NotImplementedProtocol:
    If file protocol is not local or FTP

.. seealso:: FTP LIMITATIONS at this module's doc for performance issues information