<commit_before>
import numpy as np
from math import *
import random

import sys
import os
sys.path.insert(0, sys.path[0] + '/../..')
import neupy
print neupy.__version__

import theano
print theano.config.base_compiledir
# theano.config.exception_verbosity = 'high'
import theano.tensor as T
import itertools

tdr = os.environ['TMPDIR']
# os.environ['THEANO_FLAGS'] = 'base_compiledir=' + tdr

class Cluster(object):
  def __init__(self, n):
    self.n = n
    self.atoms = np.zeros((n, 3))
    self.elems = [''] * n
    self.energy = 0.0
    self.mat_f = []
    self.mat_x = []
    self.mat_ll = []
    ee = np.eye(n, dtype=int)
    for i in range(1, n + 1):
      le = [list(g) for g in itertools.combinations(ee, i)]
      lx = [list(g) for g in itertools.combinations(range(0, n), i)]
      le = np.asarray(le)
      lx = np.asarray(lx)
      self.mat_f.append(lambda x,le=le: np.dot(le, x))
      self.mat_x.append(lx)

  def gen_ll():
    ll = np.zeros((self.n, self.n))
    for i in range(0, self.n):
      for j in range(0, i):
        ll[i, j] = np.linalg.norm(self.atoms[i] - self.atoms[j])
    self.mat_ll = ll
  
  def get_center(self):<commit_msg>gen ll<commit_after>
import numpy as np
from math import *
import random

import sys
import os
sys.path.insert(0, sys.path[0] + '/../..')
import neupy
print neupy.__version__

import theano
print theano.config.base_compiledir
# theano.config.exception_verbosity = 'high'
import theano.tensor as T
import itertools

tdr = os.environ['TMPDIR']
# os.environ['THEANO_FLAGS'] = 'base_compiledir=' + tdr

class Cluster(object):
  def __init__(self, n):
    self.n = n
    self.atoms = np.zeros((n, 3))
    self.elems = [''] * n
    self.energy = 0.0
    self.mat_f = []
    self.mat_x = []
    self.mat_ll = []
    ee = np.eye(n, dtype=int)
    for i in range(1, n + 1):
      le = [list(g) for g in itertools.combinations(ee, i)]
      lx = [list(g) for g in itertools.combinations(range(0, n), i)]
      le = np.asarray(le)
      lx = np.asarray(lx)
      self.mat_f.append(lambda x,le=le: np.dot(le, x))
      self.mat_x.append(lx)

  def gen_ll(self):
    ll = np.zeros((self.n, self.n))
    for i in range(0, self.n):
      for j in range(0, i):
        ll[i, j] = np.linalg.norm(self.atoms[i] - self.atoms[j])
    self.mat_ll = ll
  
  def get_center(self):
{'fraction_non_alphanumeric': 0.15796288303841174, 'fraction_numerical': 0.008631851532153647, 'mean_word_length': 2.8762541806020065, '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': '1525481', 'n_tokens_mistral': 952, 'n_tokens_neox': 933, 'n_words': 220}