code: def verify_temp_column_name(
      df: Union["DataFrame", PySparkDataFrame],
      column_name_or_label: Union[str, Name],
  ) -> Union[str, Label]:
      """
      Verify that the given column name does not exist in the given pandas-on-Spark or
      Spark DataFrame.
  
      The temporary column names should start and end with `__`. In addition, `column_name_or_label`
      expects a single string, or column labels when `df` is a pandas-on-Spark DataFrame.
  
      >>> psdf = ps.DataFrame({("x", "a"): ['a', 'b', 'c']})
      >>> psdf["__dummy__"] = 0
      >>> psdf[("", "__dummy__")] = 1
      >>> psdf  # doctest: +NORMALIZE_WHITESPACE
         x __dummy__
         a           __dummy__
      0  a         0         1
      1  b         0         1
      2  c         0         1
  
      >>> verify_temp_column_name(psdf, '__tmp__')
      ('__tmp__', '')
      >>> verify_temp_column_name(psdf, ('', '__tmp__'))
      ('', '__tmp__')
      >>> verify_temp_column_name(psdf, '__dummy__')
      Traceback (most recent call last):
      ...
      AssertionError: ... `(__dummy__, )` ...
      >>> verify_temp_column_name(psdf, ('', '__dummy__'))
      Traceback (most recent call last):
      ...
      AssertionError: ... `(, __dummy__)` ...
      >>> verify_temp_column_name(psdf, 'dummy')
      Traceback (most recent call last):
      ...
      AssertionError: ... should be empty or start and end with `__`: ('dummy', '')
      >>> verify_temp_column_name(psdf, ('', 'dummy'))
      Traceback (most recent call last):
      ...
      AssertionError: ... should be empty or start and end with `__`: ('', 'dummy')
  
      >>> internal = psdf._internal.resolved_copy
      >>> sdf = internal.spark_frame
      >>> sdf.select(internal.data_spark_columns).show()  # doctest: +NORMALIZE_WHITESPACE
      +------+---------+-------------+
      |(x, a)|__dummy__|(, __dummy__)|
      +------+---------+-------------+
      |     a|        0|            1|
      |     b|        0|            1|
      |     c|        0|            1|
      +------+---------+-------------+
  
      >>> verify_temp_column_name(sdf, '__tmp__')
      '__tmp__'
      >>> verify_temp_column_name(sdf, '__dummy__')
      Traceback (most recent call last):
      ...
      AssertionError: ... `__dummy__` ... '(x, a)', '__dummy__', '(, __dummy__)', ...
      >>> verify_temp_column_name(sdf, ('', '__dummy__'))
      Traceback (most recent call last):
      ...
      AssertionError: <class 'tuple'>
      >>> verify_temp_column_name(sdf, 'dummy')
      Traceback (most recent call last):
      ...
      AssertionError: ... should start and end with `__`: dummy
      """
      from pyspark.pandas.frame import DataFrame
  
      if isinstance(df, DataFrame):
          if isinstance(column_name_or_label, str):
              column_name = column_name_or_label
  
              level = df._internal.column_labels_level
              column_name_or_label = tuple(
                  [column_name_or_label] + ([""] * (level - 1))
              )
          else:
              column_name = name_like_string(column_name_or_label)
  
          assert any(
              len(label) > 0 for label in column_name_or_label
          ) and all(
              label == ""
              or (label.startswith("__") and label.endswith("__"))
              for label in column_name_or_label
          ), "The temporary column name should be empty or start and end with `__`: {}".format(
              column_name_or_label
          )
          assert all(
              column_name_or_label != label
              for label in df._internal.column_labels
          ), "The given column name `{}` already exists in the pandas-on-Spark DataFrame: {}".format(
              name_like_string(column_name_or_label), df.columns
          )
          df = df._internal.resolved_copy.spark_frame
      else:
          assert isinstance(column_name_or_label, str), type(
              column_name_or_label
          )
          assert column_name_or_label.startswith(
              "__"
          ) and column_name_or_label.endswith(
              "__"
          ), "The temporary column name should start and end with `__`: {}".format(
              column_name_or_label
          )
          column_name = column_name_or_label
  
      SparkDataFrame = get_dataframe_class()
      assert isinstance(df, SparkDataFrame), type(df)
      assert (
          column_name not in df.columns
      ), "The given column name `{}` already exists in the Spark DataFrame: {}".format(
          column_name, df.columns
      )
  
      return column_name_or_label
  
imports: import functools
  from contextlib import contextmanager
  import os
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union, TYPE_CHECKING, cast, no_type_check, overload
  import warnings
  import pandas
  from pandas.api.types import is_list_like
  from pyspark.sql import functions, Column, DataFrame, SparkSession
  from pyspark.sql.types import DoubleType
  from pyspark.sql.utils import is_remote, get_dataframe_class
  from pyspark.errors import PySparkTypeError
  from pyspark import pandas
  from pyspark.pandas._typing import Axis, Label, Name, DataFrameOrSeries
  from pyspark.pandas.typedef.typehints import as_spark_type
label_desc: Use image node_id 20 for calling a global function with example usage: verify_temp_column_name(df, column_name_or_label) and returns: column_name_or_label