code: def _make_node_transform(node: Dict[str, Any]) -> Transform3d:
      """
      Convert a transform from the json data in to a PyTorch3D
      Transform3d format.
      """
      array = node.get("matrix")
      if array is not None:  # Stored in column-major order
          M = np.array(array, dtype=np.float32).reshape(4, 4, order="F")
          return Transform3d(matrix=torch.from_numpy(M))
  
      out = Transform3d()
  
      # Given some of (scale/rotation/translation), we do them in that order to
      # get points in to the world space.
      # See https://github.com/KhronosGroup/glTF/issues/743 .
  
      array = node.get("scale", None)
      if array is not None:
          scale_vector = torch.FloatTensor(array)
          out = out.scale(scale_vector[None])
  
      # Rotation quaternion (x, y, z, w) where w is the scalar
      array = node.get("rotation", None)
      if array is not None:
          x, y, z, w = array
          # We negate w. This is equivalent to inverting the rotation.
          # This is needed as quaternion_to_matrix makes a matrix which
          # operates on column vectors, whereas Transform3d wants a
          # matrix which operates on row vectors.
          rotation_quaternion = torch.FloatTensor([-w, x, y, z])
          rotation_matrix = quaternion_to_matrix(rotation_quaternion)
          out = out.rotate(R=rotation_matrix)
  
      array = node.get("translation", None)
      if array is not None:
          translation_vector = torch.FloatTensor(array)
          out = out.translate(x=translation_vector[None])
  
      return out
  
imports: import json
  import struct
  import warnings
  from base64 import b64decode
  from collections import defaultdict, deque
  from enum import IntEnum
  from io import BytesIO
  from typing import Any, BinaryIO, cast, Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  from iopath.common.file_io import PathManager
  from PIL import Image
  from pytorch3d.io.utils import _open_file, PathOrStr
  from pytorch3d.renderer.mesh import TexturesBase, TexturesUV, TexturesVertex
  from pytorch3d.structures import join_meshes_as_scene, Meshes
  from pytorch3d.transforms import quaternion_to_matrix, Transform3d
  from .pluggable_formats import endswith, MeshFormatInterpreter
label_desc: Use image node_id 3 for calling a global function with example usage: _make_node_transform(node) and returns: out, Transform3d