docs: def sorted_maybe_numeric(x):
      """
      Sorts x with numeric semantics if all keys are nonnegative integers.
      Otherwise uses standard string sorting.
      """
      all_numeric = all(map(str.isdigit, x))
      if all_numeric:
          return sorted(x, key=int)
      else:
          return sorted(x)