<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def hard_path(path, prefix_dir):
 """Returns an absolute path to either the relative or absolute file."""

    relative = abspath("%s/%s" % (prefix_dir, path))
    a_path = abspath(path)
    if os.path.exists(relative):
        LOG.debug("using relative path %s (%s)", relative, path)
        return relative

    LOG.debug("using absolute path %s", a_path)
    return a_path