Did I find the right examples for you? yes no

All Samples(7944)  |  Call(7604)  |  Derive(340)  |  Import(0)
Invalid syntax.

src/o/t/ottwatch-HEAD/lib/gdata/samples/apps/marketplace_sample/gdata/tlslite/utils/xmltools.py   ottwatch(Download)
def parseAndStripWhitespace(s):
    try:
        element = parseDocument(s).documentElement
    except BaseException, e:
        raise SyntaxError(str(e))
    #This makes writing output simpler, and matches Canonical XML
    if element.childNodes.length==0: #DON'T DO len(element.childNodes) - doesn't work in Jython
        raise SyntaxError("Empty XML elements not allowed")
 
    #If there's a single child, it must be text context
        #If not text content, give an error
        elif element.firstChild.nodeType == element.firstChild.ELEMENT_NODE:
            raise SyntaxError("Bad whitespace under '%s'" % element.tagName)
        else:
            raise SyntaxError("Unexpected node type in XML document")
            if child == element.lastChild:
                if child.data != lastSpacer:
                    raise SyntaxError("Bad whitespace under '%s'" % element.tagName)
            elif child.data != spacer:
                raise SyntaxError("Bad whitespace under '%s'" % element.tagName)

src/g/d/gdata-2.0.18/samples/apps/marketplace_sample/gdata/tlslite/utils/xmltools.py   gdata(Download)
def parseAndStripWhitespace(s):
    try:
        element = parseDocument(s).documentElement
    except BaseException, e:
        raise SyntaxError(str(e))
    #This makes writing output simpler, and matches Canonical XML
    if element.childNodes.length==0: #DON'T DO len(element.childNodes) - doesn't work in Jython
        raise SyntaxError("Empty XML elements not allowed")
 
    #If there's a single child, it must be text context
        #If not text content, give an error
        elif element.firstChild.nodeType == element.firstChild.ELEMENT_NODE:
            raise SyntaxError("Bad whitespace under '%s'" % element.tagName)
        else:
            raise SyntaxError("Unexpected node type in XML document")
            if child == element.lastChild:
                if child.data != lastSpacer:
                    raise SyntaxError("Bad whitespace under '%s'" % element.tagName)
            elif child.data != spacer:
                raise SyntaxError("Bad whitespace under '%s'" % element.tagName)

src/o/t/ottwatch-HEAD/lib/gdata/samples/apps/marketplace_sample/gdata/tlslite/utils/Python_RSAKey.py   ottwatch(Download)
            end = s.find("-----END PRIVATE KEY-----")
            if end == -1:
                raise SyntaxError("Missing PEM Postfix")
            s = s[start+len("-----BEGIN PRIVATE KEY -----") : end]
            bytes = base64ToBytes(s)
                end = s.find("-----END RSA PRIVATE KEY-----")
                if end == -1:
                    raise SyntaxError("Missing PEM Postfix")
                s = s[start+len("-----BEGIN RSA PRIVATE KEY -----") : end]
                bytes = base64ToBytes(s)
                return Python_RSAKey._parseSSLeay(bytes)
        raise SyntaxError("Missing PEM Prefix")
        version = p.getChild(0).value[0]
        if version != 0:
            raise SyntaxError("Unrecognized PKCS8 version")
 
        rsaOID = p.getChild(1).value
        if list(rsaOID) != [6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0]:
            raise SyntaxError("Unrecognized AlgorithmIdentifier")

src/g/d/gdata-2.0.18/samples/apps/marketplace_sample/gdata/tlslite/utils/Python_RSAKey.py   gdata(Download)
            end = s.find("-----END PRIVATE KEY-----")
            if end == -1:
                raise SyntaxError("Missing PEM Postfix")
            s = s[start+len("-----BEGIN PRIVATE KEY -----") : end]
            bytes = base64ToBytes(s)
                end = s.find("-----END RSA PRIVATE KEY-----")
                if end == -1:
                    raise SyntaxError("Missing PEM Postfix")
                s = s[start+len("-----BEGIN RSA PRIVATE KEY -----") : end]
                bytes = base64ToBytes(s)
                return Python_RSAKey._parseSSLeay(bytes)
        raise SyntaxError("Missing PEM Prefix")
        version = p.getChild(0).value[0]
        if version != 0:
            raise SyntaxError("Unrecognized PKCS8 version")
 
        rsaOID = p.getChild(1).value
        if list(rsaOID) != [6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0]:
            raise SyntaxError("Unrecognized AlgorithmIdentifier")

src/o/t/ottwatch-HEAD/lib/gdata/samples/apps/marketplace_sample/gdata/tlslite/X509.py   ottwatch(Download)
        end = s.find("-----END CERTIFICATE-----")
        if start == -1:
            raise SyntaxError("Missing PEM prefix")
        if end == -1:
            raise SyntaxError("Missing PEM postfix")
        rsaOID = algorithmP.value
        if list(rsaOID) != [6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0]:
            raise SyntaxError("Unrecognized AlgorithmIdentifier")
 
        #Get the subjectPublicKey
        subjectPublicKeyP = subjectPublicKeyInfoP.getChild(1)
 
        #Adjust for BIT STRING encapsulation
        if (subjectPublicKeyP.value[0] !=0):
            raise SyntaxError()

src/g/d/gdata-2.0.18/samples/apps/marketplace_sample/gdata/tlslite/X509.py   gdata(Download)
        end = s.find("-----END CERTIFICATE-----")
        if start == -1:
            raise SyntaxError("Missing PEM prefix")
        if end == -1:
            raise SyntaxError("Missing PEM postfix")
        rsaOID = algorithmP.value
        if list(rsaOID) != [6, 9, 42, 134, 72, 134, 247, 13, 1, 1, 1, 5, 0]:
            raise SyntaxError("Unrecognized AlgorithmIdentifier")
 
        #Get the subjectPublicKey
        subjectPublicKeyP = subjectPublicKeyInfoP.getChild(1)
 
        #Adjust for BIT STRING encapsulation
        if (subjectPublicKeyP.value[0] !=0):
            raise SyntaxError()

src/o/t/ottwatch-HEAD/lib/gdata/samples/apps/marketplace_sample/gdata/tlslite/utils/cryptomath.py   ottwatch(Download)
def base64ToString(s):
    try:
        return base64.decodestring(s)
    except binascii.Error, e:
        raise SyntaxError(e)
    except binascii.Incomplete, e:
        raise SyntaxError(e)

src/g/d/gdata-2.0.18/samples/apps/marketplace_sample/gdata/tlslite/utils/cryptomath.py   gdata(Download)
def base64ToString(s):
    try:
        return base64.decodestring(s)
    except binascii.Error, e:
        raise SyntaxError(e)
    except binascii.Incomplete, e:
        raise SyntaxError(e)

src/a/u/autopep8-1.0.1/test/example_with_reduce.py   autopep8(Download)
    def atom(cls, nodelist):
        t = nodelist[1][0]
        if t == token.LPAR:
            if nodelist[2][0] == token.RPAR:
                raise SyntaxError("Empty parentheses")
            return cls.interpret(nodelist[2])
        raise SyntaxError("Language feature not supported in environment markers")
    def comparison(cls, nodelist):
        if len(nodelist)>4:
            raise SyntaxError("Chained comparison not allowed in environment markers")
        comp = nodelist[2][1]
        cop = comp[1]
            cop = cls.get_op(cop)
        except KeyError:
            raise SyntaxError(repr(cop)+" operator not allowed in environment markers")
        return cop(cls.evaluate(nodelist[1]), cls.evaluate(nodelist[3]))
 
        except NameError:
            e = sys.exc_info()[1]
            raise SyntaxError(e.args[0])
        return result
 

src/a/u/autopep8-HEAD/test/example_with_reduce.py   autopep8(Download)
    def atom(cls, nodelist):
        t = nodelist[1][0]
        if t == token.LPAR:
            if nodelist[2][0] == token.RPAR:
                raise SyntaxError("Empty parentheses")
            return cls.interpret(nodelist[2])
        raise SyntaxError("Language feature not supported in environment markers")
    def comparison(cls, nodelist):
        if len(nodelist)>4:
            raise SyntaxError("Chained comparison not allowed in environment markers")
        comp = nodelist[2][1]
        cop = comp[1]
            cop = cls.get_op(cop)
        except KeyError:
            raise SyntaxError(repr(cop)+" operator not allowed in environment markers")
        return cop(cls.evaluate(nodelist[1]), cls.evaluate(nodelist[3]))
 
        except NameError:
            e = sys.exc_info()[1]
            raise SyntaxError(e.args[0])
        return result
 

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next