<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_qubo(cls, Q, offset=0.0):
 """Create a binary quadratic model from a QUBO model. Args: Q (dict):
 Coefficients of a quadratic unconstrained binary optimization where `u`, `v`, are binary-valued variables and `bias` is their associated coefficient. offset (optional, default=0.0):
 Constant offset applied to the model. Returns: :class:`.BinaryQuadraticModel`: Binary quadratic model with vartype set to :class:`.Vartype.BINARY`. Examples: This example creates a binary quadratic model from a QUBO model. {0: -1, 1: -1} <Vartype.BINARY: frozenset({0, 1})> """

        linear = {}
        quadratic = {}
        for (u, v), bias in iteritems(Q):
            if u == v:
                linear[u] = bias
            else:
                quadratic[(u, v)] = bias

        return cls(linear, quadratic, offset, Vartype.BINARY)