code: def base_link(rel, self_rel=False):
      
      link = _BASE_LINKS[rel].copy()
      link['rel'] = 'self' if self_rel else rel
      return link
docs: Helper for getting a link document under the API root, given a rel.