content
stringlengths
1
1.05M
input_ids
listlengths
1
883k
ratio_char_token
float64
1
22.9
token_count
int64
1
883k
# Generated by Django 3.0.2 on 2020-02-09 18:12 from django.db import migrations
[ 2, 2980, 515, 416, 37770, 513, 13, 15, 13, 17, 319, 12131, 12, 2999, 12, 2931, 1248, 25, 1065, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 628 ]
2.766667
30
# # mostly copied from # http://bioportal.weizmann.ac.il/course/python/PyMOTW/PyMOTW/docs/socket/multicast.html # import socket import struct import sys import time message = 'data worth repeating' multicast_group = ('226.1.1.1', 4321) # Create the datagram socket sock = socket.socket(socket.AF_INET, socket.SOCK_D...
[ 2, 198, 2, 4632, 18984, 422, 198, 2, 220, 220, 2638, 1378, 8482, 404, 16906, 13, 732, 528, 9038, 13, 330, 13, 346, 14, 17319, 14, 29412, 14, 20519, 44, 2394, 54, 14, 20519, 44, 2394, 54, 14, 31628, 14, 44971, 14, 16680, 291, 459...
2.461538
312
import numpy as np from chol_factor import chol_factor from triangular import triangular # TEST: Cholesky factorization (LL') # Symmetric positive definite matrix A = np.matrix('5 1.2 0.3 -0.6;' '1.2 6 -0.4 0.9;' '0.3 -0.4 8 1.7;' '-0.6 0.9 1.7 10'); print('A = ...
[ 11748, 299, 32152, 355, 45941, 198, 6738, 442, 349, 62, 31412, 1330, 442, 349, 62, 31412, 198, 6738, 46963, 1330, 46963, 198, 198, 2, 43001, 25, 609, 4316, 2584, 5766, 1634, 357, 3069, 11537, 198, 198, 2, 1632, 3020, 19482, 3967, 2189...
2.151515
396
"""Build the tkinter gui root""" import math from PyQt5.QtWidgets import *#(QWidget, QToolTip, QDesktopWidget, QPushButton, QApplication) from PyQt5.QtGui import QFont from PyQt5.QtCore import QCoreApplication, QObject, QRunnable, QThread, QThreadPool, pyqtSignal, pyqtSlot from PyQt5.QtGui import QIntValidator, QDoubl...
[ 37811, 15580, 262, 256, 74, 3849, 11774, 6808, 37811, 198, 11748, 10688, 198, 6738, 9485, 48, 83, 20, 13, 48, 83, 54, 312, 11407, 1330, 1635, 2, 7, 48, 38300, 11, 1195, 25391, 28434, 11, 1195, 36881, 38300, 11, 1195, 49222, 21864, 1...
2.87619
210
# -*- coding: utf-8 -*- from __future__ import print_function, division from qsrlib_qsrs.qsr_dyadic_abstractclass import QSR_Dyadic_1t_Abstractclass import math
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 11, 7297, 198, 6738, 10662, 27891, 8019, 62, 48382, 3808, 13, 80, 27891, 62, 9892, 23876, 62, 397, 8709, 4871, 1330, 1195,...
2.728814
59
# NBA Stats Clustering # Copyright Matthew Strong, 2019 # gaussian mixture models with em algorithm import numpy as np from scipy import stats from clustering.Cluster import NBACluster # nba gmm class # gmm from scratch as well, more explained below
[ 2, 7403, 20595, 1012, 436, 1586, 198, 2, 15069, 9308, 13535, 11, 13130, 198, 198, 2, 31986, 31562, 11710, 4981, 351, 795, 11862, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 629, 541, 88, 1330, 9756, 198, 6738, 32966, 1586, 13, 2601...
3.705882
68
import torch from torch.utils.data import DataLoader import matplotlib.pyplot as plt import sys sys.path.append("./ML") import Definitions.models as models from Definitions.dataset import Data if __name__ == "__main__": main()
[ 11748, 28034, 201, 198, 6738, 28034, 13, 26791, 13, 7890, 1330, 6060, 17401, 201, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 201, 198, 201, 198, 11748, 25064, 201, 198, 201, 198, 17597, 13, 6978, 13, 33295, 7, 1911,...
2.702128
94
from datetime import datetime, timedelta import pygame from pygame.mixer import Sound from screens.base_screen import BaseScreen from ui import colours from ui.widgets.background import LcarsBackgroundImage from ui.widgets.gifimage import LcarsGifImage from ui.widgets.lcars_widgets import LcarsButton from ui.widgets....
[ 6738, 4818, 8079, 1330, 4818, 8079, 11, 28805, 12514, 198, 198, 11748, 12972, 6057, 198, 6738, 12972, 6057, 13, 19816, 263, 1330, 9506, 198, 198, 6738, 8947, 13, 8692, 62, 9612, 1330, 7308, 23901, 198, 6738, 334, 72, 1330, 18915, 198, ...
3.330189
106
import swarm_tasks.utils.robot
[ 11748, 30077, 62, 83, 6791, 13, 26791, 13, 305, 13645, 198 ]
2.818182
11
# -*- coding: utf-8 -*- """ Created on Sun Mar 7 17:11:12 2021 @author: User SUMMATION OF PRIMES The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. 21min19s to find. """ from datetime import datetime as date # INPUTS target = 2000000 prime...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 201, 198, 41972, 319, 3825, 1526, 220, 767, 1596, 25, 1157, 25, 1065, 33448, 201, 198, 201, 198, 31, 9800, 25, 11787, 201, 198, 201, 198, 50, 5883, 44, 6...
2.222222
648
import numpy as np import pytest from l5kit.geometry import transform_points from l5kit.rasterization.render_context import RenderContext
[ 11748, 299, 32152, 355, 45941, 198, 11748, 12972, 9288, 198, 198, 6738, 300, 20, 15813, 13, 469, 15748, 1330, 6121, 62, 13033, 198, 6738, 300, 20, 15813, 13, 81, 1603, 1634, 13, 13287, 62, 22866, 1330, 46722, 21947, 628 ]
3.589744
39
import vim import functools import dbus try: Fcitx = FcitxComm() fcitx_loaded = True except dbus.exceptions.DBusException as e: if not vim.vars.get('silent_unsupported'): vim.command('echohl WarningMsg | echom "fcitx.vim not loaded: %s" | echohl NONE' % e) fcitx_loaded = False
[ 11748, 43907, 198, 11748, 1257, 310, 10141, 198, 198, 11748, 288, 10885, 198, 198, 28311, 25, 198, 220, 376, 47992, 87, 796, 376, 47992, 87, 6935, 3419, 198, 220, 277, 47992, 87, 62, 14578, 796, 6407, 198, 16341, 288, 10885, 13, 1069,...
2.517241
116
import requests post()
[ 11748, 7007, 628, 198, 198, 7353, 3419, 198 ]
3.25
8
# -*- coding: utf-8 -*- from avioclient.send_data import SendControls from avioclient import config if __name__ == "__main__": send_data()
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 1196, 72, 38679, 1153, 13, 21280, 62, 7890, 1330, 16290, 15988, 82, 198, 6738, 1196, 72, 38679, 1153, 1330, 4566, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, ...
2.561404
57
c = float(input('Digite a temperatura em Ceusius: ')) f = (9*c + 160)/5 print(f'A temperatura de {c:.1f}C corresponde a {f:.1f}F')
[ 66, 796, 12178, 7, 15414, 10786, 19511, 578, 257, 4124, 2541, 64, 795, 20101, 385, 3754, 25, 705, 4008, 198, 69, 796, 357, 24, 9, 66, 1343, 13454, 20679, 20, 198, 4798, 7, 69, 6, 32, 4124, 2541, 64, 390, 1391, 66, 25, 13, 16, ...
2.166667
60
# not yet finished for _ in range(int(input())):print(len(list(set(input().replace("-", "")))))
[ 2, 407, 1865, 5201, 198, 1640, 4808, 287, 2837, 7, 600, 7, 15414, 28955, 2599, 4798, 7, 11925, 7, 4868, 7, 2617, 7, 15414, 22446, 33491, 7203, 12, 1600, 13538, 4008, 22305 ]
2.96875
32
import os import unittest import despyfitsutils.fitsutils as utils TESTDIR = os.path.dirname(__file__)
[ 11748, 28686, 198, 11748, 555, 715, 395, 198, 11748, 748, 9078, 21013, 26791, 13, 21013, 26791, 355, 3384, 4487, 628, 198, 51, 6465, 34720, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 8, 628 ]
2.864865
37
#!/usr/bin/env python # -*- coding: utf-8 -*- from time import gmtime, strftime from gluon.custom_import import track_changes track_changes(True) from gluon import current from pydal import * import sys reload(sys) sys.setdefaultencoding('utf-8') if request.global_settings.web2py_version < "2.14.1": raise HTTP...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 640, 1330, 308, 76, 2435, 11, 965, 31387, 198, 6738, 1278, 84, 261, 13, 23144, 62, 11748, 1330, 2610, 62, 36653...
2.554924
1,584
import os if (os.name == 'nt' or os.name == 'dos'): try: from win32com.shell import shell import pythoncom except Exception, e: print 'WARNING: Received exception ' + `e` + ' in doing import.' print 'WARNING: Unable to import win32com.shell.shell, pythoncom.' ...
[ 201, 198, 201, 198, 11748, 28686, 201, 198, 201, 198, 361, 357, 418, 13, 3672, 6624, 705, 429, 6, 393, 28686, 13, 3672, 6624, 705, 37427, 6, 2599, 201, 198, 220, 220, 220, 1949, 25, 201, 198, 220, 220, 220, 220, 220, 220, 220, 4...
2.508197
183
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-28 08:09 from __future__ import unicode_literals from django.db import migrations, models
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 24, 13, 17, 319, 1584, 12, 3070, 12, 2078, 8487, 25, 2931, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 1...
2.719298
57
""" Group - SwimTime - Swim your way to success """ import ads1x15 import network import time import math import machine from umqtt.simple import MQTTClient import micropython from micropython import const from machine import Pin """ Define constant values """ run = False lapnr = 3 #default lap number temp = ...
[ 37811, 628, 198, 13247, 532, 198, 198, 10462, 320, 7575, 532, 35953, 534, 835, 284, 1943, 198, 198, 37811, 198, 198, 11748, 9011, 16, 87, 1314, 198, 11748, 3127, 198, 11748, 640, 198, 11748, 10688, 198, 11748, 4572, 198, 6738, 23781, ...
2.52451
816
''' The MIT License (MIT) Copyright (c) 2016 WavyCloud Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, p...
[ 7061, 6, 198, 198, 464, 17168, 13789, 357, 36393, 8, 198, 198, 15269, 357, 66, 8, 1584, 370, 2830, 18839, 198, 198, 5990, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 198, 1659, 428, 3788, 290, ...
2.221717
18,050
""" Feeder for batch production""" from __future__ import absolute_import import ctypes from ddls.base import check_call, LIB, c_str, c_array from ddls.feeder.batch_iterator import BatchIterator
[ 37811, 18272, 263, 329, 15458, 3227, 37811, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 198, 11748, 269, 19199, 198, 6738, 49427, 7278, 13, 8692, 1330, 2198, 62, 13345, 11, 45651, 11, 269, 62, 2536, 11, 269, 62, 18747, 1...
3.45614
57
import pytest from mvlearn.example.example import example_function def test_example_function(): """ Test that example function returns correct value. """ assert example_function() == "param" assert example_function("hello") == "hello"
[ 11748, 12972, 9288, 198, 198, 6738, 285, 85, 35720, 13, 20688, 13, 20688, 1330, 1672, 62, 8818, 628, 198, 4299, 1332, 62, 20688, 62, 8818, 33529, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 6208, 326, 1672, 2163, 5860, 3376, 1988, ...
3.350649
77
from flask_restful import Resource import requests from api.common.utils import file_response ENCODING = 'utf-8' SCHEMA_URL = 'http://127.0.0.1:8422' STORE_URL = 'http://127.0.0.1:8423'
[ 6738, 42903, 62, 2118, 913, 1330, 20857, 198, 11748, 7007, 198, 198, 6738, 40391, 13, 11321, 13, 26791, 1330, 2393, 62, 26209, 628, 198, 24181, 3727, 2751, 796, 705, 40477, 12, 23, 6, 198, 50, 3398, 27630, 62, 21886, 796, 705, 4023, ...
2.5
78
#!/bin/env python #coding: utf-8 import pymongo print [x for x in range(2)] con = pymongo.MongoClient("localhost", 27017) db = con.mars collection = db.users data = collection.find_one({"username":"hyr"}) print data data['age'] = 225 print collection.update({"_idd":data['_id']}, data) print collection.find_one({"u...
[ 2, 48443, 8800, 14, 24330, 21015, 198, 2, 66, 7656, 25, 3384, 69, 12, 23, 628, 198, 198, 11748, 279, 4948, 25162, 198, 4798, 685, 87, 329, 2124, 287, 2837, 7, 17, 15437, 198, 198, 1102, 796, 279, 4948, 25162, 13, 44, 25162, 11792,...
2.635802
162
import numpy as np
[ 11748, 299, 32152, 355, 45941 ]
3.6
5
""" Greedy Module Solution for Utils control """ # Libraries from typing import List from functools import reduce # Modules from src.utils.math import ( list_negative, invert_positions, evaluate_fo ) # Constants COMPARE_VALUE = 99999999 def worst_solution(distance_matrix: List[List[float]]) -> List[in...
[ 37811, 198, 43887, 4716, 19937, 28186, 329, 7273, 4487, 1630, 198, 37811, 198, 198, 2, 46267, 198, 6738, 19720, 1330, 7343, 198, 6738, 1257, 310, 10141, 1330, 4646, 198, 198, 2, 3401, 5028, 198, 6738, 12351, 13, 26791, 13, 11018, 1330, ...
2.131561
1,505
import math import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from models.modules.model.vgg16 import Vgg16 import os vgg = Vgg16() vgg.load_state_dict(torch.load(os.path.join(os.path.abspath('.'), 'models/modules/model/', 'vgg16.weight'))) params = list(vgg.named_parameters()) encodi...
[ 11748, 10688, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 4981, 13, 18170, 13, 19849, 13, 85, 1130, 1433, 1330, 569, ...
2.177264
519
import time import random import json import requests
[ 11748, 640, 198, 11748, 4738, 198, 11748, 33918, 198, 11748, 7007, 628, 198 ]
4.307692
13
""" Codemonk link: https://www.hackerearth.com/practice/algorithms/dynamic-programming/introduction-to-dynamic-programming-1/practice-problems/algorithm/equal-array-84cf6c5f/ You are given an array A of size N. Find the minimum non negative number X such that there exists an index j that when you can replace Aj by Aj+...
[ 37811, 198, 43806, 7966, 74, 2792, 25, 3740, 1378, 2503, 13, 71, 330, 365, 260, 11999, 13, 785, 14, 39541, 14, 282, 7727, 907, 14, 67, 28995, 12, 23065, 2229, 14, 27427, 596, 12, 1462, 12, 67, 28995, 12, 23065, 2229, 12, 16, 14, ...
2.573668
638
from itertools import chain phi = 1.61803398875
[ 6738, 340, 861, 10141, 1330, 6333, 198, 198, 34846, 796, 352, 13, 21, 15259, 29626, 3459, 2425, 198 ]
2.722222
18
import unittest from unittest.mock import call, patch, Mock, MagicMock from qilib.configuration_helper import InstrumentAdapterFactory
[ 11748, 555, 715, 395, 198, 6738, 555, 715, 395, 13, 76, 735, 1330, 869, 11, 8529, 11, 44123, 11, 6139, 44, 735, 198, 198, 6738, 10662, 22282, 13, 11250, 3924, 62, 2978, 525, 1330, 42410, 47307, 22810, 628, 198 ]
3.538462
39
import json import pprint import random from terra_sdk.core import AccAddress, Coins from terra_sdk.core.auth import StdFee from terra_sdk.core.broadcast import BlockTxBroadcastResult from scripts.deploy import owner, lt from terra_sdk.core.wasm import MsgExecuteContract if __name__ == '__main__': main()
[ 11748, 33918, 198, 11748, 279, 4798, 198, 11748, 4738, 198, 198, 6738, 1059, 430, 62, 21282, 74, 13, 7295, 1330, 6366, 20231, 11, 30108, 198, 6738, 1059, 430, 62, 21282, 74, 13, 7295, 13, 18439, 1330, 520, 67, 37, 1453, 198, 6738, 1...
2.908257
109
from core.exceptions import BaseProjectException
[ 6738, 4755, 13, 1069, 11755, 1330, 7308, 16775, 16922, 628, 198 ]
4.636364
11
import math from nexinfosys.model_services import State materials = { "Aluminium", "Antimony", "Arsenic", "Baryte", "Beryllium", "Borates", "Cadmium", "Cerium", "Chromium", "Cobalt", "Copper", "Diatomite", "Dysprosium", "Europium", "Fluorspar", "Gadolini...
[ 11748, 10688, 198, 198, 6738, 497, 87, 10745, 418, 893, 13, 19849, 62, 30416, 1330, 1812, 198, 198, 33665, 82, 796, 1391, 198, 220, 220, 220, 366, 2348, 35241, 1600, 198, 220, 220, 220, 366, 13217, 33969, 1600, 198, 220, 220, 220, 3...
1.829787
517
# defining a decorator # defining a function, to be called inside wrapper # passing 'function_to_be_used' inside the decorator to control its behaviour function_to_be_used = hello_decorator(function_to_be_used) # calling the function function_to_be_used() # find out the execution time of a function using a deco...
[ 2, 16215, 257, 11705, 1352, 201, 198, 2, 16215, 257, 2163, 11, 284, 307, 1444, 2641, 29908, 201, 198, 2, 6427, 705, 8818, 62, 1462, 62, 1350, 62, 1484, 6, 2641, 262, 11705, 1352, 284, 1630, 663, 9172, 201, 198, 8818, 62, 1462, 62,...
3.383978
362
#!/usr/bin/env python """ Info: This script performs topic modeling on the clean tweets by Donald Trump. The number of topics is estimated by computing coherence values for different number of topics, and an LDA model is constructed with the number of topics with the highest coherence value. Visualizations of the topic...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 198, 12360, 25, 770, 4226, 17706, 7243, 21128, 319, 262, 3424, 12665, 416, 3759, 1301, 13, 383, 1271, 286, 10233, 318, 6108, 416, 14492, 763, 23545, 3815, 329, 1180, 1271, 286, ...
3.209657
787
""" William DUong """ import os.path as osp import os import errno from .build import DATASET_REGISTRY from .base_dataset import Datum, DatasetBase,EEGDatum from scipy.io import loadmat import numpy as np from collections import defaultdict
[ 37811, 198, 17121, 35480, 506, 198, 37811, 198, 198, 11748, 28686, 13, 6978, 355, 267, 2777, 198, 11748, 28686, 198, 11748, 11454, 3919, 198, 6738, 764, 11249, 1330, 360, 1404, 1921, 2767, 62, 31553, 1797, 40405, 198, 6738, 764, 8692, 6...
3.037037
81
import argparse import json from ursina import load_texture, Ursina, Entity, color, camera, Quad, mouse, time, window, invoke, WindowPanel, \ Text, InputField, Space, scene, Button, Draggable, Tooltip, Scrollable from pywolf3d.games.wolf3d import WALL_DEFS, WallDef, OBJECT_DEFS Z_GRID = 0 Z_OBJECT = 2 Z_WALL = 3...
[ 11748, 1822, 29572, 198, 11748, 33918, 198, 198, 6738, 220, 1834, 1437, 1330, 3440, 62, 41293, 11, 37935, 1437, 11, 20885, 11, 3124, 11, 4676, 11, 20648, 11, 10211, 11, 640, 11, 4324, 11, 26342, 11, 26580, 26639, 11, 3467, 198, 220, ...
2.592593
324
"""Functions for loading and data management for EEG-FOOOF.""" from os.path import join as pjoin import numpy as np from fooof import FOOOFGroup from fooof.analysis import get_band_peak_fg from settings import BANDS, YNG_INDS, OLD_INDS, N_LOADS, N_SUBJS, N_TIMES ####################################################...
[ 37811, 24629, 2733, 329, 11046, 290, 1366, 4542, 329, 48749, 12, 6080, 6684, 37, 526, 15931, 198, 198, 6738, 28686, 13, 6978, 1330, 4654, 355, 279, 22179, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 22944, 1659, 1330, 376, ...
2.491947
1,366
import sys import cv2 import numpy as np img1 = cv2.imread('source1.jpg',0) img2 = cv2.imread('source2.jpg',0) ret, thresh = cv2.threshold(img1, 127, 255,0) ret, thresh2 = cv2.threshold(img2, 127, 255,0) contours,hierarchy,a = cv2.findContours(thresh,2,1) cnt1 = contours[0] contours,hierarchy,a = cv2.findContours(th...
[ 11748, 25064, 198, 11748, 269, 85, 17, 198, 11748, 299, 32152, 355, 45941, 198, 198, 9600, 16, 796, 269, 85, 17, 13, 320, 961, 10786, 10459, 16, 13, 9479, 3256, 15, 8, 198, 9600, 17, 796, 269, 85, 17, 13, 320, 961, 10786, 10459, ...
2.004854
206
import os from __main__ import vtk, qt, ctk, slicer import EditorLib from EditorLib.EditOptions import HelpButton from EditorLib.EditOptions import EditOptions from EditorLib import EditUtil from EditorLib import LabelEffect # # EditorEffectTemplateTool # # # EditorEffectTemplateLogic # # # The InteractiveConnecte...
[ 11748, 28686, 198, 6738, 11593, 12417, 834, 1330, 410, 30488, 11, 10662, 83, 11, 269, 30488, 11, 14369, 263, 198, 11748, 12058, 25835, 198, 6738, 12058, 25835, 13, 18378, 29046, 1330, 10478, 21864, 198, 6738, 12058, 25835, 13, 18378, 2904...
3.532258
124
from django.urls import path from category.views import List,Detail,Create,Delete,Update,Search,All urlpatterns = [ path('all',All.as_view()), path('list/<int:pk>',List.as_view()), path('search/<str:pk>',Search.as_view()), path('detail/<int:pk>',Detail.as_view()), path('create', Create.as_view()), ...
[ 6738, 42625, 14208, 13, 6371, 82, 1330, 3108, 198, 6738, 6536, 13, 33571, 1330, 7343, 11, 11242, 603, 11, 16447, 11, 38727, 11, 10260, 11, 18243, 11, 3237, 198, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220, 3108, 10786, 439, 3...
2.331461
178
# ------------------------------------------ # Description: This python script will update AWS Thing Shadow for a Device/Thing # ------------------------------------------ # Import package import paho.mqtt.client as mqtt import ssl, time, sys # ======================================================= # Set Following V...
[ 2, 20368, 35937, 198, 2, 12489, 25, 770, 21015, 4226, 481, 4296, 30865, 21561, 8843, 329, 257, 16232, 14, 51, 722, 198, 2, 20368, 35937, 198, 198, 2, 17267, 5301, 198, 11748, 279, 17108, 13, 76, 80, 926, 13, 16366, 355, 285, 80, 9...
2.908992
923
import time from lightpi.hardware import strip, string1, string2 DELAY_SEC = 0.3 # Test the RGB Strip strip.red() time.sleep(DELAY_SEC) strip.green() time.sleep(DELAY_SEC) strip.blue() time.sleep(DELAY_SEC) strip.off() # Test the LED Strings string1.on() time.sleep(DELAY_SEC) string1.off() time.sleep(DELAY_SEC) st...
[ 11748, 640, 198, 198, 6738, 1657, 14415, 13, 10424, 1574, 1330, 10283, 11, 4731, 16, 11, 4731, 17, 628, 198, 35, 3698, 4792, 62, 23683, 796, 657, 13, 18, 198, 198, 2, 6208, 262, 25228, 18508, 198, 36311, 13, 445, 3419, 198, 2435, ...
3.236686
169
#!/usr/bin/env python # -*- coding: utf-8 -*- # # wind_direction.py # # Copyright 2020 <Simone Severini> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the Licen...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 220, 2344, 62, 37295, 13, 9078, 198, 2, 220, 220, 198, 2, 220, 15069, 12131, 220, 1279, 8890, 505, 26434...
3.232558
301
# Copyright 2017 Cloudbase Solutions SRL # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
[ 2, 15069, 2177, 10130, 8692, 23555, 311, 7836, 198, 2, 1439, 6923, 33876, 13, 198, 2, 198, 2, 220, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 220, 220, 220, 407...
3.396396
222
#!/usr/bin/python import rospy import rosbag import time
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 11748, 686, 2777, 88, 198, 11748, 686, 82, 21454, 198, 11748, 640, 628, 628, 198 ]
2.583333
24
"""A logging handler class which produces coloured logs.""" import logging import click
[ 37811, 32, 18931, 21360, 1398, 543, 11073, 34746, 17259, 526, 15931, 628, 198, 11748, 18931, 198, 198, 11748, 3904, 628 ]
4.6
20
# -*- coding: utf-8 -*- from PyQt5 import QtCore import numpy as np from matplotlib.figure import Figure import time import matplotlib matplotlib.use("Qt5Agg") # QT5 from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 9485, 48, 83, 20, 1330, 33734, 14055, 198, 11748, 299, 32152, 355, 45941, 198, 6738, 2603, 29487, 8019, 13, 26875, 1330, 11291, 198, 11748, 640, 198, 11748, 2603, ...
2.777778
90
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @Author: Tom Dwelly # @Date: 2020-03-03 # @Filename: bhm_spiders_agn.py # @License: BSD 3-clause (http://www.opensource.org/licenses/BSD-3-Clause) # derived from guide.py # ### flake8: noqa # isort: skip_file import peewee from peewee import JOIN from peewee import fn...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 2488, 13838, 25, 4186, 42979, 88, 198, 2, 2488, 10430, 25, 12131, 12, 3070, 12, 3070, 198, 2, 2488, 3506...
2.414757
3,185
# Generated by Django 3.1.6 on 2021-04-22 00:59 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 21, 319, 33448, 12, 3023, 12, 1828, 3571, 25, 3270, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.84375
32
""" Data terrain model (DTM). Examples:: >>> from worldmap import DTM >>> dtm = DTM() >>> print(dtm["NOR"]) Location('Norway') """ from typing import Dict, List, Tuple, Set, Optional from bokeh.models import Model from bokeh.models import ColumnDataSource, Patches, LabelSet import logging import num...
[ 37811, 198, 6601, 15510, 2746, 357, 35, 15972, 737, 198, 198, 27730, 3712, 628, 220, 220, 220, 13163, 422, 995, 8899, 1330, 360, 15972, 198, 220, 220, 220, 13163, 288, 17209, 796, 360, 15972, 3419, 198, 220, 220, 220, 13163, 3601, 7, ...
3.083871
155
""" """ from Crypto.PublicKey import RSA from Crypto.Hash import SHA256 from Crypto.Signature import PKCS1_v1_5 from base58 import b58encode, b58decode # ================= cryptography helpers ====================================== def hash(data): """Hash some data """ # Hash the stuff we need to hash ...
[ 37811, 198, 37811, 198, 6738, 36579, 13, 15202, 9218, 1330, 42319, 198, 6738, 36579, 13, 26257, 1330, 25630, 11645, 198, 6738, 36579, 13, 11712, 1300, 1330, 29673, 7902, 16, 62, 85, 16, 62, 20, 198, 6738, 2779, 3365, 1330, 275, 3365, ...
2.65745
651
import numpy as np import matplotlib.pyplot as plt mandelbrot(120, 6000)
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 628, 198, 22249, 417, 7957, 83, 7, 10232, 11, 39064, 8 ]
2.740741
27
import unittest import copy import os import tempfile from config_tool.utils import * if __name__ == '__main__': unittest.main()
[ 11748, 555, 715, 395, 198, 11748, 4866, 198, 11748, 28686, 198, 11748, 20218, 7753, 198, 198, 6738, 4566, 62, 25981, 13, 26791, 1330, 1635, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 555, 7...
2.893617
47
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2019-Present Datadog, Inc. from datadog_api_client.v2.model_utils import ( ModelNormal, cached_property, ...
[ 2, 17486, 11777, 5081, 4306, 477, 3696, 287, 428, 16099, 389, 11971, 739, 262, 24843, 12, 17, 13, 15, 13789, 13, 198, 2, 770, 1720, 3407, 3788, 4166, 379, 16092, 324, 519, 357, 5450, 1378, 2503, 13, 19608, 4533, 456, 80, 13, 785, ...
3.336634
101
import logging logging.Filter.filter logging.getLogger().propagate logging.StreamHandler.emit
[ 11748, 18931, 198, 198, 6404, 2667, 13, 22417, 13, 24455, 198, 6404, 2667, 13, 1136, 11187, 1362, 22446, 22930, 37861, 198, 6404, 2667, 13, 12124, 25060, 13, 368, 270, 198 ]
3.166667
30
import platform import pytest
[ 11748, 3859, 198, 198, 11748, 12972, 9288, 628 ]
4
8
# bloque principal fecha=cargar_fecha() imprimir_fecha(fecha)
[ 201, 198, 201, 198, 2, 24924, 4188, 10033, 201, 198, 201, 198, 69, 3055, 64, 28, 66, 853, 283, 62, 69, 3055, 64, 3419, 201, 198, 320, 1050, 13057, 62, 69, 3055, 64, 7, 69, 3055, 64, 8 ]
1.815789
38
# %% l = [38,32,49,15,806,806] sum(l) # %% len(l) # %% sum(l)//len(l) # %% l.sort() # %% l # %% # %% l.most_common(1) # %% ''' ''' from collections import Counter l = ['38','32','49','15','806','806'] c = Counter(l) print(c.most_common()[0][0]) print(c.most_common(1)) print(c.most_common(2)) # %% c.most_common()[...
[ 2, 43313, 198, 75, 796, 685, 2548, 11, 2624, 11, 2920, 11, 1314, 11, 37988, 11, 37988, 60, 198, 16345, 7, 75, 8, 198, 2, 43313, 198, 11925, 7, 75, 8, 198, 2, 43313, 198, 16345, 7, 75, 8, 1003, 11925, 7, 75, 8, 198, 2, 43313,...
1.948864
176
""" Network class is in charge of: 1. Storing M - User Cache Size, N - Number of Files, K - Number of Users 2. Storing User instances, Server instance, and attacker instance """ import numpy as np from scipy import special import itertools from Server import Server from User import User from tabulate import tabulate ...
[ 37811, 198, 26245, 1398, 318, 287, 3877, 286, 25, 198, 16, 13, 520, 3255, 337, 532, 11787, 34088, 12849, 11, 399, 532, 7913, 286, 13283, 11, 509, 532, 7913, 286, 18987, 198, 17, 13, 520, 3255, 11787, 10245, 11, 9652, 4554, 11, 290, ...
2.629382
599
from . import omniglot
[ 6738, 764, 1330, 22284, 328, 26487, 198 ]
3.285714
7
# two templates are used in this app from flask import Flask, render_template app = Flask(__name__) if __name__ == '__main__': app.run(debug=True)
[ 2, 734, 24019, 389, 973, 287, 428, 598, 220, 198, 198, 6738, 42903, 1330, 46947, 11, 8543, 62, 28243, 198, 1324, 796, 46947, 7, 834, 3672, 834, 8, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, ...
2.90566
53
import asyncio
[ 11748, 30351, 952, 628, 198 ]
3.4
5
import json from io import BytesIO from app.ext.api.exceptions import ( ChefNotFound, InvalidToken, MaximumImageCapacityError, OperationNotAllowed, RecipeWithoutIngredient, RecipeWithoutPreparationMode, ) from app.ext.api.services import token_services
[ 11748, 33918, 198, 6738, 33245, 1330, 2750, 4879, 9399, 198, 198, 6738, 598, 13, 2302, 13, 15042, 13, 1069, 11755, 1330, 357, 198, 220, 220, 220, 26383, 3673, 21077, 11, 198, 220, 220, 220, 17665, 30642, 11, 198, 220, 220, 220, 22246,...
2.94898
98
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2016-11-28 09:36 from __future__ import unicode_literals from django.db import migrations, models
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 940, 13, 18, 319, 1584, 12, 1157, 12, 2078, 7769, 25, 2623, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, ...
2.736842
57
import os import sys from pathlib import Path sys.path.insert(0, 'exactdelaypathfinder')
[ 11748, 28686, 198, 11748, 25064, 198, 6738, 3108, 8019, 1330, 10644, 198, 198, 17597, 13, 6978, 13, 28463, 7, 15, 11, 705, 1069, 529, 40850, 6978, 22805, 11537, 198 ]
3.103448
29
import time from collections import defaultdict if __name__ == "__main__": part1() part2()
[ 11748, 640, 198, 6738, 17268, 1330, 4277, 11600, 628, 628, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 628, 220, 220, 220, 636, 16, 3419, 198, 220, 220, 220, 636, 17, 3419, 198 ]
2.888889
36
from microbit import * import struct from time import sleep SENSORS = 2 spi.init(baudrate=100000) while True: for i in [0, 1]: print(i, ord(spi_read(i))) sleep(0.1)
[ 6738, 4580, 2545, 1330, 1635, 198, 11748, 2878, 198, 6738, 640, 1330, 3993, 198, 198, 50, 16938, 20673, 796, 362, 198, 198, 2777, 72, 13, 15003, 7, 65, 3885, 4873, 28, 3064, 830, 8, 198, 4514, 6407, 25, 198, 220, 220, 220, 329, 13...
2.188235
85
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import datetime import typing as t import json from dataclasses import dataclass, field from mypy_boto3_dynamodb.service_resource import Table from boto3.dynamodb.conditions import Attr, Key """ Data transfer object classes to be used with dynamod...
[ 2, 15069, 357, 66, 8, 3203, 11, 3457, 13, 290, 663, 29116, 13, 1439, 6923, 33876, 198, 198, 11748, 4818, 8079, 198, 11748, 19720, 355, 256, 198, 11748, 33918, 198, 6738, 4818, 330, 28958, 1330, 4818, 330, 31172, 11, 2214, 198, 6738, ...
3.180723
166
from .bucket_tensor_copy import BucketizedTensorCopy __all__ = ['BucketizedTensorCopy']
[ 6738, 764, 27041, 316, 62, 83, 22854, 62, 30073, 1330, 48353, 1143, 51, 22854, 29881, 198, 198, 834, 439, 834, 796, 37250, 33, 38811, 1143, 51, 22854, 29881, 20520, 198 ]
2.966667
30
from django.apps import AppConfig
[ 6738, 42625, 14208, 13, 18211, 1330, 2034, 16934, 628 ]
3.888889
9
import numpy as np import pytest from ddtruss import Truss, DataDrivenSolver points = np.array([[0, 0], [1, 0], [0.5, 0.5], [2, 1]]) lines = np.array([[0, 2], [1, 2], [1, 3], [2, 3]], dtype=int) truss = Truss(points, lines) E = 1.962e11 A = [2e-4, 2e-4, 1e-4, 1e-4] U_dict = {0: [0, 0], 1: [0, 0]} F_dict = {3: [0, -...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 12972, 9288, 198, 198, 6738, 49427, 2213, 1046, 1330, 833, 1046, 11, 6060, 20564, 574, 50, 14375, 198, 198, 13033, 796, 45941, 13, 18747, 26933, 58, 15, 11, 657, 4357, 685, 16, 11, 657, 4357,...
1.784232
241
from datetime import datetime from app import db
[ 6738, 4818, 8079, 1330, 4818, 8079, 198, 6738, 598, 1330, 20613, 628, 628, 628 ]
3.857143
14
import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable from utils.utils import gpu_wrapper from Modules.subModules.attention import AttentionUnit from torch.nn.utils.rnn import pack_padded_sequence as pack from torch.nn.utils.rnn import pad_pa...
[ 11748, 28686, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28034, 198, 11748, 28034, 13, 20471, 355, 299, 77, 198, 11748, 28034, 13, 20471, 13, 45124, 355, 376, 198, 6738, 28034, 13, 2306, 519, 6335, 1330, 35748, 198, 6738, 3384, 448...
3.415842
101
""" `minion-ci` is a minimalist, decentralized, flexible Continuous Integration Server for hackers. This module contains the parser to parse the `minion.yml` file. :copyright: (c) by Timo Furrer :license: MIT, see LICENSE for details """ import yaml from .errors import MinionError def parse(path):...
[ 37811, 198, 220, 220, 220, 4600, 1084, 295, 12, 979, 63, 318, 257, 44693, 11, 26512, 11, 12846, 45012, 38410, 9652, 329, 17110, 13, 628, 220, 220, 220, 770, 8265, 4909, 262, 30751, 284, 21136, 262, 4600, 1084, 295, 13, 88, 4029, 63,...
2.845
200
# -*- coding: utf-8 -*- from pymongo import MongoClient from finace import settings if __name__ == '__main__': spider = SpiderCity() url_list = spider.get() print(url_list)
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 279, 4948, 25162, 1330, 42591, 11792, 198, 198, 6738, 957, 558, 1330, 6460, 628, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220,...
2.611111
72
import structlog import logging import sys import os from structlog.processors import JSONRenderer from structlog.stdlib import filter_by_level from structlog.stdlib import add_log_level_number from .datadog import tracer_injection LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
[ 11748, 2878, 6404, 198, 11748, 18931, 198, 11748, 25064, 198, 11748, 28686, 198, 198, 6738, 2878, 6404, 13, 14681, 669, 1330, 19449, 49, 437, 11882, 198, 6738, 2878, 6404, 13, 19282, 8019, 1330, 8106, 62, 1525, 62, 5715, 198, 6738, 2878...
3.204545
88
""" templator.py reads in an excel file and a template and outputs a file for each row in the excel file, by substituting the template variables with the values in the columns. This technique uses pandas to read the excel file into a DataFrame and the python format operator ``%``` to apply the values. """ import sys ...
[ 37811, 198, 11498, 489, 1352, 13, 9078, 9743, 287, 281, 27336, 2393, 290, 257, 11055, 220, 290, 23862, 257, 2393, 329, 1123, 5752, 198, 259, 262, 27336, 2393, 11, 416, 21436, 15129, 262, 11055, 9633, 351, 262, 3815, 287, 262, 15180, 1...
3.149171
181
import unittest from test_base import TestBaseImporter from test_child import TestChildImporter if __name__ == '__main__': test_loader = unittest.TestLoader() test_classes_to_run = [TestBaseImporter, TestChildImporter] suites_list = [] for test_class in test_classes_to_run: suite = test_loader...
[ 11748, 555, 715, 395, 198, 6738, 1332, 62, 8692, 1330, 6208, 14881, 3546, 26634, 198, 6738, 1332, 62, 9410, 1330, 6208, 16424, 3546, 26634, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1332, ...
2.625
184
# import tensorflow as tf # print(tf.__version__) # # # with tf.name_scope('scalar_set_one') as scope: # tf_constant_one = tf.constant(10, name="ten") # tf_constant_two = tf.constant(20, name="twenty") # scalar_sum_one = tf.add(tf_constant_one, tf_constant_two, name="scalar_ten_plus_twenty") # # # # with tf...
[ 2, 1330, 11192, 273, 11125, 355, 48700, 198, 2, 3601, 7, 27110, 13, 834, 9641, 834, 8, 198, 2, 198, 2, 198, 2, 351, 48700, 13, 3672, 62, 29982, 10786, 1416, 282, 283, 62, 2617, 62, 505, 11537, 355, 8354, 25, 198, 2, 220, 220, ...
2.296482
398
from objects.user.User import User from objects.interface.dbconn import DB from objects.user.Currency import get_currency_symbol from objects.threads.UploadThread import UploadThread import utils.globals as _globals from utils.print import print_message, print_error from utils.enums import Months, SettingsSelection, is...
[ 6738, 5563, 13, 7220, 13, 12982, 1330, 11787, 198, 6738, 5563, 13, 39994, 13, 9945, 37043, 1330, 20137, 198, 6738, 5563, 13, 7220, 13, 34, 13382, 1330, 651, 62, 34415, 62, 1837, 23650, 198, 6738, 5563, 13, 16663, 82, 13, 41592, 16818,...
2.73018
3,721
# -*- coding: UTF-8 -*- import base64 from functools import wraps import pyaes from flask import request from werkzeug.utils import redirect from website.domain.UserVO import UserVO
[ 2, 532, 9, 12, 19617, 25, 41002, 12, 23, 532, 9, 12, 198, 11748, 2779, 2414, 198, 6738, 1257, 310, 10141, 1330, 27521, 198, 198, 11748, 279, 3972, 274, 198, 6738, 42903, 1330, 2581, 198, 6738, 266, 9587, 2736, 1018, 13, 26791, 1330,...
3.22807
57
#!/usr/bin/env python """ export_resized_ios_images Gimp plugin to export image to icon files usable on iOS. Author: ------- Tobias Blom, Techne Development AB <tobias.blom@techne-dev.se> Installation: ------------- Under Mac OS X, copy this file to ~/Library/Application Support/GIMP/x.x/plug-ins and make it exec...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37811, 198, 198, 39344, 62, 411, 1143, 62, 4267, 62, 17566, 198, 198, 38, 11011, 13877, 284, 10784, 2939, 284, 7196, 3696, 24284, 319, 8969, 13, 628, 198, 13838, 25, 198, 26866, 198, ...
3.0033
909
from timeit import default_timer as timer import random # shell sort using Knuth's sequence if __name__ == "__main__": main()
[ 6738, 640, 270, 1330, 4277, 62, 45016, 355, 19781, 198, 11748, 4738, 628, 628, 198, 2, 7582, 3297, 1262, 6102, 1071, 338, 8379, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 1388, 3...
3.159091
44
import datetime from django.utils.functional import cached_property from django.utils.safestring import mark_safe from office.offices import Office, OfficeSection from psalter.utils import get_psalms
[ 11748, 4818, 8079, 198, 198, 6738, 42625, 14208, 13, 26791, 13, 45124, 1330, 39986, 62, 26745, 198, 6738, 42625, 14208, 13, 26791, 13, 49585, 395, 1806, 1330, 1317, 62, 21230, 198, 198, 6738, 2607, 13, 2364, 1063, 1330, 4452, 11, 4452, ...
3.491803
61
import tide_constituents as tc from py_noaa import coops import pandas as pd import numpy as np import tappy start = '20180201' end = '20180228' interval = 1 start = pd.to_datetime(start) end = pd.to_datetime(end) d = start w, t, p, r = [], [], [], [] while d < end: start_ = d end_ = start_ + pd.DateOffs...
[ 11748, 20013, 62, 9979, 34272, 658, 355, 37096, 198, 6738, 12972, 62, 3919, 7252, 1330, 763, 2840, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 256, 7774, 628, 628, 198, 198, 9688, 796, 705, 12...
2.242466
730
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import...
[ 2, 19617, 28, 40477, 12, 23, 198, 2, 17202, 39410, 25, 428, 2393, 373, 7560, 416, 262, 21624, 12994, 24118, 687, 10290, 357, 27110, 5235, 8, 16984, 13, 17202, 198, 2, 17202, 2141, 407, 4370, 416, 1021, 4556, 345, 821, 1728, 345, 760...
2.324773
1,324
# -*- coding: utf-8 -*- """hw10_adversarial_attack.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1yPa2ushzqw8FNobfonL79PHzudn0vjrN # **Homework 10 - Adversarial Attack** Slides: https://reurl.cc/v5kXkk Videos: TA: ntu-ml-2021spring-ta@google...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 36599, 940, 62, 324, 690, 36098, 62, 20358, 13, 541, 2047, 65, 198, 198, 38062, 4142, 7560, 416, 1623, 4820, 2870, 13, 198, 198, 20556, 2393, 318, 5140, 379, 19...
2.68286
2,573
#!/usr/bin/env python3 import argparse, os, sys, pickle import numpy as np, pathos.multiprocessing as mp, torch import gym_util.common_util as cou, polnet as pn, util_bwopt as u from collections import defaultdict from poleval_pytorch import get_rpi_s, get_Ppi_ss, get_ppisteady_s, get_Qsa if __name__ == '__main__': ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 1822, 29572, 11, 28686, 11, 25064, 11, 2298, 293, 198, 11748, 299, 32152, 355, 45941, 11, 3108, 418, 13, 16680, 541, 305, 919, 278, 355, 29034, 11, 28034, 198, 11748, 11550,...
2.632
125
# automatically generated by the FlatBuffers compiler, do not modify # namespace: FBOutput import tdw.flatbuffers # StaticSpring def Id(self): o = tdw.flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: return self._tab.Get(tdw.flatbuffers.number_types.I...
[ 2, 6338, 7560, 416, 262, 21939, 36474, 364, 17050, 11, 466, 407, 13096, 198, 198, 2, 25745, 25, 13186, 26410, 198, 198, 11748, 41560, 86, 13, 38568, 36873, 364, 628, 220, 220, 220, 1303, 36125, 30387, 198, 220, 220, 220, 825, 5121, ...
2.623188
207
# -*- coding: utf-8 -*- from locoresponse import LocoResponse
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 1179, 382, 2777, 2591, 1330, 15181, 78, 31077, 628 ]
2.56
25
RESOURCE_TYPES = ['lumber', 'clay', 'iron', 'crop'] LUMBER = 0 CLAY = 1 IRON = 2 CROP = 3
[ 198, 19535, 31033, 62, 9936, 47, 1546, 796, 37250, 75, 4494, 3256, 705, 565, 323, 3256, 705, 1934, 3256, 705, 31476, 20520, 198, 43, 5883, 13246, 796, 657, 198, 5097, 4792, 796, 352, 198, 4663, 1340, 796, 362, 198, 9419, 3185, 796, ...
2.068182
44
"""Check the syntax and execute Pikachu commands. Methods: run -- The main context for the pikachu vm. """ from pikapy.utils import pika_error, pika_print from pikapy.reader import PikaReader from pikapy.stack import PikaStack def run(file_name, args, debug): """ Run a specified Pikachu file in a virtual en...
[ 37811, 9787, 262, 15582, 290, 12260, 38755, 9729, 13, 198, 198, 46202, 25, 198, 5143, 1377, 383, 1388, 4732, 329, 262, 279, 1134, 32323, 45887, 13, 198, 37811, 198, 198, 6738, 279, 1134, 12826, 13, 26791, 1330, 279, 9232, 62, 18224, 1...
1.829325
2,578
from rest_framework import status from rest_framework.generics import ListAPIView, RetrieveAPIView, CreateAPIView, UpdateAPIView from rest_framework.permissions import AllowAny, IsAuthenticated from rest_framework.response import Response from rest_framework.viewsets import GenericViewSet from _helpers.permissions imp...
[ 6738, 1334, 62, 30604, 1330, 3722, 198, 6738, 1334, 62, 30604, 13, 8612, 873, 1330, 7343, 2969, 3824, 769, 11, 4990, 30227, 2969, 3824, 769, 11, 13610, 2969, 3824, 769, 11, 10133, 2969, 3824, 769, 198, 6738, 1334, 62, 30604, 13, 525, ...
3.938356
146
""" Tkinter UI for PlotOptiX raytracer. https://github.com/rnd-team-dev/plotoptix/blob/master/LICENSE.txt Have a look at examples on GitHub: https://github.com/rnd-team-dev/plotoptix. """ import logging import numpy as np import tkinter as tk from PIL import Image, ImageTk from ctypes import byref, c_float, c_uint ...
[ 37811, 198, 51, 74, 3849, 12454, 329, 28114, 27871, 72, 55, 26842, 2213, 11736, 13, 198, 198, 5450, 1378, 12567, 13, 785, 14, 81, 358, 12, 15097, 12, 7959, 14, 29487, 8738, 844, 14, 2436, 672, 14, 9866, 14, 43, 2149, 24290, 13, 14...
2.828402
169
#!/usr/bin/python # Author: Luisxue <luisxue@gmail.com> # BLOG: https://luisxue.xcodn.com # # Notes: TreesShell for CentOS/RadHat 6+ Debian 7+ and Ubuntu 12+ # # Project home page: # http://trees.org.cn # https://github.com/luisxue/TreesShell import socket,sys sk = socket.socket(socket.AF_INET, socket.SO...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 6434, 25, 220, 20894, 87, 518, 1279, 2290, 271, 87, 518, 31, 14816, 13, 785, 29, 198, 2, 9878, 7730, 25, 220, 3740, 1378, 2290, 271, 87, 518, 13, 87, 19815, 77, 13, 785, 198, 2, 19...
2.323077
195
import sqlalchemy from sqlalchemy.ext.automap import automap_base from sqlalchemy.orm import Session from sqlalchemy import create_engine, func import os import requests import urllib.parse # API key introduction # API_KEY = os.environ.get('API_KEY', '') finnhub_API_Key = os.environ.get('finnhub_API_Key', '') from...
[ 11748, 44161, 282, 26599, 198, 6738, 44161, 282, 26599, 13, 2302, 13, 2306, 296, 499, 1330, 3557, 499, 62, 8692, 198, 6738, 44161, 282, 26599, 13, 579, 1330, 23575, 198, 6738, 44161, 282, 26599, 1330, 2251, 62, 18392, 11, 25439, 220, ...
2.848739
238