def define(self, *names, **kwargs):
names = tuple(names)<EOL>for name in names:<EOL><INDENT>if name in self._variables:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(name))<EOL><DEDENT><DEDENT>lower = kwargs.get('<STR_LIT>', None)<EOL>upper = kwargs.get('<STR_LIT>', None)<EOL>vartype = kwargs.get('<STR_LIT>', None)<EOL>if lower is None or isinstance(lower, numbers.Number):<EOL><INDENT>lower = repeat(lower, len(names))<EOL><DEDENT>if upper is None or isinstance(upper, numbers.Number):<EOL><INDENT>upper = repeat(upper, len(names))<EOL><DEDENT>if vartype is None or vartype in (<EOL>VariableType.Continuous, VariableType.Binary,<EOL>VariableType.Integer):<EOL><INDENT>vartype = repeat(vartype, len(names))<EOL><DEDENT>lp_names = tuple(next(self._var_names) for name in names)<EOL>vartype = (VariableType.Continuous if value is None else value<EOL>for value in vartype)<EOL>self._variables.update(zip(names, lp_names))<EOL>for name, lower, upper, t in zip(lp_names, lower, upper, vartype):<EOL><INDENT>if t != VariableType.Continuous:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>')<EOL><DEDENT>self._p.add_variable(<NUM_LIT:0>, lower, upper, name)<EOL><DEDENT>
Define a variable in the problem.

        Variables must be defined before they can be accessed by var() or
        set(). This function takes keyword arguments lower and upper to define
        the bounds of the variable (default: -inf to inf). The keyword argument
        types can be used to select the type of the variable (only Continuous
        is supported). Raises ValueError if a name is already defined.