code: def from_numpy_vectors(cls, linear, quadratic, offset, vartype, variable_order=None):
          
  
          try:
              heads, tails, values = quadratic
          except ValueError:
              raise ValueError("quadratic should be a 3-tuple")
  
          if not len(heads) == len(tails) == len(values):
              raise ValueError("row, col, and bias should be of equal length")
  
          if variable_order is None:
              variable_order = list(range(len(linear)))
  
          linear = {v: float(bias) for v, bias in zip(variable_order, linear)}
          quadratic = {(variable_order[u], variable_order[v]): float(bias)
                       for u, v, bias in zip(heads, tails, values)}
  
          return cls(linear, quadratic, offset, vartype)
docs: Create a binary quadratic model from vectors.
  
          Args:
              linear (array_like):
                  A 1D array-like iterable of linear biases.
  
              quadratic (tuple[array_like, array_like, array_like]):
                  A 3-tuple of 1D array_like vectors of the form (row, col, bias).
  
              offset (numeric, optional):
                  Constant offset for the binary quadratic model.
  
              vartype (:class:`.Vartype`/str/set):
                  Variable type for the binary quadratic model. Accepted input values:
  
                  * :class:`.Vartype.SPIN`, ``'SPIN'``, ``{-1, 1}``
                  * :class:`.Vartype.BINARY`, ``'BINARY'``, ``{0, 1}``
  
              variable_order (iterable, optional):
                  If provided, labels the variables; otherwise, indices are used.
  
          Returns:
              :obj:`.BinaryQuadraticModel`
  
          Examples:
              >>> import dimod
              >>> import numpy as np
              ...
              >>> linear_vector = np.asarray([-1, 1])
              >>> quadratic_vectors = (np.asarray([0]), np.asarray([1]), np.asarray([-1.0]))
              >>> bqm = dimod.BinaryQuadraticModel.from_numpy_vectors(linear_vector, quadratic_vectors, 0.0, dimod.SPIN)
              >>> print(bqm.quadratic)
              {(0, 1): -1.0}