Did I find the right examples for you? yes no

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

        def parse_transform(t):
    if t==None:
        return None
    if type(t)!=str:
        return None

    trans = t.replace(" ","")

    if trans==T_INV:
        return InvTransform()
    if trans.startswith(T_AFF+"(") and trans.endswith(")"):
        try:
            (s, o) = map(lambda x: float(x), trans[4:-1].split(","))
            return AffineTransform(s, o)
        except:
            return None
        


src/p/y/pyrecon-0.3.0/recon/meld.py   pyrecon(Download)
import sys
 
from serial import BSONSerializer, MsgPackSerializer
 
from util import write_len, read_len, conv_len, parse_transform
        # Process any transformation associated with this alias
        if transform!=None:
            if parse_transform(transform)==None:
                raise ValueError("Transform '"+str(transform)+ \
                                     "' could not be parsed")
        ind = self.indices[signal][V_INDEX]
        blen = self.indices[signal][V_LENGTH]
        trans = parse_transform(self.indices[signal].get(V_TRANS, None))
        self.reader.fp.seek(ind)
        data = self.reader.ser.decode_vec(self.reader.fp, blen)

src/p/y/pyrecon-0.3.0/recon/wall.py   pyrecon(Download)
from serial import BSONSerializer, MsgPackSerializer
 
from util import write_len, read_len, parse_transform
 
# This is a unique ID that every wall file starts with so
        self.aliases[alias] = {A_OF: of}
        if transform!=None:
            if parse_transform(transform)==None:
                raise ValueError("Transform '"+str(transform)+"' could not be parsed")
            self.aliases[alias][V_TRANS] = transform
    def alias_transform(self, name):
        """
        Transformation **object** between alias and base signal
        """
        return parse_transform(self.header[T_ALIASES][name].get(V_TRANS, None))