Buckets:
MisterAI/LocalAI_Demo_backends / cpu-diffusers.upgrade-tmp /python /lib /python3.10 /lib2to3 /fixes /fix_reduce.py
| # Copyright 2008 Armin Ronacher. | |
| # Licensed to PSF under a Contributor Agreement. | |
| """Fixer for reduce(). | |
| Makes sure reduce() is imported from the functools module if reduce is | |
| used in that module. | |
| """ | |
| from lib2to3 import fixer_base | |
| from lib2to3.fixer_util import touch_import | |
| class FixReduce(fixer_base.BaseFix): | |
| BM_compatible = True | |
| order = "pre" | |
| PATTERN = """ | |
| power< 'reduce' | |
| trailer< '(' | |
| arglist< ( | |
| (not(argument<any '=' any>) any ',' | |
| not(argument<any '=' any>) any) | | |
| (not(argument<any '=' any>) any ',' | |
| not(argument<any '=' any>) any ',' | |
| not(argument<any '=' any>) any) | |
| ) > | |
| ')' > | |
| > | |
| """ | |
| def transform(self, node, results): | |
| touch_import('functools', 'reduce', node) | |
Xet Storage Details
- Size:
- 837 Bytes
- Xet hash:
- b4bef47c4eae6ccf39bcea04553ab1ab70c1e5c4aad6ed1658de9be82ba4c4fb
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.