code: def construct_meta_kernel(
      qualname: str, abstract_impl_holder: AbstractImplHolder
  ) -> Callable:
      assert abstract_impl_holder.kernel is not None
  
      @functools.wraps(abstract_impl_holder.kernel.func)
      def meta_kernel(*args, **kwargs):
          assert abstract_impl_holder.kernel is not None
          source = abstract_impl_holder.kernel.source
  
          def error_on_ctx():
              raise RuntimeError(
                  f"Attempted to call get_ctx() for the meta implementation "
                  f"for {qualname} (implemented at {source})"
                  f"You have presumably called get_ctx() because the operator "
                  f"has a data-dependent output shape; if so, there is no "
                  f"such meta implementation and this error is the correct "
                  f"behavior."
              )
  
          with set_ctx_getter(error_on_ctx):
              return abstract_impl_holder.kernel(*args, **kwargs)
  
      return meta_kernel
  
file_path: pytorch/torch/_library/abstract_impl.py
imports: import contextlib
  import functools
  import warnings
  from typing import Callable, Optional
  import torch
  from torch._library.utils import Kernel, RegistrationHandle
label_desc: Use image node_id 1 for calling a global function with example usage: construct_meta_kernel(qualname, abstract_impl_holder) and returns: meta_kernel, abstract_impl_holder