<commit_before># -*- coding: utf-8 -*-

import datetime
import json
import logging
import random
import re
import sys
import time

from geopy.geocoders import GoogleV3
from pgoapi import PGoApi
from pgoapi.utilities import f2i

import logger
from cell_workers import PokemonCatchWorker, SeenFortWorker, MoveToFortWorker, InitialTransferWorker, EvolveAllWorker
from cell_workers.utils import distance, get_cellid, encode, i2f
from human_behaviour import sleep
from item_list import Item
from spiral_navigator import SpiralNavigator


class PokemonGoBot(object):
    
    @property
    def position(self):
        return (i2f(self.api._position_lat), i2f(self.api._position_lng), 0)

    def __init__(self, config):
        self.config = config
        self.pokemon_list = json.load(open('data/pokemon.json'))
        self.item_list = json.load(open('data/items.json'))

    def start(self):
        self._setup_logging()
        self._setup_api()
        self.navigator = SpiralNavigator(self)
        random.seed()

    def take_step(self):
        location = self.navigator.take_step()
        cells = self.find_close_cells(*location[0:2])

        for cell in cells:
            self.work_on_cell(cell, location)

    def update_web_location(self, cells=[], lat=None, lng=None, alt=None):
        # we can call the function with no arguments and still get the position and map_cells
        if lat == None:
            lat = i2f(self.api._position_lat)
        if lng == None:
            lng = i2f(self.api._position_lng)
        if alt == None:<commit_msg>Call find_close_cells with current position instead of target one (#1015)<commit_after># -*- coding: utf-8 -*-

import datetime
import json
import logging
import random
import re
import sys
import time

from geopy.geocoders import GoogleV3
from pgoapi import PGoApi
from pgoapi.utilities import f2i

import logger
from cell_workers import PokemonCatchWorker, SeenFortWorker, MoveToFortWorker, InitialTransferWorker, EvolveAllWorker
from cell_workers.utils import distance, get_cellid, encode, i2f
from human_behaviour import sleep
from item_list import Item
from spiral_navigator import SpiralNavigator


class PokemonGoBot(object):
    
    @property
    def position(self):
        return (i2f(self.api._position_lat), i2f(self.api._position_lng), 0)

    def __init__(self, config):
        self.config = config
        self.pokemon_list = json.load(open('data/pokemon.json'))
        self.item_list = json.load(open('data/items.json'))

    def start(self):
        self._setup_logging()
        self._setup_api()
        self.navigator = SpiralNavigator(self)
        random.seed()

    def take_step(self):
        location = self.navigator.take_step()
        cells = self.find_close_cells(*self.position[0:2])

        for cell in cells:
            self.work_on_cell(cell, location)

    def update_web_location(self, cells=[], lat=None, lng=None, alt=None):
        # we can call the function with no arguments and still get the position and map_cells
        if lat == None:
            lat = i2f(self.api._position_lat)
        if lng == None:
            lng = i2f(self.api._position_lng)
        if alt == None:
{'fraction_non_alphanumeric': 0.08854003139717426, 'fraction_numerical': 0.00816326530612245, 'mean_word_length': 3.2423435419440745, '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': '2979615', 'n_tokens_mistral': 1001, 'n_tokens_neox': 963, 'n_words': 266}