<commit_before># encoding=utf-8

import sys
import importlib
import math
from exc import (
    InvalidBotOutput,
    BotTimeoutException,
    MissedTargetException,
    TankDestroyedException,
    GameOverException,
)

# Exit error codes
EXIT_ERROR_NUMBER_OF_PARAMS = 1
EXIT_ERROR_MODULE = 2
EXIT_ERROR_BOT_INSTANCE = 3

# Relation between our grid and the coordinates in [m]
SCALE = 60

# Constants we use in the game
FREE = 0
DAMAGE_DELTA = 25
REPAIR_DELTA = 10
INITIAL_HEALTH = 100
FAILED = 'FAILED'
SUCCESS = 'SUCCESS'
LOSER = 'loser'
WINNER = 'winner'
DRAW = 'draw'
RESULT = 'result'
ACTION = 'action'
TANK_LENGTH = 3
# Map each firing result threshold with its feedback
HOT = 'HOT'
WARM = 'WARM'
COLD = 'COLD'


def _resolve_missing(distance):
    if distance <= 3:
        return HOT
    elif distance <= 8:
        return WARM
    else:
        return COLD


def _x_for_players(players, limit):
    """Given the list of players, return the numbers which will indicate the
    initial position of each one, according to the formula."""
    quarter = limit // 2
    m = len(''.join(p.username for p in players))
    n = sum(xrange(m))
    k = (n * m * 12832) % quarter
    return k, limit - k - 1


def shoot_projectile(speed, angle, starting_height=0.0, gravity=9.8,
                     x_limit=1000):
    '''
    returns a list of (x, y) projectile motion data points
    where:
    x axis is distance (or range) in meters
    y axis is height in meters
    :x_limit: Indicates if the trajectory is going out of the grid
    '''
    angle = math.radians(angle)
    distance = (speed ** 2) * math.sin(2*angle) / gravity
    return [(0, 0), (distance, 0)]


class ArenaGrid(object):
    """The grid that represents the arena over which the players are playing.
    """
    def __init__(self, width, height):
        self.width = width
        self.height = height
        self.arena = [FREE for _ in xrange(self.width)]

    def copy_for_player(self):<commit_msg>Rename quarter to half.<commit_after># encoding=utf-8

import sys
import importlib
import math
from exc import (
    InvalidBotOutput,
    BotTimeoutException,
    MissedTargetException,
    TankDestroyedException,
    GameOverException,
)

# Exit error codes
EXIT_ERROR_NUMBER_OF_PARAMS = 1
EXIT_ERROR_MODULE = 2
EXIT_ERROR_BOT_INSTANCE = 3

# Relation between our grid and the coordinates in [m]
SCALE = 60

# Constants we use in the game
FREE = 0
DAMAGE_DELTA = 25
REPAIR_DELTA = 10
INITIAL_HEALTH = 100
FAILED = 'FAILED'
SUCCESS = 'SUCCESS'
LOSER = 'loser'
WINNER = 'winner'
DRAW = 'draw'
RESULT = 'result'
ACTION = 'action'
TANK_LENGTH = 3
# Map each firing result threshold with its feedback
HOT = 'HOT'
WARM = 'WARM'
COLD = 'COLD'


def _resolve_missing(distance):
    if distance <= 3:
        return HOT
    elif distance <= 8:
        return WARM
    else:
        return COLD


def _x_for_players(players, limit):
    """Given the list of players, return the numbers which will indicate the
    initial position of each one, according to the formula."""
    half = limit // 2
    m = len(''.join(p.username for p in players))
    n = sum(xrange(m))
    k = (n * m * 12832) % half
    return k, limit - k - 1


def shoot_projectile(speed, angle, starting_height=0.0, gravity=9.8,
                     x_limit=1000):
    '''
    returns a list of (x, y) projectile motion data points
    where:
    x axis is distance (or range) in meters
    y axis is height in meters
    :x_limit: Indicates if the trajectory is going out of the grid
    '''
    angle = math.radians(angle)
    distance = (speed ** 2) * math.sin(2*angle) / gravity
    return [(0, 0), (distance, 0)]


class ArenaGrid(object):
    """The grid that represents the arena over which the players are playing.
    """
    def __init__(self, width, height):
        self.width = width
        self.height = height
        self.arena = [FREE for _ in xrange(self.width)]

    def copy_for_player(self):
{'fraction_non_alphanumeric': 0.09457403651115619, 'fraction_numerical': 0.018762677484787018, 'mean_word_length': 3.0296220633299287, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7282675', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1264, 'n_words': 448}