code: def _load_dataset(
      dataset_metadata,
      data_home=None,
      check_md5hash=False,
      add_reciprocal_rels=False,
  ):
      """Load a dataset from the details provided.
  
      DatasetMetadata = namedtuple('DatasetMetadata', ['dataset_name', 'filename', 'url', 'train_name', 'valid_name',
                                                       'test_name', 'train_checksum', 'valid_checksum', 'test_checksum'])
  
      Parameters
      ----------
      dataset_metadata: DatasetMetadata
          Named tuple containing remote datasets meta information: dataset name, dataset filename,
          url, train filename, validation filename, test filename, train checksum, valid checksum, test checksum.
  
      data_home: str
          The location to save the dataset to (default: `None`).
  
      check_md5hash: bool
          If True, check the md5hash of the files after they are downloaded (default: `False`).
  
      add_reciprocal_rels: bool
          Flag which specifies whether to add reciprocal relations. For every <s, p, o> in the dataset
          this creates a corresponding triple with reciprocal relation <o, p_reciprocal, s> (default: `False`).
      """
      dataset = {}
      if dataset_metadata.dataset_name is None:
          if dataset_metadata.url is None:
              raise ValueError(
                  "The dataset name or url must be provided to load a dataset."
              )
          dataset_metadata.dataset_name = dataset_metadata.url[
              dataset_metadata.url.rfind("/")
              + 1 : dataset_metadata.url.rfind(".")
          ]
      dataset_path = _fetch_dataset(
          dataset_metadata, data_home, check_md5hash
      )
      train = load_from_csv(
          dataset_path,
          dataset_metadata.train_name,
          add_reciprocal_rels=add_reciprocal_rels,
      )
      dataset["train"] = train
      valid = load_from_csv(
          dataset_path,
          dataset_metadata.valid_name,
          add_reciprocal_rels=add_reciprocal_rels,
      )
      dataset["valid"] = valid
      test = load_from_csv(
          dataset_path,
          dataset_metadata.test_name,
          add_reciprocal_rels=add_reciprocal_rels,
      )
      dataset["test"] = test
      if dataset_metadata.valid_negatives_name is not None:
          valid_negatives = load_from_csv(
              dataset_path,
              dataset_metadata.valid_negatives_name,
              add_reciprocal_rels=add_reciprocal_rels,
          )
          dataset["valid_negatives"] = valid_negatives
      if dataset_metadata.test_negatives_name is not None:
          test_negatives = load_from_csv(
              dataset_path,
              dataset_metadata.test_negatives_name,
              add_reciprocal_rels=add_reciprocal_rels,
          )
          dataset["test_negatives"] = test_negatives
  
      if (
          dataset_metadata.test_human_checksum is not None
          and dataset_metadata.test_human_ids_checksum is not None
      ):
          test_human = load_from_csv(
              dataset_path, dataset_metadata.test_human_name
          )
          dataset["test-human"] = test_human
          test_human_ids = load_from_csv(
              dataset_path, dataset_metadata.test_human_ids_name
          )
          dataset["test-human-ids"] = test_human_ids
      if dataset_metadata.mapper_checksum is not None:
          mapper = load_mapper_from_json(
              dataset_path, dataset_metadata.mapper_name
          )
          dataset["mapper"] = mapper
      return dataset
  
imports: import hashlib
  import json
  import logging
  import os
  import urllib
  import zipfile
  from collections import namedtuple
  from pathlib import Path
  import numpy
  import pandas
label_desc: Use image node_id 9 for calling a global function with example usage: _load_dataset(dataset_metadata, data_home, check_md5hash, add_reciprocal_rels) and returns: dataset