(self, name, visual=None)
return variables[0]
Return a variable by its name, and for any given visual which 
        is specified by its name.
Return a variable by its name, and for any given visual which 
        is specified by its name.
Return a variable by its name and for any given visual which is specified by its name .
def get_variable(self, name, visual=None):
        """Return a variable by its name, and for any given visual which 
        is specified by its name."""
        # get the variables list
        if visual is None:
            variables = self.variables.values()
        else:
            variables = self.get_visual(visual)['variables']
        variables = [v for v in variables if v.get('name', '') == name]
        if not variables:
            return None
        return variables[0]
def get_variable ( self , name , visual = None ) : # get the variables list if visual is None : variables = self . variables . values ( ) else : variables = self . get_visual ( visual ) [ 'variables' ] variables = [ v for v in variables if v . get ( 'name' , '' ) == name ] if not variables : return None return variables [ 0 ]