def get_layer(model, name):
    """ Gets a layer from a model.

    # Arguments:
        model: A keras model
        name: A string, name of a layer in the model

    # Returns:
        A keras layer
    """

    assert name in model.layers
    for l in model.layers:
        if l.name == name:
            return l