def set_gis(self):
    if ((self.pub_password != None) and (self.pub_username != None)):
        self.pub_gis_conn = GIS(url=self.pub_portal, username=self.pub_username, password=self.pub_password)
        print((self.pub_gis_conn.users.me.role, self.pub_gis_conn.users.me.username))
    else:
        self.pub_gis_conn = None
    if ((self.key != None) and (self.pem != None)):
        import ssl
        ssl._create_default_https_context = ssl._create_unverified_context
        self.gis_conn = GIS(url=self.portal, key_file=self.key, cert_file=self.pem, verify_cert=False)
        print((self.gis_conn.users.me.role, self.gis_conn.users.me.username))
    elif ((self.username != None) and (self.password != None)):
        self.gis_conn = GIS(url=self.portal, username=self.username, password=self.password)
        print((self.gis_conn.users.me.role, self.gis_conn.users.me.username))
    else:
        self.gis_conn = GIS()
def set_gis(self):
    if ((self.pub_password != None) and (self.pub_username != None)):
        self.pub_gis_conn = GIS(url=self.pub_portal, username=self.pub_username, password=self.pub_password)
        print((self.pub_gis_conn.users.me.role, self.pub_gis_conn.users.me.username))
    else:
        self.pub_gis_conn = None
    if ((self.key != None) and (self.pem != None)):
        import ssl
        ssl._create_default_https_context = ssl._create_unverified_context
        self.gis_conn = GIS(url=self.portal, key_file=self.key, cert_file=self.pem, verify_cert=False)
        print((self.gis_conn.users.me.role, self.gis_conn.users.me.username))
    elif ((self.username != None) and (self.password != None)):
        self.gis_conn = GIS(url=self.portal, username=self.username, password=self.password)
        print((self.gis_conn.users.me.role, self.gis_conn.users.me.username))
    else:
        self.gis_conn = GIS()