Upload operators.py with huggingface_hub
Browse files135 unmodified lines136137138139140141135 unmodified linesreturn instanceclass FieldOperator(StreamInstanceOperator):"""A general stream that processes the values of a field (or multiple ones135 unmodified lines136137138139140141142143144145146147148149150151152153154155156157135 unmodified linesreturn instanceclass RemoveFields(StreamInstanceOperator):"""Adds specified fields to each instance in a stream.Args:fields (Dict[str, object]): The fields to add to each instance."""fields: List[str]def process(self, instance: Dict[str, Any], stream_name: str = None) -> Dict[str, Any]:for field in self.fields:del instance[field]return instanceclass FieldOperator(StreamInstanceOperator):"""A general stream that processes the values of a field (or multiple ones
operators.py+16