content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from pymote.algorithms.shazad2015.floodingupdate import FloodingUpdate
from numpy import concatenate, array, sqrt, dot
class DVHop(FloodingUpdate):
"""
Data is {landmark: [x,y,hop_count], ...}
"""
required_params = ('truePositionKey', 'hopsizeKey')
MAX_HOP = 8
| [
6738,
279,
4948,
1258,
13,
282,
7727,
907,
13,
1477,
1031,
324,
4626,
13,
2704,
702,
278,
19119,
1330,
25588,
278,
10260,
198,
6738,
299,
32152,
1330,
1673,
36686,
378,
11,
7177,
11,
19862,
17034,
11,
16605,
628,
198,
4871,
29854,
234... | 2.638889 | 108 |
import tensorflow as tf
from tensorflow.contrib.learn.python.learn.datasets.mnist import read_data_sets
import scipy.misc
import numpy as np
import glob
import os
import json
from datetime import datetime, date, time
import cv2
import sys
import getopt
import random
####################################################... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
13,
35720,
13,
29412,
13,
35720,
13,
19608,
292,
1039,
13,
10295,
396,
1330,
1100,
62,
7890,
62,
28709,
198,
11748,
629,
541,
88,
13,
44374,
198,
11748... | 3.005188 | 771 |
# import all necessary packages
from inspect import signature
import numpy as np
from genericdiff.generic_diff import *
from genericdiff.elemental_functions import *
class JacobianProduct:
"""
Takes in a function vector and allows user to calculate partials or the full jacobian product based on
va... | [
2,
1330,
477,
3306,
10392,
201,
198,
6738,
10104,
1330,
9877,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
14276,
26069,
13,
41357,
62,
26069,
1330,
1635,
201,
198,
6738,
14276,
26069,
13,
30854,
282,
62,
12543,
2733,
1330,
... | 2.663539 | 746 |
from compilation.errors import IncorrectCallError
from compilation.tokens import Token
| [
6738,
23340,
13,
48277,
1330,
3457,
47315,
14134,
12331,
198,
6738,
23340,
13,
83,
482,
641,
1330,
29130,
628
] | 4.631579 | 19 |
from unittest import TestCase
from wild_timer import ResettableTimer
import time
| [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
6738,
4295,
62,
45016,
1330,
1874,
3087,
540,
48801,
198,
11748,
640,
628
] | 3.904762 | 21 |
# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
7804,
21017,
198,
2,
15069,
357,
66,
828,
383,
317,
4178,
5631,
1074,
13,
1439,
2489,
10395,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 2.626667 | 675 |
from ..Models import (
Sensor,
MonitoredSite,
Base,
Equipment
# SensorList
)
from sqlalchemy import select, desc, join, outerjoin, and_, not_, or_, exists, Table
from sqlalchemy.orm import aliased, exc
from collections import OrderedDict
from sqlalchemy.exc import IntegrityError
from ..controllers.s... | [
6738,
11485,
5841,
1424,
1330,
357,
198,
220,
220,
220,
35367,
11,
198,
220,
220,
220,
2892,
20026,
29123,
11,
198,
220,
220,
220,
7308,
11,
198,
220,
220,
220,
22412,
198,
220,
220,
220,
1303,
35367,
8053,
198,
8,
198,
6738,
44161,... | 3.367521 | 234 |
# https://leetcode.com/problems/path-sum-iii/submissions/
# https://leetcode.com/problems/path-sum-iii/discuss/141424/Python-step-by-step-walk-through.-Easy-to-understand.-Two-solutions-comparison.-%3A-)
# nice explanation of bruteforce + memoization
# Definition for a binary tree node.
from typing import List
from c... | [
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
6978,
12,
16345,
12,
15479,
14,
7266,
8481,
14,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
6978,
12,
16345,
12,
15479,
14,
15410,
1046,
14,
1415,
... | 2.911504 | 226 |
from first import *
| [
6738,
717,
1330,
1635,
198
] | 4 | 5 |
# Generated by Django 2.0.6 on 2018-07-08 23:20
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
21,
319,
2864,
12,
2998,
12,
2919,
2242,
25,
1238,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from typing import Any, IO, Optional, TYPE_CHECKING
if TYPE_CHECKING:
from .console import Console
# Global console used by alternative print
_console: Optional["Console"] = None
if __name__ == "__main__": # pragma: no cover
print("Hello, **World**")
| [
6738,
19720,
1330,
4377,
11,
24418,
11,
32233,
11,
41876,
62,
50084,
2751,
198,
198,
361,
41876,
62,
50084,
2751,
25,
198,
220,
220,
220,
422,
764,
41947,
1330,
24371,
198,
198,
2,
8060,
8624,
973,
416,
5559,
3601,
198,
62,
41947,
2... | 3.231707 | 82 |
from .api import Zerochan
from utils import sendPhotos, sendDocuments, handleBadRequest, NazurinError
from telegram.ext import CommandHandler
from telegram.error import BadRequest
api = Zerochan()
commands = [
CommandHandler('zerochan', zerochan_view, pass_args=True, run_async=True),
CommandHandler('zerochan_... | [
6738,
764,
15042,
1330,
12169,
3147,
198,
6738,
3384,
4487,
1330,
3758,
21197,
11,
3758,
38354,
11,
5412,
22069,
18453,
11,
12819,
333,
259,
12331,
198,
6738,
573,
30536,
13,
2302,
1330,
9455,
25060,
198,
6738,
573,
30536,
13,
18224,
13... | 3.301724 | 116 |
from dataclasses import dataclass, field
from typing import Dict, Any, ClassVar, Set
from exco import setting as st
from exco.dereferator import Dereferator
from exco.exception import ExcoException, ParserSpecCreationException
from exco.extractor_spec.type import SpecParam
@dataclass
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
19720,
1330,
360,
713,
11,
4377,
11,
5016,
19852,
11,
5345,
198,
198,
6738,
409,
1073,
1330,
4634,
355,
336,
198,
6738,
409,
1073,
13,
67,
567,
2232,
1352,
1330,
3... | 3.388235 | 85 |
# Insertion Sort - Give position of the indices, as if array were sorted.
if __name__ == "__main__":
N = int(input())
input_arr = list(map(int, input().split()))
original_arr = input_arr[:] # Replicating the input_arr, to save unsorted array
sorted_arr = insertion_sort(input_arr, N) # Function call
... | [
2,
35835,
295,
33947,
532,
13786,
2292,
286,
262,
36525,
11,
355,
611,
7177,
547,
23243,
13,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
399,
796,
493,
7,
15414,
28955,
198,
220,
220,
220,
... | 2.758621 | 145 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
2,
15069,
1584,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 3.199454 | 732 |
import taichi as ti
from .bls_test_template import bls_particle_grid
@ti.require(ti.extension.bls)
@ti.all_archs
@ti.require(ti.extension.bls)
@ti.all_archs
@ti.require(ti.extension.bls)
@ti.all_archs
@ti.require(ti.extension.bls)
@ti.all_archs
@ti.require(ti.extension.bls)
@ti.all_archs
# TODO: debug mode ... | [
11748,
20486,
16590,
355,
46668,
198,
6738,
764,
2436,
82,
62,
9288,
62,
28243,
1330,
698,
82,
62,
3911,
1548,
62,
25928,
628,
198,
31,
20259,
13,
46115,
7,
20259,
13,
2302,
3004,
13,
2436,
82,
8,
198,
31,
20259,
13,
439,
62,
3459... | 2.351351 | 148 |
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | [
2,
15069,
33448,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,... | 3.607843 | 204 |
# -*- coding: utf-8 -*-
import pytest
from moha.vm.grammar.v0_2_0 import parse_source
@pytest.mark.parametrize('op', ['==', '!=', '>=', '<=', '>', '<'])
@pytest.mark.parametrize('op', ['<<', '>>'])
@pytest.mark.parametrize('op', ['+', '-'])
@pytest.mark.parametrize('op', ['*', '/', '%'])
@pytest.mark.parametrize... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
12972,
9288,
198,
6738,
285,
28083,
13,
14761,
13,
4546,
3876,
13,
85,
15,
62,
17,
62,
15,
1330,
21136,
62,
10459,
198,
198,
31,
9078,
9288,
13,
4102,
13... | 2.047619 | 168 |
import time
import typing
import hashlib
import collections
import threading
import jk_typing
from ..utils.APIError import APIError
from ._auth_common import _Resp, _checkBytesEqual
from ..usermgr.BackupUser import BackupUser
_AuthAttempt = collections.namedtuple("_AuthAttempt", [
"asid", # authentif... | [
628,
198,
11748,
640,
198,
11748,
19720,
198,
11748,
12234,
8019,
198,
11748,
17268,
198,
11748,
4704,
278,
198,
198,
11748,
474,
74,
62,
774,
13886,
198,
198,
6738,
11485,
26791,
13,
17614,
12331,
1330,
7824,
12331,
198,
6738,
47540,
1... | 3.046414 | 237 |
#!/usr/bin/env python3
""" Port Scanner v4 """
import time
import datetime
import socket
import random
import threading
import ipaddress
import re
from optparse import OptionParser
import ftp_scanner
import ssh_scanner
import prettyprint as pp
import concurrent.futures
def portscan(host, ports):
""... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
4347,
20937,
1008,
410,
19,
220,
220,
220,
220,
37227,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
17802,
198,
1... | 2.01479 | 879 |
from sklearn import neural_network
import learners
| [
6738,
1341,
35720,
1330,
17019,
62,
27349,
198,
198,
11748,
46184,
628
] | 4.416667 | 12 |
# -*- coding: utf-8 -*-
"""
Created on Wed Dec 6 21:42:53 2017
@author: Antoi
"""
import numpy as np
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
3300,
4280,
220,
718,
2310,
25,
3682,
25,
4310,
2177,
201,
198,
201,
198,
31,
9800,
25,
3738,
23013,
201,
198,
37811,
201,
198,
11748... | 1.819444 | 72 |
# -*- coding: utf-8 -*-
"""
Tests for the main module.
"""
# Future
from __future__ import absolute_import, division, print_function, \
unicode_literals, with_statement
# Third Party
import nose
from mock import Mock
# First Party
from metaopt.core.optimize.optimize import custom_optimize
if __name__ == '__ma... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
51,
3558,
329,
262,
1388,
8265,
13,
198,
37811,
198,
198,
2,
10898,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
... | 2.974359 | 117 |
# -*- coding: utf8 -*-
import requests, json
import random
__all__ = ["Graph"]
class Graph:
""" Info """
""" Management """
def list_graph(self):
""" List all graphs """
r = requests.get(self.url + '/_api/gharial')
return r.json()
def create_graph(self, collection_name,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
198,
11748,
7007,
11,
33918,
198,
11748,
4738,
628,
198,
834,
439,
834,
796,
14631,
37065,
8973,
198,
198,
4871,
29681,
25,
628,
220,
220,
220,
37227,
14151,
37227,
628,
198... | 2.114934 | 3,837 |
import jinja2
jinja_env = jinja2.Environment(loader=jinja2.FileSystemLoader('template'))
template = jinja_env.get_template('MATH6303_Warmup_2_1_Part_1.html')
print(template.render()) | [
11748,
474,
259,
6592,
17,
201,
198,
201,
198,
18594,
6592,
62,
24330,
796,
474,
259,
6592,
17,
13,
31441,
7,
29356,
28,
18594,
6592,
17,
13,
8979,
11964,
17401,
10786,
28243,
6,
4008,
201,
198,
28243,
796,
474,
259,
6592,
62,
24330... | 2.454545 | 77 |
"""
problem_2021_05.py
"""
import sys
from typing import List, Any, Generator, Iterator
from dataclasses import dataclass
from enum import IntEnum
from itertools import combinations
import logging
from flood_advent.utils import line_to_parts
from flood_advent.utils import SparseGrid
from flood_advent.utils impo... | [
37811,
198,
220,
220,
220,
1917,
62,
1238,
2481,
62,
2713,
13,
9078,
198,
37811,
198,
198,
11748,
25064,
198,
6738,
19720,
1330,
7343,
11,
4377,
11,
35986,
11,
40806,
1352,
220,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198... | 2.643545 | 519 |
import boto3
import json
import uuid
from datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
from boto3.dynamodb.conditions import Key
# Get the service resource.
dynamodb = boto3.resource('dynamodb')
#Get Table Objects
Parent_Table = dynamodb.Table('Parent_Tasks')
Child_Table = dyna... | [
11748,
275,
2069,
18,
198,
11748,
33918,
198,
11748,
334,
27112,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
3128,
22602,
13,
2411,
265,
1572,
12514,
1330,
48993,
1572,
12514,
198,
6738,
275,
2069,
18,
13,
67,
... | 3.19708 | 137 |
from tkinter import *
from tkinter import filedialog
from PIL import Image,ImageTk
root = Tk()
root.title("Aula 15")
root.iconbitmap("Terminal.ico")
btn = Button(root, text="Abrir Arquivo", command=open).pack()
root.mainloop() | [
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
6738,
350,
4146,
1330,
7412,
11,
5159,
51,
74,
198,
198,
15763,
796,
309,
74,
3419,
198,
15763,
13,
7839,
7203,
32,
4712,
1315,
4943,
198,
15763,
... | 2.75 | 84 |
from django.db import models
from wagtail_wordpress_importer.models.base_models import \
BaseImportWordpressDataModelMixin
''' Django Models '''
class ImportPost(BaseImportWordpressDataModelMixin):
'''
a model intended for django admin management,
this will be the data source for the wagtail model ... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
266,
363,
13199,
62,
40346,
62,
320,
26634,
13,
27530,
13,
8692,
62,
27530,
1330,
3467,
198,
220,
220,
220,
7308,
20939,
26449,
8439,
6601,
17633,
35608,
259,
198,
198,
7061,
6,
377... | 2.923256 | 430 |
from pydantic import BaseModel
| [
6738,
279,
5173,
5109,
1330,
7308,
17633,
628,
198
] | 3.666667 | 9 |
# -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
2177,
12,
7908,
2320,
43,
317,
1959,
15302,
11,
257,
9368,
1087,
1664,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11... | 3.619835 | 242 |
# p = 2 * u + 1
print("Прирожков", p(10))
pq = lambda u: 2 * u + 1
# m = p / 20
######
print("Накормить класс:", кг_муки_ученикам(22), "кг муки")
напечатать_привет()
print("Тебе придётся раскошелиться на" , цена_компа("i7", 16, 128), "€")
| [
2,
279,
796,
362,
1635,
334,
1343,
352,
198,
198,
4798,
7203,
140,
253,
21169,
18849,
21169,
25443,
114,
31583,
25443,
110,
1600,
279,
7,
940,
4008,
198,
198,
79,
80,
796,
37456,
334,
25,
362,
1635,
334,
1343,
352,
198,
198,
2,
28... | 1.27551 | 196 |
import json
from collections import namedtuple
from eth_typing import Address
from eth.vm.opcode_values import *
# list of opcodes that call code from another contract
ADDRESS_CALLING_OPCODES = [CALL, CALLCODE, STATICCALL, DELEGATECALL]
# list of opcodes that read addresses from the top of the stack
ADDRESS_READING_O... | [
11748,
33918,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
4555,
62,
774,
13886,
1330,
17917,
198,
6738,
4555,
13,
14761,
13,
404,
8189,
62,
27160,
1330,
1635,
198,
198,
2,
1351,
286,
1034,
40148,
326,
869,
2438,
422,
1194,
277... | 2.765707 | 764 |
if __name__ == '__main__':
# arr = [1, 4, 8, 3, 2]
# print(search(arr))
arr = [1, 2, 3, 5, 8, 3, 2]
print(search(arr, 3))
arr = [5, 10, 9, 7, 4, 3, 2]
print(search(arr, 3))
| [
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1303,
5240,
796,
685,
16,
11,
604,
11,
807,
11,
513,
11,
362,
60,
198,
220,
220,
220,
1303,
3601,
7,
12947,
7,
3258,
4008,
628,
220,
22... | 1.862385 | 109 |
import traceback
from help_scripts import WebElementHandler
from help_scripts import BrowserWindowHandler
import time
from help_scripts import get_proxies
from help_scripts import selenium_operator as sop
# SEQUENCE OF DECISIONS TO MAKE IN ORDER OF 1 - 8
# SEQUENCE ORDER: 1
"""
BLANK
"""
# SEQUENCE ORDER: 2
# S... | [
11748,
12854,
1891,
198,
198,
6738,
1037,
62,
46521,
1330,
5313,
20180,
25060,
198,
6738,
1037,
62,
46521,
1330,
34270,
27703,
25060,
198,
11748,
640,
198,
6738,
1037,
62,
46521,
1330,
651,
62,
1676,
87,
444,
198,
6738,
1037,
62,
46521,... | 3.013423 | 149 |
"""Low-level operations on Gaussian formatted checkpoint files.
Provides low-level interfaces to manipulate/extract data in Gaussian
formatted checkpoint files.
Attributes
----------
Methods
-------
get_data
Gets data from a FChk file for each quantity label.
get_hess_data
Gets or Builds Hessian data (eige... | [
37811,
20535,
12,
5715,
4560,
319,
12822,
31562,
39559,
26954,
3696,
13,
198,
198,
15946,
1460,
1877,
12,
5715,
20314,
284,
18510,
14,
2302,
974,
1366,
287,
12822,
31562,
198,
220,
39559,
26954,
3696,
13,
198,
198,
29021,
198,
35937,
19... | 1.972121 | 21,593 |
def _attrgetter_with_default(attr, default):
"""
It returns a function that can be called with an object to get the value
of attr or the default.
Useful to convert None values to ''.
"""
return _getter
def id_name_dict(obj):
"""Creates dictionary with selected field from supplied object.""... | [
4299,
4808,
35226,
1136,
353,
62,
4480,
62,
12286,
7,
35226,
11,
4277,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
632,
5860,
257,
2163,
326,
460,
307,
1444,
351,
281,
2134,
284,
651,
262,
1988,
198,
220,
220,
220,
286,
7... | 2.42716 | 2,025 |
#If using biowulf, one has to configure an enviornment that contains pandas, as it doesn't seem to be(?) an availible module with python3
#example, type something like this:
#source /data/belfordak/Buck_lab/conda/etc/profile.d/conda.sh
#conda activate base
#conda activate all_libs (just an env with pandas and other pa... | [
2,
1532,
1262,
3182,
322,
4754,
11,
530,
468,
284,
17425,
281,
551,
8903,
1211,
434,
326,
4909,
19798,
292,
11,
355,
340,
1595,
470,
1283,
284,
307,
7,
10091,
281,
29107,
856,
8265,
351,
21015,
18,
198,
2,
20688,
11,
2099,
1223,
5... | 2.221837 | 1,731 |
# Copyright (C) 2020 Intel Corporation
#
# SPDX-License-Identifier: MIT
import argparse
from bench import (
parse_args, measure_function_time, load_data, print_output,
accuracy_score, rmse_score
)
import numpy as np
import xgboost as xgb
import os
parser = argparse.ArgumentParser(description='xgboost gradi... | [
2,
15069,
357,
34,
8,
12131,
8180,
10501,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
198,
11748,
1822,
29572,
198,
6738,
7624,
1330,
357,
198,
220,
220,
220,
21136,
62,
22046,
11,
3953,
62,
8818,
62,
24... | 2.419265 | 2,502 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
2,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
9387,
351,
198,
2,
428,
670,
329,
3224,
1321,
5115,
6634,
9238,
13,
198,
2,
383,
7054,
37,
... | 2.603866 | 8,795 |
import unittest
from com.example.client.config.low_level_client_by_connection import ESLowLevelClientByConnection
from elasticsearch_dsl import Search
from elasticsearch_dsl.query import Q, MatchPhrase
| [
11748,
555,
715,
395,
198,
6738,
401,
13,
20688,
13,
16366,
13,
11250,
13,
9319,
62,
5715,
62,
16366,
62,
1525,
62,
38659,
1330,
34084,
322,
4971,
11792,
3886,
32048,
198,
6738,
27468,
12947,
62,
67,
6649,
1330,
11140,
198,
6738,
2746... | 3.642857 | 56 |
# -*- coding: utf-8 -*-
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.action_chains import ActionChains
import time
success = True
wd = WebDriver()
wd.implicitly_wait(60)
try:
wd.get("http://localhost/addressbook/")
wd.find_element_by_name("pass").click()
wd.fin... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
6495,
12792,
13,
12384,
26230,
1330,
5313,
32103,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
2673,
62,
3... | 2.449339 | 681 |
# coding: utf-8
import unittest
import charset_normalizer.utils as unicode_utils
if __name__ == '__main__':
unittest.main()
| [
2,
19617,
25,
3384,
69,
12,
23,
201,
198,
11748,
555,
715,
395,
201,
198,
11748,
34534,
316,
62,
11265,
7509,
13,
26791,
355,
28000,
1098,
62,
26791,
201,
198,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
1... | 2.355932 | 59 |
# Python imports
import cliFile
import mx.DateTime
import pg
import sys
import editclifile
import cliRecord
import numpy
# Connect to the WEPP database
mydb = pg.connect('wepp', 'iemdb', user='wepp')
# We call with args for the time we are interested in
if (len(sys.argv) == 4):
yyyy, mm, dd = int(sys.argv[1]), int(s... | [
2,
11361,
17944,
198,
11748,
537,
72,
8979,
198,
11748,
285,
87,
13,
10430,
7575,
198,
11748,
23241,
198,
11748,
25064,
198,
11748,
4370,
565,
361,
576,
198,
11748,
537,
72,
23739,
198,
11748,
299,
32152,
198,
198,
2,
8113,
284,
262,
... | 2.417445 | 321 |
from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from toponym_api.api.api_v1.api import router as api_router
from toponym_api.core.config import ALLOWED_HOSTS, API_V1_STR, PROJECT_NAME
from mangum import Mangum
app = FastAPI(
title=PROJECT_NAME,
# if not custom domain
# open... | [
6738,
3049,
15042,
1330,
12549,
17614,
198,
6738,
3491,
21348,
13,
27171,
1574,
13,
66,
669,
1330,
23929,
12310,
2509,
1574,
198,
6738,
1353,
5177,
62,
15042,
13,
15042,
13,
15042,
62,
85,
16,
13,
15042,
1330,
20264,
355,
40391,
62,
4... | 2.56962 | 316 |
from node import Node
from assembly import Assembly
| [
6738,
10139,
1330,
19081,
201,
198,
6738,
10474,
1330,
10006,
201,
198,
201,
198,
201,
198
] | 3.625 | 16 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: create.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
2251,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
62,
65,
28,
17597,
13... | 2.419066 | 16,291 |
from django.test import TestCase
import pandas as pd
from services.IndicatorCalc.indicators import BollingerIndicator, Indicator
from services.Utils.test_pusher import convert_to_dicts
from .signalgenerator import SignalGenerator
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
2594,
13,
5497,
26407,
9771,
66,
13,
521,
44549,
1330,
43479,
3889,
5497,
26407,
11,
1423,
26407,
198,
6738,
2594,
13,
18274,
... | 3.530303 | 66 |
# Converts Source 1 .vmt material files to simple Source 2 .vmat files.
#
# Copyright (c) 2016 Rectus
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without ... | [
2,
1482,
24040,
8090,
352,
764,
14761,
83,
2587,
3696,
284,
2829,
8090,
362,
764,
85,
6759,
3696,
13,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
48599,
385,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
28... | 2.252122 | 6,243 |
import pytest
import zmq
from plenum.test.client.helper import create_zmq_connection
@pytest.fixture()
| [
11748,
12972,
9288,
198,
11748,
1976,
76,
80,
198,
198,
6738,
458,
44709,
13,
9288,
13,
16366,
13,
2978,
525,
1330,
2251,
62,
89,
76,
80,
62,
38659,
628,
198,
31,
9078,
9288,
13,
69,
9602,
3419,
628
] | 2.815789 | 38 |
from clge.Behaviour import Vector3, Vector2, World
from clge.Behaviour.Components.ThreeDimensions.AsciiRenderer3D import AsciiRenderer3D
from clge.Behaviour.Components.ThreeDimensions.Mesh3D import Mesh3D
from clge.Behaviour.Components.ThreeDimensions.Transform3D import Transform3D
from clge.Constants import Coordinate... | [
6738,
537,
469,
13,
25267,
37716,
1330,
20650,
18,
11,
20650,
17,
11,
2159,
198,
6738,
537,
469,
13,
25267,
37716,
13,
7293,
3906,
13,
12510,
29271,
5736,
13,
1722,
979,
72,
49,
437,
11882,
18,
35,
1330,
1081,
979,
72,
49,
437,
11... | 2.54039 | 359 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2017 IBM Corporation
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 agre... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
15269,
357,
34,
8,
2177,
19764,
10501,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
564,
250,
34156,
447,
251,
1... | 2.346642 | 1,102 |
import tkinter as tk
import json
from calendarauth import CalendarAuthenticator
class CalendarLoginPage(tk.Frame):
"""Menu page for logging into google calendar.
CalendarLoginPage inherits from tkinter's frame page. It's purpose
is to provide end user with interface to authenticate and authorize
goo... | [
11748,
256,
74,
3849,
355,
256,
74,
198,
11748,
33918,
198,
198,
6738,
2386,
437,
3301,
1071,
1330,
26506,
47649,
26407,
628,
198,
4871,
26506,
47790,
9876,
7,
30488,
13,
19778,
2599,
198,
220,
220,
220,
37227,
23381,
2443,
329,
18931,
... | 2.511411 | 964 |
import os
import time
import json
import http.client
from pprint import pprint
import tmdbsimple as tmdb
from PyInquirer import prompt, style_from_dict, Token
class Movie(object):
"""
:param image: (str)
:param id: (int)
:param names: ([str])
:param posters: ([str])
:param lang: (str)
"""... | [
11748,
28686,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
2638,
13,
16366,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
11748,
256,
9132,
1443,
320,
1154,
355,
256,
9132,
65,
198,
6738,
9485,
818,
29782,
81,
1330,
6152,
11,
39... | 2.253253 | 2,152 |
import os
file = open('/data/data/com.termux/files/usr/bin/locker_service.py', 'w')
file.write("""print(''' _____
RRRRRR. I PPPPPP.
R R. I. P. P
R R. I. P. P
R RRRRR. ... | [
11748,
28686,
201,
198,
201,
198,
7753,
796,
1280,
10786,
14,
7890,
14,
7890,
14,
785,
13,
4354,
2821,
14,
16624,
14,
14629,
14,
8800,
14,
5354,
263,
62,
15271,
13,
9078,
3256,
705,
86,
11537,
201,
198,
7753,
13,
13564,
7203,
15931,... | 1.539931 | 576 |
# convert to .mat
import OpenEXR, Imath
import os.path
import scipy.io as sio
import numpy as np
depth_save_root = 'E:/GTAVTempCaptures/'
exr_depth_file = 'E:/GTAVTempCaptures/frame9207.exr'
filePrefix = 'py1'
exrFile = OpenEXR.InputFile(exr_depth_file)
dw = exrFile.header()['dataWindow']
size = (dw.max.x - dw.min.x... | [
2,
10385,
284,
764,
6759,
198,
198,
11748,
4946,
6369,
49,
11,
1846,
776,
198,
11748,
28686,
13,
6978,
198,
11748,
629,
541,
88,
13,
952,
355,
264,
952,
198,
11748,
299,
32152,
355,
45941,
198,
198,
18053,
62,
21928,
62,
15763,
796,... | 2.393103 | 290 |
from app.util import RequestUtil, ResponseUtil, JsonUtil
from app.util.AuthUtil import *
@app.route('/share/list', methods=['POST'])
@authorized_required
def share_list_to_group(user):
"""
@api {post} /share/list Share list to multiple groups.
@apiName Share list to multiple groups.
@apiGroup Share
... | [
6738,
598,
13,
22602,
1330,
19390,
18274,
346,
11,
18261,
18274,
346,
11,
449,
1559,
18274,
346,
198,
6738,
598,
13,
22602,
13,
30515,
18274,
346,
1330,
1635,
628,
198,
31,
1324,
13,
38629,
10786,
14,
20077,
14,
4868,
3256,
5050,
28,
... | 2.60452 | 885 |
from bs4 import BeautifulSoup
import requests
from PIL import Image
from io import BytesIO
import os
StartSearch()
| [
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
11748,
28686,
628,
198,
10434,
18243,
3419,
198
] | 3.545455 | 33 |
"""
Packages and classes we want to expose to users
"""
from ._utils import get_project_root
__all__ = [
'get_project_root',
]
| [
37811,
198,
11869,
1095,
290,
6097,
356,
765,
284,
15651,
284,
2985,
198,
37811,
198,
6738,
47540,
26791,
1330,
651,
62,
16302,
62,
15763,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
1136,
62,
16302,
62,
15763,
3256,
... | 2.933333 | 45 |
from django.test import TestCase
from .models import Profile,BloodStock
# Create your tests here.
class ProfileTestClass(TestCase):
'''
Set Up method that creates instance of Profile Class
Runs before each test
'''
def tearDown(self):
'''
this tearDown method runs after every test.... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
764,
27530,
1330,
13118,
11,
21659,
26207,
198,
198,
2,
13610,
534,
5254,
994,
13,
198,
198,
4871,
13118,
14402,
9487,
7,
14402,
20448,
2599,
198,
220,
220,
220,
705,
7061,
1... | 2.393797 | 1,064 |
import pygame, os
from pygame import image
from .drawable import Drawable
from polybius.managers import FRAMES
| [
11748,
12972,
6057,
11,
28686,
198,
6738,
12972,
6057,
1330,
2939,
198,
6738,
764,
19334,
540,
1330,
15315,
540,
198,
6738,
7514,
65,
3754,
13,
805,
10321,
1330,
8782,
29559,
198,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
198
... | 2.928571 | 42 |
import math
import pybullet as p
import numpy as np
import transforms3d
import utilities as util
# lap joint task
INITIAL_POS = np.array([0.0, 0.0, 0.24])
INITIAL_ORN = util.mat33_to_quat(np.array([[1, 0, 0], [0, 1, 0], [0, 0, 1]]))
TARGET_POS = np.array([0, 0, 0])
TARGET_ORN = np.array([0, 0, math.pi])
URDF_PATH_TOOL... | [
11748,
10688,
198,
11748,
12972,
15065,
1616,
355,
279,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
31408,
18,
67,
198,
11748,
20081,
355,
7736,
198,
198,
2,
14779,
6466,
4876,
198,
1268,
2043,
12576,
62,
37997,
796,
45941,
13,
1874... | 2.234375 | 192 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Created on 18/10/12 16:53:03
@author: Changzhi Sun
"""
import sys
sys.path.append("..")
from typing import List, Dict, Any, Optional, Tuple, Set
from collections import defaultdict
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
1248,
14,
940,
14,
1065,
1467,
25,
4310,
25,
3070,
198,
198,
31,
9800,
25,
22597,
89,
5303,
3825... | 2.932806 | 253 |
from librus_tricks import exceptions
from librus_tricks.auth import authorizer
from librus_tricks.classes import *
from librus_tricks.core import SynergiaClient
name = 'librus_tricks'
__title__ = 'librus_tricks'
__author__ = 'Backdoorek'
__version__ = '0.7.0'
def create_session(email, password, fetch_first=True, **kw... | [
6738,
300,
2889,
385,
62,
83,
23706,
1330,
13269,
198,
6738,
300,
2889,
385,
62,
83,
23706,
13,
18439,
1330,
1772,
7509,
198,
6738,
300,
2889,
385,
62,
83,
23706,
13,
37724,
1330,
1635,
198,
6738,
300,
2889,
385,
62,
83,
23706,
13,
... | 2.539192 | 421 |
#!/usr/bin/env python3
# Utility to parse and validate a HAT package
import ctypes
from typing import Any, List, Union
from collections import OrderedDict
from functools import partial
from .hat_file import HATFile, Function, Parameter
from .arg_info import ArgInfo, verify_args
import os
class AttributeDict(Orde... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
34030,
284,
21136,
290,
26571,
257,
367,
1404,
5301,
198,
198,
11748,
269,
19199,
198,
6738,
19720,
1330,
4377,
11,
7343,
11,
4479,
198,
6738,
17268,
1330,
14230,
1068,
35,... | 3.27972 | 143 |
"""Database connection for the database updater.
The database updater only deletes entries from the files table that exceeded
their timeout after being marked as deleted.
"""
# Python imports
import logging
import datetime
from typing import List, Union, Tuple
# Local imports
from crawler.database import measure_t... | [
37811,
38105,
4637,
329,
262,
6831,
2325,
729,
13,
198,
198,
464,
6831,
2325,
729,
691,
28128,
274,
12784,
422,
262,
3696,
3084,
326,
20672,
198,
24571,
26827,
706,
852,
7498,
355,
13140,
13,
198,
37811,
628,
198,
2,
11361,
17944,
198... | 4.488095 | 84 |
import numpy as np
import torch
from torch import nn
from itertools import chain
class Controller(nn.Module):
"""
遵循Explainable Neural Computation via Stack Neural Module Networks模型架构
Sec3.1 布局控制器
从net.py传来的参数
controller_kwargs = {
'num_module': len(self.module_names), 值为6
... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
340,
861,
10141,
1330,
6333,
628,
198,
4871,
22741,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16268,
223,
11... | 1.382525 | 2,907 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
@author: Tiantian
"""
import torch
import torch.nn as nn
from torch.autograd import Variable
from torch.nn import functional as F
import pdb
from torch.nn.modules import dropout
import itertools
from pytorch_lightning.core.lightning import LightningModule
import numpy ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
9800,
25,
309,
3014,
666,
198,
37811,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
... | 3.211921 | 151 |
from django.contrib.auth import get_user_model
from core.mixins import TemplateLoginRequiredMixin
User = get_user_model()
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
198,
6738,
4755,
13,
19816,
1040,
1330,
37350,
47790,
37374,
35608,
259,
198,
198,
12982,
796,
651,
62,
7220,
62,
19849,
3419,
628,
628,
628,
628,
198
... | 3.142857 | 42 |
"""
Module defining data collections
"""
import warnings
from enum import Enum, EnumMeta
from typing import Tuple, Optional
from dataclasses import dataclass, field, fields
from aenum import extend_enum
from .config import SHConfig
from .constants import ServiceUrl
from .exceptions import SHDeprecationWarning
from .d... | [
37811,
198,
26796,
16215,
1366,
17268,
198,
37811,
198,
11748,
14601,
198,
6738,
33829,
1330,
2039,
388,
11,
2039,
388,
48526,
198,
6738,
19720,
1330,
309,
29291,
11,
32233,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
... | 2.376942 | 11,588 |
#!/usr/bin/env python
# coding: utf-8
import web
from config import settings
from datetime import datetime
render = settings.render
db = settings.db
tb = 'todo'
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
11748,
3992,
198,
6738,
4566,
1330,
6460,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
13287,
796,
6460,
13,
13287,
198,
9945,
796,
6460,
1... | 3.055556 | 54 |
from smoke.utils.registry import Registry
BACKBONES = Registry()
SMOKE_HEADS = Registry()
SMOKE_PREDICTOR = Registry()
| [
6738,
7523,
13,
26791,
13,
2301,
4592,
1330,
33432,
198,
198,
31098,
33,
39677,
796,
33432,
3419,
198,
50,
11770,
7336,
62,
37682,
50,
796,
33432,
3419,
198,
50,
11770,
7336,
62,
4805,
1961,
18379,
1581,
796,
33432,
3419,
198
] | 3 | 40 |
# %% [markdown]
"""
Fitting a custom kernel model with a parameter-free distribution
=================================================================
How the use of SNLLS to fit a kernel model and a parameter-free
distribution to a dipolar signal.
"""
import numpy as np
import matplotlib.pyplot as plt
import deerlab... | [
2,
43313,
685,
4102,
2902,
60,
198,
37811,
198,
37,
2535,
257,
2183,
9720,
2746,
351,
257,
11507,
12,
5787,
6082,
198,
23926,
28,
198,
198,
2437,
262,
779,
286,
11346,
3069,
50,
284,
4197,
257,
9720,
2746,
290,
257,
11507,
12,
5787,... | 2.706838 | 1,170 |
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import random
import csv
from functions import sign_in, wait_for_element, URL
from selenium.webdriver.chrome... | [
11748,
640,
628,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11321,
13,
1525,
1330,
2750,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
17077,
1330,
5313,
32103,
213... | 2.435331 | 317 |
#! -*- coding: utf8 -*-
# This file is part of the sale_pos module for Tryton.
# The COPYRIGHT file at the top level of this repository contains the full
# copyright notices and license terms.
from decimal import Decimal
from trytond.model import ModelView, fields, ModelSQL
from trytond.pool import PoolMeta, Pool
fro... | [
198,
2,
0,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
2,
770,
2393,
318,
636,
286,
262,
5466,
62,
1930,
8265,
329,
9993,
1122,
13,
198,
2,
383,
27975,
38162,
9947,
2393,
379,
262,
1353,
1241,
286,
428,
16099,
4909,
... | 2.871429 | 840 |
# -*- coding: utf-8 -*-
"""
Created on Sat Oct 13 14:39:56 2018
@author: sudar
"""
from bs4 import Tag, BeautifulSoup
import requests
import csv
import numpy as np
import pandas as pd
from url_feeder import *
import re
import traceback
# ===========================Retrieve Data=================================
####... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7031,
2556,
1511,
1478,
25,
2670,
25,
3980,
2864,
198,
198,
31,
9800,
25,
424,
27455,
198,
37811,
198,
198,
6738,
275,
82,
19,
1330,
17467,
11,... | 2.482079 | 558 |
import json
from nandboxbots.outmessages.OutMessage import OutMessage
| [
11748,
33918,
198,
198,
6738,
299,
392,
3524,
42478,
13,
448,
37348,
1095,
13,
7975,
12837,
1330,
3806,
12837,
628
] | 3.6 | 20 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
### Modules Importing ###
import os
import requests
from bs4 import BeautifulSoup
import toml
import argparse
### Modules Importing ###
class Main:
'''
Main Operations
Loading configuration files and languages, show the version and the logo, etc.
The function... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
21017,
3401,
5028,
17267,
278,
44386,
198,
11748,
28686,
198,
11748,
7007,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
1... | 2.433398 | 3,078 |
#! -*- coding: utf-8 -*-
#---------------------------------
# モジュールのインポート
#---------------------------------
import os
import argparse
from data_loader import common
_data_type = os.environ['DATA_TYPE']
if (_data_type == 'CIFAR-10'):
from data_loader import cifar10
elif (_data_type == 'Titanic'):
from data_loader i... | [
2,
0,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
3880,
12,
198,
2,
14524,
95,
21091,
24440,
43353,
5641,
11482,
6527,
1209,
251,
12045,
230,
198,
2,
3880,
12,
198,
11748,
28686,
198,
11748,
1822,
29572,
19... | 3.025641 | 312 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
201
] | 3.166667 | 6 |
#! /usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Osman Baskaya"
import os
inst = "hdp-wsi/wsi_input/example/num_test_instances.all.txt"
wsi_input_folder = "hdp-wsi/wsi_input/example/all/"
#key_folder = "/scratch/1/obaskaya/mapping-impact/data/twitter/keys"
key_folder = "../data/twitter/keys"
existed = set([f... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
796,
366,
16748,
805,
347,
2093,
11729,
1,
198,
198,
11748,
28686,
198,
198,
8625,
796,
366,
71,
26... | 2.267606 | 355 |
# Generated by Django 2.1.7 on 2019-04-12 06:15
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
22,
319,
13130,
12,
3023,
12,
1065,
9130,
25,
1314,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
# 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 may ... | [
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,
5964,
1321,
13,
19... | 3.204191 | 1,861 |
import numpy as np
import tensorflow as tf
from DeepAgent.interfaces.ibaseNetwork import BaseNetwork
| [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
10766,
36772,
13,
3849,
32186,
13,
571,
589,
26245,
1330,
7308,
26245,
628
] | 3.678571 | 28 |
# Generated by Django 3.0.8 on 2020-07-28 16:09
from django.db import migrations, models
import django.db.models.deletion
import wagtail.core.fields
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
23,
319,
12131,
12,
2998,
12,
2078,
1467,
25,
2931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.849057 | 53 |
from azure.ai.formrecognizer import FormRecognizerClient
from azure.core.credentials import AzureKeyCredential
import pandas as pd
from .ds import AzureOCR, OCRText
from .common import LineNumber
if __name__ == '__main__':
document_filepath = ''
endpoint =''
subscription_key = ''
form_api_ocr = Az... | [
6738,
35560,
495,
13,
1872,
13,
687,
26243,
7509,
1330,
5178,
6690,
2360,
7509,
11792,
198,
6738,
35560,
495,
13,
7295,
13,
66,
445,
14817,
1330,
22134,
9218,
34,
445,
1843,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
764,
... | 2.285714 | 378 |
from django.db import models as mo
from django.utils.translation import ugettext_lazy as _
from kalinka.core.models import *
#class Transcode(mo.Model):
# uuid = mo.CharField(_('UUID'), max_length=120, primary_key=True)
# application = mo.ForeignKey(Application, verbose_name=_('Application'), db_column='... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
355,
6941,
201,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
201,
198,
201,
198,
6738,
479,
282,
48955,
13,
7295,
13,
27530,
1330,
1635,
201,... | 2.474576 | 236 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 3 19:10:25 2019
@author: NickT
"""
import pickle
from pymatgen import MPRester
mat_api_key = 'JWV6Fi4f6VfxROtHO2uP'
mpr = MPRester(mat_api_key)
print("Loading Compounds....")
Querey = mpr.query(criteria = {'elements': ['Si'], 'nelements': 1}, p... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
2758,
220,
513,
678,
25,
940,
25,
1495,
13130,
198,
198,
31,
9800,
25,
8047,
51,
... | 2.265363 | 358 |
import chess
import ai
cnt = 0
res_F = 'Wrong command\n'
res_0 = 'Plz continue\n'
res_1 = 'Normal end\nTry to check mate as early as possible!\n'
res_2 = 'You lose!\nShe cheated!\nHint: Check her step!\n'
flag = '*CTF{1F_i_had_A_t!me_mAch1ne}\n'
boards = []
| [
11748,
19780,
198,
11748,
257,
72,
198,
198,
66,
429,
796,
657,
198,
411,
62,
37,
796,
705,
39213,
506,
3141,
59,
77,
6,
198,
411,
62,
15,
796,
705,
3646,
89,
2555,
59,
77,
6,
198,
411,
62,
16,
796,
705,
26447,
886,
59,
77,
... | 2.20339 | 118 |
start_time = time.time()
## Local Contrast Normalization
def lcn_2d(im, sigmas=[1.591, 1.591]):
""" Apply local contrast normalization to a square image.
Uses a scheme described in Pinto et al (2008)
Based on matlab code by Koray Kavukcuoglu
http://cs.nyu.edu/~koray/publis/code/randomc101.tar.gz
... | [
9688,
62,
2435,
796,
640,
13,
2435,
3419,
198,
198,
2235,
10714,
47011,
14435,
1634,
198,
198,
4299,
300,
31522,
62,
17,
67,
7,
320,
11,
43237,
5356,
41888,
16,
13,
48952,
11,
352,
13,
48952,
60,
2599,
198,
220,
220,
220,
37227,
2... | 2.110898 | 5,744 |
import argparse
import ipaddress
from sys import stderr
import boto3
from pkg_resources import get_distribution, DistributionNotFound
try:
from pyvpc_cidr_block import PyVPCBlock, return_pyvpc_objects_string, return_pyvpc_objects_json
except ModuleNotFoundError:
from .pyvpc_cidr_block import PyVPCBlock, retur... | [
11748,
1822,
29572,
198,
11748,
20966,
21975,
198,
6738,
25064,
1330,
336,
1082,
81,
198,
198,
11748,
275,
2069,
18,
198,
6738,
279,
10025,
62,
37540,
1330,
651,
62,
17080,
3890,
11,
27484,
3673,
21077,
198,
198,
28311,
25,
198,
220,
... | 2.03496 | 9,611 |
valores = []
c = 1
continuar = 'S'
while continuar != 'N':
valor = int(input(f'{c} Número: '))
if valor not in valores:
valores.append(valor)
print('Valor adicionado com sucesso!')
c += 1
print(' ')
else:
print('Erro! Valor duplicado.')
print('')
... | [
2100,
2850,
796,
17635,
201,
198,
66,
796,
352,
201,
198,
18487,
84,
283,
796,
705,
50,
6,
201,
198,
4514,
11143,
283,
14512,
705,
45,
10354,
201,
198,
220,
220,
220,
1188,
273,
796,
493,
7,
15414,
7,
69,
6,
90,
66,
92,
399,
2... | 1.983264 | 239 |
#!/usr/bin/python
class Car(object):
"""docstring for Car"""
class Truck(Car):
"""docstring for Truck"""
# This is the standard boilerplate that calls the main() function.
if __name__ == '__main__':
main() | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
4871,
1879,
7,
15252,
2599,
198,
197,
37811,
15390,
8841,
329,
1879,
37811,
198,
198,
4871,
24892,
7,
9914,
2599,
198,
197,
37811,
15390,
8841,
329,
24892,
37811,
198,
198,
2,
770,
318,
... | 3.117647 | 68 |
from functools import partial
from typing import (Any,
Tuple)
from .hints import Predicate
def instance_of(*types: type) -> Predicate:
"""
Creates predicate that checks if object is instance of given types.
>>> is_any_string = instance_of(str, bytes, bytearray)
>>> is_any_string(... | [
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
19720,
1330,
357,
7149,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
309,
29291,
8,
198,
198,
6738,
764,
71,
29503,
1330,
1... | 2.099075 | 757 |
"""
1.
This stores many different modification display methods, and all the modification will be got from here.
Shorthand:
Spectronaut -> SN
"""
class ModType(BasicModInfo):
"""
Spectronaut version 12 has get_one_prefix_result different modification display type.
The default version is set to 12, which... | [
37811,
198,
16,
13,
198,
1212,
7000,
867,
1180,
17613,
3359,
5050,
11,
290,
477,
262,
17613,
481,
307,
1392,
422,
994,
13,
198,
198,
2484,
1506,
392,
25,
198,
49738,
1313,
2306,
4613,
11346,
198,
198,
37811,
628,
198,
198,
4871,
340... | 3.755725 | 131 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
from anime import Anime
class AnimeList():
"""Holds info about a user's anime list
"""
def get_anime_data(self, include_ptw, exclude_animes_from_file,
excluded_animes):
"""Get ba... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
201,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
201,
198,
201,
198,
6738,
11984,
1330,
27812... | 2.025415 | 1,023 |
#!/usr/bin/env python
"""
Detection Training Script for CoaT.
This script is a modified version of the training script in detectron2/projects/TridentNet
"""
import os
from detectron2.checkpoint import DetectionCheckpointer
from detectron2.config import get_cfg
from detectron2.engine import DefaultTrainer, default_a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
11242,
3213,
13614,
12327,
329,
1766,
64,
51,
13,
198,
198,
1212,
4226,
318,
257,
9518,
2196,
286,
262,
3047,
4226,
287,
4886,
1313,
17,
14,
42068,
14,
2898,
738,
79... | 2.524809 | 524 |
import os
import pprint
import sys
import hydra
import pandas as pd
from hydra.utils import instantiate
from omegaconf import DictConfig, OmegaConf
sys.path.append("src/")
@hydra.main(config_path="../../config", config_name="default")
if __name__ == "__main__":
main()
| [
11748,
28686,
198,
11748,
279,
4798,
198,
11748,
25064,
198,
198,
11748,
25039,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
25039,
13,
26791,
1330,
9113,
9386,
198,
6738,
267,
28917,
7807,
69,
1330,
360,
713,
16934,
11,
19839,
1854... | 3 | 93 |
'''
Created on Mar 13, 2020
@author: ballance
'''
from ucis.cover_type import CoverType
| [
7061,
6,
198,
41972,
319,
1526,
1511,
11,
12131,
198,
198,
31,
9800,
25,
2613,
590,
198,
7061,
6,
198,
6738,
334,
66,
271,
13,
9631,
62,
4906,
1330,
17546,
6030,
198,
220,
220,
220,
220
] | 2.583333 | 36 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from flask import render_template
__author__ = 'Ondřej Lanč'
class Renderer(object):
"""class for render package elements
"""
def entry_render(self, entry):
"""base render method render all type of entries
:param entry: entry for rendering
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
198,
834,
9800,
834,
796,
705,
46,
358,
129,
247,
68,
73,
14730,
46195,
... | 1.729176 | 4,298 |