<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def variable(dims=1):
 """ Simple constructor to create single variables to create polynomials. Args: dims (int):
 Number of dimensions in the array. Returns: (Poly):
 Polynomial array with unit components in each dimension. Examples: q0 [q0, q1, q2] """

    if dims == 1:
        return Poly({(1,): 1}, dim=1, shape=())
    return Poly({
        tuple(indices): indices for indices in numpy.eye(dims, dtype=int)
    }, dim=dims, shape=(dims,))