<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addContext(self, layer, hiddenLayerName = 'hidden', verbosity = 0):
 """ Adds a context layer. Necessary to keep self.contextLayers dictionary up to date. """

        # better not add context layer first if using sweep() without mapInput
        SRN.add(self, layer, verbosity)
        if hiddenLayerName in self.contextLayers:
            raise KeyError('There is already a context layer associated with this hidden layer.', \
                             hiddenLayerName)
        else:
            self.contextLayers[hiddenLayerName] = layer
            layer.kind = 'Context'