<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_config_filename(metadata):
 """ Derive a configuration file name from the FOO_SETTINGS environment variable. """

    envvar = "{}__SETTINGS".format(underscore(metadata.name).upper())
    try:
        return environ[envvar]
    except KeyError:
        return None