class_docstr: Provide methods to access metadata for :class:`ILSVRC12` dataset.
class_docstr_tok: ["Provide","methods","to","access","metadata","for",":","class",":","`","ILSVRC12","`","dataset","."]
docstr: Return the directory structure of "dir".
  
  Args:
      dir(str): something like '/path/to/imagenet/val'
  
  Returns:
      either 'train' or 'original'
docstr_tok: ["Return","the","directory","structure","of","``","dir","''",".","Args",":","dir","(","str",")",":","something","like","'\/path\/to\/imagenet\/val'","Returns",":","either","'train","'","or","'original","'"]
code: def guess_dir_structure(dir):
      """
      Return the directory structure of "dir".
  
      Args:
          dir(str): something like '/path/to/imagenet/val'
  
      Returns:
          either 'train' or 'original'
      """
      subdir = os.listdir(dir)[0]
      # find a subdir starting with 'n'
      if subdir.startswith("n") and os.path.isdir(
          os.path.join(dir, subdir)
      ):
          dir_structure = "train"
      else:
          dir_structure = "original"
      logger.info(
          "[ILSVRC12] Assuming directory {} has '{}' structure.".format(
              dir, dir_structure
          )
      )
      return dir_structure
  
imports: import numpy
  import os
  import tarfile
  import tqdm
  from pathlib import Path
  from ...utils import logger
  from ...utils.fs import download, get_dataset_path, mkdir_p
  from ...utils.loadcaffe import get_caffe_pb
  from ...utils.timer import timed_operation
  from ..base import RNGDataFlow
label_desc: Use image node_id 7 for calling the ILSVRCMeta obj's underlying member method code with example usage: obj.guess_dir_structure(dir) and returns: dir_structure