Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

        def loads(s, key = None, extra_key = b''):
    "Reverse of dumps(), raises ValueError if signature fails"
    if isinstance(s, six.text_type):
        s = s.encode('utf8') # base64 works on bytestrings
    try:
        base64d = unsign(s, 
                         (key or settings.SECRET_KEY.encode('ascii')) + 
                         extra_key)
    except ValueError:
        raise
    decompress = False
    if base64d.startswith(b'.'):
        # It's compressed; uncompress it first
        base64d = base64d[1:]
        decompress = True
    pickled = decode(base64d)
    if decompress:
        import zlib
        pickled = zlib.decompress(pickled)
    return pickle.loads(pickled)
        


src/d/j/django-comments-xtd-1.3a1/django_comments_xtd/views.py   django-comments-xtd(Download)
def confirm(request, key, 
            template_discarded="django_comments_xtd/discarded.html"):
    try:
        tmp_comment = signed.loads(str(key), 
                                   extra_key=settings.COMMENTS_XTD_SALT)
def mute(request, key):
    try:
        comment = signed.loads(str(key), 
                               extra_key=settings.COMMENTS_XTD_SALT)
    except (ValueError, signed.BadSignature):

src/d/j/django-comments-xtd-1.3a1/django_comments_xtd/tests/views.py   django-comments-xtd(Download)
        Site.objects.get_current().domain = "testserver" # django bug #7743
        self.get_confirm_comment_url(self.key)
        data = signed.loads(self.key, extra_key=settings.COMMENTS_XTD_SALT)
        try:
            comment = XtdComment.objects.get(