content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from rest_framework.authentication import TokenAuthentication
from .utils import get_object_from_setting
Token = get_object_from_setting("api_token_class")
class TokenAuthentication(TokenAuthentication):
"""DRF authentication backend for API requests.
Parses headers like "Authorization: Bearer user-api-to... | [
6738,
1334,
62,
30604,
13,
41299,
3299,
1330,
29130,
47649,
3299,
198,
198,
6738,
764,
26791,
1330,
651,
62,
15252,
62,
6738,
62,
33990,
628,
198,
30642,
796,
651,
62,
15252,
62,
6738,
62,
33990,
7203,
15042,
62,
30001,
62,
4871,
4943... | 3.482955 | 176 |
# -*- coding: utf-8 -*-
"""Convenience wrapper function to simplify the interface to launch a :class:`aiida_shell.ShellJob` job."""
from __future__ import annotations
import logging
import pathlib
import tempfile
import typing as t
from aiida.common import exceptions
from aiida.engine import run_get_node
from aiida.o... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
3103,
574,
1240,
29908,
2163,
284,
30276,
262,
7071,
284,
4219,
257,
1058,
4871,
25,
63,
1872,
3755,
62,
29149,
13,
23248,
33308,
63,
1693,
526,
15931,
198,
6738,... | 2.83238 | 2,273 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on October 17, 2019
@author: pashaa@mskcc.org
'''
import pytest
from luna_core.common.config import ConfigSet
from luna_core.common.utils import get_absolute_path
@pytest.fixture(autouse=True)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
41972,
319,
3267,
1596,
11,
13130,
198,
198,
31,
9800,
25,
279,
1077,
7252,
31,
907,
74,
535,
13,
239... | 2.578431 | 102 |
# coding: utf8
import flask
# from flask import request, flash, redirect, url_for, render_template
from . import utils
bp = flask.Blueprint('home', __name__)
@bp.route('/tmp/<path:path>')
#@models.db_session
@bp.route('/')
| [
2,
19617,
25,
3384,
69,
23,
198,
198,
11748,
42903,
198,
2,
422,
42903,
1330,
2581,
11,
7644,
11,
18941,
11,
19016,
62,
1640,
11,
8543,
62,
28243,
198,
198,
6738,
764,
1330,
3384,
4487,
198,
198,
46583,
796,
42903,
13,
14573,
4798,
... | 2.714286 | 84 |
import torch
| [
11748,
28034,
628
] | 4.666667 | 3 |
expected_output = {
"version": {
"build_time": "10:29:46 Nov 11, 2020",
"firmware_ver": "20.2.2a",
"install_time": "05:00:38 Nov 28, 2020",
"primary_ver": "20.2.2a",
"secondary_ver": "20.2.2a",
"system_uptime": "30days 18hrs 5mins 39secs",
}
}
| [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
366,
9641,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
11249,
62,
2435,
1298,
366,
940,
25,
1959,
25,
3510,
5267,
1367,
11,
12131,
1600,
198,
220,
220,
220,
220,
220,
2... | 1.875 | 160 |
# Copyright 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 writing, ... | [
2,
15069,
12131,
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,
743,
733... | 3.358663 | 987 |
# minigrid hotfix
import importlib
from functools import wraps
from ..plotting import ImageViewer
patch_MiniGridEnv_render()
| [
2,
949,
3692,
312,
3024,
13049,
198,
11748,
1330,
8019,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
6738,
11485,
29487,
889,
1330,
7412,
7680,
263,
628,
628,
198,
17147,
62,
39234,
41339,
4834,
85,
62,
13287,
3419,
198
] | 3.25 | 40 |
import json
import hashlib
import re
import os
import uuid
import time
from binascii import hexlify
from .service import BaseService
import logging
log = logging.getLogger(__name__)
name_re = re.compile('^[a-zA-Z0-9 ]+$')
| [
11748,
33918,
198,
11748,
12234,
8019,
198,
11748,
302,
198,
11748,
28686,
198,
11748,
334,
27112,
198,
11748,
640,
198,
6738,
9874,
292,
979,
72,
1330,
17910,
75,
1958,
198,
198,
6738,
764,
15271,
1330,
7308,
16177,
198,
198,
11748,
18... | 2.777778 | 81 |
from pathlib import Path
from shutil import Error
from unittest.mock import mock_open, patch
import gdk.common.utils as utils
import pytest
from gdk.common.exceptions import error_messages
json_values = {
"component_name": "component_name",
"component_build_config": {"build_system": "zip"},
"component_ver... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
4423,
346,
1330,
13047,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
15290,
62,
9654,
11,
8529,
198,
198,
11748,
308,
34388,
13,
11321,
13,
26791,
355,
3384,
4487,
198,
11748,
12972,
9288,
198... | 2.442424 | 660 |
#CODE6---To filter the file of adverse events and prepare a file list of file name----
#Python 3.6.5 |Anaconda, Inc.
import os
import csv
import glob
import xml.etree.ElementTree as ET
path = '/home/16AT72P01/EstimateFile/CLINICALOUTPUT2/interventionstudy1/*.xml'
files = glob.glob(path)
count = 0
count1 = 0
count2 = ... | [
2,
34,
16820,
21,
6329,
2514,
8106,
262,
2393,
286,
12681,
2995,
290,
8335,
257,
2393,
1351,
286,
2393,
1438,
650,
198,
2,
37906,
513,
13,
21,
13,
20,
930,
2025,
330,
13533,
11,
3457,
13,
198,
198,
11748,
28686,
198,
11748,
269,
2... | 2.354402 | 443 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-01-16 17:01
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import uuid
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
22,
319,
2864,
12,
486,
12,
1433,
1596,
25,
486,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.74026 | 77 |
from xbmcswift2 import Plugin, xbmcgui
from resources.lib import mainaddon
plugin = Plugin()
url1 = "https://podsync.net/gIEvlBlmF" #VIDEO-TOP
url2 = "https://podsync.net/osd5x8mk_" #VIDEO-ENV
url3 = "https://podsync.net/BW7tx8dZ6" #VIDEO-INT
url4 = "https://podsync.net/ucxW18dZ_" #VIDEO-US-POL
url5 = "https:/... | [
6738,
2124,
20475,
66,
2032,
2135,
17,
1330,
42636,
11,
2124,
20475,
66,
48317,
201,
198,
6738,
4133,
13,
8019,
1330,
1388,
48078,
201,
198,
201,
198,
33803,
796,
42636,
3419,
201,
198,
6371,
16,
796,
366,
5450,
1378,
33320,
27261,
13... | 2.188256 | 579 |
#!/usr/bin/python
# coding=utf-8
###############################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import patch
from diamond.collector import Collector
from onewire import OneWireCollector
####... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
19617,
28,
40477,
12,
23,
198,
198,
29113,
29113,
7804,
4242,
21017,
198,
198,
6738,
1332,
1330,
17573,
14402,
20448,
198,
6738,
1332,
1330,
651,
62,
33327,
273,
62,
11250,
198,
6738,
1332... | 4.915888 | 107 |
import numpy as np
import os
import h5py
from tqdm import tqdm
import random
import csv
import sys
sys.path.append('..')
import mel_features
import vggish_params
import vggish_input
shuffle_data = True
shuffle_train = False
train_split = 0.8
val_split = 0.1
test_split = 0.1
num_classes = 4
# File search utility fu... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
289,
20,
9078,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
4738,
220,
198,
11748,
269,
21370,
198,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,... | 2.3086 | 2,035 |
from rest_framework import permissions, response, status, views, viewsets
from cbt.authentication import JWTAuthentication
from core.models import Exam, Result
from .serializers import (
ExamSerializerwithQuestions,
ResultSerializer, ExamSerializer
)
class ExamsListAPIView(views.APIView):
'''... | [
6738,
1334,
62,
30604,
1330,
21627,
11,
2882,
11,
3722,
11,
5009,
11,
5009,
1039,
198,
198,
6738,
269,
18347,
13,
41299,
3299,
1330,
449,
54,
5603,
315,
6925,
3299,
198,
6738,
4755,
13,
27530,
1330,
35909,
11,
25414,
198,
6738,
764,
... | 3.235955 | 267 |
import os
| [
11748,
28686,
628
] | 3.666667 | 3 |
from abc import ABC, abstractmethod
from typing import Any, Type, TypeVar
from taskcat._config import Config
T = TypeVar("T", bound="Test") # pylint: disable=invalid-name
class Test(ABC):
"""Abstract Test class the forces subclasses to implement
a run method to be called to start a test run and a clean_up
... | [
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
19720,
1330,
4377,
11,
5994,
11,
5994,
19852,
198,
198,
6738,
4876,
9246,
13557,
11250,
1330,
17056,
198,
198,
51,
796,
5994,
19852,
7203,
51,
1600,
5421,
2625,
14402,
4943,
220,
... | 2.842217 | 469 |
from __future__ import annotations
from abc import ABCMeta, abstractmethod
from typing import Dict | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
6738,
19720,
1330,
360,
713
] | 4.454545 | 22 |
# Copyright 2020 EPAM Systems
#
# 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 writin... | [
2,
220,
15069,
12131,
14724,
2390,
11998,
198,
2,
198,
2,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
... | 2.893939 | 528 |
import sys
import gym
import torch
import pylab
import random
import numpy as np
from collections import deque
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.autograd import Variable
from torchvision import transforms
from prioritized_memory import Memory
EPISODES = 500
#... | [
11748,
25064,
198,
11748,
11550,
198,
11748,
28034,
198,
11748,
279,
2645,
397,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
390,
4188,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
... | 2.382467 | 1,289 |
"""Displays the word of the BDFL."""
from discord.ext import commands
ZEN_OF_PYTHON = """
HEREIN LIES THE WORD OF THE BDFL (as told by Tim Peters):
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse i... | [
37811,
7279,
26024,
262,
1573,
286,
262,
28023,
3697,
526,
15931,
198,
198,
6738,
36446,
13,
2302,
1330,
9729,
628,
198,
57,
1677,
62,
19238,
62,
47,
56,
4221,
1340,
796,
37227,
198,
39,
9338,
1268,
406,
11015,
3336,
370,
12532,
3963,... | 3.862205 | 254 |
from sanic import Sanic
from sanic.response import json
from sanic.response import text
app = Sanic(__name__)
@app.middleware
@app.middleware('response')
@app.middleware('request')
@app.middleware('response')
@app.route('/')
if __name__ == "__main__":
app.run(host="0.0.0.0", port=8000)
| [
6738,
5336,
291,
1330,
2986,
291,
198,
6738,
5336,
291,
13,
26209,
1330,
33918,
198,
6738,
5336,
291,
13,
26209,
1330,
2420,
198,
198,
1324,
796,
2986,
291,
7,
834,
3672,
834,
8,
198,
198,
31,
1324,
13,
27171,
1574,
198,
198,
31,
... | 2.614035 | 114 |
from pathlib import Path
from decouple import AutoConfig
from django.core.management.base import BaseCommand
from core.models import User
BASE_DIR = Path(__file__).resolve().parent.parent.parent.parent
config = AutoConfig(search_path=BASE_DIR)
admin = config("ADMIN")
admin_email = config("ADMIN_EMAIL")
ad... | [
6738,
3108,
8019,
1330,
10644,
201,
198,
201,
198,
6738,
875,
43846,
1330,
11160,
16934,
201,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
201,
198,
201,
198,
6738,
4755,
13,
27530,
1330,
11787,
201,
198,
... | 2.97541 | 122 |
max_running_time = 15 * 60
check_cards_remains_interval = 5 * 60
# @games = {
# id: @game,
# ...
# }
# @game = {
# cards_remain: int
# played_time: int
# name: str
# }
# calls per second. this should implement as a async-generator.
| [
9806,
62,
20270,
62,
2435,
796,
1315,
1635,
3126,
198,
9122,
62,
27761,
62,
2787,
1299,
62,
3849,
2100,
796,
642,
1635,
3126,
198,
2,
2488,
19966,
796,
1391,
198,
2,
220,
220,
4686,
25,
2488,
6057,
11,
198,
2,
220,
220,
2644,
198,... | 2.469388 | 98 |
import argparse
import yaml
| [
11748,
1822,
29572,
198,
11748,
331,
43695,
628
] | 3.625 | 8 |
import argparse
import sys
import os
import pprint
import array
import struct
if __name__ == '__main__':
main()
| [
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
279,
4798,
198,
11748,
7177,
198,
11748,
2878,
628,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
124... | 2.627451 | 51 |
from .general import *
from .general import __all__ as gen_all
import torch
import torch.nn as nn
import torchvision.transforms as torch_transforms
import torchvision
import maruti.torch as mtorch
import maruti.deepfake.dataset as mdata
import maruti
import maruti.deepfake as mfake
import numpy as np
import cv2
import ... | [
6738,
764,
24622,
1330,
1635,
198,
6738,
764,
24622,
1330,
11593,
439,
834,
355,
2429,
62,
439,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
10178,
13,
7645,
23914,
355,
28034,
62,
7645,
23914,
198,
... | 2.796226 | 265 |
# Copyright 2017 Battelle Energy Alliance, 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 t... | [
2,
15069,
2177,
12350,
13485,
6682,
10302,
11,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,... | 2.647214 | 3,410 |
"""
Performs Optical Character Recognition on a directory of images
Using Tesseract
For Windows:
-install Tesseract from UB Mannheim, add appropriate languages, adjust binary path below
-pip install pytesseract
"""
import cv2
import pytesseract
import numpy as np
import os
# set up the path to the binary... | [
37811,
201,
198,
5990,
23914,
49593,
15684,
31517,
653,
319,
257,
8619,
286,
4263,
201,
198,
12814,
39412,
263,
529,
201,
198,
1890,
3964,
25,
201,
198,
12,
17350,
39412,
263,
529,
422,
471,
33,
20291,
9096,
11,
751,
5035,
8950,
11,
... | 2.503049 | 656 |
#!/usr/bin/python
import random
import logging
from messages import Upload, Request
from util import even_split
from peer import Peer
import pdb
debug = True
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
4738,
198,
11748,
18931,
198,
198,
6738,
6218,
1330,
36803,
11,
19390,
198,
6738,
7736,
1330,
772,
62,
35312,
198,
6738,
12720,
1330,
41139,
198,
198,
11748,
279,
9945,
198,
24442,
... | 3.681818 | 44 |
# Generated by Django 3.0.3 on 2020-08-17 06:54
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
18,
319,
12131,
12,
2919,
12,
1558,
9130,
25,
4051,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from random import randint
import requests
from django.conf import settings
from elm_finder.celery import app
@app.task
| [
6738,
4738,
1330,
43720,
600,
198,
198,
11748,
7007,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
1288,
76,
62,
22805,
13,
7015,
88,
1330,
598,
628,
198,
31,
1324,
13,
35943,
198
] | 3.514286 | 35 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 3.438849 | 139 |
#!/usr/bin/env python3
# Helper script to publish sample message to SQS queue
import yaml
import boto3
import sys
import json
if len(sys.argv) < 1:
print ('usage: process-queue.py')
sys.exit(1)
# Load config file
config = None
with open("config.yml", "r") as stream:
try:
config = list(yaml.load_all(stream))[0]
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
5053,
525,
4226,
284,
7715,
6291,
3275,
284,
49747,
50,
16834,
198,
11748,
331,
43695,
198,
11748,
275,
2069,
18,
198,
11748,
25064,
198,
11748,
33918,
198,
198,
361,
18896,
7,
... | 2.757455 | 1,006 |
import os
from subprocess import CalledProcessError, check_output
from hammer.util import abort, as_str
from .base import BaseVcs
| [
11748,
28686,
198,
6738,
850,
14681,
1330,
34099,
18709,
12331,
11,
2198,
62,
22915,
198,
198,
6738,
15554,
13,
22602,
1330,
15614,
11,
355,
62,
2536,
198,
198,
6738,
764,
8692,
1330,
7308,
53,
6359,
628
] | 3.694444 | 36 |
"""
scaffoldgraph.io
"""
from .dataframe import read_dataframe
from .sdf import read_sdf
from .smiles import read_smiles_file
__all__ = ['read_sdf', 'read_smiles_file', 'read_dataframe']
| [
37811,
198,
1416,
2001,
727,
34960,
13,
952,
198,
37811,
198,
198,
6738,
764,
7890,
14535,
1330,
1100,
62,
7890,
14535,
198,
6738,
764,
82,
7568,
1330,
1100,
62,
82,
7568,
198,
6738,
764,
5796,
2915,
1330,
1100,
62,
5796,
2915,
62,
... | 2.7 | 70 |
from binance_trading_bot import utilities, visual, indicator
import matplotlib.pyplot as plt
plt.style.use('classic')
from matplotlib.ticker import FormatStrFormatter
import matplotlib.patches as mpatches
import math | [
6738,
9874,
590,
62,
2213,
4980,
62,
13645,
1330,
20081,
11,
5874,
11,
16916,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
489,
83,
13,
7635,
13,
1904,
10786,
49421,
11537,
198,
6738,
2603,
29487,
8019,
13,
83,
... | 3.428571 | 63 |
import unittest
import samo_tidy.checker.clang_warning_checker as clang_warning_checker
import samo_tidy.core.tu_parser as tu_parser
import samo_tidy.test.test_support as test_support
if __name__ == "__main__":
test_support.default_test_setup()
| [
11748,
555,
715,
395,
198,
198,
11748,
6072,
78,
62,
83,
19325,
13,
9122,
263,
13,
565,
648,
62,
43917,
62,
9122,
263,
355,
537,
648,
62,
43917,
62,
9122,
263,
198,
11748,
6072,
78,
62,
83,
19325,
13,
7295,
13,
28047,
62,
48610,
... | 2.72043 | 93 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-06-01 16:12
from __future__ import unicode_literals
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1065,
319,
2864,
12,
3312,
12,
486,
1467,
25,
1065,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.709091 | 55 |
# Copyright 2020 Kilian Swannet, San Kilkis
# 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,
12131,
19902,
666,
2451,
1236,
316,
11,
2986,
19902,
74,
271,
198,
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,
... | 2.711111 | 675 |
# -*- coding: utf-8 -*-
# Copyright 2018 GIG Technology NV
#
# 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... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2864,
402,
3528,
8987,
23973,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
7... | 3.343558 | 326 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 3.358974 | 117 |
import os
from flask import Flask, request, redirect, url_for, render_template, send_from_directory
from werkzeug import secure_filename
UPLOAD_FOLDER = 'uploads/'
ALLOWED_EXTENSIONS = set(['m'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
app.config['MAX_CONTENT_LENGTH'] = 16*1024*1024
@app.r... | [
11748,
28686,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
18941,
11,
19016,
62,
1640,
11,
8543,
62,
28243,
11,
3758,
62,
6738,
62,
34945,
198,
6738,
266,
9587,
2736,
1018,
1330,
5713,
62,
34345,
198,
198,
52,
6489,
41048,
62,
37,
3... | 2.578947 | 171 |
"""
Demo of the new boxplot functionality
"""
import numpy as np
import matplotlib.pyplot as plt
# fake data
np.random.seed(937)
data = np.random.lognormal(size=(37, 4), mean=1.5, sigma=1.75)
labels = list('ABCD')
fs = 10 # fontsize
# demonstrate how to toggle the display of different elements:
fig, axes = plt.subpl... | [
37811,
198,
11522,
78,
286,
262,
649,
3091,
29487,
11244,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
2,
8390,
1366,
198,
37659,
13,
25120,
13,
28826,
7,
24,
... | 2.349956 | 1,143 |
from __future__ import annotations
import abc
from pathlib import Path
from typing import *
import yaml
M = TypeVar('M', bound='DirSerializableModel') # pylint: disable=invalid-name
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
11748,
450,
66,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
1635,
198,
198,
11748,
331,
43695,
628,
198,
44,
796,
5994,
19852,
10786,
44,
3256,
5421,
11639,
35277,
32634,
1... | 3.357143 | 56 |
# Implementation of 99% fault tolerant consensus as decribed by Leslie Lamport
# on page 391 of https://people.eecs.berkeley.edu/~luca/cs174/byzantine.pdf
import random
TIMEOUT = 10
LATENCY = 5
# Network simulator
# A node in the network (not including the "commander")
# Upon receiving a message...
if __name_... | [
2,
46333,
286,
7388,
4,
8046,
33435,
11529,
355,
875,
8725,
416,
26909,
10923,
634,
198,
2,
319,
2443,
5014,
16,
286,
3740,
1378,
15332,
13,
68,
721,
82,
13,
527,
13490,
13,
15532,
14,
93,
75,
43120,
14,
6359,
22985,
14,
1525,
89,... | 3.079646 | 113 |
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import gridspec
from utils.trainer import Trainer
from utils.helper import Save_Handle, AverageMeter
import os
import sys
import time
import torch
from tensorboardX import SummaryWriter
import torch.nn.functional as F
from torch imp... | [
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
10786,
46384,
11537,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
1330,
50000,
43106,
198,
6738,
3384,
4487,
13,
2213,
10613,
1330,... | 3.156134 | 269 |
"""Logging and messaging utilities.
"""
import sys
from datetime import datetime
from pathlib import Path
from typing import Union
from . import color as co
from .schema import ResolvedDotfile
OK = "🗹 "
NOT_OK = "🗷 "
PathLike = Union[str, Path]
def path(path_: PathLike) -> str:
"""A string describing a path... | [
37811,
11187,
2667,
290,
19925,
20081,
13,
198,
37811,
198,
198,
11748,
25064,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4479,
198,
198,
6738,
764,
1330,
3124,
355,
763,
198,
67... | 2.280134 | 896 |
maior = 0
menor = 0
aux = 0
for i in range(1, 5 + 1):
peso = float(input('Digite seu peso: '))
if aux == 0:
maior = peso
menor = peso
aux += 1
elif peso > maior:
maior = peso
elif peso < menor:
menor = peso
print('O maior peso é: {:.2f}Kg'.format(maior))
prin... | [
2611,
1504,
796,
657,
198,
3653,
273,
796,
657,
198,
14644,
796,
657,
198,
198,
1640,
1312,
287,
2837,
7,
16,
11,
642,
1343,
352,
2599,
198,
220,
220,
220,
32317,
78,
796,
12178,
7,
15414,
10786,
19511,
578,
384,
84,
32317,
78,
25... | 1.920635 | 189 |
import os
# Split sherlock data in different sessions
from glob import glob
import numpy as np
from joblib import Parallel, delayed
from nilearn.image import index_img, load_img
from nilearn.input_data import NiftiMasker
fetch_file(
"http://cogspaces.github.io/assets/data/hcp_mask.nii.gz",
"./data/hcp_mas... | [
11748,
28686,
198,
198,
2,
27758,
15059,
5354,
1366,
287,
1180,
10991,
198,
6738,
15095,
1330,
15095,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1693,
8019,
1330,
42945,
11,
11038,
198,
198,
6738,
299,
576,
1501,
13,
9060,
1330... | 2.235149 | 404 |
import sys
import numpy as np
from ingenialink.ethernet.network import EthernetNetwork, NET_TRANS_PROT
from ingenialink.ethercat.network import EthercatNetwork
if __name__ == '__main__':
monitoring_example()
sys.exit(0)
| [
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
27016,
498,
676,
13,
316,
2881,
316,
13,
27349,
1330,
31903,
26245,
11,
30502,
62,
5446,
15037,
62,
4805,
2394,
198,
6738,
27016,
498,
676,
13,
6750,
9246,
13,
27349,
1330,
... | 3.066667 | 75 |
# -*- coding: utf-8 -*-
from django.contrib.auth import authenticate, login
from django.shortcuts import redirect
from django.views.generic import FormView, TemplateView
from userprofiles.settings import up_settings
from userprofiles.utils import get_form_class
registration = RegistrationView.as_view()
registratio... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
11,
17594,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
198,
6738,
42625,
14208,
13,
33571,
13,
... | 3.572816 | 103 |
from operator import add
import unittest
from jsonbender import Context, K, S, bend
from jsonbender.list_ops import Forall, FlatForall, Filter, ListOp, Reduce
from jsonbender.test import BenderTestMixin
if __name__ == '__main__':
unittest.main()
| [
6738,
10088,
1330,
751,
198,
11748,
555,
715,
395,
198,
198,
6738,
33918,
45666,
1330,
30532,
11,
509,
11,
311,
11,
19396,
198,
6738,
33918,
45666,
13,
4868,
62,
2840,
1330,
1114,
439,
11,
21939,
1890,
439,
11,
25853,
11,
7343,
18257,... | 3.197531 | 81 |
from bot.daemons.update_data import UpdateData
from bot.daemons.update_status import UpdateStatus
from bot.daemons.update_topgg import UpdateTopGG | [
6738,
10214,
13,
6814,
368,
684,
13,
19119,
62,
7890,
1330,
10133,
6601,
198,
6738,
10214,
13,
6814,
368,
684,
13,
19119,
62,
13376,
1330,
10133,
19580,
198,
6738,
10214,
13,
6814,
368,
684,
13,
19119,
62,
4852,
1130,
1330,
10133,
912... | 3.395349 | 43 |
import numpy as np
from scipy import stats
import sklearn.metrics as skl_metrics
from sklearn.utils.extmath import row_norms, safe_sparse_dot
from Orange.distance import _distance
from Orange.statistics import util
from .base import (
Distance,
DistanceModel,
FittedDistance,
FittedDistanceModel,
S... | [
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
1330,
9756,
198,
11748,
1341,
35720,
13,
4164,
10466,
355,
1341,
75,
62,
4164,
10466,
198,
6738,
1341,
35720,
13,
26791,
13,
2302,
11018,
1330,
5752,
62,
27237,
82,
11,
3338,
62,... | 2.166471 | 5,106 |
from dwave_networkx.algorithms.tsp import traveling_salesperson_qubo
import dwave_networkx as dnx
import networkx as nx
import numpy as np
import dimod
from random import SystemRandom
random = SystemRandom()
def generate_QUBO_problem(S):
"""
Generate a QUBO problem (The number partitioning problem) from a ... | [
6738,
288,
19204,
62,
27349,
87,
13,
282,
7727,
907,
13,
912,
79,
1330,
11300,
62,
82,
2040,
6259,
62,
421,
2127,
198,
11748,
288,
19204,
62,
27349,
87,
355,
288,
77,
87,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
299,
32152,... | 2.051546 | 582 |
from django.views.generic import ListView, DetailView, UpdateView
from .models import CheckModel
| [
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
7343,
7680,
11,
42585,
7680,
11,
10133,
7680,
198,
198,
6738,
764,
27530,
1330,
6822,
17633,
628,
628,
198
] | 3.777778 | 27 |
from .trainset import TrainSet, MatrixTrainSet
from .testset import TestSet
from .reader import Reader
__all__ = ['TrainSet',
'MatrixTrainSet',
'TestSet',
'Reader']
| [
6738,
764,
2213,
1299,
316,
1330,
16835,
7248,
11,
24936,
44077,
7248,
198,
6738,
764,
9288,
2617,
1330,
6208,
7248,
198,
6738,
764,
46862,
1330,
25342,
198,
198,
834,
439,
834,
796,
37250,
44077,
7248,
3256,
198,
220,
220,
220,
220,
... | 2.426829 | 82 |
from django.db import models
from airtech.helpers.id_generator import id_gen
from airtech.models import BaseModel
class Flight(BaseModel):
'''
Handles creation of flights
'''
plane_category = models.CharField(max_length=255)
flight_no = models.CharField(
db_index=True, max_length=100, uni... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
1633,
13670,
13,
16794,
364,
13,
312,
62,
8612,
1352,
1330,
4686,
62,
5235,
198,
6738,
1633,
13670,
13,
27530,
1330,
7308,
17633,
628,
198,
4871,
13365,
7,
14881,
17633,
2599,
... | 2.770213 | 235 |
# Generated by Django 3.0.7 on 2020-07-01 14:59
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
2998,
12,
486,
1478,
25,
3270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from __future__ import print_function
import os
from . import shutitfile
| [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
6738,
764,
1330,
4423,
270,
7753,
198
] | 3.842105 | 19 |
class LorisException(Exception):
"""Base exception class for all errors raised by Loris."""
pass
class ConfigError(LorisException):
"""Raised for errors in the user config."""
pass
| [
4871,
26068,
271,
16922,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
6631,
1398,
329,
477,
8563,
4376,
416,
26068,
271,
526,
15931,
198,
220,
220,
220,
1208,
628,
628,
628,
628,
198,
4871,
17056,
12331,
7,
43,
37279,
16922,
2599... | 3.253968 | 63 |
import numpy
import pandas
import datetime
import sys
import time
import matplotlib.pyplot as ma
import statsmodels.tsa.seasonal as st
import statsmodels.tsa.arima_model as arima
import statsmodels.tsa.stattools as tools
"""
Load time series from CSV file, parse date times and
select column with values.
"... | [
11748,
299,
32152,
201,
198,
11748,
19798,
292,
201,
198,
11748,
4818,
8079,
201,
198,
11748,
25064,
201,
198,
11748,
640,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
17266,
201,
198,
11748,
9756,
27530,
13,
912,
64,
13,
... | 2.973373 | 338 |
import numpy as np
import nifty.graph.agglo as nagglo
from vigra.analysis import relabelConsecutive
from .features import (compute_rag, compute_affinity_features,
compute_boundary_mean_and_length, project_node_labels_to_pixels)
from .watershed import apply_size_filter
def mala_clustering(graph,... | [
11748,
299,
32152,
355,
45941,
198,
11748,
47803,
13,
34960,
13,
363,
4743,
78,
355,
299,
363,
4743,
78,
198,
6738,
10539,
430,
13,
20930,
1330,
823,
9608,
3103,
4552,
425,
198,
6738,
764,
40890,
1330,
357,
5589,
1133,
62,
22562,
11,
... | 2.271909 | 2,556 |
"""
PyTorchでMNISTを学習させる
:summary PyTorchで単純な多層パーセプトロンを構築してみる
:author RightCode Inc. (https://rightcode.co.jp)
"""
import torch
import torch.nn.functional as f
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
import matplotlib.pyplot as plt
if __name__ == '__main__':
... | [
37811,
198,
20519,
15884,
354,
30640,
39764,
8808,
31758,
27764,
99,
163,
123,
240,
43357,
2515,
249,
25748,
198,
220,
198,
25,
49736,
220,
220,
9485,
15884,
354,
30640,
39355,
246,
163,
112,
242,
26945,
13783,
248,
161,
109,
97,
32546,... | 1.697895 | 1,473 |
from tools import constants, utils
HASH = constants.ALPHA
DAEMON = constants.ALPHA_DAEMON
PARAMETERS = constants.ALPHA_PARAMETERS
FOLDER = constants.ALPHA_FOLDER
PREV_HASH = constants.HTALENT
PREV_DAEMON = constants.HTALENT_DAEMON
PREV_PARAMETERS = constants.HTALENT_PARAMETERS
| [
6738,
4899,
1330,
38491,
11,
3384,
4487,
198,
198,
39,
11211,
796,
38491,
13,
1847,
47,
7801,
198,
5631,
3620,
1340,
796,
38491,
13,
1847,
47,
7801,
62,
5631,
3620,
1340,
198,
27082,
2390,
2767,
4877,
796,
38491,
13,
1847,
47,
7801,
... | 2.531532 | 111 |
from __future__ import unicode_literals
from django.apps import AppConfig
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.619048 | 21 |
from dataclasses import dataclass
from openpersonen.backends import backend
from .ontbinding_huwelijk_partnerschap import OntbindingHuwelijkPartnerschap
from .partner import Partner
@dataclass
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
1280,
6259,
268,
13,
1891,
2412,
1330,
30203,
198,
198,
6738,
764,
756,
30786,
62,
13415,
86,
417,
45961,
62,
3911,
2741,
354,
499,
1330,
9463,
30786,
38202,
86,
417,
459... | 3.283333 | 60 |
import socket
import select
from msvcrt import kbhit, getch # type: ignore[attr-defined]
import logging
from qcodes.instrument_drivers.QuantumDesign.\
DynaCoolPPMS.private.commandhandler import CommandHandler
command_handler = CommandHandler()
log = logging.getLogger(__name__)
RECEIVE_BUFFER_SIZE = 4096
PORT =... | [
11748,
17802,
198,
11748,
2922,
198,
6738,
13845,
85,
6098,
83,
1330,
47823,
17945,
11,
651,
354,
220,
1303,
2099,
25,
8856,
58,
35226,
12,
23211,
60,
198,
11748,
18931,
198,
198,
6738,
10662,
40148,
13,
259,
43872,
62,
36702,
13,
249... | 2.084564 | 1,490 |
import gzip
import json
import os
import warnings
from collections import OrderedDict
from astropy import units as un
from astropy.coordinates import SkyCoord as coord
from astroquery.simbad import Simbad
from tqdm import tqdm
from astrocats.supernovae.scripts.repos import repo_file_list
from ...catalog.utils impor... | [
198,
11748,
308,
13344,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
14601,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
6738,
6468,
28338,
1330,
4991,
355,
555,
198,
6738,
6468,
28338,
13,
37652,
17540,
1330,
5274,
7222,
... | 2.33722 | 1,115 |
from __future__ import unicode_literals
import re
from django.db.migrations.questioner import MigrationQuestioner
from django.db.migrations.utils import get_migration_name_timestamp
class ChangeAutodetector(object):
"""
Takes a pair of ProjectStates, and compares them to see what the
first would need doi... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
302,
198,
198,
6738,
42625,
14208,
13,
9945,
13,
76,
3692,
602,
13,
25652,
263,
1330,
36991,
24361,
263,
198,
6738,
42625,
14208,
13,
9945,
13,
76,
3692,
602,
13,... | 2.243429 | 1,598 |
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | [
2,
15069,
2321,
1578,
1829,
5070,
355,
7997,
416,
262,
198,
2,
22998,
286,
262,
2351,
15781,
261,
2306,
873,
290,
4687,
8694,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
15069,
2321,
46915,
11,
3457,
13,
198,
2,
198,
2,
2... | 3.132857 | 700 |
from pkg_resources import resource_filename
import pytest
import recommendation
from recommendation.test.conftest import config_locations as overridden_config_locations # NOQA
@pytest.fixture # NOQA
from recommendation.test.conftest import change_config_and_setup_responses # NOQA
| [
6738,
279,
10025,
62,
37540,
1330,
8271,
62,
34345,
198,
198,
11748,
12972,
9288,
198,
198,
11748,
15602,
198,
6738,
15602,
13,
9288,
13,
1102,
701,
395,
1330,
4566,
62,
17946,
602,
355,
23170,
4651,
62,
11250,
62,
17946,
602,
220,
13... | 3.411765 | 85 |
from django.shortcuts import render
from django.http import HttpResponse, JsonResponse
from .models import StockInfo,DayData,RealTimeData,MonthData
from bokeh.plotting import figure
from bokeh.models import Range1d
from bokeh.embed import components
from bokeh.resources import CDN
from bokeh.plotting import Colu... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
201,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
11,
449,
1559,
31077,
201,
198,
6738,
764,
27530,
1330,
10500,
12360,
11,
12393,
6601,
11,
15633,
7575,
6601,
11,
31948,
... | 1.960643 | 2,922 |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Download an updated VS toolchain, isolate it, upload a CL to update Skia."""
import argparse
import json
import os
import shlex
import shutil
import subproc... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
1584,
3012,
3457,
13,
198,
2,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
... | 2.439889 | 1,439 |
"""AutoReply to someone according to keywords"""
from dataclasses import dataclass, field
from datetime import datetime
from collections import defaultdict
from typing import Union, List, Dict, Optional
from wechaty import ( # type: ignore
WechatyPlugin,
WechatyPluginOptions,
FileBox,
Contact,
Mes... | [
37811,
27722,
36875,
284,
2130,
1864,
284,
26286,
37811,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
19720,
1330,
4479,
11,
7343,
... | 2.974359 | 234 |
import cv2
import numpy as np
import time
import sys
sys.path.append("../")
from PenguinPiC import PenguinPi
from KeyboardController import Keyboard
from typing import List
| [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
4943,
198,
6738,
34424,
38729,
34,
1330,
34424,
38729,
198,
6738,
31973,
22130,
1330,
31973,
... | 3.782609 | 46 |
#
# (C) COPYRIGHT 2005-2021 Al von Ruff, Bill Longley and Ahasuerus
# ALL RIGHTS RESERVED
#
# The copyright notice above does not evidence any actual or
# intended publication of such source code.
#
# Version: $Revision$
# Date: $Date$
COOKIEHOST = "www.isfdb.org"
DBASE = "isfdb"
... | [
2,
198,
2,
220,
220,
220,
220,
357,
34,
8,
27975,
38162,
9947,
5075,
12,
1238,
2481,
220,
220,
978,
18042,
42409,
11,
3941,
5882,
1636,
290,
7900,
292,
15573,
385,
198,
2,
220,
220,
220,
220,
220,
220,
11096,
371,
34874,
15731,
11... | 1.977346 | 309 |
# SERVER=dev
# COMPOSE_FILE=dc.yml
# DOCKER_BUILD=0.0.1
#
# # SERVER dev or production
#
# POSTGRES_PASSWORD=123qwezxcasd
# POSTGRES_USER=ce
# POSTGRES_DB=currency_exchange
# POSTGRES_HOST=postgres
# POSTGRES_PORT=5432
#
# MEMCASHED_HOST=memcashed
# MEMCASHED_PORT=11211
#
# RABBITMQ_DEFAULT_USER=GUEST
# RABBITMQ_DEFAUL... | [
2,
18871,
5959,
28,
7959,
198,
2,
24301,
14058,
62,
25664,
28,
17896,
13,
88,
4029,
198,
2,
360,
11290,
1137,
62,
19499,
26761,
28,
15,
13,
15,
13,
16,
198,
2,
198,
2,
1303,
18871,
5959,
1614,
393,
3227,
198,
2,
198,
2,
24582,
... | 2.016736 | 239 |
from fastapi import APIRouter
from mlrun.config import config
from mlrun.runtimes.utils import resolve_mpijob_crd_version
router = APIRouter()
@router.get("/healthz")
| [
6738,
3049,
15042,
1330,
3486,
4663,
39605,
198,
198,
6738,
25962,
5143,
13,
11250,
1330,
4566,
198,
6738,
25962,
5143,
13,
81,
2797,
999,
13,
26791,
1330,
10568,
62,
3149,
2926,
672,
62,
66,
4372,
62,
9641,
198,
198,
472,
353,
796,
... | 2.898305 | 59 |
import random
import time
from colored import fg, bg, attr
# Push tile at position (x,y) into dx, dy direction
# Merges two tiles if numbers match
# returns True if state has changed.
grid = Grid(16, 8)
while True:
grid.add_random_tile()
grid.draw()
direction = random.choice("hjkl")
# di... | [
11748,
4738,
198,
11748,
640,
198,
6738,
16396,
1330,
277,
70,
11,
275,
70,
11,
708,
81,
628,
220,
220,
220,
1303,
23691,
17763,
379,
2292,
357,
87,
11,
88,
8,
656,
44332,
11,
20268,
4571,
198,
220,
220,
220,
1303,
4638,
3212,
734... | 2.485714 | 210 |
import immutables as im
t1 = list(subset1((1,(2,(3,(4,None))))))
"""
subsets equal in size to their complements
U={1,2,3,4}
{1,3} and {2,4}
{1,4} and {2,3}
{1,2} and {3,4}
{2,4} and {1,2}
"""
| [
11748,
2296,
315,
2977,
355,
545,
198,
198,
83,
16,
796,
1351,
7,
7266,
2617,
16,
19510,
16,
11,
7,
17,
11,
7,
18,
11,
7,
19,
11,
14202,
35514,
4008,
628,
198,
37811,
628,
6352,
1039,
4961,
287,
2546,
284,
511,
1224,
902,
628,
... | 1.869159 | 107 |
import tornado
from tornado import gen
from tornado.web import HTTPError
import config as c
import json
import time
import urllib
from datetime import datetime
from utils.JwtToken import JwtToken
from utils.json_decoder import DatetimeEncoder
from utils.permission import auth_login, refresh_token
from utils.bot import ... | [
11748,
33718,
198,
6738,
33718,
1330,
2429,
198,
6738,
33718,
13,
12384,
1330,
14626,
12331,
198,
11748,
4566,
355,
269,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
2956,
297,
571,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
... | 3.6 | 105 |
"""Subprocess management"""
# info: parts of this module has been copied from the original subprocess-module
# === NotImplemented ===
# - the following args are always ignored:
# - executable
# - shell
# - startupinfo
# - preexec_fn
# - bufsize
# - creationflags
# - close_fds
#Other implemention differences:
# - termi... | [
37811,
7004,
14681,
4542,
37811,
198,
2,
7508,
25,
3354,
286,
428,
8265,
468,
587,
18984,
422,
262,
2656,
850,
14681,
12,
21412,
198,
198,
2,
24844,
1892,
3546,
1154,
12061,
24844,
198,
2,
532,
262,
1708,
26498,
389,
1464,
9514,
25,
... | 2.726759 | 1,947 |
"""tests for vak.config.train module"""
import unittest
import os
import shutil
import tempfile
from configparser import ConfigParser
import vak.config.train
import vak.split
HERE = os.path.dirname(__file__)
TEST_DATA_DIR = os.path.join(HERE, '..', '..', 'test_data')
TEST_CONFIGS_DIR = os.path.join(TEST_DATA_DIR, 'c... | [
37811,
41989,
329,
410,
461,
13,
11250,
13,
27432,
8265,
37811,
198,
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
6738,
4566,
48610,
1330,
17056,
46677,
198,
198,
11748,
410,
461,
13,
112... | 2.631944 | 144 |
# Copyright 2017-2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
# Copyright 2018 Tom Blauwendraat <tom@sunflowerweb.nl>
# License MIT (https://opensource.org/licenses/MIT).
import logging
import socket
import subprocess
import threading
import time
import traceback
from odoo import http
_logger = ... | [
2,
15069,
2177,
12,
7908,
360,
22050,
402,
6485,
292,
709,
1279,
5450,
1378,
270,
12,
42068,
13,
10951,
14,
15097,
14,
38,
6485,
292,
709,
35,
22050,
29,
198,
2,
15069,
2864,
4186,
1086,
559,
86,
48286,
265,
1279,
39532,
31,
19155,
... | 3.208589 | 326 |
from .get_inputs import get_inputs
if __name__ == '__main__':
positions = get_inputs('day7.txt')
print(part1(positions))
print(part2(positions))
| [
6738,
764,
1136,
62,
15414,
82,
1330,
651,
62,
15414,
82,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
6116,
796,
651,
62,
15414,
82,
10786,
820,
22,
13,
14116,
11537,
198,
220,
220,
... | 2.476923 | 65 |
# Aula 23 - Desafio 115b: Arquivos com Python
# A solução está na pasta desafio115a | [
2,
317,
4712,
2242,
532,
2935,
1878,
952,
12279,
65,
25,
943,
421,
452,
418,
401,
11361,
198,
198,
2,
317,
1540,
84,
16175,
28749,
1556,
6557,
12385,
26296,
748,
1878,
952,
15363,
64
] | 2.470588 | 34 |
import time
import threading
from concurrent.futures import ThreadPoolExecutor
from webwhatsapi import WhatsAPIDriver
from webwhatsapi.objects.message import Message
import pdb
import sys
import json
import csv
import random
from random import randint
import phonenumbers
MAX_THREAD = 5
NUMBERS_COUNT = 115150
FILTERED_... | [
11748,
640,
198,
11748,
4704,
278,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
198,
6738,
3992,
1929,
1381,
15042,
1330,
28556,
2969,
2389,
38291,
198,
6738,
3992,
1929,
1381,
15042,
13,
48205,
13,
20500,
1330,
... | 2.652027 | 296 |
from django.forms import ModelForm
from .models import House
| [
6738,
42625,
14208,
13,
23914,
1330,
9104,
8479,
198,
198,
6738,
764,
27530,
1330,
2097,
628
] | 3.9375 | 16 |
#!/usr/bin/env python
# A Python implementation of the block cipher IDEA
# Copyright (c) 2015 Bo Zhu https://about.bozhu.me
# MIT License
if __name__ == '__main__':
main() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
317,
11361,
7822,
286,
262,
2512,
38012,
4522,
16412,
198,
198,
2,
15069,
357,
66,
8,
1853,
3248,
33144,
3740,
1378,
10755,
13,
2127,
89,
13415,
13,
1326,
198,
2,
17168,
1378... | 2.875 | 64 |
from flask import Flask, render_template, request
from database import init_db
from database import db_session
from models import Application
from crypt import encrypt
init_db()
app = Flask(__name__)
app.config['DEBUG'] = False
@app.route('/')
@app.route('/application', methods=['POST', 'GET', 'DELETE'])
@app.t... | [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
6738,
6831,
1330,
2315,
62,
9945,
198,
6738,
6831,
1330,
20613,
62,
29891,
198,
6738,
4981,
1330,
15678,
198,
6738,
8194,
1330,
34117,
198,
198,
15003,
62,
9945,
3419,
198,
... | 3.259615 | 104 |
from .chmm import CHMM
from .hmm import HMM
from .seq_wrapper import SeqLabelModelWrapper
| [
6738,
764,
354,
3020,
1330,
5870,
12038,
201,
198,
6738,
764,
71,
3020,
1330,
367,
12038,
201,
198,
6738,
764,
41068,
62,
48553,
1330,
1001,
80,
33986,
17633,
36918,
2848,
201,
198
] | 2.90625 | 32 |
# Generated by Django 2.0.9 on 2018-10-08 21:01
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
24,
319,
2864,
12,
940,
12,
2919,
2310,
25,
486,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
19... | 2.983333 | 60 |
# https://www.hackerrank.com/challenges/py-collections-ordereddict/problem
from collections import OrderedDict
ordered_dictionary = OrderedDict()
for _ in range(int(input())):
UI = input().split()
item_name = " ".join(UI[:-1])
net_price = int(UI[-1])
ordered_dictionary.setdefault(item_name, 0)
o... | [
2,
3740,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
9078,
12,
4033,
26448,
12,
24071,
11600,
14,
45573,
198,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
24071,
62,
67,
14188,
796,
14230,
1068,
35,
7... | 2.666667 | 156 |
import matplotlib.pyplot as plt
import matplotlib.cm
from scipy.signal import medfilt
import numpy as np
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
11215,
198,
6738,
629,
541,
88,
13,
12683,
282,
1330,
1117,
69,
2326,
198,
11748,
299,
32152,
355,
45941,
628,
628,
198
] | 2.868421 | 38 |
import logging
from logging.handlers import RotatingFileHandler
import random
import re
from flask import Flask, render_template, request
from flask_wtf import FlaskForm
from wtforms import SelectField
from .generate.generator import PoemMaker
pm = PoemMaker()
pm.setup()
app = Flask(__name__)
app.config.update(WTF_... | [
11748,
18931,
198,
6738,
18931,
13,
4993,
8116,
1330,
18481,
803,
8979,
25060,
198,
11748,
4738,
198,
11748,
302,
198,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
198,
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198... | 2.906383 | 235 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
| [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 3.824324 | 74 |
from functools import wraps
from unittest.mock import patch
from django.test import TestCase
from django.contrib.auth.models import User, Permission
from django.contrib.admin.models import (
LogEntry, ADDITION, CHANGE, DELETION
)
from .test_models import ModelTestCase
| [
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
8529,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
11,
2448,
3411,
1... | 3.218391 | 87 |