def clone_psql_db(db_to_clone):
<EOL>if os.path.isfile(db_to_clone):<EOL><INDENT>logger.info("<STR_LIT>", repr(db_to_clone))<EOL>populate_db(db_to_clone)<EOL><DEDENT>else:<EOL><INDENT>logger.info("<STR_LIT>", repr(db_to_clone))<EOL>with NamedTemporaryFile(prefix="<STR_LIT>".format(db_to_clone)) as backup_file:<EOL><INDENT>pg_dump(db_to_clone, backup_file.name)<EOL>populate_db(backup_file.name)<EOL><DEDENT><DEDENT>
Clone `db_to_clone` into DATABASES['default']