<commit_before>#
#   Copyright (c) 2010-2013, MIT Probabilistic Computing Project
#
#   Lead Developers: <NAME> and <NAME>
#   Authors: <NAME>, <NAME>, <NAME>, <NAME>
#   Research Leads: <NAME>, <NAME>
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#

import time
import inspect
import os
import json
import datetime
import re
import operator
import copy
import math
import ast
import sys
import random

import pylab
import numpy
import matplotlib.cm
from collections import defaultdict

import crosscat.utils.api_utils as au
import crosscat.utils.data_utils as du
import bayesdb.settings as S

from crosscat.CrossCatClient import get_CrossCatClient
from _file_persistence_layer import FilePersistenceLayer
import utils
import select_utils
import plotting_utils

class Engine(object):
  def __init__(self, crosscat_engine_type='local', seed=None, **kwargs):
    if seed is None:
      max_int = min(32767, sys.maxint) #32767 is 2^15 - 1, and is C's max int in general.
      seed = random.randint(0, max_int)
    self.backend = get_CrossCatClient(crosscat_engine_type, seed=seed, **kwargs)
    self.persistence_layer = FilePersistenceLayer()

  def drop_btable(self, tablename):
    """Delete table by tablename."""
    self.persistence_layer.drop_btable(tablename)
    return ''

  def list_btables(self):
    """Return names of all btables."""
    return self.persistence_layer.list_btables()

  def delete_model(self, tablename, model_index):
     """Delete one model."""<commit_msg>Remove seed argument from engine, since crosscat now has default random seeds.<commit_after>#
#   Copyright (c) 2010-2013, MIT Probabilistic Computing Project
#
#   Lead Developers: <NAME> and <NAME>
#   Authors: <NAME>, <NAME>, <NAME>, <NAME>
#   Research Leads: <NAME>, <NAME>
#
#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.
#

import time
import inspect
import os
import json
import datetime
import re
import operator
import copy
import math
import ast
import sys
import random

import pylab
import numpy
import matplotlib.cm
from collections import defaultdict

import crosscat.utils.api_utils as au
import crosscat.utils.data_utils as du
import bayesdb.settings as S

from crosscat.CrossCatClient import get_CrossCatClient
from _file_persistence_layer import FilePersistenceLayer
import utils
import select_utils
import plotting_utils

class Engine(object):
  def __init__(self, crosscat_engine_type='local', **kwargs):
    """ One optional argument that you may find yourself using frequently is seed.
    It defaults to random seed, but for testing/reproduceability purposes you may
    want a deterministic one. """
    self.backend = get_CrossCatClient(crosscat_engine_type, **kwargs)
    self.persistence_layer = FilePersistenceLayer()

  def drop_btable(self, tablename):
    """Delete table by tablename."""
    self.persistence_layer.drop_btable(tablename)
    return ''

  def list_btables(self):
    """Return names of all btables."""
    return self.persistence_layer.list_btables()

  def delete_model(self, tablename, model_index):
     """Delete one model."""
{'fraction_non_alphanumeric': 0.07985347985347985, 'fraction_numerical': 0.009523809523809525, 'mean_word_length': 4.468624833110814, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1600662', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1159, 'n_words': 452}