content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from __future__ import annotations
from typing import Iterator, Mapping
from prettyqt.qt import QtCore
if __name__ == "__main__":
env = ProcessEnvironment.get_system_environment()
print(dict(env))
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
19720,
1330,
40806,
1352,
11,
337,
5912,
198,
198,
6738,
2495,
39568,
13,
39568,
1330,
33734,
14055,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,... | 3.230769 | 65 |
import pytest
from aiobotocore.aiomoto.utils import response_success
@pytest.fixture
@pytest.fixture
@pytest.mark.asyncio
| [
11748,
12972,
9288,
198,
198,
6738,
257,
72,
672,
313,
420,
382,
13,
1872,
296,
2069,
13,
26791,
1330,
2882,
62,
13138,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
69,
9602,
628,
198,
31,
9078,
9288,
13,
... | 2.58 | 50 |
#!/usr/bin/env python
"""
Minimalistic filter to enable Tufte style sidenotes.
The filter replaces the pandoc internal Note token by suitable html tags to be
used with tufte.css.
"""
from pandocfilters import toJSONFilter, RawInline
sidenote_count = 0
def sidenote(key, value, fmt, meta):
"""Replace `Note` t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
9452,
4402,
2569,
8106,
284,
7139,
309,
3046,
660,
3918,
9785,
268,
6421,
13,
198,
198,
464,
8106,
24020,
262,
19798,
420,
5387,
5740,
11241,
416,
11080,
27711,
15940,
... | 2.507331 | 341 |
#!/usr/bin/env python3
"""Using exons metadata, estimate projection confidence level."""
import argparse
import sys
from collections import defaultdict
__author__ = "Bogdan Kirilenko, 2020."
__version__ = "1.0"
__email__ = "bogdan.kirilenko@senckenberg.de"
__credits__ = ["Michael Hiller", "Virag Sharma", "David Jebb"]... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
12814,
409,
684,
20150,
11,
8636,
20128,
6628,
1241,
526,
15931,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
834,
9800,
834,
796... | 2.335941 | 2,045 |
'''Common verify functions for Segment routing'''
# Python
import logging
# Metaparser
from genie.metaparser.util.exceptions import SchemaEmptyParserError
from genie.utils.timeout import Timeout
from pyats.utils.objects import find, R
from genie.libs.sdk.libs.utils.normalize import GroupKeys
log = logging.getLogger(... | [
7061,
6,
17227,
11767,
5499,
329,
1001,
5154,
28166,
7061,
6,
198,
2,
11361,
198,
11748,
18931,
198,
198,
2,
3395,
499,
28198,
198,
6738,
2429,
494,
13,
4164,
499,
28198,
13,
22602,
13,
1069,
11755,
1330,
10011,
2611,
40613,
46677,
12... | 2.252653 | 1,508 |
# -*- coding: utf-8
from __future__ import unicode_literals, absolute_import
from django.conf.urls import url, include
from rest_framework import routers
from tests import viewsets
router = routers.DefaultRouter()
router.register(r'product', viewsets.ProductViewSet)
router.register(r'category', viewsets.CategoryView... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
11,
4112,
62,
11748,
198,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
6738,
1334,
62,
3... | 2.97561 | 164 |
from bottle import *
@get("/messages")
@post("/messages")
| [
6738,
9294,
1330,
1635,
198,
198,
31,
1136,
7203,
14,
37348,
1095,
4943,
198,
198,
31,
7353,
7203,
14,
37348,
1095,
4943,
198
] | 2.608696 | 23 |
"""
Module for testing the Ona app utils
"""
from unittest.mock import patch
from django.conf import settings
from django.contrib.auth.models import User
from django.db import IntegrityError
from django.test import override_settings
from dateutil.parser import parse
from django_prices.models import Money
from model_m... | [
37811,
198,
26796,
329,
4856,
262,
1550,
64,
598,
3384,
4487,
198,
37811,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
... | 1.991155 | 12,437 |
from int_args_fwrap import *
__doc__ = u'''
>>> int_args_func(1,2,3) == (10, 6L)
True
>>> int_args_subr(1,2,3) == 6L
True
'''
| [
6738,
493,
62,
22046,
62,
69,
37150,
1330,
1635,
198,
198,
834,
15390,
834,
796,
334,
7061,
6,
198,
33409,
493,
62,
22046,
62,
20786,
7,
16,
11,
17,
11,
18,
8,
6624,
357,
940,
11,
718,
43,
8,
198,
17821,
198,
33409,
493,
62,
2... | 1.953846 | 65 |
__version__ = '0.0.1'
from .app import * # noqa
from .app import Connection # noqa
from .app import Function # noqa
from .app import Item # noqa
from .app import Locals # noqa
from .app import Output # noqa
from .app import Plan # noqa
from .app import Provider # noqa
from .app import Provisioner # noqa
from... | [
834,
9641,
834,
796,
705,
15,
13,
15,
13,
16,
6,
628,
198,
6738,
764,
1324,
1330,
1635,
220,
1303,
645,
20402,
198,
6738,
764,
1324,
1330,
26923,
220,
1303,
645,
20402,
198,
6738,
764,
1324,
1330,
15553,
220,
1303,
645,
20402,
198,
... | 3.059259 | 135 |
'''
Copyright (C) 2020-2021 Mo Zhou <cdluminate@gmail.com>
Released under the Apache-2.0 License.
'''
import os
import sys
import random
import glob
import argparse
import rich
c = rich.get_console()
if __name__ == '__main__':
ag = argparse.ArgumentParser()
ag.add_argument('-p', '--pool', type=str,
... | [
7061,
6,
198,
15269,
357,
34,
8,
12131,
12,
1238,
2481,
4270,
32222,
1279,
10210,
75,
388,
4559,
31,
14816,
13,
785,
29,
198,
45037,
739,
262,
24843,
12,
17,
13,
15,
13789,
13,
198,
7061,
6,
198,
11748,
28686,
198,
11748,
25064,
1... | 2.348214 | 336 |
import random
from uuid import uuid4
import google
import grpc
import lime_comb
import pytest
from google.cloud.firestore_v1.types import Document, Value
from lime_comb.auth.google import get_anon_cred
from lime_comb.config import config
from lime_comb.firestore import database
from .conftest import *
| [
11748,
4738,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
198,
198,
11748,
23645,
198,
11748,
1036,
14751,
198,
11748,
28738,
62,
24011,
198,
11748,
12972,
9288,
198,
6738,
23645,
13,
17721,
13,
6495,
8095,
62,
85,
16,
13,
19199,
1330,
... | 3.438202 | 89 |
"""Docstring."""
__version__ = '0.0.45'
from srupy.response import SRUResponse # noqa
from .app import SRUpy # noqa
| [
37811,
23579,
8841,
526,
15931,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
15,
13,
2231,
6,
198,
198,
6738,
264,
622,
9078,
13,
26209,
1330,
16808,
4261,
9774,
2591,
220,
1303,
645,
20402,
198,
6738,
764,
1324,
1330,
16808,
4933,
8... | 2.5 | 48 |
from kafka import KafkaConsumer
from orbit_graph.kafka_stream.config import TOPIC_NAME, KAFKA_SERVER
consumer = KafkaConsumer(TOPIC_NAME, bootstrap_servers=[KAFKA_SERVER])
for msg in consumer:
print("Received a message!")
print(msg) | [
6738,
479,
1878,
4914,
1330,
46906,
49106,
198,
6738,
13066,
62,
34960,
13,
74,
1878,
4914,
62,
5532,
13,
11250,
1330,
28662,
2149,
62,
20608,
11,
509,
8579,
25123,
62,
35009,
5959,
198,
198,
49827,
796,
46906,
49106,
7,
35222,
2149,
... | 2.975 | 80 |
# (c) 2017 Red Hat, Inc.
#
# This file is part of Ansible
| [
2,
357,
66,
8,
2177,
2297,
10983,
11,
3457,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
28038,
856,
628
] | 2.681818 | 22 |
from mds import cli
from mds import config
from mds import server
if __name__ == "__main__":
main()
| [
6738,
285,
9310,
1330,
537,
72,
198,
6738,
285,
9310,
1330,
4566,
198,
6738,
285,
9310,
1330,
4382,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.837838 | 37 |
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# Licensed under the Apache License, Version 2.0 https://aws.amazon.com/apache-2-0/
from influxdb import InfluxDBClient
| [
2,
15069,
33448,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
3... | 3.391304 | 69 |
from src.spotlight.errors import (
MAX_STRING_ERROR,
EMAIL_ERROR,
FILLED_ERROR,
IN_ERROR,
REQUIRED_ERROR,
MIN_STRING_ERROR,
)
from .validator_test import ValidatorTest
| [
6738,
12351,
13,
20485,
2971,
13,
48277,
1330,
357,
198,
220,
220,
220,
25882,
62,
18601,
2751,
62,
24908,
11,
198,
220,
220,
220,
412,
5673,
4146,
62,
24908,
11,
198,
220,
220,
220,
376,
8267,
1961,
62,
24908,
11,
198,
220,
220,
... | 2.325301 | 83 |
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
#... | [
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
... | 3.666667 | 216 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#pylint: disable=I0011,W0231
"""Bomb class"""
import item
class Bomb(item.Item):
"""Bomb"""
def __init__(self, x, y, dmo):
"""init bomb"""
item.Item.__init__(self, x, y)
self.sprite = "@"
self.dmo = dmo
def tick(self):
""... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
79,
2645,
600,
25,
15560,
28,
40,
405,
1157,
11,
54,
15,
25667,
198,
198,
37811,
48478,
1398,
37811,
198,
198,
11748,
2... | 2.168831 | 308 |
import cv2
import numpy as np
from PIL import Image
from keras import models
#Load the saved model
model = models.load_model('model_final.h5')
video = cv2.VideoCapture(0)
while True:
_, frame = video.read()
#Convert the captured frame into RGB
im = Image.fromarray(frame, 'RGB')
... | [
11748,
269,
85,
17,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
350,
4146,
1330,
7412,
201,
198,
6738,
41927,
292,
1330,
4981,
201,
198,
201,
198,
2,
8912,
262,
7448,
2746,
201,
198,
19849,
796,
4981,
13,
2220,
62,
1984... | 2.260116 | 519 |
#!/usr/bin/env python3
# Copyright 2020 NVIDIA 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 applicabl... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
15069,
12131,
15127,
10501,
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,
... | 2.894219 | 813 |
even_odd() | [
10197,
62,
5088,
3419
] | 2.5 | 4 |
if __name__ == "__main__":
v = input().rstrip()
w = input().rstrip()
print(LevenshteinDistance(v, w)) | [
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
410,
796,
5128,
22446,
81,
36311,
3419,
198,
220,
220,
220,
266,
796,
5128,
22446,
81,
36311,
3419,
198,
220,
220,
220,
3601,
7,
3123,
574,
1477,
2200... | 2.326531 | 49 |
# Generated by Django 3.1.3 on 2020-12-31 16:47
from django.db import migrations, models
import django.utils.timezone
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
18,
319,
12131,
12,
1065,
12,
3132,
1467,
25,
2857,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
26791,
13,
2435,
11340,
628
] | 2.926829 | 41 |
# Created by yingwen at 2019-03-10
import numpy as np
import tensorflow as tf
import tensorflow_probability as tfp
# return tf.math.log(tf.constant(1. + 1e-6, dtype=tf.float32) - tf.square(tf.math.tanh(x)))
| [
2,
15622,
416,
331,
278,
21006,
379,
13130,
12,
3070,
12,
940,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
1676,
65,
1799,
355,
256,
46428,
198,
198,
2,
1441,
... | 2.5 | 84 |
import string
import sys
from plot.table import TabularStats
from crawlstats import CST, MonthlyCrawl
if __name__ == '__main__':
plot_crawls = sys.argv[1:]
plot_name = 'languages'
column_header = 'language'
if len(plot_crawls) == 0:
plot_crawls = MonthlyCrawl.get_latest(3)
print(plot... | [
11748,
4731,
198,
11748,
25064,
198,
198,
6738,
7110,
13,
11487,
1330,
16904,
934,
29668,
198,
6738,
27318,
34242,
1330,
46429,
11,
27573,
34,
13132,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220... | 2.176638 | 351 |
import os
import logging
from fastapi import FastAPI
# create app
app = FastAPI()
# set up log
log_level = os.getenv("LOG_LEVEL", "INFO")
if log_level == 'DEBUG':
logging.basicConfig(level = logging.DEBUG)
else:
logging.basicConfig(level = logging.INFO)
log = logging.getLogger(__name__)
@app.get("/")
| [
11748,
28686,
198,
11748,
18931,
198,
198,
6738,
3049,
15042,
1330,
12549,
17614,
628,
198,
2,
2251,
598,
198,
1324,
796,
12549,
17614,
3419,
198,
198,
2,
900,
510,
2604,
198,
6404,
62,
5715,
796,
28686,
13,
1136,
24330,
7203,
25294,
... | 2.80531 | 113 |
#!/usr/bin/env python3
# -*- coding: utf8 -*-
import sys
import re
from pprint import pprint
import csv
verbose = False
csvFile = sys.argv[1]
nivel = sys.argv[2]
refFile = sys.argv[3]
if len(sys.argv) > 4:
verbose = sys.argv[4] == 'v'
if verbose:
pprint(sys.argv)
print(csvFile)
reader = csv.reader(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
198,
11748,
25064,
198,
11748,
302,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
198,
11748,
269,
21370,
628,
198,
19011... | 2.092166 | 434 |
def save_list(input_list, file_name):
"""A list (input_list) is saved in a file (file_name)"""
with open(file_name, 'w') as fh:
for item in input_list:
fh.write('{0}\n'.format(item))
return None
| [
4299,
3613,
62,
4868,
7,
15414,
62,
4868,
11,
2393,
62,
3672,
2599,
198,
220,
220,
220,
37227,
32,
1351,
357,
15414,
62,
4868,
8,
318,
7448,
287,
257,
2393,
357,
7753,
62,
3672,
8,
37811,
198,
220,
220,
220,
351,
1280,
7,
7753,
... | 2.22549 | 102 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
21004,
25,
3384,
69,
12,
23,
198,
11748,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
10011,
2611,
44,
4254,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198
] | 3.263158 | 38 |
#!/usr/bin/python3
from bs4 import BeautifulSoup
import requests
r = requests.get('https://www.cics.umass.edu/events')
soup = BeautifulSoup(r.text, 'html.parser')
events = soup.find_all('div', class_='view-event-wrapper')
for event in events:
date = event.find('span', class_='date-display-single').string.strip()... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
198,
81,
796,
7007,
13,
1136,
10786,
5450,
1378,
2503,
13,
66,
873,
13,
388,
562,
13,
15532,
14,
31534,
11537,
1... | 2.788462 | 156 |
"""Add an index on ssh_search_key
Revision ID: 0a8f99c161e2
Revises: ba538b2648b7
Create Date: 2018-10-04 10:49:44.739141
"""
# revision identifiers, used by Alembic.
revision = "0a8f99c161e2"
down_revision = "ba538b2648b7"
from alembic import op
import sqlalchemy as sa
def upgrade():
""" Creates an index on ... | [
37811,
4550,
281,
6376,
319,
26678,
62,
12947,
62,
2539,
198,
198,
18009,
1166,
4522,
25,
657,
64,
23,
69,
2079,
66,
25948,
68,
17,
198,
18009,
2696,
25,
26605,
49561,
65,
2075,
2780,
65,
22,
198,
16447,
7536,
25,
2864,
12,
940,
1... | 2.189498 | 438 |
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apa... | [
171,
119,
123,
2,
10097,
45537,
198,
2,
15069,
357,
66,
8,
5413,
13,
220,
1439,
2489,
10395,
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,
42... | 3.853723 | 376 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is released under terms of BSD license
# See LICENSE file for more information
# @author Mikhail Zhigun
from __future__ import print_function
import argparse
import os
import sys
from os.path import join as join_path
LICENSE_LINES = ('This file is released un... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
770,
2393,
318,
2716,
739,
2846,
286,
347,
10305,
5964,
198,
2,
4091,
38559,
24290,
2393,
329,
517,
1321,
198,
2,
... | 2.312169 | 945 |
import os
import h5py
import random
import numpy as np
import torch
from .base import BaseDataset
from models.torchvggish.torchvggish import vggish_input
| [
11748,
28686,
198,
11748,
289,
20,
9078,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
28034,
198,
198,
6738,
764,
8692,
1330,
7308,
27354,
292,
316,
198,
6738,
4981,
13,
13165,
354,
85,
1130,
680,
13,
13165,
... | 3.019231 | 52 |
try:
from tkinter.scrolledtext import *
except ImportError:
from Tkinter.ScrolledText import * | [
28311,
25,
201,
198,
197,
6738,
256,
74,
3849,
13,
1416,
8375,
5239,
1330,
1635,
201,
198,
16341,
17267,
12331,
25,
201,
198,
197,
6738,
309,
74,
3849,
13,
3351,
8375,
8206,
1330,
1635
] | 2.911765 | 34 |
"""Program schedule."""
from datetime import datetime
from typing import List, Optional
from radikopodcast.database.database import Database
from radikopodcast.database.models import Program, Station
from radikopodcast.database.program_downloader import ProgramDownloader
from radikopodcast.radiko_datetime import Radik... | [
37811,
15167,
7269,
526,
15931,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
6738,
2511,
1134,
404,
7107,
13,
48806,
13,
48806,
1330,
24047,
198,
6738,
2511,
1134,
404,
7107,
13,
48806,
13,... | 3.079848 | 263 |
# -*- coding: utf-8 -*-
# Vargas Medina Eyver Emilio - 213128780
# -------------------------------------------------
# -------------------------------------------------
# -------------------------------------------------
# -------------------------------------------------
# --------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
44684,
292,
41946,
21566,
332,
44272,
952,
532,
28658,
1065,
5774,
1795,
198,
198,
2,
20368,
1783,
12,
198,
2,
20368,
1783,
12,
198,
2,
20368,
1783,
12,
198,
2,
2... | 6.702703 | 111 |
# Generated by Django 3.2.5 on 2021-07-19 18:27
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
20,
319,
33448,
12,
2998,
12,
1129,
1248,
25,
1983,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from setuptools import setup
from codecs import open
setup(name='geppetto',
version='0.1',
description='Python interfaces to the Geppetto Simulation Engine',
long_description=readme(),
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
6738,
40481,
82,
1330,
1280,
198,
198,
40406,
7,
3672,
11639,
469,
381,
316,
1462,
3256,
198,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
16,
3256,
198,
220,
220,
220,
220,
220,
6764,
1163... | 2.505848 | 342 |
# -*- coding: utf-8 -*-
"""
Created on Sun Feb 7 17:12:29 2021
@author: ÄGARE
"""
#This script is meant to hyperoptimize GANomaly with respect to
#Inlier Classes
#Weights in the objective function
#Size of the different architectures
#Different optimization algorithms
#Dimension of the latent space
#Mini batch si... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3825,
3158,
220,
767,
1596,
25,
1065,
25,
1959,
33448,
198,
198,
31,
9800,
25,
6184,
226,
38,
12203,
198,
37811,
198,
198,
2,
1212,
4226,
318,
... | 3.284314 | 102 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
from typing import Dict, List, Optional
import pytorch_lightning as pl
import reagent.types as rlt
# pyre-fixme[21]: Could not find `petastorm`.
from petastorm import make_batch_reader
# pyre-fixme[21]: Cou... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
357,
66,
8,
3203,
11,
3457,
13,
290,
663,
29116,
13,
1439,
2489,
10395,
13,
198,
198,
11748,
18931,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
198,
198,
1... | 2.663897 | 1,324 |
# funcs03.py
zahl1 = 10
zahl2 = 20
# test_vars_01()
test_vars_02() | [
2,
1257,
6359,
3070,
13,
9078,
628,
198,
198,
89,
15668,
16,
796,
838,
198,
89,
15668,
17,
796,
1160,
198,
198,
2,
1332,
62,
85,
945,
62,
486,
3419,
198,
9288,
62,
85,
945,
62,
2999,
3419
] | 1.842105 | 38 |
import numpy as np
import garbledcircuit as gc
import time
A = np.array([0,23])
dimension = 2
precision = 10
security = 100
ts = gc.TemplateSecurity(A,precision,4)
wires,et,keys,A,square_sum_query,current,gc_euc = ts.euclidean_distance_setup()
keys1 = keys[0:dimension*precision]+keys[square_sum_query[1,0]:square_sum_... | [
11748,
299,
32152,
355,
45941,
198,
11748,
5482,
9342,
21170,
5013,
355,
308,
66,
198,
11748,
640,
198,
198,
32,
796,
45941,
13,
18747,
26933,
15,
11,
1954,
12962,
198,
46156,
796,
362,
198,
3866,
16005,
796,
838,
198,
12961,
796,
180... | 2.353191 | 235 |
import matplotlib.pyplot as pyplot
from numpy import argmax
from variables import BATCH_SIZE
def show_plots(history, plot_title=None, fig_size=None):
""" Useful function to view plot of loss values & accuracies across the various epochs
Works with the history object returned by the train_model(...) call
... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
12972,
29487,
198,
6738,
299,
32152,
1330,
1822,
9806,
198,
198,
6738,
9633,
1330,
347,
11417,
62,
33489,
628,
198,
4299,
905,
62,
489,
1747,
7,
23569,
11,
7110,
62,
7839,
28,
14202,
11,... | 2.374593 | 921 |
import os
import os.path
import subprocess
import sys
if sys.platform[:3] == "win":
else:
if __name__ == "__main__":
main(sys.argv[1])
| [
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
361,
25064,
13,
24254,
58,
25,
18,
60,
6624,
366,
5404,
1298,
198,
198,
17772,
25,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,... | 2.465517 | 58 |
import re
from itertools import chain
from colored import fg, attr
try:
print(f'{fg(226)}{attr(1)}Warning: Every Field must be answered!!!{attr(0)}')
ph_num(int(input(f"{fg(27)}{attr(1)}Phone number: {attr(0)}")),
str(input(f"{fg(27)}{attr(1)}Capitalize first letter yes(y) or no(n): {attr... | [
11748,
302,
201,
198,
6738,
340,
861,
10141,
1330,
6333,
201,
198,
6738,
16396,
1330,
277,
70,
11,
708,
81,
201,
198,
201,
198,
201,
198,
201,
198,
28311,
25,
201,
198,
220,
220,
220,
3601,
7,
69,
6,
90,
40616,
7,
24909,
8,
1847... | 2.400763 | 262 |
import math
import numpy as np
from qtpy import QtCore, QtGui, QtWidgets
from ...graphics.plotview import PlotView
from ...graphics.rulers import TickedRuler, Axis
from ...graphics.functions import arrayToQPath
from ...graphics.items import createCurve
from ...utils.ticks import tickValues
... | [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
10662,
83,
9078,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
198,
198,
6738,
2644,
70,
11549,
13,
29487,
1177,
1330,
28114,
7680,
198,
6738,
2644,... | 2.548872 | 133 |
import pytest
from overhave.entities import FeatureTypeModel
from overhave.storage import FeatureTypeStorage
@pytest.mark.usefixtures("database")
class TestFeatureTypeStorage:
""" Integration tests for :class:`FeatureTypeStorage`. """
| [
11748,
12972,
9288,
198,
198,
6738,
625,
14150,
13,
298,
871,
1330,
27018,
6030,
17633,
198,
6738,
625,
14150,
13,
35350,
1330,
27018,
6030,
31425,
628,
198,
198,
31,
9078,
9288,
13,
4102,
13,
1904,
69,
25506,
7203,
48806,
4943,
198,
... | 3.738462 | 65 |
import socket
from threading import Thread
import time
users = []
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('127.0.0.1', 53330))
sock.listen(10)
sock.setblocking(False)
user_thread = Thread(target=coming_users)
message_thread = Thread(target=message)
user_thread.start()
message_thread.s... | [
11748,
17802,
198,
198,
6738,
4704,
278,
1330,
14122,
198,
11748,
640,
198,
198,
18417,
796,
17635,
198,
82,
735,
796,
17802,
13,
44971,
7,
44971,
13,
8579,
62,
1268,
2767,
11,
17802,
13,
50,
11290,
62,
2257,
32235,
8,
198,
82,
735,... | 2.762712 | 118 |
import hydra
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import utils
from agent.ddpg import DDPGAgent
| [
11748,
25039,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
11748,
3384,
4487,
198,
6738,
5797,
13,
1860,
6024,
1330,
360,... | 3.217391 | 46 |
from _gdbm_cffi import ffi, lib # generated by _gdbm_build.py
import sys, os, threading
_lock = threading.Lock()
open_flags = "rwcnfsu"
| [
6738,
4808,
70,
9945,
76,
62,
66,
487,
72,
1330,
277,
12463,
11,
9195,
220,
220,
220,
1303,
7560,
416,
4808,
70,
9945,
76,
62,
11249,
13,
9078,
198,
11748,
25064,
11,
28686,
11,
4704,
278,
198,
62,
5354,
796,
4704,
278,
13,
25392,... | 2.431034 | 58 |
# Copyright (c) 2021 Avery
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
from os import path
from setuptools import setup
with open(path.join(path.abspath(path.dirname(__file__)), 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name='tribi',
... | [
2,
15069,
357,
66,
8,
33448,
29218,
198,
2,
220,
198,
2,
770,
3788,
318,
2716,
739,
262,
17168,
13789,
13,
198,
2,
3740,
1378,
44813,
1668,
13,
2398,
14,
677,
4541,
14,
36393,
198,
198,
6738,
28686,
1330,
3108,
198,
6738,
900,
376... | 2.641447 | 304 |
import math
import torch
import torch.nn as nn
class PositionalEncoding(nn.Module):
"""
A layer to add positional encodings to the inputs of a Transformer model.
Formula:
PE(pos,2i) = sin(pos/10000^(2i/d_model))
PE(pos,2i+1) = cos(pos/10000^(2i/d_model))
"""
def gener... | [
11748,
10688,
201,
198,
201,
198,
11748,
28034,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
201,
198,
201,
198,
4871,
18574,
1859,
27195,
7656,
7,
20471,
13,
26796,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
... | 2.396721 | 305 |
from conan.tools.google.toolchain import BazelToolchain
from conan.tools.google.bazeldeps import BazelDeps
from conan.tools.google.bazel import Bazel
from conan.tools.google.layout import bazel_layout
| [
6738,
369,
272,
13,
31391,
13,
13297,
13,
25981,
7983,
1330,
347,
41319,
25391,
7983,
198,
6738,
369,
272,
13,
31391,
13,
13297,
13,
65,
6201,
335,
25386,
1330,
347,
41319,
12156,
82,
198,
6738,
369,
272,
13,
31391,
13,
13297,
13,
6... | 3.190476 | 63 |
from django.test import TestCase
from mock import MagicMock, patch
from .. import serializers
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
15290,
1330,
6139,
44,
735,
11,
8529,
198,
198,
6738,
11485,
1330,
11389,
11341,
628
] | 3.84 | 25 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
24893,
1087,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
5525,
241,
251,
165,
110,
116,
162,
247,
118,
12859,
239,
47,
7252,
50,
33176,
111,
2... | 3.548495 | 299 |
from django.contrib.admin.apps import AdminConfig
class OAuthAdminConfig(AdminConfig):
"""Required to override stock Django admin app with OAuth2 admin app."""
default_site = 'datahub.oauth.admin.admin.OAuth2AdminSite'
| [
6738,
42625,
14208,
13,
3642,
822,
13,
28482,
13,
18211,
1330,
32053,
16934,
628,
198,
4871,
440,
30515,
46787,
16934,
7,
46787,
16934,
2599,
198,
220,
220,
220,
37227,
37374,
284,
20957,
4283,
37770,
13169,
598,
351,
440,
30515,
17,
13... | 3.239437 | 71 |
# Copyright (c) 2017, 2018 Jae-jun Kang
# See the file LICENSE for details.
from datetime import timedelta
from x2py.builtin_events import TimeoutEvent
from x2py.flow import Flow
from x2py.flows.time_flow import TimeFlow
| [
2,
15069,
357,
66,
8,
2177,
11,
2864,
34521,
12,
29741,
27504,
198,
2,
4091,
262,
2393,
38559,
24290,
329,
3307,
13,
198,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
6738,
2124,
17,
9078,
13,
18780,
259,
62,
31534,
1330,
38... | 3.231884 | 69 |
#!/usr/bin/python
# Copyright (C) 2015, WSID
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
15069,
357,
34,
8,
1853,
11,
25290,
2389,
198,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
... | 3.623188 | 345 |
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Spelling checker extension for Sphinx.
"""
import builtins
import imp
import xmlrpc.client as xmlrpc_client
from enchant.tokenize import Filter, tokenize, unit_tokenize
# TODO - Words with multiple uppercase letters treated as classes... | [
2,
21004,
25,
3384,
69,
12,
23,
198,
2,
198,
2,
15069,
357,
66,
8,
3050,
15115,
5783,
9038,
13,
220,
1439,
2489,
10395,
13,
198,
2,
198,
37811,
5248,
2680,
2198,
263,
7552,
329,
45368,
28413,
13,
198,
37811,
198,
198,
11748,
3170,... | 2.156656 | 1,615 |
import sys
from loguru import logger
logger.remove()
logger.add(sys.stderr, enqueue=True, format="", colorize=False, backtrace=True)
try:
1 / 0
except ZeroDivisionError:
logger.exception("Error")
| [
11748,
25064,
198,
6738,
2604,
14717,
1330,
49706,
198,
198,
6404,
1362,
13,
28956,
3419,
198,
6404,
1362,
13,
2860,
7,
17597,
13,
301,
1082,
81,
11,
551,
36560,
28,
17821,
11,
5794,
2625,
1600,
3124,
1096,
28,
25101,
11,
736,
40546,
... | 2.746667 | 75 |
import findspark
findspark.init()
import os
os.environ['PYSPARK_SUBMIT_ARGS'] = '--packages org.apache.spark:spark-streaming-kafka-0-8_2.11:2.3.2 pyspark-shell'
# spark-streaming-kafka-0-10 hasn't support Python yet
# https://spark.apache.org/docs/latest/streaming-kafka-integration.html
import pyspark
from pyspark.s... | [
11748,
1064,
2777,
668,
198,
19796,
2777,
668,
13,
15003,
3419,
198,
11748,
28686,
198,
418,
13,
268,
2268,
17816,
47,
56,
4303,
14175,
62,
50,
10526,
36393,
62,
1503,
14313,
20520,
796,
705,
438,
43789,
8745,
13,
43073,
13,
2777,
668... | 2.236842 | 912 |
import site
import sys
from setuptools import setup
if __name__ == "__main__":
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]
setup(data_files=[
('share/bash-completion/completions/', ['src/forest/forest.bash']),
]) | [
11748,
2524,
198,
11748,
25064,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
2524,
13,
1677,
17534,
62,
29904,
62,
50,
12709,
796,
366,
438,
7220... | 2.494737 | 95 |
from .beam2d import PBeam2D
| [
6738,
764,
40045,
17,
67,
1330,
350,
3856,
321,
17,
35,
198
] | 2.333333 | 12 |
from collections import defaultdict
import itertools
def condense(lines):
"""
Given: List of lines: [('filename', 1), ('filename', 2), ...]
Result: List of line-ranges, if they have no gap, for example
[('filename', [1,2])]
"""
res = []
# 1. Group by file
files = defaultdict(... | [
6738,
17268,
1330,
4277,
11600,
198,
11748,
340,
861,
10141,
628,
198,
4299,
1779,
1072,
7,
6615,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11259,
25,
7343,
286,
3951,
25,
685,
10786,
34345,
3256,
352,
828,
19203,
34345,
32... | 2.482353 | 255 |
import os
import cv2
import numpy as np
from datetime import date, datetime
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
from os import listdir
from os.path import isfile, join
def get_jetson_gstreamer_source(capture_width=1280, capture_height=720, display_width=1280,... | [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
27530,
1330,
3440,
62,
19849,
198,
6738,
11192,
273,
11125,
... | 2.326146 | 742 |
from typing import Tuple
import numpy as np
| [
6738,
19720,
1330,
309,
29291,
198,
11748,
299,
32152,
355,
45941,
628
] | 3.75 | 12 |
"""
Lots and the history of parcels, mergers and splits
data is from datacatalog cookcountyil gov
"""
# socrata access
SOCRATA_TOKEN_FILE = 'socrata_API_token.txt'
with open(SOCRATA_TOKEN_FILE, 'r') as token_file: # open the file and read the token
token = token_file.read().rstrip('\n')
token_file.close() ... | [
37811,
198,
43643,
290,
262,
2106,
286,
49796,
11,
4017,
5355,
290,
30778,
198,
7890,
318,
422,
4818,
330,
10254,
519,
4255,
9127,
88,
346,
467,
85,
198,
37811,
628,
198,
2,
1307,
81,
1045,
1895,
198,
50,
4503,
49,
13563,
62,
10468,... | 2.031477 | 1,652 |
import re
class GetObject(object):
"""Handles various formatting for the GetObject metadata request"""
def ids(self, content_ids, object_ids):
"""Appends the content and object ids how RETS expects them"""
result = []
content_ids = self.split(content_ids, False)
object_ids = ... | [
11748,
302,
628,
198,
4871,
3497,
10267,
7,
15252,
2599,
198,
220,
220,
220,
37227,
12885,
829,
2972,
33313,
329,
262,
3497,
10267,
20150,
2581,
37811,
628,
220,
220,
220,
825,
220,
2340,
7,
944,
11,
2695,
62,
2340,
11,
2134,
62,
23... | 2.100683 | 586 |
"""MobileNet3 for Semantic Segmentation"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from model.backbones.base import BaseModel
from model.layers.basic import _ConvBNReLU, _Hsigmoid
from model.layers.LRASPP import _Head
import warnings
warnings.filterwarnings(
action='ignore',
categor... | [
37811,
17066,
7934,
18,
329,
12449,
5109,
1001,
5154,
341,
37811,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
2746,
13,
1891,
35095,
13,
8692,
1330,
... | 2.668016 | 247 |
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RGgjoy(RPackage):
"""Joyplots provide a convenient way of visualizing changes in distribut... | [
2,
15069,
2211,
12,
7908,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
33234,
... | 2.366577 | 371 |
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
##########################################################################
def _get_keyword... | [
29113,
29113,
7804,
2235,
198,
2,
198,
2,
23241,
46787,
604,
532,
2947,
47701,
20003,
198,
2,
198,
2,
15069,
357,
34,
8,
2211,
532,
12131,
11,
383,
23241,
46787,
7712,
4816,
198,
2,
770,
3788,
318,
2716,
739,
262,
2947,
47701,
10483... | 2.649016 | 1,473 |
import os
import sys
# 현재 디렉토리 위치 추가
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from flask import request, render_template, redirect, Blueprint, session
from models.mem_model import Review, ReviewService
#from models.rev_model import ReviewService
service = ReviewService()
bp = Bluep... | [
11748,
28686,
198,
11748,
25064,
198,
2,
220,
169,
246,
226,
168,
252,
105,
31619,
242,
242,
167,
254,
231,
169,
228,
254,
167,
99,
105,
23821,
250,
226,
168,
117,
246,
23821,
114,
242,
166,
108,
222,
198,
17597,
13,
6978,
13,
332... | 2.430556 | 360 |
import json
import os
from argparse import ArgumentParser
from defusedxml.minidom import parseString
from dicttoxml import dicttoxml
from flask import (Flask, Response, abort, jsonify, make_response,
render_template, request)
try:
from scrapers import feed_gen, scrapers
except Exception as e:
... | [
11748,
33918,
198,
11748,
28686,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
198,
6738,
825,
1484,
19875,
13,
1084,
312,
296,
1330,
21136,
10100,
198,
6738,
8633,
83,
1140,
4029,
1330,
8633,
83,
1140,
4029,
198,
6738,
42903,
1330,
... | 2.760599 | 401 |
## @defgroup Methods-Noise-Fidelity_One-Engine Engine
# Fidelity One level noise calculations for the engine
# @ingroup Methods-Noise-Fidelity_One
from .noise_SAE import noise_SAE | [
2235,
2488,
4299,
8094,
25458,
12,
2949,
786,
12,
37,
23091,
62,
3198,
12,
13798,
7117,
198,
2,
376,
23091,
1881,
1241,
7838,
16765,
329,
262,
3113,
198,
2,
2488,
278,
3233,
25458,
12,
2949,
786,
12,
37,
23091,
62,
3198,
198,
198,
... | 3.272727 | 55 |
########################################################################################################################
# Script that runs the Dogcatcher pipeline with the differential expression module for benchmarking. This script is #
# optimized for multi-threading in order to preserve a fair comparison with AR... | [
29113,
29113,
29113,
14468,
7804,
198,
2,
12327,
326,
4539,
262,
8532,
9246,
2044,
11523,
351,
262,
22577,
5408,
8265,
329,
18335,
278,
13,
770,
4226,
318,
220,
220,
220,
1303,
198,
2,
23392,
329,
5021,
12,
16663,
278,
287,
1502,
284,... | 1.996034 | 4,034 |
import torch
from torch import Tensor
from .transformer import Transformer
from ..data import Vocab, SOS_IDX, EOS_IDX
class GreedyTranslator(Translator):
""" Greedy decoding append the most probable token for the next iteration input to the decoder.
2. The first input to the decoder is SOS (start-of-sentenc... | [
11748,
28034,
198,
6738,
28034,
1330,
309,
22854,
198,
6738,
764,
7645,
16354,
1330,
3602,
16354,
198,
6738,
11485,
7890,
1330,
47208,
397,
11,
42707,
62,
2389,
55,
11,
412,
2640,
62,
2389,
55,
628,
198,
198,
4871,
11955,
4716,
8291,
... | 3.353312 | 317 |
from typing import Dict, List
import pytest
import pandas as pd
from shapely.geometry import LineString
from geopandas import GeoDataFrame
from igraph import Graph
import common.igraph as ig_utils
from common.igraph import Edge as E
from graph_build.graph_green_view_join.graph_green_view_join import (
get_gsv_gvi_l... | [
6738,
19720,
1330,
360,
713,
11,
7343,
198,
11748,
12972,
9288,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
5485,
306,
13,
469,
15748,
1330,
6910,
10100,
198,
6738,
30324,
392,
292,
1330,
32960,
6601,
19778,
198,
6738,
45329,
1470,... | 2.507853 | 382 |
from typing import Optional
from pydantic import BaseSettings
# 其他地方出现的类似 from .. import config,均是从 __init__.py 导入的 Config 实例
| [
6738,
19720,
1330,
32233,
201,
198,
6738,
279,
5173,
5109,
1330,
7308,
26232,
201,
198,
201,
198,
201,
198,
2,
10263,
227,
114,
20015,
244,
28839,
108,
43095,
49035,
118,
163,
236,
108,
21410,
163,
109,
119,
27670,
120,
422,
11485,
13... | 1.847222 | 72 |
import unittest
from BlockChain import Blockchain
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
9726,
35491,
1330,
29724,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.941176 | 34 |
try:
import Tkinter as Tk
except ModuleNotFoundError:
import tkinter as Tk
| [
28311,
25,
198,
220,
220,
220,
1330,
309,
74,
3849,
355,
309,
74,
198,
16341,
19937,
3673,
21077,
12331,
25,
198,
220,
220,
220,
1330,
256,
74,
3849,
355,
309,
74,
628
] | 2.625 | 32 |
from setuptools import setup, find_packages
from os import path
import versioneer
# read the contents of README file
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
version = versioneer.get_version()
downlo... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
28686,
1330,
3108,
198,
11748,
2196,
28153,
198,
198,
2,
1100,
262,
10154,
286,
20832,
11682,
2393,
198,
5661,
62,
34945,
796,
3108,
13,
397,
2777,
776,
7,
6978,
13,... | 2.293353 | 692 |
# Copyright 2021 Cory Paik. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
15069,
33448,
28785,
11243,
1134,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
... | 3.486928 | 612 |
#
# robotCnx:
# manages our connection to the robot
#
# # SmartDashboard/vision: the vision subtable for communications with
# Robot & Driver. See targetState.py for details of the table contents.
from networktables import NetworkTable
import targetState
import sys, traceback, time
| [
2,
198,
2,
9379,
34,
77,
87,
25,
198,
2,
220,
220,
15314,
674,
4637,
284,
262,
9379,
198,
2,
198,
2,
1303,
10880,
43041,
3526,
14,
10178,
25,
220,
262,
5761,
850,
11487,
329,
8062,
351,
220,
198,
2,
220,
16071,
1222,
12434,
13,
... | 3.6375 | 80 |
import unittest
import vptree
import importlib
try:
np = importlib.import_module("numpy")
except ModuleNotFoundError:
raise RuntimeError("You should install NumPy to perform tests")
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
410,
457,
631,
198,
198,
11748,
1330,
8019,
628,
198,
28311,
25,
198,
220,
220,
220,
45941,
796,
1330,
8019,
13,
11748,
62,
21412,
7203,
77,
32152,
4943,
198,
16341,
19937,
3673,
21077,
12331,
25,
198... | 2.951807 | 83 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | [
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
2,
257,
4866,
286,
262,
13789,
379,
198,
2,... | 2.526531 | 490 |
import sys
import ctypes
flags = sys.getdlopenflags()
sys.setdlopenflags(flags | ctypes.RTLD_GLOBAL)
import scipy.linalg
sys.setdlopenflags(flags)
| [
198,
11748,
25064,
198,
11748,
269,
19199,
198,
198,
33152,
796,
25064,
13,
1136,
25404,
9654,
33152,
3419,
198,
17597,
13,
2617,
25404,
9654,
33152,
7,
33152,
930,
269,
19199,
13,
14181,
11163,
62,
8763,
9864,
1847,
8,
198,
11748,
629,... | 2.568966 | 58 |
""" Generate metadata. """
import itertools
import json
import pickle
import os
import re
from typing import List, Union
import numpy as np
from rdkit import Chem
# noinspection PyUnresolvedReferences
from rdkit.Chem import AllChem, rdmolops, rdPartialCharges, rdForceFieldHelpers, rdchem
from scipy import ... | [
37811,
2980,
378,
20150,
13,
37227,
201,
198,
11748,
340,
861,
10141,
201,
198,
11748,
33918,
201,
198,
11748,
2298,
293,
201,
198,
11748,
28686,
201,
198,
11748,
302,
201,
198,
6738,
19720,
1330,
7343,
11,
4479,
201,
198,
201,
198,
1... | 1.870683 | 10,424 |
num=10
num=20
num3=50
num4=60
num5=100
| [
22510,
28,
940,
198,
22510,
28,
1238,
198,
22510,
18,
28,
1120,
198,
22510,
19,
28,
1899,
198,
22510,
20,
28,
3064,
198
] | 1.695652 | 23 |
# -*- coding: utf-8 -*-
'''
pylivetable.api
~~~~~~~~~~~~~~~
This module implements the pylivetable API.
'''
from .models import Categories
def categories(site='all', top=None):
'''
Get categories from Live website
:param site: Live website name
:return: categories table which type is pandas.DataFra... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
79,
2645,
425,
11487,
13,
15042,
198,
15116,
8728,
4907,
93,
198,
198,
1212,
8265,
23986,
262,
279,
2645,
425,
11487,
7824,
13,
198,
7061,
6,
198,
... | 2.824818 | 137 |
r"""
Vibro-acoustic problem
3D acoustic domain with 2D perforated deforming interface.
*Master problem*: defined in 3D acoustic domain (``vibro_acoustic3d.py``)
*Slave subproblem*: 2D perforated interface (``vibro_acoustic3d_mid.py``)
Master 3D problem - find :math:`p` (acoustic pressure)
and :math:`g` (transversal... | [
81,
37811,
198,
53,
571,
305,
12,
330,
21618,
1917,
198,
198,
18,
35,
26071,
7386,
351,
362,
35,
583,
1640,
515,
390,
15464,
7071,
13,
198,
198,
9,
18254,
1917,
47026,
5447,
287,
513,
35,
26071,
7386,
357,
15506,
85,
571,
305,
62,... | 1.87156 | 2,289 |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
1584,
11,
33160,
11,
18650,
290,
14,
273,
663,
29116,
13,
220,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
10668,
12,
36612,
284,
345,
739,
262,
14499,
2448,
33532,
1... | 2.352184 | 2,175 |
#%% Change working directory from the workspace root to the ipynb file location. Turn this addition off with the DataSciece.changeDirOnImportExport setting
import os
try:
os.chdir(os.path.join(os.getcwd(), 'src'))
print(os.getcwd())
except:
pass
#%%
import json
import pickle
import os
import re
import json
from fl... | [
2,
16626,
9794,
1762,
8619,
422,
262,
44573,
6808,
284,
262,
20966,
2047,
65,
2393,
4067,
13,
6756,
428,
3090,
572,
351,
262,
6060,
3351,
8535,
13,
3803,
35277,
2202,
20939,
43834,
4634,
198,
11748,
28686,
198,
28311,
25,
198,
197,
41... | 2.621032 | 504 |
import cv2, PIL
import numpy as np
from cv2 import aruco
import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
import aruco_utils
import re
filename = "_data/SingleTargetExample.jpg"
frame = cv2.imread(filename)
frame_bgr = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
corners, ids = aruco_utils.de... | [
11748,
269,
85,
17,
11,
350,
4146,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
269,
85,
17,
1330,
610,
84,
1073,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
117... | 2.402367 | 338 |
"""
Importamos las siguientes clases desde el rest framework
la segunda clase "response" se utiliza para retornar
una respuesta estandar desde la API cuando alguno de los
otros componentes la invoque
"""
from rest_framework.views import APIView
from rest_framework.response import Response
# Vamos a usar... | [
37811,
198,
220,
220,
220,
17267,
321,
418,
39990,
43237,
84,
1153,
274,
537,
1386,
748,
2934,
1288,
1334,
9355,
198,
220,
220,
220,
8591,
384,
70,
46535,
537,
589,
366,
26209,
1,
384,
7736,
23638,
31215,
1005,
1211,
283,
198,
220,
... | 2.531379 | 2,661 |
'''
Merging on multiple columns
Another strategy to disambiguate cities with identical names is to add information on the states in which the cities are located. To this end, you add a column called state to both DataFrames from the preceding exercises. Again, pandas has been pre-imported as pd and the revenue and man... | [
7061,
6,
198,
13102,
2667,
319,
3294,
15180,
198,
198,
6610,
4811,
284,
595,
4131,
328,
4985,
4736,
351,
10411,
3891,
318,
284,
751,
1321,
319,
262,
2585,
287,
543,
262,
4736,
389,
5140,
13,
1675,
428,
886,
11,
345,
751,
257,
5721,
... | 3.557951 | 371 |
import sys
import h5py
from hdgwas.tools import Timer,Mapper, merge_genotype
import os
from hdgwas.data import Reader
import argparse
import gc
import tables
import numpy as np
parser = argparse.ArgumentParser(description='Script to merge genotype')
parser.add_argument("-g", "--genotype",nargs='+', type=str, help=... | [
11748,
25064,
198,
11748,
289,
20,
9078,
198,
6738,
220,
289,
67,
70,
9776,
13,
31391,
1330,
5045,
263,
11,
44,
11463,
11,
20121,
62,
5235,
8690,
198,
11748,
28686,
198,
6738,
289,
67,
70,
9776,
13,
7890,
1330,
25342,
198,
11748,
18... | 2.230552 | 1,414 |
import os,sys
import numpy as np
from .. import pg
from .. import QtGui
from ..lib.roislider import ROISlider
class LabelingTool:
""" Class holding labeling functions.
This class is a state machine that modifies a ImageItem stored in a PlotItem.
states:
uninitiated: not yet worked with an image.... | [
11748,
28686,
11,
17597,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
11485,
1330,
23241,
198,
6738,
11485,
1330,
33734,
8205,
72,
198,
6738,
11485,
8019,
13,
305,
3044,
1304,
1330,
15107,
1797,
75,
1304,
198,
198,
4871,
3498,
10809,
... | 2.239946 | 8,156 |