code: 
  
  from functools import partial
  from typing import Any, Callable, Dict, List, Type, TypeVar, Union, overload
  
  import torch
  import torch.nn as nn
  import torch.types
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Tuple  ,						SCREAMING_SNAKE_CASE__						:			int  ,						SCREAMING_SNAKE_CASE__						:			int ):
  
  
  
  
  
  
      if not inplace:
          UpperCamelCase :List[Any]										=     ma + ma
      else:
          ma += ma
  
      return ma
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Any  ,						SCREAMING_SNAKE_CASE__						:			str ):
      UpperCamelCase :Union[str, Any]										=     -1 * len(UpperCamelCase__ )
      UpperCamelCase :Tuple										=     list(range(len(tensor.shape[:zero_index] ) ) )
      return tensor.permute(first_inds + [zero_index + i for i in inds] )
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Optional[int]  ,						SCREAMING_SNAKE_CASE__						:			Union[str, Any] ):
      return t.reshape(t.shape[:-no_dims] + (-1,) )
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			str  ,						SCREAMING_SNAKE_CASE__						:			Dict  ,						SCREAMING_SNAKE_CASE__						:			Union[str, Any]  ,						SCREAMING_SNAKE_CASE__						:			Tuple = 1e-4 ):
      UpperCamelCase :Any										=     mask.expand(*value.shape )
      return torch.sum(mask * value  ,						dim=UpperCamelCase__ ) / (eps + torch.sum(UpperCamelCase__  ,						dim=UpperCamelCase__ ))
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Union[str, Any]  ,						SCREAMING_SNAKE_CASE__						:			List[str] = 2.31_25  ,						SCREAMING_SNAKE_CASE__						:			Dict = 21.68_75  ,						SCREAMING_SNAKE_CASE__						:			List[Any] = 64 ):
      UpperCamelCase :Union[str, Any]										=     torch.linspace(UpperCamelCase__  ,						UpperCamelCase__  ,						no_bins - 1  ,						device=pts.device )
      UpperCamelCase :int										=     torch.sqrt(torch.sum((pts.unsqueeze(-2 ) - pts.unsqueeze(-3 )) ** 2  ,						dim=-1 ) )
      return torch.bucketize(UpperCamelCase__  ,						UpperCamelCase__ )
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Tuple  ,						SCREAMING_SNAKE_CASE__						:			Dict ):
      UpperCamelCase :int										=     dicts[0]
      UpperCamelCase :Any										=     {}
      for k, v in first.items():
          UpperCamelCase :List[Any]										=     [d[k] for d in dicts]
          if isinstance(UpperCamelCase__  ,						UpperCamelCase__ ):
              UpperCamelCase :Tuple										=     dict_multimap(UpperCamelCase__  ,						UpperCamelCase__ )
          else:
              UpperCamelCase :Dict										=     fn(UpperCamelCase__ )
  
      return new_dict
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			List[Any]  ,						SCREAMING_SNAKE_CASE__						:			List[Any] ):
      UpperCamelCase :Tuple										=     v_bins.view(((1,) * len(x.shape )) + (len(UpperCamelCase__ ),) )
      UpperCamelCase :str										=     x[..., None] - reshaped_bins
      UpperCamelCase :Optional[int]										=     torch.argmin(torch.abs(UpperCamelCase__ )  ,						dim=-1 )
      return nn.functional.one_hot(UpperCamelCase__  ,						num_classes=len(UpperCamelCase__ ) ).float()
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			str  ,						SCREAMING_SNAKE_CASE__						:			Union[str, Any]  ,						SCREAMING_SNAKE_CASE__						:			Optional[int] = 0  ,						SCREAMING_SNAKE_CASE__						:			int = 0 ):
      UpperCamelCase :int										=     []
      for i, s in enumerate(data.shape[:no_batch_dims] ):
          UpperCamelCase :List[Any]										=     torch.arange(UpperCamelCase__ )
          UpperCamelCase :Tuple										=     r.view(*(*((1,) * i), -1, *((1,) * (len(inds.shape ) - i - 1))) )
          ranges.append(UpperCamelCase__ )
  
      UpperCamelCase :Optional[Any]										=     [slice(UpperCamelCase__ ) for _ in range(len(data.shape ) - no_batch_dims )]
      UpperCamelCase :Tuple										=     inds
      ranges.extend(UpperCamelCase__ )
      # Matt note: Editing this to get around the behaviour of using a list as an array index changing
      # in recent Numpy versions
      return data[tuple(UpperCamelCase__ )]
  
  
  __snake_case							      =						TypeVar("""T""")
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			str  ,						SCREAMING_SNAKE_CASE__						:			Optional[int]  ,						SCREAMING_SNAKE_CASE__						:			str ):
      UpperCamelCase :Union[str, Any]										=     {}
      for k, v in dic.items():
          if isinstance(UpperCamelCase__  ,						UpperCamelCase__ ):
              UpperCamelCase :Union[str, Any]										=     dict_map(UpperCamelCase__  ,						UpperCamelCase__  ,						UpperCamelCase__ )
          else:
              UpperCamelCase :List[str]										=     tree_map(UpperCamelCase__  ,						UpperCamelCase__  ,						UpperCamelCase__ )
  
      return new_dict
  
  
  @overload
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			List[Any]  ,						SCREAMING_SNAKE_CASE__						:			List[Any]  ,						SCREAMING_SNAKE_CASE__						:			int ):
      ...
  
  
  @overload
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Optional[Any]  ,						SCREAMING_SNAKE_CASE__						:			Any  ,						SCREAMING_SNAKE_CASE__						:			Dict ):
      ...
  
  
  @overload
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			int  ,						SCREAMING_SNAKE_CASE__						:			Optional[int]  ,						SCREAMING_SNAKE_CASE__						:			Tuple ):
      ...
  
  
  @overload
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			Union[str, Any]  ,						SCREAMING_SNAKE_CASE__						:			str  ,						SCREAMING_SNAKE_CASE__						:			Optional[int] ):
      ...
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			List[Any]  ,						SCREAMING_SNAKE_CASE__						:			Tuple  ,						SCREAMING_SNAKE_CASE__						:			List[str] ):
  
  
  
  
  
  
      if isinstance(UpperCamelCase__  ,						UpperCamelCase__ ):
          return dict_map(UpperCamelCase__  ,						UpperCamelCase__  ,						UpperCamelCase__ )
      elif isinstance(UpperCamelCase__  ,						UpperCamelCase__ ):
          return [tree_map(UpperCamelCase__  ,						UpperCamelCase__  ,						UpperCamelCase__ ) for x in tree]
      elif isinstance(UpperCamelCase__  ,						UpperCamelCase__ ):
          return tuple(tree_map(UpperCamelCase__  ,						UpperCamelCase__  ,						UpperCamelCase__ ) for x in tree )
      elif isinstance(UpperCamelCase__  ,						UpperCamelCase__ ):
          return fn(UpperCamelCase__ )
      else:
          print(type(UpperCamelCase__ ) )
          raise ValueError('''Not supported''' )
  
  
  
  __snake_case							      =						partial(tree_map, leaf_type=torch.Tensor)
  
  
  
  
  
  
style_context: 
  
  
  
  
  
  
  from __future__ import annotations
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			int ):
      UpperCamelCase :int										=     {1}
      UpperCamelCase :Optional[int]										=     [1]
      for _ in range(2  ,						depth + 1 ):
          UpperCamelCase :Union[str, Any]										=     [*previous_coefficients, 0]
          UpperCamelCase :List[str]										=     [0, *previous_coefficients]
          UpperCamelCase :List[str]										=     []
          for x, y in zip(SCREAMING_SNAKE_CASE__  ,						SCREAMING_SNAKE_CASE__ ):
              coefficients.add(x + y )
              previous_coefficients.append(x + y )
      return coefficients
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			set[int] ):
      UpperCamelCase :Union[str, Any]										=     set()
      for number in unique_coefficients:
          UpperCamelCase :Optional[int]										=     2
          UpperCamelCase :List[Any]										=     number
          while divisor**2 <= copy_number:
              UpperCamelCase :List[Any]										=     0
              while copy_number % divisor == 0:
                  copy_number //= divisor
                  multiplicity += 1
              if multiplicity >= 2:
                  non_squarefrees.add(SCREAMING_SNAKE_CASE__ )
                  break
              divisor += 1
  
      return unique_coefficients.difference(SCREAMING_SNAKE_CASE__ )
  
  
  def 						_A     (       SCREAMING_SNAKE_CASE__						:			int = 51 ):
      UpperCamelCase :Any										=     get_pascal_triangle_unique_coefficients(SCREAMING_SNAKE_CASE__ )
      UpperCamelCase :str										=     get_squarefrees(SCREAMING_SNAKE_CASE__ )
      return sum(SCREAMING_SNAKE_CASE__ )
  
  
  if __name__ == "__main__":
   print(f'''{solution() = }''')
  
  
  
  
  
  