A Script consists of instruction code, a set of roles, and related metadata (name, author, etc.).
Script
code: executable code
roles: [Role]
metadata: dictionary
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEditor; | |
| [ExecuteInEditMode] | |
| public class DrawSizeGizmo : MonoBehaviour { | |
| public bool enabled = true; | |
| void OnDrawGizmos () { |
| func microsoftImageSearch(_ query : String, completion: @escaping (_ result: [String])->()) { | |
| let url = URL(string: "https://api.cognitive.microsoft.com/bing/v7.0/images/search?q=\(query)") | |
| var request = URLRequest(url: url!) | |
| request.addValue(MICROSOFT_API_KEY, forHTTPHeaderField: "Ocp-Apim-Subscription-Key") | |
| URLSession.shared.dataTask(with:request, completionHandler: {(data, response, error) in | |
| guard let data = data, error == nil else { return } | |
| do { |
| func getEntities (_ sentence : String) -> [String] { | |
| let tagger = NSLinguisticTagger(tagSchemes: [.nameType], options: 0) | |
| let options: NSLinguisticTagger.Options = [.omitPunctuation, .omitWhitespace] | |
| tagger.string = sentence | |
| let range = NSRange(location:0, length: sentence.utf16.count) | |
| var prevTag : NSLinguisticTag? = nil | |
| var accName : String = "" | |
| import time | |
| import torch | |
| def validate(val_loader, model, criterion, use_cuda=False, print_freq=10): | |
| """ | |
| Evaluate a classification model on the entire validation set. | |
| Args: | |
| val_loader: a DataLoader instance for the validation set | |
| model: the model to evaluate |
| import sys | |
| import time | |
| from selenium import webdriver | |
| from selenium.webdriver.common.keys import Keys | |
| from selenium.webdriver.common.action_chains import ActionChains | |
| chrome_options = webdriver.ChromeOptions() | |
| chrome_options.add_argument("--disable-notifications") | |
| driver = webdriver.Chrome(chrome_options=chrome_options) |
| #!/bin/bash | |
| # Usage: ./resize_many.sh <filename> <sizes...> | |
| # e.g. ./resize_many.sh myasset.png 10x10 20x20 30x30 | |
| # produces 3 files, myasset10x10.png myasset20x20.png myasset30x30.png | |
| fullname=$1 | |
| shift; | |
| sizes=$* | |
| extension="${fullname##*.}" |
| import sys | |
| import numpy as np | |
| import colorlover as cl | |
| import scipy.io.wavfile as wav | |
| from scipy.interpolate import interp1d | |
| from python_speech_features import fbank | |
| from PIL import Image | |
| N_FILTERS = 10 | |
| N_FRAMES = 60 |
I hereby claim:
To claim this, I am signing this object: