def add_interactions_from(self, quadratic, vartype=None):
        """Add interactions and/or quadratic biases to a binary quadratic model.

        Args:
            quadratic (dict[(variable, variable), bias]/iterable[(variable, variable, bias)]):
                A collection of variables that have an interaction and their quadratic
                bias to add to the model. If a dict, keys are 2-tuples of variables
                in the binary quadratic model and values are their corresponding
                bias. Alternatively, an iterable of 3-tuples. Each interaction in `quadratic` should be
                unique; that is, if `(u, v)` is a key, `(v, u)` should not be.
                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.

            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 an interaction
            for two variables, adds to its bias while adding a new variable,
            then adds another interaction.

            >>> import dimod
            ...
            >>> bqm = dimod.BinaryQuadraticModel.empty(dimod.SPIN)
            >>> bqm.add_interactions_from({('a', 'b'): -.5})
            >>> bqm.quadratic[('a', 'b')]
            -0.5
            >>> bqm.add_interactions_from({('a', 'b'): -.5, ('a', 'c'): 2})
            >>> bqm.add_interactions_from({('b', 'c'): 2}, vartype=dimod.BINARY)   # Binary value is converted to spin value
            >>> len(bqm.quadratic)
            3
            >>> bqm.quadratic[('a', 'b')]
            -1.0

        """
        if isinstance(quadratic, abc.Mapping):
            for (u, v), bias in iteritems(quadratic):
                self.add_interaction(u, v, bias, vartype=vartype)
        else:
            try:
                for u, v, bias in quadratic:
                    self.add_interaction(u, v, bias, vartype=vartype)
            except TypeError:
                raise TypeError("expected 'quadratic' to be a dict or an iterable of 3-tuples.")