(dictionary, name_value, index=None)
Set the storage point within a class method.

    Parameters
    ----------
    dictionary : dict
    name_value : tuple
        A list of tuples, where each tuple contains a string with the name
        of the storage object and the corresponding value that is to be put
        in storage. These are stored as OrderedDicts.
    index : hashable
        An index under which to store the element. Needs to be hashable.
        This is useful for functions which might be accessed with multiple
        different arguements.
Set the storage point within a class method.
Set the storage point within a class method .
def set_storage(dictionary, name_value, index=None):
    """Set the storage point within a class method.

    Parameters
    ----------
    dictionary : dict
    name_value : tuple
        A list of tuples, where each tuple contains a string with the name
        of the storage object and the corresponding value that is to be put
        in storage. These are stored as OrderedDicts.
    index : hashable
        An index under which to store the element. Needs to be hashable.
        This is useful for functions which might be accessed with multiple
        different arguements.
    """
    # Use function name as storage name
    frame = inspect.currentframe()
    storage_name = inspect.getframeinfo(frame.f_back).function

    storage = OrderedDict(name_value)
    if index is None:
        dictionary[storage_name] = storage
    else:
        # Make sure the storage is initialized
        if storage_name not in dictionary:
            dictionary[storage_name] = {}
        # Set the indexed storage
        dictionary[storage_name][index] = storage
def set_storage ( dictionary , name_value , index = None ) : # Use function name as storage name frame = inspect . currentframe ( ) storage_name = inspect . getframeinfo ( frame . f_back ) . function storage = OrderedDict ( name_value ) if index is None : dictionary [ storage_name ] = storage else : # Make sure the storage is initialized if storage_name not in dictionary : dictionary [ storage_name ] = { } # Set the indexed storage dictionary [ storage_name ] [ index ] = storage