def METHOD_NAME(config):
    """Prepare config for processing"""
    from fnmatch import translate
    if not isinstance(config, dict):
        config = {}
    config.setdefault('to', '')
    config.setdefault('keep_dirs', True)
    config.setdefault('unrar_tool', '')
    config.setdefault('delete_archive', False)
    # If mask was specified, turn it in to a regexp
    if 'mask' in config:
        config['regexp'] = translate(config['mask'])
    # If no mask or regexp specified, accept all files
    if 'regexp' not in config:
        config['regexp'] = '.'
    return config