I hereby claim:
- I am randerzander on github.
- I am randerzander (https://keybase.io/randerzander) on keybase.
- I have a public key ASCodRRwJM9qPoQ6VvIz9cMx_U62fP7QCTDFkdE7PBnuuwo
To claim this, I am signing this object:
| import imageio | |
| import cv2 | |
| import numpy as np | |
| # Load GIF | |
| gif = imageio.mimread('calvin.gif') | |
| frames = [cv2.cvtColor(np.array(frame), cv2.COLOR_RGBA2BGR) for frame in gif] | |
| def is_panel(box, w_thresh=200, h_thresh=200): | |
| x, y, w, h = box |
| Game { | |
| height: 3; | |
| width: 50%; | |
| } |
| from textual.app import App, ComposeResult | |
| from textual.containers import Container | |
| from textual.reactive import reactive | |
| from textual.widgets import Static | |
| class Thing(Static): | |
| def __init__( self, text ) -> None: | |
| self._text = text | |
| super().__init__() |
| # determines whether a GPU is available in your instance and starts an appropriate Dask Cluster | |
| from dask.distributed import Client, LocalCluster | |
| from dask_cuda import LocalCUDACluster | |
| from dask_sql import Context | |
| from pyngrok import ngrok | |
| import dask | |
| import time | |
| import warnings | |
| from IPython.core.magic import needs_local_scope, register_cell_magic |
| from IPython.core.magic import register_cell_magic, needs_local_scope | |
| from sql_formatter.core import format_sql | |
| import time, warnings | |
| warnings.filterwarnings("ignore") | |
| @register_cell_magic | |
| @needs_local_scope | |
| def sql(line, cell, local_ns): | |
| sql_statement = cell.format(**local_ns) |
| df = spark.createDataFrame( | |
| [ | |
| (1, 'foo'), # create your data here, be consistent in the types. | |
| (2, 'bar'), | |
| ], | |
| ['id', 'txt'] # add your columns label here | |
| ) | |
| df.write.csv('test') | |
| spark.read.csv('test').collect() |
| import sys, os, cgi, _thread | |
| from http.server import SimpleHTTPRequestHandler, HTTPServer | |
| class MyServer(SimpleHTTPRequestHandler): | |
| #Custom POST handler that saves POSTed file content to local disk | |
| def do_POST(self): | |
| post_env = { | |
| 'REQUEST_METHOD': 'POST', | |
| 'CONTENT_TYPE': self.headers['Content-Type'], | |
| } |
| # Generate all substrings of string recursively | |
| def substrings(string): | |
| #base case | |
| if len(string) == 0: return '' | |
| else: | |
| ret = [string] | |
| #Slide from left | |
| for x in range(0, len(string)): | |
| sub = string[x:-1] | |
| ret.append(sub) |
| from org.apache.commons.io import IOUtils | |
| from java.nio.charset import StandardCharsets | |
| from org.apache.nifi.processor.io import StreamCallback | |
| import os, sys, imp, traceback, time | |
| from urlparse import urlparse | |
| parser_path = '/home/dev/projects/scripts/parsers/' | |
| class PyStreamCallback(StreamCallback): |
I hereby claim:
To claim this, I am signing this object: