code: 
  
  
  
  
  
  
  """simple docstring"""
  
  
  
  
  
  
  from typing import SupportsIndex
  
  import numpy as np
  from scipy.ndimage import convolve
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A    ,       A			):
     UpperCamelCase_     =np.stack((horizontal_flow, vertical_flow)    ,       2			)
  
     # Create a grid of all pixel coordinates and subtract the flow to get the
     # target pixels coordinates
     UpperCamelCase_     =np.stack(
         np.meshgrid(np.arange(0    ,       image.shape[1]			)    ,       np.arange(0    ,       image.shape[0]			)			)    ,       2			)
     UpperCamelCase_     =np.round(grid - flow			).astype(np.intaa			)
  
     # Find the locations outside of the original image
     UpperCamelCase_     =(grid < 0) | (grid >= np.array([image.shape[1], image.shape[0]]			))
     UpperCamelCase_     =0
  
     UpperCamelCase_     =image[grid[:, :, 1], grid[:, :, 0]]
  
     # Set pixels at invalid locations to 0
     UpperCamelCase_     =0
  
     return warped
  
  
  
  
  def 						_UpperCamelCase			(  A    ,       A    ,       A    ,       A = None    ,       ):
  
  
  
     if alpha is None:
        UpperCamelCase_     =0.1
  
     # Initialize flow
     UpperCamelCase_     =np.zeros_like(__A			)
     UpperCamelCase_     =np.zeros_like(__A			)
  
     # Prepare kernels for the calculation of the derivatives and the average velocity
     UpperCamelCase_     =np.array([[-1, 1], [-1, 1]]			) * 0.25
     UpperCamelCase_     =np.array([[-1, -1], [1, 1]]			) * 0.25
     UpperCamelCase_     =np.array([[1, 1], [1, 1]]			) * 0.25
     UpperCamelCase_     =np.array(
         [[1 / 12, 1 / 6, 1 / 12], [1 / 6, 0, 1 / 6], [1 / 12, 1 / 6, 1 / 12]]			)
  
     # Iteratively refine the flow
     for _ in range(__A			):
        UpperCamelCase_     =warp(__A    ,       __A    ,       __A			)
        UpperCamelCase_     =convolve(__A    ,       __A			) + convolve(__A    ,       __A			)
        UpperCamelCase_     =convolve(__A    ,       __A			) + convolve(__A    ,       __A			)
        UpperCamelCase_     =convolve(__A    ,       __A			) + convolve(__A    ,       -kernel_t			)
  
        UpperCamelCase_     =convolve(__A    ,       __A			)
        UpperCamelCase_     =convolve(__A    ,       __A			)
  
        # This updates the flow as proposed in the paper (Step 12)
        UpperCamelCase_     =(
            derivative_x * avg_horizontal_velocity
            + derivative_y * avg_vertical_velocity
            + derivative_t
        )
        UpperCamelCase_     =update / (alpha**2 + derivative_x**2 + derivative_y**2)
  
        UpperCamelCase_     =avg_horizontal_velocity - derivative_x * update
        UpperCamelCase_     =avg_vertical_velocity - derivative_y * update
  
     return horizontal_flow, vertical_flow
  
  
  if __name__ == "__main__":
      import doctest
  
      doctest.testmod()
  
  
  
  
  
  
  
style_context: 
  
  
  
  
  
  
  """simple docstring"""
  
  
  
  
  
  
  from collections import defaultdict
  
  
  
  
  def 						_UpperCamelCase			(  A = 5			):
     UpperCamelCase_     =defaultdict(A			)
     UpperCamelCase_     =0
  
     while True:
        UpperCamelCase_     =get_digits(A			)
        freqs[digits].append(A			)
  
        if len(freqs[digits]			) == max_base:
           UpperCamelCase_     =freqs[digits][0] ** 3
           return base
  
        num += 1
  
  
  
  
  def 						_UpperCamelCase			(  A			):
     return "".join(sorted(str(num**3			)			)			)
  
  
  if __name__ == "__main__":
      print(f'''{solution() = }''')
  