def _set_variables(self, cacheable):
<EOL>def extract_vars(expr):<EOL><INDENT>return [e for e in expr.atoms() if e.is_Symbol and e not in vars]<EOL><DEDENT>self.cacheable = cacheable<EOL>self.variables = {}<EOL>vars = []<EOL>for expression in self.expressions.values():<EOL><INDENT>vars += extract_vars(expression['<STR_LIT>'])<EOL><DEDENT>self.cacheable_vars = [] <EOL>for var in cacheable:            <EOL><INDENT>self.variables[var] = [e for e in vars if e.name.split('<STR_LIT:_>')[<NUM_LIT:0>]==var.lower()]<EOL>self.cacheable_vars += self.variables[var]<EOL><DEDENT>for var in cacheable:<EOL><INDENT>if not self.variables[var]:<EOL><INDENT>raise ValueError('<STR_LIT>' + var + '<STR_LIT>' + var.lower() + '<STR_LIT>' + var)<EOL><DEDENT><DEDENT>self.variables['<STR_LIT>'] = sorted([e for e in vars if not e in self.cacheable_vars],key=lambda e:e.name)<EOL>
Pull the variable names out of the provided expressions and separate into cacheable expressions and normal parameters. Those that are only stored in the cache, the parameters are stored in this object.