def get_database_size(db_user, db_name, localhost=False):
localhost_part = '<STR_LIT>'<EOL>if localhost:<EOL><INDENT>localhost_part = '<STR_LIT>'<EOL><DEDENT>cmd = '<STR_LIT>'.format(<EOL>localhost_part, db_user, db_name)<EOL>total = getoutput(cmd).split()[<NUM_LIT:2>]<EOL>return int(total)<EOL>
Returns the total size for the given database role and name.

:param db_user: String representing the database role.
:param db_name: String representing the database name.