code: def fromvineyard(tensor, vineyard_socket=None):
      if vineyard is not None and isinstance(
          tensor, vineyard.Object
      ):  # pragma: no cover
          if "vineyard::GlobalTensor" not in tensor.typename:
              raise TypeError(
                  "The input tensor %r is not a vineyard' GlobalTensor"
                  % tensor
              )
          object_id = tensor.id
      else:
          object_id = tensor
      if vineyard is not None and isinstance(
          object_id, vineyard.ObjectID
      ):
          object_id = repr(object_id)
      metaop = TensorFromVineyard(
          vineyard_socket=vineyard_socket,
          object_id=object_id,
          shape=(np.nan,),
          dtype=np.dtype("byte"),
          gpu=None,
      )
      meta = metaop(shape=(np.nan,), chunk_size=(np.nan,))
      op = TensorFromVineyardChunk(
          vineyard_socket=vineyard_socket, object_id=object_id, gpu=None
      )
      return op(meta)
  
imports: import json
  import numpy
  from ...None import opcodes
  from ...serialization.serializables import Int32Field, StringField
  from ...storage.base import StorageLevel
  from ...utils import calc_nsplits, has_unknown_shape, lazy_import
  from ...core.context import get_context
  from ..operands import TensorOperand, TensorOperandMixin
  from .core import TensorNoInput
label_desc: Use image node_id 2 for calling a global function with example usage: fromvineyard(tensor, vineyard_socket) and returns: op