code: def _validate_input_shape(dataset, input_shape):
      if dataset:
          try:
              return tuple(
                  distiller.apputils.classification_get_input_shape(
                      dataset
                  )
              )
          except ValueError:
              raise ValueError(
                  "Can't infer input shape for dataset {}, please pass shape directly".format(
                      dataset
                  )
              )
      else:
          if input_shape is None:
              raise ValueError(
                  "Must provide either dataset name or input shape"
              )
          if not isinstance(input_shape, tuple):
              raise TypeError(
                  "Shape should be a tuple of integers, or a tuple of tuples of integers"
              )
  
          def val_recurse(in_shape):
              if all(isinstance(x, int) for x in in_shape):
                  if any(x < 0 for x in in_shape):
                      raise ValueError(
                          "Shape can't contain negative dimensions: {}".format(
                              in_shape
                          )
                      )
                  return in_shape
              if all(isinstance(x, tuple) for x in in_shape):
                  return tuple(val_recurse(x) for x in in_shape)
              raise TypeError(
                  "Shape should be a tuple of integers, or a tuple of tuples of integers"
              )
  
          return val_recurse(input_shape)
  
imports: import argparse
  from collections import OrderedDict
  from copy import deepcopy
  import logging
  import operator
  import random
  import numpy
  import torch
  import torch.nn
  import torch.backends.cudnn
  import yaml
  import inspect
label_desc: Use image node_id 40 for calling a global function with example usage: _validate_input_shape(dataset, input_shape) and returns: val_recurse, tuple, in_shape, tuple