# Path: extras/python/iotsaControl/consts.py
# class UserIntervention(Exception):
#     pass
# 
# class IotsaError(RuntimeError):
#     pass
# 
# class CoapError(Exception):
#     pass
# 
# VERBOSE=[]


from future import standard_library
from builtins import str
from builtins import object
from .consts import UserIntervention, IotsaError, CoapError, VERBOSE
import sys
import socket
import time
import urllib.parse
import urllib.request
import json as jsonmod
import coapthon.client.helperclient
import coapthon.defines
import requests
import urllib3
            if json:
                print('>>>>', json)
        retryCount = 5
        while True:
            try:
                r = requests.request(method, url, auth=self.auth, json=json, verify=not self.noverify, headers=headers, files=files)
            except requests.exceptions.SSLError:
                raise
            except requests.exceptions.ConnectionError:
                if retryCount > 0:
                    retryCount -= 1
                    time.sleep(2)
                else:
                    raise
            else:
                break
        if r.history:
            print('Note: received redirect when accessing', url)
        if VERBOSE: print('<<<< status=%s reply=%s' % (r.status_code, r.text))
        r.raise_for_status()
        if r.text and r.text[0] == '{':
            return r.json()
        return None

class IotsaCOAPProtocolHandler(object):
    def __init__(self, baseURL, bearer=None, noverify=None, auth=None):
        self.client = None
        if bearer:
            raise CoapError("bearer not supported for coap")
        if auth:

# Path: extras/python/iotsaControl/consts.py
# class UserIntervention(Exception):
#     pass
# 
# class IotsaError(RuntimeError):
#     pass
# 
# class CoapError(Exception):
#     pass
# 
# VERBOSE=[]


# Path: extras/python/iotsaControl/protocols.py
from future import standard_library
from builtins import str
from builtins import object
from .consts import UserIntervention, IotsaError, CoapError, VERBOSE
import sys
import socket
import time
import urllib.parse
import urllib.request
import json as jsonmod
import coapthon.client.helperclient
import coapthon.defines
import requests
import urllib3

            if json:
                print('>>>>', json)
        retryCount = 5
        while True:
            try:
                r = requests.request(method, url, auth=self.auth, json=json, verify=not self.noverify, headers=headers, files=files)
            except requests.exceptions.SSLError:
                raise
            except requests.exceptions.ConnectionError:
                if retryCount > 0:
                    retryCount -= 1
                    time.sleep(2)
                else:
                    raise
            else:
                break
        if r.history:
            print('Note: received redirect when accessing', url)
        if VERBOSE: print('<<<< status=%s reply=%s' % (r.status_code, r.text))
        r.raise_for_status()
        if r.text and r.text[0] == '{':
            return r.json()
        return None

class IotsaCOAPProtocolHandler(object):
    def __init__(self, baseURL, bearer=None, noverify=None, auth=None):
        self.client = None
        if bearer:
            raise CoapError("bearer not supported for coap")
        if auth:

            raise CoapError("auth not supported for coap")