content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""
Generate data to simulate a study, e.g. to test ingest or download features.
DESCRIPTION
This data is similar to real data in structure and basic statistics (e.g.
sparseness), but is biologically meaningless.
EXAMPLES
# Generate 3 dense matrix files, 25 MB each
python make_toy_data.py
# Generate 6 dense matrix f... | [
37811,
198,
8645,
378,
1366,
284,
29308,
257,
2050,
11,
304,
13,
70,
13,
284,
1332,
26151,
393,
4321,
3033,
13,
198,
198,
30910,
40165,
198,
1212,
1366,
318,
2092,
284,
1103,
1366,
287,
4645,
290,
4096,
7869,
357,
68,
13,
70,
13,
... | 2.275879 | 8,221 |
"""
Based on https://gist.github.com/felixkreuk/8d70c8c1507fcaac6197d84a8a787fa0
"""
import spur
env = {
'USE_SIMPLE_THREADED_LEVEL3': '1',
'OMP_NUM_THREADS': '1',
}
ts = '/PATH-TO-DIR/ts-1.0/ts'
def parallelize(nodes_list, all_runs_args, run_script, on_gpu=False, dry_run=False):
"""
Running on a ... | [
37811,
198,
198,
15001,
319,
3740,
1378,
70,
396,
13,
12567,
13,
785,
14,
69,
417,
844,
74,
260,
2724,
14,
23,
67,
2154,
66,
23,
66,
8628,
22,
69,
6888,
330,
21,
24991,
67,
5705,
64,
23,
64,
41019,
13331,
15,
198,
37811,
198,
... | 2.174324 | 740 |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pandas as pd
import numpy as np
import seaborn as sns
from sklearn import preprocessing
from sklearn import metrics
from sklearn.metrics import r2_score
import warnings
import pickle
# import matplotlib.pyplot as plt
# %matplotlib inline
# In[ ]:
df = pd.rea... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
2361,
25,
628,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
384,
397,
1211,
355,
3013... | 2.34173 | 1,191 |
# Here are three different implementations for algorithms that solve the best trade problem.
# trade_dp is of time complexity O(n) and similar space complexity.
# trade_kadane is of time complexity O(n) and space complexity O(1).
# trade_kadane_correct is of time complexity O(n) and space complexity O(1).
# NOTE: trade... | [
2,
3423,
389,
1115,
1180,
25504,
329,
16113,
326,
8494,
262,
1266,
3292,
1917,
13,
198,
2,
3292,
62,
26059,
318,
286,
640,
13357,
440,
7,
77,
8,
290,
2092,
2272,
13357,
13,
198,
2,
3292,
62,
74,
324,
1531,
318,
286,
640,
13357,
... | 2.361111 | 576 |
#!/usr/bin/env python
# coding: utf-8
import os
import sys
import time
import re
import json
import commands
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
import color
import argparse
parser = argparse.ArgumentParser(description='This script is tasks automizer.')
parser.a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
302,
198,
11748,
33918,
198,
11748,
9729,
198,
6738,
26856,
13,
672,
2655,
690,
... | 2.658716 | 545 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
"""
The MetadataWizard(pymdwizard) software was developed by the
U.S. Geological Survey Fort Collins Science Center.
See: https://github.com/usgs/fort-pymdwizard for current project source code
See: https://usgs.github.io/fort-pymdwizard/ for current user documentation
See: ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
37811,
198,
464,
3395,
14706,
54,
8669,
7,
79,
4948,
67,
86,
8669,
8,
3788,
373,
4166,
416,
262,
198,
52,
13,
50,
13,
... | 3.767785 | 745 |
#!/usr/bin/python
with open('passes.txt') as fh:
lines = fh.readlines()
lines = [line.replace('B','1') for line in lines]
lines = [line.replace('F','0') for line in lines]
lines = [line.replace('R','1') for line in lines]
lines = [line.replace('L','0') for line in lines]
nums = [int(line,2) for line in lines]
pri... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
4480,
1280,
10786,
6603,
274,
13,
14116,
11537,
355,
277,
71,
25,
198,
220,
220,
220,
3951,
796,
277,
71,
13,
961,
6615,
3419,
198,
198,
6615,
796,
685,
1370,
13,
33491,
10786,
33,
4... | 2.7 | 160 |
import csv
import sys
REGISTERED_LABEL = 'Registered'
ATTENDEE_LABEL = 'Attendee'
if __name__ == '__main__':
args = sys.argv
if len(args) == 6:
args.append(None)
process(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5],
sys.argv[6])
| [
11748,
269,
21370,
198,
11748,
25064,
198,
198,
31553,
41517,
1961,
62,
48780,
3698,
796,
705,
47473,
6,
198,
17139,
10619,
6500,
62,
48780,
3698,
796,
705,
8086,
437,
1453,
6,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834... | 2.021127 | 142 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# tests/thread_safety.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
220,
5254,
14,
16663,
62,
44708,
13,
9078,
198,
2,
198,
2,
220,
2297,
396,
3890,
290,
779,
287,
27... | 3.362782 | 532 |
#coding:utf-8
#
# id: bugs.core_3362_complex
# title: Cursors should ignore changes made by the same statement
# decription:
# This test verifies PSQL issues that were accumulated in miscenaleous tickets.
#
# tracker_id: CORE-3362
# min_versions: ['3.0.1']
# versio... | [
2,
66,
7656,
25,
40477,
12,
23,
198,
2,
198,
2,
4686,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11316,
13,
7295,
62,
2091,
5237,
62,
41887,
198,
2,
3670,
25,
220,
220,
220,
220,
220,
220,
220,
327,
1834,
669,
815,
... | 2.061062 | 2,260 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
'''Tests for helper methods in webcompat/helpers.py.'''
import os.path
im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
770,
8090,
6127,
5178,
318,
2426,
284,
262,
2846,
286,
262,
29258,
5094,
198,
2,
13789,
11,
410,
13,
362,
13,
15... | 2.395801 | 1,905 |
# pylint: disable=missing-docstring
import unittest
import numpy as np
import tensorflow as tf
import tf_encrypted as tfe
if __name__ == '__main__':
unittest.main()
| [
2,
279,
2645,
600,
25,
15560,
28,
45688,
12,
15390,
8841,
198,
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
48700,
62,
43628,
355,
256,
5036,
628,
198,
198,
361,... | 2.85 | 60 |
"""To check if your projects are up-to-date, you can let dfetch check it.
For each project the local version (based on tag or revision) will be compared against
the available version. If there are new versions available this will be shown.
"""
import argparse
import os
import dfetch.commands.command
import dfetch.ma... | [
37811,
2514,
2198,
611,
534,
4493,
389,
510,
12,
1462,
12,
4475,
11,
345,
460,
1309,
47764,
7569,
2198,
340,
13,
198,
198,
1890,
1123,
1628,
262,
1957,
2196,
357,
3106,
319,
7621,
393,
18440,
8,
481,
307,
3688,
1028,
198,
1169,
1695... | 2.65458 | 524 |
from django.db import models
from djmoney.models.fields import MoneyField
from phonenumber_field.modelfields import PhoneNumberField
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
26316,
13,
27530,
13,
25747,
1330,
12911,
15878,
198,
6738,
32896,
268,
4494,
62,
3245,
13,
19849,
25747,
1330,
14484,
15057,
15878,
628,
628
] | 4 | 34 |
#!/usr/bin/env python
# Copyright (C) 2017 Udacity Inc.
#
# This file is part of Robotic Arm: Pick and Place project for Udacity
# Robotics nano-degree program
#
# All Rights Reserved.
# Author: Harsh Pandya
# import modules
import rospy
import tf
from kuka_arm.srv import *
from trajectory_msgs.msg import JointTrajec... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
357,
34,
8,
2177,
35774,
4355,
3457,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
3851,
6210,
7057,
25,
12346,
290,
8474,
1628,
329,
35774,
4355,
198,
2,
47061,
38706,
1... | 1.841463 | 1,394 |
# -*- coding: utf-8 -*-
"""
app.utils
~~~~~~~~~
Provides misc utility functions
"""
from __future__ import (
absolute_import, division, print_function, unicode_literals)
from json import loads, dumps
try:
from json.decoder import JSONDecodeError
except ImportError:
JSONDecodeError = ValueErro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
598,
13,
26791,
198,
220,
220,
220,
220,
15116,
93,
628,
220,
220,
220,
47081,
12747,
10361,
5499,
198,
37811,
198,
6738,
11593,
37443,
834,
... | 2.638208 | 2,120 |
# Code Listing #6
"""
Example with collections.deque for rotating sequences
"""
from collections import deque
def rotate_seq1(seq1, n):
""" Rotate a sequence left by n """
# E.g: rotate([1,2,3,4,5], 2) => [4,5,1,2,3]
k = len(seq1) - n
return seq1[k:] + seq1[:k]
def rotate_seq2(seq1, n):
"""... | [
2,
6127,
7343,
278,
1303,
21,
198,
198,
37811,
198,
198,
16281,
351,
17268,
13,
2934,
4188,
329,
24012,
16311,
198,
198,
37811,
198,
198,
6738,
17268,
1330,
390,
4188,
628,
198,
4299,
23064,
62,
41068,
16,
7,
41068,
16,
11,
299,
259... | 2.305556 | 180 |
### Basic NxN sliding puzzle solver
import numpy as np
# Switch pieces blank piece 16 up, down, left, or right if possible
| [
44386,
14392,
399,
87,
45,
22292,
15027,
1540,
332,
220,
198,
11748,
299,
32152,
355,
45941,
220,
628,
220,
220,
220,
1303,
14645,
5207,
9178,
3704,
1467,
510,
11,
866,
11,
1364,
11,
393,
826,
611,
1744,
220,
198
] | 3.384615 | 39 |
#!/usr/bin/env python
from my_devices import cisco3, arista1
from napalm import get_network_driver
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
616,
62,
42034,
1330,
269,
4861,
18,
11,
610,
12523,
16,
198,
6738,
25422,
38182,
1330,
651,
62,
27349,
62,
26230,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
... | 2.72549 | 51 |
import pytest
from dvc.cli import main
from dvc.lock import Lock, LockError
| [
11748,
12972,
9288,
198,
198,
6738,
288,
28435,
13,
44506,
1330,
1388,
198,
6738,
288,
28435,
13,
5354,
1330,
13656,
11,
13656,
12331,
628,
198
] | 3.16 | 25 |
# Generated by Django 3.1.2 on 2021-03-23 11:31
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
17,
319,
33448,
12,
3070,
12,
1954,
1367,
25,
3132,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
'''9. Write a Python program to get unique values from a list. '''
my_list = [10, 20, 30, 40, 20, 50, 60, 40]
print("Original List : ",my_list)
my_set = set(my_list)
my_new_list = list(my_set)
print("List of unique numbers : ",my_new_list) | [
7061,
6,
24,
13,
19430,
257,
11361,
1430,
284,
651,
3748,
3815,
422,
257,
1351,
13,
705,
7061,
198,
198,
1820,
62,
4868,
796,
685,
940,
11,
1160,
11,
1542,
11,
2319,
11,
1160,
11,
2026,
11,
3126,
11,
2319,
60,
198,
4798,
7203,
2... | 2.637363 | 91 |
"""Tests for the config module.
NOTE: If you intend to import Config and monkeypatch the config dir (you
should, to make it work) you need to ensure that you only import Config
inside your test function. Otherwise xdg.XDG_CONFIG_HOME will, in the
automated environment, fail to be evaluated and the tests will crash.
""... | [
37811,
51,
3558,
329,
262,
4566,
8265,
13,
198,
198,
16580,
25,
1002,
345,
14765,
284,
1330,
17056,
290,
21657,
17147,
262,
4566,
26672,
357,
5832,
198,
21754,
11,
284,
787,
340,
670,
8,
345,
761,
284,
4155,
326,
345,
691,
1330,
170... | 2.722934 | 2,263 |
#!/usr/bin/env python
import random
x = 1
seq = [0,1,2,3,4,5,6,7,8,9]
for i in seq:
x = random.randint(0,1)
x_str = str(x)
print("x_str" + " is " + x_str)
print("Done!")
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
220,
198,
11748,
4738,
198,
87,
796,
352,
198,
41068,
796,
685,
15,
11,
16,
11,
17,
11,
18,
11,
19,
11,
20,
11,
21,
11,
22,
11,
23,
11,
24,
60,
198,
1640,
1312,
287,
33756,
25,
19... | 1.848485 | 99 |
from enum import Enum
| [
6738,
33829,
1330,
2039,
388,
628
] | 3.833333 | 6 |
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
data_path = "data/raw/titanic.csv"
| [
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
7890,
62,
6978,
796,
366,
7890,
14,
1831,
14,
83,
18642,
291,
13,
40664,
1,
198
] | 2.690476 | 42 |
import sys
import os.path
import shutil
import glob
import pyspark
from pyspark import SparkConf, SparkContext, SQLContext
from pprint import pprint
try:
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from awsglue.context import GlueContext
from awsglue.dynamicframe impor... | [
11748,
25064,
198,
11748,
28686,
13,
6978,
198,
11748,
4423,
346,
198,
11748,
15095,
198,
11748,
279,
893,
20928,
198,
6738,
279,
893,
20928,
1330,
17732,
18546,
11,
17732,
21947,
11,
16363,
21947,
198,
6738,
279,
4798,
1330,
279,
4798,
... | 2.95302 | 149 |
from django.shortcuts import render
from django.db.models import Q
from api.v1.tools.paginator import customPagination
# serializers imports
from django.utils import timezone
from datetime import datetime
from django.db import DatabaseError, transaction
from django.db import IntegrityError, transaction
from django.con... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
40391,
13,
85,
16,
13,
31391,
13,
79,
363,
20900,
1330,
2183,
47,
363,
1883,
198,
2,
11389,
11341,
17944,
198,
6738... | 3.823529 | 272 |
from pyramda.function.curry import curry
import builtins
@curry
| [
6738,
12972,
859,
6814,
13,
8818,
13,
66,
16682,
1330,
34611,
198,
11748,
3170,
1040,
628,
198,
31,
66,
16682,
198
] | 3.142857 | 21 |
# Generated by Django 2.1.4 on 2018-12-13 18:29
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
19,
319,
2864,
12,
1065,
12,
1485,
1248,
25,
1959,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import numpy as np
import matplotlib.pyplot as plt
import mdtraj as md
from scattering.scattering import structure_factor
from scattering.utils.io import get_fn
| [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
45243,
9535,
73,
355,
45243,
198,
198,
6738,
45765,
13,
1416,
16475,
1330,
4645,
62,
31412,
198,
6738,
45765,
13,
26791,
13,
952,
... | 3.521739 | 46 |
from time import sleep
collors = {
"red": '\033[31m',
"green": '\033[32m',
"yellow": '\033[33m',
"purple": '\033[35m',
"blue": '\033[34m',
"end": '\033[m'
}
def inputInt(txt):
"""
A function that will validate weather a number is integer, or not.
:param txt: The text to be shown ju... | [
6738,
640,
1330,
3993,
198,
26000,
669,
796,
1391,
198,
220,
220,
220,
366,
445,
1298,
705,
59,
44427,
58,
3132,
76,
3256,
198,
220,
220,
220,
366,
14809,
1298,
705,
59,
44427,
58,
2624,
76,
3256,
198,
220,
220,
220,
366,
36022,
1... | 2.297181 | 1,632 |
import unittest
import redis
import time
from concurrent.futures import ProcessPoolExecutor
r = redis.Redis(host='localhost', port=6379)
k = 'cupid-sim_sim_dmcqm_lhmx_sku_rec_faiss_item_vec_scene102002_v1_s_d_d100_e100-watcher'
v = {'id': 'e71bc544-7fa5-11ea-8249-8c85909d35fg', 'status': 0}
r.hmset(k, v)
a = r.hget... | [
11748,
555,
715,
395,
198,
198,
11748,
2266,
271,
198,
11748,
640,
198,
6738,
24580,
13,
69,
315,
942,
1330,
10854,
27201,
23002,
38409,
198,
198,
81,
796,
2266,
271,
13,
7738,
271,
7,
4774,
11639,
36750,
3256,
2493,
28,
21,
29088,
... | 2.043956 | 182 |
# -*- coding: utf-8 -*-
from ocelot.logger import create_log, create_detailed_log
import json
import logging
import os
import pytest
import tempfile
base_logger = logging.getLogger('ocelot')
detailed_logger = logging.getLogger('ocelot-detailed')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
267,
5276,
313,
13,
6404,
1362,
1330,
2251,
62,
6404,
11,
2251,
62,
15255,
6255,
62,
6404,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
129... | 2.850575 | 87 |
## This program extracts a phrase-pairs from the word alignments of a parallel corpus ##
import optparse, sys, os, logging, time
from types import *
from zgc import zgc
from itertools import izip
# Constants
weight_rules = False # When distributing the unit-count among the rules, should it be weighted by th... | [
2235,
770,
1430,
32139,
257,
9546,
12,
79,
3468,
422,
262,
1573,
10548,
902,
286,
257,
10730,
35789,
22492,
198,
198,
11748,
2172,
29572,
11,
25064,
11,
28686,
11,
18931,
11,
640,
220,
198,
6738,
3858,
1330,
1635,
198,
6738,
1976,
364... | 2.125069 | 5,413 |
from __future__ import with_statement
try:
import simplejson as json
except ImportError:
import json
import base64
import datetime
import unittest
from flask import g
from flask_peewee.rest import Authentication
from flask_peewee.rest import RestAPI
from flask_peewee.rest import RestResource
from flask_peew... | [
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
2829,
17752,
355,
33918,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1330,
33918,
198,
198,
11748,
2779,
2414,
198,
11748,
4818,
8079,
... | 3.161473 | 353 |
"""
Unit tests for the asset upload endpoint.
"""
import json
from datetime import datetime
from io import BytesIO
from unittest import mock
from unittest.mock import patch
from ddt import data, ddt
from django.conf import settings
from django.test.utils import override_settings
from opaque_keys.edx.keys import Asse... | [
37811,
198,
26453,
5254,
329,
262,
11171,
9516,
36123,
13,
198,
37811,
628,
198,
11748,
33918,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
6738,
555,
715,
395,
1330,
15290,
198,
6738,
555,
715... | 2.271842 | 8,630 |
# -*- coding: utf-8 -*-
u"""PyTest for :mod:`sirepo.template.srw.py`
:copyright: Copyright (c) 2018 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
import pytest
import zipfile
from pykern import pkunit... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
84,
37811,
20519,
14402,
329,
1058,
4666,
25,
63,
82,
557,
7501,
13,
28243,
13,
27891,
86,
13,
9078,
63,
198,
198,
25,
22163,
4766,
25,
15069,
357,
66,
8,
2864,
5325... | 2.889764 | 127 |
# -*- coding: utf-8 -*-
# This file is part of Viper - https://github.com/viper-framework/viper
# See the file 'LICENSE' for copying permission.
from viper.common.abstracts import Command
from viper.core.database import Database
from viper.core.session import __sessions__
class Tags(Command):
"""
This comman... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
770,
2393,
318,
636,
286,
34517,
532,
3740,
1378,
12567,
13,
785,
14,
8903,
525,
12,
30604,
14,
8903,
525,
198,
2,
4091,
262,
2393,
705,
43,
2149,
24290,
6,
329,
... | 3.090278 | 144 |
# Clousure
print('==========Clousure==========')
# Fungsi bersarang dengan closure
hasil_hitung = hitung()
print(hasil_hitung())
print(hasil_hitung())
print(hasil_hitung())
print('')
# Fungsi bersarang biasa
hitung()
hitung()
hitung()
| [
2,
1012,
516,
495,
198,
198,
4798,
10786,
2559,
855,
2601,
516,
495,
2559,
855,
11537,
198,
198,
2,
376,
2150,
13396,
275,
364,
283,
648,
2853,
1030,
16512,
198,
198,
10134,
346,
62,
17945,
2150,
796,
2277,
2150,
3419,
198,
198,
479... | 2.42 | 100 |
import rdkit
import molecule_utils
from collections import Iterable
import pandas as pd
from src import setting
degrees = [0, 1, 2, 3, 4, 5]
class Node(object):
""" Class represent graph node.
Args:
ntype (string): Node type
ext_id (string): External identifier
data: Node payload (de... | [
11748,
374,
67,
15813,
198,
11748,
27756,
62,
26791,
198,
6738,
17268,
1330,
40806,
540,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
12351,
1330,
4634,
198,
198,
13500,
6037,
796,
685,
15,
11,
352,
11,
362,
11,
513,
11,
604,
11... | 2.161043 | 652 |
#
# MIT License
#
# Copyright (c) 2022 GT4SD team
#
# 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, merge,... | [
2,
198,
2,
17168,
13789,
198,
2,
198,
2,
15069,
357,
66,
8,
33160,
7963,
19,
10305,
1074,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917... | 2.204351 | 6,068 |
res = 0
for i in range(1, int(input())+1):
res += i
print(res) | [
411,
796,
657,
198,
198,
1640,
1312,
287,
2837,
7,
16,
11,
493,
7,
15414,
28955,
10,
16,
2599,
198,
220,
220,
220,
581,
15853,
1312,
198,
198,
4798,
7,
411,
8
] | 2.125 | 32 |
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("https://marketplace-dev.allizom.org/")
driver.implicitly_wait(12)
driver.find_element_by_xpath("//*[@id='site-header']/mkt-header-child-toggle[1]").click()
driver.implicitly_wait(2)
driver.find_elem... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
13083,
1330,
26363,
628,
198,
26230,
796,
3992,
26230,
13,
13543,
12792,
3419,
198,
26230,
13,
1136,
7203,
5450,
1378,
10728,
5372,
... | 2.803681 | 163 |
#!/usr/bin/env python3.7
import os
BLOCK_SIZE = 256
P = [
(0, [1, 7]),
(1, [0, 8]),
(0, [5, 3]),
(1, [8, 6]),
(0, [3, 9]),
(1, [4, 0]),
(0, [9, 1]),
(1, [6, 2]),
(0, [7, 5]),
(1, [2, 4]),
]
if __name__ == "__main__":
pt1 = int(bytes.hex(os.urandom(BLOCK_SIZE // 8)), 16)
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
22,
198,
11748,
28686,
198,
198,
9148,
11290,
62,
33489,
796,
17759,
198,
198,
47,
796,
685,
198,
220,
220,
220,
357,
15,
11,
685,
16,
11,
767,
46570,
198,
220,
220,
220,
357,
... | 1.68693 | 329 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# 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,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
7358,
12,
7908,
41992,
4912,
31703,
12052,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
36... | 3.594796 | 269 |
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# @File : token.py
# @Created : 2020/10/23 5:59 下午
# @Software : PyCharm
#
# @Author : Liu.Qi
# @Contact : liuqi_0725@aliyun.com
#
# @Desc : token api
# -----------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
24305,
198,
2,
2488,
8979,
220,
220,
220,
220,
1058,
11241,
13,
9078,
198,
2,
2488,
41972,
220,
1058,
12131,
14,
940,
14,
1954,
642,
25,
3270,
220,
10310,
... | 1.936295 | 1,193 |
import smart_imports
smart_imports.all()
| [
198,
11748,
4451,
62,
320,
3742,
198,
198,
27004,
62,
320,
3742,
13,
439,
3419,
628,
628
] | 2.705882 | 17 |
import sys, logging
from etl import run_etl
if __name__ == '__main__':
import logging
logging.basicConfig(
filename='data/etl.log',
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S',
level=logging.INFO
)
main() | [
11748,
25064,
11,
18931,
198,
6738,
2123,
75,
1330,
1057,
62,
316,
75,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1330,
18931,
628,
220,
220,
220,
18931,
13,
35487,
16934,
7,
198,
220,
22... | 2.033557 | 149 |
#test if the skim is as expected
#test the isolation distribution of (loose) leptons, show max isolation value!
#print list of found triggers
#print list of not found triggers | [
2,
9288,
611,
262,
39080,
318,
355,
2938,
198,
2,
9288,
262,
15133,
6082,
286,
357,
5439,
577,
8,
443,
457,
684,
11,
905,
3509,
15133,
1988,
0,
198,
2,
4798,
1351,
286,
1043,
20022,
198,
2,
4798,
1351,
286,
407,
1043,
20022
] | 4.069767 | 43 |
# -*- coding: utf-8 -*-
import asyncio
import time
from bls_py import bls
from enum import IntEnum
from .bitcoin import address_to_script
from .dash_msg import (DSPoolStatusUpdate, DSMessageIDs, ds_msg_str,
ds_pool_state_str, DashDsaMsg, DashDsiMsg, DashDssMsg)
from .dash_tx import str_ip, CTxI... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
30351,
952,
198,
11748,
640,
198,
6738,
698,
82,
62,
9078,
1330,
698,
82,
198,
6738,
33829,
1330,
2558,
4834,
388,
198,
198,
6738,
764,
35395,
1330,
2209,
... | 2.09011 | 3,640 |
from time import time
from sso.providers.identity_provider import IdentityProvider
from sso.providers.oauth2.views import OAuth2CallbackView, OAuth2LoginView
class OAuth2Provider(IdentityProvider):
"""The `OAuth2Provider` provides a generic identity provider
that uses the OAuth 2.0 protocol as a means for au... | [
6738,
640,
1330,
640,
198,
198,
6738,
264,
568,
13,
15234,
4157,
13,
738,
414,
62,
15234,
1304,
1330,
27207,
29495,
198,
6738,
264,
568,
13,
15234,
4157,
13,
12162,
1071,
17,
13,
33571,
1330,
440,
30515,
17,
47258,
7680,
11,
440,
30... | 3.08867 | 203 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
6060,
44,
4254,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198
] | 2.976744 | 43 |
import pigpio
import math
minPulse = 500 # us
maxPulse = 2500 # us
minAngle = -math.pi / 2
maxAngle = math.pi / 2
pi = pigpio.pi()
| [
198,
11748,
12967,
79,
952,
198,
11748,
10688,
198,
198,
1084,
47,
9615,
796,
5323,
1303,
514,
198,
9806,
47,
9615,
796,
33507,
1303,
514,
198,
1084,
13450,
293,
796,
532,
11018,
13,
14415,
1220,
362,
198,
9806,
13450,
293,
796,
10688... | 2.368421 | 57 |
from tkinter import *
import db
import sqlite3
import pycep_correios
# from validacoes import *
from tkinter import messagebox as mb
janela = Tk()
janela.title('Veterinario')
janela.geometry('350x350+200+100')
janela.resizable(width=False, height=False)
photo2 = PhotoImage(file='logo.png')
logo2 = Label(janela, im... | [
6738,
256,
74,
3849,
1330,
1635,
198,
11748,
20613,
198,
11748,
44161,
578,
18,
198,
11748,
12972,
344,
79,
62,
10215,
260,
4267,
198,
2,
422,
4938,
330,
3028,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
3275,
3524,
355,
285,
65,
62... | 2.254237 | 354 |
##---------------------------------------------------------------------------
# R1_realistic.py
# G.Urbancic
#
# Takes raw .dat files:
# (1) removes NaN values and replace by interpolation
# (2) determines weather or not there is bad data during the day
# [x,y,z,T]< [35,35,35,25]
##-------------------... | [
2235,
10097,
32284,
198,
2,
371,
16,
62,
5305,
2569,
13,
9078,
220,
198,
2,
402,
13,
16692,
65,
1192,
291,
220,
198,
2,
198,
2,
33687,
8246,
764,
19608,
3696,
25,
220,
198,
2,
220,
220,
220,
357,
16,
8,
20694,
11013,
45,
3815,
... | 2.017544 | 969 |
import time
import os
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import torch
import torchvision.transforms.functional as F
from .datasets import BojaDataSet
from .._file_utils import get_highest_numbered_file
from .._image_utils import draw_bboxes
from .. import _models
from .._s3_utils imp... | [
11748,
640,
198,
11748,
28686,
198,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
10178,
13,
7645,
23914,
13,
45124,
... | 2.301105 | 724 |
from Jumpscale import j
JSBASE = j.application.JSBaseClass
| [
6738,
449,
8142,
38765,
1330,
474,
628,
198,
41,
16811,
11159,
796,
474,
13,
31438,
13,
20120,
14881,
9487,
628
] | 3.1 | 20 |
"""Console backend"""
import logging
from unittest.mock import patch
from notifications.providers import BaseNotificationProvider
from .synchronous import SynchronousBackend
| [
37811,
47581,
30203,
37811,
198,
198,
11748,
18931,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
19605,
13,
15234,
4157,
1330,
7308,
3673,
2649,
29495,
198,
198,
6738,
764,
28869,
11413,
516,
1330,
16065,
11413,
51... | 4.045455 | 44 |
import time
from datetime import datetime
from file_utils import load_app_info
if __name__ == '__main__':
main()
| [
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
2393,
62,
26791,
1330,
3440,
62,
1324,
62,
10951,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
... | 2.906977 | 43 |
import os
from typing import List
from ..package_spec import PackageSpec
from ..python_version import AvailablePythonVersion
from ..step_builder import CommandStepBuilder
from ..utils import BuildkiteLeafStep, BuildkiteStep, CommandStep, GroupStep
| [
11748,
28686,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
11485,
26495,
62,
16684,
1330,
15717,
22882,
198,
6738,
11485,
29412,
62,
9641,
1330,
14898,
37906,
14815,
198,
6738,
11485,
9662,
62,
38272,
1330,
9455,
8600,
32875,
198,
6738,
... | 4.114754 | 61 |
import json
import sys
from collections import defaultdict
cut = True
best_other_alg = 'zlib'
if len(sys.argv) > 1 and 'b95' in sys.argv[1]:
best_other_alg = 'b95'
elif len(sys.argv) > 1 and 'b11' in sys.argv[1]:
best_other_alg = 'b11'
elif len(sys.argv) > 1:
assert 'zlib' in sys.argv[1]
sub_item = 6
combo_... | [
11748,
33918,
198,
11748,
25064,
198,
6738,
17268,
1330,
4277,
11600,
198,
8968,
796,
6407,
198,
13466,
62,
847,
62,
14016,
796,
705,
89,
8019,
6,
198,
361,
18896,
7,
17597,
13,
853,
85,
8,
1875,
352,
290,
705,
65,
3865,
6,
287,
2... | 1.952421 | 2,354 |
import matplotlib.pyplot as plt
file1 = open("results.txt", "r")
file1 = file1.readlines()
vertices = []
s_times = []
p_times = []
for line in file1:
line = line.split()
if line[0][0] == 'S':
s_times.append(float(line[2]))
vertices.append(int(line[1]))
elif line[0][0] == 'P':
p_t... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
7753,
16,
796,
1280,
7203,
43420,
13,
14116,
1600,
366,
81,
4943,
198,
7753,
16,
796,
2393,
16,
13,
961,
6615,
3419,
198,
198,
1851,
1063,
796,
17635,
198,
82,
62,
... | 2.357692 | 260 |
from math import floor, ceil, sqrt, log2
from libraries import Digits
| [
6738,
10688,
1330,
4314,
11,
2906,
346,
11,
19862,
17034,
11,
2604,
17,
198,
6738,
12782,
1330,
7367,
896,
628
] | 3.55 | 20 |
"""
Two words are “rotate pairs” if you can rotate one of them and get the other
(see rotate_word in Exercise 8.5).
Write a program that reads a wordlist and finds all the rotate pairs.
"""
from base_functions import make_wordlist, make_worddict, in_bisect, my_rotate_word
def rotate_pairs(word_list: list) -> dict:
... | [
37811,
198,
7571,
2456,
389,
564,
250,
10599,
378,
14729,
447,
251,
611,
345,
460,
23064,
530,
286,
606,
290,
651,
262,
584,
220,
198,
7,
3826,
23064,
62,
4775,
287,
32900,
807,
13,
20,
737,
198,
16594,
257,
1430,
326,
9743,
257,
... | 2.294656 | 655 |
from datetime import datetime
from string import Template
from typing import Optional, Union
import discord
from redbot.core import Config, commands
from redbot.core.bot import Red
from redbot.core.utils.chat_formatting import (
bold,
humanize_list,
humanize_number,
inline,
)
from .abc import Composit... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4731,
1330,
37350,
198,
6738,
19720,
1330,
32233,
11,
4479,
198,
198,
11748,
36446,
198,
6738,
2266,
13645,
13,
7295,
1330,
17056,
11,
9729,
198,
6738,
2266,
13645,
13,
7295,
13,
13645,
133... | 2.853793 | 725 |
import inspect
import rlcompleter
if __name__ == '__main__':
Klass().foo()
| [
11748,
10104,
198,
11748,
374,
75,
785,
1154,
353,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
14770,
562,
22446,
21943,
3419,
198
] | 2.5625 | 32 |
import os
import pathlib
import pytest
from ecranner.config.config import (
YAMLLoader, EnvFileLoader, FileLoader,
load_yaml, load_dot_env
)
from ecranner.config.exceptions import (
ConfigurationError, EnvFileNotFoundError,
ConfigurationNotFoundError
)
@pytest.fixture()
| [
11748,
28686,
198,
11748,
3108,
8019,
198,
11748,
12972,
9288,
198,
6738,
9940,
2596,
1008,
13,
11250,
13,
11250,
1330,
357,
198,
220,
220,
220,
575,
2390,
3069,
1170,
263,
11,
2039,
85,
8979,
17401,
11,
9220,
17401,
11,
198,
220,
220... | 2.820755 | 106 |
import deepspeech
import numpy
import os
import wget
from typing import List
from speechless.utils.storage import make_cache_dir_rel
from speechless.processing.tokenization import EditToken
SCORER_URL = 'https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3-models.scorer'
MODEL_URL = 'https... | [
11748,
2769,
45862,
198,
11748,
299,
32152,
198,
11748,
28686,
198,
11748,
266,
1136,
198,
198,
6738,
19720,
1330,
7343,
198,
198,
6738,
4046,
1203,
13,
26791,
13,
35350,
1330,
787,
62,
23870,
62,
15908,
62,
2411,
198,
6738,
4046,
1203,... | 2.891791 | 1,876 |
__copyright__ = "Copyright (c) 2020 Jina AI Limited. All rights reserved."
__license__ = "Apache-2.0"
import click
from jina.clients import py_client
@click.command()
@click.argument("text")
@click.option("--host", default="localhost")
@click.option("--top_k", "-k", default=5)
if __name__ == "__main__":
mai... | [
834,
22163,
4766,
834,
796,
366,
15269,
357,
66,
8,
12131,
449,
1437,
9552,
15302,
13,
1439,
2489,
10395,
526,
198,
834,
43085,
834,
796,
366,
25189,
4891,
12,
17,
13,
15,
1,
198,
198,
11748,
3904,
198,
198,
6738,
474,
1437,
13,
5... | 2.817391 | 115 |
'''
ref at https://github.com/aakankshaws/Python/blob/master/weather_data_bs4.py
https://medium.com/@aakankshaws/using-beautifulsoup-requests-to-scrape-weather-data-9c6e9d317800
Using BeautifulSoup, requests to scrape weather data, then save it into a timestamped cvs file
'''
import requests
from bs4 import BeautifulS... | [
7061,
6,
198,
5420,
379,
3740,
1378,
12567,
13,
785,
14,
64,
461,
2283,
71,
8356,
14,
37906,
14,
2436,
672,
14,
9866,
14,
23563,
62,
7890,
62,
1443,
19,
13,
9078,
198,
5450,
1378,
24132,
13,
785,
14,
31,
64,
461,
2283,
71,
8356,... | 1.91545 | 1,644 |
import cv2
import matplotlib
import numpy as np
from matplotlib import pyplot as plt
# * syn where to set this
# must use 'Agg' to plot out onto image
matplotlib.use("Agg")
####
def fig2data(fig, dpi=180):
"""Convert a Matplotlib figure to a 4D numpy array with RGBA channels and return it.
Args:
... | [
11748,
269,
85,
17,
198,
11748,
2603,
29487,
8019,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
2,
1635,
6171,
810,
284,
900,
428,
198,
2,
1276,
779,
705,
46384,
6,
28... | 2.355623 | 329 |
import csv
import pandas
import sys
import json
from tabulate import tabulate
import argparse
import math
import plotting_utils as utils
TEXFILE_TEMPLATE = r"""
{###ENTRIES PLACEHOLDER###}
"""
ENTRY_TEMPLATE = r"""
\addplot[only marks, color={col{###TOOL NAME PLACEHOLDER###}}, mark={###TOOL MARK PLACEHO... | [
11748,
269,
21370,
198,
11748,
19798,
292,
198,
11748,
25064,
198,
11748,
33918,
198,
6738,
7400,
5039,
1330,
7400,
5039,
198,
11748,
1822,
29572,
198,
11748,
10688,
198,
11748,
29353,
62,
26791,
355,
3384,
4487,
628,
198,
198,
51,
6369,
... | 2.448445 | 611 |
from Core.Assertions.Assertion import Assert, APIAssert
| [
6738,
7231,
13,
8021,
861,
507,
13,
8021,
861,
295,
1330,
2195,
861,
11,
3486,
3539,
824,
861,
628
] | 3 | 19 |
import interactions
import config
from tools.embed import (
create_info_embed,
create_error_embed,
create_review_embeds)
from tools import check, database, component
| [
198,
11748,
12213,
198,
198,
11748,
4566,
198,
6738,
4899,
13,
20521,
1330,
357,
198,
220,
220,
220,
2251,
62,
10951,
62,
20521,
11,
220,
198,
220,
220,
220,
2251,
62,
18224,
62,
20521,
11,
220,
198,
220,
220,
220,
2251,
62,
19023,
... | 2.8 | 70 |
from spada.methods import get_switches
from spada.network import gene_network
import os
import pickle
import pytest
scriptPath = os.path.realpath(__file__)
dataPath = os.path.dirname(scriptPath) + "/../../data/"
g = get_switches.GetSwitches(dataPath + 'annotation.pklz')
g.run(dataPath + 'switches')
gn = g._genes
tx... | [
6738,
599,
4763,
13,
24396,
82,
1330,
651,
62,
2032,
9249,
198,
6738,
599,
4763,
13,
27349,
1330,
9779,
62,
27349,
198,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
12972,
9288,
198,
198,
12048,
15235,
796,
28686,
13,
6978,
1... | 2.713115 | 122 |
# -*- coding: utf-8 -*-
"""IdentityServicesEngineAPI node_services API fixtures and tests.
Copyright (c) 2021 Cisco and/or its affiliates.
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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
7390,
26858,
31007,
13798,
17614,
10139,
62,
30416,
7824,
34609,
290,
5254,
13,
198,
198,
15269,
357,
66,
8,
33448,
28289,
290,
14,
273,
663,
29116,
13,
198,
198,... | 3.434211 | 532 |
#! -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import pytest
@pytest.mark.django_db
@pytest.mark.django_db
| [
2,
0,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
4102,
13,
28241,
14208,
62,
9945,
628,
198,
... | 2.392857 | 56 |
#!/usr/bin/python3
# Let's use textgenrnn to train a natural language
# model with Lord Andy works!
# But first, imports
from textgenrnn import textgenrnn
# We need to instantiate a `textgenrnn` object
textgen = textgenrnn()
# Let's train the model with the script for Love Never Dies
textgen.reset()
textgen.train_f... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
2,
3914,
338,
779,
2420,
5235,
81,
20471,
284,
4512,
257,
3288,
3303,
198,
2,
2746,
351,
4453,
12382,
2499,
0,
198,
198,
2,
887,
717,
11,
17944,
198,
6738,
2420,
5235,
81,
20471,... | 2.373494 | 249 |
from django.urls import path
from common import views
app_name = 'common'
urlpatterns = [
path('health-check/', views.health_check, name='health-check')
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
2219,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
705,
11321,
6,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
13948,
12,
9122,
14,
3256,
5009,
13,
1394... | 2.927273 | 55 |
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_test")
load(":runtime_resources.bzl", "runtime_resources")
def grab_android_local_test(
name,
srcs,
deps,
associates = [],
custom_package = "",
*... | [
2220,
7203,
31,
952,
62,
65,
41319,
62,
38785,
62,
74,
313,
2815,
1003,
74,
313,
2815,
25,
74,
313,
2815,
13,
65,
48274,
1600,
366,
21841,
62,
73,
14761,
62,
32016,
4943,
198,
2220,
7203,
31,
952,
62,
65,
41319,
62,
38785,
62,
7... | 2.426816 | 2,767 |
import numpy as np
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.ensemble import RandomForestClassifier
from sklearn.metrics import accuracy_score, confusion_matrix, classification_report, log_loss
import time
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
1341,
35720,
13,
21048,
1330,
26423,
27660,
9487,
7483,
198,
6738,
1341,
35720,
13,
1072,
11306,
1330,
14534,
34605,
9487,
7483,
198,
6738,
1341,
35720,
13,
... | 2.45614 | 969 |
import cv2
import numpy as np
import pandas as pd
from keras.callbacks import EarlyStopping, ReduceLROnPlateau, ModelCheckpoint, TensorBoard
from sklearn.model_selection import train_test_split
import sys
import params
input_size = params.input_size
epochs = params.max_epochs
batch_size = params.batch_size
df_train ... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
41927,
292,
13,
13345,
10146,
1330,
12556,
1273,
33307,
11,
44048,
35972,
2202,
3646,
378,
559,
11,
9104,
9787,
4122,
11,
309,
22... | 1.695067 | 1,338 |
import os
from PIL import Image, ImageDraw, ImageFont
import cv2
import numpy as np
from cv2 import VideoWriter, VideoWriter_fourcc
import crawler
from config import config
import text_processing
if __name__ == "__main__":
main()
font = ImageFont.truetype("msyh.ttc", 40, encoding="utf-8")
font.ge... | [
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
11,
7412,
23252,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
269,
85,
17,
1330,
7623,
34379,
11,
7623,
34379,
62,
14337,
535,
198,
198,
11748... | 2.754098 | 122 |
import unittest
from simtk.openmm.app import *
from simtk.openmm import *
from simtk.unit import *
import simtk.openmm.app.element as elem
class TestGromacsGroFile(unittest.TestCase):
"""Test the Gromacs GRO file parser"""
def test_Triclinic(self):
"""Test parsing a file that describes a triclinic bo... | [
11748,
555,
715,
395,
198,
6738,
985,
30488,
13,
9654,
3020,
13,
1324,
1330,
1635,
198,
6738,
985,
30488,
13,
9654,
3020,
1330,
1635,
198,
6738,
985,
30488,
13,
20850,
1330,
1635,
198,
11748,
985,
30488,
13,
9654,
3020,
13,
1324,
13,
... | 1.881684 | 879 |
from pathlib import Path
import click
from databricks_cli.configure.config import debug_option
from databricks_sync import CONTEXT_SETTINGS, log
from databricks_sync.cmds import templates
@click.command(context_settings=CONTEXT_SETTINGS, help="Initialize export configuration file.")
@click.option('--filename', '-f',... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
3904,
198,
6738,
4818,
397,
23706,
62,
44506,
13,
11250,
495,
13,
11250,
1330,
14257,
62,
18076,
198,
198,
6738,
4818,
397,
23706,
62,
27261,
1330,
22904,
13918,
62,
28480,
51,
20754,
11,
... | 3.548387 | 124 |
from djangorest_routes.config.base import *
DEBUG = env("DEBUG")
ALLOWED_HOSTS += ["djangorest_auth.digitalstade.com", "djangorest_auth.herokuapp.com"]
# Database
# https://docs.djangoproject.com/en/4.0/ref/settings/#databases
DATABASES = {
"default": dj_database_url.parse(env("DATABASE_URL")),
}
# Applicati... | [
6738,
42625,
648,
26522,
62,
81,
448,
274,
13,
11250,
13,
8692,
1330,
1635,
628,
198,
30531,
796,
17365,
7203,
30531,
4943,
198,
198,
7036,
3913,
1961,
62,
39,
10892,
50,
15853,
14631,
28241,
648,
26522,
62,
18439,
13,
34725,
301,
671... | 2.370283 | 424 |
from sklearn.cluster import KMeans
import numpy as np
import logging
import sys
import os
import warnings
from sklearn import metrics
from sklearn.metrics.cluster import normalized_mutual_info_score
from sklearn.metrics.cluster import adjusted_mutual_info_score
if not sys.warnoptions:
warnings.simplefilter("ignore... | [
6738,
1341,
35720,
13,
565,
5819,
1330,
509,
5308,
504,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
14601,
198,
6738,
1341,
35720,
1330,
20731,
198,
6738,
1341,
35720,
13,
4164,... | 3.319328 | 119 |
import numpy as np
from sklearn.utils.validation import check_is_fitted
from sklearn.utils.extmath import randomized_svd
from sklearn.utils.validation import check_array
from sklearn.base import BaseEstimator, TransformerMixin
from numpy.linalg import norm
import warnings
def _soft_thresh(X, threshold):
"Apply so... | [
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
13,
26791,
13,
12102,
341,
1330,
2198,
62,
271,
62,
38631,
198,
6738,
1341,
35720,
13,
26791,
13,
2302,
11018,
1330,
23925,
62,
82,
20306,
198,
6738,
1341,
35720,
13,
26791,
13,
1... | 2.433708 | 4,533 |
#
# PySNMP MIB module CISCO-WLAN-VLAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-WLAN-VLAN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:00:14 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
36159,
8220,
12,
54,
25697,
12,
53,
25697,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490... | 2.785434 | 7,648 |
# Generated by Django 3.1.1 on 2020-11-25 21:12
# pylint: disable=invalid-name
from django.db import migrations
from django.db import models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
16,
319,
12131,
12,
1157,
12,
1495,
2310,
25,
1065,
198,
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
6738,
42625... | 2.83871 | 62 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Rene Liebscher
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 3 of the License, or (at your option) any
# later version.... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
3717,
220,
371,
1734,
12060,
65,
1416,
372,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,... | 2.174648 | 1,775 |
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | [
2,
15069,
1584,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.661591 | 591 |
import pytest
from tests import utilities
@pytest.fixture
@pytest.mark.usefixtures("test_states_page")
| [
11748,
12972,
9288,
198,
198,
6738,
5254,
1330,
20081,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
4102,
13,
1904,
69,
25506,
7203,
9288,
62,
27219,
62,
7700,
4943,
198
] | 3 | 36 |
import inspect
import time
from datetime import timedelta
from django.core.management.base import BaseCommand, CommandError
from corehq.apps.es.registry import get_registry, registry_entry
from corehq.elastic import get_es_export
from pillowtop.es_utils import initialize_index, set_index_reindex_settings
USAGE = """... | [
11748,
10104,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
11,
9455,
12331,
198,
198,
6738,
4755,
71,
80,
13,
18211,
13,
274,
13,
2301,
459... | 3.38961 | 154 |
#!/usr/bin/python
"""
serialrosbags.py: version 0.2.0
History:
2016/10/13: Initial version stream multiple rosbags in sync.
"""
import sys
import rosbag
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
46911,
4951,
34005,
13,
9078,
25,
2196,
657,
13,
17,
13,
15,
198,
198,
18122,
25,
198,
5304,
14,
940,
14,
1485,
25,
20768,
2196,
4269,
3294,
686,
82,
34005,
287,
17510,
13,
19... | 2.836364 | 55 |
import numpy as np
from sklearn import __version__
from sklearn.utils import check_array
from sklearn.utils.validation import check_is_fitted
from .base import BaseFeatureLibrary
from .weak_pde_library import WeakPDELibrary
from .generalized_library import GeneralizedLibrary
from .polynomial_library import PolynomialL... | [
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
1330,
11593,
9641,
834,
198,
6738,
1341,
35720,
13,
26791,
1330,
2198,
62,
18747,
198,
6738,
1341,
35720,
13,
26791,
13,
12102,
341,
1330,
2198,
62,
271,
62,
38631,
198,
198,
6738,
... | 3.519802 | 202 |
import random
print(random.random() )
print(random.randint(10,99))
print(random.randrange(10,99)) | [
11748,
4738,
198,
4798,
7,
25120,
13,
25120,
3419,
1267,
198,
4798,
7,
25120,
13,
25192,
600,
7,
940,
11,
2079,
4008,
198,
4798,
7,
25120,
13,
25192,
9521,
7,
940,
11,
2079,
4008
] | 2.852941 | 34 |
from textfier.core import Dataset
# Defines the input sequences
sentences = ['hey', 'lets go']
# Defines the input labels
labels = [0, 0]
# Creates the dataset
dataset = Dataset(sentences=sentences, labels=labels)
print(dataset.sentences, dataset.labels)
| [
6738,
2420,
69,
959,
13,
7295,
1330,
16092,
292,
316,
198,
198,
2,
2896,
1127,
262,
5128,
16311,
198,
34086,
3007,
796,
37250,
20342,
3256,
705,
5289,
467,
20520,
198,
198,
2,
2896,
1127,
262,
5128,
14722,
198,
23912,
1424,
796,
685,
... | 2.877778 | 90 |
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import pandas as pd
import sqlite3
import numpy as np
import csv
import sys
print('Libraries imported.')
# In[ ]:
conn=sqlite3.connect('greendots.db')
cur=conn.cursor()
# In[ ]:
SQL1= """
CREATE TABLE DB_Veins (
Codi Veina TEXT,
Nom TEXT,
Barri TEXT... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
2361,
25,
628,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
44161,
578,
18,
198,
11748,
299,
32152,
355,
45941,
198,
1174... | 2.096491 | 912 |