def get_nested(dct, key_pattern):
    """ Get value(s) from a nested dict
    
        Args:
            dct: dict having str keys and values which may be other `dct`s
            key_pattern: str giving dotted key
        
        Returns the value. Note that if key_pattern does not go to full depth then a dict is returned.
    """
    d = dct
    patt_parts = key_pattern.split('.')
    for kp in patt_parts:       
        if kp in d:
            d = d[kp]
        else:
            raise KeyError("No such key '%s'" % key_pattern)
    return d