<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def base_link(rel, self_rel=False):
 """Helper for getting a link document under the API root, given a rel."""

    link = _BASE_LINKS[rel].copy()
    link['rel'] = 'self' if self_rel else rel
    return link