content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import pytest
from requests import get
from urllib.parse import urljoin
def test_valid_new_link_page(wait_for_api, login_user):
"""
GIVEN a user has logged in (login_user)
WHEN the '/links/new' page is navigated to (GET)
THEN check the response is valid and page title is correct
"""
request_ses... | [
11748,
12972,
9288,
198,
6738,
7007,
1330,
651,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
22179,
198,
198,
4299,
1332,
62,
12102,
62,
3605,
62,
8726,
62,
7700,
7,
17077,
62,
1640,
62,
15042,
11,
17594,
62,
7220,
2599,
198,
... | 2.902991 | 1,371 |
from blockchain import BlockChain
from block import Block
blockchain = BlockChain()
print("***Mining mechgCoin about to start***")
print(blockchain.chain)
last_block = blockchain.latest_block
last_proof_no = last_block.proof_no
proof_no = blockchain.proof_of_work(last_proof_no)
blockchain.new_data(
... | [
6738,
11779,
1330,
9726,
35491,
201,
198,
6738,
2512,
1330,
9726,
201,
198,
201,
198,
9967,
7983,
796,
9726,
35491,
3419,
201,
198,
201,
198,
4798,
7203,
8162,
44,
3191,
36571,
70,
24387,
546,
284,
923,
8162,
4943,
201,
198,
4798,
7,
... | 2.931174 | 247 |
# -*- coding: utf-8 -*-
# cython: language_level=3
# BSD 3-Clause License
#
# Copyright (c) 2020-2022, Faster Speeding
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of sour... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
3075,
400,
261,
25,
3303,
62,
5715,
28,
18,
198,
2,
347,
10305,
513,
12,
2601,
682,
13789,
198,
2,
198,
2,
15069,
357,
66,
8,
12131,
12,
1238,
1828,
11,
38996,
... | 2.762002 | 8,332 |
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Auth import Auth
from PLC.Nodes import Node, Nodes
class DeleteNode(Method):
"""
Mark an existing node as deleted.
PIs and techs may only delete nodes at their own sites. ins may
delete nodes at ... | [
6738,
350,
5639,
13,
37,
13185,
1330,
1635,
198,
6738,
350,
5639,
13,
17410,
1330,
11789,
198,
6738,
350,
5639,
13,
36301,
1330,
25139,
2357,
11,
35250,
198,
6738,
350,
5639,
13,
30515,
1330,
26828,
198,
6738,
350,
5639,
13,
45,
4147,... | 2.728111 | 217 |
import json
import urllib.request
import urllib.error
from enum import Enum
from flask import Flask, render_template
app = Flask(__name__)
STATUS = {}
@app.route("/")
@app.route("/happy")
| [
11748,
33918,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
2956,
297,
571,
13,
18224,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
... | 2.880597 | 67 |
import heterocl as hcl
import numpy as np
test_conv2D_lb_wb() | [
11748,
14445,
38679,
355,
289,
565,
198,
11748,
299,
32152,
355,
45941,
198,
198,
9288,
62,
42946,
17,
35,
62,
23160,
62,
39346,
3419
] | 2.583333 | 24 |
"""
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).
Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to reach the top of the floor, and you can either start from the step with index 0, or the step with index 1.
Example 1:
Input: cost = ... | [
37811,
198,
2202,
257,
27656,
11,
262,
1312,
12,
400,
2239,
468,
617,
1729,
12,
31591,
1575,
1575,
58,
72,
60,
8686,
357,
15,
41497,
737,
198,
198,
7454,
345,
1414,
262,
1575,
11,
345,
460,
2035,
12080,
530,
393,
734,
4831,
13,
92... | 3.16055 | 218 |
"""Module for running all unit tests of panter."""
import numpy as np
from tests.background_subtraction import do_backgroundfittest
from tests.basicfit import do_histtestfit
from tests.filter import do_histtestfilter
from tests.hist_output import do_histtestout
from tests.histogram import do_histtestbasic
def run_a... | [
37811,
26796,
329,
2491,
477,
4326,
5254,
286,
3425,
353,
526,
15931,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
5254,
13,
25249,
62,
7266,
83,
7861,
1330,
466,
62,
25249,
69,
715,
395,
198,
6738,
5254,
13,
35487,
11147,... | 2.716418 | 268 |
import frappe
from frappe import msgprint, throw, _
# ruleid: frappe-missing-translate-function-python
throw("Error Occured")
# ruleid: frappe-missing-translate-function-python
frappe.throw("Error Occured")
# ruleid: frappe-missing-translate-function-python
frappe.msgprint("Useful message")
# ruleid: frappe-missin... | [
11748,
5306,
27768,
198,
6738,
5306,
27768,
1330,
31456,
4798,
11,
3714,
11,
4808,
628,
198,
2,
3896,
312,
25,
5306,
27768,
12,
45688,
12,
7645,
17660,
12,
8818,
12,
29412,
198,
16939,
7203,
12331,
10775,
1522,
4943,
198,
198,
2,
3896... | 3.105691 | 246 |
import random
import string
import app
import json
import unittest
from datetime import datetime
App = app.app
testSet = {
True : [
'''[{"date": "2015-05-12T14:36:00.451765",
"md5checksum": "e8c83e232b64ce94fdd0e4539ad0d44f",
"name": "John Doe",
"uid": "1"},
... | [
11748,
4738,
198,
11748,
4731,
198,
11748,
598,
198,
11748,
33918,
198,
11748,
555,
715,
395,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
198,
4677,
796,
598,
13,
1324,
198,
198,
9288,
7248,
796,
1391,
198,
220,
220,
220,
6407,
1058... | 1.632609 | 920 |
import numpy as np
import pandas as pd
from scipy import optimize
from sklearn.linear_model import LinearRegression
filename = "ThermalConductivity_temperature.dat"
with open(filename,'r') as f:
lines = [k.strip() for k in f.readlines()]
rows =[]
for i, line in enumerate(lines):
line_args = [k.strip() for k ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
629,
541,
88,
1330,
27183,
198,
6738,
1341,
35720,
13,
29127,
62,
19849,
1330,
44800,
8081,
2234,
198,
34345,
796,
366,
35048,
7617,
34,
12920,
3458,
62,
... | 2.394737 | 342 |
import os
prompt = ':prompt:'
int_if_name_in_openstack = 'infra-int'
reg = os.getenv('REG')
reg_port = os.getenv('REG_PORT')
reg_path = os.getenv('REG_PATH')
test_image = "kubernetespause"
source_folder = os.getenv('SOURCE_FOLDER')
vnf_id = os.getenv('STACK_ID')
cbam_py = "{}/scripts/cbam.py".format(source_folder)
... | [
11748,
28686,
198,
198,
16963,
457,
796,
705,
25,
16963,
457,
32105,
198,
198,
600,
62,
361,
62,
3672,
62,
259,
62,
9654,
25558,
796,
705,
10745,
430,
12,
600,
6,
198,
198,
2301,
796,
28686,
13,
1136,
24330,
10786,
31553,
11537,
198... | 2.158777 | 9,781 |
# Copyright 2020 The StackStorm Authors.
# Copyright 2019 Extreme Networks, Inc.
#
# 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 ... | [
2,
15069,
12131,
383,
23881,
32173,
46665,
13,
198,
2,
15069,
13130,
18111,
27862,
11,
3457,
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,
... | 3.629091 | 275 |
import datetime
current_time = datetime.time()
time_in_sec = int(current_time[0])*3600 + int(current_time[1])*60 + int(current_time[2])
steps = int(input())
time_for_each_step = int(input())
total_time = time_in_sec + steps*time_for_each_step
a = str(datetime.timedelta(seconds=total_time))
az = a[len(a)-7:len(a)]
prin... | [
11748,
4818,
8079,
198,
14421,
62,
2435,
796,
4818,
8079,
13,
2435,
3419,
198,
2435,
62,
259,
62,
2363,
796,
493,
7,
14421,
62,
2435,
58,
15,
12962,
9,
2623,
405,
1343,
493,
7,
14421,
62,
2435,
58,
16,
12962,
9,
1899,
1343,
493,
... | 2.492754 | 138 |
#!/usr/bin/python3
import time
import datetime
import csv
import os
import board
import busio
import adafruit_bme280
OUTPUT_FILE='thp_log.csv'
SAMPLE_INTERVAL=5
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_bme280.Adafruit_BME280_I2C(i2c)
sensor.mode = adafruit_bme280.MODE_FORCE
sensor.overscan_pressure = ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
269,
21370,
198,
11748,
28686,
198,
11748,
3096,
198,
11748,
1323,
952,
198,
11748,
512,
1878,
4872,
62,
65,
1326,
21033,
198,
198,
26... | 2.193089 | 492 |
from __future__ import print_function
from __future__ import unicode_literals
import time
import re
from tiny_test_fw import DUT, App, TinyFW
from ttfw_bl import BL602App, BL602DUT
@TinyFW.test_method(app=BL602App.BL602App, dut=BL602DUT.BL602TyMbDUT, test_suite_name='benchmark_security_aes_tc')
if __name__ == '__m... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
640,
198,
11748,
302,
198,
198,
6738,
7009,
62,
9288,
62,
44482,
1330,
360,
3843,
11,
2034,
11,
20443,
24160,
... | 2.627737 | 137 |
# -*- coding: utf-8 -*-
from anchorman.elements import create_element
from anchorman.elements import remove_elements
from anchorman.intervals import all_intervals
from anchorman.result import applicables
from anchorman.result import augment_result
from anchorman.settings import get_config
from anchorman.utils import lo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
12619,
26183,
13,
68,
3639,
1330,
2251,
62,
30854,
198,
6738,
12619,
26183,
13,
68,
3639,
1330,
4781,
62,
68,
3639,
198,
6738,
12619,
26183,
13,
3849,
12786,
1330,... | 2.615619 | 986 |
import asyncio
from subprocess import CalledProcessError
from conjureup import controllers, juju
from conjureup.app_config import app
from conjureup.consts import JAAS_DOMAIN
from conjureup.ui.views.interstitial import InterstitialView
from conjureup.ui.views.jaas import JaaSLoginView
_controller_class = JaaSLoginC... | [
11748,
30351,
952,
198,
6738,
850,
14681,
1330,
34099,
18709,
12331,
198,
198,
6738,
11644,
495,
929,
1330,
20624,
11,
7544,
14396,
198,
6738,
11644,
495,
929,
13,
1324,
62,
11250,
1330,
598,
198,
6738,
11644,
495,
929,
13,
1102,
6448,
... | 3.4375 | 96 |
import pickle
import os.path as path
from udaru_anomaly_detection \
import check_length, check_distribution, check_gramma
from udaru_anomaly_detection.tests.generator import generate_resource
dirname = path.dirname(path.realpath(__file__))
modeldir = path.join(dirname, 'models')
train_dataset = list(generate_re... | [
198,
11748,
2298,
293,
198,
11748,
28686,
13,
6978,
355,
3108,
198,
198,
6738,
334,
67,
11493,
62,
272,
24335,
62,
15255,
3213,
3467,
198,
220,
220,
220,
1330,
2198,
62,
13664,
11,
2198,
62,
17080,
3890,
11,
2198,
62,
4546,
2611,
19... | 2.495146 | 515 |
### This file is a part of the Syncpy library.
### Copyright 2015, ISIR / Universite Pierre et Marie Curie (UPMC)
### Main contributor(s): Giovanna Varni, Marie Avril,
### syncpy@isir.upmc.fr
###
### This software is a computer program whose for investigating
### synchrony in a fast and exhaustive way.
###
### This ... | [
21017,
770,
2393,
318,
257,
636,
286,
262,
35908,
9078,
5888,
13,
198,
21017,
15069,
1853,
11,
3180,
4663,
1220,
26986,
578,
21204,
2123,
20492,
4424,
494,
357,
52,
5868,
34,
8,
198,
21017,
8774,
18920,
7,
82,
2599,
36089,
7697,
569,
... | 2.499396 | 2,485 |
"""mysite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-base... | [
37811,
28744,
578,
10289,
28373,
198,
464,
4600,
6371,
33279,
82,
63,
1351,
11926,
32336,
284,
5009,
13,
1114,
517,
1321,
3387,
766,
25,
198,
220,
220,
220,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
268,
14,
16,... | 2.627027 | 925 |
"""Sensor support for Wireless Sensor Tags platform."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_MONITORED_CONDITIONS
from homeassistant.core import callback
import homeassistant.helpers.config_validation as ... | [
37811,
47864,
1104,
329,
24365,
35367,
44789,
3859,
526,
15931,
198,
11748,
18931,
198,
198,
11748,
2322,
37623,
5623,
355,
2322,
198,
198,
6738,
1363,
562,
10167,
13,
5589,
3906,
13,
82,
22854,
1330,
9297,
1404,
21389,
62,
50,
3398,
27... | 2.383147 | 1,519 |
import numpy as np
from numpy.random import randn
from util import Activations
| [
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
25120,
1330,
43720,
77,
198,
6738,
7736,
1330,
13144,
602,
198
] | 3.761905 | 21 |
import os
from print_function import consumergroup_usage
# Exemple
# main.py consumergroup list
# main.py consumergroup describe groupe1
KAFKA_HOME = str(os.getenv("KAFKA_HOME"))
KAFKA_BROKERS = str(os.getenv("KAFKA_BROKERS"))
KAFKA_ZOOKEEPER = str(os.getenv("KAFKA_ZOOKEEPER"))
KAFKA_CONNECT = str(os.getenv("... | [
11748,
28686,
201,
198,
6738,
3601,
62,
8818,
1330,
2784,
6422,
3233,
62,
26060,
201,
198,
201,
198,
2,
1475,
368,
1154,
201,
198,
2,
1388,
13,
9078,
2784,
6422,
3233,
1351,
201,
198,
2,
1388,
13,
9078,
2784,
6422,
3233,
6901,
1132,... | 2.32243 | 214 |
"""A Light designed to have access to other component's private data when is toggled."""
DOMAIN = "light_simple_access"
| [
37811,
32,
4401,
3562,
284,
423,
1895,
284,
584,
7515,
338,
2839,
1366,
618,
318,
284,
1130,
992,
526,
15931,
198,
198,
39170,
29833,
796,
366,
2971,
62,
36439,
62,
15526,
1,
198
] | 3.666667 | 33 |
import asyncio
import re
import argparse
from cmd import Cmd
from distutils.util import strtobool
import bili_statistics
import printer
import notifier
from tasks.utils import UtilsTask
from tasks.bili_console import (
PrintGiftbagsTask,
PrintMedalsTask,
PrintMainBiliDailyJobTask,
PrintLi... | [
11748,
30351,
952,
201,
198,
11748,
302,
201,
198,
11748,
1822,
29572,
201,
198,
6738,
23991,
1330,
327,
9132,
201,
198,
6738,
1233,
26791,
13,
22602,
1330,
965,
83,
672,
970,
201,
198,
201,
198,
11748,
275,
2403,
62,
14269,
3969,
201... | 2.569767 | 258 |
import os
import sys
import numpy
numpy.random.seed(42)
with open(os.path.join(sys.argv[1], "dev-other.lst"), "r") as f:
data = [line.strip() for line in f]
for n, seed_val in enumerate([0, 2, 3, 4, 5]):
numpy.random.seed(42 + seed_val)
data = numpy.random.permutation(data)
with open("tts_shuffle... | [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
628,
198,
77,
32152,
13,
25120,
13,
28826,
7,
3682,
8,
628,
198,
4480,
1280,
7,
418,
13,
6978,
13,
22179,
7,
17597,
13,
853,
85,
58,
16,
4357,
366,
7959,
12,
847,
13,
... | 2.102941 | 272 |
import time
import json
import machine
import os
from network import WLAN
from machine import Pin
from MQTTLib import AWSIoTMQTTClient
###################################################################################################
# CONFIG NETWORK
##################################################################... | [
11748,
640,
198,
11748,
33918,
198,
11748,
4572,
198,
11748,
28686,
198,
6738,
3127,
1330,
370,
25697,
198,
6738,
4572,
1330,
13727,
198,
6738,
337,
48,
51,
14990,
571,
1330,
14356,
11584,
78,
15972,
48,
15751,
11792,
628,
198,
29113,
2... | 3.428636 | 2,221 |
host = '127.0.0.1'
user = 'root'
passwd = '12345678'
database ='fangSpider'
TABLENAME = 'loupanindexzzz' | [
4774,
796,
705,
16799,
13,
15,
13,
15,
13,
16,
6,
198,
7220,
796,
705,
15763,
6,
198,
6603,
16993,
796,
705,
10163,
2231,
30924,
6,
198,
48806,
796,
6,
69,
648,
41294,
6,
198,
5603,
9148,
1677,
10067,
796,
705,
75,
280,
6839,
96... | 2.166667 | 48 |
import sys
import pandas as pd
import json
import os
import numpy as np
#opening the json file
f = open(sys.argv[1]+".json", "r")
x=f.read()
# parse x:
data = json.loads(x)
# Creates DataFrame.
df = pd.DataFrame(data)
df = df.fillna(value=np.nan)
f.close()
#print(df)
df.to_stata(sys.argv[2... | [
11748,
25064,
220,
198,
11748,
19798,
292,
355,
279,
67,
220,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
628,
198,
2,
29443,
262,
33918,
2393,
198,
69,
796,
1280,
7,
17597,
13,
853,
85,
58,
16,
48688,
... | 2.132979 | 188 |
import io
import os
import pytest
from release import cibuild
@pytest.mark.parametrize("version, tag, ok", [
("3.0.0.dev", "", True), # regular snapshot
("3.0.0.dev", "v3.0.0", False), # forgot to remove ".dev" on bump
("3.0.0", "", False), # forgot to re-add ".dev"
("3.0.0", "v4.0.0",... | [
11748,
33245,
198,
11748,
28686,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
2650,
1330,
269,
571,
3547,
628,
628,
628,
628,
628,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
9641,
11,
7621,
11,
12876,
... | 2.223485 | 264 |
import calendar
import json
import re
from collections import defaultdict
from heapq import nlargest
from operator import itemgetter
from django import forms
from django.db.models import Count
from django.shortcuts import get_object_or_404, render_to_response
from django.utils.html import strip_tags
from django.views.... | [
11748,
11845,
198,
11748,
33918,
198,
11748,
302,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
24575,
80,
1330,
299,
28209,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,... | 2.66939 | 1,591 |
from telegram.ext import Updater
from telegram.ext import CommandHandler
from telegram.ext import JobQueue
from telegram.ext import Job
import time
import requests
import json
import os.path
from VARIABLES import *
updater = Updater(token=TOKEN_VAR, use_context=True)
dispatcher = updater.dispatcher
job_queue = update... | [
198,
6738,
573,
30536,
13,
2302,
1330,
3205,
67,
729,
198,
6738,
573,
30536,
13,
2302,
1330,
9455,
25060,
198,
6738,
573,
30536,
13,
2302,
1330,
15768,
34991,
198,
6738,
573,
30536,
13,
2302,
1330,
15768,
198,
11748,
640,
198,
11748,
... | 2.881159 | 345 |
import pytest
from ...core.relay import extract_global_id
from ...form.models import Question
from .. import models
@pytest.mark.parametrize(
"case__status,result_count",
[(models.Case.STATUS_RUNNING, 1), (models.Case.STATUS_COMPLETED, 0)],
)
@pytest.mark.parametrize("task__lead_time", [100, None])
@pytest... | [
11748,
12972,
9288,
198,
198,
6738,
2644,
7295,
13,
2411,
323,
1330,
7925,
62,
20541,
62,
312,
198,
6738,
2644,
687,
13,
27530,
1330,
18233,
198,
6738,
11485,
1330,
4981,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
... | 2.56196 | 347 |
# Generated by Django 4.0.3 on 2022-04-08 10:27
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
13,
18,
319,
33160,
12,
3023,
12,
2919,
838,
25,
1983,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
car_input = input('Welcome, what kind of car would you like to rent?\n' )
print(f"{car_input.upper()}?? sure, we have different models {car_input}'s let me show you!" )
| [
7718,
62,
15414,
796,
5128,
10786,
14618,
11,
644,
1611,
286,
1097,
561,
345,
588,
284,
5602,
30,
59,
77,
6,
1267,
198,
4798,
7,
69,
1,
90,
7718,
62,
15414,
13,
45828,
3419,
92,
3548,
1654,
11,
356,
423,
1180,
4981,
1391,
7718,
... | 3.017857 | 56 |
import os
import sys
import re
import json
import random
import pickle
import numpy as np
if __name__ == "__main__":
tg = TraceGenerator(
use_existing_trace=False,
url_nums=240,
trace_length=2400,
)
trace = tg.generate_new_trace()
with open('data/trace.pickle', 'wb') as fp:
... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
302,
198,
11748,
33918,
198,
11748,
4738,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220... | 2.251613 | 155 |
import unittest
from BarCrawlrServer.model.plan import plan
import json
myPlan = "{" +\
"\"name\":\"Alex's Plan\"," +\
"\"places\":[" +\
"{" +\
"\"name\":\"Joe's Bar\"," +\
"\"address\":\"10 King's Street, Burlington, 05401 VT\"," +\
... | [
11748,
555,
715,
395,
628,
198,
6738,
2409,
34,
13132,
81,
10697,
13,
19849,
13,
11578,
1330,
1410,
198,
198,
11748,
33918,
198,
198,
1820,
20854,
796,
366,
4895,
1343,
59,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,... | 1.61978 | 455 |
import json
data = {"Fruteria": [ {"Fruta": [ {"Nombre":"Manzana","Cantidad":10}, {"Nombre":"Pera","Cantidad":20}, {"Nombre":"Naranja","Cantidad":30} ] }, {"Verdura": [ {"Nombre":"Lechuga","Cantidad":80}, {"Nombre":"Tomate","Cantidad":15}, {"Nombre":"Pepino","Cantidad":50} ] } ]}
#encode... | [
11748,
33918,
198,
198,
7890,
796,
19779,
6732,
315,
5142,
1298,
685,
220,
19779,
6732,
29822,
1298,
220,
220,
685,
220,
220,
220,
19779,
45,
2381,
260,
2404,
5124,
89,
2271,
2430,
34,
415,
32482,
1298,
940,
5512,
220,
220,
220,
19779... | 2.174888 | 223 |
import pandas as pd
import numpy as np
import math
import copy
if __name__ == '__main__':
model = {"BIG_C":1.0,"conts":{"x":[[0,0],[1,1]]}, "cats":[]}
print(penalize_this_cont_col(model,"x", {"contStraight":0.01}))
model = {"BIG_C":1.0,"conts":{"x":[[0,0],[1,1]]}, "cats":[]}
print(penalize_this_cont_col(model,"x",... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
4866,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
2746,
796,
19779,
3483,
38,
62,
34,
1298,
16,
13,
15,
... | 2.293333 | 150 |
from threading import Thread
from src.commands.ForwardSavedStrandAndInformUserCommand import ForwardSavedStrandAndInformUserCommand
from src.commands.SendErrorMessageCommand import SendErrorMessageCommand
from src.commands.SendPleaseInstallMessageCommand import SendPleaseInstallMessageCommand
from src.models.exception... | [
6738,
4704,
278,
1330,
14122,
198,
198,
6738,
12351,
13,
9503,
1746,
13,
39746,
50,
9586,
13290,
392,
1870,
818,
687,
12982,
21575,
1330,
19530,
50,
9586,
13290,
392,
1870,
818,
687,
12982,
21575,
198,
6738,
12351,
13,
9503,
1746,
13,
... | 4.096591 | 176 |
import time
import logging
import rethinkdb as r
from bigchaindb import backend
from bigchaindb.backend.exceptions import BackendError
from bigchaindb.backend.changefeed import ChangeFeed
from bigchaindb.backend.utils import module_dispatch_registrar
from bigchaindb.backend.rethinkdb.connection import RethinkDBConnect... | [
11748,
640,
198,
11748,
18931,
198,
11748,
36437,
9945,
355,
374,
198,
198,
6738,
1263,
7983,
9945,
1330,
30203,
198,
6738,
1263,
7983,
9945,
13,
1891,
437,
13,
1069,
11755,
1330,
5157,
437,
12331,
198,
6738,
1263,
7983,
9945,
13,
1891,... | 2.68254 | 504 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
'''
该部分程序用于判断目标合约是否包含转钱出去的语句
'''
'''
可用工具:slither真是个宝藏工具
slither可能可用的功能:
合约各个函数的调用图
文件中各个合约的继承关系
最子类合约的构造函数执行结果
function-summary里有每个函数读写、内外部调用的总结
human-summary里有对每个合约功能的概述->可以用来判断->不能用来判断,对于Receive ETH而言,只判断payable关键字而不判断合约是否真的可以接收以太币
require显示出每个合约的每个函数中用到的require和assert
最子类合... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
46237,
98,
32849,
101,
26344,
228,
163,
101,
233,
41753,
237,
18796,
101,
12859,
236,
26344,
97,
23877,
25... | 1.01107 | 1,355 |
from setuptools import setup, find_packages
from teamleader import __prog__, __version__
setup(
name=__prog__,
version=__version__,
description='python-teamleader',
long_description='Library for accessing the Teamleader API (http://apidocs.teamleader.be/)',
author='Ruben Van den Bossche, Matteo... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
6738,
1074,
27940,
1330,
11593,
1676,
70,
834,
11,
11593,
9641,
834,
628,
198,
40406,
7,
198,
220,
220,
220,
1438,
28,
834,
1676,
70,
834,
11,
198,
220,
220,
220,
... | 2.883117 | 231 |
"""
Just a dummy package to test again importing modules.
"""
| [
37811,
198,
5703,
257,
31548,
5301,
284,
1332,
757,
33332,
13103,
13,
198,
37811,
198
] | 4.133333 | 15 |
#
# This illustrates how the code_pipeline can be used to run the sample test generator
#
import unittest
from click.testing import CliRunner
if __name__ == '__main__':
unittest.main() | [
2,
198,
2,
770,
21290,
703,
262,
2438,
62,
79,
541,
4470,
460,
307,
973,
284,
1057,
262,
6291,
1332,
17301,
198,
2,
198,
11748,
555,
715,
395,
198,
6738,
3904,
13,
33407,
1330,
1012,
72,
49493,
628,
198,
198,
361,
11593,
3672,
834... | 3.183333 | 60 |
#!/usr/bin/env python
import re
import fileinput
import json
import urllib
Lookup = {}
key = raw_input("Please type your gene name, all caps, and press enter: ")
#print var_matches
for line in fileinput.input(['/home/jiawen/data/Homo_sapiens.GRCh37.75.gtf']):
gene_id_matches = re.findall('gene_id \"(.*?)\";',line)
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
302,
198,
11748,
2393,
15414,
198,
11748,
33918,
198,
11748,
2956,
297,
571,
198,
8567,
929,
796,
23884,
198,
2539,
796,
8246,
62,
15414,
7203,
5492,
2099,
534,
9779,
1438,
11,
... | 2.402214 | 813 |
from django.shortcuts import get_object_or_404
import jingo
from projects.models import Project
from topics.models import Topic
def all(request):
"""Show a list of topics."""
# note that we get the list of topics from the bundled context processor
projects = Project.objects.all()
return jingo.render... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
198,
198,
11748,
474,
32735,
198,
198,
6738,
4493,
13,
27530,
1330,
4935,
198,
6738,
10233,
13,
27530,
1330,
47373,
628,
198,
4299,
477,
7,
25927,
2599,
1... | 2.772973 | 370 |
"""
The MIT License (MIT)
Copyright (c) 2016 Swapnil Agarwal
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, mer... | [
37811,
198,
464,
17168,
13789,
357,
36393,
8,
198,
198,
15269,
357,
66,
8,
1584,
48408,
45991,
2449,
283,
16783,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
... | 3.622754 | 334 |
# -*- coding: utf-8 -*-
# NOTES:
# - this file contains the CLI implementation for `hddcoin hodl commit`
from __future__ import annotations
import asyncio
import decimal
import pathlib
import sys
import time
import typing as th
import aiohttp
import blspy # type: ignore
import yaml
import hddcoin.hodl
import hddcoi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
5626,
1546,
25,
198,
2,
220,
532,
428,
2393,
4909,
262,
43749,
7822,
329,
4600,
71,
1860,
3630,
289,
375,
75,
4589,
63,
198,
6738,
11593,
37443,
834,
1330,
37647,
... | 3.484305 | 446 |
from ..params_container import Container
from requests import get
from bs4 import BeautifulSoup
from html import unescape
from ..target import Target
TEST_QUERIES = {'test_single_query': 'walasa',
'test_multi_query': ['walasa', 'yɔrɔ']
}
__doc__ = \
"""
API for Bamana corpus (http... | [
6738,
11485,
37266,
62,
34924,
1330,
43101,
198,
6738,
7007,
1330,
651,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
27711,
1330,
555,
41915,
198,
6738,
11485,
16793,
1330,
12744,
198,
198,
51,
6465,
62,
10917,
1137,
11015... | 2.774373 | 359 |
from time import time_ns
from typing import List
from app import App
class Rotator:
'''
Rotator rotates apps vertically on the screen
'''
class Scroller:
'''
Scrolls content right to left at the given speed
'''
| [
6738,
640,
1330,
640,
62,
5907,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
598,
1330,
2034,
198,
198,
4871,
18481,
1352,
25,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
18481,
1352,
5724,
689,
6725,
31677,
319,
262,
3159,
... | 3 | 80 |
from tornasole.exceptions import *
from tornasole.core.utils import get_logger
from tornasole.trials import create_trial
from tornasole.rules.generic import *
import inspect
logger = get_logger()
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(description='Rule invoker takes the b... | [
6738,
12445,
292,
2305,
13,
1069,
11755,
1330,
1635,
198,
6738,
12445,
292,
2305,
13,
7295,
13,
26791,
1330,
651,
62,
6404,
1362,
198,
6738,
12445,
292,
2305,
13,
28461,
874,
1330,
2251,
62,
45994,
198,
6738,
12445,
292,
2305,
13,
387... | 2.330159 | 630 |
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.admin.views.decorators import staff_member_required
from django.urls import path
from django.views.generic.base import TemplateView
try:
import ... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
... | 2.372734 | 1,379 |
import pytest
import numpy as np
| [
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
628,
198
] | 3.181818 | 11 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 2.491172 | 1,869 |
# Copyright 2020 Google LLC
#
# 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 in writing, ... | [
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 3.416404 | 317 |
from bs4 import BeautifulSoup as bs
import sys,glob
# test_i = open(sys.argv[1])
for i in glob.glob('*_META_ORG'):
newdata = get_contracts(open(i))
#print newdata
with open(i+"CN.xml", "w") as output:
output.write(' '.join(str(doc) for doc in newdata))
# [1] in 2008 and 2009 are <proc> and <natnotice> often ... | [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
355,
275,
82,
198,
11748,
25064,
11,
4743,
672,
198,
198,
2,
1332,
62,
72,
796,
1280,
7,
17597,
13,
853,
85,
58,
16,
12962,
198,
198,
1640,
1312,
287,
15095,
13,
4743,
672,
10786,
9,
62... | 2.819209 | 177 |
#/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Guy Serbin"
__version__ = "1.0.4"
__all__ = ["imageprocess", "ENVIfile", "modistools"]
__main__ = "imageprocess"
| [
2,
14,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
366,
31080,
2930,
8800,
1,
198,
834,
9641,
834,
796,
366,
16,
13,
15,
13,
19,
1,
198,
834,
439,
... | 2.297297 | 74 |
from importlib import reload
from . import config, plugin
__version__ = "1.0.0"
__author__ = "Paul Townsend <pault@pault.org>"
__url__ = "https://github.com/paultownsend/supybot-soccer"
# In case we're being reloaded.
reload(config)
reload(plugin)
Class = plugin.Class
configure = config.configure
| [
6738,
1330,
8019,
1330,
18126,
198,
198,
6738,
764,
1330,
4566,
11,
13877,
198,
198,
834,
9641,
834,
796,
366,
16,
13,
15,
13,
15,
1,
198,
834,
9800,
834,
796,
366,
12041,
46811,
1279,
79,
1721,
31,
79,
1721,
13,
2398,
24618,
198,... | 2.849057 | 106 |
from abc import ABC
from typing import Iterable
import pandas as pd
from ntiles import plotter
from ntiles.tears.base_tear import BaseTear
from ntiles import utils
class ICTear(BaseTear, ABC):
"""
Computes IC from the given factor and returns
Currently will only measure IC for days a company is in the ... | [
6738,
450,
66,
1330,
9738,
198,
6738,
19720,
1330,
40806,
540,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
299,
83,
2915,
1330,
7110,
353,
198,
6738,
299,
83,
2915,
13,
83,
4127,
13,
8692,
62,
83,
451,
1330,
7308,
5... | 2.38395 | 2,081 |
from app.celery import celery
from app.integrations import tg
@celery.task
| [
6738,
598,
13,
7015,
88,
1330,
18725,
1924,
198,
6738,
598,
13,
18908,
9143,
1330,
256,
70,
628,
198,
31,
7015,
88,
13,
35943,
198
] | 3.08 | 25 |
"""
Module for /api/account method
"""
import uuid
from datetime import datetime, timedelta
from typing import Dict, Tuple
from flask_restful import Resource, reqparse
from werkzeug.exceptions import abort
from api.endpoints.accounts.auth import authorization_validator
from api.endpoints.accounts.model import Account... | [
37811,
198,
26796,
329,
1220,
15042,
14,
23317,
2446,
198,
37811,
198,
11748,
334,
27112,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
19720,
1330,
360,
713,
11,
309,
29291,
198,
198,
6738,
42903,
62,
2118,
913,... | 3.60177 | 113 |
# -*- coding: utf-8 -*-
from clare.common.messaging import consumer
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
537,
533,
13,
11321,
13,
37348,
3039,
1330,
7172,
628,
198
] | 2.62963 | 27 |
#
# Copyright (c), 2018-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Davide Brunato <brunato@... | [
2,
198,
2,
15069,
357,
66,
828,
2864,
12,
42334,
11,
311,
1797,
4090,
357,
24274,
3961,
329,
13435,
10422,
737,
198,
2,
1439,
2489,
10395,
13,
198,
2,
770,
2393,
318,
9387,
739,
262,
2846,
286,
262,
17168,
13789,
13,
198,
2,
4091,... | 2.273099 | 11,981 |
from preparation.transformers.base import BaseTransformer
from preparation.transformers.categorical import (CategoricalTransformer, OneHotEncodingTransformer)
__all__ = [
'BaseTransformer',
'CategoricalTransformer',
'OneHotEncodingTransformer',
]
| [
6738,
11824,
13,
35636,
364,
13,
8692,
1330,
7308,
8291,
16354,
198,
6738,
11824,
13,
35636,
364,
13,
66,
2397,
12409,
1330,
357,
34,
2397,
12409,
8291,
16354,
11,
1881,
21352,
27195,
7656,
8291,
16354,
8,
198,
198,
834,
439,
834,
796... | 3.333333 | 78 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, math
# https://www.nayuki.io/page/fast-fourier-transform-in-x86-assembly
sys.stdout.write("const float cos_table[512] = {\n")
for i in range(512):
if not (i % 8):
sys.stdout.write(" ")
sys.stdout.write("%9.6ff" % math.cos((math.pi * i) / 512... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
25064,
11,
10688,
198,
2,
3740,
1378,
2503,
13,
77,
323,
11308,
13,
952,
14,
7700,
14,
7217,
12,
69,
28... | 1.946988 | 415 |
import os
import pytest
import json
from xbox.nano.channel import Channel
from xbox.nano.enum import ChannelClass
@pytest.fixture(scope='session')
@pytest.fixture(scope='session')
@pytest.fixture(scope='session')
| [
11748,
28686,
198,
11748,
12972,
9288,
198,
11748,
33918,
198,
198,
6738,
2124,
3524,
13,
77,
5733,
13,
17620,
1330,
11102,
198,
6738,
2124,
3524,
13,
77,
5733,
13,
44709,
1330,
11102,
9487,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
... | 3.013699 | 73 |
import sys
import os
sys.path.append('.')
import os
import logging
logging.basicConfig(format='%(asctime)s - %(message)s', level=logging.INFO)
logging.getLogger('matplotlib').setLevel(logging.WARNING)
import pandas as pd
import numpy as np
import time
from sslplay.data.digits import DataDigits
from sslplay.model.ra... | [
11748,
25064,
198,
11748,
28686,
198,
17597,
13,
6978,
13,
33295,
10786,
2637,
8,
198,
198,
11748,
28686,
198,
198,
11748,
18931,
198,
6404,
2667,
13,
35487,
16934,
7,
18982,
11639,
4,
7,
292,
310,
524,
8,
82,
532,
4064,
7,
20500,
8... | 2.234679 | 669 |
from unittest import TestCase
import numpy as np
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure
from xrview.glyphs import (
Band,
BoxWhisker,
Circle,
Diamond,
ErrorCircle,
ErrorLine,
HBar,
Line,
Ray,
Rect,
Square,
Triangle,
VBar,
VLi... | [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1489,
365,
71,
13,
27530,
1330,
29201,
6601,
7416,
198,
6738,
1489,
365,
71,
13,
29487,
889,
1330,
3785,
198,
198,
6738,
2124,
81,
1177,
13,
... | 2.186047 | 172 |
# square root of two -- how many iterations under 1001 contain a numerator with more digits than the denominator?
import timeit
start = timeit.default_timer()
print "Answer: %s" % euler_57()
stop = timeit.default_timer()
print "Time: %f" % (stop - start)
| [
2,
6616,
6808,
286,
734,
1377,
703,
867,
34820,
739,
1802,
16,
3994,
257,
5470,
1352,
351,
517,
19561,
621,
262,
31457,
1352,
30,
220,
198,
198,
11748,
640,
270,
628,
198,
9688,
796,
640,
270,
13,
12286,
62,
45016,
3419,
198,
220,
... | 3.011236 | 89 |
import time
from enum import Enum
from functools import reduce
import contextlib
import numpy as np
import torch
from torch import nn
from torch.nn import functional as F
from torch.autograd import Variable
from second.pytorch.models.voxelnet import register_voxelnet, VoxelNet
from second.pytorch.models import rpn
... | [
11748,
640,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
11748,
4732,
8019,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
13,
20471,
1330,
1... | 3.141732 | 127 |
import typing
import hvac
| [
11748,
19720,
198,
198,
11748,
289,
85,
330,
628
] | 3.111111 | 9 |
"""Event."""
from __future__ import annotations
import logging
from typing import List
from ..consts import (
XML_TAG_CREATIONINFO,
XML_TAG_DESCRIPTION,
XML_TAG_MAGNITUDE,
XML_TAG_ORIGIN,
)
from .creation_info import CreationInfo
from .description import Description
from .element import Element
from .... | [
37811,
9237,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
18931,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
11485,
1102,
6448,
1330,
357,
198,
220,
220,
220,
23735,
62,
42197,
62,
43387,
6234,
10778,
11,
19... | 2.372845 | 928 |
from flask import request
from flask_restplus import Resource, cors
from app.main.model.todo_dto import TodoDTO
from app.main.service.todo_service import (
get_all_todos,
save_new_todo,
get_todo,
delete_todo,
)
from app.main.util.auth_decorator import token_required
api = TodoDTO.api
_todo = TodoDTO.... | [
6738,
42903,
1330,
2581,
198,
6738,
42903,
62,
2118,
9541,
1330,
20857,
11,
269,
669,
198,
198,
6738,
598,
13,
12417,
13,
19849,
13,
83,
24313,
62,
67,
1462,
1330,
309,
24313,
35,
10468,
198,
6738,
598,
13,
12417,
13,
15271,
13,
83,... | 2.182556 | 986 |
#!/usr/bin/env python
#author:Richard Peng
#project:Kindelabra
#website:http://www.richardpeng.com/projects/kindelabra/
#repository:https://github.com/richardpeng/Kindelabra
#license:Creative Commons GNU GPL v2
# (http://creativecommons.org/licenses/GPL/2.0/)
import struct
import zipfile
import re
import codecs
impor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
9800,
25,
22245,
42341,
198,
2,
16302,
25,
35854,
417,
397,
430,
198,
2,
732,
12485,
25,
4023,
1378,
2503,
13,
7527,
446,
79,
1516,
13,
785,
14,
42068,
14,
11031,
417,
397,
430,... | 2.782609 | 207 |
import os
from app import create_app, db
app = create_app()
@app.cli.command()
def test():
"""Run the unit tests."""
import unittest
tests = unittest.TestLoader().discover('tests')
unittest.TextTestRunner(verbosity=2).run(tests)
@app.cli.command()
def ipy():
"""Open IPython Debug Shell"""
... | [
11748,
28686,
198,
198,
6738,
598,
1330,
2251,
62,
1324,
11,
20613,
198,
198,
1324,
796,
2251,
62,
1324,
3419,
628,
198,
31,
1324,
13,
44506,
13,
21812,
3419,
198,
4299,
1332,
33529,
198,
220,
220,
220,
37227,
10987,
262,
4326,
5254,
... | 2.056266 | 1,564 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="nnplot",
# packages = ['nnplot'],
version="1.0.1",
author="Yuval Ai",
author_email="yuval_a@rad.com",
description="Plot Neural Networks and the weights of the links between their nodes... | [
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
... | 2.8 | 335 |
# -*- coding: utf-8 -*-
import requests
import json
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
7007,
198,
11748,
33918,
628
] | 2.65 | 20 |
"""
Senz Wifi Session
"""
import json
import requests
import os
import urllib3
from . import urls
def _validate_response(response):
""" Verify that response is OK """
if response.status_code == 200:
return
raise ResponseError(response.status_code, response.text)
class Error(Exception):
''' S... | [
37811,
198,
10445,
89,
370,
22238,
23575,
198,
37811,
198,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
28686,
198,
11748,
2956,
297,
571,
18,
198,
6738,
764,
1330,
2956,
7278,
198,
198,
4299,
4808,
12102,
378,
62,
26209,
7,
26209,
... | 2.336756 | 974 |
import argparse
import glob
import os
import sys
import time
from multiprocessing import cpu_count
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from PIL import Image, ImageFilter
import torch
import torch.nn as nn
from gensim.models import Word2Vec
from torch.utils.data import DataLoader
i... | [
11748,
1822,
29572,
198,
11748,
15095,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
6738,
18540,
305,
919,
278,
1330,
42804,
62,
9127,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32... | 1.85928 | 6,751 |
from rekall import Interval, IntervalSet, IntervalSetMapping
from rekall.bounds import Bounds3D
from rekall.predicates import overlaps
from rekall.stdlib.merge_ops import payload_first
import unittest
from pstats import Stats
import cProfile
| [
6738,
302,
74,
439,
1330,
4225,
2100,
11,
4225,
2100,
7248,
11,
4225,
2100,
7248,
44,
5912,
198,
6738,
302,
74,
439,
13,
65,
3733,
1330,
347,
3733,
18,
35,
198,
6738,
302,
74,
439,
13,
28764,
16856,
1330,
12893,
1686,
198,
6738,
3... | 3.253333 | 75 |
# -*- coding: utf-8 -*-
"""
Collect the results for a given hint command.
"""
__author__ = "Jakrin Juangbhanich"
__email__ = "juangbhanich.k@gmail.com"
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
31337,
262,
2482,
329,
257,
1813,
9254,
3141,
13,
198,
37811,
198,
198,
834,
9800,
834,
796,
366,
41,
461,
12769,
12585,
648,
65,
7637,
488,
1,
198,
... | 2.460317 | 63 |
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtOpenGL import *
from PyQt5.QtWidgets import *
# TODO: Maybe export all from PyQt5.QtCore.Qt?
# Because Qt.Key_W is better than Qt.Qt.Key_W
| [
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
11505,
8763,
1330,
1635,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
... | 2.141414 | 99 |
from jira_api import get_all_tasks
from jira_api import flatten_dict
import pandas as pd
import numpy as np
import datetime
import json
import yaml
import urllib3
import os
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# load JIRA username and password
jira_creds = yaml.load(open('./user_dev.yml'... | [
6738,
474,
8704,
62,
15042,
1330,
651,
62,
439,
62,
83,
6791,
198,
6738,
474,
8704,
62,
15042,
1330,
27172,
268,
62,
11600,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4818,
8079,
198,
11748,
... | 2.408463 | 1,158 |
#!/usr/bin/env python
"""
Creates a secure, random password for the Django user 'admin'
"""
import hashlib
import imp
import os
import sqlite3
import django
from django.contrib.auth.models import User
django.setup()
# Load the OpenShift helper library
lib_path = os.environ['OPENSHIFT_REPO_DIR'] + 'web/'
modinfo = imp.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
16719,
274,
257,
5713,
11,
4738,
9206,
329,
262,
37770,
2836,
705,
28482,
6,
198,
37811,
198,
11748,
12234,
8019,
198,
11748,
848,
198,
11748,
28686,
198,
11748,
44161,
578,
... | 2.755682 | 352 |
import os
import pytest
import server as serv
filename = os.path.join("tests", "b64.txt")
with open(filename, "r") as fobj:
b64_str = fobj.read()
type_keys = {"a": int, "b": float, "c": str, "d": list}
@pytest.mark.parametrize("my_input, expected", [
(1, 1),
("1", 1),
("one", False),
(0j + 1, 1... | [
11748,
28686,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
4382,
355,
1113,
198,
198,
34345,
796,
28686,
13,
6978,
13,
22179,
7203,
41989,
1600,
366,
65,
2414,
13,
14116,
4943,
198,
4480,
1280,
7,
34345,
11,
366,
81,
4943,
355,
277,... | 2.070496 | 766 |
#!/bin/python
# Python3 script which continuously reads Gmail messages and uploads them to GitHub
#
# This script assumes there exists a credentials directory (which is .gitignored) containing:
# - oauth secret api key
# - stored oauth access token for the gmail account
# - GitHub personal access token
#
# This also re... | [
2,
48443,
8800,
14,
29412,
198,
2,
11361,
18,
4226,
543,
17282,
9743,
33662,
6218,
290,
9516,
82,
606,
284,
21722,
198,
2,
198,
2,
770,
4226,
18533,
612,
7160,
257,
18031,
8619,
357,
4758,
318,
764,
18300,
570,
1850,
8,
7268,
25,
... | 2.502498 | 2,402 |
nucleotides = ["A", "C", "G", "T"]
# Average masses of monophosphate deoxy nucleotides
unambiguous_dna_weights = {"A": 331.2218, "C": 307.1971, "G": 347.2212, "T": 322.2085}
# Monoisotopic masses of monophospate deoxy nucleotides
monoisotopic_unambiguous_dna_weights = {
"A": 331.06817,
"C": 307.056936,
"... | [
198,
77,
14913,
313,
1460,
796,
14631,
32,
1600,
366,
34,
1600,
366,
38,
1600,
366,
51,
8973,
198,
198,
2,
13475,
14568,
286,
937,
2522,
14222,
378,
390,
23536,
17751,
313,
1460,
198,
403,
4131,
29709,
62,
67,
2616,
62,
43775,
796,
... | 1.705518 | 1,939 |
from distutils.core import setup
setup(
name='pybinarymoip',
version='0.0.8',
license='MIT',
description='Python library for Binary Media over IP (MOIP), used for Home Assistant',
author='Greg J. Badros',
author_email='badros@gmail.com',
url='http://github.com/gjbadros/pybinarymoip',
pa... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
9078,
39491,
5908,
541,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
15,
13,
23,
3256,
198,
220,
220,
220,
5964,
11639,
36393,
3256,
198... | 2.720307 | 261 |
# -*- coding:utf-8 -*-
# @Time : 2019-12-30 13:41
# @Author : liuqiuxi
# @Email : liuqiuxi1990@gmail.com
# @File : indexfeeds.py
# @Project : datafeeds
# @Software: PyCharm
# @Remark : This is all data source index feeds
import datetime
from datafeeds.utils import BarFeedConfig
from datafeeds im... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
201,
198,
2,
2488,
7575,
220,
220,
220,
1058,
13130,
12,
1065,
12,
1270,
1511,
25,
3901,
201,
198,
2,
2488,
13838,
220,
1058,
7649,
84,
40603,
2821,
72,
201,
198,
2,
2488,
1... | 2.602564 | 234 |
from perl import BarnOwl
m = BarnOwl.Module.Python
| [
6738,
48746,
1330,
11842,
46,
40989,
198,
76,
796,
11842,
46,
40989,
13,
26796,
13,
37906,
198
] | 3 | 17 |
# encoding: utf-8
from django import forms
from django.conf import settings
from django.views import generic
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import redirect, get_object_or_404
from django.utils.http import base36_to_int, int_to_base36
from django.contrib import auth, messa... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
33571,
1330,
14276,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
... | 3.246988 | 166 |
# Copyright (C) 2019 Akamai Technologies, Inc.
# Copyright (C) 2011-2016 Nominum, Inc.
#
# 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
#... | [
2,
15069,
357,
34,
8,
13130,
9084,
1689,
72,
21852,
11,
3457,
13,
198,
2,
15069,
357,
34,
8,
2813,
12,
5304,
399,
6351,
388,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
... | 3.68705 | 278 |
#!/usr/bin/env python
import sys
import multiprocessing as mp
import numpy as np
import scipy.optimize as op
import copy
import blackboxhelper as bbh
import utils as u
from skopt import Optimizer
import skopt.acquisition as acq
import argparse
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
11748,
18540,
305,
919,
278,
355,
29034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
40085,
1096,
355,
1034,
198,
11748,
4866,
198,
11748,
2042,
... | 2.477837 | 4,309 |
from player import Player
import time
from tkinter import *
from tkinter.ttk import *
from ttkthemes import themed_tk as tk
pop = PopIt()
pop.run_game()
| [
6738,
2137,
1330,
7853,
201,
198,
11748,
640,
201,
198,
6738,
256,
74,
3849,
1330,
1635,
201,
198,
6738,
256,
74,
3849,
13,
926,
74,
1330,
1635,
201,
198,
6738,
256,
30488,
1169,
6880,
1330,
31892,
62,
30488,
355,
256,
74,
201,
198,... | 2.5 | 68 |
from distutils.version import StrictVersion
__all__ = ['VERSION']
VERSION = StrictVersion('0.14')
| [
6738,
1233,
26791,
13,
9641,
1330,
520,
2012,
14815,
198,
198,
834,
439,
834,
796,
37250,
43717,
20520,
198,
198,
43717,
796,
520,
2012,
14815,
10786,
15,
13,
1415,
11537,
198
] | 3.225806 | 31 |
import tempfile
from typing import List, Tuple, Optional
from mason.engines.scheduler.models.dags.invalid_dag_step import InvalidDagStep
from mason.engines.scheduler.models.dags.valid_dag_step import ValidDagStep
from asciidag.graph import Graph
from asciidag.node import Node
from mason.util.list import flatten_array,... | [
11748,
20218,
7753,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
32233,
198,
198,
6738,
285,
888,
13,
1516,
1127,
13,
1416,
704,
18173,
13,
27530,
13,
67,
3775,
13,
259,
12102,
62,
67,
363,
62,
9662,
1330,
17665,
35,
363,
8600,... | 3.083916 | 143 |
#!/usr/bin/env python
#
# description: Rotting Oranges
# difficulty: Medium
# leetcode_num: 994
# leetcode_url: https://leetcode.com/problems/rotting-oranges/
#
# You are given an m x n grid where each cell can have one of three values:
# 0 representing an empty cell,
# 1 representing a fresh orange, or
# 2 representin... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
6764,
25,
18481,
889,
1471,
6231,
198,
2,
8722,
25,
13398,
198,
2,
443,
316,
8189,
62,
22510,
25,
860,
5824,
198,
2,
443,
316,
8189,
62,
6371,
25,
3740,
1378,
293,
316... | 2.705341 | 543 |
#!/usr/bin/python -tt
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distrib... | [
2,
48443,
14629,
14,
8800,
14,
29412,
532,
926,
198,
2,
770,
2393,
318,
636,
286,
28038,
856,
198,
2,
198,
2,
28038,
856,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2,
340,
739,
262,
2846,
286,
26... | 2.909964 | 833 |