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
#!/anaconda/bin/python3 | |
import os | |
import sys | |
import array | |
import joblib | |
import numbers | |
import numpy as np | |
import scipy.sparse as sp |
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 jwtDecode from 'jwt-decode' | |
import * as auth from '../actions/auth' | |
function getInitialState() { | |
let initialState = { | |
access: undefined, | |
refresh: undefined, | |
errors: {} | |
} | |
const authStorage = localStorage.getItem('persist:polls') |
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 sys | |
from PyPDF2 import PdfFileReader | |
pages = [] | |
doc = PdfFileReader(sys.argv[1]) | |
for num in range(doc.numPages): | |
page = doc.getPage(num) | |
pages.append(page.extractText()) | |
print("\n".join(pages)) |
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 django import template | |
from django.conf import settings | |
from wagtail.images.templatetags.wagtailimages_tags import image | |
register = template.Library() | |
@register.tag(name="srcset_image") |
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 django import template | |
from django.conf import settings | |
from wagtail.images.templatetags.wagtailimages_tags import image | |
register = template.Library() | |
@register.tag(name="srcset_image") |
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 pytest | |
from django.conf import settings | |
from python_podcast.users.tests.factories import UserFactory | |
@pytest.fixture | |
def user() -> settings.AUTH_USER_MODEL: | |
password = "password" | |
user = UserFactory(password=password) |
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 subprocess | |
from queue import Queue | |
from threading import Thread | |
from tempfile import NamedTemporaryFile | |
class ClosableQueue(Queue): | |
SENTINEL = object() |
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 time | |
import math | |
import psutil | |
def convert_size(size_bytes): | |
if size_bytes == 0: | |
return "0B" | |
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") |
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 time | |
import math | |
import psutil | |
def convert_size(size_bytes): | |
if size_bytes == 0: | |
return "0B" | |
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") |
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 time | |
import math | |
import psutil | |
def convert_size(size_bytes): | |
if size_bytes == 0: | |
return "0B" | |
size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") |
OlderNewer