| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 | from pydantic import Fieldfrom core.helper import encrypterfrom .segments import (    ArrayAnySegment,    ArrayFileSegment,    ArrayNumberSegment,    ArrayObjectSegment,    ArrayStringSegment,    FileSegment,    FloatSegment,    IntegerSegment,    NoneSegment,    ObjectSegment,    Segment,    StringSegment,)from .types import SegmentTypeclass Variable(Segment):    """    A variable is a segment that has a name.    """    id: str = Field(        default='',        description="Unique identity for variable. It's only used by environment variables now.",    )    name: str    description: str = Field(default='', description='Description of the variable.')class StringVariable(StringSegment, Variable):    passclass FloatVariable(FloatSegment, Variable):    passclass IntegerVariable(IntegerSegment, Variable):    passclass FileVariable(FileSegment, Variable):    passclass ObjectVariable(ObjectSegment, Variable):    passclass ArrayAnyVariable(ArrayAnySegment, Variable):    passclass ArrayStringVariable(ArrayStringSegment, Variable):    passclass ArrayNumberVariable(ArrayNumberSegment, Variable):    passclass ArrayObjectVariable(ArrayObjectSegment, Variable):    passclass ArrayFileVariable(ArrayFileSegment, Variable):    passclass SecretVariable(StringVariable):    value_type: SegmentType = SegmentType.SECRET    @property    def log(self) -> str:        return encrypter.obfuscated_token(self.value)class NoneVariable(NoneSegment, Variable):    value_type: SegmentType = SegmentType.NONE    value: None = None
 |