code: def make_time_attn(
      in_channels,
      attn_type="vanilla",
      attn_kwargs=None,
      alpha: float = 0,
      merge_strategy: str = "learned",
  ):
      assert attn_type in [
          "vanilla",
          "vanilla-xformers",
      ], f"attn_type {attn_type} not supported for spatio-temporal attention"
      print(
          f"making spatial and temporal attention of type '{attn_type}' with {in_channels} in_channels"
      )
      if not XFORMERS_IS_AVAILABLE and attn_type == "vanilla-xformers":
          print(
              f"Attention mode '{attn_type}' is not available. Falling back to vanilla attention. "
              f"This is not a problem in Pytorch >= 2.0. FYI, you are running with PyTorch version {torch.__version__}"
          )
          attn_type = "vanilla"
  
      if attn_type == "vanilla":
          assert attn_kwargs is None
          return partialclass(
              VideoBlock,
              in_channels,
              alpha=alpha,
              merge_strategy=merge_strategy,
          )
      elif attn_type == "vanilla-xformers":
          print(
              f"building MemoryEfficientAttnBlock with {in_channels} in_channels..."
          )
          return partialclass(
              MemoryEfficientVideoBlock,
              in_channels,
              alpha=alpha,
              merge_strategy=merge_strategy,
          )
      else:
          return NotImplementedError()
  
imports: from typing import Callable, Iterable, Union
  import torch
  from einops import rearrange, repeat
  from sgm.modules.diffusionmodules.model import XFORMERS_IS_AVAILABLE, AttnBlock, Decoder, MemoryEfficientAttnBlock, ResnetBlock
  from sgm.modules.diffusionmodules.openaimodel import ResBlock, timestep_embedding
  from sgm.modules.video_attention import VideoTransformerBlock
  from sgm.util import partialclass
label_desc: Use image node_id 1 for calling a global function with example usage: make_time_attn(in_channels, attn_type, attn_kwargs, alpha, merge_strategy) and returns: partialclass, partialclass, NotImplementedError