<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _resolve_hostname(name):
 """Returns resolved hostname using the ssh config"""

    if env.ssh_config is None:
        return name
    elif not os.path.exists(os.path.join("nodes", name + ".json")):
        resolved_name = env.ssh_config.lookup(name)['hostname']
        if os.path.exists(os.path.join("nodes", resolved_name + ".json")):
            name = resolved_name
    return name