parameters: (self, user, instance)
return_statement: return queryset.filter(user=user).exists()
docstring: Check if a user is following an instance.
docstring_summary: Check if a user is following an instance.
docstring_tokens: Check if a user is following an instance .
function: def is_following(self, user, instance):
          """
          Check if a user is following an instance.
          """
          if not user or user.is_anonymous():
              return False
          queryset = self.for_object(instance)
          return queryset.filter(user=user).exists()
function_tokens: def is_following ( self , user , instance ) : if not user or user . is_anonymous ( ) : return False queryset = self . for_object ( instance ) return queryset . filter ( user = user ) . exists ( )