parameters: (self, model, param_space, var_space, var_ref_space)
docstring: Set custom update model, its parameters, 
          initial variables and variable referneces
  
          Args:
          model           --  type as string or instance of the model
          param_space     --  dict with model parameters
          var_space       --  dict with model variables
          var_references  --  dict with model variables
docstring_summary: Set custom update model, its parameters, 
          initial variables and variable referneces
docstring_tokens: Set custom update model its parameters initial variables and variable referneces
function: def set_custom_update_model(self, model, param_space, var_space, var_ref_space):
          """Set custom update model, its parameters, 
          initial variables and variable referneces
  
          Args:
          model           --  type as string or instance of the model
          param_space     --  dict with model parameters
          var_space       --  dict with model variables
          var_references  --  dict with model variables
          """
  
          # Prepare standard model
          (self.custom_update_model, self.type, self.param_names, self.params,
           self.var_names, self.vars, self.extra_global_params) =\
              model_preprocessor.prepare_model(
                  model, self, param_space, var_space, 
                  genn_wrapper.CustomUpdateModels)
  
          # Check variable references
          self.var_ref_names = [vnt.name for vnt in self.custom_update_model.get_var_refs()]
          if var_ref_space is not None and set(iterkeys(var_ref_space)) != set(self.var_ref_names):
              raise ValueError("Invalid variable reference initializers "
                               "for CustomUpdateModels")
  
          # Count wu var references in list
          num_wu_var_refs = sum(isinstance(v[0], WUVarReference)
                                for v in itervalues(var_ref_space))
  
          # If there's a mixture of references to weight 
          # update  model and other variables, give error
          if num_wu_var_refs != 0 and num_wu_var_refs != len(var_ref_space):
              raise ValueError("Custom updates cannot be created with "
                               "references pointing to a mixture of "
                               "weight update and other variables")
  
          # Set flag 
          self.custom_wu_update = (num_wu_var_refs != 0)
  
          # Store variable references in class
          self.var_refs = var_ref_space
function_tokens: def set_custom_update_model ( self , model , param_space , var_space , var_ref_space ) : # Prepare standard model ( self . custom_update_model , self . type , self . param_names , self . params , self . var_names , self . vars , self . extra_global_params ) = model_preprocessor . prepare_model ( model , self , param_space , var_space , genn_wrapper . CustomUpdateModels ) # Check variable references self . var_ref_names = [ vnt . name for vnt in self . custom_update_model . get_var_refs ( ) ] if var_ref_space is not None and set ( iterkeys ( var_ref_space ) ) != set ( self . var_ref_names ) : raise ValueError ( "Invalid variable reference initializers " "for CustomUpdateModels" ) # Count wu var references in list num_wu_var_refs = sum ( isinstance ( v [ 0 ] , WUVarReference ) for v in itervalues ( var_ref_space ) ) # If there's a mixture of references to weight  # update  model and other variables, give error if num_wu_var_refs != 0 and num_wu_var_refs != len ( var_ref_space ) : raise ValueError ( "Custom updates cannot be created with " "references pointing to a mixture of " "weight update and other variables" ) # Set flag  self . custom_wu_update = ( num_wu_var_refs != 0 ) # Store variable references in class self . var_refs = var_ref_space