message: Enhancement with deprecated_argument_lookup
  * Enhancement with deprecated_argument_lookup
  The tf.losses.cosine_distance deprecated dim and switched
  to axis. This fix adds the enhancement of using
  deprecated_argument_lookup, which is used in all other
  arguments deprecations.
  * Add missing import
diff: @@ -29,6 +29,7 @@ from tensorflow.python.ops import nn_ops
  from tensorflow.python.ops import weights_broadcast_ops
  from tensorflow.python.ops.losses import util
  from tensorflow.python.util.deprecation import deprecated_args
  +from tensorflow.python.util.deprecation import deprecated_argument_lookup
  from tensorflow.python.util.tf_export import tf_export
  @@ -306,11 +307,8 @@ def cosine_distance(
  ValueError: If `predictions` shape doesn't match `labels` shape, or
  `axis`, `labels`, `predictions` or `weights` is `None`.
  """
  - if dim is not None:
  - if axis is not None:
  - raise ValueError("Cannot specify both 'axis' and 'dim'")
  - axis = dim
  - if axis is None and dim is None:
  + axis = deprecated_argument_lookup("axis", axis, "dim", dim)
  + if axis is None:
  raise ValueError("You must specify 'axis'.")
  if labels is None:
  raise ValueError("labels must not be None.")
  