docstr: Given a op type key, return the according translation function.
  Note that the key is sanitized by removing suffix and prefix ``_`` before query.
  For instance, ``__add__`` -> ``add``, ``sub_`` -> ``sub``.
docstr_tok: ["Given","a","op","type","key",",","return","the","according","translation","function",".","Note","that","the","key","is","sanitized","by","removing","suffix","and","prefix","``","_","``","before","query",".","For","instance",",","``","__add__","``","-",">","``","add","``",",","``","sub_","``","-",">","``","sub","``","."]
code: def get_func(self, op_lookup: str) -> Callable:
      """
      Given a op type key, return the according translation function.
      Note that the key is sanitized by removing suffix and prefix ``_`` before query.
      For instance, ``__add__`` -> ``add``, ``sub_`` -> ``sub``.
      """
      if op_lookup.startswith("__") and op_lookup.endswith("__"):
          # Some ops may have double underscore, such as `__and__`.
          op_lookup = op_lookup[2:-2]
      elif op_lookup.endswith("_"):
          # This is an "in place" op.
          # Look up the standard op instead by removing underscore.
          op_lookup = op_lookup[:-1]
  
      return self.name_to_func_mapping.get(op_lookup, None)
  
file_path: coremltools/coremltools/converters/mil/frontend/torch/torch_op_registry.py
imports: from typing import Callable, List
  import torch
  from coremltools import _logger
  from coremltools.models._deprecation import deprecated
label_desc: Use image node_id 2 for calling the TorchOpsRegistry obj's underlying member method code with example usage: obj.get_func(op_lookup) and returns: self