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 time | |
import random | |
from elasticapm import Client, instrument | |
from elasticapm.base import get_client as get_apm_client | |
from elasticapm.contrib.celery import register_exception_tracking, register_instrumentation | |
from elasticapm.traces import execution_context | |
from celery import Celery | |
from celery.canvas import group |
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
[ | |
{ | |
"database": "load_planner", | |
"index": "saas-base", | |
"nodes": { | |
"table": "saas_api_user", | |
"schema": "public", | |
"columns": [], | |
"transform": { | |
"rename": { |
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
--- | |
apiVersion: v1 | |
kind: ConfigMap | |
metadata: | |
name: metricbeat-daemonset-modules | |
namespace: kube-system | |
labels: | |
k8s-app: metricbeat | |
data: | |
system.yml: |- |
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 React from 'react'; | |
import { useState, useEffect } from 'react' | |
function App() { | |
const [count, setCount] = useState(0) | |
// Should print the latest count a render happens | |
console.log(count) | |
useEffect(() => { | |
console.log('In effect') |
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
library(heatmaply) | |
library(shiny) | |
library(plotly) | |
ui <- fluidPage( | |
titlePanel("Old Faithful Geyser Data"), | |
mainPanel( | |
plotlyOutput(outputId = 'heatmap') | |
) |
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 vid_utils import Video, concatenate_videos | |
videos = [ | |
Video(speed=1.0, path="C:/temp/my_video_1.mp4"), | |
Video(speed=2.0, path="C:/temp/my_video_2.mp4"), | |
Video(speed=0.5, path="C:/temp/my_video_3.mp4"), | |
] | |
concatenate_videos(videos=videos, output_file=f"C:/temp/output_video.mp4") |
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 functools | |
import inspect | |
from tqdm import tqdm | |
def print_progress(total=None, enabled=True): | |
def decorator(func): | |
@functools.wraps(func) | |
def wrapper(*args, **kwargs): | |
if not enabled or total is None: |
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
# Install GPFlow | |
!git clone https://github.com/namoshizun/GPflow.git | |
!mv ./GPflow/gpflow ./ | |
!rm -rf GPflow | |
!pip install multipledispatch | |
!pip install pytest | |
# Install Other libraries | |
!pip install edward |
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 __future__ import division | |
from random import random | |
import numpy as np | |
import pandas as pd | |
''' | |
Use regret-matching algorithm to play Scissors-Rock-Paper. | |
''' | |
class RPS: |
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
""" | |
Implement a very simple gaussian process for regression task. | |
Credit : http://katbailey.github.io/post/gaussian-processes-for-dummies/ | |
""" | |
import numpy as np | |
import matplotlib.pyplot as pl | |
def prepare_data(n, fn): |
NewerOlder