nodes: 0, module; 1, function_definition; 2, function_name:_common_query_parameters; 3, parameters; 4, block; 5, identifier:self; 6, identifier:doc_type; 7, identifier:includes; 8, identifier:owner; 9, identifier:promulgated_only; 10, identifier:series; 11, identifier:sort; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, if_statement; 16, if_statement; 17, if_statement; 18, if_statement; 19, if_statement; 20, return_statement; 21, string; 22, assignment; 23, comparison_operator:includes is not None; 24, block; 25, comparison_operator:doc_type is not None; 26, block; 27, identifier:promulgated_only; 28, block; 29, comparison_operator:owner is not None; 30, block; 31, comparison_operator:series is not None; 32, block; 33, comparison_operator:sort is not None; 34, block; 35, identifier:queries; 36, string_content:Extract common query parameters between search and list into slice.
  
          @param includes What metadata to return in results (e.g. charm-config).
          @param doc_type Filter to this type: bundle or charm.
          @param promulgated_only Whether to filter to only promulgated charms.
          @param sort Sorting the result based on the sort string provided
              which can be name, author, series and - in front for descending.
          @param owner Optional owner. If provided, search results will only
              include entities that owner can view.
          @param series The series to filter; can be a list of series or a
              single series.; 37, identifier:queries; 38, list; 39, identifier:includes; 40, None; 41, expression_statement; 42, identifier:doc_type; 43, None; 44, expression_statement; 45, expression_statement; 46, identifier:owner; 47, None; 48, expression_statement; 49, identifier:series; 50, None; 51, if_statement; 52, expression_statement; 53, identifier:sort; 54, None; 55, expression_statement; 56, call; 57, call; 58, call; 59, call; 60, comparison_operator:type(series) is list; 61, block; 62, call; 63, call; 64, attribute; 65, argument_list; 66, attribute; 67, argument_list; 68, attribute; 69, argument_list; 70, attribute; 71, argument_list; 72, call; 73, identifier:list; 74, expression_statement; 75, attribute; 76, argument_list; 77, attribute; 78, argument_list; 79, identifier:queries; 80, identifier:extend; 81, list_comprehension; 82, identifier:queries; 83, identifier:append; 84, tuple; 85, identifier:queries; 86, identifier:append; 87, tuple; 88, identifier:queries; 89, identifier:append; 90, tuple; 91, identifier:type; 92, argument_list; 93, assignment; 94, identifier:queries; 95, identifier:append; 96, tuple; 97, identifier:queries; 98, identifier:append; 99, tuple; 100, tuple; 101, for_in_clause; 102, string; 103, identifier:doc_type; 104, string; 105, integer:1; 106, string; 107, identifier:owner; 108, identifier:series; 109, identifier:series; 110, call; 111, string; 112, identifier:series; 113, string; 114, identifier:sort; 115, string; 116, identifier:include; 117, identifier:include; 118, identifier:includes; 119, string_content:type; 120, string_content:promulgated; 121, string_content:owner; 122, attribute; 123, argument_list; 124, string_content:series; 125, string_content:sort; 126, string_content:include; 127, string; 128, identifier:join; 129, identifier:series; 130, string_content:,
code: def _common_query_parameters(self, doc_type, includes, owner,
                                   promulgated_only, series, sort):
          '''
          Extract common query parameters between search and list into slice.
  
          @param includes What metadata to return in results (e.g. charm-config).
          @param doc_type Filter to this type: bundle or charm.
          @param promulgated_only Whether to filter to only promulgated charms.
          @param sort Sorting the result based on the sort string provided
              which can be name, author, series and - in front for descending.
          @param owner Optional owner. If provided, search results will only
              include entities that owner can view.
          @param series The series to filter; can be a list of series or a
              single series.
          '''
          queries = []
          if includes is not None:
              queries.extend([('include', include) for include in includes])
          if doc_type is not None:
              queries.append(('type', doc_type))
          if promulgated_only:
              queries.append(('promulgated', 1))
          if owner is not None:
              queries.append(('owner', owner))
          if series is not None:
              if type(series) is list:
                  series = ','.join(series)
              queries.append(('series', series))
          if sort is not None:
              queries.append(('sort', sort))
          return queries