Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _getnative():
args = parser.parse_args()
if args.use:
source_filter = get_attr(core, args.use)
if not source_filter:
raise GetnativeException(f"{args.use} is not available.")
print(f"Using {args.use} as source filter")
else:
source_filter = get_source_filter(core, imwri, args)
src = source_filter(args.input_file)
mode = [None] # default
if args.mode == "bilinear":
mode = [common_scaler["bilinear"][0]]
elif args.mode == "bicubic":
mode = [scaler for scaler in common_scaler["bicubic"]]
elif args.mode == "bl-bc":
mode = [scaler for scaler in common_scaler["bicubic"]]
mode.append(common_scaler["bilinear"][0])
elif args.mode == "all":
mode = [s for scaler in common_scaler.values() for s in scaler]
for i, scaler in enumerate(mode):
if scaler is not None and scaler.plugin is None: