content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import unittest
from AdditionalModules.type_checker import is_valid_number
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
15891,
5841,
5028,
13,
4906,
62,
9122,
263,
1330,
318,
62,
12102,
62,
17618,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
19... | 2.883721 | 43 |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | [
2,
770,
2438,
318,
636,
286,
1195,
1984,
270,
13,
198,
2,
198,
2,
357,
34,
8,
15069,
19764,
2864,
11,
12131,
13,
198,
2,
198,
2,
770,
2438,
318,
11971,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
921,
743,
198,
2,
7330... | 2.132409 | 27,755 |
# Generated by Django 3.0.8 on 2020-11-05 19:38
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
23,
319,
12131,
12,
1157,
12,
2713,
678,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
"""Configuration for the test app."""
ADMIN_USERNAME = "admin"
ADMIN_EMAIL = "admin@localhost"
ADMIN_PASSWORD = "9V0aGfEGAkQTfn8GICqHjAqCzodsUL6IVp02GmtKML8"
BCRYPT_LOG_ROUNDS = 4
SECRET_KEY = "lzlD6LdPmLI6rX-4eEMUeLsIcnkXaDDQYqrAIKahsdY"
SQLALCHEMY_DATABASE_URI = "sqlite://"
SQLALCHEMY_TRACK_MODIFICATIONS = False
TEST... | [
37811,
38149,
329,
262,
1332,
598,
526,
15931,
198,
2885,
23678,
62,
29904,
20608,
796,
366,
28482,
1,
198,
2885,
23678,
62,
27630,
4146,
796,
366,
28482,
31,
36750,
1,
198,
2885,
23678,
62,
47924,
54,
12532,
796,
366,
24,
53,
15,
6... | 1.970238 | 168 |
import wx
import wx.lib.mixins.inspection
from pynput import mouse
import sys
import os
import colordistance.core as core
import colordistance.screen as screen
from colordistance.components import ColorSelector, DifferenceLine
from colordistance.util import assoc
class Application(wx.Frame):
"""
Entry poin... | [
11748,
266,
87,
198,
11748,
266,
87,
13,
8019,
13,
19816,
1040,
13,
1040,
14978,
198,
6738,
279,
2047,
1996,
1330,
10211,
198,
198,
11748,
25064,
198,
198,
11748,
28686,
198,
198,
11748,
951,
585,
9311,
13,
7295,
355,
4755,
198,
11748... | 2.642241 | 928 |
n = '10.5'
print(n)
float(n)
print(n)
cadena = "Un numero podría ser " + str(10) + ' y un decimal podria ser ' + str(12.4)
print(cadena)
# CONVERSION DE UN NUMERO A BINARIO
print(bin(10))
# CONVERSION DE UN NUMERO A HEXADECIMAL
print(hex(13))
#CONVERSION DE UNA CADENA A BINARIO
print(int('0b1010', 2))
#CONVERSION DE... | [
77,
796,
705,
940,
13,
20,
6,
198,
4798,
7,
77,
8,
198,
22468,
7,
77,
8,
198,
4798,
7,
77,
8,
198,
198,
66,
38047,
796,
366,
3118,
997,
3529,
24573,
81,
29690,
1055,
366,
1343,
965,
7,
940,
8,
1343,
705,
331,
555,
32465,
245... | 2.242321 | 293 |
#!/bin/python
print('I am:', __name__)
if __name__ == '__main__':
print(minmax(lessthan, 4, 2, 1, 5, 6, 3))
print(minmax(grtrthan, 4, 2, 1, 5, 6, 3))
| [
2,
48443,
8800,
14,
29412,
198,
198,
4798,
10786,
40,
716,
25,
3256,
11593,
3672,
834,
8,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3601,
7,
1084,
9806,
7,
829,
301,
7637,
11,
604,
11,... | 2 | 80 |
""" Convert a PCF file into a VPR io.place file. """
from __future__ import print_function
import argparse
import sys
import vpr_place_constraints
import sqlite3
import lxml.etree as ET
if __name__ == '__main__':
main()
| [
37811,
38240,
257,
4217,
37,
2393,
656,
257,
569,
4805,
33245,
13,
5372,
2393,
13,
37227,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
410,
1050,
62,
5372,
62,
1102,
2536,
... | 2.974026 | 77 |
# -*- generated by 1.0.9 -*-
import da
PatternExpr_243 = da.pat.TuplePattern([da.pat.ConstantPattern('access'), da.pat.FreePattern('newtok')])
PatternExpr_255 = da.pat.TuplePattern([da.pat.ConstantPattern('request'), da.pat.FreePattern('c'), da.pat.FreePattern('p')])
PatternExpr_283 = da.pat.TuplePattern([da.pat.Consta... | [
2,
532,
9,
12,
7560,
416,
352,
13,
15,
13,
24,
532,
9,
12,
198,
11748,
12379,
198,
47546,
3109,
1050,
62,
26660,
796,
12379,
13,
8071,
13,
51,
29291,
47546,
26933,
6814,
13,
8071,
13,
3103,
18797,
47546,
10786,
15526,
33809,
12379,
... | 2.837563 | 394 |
import logging
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Tuple, cast
from bugout.app import Bugout
from bugout.data import BugoutResource
from moonstreamdb.blockchain import AvailableBlockchainType, get_label_model
from sqlalchemy import and_, or_, text
from sqlalchemy.orm ... | [
11748,
18931,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
32233,
11,
309,
29291,
11,
3350,
198,
198,
6738,
5434,
448,
13,
1324,
1330,
15217,
448,
198,
6738,
... | 3.34585 | 506 |
from typing import Dict, List, Set, Callable
# https://github.com/cilium/cilium/blob/master/pkg/identity/numericidentity.go#L33
reserved_identities = {
0: ["reserved:unknown"],
1: ["reserved:host"],
2: ["reserved:world"],
3: ["reserved:cluster"],
4: ["reserved:health"],
5: ["reserved:init"]
}
... | [
6738,
19720,
1330,
360,
713,
11,
7343,
11,
5345,
11,
4889,
540,
628,
198,
2,
3740,
1378,
12567,
13,
785,
14,
2856,
1505,
14,
2856,
1505,
14,
2436,
672,
14,
9866,
14,
35339,
14,
738,
414,
14,
77,
39223,
738,
414,
13,
2188,
2,
43,... | 2.137143 | 525 |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | [
7804,
198,
2,
15069,
357,
66,
8,
1946,
402,
13827,
4561,
2114,
21852,
12052,
13,
1439,
2489,
10395,
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,
4... | 3.256849 | 292 |
print("<!DOCTYPE html><html><body>")
# arr =[[0, 152, 17, 252, 146, 88], [1, 260, 335, 63, 44, 17], [2, 53, 72, 130, 24, 80], [3, 352, 178, 32, 30, 287], [4, 80, 24, 17, 77, 28], [5, 85, 79, 276, 158, 63], [6, 376, 85, 16, 251, 382], [7, 17, 378, 16, 376, 384], [8, 79, 180, 183, 362, 85], [9, 80, 28, 17, 11, 36], [10, ... | [
4798,
7203,
27,
0,
18227,
4177,
56,
11401,
27711,
6927,
6494,
6927,
2618,
29,
4943,
198,
2,
5240,
796,
30109,
15,
11,
24848,
11,
1596,
11,
25264,
11,
22986,
11,
9193,
4357,
685,
16,
11,
21148,
11,
37144,
11,
8093,
11,
5846,
11,
15... | 2.045765 | 237,651 |
# Open the input file
with open("Prob07.in.txt", "rt") as inputFile:
# Read the number of test cases (trim out the newline)
cases = int(inputFile.readline().replace("\n", ""))
# For each test case
for caseNum in range(cases):
# Read the number of words
wordCount = int(inputFile.readline(... | [
2,
4946,
262,
5128,
2393,
198,
4480,
1280,
7203,
2964,
65,
2998,
13,
259,
13,
14116,
1600,
366,
17034,
4943,
355,
5128,
8979,
25,
198,
220,
220,
220,
1303,
4149,
262,
1271,
286,
1332,
2663,
357,
2213,
320,
503,
262,
649,
1370,
8,
... | 1.956698 | 739 |
import sys
import mock
import libvirt
import difflib
import unittest
from see.context.resources import vbox
def compare(text1, text2):
"""Utility function for comparing text and returining differences."""
diff = difflib.ndiff(text1.splitlines(True), text2.splitlines(True))
return '\n' + '\n'.join(diff)
... | [
11748,
25064,
198,
11748,
15290,
198,
11748,
9195,
48940,
198,
11748,
814,
8019,
198,
11748,
555,
715,
395,
198,
198,
6738,
766,
13,
22866,
13,
37540,
1330,
410,
3524,
628,
198,
4299,
8996,
7,
5239,
16,
11,
2420,
17,
2599,
198,
220,
... | 3.018692 | 107 |
""" Modifications Copyright (c) 2019 Uber Technologies, Inc. """
import numpy as np
import cv2
import torch
import gym
import argparse
import os
import utils
import TD3
import OurDDPG
import D3G
import Standard_QSS
# Runs policy for X episodes and returns average reward
# A fixed seed is used for the eval environ... | [
37811,
3401,
6637,
15069,
357,
66,
8,
13130,
12024,
21852,
11,
3457,
13,
37227,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
28034,
198,
11748,
11550,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
198... | 2.048687 | 3,656 |
#https://docs.python.org/3/libraty/functions.html#open
#costumase usar o bloco try para abrir arquivos
try:
file = open('abc.txt', 'w+')
file.write('Linha')# o arquivo esta vazio entao escrevemos
file.seek(0)
print(file.read())
finally: #para garantir que o arquivo sera fechado se holver e... | [
2,
5450,
1378,
31628,
13,
29412,
13,
2398,
14,
18,
14,
75,
2889,
265,
88,
14,
12543,
2733,
13,
6494,
2,
9654,
198,
2,
15805,
388,
589,
514,
283,
267,
24003,
78,
1949,
31215,
450,
29283,
610,
421,
452,
418,
198,
198,
28311,
25,
1... | 2.235294 | 153 |
# --------------
#Importing header files
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
#Path of the file is stored in the variable path
#Code starts here
# Data Loading
data=pd.read_csv(path)
data.rename(columns={'Total':'Total_Medals'},inplace=True)
data.head(10)
# Summer or Winter
data['B... | [
2,
220,
26171,
198,
2,
20939,
278,
13639,
3696,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2,
15235,
286,
262,
2393,
318,
8574,
2... | 2.533385 | 1,288 |
from typing import Union
welder = Position(name='Alex', surname='Murphy', position='welder', wage=120000, bonus=30000)
print(welder)
print(welder.get_full_name())
miller = Position(name='Anne', surname='Lewis', position='miller', wage=150000, bonus=24000)
print(miller)
print(miller.get_total_income())
| [
6738,
19720,
1330,
4479,
628,
628,
198,
732,
6499,
796,
23158,
7,
3672,
11639,
15309,
3256,
40358,
11639,
23830,
6883,
3256,
2292,
11639,
732,
6499,
3256,
7699,
28,
1065,
2388,
11,
7202,
28,
18,
2388,
8,
198,
4798,
7,
732,
6499,
8,
... | 2.990291 | 103 |
#!/usr/bin/env python3
# -*- coding: utf8
# obstacle2osm
# Converts aviation obstacles from Kartverket WFS/GML files for import/update in OSM
# Usage: obstacle2.osm [county]
# Creates OSM file with name "Luftfartshinder_" + county + ".osm"
import html
import time
import sys
import urllib.request
import json
import z... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
198,
198,
2,
22007,
17,
418,
76,
198,
2,
1482,
24040,
22548,
17648,
422,
32872,
332,
7126,
370,
10652,
14,
38,
5805,
3696,
329,
1330,
... | 2.273448 | 4,286 |
import time
from blinds import Blinds, NEUTRAL, UP, DOWN
# janky way to calibrate blinds to be open/closed to the right amount
# edit this file to change UP/DOWN to move blinds in desired direction,
# save and then run
if __name__ == '__main__':
main()
| [
11748,
640,
198,
198,
6738,
7770,
82,
1330,
24507,
82,
11,
10635,
3843,
35296,
11,
15958,
11,
30320,
198,
198,
2,
474,
39556,
835,
284,
33801,
378,
7770,
82,
284,
307,
1280,
14,
20225,
284,
262,
826,
2033,
198,
2,
4370,
428,
2393,
... | 3.25 | 80 |
import pytest
import os
from jinja2 import Environment, BaseLoader
from svl.compiler.compiler import _extract_additional_datasets, svl
from svl.compiler.errors import (
SvlSyntaxError,
SvlMissingFileError,
SvlPlotError,
SvlDataLoadError,
SvlDataProcessingError,
)
CURRENT_DIR = os.path.dirname(os... | [
11748,
12972,
9288,
198,
11748,
28686,
198,
198,
6738,
474,
259,
6592,
17,
1330,
9344,
11,
7308,
17401,
198,
198,
6738,
264,
19279,
13,
5589,
5329,
13,
5589,
5329,
1330,
4808,
2302,
974,
62,
2860,
1859,
62,
19608,
292,
1039,
11,
264,
... | 2.411341 | 2,081 |
from djaveAPI.docs import docs
from djaveURL import protocol_and_host
| [
6738,
42625,
1015,
17614,
13,
31628,
1330,
34165,
198,
6738,
42625,
1015,
21886,
1330,
8435,
62,
392,
62,
4774,
628
] | 3.55 | 20 |
from pathlib import Path
import numpy as np
import pandas as pd
from pylab import plt
from progressbar import ProgressBar
from models import sklearn_model
| [
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
279,
2645,
397,
1330,
458,
83,
198,
6738,
4371,
5657,
1330,
18387,
10374,
198,
198,
6738,
4981,
1330,
1341,
35720,
... | 3.590909 | 44 |
from __future__ import print_function
import math
import copy
import json
dancer = {
verbs : {}
adjs: {}
}
# dancer describes the state of a conscious being
# relation describes the feeling of one regarding another
dancer["adjs"]["lust"]
dancer["adjs"]["like"]
# define the archetypal relations
dancer["relati... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
10688,
198,
11748,
4866,
198,
11748,
33918,
198,
198,
67,
8250,
796,
1391,
198,
197,
197,
46211,
1058,
23884,
198,
197,
197,
324,
8457,
25,
23884,
198,
197,
197,
92,
198,
198,... | 2.637519 | 5,901 |
##### CLASSE ARBRE #####
#Initialise l'arbre
#Emplacement du sous arbre gauche
#Feuille la plus lourde de l'arbre
#Liste des feuille de l'arbre
#Largeur du noeud
#Place les arbres
#Largeur de l'arbre pour le dessin
#Longueur de l'arbre pour le dess... | [
4242,
2,
7852,
1921,
5188,
5923,
40438,
46424,
198,
197,
198,
197,
2,
24243,
786,
300,
6,
283,
4679,
628,
198,
220,
220,
220,
220,
198,
220,
220,
220,
1303,
10161,
489,
5592,
7043,
264,
516,
610,
4679,
14885,
2395,
628,
220,
220,
... | 2.06 | 200 |
import cv2
import math
from pynput.mouse import Button
| [
11748,
269,
85,
17,
198,
11748,
10688,
198,
6738,
279,
2047,
1996,
13,
35888,
1330,
20969,
628
] | 3.294118 | 17 |
import re
def elem2dict(node):
"""
Convert an lxml.etree node tree into a dict.
"""
d = {}
for e in node.iterchildren():
key = e.tag.split('}')[1] if '}' in e.tag else e.tag
value = e.text if e.text else elem2dict(e)
d[key] = value
return d
| [
11748,
302,
628,
198,
4299,
9766,
76,
17,
11600,
7,
17440,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
38240,
281,
300,
19875,
13,
316,
631,
10139,
5509,
656,
257,
8633,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
... | 2.130435 | 138 |
from setuptools import setup, find_packages
import codecs
import pathlib
import re
here = pathlib.Path(__file__).parent.resolve()
def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with codecs.open(pathlib.Pure... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
11748,
40481,
82,
198,
11748,
3108,
8019,
198,
11748,
302,
628,
198,
1456,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
8000,
13,
411,
6442,
3419,
628,
198,
4299,
... | 2.249724 | 1,810 |
###############################################################################
import numpy as np
import random as rn
#DO NOT CHANGE THIS
np.random.seed(1478)
rn.seed(2264)
###################
from utils import load_datasets_filenames, load_experiment_configuration
from utils import load_dataset, save_predictions
fr... | [
29113,
29113,
7804,
4242,
21017,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
355,
374,
77,
198,
198,
2,
18227,
5626,
5870,
27746,
12680,
198,
37659,
13,
25120,
13,
28826,
7,
1415,
3695,
8,
198,
35906,
13,
28826,
7,
1828,
241... | 2.486667 | 1,200 |
#!/usr/bin/env python3
import evdev
import select
import requests
import subprocess
import re
from datetime import datetime
roon_base_url = "http://greenspeaker:3000/api/v1"
harmony_base_url = "http://m1:8282/hubs/harmony-hub/devices/schiit-amp/commands"
p = re.compile('"zone_id": "([a-z0-9]+)",\n *"display_name": "... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
819,
7959,
198,
11748,
2922,
198,
11748,
7007,
198,
11748,
850,
14681,
198,
11748,
302,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
305,
261,
62,
8692,
62,
6371,... | 1.669225 | 2,606 |
"""
Manipulate images in specific ways based on commands used on input.
This module is used in order to manipulate images in a number of ways.
All of this is done through the ImageO object. The ImageO object reads in a file and allows for
manipulations to be done on an image and for that image to be output after the ... | [
37811,
198,
5124,
541,
5039,
4263,
287,
2176,
2842,
1912,
319,
9729,
973,
319,
5128,
13,
198,
198,
1212,
8265,
318,
973,
287,
1502,
284,
18510,
4263,
287,
257,
1271,
286,
2842,
13,
198,
198,
3237,
286,
428,
318,
1760,
832,
262,
7412... | 2.195083 | 6,915 |
# 导入了 time.ctime()和 socket 模块的所有属性
from socket import *
from time import ctime
HOST = '' # HOST 变量是空白的,这是对 bind()方法的标识,表示它可以使用任何可用的地址
PORT = 21567 # 选择了一个随机的端口号,并且该端口号似乎没有被使用或被系统保留
BZUGSIZ = 1024 # 对于该 应用程序,将缓冲区大小设置为 1KB。可以根据网络性能和程序需要改变这个容量
ADDR = (HOST, PORT)
tcpSerSock = socket(AF_INET, SOCK_STREAM) # ... | [
198,
2,
10263,
107,
120,
17739,
98,
12859,
228,
640,
13,
310,
524,
3419,
161,
240,
234,
17802,
10545,
101,
94,
161,
251,
245,
21410,
33699,
222,
17312,
231,
161,
109,
252,
45250,
100,
198,
198,
6738,
17802,
1330,
1635,
198,
6738,
64... | 0.912746 | 1,169 |
# -*- coding: utf-8 -*-
import uuid
from tinymce import HTMLField
from django.db import models
from django.urls import reverse
from django.core.mail import EmailMessage
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from crm.utils import print_pdf
CONFERENCE_REGISTRATION_TYP... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
334,
27112,
198,
6738,
7009,
76,
344,
1330,
11532,
15878,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
1... | 3.167939 | 131 |
import re
import pytest
from sqlalchemy import Column
from sqlalchemy import MetaData
from sqlalchemy import Table
from sqlalchemy.sql import func
from sqlalchemy.sql import insert
from sqlalchemy.sql import text
from geoalchemy2.exc import ArgumentError
from geoalchemy2.types import Geography
from geoalchemy2.types ... | [
11748,
302,
198,
198,
11748,
12972,
9288,
198,
6738,
44161,
282,
26599,
1330,
29201,
198,
6738,
44161,
282,
26599,
1330,
30277,
6601,
198,
6738,
44161,
282,
26599,
1330,
8655,
198,
6738,
44161,
282,
26599,
13,
25410,
1330,
25439,
198,
673... | 3.323741 | 139 |
from homeassistant import config_entries
from homeassistant.core import callback
from collections import OrderedDict
from .auth import get_master_token, get_access_token
from .const import (
DOMAIN,
CONF_USERNAME,
CONF_PASSWORD,
CONF_MASTER_TOKEN,
CONF_DEVICE_TYPES,
CONF_RSSI_THRESHOLD,
CONF... | [
6738,
1363,
562,
10167,
1330,
4566,
62,
298,
1678,
198,
6738,
1363,
562,
10167,
13,
7295,
1330,
23838,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
764,
18439,
1330,
651,
62,
9866,
62,
30001,
11,
651,
62,
15526,
62,
30001,... | 2.456274 | 263 |
import os.path as osp
from mmcv.utils import TORCH_VERSION
from mmcv.runner.dist_utils import master_only
from mmcv.runner import HOOKS
from torch.utils.data import DataLoader
from mmcv.runner.hooks.logger import LoggerHook
import torch
import numpy as np
from .utils import CompareMultiLayerDist
@HOOKS.register_module... | [
11748,
28686,
13,
6978,
355,
267,
2777,
198,
6738,
8085,
33967,
13,
26791,
1330,
40691,
3398,
62,
43717,
198,
6738,
8085,
33967,
13,
16737,
13,
17080,
62,
26791,
1330,
4958,
62,
8807,
198,
6738,
8085,
33967,
13,
16737,
1330,
367,
15308,... | 3.285714 | 98 |
from typing import Dict, Tuple
import torch
from classifier.classes.core.Model import Model
from classifier.classes.modules.text.transformer.Transformer import Transformer
| [
6738,
19720,
1330,
360,
713,
11,
309,
29291,
198,
198,
11748,
28034,
198,
198,
6738,
1398,
7483,
13,
37724,
13,
7295,
13,
17633,
1330,
9104,
198,
6738,
1398,
7483,
13,
37724,
13,
18170,
13,
5239,
13,
7645,
16354,
13,
8291,
16354,
1330... | 3.888889 | 45 |
#!/usr/bin/env python
import tarfile
import urllib
import re
import StringIO
import os
basedir = 'src/jvm/io/fsq/twofishes/indexer/data/downloaded'
flickr_shapes_file_name = os.path.join(basedir, 'flickr_shapes_public_dataset_2.0.tar.gz')
try:
open(flickr_shapes_file_name)
except IOError as e:
print 'Downloadin... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
13422,
7753,
198,
11748,
2956,
297,
571,
198,
11748,
302,
198,
11748,
10903,
9399,
198,
11748,
28686,
198,
198,
3106,
343,
796,
705,
10677,
14,
73,
14761,
14,
952,
14,
9501... | 2.498599 | 357 |
from abc import ABC, abstractmethod
from typing import Optional
storage: Optional[AbstractStorage] = None
# Функция понадобится при внедрении зависимостей
| [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
32233,
628,
198,
198,
35350,
25,
32233,
58,
23839,
31425,
60,
796,
6045,
628,
198,
2,
12466,
97,
35072,
22177,
31583,
141,
228,
18849,
40623,
12466,
123,
15166,
22177,... | 2.051282 | 78 |
import argparse
import os
import sys
import keras
import tensorflow as tf
# print(__name__,'__package__:',__package__)
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
import convnet3d.bin # noqa: F401
__package__ = "convnet3d.bin"... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
41927,
292,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
2,
3601,
7,
834,
3672,
834,
4032,
834,
26495,
834,
25,
3256,
834,
26495,
834,
8,
198,
198,
361,
115... | 2.916766 | 841 |
import logging
import subprocess
logging.basicConfig(level = logging.INFO)
logger = logging.getLogger(__name__)
news_sites_uid = ['elpais']
if __name__ == '__main__':
main() | [
11748,
18931,
220,
198,
11748,
850,
14681,
198,
198,
6404,
2667,
13,
35487,
16934,
7,
5715,
796,
18931,
13,
10778,
8,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
198,
10827,
62,
49315,
62,
27112,
7... | 2.710145 | 69 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Update or create an Apple XCode project localization strings file.
TODO: handle localization domains
'''
from __future__ import with_statement
import sys
import os
import os.path
import re
import tempfile
import subprocess
import codecs
import unittest
import optpar... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
10260,
393,
2251,
281,
4196,
1395,
10669,
1628,
42842,
13042,
2393,
13,
198,
198,
51,
3727,
46,
25... | 2.315552 | 6,430 |
from enum import Enum, auto
| [
6738,
33829,
1330,
2039,
388,
11,
8295,
628
] | 3.625 | 8 |
"""
Sending additional var-binds
++++++++++++++++++++++++++++
Send SNMP notification using the following options:
* SNMPv2c
* with community name 'public'
* over IPv4/UDP
* send INFORM notification
* with TRAP ID 'coldStart' specified as a MIB symbol
* include managed object information specified as a MIB symbol
Fun... | [
37811,
198,
50,
1571,
3224,
1401,
12,
21653,
82,
198,
44627,
25128,
14030,
198,
198,
25206,
11346,
7378,
14483,
1262,
262,
1708,
3689,
25,
198,
198,
9,
11346,
7378,
85,
17,
66,
198,
9,
351,
2055,
1438,
705,
11377,
6,
198,
9,
625,
... | 2.390533 | 507 |
"""
Author: Remy Priem (remy.priem@onera.fr)
This package is distributed under New BSD license.
"""
from __future__ import division
import numpy as np
from scipy import linalg
from smt.utils.kriging_utils import differences
from smt.surrogate_models.krg_based import KrgBased
from smt.utils.kriging_utils import compo... | [
37811,
198,
13838,
25,
32912,
4389,
368,
357,
260,
1820,
13,
3448,
368,
31,
261,
8607,
13,
8310,
8,
198,
198,
1212,
5301,
318,
9387,
739,
968,
347,
10305,
5964,
13,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
117... | 3.090909 | 121 |
import FWCore.ParameterSet.Config as cms
TrackerTFPProducer_params = cms.PSet (
LabelDTC = cms.string( "TrackerDTCProducer" ), #
LabelGP = cms.string( "TrackerTFPProducerGP" ), #
LabelHT = cms.string( "TrackerTFPProducerHT" ), #
LabelMHT = cms.string( "TrackerTF... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
35694,
51,
5837,
11547,
2189,
62,
37266,
796,
269,
907,
13,
3705,
316,
357,
628,
220,
36052,
35,
4825,
220,
220,
220,
220,
220,
220,
220,
220,
796,
269,
907,
... | 2.268519 | 648 |
from organization.views import OrgView,AddUserAskView,OrgHomeView,OrgCourseView,OrgDescView,\
OrgTeacherView,AddFavView,TeacherListView,TeacherDetailView
from django.conf.urls import url,include
#from django.urls import path,re_path
# 要写上app的名字
app_name = "organization"
urlpatterns = [
#课程机构列表页
url(r'^lis... | [
6738,
4009,
13,
33571,
1330,
1471,
70,
7680,
11,
4550,
12982,
25214,
7680,
11,
46808,
16060,
7680,
11,
46808,
49046,
7680,
11,
46808,
24564,
7680,
11,
59,
198,
220,
220,
220,
1471,
70,
6767,
3493,
7680,
11,
4550,
37,
615,
7680,
11,
... | 2.121593 | 477 |
"""Tests for rhasspyhermes.wake"""
from rhasspyhermes.wake import HotwordDetected, HotwordToggleOff, HotwordToggleOn
wakeword_id = "testWakeWord"
def test_hotword_detected():
"""Test HotwordDetected."""
assert HotwordDetected.is_topic(HotwordDetected.topic(wakeword_id=wakeword_id))
assert (
Hotwo... | [
37811,
51,
3558,
329,
9529,
562,
9078,
372,
6880,
13,
48530,
37811,
198,
6738,
9529,
562,
9078,
372,
6880,
13,
48530,
1330,
6964,
4775,
11242,
11197,
11,
6964,
4775,
51,
20258,
9362,
11,
6964,
4775,
51,
20258,
2202,
198,
198,
48530,
4... | 2.581132 | 265 |
import json
import os
from tqdm import tqdm
import geojson
import shapefile
from geography.models import Geometry
| [
11748,
33918,
198,
11748,
28686,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
198,
11748,
4903,
13210,
1559,
198,
11748,
5485,
7753,
198,
6738,
27876,
13,
27530,
1330,
2269,
15748,
628
] | 3.441176 | 34 |
"""Provide tests for the node value."""
from openzwavemqtt.const import (
EVENT_VALUE_ADDED,
EVENT_VALUE_CHANGED,
EVENT_VALUE_REMOVED,
)
def test_value_events(mgr):
"""Test value events."""
events = []
# Fill parent data.
mgr.mock_receive_json("OpenZWave/1/node/2", {})
mgr.mock_receiv... | [
37811,
15946,
485,
5254,
329,
262,
10139,
1988,
526,
15931,
198,
6738,
1280,
89,
19204,
76,
80,
926,
13,
9979,
1330,
357,
198,
220,
220,
220,
49261,
62,
39488,
62,
29266,
1961,
11,
198,
220,
220,
220,
49261,
62,
39488,
62,
3398,
155... | 2.291845 | 699 |
#!/usr/bin/python
# Import the PCA9685 module.
import Adafruit_PCA9685
import time
import random
import sys
import json
# Initialise the PCA9685 using the default address (0x40).
pwm = Adafruit_PCA9685.PCA9685(0x40)
pwm.set_pwm_freq(60)
SRV_OPTIONS = []
ACTIONS = {}
STATUS=""
thingfile = "/home/pi/pimeup/thingbox/t... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
17267,
262,
4217,
32,
24,
35978,
8265,
13,
198,
11748,
1215,
1878,
4872,
62,
5662,
32,
24,
35978,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
25064,
198,
11748,
33918,
198,
2,
20... | 2.445055 | 182 |
## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera
## 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... | [
2235,
15069,
1853,
12,
23344,
13778,
4563,
19948,
259,
11,
28855,
49858,
198,
198,
2235,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2235,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 2.342471 | 5,545 |
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from typing import Callable, Dict, List, Set, Tuple, Union
import pytest
from datadog_checks.base.stubs.aggregator import AggregatorStub
from datadog_checks.dev import get_docker_hostname, get_... | [
2,
357,
34,
8,
16092,
324,
519,
11,
3457,
13,
12131,
12,
25579,
198,
2,
1439,
2489,
10395,
198,
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
357,
3826,
38559,
24290,
8,
198,
11748,
28686,
198,
6738,
19720,
1330,
... | 2.410003 | 3,739 |
# Copyright (c) 2010 Noah Kantrowitz <noah@coderanger.net>
__version__ = (0, 3, 0)
from chef.api import ChefAPI, autoconfigure
from chef.client import Client
from chef.data_bag import DataBag, DataBagItem
from chef.exceptions import ChefError
from chef.node import Node
from chef.role import Role
from chef.environment... | [
2,
15069,
357,
66,
8,
3050,
18394,
29576,
808,
4224,
1279,
3919,
993,
31,
66,
12342,
2564,
13,
3262,
29,
198,
198,
834,
9641,
834,
796,
357,
15,
11,
513,
11,
657,
8,
198,
198,
6738,
21221,
13,
15042,
1330,
26383,
17614,
11,
1960,
... | 3.443478 | 115 |
"""
===========
NH2D fitter: ortho- and para- in the same file, but not modeled together
===========
Reference for line params:
F. Daniel et al. (2016) line frequencies and line strengths.
It includes HFS due to D
http://adsabs.harvard.edu/abs/2016A%26A...586L...4D
"""
from . import hyperfine
import astropy.units as ... | [
37811,
198,
2559,
18604,
198,
33863,
17,
35,
277,
1967,
25,
29617,
78,
12,
290,
31215,
12,
287,
262,
976,
2393,
11,
475,
407,
29563,
1978,
198,
2559,
18604,
198,
26687,
329,
1627,
42287,
25,
198,
198,
37,
13,
7806,
2123,
435,
13,
... | 1.603803 | 6,416 |
password="4bd9270216a6d2e7bc330cf396f7c8f2"
| [
28712,
2625,
19,
17457,
24,
1983,
2999,
1433,
64,
21,
67,
17,
68,
22,
15630,
26073,
12993,
34107,
69,
22,
66,
23,
69,
17,
1,
198
] | 1.692308 | 26 |
from typing import List
from typing import Dict
from typing import NamedTuple
# from typing import Optional
| [
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
34441,
51,
29291,
198,
2,
422,
19720,
1330,
32233,
628,
198
] | 4.4 | 25 |
#!/usr/bin/env python3
import asyncio
import websockets
import threading
import queue
import secrets
asyncio.run(main())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
30351,
952,
198,
11748,
2639,
11603,
198,
11748,
4704,
278,
198,
11748,
16834,
198,
11748,
13141,
198,
198,
292,
13361,
952,
13,
5143,
7,
12417,
28955,
198
] | 3.153846 | 39 |
"""
A demultiplexing element that splits packet streams by flow_id.
"""
class FlowDemux:
"""
The constructor takes a list of downstream elements for the
corresponding output ports as its input.
"""
def put(self, packet):
""" Sends a packet to this element. """
self.packets_receive... | [
37811,
198,
32,
1357,
586,
2480,
87,
278,
5002,
326,
30778,
19638,
15190,
416,
5202,
62,
312,
13,
198,
37811,
628,
198,
4871,
27782,
11522,
2821,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
383,
23772,
2753,
257,
1351,
286,
3... | 2.371041 | 221 |
# author: Mahmud Ahsan
# code: https://github.com/mahmudahsan/thinkdiff
# blog: http://thinkdiff.net
# http://pythonbangla.com
# MIT License
# --------------------------
# Files
# --------------------------
## Reading full contents of a text file
'''
Encouraged way
with keyword close the file automatically
'''
... | [
2,
1772,
25,
31556,
463,
7900,
12807,
198,
2,
2438,
25,
3740,
1378,
12567,
13,
785,
14,
76,
993,
41650,
993,
12807,
14,
14925,
26069,
198,
2,
4130,
25,
2638,
1378,
14925,
26069,
13,
3262,
198,
2,
2638,
1378,
29412,
36668,
5031,
13,
... | 2.420639 | 1,909 |
from flask import Flask
from flask import json
from multiprocessing import Queue
responses_ = Queue()
port = 4001
app = Flask(__name__)
@app.route("/state/<int:time>")
| [
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
33918,
198,
6738,
18540,
305,
919,
278,
1330,
4670,
518,
198,
198,
16733,
274,
62,
796,
4670,
518,
3419,
198,
634,
796,
7337,
16,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
62... | 2.932203 | 59 |
from numbers import Number
from typing import Iterable, Tuple, Union, List, Optional
import copy
import numpy as np
from .cell import Cell
from .cell_indices import CellIndices
from .serialization import Serialization
# Acceptable values for the slice
T_slice = Union[np.ndarray,
List[Number], List[st... | [
6738,
3146,
1330,
7913,
198,
6738,
19720,
1330,
40806,
540,
11,
309,
29291,
11,
4479,
11,
7343,
11,
32233,
198,
11748,
4866,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
764,
3846,
1330,
12440,
198,
6738,
764,
3846,
62,
52... | 2.044063 | 7,739 |
from shlex import quote
from subprocess import getoutput, getstatusoutput
# from flask import current_app
| [
6738,
427,
2588,
1330,
9577,
198,
6738,
850,
14681,
1330,
651,
22915,
11,
651,
13376,
22915,
198,
198,
2,
422,
42903,
1330,
1459,
62,
1324,
628,
628,
628
] | 4 | 28 |
# _________________________________________________________________________
#
# PyUtilib: A Python utility library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the BSD License.
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains ... | [
2,
220,
220,
27193,
2602,
62,
198,
2,
198,
2,
220,
9485,
18274,
22282,
25,
317,
11361,
10361,
5888,
13,
198,
2,
220,
15069,
357,
66,
8,
3648,
3837,
544,
10501,
13,
198,
2,
220,
770,
3788,
318,
9387,
739,
262,
347,
10305,
13789,
... | 3.767123 | 219 |
from rest_framework.serializers import Serializer, DecimalField, IntegerField
from pss_project.api.serializers.rest.metrics.LatencyMetricsSerializer \
import LatencyMetricsSerializer
from pss_project.api.models.rest.metrics.IncrementalMetrics \
import IncrementalMetrics
from pss_project.api.serializers.rest.met... | [
6738,
1334,
62,
30604,
13,
46911,
11341,
1330,
23283,
7509,
11,
4280,
4402,
15878,
11,
34142,
15878,
198,
6738,
279,
824,
62,
16302,
13,
15042,
13,
46911,
11341,
13,
2118,
13,
4164,
10466,
13,
24220,
1387,
9171,
10466,
32634,
7509,
3467... | 3.336207 | 116 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from ._fst import FST
from ._results import FailedTestResult, PassedTestResult
from .exceptions import TestCaseDefinitionError
class TestCase:
"""
An executable test case.
"""
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
32233,
11,
4479,
198,
... | 2.294925 | 729 |
#!/usr/bin/env python
import copy
from collections import deque, defaultdict
from utils.intcode import Machine
from utils.utils import get_input, ints
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
4866,
198,
6738,
17268,
1330,
390,
4188,
11,
4277,
11600,
198,
198,
6738,
3384,
4487,
13,
600,
8189,
1330,
10850,
198,
6738,
3384,
4487,
13,
26791,
1330,
651,
62,
15414,
11... | 3.030769 | 65 |
from __future__ import absolute_import, unicode_literals
import logging
import functools
import threading
import time
from django.http import HttpResponse
from libs import send_email, util
from libs import call_inception
from .models import (
Usermessage,
DatabaseList,
Account,
globalpermissions,
Sq... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
28000,
1098,
62,
17201,
874,
198,
11748,
18931,
198,
11748,
1257,
310,
10141,
198,
11748,
4704,
278,
198,
11748,
640,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6... | 1.568614 | 6,041 |
#!/usr/bin/env python
from __future__ import print_function
from datetime import datetime, timedelta, tzinfo
import boto3
from botocore.exceptions import ClientError
DEFAULT_RETENTION_DAYS = None
"""If None, no default retention is applied"""
ZERO = timedelta(0)
class UTC(tzinfo):
"""
Implements UTC time... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
11,
256,
89,
10951,
198,
11748,
275,
2069,
18,
198,
6738,
10214,
420... | 2.35019 | 791 |
#!/usr/bin/env python
import argparse
import requests
try:
import simplejson as json
except ImportError:
import json
version = '%(prog)s 20180912'
### From Domain
### From IP address
### From Sample
### From AV
### From Report
### Search APINotes
if __name__ == '__main__':
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
7007,
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,
1... | 2.57629 | 911 |
import logging
from .api_client import APIClient
# child class of APIClient --> Extends error handling functionality
# ConnectionsClient class contains a series of functions corresponding to all
# pod admin endpoints on the REST API.
| [
11748,
18931,
198,
198,
6738,
764,
15042,
62,
16366,
1330,
3486,
2149,
75,
1153,
628,
198,
2,
1200,
1398,
286,
3486,
2149,
75,
1153,
14610,
5683,
2412,
4049,
9041,
11244,
198,
2,
8113,
507,
11792,
1398,
4909,
257,
2168,
286,
5499,
111... | 4.25 | 56 |
"""
Handle all actions on the weather resource.
"""
import json
import requests
from server.utils import call_openwhisk
from server.exceptions import ResourceDoesNotExistException, APIException
def get_recommendations(demoGuid):
"""
Get recommendations
"""
try:
payload = dict()
payload... | [
37811,
198,
37508,
477,
4028,
319,
262,
6193,
8271,
13,
198,
37811,
198,
11748,
33918,
198,
11748,
7007,
198,
6738,
4382,
13,
26791,
1330,
869,
62,
9654,
1929,
1984,
198,
6738,
4382,
13,
1069,
11755,
1330,
20857,
13921,
3673,
3109,
396,... | 2.722868 | 516 |
"""GDB pretty-printers for CSD.
"""
import enum
import gdb
import gdb.xmethod
import re
_csd_printer_name = 'csd_pretty_printer'
_csd_xmethod_name = 'csd_xmethods'
_nttpIntegralSuffix = {
'long' : 'l',
'long long' : 'll',
'unsigned int' : 'u',
'unsigned long' : 'ul',
'unsigned long long' : 'ull'
}
def _ge... | [
37811,
38,
11012,
2495,
12,
1050,
20193,
329,
9429,
35,
13,
198,
37811,
198,
198,
11748,
33829,
198,
11748,
308,
9945,
198,
11748,
308,
9945,
13,
87,
24396,
198,
11748,
302,
198,
198,
62,
6359,
67,
62,
1050,
3849,
62,
3672,
796,
705... | 2.751479 | 1,014 |
import math
import megengine.module as M
import megengine.functional as F
class PositionEncodingSine(M.Module):
"""
This is a sinusoidal position encoding that generalized to 2-dimensional images
"""
def __init__(self, d_model, max_shape=(256, 256)):
"""
Args:
max_shape (t... | [
11748,
10688,
198,
11748,
17243,
18392,
13,
21412,
355,
337,
198,
11748,
17243,
18392,
13,
45124,
355,
376,
628,
198,
4871,
23158,
27195,
7656,
50,
500,
7,
44,
13,
26796,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
318,
... | 1.96463 | 622 |
# Copyright 2013, Michael H. Goldwasser
#
# Developed for use with the book:
#
# Data Structures and Algorithms in Python
# Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser
# John Wiley & Sons, 2013
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | [
2,
15069,
2211,
11,
3899,
367,
13,
3561,
86,
24929,
198,
2,
198,
2,
6013,
276,
329,
779,
351,
262,
1492,
25,
198,
2,
198,
2,
220,
220,
220,
6060,
32112,
942,
290,
978,
7727,
907,
287,
11361,
198,
2,
220,
220,
220,
3899,
309,
1... | 2.231849 | 1,639 |
FEATURES = {
"DWI": [
"MD",
"FA",
"AD",
"RD",
"EigenValue",
"EigenVector",
"CS",
"CP",
"CL",
],
"SMRI": [
"Thickness",
"Volume",
"Sulc",
],
}
| [
15112,
47471,
796,
1391,
198,
220,
220,
220,
366,
35,
36326,
1298,
685,
198,
220,
220,
220,
220,
220,
220,
220,
366,
12740,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
7708,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366... | 1.451429 | 175 |
import pytest
from aiohttp import web
from aiohttp_middlewares import https_middleware
@pytest.mark.parametrize(
"match_headers, request_headers, expected",
[
(None, None, "http"),
(None, {"X-Forwarded-Proto": "http"}, "http"),
(None, {"X-Forwarded-Proto": "https"}, "https"),
... | [
11748,
12972,
9288,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
198,
6738,
257,
952,
4023,
62,
27171,
86,
3565,
1330,
3740,
62,
27171,
1574,
628,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,
... | 2.358065 | 310 |
# holds mapping between human key prefixes and real Redis prefixes
minute = 60
hour = 60 * minute
day = 24 * hour
week = 7 * day
month = 31 * day
redis_scheme = {
#
# human-readable table name
# |
# | prefix for key in Redis +
# | key placeholder
... | [
2,
6622,
16855,
1022,
1692,
1994,
21231,
274,
290,
1103,
2297,
271,
21231,
274,
198,
11374,
796,
3126,
198,
9769,
796,
3126,
1635,
5664,
198,
820,
796,
1987,
1635,
1711,
198,
10464,
796,
767,
1635,
1110,
198,
8424,
796,
3261,
1635,
11... | 1.64 | 650 |
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | [
2,
220,
220,
15069,
357,
66,
8,
2864,
350,
37382,
47,
37382,
46665,
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,
... | 3.559809 | 209 |
"""
extractor
=========
Extract path info from flask application.
"""
from .base import Extractor
from .mark import MarkExtractor
__all__ = ['Extractor', 'MarkExtractor']
| [
37811,
198,
2302,
40450,
198,
2559,
28,
198,
198,
11627,
974,
3108,
7508,
422,
42903,
3586,
13,
198,
198,
37811,
198,
6738,
764,
8692,
1330,
29677,
273,
198,
6738,
764,
4102,
1330,
2940,
11627,
40450,
198,
198,
834,
439,
834,
796,
372... | 3.411765 | 51 |
# Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Process related utilities."""
from __future__ import print_function
import errno
import os
import signal
import sys
import time
def GetExitStatus(s... | [
2,
15069,
1946,
383,
18255,
1505,
7294,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198,... | 2.816807 | 595 |
import soaculib
import test_helpers as th
import time
import numpy as np
import pickle
# Locals.
import spem_model
import util
parser = util.get_parser()
parser.add_argument('mode', default='passive', nargs='?')
args = parser.parse_args()
SPEM_KEYS = [
'IA', 'IE',
'TF', 'TFS',
'TFC',
'AN', 'AW',
# ... | [
11748,
523,
330,
377,
571,
198,
11748,
1332,
62,
16794,
364,
355,
294,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
198,
2,
15181,
874,
13,
198,
11748,
599,
368,
62,
19849,
198,
11748,
7736,
198,
... | 2.098455 | 2,783 |
from ledger.models import LedgerData
| [
6738,
37208,
13,
27530,
1330,
22964,
1362,
6601,
198
] | 4.111111 | 9 |
#!/usr/bin/env python
#
# Copyright 2014 cloudysunny14.
#
# 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... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
1946,
6279,
893,
16948,
1415,
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,... | 2.245028 | 1,408 |
from collections import defaultdict
from django.utils import timezone
class RecordStorage(object):
"""
list-dict implementation for fast lookups of record types
"""
def format_hostmaster(hostmaster):
"""
The DNS encodes the <local-part> as a single label, and encodes the
<mail-domain> as a... | [
6738,
17268,
1330,
4277,
11600,
198,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
628,
198,
4871,
13266,
31425,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1351,
12,
11600,
7822,
329,
3049,
804,
4739,
286,
... | 2.975342 | 365 |
import yaml
import json
import sqlite3
from functools import reduce
import operator
import time
f=open('./tmp/sde/typeIDs.json', 'r', encoding='utf-8')
j=json.load(f)
#y=load("./tmp/sde/fsd/typeIDs.yaml")
#f=open('./tmp/sde/typeIDs.json', 'w', encoding='utf-8')
#json.dump(y, f)
#f.write(json.dump(y))
#f.close()
#d... | [
198,
11748,
331,
43695,
198,
11748,
33918,
198,
11748,
44161,
578,
18,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
11748,
10088,
198,
11748,
640,
628,
198,
69,
28,
9654,
7,
4458,
14,
22065,
14,
82,
2934,
14,
4906,
47954,
13,
17752,
... | 2.568872 | 1,844 |
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import theano
import pymc3 as pm
from functools import wraps
theano.config.compute_test_value = "ignore"
theano.config.on_opt_error = "raise"
theano.config.mode = "FAST_COMPILE"
theano.config.cxx ... | [
11748,
14601,
198,
198,
4480,
14601,
13,
40198,
62,
40539,
654,
33529,
198,
220,
220,
220,
14601,
13,
24455,
40539,
654,
7203,
46430,
1600,
6536,
28,
12156,
8344,
341,
20361,
8,
198,
220,
220,
220,
1330,
262,
5733,
198,
198,
11748,
27... | 2.859649 | 114 |
import os
from MachineLearning.load_datasets import load_filenames_2nd, load_data, keep_t2
from glob2 import glob
import nibabel as nib
import numpy as np
import keras
from Segmentation.model_keras import *
from sklearn.metrics import precision_recall_curve, precision_score, \
recall_score, roc_auc_score, f1_score,... | [
11748,
28686,
198,
6738,
10850,
41730,
13,
2220,
62,
19608,
292,
1039,
1330,
3440,
62,
10379,
268,
1047,
62,
17,
358,
11,
3440,
62,
7890,
11,
1394,
62,
83,
17,
198,
6738,
15095,
17,
1330,
15095,
198,
11748,
33272,
9608,
355,
33272,
... | 1.872265 | 5,073 |
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
import numpy as np
from fixed_stack_models import BeamItems, FixedStack, FixedStackRNNG, StackState
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
20471,
13,
26791,
13,
81,
20471,
1330,
2353,
62,
79,
29373,
62,
43167,
11,
14841,
62,
34860,
62,
43167,
198,
11748... | 3.442857 | 70 |
import numpy as np
from linear_models.logistic_regression import LogisticRegression
class Perceptron(LogisticRegression):
"""A simple (binary classification) perceptron. Uses binary cross-entropy loss for updating weights.
>>NOTE: it inherits most of the code from logistic regression for simplicity.<<
Pa... | [
11748,
299,
32152,
355,
45941,
198,
6738,
14174,
62,
27530,
13,
6404,
2569,
62,
2301,
2234,
1330,
5972,
2569,
8081,
2234,
628,
198,
4871,
2448,
984,
1313,
7,
11187,
2569,
8081,
2234,
2599,
198,
220,
220,
220,
37227,
32,
2829,
357,
394... | 2.730223 | 493 |
import subprocess
import io
import random
INF = 10 ** 20
stress(100)
exit()
data = (16, 8, [8, 10, 15, 16, 4, 11])
"""
16 6 8
8 10 15 16 4 11
"""
ans = solve(*data)
print(test(*data, ans))
print(data, ans)
"""
[Error] (18, 3, [18, 8, 11, 2, 17, 10, 15, 5, 16]) (0, 1, 6)
[Error] (80, 5, [61, 2]... | [
11748,
850,
14681,
198,
11748,
33245,
198,
11748,
4738,
198,
198,
1268,
37,
796,
838,
12429,
1160,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
628,
628,
198,
41494,
7,
3064,
8,
198,
37023,
3419,
198,
198,
7890,
... | 1.85348 | 273 |
import numpy as np
from meta_policy_search.envs.base import MetaEnv
from meta_policy_search.utils import logger
import gym
from gym.envs.mujoco.mujoco_env import MujocoEnv
IterationBound1 = 200
IterationBound2 = 600 | [
11748,
299,
32152,
355,
45941,
198,
6738,
13634,
62,
30586,
62,
12947,
13,
268,
14259,
13,
8692,
1330,
30277,
4834,
85,
198,
6738,
13634,
62,
30586,
62,
12947,
13,
26791,
1330,
49706,
198,
11748,
11550,
198,
6738,
11550,
13,
268,
14259,... | 3 | 72 |
import pycuda.autoinit
from pycuda.compiler import SourceModule
cu_matrix_kernel = SourceModule("""
#include <math.h>
#include <stdio.h>
#include "texture_fetch_functions.h"
#include "texture_types.h"
#define THREADS_PER_BLOCK 256
#define FIT_RADIUS 6
texture<float, cudaTextureType2DLayered, cudaReadModeElementTyp... | [
11748,
12972,
66,
15339,
13,
23736,
15003,
198,
6738,
12972,
66,
15339,
13,
5589,
5329,
1330,
8090,
26796,
198,
198,
27399,
62,
6759,
8609,
62,
33885,
796,
8090,
26796,
7203,
15931,
198,
198,
2,
17256,
1279,
11018,
13,
71,
29,
198,
2,... | 1.726989 | 24,651 |
"""
Job framework defines components used for job submission and management.
It is built upon :mod:`execution` framework.
It provides constructs for:
1. Creating of job definition
2. Implementing of job instance
3. Implementing of job observer
There are two type of clients of the framework:
1. Job users
2. J... | [
37811,
198,
33308,
9355,
15738,
6805,
973,
329,
1693,
14498,
290,
4542,
13,
198,
1026,
318,
3170,
2402,
1058,
4666,
25,
63,
18558,
1009,
63,
9355,
13,
198,
1026,
3769,
34175,
329,
25,
198,
220,
352,
13,
30481,
286,
1693,
6770,
198,
... | 3.337349 | 249 |
import pbt
import sys
import unittest
@pbt.command(name="test")
| [
11748,
279,
18347,
198,
11748,
25064,
198,
11748,
555,
715,
395,
198,
198,
31,
79,
18347,
13,
21812,
7,
3672,
2625,
9288,
4943,
628
] | 2.75 | 24 |
import unittest
from pynvg.api import nvgli
if(__name__=="main"):
unittest.main() | [
11748,
555,
715,
395,
198,
6738,
279,
2047,
45119,
13,
15042,
1330,
299,
45119,
4528,
198,
198,
361,
7,
834,
3672,
834,
855,
1,
12417,
1,
2599,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419
] | 2.324324 | 37 |
# Generated by Django 3.0 on 2020-03-25 09:09
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
319,
12131,
12,
3070,
12,
1495,
7769,
25,
2931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
import os
from django.template.loaders.filesystem import Loader as FileSystemLoader
from accounts.models import get_template
import settings
| [
11748,
28686,
198,
6738,
42625,
14208,
13,
28243,
13,
2220,
364,
13,
16624,
6781,
1330,
8778,
263,
355,
9220,
11964,
17401,
198,
6738,
5504,
13,
27530,
1330,
651,
62,
28243,
198,
11748,
6460,
628
] | 4.176471 | 34 |
import ipaddress
if __name__ == "__main__":
ip1 = IPAddress("10.1.1.1/25")
print(ip1 + 5)
print(5 + ip1)
print(ip1.__radd__(5))
| [
11748,
20966,
21975,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
20966,
16,
796,
27966,
1860,
601,
7203,
940,
13,
16,
13,
16,
13,
16,
14,
1495,
4943,
198,
220,
220,
220,
3601,
7,
541... | 1.934211 | 76 |