<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def local_link(local_fn, remote_fn, staging):
 """ Creates a symlink to a local staging area. The link name is built from `remote_fn`, but the absolute path is put inside the staging directory. Example ------- If we have the following initial setup:: cwd="/home/user" local="data/sample1.bw" remote="/hubs/hg19/a.bw" staging="__staging__" Then this function does the equivalent of:: mkdir -p __staging__/hubs/hg19 ln -sf \\ /home/user/data/sample1.bw \\ /home/user/__staging__/hubs/hg19/a.bw """

    linkname = os.path.join(staging, remote_fn.lstrip(os.path.sep))
    return symlink(local_fn, linkname)