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 python | |
""" | |
Decorator for fluent interface classes. | |
""" | |
import functools | |
import inspect | |
def chained(method): | |
"""Method decorator to allow chaining.""" |
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 json | |
import typing | |
from pathlib import Path | |
import click | |
import numpy as np | |
import pandas as pd | |
def get_dataset_as_dict(data_loaded: dict) -> dict: |
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
# Save the transcripts using the "Save Page WE" Chrome Extension | |
# This script was generated by ChatGPT | |
import sys | |
from bs4 import BeautifulSoup | |
# Check if a file was provided as a command line argument | |
if len(sys.argv) < 2: | |
print("Please provide an HTML file as a command line argument.") | |
sys.exit(1) |
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 | |
import contextlib | |
import os | |
import sys | |
import cachier | |
import feedparser | |
import keyring |
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
def fluent(bound_method, /, *args, **kwargs): | |
"""Call a bound method and return `self` from that method.""" | |
bound_method(*args, **kwargs) | |
return bound_method.__self__ |
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 importlib.metadata import distributions | |
import httpx | |
import yaml | |
def fetch_funding(httpx_client, owner, repo): | |
query = """ | |
query($owner: String!, $repo: String!) { |