pip3 install pipenv
pipenv shell
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| ) | |
| func main() { |
| !pip install fastai | |
| !apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python | |
| import cv2 | |
| from os import path | |
| from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag | |
| platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag()) | |
| accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu' | |
| !pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.3.0.post4-{platform}-linux_x86_64.whl torchvision |
| // Tensorflow Serving Go client for the inception model | |
| // go get github.com/golang/protobuf/ptypes/wrappers google.golang.org/grpc | |
| // | |
| // Compile the proto files: | |
| // | |
| // git clone https://github.com/tensorflow/serving.git | |
| // git clone https://github.com/tensorflow/tensorflow.git | |
| // | |
| // mkdir -p vendor |
| package main | |
| import "golang.org/x/tour/pic" | |
| func Pic(dx, dy int) [][]uint8 { | |
| p := make([][]uint8, dy) | |
| for y := range p { | |
| p[y] = make([]uint8, dx) | |
| for x := 0; x < dx; x++ { | |
| p[y][x] = uint8(x^y) |
| import time | |
| import json | |
| import gevent | |
| from uuid import uuid4 | |
| from locust import HttpLocust, TaskSet, task, ResponseError, events, Locust | |
| import websocket | |
| class SocketClient(object): |
| ''' | |
| Application to demonstrate testing tornado websockets. | |
| Try it wiith: python -m tornado.testing discover | |
| ''' | |
| from tornado import testing, httpserver, gen, websocket | |
| from ws import APP |
| # -*- coding:utf-8 -*- | |
| from __future__ import absolute_import | |
| from __future__ import unicode_literals | |
| from __future__ import print_function | |
| import json | |
| import uuid | |
| import time | |
| import gevent |