content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Extreme values from expressions
inf = 1e234 * 1e234
_inf = 1e234 * -1e234
_zero = 1 / _inf
nan = inf + _inf
inf, _inf, _zero, nan
(inf, -inf, -0.0, nan)
# Print
for value in (inf, _inf, _zero, nan): print(value)
inf
-inf
-0.0
nan
# Extreme values from other means
float('nan')
nan
float('inf')
inf
float('-inf')
-inf
... | [
2,
18111,
3815,
422,
14700,
198,
10745,
796,
352,
68,
24409,
1635,
352,
68,
24409,
198,
62,
10745,
796,
352,
68,
24409,
1635,
532,
16,
68,
24409,
198,
62,
22570,
796,
352,
1220,
4808,
10745,
198,
12647,
796,
1167,
1343,
4808,
10745,
... | 2.252336 | 214 |
from django import template
register = template.Library()
@register.simple_tag
| [
6738,
42625,
14208,
1330,
11055,
628,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
198,
31,
30238,
13,
36439,
62,
12985,
198
] | 3.772727 | 22 |
from uuid import uuid4
from django.db import models
class TestUUIDModel(models.Model):
"""
Simple model with UUIDField as primary key for tests.
"""
id = models.UUIDField(primary_key=True, default=uuid4)
name = models.CharField(max_length=255)
| [
6738,
334,
27112,
1330,
334,
27112,
19,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
198,
4871,
6208,
52,
27586,
17633,
7,
27530,
13,
17633,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
17427,
2746,
351,
471,
27586... | 2.791667 | 96 |
# -*- coding: utf-8 -*-
'''*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
9,
198,
197,
1212,
1430,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
197,
270,
739,
262,
2846,
286,
262,
22961,
3611,
50... | 3.629834 | 181 |
###############################################
# RabbitMQ in Action
# Chapter 4.2.2 - Alerting Server Producer
#
# Requires: pika >= 0.9.5
#
# Author: Jason J. W. Williams
# (C)2011
###############################################
import json, pika
from optparse import OptionParser
#/(asp.0) Read in command line arg... | [
29113,
7804,
4242,
21017,
198,
2,
25498,
49215,
287,
7561,
198,
2,
7006,
604,
13,
17,
13,
17,
532,
23276,
278,
9652,
30436,
198,
2,
220,
198,
2,
26848,
25,
279,
9232,
18189,
657,
13,
24,
13,
20,
198,
2,
220,
198,
2,
6434,
25,
... | 2.192623 | 732 |
"""Entry point for cliff CLI application"""
import sys
from scadi.main import main
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
| [
37811,
30150,
966,
329,
19516,
43749,
3586,
37811,
198,
198,
11748,
25064,
198,
198,
6738,
629,
9189,
13,
12417,
1330,
1388,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
25064,
13,
37023,
7,
1... | 2.807692 | 52 |
from tmp import <weak_warning descr="Access to a protected member _CONSTANT of a class">_CONSTANT</weak_warning> | [
6738,
45218,
1330,
1279,
38695,
62,
43917,
1715,
81,
2625,
15457,
284,
257,
6861,
2888,
4808,
10943,
2257,
8643,
286,
257,
1398,
5320,
62,
10943,
2257,
8643,
3556,
38695,
62,
43917,
29
] | 3.5 | 32 |
from utility.platform import bean
from utility.platform import youtube
| [
6738,
10361,
13,
24254,
1330,
26394,
198,
6738,
10361,
13,
24254,
1330,
35116,
628
] | 5.142857 | 14 |
import logging
import os
# import fabric-comanage-api package (uses directory for development purposes)
from comanage_api import ComanageApi
# create a new ComanageApi object and set the connection attributes
api = ComanageApi(
co_api_url=os.getenv('COMANAGE_API_URL'),
co_api_user=os.getenv('COMANAGE_API_USER... | [
11748,
18931,
198,
11748,
28686,
198,
198,
2,
1330,
9664,
12,
785,
272,
496,
12,
15042,
5301,
357,
2664,
8619,
329,
2478,
4959,
8,
198,
6738,
401,
272,
496,
62,
15042,
1330,
955,
272,
496,
32,
14415,
198,
198,
2,
2251,
257,
649,
9... | 2.473251 | 243 |
import json
import os
import random
| [
11748,
33918,
198,
11748,
28686,
198,
11748,
4738,
628
] | 4.111111 | 9 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import zipfile
try:
import cPickle as pickle
except ImportError:
import pickle
import tensorflow as tf
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
19974,
7753,
198,
28311,
25,
198,
220,
220,
220,
1330,
269,
31686,
293,
355,
... | 3.52381 | 63 |
"""
The training and testing loops for PyTorch.
"""
import copy
import logging
import os
import numpy as np
import torch
import subfedavg_pruning as pruning_processor
from plato.config import Config
from plato.datasources import registry as datasources_registry
from plato.samplers import registry as samplers_registry... | [
37811,
198,
464,
3047,
290,
4856,
23607,
329,
9485,
15884,
354,
13,
198,
37811,
198,
11748,
4866,
198,
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
198,
11748,
850,
19082,
615,
70,
62... | 1.953023 | 4,747 |
import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../'))
import numpy as np
import h5py
import argparse
import time
import logging
from sklearn import metrics
from utils import utilities, data_generator
import core
import keras
from keras.models import Model
from keras.layers import (Input, Dense, Bat... | [
11748,
28686,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
16,
11,
28686,
13,
6978,
13,
22179,
7,
17597,
13,
6978,
58,
15,
4357,
705,
40720,
6,
4008,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
289,
20,
9078,
198,
1174... | 2.283433 | 1,002 |
# Copyright (C) 2016 William Granados<wiliam.granados@wgma00.me>
#
# This file is part of PokemonShowdownBot.
#
# PokemonShowdownBot 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 Lice... | [
2,
15069,
357,
34,
8,
1584,
3977,
17113,
22484,
27,
86,
346,
1789,
13,
46324,
22484,
31,
86,
70,
2611,
405,
13,
1326,
29,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
14878,
15307,
2902,
20630,
13,
198,
2,
198,
2,
14878,
15307,
290... | 2.656963 | 1,752 |
from xv_leak_tools.factory import Builder
from xv_leak_tools.test_components.git.git import Git
| [
6738,
2124,
85,
62,
293,
461,
62,
31391,
13,
69,
9548,
1330,
35869,
198,
6738,
2124,
85,
62,
293,
461,
62,
31391,
13,
9288,
62,
5589,
3906,
13,
18300,
13,
18300,
1330,
15151,
198
] | 2.823529 | 34 |
import json
import zlib
from pathlib import Path
from zipfile import ZipFile
import dill as pickle
import numpy as np
from gismo.filesource import FileSource
from sisu.datasets.covid import get_content
from sisu.preprocessing.language import guess_language
def load_dataset(dataset_dir: str, getters: dict = None, ma... | [
11748,
33918,
198,
11748,
1976,
8019,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19974,
7753,
1330,
38636,
8979,
198,
198,
11748,
288,
359,
355,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
308,
44126,
13,
16624,
1668,
... | 2.484703 | 2,713 |
# native packs
from typing import List
# installed packs
#
# my packs
from skillNer.text_class import Text
class Matchers:
"""class to instanciate a matcher pipeline used to annotate text.
"""
def __init__(
self,
nlp,
skills_db: dict,
phraseMatcher
):
"""Constr... | [
2,
6868,
15186,
198,
6738,
19720,
1330,
7343,
198,
2,
6589,
15186,
198,
2,
198,
2,
616,
15186,
198,
6738,
5032,
45,
263,
13,
5239,
62,
4871,
1330,
8255,
628,
198,
4871,
6550,
3533,
25,
198,
220,
220,
220,
37227,
4871,
284,
916,
27... | 2.099529 | 1,909 |
from setuptools import setup, find_packages
setup(
author='Luke Hollis',
author_email='luke@lukehollis.org',
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1772,
11639,
30730,
11806,
271,
3256,
198,
220,
220,
220,
1772,
62,
12888,
11639,
2290,
365,
31,
2290,
365,
71,
692,
271,
13,
2398,
32... | 2.84434 | 424 |
# Copyright 2020 MobiledgeX, Inc. All rights and licenses reserved.
# MobiledgeX, Inc. 156 2nd Street #408, San Francisco, CA 94105
#
# 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
#
# htt... | [
2,
15069,
12131,
16540,
3902,
469,
55,
11,
3457,
13,
1439,
2489,
290,
16625,
10395,
13,
198,
2,
16540,
3902,
469,
55,
11,
3457,
13,
23871,
362,
358,
3530,
1303,
26200,
11,
2986,
6033,
11,
7257,
10048,
13348,
198,
2,
198,
2,
49962,
... | 3.785933 | 327 |
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_xlim([0, 10])
ax.set_ylim([0, 10])
rojos = []
azules = []
linea = False
x = np.arange(0,11)
y = x
cid = fig.canvas.mpl_connect('button_press_event', onclick)
plt.show() | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
5647,
796,
458,
83,
13,
26875,
3419,
198,
897,
796,
2336,
13,
2860,
62,
7266,
29487,
7,
16243,
8,
198,
897,
13,
2617,
62,
87,
2... | 2.219512 | 123 |
import pickle
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from flask import Flask
from flask_restful import reqparse, abort, Api, Resource
import pdb
app = Flask(__name__)
api = Api(app)
# argument parsing
parser = reqparse.RequestParser()
parser.add_argument('data')
model_dir = "/home/bit... | [
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
2118,
913,
1330,
43089,
29572,
11,
15614,
11,
5949,
72,
... | 2.907407 | 162 |
import pandas as pd
from pptx.util import Pt
from base import ObjectWorker
from utils.pptx_params import PrsParamsManager
| [
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
279,
457,
87,
13,
22602,
1330,
34352,
198,
198,
6738,
2779,
1330,
9515,
12468,
263,
198,
6738,
3384,
4487,
13,
381,
17602,
62,
37266,
1330,
1736,
82,
10044,
4105,
13511,
628,
198
] | 3.073171 | 41 |
# Generated by Django 3.1.2 on 2021-04-16 15:36
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
17,
319,
33448,
12,
3023,
12,
1433,
1315,
25,
2623,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# Generated by Django 3.2.4 on 2021-10-25 14:29
from django.db import migrations
import i18nfield.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
19,
319,
33448,
12,
940,
12,
1495,
1478,
25,
1959,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
11748,
1312,
1507,
77,
3245,
13,
25747,
628
] | 2.815789 | 38 |
import django_filters
from apps.responsible_disc import models
| [
11748,
42625,
14208,
62,
10379,
1010,
198,
6738,
6725,
13,
24358,
62,
15410,
1330,
4981,
628
] | 4 | 16 |
# coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.AndereLaag import AndereLaag
from OTLMOW.OTLModel.Datatypes.KlDunneOverlagingType import KlDunneOverlagingType
from OTLMOW.OTLModel.Datatypes.KlKleurSupp import KlKleurSupp
from OTLMOW.OTLModel.Datatypes.KwantW... | [
2,
19617,
28,
40477,
12,
23,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,
13,
14881,
9487,
274,
13,
2394,
43,
8086,
822,
84,
315,
1330,
440,
14990,
8086,
822,
84,
315,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,... | 2.378846 | 520 |
if __name__ == '__main__':
i = Input()
i.user_input()
i.std_output() | [
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
1312,
796,
23412,
3419,
201,
198,
220,
220,
220,
1312,
13,
7220,
62,
15414,
3419,
201,
198,
220,
220,
220,
1312,
13,
19282,
62,
22915,
3419... | 1.976744 | 43 |
# -*- coding: utf-8 -*-
"""
Workflow engine for controlling and documenting all calculations in application
"""
__author__ = 'Samir Adrik'
__email__ = 'samir.adrik@gmail.com'
from .scrape_finn_community_statistics import ScrapeFinnCommunityStatistics
from .scrape_finn_ownership_history import ScrapeFinnOwnershipHist... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
12468,
11125,
3113,
329,
12755,
290,
33045,
477,
16765,
287,
3586,
198,
198,
37811,
198,
198,
834,
9800,
834,
796,
705,
16305,
343,
1215,
12602,
6,
198,
834,... | 3.491525 | 413 |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 23 21:13:00 2019
@author: hamil
"""
import numpy as np
import matplotlib.pyplot as plt
import numpy.random as rand
#first function for old version of game
#Print(“The amount of turns it takes to win:”, turns)
test1 = old_cherry(50)
#print("Turns for old version:",(t... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
8621,
2242,
2310,
25,
1485,
25,
405,
13130,
198,
198,
31,
9800,
25,
8891,
346,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
... | 2.303116 | 353 |
from flask import render_template
from .forms import LoginForm
from vendrest import app
@app.errorhandler(404)
@app.errorhandler(500)
@app.route('/')
@app.route('/index')
@app.route('/login', methods=['GET', 'POST'])
| [
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
764,
23914,
1330,
23093,
8479,
198,
6738,
10817,
2118,
1330,
598,
198,
198,
31,
1324,
13,
18224,
30281,
7,
26429,
8,
628,
198,
31,
1324,
13,
18224,
30281,
7,
4059,
8,
198,
198,
31,
1324... | 2.883117 | 77 |
"""Pytest fixtures.
"""
import os
import pytest
@pytest.fixture(scope="session")
def templates_repo() -> str:
"""Directory path of the root of the templates repository."""
repo_path = os.path.abspath(
os.path.join(os.path.dirname(__file__), "data/templates")
)
return repo_path
| [
37811,
20519,
9288,
34609,
13,
198,
37811,
198,
198,
11748,
28686,
198,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
2625,
29891,
4943,
198,
4299,
24019,
62,
260,
7501,
3419,
4613,
965,
25,
198,
220,
220,... | 2.637931 | 116 |
"""
This file contains the base join optimization class, and an
exhaustive implementation.
Join optimization takes a From() operator, along with the relevant
join predicates, as input, and outputs an optimized physical join
plan that is "good".
See the README in this folder for details
"""
from ..ops import *
from ... | [
37811,
198,
1212,
2393,
4909,
262,
2779,
4654,
23989,
1398,
11,
290,
281,
220,
198,
1069,
42456,
425,
7822,
13,
198,
198,
18234,
23989,
2753,
257,
3574,
3419,
10088,
11,
1863,
351,
262,
5981,
220,
198,
22179,
2747,
16856,
11,
355,
512... | 2.621483 | 2,346 |
#!/usr/bin/env python3
import sys
import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import axes3d, Axes3D
plt.rcParams['text.usetex'] = True
###
# Enable latex for labels
f = open( sys.argv[1], 'r' )
current_sigma = 0.0
current_rho = 0.0
current_beta = 0.0
sigma_lst = []
rho_lst = []
beta_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
76,
29487,
18,
6... | 1.935813 | 1,371 |
from django.contrib import admin
from .models import Analysis
from .models import Mesh
from .models import Resin
from .models import Preform
from .models import Section
from .models import Step
from .models import BC
admin.site.register(Analysis)
admin.site.register(Mesh)
admin.site.register(Resin)
admin.site.register... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
14691,
198,
6738,
764,
27530,
1330,
47529,
198,
6738,
764,
27530,
1330,
1874,
259,
198,
6738,
764,
27530,
1330,
3771,
687,
198,
6738,
764,
27530,
1330,
7275,
1... | 3.436975 | 119 |
# Desired capabilities example file for LambdaTest
# Generate from https://www.lambdatest.com/capabilities-generator/
capabilities = {
"build": "your build name",
"name": "your test name",
"platform": "Windows 11",
"browserName": "Chrome",
"version": "100.0",
}
| [
2,
2935,
1202,
9889,
1672,
2393,
329,
21114,
6814,
14402,
198,
2,
2980,
378,
422,
3740,
1378,
2503,
13,
2543,
17457,
265,
395,
13,
785,
14,
11128,
5738,
12,
8612,
1352,
14,
198,
11128,
5738,
796,
1391,
198,
220,
220,
220,
366,
11249... | 2.848485 | 99 |
from app import db
from flask.ext.security import RoleMixin | [
6738,
598,
1330,
20613,
198,
6738,
42903,
13,
2302,
13,
12961,
1330,
20934,
35608,
259
] | 3.933333 | 15 |
import os, sys
# Link: https://github.com/spatialaudio/python-sounddevice/issues/11#issuecomment-155836787
'''
It seems to work by running this before each PortAudio call:
devnull = os.open(os.devnull, os.O_WRONLY)
old_stderr = os.dup(2)
sys.stderr.flush()
os.dup2(devnull, 2)
os.close(devnull)
and this immediately ... | [
11748,
28686,
11,
25064,
628,
198,
2,
7502,
25,
3740,
1378,
12567,
13,
785,
14,
2777,
34961,
24051,
14,
29412,
12,
23661,
25202,
14,
37165,
14,
1157,
2,
21949,
23893,
12,
1314,
3365,
2623,
41019,
198,
7061,
6,
198,
1026,
2331,
284,
... | 2.463277 | 177 |
import Fan
from PyQt5 import QtCore, QtGui, QtWidgets
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())
| [
198,
11748,
13836,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1330,
25064,
1... | 2.275591 | 127 |
from client_lib.servercall import login, remote_call, ServerLoginError, ServerCallException
import getpass
import sys
username = raw_input("Username: ")
old_pass = getpass.getpass("Old password: ")
try:
login(username, old_pass)
except ServerLoginError:
print >> sys.stderr, "Kon niet inloggen met gegeven gebr... | [
6738,
5456,
62,
8019,
13,
15388,
13345,
1330,
17594,
11,
6569,
62,
13345,
11,
9652,
47790,
12331,
11,
9652,
14134,
16922,
198,
11748,
651,
6603,
198,
11748,
25064,
198,
198,
29460,
796,
8246,
62,
15414,
7203,
5842,
13292,
25,
366,
8,
... | 2.679842 | 253 |
import unittest
import os
from pyPostcode import Api, pyPostcodeException
| [
11748,
555,
715,
395,
198,
11748,
28686,
198,
198,
6738,
12972,
6307,
8189,
1330,
5949,
72,
11,
12972,
6307,
8189,
16922,
628
] | 3.454545 | 22 |
#!/usr/bin/python
import os
import sys
from PIL import Image, ImageColor
import colorsys
#Usage:
# ./draw_scan.py scan_data disk_size img.png [dimx dimy]
color_cache = dict()
colors = [ "orange", 'white', "red", "green", "blue",
"gray", "yellow", "purple", 'magenta', 'lime',
'teal', 'aqua', 'navy', 'olive', 'maro... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
10258,
198,
11748,
7577,
893,
198,
198,
2,
28350,
25,
198,
2,
24457,
19334,
62,
35836,
13,
9078,
9367,
62,
7890,
... | 2.132242 | 794 |
from tests.conftest import (
common_config, multi_agent_episode_runner, pf_config,
multicomponent_building_config
)
from tests.agents.conftest import (
ev_charging_config, pv_config, pv_array_config, energy_storage_config)
from gridworld import MultiAgentEnv, MultiComponentEnv
from gridworld.agents.vehicl... | [
6738,
5254,
13,
1102,
701,
395,
1330,
357,
198,
220,
220,
220,
2219,
62,
11250,
11,
5021,
62,
25781,
62,
38668,
62,
16737,
11,
279,
69,
62,
11250,
11,
220,
198,
220,
220,
220,
47368,
3361,
3471,
62,
16894,
62,
11250,
198,
8,
198,
... | 2.322357 | 1,154 |
import lxml
import requests
from lxml import etree
from lxml.html import fromstring, tostring
with open('text5.html', 'w', encoding="utf-8") as outputFile:
url = "http://inosmi.ru/russia/20150508/227923804.html"
r = requests.get(url.strip())
html = lxml.html.fromstring(r.text)
text = etree.tounicode(ht... | [
11748,
300,
19875,
198,
11748,
7007,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
6738,
300,
19875,
13,
6494,
1330,
422,
8841,
11,
284,
8841,
198,
198,
4480,
1280,
10786,
5239,
20,
13,
6494,
3256,
705,
86,
3256,
21004,
2625,
40477,
12... | 2.50655 | 229 |
# This is an file containing different functions that extracts information from a executable file.
import sys | [
2,
770,
318,
281,
2393,
7268,
1180,
5499,
326,
32139,
1321,
422,
257,
28883,
2393,
13,
198,
198,
11748,
25064
] | 5.5 | 20 |
from output.models.nist_data.atomic.nmtoken.schema_instance.nistschema_sv_iv_atomic_nmtoken_enumeration_4_xsd.nistschema_sv_iv_atomic_nmtoken_enumeration_4 import (
NistschemaSvIvAtomicNmtokenEnumeration4,
NistschemaSvIvAtomicNmtokenEnumeration4Type,
)
__all__ = [
"NistschemaSvIvAtomicNmtokenEnumeration4",... | [
6738,
5072,
13,
27530,
13,
77,
396,
62,
7890,
13,
47116,
13,
77,
16762,
4233,
13,
15952,
2611,
62,
39098,
13,
77,
1023,
2395,
2611,
62,
21370,
62,
452,
62,
47116,
62,
77,
16762,
4233,
62,
268,
6975,
341,
62,
19,
62,
87,
21282,
1... | 2.239521 | 167 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# -- prioritized --
import sys
import os.path
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
# -- stdlib --
from collections import Counter
import os
import json
import sys
import time
# -- third party --
import requests
# -- own --
# -- code --
ts = int(ti... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
1377,
19086,
1143,
1377,
198,
11748,
25064,
198,
11748,
28686,
13,
6978,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13... | 2.04325 | 763 |
#!/usr/bin/env python3
# coding=utf-8
"""
@author: guoyanfeng
@software: PyCharm
@time: 18-12-25 下午3:56
"""
import atexit
from collections.abc import MutableMapping, MutableSequence
from typing import Dict, List, Optional, Tuple, Union
import aelog
from pymongo import MongoClient as MongodbClient
from pymongo.databa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
37811,
198,
31,
9800,
25,
915,
726,
272,
69,
1516,
198,
31,
43776,
25,
9485,
1925,
1670,
198,
31,
2435,
25,
1248,
12,
1065,
12,
1495,
2... | 1.798959 | 10,754 |
token = None
baseurl = "https://besistudy.org/api/v1"
import milkmaid.api
from milkmaid.resource import (
MementoEvent,
AthenaNotification,
AthenaNotifyType
)
| [
30001,
796,
6045,
198,
8692,
6371,
796,
366,
5450,
1378,
12636,
396,
463,
88,
13,
2398,
14,
15042,
14,
85,
16,
1,
198,
198,
11748,
7545,
23151,
13,
15042,
198,
198,
6738,
7545,
23151,
13,
31092,
1330,
357,
198,
220,
220,
220,
337,
... | 2.621212 | 66 |
# Cleans plain text into arrays of words
# Reads comma separated file
# Compares arrays of words and calculates a score
# Classifies one or bulks of emails
# Imports hidden at the bottom
import os
import csv
import glob
import nltk
import string
nltk.download('punkt')
nltk.download('stopwords')
... | [
201,
198,
2,
3779,
504,
8631,
2420,
656,
26515,
286,
2456,
201,
198,
201,
198,
2,
4149,
82,
39650,
11266,
2393,
201,
198,
201,
198,
2,
3082,
3565,
26515,
286,
2456,
290,
43707,
257,
4776,
201,
198,
201,
198,
2,
5016,
6945,
530,
39... | 2.818182 | 209 |
"""Tests the Bounce API."""
import json
from bounce.server.api import util
| [
37811,
51,
3558,
262,
41474,
7824,
526,
15931,
198,
198,
11748,
33918,
198,
198,
6738,
20110,
13,
15388,
13,
15042,
1330,
7736,
628,
628,
628,
198
] | 3.192308 | 26 |
'''
Add or remove a program from a user's startup sequence.
>>> import startup
>>> startup.enable('c:\\Program Files\\Digsby\\digsby.exe', 'Digsby', 'extra', 'args')
Implemented for Windows and Mac OS X.
'''
import platform, os.path
from logging import getLogger, StreamHandler
log = getLogger('startup')
log.addHandl... | [
7061,
6,
198,
4550,
393,
4781,
257,
1430,
422,
257,
2836,
338,
13693,
8379,
13,
198,
198,
33409,
1330,
13693,
198,
33409,
13693,
13,
21633,
10786,
66,
25,
6852,
15167,
13283,
6852,
35,
9235,
1525,
6852,
67,
9235,
1525,
13,
13499,
3256... | 2.792279 | 544 |
#-*-coding: utf-8 -*-
"""
/mediasurvey/models.py
.. beschreibt die Datenbankstrukturen des Medien-Fragebogens
Django content Management System
Hans Rauch
hans.rauch@gmx.net
Die Programme des dms-Systems koennen frei genutzt und den spezifischen
Beduerfnissen entsprechend angepasst werden.
0.01 19.04.20... | [
2,
12,
9,
12,
66,
7656,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
14,
2379,
292,
333,
3304,
14,
27530,
13,
9078,
198,
198,
492,
7284,
354,
260,
571,
83,
4656,
16092,
268,
17796,
19554,
21841,
23532,
748,
2019,
2013,
12,... | 2.219866 | 2,688 |
# problem name: Minimum Number of Operations to Reinitialize a Permutation
# problem link: https://leetcode.com/contest/weekly-contest-234/problems/minimum-number-of-operations-to-reinitialize-a-permutation/
# contest link: https://leetcode.com/contest/weekly-contest-234/
# time: (?)
# author: reyad
# other_tags: (?)... | [
2,
1917,
1438,
25,
26265,
7913,
286,
16205,
284,
22299,
6847,
1096,
257,
2448,
76,
7094,
198,
2,
1917,
2792,
25,
3740,
1378,
293,
316,
8189,
13,
785,
14,
3642,
395,
14,
45291,
12,
3642,
395,
12,
24409,
14,
1676,
22143,
14,
39504,
... | 3.052174 | 115 |
import boto3
import datetime
import random
from elasticsearch import Elasticsearch, RequestsHttpConnection
from aws_requests_auth.aws_auth import AWSRequestsAuth
cred = boto3.session.Session().get_credentials()
es_host = 'search-test-qc-nnfncq57wg3kmkpwuaj3t2nkoa.ap-southeast-2.es.amazonaws.com'
auth = AWSRequestsAuth... | [
11748,
275,
2069,
18,
198,
11748,
4818,
8079,
198,
11748,
4738,
198,
6738,
27468,
12947,
1330,
48567,
12947,
11,
9394,
3558,
43481,
32048,
198,
6738,
3253,
82,
62,
8897,
3558,
62,
18439,
13,
8356,
62,
18439,
1330,
30865,
16844,
3558,
30... | 2.467213 | 244 |
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | [
2,
15069,
2177,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
198,
2,
743,
407,
779,
428,
2393,
... | 2.76035 | 3,430 |
import torch
import numpy
import environment as env
from environment import get_valid_directions, move, prettyprint
device = torch.device('cuda') if torch.cuda.is_available() else torch.device('cpu')
batch_size = 16
discount = 0.8
learnrate = 0.02
epochs = 100
simulations = 10
max_steps = 50
with_baseline = True
... | [
11748,
28034,
198,
11748,
299,
32152,
198,
11748,
2858,
355,
17365,
198,
198,
6738,
2858,
1330,
651,
62,
12102,
62,
12942,
507,
11,
1445,
11,
2495,
4798,
628,
198,
198,
25202,
796,
28034,
13,
25202,
10786,
66,
15339,
11537,
611,
28034,
... | 2.743707 | 1,311 |
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This module is for build-ahead related operations.
It provides functions for:
* Triggering a build-ahead on a specific builder.
"""
import json
import l... | [
2,
15069,
2864,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
37811,
121... | 2.99311 | 4,064 |
# This is a "configuration" file for the Locust load tester. http://locust.io
# Quick Start:
# * pip3 install locust
# * cd into the directory containing this file
# * locust
# * go to http://localhost:8089
import time
from locust import HttpUser, task, between
| [
2,
770,
318,
257,
366,
11250,
3924,
1,
2393,
329,
262,
15181,
436,
3440,
256,
7834,
13,
2638,
1378,
17946,
436,
13,
952,
198,
198,
2,
12029,
7253,
25,
198,
2,
220,
220,
1635,
7347,
18,
2721,
1179,
436,
198,
2,
220,
220,
1635,
22... | 3.090909 | 88 |
import json
from jinja2 import Template
if __name__ == '__main__':
api_config()
choice = None
while (choice != 99):
print '------------------- Welcome to Sportia Api Setup ----------------------'
print '1. Google+ Api'
print '2. Facebook Api'
print '99. Exit'
... | [
11748,
33918,
198,
198,
6738,
474,
259,
6592,
17,
1330,
37350,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
40391,
62,
11250,
3419,
628,
220,
220,
220,
3572,
796,
6045,
198,
... | 2.42236 | 483 |
"""
Pratt parser for infix expressions
http://eli.thegreenplace.net/2010/01/02/top-down-operator-precedence-parsing/
# TODO: see if any ideas from precedence_climbing.py can improve this
# or vice-versa
"""
import re
## parse('1+2*3+4')
#. 11
| [
37811,
198,
6836,
1078,
30751,
329,
1167,
844,
14700,
198,
4023,
1378,
43733,
13,
1169,
14809,
5372,
13,
3262,
14,
10333,
14,
486,
14,
2999,
14,
4852,
12,
2902,
12,
46616,
12,
3866,
771,
594,
12,
79,
945,
278,
14,
198,
2,
16926,
4... | 2.587629 | 97 |
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 2 23:40:34 2017
@author: iwatts
"""
import pickle
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
import time
from skimage.feature import hog
from sklearn.preprocessing import StandardScaler
from sklearn impor... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
2892,
2556,
220,
362,
2242,
25,
1821,
25,
2682,
2177,
201,
198,
201,
198,
31,
9800,
25,
1312,
86,
30353,
201,
198,
37811,
201,
198,
... | 2.329809 | 2,459 |
__author__ = 'Aleksandar Gyorev'
__email__ = 'a.gyorev@jacobs-university.de'
import cv2
import numpy as np | [
834,
9800,
834,
796,
705,
37474,
591,
392,
283,
18488,
382,
85,
6,
198,
834,
12888,
834,
220,
796,
705,
64,
13,
1360,
382,
85,
31,
30482,
8158,
12,
403,
1608,
13,
2934,
6,
198,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
35... | 2.347826 | 46 |
import yaml
# tokenizer-pre_tokenizers
from tokenizers.pre_tokenizers import (
PreTokenizer,
ByteLevel,
Whitespace,
WhitespaceSplit,
BertPreTokenizer,
Metaspace,
CharDelimiterSplit,
Punctuation,
Sequence,
Digits,
UnicodeScripts,
Split,
)
# tokenizer-normalizers
from tok... | [
11748,
331,
43695,
198,
198,
2,
11241,
7509,
12,
3866,
62,
30001,
11341,
198,
6738,
11241,
11341,
13,
3866,
62,
30001,
11341,
1330,
357,
198,
220,
220,
220,
3771,
30642,
7509,
11,
198,
220,
220,
220,
30589,
4971,
11,
198,
220,
220,
... | 2.789216 | 204 |
# Evaluate the perfomance of trained network by evaluating intersection over union (IOU) of the network predcition
# and ground truth of the validation set
# 1) Make sure you you have trained model in logs_dir (See Train.py for creating trained model)
# 2) Set the Image_Dir to the folder where the input images for pre... | [
2,
26439,
4985,
262,
23035,
296,
590,
286,
8776,
3127,
416,
22232,
16246,
625,
6441,
357,
40,
2606,
8,
286,
262,
220,
3127,
2747,
66,
653,
198,
2,
290,
2323,
3872,
286,
262,
21201,
900,
198,
2,
352,
8,
6889,
1654,
345,
345,
423,
... | 4.708812 | 522 |
# -*- encoding: utf-8 -*-
import pytest
from django.core.urlresolvers import reverse
from django.test import TestCase
from contact.tests.factories import ContactFactory, UserContactFactory
from crm.tests.factories import CrmContactFactory, TicketFactory
from login.tests.factories import TEST_PASSWORD, UserFactory
fro... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
28... | 3.341085 | 129 |
# https://docs.djangoproject.com/en/1.6/intro/tutorial03/
from django.conf import settings
from django.conf.urls import include, url
import views
if settings.IS_PUBLIC:
urlpatterns = [
#url(r'^api/', include('api.urls')),
#url(r'^rest/', include('REST.urls')),
url(r'^$', views.hem_landing_... | [
2,
220,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
268,
14,
16,
13,
21,
14,
600,
305,
14,
83,
44917,
3070,
14,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
... | 2.184652 | 417 |
# -*- coding: utf-8 -*-
RESEARCH_ORG_DOMAINS = {
'niper.ac.in': [u'National Institute of Pharmaceutical Education and Research'],
'nyumc.org': [u'NYU Langone Medical Center'],
'coh.org': [u'Beckman Research Institute'],
'embl.de': [u'European Molecular Biology Laboratory'],
'erasmusmc.nl': [u'Erasm... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
19535,
17133,
3398,
62,
1581,
38,
62,
39170,
32,
20913,
796,
1391,
198,
220,
220,
220,
705,
45554,
13,
330,
13,
259,
10354,
685,
84,
6,
16186,
5136,
286,
37175,
... | 2.427673 | 636 |
import paystacklib
from paystacklib.base.baseapi import BaseApi
from paystacklib.util.utils import clean_params
| [
11748,
1414,
25558,
8019,
198,
6738,
1414,
25558,
8019,
13,
8692,
13,
8692,
15042,
1330,
7308,
32,
14415,
198,
6738,
1414,
25558,
8019,
13,
22602,
13,
26791,
1330,
3424,
62,
37266,
628,
198
] | 3.454545 | 33 |
"""
An example script which lists all available bluetooth devices. Use this to obtain the device_address used in other
scripts
"""
import nest_asyncio
nest_asyncio.apply()
import asyncio
from bleak import discover
if __name__ == "__main__":
import os
os.environ["PYTHONASYNCIODEBUG"] = str(1)
loop = a... | [
37811,
198,
2025,
1672,
4226,
543,
8341,
477,
1695,
48208,
16271,
4410,
13,
5765,
428,
284,
7330,
262,
3335,
62,
21975,
973,
287,
584,
198,
46521,
198,
37811,
198,
198,
11748,
16343,
62,
292,
13361,
952,
198,
77,
395,
62,
292,
13361,
... | 2.937984 | 129 |
from .transition import Transition
from .deadtransition import DeadTransition
from .functiontransition import FunctionTransition
| [
6738,
764,
7645,
653,
1330,
40658,
198,
6738,
764,
25124,
7645,
653,
1330,
5542,
8291,
653,
198,
6738,
764,
8818,
7645,
653,
1330,
15553,
8291,
653,
198
] | 4.777778 | 27 |
import matplotlib.pyplot as plt
import numpy as np
import tikzplotlib as tpl
###############################################################################
## MANNEVILLE-POMEAU by Tom Conti-Leslie MIT License ##
## invariant_density_notquite.py ##
##... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
256,
1134,
89,
29487,
8019,
355,
256,
489,
198,
198,
29113,
29113,
7804,
4242,
21017,
198,
2235,
220,
17254,
12161,
38526,
12,
47,
... | 2.377133 | 1,758 |
#!/usr/bin/python
#-----------------------------------------------------
# Apply a mapPartitions() transformation to an RDD
# Input: NONE
#------------------------------------------------------
# Input Parameters:
# NONE
#-------------------------------------------------------
# @author Mahmoud Parsian
#------------... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
3880,
19351,
12,
198,
2,
27967,
257,
3975,
7841,
1756,
3419,
13389,
284,
281,
371,
16458,
198,
2,
23412,
25,
399,
11651,
198,
2,
3880,
19351,
438,
198,
2,
23412,
40117,
25,
198,
2,
220... | 3.099507 | 1,216 |
import sys,os
sys.path.append(os.getcwd())
config = {
"virgil_fs": {"local": "{{ cookiecutter.data_lake_path }}", "databricks": "dbfs:/jobs/"},
"file-checkpoint-dir": {"local": "{{ cookiecutter.data_lake_path }}/checkpoint-dirs/file", "databricks": "/mnt/raw/_checkpoints/file/"},
"json-input-data": {"local... | [
11748,
25064,
11,
418,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
1136,
66,
16993,
28955,
198,
198,
11250,
796,
1391,
198,
220,
220,
220,
366,
37040,
37718,
62,
9501,
1298,
19779,
12001,
1298,
366,
27007,
19751,
8968,
353,
13,
7890,... | 2.620985 | 467 |
#!/usr/bin/env python
"""
Example usage of argparse library
https://fabianlee.org/2019/09/14/python-parsing-command-line-arguments-with-argparse/
USAGE
./argParseTest2.py 3 4
./argParseTest2.py 3 4 --op=mul
"""
import sys
import argparse
def show_math_result(a, b, op="add", upper=False):
"""perform math op... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
17934,
8748,
286,
1822,
29572,
5888,
628,
3740,
1378,
36434,
666,
7197,
13,
2398,
14,
23344,
14,
2931,
14,
1415,
14,
29412,
12,
79,
945,
278,
12,
21812,
12,
1370,
12,
853... | 2.4375 | 240 |
# -*- coding:utf-8 -*-
import requests
import json, re
if __name__ == '__main__':
kr36 = Kr36()
kr36.run()
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
7007,
198,
11748,
33918,
11,
302,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
479,
81,
2623,
796,
13685,
2623,
3419,... | 2.145455 | 55 |
import json
from contextlib import contextmanager
from unittest.mock import patch
import jwt
from tornado import gen
from tornado.concurrent import Future
from tornado.httpclient import HTTPRequest, HTTPError
from tornado.testing import AsyncHTTPTestCase, LogTrapTestCase, gen_test
from tornado.websocket import webso... | [
11748,
33918,
198,
198,
6738,
4732,
8019,
1330,
4732,
37153,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
11748,
474,
46569,
198,
198,
6738,
33718,
1330,
2429,
198,
6738,
33718,
13,
1102,
14421,
1330,
10898,
198,
6738,
... | 2.360201 | 5,980 |
# pylint: disable=g-bad-file-header
# Copyright 2016 The TensorFlow 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://www.apache.org/licenses/LICENS... | [
2,
279,
2645,
600,
25,
15560,
28,
70,
12,
14774,
12,
7753,
12,
25677,
198,
2,
15069,
1584,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,... | 2.548137 | 5,287 |
# Copyright 2020 Dougal Seeley <github@dougalseeley.com>
# https://github.com/dseeley/ebsmap
# Copyright 2017 Amazon.com, Inc. and its affiliates. All Rights Reserved.
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the ... | [
2,
15069,
12131,
5728,
13528,
4091,
1636,
1279,
12567,
31,
67,
20805,
2820,
68,
1636,
13,
785,
29,
198,
2,
3740,
1378,
12567,
13,
785,
14,
67,
3826,
1636,
14,
68,
1443,
8899,
198,
198,
2,
15069,
2177,
6186,
13,
785,
11,
3457,
13,
... | 1.986085 | 1,581 |
import matplotlib.pyplot as plt
import numpy as np
import pprint
from ml.datasets.blobs import Blobs
from ml.models.random_forest import RandomForest
from ml.metrics.classification import ClassificationMetrics
from ml.metrics.regression import RegressionMetrics
is_classification = True
dataset = Blobs()
... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
279,
4798,
201,
198,
201,
198,
6738,
25962,
13,
19608,
292,
1039,
13,
2436,
8158,
1330,
1086,
8158,
201,
198,
6738,
259... | 2.290926 | 1,069 |
import pytest
from symbol_exporter.ast_package_symbol_extractor import DirectorySymbolFinder
from symbol_exporter.ast_symbol_extractor import SymbolType
expected = {
"numpy.version": {"type": SymbolType.MODULE, "data": {"symbols_in_volume": {"os": {"line number": [1]}}}},
"numpy.version.get_versions": {"type"... | [
11748,
12972,
9288,
198,
198,
6738,
6194,
62,
1069,
26634,
13,
459,
62,
26495,
62,
1837,
23650,
62,
2302,
40450,
1330,
27387,
13940,
23650,
37,
5540,
198,
6738,
6194,
62,
1069,
26634,
13,
459,
62,
1837,
23650,
62,
2302,
40450,
1330,
3... | 2.184529 | 2,314 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
... | 3.669145 | 269 |
#!/usr/bin/env python
import unittest
import socket
import binascii
import time
from framework import VppTestCase, VppTestRunner
from scapy.packet import Raw
from scapy.layers.l2 import Ether
from scapy.layers.inet import IP, UDP
from scapy.utils import hexdump
from util import ppp
class TestFlowperpkt(VppTestCase)... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
555,
715,
395,
198,
11748,
17802,
198,
11748,
9874,
292,
979,
72,
198,
11748,
640,
198,
198,
6738,
9355,
1330,
569,
381,
14402,
20448,
11,
569,
381,
14402,
49493,
198,
198,... | 1.946227 | 4,519 |
import os
import intake
from rubicon.intake_rubicon.project import ProjectSource
intake.register_driver("rubicon_project", ProjectSource)
root = os.path.dirname(__file__)
project_name = "intake-rubicon unit testing"
| [
11748,
28686,
198,
198,
11748,
10337,
198,
198,
6738,
6437,
4749,
13,
600,
539,
62,
25089,
4749,
13,
16302,
1330,
4935,
7416,
198,
198,
600,
539,
13,
30238,
62,
26230,
7203,
25089,
4749,
62,
16302,
1600,
4935,
7416,
8,
198,
198,
15763... | 3.171429 | 70 |
""" Evaluation script for EntailmentBank models. """
import argparse
import glob
import logging
import json
import os
import re
import sys
from bleurt import score
from tqdm import tqdm
sys.path.append(os.path.join(os.getcwd())) # noqa: E402 # isort:skip
from utils.angle_utils import decompose_slots, load_jsonl, s... | [
37811,
34959,
4226,
329,
7232,
603,
434,
28650,
4981,
13,
37227,
198,
198,
11748,
1822,
29572,
198,
11748,
15095,
198,
11748,
18931,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
6738,
7245,
3325,
1330,
47... | 2.631455 | 426 |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A continuous builder which runs recipe tests."""
from recipe_engine.recipe_api import Property
DEPS = [
'depot_tools/bot_update',
'depot_tools/gclien... | [
2,
15069,
1584,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
37811,
32,... | 2.984906 | 265 |
# Generated by Django 2.2.10 on 2020-02-21 21:27
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
940,
319,
12131,
12,
2999,
12,
2481,
2310,
25,
1983,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.875 | 32 |
"""
`plane`, `rake`, `line`, etc all allow plotting of multiple measurements.
"""
import matplotlib.pyplot as plt
import mplstereonet
# Make a figure with a single stereonet axes
fig, ax = mplstereonet.subplots()
# These follow the right hand rule to indicate dip direction
strikes = [22, 317, 170, 220]
dips = [10, 20... | [
37811,
198,
63,
14382,
47671,
4600,
33788,
47671,
4600,
1370,
47671,
3503,
477,
1249,
29353,
286,
3294,
13871,
13,
198,
37811,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
285,
489,
301,
567,
36823,
198,
198... | 2.843373 | 166 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-12-19 09:50
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
23,
319,
13130,
12,
1065,
12,
1129,
7769,
25,
1120,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.73913 | 69 |
# -*- coding: utf-8 -*-
"""Elastic Net regression with nested cross validation module.
This workflow trains an elastic net model for a binary classification task
(e.g., tumor vs. normal patients). The training is conducted using a nested
cross validation approach (the number of cross validation in both loops can
be s... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
9527,
3477,
3433,
20683,
351,
28376,
3272,
21201,
8265,
13,
198,
198,
1212,
30798,
13404,
281,
27468,
2010,
2746,
329,
257,
13934,
17923,
4876,
198,
7,
68,
1... | 2.723711 | 1,940 |
from copy import copy
from datetime import timedelta
import django_tables2 as tables
from django.contrib import messages
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.auth.mixins import UserPassesTestMixin
from django.c... | [
6738,
4866,
1330,
4866,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
11748,
42625,
14208,
62,
83,
2977,
17,
355,
8893,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
... | 3.054659 | 1,921 |
from sys import stdin
for cn in xrange(1, 1 + int(stdin.readline())):
[N, M] = [int(z) for z in stdin.readline().split()]
A = [int(z) for z in stdin.readline().split()]
B = [int(z) for z in stdin.readline().split()]
A = summarize(A)
B = summarize(B)
N = len(A) / 2
M = len(B) / 2
A = [A[... | [
6738,
25064,
1330,
14367,
259,
198,
198,
1640,
269,
77,
287,
2124,
9521,
7,
16,
11,
352,
1343,
493,
7,
19282,
259,
13,
961,
1370,
28955,
2599,
198,
220,
220,
220,
685,
45,
11,
337,
60,
796,
685,
600,
7,
89,
8,
329,
1976,
287,
... | 1.65113 | 708 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
from page.webpage import WebPage, sleep
from common.readelement import Element
search = Element('search')
class SearchPage(WebPage):
"""搜索类"""
def input_search(self, content):
"""输入搜索"""
self.input_text(search['搜索框'], txt=content)
sleep()... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
6738,
2443,
13,
12384,
7700,
1330,
5313,
9876,
11,
3993,
198,
6738,
2219,
13,
260,
671,
1732,
1330,
11703,
198,
198,
... | 1.899666 | 299 |
#-*-coding:utf-8-*-
"""快速排序:是对冒泡排序的一种改进。"""
from datetime import datetime
import random
# 生成一个随机数组
array = []
for x in range(0,10000):
array.append(random.randint(0,100000))
# 快速排序
start = datetime.now().microsecond# 开始时间
print(quicksort(array,0,len(array)-1)[:100])# 输出前一百个
end = datetime.now().micros... | [
2,
12,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
201,
198,
37811,
33232,
104,
34460,
253,
162,
236,
240,
41753,
237,
171,
120,
248,
42468,
43380,
117,
161,
10253,
37345,
94,
162,
236,
240,
41753,
237,
21410,
31660,
163,
100,
... | 1.545455 | 242 |
def get_dynamic_db_settings(server_root, username, password, dbname, installed_apps):
"""
Get dynamic database settings. Other apps can use this if they want to change
settings
"""
server = get_server_url(server_root, username, password)
database = "%(server)s/%(database)s" % {"server": se... | [
628,
198,
198,
4299,
651,
62,
67,
28995,
62,
9945,
62,
33692,
7,
15388,
62,
15763,
11,
20579,
11,
9206,
11,
20613,
3672,
11,
6589,
62,
18211,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3497,
8925,
6831,
6460,
13,
220,
38... | 2.652439 | 164 |
# -*- coding: utf-8 -*-
import requests
try:
# if Python 3.X.X
from urllib.parse import urlparse
except ImportError:
# if Python 2.X.X
from urlparse import urlparse
def verify_url(url):
"""
Verify the URl.
Args:
url (str): URL to verify
Returns:
bool: True if URL is ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
7007,
198,
198,
28311,
25,
198,
220,
220,
220,
1303,
611,
11361,
513,
13,
55,
13,
55,
198,
220,
220,
220,
422,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
... | 2.193548 | 403 |
__all__ = []
| [
834,
439,
834,
796,
17635,
201,
198,
201,
198
] | 1.777778 | 9 |
#!/usr/bin/env python
import socket
import time
import csv
OUTPUT_NAMES = ['Time', 'T1FX', 'T1FY', 'T1FZ', 'T1TX', 'T1TY', 'T1TZ']
if __name__ == '__main__':
try:
l = Listener()
l.start()
except:
pass | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
17802,
198,
11748,
640,
198,
11748,
269,
21370,
198,
198,
2606,
7250,
3843,
62,
45,
29559,
796,
37250,
7575,
3256,
705,
51,
16,
17213,
3256,
705,
51,
16,
43833,
3256,
705,
51,
... | 1.950413 | 121 |
from setuptools import find_packages, setup
setup(
name='the_keyspy',
packages=find_packages(include=('the_keyspy*',)),
version='0.0.9',
description='The Keys Api',
author='Kevin Bonnoron',
author_email='kevin.bonnoron@gmail.com',
url='https://github.com/KevinBonnoron',
download_url='ht... | [
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
1169,
62,
13083,
9078,
3256,
198,
220,
220,
220,
10392,
28,
19796,
62,
43789,
7,
17256,
28,
10786,
1169,
62,
13083,
9078,
... | 2.450644 | 233 |
#Import libraries
import pandas as pd
| [
2,
20939,
12782,
198,
11748,
19798,
292,
355,
279,
67,
198
] | 3.454545 | 11 |
import os
from flask import Flask, render_template, flash
from forms import AddBookForm
from books import add_book, lookup_isbn
app = Flask(__name__)
app.config['SECRET_KEY'] = (os.environ.get('GAE_APPLICATION', 'super') +
os.environ.get('GAE_DEPLOYMENT_ID', 'secret'))
@app.route('/boo... | [
11748,
28686,
198,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
7644,
198,
198,
6738,
5107,
1330,
3060,
10482,
8479,
198,
6738,
3835,
1330,
751,
62,
2070,
11,
35847,
62,
271,
9374,
198,
198,
1324,
796,
46947,
7,
834,
3672,
... | 2.356757 | 185 |