<commit_before>"""Functions to load and operate with the London Tube map."""

import csv
import os
import random

from collections import defaultdict
from os import path

from . import graph


STATIONS = None
CONNECTIONS = None


def _lazy_load_data(func):
    def decorated(*args, **kwargs):
        global STATIONS, CONNECTIONS
        if STATIONS is None:
            STATIONS = _load_stations()
            CONNECTIONS = _load_connections()
        return func(*args, **kwargs)
    return decorated


@_lazy_load_data
def get_station_name(station_id):
    """Returns station name for a given station_id."""
    return STATIONS[station_id]['name']


@_lazy_load_data
def get_random_station(exclude=None):
    """Returns a random tube station."""
    stations = STATIONS.keys()
    if exclude:
        stations = [s for s in stations if s not in exclude]
    return random.choice(stations)


@_lazy_load_data<commit_msg>oops, remove graph import<commit_after>"""Functions to load and operate with the London Tube map."""

import csv
import os
import random

from collections import defaultdict
from os import path

STATIONS = None
CONNECTIONS = None


def _lazy_load_data(func):
    def decorated(*args, **kwargs):
        global STATIONS, CONNECTIONS
        if STATIONS is None:
            STATIONS = _load_stations()
            CONNECTIONS = _load_connections()
        return func(*args, **kwargs)
    return decorated


@_lazy_load_data
def get_station_name(station_id):
    """Returns station name for a given station_id."""
    return STATIONS[station_id]['name']


@_lazy_load_data
def get_random_station(exclude=None):
    """Returns a random tube station."""
    stations = STATIONS.keys()
    if exclude:
        stations = [s for s in stations if s not in exclude]
    return random.choice(stations)


@_lazy_load_data
{'fraction_non_alphanumeric': 0.08505997818974918, 'fraction_numerical': 0.0, 'mean_word_length': 3.553349875930521, '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': '2683200', 'n_tokens_mistral': 561, 'n_tokens_neox': 527, 'n_words': 179}