content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import unittest2 as unittest
import os
import json
import random
import numpy as np
import csv
import scipy.constants as const
from pymatgen.analysis.diffusio... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
350,
4948,
265,
5235,
7712,
4816,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
17168,
13789,
13,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
11,
28000,
1098,
62,
... | 2.623145 | 337 |
import sympy
from .utils import known_equal_pair, contains_incorrect_symbols
from .utils import EqualityType
from .parsing import logic_parser, UnsafeInputException
__all__ = ["check"]
KNOWN_PAIRS = dict()
def parse_expression(expression_str, *, local_dict=None):
"""Take a string containing a mathematical ex... | [
11748,
10558,
88,
198,
198,
6738,
764,
26791,
1330,
1900,
62,
40496,
62,
24874,
11,
4909,
62,
1939,
47315,
62,
1837,
2022,
10220,
198,
6738,
764,
26791,
1330,
31428,
6030,
198,
6738,
764,
79,
945,
278,
1330,
9156,
62,
48610,
11,
791,
... | 2.665639 | 3,568 |
from math import e, log10, pi
while True:
try:
n = int(input())
except EOFError:
break
if n == 0:
print(1)
else:
print(int(n * log10(n / e) + log10(2 * pi * n) / 2) + 1) | [
6738,
10688,
1330,
304,
11,
2604,
940,
11,
31028,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
299,
796,
493,
7,
15414,
28955,
198,
220,
220,
220,
2845,
412,
19238,
12331,
25,
198... | 1.85 | 120 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import sys
import argparse
import readline
import random
import traceback
try:
import builtins
raw_input = getattr(builtins, 'input')
except ImportError:
pass
from game24 import calc, game
MSG_ME... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
7297,
198,
198,
11748,
25064,
198,
11748,
1822,
... | 2.5 | 650 |
import json
import os
import boto3
from faker import Faker
# DynamoDB object
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(f"TestUsersTable-{os.environ['STAGE']}")
| [
11748,
33918,
198,
11748,
28686,
198,
11748,
275,
2069,
18,
198,
6738,
277,
3110,
1330,
376,
3110,
628,
198,
2,
41542,
11012,
2134,
198,
67,
4989,
375,
65,
796,
275,
2069,
18,
13,
31092,
10786,
67,
4989,
375,
65,
11537,
198,
11487,
... | 2.705882 | 68 |
# Using Log Files
# Settings/Options/System/Environment (use custom variables)
# QGIS_LOG_FILE=/qgis_data/log.txt
# Restart QGIS
# Message to log file:
QgsLogger.logMessageToFile("This is a message to a log file.")
# Message to QGIS Log Window ( yellow triangle icon in the lower right)
QgsMessageLog.logMessage("Thi... | [
2,
8554,
5972,
13283,
198,
198,
2,
16163,
14,
29046,
14,
11964,
14,
31441,
357,
1904,
2183,
9633,
8,
220,
198,
2,
1195,
38,
1797,
62,
25294,
62,
25664,
33223,
80,
70,
271,
62,
7890,
14,
6404,
13,
14116,
198,
2,
8324,
433,
1195,
... | 3.262295 | 122 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 appl... | [
2,
220,
220,
15069,
357,
66,
8,
12131,
350,
37382,
47,
37382,
46665,
13,
1439,
6923,
12224,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
... | 3.773006 | 163 |
from logging import getLogger, StreamHandler, DEBUG, Formatter
from typing import Dict, Union
import re
import json
import requests
import MeCab
from neologdn import normalize
# ロガー設定
logger = getLogger(__name__)
handler = StreamHandler()
handler.setLevel(DEBUG)
logger.setLevel(DEBUG)
logger.addHandler(handler)
logger... | [
6738,
18931,
1330,
651,
11187,
1362,
11,
13860,
25060,
11,
16959,
11,
5178,
1436,
198,
6738,
19720,
1330,
360,
713,
11,
4479,
198,
11748,
302,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
2185,
34,
397,
198,
6738,
497,
928,
32656,
... | 2.971014 | 138 |
import paho.mqtt.client as mqtt
import ev3dev.ev3 as ev3
import ctypes
import numpy as np
import sys
import cv2
from Sensors.mpu6050.mpu6050 import MPU6050
import smbus
from Sensors.odometry import Odometry
import sys, serial
from serial.tools import list_ports
#Create camera sensor object
camera = OnBoardCamera()
... | [
11748,
279,
17108,
13,
76,
80,
926,
13,
16366,
355,
285,
80,
926,
198,
11748,
819,
18,
7959,
13,
1990,
18,
355,
819,
18,
198,
11748,
269,
19199,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
11748,
269,
85,
17,
198,
... | 3.057143 | 105 |
import numpy as np
import openmdao.api as om
if __name__ == '__main__':
check_integrated_surface_force_partials()
| [
11748,
299,
32152,
355,
45941,
198,
11748,
1280,
9132,
5488,
13,
15042,
355,
39030,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2198,
62,
18908,
4111,
62,
42029,
62,
3174,
62,
3911,
8231,
34... | 2.767442 | 43 |
# Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | [
2,
15069,
357,
66,
8,
1946,
12,
25579,
19193,
9399,
1279,
32057,
31,
24254,
952,
13,
2398,
29,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
... | 3.317029 | 552 |
# -*- coding: utf-8 -*-
__author__ = 'Kazuyuki TAKASE'
__copyright__ = 'PLEN Project Company Inc, and all authors.'
__license__ = 'The MIT License (http://opensource.org/licenses/mit-license.php)'
# 外部プログラムの読み込み
# =============================================================================
from time import sle... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
834,
9800,
834,
220,
220,
220,
796,
705,
42,
1031,
4669,
11308,
309,
10206,
11159,
6,
198,
834,
22163,
4766,
834,
796,
705,
6489,
1677,
4935,
5834,
3457,
11,
290,... | 2.896694 | 242 |
#!/bin/python3
# if used ubuntu 20.10 or later, interpreter set as #!/bin/python and use pip instead of pip3
# =================================================================== #
# platfrom check
# dateutil check and import
try:
from dateutil.relativedelta import relativedelta
except:
import os,sys,subproces... | [
2,
48443,
8800,
14,
29412,
18,
198,
2,
611,
973,
20967,
11157,
1160,
13,
940,
393,
1568,
11,
28846,
900,
355,
1303,
48443,
8800,
14,
29412,
290,
779,
7347,
2427,
286,
7347,
18,
198,
198,
2,
38093,
855,
1303,
198,
2,
40315,
6738,
2... | 2.018998 | 15,949 |
import math | [
11748,
10688
] | 5.5 | 2 |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
from .backbones.darknet import CSPDarknet, Darknet
from .backbones.resnet_vd import Resnet18Vd, Resnet50Vd
from .backbones.resnet_vb import Resnet50Vb
from .losses.yolov3_loss import YOLOv3Loss
from .losses.losse... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
1946,
12,
1238,
2481,
8336,
85,
4178,
3457,
13,
1439,
2489,
10395,
13,
198,
198,
6738,
764,
... | 2.537217 | 309 |
#!/usr/bin/env python
import numpy as np
import kaldiio
id2mfcc = kaldiio.load_scp('/home/sangjik/kaldi/egs/voxceleb/v2.smallest/mfcc/raw_mfcc_train.10.scp')
for utt_id, mfcc in id2mfcc.items():
#print(utt_id, mfcc.shape)
np.save('./tmp_mfcc/{}.npy'.format(utt_id), mfcc)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
479,
37566,
952,
198,
198,
312,
17,
76,
69,
535,
796,
479,
37566,
952,
13,
2220,
62,
1416,
79,
10786,
14,
11195,
14,
82,
648,
73,
11... | 1.918367 | 147 |
import logging
import pathlib
import re
import os
from fnmatch import fnmatch
from textwrap import dedent
from collections import defaultdict
import datajoint as dj
from . import lab
from . import experiment
from . import ephys
from . import tracking
from .ingest.tracking import TrackingIngest
from pipeline.globu... | [
198,
11748,
18931,
198,
11748,
3108,
8019,
198,
11748,
302,
198,
11748,
28686,
198,
198,
6738,
24714,
15699,
1330,
24714,
15699,
198,
6738,
2420,
37150,
1330,
4648,
298,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
1366,
73,
1563... | 1.975054 | 6,494 |
from .data_reader import (
BetterDatasetReader, SRLDatasetReader
)
from .metrics import SRLMetric, BaseF, ExactMatch, FBetaMixMeasure
from .models import SpanModel
from .modules import (
MLPSpanTyping, SpanTyping, SpanFinder, BIOSpanFinder
)
from .predictor import SpanPredictor
from .utils import Span
| [
6738,
764,
7890,
62,
46862,
1330,
357,
198,
220,
220,
220,
11625,
27354,
292,
316,
33634,
11,
311,
7836,
27354,
292,
316,
33634,
198,
8,
198,
6738,
764,
4164,
10466,
1330,
311,
7836,
9171,
1173,
11,
7308,
37,
11,
1475,
529,
23850,
1... | 3.04902 | 102 |
# ------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See LICENSE in the repo root for license information.
# -------------------------------------------------------------------... | [
2,
220,
16529,
22369,
438,
198,
2,
220,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
220,
49962,
739,
262,
17168,
13789,
357,
36393,
737,
4091,
38559,
24290,
287,
262,
29924,
6808,
329,
5964,
1321,
13,
198,
2,
... | 3.954082 | 196 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
from click.testing import CliRunner
from pivotpoint import pp
from pivotpoint import cli
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
555,
715,
395,
198,
6738,
3904,
13,
33407,
1330,
1012,
72,
49493,
198,
6738,
30355,
4122,
1330,
9788,
198,
6738,... | 3.04 | 50 |
# -*- coding: utf-8 -*-
"""rackio/dao/controls.py
This module implements Controls Data Objects Access.
"""
from .core import RackioDAO
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
39638,
952,
14,
67,
5488,
14,
13716,
82,
13,
9078,
198,
198,
1212,
8265,
23986,
36357,
6060,
35832,
8798,
13,
198,
37811,
198,
6738,
764,
7295,
1330,
37927,
952,
... | 2.875 | 48 |
# coding:utf-8
# 添加PDF书签
from pdf_utils import MyPDFHandler,PDFHandleMode as mode
import ConfigParser
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
if __name__ == '__main__':
main() | [
2,
19617,
25,
40477,
12,
23,
201,
198,
2,
10545,
115,
119,
27950,
254,
20456,
20046,
99,
163,
255,
122,
201,
198,
6738,
37124,
62,
26791,
1330,
2011,
20456,
25060,
11,
20456,
37508,
19076,
355,
4235,
201,
198,
11748,
17056,
46677,
201... | 2.372093 | 86 |
from typing import List, Optional, Union
import pytest
from openff.utilities.utilities import has_executable, has_package
def skip_if_missing(package_name: str, reason: Optional[str] = None):
"""
Helper function to generate a pytest.mark.skipif decorator
for any package. This allows tests to be skipped ... | [
6738,
19720,
1330,
7343,
11,
32233,
11,
4479,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
1280,
487,
13,
315,
2410,
13,
315,
2410,
1330,
468,
62,
18558,
18187,
11,
468,
62,
26495,
628,
198,
4299,
14267,
62,
361,
62,
45688,
7,
2649... | 2.79046 | 587 |
if __name__ == '__main__':
test_case_1()
test_case_2()
test_case_3()
| [
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
198,
198,
9288,
62,
7442,
62,
16,
3419,
198,
9288,
62,
7442,
62,
17,
3419,
198,
9288,
62,
7442,
62,
18,
3419,
198
] | 2.083333 | 36 |
"""Test for checking if the response format is proper. Run test_crud before running this."""
import unittest
import random
import string
import json
import re
import uuid
from hydrus.app_factory import app_factory
from hydrus.socketio_factory import create_socket
from hydrus.utils import set_session, set_doc, ... | [
37811,
14402,
329,
10627,
611,
262,
2882,
5794,
318,
1774,
13,
5660,
1332,
62,
6098,
463,
878,
2491,
428,
526,
15931,
201,
198,
11748,
555,
715,
395,
201,
198,
11748,
4738,
201,
198,
11748,
4731,
201,
198,
11748,
33918,
201,
198,
1174... | 2.039665 | 17,320 |
"""Environment Variables
"""
import os
from dotenv import load_dotenv
load_dotenv()
HIC_DB_USERNAME = os.environ["HIC_DB_USERNAME"]
HIC_DB_PASSWORD = os.environ["HIC_DB_PASSWORD"]
HIC_DB_HOST = os.environ["HIC_DB_HOST"]
HIC_DB_DATABASE = os.environ["HIC_DB_DATABASE"]
MS_SQL_ODBC_DRIVER = os.environ["MS... | [
37811,
31441,
15965,
2977,
201,
198,
37811,
201,
198,
11748,
28686,
201,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
201,
198,
201,
198,
2220,
62,
26518,
24330,
3419,
201,
198,
201,
198,
201,
198,
39,
2149,
62,
11012,
62,
2... | 2.043367 | 392 |
# Generated by Django 3.2.9 on 2022-01-03 14:32
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
24,
319,
33160,
12,
486,
12,
3070,
1478,
25,
2624,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import numpy as np
def fit_transformation(source, target):
"""
This function computes the best rigid transformation between two point sets. It assumes that "source" and
"target" are with the same length and "source[i]" corresponds to "target[i]".
:param source: Nxd array.
:param target: Nxd ... | [
11748,
299,
32152,
355,
45941,
628,
198,
4299,
4197,
62,
7645,
1161,
7,
10459,
11,
2496,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
2163,
552,
1769,
262,
1266,
20831,
13389,
1022,
734,
966,
5621,
13,
632,
18533,
326,
... | 2.334831 | 445 |
"""
[Modular Equation](https://www.codechef.com/MAY21C/problems/MODEQ)
Given integers N and M, find the number of ordered pairs (a,b)
such that 1≤a<b≤N and ((M mod a) mod b)=((M mod b) mod a).
Input
The first line contains an integer T, the number of test cases. Then the test cases follow.
The only line of each test ... | [
37811,
198,
58,
5841,
934,
7889,
341,
16151,
5450,
1378,
2503,
13,
19815,
721,
258,
69,
13,
785,
14,
44,
4792,
2481,
34,
14,
1676,
22143,
14,
49058,
48,
8,
198,
198,
15056,
37014,
399,
290,
337,
11,
1064,
262,
1271,
286,
6149,
147... | 2.073626 | 910 |
import sys
import os
import yaml
class SingleCrawlerManifestManager(object):
"""
"""
required_files = ["spider_manifest.json", "spider_manifest.py"]
| [
11748,
25064,
198,
11748,
28686,
198,
11748,
331,
43695,
628,
198,
4871,
14206,
34,
39464,
5124,
8409,
13511,
7,
15252,
2599,
198,
220,
220,
220,
37227,
628,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
2672,
62,
16624,
796,
14631,
... | 2.813559 | 59 |
#!/usr/bin/env python
##
#
# Send SET_GPS_GLOBAL_ORIGIN and SET_HOME_POSITION messages
#
##
import rospy
from pymavlink.dialects.v10 import ardupilotmega as MAV_APM
from mavros.mavlink import convert_to_rosmsg
from mavros_msgs.msg import Mavlink
class fifo(object):
""" A simple buffer """
def send_message(msg,... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2235,
198,
2,
198,
2,
16290,
25823,
62,
38,
3705,
62,
8763,
9864,
1847,
62,
1581,
3528,
1268,
290,
25823,
62,
39069,
62,
37997,
17941,
6218,
198,
2,
198,
2235,
198,
198,
11748,
... | 2.081736 | 991 |
from __future__ import absolute_import
from tests.clims.models.test_substance import SubstanceTestCase
from clims.plugins.demo.dnaseq.workflows.sequence import SequenceSimple
from clims.api.serializers.models.process_definition import ProcessDefinitionSerializer
expected_sequence_simple = {
'id':
u'clims.pl... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
5254,
13,
565,
12078,
13,
27530,
13,
9288,
62,
7266,
301,
590,
1330,
50021,
14402,
20448,
198,
6738,
5424,
82,
13,
37390,
13,
9536,
78,
13,
32656,
589,
80,
13,
1818,
44... | 2.111489 | 1,471 |
from flask import Flask
from config import Config
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from flask_login import LoginManager
from logging.handlers import SMTPHandler,RotatingFileHandler
from flask_mail import Mail, Message
import logging,os, smtplib
from threading import Thread
app... | [
6738,
42903,
1330,
46947,
198,
6738,
4566,
1330,
17056,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
42903,
62,
76,
42175,
1330,
337,
42175,
198,
6738,
42903,
62,
38235,
1330,
23093,
13511,
198,
6738,
1893... | 2.341121 | 856 |
import re
data = input()
total_income = 0
while data != "end of shift":
pattern_customer = r"\%(?P<customer>[A-Z][a-z]+)\%"
customer = re.finditer(pattern_customer, data)
is_customer = bool([c.group(0) for c in customer])
pattern_product = r"\<(?P<product>[0-9a-zA-Z\_]+)\>"
product = re.finditer(... | [
11748,
302,
198,
198,
7890,
796,
5128,
3419,
198,
23350,
62,
12519,
796,
657,
198,
198,
4514,
1366,
14512,
366,
437,
286,
6482,
1298,
198,
220,
220,
220,
3912,
62,
23144,
263,
796,
374,
1,
59,
4,
7,
30,
47,
27,
23144,
263,
36937,
... | 2.298193 | 664 |
import cv2 as cv
import numpy as np
from matplotlib import pyplot as plt
if __name__ == '__main__':
drawShapes()
| [
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
3197,
... | 2.608696 | 46 |
import datetime
import pytest
from francis.util import (
parse_date,
parse_rc,
prettytable,
)
# FIXME: test multiple > 40 columns
| [
11748,
4818,
8079,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
46754,
271,
13,
22602,
1330,
357,
198,
220,
220,
220,
21136,
62,
4475,
11,
198,
220,
220,
220,
21136,
62,
6015,
11,
198,
220,
220,
220,
2495,
11487,
11,
198,
8,
628,
... | 2.666667 | 57 |
import math
| [
11748,
10688,
198
] | 4 | 3 |
__all__ = ['example_data']
| [
198,
834,
439,
834,
796,
37250,
20688,
62,
7890,
20520,
198
] | 2.545455 | 11 |
from xgboost.sklearn import XGBClassifier
# from xgb_model import xgb_model_fit
# from sklearn.grid_search import GridSearchCV
from sklearn.ensemble import VotingClassifier
from sklearn.metrics import accuracy_score
import pandas as pd
from sklearn.model_selection import train_test_split
import numpy as np
from sklearn... | [
6738,
2124,
70,
39521,
13,
8135,
35720,
1330,
1395,
4579,
9487,
7483,
198,
2,
422,
2124,
22296,
62,
19849,
1330,
2124,
22296,
62,
19849,
62,
11147,
198,
2,
422,
1341,
35720,
13,
25928,
62,
12947,
1330,
24846,
18243,
33538,
198,
6738,
... | 2.397207 | 1,289 |
from utils import nwise
import pkg_resources
import re, time, os
import itertools
import argparse
import numpy
import json
DELIM = u"│" # delim used by onmt
def split_infobox(dataset_folder, destination_folder):
"""
extract box content, field type and position information from infoboxes from original_data
... | [
6738,
3384,
4487,
1330,
299,
3083,
198,
198,
11748,
279,
10025,
62,
37540,
198,
11748,
302,
11,
640,
11,
28686,
198,
11748,
340,
861,
10141,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
198,
11748,
33918,
198,
198,
35,
3698,
3955,
... | 2.170321 | 3,147 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division
import numpy as np
import pandas as pd
import argparse
from utils import _update_par as updateBatch
from utils import _run_moog as runMoog
from utils import Readmoog
from interpolation import interpolator
import os
def solar_ab... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
198,
2,
2011,
17944,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
... | 1.938887 | 2,389 |
# Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
2,
15069,
13130,
24118,
13434,
11,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
9... | 3.142678 | 799 |
import argparse
from os import makedirs
from os.path import abspath, exists, join, dirname, expanduser
import re
import subprocess
import time
import json
import threading
import socket
import sys
CONFIG_JSON = """
{
"version": 2,
"controller": {},
"workers": [
{
"transports": [
{
... | [
11748,
1822,
29572,
198,
6738,
28686,
1330,
285,
4335,
17062,
198,
6738,
28686,
13,
6978,
1330,
2352,
6978,
11,
7160,
11,
4654,
11,
26672,
3672,
11,
4292,
7220,
198,
11748,
302,
198,
11748,
850,
14681,
198,
11748,
640,
198,
11748,
33918... | 1.565299 | 1,072 |
import bisect
| [
11748,
47457,
478,
201
] | 3.5 | 4 |
import sys
shuffle()
| [
11748,
25064,
628,
628,
198,
1477,
18137,
3419,
198
] | 2.777778 | 9 |
import json
import time
import urllib
import boto3
import traceback
from lab_config import boto_args
from boto3.dynamodb.types import TypeDeserializer
| [
11748,
33918,
198,
11748,
640,
198,
11748,
2956,
297,
571,
198,
11748,
275,
2069,
18,
198,
11748,
12854,
1891,
198,
6738,
2248,
62,
11250,
1330,
275,
2069,
62,
22046,
198,
6738,
275,
2069,
18,
13,
67,
4989,
375,
65,
13,
19199,
1330,
... | 3.212766 | 47 |
# Copyright 2016 SAP SE
#
# 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 appl... | [
2,
15069,
1584,
48323,
7946,
198,
2,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
220,
220,
220,
407,
779,
4... | 3.143443 | 488 |
import tensorflow as tf
import numpy as np
tf.set_random_seed(5)
n_inputs = 28
n_neurons = 150
n_layers = 3
n_steps = 28
n_outputs = 10
learning_rate = 0.001
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/")
X_test = mnist.test.images.reshape((-1, n_steps, n_... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
198,
27110,
13,
2617,
62,
25120,
62,
28826,
7,
20,
8,
198,
198,
77,
62,
15414,
82,
796,
2579,
198,
77,
62,
710,
333,
684,
796,
6640,
198,
77,
62,
75,
... | 2.287979 | 757 |
from os import path
import logging
from typing import Dict, List, Optional
import copy
import torch
import torch.nn.functional as F
from overrides import overrides
from allennlp.data import Vocabulary
from allennlp.common.params import Params
from allennlp.models.model import Model
from allennlp.modules import Seq2Se... | [
6738,
28686,
1330,
3108,
198,
11748,
18931,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
198,
11748,
4866,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
23170,
1460,
1330,
23170,
1460,
1... | 2.324863 | 6,572 |
"""Utility functions."""
import enum
import json
import struct
import subprocess
import time
import numpy as np
# Measurements contain 5 floats (elapsed_time, basket_resistance,
# group_resistance, basket_temperature, and group_temperature) and an int
# (state, for which 0, 1, 2, and 3 map to START, RUNNING, STOP, an... | [
37811,
18274,
879,
5499,
526,
15931,
198,
11748,
33829,
198,
11748,
33918,
198,
11748,
2878,
198,
11748,
850,
14681,
198,
11748,
640,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
24291,
902,
3994,
642,
36016,
357,
417,
28361,
6... | 2.862416 | 894 |
from setuptools import setup, find_packages
setup(
name="gitcv",
version="0.1",
packages=find_packages(),
author="Jan Groth",
license="MIT License",
setup_requires=['pytest-runner'],
tests_require=['pytest']
)
| [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
18300,
33967,
1600,
198,
220,
220,
220,
2196,
2625,
15,
13,
16,
1600,
198,
220,
220,
220,
10392,
28,
19796,
62,
43789,
227... | 2.597826 | 92 |
#!/usr/bin/env python
# coding: utf-8
# http://paulbourke.net/fractals/clifford/?curius=373
# In[13]:
import numpy as np
import math as m
import matplotlib.pyplot as plt
# In[65]:
a = -1.5
b = 1.6
c = 1.2
d = 0.7
# In[66]:
# In[ ]:
# In[77]:
sidelength = 8192
center = (sidelength // 2 , sidelength ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
2638,
1378,
79,
2518,
6084,
365,
13,
3262,
14,
69,
974,
874,
14,
565,
733,
585,
20924,
22019,
3754,
28,
34770,
220,
198,
198,
2,
554,... | 2.169591 | 684 |
# -*- coding: utf-8 -*-
import discord
from discord import Embed
from discord.ext import tasks
from datetime import datetime
import os
import requests
import random
import json
TOKEN = os.environ["TOKEN"]
client = discord.Client(intents=discord.Intents.all())
# 次回送信予定時刻を06:00-8:30までの間でランダムに設定
ti... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
11748,
36446,
201,
198,
6738,
36446,
1330,
13302,
276,
201,
198,
6738,
36446,
13,
2302,
1330,
8861,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
11748,
2... | 1.882784 | 273 |
import os
import sys
import torch
from config import Config
from train3 import image_size
from model import SiameseNetwork
from evaluate3 import TestDataset
from torch.utils.data import DataLoader
use_gpu = False
register_dir = "./data/ct0202a/"
threshold = 50
siam_model = None
log_lines = []
##
if __name__ == '__m... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
28034,
198,
6738,
4566,
1330,
17056,
198,
6738,
4512,
18,
1330,
2939,
62,
7857,
198,
6738,
2746,
1330,
15638,
1047,
68,
26245,
198,
6738,
13446,
18,
1330,
6208,
27354,
292,
316,
198,
6738,
28... | 1.944067 | 1,323 |
"""This module contains auxiliary function which we use in the example notebook."""
import json
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from scipy.stats import norm
import pandas as pd
import numpy as np
from grmpy.estimate.estimate_output import calculate_mte
from grmpy.read.read import... | [
37811,
1212,
8265,
4909,
37419,
2163,
543,
356,
779,
287,
262,
1672,
20922,
526,
15931,
198,
11748,
33918,
198,
198,
11748,
2603,
29487,
8019,
13,
8071,
2052,
355,
285,
8071,
2052,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
45... | 2.392535 | 1,661 |
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
"""
Contains the models/tables for the kumbhmela_db.sqlite3
database.
Every field has (when necessary) a 'help_text' that
explains the meaning of the field.
"""
__author__ = "Louis Dijkstra"
@python_2_unicode_compatib... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
12685,
7656,
1330,
21015,
62,
17,
62,
46903,
1098,
62,
38532,
198,
198,
37811,
220,
198,
197,
4264,
1299,
262,
4981,
14,
83,
2977,
329,
262,
479,
2178,
... | 2.604258 | 2,959 |
"""Plotting methods for warm and cold fronts."""
import numpy
import matplotlib
matplotlib.use('agg')
import matplotlib.colors
from gewittergefahr.gg_utils import longitude_conversion as lng_conversion
from gewittergefahr.gg_utils import error_checking
from generalexam.ge_utils import front_utils
from generalexam.plot... | [
37811,
43328,
889,
5050,
329,
5814,
290,
4692,
29324,
526,
15931,
198,
198,
11748,
299,
32152,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
9460,
11537,
198,
11748,
2603,
29487,
8019,
13,
4033,
669,
198,
6738,
... | 2.395399 | 3,738 |
import sys, collections, pylev
from stemming.porter2 import stem
#--------------------------------------------------------------
# Author: Scott Wen-tau Yih
# Usage: evalQA.py para-ids gold-labels system-predictions
# example usage: python propara/eval/evalQA.py tests/fixtures/eval/para_id.test.txt tests/fixtures/eval... | [
11748,
25064,
11,
17268,
11,
279,
2349,
85,
198,
6738,
34807,
13,
26634,
17,
1330,
10717,
198,
198,
2,
47232,
26171,
198,
2,
6434,
25,
4746,
31164,
12,
83,
559,
575,
4449,
198,
2,
29566,
25,
5418,
48,
32,
13,
9078,
31215,
12,
2340... | 4.652778 | 792 |
from gevent import monkey; monkey.patch_all()
import gevent
from socketio import socketio_manage
from socketio.server import SocketIOServer
from socketio.namespace import BaseNamespace
from socketio.mixins import RoomsMixin, BroadcastMixin
from twisted.internet import reactor, task, defer
from twisted.python import ... | [
6738,
4903,
1151,
1330,
21657,
26,
21657,
13,
17147,
62,
439,
3419,
198,
198,
11748,
4903,
1151,
198,
198,
6738,
17802,
952,
1330,
17802,
952,
62,
805,
496,
198,
6738,
17802,
952,
13,
15388,
1330,
47068,
40,
2640,
18497,
198,
6738,
17... | 3.362963 | 135 |
# Copyright © 2019 Province of British Columbia
#
# 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 agr... | [
2,
15069,
10673,
13130,
22783,
286,
3517,
9309,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
705,
34156,
24036,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
... | 2.463243 | 5,550 |
from .source import SourceSmartsheets
__all__ = ["SourceSmartsheets"]
| [
6738,
764,
10459,
1330,
8090,
7556,
5889,
258,
1039,
198,
198,
834,
439,
834,
796,
14631,
7416,
7556,
5889,
258,
1039,
8973,
198
] | 3.086957 | 23 |
from mprl.rl.envs.stratego.stratego_spatial_multiagent_env import SpatialStrategoMultiAgentEnv
from progress.bar import Bar
import numpy as np
import dill
from multiprocessing.pool import Pool
from multiprocessing import cpu_count
| [
6738,
285,
1050,
75,
13,
45895,
13,
268,
14259,
13,
23104,
2188,
13,
23104,
2188,
62,
2777,
34961,
62,
41684,
25781,
62,
24330,
1330,
1338,
34961,
1273,
4873,
2188,
29800,
36772,
4834,
85,
198,
6738,
4371,
13,
5657,
1330,
2409,
198,
1... | 3.25 | 72 |
from django.contrib import admin
from .models import ToDoItem
admin.site.register(ToDoItem)
# Register your models here.
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
1675,
5211,
7449,
198,
198,
28482,
13,
15654,
13,
30238,
7,
2514,
5211,
7449,
8,
198,
198,
2,
17296,
534,
4981,
994,
13,
198
] | 3.324324 | 37 |
from __future__ import absolute_import
import sys
import argparse
import where
if __name__ == "__main__":
sys.exit(main())
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
198,
11748,
810,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
25064,
13,
37023,
7,
12... | 3.022727 | 44 |
name = "on-location-change-notifier-slack"
add_files = (
"ruleset.py",
)
add_modules = True # find modules in directory (folders having __init__.py file) and add them to container
extra_commands = (
# ("RUN", "pip install my-wonderful-lib==1.0"),
)
labels = {
"networking.knative.dev/visibility": "clust... | [
198,
3672,
796,
366,
261,
12,
24886,
12,
3803,
12,
1662,
7483,
12,
6649,
441,
1,
198,
198,
2860,
62,
16624,
796,
357,
198,
220,
220,
220,
366,
38785,
316,
13,
9078,
1600,
198,
8,
198,
198,
2860,
62,
18170,
796,
6407,
220,
1303,
... | 2.206813 | 411 |
#!/usr/bin/python
# sound_waves.py v1.1 12-3-2011 Jeff Doak jeff.w.doak@gmail.com
import sys
import scipy as sp
from scipy import linalg
from scipy.integrate import dblquad
import read_file
BOLTZCONST = 1.381e-23 # J/K
PLANCKCONST = 6.626e-34 # J*s
AVONUM = 6.022e23 # things/mol
def dir_cosines(dir,coords=sp.ide... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
2128,
62,
32569,
13,
9078,
410,
16,
13,
16,
1105,
12,
18,
12,
9804,
5502,
2141,
461,
11223,
487,
13,
86,
13,
4598,
461,
31,
14816,
13,
785,
198,
198,
11748,
25064,
198,
11748,
6... | 1.815081 | 1,671 |
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | [
2,
10097,
32501,
198,
2,
15069,
357,
66,
8,
2321,
532,
33160,
11,
1052,
330,
13533,
11,
3457,
1539,
290,
347,
2088,
71,
25767,
669,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
383,
1336,
5964,
318,
287,
262,
2393,
38559,
... | 3.62022 | 1,543 |
s = input()
c = 0
n = int(input())
a = [0]*3
c = 0
for i in range(n):
a[i] = input()
for i in (a):
print(s.count(i))
| [
82,
796,
5128,
3419,
198,
66,
796,
657,
198,
77,
796,
493,
7,
15414,
28955,
198,
64,
796,
685,
15,
60,
9,
18,
198,
66,
796,
657,
198,
1640,
1312,
287,
2837,
7,
77,
2599,
198,
220,
220,
220,
257,
58,
72,
60,
796,
5128,
3419,
... | 1.842857 | 70 |
# -*- coding: utf-8 -*-
from typing import Dict, Any
import os
import pkg_resources
from bag.design import Module
yaml_file = pkg_resources.resource_filename(__name__, os.path.join('netlist_info',
'sense_amp_strongarm.yaml'))
# noinspection PyPep... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
19720,
1330,
360,
713,
11,
4377,
198,
198,
11748,
28686,
198,
11748,
279,
10025,
62,
37540,
198,
198,
6738,
6131,
13,
26124,
1330,
19937,
628,
198,
88,
43695,... | 2.274678 | 233 |
# flake8: noqa
# Converting GFF format with space in lines starting with gi to tab
import sys
import re
fn = sys.argv[1]
f = open(fn, "r")
for l in f.read().split("\n"):
if l.startswith("gi"):
print re.sub(" ", "\t", l)
else:
print l
| [
2,
781,
539,
23,
25,
645,
20402,
198,
2,
35602,
889,
402,
5777,
5794,
351,
2272,
287,
3951,
3599,
351,
308,
72,
284,
7400,
198,
198,
11748,
25064,
198,
11748,
302,
198,
198,
22184,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
69,
7... | 2.230769 | 117 |
import random
from itertools import islice
from pysat.solvers import Minicard
import numpy as np
# from numba import njit, int16
from utils import np_one_hot, softmax
# @njit(int16[:,:](int16[:]))
| [
11748,
4738,
198,
6738,
340,
861,
10141,
1330,
318,
75,
501,
198,
6738,
279,
893,
265,
13,
34453,
690,
1330,
1855,
291,
446,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
422,
997,
7012,
1330,
299,
45051,
11,
493,
1433,
198,
198,... | 2.697368 | 76 |
name = "vapetool"
| [
3672,
796,
366,
85,
499,
316,
970,
1,
198
] | 2 | 9 |
"""
__init__.py.py:
"""
from pdd_sdk.api.rest import *
from pdd_sdk.api.base import FileItem | [
198,
198,
37811,
198,
834,
15003,
834,
13,
9078,
13,
9078,
25,
198,
37811,
198,
198,
6738,
279,
1860,
62,
21282,
74,
13,
15042,
13,
2118,
1330,
1635,
198,
6738,
279,
1860,
62,
21282,
74,
13,
15042,
13,
8692,
1330,
9220,
7449
] | 2.261905 | 42 |
""" Locators for Spring '22 """
eda_lex_locators = {
"app_tile": "//one-app-launcher-modal//one-app-launcher-app-tile//a[.='{}']",
"app_item": "//a[@data-label='{}']",
"frame": "//iframe[contains(@id, '{}') or contains(@title, '{}') or contains(@name, '{}')]",
"input_placeholder": "//input[contains(@pl... | [
37811,
15181,
2024,
329,
8225,
705,
1828,
37227,
198,
198,
18082,
62,
2588,
62,
17946,
2024,
796,
1391,
198,
220,
220,
220,
366,
1324,
62,
40927,
1298,
366,
1003,
505,
12,
1324,
12,
38722,
2044,
12,
4666,
282,
1003,
505,
12,
1324,
1... | 2.497148 | 20,509 |
'''
Things to do:
An exe / chrome extension
automatically run the script
Automatically export the text file to a server/client.
'''
from pynput.keyboard import Key, Listener
count = 0
keys = []
with Listener(on_press = on_press, on_release = on_release) as listener:
listener.join(... | [
201,
198,
7061,
6,
201,
198,
22248,
284,
466,
25,
201,
198,
220,
220,
220,
1052,
409,
68,
1220,
32030,
7552,
220,
201,
198,
220,
220,
220,
6338,
1057,
262,
4226,
201,
198,
220,
220,
220,
17406,
4142,
10784,
262,
2420,
2393,
284,
2... | 2.620968 | 124 |
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 6 21:10:57 2021
@author: geoto
"""
#clear list
item=mylist3.clear()
print(item)
print('-----------------------------------------------')
#reverse list
print(mylist)
list_rev=mylist.reverse()#reverse() used inplace=True so the change takes ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
7031,
1526,
220,
718,
2310,
25,
940,
25,
3553,
33448,
201,
198,
201,
198,
31,
9800,
25,
4903,
2069,
201,
198,
37811,
201,
198,
220,
... | 2.107407 | 810 |
from pathlib import Path
from typing import Dict, Optional, Sequence, Tuple
from warnings import simplefilter
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from statsmodels.regression.linear_model import OLS
from statsmodels.tools import add_constant
from tqdm import tqdm
import etl
from epim... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
11,
45835,
11,
309,
29291,
198,
6738,
14601,
1330,
2829,
24455,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
... | 2.571354 | 1,913 |
#!/usr/bin/env python3
# Copyright 2021 Steve Palmer
"""Generate a complete list of test numbers and names."""
import collections
import inspect
import generic_testing
TestRecord = collections.namedtuple("TestRecord", ["class_", "testname", "test_number"])
if __name__ == "__main__":
Main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
15069,
33448,
6542,
18918,
198,
198,
37811,
8645,
378,
257,
1844,
1351,
286,
1332,
3146,
290,
3891,
526,
15931,
198,
198,
11748,
17268,
198,
11748,
10104,
198,
198,
11748,
14276,
... | 3.318681 | 91 |
#
# 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 us... | [
2,
198,
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,
... | 3.253968 | 1,260 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.22 on 2019-11-21 23:29
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1828,
319,
13130,
12,
1157,
12,
2481,
2242,
25,
1959,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198... | 2.923077 | 65 |
import http
from unittest.mock import Mock, patch
import pytest
from django.conf import settings
from django.test import override_settings
from django.urls import reverse
from rest_framework import status
from buyer import models
from core.tests.test_views import reload_module, reload_urlconf
@pytest.mark.django_db... | [
11748,
2638,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
44123,
11,
8529,
198,
198,
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9288,
1330,
20957,
62,
33692,
198,
6738,
42625,
14208,... | 2.9869 | 229 |
import mock
from mock import patch
import unittest
from cfgm_common.vnc_db import DBBase
from svc_monitor import config_db
from svc_monitor import loadbalancer_agent
from vnc_api.vnc_api import *
import argparse
import ConfigParser
# end setUp
# end tearDown
# end create_pool
#end create_hm_obj
#... | [
11748,
15290,
198,
6738,
15290,
1330,
8529,
198,
11748,
555,
715,
395,
198,
6738,
30218,
39870,
62,
11321,
13,
85,
10782,
62,
9945,
1330,
20137,
14881,
198,
6738,
264,
28435,
62,
41143,
1330,
4566,
62,
9945,
198,
6738,
264,
28435,
62,
... | 2.566893 | 441 |
#!/usr/bin/env python
from docutils.core import publish_string, publish_parts
from docutils.readers.standalone import Reader
from nose.config import Config
from nose.plugins.manager import BuiltinPluginManager
import nose
import nose.commands
import nose.tools
import os
import re
import time
doc_word.priority = 100
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
2205,
26791,
13,
7295,
1330,
7715,
62,
8841,
11,
7715,
62,
42632,
198,
6738,
2205,
26791,
13,
961,
364,
13,
1481,
17749,
1330,
25342,
198,
6738,
9686,
13,
11250,
1330,
17056... | 2.65906 | 745 |
# Generated by Django 3.1.13 on 2021-09-21 15:33
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
1485,
319,
33448,
12,
2931,
12,
2481,
1315,
25,
2091,
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.840909 | 44 |
"""Simulation where an agent will get all collectibles spawn randomly
"""
import sys
sys.path.append("../")
from westworld.environment import GridEnvironment
from westworld.agents import BaseGridAgent
from westworld.objects import BaseObstacle,BaseTrigger,BaseCollectible
from westworld.simulation import Simulation
... | [
37811,
8890,
1741,
810,
281,
5797,
481,
651,
477,
2824,
18764,
10922,
15456,
198,
37811,
628,
198,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
4943,
198,
198,
6738,
7421,
6894,
13,
38986,
1330,
24846,
31441,
198,
67... | 4.160535 | 299 |
# AUTHOR = PAUL KEARNEY
# STUDENT ID = G00364787
# DATE = 2018-02-24
#
# STUDENT ID = G00364787
# EXERCISE 04
# projectEuler problem 2
# references used
# http://www.tutorialspoint.com/python/python_basic_operators.htm
# https://www.tutorialspoint.com/python/python_strings.htm
# https://stackoverflow.co... | [
2,
44746,
796,
8147,
6239,
509,
17133,
36231,
220,
220,
201,
198,
2,
49348,
3525,
4522,
796,
402,
11245,
2414,
41019,
201,
198,
2,
360,
6158,
796,
2864,
12,
2999,
12,
1731,
201,
198,
2,
201,
198,
2,
49348,
3525,
4522,
796,
402,
11... | 2.294118 | 459 |
def plot_tuning_curve(resp, ori, ax=None):
"""Plot single neuron responses as a function of stimulus orientation
Args:
resp (numpy array): n_stimuli x n_neurons matrix with responses of each
neuron whose tuning curve to plot. Can also be a 1D array of length
n_stimuli to plot tuning curve of a sin... | [
4299,
7110,
62,
28286,
278,
62,
22019,
303,
7,
4363,
11,
22812,
11,
7877,
28,
14202,
2599,
198,
220,
37227,
43328,
2060,
43164,
9109,
355,
257,
2163,
286,
19819,
12852,
628,
220,
943,
14542,
25,
198,
220,
220,
220,
1217,
357,
77,
32... | 2.805464 | 915 |
#
# @section License
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2017, Erik Moqvist
#
# 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 ... | [
2,
198,
2,
2488,
5458,
13789,
198,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
1584,
12,
5539,
11,
22722,
4270,
44179,
396,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
... | 3.475369 | 406 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
__author__ = 'weihaoxuan'
from celery import task
from confile_process import process
import models
import os
# import ansible_api
@task
@task
@task
@task
@task
@task
@task
@task
@task
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
12,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
705,
42990,
3099,
1140,
7258,
6,
198,
198,
6738,
18725,
1924,
1330,
4876,
198,
6738,
1013,
576,
62,
... | 2.474227 | 97 |
"""Build and Version QuerySet classes."""
import datetime
import logging
from django.db import models
from django.db.models import Q
from django.utils import timezone
from readthedocs.builds.constants import (
BUILD_STATE_FINISHED,
BUILD_STATE_TRIGGERED,
EXTERNAL,
)
from readthedocs.core.permissions impor... | [
37811,
15580,
290,
10628,
43301,
7248,
6097,
526,
15931,
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625,
14208,
13,... | 2.263288 | 3,236 |
"""Platform for LGE climate integration."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import timedelta
import logging
from typing import Any, Awaitable, Callable, List, Tuple
from .wideq import (
FEAT_HUMIDITY,
FEAT_OUT_WATER_TEMP,
UNIT_TEMP_FAHRENHEIT,
DeviceT... | [
37811,
37148,
329,
406,
8264,
4258,
11812,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
11748,
18931,
198,
6738,
19720,
13... | 2.325926 | 6,345 |
import copy
import math
import time
import torch
import torch.nn as nn
import numpy as np
from constants import *
from embeddings import *
from tqdm import tqdm
from utils.model_utils import device, model_checkpoint
from utils.misc_utils import write_line_to_file
from utils.lang_utils import make_std_mask
from evaluate... | [
11748,
4866,
198,
11748,
10688,
198,
11748,
640,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
38491,
1330,
1635,
198,
6738,
11525,
67,
654,
1330,
1635,
198,
6738,
256,
80,... | 2.382937 | 1,512 |
# This Python file uses the following encoding: utf-8
import os
import sys
import time
from PyQt5 import QtCore
from PySide2.QtCore import QFile
from PySide2.QtUiTools import QUiLoader
from PySide2.QtWidgets import QApplication, QWidget, QFileDialog, \
QPushButton, QLineEdit, QMessageBox, QTextBrowser, QProgressBa... | [
2,
770,
11361,
2393,
3544,
262,
1708,
21004,
25,
3384,
69,
12,
23,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
198,
6738,
9485,
24819,
17,
13,
48,
83,
14055,
1330,
119... | 3 | 190 |
import os
import FWCore.ParameterSet.Config as cms
from Configuration.StandardSequences.Eras import eras
process = cms.Process('PCL',eras.Run2_2017)
# ----------------------------------------------------------------------
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.threshold = 'IN... | [
11748,
28686,
198,
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
6738,
28373,
13,
23615,
44015,
3007,
13,
36,
8847,
1330,
49089,
198,
14681,
796,
269,
907,
13,
18709,
10786,
47,
5097,
3256,
263,
292,
13,
10987,
... | 2.812 | 1,000 |
# Consider a staircase of size :
#
# #
# ##
# ###
# ####
#
# Observe that its base and height are both equal to , and the image is drawn using # symbols and spaces. The last line is not preceded by any spaces.
#
# Write a program that prints a staircase of size .
#
# Input Format
#
# A single integer, , deno... | [
2,
12642,
257,
27656,
286,
2546,
1058,
198,
2,
220,
198,
2,
220,
220,
220,
1303,
198,
2,
220,
220,
22492,
198,
2,
220,
44386,
198,
2,
1303,
21017,
198,
2,
220,
198,
2,
11086,
3760,
326,
663,
2779,
290,
6001,
389,
1111,
4961,
284... | 2.86262 | 313 |
#! /usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2019/3/10 8:10 PM
# @Author : xiaoliji
# @Email : yutian9527@gmail.com
"""
求1+...n, 不能用循环等。
>>> sum_solution(10)
55
"""
| [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
220,
1058,
13130,
14,
18,
14,
940,
807,
25,
940,
3122,
198,
2,
2488,
13838,
220,
220... | 1.622951 | 122 |
"""
COBRA Visualisations
--------------------
This notebook will cover the visulaisation and plotting offered by
pycobra.
"""
# %matplotlib inline
import numpy as np
from pycobra.cobra import Cobra
from pycobra.ewa import Ewa
from pycobra.visualisation import Visualisation
from pycobra.diagnostics import Diagnostics... | [
37811,
198,
8220,
33,
3861,
15612,
38189,
198,
19351,
198,
198,
1212,
20922,
481,
3002,
262,
1490,
4712,
5612,
290,
29353,
4438,
416,
198,
9078,
66,
672,
430,
13,
198,
198,
37811,
198,
198,
2,
4064,
6759,
29487,
8019,
26098,
198,
1174... | 2.951415 | 1,626 |
# -*- coding:utf8 -*-
from flask import Flask
from flask_mongoengine import MongoEngine
from config import config
db = MongoEngine() | [
2,
532,
9,
12,
19617,
25,
40477,
23,
532,
9,
12,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
76,
25162,
18392,
1330,
42591,
13798,
198,
198,
6738,
4566,
1330,
4566,
198,
198,
9945,
796,
42591,
13798,
3419
] | 3.435897 | 39 |
#!/usr/bin/env python3
# This program finds files that are above a specified size within
# a specified folder and its subfolders
'''
Write a program that walks through a folder tree and searches for
exceptionally large files or folders—say, ones that have a file size of
more than 100MB. (Remember, to get a file’s siz... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
220,
770,
1430,
7228,
3696,
326,
389,
2029,
257,
7368,
2546,
1626,
198,
2,
220,
257,
7368,
9483,
290,
663,
850,
11379,
364,
198,
7061,
6,
198,
16594,
257,
1430,
326,
11114,
... | 2.692208 | 770 |
"""
Configuration:
To use the car_milage_per_month component you will need to add the following to your
configuration.yaml file:
car_milage_per_month:
odometer_sensor: sensor.ete123_odometer (the sensor that holds the total amount of km)
"""
import json
import logging
import calendar
import os
import voluptuous as... | [
37811,
198,
38149,
25,
198,
198,
2514,
779,
262,
1097,
62,
25433,
496,
62,
525,
62,
8424,
7515,
345,
481,
761,
284,
751,
262,
1708,
284,
534,
198,
11250,
3924,
13,
88,
43695,
2393,
25,
198,
198,
7718,
62,
25433,
496,
62,
525,
62,
... | 2.440353 | 2,037 |