nodes: 0, module; 1, function_definition; 2, function_name:to_json; 3, parameters; 4, block; 5, identifier:self; 6, keyword_separator; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, return_statement; 11, identifier:indent; 12, None; 13, identifier:sort_keys; 14, False; 15, comment:"""Gets the object's JSON representation.
  
          Parameters
          ----------
          indent: :class:`int`, optional
              Number of spaces used as indentation, ``None`` will return the shortest possible string.
          sort_keys: :class:`bool`, optional
              Whether keys should be sorted alphabetically or preserve the order defined by the object.
  
          Returns
          -------
          :class:`str`
              JSON representation of the object.
          """; 16, call; 17, attribute; 18, argument_list; 19, identifier:json; 20, identifier:dumps; 21, dictionary_comprehension; 22, keyword_argument; 23, keyword_argument; 24, keyword_argument; 25, pair; 26, for_in_clause; 27, if_clause; 28, identifier:indent; 29, identifier:indent; 30, identifier:sort_keys; 31, identifier:sort_keys; 32, identifier:default; 33, attribute; 34, identifier:k; 35, identifier:v; 36, pattern_list; 37, call; 38, comparison_operator:v is not None; 39, identifier:self; 40, identifier:_try_dict; 41, identifier:k; 42, identifier:v; 43, attribute; 44, argument_list; 45, identifier:v; 46, None; 47, call; 48, identifier:items; 49, identifier:dict; 50, argument_list; 51, identifier:self
code: def to_json(self, *, indent=None, sort_keys = False):
          """Gets the object's JSON representation.
  
          Parameters
          ----------
          indent: :class:`int`, optional
              Number of spaces used as indentation, ``None`` will return the shortest possible string.
          sort_keys: :class:`bool`, optional
              Whether keys should be sorted alphabetically or preserve the order defined by the object.
  
          Returns
          -------
          :class:`str`
              JSON representation of the object.
          """
          return json.dumps({k: v for k, v in dict(self).items() if v is not None}, indent=indent, sort_keys=sort_keys,
                            default=self._try_dict)