<commit_before>import matplotlib.pylab as plt
import pandas as pd
from matplotlib.dates import DateFormatter

data_path = "/Users/jaredbowden/Google Drive/cave_in_a_lake/data/"

dateparse = lambda x: pd.datetime.strptime(x, '%Y/%d/%m %H:%M:%S')

raw_data = pd.read_csv(data_path + "speed_frame.csv",
                       parse_dates=['Time'],
                       date_parser=dateparse)

temp_color = []

for line in raw_data["location"]:

    if line == "0":

        temp_color.append("grey")

    elif "Austin" in line:

        temp_color.append("green")

    else:

        temp_color.append("red")

raw_data["temp_color"] = temp_color
"""
raw_data["Time"] = pd.to_datetime(raw_data["Time"])

plt.scatter(
    range(len(raw_data["Time"])),
    raw_data["Download"],
    color=raw_data["temp_color"],
    alpha=0.8)
"""

# This is going to be a variation on the plotting option
fig, ax = plt.subplots()

ax.plot_date(x=raw_data["Time"],
             y=raw_data["Download"],
             alpha=0.8,
             color=raw_data["temp_color"])

myFmt = DateFormatter('%b %G')
ax.xaxis.set_major_formatter(myFmt)

ax.autoscale_view()

fig.autofmt_xdate()

plt.title("Moontower Internet Speed")
plt.xlabel("Time")
plt.ylabel("Speed")

plt.show()
plt.close()
<commit_msg>Clean up formatting<commit_after>__author__ = "<NAME>"
__version__ = 1.2
"""
Plot of internet speed
"""

import matplotlib.pylab as plt
import pandas as pd
from matplotlib.dates import DateFormatter

data_path = "/Users/jaredbowden/Google Drive/cave_in_a_lake/data/"

dateparse = lambda x: pd.datetime.strptime(x, '%Y/%d/%m %H:%M:%S')

raw_data = pd.read_csv(data_path + "speed_frame.csv",
                       parse_dates=['Time'],
                       date_parser=dateparse)

location_tag = []

for line in raw_data["location"]:

    if line == "0":

        location_tag.append("Empty")

    elif "Austin" in line:

        location_tag.append("Time Warner")

    else:

        location_tag.append("VPN")

raw_data["location_tag"] = location_tag

# Plot things up
fig, ax = plt.subplots()

location = ["Empty", "Time Warner", "VPN"]
marker_color = ["0.75", "g", "r"]

for color, plot_layer in enumerate(location):
    ax.plot_date(
        x=raw_data[raw_data["location_tag"] == plot_layer]["Time"],
        y=raw_data[raw_data["location_tag"] == plot_layer]["Download"],
        marker="o",
        fillstyle="full",
        linestyle='None',
        alpha=0.5,
        markeredgewidth=0.0,
        fmt=marker_color[color])

myFmt = DateFormatter('%b %G')
ax.xaxis.set_major_formatter(myFmt)

ax.autoscale_view()

fig.autofmt_xdate()

plt.title("Moontower Internet Speed")
plt.xlabel("Time")
plt.ylabel("Speed")

plt.show()
plt.close()

{'fraction_non_alphanumeric': 0.15378955114054452, 'fraction_numerical': 0.005518763796909493, 'mean_word_length': 3.4794069192751236, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7269420', 'n_tokens_mistral': 998, 'n_tokens_neox': 957, 'n_words': 181}