'Gets the typeinfo for the Source Events for the passed typeinfo'

def GetSourceTypeInfo(self, typeinfo):

    attr = typeinfo.GetTypeAttr()
    cFuncs = attr[6]
    typeKind = attr[5]
    if (typeKind not in [pythoncom.TKIND_COCLASS, pythoncom.TKIND_INTERFACE]):
        RaiseAssert(winerror.E_UNEXPECTED, 'The    typeKind    of    the    object    is    unexpected')
    cImplType = attr[8]
    for i in xrange(cImplType):
        flags = typeinfo.GetImplTypeFlags(i)
        flagsNeeded = (pythoncom.IMPLTYPEFLAG_FDEFAULT | pythoncom.IMPLTYPEFLAG_FSOURCE)
        if ((flags & (flagsNeeded | pythoncom.IMPLTYPEFLAG_FRESTRICTED)) == flagsNeeded):
            href = typeinfo.GetRefTypeOfImplType(i)
            return typeinfo.GetRefTypeInfo(href)
