nodes: 0, module; 1, function_definition; 2, function_name:from_url; 3, parameters; 4, block; 5, identifier:reddit_session; 6, identifier:url; 7, default_parameter; 8, default_parameter; 9, default_parameter; 10, default_parameter; 11, expression_statement; 12, if_statement; 13, expression_statement; 14, expression_statement; 15, expression_statement; 16, expression_statement; 17, expression_statement; 18, if_statement; 19, if_statement; 20, expression_statement; 21, if_statement; 22, expression_statement; 23, expression_statement; 24, comment:# pylint: disable=W0212; 25, expression_statement; 26, comment:# pylint: disable=W0212; 27, return_statement; 28, identifier:comment_limit; 29, integer:0; 30, identifier:comment_sort; 31, None; 32, identifier:comments_only; 33, False; 34, identifier:params; 35, None; 36, comment:"""Request the url and return a Submission object.
  
          :param reddit_session: The session to make the request with.
          :param url: The url to build the Submission object from.
          :param comment_limit: The desired number of comments to fetch. If <= 0
              fetch the default number for the session's user. If None, fetch the
              maximum possible.
          :param comment_sort: The sort order for retrieved comments. When None
              use the default for the session's user.
          :param comments_only: Return only the list of comments.
          :param params: dictionary containing extra GET data to put in the url.
  
          """; 37, comparison_operator:params is None; 38, block; 39, assignment; 40, assignment; 41, assignment; 42, call; 43, assignment; 44, comparison_operator:comment_limit is None; 45, comment:# Fetch MAX; 46, block; 47, elif_clause; 48, identifier:comment_sort; 49, block; 50, assignment; 51, identifier:comments_only; 52, block; 53, assignment; 54, assignment; 55, assignment; 56, identifier:submission; 57, identifier:params; 58, None; 59, expression_statement; 60, identifier:parsed; 61, call; 62, identifier:query_pairs; 63, call; 64, identifier:get_params; 65, call; 66, attribute; 67, argument_list; 68, identifier:url; 69, call; 70, identifier:comment_limit; 71, None; 72, expression_statement; 73, comment:# Just use a big number; 74, comparison_operator:comment_limit > 0; 75, comment:# Use value; 76, block; 77, expression_statement; 78, identifier:response; 79, call; 80, return_statement; 81, identifier:submission; 82, call; 83, attribute; 84, identifier:comment_sort; 85, attribute; 86, identifier:params; 87, assignment; 88, identifier:urlparse; 89, argument_list; 90, identifier:parse_qs; 91, argument_list; 92, identifier:dict; 93, generator_expression; 94, identifier:params; 95, identifier:update; 96, identifier:get_params; 97, identifier:urlunparse; 98, argument_list; 99, assignment; 100, identifier:comment_limit; 101, integer:0; 102, expression_statement; 103, assignment; 104, attribute; 105, argument_list; 106, subscript; 107, attribute; 108, argument_list; 109, identifier:submission; 110, identifier:_comment_sort; 111, identifier:submission; 112, identifier:_params; 113, identifier:params; 114, dictionary; 115, identifier:url; 116, attribute; 117, tuple; 118, for_in_clause; 119, binary_operator:parsed[:3] + ("", "", ""); 120, subscript; 121, integer:2048; 122, assignment; 123, subscript; 124, identifier:comment_sort; 125, identifier:reddit_session; 126, identifier:request_json; 127, identifier:url; 128, keyword_argument; 129, subscript; 130, string; 131, identifier:Submission; 132, identifier:from_json; 133, identifier:response; 134, identifier:parsed; 135, identifier:query; 136, identifier:k; 137, call; 138, pattern_list; 139, call; 140, subscript; 141, tuple; 142, identifier:params; 143, string; 144, subscript; 145, identifier:comment_limit; 146, identifier:params; 147, string; 148, identifier:params; 149, identifier:params; 150, subscript; 151, string; 152, string_content:children; 153, attribute; 154, argument_list; 155, identifier:k; 156, identifier:v; 157, attribute; 158, argument_list; 159, identifier:parsed; 160, slice; 161, string:""; 162, string:""; 163, string:""; 164, string_content:limit; 165, identifier:params; 166, string; 167, string_content:sort; 168, identifier:response; 169, integer:1; 170, string_content:data; 171, string:","; 172, identifier:join; 173, identifier:v; 174, identifier:query_pairs; 175, identifier:items; 176, integer:3; 177, string_content:limit
code: def from_url(reddit_session, url, comment_limit=0, comment_sort=None,
                   comments_only=False, params=None):
          """Request the url and return a Submission object.
  
          :param reddit_session: The session to make the request with.
          :param url: The url to build the Submission object from.
          :param comment_limit: The desired number of comments to fetch. If <= 0
              fetch the default number for the session's user. If None, fetch the
              maximum possible.
          :param comment_sort: The sort order for retrieved comments. When None
              use the default for the session's user.
          :param comments_only: Return only the list of comments.
          :param params: dictionary containing extra GET data to put in the url.
  
          """
          if params is None:
              params = {}
  
          parsed = urlparse(url)
          query_pairs = parse_qs(parsed.query)
          get_params = dict((k, ",".join(v)) for k, v in query_pairs.items())
          params.update(get_params)
          url = urlunparse(parsed[:3] + ("", "", ""))
          if comment_limit is None:  # Fetch MAX
              params['limit'] = 2048  # Just use a big number
          elif comment_limit > 0:  # Use value
              params['limit'] = comment_limit
          if comment_sort:
              params['sort'] = comment_sort
  
          response = reddit_session.request_json(url, params=params)
          if comments_only:
              return response[1]['data']['children']
          submission = Submission.from_json(response)
          submission._comment_sort = comment_sort  # pylint: disable=W0212
          submission._params = params  # pylint: disable=W0212
          return submission