def fingerprint(dirnames, prefix=None, previous=[]):<EOL>
results = []<EOL>for dirname in dirnames:<EOL><INDENT>for filename in os.listdir(dirname):<EOL><INDENT>fullpath = os.path.join(dirname, filename)<EOL>if os.path.isdir(fullpath):<EOL><INDENT>results += fingerprint(<EOL>[fullpath], prefix=filename, previous=previous)<EOL><DEDENT>else:<EOL><INDENT>fullname = fullpath<EOL>if prefix and fullname.startswith(prefix):<EOL><INDENT>fullname = fullname[len(prefix):]<EOL><DEDENT>found = False<EOL>for prevpath in previous:<EOL><INDENT>if fullname == prevpath['<STR_LIT>']:<EOL><INDENT>found = True<EOL>break<EOL><DEDENT><DEDENT>if not found:<EOL><INDENT>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><DEDENT>return results<EOL>
Returns a list of paths available from *dirname*. When previous
is specified, returns a list of additional files only.

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"},
]