def config_fname():
    """
    Get the location of the config file.

    Looks for pystepsrc file in the following order:
    - $PWD/pystepsrc: Looks for the file in the current directory
    - $PYSTEPSRC: If the system variable $PYSTEPSRC is defined and it points
    to a file, it is used..
    - $PYSTEPSRC/pystepsrc: If $PYSTEPSRC points to a directory, it looks for
    the pystepsrc file inside that directory.
    - $HOME/.pysteps/pystepsrc (unix and Mac OS X) :
    If the system variable $HOME is defined, it looks
    for the configuration file in this path.
    - $USERPROFILE/pysteps/pystepsrc (windows only): It looks for the
    configuration file in the pysteps directory located user's home directory.
    - Lastly, it looks inside the library in pysteps/pystepsrc for a
    system-defined copy.
    """

    file_name = None
    for file_name in _fconfig_candidates_generator():
        if file_name is not None:
            if os.path.exists(file_name):
                st_mode = os.stat(file_name).st_mode
                if stat.S_ISREG(st_mode) or stat.S_ISFIFO(st_mode):
                    return file_name

            # Return first candidate that is a file,
            # or last candidate if none is valid
            # (in that case, a warning is raised at startup by `rc_params`).

    return file_name
Get the location of the config file.

Looks for pystepsrc file in the following order:
- $PWD/pystepsrc: Looks for the file in the current directory
- $PYSTEPSRC: If the system variable $PYSTEPSRC is defined and it points
to a file, it is used..
- $PYSTEPSRC/pystepsrc: If $PYSTEPSRC points to a directory, it looks for
the pystepsrc file inside that directory.
- $HOME/.pysteps/pystepsrc (unix and Mac OS X) :
If the system variable $HOME is defined, it looks
for the configuration file in this path.
- $USERPROFILE/pysteps/pystepsrc (windows only): It looks for the
configuration file in the pysteps directory located user's home directory.
- Lastly, it looks inside the library in pysteps/pystepsrc for a
system-defined copy.
pysteps/__init__.py