code: def with_context(
      cls,
      obj: SyftObject,
      context: NodeServiceContext,
      object_uid: Optional[UID] = None,
      service_type: Optional[Type[Any]] = None,
  ) -> Self:
      if service_type is None:
          # relative
          from ..service.service import TYPE_TO_SERVICE
  
          service_type = TYPE_TO_SERVICE[type(obj)]
  
      if object_uid is None and hasattr(obj, "id"):
          object_uid = getattr(obj, "id", None)
      if object_uid is None:
          raise Exception(f"{cls} Requires an object UID")
  
      node_uid = context.node.id
  
      return LinkedObject(
          node_uid=node_uid,
          service_type=service_type,
          object_type=type(obj),
          object_uid=object_uid,
      )
  
imports: from typing import Any
  from typing import Optional
  from typing import Type
  from typing import Union
  from typing_extensions import Self
  from ..serde.serializable import serializable
  from ..service.context import AuthedServiceContext
  from ..service.context import ChangeContext
  from ..service.context import NodeServiceContext
  from ..service.response import SyftError
  from ..service.response import SyftSuccess
  from ..types.syft_object import SYFT_OBJECT_VERSION_1
  from ..types.syft_object import SyftObject
  from ..types.uid import UID
label_desc: Use image node_id 6 for calling the LinkedObject obj's underlying member method code with example usage: obj.with_context(cls, obj, context, object_uid, service_type) and returns: LinkedObject