code: def if_relationship(parser, token):
      
      bits = list(token.split_contents())
      if len(bits) != 4:
          raise TemplateSyntaxError("%r takes 3 arguments:\n%s" % (bits[0], if_relationship.__doc__))
      end_tag = 'end' + bits[0]
      nodelist_true = parser.parse(('else', end_tag))
      token = parser.next_token()
      if token.contents == 'else':
          nodelist_false = parser.parse((end_tag,))
          parser.delete_first_token()
      else:
          nodelist_false = template.NodeList()
      return IfRelationshipNode(nodelist_true, nodelist_false, *bits[1:])
docs: Determine if a certain type of relationship exists between two users.
      The ``status`` parameter must be a slug matching either the from_slug,
      to_slug or symmetrical_slug of a RelationshipStatus.
  
      Example::
  
          {% if_relationship from_user to_user "friends" %}
              Here are pictures of me drinking alcohol
          {% else %}
              Sorry coworkers
          {% endif_relationship %}
  
          {% if_relationship from_user to_user "blocking" %}
              damn seo experts
          {% endif_relationship %}