def list_local(paths, prefix=None):
results = []<EOL>for path in paths:<EOL><INDENT>if os.path.isdir(path):<EOL><INDENT>for filename in os.listdir(path):<EOL><INDENT>fullpath = os.path.join(path, filename)<EOL>if os.path.isdir(fullpath):<EOL><INDENT>results += list_local([fullpath], prefix)<EOL><DEDENT>else:<EOL><INDENT>fullname = fullpath<EOL>if prefix and fullname.startswith(prefix):<EOL><INDENT>fullname = fullname[len(prefix):]<EOL><DEDENT>mtime = datetime.datetime.fromtimestamp(<EOL>os.path.getmtime(fullpath), tz=utc)<EOL>results += [{"<STR_LIT>": fullname,<EOL>"<STR_LIT>": mtime.strftime(<EOL>'<STR_LIT>')}]<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>fullpath = path<EOL>fullname = fullpath<EOL>if prefix and fullname.startswith(prefix):<EOL><INDENT>fullname = fullname[len(prefix):]<EOL><DEDENT>mtime = datetime.datetime.fromtimestamp(<EOL>os.path.getmtime(fullpath), tz=utc)<EOL>results += [{"<STR_LIT>": fullname,<EOL>"<STR_LIT>": mtime.strftime(<EOL>'<STR_LIT>')}]<EOL><DEDENT><DEDENT>return results<EOL>
Returns a list of all files (recursively) present in a directory
with their timestamp.

Example:
[{ "Key": "abc.txt",
   "LastModified": "Mon, 05 Jan 2015 12:00:00 UTC"},
 { "Key": "def.txt",
   "LastModified": "Mon, 05 Jan 2015 12:00:001 UTC"},
]