parameters: (self, layer_key, fisher_block)
docstring: Validates and registers the layer_key associated with the fisher_block.
  
      Validation consists of checking whether the key was already registered or
      if any of the elements of layer_key (if it's a tuple) were already
      registered as part of another tuple (throws an error if so). If any of the
      elements were registered by themselves, or as part of tuples that are
      subsets of this layer_key, those registrations are first removed.
  
      If the layer_key is a subset of an existing registration, registration of
      the new, smaller layer_key is skipped.
  
      e.g. If registrations include {'a': foo, ('b', 'c'): bar}, then
        - register_layer('a', baz) -> ValueError
        - register_layer(('b', 'c', 'd'), baz) ->
          {'a': foo, ('b', 'c', 'd'): baz}
        - register_layer('b', baz) ->
          {'a': foo, ('b', 'c'): bar} (No change)
        - register_layer(('a', 'd'), baz) ->
          {('a', 'd'): baz, ('b', 'c'): bar}
        - register_layer(('b', 'd'), baz) -> ValueError
  
      Args:
        layer_key: The key to check for in existing registrations and to register
            if valid.
        fisher_block: The associated fisher block.
  
      Raises:
        ValueError: If the layer_key was already registered, or if a subset of the
            layer_key has already been registered as part of a different tuple.
docstring_summary: Validates and registers the layer_key associated with the fisher_block.
docstring_tokens: Validates and registers the layer_key associated with the fisher_block .
function: def register_block(self, layer_key, fisher_block):
      """Validates and registers the layer_key associated with the fisher_block.
  
      Validation consists of checking whether the key was already registered or
      if any of the elements of layer_key (if it's a tuple) were already
      registered as part of another tuple (throws an error if so). If any of the
      elements were registered by themselves, or as part of tuples that are
      subsets of this layer_key, those registrations are first removed.
  
      If the layer_key is a subset of an existing registration, registration of
      the new, smaller layer_key is skipped.
  
      e.g. If registrations include {'a': foo, ('b', 'c'): bar}, then
        - register_layer('a', baz) -> ValueError
        - register_layer(('b', 'c', 'd'), baz) ->
          {'a': foo, ('b', 'c', 'd'): baz}
        - register_layer('b', baz) ->
          {'a': foo, ('b', 'c'): bar} (No change)
        - register_layer(('a', 'd'), baz) ->
          {('a', 'd'): baz, ('b', 'c'): bar}
        - register_layer(('b', 'd'), baz) -> ValueError
  
      Args:
        layer_key: The key to check for in existing registrations and to register
            if valid.
        fisher_block: The associated fisher block.
  
      Raises:
        ValueError: If the layer_key was already registered, or if a subset of the
            layer_key has already been registered as part of a different tuple.
      """
      if layer_key in self.fisher_blocks:
        raise ValueError("Duplicate registration: {}".format(layer_key))
      if isinstance(layer_key, (tuple, list)):
        self._register_block_with_sequence_key(layer_key, fisher_block)
      else:
        self._register_block_with_nonsequence_key(layer_key, fisher_block)
function_tokens: def register_block ( self , layer_key , fisher_block ) : if layer_key in self . fisher_blocks : raise ValueError ( "Duplicate registration: {}" . format ( layer_key ) ) if isinstance ( layer_key , ( tuple , list ) ) : self . _register_block_with_sequence_key ( layer_key , fisher_block ) else : self . _register_block_with_nonsequence_key ( layer_key , fisher_block )