nodes: 0, module; 1, function_definition; 2, function_name:save_json; 3, parameters; 4, comment:# type: (Dict, str, bool, bool) -> None; 5, block; 6, identifier:dictionary; 7, identifier:path; 8, default_parameter; 9, default_parameter; 10, expression_statement; 11, with_statement; 12, identifier:pretty; 13, False; 14, identifier:sortkeys; 15, False; 16, comment:"""Save dictionary to JSON file preserving order if it is an OrderedDict
  
      Args:
          dictionary (Dict): Python dictionary to save
          path (str): Path to JSON file
          pretty (bool): Whether to pretty print. Defaults to False.
          sortkeys (bool): Whether to sort dictionary keys. Defaults to False.
  
      Returns:
          None
      """; 17, with_clause; 18, block; 19, with_item; 20, if_statement; 21, expression_statement; 22, as_pattern; 23, identifier:pretty; 24, block; 25, else_clause; 26, call; 27, call; 28, as_pattern_target; 29, expression_statement; 30, expression_statement; 31, block; 32, attribute; 33, argument_list; 34, identifier:open; 35, argument_list; 36, identifier:f; 37, assignment; 38, assignment; 39, expression_statement; 40, expression_statement; 41, identifier:json; 42, identifier:dump; 43, identifier:dictionary; 44, identifier:f; 45, keyword_argument; 46, keyword_argument; 47, keyword_argument; 48, identifier:path; 49, string; 50, identifier:indent; 51, integer:2; 52, identifier:separators; 53, tuple; 54, assignment; 55, assignment; 56, identifier:indent; 57, identifier:indent; 58, identifier:sort_keys; 59, identifier:sortkeys; 60, identifier:separators; 61, identifier:separators; 62, string_content:w; 63, string; 64, string; 65, identifier:indent; 66, None; 67, identifier:separators; 68, tuple; 69, string_content:,; 70, string_content::; 71, string; 72, string; 73, string_content:,; 74, string_content::
code: def save_json(dictionary, path, pretty=False, sortkeys=False):
      # type: (Dict, str, bool, bool) -> None
      """Save dictionary to JSON file preserving order if it is an OrderedDict
  
      Args:
          dictionary (Dict): Python dictionary to save
          path (str): Path to JSON file
          pretty (bool): Whether to pretty print. Defaults to False.
          sortkeys (bool): Whether to sort dictionary keys. Defaults to False.
  
      Returns:
          None
      """
      with open(path, 'w') as f:
          if pretty:
              indent = 2
              separators = (',', ': ')
          else:
              indent = None
              separators = (', ', ': ')
          json.dump(dictionary, f, indent=indent, sort_keys=sortkeys, separators=separators)