This file contains hidden or 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 python:3.9-slim as builder | |
COPY requirements.txt . | |
COPY src/ src/ | |
COPY setup.py . | |
RUN python setup.py bdist_wheel | |
FROM public.ecr.aws/lambda/python:3.9 | |
COPY --from=builder dist/<package_name>-1.0-py3-none-any.whl <package_name>-1.0-py3-none-any.whl | |
RUN python3.9 -m pip install <package_name>-1.0-py3-none-any.whl && rm -f <package_name>-1.0-py3-none-any.whl |
This file contains hidden or 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
package com.jiwire.pca.tasks.output.views | |
import mist.api.data.{JsData, JsList, JsMap, JsString} | |
import mist.api.encoding.JsEncoder | |
import shadedshapeless._ | |
import shadedshapeless.labelled.FieldType | |
import shadedshapeless.ops.hlist.{Mapper, ToTraversable} | |
import shadedshapeless.ops.record._ | |
case class Sheet( |
This file contains hidden or 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 java.lang.*; | |
import java.lang.reflect.*; | |
public class TestJava { | |
public static void main(String... args) throws Throwable { | |
org.apache.spark.util.Utils$ instance = org.apache.spark.util.Utils$.MODULE$; | |
Method method = instance.getClass().getDeclaredMethod("findLocalInetAddress"); |
This file contains hidden or 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
object ScalingFactorFunc extends MistFn { | |
implicit val sfDailyOutMessageEnc = mist.api.encoding.generic.encoder[ScalingFactorDailyOutMessage] | |
implicit val sfCommonConfigExt = mist.api.encoding.generic.extractor[CommonConfig] | |
implicit val sfDailyInMessageExt = mist.api.encoding.generic.extractor[ScalingFactorDailyInMessage] | |
implicit val sfConfigExt = mist.api.encoding.generic.extractor[ScalingFactorConfig] | |
def handle: Handle = withArgs( | |
arg[CommonConfig]("cfg"), | |
arg[ScalingFactorDailyInMessage]("params"), | |
arg[ScalingFactorConfig]("sfCfg") |
This file contains hidden or 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
object PcaLvmOutput extends MistFn { | |
implicit val resultMessageEnc = mist.api.encoding.generic.encoder[ResultMessage] | |
override def handle: Handle = { | |
withArgs( | |
arg[String]("table_prefix"), | |
arg[Int]("nod_histogram_length", 31) | |
.validated(nodHistogramLength => nodHistogramLength > 0, "nod_histogram_length value should be positive"), | |
arg[Int]("limit_value", 250), | |
arg[String]("sources", " 'ai_6010' "), | |
arg[Int]("scaling_factor_days_processed", 90), |
This file contains hidden or 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
object VisitRateMist extends MistFn with Logging { | |
implicit val vmArgExt = mist.api.encoding.generic.extractor[VisitMetricsResultMessage] | |
implicit val vmMetricsEnc = mist.api.encoding.generic.encoder[VisitMetricsResultMessage] | |
override def handle: Handle = { | |
withArgs(arg[VisitRateArguments]) | |
.withMistExtras | |
.onSparkSession((args: VisitRateArguments, extras: MistExtras, spark: SparkSession) => { | |
//computation | |
val result: VisitMetricsResultMessage = ??? |
This file contains hidden or 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 | |
from abc import abstractmethod | |
def with_args(*args_decorator): | |
def wrapper(f): | |
for arg_decorator in args_decorator: | |
f = arg_decorator(f) | |
f.arg_defs = args_decorator | |
return f |
This file contains hidden or 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
$(document).ready -> | |
class TaskFour | |
MAX_VALUE = Number.MAX_VALUE | |
constructor: (n = 3) -> | |
@n = n | |
console.log "N = #{@n}" | |
@s = @_setArray(@n + 1) | |
@s[0] = 3.4 |
This file contains hidden or 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 gzip | |
import pickle | |
import numpy as np | |
import tensorflow as tf | |
import tflearn | |
from gensim.models.word2vec import Word2Vec | |
from tflearn.data_utils import to_categorical, pad_sequences | |
from tflearn.datasets import imdb | |
from tflearn.layers.conv import conv_1d, global_max_pool, conv_2d |
This file contains hidden or 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 argparse as arg | |
import os | |
import cv2 | |
import numpy as np | |
def generate_cropped_by_white(img_path): | |
img = cv2.imread(img_path) | |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) |
NewerOlder