nodes: 0, module; 1, function_definition; 2, function_name:validate_argsort_with_ascending; 3, parameters; 4, block; 5, identifier:ascending; 6, identifier:args; 7, identifier:kwargs; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, return_statement; 12, comment:"""
      If 'Categorical.argsort' is called via the 'numpy' library, the
      first parameter in its signature is 'axis', which takes either
      an integer or 'None', so check if the 'ascending' parameter has
      either integer type or is None, since 'ascending' itself should
      be a boolean
      """; 13, boolean_operator; 14, block; 15, call; 16, identifier:ascending; 17, call; 18, comparison_operator:ascending is None; 19, expression_statement; 20, expression_statement; 21, identifier:validate_argsort_kind; 22, argument_list; 23, identifier:is_integer; 24, argument_list; 25, identifier:ascending; 26, None; 27, assignment; 28, assignment; 29, identifier:args; 30, identifier:kwargs; 31, keyword_argument; 32, identifier:ascending; 33, identifier:args; 34, binary_operator:(ascending,) + args; 35, identifier:ascending; 36, True; 37, identifier:max_fname_arg_count; 38, integer:3; 39, tuple; 40, identifier:args; 41, identifier:ascending
code: def validate_argsort_with_ascending(ascending, args, kwargs):
      """
      If 'Categorical.argsort' is called via the 'numpy' library, the
      first parameter in its signature is 'axis', which takes either
      an integer or 'None', so check if the 'ascending' parameter has
      either integer type or is None, since 'ascending' itself should
      be a boolean
      """
  
      if is_integer(ascending) or ascending is None:
          args = (ascending,) + args
          ascending = True
  
      validate_argsort_kind(args, kwargs, max_fname_arg_count=3)
      return ascending