code: def _load_primitive_cell(
      struct: PymatgenStructure,
      aos: List[str],
      pbc: List[bool],
      ns: int,
      na: int,
      cutoff: float,
      eigen_tol: float = 1e-5,
  ) -> _SiteEnvironments:
      """
      This loads the primitive cell, along with all the permutations
      required for creating a neighbor. This produces the site environments of
      the primitive cell.
  
      Parameters
      ----------
      struct: PymatgenStructure
          Pymatgen Structure object of the primitive cell used for calculating
          neighbors from lattice transformations.It also requires site_properties
          attribute with "Sitetypes"(Active or spectator site).
      aos: List[str]
          A list of all the active site species. For the Pt, N, NO configuration
          set it as ['0', '1', '2'].
      pbc: List[bool]
          Periodic Boundary Condition
      ns: int (default 1)
          The number of spectator types elements. For "S1" its 1.
      na: int (default 1)
          The number of active types elements. For "A1" its 1.
      cutoff: float (default 6.00)
          Cutoff of radius for getting local environment.Only
          used down to 2 digits.
      eigen_tol : float (default)
          tolerance for eigenanalysis of point group analysis in
          pymatgen.
  
      Returns
      -------
      SiteEnvironments: _SiteEnvironments
          Instance of the _SiteEnvironments object
      """
      site_envs = _get_SiteEnvironments(
          struct, cutoff, pbc, True, eigen_tol=eigen_tol
      )
      site_envs_format = [
          _SiteEnvironment(
              e["pos"],
              e["sitetypes"],
              e["env2config"],
              e["permutations"],
              cutoff,
          )
          for e in site_envs
      ]
  
      ust = [env.sitetypes[0] for env in site_envs_format]
      usi = np.unique(ust, return_index=True)[1]
      site_envs_format = [site_envs_format[i] for i in usi]
      return _SiteEnvironments(
          site_envs_format, ns, na, aos, eigen_tol, pbc, cutoff
      )
  
imports: import numpy
  import logging
  from deepchem.feat import MaterialStructureFeaturizer
  from collections import defaultdict
  from typing import List, Dict, Tuple, DefaultDict, Any
  from deepchem.utils.typing import PymatgenStructure
  from deepchem.feat.graph_data import GraphData
  from scipy.spatial.distance import pdist, squareform, cdist
  from scipy.spatial.transform import Rotation
label_desc: Use image node_id 1 for calling a global function with example usage: _load_primitive_cell(struct, aos, pbc, ns, na, cutoff, eigen_tol) and returns: _SiteEnvironments