code: def getKeyType(self, account, pub):
          
          for authority in ["owner", "active"]:
              for key in account[authority]["key_auths"]:
                  if str(pub) == key[0]:
                      return authority
          if str(pub) == account["options"]["memo_key"]:
              return "memo"
          return None
docs: Get key type