def _request(self, path, data=None, method='GET'):
        headers = {}
        if self.user:
            authorization = b64encode('%s:%s' % (self.user, self.password))
            headers['Authorization'] = ['Basic ' + authorization]

        return utils.HTTPRequest().getJson(
            self.url + path, method, headers=headers, data=data)
dataset/ETHPy150Open calston/tensor/tensor/protocol/elasticsearch.py/ElasticSearch._request/original