parameters: (input_class_simple, valid_classes)
return_statement: return valid_type
docstring: Args:
          input_class_simple (class): the class of the input_value that we are
              checking
          valid_classes (tuple): the valid classes that the current item
              should be
      Returns:
          bool
docstring_summary: Args:
          input_class_simple (class): the class of the input_value that we are
              checking
          valid_classes (tuple): the valid classes that the current item
              should be
      Returns:
          bool
docstring_tokens: Args : input_class_simple ( class ) : the class of the input_value that we are checking valid_classes ( tuple ) : the valid classes that the current item should be Returns : bool
function: def is_valid_type(input_class_simple, valid_classes):
      """
      Args:
          input_class_simple (class): the class of the input_value that we are
              checking
          valid_classes (tuple): the valid classes that the current item
              should be
      Returns:
          bool
      """
      if issubclass(input_class_simple, OpenApiModel) and \
          valid_classes == (bool, date, datetime, dict, float, int, list, str, none_type,):
          return True
      valid_type = input_class_simple in valid_classes
      if not valid_type and (
              issubclass(input_class_simple, OpenApiModel) or
              input_class_simple is none_type):
          for valid_class in valid_classes:
              if input_class_simple is none_type and is_type_nullable(valid_class):
                  # Schema is oneOf/anyOf and the 'null' type is one of the allowed types.
                  return True
              if not (issubclass(valid_class, OpenApiModel) and valid_class.discriminator):
                  continue
              discr_propertyname_py = list(valid_class.discriminator.keys())[0]
              discriminator_classes = (
                  valid_class.discriminator[discr_propertyname_py].values()
              )
              valid_type = is_valid_type(input_class_simple, discriminator_classes)
              if valid_type:
                  return True
      return valid_type
function_tokens: def is_valid_type ( input_class_simple , valid_classes ) : if issubclass ( input_class_simple , OpenApiModel ) and valid_classes == ( bool , date , datetime , dict , float , int , list , str , none_type , ) : return True valid_type = input_class_simple in valid_classes if not valid_type and ( issubclass ( input_class_simple , OpenApiModel ) or input_class_simple is none_type ) : for valid_class in valid_classes : if input_class_simple is none_type and is_type_nullable ( valid_class ) : # Schema is oneOf/anyOf and the 'null' type is one of the allowed types. return True if not ( issubclass ( valid_class , OpenApiModel ) and valid_class . discriminator ) : continue discr_propertyname_py = list ( valid_class . discriminator . keys ( ) ) [ 0 ] discriminator_classes = ( valid_class . discriminator [ discr_propertyname_py ] . values ( ) ) valid_type = is_valid_type ( input_class_simple , discriminator_classes ) if valid_type : return True return valid_type