nodes: 0, module; 1, function_definition; 2, function_name:list_refs; 3, parameters; 4, block; 5, identifier:profile; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, identifier:ref_type; 14, None; 15, comment:"""List all refs.
  
      Args:
  
          profile
              A profile generated from ``simplygithub.authentication.profile``.
              Such profiles tell this module (i) the ``repo`` to connect to,
              and (ii) the ``token`` to connect with.
  
          ref_type
              The type of ref you want. For heads, it's ``heads``. For tags,
              it's ``tags``. That sort of thing. If you don't specify a type,
              all refs are returned.
  
      Returns:
          A list of dicts with data about each ref.
  
      """; 16, assignment; 17, identifier:ref_type; 18, block; 19, assignment; 20, assignment; 21, identifier:result; 22, identifier:resource; 23, string:"/refs"; 24, expression_statement; 25, identifier:data; 26, call; 27, identifier:result; 28, list_comprehension; 29, augmented_assignment; 30, attribute; 31, argument_list; 32, call; 33, for_in_clause; 34, identifier:resource; 35, binary_operator:"/" + ref_type; 36, identifier:api; 37, identifier:get_request; 38, identifier:profile; 39, identifier:resource; 40, identifier:prepare; 41, argument_list; 42, identifier:x; 43, identifier:data; 44, string:"/"; 45, identifier:ref_type; 46, identifier:x
code: def list_refs(profile, ref_type=None):
      """List all refs.
  
      Args:
  
          profile
              A profile generated from ``simplygithub.authentication.profile``.
              Such profiles tell this module (i) the ``repo`` to connect to,
              and (ii) the ``token`` to connect with.
  
          ref_type
              The type of ref you want. For heads, it's ``heads``. For tags,
              it's ``tags``. That sort of thing. If you don't specify a type,
              all refs are returned.
  
      Returns:
          A list of dicts with data about each ref.
  
      """
      resource = "/refs"
      if ref_type:
          resource += "/" + ref_type
      data = api.get_request(profile, resource)
      result = [prepare(x) for x in data]
      return result