content
stringlengths
1
1.04M
input_ids
listlengths
1
774k
ratio_char_token
float64
0.38
22.9
token_count
int64
1
774k
# -*- coding: utf-8 -*- """ For the ICRA video, we made some animations of how the preference model posteriors evolve after each iteration. This script saves the stack of images to make such an animation for the compass-gait biped's model posterior. For every iteration, we save an image of the model posterior from on...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 1890, 262, 12460, 3861, 2008, 11, 356, 925, 617, 22407, 286, 703, 262, 12741, 2746, 220, 198, 79, 6197, 12706, 18101, 706, 1123, 24415, 13, 770, 4226, 16031,...
2.200498
2,813
#!/usr/bin/env python # -*- coding: utf-8 -*- from gym_minigrid.minigrid import * from gym_minigrid.register import register from gym_minigrid.wrappers import RGBImgPartialObsWrapper from gym_minigrid.wrappers import FrameStack from collections import deque from gym.spaces import Box from gym import Wrapper import num...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 6738, 11550, 62, 1084, 3692, 312, 13, 1084, 3692, 312, 1330, 1635, 198, 6738, 11550, 62, 1084, 3692, 312, 13, 30...
2.600791
253
# to run open terminal window in location then type 'python "scriptname.py" "filename.csv" ' - "" indicates that these portions are replaced with actual file names # import necessary libraries import csv import sys import math # read in the file & convert "that memory" into a csv read file f = open(sys.argv[1],'rb')...
[ 2, 284, 1057, 1280, 12094, 4324, 287, 4067, 788, 2099, 705, 29412, 366, 12048, 3672, 13, 9078, 1, 366, 34345, 13, 40664, 1, 705, 532, 13538, 9217, 326, 777, 16690, 389, 6928, 351, 4036, 2393, 3891, 198, 198, 2, 1330, 3306, 12782, 19...
2.115727
1,348
#! /usr/bin/env python from setuptools import find_packages from setuptools import setup with open('README.md') as readme_file: readme = readme_file.read() setup( author='Beau Martinez', classifiers=[ 'Programming Language :: Python :: 2.7', ], description='Delete your tweets and backup...
[ 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 6738, 900, 37623, 10141, 1330, 1064, 62, 43789, 198, 6738, 900, 37623, 10141, 1330, 9058, 628, 198, 4480, 1280, 10786, 15675, 11682, 13, 9132, 11537, 355, 1100, 1326, 62, 7753, ...
2.318841
345
from __future__ import annotations from typing import Any, Dict, List, Literal, Optional, Union from .event import Event from .database import query, queryWithResult, queryWithResults properties = [ "time", "position", "points", "incomplete", "event", "competitor", "type", "course", ...
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 6738, 19720, 1330, 4377, 11, 360, 713, 11, 7343, 11, 25659, 1691, 11, 32233, 11, 4479, 198, 198, 6738, 764, 15596, 1330, 8558, 198, 6738, 764, 48806, 1330, 12405, 11, 12405, 3152, 23004, 11, ...
2.593548
155
import matplotlib.pyplot as plt import numpy as np import pandas as pd # solveData = pd.DataFrame(data = [[1,2,4,8,16,32,64,128],[1,1,2,3,4,3,2,1]], columns=[0,1,2,3,4,5,6,7]) # solveData = solveData.transpose() # a = [[1,2,3,4],[4,3,2,1,2,3,4,3,2,1]] # #b= np.array(a) # c = np.array(a).T # newData = pd.DataF...
[ 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 628, 628, 198, 2, 8494, 6601, 796, 279, 67, 13, 6601, 19778, 7, 7890, 796, 16410, 16, 11, 17, 11, 1...
1.9375
480
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F # def zigzag_indices(shape: (int, int), count): # x_range, y_range = shape # index_order = sorted(((x, y) for x in range(x_range) for y in range(y_range)), # key=lambda p: (p[0] + p[1], -p[1] if (p[0]...
[ 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, 198, 2, 825, 1976, 328, 50183, 62, 521, 1063, 7, 43358, 25, 357, 600, 11, 493, 828...
2.053446
711
# Generated by Django 2.2 on 2019-04-15 12:47 from django.db import migrations, models
[ 2, 2980, 515, 416, 37770, 362, 13, 17, 319, 13130, 12, 3023, 12, 1314, 1105, 25, 2857, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.966667
30
# @Time : 2018-9-10 # @Author : zxh import os import tensorflow as tf import sys from zutils.utils import relative_project_path
[ 2, 2488, 7575, 220, 220, 1058, 2864, 12, 24, 12, 940, 198, 2, 2488, 13838, 1058, 1976, 87, 71, 198, 11748, 28686, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 25064, 198, 6738, 1976, 26791, 13, 26791, 1330, 3585, 62, 16302, ...
2.87234
47
# based on https://realpython.com/python-sqlite-sqlalchemy/#using-flat-files-for-data-storage from datetime import datetime import sqlalchemy from sqlalchemy import Column, String, Boolean, Integer, Float, Date, DateTime, ForeignKey, select, func, cast from sqlalchemy.exc import NoResultFound from sqlalchemy.ext.decla...
[ 2, 1912, 319, 3740, 1378, 5305, 29412, 13, 785, 14, 29412, 12, 25410, 578, 12, 25410, 282, 26599, 31113, 3500, 12, 38568, 12, 16624, 12, 1640, 12, 7890, 12, 35350, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 11748, 44161, 282, ...
2.837349
332
#!/usr/bin/python import argparse from bs4 import BeautifulSoup from html.parser import HTMLParser from lxml import etree import json import re import requests GOLFSHOT_URL = 'https://play.golfshot.com' parser = argparse.ArgumentParser(description='Download GolfShot data') parser.add_argument('username', he...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 11748, 1822, 29572, 198, 6738, 275, 82, 19, 1330, 23762, 50, 10486, 198, 6738, 27711, 13, 48610, 1330, 11532, 46677, 198, 6738, 300, 19875, 1330, 2123, 631, 198, 11748, 33918, 198, 11748, ...
2.735426
446
from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s
[ 6738, 9485, 48, 83, 19, 1330, 33734, 14055, 11, 33734, 8205, 72, 201, 198, 201, 198, 28311, 25, 201, 198, 220, 220, 220, 4808, 6738, 18274, 69, 23, 796, 33734, 14055, 13, 48, 10100, 13, 6738, 18274, 69, 23, 201, 198, 16341, 3460, ...
2.142857
63
## Modify Process Token # Global Imports import ctypes from ctypes.wintypes import DWORD # Grab a handle on Advapi.dll, User32.dll and Kernel32.dll a_handle = ctypes.WinDLL("Advapi32.dll") u_handle = ctypes.WinDLL("User32.dll") k_handle = ctypes.WinDLL("Kernel32.dll") # Shortcut to give "All Access" right...
[ 2235, 3401, 1958, 10854, 29130, 201, 198, 201, 198, 2, 8060, 1846, 3742, 201, 198, 11748, 269, 19199, 201, 198, 6738, 269, 19199, 13, 86, 600, 9497, 1330, 29652, 12532, 201, 198, 201, 198, 2, 25339, 257, 5412, 319, 8007, 15042, 13, ...
2.310867
2,181
from abc import ABC, abstractmethod
[ 6738, 450, 66, 1330, 9738, 11, 12531, 24396, 628 ]
4.111111
9
""" Ejercicio 15 Dados como datos el precio final pagado por un producto y su precio de venta al público (PVP), se requiere que calcule y muestre el porcentaje de descuento que le ha sido aplicado. Entradas Precio_Final_Pagado --> Float --> P_F Precio_Venta_Publico --> Float --> P_V_P Salidas Porcentaje_Descuento -->...
[ 37811, 198, 36, 73, 2798, 46441, 1315, 198, 35, 22484, 401, 78, 4818, 418, 1288, 3718, 952, 2457, 42208, 4533, 16964, 555, 1720, 78, 331, 424, 3718, 952, 390, 7435, 64, 435, 279, 21356, 65, 677, 78, 357, 47, 8859, 828, 384, 1038, ...
2.40339
295
#brailleInput.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2012-2013 NV Access Limited, Rui Batista import os.path import louis import braille import config from logHandler import log import winUser import ...
[ 2, 16057, 8270, 20560, 13, 9078, 198, 2, 32, 636, 286, 8504, 36259, 27850, 8798, 357, 27159, 5631, 8, 198, 2, 1212, 2393, 318, 5017, 416, 262, 22961, 3611, 5094, 13789, 13, 198, 2, 6214, 262, 2393, 27975, 45761, 329, 517, 3307, 13, ...
2.978474
511
from typing import List, Optional, Tuple import numpy as np from gutenTAG.anomalies import AnomalyProtocol, LabelRange, Anomaly from gutenTAG.base_oscillations.interface import BaseOscillationInterface
[ 6738, 19720, 1330, 7343, 11, 32233, 11, 309, 29291, 198, 198, 11748, 299, 32152, 355, 45941, 198, 198, 6738, 308, 7809, 42197, 13, 272, 18048, 444, 1330, 1052, 24335, 19703, 4668, 11, 36052, 17257, 11, 1052, 24335, 198, 6738, 308, 7809,...
3.551724
58
# -*- coding: utf-8 -*- """ Created on Mon Mar 5 11:06:16 2018 @author: r.dewinter """ import numpy as np #import matplotlib.pyplot as plt #from mpl_toolkits.mplot3d import Axes3D #rngMin = np.zeros(9) #rngMax = np.ones(9) #nVar = 9 #ref = np.array([1,1,1]) #parameters = np.empty((200,9)) #objecti...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 201, 198, 41972, 319, 2892, 1526, 220, 642, 1367, 25, 3312, 25, 1433, 2864, 201, 198, 201, 198, 31, 9800, 25, 374, 13, 67, 413, 3849, 201, 198, 37811, 20...
2.049875
401
""" Helper script used for turning text into tf-idf vector for the knn experiment """ import re import numpy from nltk import pos_tag from nltk.corpus import stopwords from nltk.corpus import wordnet from nltk.stem import SnowballStemmer from nltk.stem import WordNetLemmatizer from nltk.tokenize import wo...
[ 37811, 201, 198, 47429, 4226, 973, 329, 6225, 2420, 656, 48700, 12, 312, 69, 15879, 329, 262, 638, 77, 6306, 201, 198, 37811, 201, 198, 201, 198, 11748, 302, 201, 198, 201, 198, 11748, 299, 32152, 201, 198, 6738, 299, 2528, 74, 1330...
2.187767
703
import os.path DATA_DIRECTORY = os.path.join(os.path.dirname(__file__), 'data')
[ 11748, 28686, 13, 6978, 198, 198, 26947, 62, 17931, 23988, 15513, 796, 28686, 13, 6978, 13, 22179, 7, 418, 13, 6978, 13, 15908, 3672, 7, 834, 7753, 834, 828, 705, 7890, 11537, 198 ]
2.454545
33
# -*- coding: utf-8 -*- # test = Solution() # # print test.lexicographical('apple', 'appld') # print test.trySet() test = Solution3() print test.canFinish([[1, 0], [2, 1], [2, 0]])
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 628, 198, 2, 1332, 796, 28186, 3419, 198, 2, 1303, 3601, 1332, 13, 2588, 291, 17046, 10786, 18040, 3256, 705, 1324, 335, 11537, 198, 2, 3601, 1332, 13, 28311, 7248, 3419, 1...
2.472973
74
# terrascript/resource/phillbaker/elasticsearch.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:15:48 UTC) import terrascript __all__ = [ "elasticsearch_component_template", "elasticsearch_composable_index_template", "elasticsearch_index", "elasticsearch_index_...
[ 2, 8812, 15961, 14, 31092, 14, 746, 359, 65, 3110, 14, 417, 3477, 12947, 13, 9078, 198, 2, 17406, 4142, 7560, 416, 4899, 14, 15883, 8189, 13, 9078, 357, 1731, 12, 19117, 12, 1238, 2481, 1315, 25, 1314, 25, 2780, 18119, 8, 198, 117...
2.492063
441
import pytest from ...utilities import iconfont from ...PyQt import QtGui, QtCore
[ 11748, 12972, 9288, 198, 6738, 2644, 315, 2410, 1330, 7196, 10331, 198, 6738, 2644, 20519, 48, 83, 1330, 33734, 8205, 72, 11, 33734, 14055, 628, 628, 628 ]
3.222222
27
import argparse, os from sklearn.linear_model import LogisticRegression from sklearn.svm import SVR import pandas as pd from scipy.io import arff # to get the summary both logistic-regression and support-vector-machines have to be run once with the output errors option if __name__ == "__main__": parser = ar...
[ 11748, 1822, 29572, 11, 28686, 198, 6738, 1341, 35720, 13, 29127, 62, 19849, 1330, 5972, 2569, 8081, 2234, 198, 6738, 1341, 35720, 13, 82, 14761, 1330, 311, 13024, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 629, 541, 88, 13, 952...
2.807229
498
import numpy as np """ Within this file, the predefined functions appearing in the main menu may be defined. If a new one is added, it must be added to the attributes self.predef_funs_show and self.predef_funs of the PredefinedFunctions class from the MainMenu.py file. Moreover, these functions must be added to the se...
[ 11748, 299, 32152, 355, 45941, 198, 198, 37811, 198, 22005, 428, 2393, 11, 262, 2747, 18156, 5499, 12655, 287, 262, 1388, 6859, 743, 307, 5447, 13, 1002, 257, 649, 530, 318, 2087, 11, 340, 1276, 307, 198, 29373, 284, 262, 12608, 2116,...
3.793814
97
#!/usr/bin/env python3 """ :problem: https://www.hackerrank.com/challenges/ctci-connected-cell-in-a-grid/problem """ from typing import List, Set, Tuple Cell = Tuple[int, int] if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 198, 25, 45573, 25, 3740, 1378, 2503, 13, 31153, 8056, 962, 13, 785, 14, 36747, 34120, 14, 310, 979, 12, 15236, 12, 3846, 12, 259, 12, 64, 12, 25928, 14, 45573, 198, 378...
2.55814
86
# -*- coding: utf-8 -*- ''' This is a fully connected neural network. It contains data batching , using Relu activation function, using adam optimizer and dropout for overfitting. ''' import torch import pandas as pd import numpy as np import matplotlib.pyplot as plt import sklearn data = pd.read_csv('bike_sharing.c...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 7061, 6, 198, 1212, 318, 257, 3938, 5884, 17019, 3127, 13, 220, 198, 1026, 4909, 1366, 15458, 278, 837, 1262, 4718, 84, 14916, 2163, 11, 198, 3500, 23197, 6436, 7509, ...
2.459812
1,916
import FWCore.ParameterSet.Config as cms hltPhase2L3MuonsNoID = cms.EDProducer("MuonIdProducer", CaloExtractorPSet = cms.PSet( CenterConeOnCalIntersection = cms.bool(False), ComponentName = cms.string('CaloExtractorByAssociator'), DR_Max = cms.double(1.0), DR_Veto_E = cms.double(0.0...
[ 11748, 48849, 14055, 13, 36301, 7248, 13, 16934, 355, 269, 907, 198, 198, 71, 2528, 35645, 17, 43, 18, 33239, 684, 2949, 2389, 796, 269, 907, 13, 1961, 11547, 2189, 7203, 33239, 261, 7390, 11547, 2189, 1600, 198, 220, 220, 220, 2199, ...
1.977833
6,045
arr = [2, 4, 1, 2, 8, 3] insertionSort(arr) print(arr)
[ 198, 198, 3258, 796, 685, 17, 11, 604, 11, 352, 11, 362, 11, 807, 11, 513, 60, 198, 28463, 295, 42758, 7, 3258, 8, 198, 4798, 7, 3258, 8 ]
1.931034
29
from unittest.mock import patch from django.conf import settings from django.db import IntegrityError from django.test import TestCase from feeds.tests.helpers import ( make_fake_feedparser_dict, make_feed_entries_list, make_preprocessed_entries_list ) from feeds.models import Entry, Feed @...
[ 6738, 555, 715, 395, 13, 76, 735, 1330, 8529, 201, 198, 201, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 201, 198, 6738, 42625, 14208, 13, 9945, 1330, 39348, 12331, 201, 198, 6738, 42625, 14208, 13, 9288, 1330, 6208, 20448, 201, 1...
2.754967
151
#!/usr/bin/env python FjRNtSCJtxQIHzHCBANyvSDFfkHSAoEHzzByCQCtzEQRIPEGztHSpPBmIAjBJFF = 'RXLQksAGmIIuwhBJUptxVuytBrDBAdGQAQvkSrGtgiSFnGSZospnORAnCEZHCBz' zmNDzvGHuIEXFHBBtGtCEpxpAQSFvzsESQMwGFYFyGQyEUBBoMCOCFPCRARREmS = 'RICsbwNkCOqPrHxHGDwjHTJCAhHPGiRZSFzrFITzFLmZFDDAuBRtAxtkQzDUuGg' xJOxLDDlmqmAmyPHrDJSJSCFCitymFVQqv...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 37, 73, 42336, 83, 6173, 41, 17602, 48, 40, 7399, 16045, 33, 1565, 88, 85, 50, 8068, 69, 74, 39, 4090, 78, 42413, 3019, 3886, 34, 48, 34, 22877, 36, 48, 32618, 7156, 89, 83, 39, ...
1.419342
25,230
# -*- coding: utf-8 -*- """ Created on Mon Jun 28 10:55:12 2021 @author: mikf """ import numpy as np from py_wake.examples.data.ParqueFicticio import ParqueFicticio_path from py_wake.site import WaspGridSite from py_wake.site.xrsite import XRSite x = np.asarray([262403., 262553., 262703., 262853., 263003., 263153., ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 2892, 7653, 2579, 838, 25, 2816, 25, 1065, 33448, 198, 198, 31, 9800, 25, 285, 1134, 69, 198, 37811, 198, 11748, 299, 32152, 355, 45941, 198, 6...
1.938209
793
# -*- coding: utf-8 -*- """Neural Style Pattern Transfer.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1ijYjSvGfWm1aUkw0stn6P7U8pYwhsbU0 """ #!nvcc --version print("Your GPU is a ") !nvidia-smi -L print("GPU Logs") print("Nvidia K80 is not enou...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 8199, 1523, 17738, 23939, 20558, 13, 541, 2047, 65, 198, 198, 38062, 4142, 7560, 416, 1623, 4820, 2870, 13, 198, 198, 20556, 2393, 318, 5140, 379, 198, 220, 220, ...
2.434266
18,438
import logging from os import path from os.path import dirname, join from arekit.common.utils import create_dir_if_not_exists from arekit.contrib.experiments.cv.default import SimpleCVFolding from arekit.contrib.experiments.cv.doc_stat.rusentrel import RuSentRelDocStatGenerator from arekit.contrib.experiments.cv.senten...
[ 11748, 18931, 198, 6738, 28686, 1330, 3108, 198, 6738, 28686, 13, 6978, 1330, 26672, 3672, 11, 4654, 198, 6738, 389, 15813, 13, 11321, 13, 26791, 1330, 2251, 62, 15908, 62, 361, 62, 1662, 62, 1069, 1023, 198, 6738, 389, 15813, 13, 364...
3.284746
295
import numpy as np from scipy.misc import imread, imresize FACENET_MEAN = np.array([ 0.52591038, 0.40204082, 0.34178183], dtype=np.float32) FACENET_STD = np.sqrt(np.array([3941.30175781, 2856.94287109, 2519.35791016], dtype=np.float32) / 255.**2) def preprocess_image(img): """Preprocess an image for squeezenet....
[ 11748, 299, 32152, 355, 45941, 198, 6738, 629, 541, 88, 13, 44374, 1330, 545, 961, 11, 545, 411, 1096, 198, 198, 37, 2246, 1677, 2767, 62, 11682, 1565, 796, 45941, 13, 18747, 26933, 657, 13, 20, 25191, 940, 2548, 11, 220, 657, 13, ...
2.353234
201
# -*- coding: utf-8 -*- """PizzaCell class.""" from enum import Enum, unique from cell import Cell from slice import Slice @unique class Ingredient(Enum): """Ingredient enum.""" MUSHROOM = 'M' TOMATO = 'T' class PizzaCell(object): """Cell of Pizza. :type ingredient: Ingredient or None ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 47, 9990, 28780, 1398, 526, 15931, 198, 198, 6738, 33829, 1330, 2039, 388, 11, 3748, 198, 198, 6738, 2685, 1330, 12440, 198, 6738, 16416, 1330, 3454, 501, 628, 19...
2.14746
1,614
import torch.optim as optim import tqdm from moses.utils import Logger import torch
[ 11748, 28034, 13, 40085, 355, 6436, 198, 11748, 256, 80, 36020, 198, 6738, 285, 4629, 13, 26791, 1330, 5972, 1362, 198, 11748, 28034, 628 ]
3.541667
24
import requests from django.core.files import File from tempfile import mkdtemp from shutil import copy, rmtree import os import yaml import zipfile from django.conf import settings from docker.client import DockerClient from docker.models.images import ImageCollection from docker_registry_client import DockerRegistry...
[ 11748, 7007, 198, 6738, 42625, 14208, 13, 7295, 13, 16624, 1330, 9220, 198, 6738, 20218, 7753, 1330, 33480, 67, 29510, 198, 6738, 4423, 346, 1330, 4866, 11, 374, 16762, 631, 198, 11748, 28686, 198, 11748, 331, 43695, 198, 11748, 19974, ...
3.179167
240
# Import libraries import os import sys import pypsa import numpy as np import pandas as pd #from sympy import latex import time import math # Timer t0 = time.time() # Start a timer # Import functions file sys.path.append(os.path.split(os.getcwd())[0]) from functions_file import * # Directory of file #dir...
[ 2, 17267, 12782, 198, 11748, 28686, 198, 11748, 25064, 198, 11748, 12972, 862, 64, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 2, 6738, 10558, 88, 1330, 47038, 198, 198, 11748, 640, 198, 11748, 10688, ...
2.855261
15,870
# Similar to scratch3, but with the BAN channel from sys_simulator.channels import BANChannel from sys_simulator import general as gen from sys_simulator.pathloss import pathloss_bs_users from sys_simulator.plots import plot_positions_actions_pie from sys_simulator.q_learning.environments.completeEnvironment5 \ imp...
[ 2, 11014, 284, 12692, 18, 11, 475, 351, 262, 347, 1565, 6518, 198, 6738, 25064, 62, 14323, 8927, 13, 354, 8961, 1330, 347, 1565, 29239, 198, 6738, 25064, 62, 14323, 8927, 1330, 2276, 355, 2429, 198, 6738, 25064, 62, 14323, 8927, 13, ...
2.580524
1,068
import autograd.numpy as np import scipy as sc from scipy import optimize from scipy import special from sklearn.preprocessing import PolynomialFeatures from sklearn.linear_model import Ridge import copy
[ 11748, 1960, 519, 6335, 13, 77, 32152, 355, 45941, 198, 198, 11748, 629, 541, 88, 355, 629, 198, 6738, 629, 541, 88, 1330, 27183, 198, 6738, 629, 541, 88, 1330, 2041, 198, 198, 6738, 1341, 35720, 13, 3866, 36948, 1330, 12280, 26601, ...
3.5
60
import torch import sys import os sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from utilities.losses import kld_loss test_kld_loss()
[ 11748, 28034, 198, 11748, 25064, 198, 11748, 28686, 198, 17597, 13, 6978, 13, 33295, 7, 418, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 397, 2777, 776, 7, 834, 7753, 834, 35514, 198, 6738, ...
2.704918
61
number = int(input('Digite um número de até 4 algarismos: ')) print(f'Analisando o número {number} ...') u = number // 1 % 10 d = number // 10 % 10 c = number // 100 % 10 m = number // 1000 % 10 print(f'Unidade: {u}\nDezena: {d}\nCentena: {c}\nMilhar: {m}')
[ 17618, 796, 493, 7, 15414, 10786, 19511, 578, 23781, 299, 21356, 647, 78, 390, 379, 2634, 604, 435, 4563, 1042, 418, 25, 705, 4008, 198, 4798, 7, 69, 6, 2025, 27315, 25440, 267, 299, 21356, 647, 78, 1391, 17618, 92, 2644, 11537, 198...
2.357798
109
#!/usr/bin/python ''' Simple implementation for Linux lockfile ''' import os import time def LockFile(target, retry=30, timeout=1): ''' Use this method if you want to make sure only one process opens the "target" file. The "target" path should be a path to a file in an existing folder. Create a ...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 7061, 6, 198, 26437, 7822, 329, 7020, 5793, 7753, 198, 7061, 6, 198, 198, 11748, 28686, 198, 11748, 640, 628, 198, 4299, 13656, 8979, 7, 16793, 11, 1005, 563, 28, 1270, 11, 26827, 28, 16, ...
2.525234
535
#!/usr/bin/env python __author__ = 'Vahid Jalili' from urllib.parse import parse_qs import json import os import re import sys import traceback import argparse import importlib import logging from mako.lookup import TemplateLookup from oic import rndstr from oic.oic.provider import AuthorizationEndpoint from oic.o...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 834, 9800, 834, 796, 705, 53, 993, 312, 28649, 2403, 6, 198, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 21136, 62, 48382, 198, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, 302, ...
2.322803
3,925
#!/usr/bin/env python import argparse import numpy as np import os import data_utils import mle_sphere import gen_sphere import gen_sphere_grid import gen_r_sig_3d import gen_selection_in_g_3d import metrics import param_ss import mle_priors_3d DEFAULT_MLE_SPHERE_PARAM_DICT = dict(xc=0, yc=0, zc=0, r=1, rSig=0.3, xE...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 1822, 29572, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 198, 11748, 1366, 62, 26791, 198, 11748, 285, 293, 62, 2777, 1456, 198, 11748, 2429, 62, 2777, 1456, ...
2.004286
3,733
#!/usr/bin/env python # # Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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 3, or...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 15069, 5472, 11, 12726, 11, 10333, 11, 6999, 11, 6390, 3232, 10442, 5693, 11, 3457, 13, 198, 2, 198, 2, 770, 2393, 318, 636, 286, 22961, 8829, 198, 2, 198, 2, 22961, 8...
3.422535
284
#!/usr/bin/env python3 import abc from typing import List import torch from reagent.core.fb_checker import IS_FB_ENVIRONMENT from reagent.core.registry_meta import RegistryMeta from reagent.models.base import ModelBase from reagent.parameters import NormalizationData from reagent.prediction.predictor_wrapper import A...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 450, 66, 198, 6738, 19720, 1330, 7343, 198, 198, 11748, 28034, 198, 6738, 302, 25781, 13, 7295, 13, 21855, 62, 9122, 263, 1330, 3180, 62, 26001, 62, 1677, 53, 4663, 1...
2.682081
519
show_process = False iterations = 50 import turtle if not show_process: turtle.tracer(0) turtle.colormode(255) turtle.color((0, 150, 0)) turtle.penup() turtle.goto(-330, 0) turtle.pendown() fern(iterations) turtle.update() turtle.exitonclick()
[ 12860, 62, 14681, 796, 10352, 201, 198, 2676, 602, 796, 2026, 201, 198, 201, 198, 201, 198, 11748, 28699, 201, 198, 361, 407, 905, 62, 14681, 25, 201, 198, 220, 220, 220, 28699, 13, 2213, 11736, 7, 15, 8, 201, 198, 201, 198, 201, ...
2.184
125
# source: https://stackoverflow.com/a/30875830 from rest_framework.authentication import SessionAuthentication
[ 2, 2723, 25, 3740, 1378, 25558, 2502, 11125, 13, 785, 14, 64, 14, 21495, 38569, 1270, 198, 6738, 1334, 62, 30604, 13, 41299, 3299, 1330, 23575, 47649, 3299, 628 ]
3.862069
29
from .base_widget import * from .mdt2json import *
[ 6738, 764, 8692, 62, 42655, 1330, 1635, 198, 6738, 764, 9132, 83, 17, 17752, 1330, 1635, 198 ]
3
17
import time from sys import exit, version_info try: from smbus import SMBus except ImportError: if version_info[0] < 3: exit("This library requires python-smbus\nInstall with: sudo apt-get install python-smbus") elif version_info[0] == 3: exit("This library requires python3-smbus\nInstall w...
[ 11748, 640, 198, 6738, 25064, 1330, 8420, 11, 2196, 62, 10951, 198, 198, 28311, 25, 198, 220, 220, 220, 422, 895, 10885, 1330, 9447, 16286, 198, 16341, 17267, 12331, 25, 198, 220, 220, 220, 611, 2196, 62, 10951, 58, 15, 60, 1279, 51...
2.197619
420
from typing import TYPE_CHECKING, TypedDict if TYPE_CHECKING: from .snowflake import Snowflake, SnowflakeList __all__ = ("Category",)
[ 6738, 19720, 1330, 41876, 62, 50084, 2751, 11, 17134, 276, 35, 713, 198, 198, 361, 41876, 62, 50084, 2751, 25, 198, 220, 220, 220, 422, 764, 82, 2197, 47597, 1330, 7967, 47597, 11, 7967, 47597, 8053, 198, 198, 834, 439, 834, 796, 58...
3
47
import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import datasets from myConvexHull import convex_hull, random_color from myConvexHull.point_utils import X, Y data = datasets.load_digits() df = pd.DataFrame(data.data, columns=data.feature_names) df['Target'] = pd.DataFrame(data.target...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 1341, 35720, 1330, 40522, 198, 6738, 616, 3103, 303, 87, 39, 724, 1330, 24748, 87, 62, 71, ...
2.396011
351
from random import sample from time import sleep colors = {"clean": "\033[m", "red": "\033[31m", "green": "\033[32m", "yellow": "\033[33m", "blue": "\033[34m", "purple": "\033[35m", "cian": "\033[36m"} order = ["Breno", "Edu", "Miguel", "Lucas"] print("{}Hmm.....
[ 6738, 4738, 1330, 6291, 198, 6738, 640, 1330, 3993, 198, 4033, 669, 796, 19779, 27773, 1298, 37082, 44427, 58, 76, 1600, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 366, 445, 1298, 37082, 44427, 58, 3132, 76, 1600, 198, 220, 2...
2.170306
229
# AP Ruymgaart DMD, main script import numpy as np, time, sys, copy, matplotlib.pyplot as plt from videoFunctions import * from tensorFiles import * from plottingFunctions import * from dmd import * #==== input (command line, from run.sh) ==== print('===================================== start DMD ====================...
[ 2, 3486, 371, 4669, 76, 4908, 433, 360, 12740, 11, 1388, 4226, 198, 11748, 299, 32152, 355, 45941, 11, 640, 11, 25064, 11, 4866, 11, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 2008, 24629, 2733, 1330, 1635, 198, 67...
2.146049
1,253
from pathlib import Path import environ env = environ.Env() READ_DOT_ENV_FILE = env.bool('READ_DOT_ENV_FILE', default=True) if READ_DOT_ENV_FILE: env.read_env() BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = env('SECRET_KEY') DEBUG = env.bool('DEBUG') ALLOWED_HOSTS = ['127.0.0.1', 'payment-...
[ 6738, 3108, 8019, 1330, 10644, 198, 11748, 551, 2268, 628, 198, 24330, 796, 551, 2268, 13, 4834, 85, 3419, 198, 198, 15675, 62, 35, 2394, 62, 1677, 53, 62, 25664, 796, 17365, 13, 30388, 10786, 15675, 62, 35, 2394, 62, 1677, 53, 62, ...
2.213393
1,120
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # Python camera library for the Rasperry-Pi camera module # Copyright (c) 2013-2015 Dave Jones <dave@waveform.org.uk> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # ...
[ 2, 43907, 25, 900, 2123, 1509, 28, 19, 39747, 28, 19, 2393, 12685, 7656, 28, 40477, 12, 23, 25, 198, 2, 198, 2, 11361, 4676, 5888, 329, 262, 28513, 525, 563, 12, 38729, 4676, 8265, 198, 2, 15069, 357, 66, 8, 2211, 12, 4626, 9935...
3.285938
640
import os from typing import Any, Dict import pytest from src.stairlight.config import Configurator from src.stairlight.key import StairlightConfigKey from src.stairlight.source.redash import ( RedashTemplate, RedashTemplateSource, TemplateSourceType, ) @pytest.mark.parametrize( "env_key, path", ...
[ 11748, 28686, 198, 6738, 19720, 1330, 4377, 11, 360, 713, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 12351, 13, 301, 958, 2971, 13, 11250, 1330, 17056, 333, 1352, 198, 6738, 12351, 13, 301, 958, 2971, 13, 2539, 1330, 520, 958, 2971...
2.063457
457
import os import pickle import numpy as np import pandas as pd from torch.utils.data import Dataset DATASET_DIR = "datasets"
[ 11748, 28686, 198, 11748, 2298, 293, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 6738, 28034, 13, 26791, 13, 7890, 1330, 16092, 292, 316, 628, 198, 35, 1404, 1921, 2767, 62, 34720, 796, 366...
2.75
48
# Exercise 013 - That Classic Average """Create a program that reads two grades from a student and calculates their average, showing a message at the end, according to the average achieved: - Average below 5.0: FAIL""" grade_01 = float(input("Enter the first grade: ")) grade_02 = float(input("Enter the second grade: ...
[ 2, 32900, 5534, 18, 532, 1320, 13449, 13475, 198, 198, 37811, 16447, 257, 1430, 326, 9743, 734, 19051, 422, 257, 3710, 290, 43707, 511, 2811, 11, 4478, 257, 3275, 379, 262, 886, 11, 1864, 284, 262, 2811, 8793, 25, 198, 12, 13475, 21...
3.255682
176
import datetime import logging import json import hashlib import hmac import base64 import aiohttp import asyncio from collections import deque
[ 11748, 4818, 8079, 198, 11748, 18931, 198, 11748, 33918, 198, 11748, 12234, 8019, 198, 11748, 289, 20285, 198, 11748, 2779, 2414, 198, 11748, 257, 952, 4023, 198, 11748, 30351, 952, 198, 6738, 17268, 1330, 390, 4188, 628, 198 ]
3.842105
38
import configparser BACKUP_SUFFIX = ".bak" _parser = configparser.ConfigParser() def parse_file(filename): """Return all infomation you needed to patch files""" _parser.read(filename) result = {'files': {}} result['metadata'] = { "name": _parser['metadata']['name'], "description": _p...
[ 11748, 4566, 48610, 198, 198, 31098, 8577, 62, 12564, 5777, 10426, 796, 27071, 65, 461, 1, 198, 198, 62, 48610, 796, 4566, 48610, 13, 16934, 46677, 3419, 628, 198, 4299, 21136, 62, 7753, 7, 34345, 2599, 198, 220, 220, 220, 37227, 1361...
1.905484
857
#!/usr/bin/env python # for i from 2 to 20 # compute prime factorization of i. # use largest multiplicity in any # prime factor seen thus far facs = {} for i in xrange(2,21): f = factorize(i) for j in f: facs[j] = max(facs.get(j,0),f[j]) print reduce(lambda x,y: x*y, (i**facs[i] for i in facs))
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 329, 1312, 422, 362, 284, 1160, 198, 2, 24061, 6994, 5766, 1634, 286, 1312, 13, 198, 2, 779, 4387, 15082, 8467, 287, 597, 198, 2, 6994, 5766, 1775, 4145, 1290, 198, 198, 69...
2.325926
135
# Generated by the protocol buffer compiler. DO NOT EDIT! # sources: onos/config/diags/diags.proto # plugin: python-betterproto from dataclasses import dataclass from typing import AsyncIterator, Dict import betterproto from betterproto.grpc.grpclib_server import ServiceBase import grpclib class Type(betterproto.En...
[ 2, 2980, 515, 416, 262, 8435, 11876, 17050, 13, 220, 8410, 5626, 48483, 0, 198, 2, 4237, 25, 319, 418, 14, 11250, 14, 10989, 3775, 14, 10989, 3775, 13, 1676, 1462, 198, 2, 13877, 25, 21015, 12, 27903, 1676, 1462, 198, 6738, 4818, ...
3.394155
1,403
import sys sys.path.insert(0, 'src/reversion') from distutils.core import setup from version import __version__ # Load in babel support, if available. try: from babel.messages import frontend as babel cmdclass = {"compile_catalog": babel.compile_catalog, "extract_messages": babel.extract_messa...
[ 11748, 25064, 198, 17597, 13, 6978, 13, 28463, 7, 15, 11, 705, 10677, 14, 260, 9641, 11537, 198, 6738, 1233, 26791, 13, 7295, 1330, 9058, 198, 6738, 2196, 1330, 11593, 9641, 834, 628, 198, 2, 8778, 287, 9289, 417, 1104, 11, 611, 169...
2.458003
631
import random class Account_user: """ Class to create new user accounts and save information """ users_list = [] def __init__(self,first_name,password): ''' Method that helps us define properties that each user account will have Args: first_name : main ...
[ 11748, 4738, 198, 4871, 10781, 62, 7220, 25, 198, 220, 220, 220, 37227, 198, 220, 220, 220, 5016, 284, 2251, 649, 2836, 5504, 290, 3613, 1321, 198, 220, 220, 220, 37227, 628, 220, 220, 220, 2985, 62, 4868, 796, 17635, 628, 220, 220,...
2.438462
260
#!/usr/bin/env python import argparse import csv import glob import os import itertools from pylab import * import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages from asyncore import loop # Values we care about keys = [] keys.append('num_read') keys.append('num_writes') keys.append('n...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 628, 198, 11748, 1822, 29572, 198, 11748, 269, 21370, 198, 11748, 15095, 198, 11748, 28686, 198, 11748, 340, 861, 10141, 198, 6738, 279, 2645, 397, 1330, 1635, 198, 11748, 2603, 29487, 8019, ...
2.23501
2,485
#!/usr/bin/env python # This is a script for loading some test data into the video-asset-manager using # REST calls. Each insert is being done as a separate call, which is the only type of # insert that the API supports at this point. # # Note that for production loads, we would not do this in this manner. Instead, we...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 770, 318, 257, 4226, 329, 11046, 617, 1332, 1366, 656, 262, 2008, 12, 562, 316, 12, 37153, 1262, 198, 2, 30617, 3848, 13, 5501, 7550, 318, 852, 1760, 355, 257, 4553, 869, 1...
1.692788
4,007
""" Module for gathering info from Wolf Heating System via ISM8 adapter """ import logging import asyncio class Ism8(asyncio.Protocol): """ This protocol class is invoked to listen to message from ISM8 module and feed data into internal data array """ ISM_HEADER = b'\x06\x20\xf0\x80'...
[ 37811, 201, 198, 26796, 329, 11228, 7508, 422, 8662, 679, 803, 4482, 2884, 3180, 44, 23, 21302, 201, 198, 37811, 201, 198, 201, 198, 11748, 18931, 201, 198, 11748, 30351, 952, 201, 198, 201, 198, 4871, 1148, 76, 23, 7, 292, 13361, 9...
1.921392
14,566
# -*- coding: utf-8 -*- # pylint: disable=missing-docstring # pylint: disable=wildcard-import # pylint: disable=unused-wildcard-import # pylint: disable=invalid-name from datetime import datetime import json from clx.xms import api, exceptions, deserialize from nose.tools import * from iso8601 import UTC @raises(exce...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 279, 2645, 600, 25, 15560, 28, 45688, 12, 15390, 8841, 198, 2, 279, 2645, 600, 25, 15560, 28, 21992, 9517, 12, 11748, 198, 2, 279, 2645, 600, 25, 15560, 28, 403, ...
3.179894
189
# Copyright 2021 The TensorFlow Authors # # 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 required by applicable law or agreed to ...
[ 2, 15069, 33448, 383, 309, 22854, 37535, 46665, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 198, ...
2.514286
1,260
from rdflib.namespace import DefinedNamespace, Namespace from rdflib.term import URIRef class ODRL2(DefinedNamespace): """ ODRL Version 2.2 The ODRL Vocabulary and Expression defines a set of concepts and terms (the vocabulary) and encoding mechanism (the expression) for permissions and obligations s...
[ 6738, 374, 67, 2704, 571, 13, 14933, 10223, 1330, 2896, 1389, 36690, 10223, 11, 28531, 10223, 198, 6738, 374, 67, 2704, 571, 13, 4354, 1330, 37902, 4663, 891, 628, 198, 4871, 440, 7707, 43, 17, 7, 7469, 1389, 36690, 10223, 2599, 198, ...
3.491665
6,299
from flask import Flask from app.apis.v1 import api_v1_bp def register_blueprints(app: "Flask") -> "Flask": """A function to register flask blueprint. To register blueprints add them like the example Example usage: from app.blueprints import blueprint app.register_blueprint(blueprint) ...
[ 6738, 42903, 1330, 46947, 198, 198, 6738, 598, 13, 499, 271, 13, 85, 16, 1330, 40391, 62, 85, 16, 62, 46583, 628, 198, 4299, 7881, 62, 17585, 17190, 7, 1324, 25, 366, 7414, 2093, 4943, 4613, 366, 7414, 2093, 1298, 198, 220, 220, 2...
2.785311
177
import networkx as nx from cStringIO import StringIO from Bio import Phylo import matplotlib.pyplot as plt import random import logging from tqdm import tqdm logger = logging.getLogger() logger.setLevel(logging.INFO) import numpy as np import trees from trees.ddt import DirichletDiffusionTree, Inverse, GaussianLikeliho...
[ 11748, 3127, 87, 355, 299, 87, 198, 6738, 269, 10100, 9399, 1330, 10903, 9399, 198, 6738, 16024, 1330, 1380, 2645, 78, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 4738, 198, 11748, 18931, 198, 6738, 256, ...
2.635417
384
#!/usr/bin/python import getopt, logging, sys, SneeqlLib, UtilLib, AvroraLib, os, checkTupleCount queryMap = {'Q2' : 'input/pipes/Q2.txt', 'Q4' : 'input/pipes/QNest4.txt', 'Q5' : 'input/pipes/QNest5.txt'} networkMap = {'10' : 'input/networks/10-node-topology.xml', '30' : 'scripts/qos-exp/scenarios/30-dense-net.xml...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 201, 198, 11748, 651, 8738, 11, 18931, 11, 25064, 11, 311, 21381, 13976, 25835, 11, 7273, 346, 25835, 11, 5184, 1472, 64, 25835, 11, 28686, 11, 2198, 51, 29291, 12332, 201, 198, 201, 198, 22766, ...
2.251366
549
#!/usr/bin/python import sys from Foundation import * from ScriptingBridge import * ab = SBApplication.applicationWithBundleIdentifier_("com.apple.AddressBook") for person in ab.people(): fname = person.firstName() pfname = person.phoneticFirstName() lname = person.lastName() plname = person.phonetic...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 198, 11748, 25064, 198, 6738, 5693, 1330, 1635, 198, 6738, 12327, 278, 37385, 1330, 1635, 198, 198, 397, 796, 311, 4339, 381, 10142, 13, 31438, 3152, 33, 31249, 33234, 7483, 62, 7203, 785, 13...
2.569343
274
from django.db import models from django.utils.text import ugettext_lazy as _ from model_utils.fields import AutoCreatedField, AutoLastModifiedField class BaseModel(models.Model): """ An abstract base class model that providers self-updating `created` and `modified` fields. """ date_added = AutoC...
[ 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 26791, 13, 5239, 1330, 334, 1136, 5239, 62, 75, 12582, 355, 4808, 198, 198, 6738, 2746, 62, 26791, 13, 25747, 1330, 11160, 41972, 15878, 11, 11160, 5956, 5841, 1431,...
3.220472
127
"""Contains integration measures.""" import abc from typing import Optional, Tuple, Union import numpy as np import scipy.stats from probnum.randvars import Normal from probnum.typing import FloatArgType, IntArgType class IntegrationMeasure(abc.ABC): """An abstract class for a measure against which a target fu...
[ 37811, 4264, 1299, 11812, 5260, 526, 15931, 198, 198, 11748, 450, 66, 198, 6738, 19720, 1330, 32233, 11, 309, 29291, 11, 4479, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 629, 541, 88, 13, 34242, 198, 198, 6738, 1861, 22510, ...
2.346247
2,478
# -*- coding: utf-8 -*- """ Copyright (C) 2021 Stefano Gottardo (script.appcast) Exceptions SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ # Exceptions for DATABASE class DBSQLiteConnectionError(Exception): """An error occurred in the database connection""" class DBS...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 220, 220, 220, 15069, 357, 34, 8, 33448, 22350, 5733, 39451, 13109, 357, 12048, 13, 1324, 2701, 8, 198, 220, 220, 220, 1475, 11755, 628, 220, 220, 220, 306...
3.337719
228
# Copyright 2017 Red Hat, Inc. # 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 required by applicable law ...
[ 2, 15069, 2177, 2297, 10983, 11, 3457, 13, 198, 2, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 407, 779, 428, 2393, 2845, 287, 11846...
3.160543
1,252
#!/bin/python #python import sys import os import time import re import shutil import MySQLdb #appion from appionlib import appionScript from appionlib import apStack from appionlib import apDisplay from appionlib import apEMAN from appionlib import apFile from appionlib.apSpider import operations from appionlib.apTil...
[ 2, 48443, 8800, 14, 29412, 198, 198, 2, 29412, 198, 11748, 25064, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 302, 198, 11748, 4423, 346, 198, 11748, 33476, 9945, 198, 2, 1324, 295, 198, 6738, 598, 295, 8019, 1330, 598, 295, 7391,...
3.147239
163
# bug 3 # http://asu-compmethodsphysics-phy494.github.io/ASU-PHY494/2017/01/24/04_Debugging_1/#activity-fix-as-many-bugs-as-possible # Print "error" for input 0: x = float(input("Enter non-zero number --> ")) if x == 0: print("ERROR: number cannot be 0")
[ 2, 5434, 513, 198, 2, 2638, 1378, 27345, 12, 5589, 24396, 82, 746, 23154, 12, 6883, 39449, 13, 12567, 13, 952, 14, 1921, 52, 12, 11909, 56, 39449, 14, 5539, 14, 486, 14, 1731, 14, 3023, 62, 27509, 2667, 62, 16, 31113, 21797, 12, ...
2.574257
101
import sys from openml.exceptions import OpenMLServerException from requests.exceptions import ChunkedEncodingError if __name__ == "__main__": test_automl(600)
[ 11748, 25064, 198, 6738, 1280, 4029, 13, 1069, 11755, 1330, 4946, 5805, 10697, 16922, 198, 6738, 7007, 13, 1069, 11755, 1330, 609, 2954, 276, 27195, 7656, 12331, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 129...
3.12963
54
from django.contrib import admin from .models import Business, NeighborHood, Post, Profile # Register your models here. admin.site.register(Profile) admin.site.register(Business) admin.site.register(Post) admin.site.register(NeighborHood)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 764, 27530, 1330, 7320, 11, 28708, 39, 702, 11, 2947, 11, 13118, 198, 198, 2, 17296, 534, 4981, 994, 13, 198, 28482, 13, 15654, 13, 30238, 7, 37046, 8, 198, 28482, 13, 15654...
3.442857
70
import json import os T = Translation()
[ 11748, 33918, 198, 11748, 28686, 628, 198, 198, 51, 796, 33322, 3419, 198 ]
3.307692
13
from django.conf.urls import include, url from django.contrib import admin from inventory import views as inventory_index urlpatterns = [ # Examples: # url(r'^$', 'rudra.views.home', name='home'), # url(r'^blog/', include('blog.urls')), url(r'^$', inventory_index.index, name='index'), url(r'^...
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 2291, 11, 19016, 198, 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 198, 6738, 13184, 1330, 5009, 355, 13184, 62, 9630, 198, 198, 6371, 33279, 82, 796, 685, 198, 220, 220, 220,...
2.494318
176
#!/usr/bin/python # -*- coding: utf-8 -*- import time import datetime import string from os import listdir from os.path import join as pathjoin from math import log, ceil import subprocess import pandas as pd import nltk from nltk.corpus import stopwords import matplotlib.pyplot as plt import tailer from ttp import t...
[ 2, 48443, 14629, 14, 8800, 14, 29412, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 640, 198, 11748, 4818, 8079, 198, 11748, 4731, 198, 6738, 28686, 1330, 1351, 15908, 198, 6738, 28686, 13, 6978, 13...
2.352486
21,564
#!/usr/bin/env python # -*- coding:utf-8 -*- """Reexport""" from __future__ import print_function, division, unicode_literals from .model import Model, Argument, BaseAdapter from .exception import ArgumentError, ArgumentMissError, ArgumentInvalidError __version__ = "0.0.2" __all__ = ["ArgumentError", "ArgumentMiss...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 40477, 12, 23, 532, 9, 12, 198, 37811, 3041, 39344, 37811, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 11, 7297, 11, 28000, 1098, 62, 17201, 874, ...
3.069231
130
# Author: btjanaka (Bryon Tjanaka) # Problem: (Kattis) missingnumbers # Title: Missing Numbers # Link: https://open.kattis.com/problems/missingnumbers # Idea: Keep counting. # Difficulty: easy # Tags: implementation n = int(input()) cur = 1 num_printed = 0 for _ in range(n): k = int(input()) while cur < k: ...
[ 2, 6434, 25, 275, 83, 13881, 8130, 357, 33, 563, 261, 309, 13881, 8130, 8, 198, 2, 20647, 25, 357, 42, 1078, 271, 8, 4814, 77, 17024, 198, 2, 11851, 25, 25639, 27797, 198, 2, 7502, 25, 3740, 1378, 9654, 13, 74, 1078, 271, 13, ...
2.488506
174
#! /usr/bin/env python3 """Unga programmerare kodkalender 2020, lucka 3.""" # https://ungaprogrammerare.se/kodkalender/lucka-3/ import functools import math import operator a = math.factorial(100) b = functools.reduce(operator.mul, range(2, 165, 2)) how_many = round(a / b) print(f"Antal delar: {how_many}") # Antal ...
[ 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 37811, 52, 782, 64, 24292, 533, 479, 375, 74, 282, 2194, 12131, 11, 8458, 64, 513, 526, 15931, 198, 2, 3740, 1378, 2150, 499, 39529, 647, 533, 13, 325, 14, 74, 375, 74...
2.421429
140
import datetime import math import os import pickle import random import shutil import time import zipfile import cv2 as cv import numpy as np import torch from PIL import Image from flask import request from scipy.stats import norm from torch import nn from torch.utils.data import Dataset from torchvision import tran...
[ 11748, 4818, 8079, 198, 11748, 10688, 198, 11748, 28686, 198, 11748, 2298, 293, 198, 11748, 4738, 198, 11748, 4423, 346, 198, 11748, 640, 198, 11748, 19974, 7753, 198, 198, 11748, 269, 85, 17, 355, 269, 85, 198, 11748, 299, 32152, 355, ...
2.708148
675
import numpy as np import cv2 import reip class OpticalFlow(reip.Block): ''' https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_video/py_lucas_kanade/py_lucas_kanade.html#dense-optical-flow-in-opencv ''' hsv = None _prev = None # pyr_scale=0.5, levels=3, winsize=15, iter...
[ 11748, 299, 32152, 355, 45941, 198, 11748, 269, 85, 17, 198, 11748, 302, 541, 628, 198, 198, 4871, 49593, 37535, 7, 260, 541, 13, 12235, 2599, 198, 220, 220, 220, 705, 7061, 198, 220, 220, 220, 3740, 1378, 9654, 33967, 12, 29412, 12...
2.12069
174
import re import subprocess import os from tqdm import tqdm
[ 11748, 302, 198, 11748, 850, 14681, 198, 11748, 28686, 198, 6738, 256, 80, 36020, 1330, 256, 80, 36020, 628, 198 ]
3.1
20
# Find the genre in which there has been the greatest number of movie releases import pandas as pd import numpy as np dataset=pd.read_csv('c:\\temp\\HollywoodMovies.csv') selected_data=dataset.loc[:,['WorldGross','Genre']] df=pd.DataFrame(selected_data) df_notnull_genre=df[df.Genre.notnull()] df_notnull_worldgross=df...
[ 2, 9938, 262, 12121, 287, 543, 612, 468, 587, 262, 6000, 1271, 286, 3807, 10050, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 299, 32152, 355, 45941, 198, 198, 19608, 292, 316, 28, 30094, 13, 961, 62, 40664, 10786, 66, 25,...
2.77533
227
import esphome.codegen as cg from esphome.components import binary_sensor from .. import ( HOME_ASSISTANT_IMPORT_SCHEMA, homeassistant_ns, setup_home_assistant_entity, ) DEPENDENCIES = ["api"] HomeassistantBinarySensor = homeassistant_ns.class_( "HomeassistantBinarySensor", binary_sensor.BinarySensor...
[ 11748, 1658, 746, 462, 13, 8189, 5235, 355, 269, 70, 198, 6738, 1658, 746, 462, 13, 5589, 3906, 1330, 13934, 62, 82, 22854, 198, 198, 6738, 11485, 1330, 357, 198, 220, 220, 220, 41779, 62, 10705, 8808, 8643, 62, 3955, 15490, 62, 50,...
2.613636
176
# -*-coding:utf-8-*- """ 진법 변환 recursive 알고리즘 2 <= n <= 16까지 가능 """ """ def test(n,t): answer = '' while t//n >= 1: re = t%n t = t//n answer = str(re) + answer print(answer) if t < n: answer = str(t) + answer return int(answer) """ """ # 진법 변환 함수 재도전 d...
[ 2, 532, 9, 12, 66, 7656, 25, 40477, 12, 23, 12, 9, 12, 198, 198, 37811, 198, 168, 100, 226, 167, 110, 243, 31619, 111, 222, 169, 247, 246, 45115, 23821, 243, 234, 166, 111, 254, 167, 99, 105, 168, 99, 246, 198, 17, 19841, 299,...
1.454286
350
from ..entity import Entity from ..map import Map from ..reference import Reference from ..string import String from ..void import Void
[ 6738, 11485, 26858, 1330, 20885, 198, 6738, 11485, 8899, 1330, 9347, 198, 6738, 11485, 35790, 1330, 20984, 198, 6738, 11485, 8841, 1330, 10903, 198, 6738, 11485, 19382, 1330, 18331, 628 ]
4.566667
30
import sys import pkg_resources from setuptools import setup, find_packages """ setup.py websocket - WebSocket client library for Python Copyright 2022 engn33r 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...
[ 11748, 25064, 198, 11748, 279, 10025, 62, 37540, 198, 6738, 900, 37623, 10141, 1330, 9058, 11, 1064, 62, 43789, 198, 198, 37811, 198, 40406, 13, 9078, 198, 732, 1443, 5459, 532, 5313, 39105, 5456, 5888, 329, 11361, 198, 198, 15269, 3316...
2.733122
948
import numpy as np import argparse, gym, time, os import os.path as osp import torch import torch.nn as nn import torch.optim as optim from on_policy.utils import core from on_policy.utils.model import ActorCritic from on_policy.utils.replay_buffer import ReplayBuffer from utils.logx import EpochLogger from u...
[ 11748, 299, 32152, 355, 45941, 201, 198, 11748, 1822, 29572, 11, 11550, 11, 640, 11, 28686, 201, 198, 11748, 28686, 13, 6978, 355, 267, 2777, 201, 198, 11748, 28034, 201, 198, 11748, 28034, 13, 20471, 355, 299, 77, 201, 198, 11748, 28...
2.474308
759