def METHOD_NAME(target, base_path=os.curdir):
    """\
    Return a relative path to the target from either the current directory
    or an optional base directory.
    Base can be a directory specified either as absolute or relative
    to current directory."""
    # http://code.activestate.com/recipes/302594/
    base_path = normcase(abspath(normpath(base_path)))
    target = normcase(abspath(normpath(target)))
    if base_path == target:
        return '.'
    # On the windows platform the target may be on a different drive.
    if splitdrive(base_path)[0] != splitdrive(target)[0]:
        return None
    common_path_len = len(commonpath(base_path, target))
    # If there's no common prefix decrease common_path_len should be less by 1
    base_drv, base_dir = splitdrive(base_path)
    if common_path_len == len(base_drv) + 1:
        common_path_len -= 1
    # if base_path is root directory - no directories up
    if base_dir == os.sep:
        dirs_up = 0
    else:
        dirs_up = base_path[common_path_len:].count(os.sep)
    ret = os.sep.join([os.pardir] * dirs_up)
    if len(target) > common_path_len:
        ret = path_join(ret, target[common_path_len + 1:])
    return ret