def METHOD_NAME(ctx):
    '''
    Fate Flow Client
    '''
    ctx.ensure_object(dict)
    if ctx.invoked_subcommand == 'init':
        return
    with open(os.path.join(os.path.dirname(__file__), 'settings.yaml'), 'r') as fin:
        config = yaml.safe_load(fin)
    if not config.get('api_version'):
        raise ValueError('api_version in config is required')
    ctx.obj['api_version'] = config['api_version']
    is_server_conf_exist = False
    if config.get('server_conf_path'):
        conf_path = Path(config['server_conf_path'])
        is_server_conf_exist = conf_path.is_file()
    if is_server_conf_exist:
        server_conf = yaml.safe_load(conf_path.read_text('utf-8'))
        local_conf_path = conf_path.with_name(f'local.{conf_path.name}')
        if local_conf_path.is_file():
            server_conf.update(yaml.safe_load(local_conf_path.read_text('utf-8')))
        ctx.obj['ip'] = server_conf['fateflow']['host']
        ctx.obj['http_port'] = int(server_conf['fateflow']['http_port'])
        ctx.obj['server_url'] = f'http://{ctx.obj["ip"]}:{ctx.obj["http_port"]}/{ctx.obj["api_version"]}'
        http_app_key = None
        http_secret_key = None
        if server_conf.get('authentication', {}).get('client', {}).get('switch'):
            http_app_key = server_conf['authentication']['client']['http_app_key']
            http_secret_key = server_conf['authentication']['client']['http_secret_key']
        else:
            http_app_key = server_conf.get('fateflow', {}).get('http_app_key')
            http_secret_key = server_conf.get('fateflow', {}).get('http_secret_key')
        if http_app_key and http_secret_key:
            ctx.obj['app_key'] = http_app_key
            ctx.obj['secret_key'] = http_secret_key
    elif config.get('ip') and config.get('port'):
        ctx.obj['ip'] = config['ip']
        ctx.obj['http_port'] = int(config['port'])
        ctx.obj['server_url'] = f'http://{ctx.obj["ip"]}:{ctx.obj["http_port"]}/{config["api_version"]}'
        if config.get('app_key') and config.get('secret_key'):
            ctx.obj['app_key'] = config['app_key']
            ctx.obj['secret_key'] = config['secret_key']
    else:
        raise ValueError('Invalid configuration file. Did you run "flow init"?')
    ctx.obj['initialized'] = is_server_conf_exist or (config.get('ip') and config.get('port'))