def METHOD_NAME(token_generator_conf, length=42):
    if callable(token_generator_conf):
        return token_generator_conf
    if isinstance(token_generator_conf, str):
        return import_string(token_generator_conf)
    elif token_generator_conf is True:
        def token_generator(*args, **kwargs):
            return generate_token(length)
        return token_generator