original_docstring: 
      Custom function to check that a user is allowed to access the provided object storage
      paths.
      
docstring: Custom function to check that a user is allowed to access the provided object storage
  paths.
docstring_tokens: Custom function to check that a user is allowed to access the provided object storage paths .
code: def validate_paths(user, string):
      """
      Custom function to check that a user is allowed to access the provided object storage
      paths.
      """
      path_list = [s.strip() for s in string.split(',')]
      for path in path_list:
          path_parts = pathlib.Path(path).parts
          if path_parts[0] != user.username:
              if len(path_parts) == 1 or path_parts[1] == 'uploads':
                  raise serializers.ValidationError(
                      ["You do not have permission to access this path."])
              try:
                  # file paths should be of the form <username>/feed_<id>/..
                  feed_id = path_parts[1].split('_')[-1]
                  feed = Feed.objects.get(pk=feed_id)
              except (ValueError, Feed.DoesNotExist):
                  raise serializers.ValidationError(
                      ["This field may not be an invalid path."])
              if user not in feed.owner.all():
                  raise serializers.ValidationError(
                      ["You do not have permission to access this path."])
      return ','.join(path_list)
code_tokens: def validate_paths ( user , string ) : path_list = [ s . strip ( ) for s in string . split ( ',' ) ] for path in path_list : path_parts = pathlib . Path ( path ) . parts if path_parts [ 0 ] != user . username : if len ( path_parts ) == 1 or path_parts [ 1 ] == 'uploads' : raise serializers . ValidationError ( [ "You do not have permission to access this path." ] ) try : feed_id = path_parts [ 1 ] . split ( '_' ) [ - 1 ] feed = Feed . objects . get ( pk = feed_id ) except ( ValueError , Feed . DoesNotExist ) : raise serializers . ValidationError ( [ "This field may not be an invalid path." ] ) if user not in feed . owner . all ( ) : raise serializers . ValidationError ( [ "You do not have permission to access this path." ] ) return ',' . join ( path_list )
short_docstring: Custom function to check that a user is allowed to access the provided object storage
  paths.
short_docstring_tokens: Custom function to check that a user is allowed to access the provided object storage paths .
comment: """
      Custom function to check that a user is allowed to access the provided object storage
      paths.
      """$SEP$# file paths should be of the form <username>/feed_<id>/..