nodes: 0, module; 1, function_definition; 2, function_name:parse; 3, parameters; 4, block; 5, identifier:cls; 6, identifier:querydict; 7, expression_statement; 8, for_statement; 9, expression_statement; 10, return_statement; 11, comment:""" Parse querydict data.
  
          There are expected agruments:
              distinct, fields, filter, include, page, sort
  
          Parameters
          ----------
          querydict : django.http.request.QueryDict
              MultiValueDict with query arguments.
  
          Returns
          -------
          result : dict
              dictionary in format {key: value}.
  
          Raises
          ------
          ValueError
              If args consist of not know key.
  
          """; 12, identifier:key; 13, call; 14, block; 15, assignment; 16, identifier:result; 17, attribute; 18, argument_list; 19, if_statement; 20, identifier:result; 21, call; 22, identifier:querydict; 23, identifier:keys; 24, not_operator; 25, block; 26, identifier:JSONAPIQueryDict; 27, argument_list; 28, call; 29, expression_statement; 30, raise_statement; 31, keyword_argument; 32, keyword_argument; 33, keyword_argument; 34, keyword_argument; 35, keyword_argument; 36, keyword_argument; 37, identifier:any; 38, argument_list; 39, assignment; 40, call; 41, identifier:distinct; 42, call; 43, identifier:fields; 44, call; 45, identifier:filter; 46, call; 47, identifier:include; 48, call; 49, identifier:page; 50, conditional_expression:int(querydict.get('page')) if querydict.get('page') else None; 51, identifier:sort; 52, call; 53, tuple; 54, identifier:msg; 55, call; 56, identifier:ValueError; 57, argument_list; 58, attribute; 59, argument_list; 60, attribute; 61, argument_list; 62, attribute; 63, argument_list; 64, attribute; 65, argument_list; 66, call; 67, call; 68, None; 69, attribute; 70, argument_list; 71, comparison_operator:key in JSONAPIQueryDict._fields; 72, call; 73, attribute; 74, argument_list; 75, identifier:msg; 76, identifier:cls; 77, identifier:prepare_values; 78, call; 79, identifier:cls; 80, identifier:parse_fields; 81, identifier:querydict; 82, identifier:querydict; 83, identifier:getlist; 84, string; 85, identifier:cls; 86, identifier:prepare_values; 87, call; 88, identifier:int; 89, argument_list; 90, attribute; 91, argument_list; 92, identifier:cls; 93, identifier:prepare_values; 94, call; 95, identifier:key; 96, attribute; 97, attribute; 98, argument_list; 99, string:"Query parameter {} is not known"; 100, identifier:format; 101, identifier:key; 102, attribute; 103, argument_list; 104, string_content:filter; 105, attribute; 106, argument_list; 107, call; 108, identifier:querydict; 109, identifier:get; 110, string; 111, attribute; 112, argument_list; 113, identifier:JSONAPIQueryDict; 114, identifier:_fields; 115, attribute; 116, identifier:match; 117, identifier:key; 118, identifier:querydict; 119, identifier:getlist; 120, string; 121, identifier:querydict; 122, identifier:getlist; 123, string; 124, attribute; 125, argument_list; 126, string_content:page; 127, identifier:querydict; 128, identifier:getlist; 129, string; 130, identifier:cls; 131, identifier:RE_FIELDS; 132, string_content:distinct; 133, string_content:include; 134, identifier:querydict; 135, identifier:get; 136, string; 137, string_content:sort; 138, string_content:page
code: def parse(cls, querydict):
          """ Parse querydict data.
  
          There are expected agruments:
              distinct, fields, filter, include, page, sort
  
          Parameters
          ----------
          querydict : django.http.request.QueryDict
              MultiValueDict with query arguments.
  
          Returns
          -------
          result : dict
              dictionary in format {key: value}.
  
          Raises
          ------
          ValueError
              If args consist of not know key.
  
          """
          for key in querydict.keys():
              if not any((key in JSONAPIQueryDict._fields,
                          cls.RE_FIELDS.match(key))):
  
                  msg = "Query parameter {} is not known".format(key)
                  raise ValueError(msg)
  
          result = JSONAPIQueryDict(
              distinct=cls.prepare_values(querydict.getlist('distinct')),
              fields=cls.parse_fields(querydict),
              filter=querydict.getlist('filter'),
              include=cls.prepare_values(querydict.getlist('include')),
              page=int(querydict.get('page')) if querydict.get('page') else None,
              sort=cls.prepare_values(querydict.getlist('sort'))
          )
  
          return result