parameters: (model, model_family)
return_statement: return model, model_type
docstring: Check whether the model is valid, i.e is native or derived
      from model_family.Custom
  
      Args:
      model           --  string or instance of model_family.Custom
      model_family    --  model family (NeuronModels, WeightUpdateModels or
                          PostsynapticModels) to which model should belong to
  
      Returns:
      instance of the model and its type as string
  
      Raises ValueError if model is not valid (i.e. is not custom and is
      not natively available)
docstring_summary: Check whether the model is valid, i.e is native or derived
      from model_family.Custom
docstring_tokens: Check whether the model is valid i . e is native or derived from model_family . Custom
function: def is_model_valid(model, model_family):
      """Check whether the model is valid, i.e is native or derived
      from model_family.Custom
  
      Args:
      model           --  string or instance of model_family.Custom
      model_family    --  model family (NeuronModels, WeightUpdateModels or
                          PostsynapticModels) to which model should belong to
  
      Returns:
      instance of the model and its type as string
  
      Raises ValueError if model is not valid (i.e. is not custom and is
      not natively available)
      """
  
      if not isinstance(model, str):
          if not isinstance(model, model_family.Custom):
              model_type = type(model).__name__
              if not hasattr(model_family, model_type):
                  raise ValueError("model '{0}' is not "
                                   "supported".format(model_type))
          else:
              model_type = "Custom"
      else:
          model_type = model
          if not hasattr(model_family, model_type):
              raise ValueError("model '{0}' is not supported".format(model_type))
          else:
              model = getattr(model_family, model_type).get_instance()
      return model, model_type
function_tokens: def is_model_valid ( model , model_family ) : if not isinstance ( model , str ) : if not isinstance ( model , model_family . Custom ) : model_type = type ( model ) . __name__ if not hasattr ( model_family , model_type ) : raise ValueError ( "model '{0}' is not " "supported" . format ( model_type ) ) else : model_type = "Custom" else : model_type = model if not hasattr ( model_family , model_type ) : raise ValueError ( "model '{0}' is not supported" . format ( model_type ) ) else : model = getattr ( model_family , model_type ) . get_instance ( ) return model , model_type