parameters: (method)
return_statement: return new_method
docstring: A wrapper that wraps a parameter checker around the original Dataset(Caltech101Dataset).
docstring_summary: A wrapper that wraps a parameter checker around the original Dataset(Caltech101Dataset).
docstring_tokens: A wrapper that wraps a parameter checker around the original Dataset ( Caltech101Dataset ) .
function: def check_caltech101_dataset(method):
      """A wrapper that wraps a parameter checker around the original Dataset(Caltech101Dataset)."""
  
      @wraps(method)
      def new_method(self, *args, **kwargs):
          _, param_dict = parse_user_args(method, *args, **kwargs)
  
          nreq_param_int = ['num_samples', 'num_parallel_workers', 'num_shards', 'shard_id']
          nreq_param_bool = ['shuffle', 'decode']
          nreq_param_str = ['target_type']
  
          dataset_dir = param_dict.get('dataset_dir')
          check_dir(dataset_dir)
  
          target_type = param_dict.get('target_type')
          if target_type is not None:
              check_valid_str(target_type, ["category", "annotation", "all"], "target_type")
  
          validate_dataset_param_value(nreq_param_int, param_dict, int)
          validate_dataset_param_value(nreq_param_bool, param_dict, bool)
          validate_dataset_param_value(nreq_param_str, param_dict, str)
          check_sampler_shuffle_shard_options(param_dict)
  
          cache = param_dict.get('cache')
          check_cache_option(cache)
  
          return method(self, *args, **kwargs)
  
      return new_method
function_tokens: def check_caltech101_dataset ( method ) : @ wraps ( method ) def new_method ( self , * args , * * kwargs ) : _ , param_dict = parse_user_args ( method , * args , * * kwargs ) nreq_param_int = [ 'num_samples' , 'num_parallel_workers' , 'num_shards' , 'shard_id' ] nreq_param_bool = [ 'shuffle' , 'decode' ] nreq_param_str = [ 'target_type' ] dataset_dir = param_dict . get ( 'dataset_dir' ) check_dir ( dataset_dir ) target_type = param_dict . get ( 'target_type' ) if target_type is not None : check_valid_str ( target_type , [ "category" , "annotation" , "all" ] , "target_type" ) validate_dataset_param_value ( nreq_param_int , param_dict , int ) validate_dataset_param_value ( nreq_param_bool , param_dict , bool ) validate_dataset_param_value ( nreq_param_str , param_dict , str ) check_sampler_shuffle_shard_options ( param_dict ) cache = param_dict . get ( 'cache' ) check_cache_option ( cache ) return method ( self , * args , * * kwargs ) return new_method