code: def proximal_translation(prox_factory, y):
      r
  
      def translation_prox_factory(sigma):
          """Create proximal for the translation with a given sigma.
  
          Parameters
          ----------
          sigma : positive float
              Step size parameter
  
          Returns
          -------
          proximal : `Operator`
              The proximal operator of ``s * F( . - y)`` where ``s`` is the
              step size
          """
          return (ConstantOperator(y) + prox_factory(sigma) *
                  (IdentityOperator(y.space) - ConstantOperator(y)))
  
      return translation_prox_factory
docs: r"""Calculate the proximal of the translated function F(x - y).
  
      Parameters
      ----------
      prox_factory : callable
          A factory function that, when called with a step size, returns the
          proximal operator of ``F``.
      y : Element in domain of ``F``.
  
      Returns
      -------
      prox_factory : function
          Factory for the proximal operator to be initialized
  
      Notes
      -----
      Given a functional :math:`F`, this is calculated according to the rule
  
      .. math::
          \mathrm{prox}_{\sigma F( \cdot - y)}(x) =
          y + \mathrm{prox}_{\sigma F}(x - y)
  
      where :math:`y` is the translation, and :math:`\sigma` is the step size.
  
      For reference on the identity used, see [CP2011c].
  
      References
      ----------
      [CP2011c] Combettes, P L, and Pesquet, J-C. *Proximal splitting
      methods in signal processing.* In:  Bauschke, H H, Burachik, R S,
      Combettes, P L, Elser, V, Luke, D R, and Wolkowicz, H. Fixed-point
      algorithms for inverse problems in science and engineering, Springer,
      2011.