Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 uuid | |
from pathlib import Path | |
from urllib.parse import urlparse | |
from datetime import datetime | |
import html2text | |
import requests | |
from bs4 import BeautifulSoup |
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 requests | |
from bs4 import BeautifulSoup | |
import sys | |
def get_content(url): | |
r = requests.get(url) | |
r.raise_for_status() | |
return r.text |
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 bs4 import BeautifulSoup | |
from tabulate import tabulate | |
import xerox | |
raw_html = xerox.paste() | |
tab_html = BeautifulSoup(raw_html, 'lxml') | |
rows = [] | |
for row in tab_html.find_all('tr'): | |
cols = [x.get_text().strip() for x in row.find_all(['td', 'th'])] |
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 timeit | |
from lxml import etree | |
from pandas import DataFrame | |
from uuid import uuid4 | |
# List of process attributes to retrieve | |
def analyze_deadlock(elem, data_locks, data_procs): | |
# Generate a UUID to identify all processes belonging to the same deadlock event | |
dl_uuid = uuid4().hex | |
databases = set() |
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 requests | |
import subprocess | |
import sys | |
from PIL import Image | |
from io import BytesIO | |
api_url='https://api.projectoxford.ai/vision/v1/ocr' | |
header = {'Ocp-Apim-Subscription-Key': '', | |
'Content-Type': 'application/octet-stream'} |
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 pathlib import Path | |
import logging | |
import re | |
import requests | |
from bs4 import BeautifulSoup | |
log = logging.getLogger(__name__) | |
log.addHandler(logging.NullHandler()) | |
class PacktBooks: |
NewerOlder