def setup_rpyc_namespace(connection: 'rpyc.core.protocol.Connection'):
    """
    setup_rpyc_namespace - Register certain modules and variables in the namespace
                           of cortexcontrol that will be needed for this module.
    :param connection:  RPyC connection to cortexcontrol.
    """
    connection.namespace['_USE_RPYC'] = True
    connection.namespace['copy'] = connection.modules.copy
    connection.namespace['os'] = connection.modules.os
    connection.namespace['ctxdynapse'] = connection.modules.CtxDynapse
    connection.namespace['rpyc'] = connection.modules.rpyc
    connection.namespace['tools'] = connection.modules.tools
    connection.namespace['params'] = connection.modules.params
    if 'initialized_chips' not in connection.modules.tools.storage.keys():
        connection.modules.tools.store_var('initialized_chips', [])
    else:
        print('dynapse_control: Already initialized chips: {}'.format(
            connection.modules.tools.storage['initialized_chips']))
    if 'initialized_neurons' not in connection.modules.tools.storage.keys():
        connection.modules.tools.store_var('initialized_neurons', [])
    print('dynapse_control: RPyC namespace complete.')
