def mirror_transform(transform, axis='y'):

    mirrored_transform = transform

    regex = r"(?P<before>.*?)translate\s?\(\s?(?P<x>-?[0-9]*\.?[0-9]+)\s+(?P<y>-?[0-9]*\.?[0-9]+\s?)\s?\)(?P<after>.*)"
    capture = re.match(regex, transform)

    if capture is not None:
        mirrored_transform = "%s translate(%g %s) %s" % (
                capture.group('before'), 
                -float(capture.group('x')), 
                capture.group('y'), 
                capture.group('after'))

    return mirrored_transform
Returns a mirrored transfrom
dataset/ETHPy150Open boldport/pcbmode/pcbmode/utils/svg.py/mirror_transform