<commit_before>from __future__ import print_function
import numpy as N

def euler_angles(rotation_matrix):
    """ Compute Euler angles from rotation matrix"""
    r = rotation_matrix
    if r.shape[1] == 2:
        angles = [N.arctan2(r[1,0], r[0,0]),
                  N.pi/2-N.arctan2(r[1,0],-r[0,0])]
        return N.array(angles)

    return [N.arctan2(r[2,1],r[2,2]),
              N.arctan2(-r[2, 0], N.sqrt(r[0,0]**2 + r[1,0]**2)),
              N.arctan2(r[1, 0],r[0, 0])]


def ellipse(center,covariance_matrix):
    """Returns error ellipse in slope-azimuth space"""
    # singular value decomposition
    U, s, rotation_matrix = N.linalg.svd(covariance_matrix)
    # semi-axes (largest first)
    saxes = N.sqrt(s)
    volume = N.pi*N.prod(saxes)
    # rotation matrix
    angles = euler_angles(rotation_matrix)

    u = N.linspace(0, 2*N.pi, 100)
    data = N.column_stack((saxes[0]*N.cos(u), saxes[1]*N.sin(u)))
    # rotate data
    return N.dot(data, rotation_matrix)+ center
<commit_msg>Got rid of functions to compute Euler angles<commit_after>from __future__ import division
import numpy as N

def ellipse(center,covariance_matrix):
    """Returns error ellipse in slope-azimuth space"""
    # singular value decomposition
    U, s, rotation_matrix = N.linalg.svd(covariance_matrix)
    # semi-axes (largest first)
    saxes = N.sqrt(s)
    u = N.linspace(0, 2*N.pi, 100)
    data = N.column_stack((saxes[0]*N.cos(u), saxes[1]*N.sin(u)))
    # rotate data
    return N.dot(data, rotation_matrix)+ center

{'fraction_non_alphanumeric': 0.15026246719160105, 'fraction_numerical': 0.030183727034120734, 'mean_word_length': 3.3447293447293447, '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': '6783802', 'n_tokens_mistral': 607, 'n_tokens_neox': 565, 'n_words': 123}