Skip to content

Instantly share code, notes, and snippets.

Al Johri AlJohri

Block or report user

Report or block AlJohri

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Untitled.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View batch.sh
#!/bin/bash
set -e
REPOSITORY=$(basename $(realpath $(dirname "$0")))
VCPUS=16
MEMORY=$(expr 1024 \* 32)
COMMAND='[]'
JOB_QUEUE=default
View ner.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View stream_s3_deflate.py
import io
import csv
import zlib
import boto3
from tqdm.auto import tqdm
s3 = boto3.resource('s3')
def iterable_to_stream(iterable, buffer_size=io.DEFAULT_BUFFER_SIZE):
"""
View lambda_calculus.py
# the switch
def LEFT(a):
def f(b):
return a
return f
def RIGHT(a):
def f(b):
return b
View testsubcommand.py
import sys
import argparse
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('command', choices=['userpath'])
parser.add_argument('--verbose')
parser.add_argument('--flag', action='store_true', default=False)
@AlJohri
AlJohri / sample_sqlalchemy_reflection.py
Created Apr 9, 2019
sample usage of sqlalchemy reflection to load tables hooks to print queries as they happen
View sample_sqlalchemy_reflection.py
"""
http://docs.sqlalchemy.org/en/latest/core/tutorial.html
"""
import time
import logging
import logging.config
import warnings
import sqlparse
from functools import partial
View cache_structure.txt
cache
├── aylien.sqlite
├── clavis.sqlite
├── google.sqlite
├── google_search.sqlite
├── joblib
│   └── joblib
│   └── lib
│   └── utils
│   └── translate
View dvc-reset-checksum.py
#!/usr/bin/env python
import sys
from dvc.project import Project
from dvc.stage import Stage
stage_file = sys.argv[1]
dvc = Project()
with dvc.state:
View scrape_presidential_debates.py
import requests
from bs4 import BeautifulSoup
url = 'https://www.presidency.ucsb.edu/documents/presidential-documents-archive-guidebook/presidential-candidates-debates-1960-2016'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')
for tr in soup.select('.field-body > table > tbody > tr > td > table > tbody > tr > td > table > tbody > tr'):
columns = tr.select('td')
if len(columns) == 1: continue
You can’t perform that action at this time.