# Path: solvebio/client.py
# def _handle_api_error(response):
# def _handle_request_error(e):
#     def __init__(self, token=None, token_type='Token'):
#     def __call__(self, r):
#     def __repr__(self):
#     def __init__(self, host=None, token=None, token_type='Token',
#                  include_resources=True):
#     def set_host(self, host=None):
#     def set_token(self, token=None, token_type='Token'):
#     def set_user_agent(self, name=None, version=None):
#     def whoami(self):
#     def get(self, url, params, **kwargs):
#     def post(self, url, data, **kwargs):
#     def delete(self, url, data, **kwargs):
#     def request(self, method, url, **kwargs):
#     def _log_raw_request(self, method, url, **kwargs):
#     def __repr__(self):
# class SolveTokenAuth(AuthBase):
# class SolveClient(object):


from .client import client
import logging
            if (i + 1) % chunk_size == 0:
                for r in self._execute(chunk):
                    yield r
                chunk = []

        if chunk:
            for r in self._execute(chunk):
                yield r
            chunk = []

    def _execute(self, chunk):
        data = {
            'records': chunk,
            'fields': self.fields,
            'annotator_params': self.annotator_params,
            'data': self.data
        }

        for r in self._client.post('/v1/annotate', data)['results']:
            yield r


class Expression(object):
    """Runs a single SolveBio expression."""

    # Allows pre-setting a SolveClient
    _client = None

    def __init__(self, expr, **kwargs):
        self.expr = expr

# Path: solvebio/client.py
# def _handle_api_error(response):
# def _handle_request_error(e):
#     def __init__(self, token=None, token_type='Token'):
#     def __call__(self, r):
#     def __repr__(self):
#     def __init__(self, host=None, token=None, token_type='Token',
#                  include_resources=True):
#     def set_host(self, host=None):
#     def set_token(self, token=None, token_type='Token'):
#     def set_user_agent(self, name=None, version=None):
#     def whoami(self):
#     def get(self, url, params, **kwargs):
#     def post(self, url, data, **kwargs):
#     def delete(self, url, data, **kwargs):
#     def request(self, method, url, **kwargs):
#     def _log_raw_request(self, method, url, **kwargs):
#     def __repr__(self):
# class SolveTokenAuth(AuthBase):
# class SolveClient(object):


# Path: solvebio/annotate.py
from .client import client
import logging

            if (i + 1) % chunk_size == 0:
                for r in self._execute(chunk):
                    yield r
                chunk = []

        if chunk:
            for r in self._execute(chunk):
                yield r
            chunk = []

    def _execute(self, chunk):
        data = {
            'records': chunk,
            'fields': self.fields,
            'annotator_params': self.annotator_params,
            'data': self.data
        }

        for r in self._client.post('/v1/annotate', data)['results']:
            yield r


class Expression(object):
    """Runs a single SolveBio expression."""

    # Allows pre-setting a SolveClient
    _client = None

    def __init__(self, expr, **kwargs):
        self.expr = expr

        self._client = kwargs.get('client') or self._client or client