content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import sys
input = sys.stdin.readline
T = int(input())
fb = [0 for _ in range(50)]
fb[0], fb[1] = 1,1
for i in range(2,50): fb[i] = fb[i-1]+fb[i-2]
for _ in range(T):
N = int(input())
L = []
while N:
for i in range(50):
if fb[i]>N:
L.append(fb[i-1])
N-=... | [
11748,
25064,
198,
15414,
796,
25064,
13,
19282,
259,
13,
961,
1370,
198,
198,
51,
796,
493,
7,
15414,
28955,
198,
21855,
796,
685,
15,
329,
4808,
287,
2837,
7,
1120,
15437,
198,
21855,
58,
15,
4357,
277,
65,
58,
16,
60,
796,
352,... | 1.571875 | 320 |
import glob
import os
import platform
import shutil
import sys
import pyxel
if __name__ == "__main__":
run()
| [
11748,
15095,
198,
11748,
28686,
198,
11748,
3859,
198,
11748,
4423,
346,
198,
11748,
25064,
198,
198,
11748,
12972,
87,
417,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1057,
3419,
198
] | 2.878049 | 41 |
import pickle
import numpy as np
from projeto.settings import WEIGHTS_PATH
from loguru import logger
| [
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
386,
73,
27206,
13,
33692,
1330,
12887,
34874,
62,
34219,
198,
6738,
2604,
14717,
1330,
49706,
198
] | 3.607143 | 28 |
# Copyright 2019-2020 Not Just A Toy Corp.
#
# 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... | [
2,
15069,
13130,
12,
42334,
1892,
2329,
317,
10977,
11421,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
... | 2.86034 | 1,296 |
import logging
import async_timeout
logger = logging.getLogger(__name__)
| [
11748,
18931,
198,
198,
11748,
30351,
62,
48678,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 3.166667 | 24 |
from alembic import op
import sqlalchemy as sa
"""empty message
Revision ID: 1e09e871fb65
Revises: ('0b4e7a8a7e64', '0701782c564d')
Create Date: 2019-03-28 23:08:21.960495
"""
# revision identifiers, used by Alembic.
revision = '1e09e871fb65'
down_revision = ('0b4e7a8a7e64', '0701782c564d')
| [
6738,
31341,
2022,
291,
1330,
1034,
198,
11748,
44161,
282,
26599,
355,
473,
198,
198,
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
352,
68,
2931,
68,
23,
4869,
21855,
2996,
198,
18009,
2696,
25,
19203,
15,
65,
19,
68,
22,
6... | 2.223881 | 134 |
import os
import pickle
from asgiref.sync import sync_to_async
@sync_to_async
| [
11748,
28686,
198,
11748,
2298,
293,
198,
6738,
355,
70,
557,
69,
13,
27261,
1330,
17510,
62,
1462,
62,
292,
13361,
198,
198,
31,
27261,
62,
1462,
62,
292,
13361,
198
] | 2.548387 | 31 |
import numpy as np
class ParamLine_py(object):
""" A 3D parametric line.
Parameters
----------
P0: ndarray(3,)
A tail point.
P1: ndarray(3,)
A head point.
Attributes
----------
P0
P1
u: ndarray(3,)
Show the direction of the parametric line
Example... | [
11748,
299,
32152,
355,
45941,
198,
198,
4871,
25139,
13949,
62,
9078,
7,
15252,
2599,
198,
220,
220,
220,
37227,
317,
513,
35,
5772,
19482,
1627,
13,
628,
220,
220,
220,
40117,
198,
220,
220,
220,
24200,
438,
628,
220,
220,
220,
35... | 1.963883 | 1,329 |
from __future__ import annotations
from jsonclasses import jsonclass, types
@jsonclass
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
33918,
37724,
1330,
33918,
4871,
11,
3858,
628,
198,
31,
17752,
4871,
628
] | 4.285714 | 21 |
from django.contrib.auth.models import User
from django.db.models.signals import pre_save, post_save, post_delete
from django.dispatch import receiver
from .models import Post, Subscriber
from .functions import notify_new_content, notify_new_subscriber
@receiver(post_save, sender=Post)
def send_mail_to_subscriber(sen... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
12683,
874,
1330,
662,
62,
21928,
11,
1281,
62,
21928,
11,
1281,
62,
33678,
198,
6738,
42625,
14208,
13,
6381,
171... | 2.75 | 300 |
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from .models import User, Agreement
# Register your models here.
admin.site.register(User, UserAdmin)
admin.site.register(Agreement)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
28482,
1330,
11787,
46787,
198,
198,
6738,
764,
27530,
1330,
11787,
11,
12729,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
28... | 3.444444 | 63 |
import sys
import os
import json
import traceback
import importlib
from flask import request, make_response, Blueprint, abort
from lifoid.config import settings
from lifoid.logging.mixin import ServiceLogger
from lifoid.constants import E_GET, E_POST
from lifoid.events import process_event
from lifoid.exceptions import... | [
11748,
25064,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
12854,
1891,
198,
11748,
1330,
8019,
198,
6738,
42903,
1330,
2581,
11,
787,
62,
26209,
11,
39932,
11,
15614,
198,
6738,
3868,
1868,
13,
11250,
1330,
6460,
198,
6738,
3868,
... | 2.49226 | 969 |
# flake8: noqa
from .version import __version__
from .authorized_service import AuthorizedService, get_email_and_key
| [
2,
781,
539,
23,
25,
645,
20402,
198,
6738,
764,
9641,
1330,
11593,
9641,
834,
198,
198,
6738,
764,
19721,
62,
15271,
1330,
6434,
1143,
16177,
11,
651,
62,
12888,
62,
392,
62,
2539,
198
] | 3.371429 | 35 |
from collections import UserDict
from copy import copy
from . import *
class TagContainer(UserDict):
"""
Manages a coherent group of tags
Instances are callable. That syntax is the preferred way to get a tag, since
it will always return a tag object. Accessing an undeclared tag in this way
will r... | [
6738,
17268,
1330,
11787,
35,
713,
198,
6738,
4866,
1330,
4866,
198,
198,
6738,
764,
1330,
1635,
198,
198,
4871,
17467,
29869,
7,
12982,
35,
713,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
1869,
1095,
257,
24870,
1448,
286,
... | 2.29801 | 1,859 |
#
# apologies for the camelCase - the previous version was in JS
import dateutil.parser
import datetime
from datetime import date, time
from time import sleep
import http.client
import xml.etree.ElementTree as ET
## ''Aquila 6 April 2009 > 5 mag
# 42.3476°N 13.3800°ECoordinates: 42.3476°N 13.3800°E[... | [
2,
198,
2,
32920,
329,
262,
41021,
20448,
532,
262,
2180,
2196,
373,
287,
26755,
198,
198,
11748,
3128,
22602,
13,
48610,
198,
11748,
4818,
8079,
198,
6738,
4818,
8079,
1330,
3128,
11,
640,
198,
6738,
640,
1330,
3993,
198,
198,
11748,... | 2.428571 | 273 |
'''
Script that tests a trained models on its training dataset. It does the same
testing routine as the one in the overall utilities_models_tf.py script.
It saves
¤ the information about the test for easy later plotting
¤ ROC (per-class and overall using micro and macro average)
¤ PP curve (per-class and overall using ... | [
7061,
6,
198,
7391,
326,
5254,
257,
8776,
4981,
319,
663,
3047,
27039,
13,
632,
857,
262,
976,
198,
33407,
8027,
355,
262,
530,
287,
262,
4045,
20081,
62,
27530,
62,
27110,
13,
9078,
4226,
13,
198,
1026,
16031,
198,
126,
97,
262,
... | 2.474942 | 9,498 |
from yunionclient.common import base
| [
6738,
331,
24592,
16366,
13,
11321,
1330,
2779,
628,
198
] | 3.9 | 10 |
"""The script retrieves explicit connectives marking temporal, comparison, contingency, and expansion relations
and prints the total number of these connectives per article section."""
import sys
import spacy
from collections import Counter
nlp = spacy.load("en_core_web_sm")
# The script below retrieves the c... | [
37811,
464,
4226,
13236,
1158,
7952,
2018,
1083,
18730,
21964,
11,
7208,
11,
38820,
11,
290,
7118,
2316,
201,
198,
392,
20842,
262,
2472,
1271,
286,
777,
2018,
1083,
583,
2708,
2665,
526,
15931,
201,
198,
201,
198,
11748,
25064,
201,
... | 2.24653 | 1,513 |
"""
Basic metadata reports/queries
@author: dan myung (dmyung@dimagi.com)
create: 10/19/2009
Notes:
A place where oft reused queries off xformmanager.metadata can be referenced.
This is somewhat redundant with functionality already existent in the apps/reports/util.py file which already does
a basic metadata query.... | [
37811,
220,
198,
26416,
20150,
3136,
14,
421,
10640,
198,
31,
9800,
25,
46078,
616,
2150,
357,
67,
1820,
2150,
31,
27740,
18013,
13,
785,
8,
220,
198,
17953,
25,
838,
14,
1129,
14,
10531,
198,
198,
16130,
25,
198,
32,
1295,
810,
2... | 2.782626 | 2,544 |
################################################################################
# filename: switch_skill.py
# date: 07. Apr. 2021
# username: winkste
# name: Stephan Wink
# description: This module handles the input signal of a switch.
# In the first implementation it will only support polling of an
# ... | [
29113,
29113,
14468,
198,
2,
29472,
25,
5078,
62,
42401,
13,
9078,
198,
2,
3128,
25,
8753,
13,
2758,
13,
33448,
198,
2,
20579,
25,
41955,
4169,
198,
2,
1438,
25,
20800,
48450,
198,
2,
6764,
25,
770,
8265,
17105,
262,
5128,
6737,
2... | 3.92915 | 494 |
from vyper.utils import GAS_IDENTITY, GAS_IDENTITYWORD
from vyper.exceptions import (
InvalidLiteralException,
TypeMismatchException
)
from vyper.parser.lll_node import (
LLLnode
)
from vyper.types import (
BaseType,
ByteArrayType,
ContractType,
NullType,
StructType,
MappingType,
... | [
6738,
410,
88,
525,
13,
26791,
1330,
402,
1921,
62,
25256,
9050,
11,
402,
1921,
62,
25256,
9050,
54,
12532,
198,
198,
6738,
410,
88,
525,
13,
1069,
11755,
1330,
357,
198,
220,
220,
220,
17665,
43,
270,
1691,
16922,
11,
198,
220,
2... | 2.820331 | 423 |
from __future__ import absolute_import
import random
from six.moves import range
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
4738,
198,
6738,
2237,
13,
76,
5241,
1330,
2837,
628
] | 4.1 | 20 |
from xbeecoord import *
from time import sleep
import multiprocessing
reset()
sleep(5)
getRssi()
sleep(2)
wakeup()
startwait()
'''
def main():
reset()
sleep(5)
getRssi()
sleep(2)
wakeup()
startwait()
if __name__=='__main__':
p = multiprocessing.Process(target=main,name="routine")
p.start()
sleep(300)
p... | [
6738,
2124,
1350,
47704,
585,
1330,
1635,
198,
6738,
640,
1330,
3993,
198,
11748,
18540,
305,
919,
278,
198,
198,
42503,
3419,
198,
42832,
7,
20,
8,
198,
1136,
49,
824,
72,
3419,
198,
42832,
7,
17,
8,
198,
48530,
929,
3419,
198,
9... | 2.414474 | 152 |
##
# @file rulesanml.py
# @author Ankit Srivastava <asrivast@gatech.edu>
#
# Copyright 2018 Georgia Institute of Technology
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | [
2235,
198,
2,
2488,
7753,
3173,
272,
4029,
13,
9078,
198,
2,
2488,
9800,
1052,
15813,
311,
15104,
459,
4170,
1279,
292,
15104,
459,
31,
10494,
354,
13,
15532,
29,
198,
2,
198,
2,
15069,
2864,
7859,
5136,
286,
8987,
198,
2,
198,
2,... | 2.427136 | 1,393 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2003-2009 Edgewall Software
# Copyright (C) 2003-2005 Jonas Borgström <jonas@edgewall.com>
# Copyright (C) 2005 Christopher Lenz <cmlenz@gmx.de>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you sho... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
201,
198,
2,
15069,
357,
34,
8,
5816,
12,
10531,
1717,
39909,
439,
10442,
201,
198,
2,
15069,
357,
34,... | 2.206842 | 5,086 |
# WAP to accept a folder name from user and create zip file out of contents of it.
import shutil
if __name__ == "__main__":
main() | [
2,
370,
2969,
284,
2453,
257,
9483,
1438,
422,
2836,
290,
2251,
19974,
2393,
503,
286,
10154,
286,
340,
13,
198,
11748,
4423,
346,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419
] | 3.214286 | 42 |
# -*- coding: utf-8 -*-
"""
pagarmecoreapi
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class CreatePriceBracketRequest(object):
"""Implementation of the 'CreatePriceBracketRequest' model.
Request for creating a price bracket
Attributes:
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
37811,
201,
198,
220,
220,
220,
42208,
1670,
721,
382,
15042,
201,
198,
201,
198,
220,
220,
220,
770,
2393,
373,
6338,
7560,
416,
3486,
3955,
1404,
2149... | 2.204868 | 986 |
from dataclasses import dataclass, field
from typing import List, AnyStr, Iterator, Any, Dict
import numpy as np
import pandas as pd
from gmpy2 import mpz
@dataclass
class Item:
""" Describes an item of an attribute.
The item is the lowest level representation of the attribute. It is defined by at least one... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
19720,
1330,
7343,
11,
4377,
13290,
11,
40806,
1352,
11,
4377,
11,
360,
713,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738... | 3.147899 | 595 |
'''
Created on Sep 19, 2021
@author: immanueltrummer
'''
import argparse
import collections
import json
import pandas as pd
import sqlite3
def get_db_path(spider_dir, db_id):
""" Return path to SQLite database file.
Args:
spider_dir: path to SPIDER benchmark
db_id: database identifier
... | [
7061,
6,
198,
41972,
319,
8621,
678,
11,
33448,
198,
198,
31,
9800,
25,
545,
805,
84,
2120,
6582,
647,
198,
7061,
6,
198,
11748,
1822,
29572,
198,
11748,
17268,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
44... | 1.928499 | 1,972 |
import mobula.layers as L
import numpy as np
| [
11748,
7251,
4712,
13,
75,
6962,
355,
406,
198,
11748,
299,
32152,
355,
45941,
198
] | 3 | 15 |
# Generated by Django 3.1.7 on 2021-06-01 08:44
from django.conf import settings
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
3312,
12,
486,
8487,
25,
2598,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 3.1 | 40 |
# -*- coding: utf-8 -*-
# vim: set sw=2 ts=2 sts=2 et :
'''Defines a comment
(@@ c.(This is a comment!) x z) -> (x z)
'''
from lambd import *
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
43907,
25,
900,
1509,
28,
17,
40379,
28,
17,
39747,
28,
17,
2123,
1058,
198,
198,
7061,
6,
7469,
1127,
257,
2912,
198,
198,
7,
12404,
269,
12195,
1212,
318,
257,
... | 2.164179 | 67 |
import setuptools
import os
with open("README.md", "r") as fh:
long_description = fh.read()
version = os.popen('git tag -l --sort -version:refname | head -n 1').read().split('\n', 1)[0]
setuptools.setup(
name="sherlockpipe", # Replace with your own username
version=version,
author="F.J. Pozuelos & M. ... | [
11748,
900,
37623,
10141,
198,
11748,
28686,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
9641,
796,
28686,
13,
79,
... | 1.730372 | 968 |
# -*- coding: utf-8 -*-
# flake8: noqa
from . import api
from . import tasks
from . import web
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
781,
539,
23,
25,
645,
20402,
198,
198,
6738,
764,
1330,
40391,
198,
6738,
764,
1330,
8861,
198,
6738,
764,
1330,
3992,
198
] | 2.526316 | 38 |
default_app_config = 'sensor.apps.SmogerConfig'
| [
12286,
62,
1324,
62,
11250,
796,
705,
82,
22854,
13,
18211,
13,
7556,
519,
263,
16934,
6,
198
] | 2.666667 | 18 |
import mongoengine
from mongoengine import fields, Document, ImproperlyConfigured
from creators.models import Creator | [
198,
11748,
285,
25162,
18392,
198,
6738,
285,
25162,
18392,
1330,
7032,
11,
16854,
11,
12205,
525,
306,
16934,
1522,
198,
6738,
16294,
13,
27530,
1330,
21038
] | 4.37037 | 27 |
l = range(8)
print filter(lambda x: x % 2 == 0, l)
# [0, 2, 4, 6]
| [
75,
796,
2837,
7,
23,
8,
198,
198,
4798,
8106,
7,
50033,
2124,
25,
2124,
4064,
362,
6624,
657,
11,
300,
8,
198,
2,
685,
15,
11,
362,
11,
604,
11,
718,
60,
198
] | 1.970588 | 34 |
import unittest
from pystrings.lineup_students import lineup_students
s1 = "Tadashi Takahiro Takao Takashi Takayuki Takehiko Takeo Takeshi Takeshi"
lst1 = [
"Takehiko",
"Takayuki",
"Takahiro",
"Takeshi",
"Takeshi",
"Takashi",
"Tadashi",
"Takeo",
"Takao",
]
s2 = "Michio Miki Mikio... | [
11748,
555,
715,
395,
198,
198,
6738,
12972,
37336,
13,
1370,
929,
62,
19149,
658,
1330,
12750,
62,
19149,
658,
198,
198,
82,
16,
796,
366,
51,
324,
12144,
15804,
993,
7058,
15804,
5488,
15804,
12144,
15804,
323,
11308,
7214,
71,
1212... | 1.912439 | 1,439 |
#@<OUT> CLI --help
The following objects provide command line operations:
cli_tester
CLI Integration Testing Plugin
cluster
Represents an InnoDB cluster.
dba
InnoDB cluster and replicaset management functions.
rs
Represents an InnoDB ReplicaSet.
shell
Gives access to ge... | [
2,
31,
27,
12425,
29,
43749,
1377,
16794,
198,
464,
1708,
5563,
2148,
3141,
1627,
4560,
25,
628,
220,
220,
537,
72,
62,
4879,
353,
198,
220,
220,
220,
220,
220,
43749,
38410,
23983,
42636,
628,
220,
220,
13946,
198,
220,
220,
220,
... | 3.075055 | 1,359 |
# encoding: utf8
#
# This file is part of the Neurons project.
# Copyright (c), Arskom Ltd. (arskom.com.tr),
# Burak Arslan <burak.arslan@arskom.com.tr>.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following... | [
2,
21004,
25,
3384,
69,
23,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
262,
3169,
333,
684,
1628,
13,
198,
2,
15069,
357,
66,
828,
943,
8135,
296,
12052,
13,
357,
945,
74,
296,
13,
785,
13,
2213,
828,
198,
2,
220,
220,
220,
2... | 3.37451 | 510 |
from param import Param
from numpy import zeros, zeros_like, roll
from gmg.hierarchy import Gmg
import fortran_advection as fa
import fortran_operators as fo
import fortran_diag as fd
from fourier import Fourier
| [
6738,
5772,
1330,
25139,
198,
6738,
299,
32152,
1330,
1976,
27498,
11,
1976,
27498,
62,
2339,
11,
4836,
198,
6738,
308,
11296,
13,
71,
959,
9282,
1330,
402,
11296,
198,
11748,
329,
2213,
272,
62,
324,
303,
596,
355,
24685,
198,
11748,... | 3.086957 | 69 |
# -*- coding: utf-8 -*-
import unittest
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
628
] | 2.1 | 20 |
import pandas as pd
import numpy as np
def gini(x):
"""Calculate the Gini coefficient for series of observed values (x).
where:
* x is the array of observed values (and all x are positive, non-zero values)
Note: x must be a numpy array or a pandas series
See: https://www.statsdirect.com/help/def... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4299,
308,
5362,
7,
87,
2599,
198,
220,
220,
220,
37227,
9771,
3129,
378,
262,
402,
5362,
35381,
329,
2168,
286,
6515,
3815,
357,
87,
737,
220,
198,
220,... | 2.552457 | 753 |
#!/usr/bin/env python
# Copyright (c) 2013 Martin Katrenik, Snowplow Analytics Ltd. All rights reserved.
#
# This program is licensed to you under the Apache License Version 2.0,
# and you may not use this file except in compliance with the Apache
# License Version 2.0.
# You may obtain a copy of the Apache License Ve... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
66,
8,
2211,
5780,
8595,
918,
1134,
11,
7967,
489,
322,
30437,
12052,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
1430,
318,
11971,
284,
345,
739,
262,
2484... | 2.990326 | 827 |
import numpy as np
import tensorflow as tf
from scipy.stats import multivariate_normal as normal
class Equation(object):
"""Base class for defining PDE related function."""
def w_tf(self, x, u):
"""Running cost in control problems."""
raise NotImplementedError
def Z_tf(self, x):
"... | [
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
629,
541,
88,
13,
34242,
1330,
1963,
42524,
62,
11265,
355,
3487,
198,
198,
4871,
7889,
341,
7,
15252,
2599,
198,
220,
220,
220,
37227,
14881,
1398,
... | 2.357466 | 663 |
# -*- coding: utf-8 -*-
'''
File Name: handle_config.py
Author: WillDX
mail: xiang.dai@shuyun.com
Created Time: 2016年04月19日 星期二 09时36分58秒
'''
import json
from ConfigParser import ConfigParser
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
8979,
6530,
25,
5412,
62,
11250,
13,
9078,
198,
13838,
25,
2561,
36227,
198,
4529,
25,
2124,
15483,
13,
67,
1872,
31,
1477,
4669,
403,
13,
785,
198,
41... | 2.193182 | 88 |
# coding=utf-8
"""
main script for training and testing mask rcnn on MSCOCO/DIVA/MEVA dataset
multi gpu version
"""
import argparse
import cv2
import math
import json
import random
import operator
import time
import os
import pickle
import sys
import threading
# so here won"t have poll allocator info
os.environ["T... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
220,
1388,
4226,
329,
3047,
290,
4856,
9335,
48321,
20471,
319,
337,
6173,
4503,
46,
14,
33569,
32,
14,
11682,
11731,
27039,
198,
220,
5021,
308,
19944,
2196,
198,
37811,
198,
198,
11748,
... | 2.73561 | 1,581 |
import os
import pandas as pd
from app import app, db
from models.price import Currency
@app.cli.command("import_currency")
def import_currency():
"""
Loads up a provided CSV file of world currencies and extracts the unicode symbol
and text label associated with each currency. Loads these into the Curren... | [
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
598,
1330,
598,
11,
20613,
198,
6738,
4981,
13,
20888,
1330,
20113,
628,
198,
31,
1324,
13,
44506,
13,
21812,
7203,
11748,
62,
34415,
4943,
198,
4299,
1330,
62,
34415... | 2.552703 | 740 |
# License: BSD 3 clause
import numpy as np
| [
2,
13789,
25,
347,
10305,
513,
13444,
201,
198,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198
] | 2.45 | 20 |
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from match.models import Ranking, Match, Game, ParticipantRole, t
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
11,
9455,
12331,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
2872,
13,
27530,
1330,
45407,
11,
13225,
11,
3776,
11,
2... | 3.847826 | 46 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2017 Andrey Antukh <niwi@niwi.nz>
# Copyright (C) 2014-2017 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2017 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014-2017 Alejandro Alonso <alejandro.alonso@kaleidos.net>
# Copyright (C) 2014-2017 Anler Hernández ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
1946,
12,
5539,
843,
4364,
3738,
2724,
71,
1279,
8461,
37686,
31,
8461,
37686,
13,
27305,
29,
198,
2,
15069,
357,
34,
8,
1946,
12,
5539,
4804,
... | 3.303719 | 484 |
import logging
from rssdldmng.utils.restserver import RESTHttpServer
_LOGGER = logging.getLogger(__name__)
| [
11748,
18931,
201,
198,
201,
198,
6738,
374,
824,
67,
335,
76,
782,
13,
26791,
13,
2118,
15388,
1330,
15731,
4221,
29281,
10697,
201,
198,
201,
198,
62,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
201,
198... | 2.577778 | 45 |
"""
Django settings for vimeoct project.
Generated by 'django-admin startproject' using Django 3.2.8.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from dotenv ... | [
37811,
198,
35,
73,
14208,
6460,
329,
410,
524,
38441,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
513,
13,
17,
13,
23,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,... | 2.360042 | 1,897 |
from collections import namedtuple
_VersionInfo = namedtuple("_VersionInfo", "major minor patch")
version_info = _VersionInfo(0, 3, 0)
__version__ = ".".join(str(v) for v in version_info)
__license__ = "MIT"
__author__ = "FalseDev"
__title__ = "discord-ext-wizard"
__copyright__ = "Copyright 2021 {}".format(__author__... | [
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
62,
14815,
12360,
796,
3706,
83,
29291,
7203,
62,
14815,
12360,
1600,
366,
22478,
4159,
8529,
4943,
198,
9641,
62,
10951,
796,
4808,
14815,
12360,
7,
15,
11,
513,
11,
657,
8,
198,
198,
8... | 2.862275 | 167 |
# Copyright (c) 2021, Aakvatech Limited and contributors
# For license information, please see license.txt
# import frappe
from __future__ import unicode_literals
import frappe
import time
import datetime
from frappe.model.document import Document
from frappe import _
import json
from frappe.utils import nowdate
from ... | [
2,
15069,
357,
66,
8,
33448,
11,
317,
461,
85,
40340,
15302,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
2,
1330,
5306,
27768,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,... | 1.875721 | 2,599 |
import argparse
import pathlib
import sys
import torch
import torchaudio
import yaml
import common
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Convert wav to mel spectrogram')
parser.add_argument('wav_dir', type=pathlib.Path, help='path to directory of speaker directories co... | [
11748,
1822,
29572,
198,
11748,
3108,
8019,
198,
11748,
25064,
198,
198,
11748,
28034,
198,
11748,
28034,
24051,
198,
11748,
331,
43695,
198,
198,
11748,
2219,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
... | 2.482014 | 417 |
import pydocweb.docweb.rst as rst
from pydocweb.docweb.utils import *
from pydocweb.docweb.models import *
from views_docstring import EditForm
#------------------------------------------------------------------------------
# Wiki
#------------------------------------------------------------------------------
WIKI_C... | [
11748,
279,
5173,
420,
12384,
13,
15390,
12384,
13,
81,
301,
355,
374,
301,
198,
6738,
279,
5173,
420,
12384,
13,
15390,
12384,
13,
26791,
1330,
1635,
198,
6738,
279,
5173,
420,
12384,
13,
15390,
12384,
13,
27530,
1330,
1635,
198,
198... | 4.107527 | 93 |
import gym
import numpy
import random
import logging
from gym import spaces
from gym.utils import seeding
| [
11748,
11550,
198,
11748,
299,
32152,
198,
11748,
4738,
198,
11748,
18931,
198,
198,
6738,
11550,
1330,
9029,
198,
6738,
11550,
13,
26791,
1330,
384,
8228,
628
] | 4 | 27 |
from datetime import datetime
from .ChromosomeBot import get_or_create
from ..geneprotein import organism_info
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
764,
1925,
398,
418,
462,
20630,
1330,
651,
62,
273,
62,
17953,
198,
6738,
11485,
5235,
538,
35574,
1330,
26433,
62,
10951,
628,
198
] | 3.53125 | 32 |
from django.http import Http404
from django.shortcuts import render
from play.models import Game, Save
| [
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
26429,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
6738,
711,
13,
27530,
1330,
3776,
11,
12793,
628
] | 3.714286 | 28 |
# -*- coding:utf-8 -*-
import shutil
import os
import sys
import subprocess
from platform import system
input_arg = output_arg = None
if __name__ == "__main__":
if system() != 'Linux' and system() != 'Darwin':
print('only linux is supported currently')
else:
main()
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
4423,
346,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
850,
14681,
198,
6738,
3859,
1330,
1080,
198,
198,
15414,
62,
853,
796,
5072,
62,
853,
796,
6045,
628,
6... | 2.740741 | 108 |
"""
To do:
- catch KeyboardInterrupt while evaluating
- show all?
- show statistics
- fix up exception handling; decorator?
"""
import cmd
from church.ast import ParseError
from church.environment import (
UndefinedNameError,
)
from church.eval import (
environment,
reduce,
Suspension,
)
from church.... | [
37811,
198,
2514,
466,
25,
198,
198,
12,
4929,
31973,
9492,
3622,
981,
22232,
198,
12,
905,
477,
30,
198,
12,
905,
7869,
198,
12,
4259,
510,
6631,
9041,
26,
11705,
1352,
30,
198,
198,
37811,
198,
11748,
23991,
198,
198,
6738,
4928,
... | 3.101695 | 177 |
import pytest
from aydin.io.datasets import cropped_newyork
from aydin.it.classic_denoisers.demo.demo_2D_dictionary_fixed import (
demo_dictionary_fixed,
)
from aydin.it.classic_denoisers.demo.demo_2D_dictionary_learned import (
demo_dictionary_learned,
)
from aydin.it.classic_denoisers.dictionary_fixed import... | [
11748,
12972,
9288,
198,
198,
6738,
257,
5173,
259,
13,
952,
13,
19608,
292,
1039,
1330,
48998,
62,
3605,
88,
967,
198,
6738,
257,
5173,
259,
13,
270,
13,
49421,
62,
6559,
10924,
364,
13,
9536,
78,
13,
9536,
78,
62,
17,
35,
62,
... | 2.573964 | 169 |
import pprint
import json
pp = pprint.PrettyPrinter(indent = 4)
if __name__ == '__main__':
pp.pprint(main())
| [
11748,
279,
4798,
198,
11748,
33918,
198,
381,
796,
279,
4798,
13,
35700,
6836,
3849,
7,
521,
298,
796,
604,
8,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
9788,
13,
381,
22272,
7,
12417,
... | 2.533333 | 45 |
# coding:utf-8
restaurant = Restaurant('丽水云泉大酒店', 'duck')
print(restaurant.restaurant_name)
print(restaurant.cuisine_type)
restaurant.describe_restaurant()
restaurant.open_restaurant()
| [
2,
19617,
25,
40477,
12,
23,
628,
198,
2118,
2899,
415,
796,
26078,
10786,
10310,
121,
36365,
112,
12859,
239,
37345,
231,
32014,
165,
227,
240,
41753,
245,
3256,
705,
646,
694,
11537,
198,
4798,
7,
2118,
2899,
415,
13,
2118,
2899,
... | 2.280488 | 82 |
# -*- coding: utf-8 -*-
import os
import h5py
class HDF5(object):
"""HDF5 handler
Offer the hdf5 format file handler
Parameters
---------
fpath : str,
Path of hdf5 file
mode : str,
Open h5 as write and/or read mode
`a` : open as read/write (Default)
`w` : ope... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
289,
20,
9078,
628,
198,
4871,
5572,
37,
20,
7,
15252,
2599,
198,
220,
220,
220,
37227,
39,
8068,
20,
21360,
198,
220,
220,
220,
33085,
... | 2.148087 | 601 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2017-04-06 09:14
from __future__ import unicode_literals
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,
24,
13,
23,
319,
2177,
12,
3023,
12,
3312,
7769,
25,
1415,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.719298 | 57 |
print("Hello World")
########## Edit below this line
# print your name to the console
########## Edit above this line
# Once you've finished save and commit your changes to GitHub | [
4798,
7203,
15496,
2159,
4943,
198,
198,
7804,
2235,
5312,
2174,
428,
1627,
220,
198,
2,
3601,
534,
1438,
284,
262,
8624,
628,
628,
628,
198,
7804,
2235,
5312,
2029,
428,
1627,
198,
2,
4874,
345,
1053,
5201,
3613,
290,
4589,
534,
24... | 4.155556 | 45 |
##CBWitness-EvaluateCallBack Function
import json
import boto3
import os
import datetime
import pytz
import base64
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key
#===============================
| [
2235,
23199,
38670,
12,
36,
2100,
4985,
14134,
7282,
15553,
198,
11748,
33918,
198,
11748,
275,
2069,
18,
198,
11748,
28686,
198,
11748,
4818,
8079,
198,
11748,
12972,
22877,
198,
11748,
2779,
2414,
198,
6738,
10214,
420,
382,
13,
1069,
... | 3.375 | 72 |
import sys, os
sys.path.append(os.getcwd())
import ConfigParser
cp = ConfigParser.ConfigParser();
cp.read('../.environ')
os.environ.update({key.upper():value for key, value in cp.items('env')})
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
| [
11748,
25064,
11,
28686,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
1136,
66,
16993,
28955,
198,
198,
11748,
17056,
46677,
198,
13155,
796,
17056,
46677,
13,
16934,
46677,
9783,
198,
13155,
13,
961,
10786,
492,
11757,
268,
2268,
... | 2.989474 | 95 |
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2022 Osyris contributors (https://github.com/osyris-project/osyris)
from .tools import make_label
import numpy as np
| [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
18,
12,
2601,
682,
198,
2,
15069,
357,
66,
8,
33160,
440,
1837,
2442,
20420,
357,
5450,
1378,
12567,
13,
785,
14,
418,
2417,
271,
12,
16302,
14,
418,
2417,
271,
8,
19... | 2.916667 | 60 |
muster = open("muster.txt", "r")
output = open("output.txt", "r")
mustervals = []
outputvals = []
for line in muster:
a,b,val = line.split(" ")
mustervals.append(int(val))
for line in output:
outputvals.append(int(line))
print len(mustervals)
print len(outputvals)
length = min(len(mustervals), len... | [
76,
5819,
796,
1280,
7203,
76,
5819,
13,
14116,
1600,
366,
81,
4943,
201,
198,
22915,
796,
1280,
7203,
22915,
13,
14116,
1600,
366,
81,
4943,
201,
198,
201,
198,
27238,
712,
874,
796,
17635,
201,
198,
22915,
12786,
796,
17635,
201,
... | 2.38835 | 206 |
"""
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.
https://leetcode.com/problems/longest-valid-parentheses/
"""
test_cases = ["(()", ")()())", "())()()()", "())((())()", "())((()))", "()(()", "))(()))()"]
results = [2, 4, 6, 6, 6,... | [
37811,
198,
15056,
257,
4731,
7268,
655,
262,
3435,
705,
10786,
290,
705,
8,
3256,
1064,
262,
4129,
286,
262,
14069,
4938,
357,
4053,
12,
12214,
8,
46672,
3293,
1806,
13,
198,
198,
5450,
1378,
293,
316,
8189,
13,
785,
14,
1676,
2214... | 2.64898 | 245 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup, find_packages
import shop_subscribe
with open('README.rst') as fd:
README = fd.read()
CLASSIFIERS = [
'Environment :: Web Environment',
'Framework :: Django',
'Intended Audience :: Deve... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62... | 2.635438 | 491 |
from ..base import GnuRecipe
| [
6738,
11485,
8692,
1330,
18509,
84,
37523,
628
] | 3.75 | 8 |
# -*- coding: utf-8 -*-
import math
import numbers
import re
import tenacity
from sqlalchemy import exc, util
from sqlalchemy.engine import Engine, reflection
from sqlalchemy.engine.default import DefaultDialect
from sqlalchemy.exc import NoSuchTableError, OperationalError
from sqlalchemy.sql.compiler import (
DDL... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
10688,
198,
11748,
3146,
198,
11748,
302,
198,
198,
11748,
3478,
4355,
198,
6738,
44161,
282,
26599,
1330,
2859,
11,
7736,
198,
6738,
44161,
282,
26599,
13,
18392,
... | 2.454121 | 643 |
import asyncio
from thispersondoesnotexist import get_online_person, save_online_person
loop = asyncio.get_event_loop()
loop.run_until_complete(main()) | [
11748,
30351,
952,
198,
198,
6738,
428,
19276,
623,
3028,
1662,
38476,
1330,
651,
62,
25119,
62,
6259,
11,
3613,
62,
25119,
62,
6259,
628,
198,
198,
26268,
796,
30351,
952,
13,
1136,
62,
15596,
62,
26268,
3419,
198,
26268,
13,
5143,
... | 3.163265 | 49 |
import tensorflow as tf
import numpy as np
import pytest
from ..lad import lad, lad_polyfit
sess = tf.Session()
true_params = np.array([3, 10])
x = np.linspace(-1, 1, 10000)
y = np.random.laplace(loc=x * true_params[0] + true_params[1], scale=1.)
@pytest.mark.parametrize("yerr", [(None), (np.ones(len(y))), (np.std(... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
6738,
11485,
9435,
1330,
9717,
11,
9717,
62,
35428,
11147,
628,
198,
82,
408,
796,
48700,
13,
36044,
3419,
198,
7942,
62,
37266,
796... | 2.114094 | 298 |
"""Helpers for running a local webserver to receive authorization code."""
import socket
from contextlib import closing
from pydata_google_auth import exceptions
LOCALHOST = "localhost"
DEFAULT_PORTS_TO_TRY = 100
def is_port_open(port):
"""Check if a port is open on localhost.
Based on StackOverflow answ... | [
37811,
12621,
19276,
329,
2491,
257,
1957,
2639,
18497,
284,
3328,
19601,
2438,
526,
15931,
198,
198,
11748,
17802,
198,
6738,
4732,
8019,
1330,
9605,
198,
198,
6738,
279,
5173,
1045,
62,
13297,
62,
18439,
1330,
13269,
628,
198,
29701,
... | 2.644242 | 877 |
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils import timezone
from enumfields import Enum # Uses Ethan Furman's "enum34" backport
from enumfields import EnumField
from sorl.thumbnail import Imag... | [
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
25747,
1330,
42044,
33616,
9218,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
... | 3.862595 | 131 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.0
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | [
2,
770,
2393,
373,
6338,
7560,
416,
12672,
3528,
357,
4023,
1378,
2503,
13,
2032,
328,
13,
2398,
737,
198,
2,
10628,
604,
13,
15,
13,
15,
198,
2,
198,
2,
2141,
407,
787,
2458,
284,
428,
2393,
4556,
345,
760,
644,
345,
389,
1804,... | 2.007196 | 36,548 |
"""
Generator class for some Process-based mixing algorithms.
Copyright 2020 Thomas Jackson Park & Jeremy Pavier
"""
import os
import random
import inspect
from pydub import AudioSegment
from GenerIter.process import Process
from GenerIter.util import debug, nextPowerOf2
import GenerIter.excepts as robox
| [
37811,
198,
8645,
1352,
1398,
329,
617,
10854,
12,
3106,
17090,
16113,
13,
198,
198,
15269,
12131,
5658,
6612,
3250,
1222,
11753,
350,
19492,
198,
198,
37811,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
10104,
198,
6738,
279,
5173,
... | 4 | 77 |
import numpy as np
DT = np.float32
eps = 1e-12
# Globals
components = []
params = []
# Global forward/backward
# Optimization functions
# Values
# Parameters
# Xavier initializer
# Utility function for shape inference with broadcasting
#### Actual components
class Add: # Add with broadcasting
"""... | [
11748,
299,
32152,
355,
45941,
198,
198,
24544,
796,
45941,
13,
22468,
2624,
198,
25386,
796,
352,
68,
12,
1065,
198,
2,
40713,
874,
198,
5589,
3906,
796,
17635,
198,
37266,
796,
17635,
628,
198,
2,
8060,
2651,
14,
1891,
904,
628,
1... | 2.833661 | 2,543 |
import os
import psutil
| [
11748,
28686,
198,
11748,
26692,
22602,
198
] | 3.428571 | 7 |
#
## PyMoira client library
##
## This file contains the utility functions common for multiple modules.
#
import datetime
from .errors import UserError
def convertToMoiraValue(val):
"""Converts data from Python to Moira protocol representation."""
if type(val) == bool:
return '1' if val else '0'
... | [
2,
198,
2235,
9485,
16632,
8704,
5456,
5888,
198,
2235,
198,
2235,
770,
2393,
4909,
262,
10361,
5499,
2219,
329,
3294,
13103,
13,
198,
2,
198,
198,
11748,
4818,
8079,
198,
6738,
764,
48277,
1330,
11787,
12331,
198,
198,
4299,
10385,
2... | 2.639918 | 486 |
import unittest
import base64
from detect_face import lambda_handler
# 顔があると200が返ってくる
# 顔がないと204が返ってくる
# 画像以外のファイルを拡張子を偽ってアップロードしてもダメ
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
2779,
2414,
198,
6738,
4886,
62,
2550,
1330,
37456,
62,
30281,
628,
198,
220,
220,
220,
1303,
16268,
94,
242,
35585,
40948,
25748,
30201,
2167,
35585,
32573,
242,
33180,
28134,
31917,
25748,
628,
220,
2... | 1.604839 | 124 |
import json
from django.core.exceptions import ObjectDoesNotExist
from tastypie import http
from tastypie.bundle import Bundle
from tastypie.exceptions import ImmediateHttpResponse
from tastypie.resources import ModelResource
import commonware.log
import oauth2
from translations.fields import PurifiedField, Translat... | [
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
198,
6738,
14854,
4464,
494,
1330,
2638,
198,
6738,
14854,
4464,
494,
13,
65,
31249,
1330,
25282,
198,
6738,
14854,
4464,
49... | 3.627451 | 102 |
# Generated by Django 3.2.8 on 2021-10-16 07:05
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
23,
319,
33448,
12,
940,
12,
1433,
8753,
25,
2713,
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.818182 | 44 |
'''
Created on 27/02/2013
@author: butler
'''
import json
class JParser(object):
'''
Parser for json config file. As this is designed to be '
'''
def __init__(self, file_name):
'''
'''
self.file_name = file_name
"""
self.delta_t_ms
self.sample_rate
... | [
7061,
6,
198,
41972,
319,
2681,
14,
2999,
14,
6390,
198,
198,
31,
9800,
25,
475,
1754,
198,
7061,
6,
198,
11748,
33918,
628,
198,
4871,
21331,
28198,
7,
15252,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
23042,
263,
3... | 1.931034 | 203 |
import datetime
import pytz
from decimal import Decimal
| [
11748,
4818,
8079,
201,
198,
11748,
12972,
22877,
201,
198,
6738,
32465,
1330,
4280,
4402,
201
] | 3.625 | 16 |
x = 1
y = 'Hello'
z = 10.123
d = x + z
print(d)
print(type(x))
print(type(y))
print(y.upper())
print(y.lower())
print(type(z))
a = [1,2,3,4,5,6,6,7,8]
print(len(a))
print(a.count(6))
b = list(range(10,100,10))
print(b)
stud_marks = {"Madhan":90, "Raj":25,"Mani":80}
print(stud_marks.keys())
print(stud_marks.va... | [
87,
796,
352,
198,
88,
796,
705,
15496,
6,
198,
89,
796,
838,
13,
10163,
198,
198,
67,
796,
2124,
1343,
1976,
198,
4798,
7,
67,
8,
198,
198,
4798,
7,
4906,
7,
87,
4008,
198,
4798,
7,
4906,
7,
88,
4008,
198,
4798,
7,
88,
13,
... | 2 | 209 |
#!/usr/bin/env python
import logging
import socket
import urllib.request
import time
LOGGER = logging.getLogger('mierzyciel.telegram')
if __name__ == '__main__':
fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logging.basicConfig(level='INFO', format=fmt)
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
18931,
198,
11748,
17802,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
640,
198,
198,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
10786,
76,
959,
7357,
979,
417,
... | 2.508621 | 116 |
""" Test utilities. """
import pytest
from aries_staticagent import utils, Message
from aries_staticagent.mtc import (
AUTHCRYPT_AFFIRMED,
AUTHCRYPT_DENIED,
ANONCRYPT_AFFIRMED,
ANONCRYPT_DENIED,
)
@pytest.fixture
def test_preprocess():
"""Test preprocessing decorator."""
@utils.preprocess... | [
37811,
6208,
20081,
13,
37227,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
257,
1678,
62,
12708,
25781,
1330,
3384,
4487,
11,
16000,
198,
6738,
257,
1678,
62,
12708,
25781,
13,
16762,
66,
1330,
357,
198,
220,
220,
220,
37195,
9419,
... | 2.521044 | 1,188 |
import FWCore.ParameterSet.Config as cms
heavyFlavorValidation = cms.EDAnalyzer("HeavyFlavorValidation",
DQMFolder = cms.untracked.string("HLT/HeavyFlavor"),
TriggerProcessName = cms.untracked.string("HLT"),
TriggerPathName = cms.untracked.string("HLT_Mu5"),
TriggerSummaryRAW = cms.untracked.string("hl... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
23701,
7414,
5570,
7762,
24765,
796,
269,
907,
13,
1961,
37702,
9107,
7203,
33210,
7414,
5570,
7762,
24765,
1600,
198,
220,
220,
220,
360,
48,
44,
41092,
796,
2... | 2.268702 | 655 |
"""
Authors: Wouter Van Gansbeke, Simon Vandenhende
Licensed under the CC BY-NC 4.0 license (https://creativecommons.org/licenses/by-nc/4.0/)
"""
import os
import yaml
from easydict import EasyDict
from utils.utils import mkdir_if_missing
| [
37811,
198,
30515,
669,
25,
370,
39605,
6656,
402,
504,
1350,
365,
11,
11288,
35464,
268,
15631,
68,
198,
26656,
15385,
739,
262,
12624,
11050,
12,
7792,
604,
13,
15,
5964,
357,
5450,
1378,
20123,
425,
9503,
684,
13,
2398,
14,
677,
... | 2.879518 | 83 |
from __future__ import print_function
from __future__ import division
from . import _C
import matplotlib.pyplot as plt
import numpy as np
from copy import copy, deepcopy
EXTENDED_PERCENT = 0.1
############################################################################################################################... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
764,
1330,
4808,
34,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
... | 6.648649 | 74 |
##########################################################################
# Copyright (c) 2017-2018 Bertrand Néron. All rights reserved. #
# Use of this source code is governed by a BSD-style license that can be #
# found in the LICENSE file. #
###############... | [
29113,
29113,
7804,
2235,
198,
2,
15069,
357,
66,
8,
2177,
12,
7908,
22108,
25192,
399,
2634,
1313,
13,
1439,
2489,
10395,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1303,
198,
2,
5765,
286,
428... | 2.853165 | 395 |
import utils
from sklearn.model_selection import train_test_split
import lsh_random_projection as LSH
import pickle
build_model()
with open('lsh.pkl', 'rb') as input:
lsh = pickle.load(input)
# lsh.get()
| [
11748,
3384,
4487,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
11748,
300,
1477,
62,
25120,
62,
16302,
295,
355,
406,
9693,
198,
11748,
2298,
293,
628,
628,
198,
11249,
62,
19849,
3419,
198,
198... | 2.646341 | 82 |
# Example of applying VGG16 classifier
# Based on Keras book sec 5.4.3.
from keras.applications.vgg16 import VGG16
from keras.applications.vgg16 import preprocess_input, decode_predictions
from keras.preprocessing import image
#import matplotlib.pyplot as plt
import numpy as np
#import urllib
#from keras.application... | [
2,
17934,
286,
11524,
569,
11190,
1433,
1398,
7483,
198,
2,
13403,
319,
17337,
292,
220,
1492,
792,
642,
13,
19,
13,
18,
13,
198,
198,
6738,
41927,
292,
13,
1324,
677,
602,
13,
85,
1130,
1433,
1330,
569,
11190,
1433,
198,
6738,
41... | 2.574132 | 1,268 |
from .web_requests import safeGet
| [
6738,
764,
12384,
62,
8897,
3558,
1330,
3338,
3855,
628,
628,
628,
220,
220,
220,
220,
198
] | 2.588235 | 17 |