| import mlflow | |
| # There are two ways to create parent/child runs in MLflow. | |
| # (1) The most common way is to use the fluent | |
| # mlflow.start_run API, passing nested=True: | |
| with mlflow.start_run(): | |
| num_trials = 10 | |
| mlflow.log_param("num_trials", num_trials) | |
| best_loss = 1e100 |
| import pyspark.sql.functions as F | |
| from pyspark.sql import Window | |
| df = spark.createDataFrame([ | |
| ('d1',None), | |
| ('d2',10), | |
| ('d3',None), | |
| ('d4',30), | |
| ('d5',None), | |
| ('d6',None), |
| // ==UserScript== | |
| // @name activesg - single court for 2 hrs | |
| // @namespace blah | |
| // @version 0.6.5 | |
| // @description activesg court booking | |
| // @match https://members.myactivesg.com/* | |
| // @copyright 2017+, naresh,Gavin,Kent | |
| // @require http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js | |
| // ==/UserScript== |
How to get Intersection and Differences of 2 arrays with golang?
- Intersection
package main
import (
"fmt"
)
| kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod |
If you hate git submodule, then you may want to give git subtree a try.
When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.
When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.
Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:
| import os | |
| import requests | |
| import time | |
| from pprint import pprint | |
| def poll_job(s, redash_url, job): | |
| # TODO: add timeout | |
| while job['status'] not in (3,4): | |
| response = s.get('{}/api/jobs/{}'.format(redash_url, job['id'])) |
| # Below are the dependencies required for installing the common combination of numpy, scipy, pandas and matplotlib | |
| # in an Alpine based Docker image. | |
| FROM alpine:3.4 | |
| RUN echo "http://dl-8.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories | |
| RUN apk --no-cache --update-cache add gcc gfortran python python-dev py-pip build-base wget freetype-dev libpng-dev openblas-dev | |
| RUN ln -s /usr/include/locale.h /usr/include/xlocale.h | |
| RUN pip install numpy scipy pandas matplotlib | |