code: def validate_data_structure(data):
      """
      Validates structure of the stored data
  
      Parameters
      ----------
      data : dict
  
      Raises
      ------
      InvalidFormat
          When format is invalid
      """
      if not isinstance(data, dict):
          raise InvalidFormat(
              "Stored data should be in dictionary format"
          )
  
      if "layers" not in data:
          raise InvalidFormat("Stored data has no key `layers`")
  
      if not isinstance(data["layers"], list):
          raise InvalidFormat("Layers stored not in the list format")
  
      if not data["layers"]:
          raise InvalidFormat("Stored data don't have any layer stored")
  
      for layer_index, layer in enumerate(data["layers"]):
          if not isinstance(layer, dict):
              raise InvalidFormat(
                  "Layer in the {} position (0-based indices) is not a "
                  "dictionary (it is {})".format(
                      layer_index, type(layer)
                  )
              )
  
          for attr in ("parameters", "name"):
              if attr not in layer:
                  raise InvalidFormat(
                      "Layer in the {} position (0-based indices) don't "
                      "have key `{}` specified".format(
                          layer_index, attr
                      )
                  )
  
          if not isinstance(layer["parameters"], dict):
              raise InvalidFormat(
                  "Layer in the {} position (0-based indices) parameters "
                  "specified as `{}`, but dictionary expected"
                  "".format(layer_index, type(layer["parameters"]))
              )
  
          for param_name, param in layer["parameters"].items():
              if not isinstance(param, dict):
                  raise InvalidFormat(
                      "Layer in the {} position (0-based indices) has "
                      "incorrect value for parameter named `{}`. It has "
                      "to be a dictionary, but got {}"
                      "".format(layer_index, param_name, type(param))
                  )
  
              if "value" not in param:
                  raise InvalidFormat(
                      "Layer in the {} position (0-based indices) has "
                      "incorrect value for parameter named `{}`. Parameter "
                      "doesn't have key named `value`"
                      "".format(layer_index, param_name)
                  )
  
imports: import json
  from time import gmtime, strftime
  import six
  import h5py
  import numpy
  import tensorflow
  from six.moves import cPickle
  import neupy
  from neupy.core.docs import shared_docs
  from neupy.layers.graph import LayerGraph
  from neupy.algorithms.base import BaseNetwork
  from neupy.utils import asfloat, tf_utils
label_desc: Use image node_id 5 for calling a global function with example usage: validate_data_structure(data) without return types