def extract_config(config, prefix):
    """return all keys with the same prefix without the prefix"""
    prefix = prefix.strip('.') + '.'
    plen = len(prefix)
    value = {}
    for k, v in config.items():
        if k.startswith(prefix):
            value[k[plen:]] = v
    return value
def extract_config ( config , prefix ) : prefix = prefix . strip ( '.' ) + '.' plen = len ( prefix ) value = { } for k , v in config . items ( ) : if k . startswith ( prefix ) : value [ k [ plen : ] ] = v return value
return all keys with the same prefix without the prefix