<commit_before>'''Instance webapp api wrapper'''

# Lib imports
import json
import requests

# App imports
from basepair.helpers import eprint
from .abstract import Abstract

class Instance(Abstract):
  '''Webapp Instance class'''
  def __init__(self, cfg):
    super(Instance, self).__init__(cfg)
    self.endpoint += 'instances/'

  def get_instances(self, payload={}, verify=True):
    '''Get available instances'''
    try:
      response = requests.get(
        self.endpoint,
        data=json.dumps(payload),
        headers=self.headers,
        params=self.payload,
        verify=verify,
      )
      return self._parse_response(response)
    except requests.exceptions.RequestException as error:
      eprint('ERROR: {}'.format(error))
      return {'error': True, 'msg': error}<commit_msg>new line at end of instance file<commit_after>'''Instance webapp api wrapper'''

# Lib imports
import json
import requests

# App imports
from basepair.helpers import eprint
from .abstract import Abstract

class Instance(Abstract):
  '''Webapp Instance class'''
  def __init__(self, cfg):
    super(Instance, self).__init__(cfg)
    self.endpoint += 'instances/'

  def get_instances(self, payload={}, verify=True):
    '''Get available instances'''
    try:
      response = requests.get(
        self.endpoint,
        data=json.dumps(payload),
        headers=self.headers,
        params=self.payload,
        verify=verify,
      )
      return self._parse_response(response)
    except requests.exceptions.RequestException as error:
      eprint('ERROR: {}'.format(error))
      return {'error': True, 'msg': error}
      
{'fraction_non_alphanumeric': 0.12024539877300613, 'fraction_numerical': 0.0, 'mean_word_length': 3.408108108108108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6591975', 'n_tokens_mistral': 455, 'n_tokens_neox': 459, 'n_words': 125}