Datasets:
Download src/00006.py from BlazingCustoms/pybytecode-csn-3.12-licensed: direct link, hf CLI and curl.
- Browser
- Download file 628 Bytes
-
https://huggingface.co/datasets/BlazingCustoms/pybytecode-csn-3.12-licensed/resolve/main/src/00006.py
- Command line
-
hf download hf://datasets/BlazingCustoms/pybytecode-csn-3.12-licensed/src/00006.py
-
curl -L -o 00006.py https://huggingface.co/datasets/BlazingCustoms/pybytecode-csn-3.12-licensed/resolve/main/src/00006.py
628 Bytes
| def expand(self, expression): | |
| """pass""" | |
| self.logger.debug('expand : expression %s', str(expression)) | |
| if not is_string(expression): | |
| return expression | |
| result = self._pattern.sub(lambda var: str(self._variables[var.group(1)]), expression) | |
| result = result.strip() | |
| self.logger.debug('expand : %s - result : %s', expression, result) | |
| if is_number(result): | |
| if result.isdigit(): | |
| self.logger.debug(' expand is integer !!!') | |
| return int(result) | |
| else: | |
| self.logger.debug(' expand is float !!!') | |
| return float(result) | |
| return result |