class_docstr: Class for an `Op` with an external C implementation.
  
  One can inherit from this class, provide its constructor with a path to
  an external C source file and the name of a function within it, and define
  an `Op` for said function.
docstr: Convert a path relative to the location of the class file into an absolute path.
  
  Paths that are already absolute are passed through unchanged.
docstr_tok: ["Convert","a","path","relative","to","the","location","of","the","class","file","into","an","absolute","path",".","Paths","that","are","already","absolute","are","passed","through","unchanged","."]
code: def get_path(cls, f: str) -> str:
      """Convert a path relative to the location of the class file into an absolute path.
  
      Paths that are already absolute are passed through unchanged.
  
      """
      if not os.path.isabs(f):
          class_file = inspect.getfile(cls)
          class_dir = os.path.dirname(class_file)
          f = os.path.realpath(os.path.join(class_dir, f))
      return f
  
imports: import inspect
  import os
  import re
  import warnings
  from collections.abc import Collection
  from re import Pattern
  from typing import TYPE_CHECKING, Any, Callable, ClassVar, Optional, Union, cast
  import numpy
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply, Variable
  from pytensor.graph.op import ComputeMapType, Op, StorageMapType, ThunkType
  from pytensor.graph.type import HasDataType
  from pytensor.graph.utils import MethodNotDefined
  from pytensor.link.c.interface import CLinkerOp
  from pytensor.link.c.params_type import ParamsType
  from pytensor.utils import hash_from_code
label_desc: Use image node_id 1 for calling the ExternalCOp obj's underlying member method code with example usage: obj.get_path(cls, f) and returns: f