<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_ising(cls, h, J, offset=0.0):
 """Create a binary quadratic model from an Ising problem. Args: h (dict/list):
 Linear biases of the Ising problem. If a dict, should be of the is its associated bias. If a list, it is treated as a list of biases where the indices are the variable labels. J (dict[(variable, variable), bias]):
 Quadratic biases of the Ising problem. offset (optional, default=0.0):
 Constant offset applied to the model. Returns: :class:`.BinaryQuadraticModel`: Binary quadratic model with vartype set to :class:`.Vartype.SPIN`. Examples: This example creates a binary quadratic model from an Ising problem. BinaryQuadraticModel({1: 1, 2: 2, 3: 3, 4: 4}, {(1, 2):
 12, (1, 3):
 13, (1, 4):
 14, (2, 3):
 23, (3, 4):
 34, (2, 4):
 24}, 0.0, Vartype.SPIN) """

        if isinstance(h, abc.Sequence):
            h = dict(enumerate(h))

        return cls(h, J, offset, Vartype.SPIN)