This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func GetCurrentWeather() (ApiWeatherInfo, error) { | |
req, err := http.NewRequest("GET", "http://api.weatherapi.com/v1/current.json?", nil) | |
if err != nil { | |
fmt.Println(err) | |
return ApiWeatherInfo{}, err | |
} | |
// define the query parameters and their respective values | |
q := req.URL.Query() | |
q.Add("key", os.Getenv("WAPIKEY")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from yellowbrick.datasets import load_occupancy | |
from yellowbrick.model_selection import CVScores | |
from yellowbrick.classifier import ConfusionMatrix | |
from sklearn.svm import SVC | |
from sklearn.model_selection import StratifiedKFold | |
from sklearn.model_selection import train_test_split as tts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# barnacle.py | |
# Adds the ID line to directory files using git metadata. | |
# | |
# Author: Rebecca Bilbro | |
# Created: Sat Sep 14 13:26:53 EDT 2019 | |
# | |
""" | |
Scans local directory for git repository metadata and adds ID line to file footers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# toto.py | |
# Adds the ID line to directory files using git metadata. | |
# | |
# Author: Rebecca Bilbro | |
# Created: Sun Aug 11 11:27:57 EDT 2019 | |
# | |
""" | |
Scans local directory for git repository metadata and adds ID line to file headers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# plot_classifier_comparison.py | |
""" | |
A comparison of a several classifiers in scikit-learn on synthetic datasets. | |
The point of this example is to illustrate the nature of decision boundaries | |
of different classifiers. | |
Particularly in high-dimensional spaces, data can more easily be separated | |
linearly and the simplicity of classifiers such as naive Bayes and linear SVMs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# kimchi.py | |
# For converting Python 2 pickles to Python 3 | |
import os | |
import dill | |
import pickle | |
import argparse | |
def convert(old_pkl): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import zipfile | |
import requests | |
import pandas as pd | |
WALKING_DATASET = ( | |
"https://archive.ics.uci.edu/ml/machine-learning-databases/00286/User%20Identification%20From%20Walking%20Activity.zip", | |
) | |
def download_data(path='data', urls=WALKING_DATASET): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/shirou/gopsutil/mem" | |
"github.com/shirou/gopsutil/cpu" | |
"github.com/shirou/gopsutil/disk" | |
"github.com/shirou/gopsutil/host" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from sklearn.datasets.base import Bunch | |
from yellowbrick.download import download_all | |
## The path to the test data sets | |
FIXTURES = os.path.join(os.getcwd(), "data") | |
## Dataset loading mechanisms | |
datasets = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from elasticsearch.helpers import bulk | |
from elasticsearch import Elasticsearch | |
class ElasticIndexer(object): | |
""" | |
Create an ElasticSearch instance, and given a list of documents, | |
index the documents into ElasticSearch. | |
""" | |
def __init__(self): | |
self.elastic_search = Elasticsearch() |
NewerOlder