content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from typing import Any, Dict, Optional
from django import forms
from django.contrib import admin
from django.core.exceptions import ValidationError
from django.db.models.functions import Lower
from django.utils.safestring import mark_safe
from django.utils.timezone import now
from allianceauth.eveonline.models import... | [
6738,
19720,
1330,
4377,
11,
360,
713,
11,
32233,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42... | 2.300384 | 1,042 |
from datetime import datetime, timezone
from bson import ObjectId
from pydantic import BaseModel, Field
from app.models.types import PyObjectId
| [
6738,
4818,
8079,
1330,
4818,
8079,
11,
640,
11340,
198,
198,
6738,
275,
1559,
1330,
9515,
7390,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
11,
7663,
198,
198,
6738,
598,
13,
27530,
13,
19199,
1330,
9485,
10267,
7390,
628,
628
] | 3.634146 | 41 |
from logparser.ADC.ADC_Fast import log_split, log_similarity
# '<$>()<-1> : getImeiV2 memory:868404020067521'
tem = ['<$>', '(', '', ')', '<-1>', ' ', '', ':', '', ' ', '<$>', '<$>', '<$>', '<$>', '<$>']
log = ['<$>', '(', '', ')', '<-1>', ' ', '', ':', '', ' ', 'getImeiV2', ' ', 'memory', ':', '868404020067521']
a = ... | [
6738,
2604,
48610,
13,
2885,
34,
13,
2885,
34,
62,
22968,
1330,
2604,
62,
35312,
11,
2604,
62,
38610,
414,
198,
198,
2,
705,
27,
3,
29,
3419,
27,
12,
16,
29,
1058,
651,
40,
1326,
72,
53,
17,
4088,
25,
23,
3104,
1821,
1821,
133... | 1.95082 | 183 |
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
chatbot = ChatBot('Ron Obvious')
# Create a new trainer for the chatbot
trainer = ChatterBotCorpusTrainer(chatbot)
# Train the chatbot based on the english corpus
trainer.train("chatterbot.corpus.english")
# Get a response to an ... | [
6738,
37303,
13645,
1330,
24101,
20630,
198,
6738,
37303,
13645,
13,
27432,
364,
1330,
609,
1436,
20630,
45680,
385,
2898,
10613,
198,
198,
17006,
13645,
796,
24101,
20630,
10786,
23672,
1835,
1442,
11537,
198,
198,
2,
13610,
257,
649,
21... | 3.385965 | 114 |
from drlgeb.ac import A3C
if __name__ == '__main__':
env_id = "SpaceInvaders-v0"
agent = A3C(env_id=env_id)
# train
agent.learn()
# test
model_path = "..."
agent.play(episodes=5, model_path=model_path)
| [
6738,
1553,
75,
469,
65,
13,
330,
1330,
317,
18,
34,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
198,
220,
220,
220,
17365,
62,
312,
796,
366,
14106,
19904,
9972,
12,
85,
15,
1,
198,
220,
220,
220,
5... | 2.145455 | 110 |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
5366,
13,
26791,
1330,
4818,
8079,
62,
26791,
355,
4818,
8079,
198,
6738,
5366,
13,
9945,
1330,
20613,
198,
6738,
5366,
13,
85,
17,
1330,
10011,
2611,
44,
4254,
... | 3.113208 | 53 |
custom_params = {}
custom_params['model_dir'] = 'nn_models/all_feat_1l/model_data/'
custom_params['out_dir'] = 'output/all_feat_1l/'
custom_params['feat_mask'] = [1.0, 1.0, 1.0, 1.0, 1.0]
custom_params['n_conv_layers'] = 1
| [
23144,
62,
37266,
796,
23884,
198,
23144,
62,
37266,
17816,
19849,
62,
15908,
20520,
796,
705,
20471,
62,
27530,
14,
439,
62,
27594,
62,
16,
75,
14,
19849,
62,
7890,
14,
6,
198,
23144,
62,
37266,
17816,
448,
62,
15908,
20520,
796,
7... | 2.252525 | 99 |
# Copyright 2016-2020 Google 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,
1584,
12,
42334,
3012,
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,
921... | 2.135993 | 1,103 |
"""
SKLearn linear model to SKAST.
"""
from skompiler.dsl import const
def linear_model(coef, intercept, inputs):
"""
Linear regression.
Depending on the shape of the coef and intercept, produces either a single-valued
linear model (w @ x + b) or a multi-valued one (M @ x + b_vec)
Args:
c... | [
37811,
198,
18831,
20238,
14174,
2746,
284,
14277,
11262,
13,
198,
37811,
198,
6738,
1341,
3361,
5329,
13,
67,
6649,
1330,
1500,
198,
198,
4299,
14174,
62,
19849,
7,
1073,
891,
11,
15788,
11,
17311,
2599,
198,
220,
220,
220,
37227,
19... | 3.030303 | 363 |
default_app_config = 'roomsensor.apps.RoomsensorConfig' | [
12286,
62,
1324,
62,
11250,
796,
705,
9649,
22854,
13,
18211,
13,
15450,
3150,
22854,
16934,
6
] | 3.235294 | 17 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Nov 14 21:10:20 2018
@author: haoqi
"""
import os
import torch
import torch.nn as nn
class Classification_Base_1D_NN_fixed_seq_len_1s_majvote_v2(nn.Module):
'''
'''
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
5267,
1478,
2310,
25,
940,
25,
1238,
2864,
198,
198,
31,
9800,
25,
387,
78,
40603,
... | 2.271028 | 107 |
#! /usr/bin/env python
"""API Wrapper for Bitcoin.de Trading API."""
import requests
import time
import json
import hmac
import hashlib
import logging
import codecs
import decimal
import inspect
import urllib
from urllib.parse import urlencode
logging.basicConfig()
log = logging.getLogger(__name__)
requests_log = lo... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
17614,
27323,
2848,
329,
6185,
13,
2934,
25469,
7824,
526,
15931,
198,
198,
11748,
7007,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
289,
20285,
198,
11748,
12234,
8019,
198... | 2.171941 | 6,857 |
import numpy as np
arr=np.arange(10)
print arr
#saving single array
np.save('saved_array',arr)
#now_file_is_created = saved_array.npy
new_array=np.load('saved_array.npy')
print new_array
#save multiple array
array_1=np.arange(25)
array_2=np.arange(30)
np.savez('saved_archieve.npz',x=array_1,y=array_2)
load_archi... | [
11748,
299,
32152,
355,
45941,
198,
3258,
28,
37659,
13,
283,
858,
7,
940,
8,
198,
4798,
5240,
198,
198,
2,
29336,
2060,
7177,
198,
37659,
13,
21928,
10786,
82,
9586,
62,
18747,
3256,
3258,
8,
198,
2,
2197,
62,
7753,
62,
271,
62,
... | 2.496667 | 300 |
import cocotb
from cocotb.clock import Clock
from cocotb.triggers import RisingEdge, FallingEdge, ClockCycles
import random
from test.test_encoder import Encoder
clocks_per_phase = 10
# takes ~60 seconds on my PC
@cocotb.test()
| [
11748,
8954,
313,
65,
198,
6738,
8954,
313,
65,
13,
15750,
1330,
21328,
198,
6738,
8954,
313,
65,
13,
2213,
328,
5355,
1330,
17658,
37021,
11,
42914,
37021,
11,
21328,
20418,
5427,
198,
11748,
4738,
198,
6738,
1332,
13,
9288,
62,
1268... | 3.052632 | 76 |
import datetime
import numpy
from sqlalchemy import func, and_
from lemonadefashion_flask_monitoringdashboard.core.timezone import to_utc_datetime, to_local_datetime
from lemonadefashion_flask_monitoringdashboard.database import Request
from lemonadefashion_flask_monitoringdashboard.database.count_group import count_... | [
11748,
4818,
8079,
198,
198,
11748,
299,
32152,
198,
6738,
44161,
282,
26599,
1330,
25439,
11,
290,
62,
198,
198,
6738,
18873,
671,
25265,
62,
2704,
2093,
62,
41143,
278,
42460,
3526,
13,
7295,
13,
2435,
11340,
1330,
284,
62,
315,
66,... | 2.75715 | 1,923 |
#======================================================================
# MYTH : Multipurpose code compiles YT-rendering for Hydro-simulations
#
# Author: Siddhartha Gupta
# contact: gsiddhartha@uchicago.edu
#
# Last modified on 17 July 2020
#======================================================================... | [
2,
23926,
50155,
198,
2,
17615,
4221,
1058,
7854,
541,
333,
3455,
2438,
552,
2915,
575,
51,
12,
13287,
278,
329,
32116,
12,
14323,
5768,
198,
2,
220,
220,
198,
2,
6434,
25,
44487,
9869,
12898,
42095,
198,
2,
2800,
25,
308,
82,
163... | 2.783093 | 2,153 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321... | 3.142725 | 1,079 |
# -*- coding: utf-8 -*-
# @Time : 2021/4/6 下午8:51
# @Author : 司云中
# @File : manage_carousel_api.py
# @Software: Pycharm
from rest_framework.response import Response
from Emall.base_api import BackendGenericApiView
from Emall.decorator import validate_url_data
from Emall.response_code import response_code, DELETE_CARO... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
1058,
33448,
14,
19,
14,
21,
220,
10310,
233,
39355,
230,
23,
25,
4349,
198,
2,
2488,
13838,
1058,
10263,
237,
116,
12859,
239,
40792,
198,
2,
24... | 2.148968 | 678 |
from django.test import TestCase
from django_tally.data.models import Data
from django_tally.user_def.lang import parse
from django_tally.user_def.lang.json import encode
from django_tally.user_def.models import UserDefTemplate
from .testapp.models import Foo
AGGREGATE_PARAMS = {
'required': ['get_tally', 'add'... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
42625,
14208,
62,
83,
453,
13,
7890,
13,
27530,
1330,
6060,
198,
6738,
42625,
14208,
62,
83,
453,
13,
7220,
62,
4299,
13,
17204,
1330,
21136,
198,
6738,
42625,
14208,
62... | 2.205056 | 712 |
# -*- coding: utf-8 -*-
"""
Created on Sat May 23 12:02:26 2020
@author: Chung
"""
import numpy as np
import pandas as pd
from sklearn import svm
import sys
import argparse
from sklearn.linear_model import Perceptron
from sklearn.preprocessing import OneHotEncoder
import matplotlib.pyplot as plt
from sklearn.model_s... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7031,
1737,
2242,
1105,
25,
2999,
25,
2075,
12131,
198,
198,
31,
9800,
25,
43915,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748... | 2.709016 | 1,708 |
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.contrib.auth.models import AnonymousUser
from django.core.urlresolvers import reverse
from django.test import RequestFactory
from tally_ho.apps.tally.views import quality_control as views
from tally_ho.apps.tally.models.quality_contro... | [
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
2448,
3411,
21306,
798,
11,
31922,
6243,
32180,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
19200,
12982,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349... | 3.342995 | 207 |
from kafka_rules_manager import RuleEngine
| [
6738,
479,
1878,
4914,
62,
38785,
62,
37153,
1330,
14330,
13798,
628,
628
] | 3.538462 | 13 |
#! /usr/bin/python
import email, smtplib, tidy, os, datetime, csv, subprocess, locale, time, inspect, sys
from lxml import etree
from email.mime.text import MIMEText
# allow import from subdirectory
currentDir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
btcuDir = currentDir + '/bitcoin... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
3053,
11,
895,
83,
489,
571,
11,
43044,
11,
28686,
11,
4818,
8079,
11,
269,
21370,
11,
850,
14681,
11,
36693,
11,
640,
11,
10104,
11,
25064,
198,
6738,
300,
19875,
1330,
212... | 2.279805 | 1,233 |
# Execution time : 0.001408 seconds
# Solution Explanation
# Let v = { v1, v2, ..., vn } be values
# We want to find in how many ways we can sum s with
# element of v if we can get as many items of v as we need
# ( We can choose as many times and element as we want )
# So, we can define the following recurrence
# sol... | [
198,
2,
37497,
640,
1058,
657,
13,
405,
1415,
2919,
4201,
198,
198,
2,
28186,
50125,
341,
198,
2,
3914,
410,
796,
1391,
410,
16,
11,
410,
17,
11,
2644,
11,
410,
77,
1782,
307,
3815,
198,
2,
775,
765,
284,
1064,
287,
703,
867,
... | 2.8659 | 261 |
"""
This is my fifth prime number project,
it is one of the fastest.
It will find all prime numbers between 2 and 'End'.
1. At first we create an Prime array to N
store True vlaue, and N is End + 1 == size
and another list containing 2 as our main prime list
2.we iterate all odd numbers in range of 3 and END,
if tha... | [
37811,
198,
1212,
318,
616,
8150,
6994,
1271,
1628,
11,
198,
270,
318,
530,
286,
262,
14162,
13,
198,
1026,
481,
1064,
477,
6994,
3146,
1022,
362,
290,
705,
12915,
4458,
198,
198,
16,
13,
1629,
717,
356,
2251,
281,
5537,
7177,
284,
... | 3.47561 | 164 |
#!/usr/bin/env python
# Copyright NumFOCUS
#
# 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.txt
#
# Unless required by applicable law or ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
31835,
37,
4503,
2937,
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,
28... | 2.927405 | 551 |
import logger
log = logger.get_logger(__name__)
import argparse
import sys
import os
import subprocess
import module as mod
import subpackage.submodule as submod
if __name__ == '__main__':
args = get_args()
if args.log_level:
log.setLevel(args.log_level.upper())
main()
| [
11748,
49706,
198,
6404,
796,
49706,
13,
1136,
62,
6404,
1362,
7,
834,
3672,
834,
8,
198,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
198,
11748,
8265,
355,
953,
198,
11748,
850,
26495,
... | 2.722222 | 108 |
from django.template import RequestContext
from django.shortcuts import render_to_response | [
6738,
42625,
14208,
13,
28243,
1330,
19390,
21947,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
62,
1462,
62,
26209
] | 4.285714 | 21 |
from db.connect.instanciaAtualDB import atualDB
from db.scripts.script_select.select_canais import select_verifica_canal, select_canais_ativos
from db.scripts.script_select.select_aventureiros import script_select_aventureiro_nome, script_select_aventureiro_id
from db.scripts.script_create_drop.create_tables import cre... | [
6738,
20613,
13,
8443,
13,
8625,
1192,
544,
2953,
723,
11012,
1330,
379,
723,
11012,
198,
6738,
20613,
13,
46521,
13,
12048,
62,
19738,
13,
19738,
62,
66,
2271,
271,
1330,
2922,
62,
332,
811,
64,
62,
5171,
282,
11,
2922,
62,
66,
2... | 2.835206 | 534 |
from django.utils.translation import ugettext
from rest_framework.exceptions import NotFound
from commons.decorators import validate_requirements, validate_existance, str_to_boolean
from payment.models import Payment
from .models import Branch
class BranchService:
"""
General services for branch
"""
... | [
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
198,
6738,
1334,
62,
30604,
13,
1069,
11755,
1330,
1892,
21077,
198,
198,
6738,
36523,
13,
12501,
273,
2024,
1330,
26571,
62,
8897,
18883,
11,
26571,
62,
1069,
9311,
11,
... | 2.303411 | 1,114 |
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. 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 requir... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
2,
15069,
12131,
3012,
11419,
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... | 3.059809 | 836 |
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-08-11 02:47
from hanlp.common.dataset import SortingSamplerBuilder
from hanlp.components.tokenizers.transformer import TransformerTaggingTokenizer
from hanlp.datasets.cws.sighan2005.pku import SIGHAN2005_PKU_TRAIN_ALL, SIGHAN2005_PKU_TEST
from tests import cdroot
cd... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
6434,
25,
289,
962,
6359,
198,
2,
7536,
25,
12131,
12,
2919,
12,
1157,
7816,
25,
2857,
198,
6738,
289,
272,
34431,
13,
11321,
13,
19608,
292,
316,
1330,
311,
24707,
... | 2.282238 | 411 |
import pytest
from yaaredis.utils import b
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
@pytest.mark.asyncio
... | [
11748,
12972,
9288,
198,
198,
6738,
21349,
1144,
271,
13,
26791,
1330,
275,
628,
198,
31,
9078,
9288,
13,
4102,
13,
292,
13361,
952,
628,
198,
31,
9078,
9288,
13,
4102,
13,
292,
13361,
952,
628,
198,
31,
9078,
9288,
13,
4102,
13,
... | 2.173184 | 179 |
# coding=utf-8
import logging
import sys
import argparse
from bandcamp_parser.album import Album
from bandcamp_parser.tag import Tag
from bandcamp_parser.track import Track
logging.basicConfig(level=logging.INFO)
def main():
""" Playing the tracks until CTRL-C """
try:
loop()
except KeyboardInt... | [
2,
19617,
28,
40477,
12,
23,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
198,
6738,
4097,
16544,
62,
48610,
13,
40916,
1330,
23999,
198,
6738,
4097,
16544,
62,
48610,
13,
12985,
1330,
17467,
198,
6738,
4097,
1654... | 2.80292 | 137 |
# -*- coding: utf-8 -*-
"""
MarvelmindデータをAWS IoT Core へ Publish するパーツクラスを定義するモジュール。
"""
import time
import json
from .base import PublisherBase, to_float, to_str
from .topic import pub_hedge_usnav_json_topic, pub_hedge_usnav_raw_json_topic, pub_hedge_imu_json_topic
class USNavPublisher(PublisherBase):
"""
Ma... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
38864,
10155,
21959,
6312,
23376,
31758,
12298,
50,
38488,
7231,
23294,
116,
8525,
1836,
23294,
247,
25748,
32546,
12045,
226,
14099,
9263,
8943,
31758,
22522,
2... | 1.284786 | 6,770 |
'''
Author: Jason.Parks
Created: April 25, 2012
Module: menu.clean.__init__
Purpose: to import menu clean
'''
if not __name__ == '__main__':
print "menu.clean.__init__ imported" | [
7061,
6,
198,
13838,
25,
8982,
13,
47,
5558,
198,
41972,
25,
3035,
1679,
11,
2321,
198,
26796,
25,
6859,
13,
27773,
13,
834,
15003,
834,
198,
30026,
3455,
25,
284,
1330,
6859,
3424,
220,
198,
7061,
6,
198,
197,
198,
361,
407,
1159... | 2.731343 | 67 |
from membase.api.rest_client import RestConnection, RestHelper
from memcached.helper.data_helper import MemcachedClientHelper
from remote.remote_util import RemoteMachineShellConnection
from mc_bin_client import MemcachedClient, MemcachedError
from membase.api.exception import ServerAlreadyJoinedException
from membase.... | [
6738,
1066,
8692,
13,
15042,
13,
2118,
62,
16366,
1330,
8324,
32048,
11,
8324,
47429,
198,
6738,
1066,
66,
2317,
13,
2978,
525,
13,
7890,
62,
2978,
525,
1330,
4942,
66,
2317,
11792,
47429,
198,
6738,
6569,
13,
47960,
62,
22602,
1330,
... | 4.007407 | 135 |
import pytest
import torch
from nanodet.model.backbone import ResNet, build_backbone
| [
11748,
12972,
9288,
198,
11748,
28034,
198,
198,
6738,
15709,
375,
316,
13,
19849,
13,
1891,
15992,
1330,
1874,
7934,
11,
1382,
62,
1891,
15992,
628
] | 3.346154 | 26 |
import socket
import sys
import time
throttle_position=1000
throttle_min =0
throttle_max = 0xffff
from tkinter import *
master = Tk()
master.geometry("500x500")
master.columnconfigure(0, weight=1)
master.rowconfigure(0, weight=1)
w1 = Scale(master, from_=throttle_min, to=throttle_max, tickinterval=10)
w1.set(thrott... | [
11748,
17802,
198,
11748,
25064,
198,
11748,
640,
198,
198,
26110,
23296,
62,
9150,
28,
12825,
198,
26110,
23296,
62,
1084,
796,
15,
198,
26110,
23296,
62,
9806,
796,
657,
87,
12927,
628,
198,
198,
6738,
256,
74,
3849,
1330,
1635,
198... | 2.473002 | 463 |
from pyroombaadapter.pyroombaadapter import PyRoombaAdapter
| [
6738,
12972,
305,
2381,
64,
324,
3429,
13,
9078,
305,
2381,
64,
324,
3429,
1330,
9485,
15450,
2381,
64,
47307,
198
] | 2.857143 | 21 |
import argparse
class Parameters:
"""Global parameters"""
parser = argparse.ArgumentParser(description='Testing parameters')
parser.add_argument("-p1", dest="param1", help="parameter1")
parser.add_argument("-p2", dest="param2", help="parameter2")
params = parser.parse_args()
input_parameters = Pa... | [
11748,
1822,
29572,
201,
198,
201,
198,
4871,
40117,
25,
201,
198,
220,
220,
220,
37227,
22289,
10007,
37811,
201,
198,
220,
220,
220,
220,
201,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
44154,
10007,
11537,... | 2.835616 | 146 |
import os
from pathlib import Path
from smarts.sstudio import gen_scenario
from smarts.sstudio.types import (
Mission,
Route,
SocialAgentActor,
Scenario,
)
actors = [
SocialAgentActor(
name=f"non-interactive-agent-{speed}-v0",
agent_locator="zoo.policies:non-interactive-agent-v0",
... | [
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
4451,
82,
13,
82,
19149,
952,
1330,
2429,
62,
1416,
39055,
198,
6738,
4451,
82,
13,
82,
19149,
952,
13,
19199,
1330,
357,
198,
220,
220,
220,
12633,
11,
198,
220,
220... | 2.126904 | 394 |
## STEP: GATHER DATA
# data source: where.data, Google Geodata API
# edit where.data to add an address nearby where you live
# use the Google geocoding API to clean up some user-entered geographic locations of university names
import urllib.request, urllib.parse, urllib.error
import http
import sqlite3
import json
imp... | [
2235,
49154,
25,
402,
45226,
42865,
198,
2,
1366,
2723,
25,
810,
13,
7890,
11,
3012,
2269,
375,
1045,
7824,
198,
2,
4370,
810,
13,
7890,
284,
751,
281,
2209,
6716,
810,
345,
2107,
198,
2,
779,
262,
3012,
4903,
420,
7656,
7824,
284... | 3.037851 | 1,638 |
from setuptools import setup
setup(
name='gdal2tilesp.py',
version='3.14.15926',
author='',
author_email='',
packages=['.'],
scripts=['gdal2tilesp.py'],
url='https://github.com/roblabs/gdal2tilesp',
license='LICENSE.txt',
description='Enhancements to tile cutter for parallelism and ... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
21287,
282,
17,
83,
2915,
79,
13,
9078,
3256,
198,
220,
220,
220,
2196,
11639,
18,
13,
1415,
13,
19707,
2075,
3256,
198,
220,
220,
220,
1772,
... | 2.529032 | 155 |
stack = MinStackNew()
stack.push(0)
stack.push(-1)
stack.push(0)
x = stack.getMin()
print(x)
stack.pop()
stack.pop()
x = stack.getMin()
print(x) | [
197,
197,
198,
197,
197,
198,
198,
25558,
796,
1855,
25896,
3791,
3419,
198,
25558,
13,
14689,
7,
15,
8,
198,
25558,
13,
14689,
32590,
16,
8,
198,
25558,
13,
14689,
7,
15,
8,
198,
87,
796,
8931,
13,
1136,
9452,
3419,
198,
4798,
... | 2.157143 | 70 |
#from simplejson import JSONDecoder
#from simplejson import JSONEncoder
# --------------------------------------------------------------------------------------
# This block define the input of the app
# the name of style is not difined
# json_example:
# '{"State": "Normal", "Style": "10", "Moves": [[1, 2],... | [
201,
198,
2,
6738,
2829,
17752,
1330,
19449,
10707,
12342,
201,
198,
2,
6738,
2829,
17752,
1330,
19449,
27195,
12342,
201,
198,
201,
198,
201,
198,
2,
16529,
19351,
438,
201,
198,
2,
770,
2512,
8160,
262,
5128,
286,
262,
598,
201,
1... | 3.452663 | 338 |
"""
Build and run any AuTuMN model, storing the outputs
"""
import os
import logging
import yaml
from datetime import datetime
from autumn import constants
from autumn.tool_kit.timer import Timer
from autumn.tool_kit.serializer import serialize_model
from autumn.tool_kit.scenarios import Scenario
from autumn.tool_kit... | [
37811,
198,
15580,
290,
1057,
597,
40666,
47247,
39764,
2746,
11,
23069,
262,
23862,
198,
37811,
198,
11748,
28686,
198,
11748,
18931,
198,
11748,
331,
43695,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
198,
6738,
23608,
1330,
38491,
19... | 2.283262 | 1,398 |
import numpy as np
import requests
from django.db.models import Q
from api.models import Photo, User
from api.util import logger
from ownphotos.settings import IMAGE_SIMILARITY_SERVER
| [
11748,
299,
32152,
355,
45941,
198,
11748,
7007,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
198,
6738,
40391,
13,
27530,
1330,
5555,
11,
11787,
198,
6738,
40391,
13,
22602,
1330,
49706,
198,
6738,
898,
24729,
13,
336... | 3.481481 | 54 |
import os
import urllib.request
from collections import Counter
import re
# data provided
stopwords_file = os.path.join('/tmp', 'stopwords')
harry_text = os.path.join('/tmp', 'harry')
urllib.request.urlretrieve('http://bit.ly/2EuvyHB', stopwords_file)
urllib.request.urlretrieve('http://bit.ly/2C6RzuR', harry_... | [
11748,
28686,
201,
198,
11748,
2956,
297,
571,
13,
25927,
201,
198,
6738,
17268,
1330,
15034,
201,
198,
11748,
302,
201,
198,
201,
198,
2,
1366,
2810,
201,
198,
11338,
10879,
62,
7753,
796,
28686,
13,
6978,
13,
22179,
10786,
14,
22065... | 2.484076 | 157 |
import logging
import cv2 as cv
from utils.functions import iter_dir, join, make_dirs
LOG = logging.getLogger(__name__)
| [
11748,
18931,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
6738,
3384,
4487,
13,
12543,
2733,
1330,
11629,
62,
15908,
11,
4654,
11,
787,
62,
15908,
82,
198,
198,
25294,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 2.837209 | 43 |
# -*- coding: utf-8 -*-
#
# Copyright 2016 Capital One Services, 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 ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
1584,
9747,
1881,
6168,
11,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345... | 3.618812 | 202 |
""" Full assembly of the parts to form the complete network """
import sys
import torch.nn.functional as F
from .unet_parts import *
'''class UNet(nn.Module):
def __init__(self, n_channels, n_classes, isfine=True, bilinear=True):
super(UNet, self).__init__()
self.n_channels = n_channels
se... | [
37811,
6462,
10474,
286,
262,
3354,
284,
1296,
262,
1844,
3127,
37227,
198,
11748,
25064,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
764,
403,
316,
62,
42632,
1330,
1635,
198,
198,
7061,
6,
4871,
4725,
316,
7,
... | 1.943704 | 675 |
# -*- mode: python; coding: utf-8 -*
# Copyright (c) 2018 Radio Astronomy Software Group
# Licensed under the 2-clause BSD License
"""Tests for FHD_cal object.
"""
from __future__ import absolute_import, division, print_function
import nose.tools as nt
import os
import numpy as np
from pyuvdata import UVCal
import ... | [
2,
532,
9,
12,
4235,
25,
21015,
26,
19617,
25,
3384,
69,
12,
23,
532,
9,
198,
2,
15069,
357,
66,
8,
2864,
8829,
25398,
9145,
10442,
4912,
198,
2,
49962,
739,
262,
362,
12,
565,
682,
347,
10305,
13789,
198,
198,
37811,
51,
3558,
... | 2.305526 | 2,805 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems
This module is developed by:
Yalin Li <zoe.yalin.li@gmail.com>
This module is under the University of Illinois/NCSA Open Source License.
Please refer to https://github.com/QSD-G... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
48,
10305,
12807,
25,
16972,
12464,
45276,
8495,
329,
39958,
290,
8271,
7628,
3341,
198,
198,
... | 2.880952 | 462 |
# fallacy quoter for antaytheist
import json
import re
import requests
fallaciesjson = requests.get("https://yourlogicalfallacyis.com/js/data/fallacies.json", timeout=15)
fallaciesjson.raise_for_status()
fallacies = json.loads(fallaciesjson.text)
fallacynames = []
for fallacyitem in fallacies:
fallacynames.append... | [
2,
39104,
627,
19543,
329,
1885,
323,
1169,
396,
198,
11748,
33918,
198,
11748,
302,
198,
11748,
7007,
198,
198,
7207,
13433,
17752,
796,
7007,
13,
1136,
7203,
5450,
1378,
14108,
6404,
605,
7207,
1590,
271,
13,
785,
14,
8457,
14,
7890... | 3.146789 | 109 |
idx = 0
a, b, c = map(int, input().split())
for i in range(a):
for j in range(b):
for k in range(c):
idx += 1
print(i, j, k)
print(idx) | [
312,
87,
796,
657,
198,
64,
11,
275,
11,
269,
796,
3975,
7,
600,
11,
5128,
22446,
35312,
28955,
198,
1640,
1312,
287,
2837,
7,
64,
2599,
198,
220,
220,
220,
329,
474,
287,
2837,
7,
65,
2599,
198,
220,
220,
220,
220,
220,
220,
... | 1.8 | 95 |
# Live stream a Colored video from Webcam or default Video Capture device
import cv2
# Open the default Video Capture device (or WebCam)
v = cv2.VideoCapture(0)
# Check if the file can be opened successfully
if(v.isOpened() == "False"):
print("ERROR: Cannot open the Video File")
quit()
print("SUCCESS: Video... | [
2,
7547,
4269,
257,
1623,
1850,
2008,
422,
5313,
20991,
393,
4277,
7623,
31793,
3335,
198,
198,
11748,
269,
85,
17,
198,
198,
2,
4946,
262,
4277,
7623,
31793,
3335,
357,
273,
5313,
21701,
8,
198,
85,
796,
269,
85,
17,
13,
10798,
4... | 2.828671 | 286 |
answers = []
with open("input06.txt") as f:
ans = set('')
for line in f:
line = line.strip()
if not line:
answers.append(ans)
ans = set('')
else:
ans = ans.union(set(line))
ans = ans.union(set(line))
answers.append(ans)
print(sum([len(a) for a in ans... | [
504,
86,
364,
796,
17635,
198,
4480,
1280,
7203,
15414,
3312,
13,
14116,
4943,
355,
277,
25,
198,
220,
220,
220,
9093,
796,
900,
7,
7061,
8,
198,
220,
220,
220,
329,
1627,
287,
277,
25,
198,
220,
220,
220,
220,
220,
220,
220,
16... | 1.989011 | 364 |
from .AST import AST
| [
6738,
764,
11262,
1330,
29273,
628
] | 3.666667 | 6 |
import enum
import sys
import gidgethub
DEFAULT_BODY = ""
TAG_NAME = "gh-issue-number"
NEWS_NEXT_DIR = "Misc/NEWS.d/next/"
CLOSING_TAG = f"<!-- /{TAG_NAME} -->"
BODY = f"""\
{{body}}
<!-- {TAG_NAME}: gh-{{issue_number}} -->
* gh-{{issue_number}}
{CLOSING_TAG}
"""
@enum.unique
def create_status(context, state, *... | [
11748,
33829,
198,
11748,
25064,
198,
198,
11748,
308,
17484,
40140,
628,
198,
7206,
38865,
62,
33,
33076,
796,
13538,
198,
42197,
62,
20608,
796,
366,
456,
12,
21949,
12,
17618,
1,
198,
49597,
62,
45,
13918,
62,
34720,
796,
366,
44,
... | 2.507273 | 1,650 |
"""
Author: John Betacourt Gonzalez
Aka: @JohnBetaCode
"""
# =============================================================================
# LIBRARIES AND DEPENDENCIES - LIBRARIES AND DEPENDENCIES - LIBRARIES AND DEPEN
# =============================================================================
from utils import pr... | [
37811,
198,
13838,
25,
1757,
5147,
330,
15666,
24416,
198,
32,
4914,
25,
2488,
7554,
43303,
10669,
198,
37811,
198,
198,
2,
38093,
25609,
198,
2,
45651,
49,
1503,
11015,
5357,
5550,
47,
10619,
24181,
11015,
532,
45651,
49,
1503,
11015,
... | 5.142857 | 231 |
"""NGPVAN Locations Endpoints"""
from parsons.etl.table import Table
import logging
logger = logging.getLogger(__name__)
| [
37811,
10503,
47,
53,
1565,
41277,
5268,
13033,
37811,
198,
198,
6738,
13544,
684,
13,
316,
75,
13,
11487,
1330,
8655,
198,
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 3.1 | 40 |
#!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
#
# This is a python script. You need a Python interpreter to run it.
# For example, ActiveState Python, which exists for windows.
#
# This script strips the penultimate record from a Mobipocket file.
# This is useful because the current KindleGen... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
43907,
25,
7753,
12685,
7656,
28,
48504,
12,
23,
25,
912,
28,
19,
25,
2032,
28,
19,
25,
38031,
25,
316,
25,
6448,
28,
19,
25,
1872,
198,
2,
198,
2,
770,
318,
257,
21015,
422... | 3.59634 | 929 |
#!/usr/bin/env python3
import re
import os
import json
from argparse import ArgumentParser
CSS_ICON_NAME_PARSER = r"""\.fa-([^:]*?):(?=[^}]*?content:\s*['"](.*?)['"])"""
def generate(css_file, json_file):
"""Generate a file that contains code for character names
"""
# check css_file exists
if not os... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
302,
198,
11748,
28686,
198,
11748,
33918,
198,
6738,
1822,
29572,
1330,
45751,
46677,
628,
198,
49155,
62,
2149,
1340,
62,
20608,
62,
27082,
35009,
796,
374,
37811,
17405,
13... | 2.416938 | 614 |
import json
from numpy import *
import csv
import berexapi as bex
from pandas import Series, DataFrame
import pandas as pd
import tools.color as toolcolor
import tools.arrange as toolarrange
import numpy as np
import itertools
import tools.repack as toolrepack
import tools.genie3 as toolgenie3
ERROR_CODE ... | [
11748,
33918,
201,
198,
6738,
299,
32152,
1330,
1635,
201,
198,
11748,
269,
21370,
201,
198,
11748,
307,
21510,
15042,
355,
307,
87,
201,
198,
6738,
19798,
292,
1330,
7171,
11,
6060,
19778,
201,
198,
11748,
19798,
292,
355,
279,
67,
2... | 2.746479 | 142 |
from dbipyt import dbipyt
| [
6738,
20613,
541,
20760,
1330,
20613,
541,
20760,
198
] | 2.888889 | 9 |
import os
import copy
import torch
import torch.distributed as dist
from .symmatrix import SymMatrix
HESSIAN = 'hessian' # Hessian
FISHER_EXACT = 'fisher_exact' # exact Fisher
FISHER_MC = 'fisher_mc' # Fisher estimation by Monte-Carlo sampling
COV = 'cov' # no-centered covariance a.k.a. empirical Fisher
SHAPE_F... | [
11748,
28686,
198,
11748,
4866,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
17080,
6169,
355,
1233,
198,
198,
6738,
764,
1837,
3020,
265,
8609,
1330,
15845,
46912,
198,
198,
39,
7597,
16868,
796,
705,
33979,
666,
6,
220,
1303,
46305,... | 2.232984 | 382 |
while True:
line = raw_input('> ')
if line[0] == '#' :
continue
if line == 'done':
break
print line
print 'Done!'
| [
4514,
6407,
25,
198,
220,
220,
220,
1627,
796,
8246,
62,
15414,
10786,
29,
705,
8,
198,
220,
220,
220,
611,
1627,
58,
15,
60,
6624,
705,
2,
6,
1058,
198,
220,
220,
220,
220,
220,
220,
220,
2555,
198,
220,
220,
220,
611,
1627,
... | 2.084507 | 71 |
from conans import ConanFile, CMake
import os
############### CONFIGURE THESE VALUES ##################
default_user = "lucteo"
default_channel = "testing"
#########################################################
channel = os.getenv("CONAN_CHANNEL", default_channel)
username = os.getenv("CONAN_USERNAME", default_use... | [
6738,
369,
504,
1330,
31634,
8979,
11,
327,
12050,
198,
11748,
28686,
198,
198,
7804,
4242,
21017,
25626,
11335,
48947,
26173,
35409,
1303,
14468,
2,
198,
12286,
62,
7220,
796,
366,
2290,
310,
68,
78,
1,
198,
12286,
62,
17620,
796,
36... | 3.670455 | 88 |
__author__ = 'jlu96'
import csv
import numpy as np
import json
import pandas as pd
import collections
global data_dir
data_dir = "/Users/jlu96/v-causal-snps/data/GeneExpressionData/GGR_Network/"
global genecols
genecols = ["Official Symbol Interactor A", "Official Symbol Interactor B"]
def annotate_cols(... | [
834,
9800,
834,
796,
705,
73,
2290,
4846,
6,
198,
11748,
269,
21370,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
17268,
198,
198,
20541,
1366,
62,
15908,
198,
7890,
62,
1590... | 2.267879 | 4,894 |
import tensorflow as tf
from tensorflow import keras
import matplotlib.pyplot as plt
import tensorflow_datasets as tfds
import random
from ew import EWBase, EWDense, EWConv2D
AUTOTUNE = tf.data.experimental.AUTOTUNE
dataset = tfds.load("mnist", as_supervised=True, split="train")
val_set = tfds.load("mnist", as_supe... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
1330,
41927,
292,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
11192,
273,
11125,
62,
19608,
292,
1039,
355,
48700,
9310,
198,
11748,
4738,
... | 2.832188 | 1,019 |
import os
import glob
import pickle
import random
import shutil
import zipfile
import requests
import igraph as ig
import pandas as pd
from .grna import GuideRNA
from .network import Network
from .kinetics import Kinetics
from .sampling import Sampling
from .gillespie_ssa import GillespieSSA
from .compile_reactions imp... | [
11748,
28686,
198,
11748,
15095,
198,
11748,
2298,
293,
198,
11748,
4738,
198,
11748,
4423,
346,
198,
11748,
19974,
7753,
198,
11748,
7007,
198,
11748,
45329,
1470,
355,
45329,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
764,
2164,
... | 3.695652 | 92 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Task 1 - data parsing."""
__author__ = "Stanislav D. Kudriavtsev"
import json
from pathlib import Path
from sys import exit
# Attention.
# the original files were with mistakes
# so they all were passed through JSON
# online validator and beautifier, see
# README ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
25714,
352,
532,
1366,
32096,
526,
15931,
628,
198,
834,
9800,
834,
796,
366,
32140,
3044,
615,
360,
13,
509,
... | 2.170535 | 991 |
import sys
from django.contrib.auth import authenticate
from django.contrib.auth import get_user_model
from django.utils import timezone
from micro.models import Following
import random
User = get_user_model()
user_nameL = "L"
user_nameR = "R"
password = "pass"
TOTAL_USERS = 20
MAX_FOLLOWERS = 3
i = 0
while (i < TO... | [
11748,
25064,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
4580,... | 2.493861 | 733 |
"""Here goes the training code."""
| [
37811,
4342,
2925,
262,
3047,
2438,
526,
15931,
198
] | 3.888889 | 9 |
import os
import json
import pandas as pd
import numpy as np
import uuid
import matplotlib.pyplot as plt
from matplotlib.cm import get_cmap
import random
from datetime import datetime, timedelta
SAMPLES_FOLDER = os.environ.get('SAMPLES_FOLDER')
application_diagram = {
'productpage': set(['reviews', 'details']... | [
11748,
28686,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
334,
27112,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,... | 2.385965 | 456 |
# %% [728. Self Dividing Numbers](https://leetcode.com/problems/self-dividing-numbers/)
# 問題:leftからrightまででself-dividingの数をリストで返せ。self-dividingは、各桁の数字で割り切れる
# 解法:各桁は`k, m = m % 10, m // 10`のように更新する
| [
2,
43313,
685,
48524,
13,
12189,
360,
1699,
278,
27797,
16151,
5450,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
944,
12,
67,
1699,
278,
12,
77,
17024,
34729,
198,
2,
10263,
243,
237,
165,
94,
234,
171,
120,
248,
9464,
273... | 1.496241 | 133 |
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth import get_user_model
from .models import LeaderboardSettings
User = get_user_model()
@receiver(post_save, sender=User)
def update_submission_map(sender, instance, created, **kwargs):
"""automatically cre... | [
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
1281,
62,
21928,
198,
6738,
42625,
14208,
13,
6381,
17147,
1330,
9733,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
198,
6738,
7... | 3.246479 | 142 |
from . import merge_callbacks, merge_commands
from . import basic_commands, crypt, compress, convert, split | [
6738,
764,
1330,
20121,
62,
13345,
10146,
11,
20121,
62,
9503,
1746,
220,
198,
6738,
764,
1330,
4096,
62,
9503,
1746,
11,
8194,
11,
27413,
11,
10385,
11,
6626
] | 3.724138 | 29 |
from io import StringIO
from pathlib import Path
from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
| [
6738,
33245,
1330,
10903,
9399,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1330,
869,
62,
21812,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
1... | 4.040816 | 49 |
n = 2
print(largestNumber(n))
| [
198,
198,
77,
796,
362,
198,
4798,
7,
28209,
15057,
7,
77,
4008,
198
] | 2.285714 | 14 |
import re, glob, sys, os, argparse
import pandas as pd
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('csv_dir')
parser.add_argument('output_file')
args = parser.parse_args()
# 指定されたCSVディレクトリ配下の全CSVファイルのパス
files = glob.glob(args.csv_dir + '/*.csv')
major_class_name = "業種(大分類)_分類名"
medium_c... | [
11748,
302,
11,
15095,
11,
25064,
11,
28686,
11,
1822,
29572,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
... | 1.67938 | 839 |
"""Just a class to verify the wrapping works"""
import re
import time
import logging
from selenium.common.exceptions import WebDriverException, UnexpectedAlertPresentException
from selen_kaa.webdriver import SeWebDriver
from selen_kaa.element.se_web_element import SeWebElement
from selen_kaa.utils import se_utils
D... | [
37811,
5703,
257,
1398,
284,
11767,
262,
27074,
2499,
37811,
198,
11748,
302,
198,
11748,
640,
198,
11748,
18931,
198,
198,
6738,
384,
11925,
1505,
13,
11321,
13,
1069,
11755,
1330,
5313,
32103,
16922,
11,
471,
42072,
36420,
34695,
16922,... | 3.60274 | 146 |
# from app import app
import urllib.request
import json
from .models import Source,Article
# Source = source.Source
# Getting api key
api_key = None
# Getting the news base url
source_base_url = None
article_base_url = None
def configure_request(app):
'''
Function to acquire the api key and base urls
'''
glo... | [
2,
422,
598,
1330,
598,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
33918,
198,
6738,
764,
27530,
1330,
8090,
11,
14906,
628,
198,
2,
8090,
796,
2723,
13,
7416,
198,
220,
198,
2,
220,
18067,
40391,
1994,
198,
15042,
62,
2539,... | 2.872361 | 1,042 |
"""
Use HPPC battery cell data to determine the tau, resistor and capacitor values
(RC parameters) for each SOC section. Curve fit coefficients are determined
from the two time constant (TTC) function.
"""
import params
from ecm import CellHppcData
from ecm import CellEcm
# Battery cell HPPC data and equivalent circu... | [
37811,
198,
11041,
6574,
5662,
6555,
2685,
1366,
284,
5004,
262,
256,
559,
11,
45032,
290,
43212,
3815,
198,
7,
7397,
10007,
8,
329,
1123,
31430,
2665,
13,
46300,
4197,
44036,
389,
5295,
198,
6738,
262,
734,
640,
6937,
357,
51,
4825,
... | 2.454867 | 565 |
print(tribonacci(3))
| [
198,
198,
4798,
7,
83,
822,
261,
44456,
7,
18,
4008,
198
] | 1.916667 | 12 |
from django.utils.html import mark_safe
from dynamic_preferences.registries import global_preferences_registry
from basxconnect.core.views.person.search_person_view import searchbar
| [
6738,
42625,
14208,
13,
26791,
13,
6494,
1330,
1317,
62,
21230,
198,
6738,
8925,
62,
3866,
69,
4972,
13,
2301,
32995,
1330,
3298,
62,
3866,
69,
4972,
62,
2301,
4592,
198,
198,
6738,
1615,
87,
8443,
13,
7295,
13,
33571,
13,
6259,
13,... | 3.538462 | 52 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
Topic: 以编程方式定义类
Desc :
"""
# stock.py
# Example of making a class manually from parts
# Methods
cls_dict = {
'__init__': __init__,
'cost': cost,
}
# Make a class
import types
Stock = types.new_class('Stock', (), {}, lambda ns: ns.update(cls_dict))
Stoc... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
33221,
25,
220,
20015,
98,
163,
120,
244,
163,
101,
233,
43095,
28156,
237,
22522,
248,
20046,
231,
163,
... | 2.382716 | 162 |
from torch import nn
import torch
import torch.nn.functional as F
| [
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
628,
628
] | 3.631579 | 19 |
# This file is part of the Blockchain-based Fair Exchange Benchmark Tool
# https://gitlab.com/MatthiasLohr/bfebench
#
# Copyright 2021 Matthias Lohr <mail@mlohr.com>
#
# 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... | [
2,
770,
2393,
318,
636,
286,
262,
29724,
12,
3106,
7011,
12516,
25187,
4102,
16984,
198,
2,
220,
220,
220,
3740,
1378,
18300,
23912,
13,
785,
14,
19044,
400,
4448,
43,
1219,
81,
14,
19881,
1765,
24421,
198,
2,
198,
2,
15069,
33448,
... | 3.626866 | 268 |
"""
based on Gary's
TSTFTarray.m in
iris_mt_scratch/egbert_codes-20210121T193218Z-001/egbert_codes/matlabPrototype_10-13-20/TF/classes
"""
class TSTFTArray(object):
"""
class to support creating FC arrays from STFT objects stored as mat files
% class to support creating FC arrays from STFT objects stored... | [
37811,
198,
3106,
319,
10936,
338,
198,
51,
2257,
9792,
18747,
13,
76,
287,
198,
29616,
62,
16762,
62,
1416,
36722,
14,
1533,
4835,
62,
40148,
12,
1238,
2481,
486,
2481,
51,
1129,
2624,
1507,
57,
12,
8298,
14,
1533,
4835,
62,
40148,... | 2.226263 | 2,970 |
import discord
from discord.ext import commands
import random
import httpx
from lxml import html
import os
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
11748,
4738,
198,
11748,
2638,
87,
198,
6738,
300,
19875,
1330,
27711,
198,
11748,
28686,
628
] | 4.153846 | 26 |
#!/usr/bin/env python3
S = "11100010"
S = "111000111100001100"
S = '1100'
S = '1010'
S = '10'
S = "11011000"
S = ''
sol = Solution()
print(sol.makeLargestSpecial(S))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
50,
796,
366,
1157,
3064,
20943,
1,
198,
50,
796,
366,
1157,
3064,
486,
16243,
2388,
42060,
1,
198,
50,
796,
705,
42060,
6,
198,
50,
796,
705,
8784,
15,
6,
198,
50,
796,... | 2.113924 | 79 |
"""
Classes, that represents various value types that can appear in the configuration and problem definitionfiles.
Each grammar type can both parse string containing a value of a given type, and to create the string containing a given value.
"""
import pyparsing as pp
import io
import inspect
from pyparsing import W... | [
37811,
198,
9487,
274,
11,
326,
6870,
2972,
1988,
3858,
326,
460,
1656,
287,
262,
8398,
290,
1917,
6770,
16624,
13,
198,
198,
10871,
23491,
2099,
460,
1111,
21136,
4731,
7268,
257,
1988,
286,
257,
1813,
2099,
11,
290,
284,
2251,
262,
... | 2.892804 | 6,045 |
import re
import os
def setup_poetry(config):
"""Entry point of module: setup poetry files and run poetry commands"""
update_pyproject_dot_toml(config)
#lock_poetry_dependencies()
#install_dependencies()
def lock_poetry_dependencies_on_docker():
"""Create poetry.lock file"""
os.... | [
11748,
302,
201,
198,
11748,
28686,
201,
198,
201,
198,
201,
198,
4299,
9058,
62,
7501,
11973,
7,
11250,
2599,
201,
198,
220,
220,
220,
37227,
30150,
966,
286,
8265,
25,
9058,
19518,
3696,
290,
1057,
19518,
9729,
37811,
201,
198,
220,... | 2.810651 | 169 |
from typing import List
| [
6738,
19720,
1330,
7343,
628
] | 5 | 5 |
from .breed_serializer import BreedSerializer
from .dog_serializer import DogSerializer
from .user_serializer import UserSerializer
from .role_serializer import RoleSerializer
from .person_serializer import PersonSerializer
from .custom_token_serializer import CustomTokenSerializer | [
6738,
764,
4679,
276,
62,
46911,
7509,
1330,
45958,
32634,
7509,
198,
6738,
764,
9703,
62,
46911,
7509,
1330,
8532,
32634,
7509,
198,
6738,
764,
7220,
62,
46911,
7509,
1330,
11787,
32634,
7509,
198,
6738,
764,
18090,
62,
46911,
7509,
13... | 4.086957 | 69 |
# Copyright 2021 Rufaim (https://github.com/Rufaim)
#
# 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 ... | [
2,
15069,
33448,
371,
3046,
1385,
357,
5450,
1378,
12567,
13,
785,
14,
49,
3046,
1385,
8,
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.733068 | 502 |
#!/usr/bin/env python
import pipe
ES_HOST = {"host" : "localhost", "port" : 9200}
INDEX_NAME = 'view'
TYPE_NAME = 'docs'
N = 1000
from pyhocon import ConfigFactory
from elasticsearch import Elasticsearch
import json
import sys
conf = ConfigFactory.parse_file('../view.conf')
docs_conf = conf.get('view.docs')
es = ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
12656,
198,
198,
1546,
62,
39,
10892,
796,
19779,
4774,
1,
1058,
366,
36750,
1600,
366,
634,
1,
1058,
860,
2167,
92,
198,
12115,
6369,
62,
20608,
796,
705,
1177,
6,
198,
... | 2.844961 | 129 |
from typing import List
from boa3.builtin import public
@public
@public
| [
6738,
19720,
1330,
7343,
198,
198,
6738,
1489,
64,
18,
13,
18780,
259,
1330,
1171,
628,
198,
31,
11377,
628,
198,
31,
11377,
198
] | 3.208333 | 24 |