INNER CODE UNIT · Python

represent_scalar

mongodb/mongo-c-driver · .evergreen/legacy_config_generator/evergreen_config_generator/__init__.py:72

    def represent_scalar(self, tag: str, value: Value, style: str | None = None) -> yaml.ScalarNode:
        if isinstance(value, (str)) and '\n' in value:
            style = '|'
        return super().represent_scalar(tag, value, style)  # type: ignore

    def represent_set(self, data: Iterable[Value]) -> yaml.MappingNode:
        return super().represent_list(sorted(set(data)))  # type: ignore

    def represent_config_object(self, obj: ConfigObject) -> yaml.Node:
        d = obj.to_dict()
        return super().represent_data(d)  # type: ignore


def yaml_dump(obj: Any):
    return yaml.dump(obj, Dumper=_Dumper, default_flow_style=False)


def generate(config: Any, path: str):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…