def check_stamp(filename, contents=None):
    'Check that a given stamp file is up-to-date.\n\n  Returns: False is the file does not exists or is older that that given\n    comparison file, or does not contain the given contents. True otherwise.\n  '
    if (not os.path.exists(filename)):
        return False
    if (contents is not None):
        with open(filename) as f:
            if (not f.read().startswith(contents)):
                return False
    return True
Check that a given stamp file is up-to-date.

Returns: False is the file does not exists or is older that that given
  comparison file, or does not contain the given contents. True otherwise.
def check_stamp(filename, contents=None):
    'Check that a given stamp file is up-to-date.\n\n  Returns: False is the file does not exists or is older that that given\n    comparison file, or does not contain the given contents. True otherwise.\n  '
    if (not os.path.exists(filename)):
        return False
    if (contents is not None):
        with open(filename) as f:
            if (not f.read().startswith(contents)):
                return False
    return True