<commit_before>"""
Tools for handling USGS earthquake data feeds.

This module provides a simple way of retrieving earthquake data
for a given minimum severity level and time period from a web
service run by the USGS Earthquake Hazards Program.  It also
provides the means to generate a Google map showing earthquake
locations and other details.

Feeds and a description of their format are available at
http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php
"""

from string import Template
import urllib.request
import json


URL = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/{}_{}.geojson"

ALLOWED_LEVELS = ("significant", "4.5", "2.5", "1.0", "all")
ALLOWED_PERIODS = ("hour", "day", "week", "month")

MAP_TEMPLATE = Template("""\
<!DOCTYPE html><commit_msg>Improved docstring.<commit_after>"""
Tools for handling USGS earthquake data feeds.

This module provides a simple way of retrieving earthquake data
for a given minimum severity level and time period from a web
service run by the USGS Earthquake Hazards Program.  It also
provides the means to generate a Google map showing earthquake
locations and other details such as magnitude.

Feeds and a description of their format are available at
http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php
"""

from string import Template
import urllib.request
import json


URL = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/{}_{}.geojson"

ALLOWED_LEVELS = ("significant", "4.5", "2.5", "1.0", "all")
ALLOWED_PERIODS = ("hour", "day", "week", "month")

MAP_TEMPLATE = Template("""\
<!DOCTYPE html>
{'fraction_non_alphanumeric': 0.10880503144654088, 'fraction_numerical': 0.012578616352201259, 'mean_word_length': 4.936567164179104, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '451668', 'n_tokens_mistral': 521, 'n_tokens_neox': 485, 'n_words': 183}