def clean_collect_field(collect_field):
    """
    WTF python escaping!?
    >>> clean_collect_field('foo\\\\bar')
    'foo\\\\\\\\bar'
    >>> clean_collect_field("foo'bar")
    "foo\\\\\'bar"
    """
    return collect_field.replace('\\', '\\\\').replace("'", "\\'")