def v1_deprecated(warning=None):
 warning = (warning or '')
 def mark_deprecated(f):
  def optional_warn_function(*args, **kwargs):
   if ENABLE_V1_WARNINGS:
    warnings.warn(warning, DeprecationWarning, stacklevel=2)
   return f(*args, **kwargs)
  try:
   optional_warn_function.func_name = f.func_name
  except TypeError:
   pass
  return optional_warn_function
 return mark_deprecated

def v1_deprecated ( warning = None ) : warning = ( warning or '' ) def mark_deprecated ( f ) : def optional_warn_function ( * args , ** kwargs ) : if ENABLE_V1_WARNINGS : warnings . warn ( warning , DeprecationWarning , stacklevel = 2 ) return f ( * args , ** kwargs ) try : optional_warn_function . func_name = f . func_name except TypeError : pass return optional_warn_function return mark_deprecated
shows a warning if enable_v1_warnings is true .