code: def add_variables_from(self, linear, vartype=None):
          
          if isinstance(linear, abc.Mapping):
              for v, bias in iteritems(linear):
                  self.add_variable(v, bias, vartype=vartype)
          else:
              try:
                  for v, bias in linear:
                      self.add_variable(v, bias, vartype=vartype)
              except TypeError:
                  raise TypeError("expected 'linear' to be a dict or an iterable of 2-tuples.")
docs: Add variables and/or linear biases to a binary quadratic model.
  
          Args:
              linear (dict[variable, bias]/iterable[(variable, bias)]):
                  A collection of variables and their linear biases to add to the model.
                  If a dict, keys are variables in the binary quadratic model and
                  values are biases. Alternatively, an iterable of (variable, bias) pairs.
                  Variables can be any python object that is a valid dict key.
                  Many methods and functions expect the biases
                  to be numbers but this is not explicitly checked.
                  If any variable already exists in the model, its bias is added to
                  the variable's current linear bias.
  
              vartype (:class:`.Vartype`, optional, default=None):
                  Vartype of the given bias. If None, the vartype of the binary
                  quadratic model is used. Valid values are :class:`.Vartype.SPIN` or
                  :class:`.Vartype.BINARY`.
  
          Examples:
              This example creates creates an empty Ising model, adds two variables,
              and subsequently adds to the bias of the one while adding a new, third,
              variable.
  
              >>> import dimod
              ...
              >>> bqm = dimod.BinaryQuadraticModel({}, {}, 0.0, dimod.SPIN)
              >>> len(bqm.linear)
              0
              >>> bqm.add_variables_from({'a': .5, 'b': -1.})
              >>> 'b' in bqm
              True
              >>> bqm.add_variables_from({'b': -1., 'c': 2.0})
              >>> bqm.linear['b']
              -2.0