def METHOD_NAME(cls, cfg, args):
    if args.img is None:
        args.img = cfg.bin_file
    if args.dfuse:
        args.dt_flash = True  # --dfuse implies --dt-flash.
        build_conf = BuildConfiguration(cfg.build_dir)
        dcfg = DfuSeConfig(address=cls.get_flash_address(args, build_conf),
                           options=args.dfuse_modifiers)
    else:
        dcfg = None
    ret = DfuUtilBinaryRunner(cfg, args.dev_id, args.alt, args.img,
                              exe=args.dfu_util, dfuse_config=dcfg)
    ret.ensure_device()
    return ret