content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import itertools
import logging
from bs4 import BeautifulSoup
from chibi.file.temp import Chibi_temp_path
from .episode import Episode
from chibi_dl.site.base.site import Site
logger = logging.getLogger( "chibi_dl.sites.tmo_fans.serie" )
| [
11748,
340,
861,
10141,
198,
11748,
18931,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
442,
27567,
13,
7753,
13,
29510,
1330,
609,
27567,
62,
29510,
62,
6978,
198,
198,
6738,
764,
38668,
1330,
7922,
198,
6738,
442,... | 2.927711 | 83 |
import matplotlib.pyplot as plt
import numpy as np
import math
import time
import sys
if __name__ == '__main__':
# this random seed provides better result
np.random.seed(1000384)
X, Y = input_coordinates("prefs.out")
#init_path = greedy_tsp(X, Y)
init_path = random_path(X, Y)
plt.title('Anneali... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
11748,
640,
198,
11748,
25064,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
... | 2.194175 | 412 |
from cffconvert import CodemetaObject
import unittest
import os
import ruamel.yaml as yaml
| [
6738,
269,
487,
1102,
1851,
1330,
18720,
368,
17167,
10267,
198,
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
7422,
17983,
13,
88,
43695,
355,
331,
43695,
628,
198
] | 3.1 | 30 |
# Copyright 2019 Verily Life Sciences 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 appli... | [
2,
15069,
13130,
4643,
813,
5155,
13473,
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,
... | 3.536585 | 328 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from tap.problemak.solucion import diferencia_hojas
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
9814,
13,
45573,
461,
13,
34453,
1229,
295,
1330,
288,
361,
567,
10782,
544,
62,
8873,
28121,
628
] | 2.681818 | 44 |
# -*- coding: utf-8 -*-
"""Non-player characters."""
# Part of Clockwork MUD Server (https://github.com/whutch/cwmud)
# :copyright: (c) 2008 - 2017 Will Hutcheson
# :license: MIT (https://github.com/whutch/cwmud/blob/master/LICENSE.txt)
import re
from .attributes import Attribute
from .characters import Character
fro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
15419,
12,
7829,
3435,
526,
15931,
198,
2,
2142,
286,
47120,
337,
8322,
9652,
357,
5450,
1378,
12567,
13,
785,
14,
1929,
7140,
14,
66,
26377,
463,
8,
198,
2,
... | 2.633001 | 703 |
import os
from rackattack.virtual import sh
| [
11748,
28686,
198,
6738,
19127,
20358,
13,
32844,
1330,
427,
628,
198
] | 3.833333 | 12 |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | [
2,
16529,
1783,
10541,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
5964,
1321,
13,
198,
2,
16529,
1783,
10541,
198,... | 7.384615 | 52 |
try:
from Occiput_Interface_Biograph_mMR import Biograph_mMR_Physiology
except:
Biograph_mMR_Physiology = None
try:
from Occiput_Interface_Brain_PET import Brain_PET_Physiology
except:
Brain_PET_Physiology = None
| [
28311,
25,
198,
220,
220,
220,
422,
10775,
541,
315,
62,
39317,
62,
23286,
2384,
62,
76,
13599,
1330,
8436,
2384,
62,
76,
13599,
62,
43215,
12371,
198,
16341,
25,
198,
220,
220,
220,
8436,
2384,
62,
76,
13599,
62,
43215,
12371,
796,... | 2.705882 | 85 |
#sep8a: RH 65
#sep8b: rh65
#sep15: temp22
import serial
from datetime import datetime
import datetime
import time
import csv
import sys
start = time.time()
runtime = 310
serial_port = 'com3'
baud_rate = 9600
print(datetime.datetime.now())
ser = serial.Serial(serial_port, baud_rate)
with open(r"... | [
2,
325,
79,
23,
64,
25,
35662,
6135,
201,
198,
2,
325,
79,
23,
65,
25,
9529,
2996,
201,
198,
2,
325,
79,
1314,
25,
20218,
1828,
201,
198,
11748,
11389,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
11748,
4818,
8079,
2... | 1.891107 | 551 |
# urllib3/_collections.py
##
##
##
##
from collections import deque
from threading import RLock
__all__ = ['RecentlyUsedContainer']
class RecentlyUsedContainer(dict):
''''''
##
##
##
CLEANUP_FACTOR = 10
def _invalidate_entry(self, key):
''''''
old_entry = self.ac... | [
2,
2956,
297,
571,
18,
47835,
4033,
26448,
13,
9078,
198,
2235,
198,
198,
2235,
198,
198,
2235,
198,
198,
2235,
628,
198,
6738,
17268,
1330,
390,
4188,
198,
198,
6738,
4704,
278,
1330,
371,
25392,
198,
198,
834,
439,
834,
796,
37250... | 2.036339 | 743 |
from pyspark.sql import SparkSession,SQLContext
from pyspark.sql.types import *
from pyspark import SparkConf
from pyspark.context import SparkContext
from pyspark.sql.functions import asc
from pyspark.sql.functions import col
from functools import reduce # For Python 3.x
from pyspark.sql import DataFrame
from pyspark... | [
6738,
279,
893,
20928,
13,
25410,
1330,
17732,
36044,
11,
17861,
21947,
198,
6738,
279,
893,
20928,
13,
25410,
13,
19199,
1330,
1635,
198,
6738,
279,
893,
20928,
1330,
17732,
18546,
198,
6738,
279,
893,
20928,
13,
22866,
1330,
17732,
21... | 2.950464 | 323 |
from collections import OrderedDict
from color import ColorString
from prettytable import PrettyTable
| [
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
6738,
3124,
1330,
5315,
10100,
198,
6738,
2495,
11487,
1330,
20090,
10962,
628
] | 4.727273 | 22 |
import os
import sys
import numpy as np
from algorithm.errors import *
try:
import algorithm.internal as internal
from algorithm.dists import *
except ImportError:
raise EFSMCompilationError()
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11862,
13,
48277,
1330,
1635,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
11862,
13,
32538,
355,
5387,
198,
220,
220,
220,
422,
11862,
13,
67,
1023,
13... | 3.071429 | 70 |
# -*- coding: utf-8 -*-
'''
Copyright (c) 2016, Virginia Tech
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of condi... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
15269,
357,
66,
8,
1584,
11,
6025,
9634,
198,
3237,
2489,
10395,
13,
198,
198,
7738,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11,
351,
393,
12... | 3.326944 | 1,878 |
# -*- coding: utf-8 -*-
from flask_restful import Resource
from static.imports import *
from db import db
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
198,
198,
6738,
9037,
13,
320,
3742,
1330,
1635,
198,
6738,
20613,
1330,
20613,
628
] | 3 | 36 |
import unittest
import sys
import numpy as np
sys.path.append("../")
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
4943,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13... | 2.622222 | 45 |
from cc3d import CompuCellSetup
from ReactionDiffusion_2D_FNSteppables import ReactionDiffusion_2D_FNSteppable
CompuCellSetup.register_steppable(steppable=ReactionDiffusion_2D_FNSteppable(frequency=1))
CompuCellSetup.run()
| [
6738,
36624,
18,
67,
1330,
3082,
84,
28780,
40786,
198,
198,
6738,
39912,
28813,
4241,
62,
17,
35,
62,
43221,
7447,
381,
2977,
1330,
39912,
28813,
4241,
62,
17,
35,
62,
43221,
7447,
381,
540,
198,
198,
7293,
84,
28780,
40786,
13,
30... | 2.860759 | 79 |
from flask_admin.contrib import sqla
from flask_security import current_user, utils
from wtforms.fields import PasswordField
##
## view models
##
# Customized User model for SQL-Admin
# Customized Role model for SQL-Admin
# Prevent administration of Roles unless the currently logged-in user has the "admin" rol... | [
6738,
42903,
62,
28482,
13,
3642,
822,
1330,
19862,
5031,
198,
6738,
42903,
62,
12961,
1330,
1459,
62,
7220,
11,
3384,
4487,
198,
6738,
266,
83,
23914,
13,
25747,
1330,
30275,
15878,
198,
198,
2235,
198,
2235,
1570,
4981,
198,
2235,
1... | 3.701149 | 87 |
from xml.etree import ElementTree as ET
from graph_analyzer import create_graph_from_connection
if __name__ == '__main__':
main()
| [
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
355,
12152,
198,
198,
6738,
4823,
62,
38200,
9107,
1330,
2251,
62,
34960,
62,
6738,
62,
38659,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,... | 3.043478 | 46 |
#-*- coding: utf-8 -*-
import multiprocessing
import logging
try: # Python 2.7+
from logging import NullHandler
except ImportError:
LOG = logging.getLogger(__name__)
LOG.addHandler(NullHandler())
| [
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
18540,
305,
919,
278,
198,
11748,
18931,
198,
28311,
25,
220,
1303,
11361,
362,
13,
22,
10,
198,
220,
220,
220,
422,
18931,
1330,
35886,
25060,
198,
16341,
... | 2.859155 | 71 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# FSRobo-R Package BSDL
# ---------
# Copyright (C) 2019 FUJISOFT. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# 1. Redistributions of source code... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
376,
12562,
20391,
12,
49,
15717,
347,
10305,
43,
198,
2,
45337,
198,
2,
15069,
357,
34,
8,
13130,
376,
52,... | 2.296813 | 3,797 |
from metablock import Metablock
| [
6738,
10523,
5354,
1330,
3395,
397,
5354,
628
] | 4.125 | 8 |
"""
Ensures that the protocol handlers for the control protocol and the network
protocol work as expected.
"""
from collections import defaultdict
import socket
import threading
import traceback
import unittest
from lns import control_proto, reactor
# Change this to some port that is available on your machine, so tha... | [
37811,
198,
4834,
82,
942,
326,
262,
8435,
32847,
329,
262,
1630,
8435,
290,
262,
3127,
198,
11235,
4668,
670,
355,
2938,
13,
198,
37811,
198,
6738,
17268,
1330,
4277,
11600,
198,
11748,
17802,
198,
11748,
4704,
278,
198,
11748,
12854,
... | 3.492806 | 278 |
"""
ogn_lib.client
--------------
This module contains methods and classes related to opening and managing a
connection to OGN's APRS servers.
"""
import logging
import socket
import time
import ogn_lib
logger = logging.getLogger(__name__)
class OgnClient:
"""
Holds an APRS session.
Provides methods... | [
37811,
198,
2360,
62,
8019,
13,
16366,
198,
26171,
198,
198,
1212,
8265,
4909,
5050,
290,
6097,
3519,
284,
4756,
290,
11149,
257,
198,
38659,
284,
440,
16630,
338,
3486,
6998,
9597,
13,
198,
37811,
198,
198,
11748,
18931,
198,
11748,
... | 2.199727 | 4,396 |
''' Pointwise wrapper '''
import os
# --- Python/system level imports
from subprocess import call
from string import Template
# --- OpenMDAO main and library imports
from openmdao.api import Problem, Group, ExternalCode, IndepVarComp
class Pointwise(ExternalCode):
''' OpenMDAO component for executing Pointwise ... | [
7061,
6,
6252,
3083,
29908,
705,
7061,
198,
11748,
28686,
198,
198,
2,
11420,
11361,
14,
10057,
1241,
17944,
198,
6738,
850,
14681,
1330,
869,
198,
6738,
4731,
1330,
37350,
198,
198,
2,
11420,
4946,
44,
5631,
46,
1388,
290,
5888,
1794... | 3.507538 | 199 |
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
if __name__ == "__main__":
main()
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
628,
628,
628,
628,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,... | 2.666667 | 48 |
import logging
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
# torch.manual_seed(0)
# torch.backends.cudnn.deterministic = True
# torch.backends.cudnn.benchmark = False
from pyro.distributions import MultivariateNormal, Normal, Independent
from sklearn.cluster import KMeans, ... | [
11748,
18931,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
2,
28034,
13,
805,
723,
62,
28826,
7,
15,
8,
198,
2,
28034... | 2.545263 | 475 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
198
] | 3.777778 | 9 |
# Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | [
2,
15069,
12131,
15841,
3216,
21852,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
... | 3.177966 | 354 |
# Kata url: https://www.codewars.com/kata/58bf9bd943fadb2a980000a7.
from typing import List
| [
2,
509,
1045,
19016,
25,
3740,
1378,
2503,
13,
19815,
413,
945,
13,
785,
14,
74,
1045,
14,
3365,
19881,
24,
17457,
24,
3559,
69,
324,
65,
17,
64,
4089,
2388,
64,
22,
13,
198,
198,
6738,
19720,
1330,
7343,
628
] | 2.292683 | 41 |
import json
import time
| [
11748,
33918,
198,
11748,
640,
628,
628,
628,
628
] | 3.444444 | 9 |
"""
This file is meant to be a fully working mining client to interact with the REST api defined in the node-files
directory. Other client software can be written to mine and transact with the API however.
"""
import json
import sys
import os
import requests
import time
import ecdsa
from hashlib import sha256
from ppri... | [
37811,
198,
1212,
2393,
318,
4001,
284,
307,
257,
3938,
1762,
9691,
5456,
284,
9427,
351,
262,
30617,
40391,
5447,
287,
262,
10139,
12,
16624,
198,
34945,
13,
3819,
5456,
3788,
460,
307,
3194,
284,
6164,
290,
48878,
351,
262,
7824,
21... | 2.547968 | 1,772 |
import numpy as np
def pade(time,signal,sigma=100.0,max_len=None,w_min=0.0,w_max=10.0,w_step=0.01,read_freq=None):
""" Routine to take the Fourier transform of a time signal using the method
of Pade approximants.
Inputs:
time: (list or Numpy NDArray) signal sampling times
... | [
11748,
299,
32152,
355,
45941,
198,
198,
4299,
279,
671,
7,
2435,
11,
12683,
282,
11,
82,
13495,
28,
3064,
13,
15,
11,
9806,
62,
11925,
28,
14202,
11,
86,
62,
1084,
28,
15,
13,
15,
11,
86,
62,
9806,
28,
940,
13,
15,
11,
86,
... | 2.087706 | 1,334 |
#------------------------------------------------------------------------------
# Copyright (c) 2013, Nucleic Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-------------------------------------------------... | [
2,
10097,
26171,
198,
2,
15069,
357,
66,
8,
2211,
11,
399,
14913,
291,
7712,
4816,
13,
198,
2,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
287,
262,
2393,
279... | 3.019956 | 902 |
"""
elcaro-contract.py
MIT License
Copyright 2017 Splyse Inc.
"""
from boa.blockchain.vm.System.ExecutionEngine import GetScriptContainer,GetExecutingScriptHash
from boa.blockchain.vm.Neo.Transaction import *
from boa.blockchain.vm.Neo.Runtime import GetTrigger,CheckWitness,Notify,Log
from boa.blockchain.vm.Neo.Trig... | [
37811,
198,
417,
7718,
78,
12,
28484,
13,
9078,
198,
198,
36393,
13789,
198,
198,
15269,
2177,
1338,
306,
325,
3457,
13,
198,
37811,
198,
198,
6738,
1489,
64,
13,
9967,
7983,
13,
14761,
13,
11964,
13,
23002,
1009,
13798,
1330,
3497,
... | 2.136364 | 374 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-30 18:30
from __future__ import unicode_literals
from django.db import migrations
NEW_SOURCES = [
{'code': 'trabajospython', 'name': 'Trabajos Python', 'url': 'http://www.trabajospython.com/'},
{'code': 'workinstartups', 'name': 'Work In Startups',... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
319,
2177,
12,
3023,
12,
1270,
1248,
25,
1270,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738... | 2.525568 | 352 |
from django.db import models
from intragram.users import models as user_model
# post를 표현하기 위한 모델 posts - 터미널에서 'django-admin startapp posts'를 입력
# Django data model을 만들 때 게시물 생성 날짜/업데이트 날짜를 Post/Comment마다 만들지 말고,
# TimeStampedModel에 상속 시켜주자
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
9913,
6713,
13,
18417,
1330,
4981,
355,
2836,
62,
19849,
198,
2,
1281,
167,
98,
120,
220,
169,
239,
250,
169,
246,
226,
47991,
246,
166,
116,
108,
23821,
250,
226,
47991,
250,
316... | 1.235 | 200 |
from cool.modules.ASA.asa_0_login_info import ip, my_headers, auth_header
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
# 创建内部Object
# rest-api image flash:/asa-restapi-131-lfbff-k8.SPA
# rest-api agent
# 文档:https://192.168.20.4/doc/#
# 创建外部Object
if __name__ =... | [
6738,
3608,
13,
18170,
13,
1921,
32,
13,
15462,
62,
15,
62,
38235,
62,
10951,
1330,
20966,
11,
616,
62,
50145,
11,
6284,
62,
25677,
198,
11748,
7007,
198,
11748,
2956,
297,
571,
18,
198,
333,
297,
571,
18,
13,
40223,
62,
40539,
65... | 2.167598 | 179 |
import sys
import math
import random
A = [7,6,5,4,3,2,1]
merge_sort(A)
print(A)
# TESTING
START = -99
STOP = 99
LIMIT = 1000
RANDOM1 = [random.randint(START, STOP) for iter in range(LIMIT)]
#print(RANDOM1)
RANDOM2 = [random.randint(START, STOP) for iter in range(LIMIT)]
#print(RANDOM2)
RANDOM3 = [random.randint(STAR... | [
11748,
25064,
198,
11748,
10688,
198,
11748,
4738,
198,
198,
32,
796,
685,
22,
11,
21,
11,
20,
11,
19,
11,
18,
11,
17,
11,
16,
60,
198,
647,
469,
62,
30619,
7,
32,
8,
198,
4798,
7,
32,
8,
198,
2,
43001,
2751,
198,
198,
2257,... | 2.049563 | 343 |
import logging
import torch
import torch.nn as nn
import torch.utils.checkpoint as cp
from mmcv.cnn import constant_init, kaiming_init
from mmcv.runner import load_checkpoint
from ...registry import BACKBONES
import torch.nn.functional as F
from torch.nn.modules.batchnorm import _BatchNorm
import numpy as np
def ... | [
11748,
18931,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
26791,
13,
9122,
4122,
355,
31396,
198,
198,
6738,
8085,
33967,
13,
66,
20471,
1330,
6937,
62,
15003,
11,
479,
1385,
278,
62,
15003,
1... | 2.449257 | 808 |
"""Tests for the ee.computedobject module."""
import unittest
import ee
from ee import apitestcase
if __name__ == '__main__':
unittest.main()
| [
37811,
51,
3558,
329,
262,
304,
68,
13,
785,
17128,
15252,
8265,
526,
15931,
628,
198,
198,
11748,
555,
715,
395,
198,
198,
11748,
304,
68,
198,
198,
6738,
304,
68,
1330,
2471,
270,
395,
7442,
628,
198,
198,
361,
11593,
3672,
834,
... | 2.62069 | 58 |
from django.core.management.base import BaseCommand
from pyquery import PyQuery
from olympia.applications.models import AppVersion
from olympia.constants.applications import APP_GUIDS
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
198,
198,
6738,
12972,
22766,
1330,
9485,
20746,
198,
198,
6738,
267,
6760,
544,
13,
1324,
677,
602,
13,
27530,
1330,
2034,
14815,
198,
6738,
267,
6760,
544,
13,
99... | 3.528302 | 53 |
import asyncio
import json
import aiosqlite
from aiogram.types import Message
from config import DB_URL, dp, CHANNEL_BOT_ID
from core.db.utils import dict_factory
from core.models.group import GroupSettings
@dp.throttled(rate=2)
| [
11748,
30351,
952,
198,
11748,
33918,
198,
198,
11748,
257,
4267,
13976,
578,
198,
6738,
257,
72,
21857,
13,
19199,
1330,
16000,
198,
198,
6738,
4566,
1330,
20137,
62,
21886,
11,
288,
79,
11,
5870,
22846,
3698,
62,
33,
2394,
62,
2389,... | 2.987179 | 78 |
#Tester
n = Numbers(2, 5)
n.add() | [
198,
2,
51,
7834,
198,
77,
796,
27797,
7,
17,
11,
642,
8,
198,
77,
13,
2860,
3419
] | 1.888889 | 18 |
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause... | [
2,
16529,
35937,
201,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
201,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
201,
198,
2,
5964,
1321,
13,
201,
198,
2,
... | 2.987872 | 4,535 |
import pika
import sys
connection = pika.BlockingConnection(pika.ConnectionParameters("localhost"))
channel = connection.channel()
# channel.queue_declare(queue="hello")
channel.queue_declare(queue="task_queue", durable=True)
message = " ".join(sys.argv[1:]) or "Hello World!"
# channel.basic_publish(exchange="", rou... | [
11748,
279,
9232,
198,
11748,
25064,
198,
198,
38659,
796,
279,
9232,
13,
3629,
8629,
32048,
7,
79,
9232,
13,
32048,
48944,
7203,
36750,
48774,
198,
17620,
796,
4637,
13,
17620,
3419,
198,
198,
2,
6518,
13,
36560,
62,
32446,
533,
7,
... | 2.910891 | 202 |
import os
import sys
import click
from ..client.api import api_client
from .plugins import COMMANDS
# cmd_folder = os.path.abspath(os.path.join(os.path.dirname(__file__), 'plugins'))
add_command = ["ps", "init", "start", "stop", "deploy", "update", "create", "status", "health", "fetch"]
@click.command(cls=PluginCo... | [
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
3904,
198,
198,
6738,
11485,
16366,
13,
15042,
1330,
40391,
62,
16366,
198,
6738,
764,
37390,
1330,
9440,
10725,
5258,
198,
198,
2,
23991,
62,
43551,
796,
28686,
13,
6978,
13,
397,
2777,... | 2.844262 | 122 |
import pygame
from pygame.locals import *
from threading import Lock
from videoreceiver import VideoReceiver
from controlio import ControlIO
import sys
class Rover(object):
"""Primary control interface for Rover"""
FPS = 15
MLIMITLOW = 32
LLIMITLOW = 96
WIDTH = 1280
HEIGHT = 960
BLACK = (0,... | [
11748,
12972,
6057,
198,
6738,
12972,
6057,
13,
17946,
874,
1330,
1635,
198,
6738,
4704,
278,
1330,
13656,
198,
6738,
18784,
382,
39729,
1330,
7623,
3041,
39729,
198,
6738,
1630,
952,
1330,
6779,
9399,
198,
11748,
25064,
198,
198,
4871,
... | 1.978979 | 1,998 |
#!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
357,
66,
8,
2177,
5949,
12044,
3457,
11,
1279,
28158,
31,
499,
12044,
13,
785,
29,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
28038,
856,
198,
2,
198,
2,
28038,
856,
318,
14... | 2.716522 | 2,300 |
from typing import Callable
def get_sentry_extension() -> Callable[[str], None]:
"""
Return set_transaction_id, if the Sentry-sdk is installed.
"""
try:
import sentry_sdk # noqa: F401, TC002
from asgi_correlation_id.extensions.sentry import set_transaction_id
return set_tran... | [
6738,
19720,
1330,
4889,
540,
628,
198,
4299,
651,
62,
82,
13000,
62,
2302,
3004,
3419,
4613,
4889,
540,
30109,
2536,
4357,
6045,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8229,
900,
62,
7645,
2673,
62,
312,
11,
611,
262,... | 2.858621 | 290 |
from JobBrowserBFF.TestBase import TestBase
import JobBrowserBFF.Utils as utils
UPSTREAM_SERVICE = 'ee2'
ENV = 'ci'
USER_CLASS = 'user'
| [
6738,
15768,
46532,
33,
5777,
13,
14402,
14881,
1330,
6208,
14881,
198,
11748,
15768,
46532,
33,
5777,
13,
18274,
4487,
355,
3384,
4487,
198,
198,
8577,
2257,
32235,
62,
35009,
27389,
796,
705,
1453,
17,
6,
198,
1677,
53,
796,
705,
97... | 2.653846 | 52 |
from snuba.datasets.factory import get_dataset
from snuba.query import SelectedExpression
from snuba.query.conditions import OPERATOR_TO_FUNCTION, binary_condition, in_condition
from snuba.query.expressions import Column, FunctionCall, Literal
from snuba.query.parser import parse_query
from snuba.query.processors.tags_... | [
6738,
3013,
22013,
13,
19608,
292,
1039,
13,
69,
9548,
1330,
651,
62,
19608,
292,
316,
198,
6738,
3013,
22013,
13,
22766,
1330,
41344,
16870,
2234,
198,
6738,
3013,
22013,
13,
22766,
13,
17561,
1756,
1330,
43521,
25633,
62,
10468,
62,
... | 3.637931 | 116 |
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from ..models import *
from ..serializers import *
| [
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
33571,
1330,
3486,
3824,
769,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
198,
6738,
11485,
27530,
1330,
1635,
198,
6738,
11485,
46911,
11341,
1330,
1635,
1... | 4.195122 | 41 |
from data_structures.stack import Stack
from trees_and_tree_algorithms.binary_tree import BinaryTree
import operator
| [
6738,
1366,
62,
7249,
942,
13,
25558,
1330,
23881,
198,
6738,
7150,
62,
392,
62,
21048,
62,
282,
7727,
907,
13,
39491,
62,
21048,
1330,
45755,
27660,
198,
198,
11748,
10088,
628,
628,
198
] | 3.588235 | 34 |
#!/usr/bin/python
import os, codecs, datetime
import jinja2, markdown
from email.utils import formatdate
from xml.sax.saxutils import escape
from ..utils.misc import json_dumps
__all__ = ["add_entries"]
config = {"__Instructions_filename_":"In the filename, 0 is the extension, specified by ext, 1 is the format name,... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
28686,
11,
40481,
82,
11,
4818,
8079,
198,
11748,
474,
259,
6592,
17,
11,
1317,
2902,
198,
6738,
3053,
13,
26791,
1330,
5794,
4475,
198,
6738,
35555,
13,
82,
897,
13,
82,
897,
... | 2.532389 | 494 |
import pytest
from contessa.models import ResultTable, QualityCheck
from contessa.rules import GtRule, NotNullRule
@pytest.mark.parametrize(
"rule_def, rule_cls",
[({"type": "not_null"}, NotNullRule), ({"type": "gt"}, GtRule)],
)
| [
11748,
12972,
9288,
198,
198,
6738,
542,
21411,
13,
27530,
1330,
25414,
10962,
11,
14156,
9787,
198,
6738,
542,
21411,
13,
38785,
1330,
402,
83,
31929,
11,
1892,
35067,
31929,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
3... | 2.692308 | 91 |
from dbus_next.service import ServiceInterface, signal
from dbus_next.aio import MessageBus
from dbus_next import Message
import pytest
@pytest.mark.asyncio
| [
6738,
288,
10885,
62,
19545,
13,
15271,
1330,
4809,
39317,
11,
6737,
198,
6738,
288,
10885,
62,
19545,
13,
64,
952,
1330,
16000,
16286,
198,
6738,
288,
10885,
62,
19545,
1330,
16000,
198,
198,
11748,
12972,
9288,
628,
198,
198,
31,
90... | 3.22 | 50 |
'''
* Solution for Binary Tree Inorder Traversal (Leetcode 94)
* https://leetcode.com/problems/binary-tree-inorder-traversal/
* Time Complexity: O(n)
* Space Complexity: O(h)
* Idea: Recursion
'''
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# ... | [
7061,
6,
198,
1635,
28186,
329,
45755,
12200,
554,
2875,
4759,
690,
282,
357,
3123,
316,
8189,
10048,
8,
198,
1635,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
39491,
12,
21048,
12,
259,
2875,
12,
9535,
690,
282,
14,
... | 2.453333 | 150 |
import glob
import os
import yaml
with open("server_config.yaml") as f:
config = yaml.load(f.read())
| [
198,
11748,
15095,
198,
11748,
28686,
198,
11748,
331,
43695,
628,
198,
4480,
1280,
7203,
15388,
62,
11250,
13,
88,
43695,
4943,
355,
277,
25,
198,
220,
220,
220,
4566,
796,
331,
43695,
13,
2220,
7,
69,
13,
961,
28955,
628,
628,
628... | 2.6 | 45 |
from chainer import Chain
import chainer.functions as F
import chainer.links as L
from pydlshogi.common import *
ch=192
| [
171,
119,
123,
6738,
6333,
263,
1330,
21853,
198,
11748,
6333,
263,
13,
12543,
2733,
355,
376,
198,
11748,
6333,
263,
13,
28751,
355,
406,
198,
198,
6738,
279,
5173,
75,
1477,
44381,
13,
11321,
1330,
1635,
198,
198,
354,
28,
17477,
... | 2.883721 | 43 |
# Generated by Django 2.2.13 on 2021-02-26 11:42
from django.core.exceptions import ObjectDoesNotExist
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1485,
319,
33448,
12,
2999,
12,
2075,
1367,
25,
3682,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
6738,
42625,
14208,
13,
9945,
1330,
1... | 3.0625 | 48 |
import math
import numpy as np
import tensorflow as tf
from tensorflow.python.framework import ops
class BatchNorm(object):
"""Code modification of http://stackoverflow.com/a/33950177"""
def linear(inpt, output_dim, scope=None, stddev=1.0, with_w=False):
"""
Linear transformation
:param inpt: data... | [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
11192,
273,
11125,
13,
29412,
13,
30604,
1330,
39628,
628,
198,
4871,
347,
963,
35393,
7,
15252,
2599,
198,
220,
220,
220,
3722... | 2.067361 | 2,880 |
from .studiesIndex_whenDownloaded import studiesIndex_whenDownloaded
from .studiesIndex_whenDownloaded_withEmptyStudyList import studiesIndex_whenDownloaded_withEmptyStudyList
from .study_whenDownloaded import study_whenDownloaded
from .study_whenDownloaded_withEmptySeriesList import study_whenDownloaded_withEmptySerie... | [
6738,
764,
19149,
444,
15732,
62,
12518,
10002,
276,
1330,
3640,
15732,
62,
12518,
10002,
276,
198,
6738,
764,
19149,
444,
15732,
62,
12518,
10002,
276,
62,
4480,
40613,
39841,
8053,
1330,
3640,
15732,
62,
12518,
10002,
276,
62,
4480,
4... | 3.97561 | 82 |
"""Builds command for emulator."""
from __future__ import annotations
import abc
import argparse
import os
from dataclasses import dataclass
from enum import Enum
from typing import Dict
from emulation_system.consts import (
PRODUCTION_MODE_NAME,
DEVELOPMENT_MODE_NAME,
LATEST_KEYWORD,
ROOT_DIR,
)
fro... | [
37811,
15580,
82,
3141,
329,
38274,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
450,
66,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
33829,
... | 2.266308 | 4,277 |
from flask import render_template
from flask_restful import Api, reqparse
from models import app
from resources import UserAuthentication, UserRefreshToken, UserRegistration, UserLogout, Todos, Todo
from flask_moment import Moment
moment = Moment(app)
api = Api(app)
api.add_resource(UserRegistration, '/registration')... | [
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
11,
43089,
29572,
198,
6738,
4981,
1330,
598,
198,
6738,
4133,
1330,
11787,
47649,
3299,
11,
11787,
8134,
3447,
30642,
11,
11787,
47133,
11,
11787,
111... | 2.924901 | 253 |
from flask import Flask, jsonify, request
from flask_cors import CORS
from os import environ
import pandas as pd
# To do : Filter away very small amounts
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})
@app.route('/compute_weights',methods=['POST'])
if __name__ == "__main__":
app.run(host="... | [
6738,
42903,
1330,
46947,
11,
33918,
1958,
11,
2581,
198,
6738,
42903,
62,
66,
669,
1330,
327,
20673,
198,
6738,
28686,
1330,
551,
2268,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
2,
1675,
466,
1058,
25853,
1497,
845,
1402,
6867,... | 2.625 | 144 |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
# bem: triangulation and fmm/bem electrostatics tools
#
# Copyright (C) 2011-2012 Robert Jordens <jordens@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
1279,
46803,
18982,
29,
18,
13,
15,
3556,
46803,
18982,
29,
198,
198,
2,
1279,
8189,
3846,
29,
198,
198,
2,
220,
220,
307,
76,
25,
1333,
648,
1741,
290,
277,
30... | 2.509145 | 1,695 |
"""
MUV dataset loader.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import numpy as np
import shutil
import deepchem as dc
def load_muv(featurizer='ECFP', split='index'):
"""Load MUV datasets. Does not do train/test split"""
# Load MU... | [
37811,
198,
44,
31667,
27039,
40213,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
28686,
... | 2.411683 | 719 |
__author__ = 'yinjun'
# @param s, a string
# @return an integer
| [
834,
9800,
834,
796,
705,
88,
259,
29741,
6,
198,
220,
220,
220,
1303,
2488,
17143,
264,
11,
257,
4731,
198,
220,
220,
220,
1303,
2488,
7783,
281,
18253,
628,
198
] | 2.387097 | 31 |
from django.db import models
from django.db.models.fields import BooleanField, CharField, FloatField, IntegerField, SmallIntegerField
from django.db.models.fields.files import ImageField
from .user import User
from .inmueble import Inmueble
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
25747,
1330,
41146,
15878,
11,
3178,
15878,
11,
48436,
15878,
11,
34142,
15878,
11,
10452,
46541,
15878,
198,
6738,
42625,
14208,
13,
9945,
13,
... | 3.597015 | 67 |
import json
from chargebee.model import Model
from chargebee import request
from chargebee import APIError
| [
11748,
33918,
198,
6738,
3877,
20963,
13,
19849,
1330,
9104,
198,
6738,
3877,
20963,
1330,
2581,
198,
6738,
3877,
20963,
1330,
7824,
12331,
628
] | 4.5 | 24 |
#Written by Gary Zeri
#Computer Science Major at Chapman University, Member of Dr. LaRue's CatLab
#Abstract Class to define the properties of all methods used to generate a Potential Energy Surface
from compChemGlobal import *
from graphableData import *
########################################################... | [
2,
25354,
416,
10936,
1168,
33442,
198,
2,
34556,
5800,
8386,
379,
29045,
2059,
11,
10239,
286,
1583,
13,
4689,
49,
518,
338,
5181,
17822,
198,
198,
2,
23839,
5016,
284,
8160,
262,
6608,
286,
477,
5050,
973,
284,
7716,
257,
32480,
6... | 6.070968 | 155 |
"""The builtin int type (W_AbstractInt) and the base impl (W_IntObject)
based on rpython ints.
In order to have the same behavior running on CPython, and after RPython
translation this module uses rarithmetic.ovfcheck to explicitly check
for overflows, something CPython does not do anymore.
"""
import operator
import ... | [
37811,
464,
3170,
259,
493,
2099,
357,
54,
62,
23839,
5317,
8,
290,
262,
2779,
4114,
357,
54,
62,
5317,
10267,
8,
198,
3106,
319,
374,
29412,
493,
82,
13,
198,
198,
818,
1502,
284,
423,
262,
976,
4069,
2491,
319,
16932,
7535,
11,
... | 2.512584 | 3,139 |
#import libraries
import MySQLdb
import ConfigParser
from Tkinter import *
from tkMessageBox import *
emain = Tk()
emain.title('Input')
Label(emain, text="Enter table name to delete : ").grid(row=1,column=2,sticky=W,pady=4)
inp_tbl = Entry(emain)
inp_tbl.grid(row=1,column=4,padx=12)
inp_tbl.bind('<Retur... | [
2,
11748,
12782,
201,
198,
11748,
33476,
9945,
201,
198,
11748,
17056,
46677,
201,
198,
6738,
309,
74,
3849,
1330,
1635,
201,
198,
6738,
256,
74,
12837,
14253,
1330,
1635,
201,
198,
201,
198,
201,
198,
368,
391,
796,
309,
74,
3419,
... | 2.246988 | 166 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | [
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
220,
220,
... | 2.310747 | 2,317 |
import subprocess
from pathlib import Path
from uuid import uuid4
from django.conf import settings
from django.http import FileResponse
from django.shortcuts import render
from ratelimit import UNSAFE as UNSAFE_METHODS
from ratelimit.decorators import ratelimit
from .forms import MetadataRemovalForm
@ratelimit(key=... | [
11748,
850,
14681,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
4023,
1330,
9220,
31077,
198,
6738,
42625,
14208,
13,
... | 3.128378 | 148 |
from django.shortcuts import render, redirect
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
198,
2,
13610,
534,
5009,
994,
13,
198
] | 3.842105 | 19 |
"""Integration-ish tests for CLI endpoints.
We only mock subprocess calls since we cannot do multi-host testing.
Some of the test above don't verify much, but they at least ensure that all parts work well together.
"""
import os
import sys
from contextlib import contextmanager
from datetime import datetime
from unitt... | [
37811,
34500,
1358,
12,
680,
5254,
329,
43749,
886,
13033,
13,
198,
1135,
691,
15290,
850,
14681,
3848,
1201,
356,
2314,
466,
5021,
12,
4774,
4856,
13,
198,
198,
4366,
286,
262,
1332,
2029,
836,
470,
11767,
881,
11,
475,
484,
379,
1... | 2.665122 | 1,511 |
from pathlib import Path
from keras.layers import Conv2D, MaxPooling2D, Flatten, Dense
from keras.models import Sequential, model_from_json
from keras.datasets import mnist
from keras.utils import to_categorical
from keras.preprocessing import image
import matplotlib.pyplot as plt
import numpy as np
# %matplotlib ... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
34872,
17,
35,
11,
5436,
27201,
278,
17,
35,
11,
1610,
41769,
11,
360,
1072,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
11,
2746,
62,
6738,
62,... | 3.114286 | 105 |
from __future__ import unicode_literals
from django.core.management import BaseCommand
from dbpedia_links_rating.rating.models import Link
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
7308,
21575,
198,
198,
6738,
20613,
50235,
62,
28751,
62,
8821,
13,
8821,
13,
27530,
1330,
7502,
198
] | 3.710526 | 38 |
import unittest
import pandas as pd
from utils import index as utils
from afo.driver import Driver
from test.test_fixtures_funcs import generate_list_str, get_test_file | [
11748,
555,
715,
395,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
3384,
4487,
1330,
6376,
355,
3384,
4487,
198,
6738,
257,
6513,
13,
26230,
1330,
12434,
198,
6738,
1332,
13,
9288,
62,
69,
25506,
62,
12543,
6359,
1330,
... | 3.207547 | 53 |
# mask_decoder.py
#
# Sampson Mao, Anders Poirel
# 26-10-2019
#
# script for decoding the masks for each image in the training set from
# the .csv file, writing the output as a seperate .jpg file for each
# label-image pair
import pandas as pd
import numpy as np
from PIL import Image
def rle2mask(row, height =... | [
2,
9335,
62,
12501,
12342,
13,
9078,
198,
2,
220,
198,
2,
42168,
1559,
22828,
11,
25519,
7695,
557,
75,
198,
2,
2608,
12,
940,
12,
23344,
198,
2,
198,
2,
4226,
329,
39938,
262,
20680,
329,
1123,
2939,
287,
262,
3047,
900,
422,
1... | 2.432039 | 824 |
import os
import requests
import pandas as pd
from datetime import datetime
from easydict import EasyDict as edict
# ----------------------------------------------------------------------------------------------------------------------
# Global variables
# -------------------------------------------------------------... | [
11748,
28686,
198,
11748,
7007,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
2562,
11600,
1330,
16789,
35,
713,
355,
1225,
713,
628,
198,
2,
16529,
3880,
19351,
438,
198,
2,
8060,
9633,
198... | 3.176355 | 1,015 |
#!/usr/bin/env python
from scapy.all import *
pkts = []
pkts += Ether(dst='ff:ff:ff:ff:ff:ff', src='00:01:02:03:04:05')/ \
Dot1Q(vlan=6)/ \
IP(dst='1.2.3.4', src='5.6.7.8')/UDP(dport=53)/DNS(id=1, rd=1, qd=DNSQR(qname='example.com'))
pkts += Ether(dst='ff:ff:ff:ff:ff:ff', src='00:01:02:03:04:05')/ \
Dot1Q... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
629,
12826,
13,
439,
1330,
1635,
198,
198,
79,
74,
912,
796,
17635,
198,
198,
79,
74,
912,
15853,
20017,
7,
67,
301,
11639,
487,
25,
487,
25,
487,
25,
487,
25,
487,
25,
487... | 1.718861 | 281 |
import os
import re
import glob
from pathlib import Path
from tqdm import tqdm
import supernotelib as sn
SUPERNOTE_PATH = '/run/user/1000/gvfs/mtp:host=rockchip_Supernote_A5_X_SN100B10004997/Supernote/Note'
OUTPUT_PATH = '../Notes_synced'
assert os.path.exists(SUPERNOTE_PATH)
assert os.path.exists(OUTPUT_PATH)
f... | [
11748,
28686,
198,
11748,
302,
198,
11748,
15095,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
2208,
1662,
417,
571,
355,
3013,
198,
198,
40331,
1137,
16580,
62,
34219,
796,
31051,
514... | 2.298305 | 295 |
if __name__ == '__main__':
from setuptools import setup, Extension
_synctex_parser = Extension('pysynctex._synctex_parser',
sources=['wrapper/synctex_parser.i',
'wrapper/synctex_package/synctex_parser.c',
'wrapp... | [
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
422,
900,
37623,
10141,
1330,
9058,
11,
27995,
198,
220,
220,
220,
220,
198,
220,
220,
220,
4808,
28869,
310,
1069,
62,
48610,
796,
27995,
10786,
79,
893,
... | 2.022355 | 671 |
import os
import time
import errno
import socket
from nrepl._compat import urlparse
from nrepl.clj import get_ns
from nrepl.utils import console, get_ts, traverse_dir
from nrepl.client import Client
COLOR_GRAY = '2'
COLOR_RED = '0;31'
| [
11748,
28686,
198,
11748,
640,
198,
11748,
11454,
3919,
198,
11748,
17802,
198,
198,
6738,
299,
35666,
13557,
5589,
265,
1330,
19016,
29572,
198,
6738,
299,
35666,
13,
565,
73,
1330,
651,
62,
5907,
198,
6738,
299,
35666,
13,
26791,
1330... | 3.0125 | 80 |
import numpy as np
import os
import json
import tensorflow as tf
from tensorflow.keras.models import model_from_json
from tensorflow.keras.preprocessing import image
from tensorflow.compat.v1 import ConfigProto
from tqdm import tqdm
import shutil
from animal_classification_report_generator import Animal_Classi... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
28686,
201,
198,
11748,
33918,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
27530,
1330,
2746,
62,
6738,
62,
17752,
201,
198,
6738,... | 2.275441 | 1,474 |
#!/usr/bin/env python
# pylint: disable=C0111, C0325
import logging
import sys
import tempfile
from pprint import pprint
from cutlass import HostVariantCall
from cutlass import iHMPSession
username = "test"
password = "test"
def set_logging():
""" Setup logging. """
root = logging.getLogger()
root.setLe... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
34,
486,
1157,
11,
327,
3070,
1495,
198,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
20218,
7753,
198,
6738,
279,
4798,
1330,
279,
4798,
... | 2.575685 | 839 |
import argparse
# import sys
import os
from patient import Patient
from vitals import VitalSigns
from lab import Lab
from socialhistory import SocialHistory
from familyhistory import FamilyHistory
from immunization import Immunization
from procedure import Procedure
from condition import Condition
from m... | [
11748,
1822,
29572,
198,
2,
1330,
25064,
198,
11748,
28686,
198,
6738,
5827,
220,
220,
220,
220,
220,
220,
1330,
35550,
198,
6738,
410,
8321,
1330,
28476,
11712,
82,
198,
6738,
2248,
1330,
3498,
198,
6738,
1919,
23569,
1330,
5483,
18122... | 2.37362 | 1,630 |
import unittest
import numpy as np
import sklearn
import sklearn.datasets
from incremental_trees.models.classification.streaming_extc import StreamingEXTC
from incremental_trees.models.regression.streaming_extr import StreamingEXTR
from incremental_trees.models.regression.streaming_rfr import StreamingRFR
from increm... | [
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1341,
35720,
198,
11748,
1341,
35720,
13,
19608,
292,
1039,
198,
198,
6738,
29497,
62,
83,
6037,
13,
27530,
13,
4871,
2649,
13,
5532,
278,
62,
2302,
66,
1330,
... | 1.821113 | 12,684 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import socket
import os
import socks
import json
from core.targets import target_type
from core.alert import info
from core.alert import messages
from core.alert import warn
from lib.icmp.engine import send_one_ping, receive_one_ping
from lib.socks_resolver.engine import g... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
17802,
198,
11748,
28686,
198,
11748,
24359,
198,
11748,
33918,
198,
6738,
4755,
13,
83,
853,
1039,
1330,
2... | 2.697531 | 324 |
""" CryptoPy - a pure python cryptographic libraries
cryptopy.passwords package
Copyright (c) 2002 by Paul A. Lambert
Read LICENSE.txt for license information.
"""
| [
37811,
36579,
20519,
532,
257,
5899,
21015,
40705,
12782,
628,
220,
220,
220,
8194,
11081,
13,
6603,
10879,
5301,
628,
220,
220,
220,
15069,
357,
66,
8,
6244,
416,
3362,
317,
13,
36978,
198,
220,
220,
220,
4149,
38559,
24290,
13,
1411... | 3.480769 | 52 |
from django.contrib import admin
from django.http import QueryDict
from django.urls import reverse
from django.utils.html import format_html
from .forms import (
AgencyForm,
CorrespondenceForm,
RecordRequestFileForm,
RecordRequestForm,
)
from .models import Agency, Correspondence, RecordRequest, Record... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
4023,
1330,
43301,
35,
713,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
26791,
13,
6494,
1330,
5794,
62,
6494,
198,
198,
... | 3.323741 | 139 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321... | 3.530612 | 392 |
import numpy as np
import getopt
import vars.utils as utils
import glob
import sys
import pdb
def parse_logs(files):
"""
parses through log files to extract marginal
likelihood estimates from executing the
variational inference algorithm on a dataset.
Arguments:
files : list
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
651,
8738,
198,
11748,
410,
945,
13,
26791,
355,
3384,
4487,
198,
11748,
15095,
198,
11748,
25064,
198,
11748,
279,
9945,
198,
198,
4299,
21136,
62,
6404,
82,
7,
16624,
2599,
628,
220,
220,
2... | 2.402839 | 1,127 |
import sys
import ast
from random import randint
from questions_backend import QuestionGeneration
import requests
from watson_developer_cloud import NaturalLanguageUnderstandingV1
from watson_developer_cloud.natural_language_understanding_v1 import Features, KeywordsOptions
import json
"""
argv[1] : ke... | [
11748,
25064,
201,
198,
11748,
6468,
201,
198,
6738,
4738,
1330,
43720,
600,
201,
198,
6738,
2683,
62,
1891,
437,
1330,
18233,
8645,
341,
201,
198,
11748,
7007,
201,
198,
201,
198,
6738,
266,
13506,
62,
16244,
263,
62,
17721,
1330,
12... | 2.499548 | 1,105 |
from .__init__helper import *
#clear warning from pylance
from .Exit import *
from .Trap import *
from .Chair import *
from .Monster import * | [
6738,
764,
834,
15003,
834,
2978,
525,
1330,
1635,
198,
2,
20063,
6509,
422,
279,
2645,
590,
198,
6738,
764,
30337,
1330,
1635,
198,
6738,
764,
51,
2416,
1330,
1635,
198,
6738,
764,
43189,
1330,
1635,
198,
6738,
764,
40872,
1330,
1635... | 3.357143 | 42 |
#
# @lc app=leetcode id=301 lang=python3
#
# [301] Remove Invalid Parentheses
#
# https://leetcode.com/problems/remove-invalid-parentheses/description/
#
# algorithms
# Hard (44.46%)
# Likes: 3255
# Dislikes: 151
# Total Accepted: 258.9K
# Total Submissions: 577.9K
# Testcase Example: '"()())()"'
#
# Given a str... | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
18938,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
18938,
60,
17220,
17665,
16774,
39815,
198,
2,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
28956,
... | 2.589499 | 419 |