<commit_before># -*- coding: utf-8 -*-
from __future__ import division

import math


class LorentzFactor(object):
    SPEED_OF_LIGHT = 299792458

    @staticmethod
    def get_beta(velocity, is_percent):
        if is_percent:
            return velocity
        return velocity / SPEED_OF_LIGHT

    @staticmethod
    def lorentz_factor(time, velocity, is_percent):
        beta = LorentzFactor.get_beta(velocity, is_percent)
        return time / (math.sqrt(1 - beta ** 2))


class TimeDilation(LorentzFactor):
    @staticmethod
    def get_proper_time(time, velocity, is_percent=True):
        return time * TimeDilation.lorentz_factor(time, velocity, is_percent)

    @staticmethod
    def get_time_relative_ex_observer(time, velocity, is_percent=True):
        """
        Dilation relative to an external observer
        """
        return time ** 2 / TimeDilation.lorentz_factor(time, velocity, is_percent)<commit_msg>Fix error in calculation on lorentz factor<commit_after># -*- coding: utf-8 -*-
from __future__ import division

import math


class LorentzFactor(object):
    SPEED_OF_LIGHT = 299792458

    @staticmethod
    def get_beta(velocity, is_percent):
        if is_percent:
            return velocity
        return velocity / SPEED_OF_LIGHT

    @staticmethod
    def lorentz_factor(velocity, is_percent):
        beta = LorentzFactor.get_beta(velocity, is_percent)
        return 1 / (math.sqrt(1 - beta ** 2))


class TimeDilation(LorentzFactor):
    @staticmethod
    def get_proper_time(time, velocity, is_percent=True):
        return time * TimeDilation.lorentz_factor(velocity, is_percent)

    @staticmethod
    def get_time_relative_ex_observer(time, velocity, is_percent=True):
        """
        Dilation relative to an external observer
        """
        return time / TimeDilation.lorentz_factor(velocity, is_percent)
{'fraction_non_alphanumeric': 0.08346795907377491, 'fraction_numerical': 0.014001077005923533, 'mean_word_length': 3.2227272727272727, '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': '1183373', 'n_tokens_mistral': 590, 'n_tokens_neox': 534, 'n_words': 133}