content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from users.logic.business import (
get_or_create_scope, get_user_from_id, add_scope_to_user
)
from users.schemas.scope import ScopeSchema
from commons.auth import jwt_scope_all_of
from ripozo.decorators import apimethod
from ripozo.resources.resource_base import ResourceBase
| [
6738,
2985,
13,
6404,
291,
13,
22680,
1330,
357,
198,
220,
220,
220,
651,
62,
273,
62,
17953,
62,
29982,
11,
651,
62,
7220,
62,
6738,
62,
312,
11,
751,
62,
29982,
62,
1462,
62,
7220,
198,
8,
198,
6738,
2985,
13,
1416,
4411,
292,... | 3.043011 | 93 |
import csv
fileinput = '0x4003.csv'
fileoutput = '0x4003.parsed.csv'
fin = open(fileinput,"r")
fout = open(fileoutput, "w")
with open(fileinput) as csvfile:
data_list=list(csv.reader(csvfile))
data = [str(x[0]) for x in data_list]
| [
11748,
269,
21370,
198,
198,
7753,
15414,
796,
705,
15,
87,
7029,
18,
13,
40664,
6,
198,
7753,
22915,
796,
705,
15,
87,
7029,
18,
13,
79,
945,
276,
13,
40664,
6,
198,
198,
15643,
796,
1280,
7,
7753,
15414,
553,
81,
4943,
198,
69... | 2.31068 | 103 |
"""Engines are functions that are used by the Do-ers.
Keyword Args: experiments, farms, barn
Returns: farms, barn
"""
import time
import logging
import pandas as pd
from cellpy import dbreader
from cellpy.parameters.internal_settings import get_headers_journal
from cellpy.utils.batch_tools import batch_helpe... | [
37811,
7936,
1127,
389,
5499,
326,
389,
973,
416,
262,
2141,
12,
364,
13,
628,
220,
220,
220,
7383,
4775,
943,
14542,
25,
10256,
11,
15893,
11,
25203,
198,
220,
220,
220,
16409,
25,
15893,
11,
25203,
198,
37811,
198,
198,
11748,
640... | 2.460104 | 2,682 |
"""Python.Dictionary COM Server.
This module implements a simple COM server that acts much like a Python
dictionary or as a standard string-keyed VB Collection. The keys of
the dictionary are strings and are case-insensitive.
It uses a highly customized policy to fine-tune the behavior exposed to
the COM clie... | [
37811,
37906,
13,
35,
14188,
9440,
9652,
13,
201,
198,
201,
198,
1212,
8265,
23986,
257,
2829,
9440,
4382,
326,
6529,
881,
588,
257,
11361,
201,
198,
67,
14188,
393,
355,
257,
3210,
4731,
12,
2539,
276,
569,
33,
12251,
13,
220,
383,... | 2.840226 | 532 |
import triangle
from numpy import array
from math import pi, cos, sin
from random import randint
for radius in radii:
for area in areas:
name = 'circle_' + str(int(radius)) + '_' + area
model_name = create_triangulated_polygon_model(
model_manager, sides, radius, area, name
... | [
11748,
22950,
198,
6738,
299,
32152,
1330,
7177,
198,
6738,
10688,
1330,
31028,
11,
8615,
11,
7813,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
1640,
16874,
287,
2511,
4178,
25,
198,
220,
220,
220,
329,
1989,
287,
3006,
25,
198,
220,... | 2.538961 | 154 |
""" Compute first best solution.
This module computes the first best solution.
"""
#####################################################
# IMPORTS
#####################################################
import json
import sys
import numpy as np
from bld.project_paths import project_paths_join as ppj
#################... | [
37811,
3082,
1133,
717,
1266,
4610,
13,
198,
198,
1212,
8265,
552,
1769,
262,
717,
1266,
4610,
13,
198,
198,
37811,
198,
29113,
14468,
4242,
2,
198,
2,
30023,
33002,
198,
29113,
14468,
4242,
2,
198,
11748,
33918,
198,
11748,
25064,
19... | 3.312121 | 330 |
import os
import subprocess
import unittest.mock
from pathlib import Path
import pytest
from elaspic2.plugins.rosetta_ddg import RosettaDDG
TESTS_DIR = Path(__file__).absolute().parent
@pytest.mark.parametrize(
"structure, mutation, is_correct",
[
# (TESTS_DIR.joinpath("structures").joinpath("1SBN.... | [
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
555,
715,
395,
13,
76,
735,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
1288,
5126,
291,
17,
13,
37390,
13,
305,
2617,
8326,
62,
1860,
70,
1330,
... | 2.107926 | 1,186 |
# Start from behind since no value at last
# What's the loop condition
# Time: O(n)
# Space: O(1)
if __name__ == "__main__":
nums1 = [1, 2, 3, 0, 0, 0]
m = 3
nums2 = [2, 5, 6]
n = 3
s = Solution()
s.merge(nums1, m, nums2, n)
print(nums1)
| [
2,
7253,
422,
2157,
1201,
645,
1988,
379,
938,
198,
2,
1867,
338,
262,
9052,
4006,
198,
2,
3862,
25,
440,
7,
77,
8,
198,
2,
4687,
25,
440,
7,
16,
8,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
... | 1.992593 | 135 |
import httpx
from bs4 import BeautifulSoup
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36'
}
| [
11748,
2638,
87,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
198,
50145,
796,
1391,
198,
220,
220,
220,
705,
12982,
12,
36772,
10354,
705,
44,
8590,
5049,
14,
20,
13,
15,
357,
11209,
24563,
838,
13,
15,
26,
7178,
2414,
26... | 2.390244 | 82 |
import os
from setuptools import find_packages, setup
import ccy
install_requires = requirements("dev/requirements.txt")[0]
tests_require = requirements("dev/requirements-dev.txt")[0]
meta = dict(
name="ccy",
version=ccy.__version__,
description=ccy.__doc__,
author="Luca Sbardella",
author_e... | [
11748,
28686,
198,
198,
6738,
900,
37623,
10141,
1330,
1064,
62,
43789,
11,
9058,
198,
198,
11748,
269,
948,
628,
628,
198,
17350,
62,
47911,
796,
5359,
7203,
7959,
14,
8897,
18883,
13,
14116,
4943,
58,
15,
60,
198,
41989,
62,
46115,
... | 2.647436 | 468 |
array_to_be_sorted = [4,2,7,3,1,6]
print("Original Array: ",array_to_be_sorted)
print("Sorted Array: ",QuickSort(array_to_be_sorted))
| [
628,
198,
18747,
62,
1462,
62,
1350,
62,
82,
9741,
796,
685,
19,
11,
17,
11,
22,
11,
18,
11,
16,
11,
21,
60,
198,
4798,
7203,
20556,
15690,
25,
33172,
18747,
62,
1462,
62,
1350,
62,
82,
9741,
8,
198,
4798,
7203,
50,
9741,
1569... | 2.245902 | 61 |
from alphazero.Game import GameState
from alphazero.GenericPlayers import BasePlayer
import numpy as np
class OneStepLookaheadConnect4Player(BasePlayer):
"""Simple player who always takes a win if presented, or blocks a loss if obvious, otherwise is random."""
| [
6738,
435,
746,
1031,
3529,
13,
8777,
1330,
3776,
9012,
198,
6738,
435,
746,
1031,
3529,
13,
46189,
24860,
1330,
7308,
14140,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
4871,
1881,
8600,
8567,
38204,
13313,
19,
14140,
7,
... | 3.736111 | 72 |
#!/usr/bin/env python3
# Copyright (c) 2018-2021 AnimatedLEDStrip
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
220,
15069,
357,
66,
8,
2864,
12,
1238,
2481,
36492,
30465,
1273,
5528,
198,
2,
198,
2,
220,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
1672... | 2.973843 | 994 |
import numpy as np
from litebo.core.distributed.worker import Worker
from litebo.utils.config_space import ConfigurationSpace
from ConfigSpace.hyperparameters import UniformFloatHyperparameter
| [
11748,
299,
32152,
355,
45941,
198,
6738,
300,
578,
2127,
13,
7295,
13,
17080,
6169,
13,
28816,
1330,
35412,
198,
6738,
300,
578,
2127,
13,
26791,
13,
11250,
62,
13200,
1330,
28373,
14106,
198,
6738,
17056,
14106,
13,
49229,
17143,
7307... | 4.041667 | 48 |
import os
import tensorflow as tf
import tensorflow_addons as tfa
import train.utils as utils
TF_AUTOTUNE = tf.data.experimental.AUTOTUNE
| [
11748,
28686,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
39996,
355,
256,
13331,
198,
198,
11748,
4512,
13,
26791,
355,
3384,
4487,
628,
198,
10234,
62,
39371,
2394,
41884,
796,
48700,
13,
7890,
1... | 2.94 | 50 |
from django.db import models
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class Phone(models.Model):
"""
Phone model
"""
id = models.UUIDField(primary_key=True, unique=True)
number = models.CharField(max_length=200)
extension = models.CharField(max_len... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
628,
198,
4871,
14484,
7,
27530,
13,
17633,
2599,
1... | 2.885965 | 114 |
# Generated by Django 3.2 on 2021-07-31 10:08
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
319,
33448,
12,
2998,
12,
3132,
838,
25,
2919,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
#!/usr/bin/env python
"""Computes the result of a stats cPickle file.
A stats cPickle file has the following format:
- List of N elements, each representing a track.
- Each position (or track) contains the rank index of the covers
corresponding to this position.
The results this script computes are:
- Mean Avera... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
7293,
1769,
262,
1255,
286,
257,
9756,
269,
31686,
293,
2393,
13,
198,
198,
32,
9756,
269,
31686,
293,
2393,
468,
262,
1708,
5794,
25,
198,
198,
12,
7343,
286,
399,
4847,
11,
... | 3.384389 | 679 |
import random
import string
from pathlib import Path
from django.conf import settings
from django.contrib.auth.models import User
from django.core import validators as valids
from django.db import models
from django_resized import ResizedImageField
from phonenumber_field.modelfields import PhoneNumberField
from rest_f... | [
11748,
4738,
198,
11748,
4731,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
7295,
1330,
... | 3.861702 | 94 |
"""Source
https://github.com/yihui-he/resnet-cifar10-caffe
"""
from __future__ import print_function
from caffe.proto import caffe_pb2
import os.path as osp
import sys
import os
# import caffe
import torch
import torch.nn as nn
import torch.nn.functional as F
def resnet_cifar(self, n=3):
"""6n+2, n=3 9 18 core... | [
37811,
7416,
198,
5450,
1378,
12567,
13,
785,
14,
88,
4449,
9019,
12,
258,
14,
411,
3262,
12,
66,
361,
283,
940,
12,
66,
21223,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
21121,
13,
1676,
1462,
... | 2.414815 | 270 |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# 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,
33160,
43208,
21852,
1766,
1539,
12052,
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.950636 | 1,965 |
from django.core.management.base import BaseCommand, CommandError
from django.test import Client
import os
from django.core.serializers.json import json, DjangoJSONEncoder
import logging
import django
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
11,
9455,
12331,
198,
6738,
42625,
14208,
13,
9288,
1330,
20985,
198,
11748,
28686,
198,
6738,
42625,
14208,
13,
7295,
13,
46911,
11341,
13,
17752,
1330,
33918,
11,
3... | 3.884615 | 52 |
#!/usr/bin/python
#
# A python program to compare against the output from "mime-structure" tool.
#
# Usage: python mimeParse.py <file list>
#
import sys
import email
# _structure ( msg )
main () | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
197,
32,
21015,
1430,
284,
8996,
1028,
262,
5072,
422,
366,
76,
524,
12,
301,
5620,
1,
2891,
13,
198,
2,
198,
2,
197,
28350,
25,
21015,
285,
524,
10044,
325,
13,
9078,
1279,
... | 2.763889 | 72 |
# SPDX-License-Identifier: Apache-2.0
"""
.. _l-rf-example-zipmap:
Probabilities as a vector or as a ZipMap
========================================
A classifier usually returns a matrix of probabilities.
By default, *sklearn-onnx* converts that matrix
into a list of dictionaries where each probabilies is mapped
to... | [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
628,
198,
37811,
198,
492,
4808,
75,
12,
41871,
12,
20688,
12,
13344,
8899,
25,
198,
198,
2964,
65,
5738,
355,
257,
15879,
393,
355,
257,
38636,
13912,
198,
1005... | 2.87634 | 1,399 |
import shutil, os
"""
>>> nuke.Lut('REDSpace').toFloat([x/5.0 for x in range(5)])
# Result: [0.0, 0.64340996742248535, 0.86640632152557373,
0.9471660852432251, 0.98195165395736694]
>>> nuke.Root()['luts'].toScript()
# Result: 'linear {}\nsRGB {}\nrec709 {}\nCineon {}\nGamma1.8
{}\nGamma2.2 {}\nPanalog {}\nREDLog... | [
11748,
4423,
346,
11,
28686,
198,
198,
37811,
628,
13163,
299,
4649,
13,
43,
315,
10786,
22083,
14106,
27691,
1462,
43879,
26933,
87,
14,
20,
13,
15,
329,
2124,
287,
2837,
7,
20,
8,
12962,
198,
2,
25414,
25,
685,
15,
13,
15,
11,
... | 2.33393 | 1,117 |
from django.contrib.contenttypes.models import ContentType
from django.core.checks import register, Tags, Warning
from django.db import connections, DatabaseError
@register(Tags.database)
@register(Tags.database)
| [
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
27530,
1330,
14041,
6030,
198,
6738,
42625,
14208,
13,
7295,
13,
42116,
1330,
7881,
11,
44789,
11,
15932,
198,
6738,
42625,
14208,
13,
9945,
1330,
8787,
11,
24047,
12331,
628,
198... | 3.741379 | 58 |
expected_output = {
"vlan_id": {
"100": {"access_map_tag": "karim"},
"3": {"access_map_tag": "mordred"},
"15": {"access_map_tag": "mordred"},
"5": {"access_map_tag": "mordred"},
}
}
| [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
366,
85,
9620,
62,
312,
1298,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
3064,
1298,
19779,
15526,
62,
8899,
62,
12985,
1298,
366,
21070,
320,
25719,
198,
220,
220,
220,
220,
... | 1.930435 | 115 |
n = int(input())
matrix = [2**i for i in range(31)]
print(1) if n in matrix else print(0)
| [
77,
796,
493,
7,
15414,
28955,
198,
6759,
8609,
796,
685,
17,
1174,
72,
329,
1312,
287,
2837,
7,
3132,
15437,
198,
4798,
7,
16,
8,
611,
299,
287,
17593,
2073,
3601,
7,
15,
8,
198
] | 2.5 | 36 |
# 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,
11,
3012,
11419,
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,
13789,
13,
198,
2,
921,
... | 2.702194 | 638 |
# -*- coding: utf-8 -*-
import copy
import datetime
import json
import math
import time
from freezegun import freeze_time
from mantarray_desktop_app import CONSTRUCT_SENSOR_SAMPLING_PERIOD
from mantarray_desktop_app import DATA_ANALYZER_BUFFER_SIZE_CENTIMILLISECONDS
from mantarray_desktop_app import FIFO_READ_PRODUCER... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
4866,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
10688,
198,
11748,
640,
198,
198,
6738,
1479,
89,
1533,
403,
1330,
16611,
62,
2435,
198,
6738,
24818,
... | 2.218925 | 1,786 |
#!/usr/bin/python
import matplotlib.pyplot as plt
from auvlib.bathy_maps import patch_draper, data_vis
from numpy import sign
import numpy as np
from copy import deepcopy
import sys
import os
import cv2
from auvlib.bathy_maps.gen_utils import clip_to_interval
patch_views = patch_draper.sss_patch_views.read_data(sys.a... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
257,
14795,
8019,
13,
65,
10036,
62,
31803,
1330,
8529,
62,
32491,
525,
11,
1366,
62,
4703,
198,
6738,
299,
32152,
1... | 2.395459 | 1,057 |
#
# Copyright (c) 2019. JetBrains s.r.o.
# Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#
import pytest
import lets_plot as gg
data = [1, 2]
mapping_empty = gg.aes()
mapping_x = gg.aes('X')
result_empty = {'data': None, 'mapping': None, 'layers': [], 'scales': [], 'ki... | [
2,
198,
2,
15069,
357,
66,
8,
13130,
13,
19013,
9414,
1299,
264,
13,
81,
13,
78,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
262,
17168,
5964,
326,
460,
307,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
2,
198,
1174... | 2.526055 | 403 |
from __future__ import absolute_import
import os
import fwakit as fwa
DB_URL = os.environ['FWA_DB_TEST']
TEST_SHP = r'tests/data/pscis.shp'
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
11748,
28686,
198,
198,
11748,
277,
86,
461,
270,
355,
277,
10247,
628,
198,
11012,
62,
21886,
796,
28686,
13,
268,
2268,
17816,
37,
15543,
62,
11012,
62,
51,
6465,
20520,
198,
51,
... | 2.370968 | 62 |
"""
Resolves UT-specific details to a useful URL
"""
from django import template
# pylint: disable=invalid-name
register = template.Library()
@register.simple_tag()
def osiris_url(course_code, calendar_year) -> str:
"""
A template tag which resolves the params into a Osiris URL.
Calendar Year is understo... | [
37811,
198,
4965,
9010,
19255,
12,
11423,
3307,
284,
257,
4465,
10289,
198,
37811,
198,
6738,
42625,
14208,
1330,
11055,
198,
198,
2,
279,
2645,
600,
25,
15560,
28,
259,
12102,
12,
3672,
198,
30238,
796,
11055,
13,
23377,
3419,
628,
1... | 2.870246 | 447 |
from doit import get_var
config = {"abc": get_var('abc', 'NO')}
| [
6738,
466,
270,
1330,
651,
62,
7785,
198,
198,
11250,
796,
19779,
39305,
1298,
651,
62,
7785,
10786,
39305,
3256,
705,
15285,
11537,
92,
198
] | 2.6 | 25 |
from sympy import Rational, S
from sympy.geometry import Circle, Line, Point, Polygon, Segment
from sympy.sets import FiniteSet, Union, Intersection, EmptySet
def test_booleans():
""" test basic unions and intersections """
half = Rational(1, 2)
p1, p2, p3, p4 = map(Point, [(0, 0), (1, 0), (5, 1), (0, 1)... | [
6738,
10558,
88,
1330,
46863,
11,
311,
198,
6738,
10558,
88,
13,
469,
15748,
1330,
16291,
11,
6910,
11,
6252,
11,
12280,
14520,
11,
1001,
5154,
198,
6738,
10558,
88,
13,
28709,
1330,
4463,
578,
7248,
11,
4479,
11,
4225,
5458,
11,
33... | 2.332046 | 777 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from enum import Enum
from .core import APIObject, APIClient
class ESRB(Enum):
"""
1 RP
2 EC
3 E
4 E10+
5 T
6 M
7 AO
"""
RP = 1
EC = 2
E = 3
E10plus = 4
T = 5
M = 6
AO = 7
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
33829,
1330,
2039,
388,
198,
198,
6738,
764,
7295,
1330,
7824,
10267,
11,
3486,
2149,
75,
1153,
628,
198,
198,
... | 1.718563 | 167 |
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0,16,0.1)
y = np.sin(x)
plt.plot(x,y)
plt.show()
print ('abcd')
print ('ddddd22ddgit')
print ('aaa') | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
87,
796,
45941,
13,
283,
858,
7,
15,
11,
1433,
11,
15,
13,
16,
8,
198,
88,
796,
45941,
13,
31369,
7,
87,
8,
198,
198,
489,
... | 2.074074 | 81 |
from bottle import route, run
import time
@route('/api/agralert')
@route('/api/agralert/alerts')
if __name__ == '__main__':
run(host='0.0.0.0', port=8080)
| [
6738,
9294,
1330,
6339,
11,
1057,
198,
11748,
640,
198,
198,
31,
38629,
10786,
14,
15042,
14,
363,
1373,
861,
11537,
220,
198,
31,
38629,
10786,
14,
15042,
14,
363,
1373,
861,
14,
44598,
82,
11537,
628,
198,
361,
11593,
3672,
834,
6... | 2.328571 | 70 |
#!/usr/bin/python
#
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The Astrobee platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in comp... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
357,
66,
8,
2177,
11,
1578,
1829,
5070,
11,
355,
7997,
416,
262,
198,
2,
22998,
286,
262,
2351,
15781,
261,
2306,
873,
290,
4687,
8694,
13,
198,
2,
198,
2,
1439,
2489,... | 3.911565 | 294 |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# dist... | [
2,
220,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
220,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
220,
220,
220,
921,
743,
... | 3.531818 | 220 |
from cli.cli import Cli
# Main method which executes the CLI
if __name__ == "__main__":
Cli()
| [
6738,
537,
72,
13,
44506,
1330,
1012,
72,
198,
198,
2,
8774,
2446,
543,
42985,
262,
43749,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1012,
72,
3419,
198
] | 2.75 | 36 |
import pandas
import matplotlib.pyplot as plt
names = ['A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8', 'A9', 'A10', 'A11', 'A12', 'A13', 'A14', 'A15', 'class']
dataset = pandas.read_csv('data/crx.csv', names=names)
# shape
print(dataset.shape)
# head
print(dataset.head(20))
# class distribution
print(dataset.grou... | [
11748,
19798,
292,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
14933,
796,
37250,
32,
16,
3256,
705,
32,
17,
3256,
705,
32,
18,
3256,
705,
32,
19,
3256,
705,
32,
20,
3256,
705,
32,
21,
3256,
705,
32,
... | 1.971989 | 714 |
"""
Definition of models.
"""
from datetime import datetime
from django.db import models
from django.utils import timezone
from app.utilities import getLogoPath
class Manager(models.Model):
"""Manager"""
username = models.CharField(
max_length=64, blank=False, unique=True, null=False)
... | [
37811,
201,
198,
36621,
286,
4981,
13,
201,
198,
37811,
201,
198,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
201,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
201,
198,
6... | 2.610417 | 1,440 |
# Generated by Django 2.2.6 on 2019-10-24 14:00
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
21,
319,
13130,
12,
940,
12,
1731,
1478,
25,
405,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
# Copyright 2021 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import io
import subprocess
from iree.compiler import ir
from iree.compiler import passmanager
from i... | [
2,
15069,
33448,
383,
314,
11587,
46665,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
410,
17,
13,
15,
351,
27140,
15996,
1475,
11755,
13,
198,
2,
4091,
3740,
1378,
297,
14761,
13,
2398,
14,
43,
2149,
24290,
13,
14116,
329,
5964,
... | 2.592105 | 760 |
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
import torch
import torch.nn as nn
from functools import partial
from vision_transformer import *
from timm.models.registry import register_model
from timm.models.layers import trunc_normal_
| [
2,
15069,
357,
66,
8,
1853,
12,
25579,
11,
3203,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
198,
6738,
5761,
62,
7645,
... | 3.527027 | 74 |
import numpy as np
import pandas as pd
from options import MODEL_DIR, opt, Debug_Index
from sklearn.preprocessing import normalize
import pyreadr
test_size = opt.test_size
a = 0
if __name__ == '__main__':
# tuple = load_h5("../data_process/snn_data.h5")
# x, y, s1, s2 = get_batch(tuple, False)
load_csv(... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
3689,
1330,
19164,
3698,
62,
34720,
11,
2172,
11,
31687,
62,
15732,
198,
6738,
1341,
35720,
13,
3866,
36948,
1330,
3487,
1096,
198,
11748,
12972,
961,
81,
... | 2.295918 | 294 |
from GenericRequest import GenericRequest
from kol.Error import NotEnoughItemsError, RequestError, UserInHardcoreRoninError, UserIsIgnoringError
from kol.manager import PatternManager
from kol.util import Report
| [
6738,
42044,
18453,
1330,
42044,
18453,
198,
6738,
479,
349,
13,
12331,
1330,
1892,
47323,
23022,
12331,
11,
19390,
12331,
11,
11787,
818,
17309,
7295,
23672,
259,
12331,
11,
11787,
3792,
32916,
3255,
12331,
198,
6738,
479,
349,
13,
37153... | 3.909091 | 55 |
import pandas as pd
import math
import LR_config
import statsmodels.api as sm
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_squared_error, mean_absolute_error, r2_score
from sklearn.linear_model import LinearRegression
if __name__ == "__main__":
df = pd.read_csv(LR_config.... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
10688,
198,
11748,
37491,
62,
11250,
198,
11748,
9756,
27530,
13,
15042,
355,
895,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
6738,
1341,
35720,
13,
... | 2.607843 | 306 |
import os
# with open("valid-videos.txt", "r") as f:
# for root, dirs, files in os.walk("../data", topdown=False):
# for name in files:
# if name.split('.')[-1] == 'mp4':
# print(name.split('.')[0])
# f.write(name.split('.')[0])
# # for name in dirs:
# # print(os.path.join(root, ... | [
11748,
28686,
198,
198,
2,
351,
1280,
7203,
12102,
12,
32861,
13,
14116,
1600,
366,
81,
4943,
355,
277,
25,
198,
2,
220,
197,
1640,
6808,
11,
288,
17062,
11,
3696,
287,
28686,
13,
11152,
7203,
40720,
7890,
1600,
1353,
2902,
28,
2510... | 2.211753 | 987 |
import os
import sys
# sys.argv size
print(len(sys.argv))
# program-name, minus .## extension (.py or .rb)
print(sys.argv[0][0:-3])
# first argument.
print(sys.argv[1])
# showing that argv can be modified
sys.argv[0] = "abcd"
sys.argv[1] = "abcd"
print(" ".join(sys.argv))
| [
11748,
28686,
198,
11748,
25064,
198,
198,
2,
25064,
13,
853,
85,
2546,
198,
4798,
7,
11925,
7,
17597,
13,
853,
85,
4008,
198,
198,
2,
1430,
12,
3672,
11,
20208,
764,
2235,
7552,
20262,
9078,
393,
764,
26145,
8,
198,
4798,
7,
1759... | 2.336134 | 119 |
'''
103.Binary Tree Zigzag Level Order Traversal
103.二叉树的锯齿形层序遍历
https://leetcode-cn.com/problems/
binary-tree-zigzag-level-order-traversal
给定一个二叉树,返回其节点值的锯齿形层序遍历。(即先从左往右,再从右往左进行下一层遍历,以此类推,层与层之间交替进行)。
例如:
给定二叉树 [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
返回锯齿形层序遍历如下:
[
[3],
[20,9],
[15,7... | [
7061,
6,
198,
15197,
13,
33,
3219,
12200,
24992,
50183,
5684,
8284,
4759,
690,
282,
198,
15197,
13,
12859,
234,
20998,
231,
43718,
239,
21410,
165,
242,
107,
165,
121,
123,
37605,
95,
161,
109,
224,
41753,
237,
34402,
235,
43889,
228,... | 1.592453 | 795 |
from collections import Counter, deque
from treelib import Tree
import re
| [
6738,
17268,
1330,
15034,
11,
390,
4188,
201,
198,
6738,
2054,
417,
571,
1330,
12200,
201,
198,
11748,
302,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 2.806452 | 31 |
# supposedly required so that tests & stuff works
# from django.db import models
# Create your models here.
| [
2,
13519,
2672,
523,
326,
5254,
1222,
3404,
2499,
198,
198,
2,
422,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198
] | 3.928571 | 28 |
import contextlib
import unittest
import tempfile
from io import StringIO
import numpy as np
from tests.utils import create_dummy_data, preprocess_lm_data, train_language_model
try:
from pyarrow import plasma
from fairseq.data.plasma_utils import PlasmaView, PlasmaStore
PYARROW_AVAILABLE = True
except I... | [
11748,
4732,
8019,
198,
11748,
555,
715,
395,
198,
11748,
20218,
7753,
198,
6738,
33245,
1330,
10903,
9399,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
5254,
13,
26791,
1330,
2251,
62,
67,
13513,
62,
7890,
11,
662,
14681,
... | 2.792208 | 154 |
from src.helpers.dateHelper import SIMPLE_DATE_STR
from src.secret.db_keys import __EMAIL_USER, __EMAIL_PASSWORD
import smtplib
from datetime import datetime
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
__DESTINATION: str = 'neltharak@gmai... | [
6738,
12351,
13,
16794,
364,
13,
4475,
47429,
1330,
23749,
16437,
62,
35,
6158,
62,
18601,
198,
6738,
12351,
13,
21078,
13,
9945,
62,
13083,
1330,
11593,
27630,
4146,
62,
29904,
11,
11593,
27630,
4146,
62,
47924,
54,
12532,
198,
198,
... | 2.562212 | 217 |
# -*- coding: utf-8 -*-
from urllib.request import urlopen
import scrapy
from scrapy.http import Request
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
2956,
297,
571,
13,
25927,
1330,
19016,
9654,
198,
11748,
15881,
88,
198,
6738,
15881,
88,
13,
4023,
1330,
19390,
628
] | 2.944444 | 36 |
from django.contrib import admin
from .models import Stream, Class, Subject, ClassSyllabus
admin.site.register(Stream)
admin.site.register(Class)
admin.site.register(Subject)
admin.site.register(ClassSyllabus)
# Register your models here.
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
27530,
1330,
13860,
11,
5016,
11,
15540,
11,
5016,
13940,
297,
46844,
198,
198,
28482,
13,
15654,
13,
30238,
7,
12124,
8,
198,
28482,
13,
15654,
13,
30238,
7,
9487,
... | 3.315068 | 73 |
from zcrmsdk.src.com.zoho.crm.api.user_signature import UserSignature
from zcrmsdk.src.com.zoho.api.authenticator.oauth_token import OAuthToken
from zcrmsdk.src.com.zoho.api.authenticator.store import DBStore
from zcrmsdk.src.com.zoho.api.logger import Logger
from zcrmsdk.src.com.zoho.crm.api.dc import USDataCenter
fro... | [
6738,
1976,
6098,
907,
34388,
13,
10677,
13,
785,
13,
89,
40950,
13,
6098,
76,
13,
15042,
13,
7220,
62,
12683,
1300,
1330,
11787,
11712,
1300,
198,
6738,
1976,
6098,
907,
34388,
13,
10677,
13,
785,
13,
89,
40950,
13,
15042,
13,
4129... | 2.56087 | 230 |
import babeltrace
import statistics
# Count the number of occurrences of each key
# Average value of a counter
# find average time between two events in the same thread
# measure the number of contended and uncontended lock acquisitions
| [
11748,
9289,
2120,
16740,
198,
11748,
7869,
198,
198,
2,
2764,
262,
1271,
286,
40279,
286,
1123,
1994,
198,
198,
2,
13475,
1988,
286,
257,
3753,
628,
198,
2,
1064,
2811,
640,
1022,
734,
2995,
287,
262,
976,
4704,
628,
198,
2,
3953,
... | 4.537037 | 54 |
from dependencies import *
# https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py
# resnet18 : BasicBlock, [2, 2, 2, 2]
# resnet34 : BasicBlock, [3, 4, 6, 3]
# resnet50 : Bottleneck [3, 4, 6, 3]
#
# https://medium.com/neuromation-io-blog/deepglobe-challenge-three-papers-from-neurom... | [
6738,
20086,
1330,
1635,
201,
198,
201,
198,
2,
220,
3740,
1378,
12567,
13,
785,
14,
9078,
13165,
354,
14,
10178,
14,
2436,
672,
14,
9866,
14,
13165,
354,
10178,
14,
27530,
14,
411,
3262,
13,
9078,
201,
198,
2,
220,
581,
3262,
150... | 2.021195 | 3,397 |
from os.path import join
import platform
from setuptools import setup, Extension
LONG_DESC = """# PythonUnpack200
A Python wrapper for the JDK unpack200 utility.
## Usage
The unpack200.unpack function takes three parameters:
* infile: string, full path to the pack200 file to extract
* outfile: string, full path to t... | [
6738,
28686,
13,
6978,
1330,
4654,
198,
11748,
3859,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
27995,
198,
198,
43,
18494,
62,
30910,
34,
796,
37227,
2,
11361,
3118,
8002,
2167,
198,
32,
11361,
29908,
329,
262,
28591,
42,
555,
800... | 2.614911 | 1,462 |
from DSTK.ProjectedGradientDescentLogit.pgd_logit import *
| [
6738,
360,
2257,
42,
13,
16775,
276,
42731,
1153,
5960,
1087,
11187,
270,
13,
6024,
67,
62,
6404,
270,
1330,
1635,
198
] | 2.681818 | 22 |
from django import forms
from budgetbuddy.accounts.models import BudgetAccount, MoneyAccount, Transaction
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
4466,
65,
21584,
13,
23317,
82,
13,
27530,
1330,
15401,
30116,
11,
12911,
30116,
11,
45389,
198,
6738,
42807,
62,
23914,
13,
2978,
525,
1330,
5178,
47429,
198,
6738,
42807,
62,
23914,
13,
39786... | 4.244444 | 45 |
value = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.admin',
'django.contrib.staticfiles',
'main',
'expense',
'user',
'department',
'member'
)
| [
8367,
796,
357,
198,
220,
220,
220,
705,
28241,
14208,
13,
3642,
822,
13,
18439,
3256,
198,
220,
220,
220,
705,
28241,
14208,
13,
3642,
822,
13,
11299,
19199,
3256,
198,
220,
220,
220,
705,
28241,
14208,
13,
3642,
822,
13,
82,
6202,... | 2.144 | 125 |
import subprocess
print getClipboardData() | [
11748,
850,
14681,
198,
198,
4798,
651,
2601,
541,
3526,
6601,
3419
] | 3.583333 | 12 |
import sys
import unittest
import os
import tempfile
import netCDF4
# test group creation.
FILE_NAME1 = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
FILE_NAME2 = tempfile.NamedTemporaryFile(suffix='.nc', delete=False).name
DYNASTY=u"Tudor"
HENRY_VII=u"Henry_VII"
MARGARET=u"Margaret"
JAMES_V_OF_SCOTLAN... | [
11748,
25064,
198,
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
20218,
7753,
198,
11748,
2010,
34,
8068,
19,
198,
198,
2,
1332,
1448,
6282,
13,
198,
198,
25664,
62,
20608,
16,
796,
20218,
7753,
13,
45,
2434,
12966,
5551,
8979,... | 2.214797 | 419 |
from tello import Tello
if __name__ == "__main__":
tello = Tello('', 8889)
tello.send_command('command')
tello.send_command('land') | [
6738,
1560,
78,
1330,
309,
11109,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
201,
198,
220,
220,
220,
1560,
78,
796,
309,
11109,
10786,
3256,
807,
39121,
8,
220,
220,
201,
198,
220,
220,
220,
1560,
... | 2.30303 | 66 |
"""
#995 - rewrite 28/10/2019 - read from CSV instead of human file
"""
import pandas as pd
| [
37811,
198,
2,
33438,
532,
28183,
2579,
14,
940,
14,
23344,
532,
1100,
422,
44189,
2427,
286,
1692,
2393,
198,
37811,
198,
198,
11748,
19798,
292,
355,
279,
67,
628
] | 3.133333 | 30 |
# -*- coding: utf-8 -*-
import yaml
import json
import os
from .keywordgroup import KeywordGroup
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
331,
43695,
198,
11748,
33918,
198,
11748,
28686,
198,
198,
6738,
764,
2539,
4775,
8094,
1330,
7383,
4775,
13247,
198
] | 2.8 | 35 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Utility strings for use during deployment.
NB: This is not part of the core sqlfluff code.
"""
from __future__ import absolute_import
from __future__ import print_function
# This contains various utility scripts
import shutil
import os
import click
@click.group(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
18274,
879,
13042,
329,
779,
1141,
14833,
13,
198,
198,
32819,
25,
770,
318,
407,
636,
286,
262,
4755,
19... | 2.763587 | 368 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.home, name="home"),
url(r'^register/', views.register, name="register"),
] | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
3256,
5009,
13,
11195,
11,
1438,
2625,
11195,
12340,
198,
220,
... | 2.68254 | 63 |
import discord
from discord.ext import commands
from models.embed.ban import Ban
import json
from models.logger import setup_discord_logger as setup_logger
import os
CONFIG_FILE = "res/moderadot.json"
logger = setup_logger("logs/moderadot.log")
bot_config = None
with open(CONFIG_FILE) as file:
bot_c... | [
11748,
36446,
201,
198,
6738,
36446,
13,
2302,
1330,
9729,
201,
198,
6738,
4981,
13,
20521,
13,
3820,
1330,
10274,
201,
198,
11748,
33918,
201,
198,
6738,
4981,
13,
6404,
1362,
1330,
9058,
62,
15410,
585,
62,
6404,
1362,
355,
9058,
62... | 2.490566 | 212 |
import setuptools
setuptools.setup(
name="chrome_trex",
version="0.0.1",
author="Fernando Kurike Matsumoto",
author_email="ferkmatsumoto@gmail.com",
description="A library with the chrome trex game",
url="https://github.com/GrupoTuringCodes/chrome-trex-rush",
license="MIT",
packages=['c... | [
11748,
900,
37623,
10141,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
220,
220,
220,
1438,
2625,
46659,
62,
83,
21510,
1600,
198,
220,
220,
220,
2196,
2625,
15,
13,
15,
13,
16,
1600,
198,
220,
220,
220,
1772,
2625,
37,
13023,
... | 2.532189 | 233 |
#! python3
from programacao_funcional.generetor_v1 import cores_arco_ires
if __name__ == '__main__':
generetor = cores_arco_ires()
for cor in generetor:
print(cor)
print('Fim')
| [
2,
0,
21015,
18,
198,
6738,
1430,
330,
5488,
62,
20786,
1538,
13,
5235,
567,
13165,
62,
85,
16,
1330,
21758,
62,
283,
1073,
62,
2387,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
2429,
56... | 2.302326 | 86 |
"""
Create a new file out.xlsx from a TM1 application file.
"""
import configparser
from TM1py import TM1Service
from TM1py.Objects.Application import ApplicationTypes
config = configparser.ConfigParser()
# storing the credentials in a file is not recommended for purposes other than testing.
# it's better to setup CA... | [
37811,
198,
16447,
257,
649,
2393,
503,
13,
87,
7278,
87,
422,
257,
21232,
16,
3586,
2393,
13,
198,
37811,
198,
11748,
4566,
48610,
198,
198,
6738,
21232,
16,
9078,
1330,
21232,
16,
16177,
198,
6738,
21232,
16,
9078,
13,
10267,
82,
... | 2.946128 | 297 |
import os
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
DATA_DIR = os.path.join(ROOT_DIR, "data")
RESULT_DIR = os.path.join(DATA_DIR, "results") | [
11748,
28686,
198,
198,
13252,
2394,
62,
34720,
796,
28686,
13,
6978,
13,
15908,
3672,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
4008,
198,
26947,
62,
34720,
796,
28686,
13,
6978,
13,
22179,
7,
13252,
2394,
62,
34720,... | 2.318182 | 66 |
#!/usr/bin/python3
import pytest
from brownie import accounts
@pytest.fixture(scope="module", autouse=True)
def test_into_custodian(check_counts, token, cust):
'''Transfer into custodian - investor'''
token.transfer(accounts[1], 10000, {'from': accounts[0]})
token.transfer(accounts[2], 10000, {'from':... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
7586,
494,
1330,
5504,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
2625,
21412,
1600,
1960,
1076,
28,
17821,
8,
628,
198,
4299,
1332,
62,
... | 2.549133 | 1,038 |
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import mlflow
def make_prediction(model, X_train_data, Y_train, X_test):
"""Add predictions from a specific model to the dataframe (test)
Parameters
----------
model : model consi... | [
11748,
299,
32152,
355,
45941,
1303,
14174,
37139,
198,
11748,
19798,
292,
355,
279,
67,
1303,
1366,
7587,
11,
44189,
2393,
314,
14,
46,
357,
68,
13,
70,
13,
279,
67,
13,
961,
62,
40664,
8,
198,
11748,
285,
1652,
9319,
198,
198,
4... | 2.771593 | 521 |
from typing import List, Optional
import graphene
from ..core.enums import OrderDirection
from ..core.types import SortInputObjectType
from .types import Plugin
| [
6738,
19720,
1330,
7343,
11,
32233,
198,
198,
11748,
42463,
198,
198,
6738,
11485,
7295,
13,
268,
5700,
1330,
8284,
35,
4154,
198,
6738,
11485,
7295,
13,
19199,
1330,
33947,
20560,
10267,
6030,
198,
6738,
764,
19199,
1330,
42636,
628,
6... | 3.97619 | 42 |
from src.data_structures.bst import BST
class AVL(BST):
"""An AVL tree with all the fixings (subclass of BST).
Distinct integers. left <= node < right.
Attributes:
root (Node): Root of tree.
size (int): Size of tree (number of nodes).
"""
def _insert_helper(self, curr_node, new... | [
6738,
12351,
13,
7890,
62,
7249,
942,
13,
65,
301,
1330,
44992,
628,
198,
4871,
14661,
43,
7,
33,
2257,
2599,
198,
220,
220,
220,
37227,
2025,
14661,
43,
5509,
351,
477,
262,
4259,
654,
357,
7266,
4871,
286,
44992,
737,
628,
220,
... | 1.991754 | 3,153 |
#####################################################################
# #
# /labscript_devices/DummyPseudoclock/register_classes.py #
# #
# Copyright 2017, Christopher Billington... | [
29113,
29113,
4242,
2,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.980488 | 615 |
import random
from pytests.N1qlTransaction.N1qlBase import N1qlBase
"""
Basic test cases with commit,rollback scenarios
"""
| [
11748,
4738,
198,
198,
6738,
12972,
41989,
13,
45,
16,
13976,
48720,
13,
45,
16,
13976,
14881,
1330,
399,
16,
13976,
14881,
198,
37811,
198,
26416,
1332,
2663,
351,
4589,
11,
2487,
1891,
13858,
198,
37811,
628
] | 3.405405 | 37 |
"""
Equilibrium Point
https://practice.geeksforgeeks.org/problems/equilibrium-point/0
"""
def equilibrium_point(numbers, size):
"""
Given an array A your task is to tell at which position the equilibrium
first occurs in the array. Equilibrium position in an array is a position
such that the sum of ele... | [
37811,
198,
23588,
24741,
6252,
198,
5450,
1378,
39541,
13,
469,
2573,
30293,
2573,
13,
2398,
14,
1676,
22143,
14,
4853,
24741,
12,
4122,
14,
15,
198,
37811,
628,
198,
4299,
29163,
62,
4122,
7,
77,
17024,
11,
2546,
2599,
198,
220,
2... | 2.327982 | 436 |
import os
import secrets
from flask import render_template, url_for, flash, redirect, request
from pitch import app, db, bcrypt
from pitch.forms import RegistrationForm, LoginForm, UpdateAccountForm, PitchForm
from pitch.models import User, Pitch
from flask_login import login_user, current_user, logout_user, login_requ... | [
11748,
28686,
198,
11748,
13141,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
7644,
11,
18941,
11,
2581,
198,
6738,
7078,
1330,
598,
11,
20613,
11,
275,
29609,
198,
6738,
7078,
13,
23914,
1330,
24610,
8479,
11,
23... | 2.793443 | 305 |
from sofi.ui import AlertLink
| [
6738,
523,
12463,
13,
9019,
1330,
23276,
11280,
198
] | 3.333333 | 9 |
from enum import Enum, auto
import aiohttp
import socket
import uuid
import random
from yarl import URL
import asyncio
import async_timeout
import structlog
import time
import colorama
logger = structlog.get_logger()
| [
6738,
33829,
1330,
2039,
388,
11,
8295,
198,
11748,
257,
952,
4023,
198,
11748,
17802,
198,
11748,
334,
27112,
198,
11748,
4738,
198,
6738,
331,
7063,
1330,
10289,
198,
11748,
30351,
952,
198,
11748,
30351,
62,
48678,
198,
11748,
2878,
... | 3.532258 | 62 |
import sys, pygame, math
| [
11748,
25064,
11,
12972,
6057,
11,
10688,
198
] | 3.125 | 8 |
import sys
import os
import secrets
import time
from rtl433stub import Rtl433Stub
#import Packet
import json
from ProcessManager import ProcessManager
from azure.iot.device import IoTHubDeviceClient, Message
DEFAULT_COMMAND = "rtl_433 -M utc -R 40 -C si -F json"
if __name__ == '__main__':
main() | [
11748,
25064,
198,
11748,
28686,
198,
11748,
13141,
198,
11748,
640,
198,
6738,
374,
28781,
42117,
301,
549,
1330,
371,
28781,
42117,
1273,
549,
198,
2,
11748,
6400,
316,
198,
11748,
33918,
198,
6738,
10854,
13511,
1330,
10854,
13511,
198... | 2.990099 | 101 |
#compute RGBmean
import os
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
import cv2
R_channel = 0
G_channel = 0
B_channel = 0
R_channel_square = 0
G_channel_square = 0
B_channel_square = 0
pixels_num = 0
imgs = []
root_path ='/home/ch/data/train_data/images/' # change your image path here!
... | [
2,
5589,
1133,
25228,
32604,
198,
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
198,
49,
62,
17620,
796,... | 2.072122 | 721 |
from .forces import attack_casualty_prefs # type: ignore
from .forces import defend_casualty_prefs # type: ignore
from .forces import Forces # type: ignore
from .units import unit_data # type: ignore
import copy
import matplotlib.pyplot as plt # type: ignore
import numpy as np # type: ignore
import random
import textwr... | [
6738,
764,
27087,
1330,
1368,
62,
34004,
723,
774,
62,
3866,
9501,
1303,
2099,
25,
8856,
198,
6738,
764,
27087,
1330,
4404,
62,
34004,
723,
774,
62,
3866,
9501,
1303,
2099,
25,
8856,
198,
6738,
764,
27087,
1330,
12700,
1303,
2099,
25,... | 2.735043 | 234 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT license.
import os, sys
#Add SeeDot directory to path
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'SeeDot'))
# For this warning: https://stackoverflow.com/questions/47068709/your-cpu-supports-instructions-that-this... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
198,
198,
11748,
28686,
11,
25064,
198,
198,
2,
4550,
4091,
35,
313,
8619,
284,
3108,
198,
17597,
13,
6978,
13,
33295,
7,
418,... | 2.753086 | 324 |
#!/usr/bin/python3
import re
import os
import sys
import common
import itertools
from readliner import Readliner
import tags as tagger
from checker import PackChecker, check_assets
if __name__ == '__main__':
config, extra = parse_args()
if extra["do_get"]:
print_lang_label(config, extra["do_g... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
302,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
2219,
198,
11748,
340,
861,
10141,
198,
198,
6738,
1100,
24683,
1330,
4149,
24683,
198,
198,
11748,
15940,
355,
7621,
1362... | 2.200658 | 912 |
import pygal
from die import Die
# 创建两个D8骰子
die_1 = Die(8)
die_2 = Die(8)
# 掷几次骰子,并将结果存储在一个列表中
results = [die_1.roll() + die_2.roll() for roll_num in range(1000000)]
# 分析结果
frequencies = []
max_result = die_1.num_sides + die_2.num_sides
for value in range(2, max_result + 1):
frequency = results.count(value)
... | [
11748,
12972,
13528,
198,
198,
6738,
4656,
1330,
6733,
198,
198,
2,
10263,
230,
249,
161,
119,
118,
10310,
97,
10310,
103,
35,
23,
165,
103,
108,
36310,
198,
11979,
62,
16,
796,
6733,
7,
23,
8,
198,
11979,
62,
17,
796,
6733,
7,
... | 1.479924 | 523 |
salario = float(input("Digite o valor do salário"))
faltas = int(input("Digite o numero de faltas"))
atrasos = int(input("Digite o numero de atrasos"))
bonus = calculaBonusSalario(salario,faltas,atrasos)
bonus = salario+bonus
print ("O valor do seu salario com bonus foi de", bonus)
| [
198,
21680,
4982,
796,
12178,
7,
15414,
7203,
19511,
578,
267,
1188,
273,
466,
3664,
6557,
27250,
48774,
198,
69,
2501,
292,
796,
493,
7,
15414,
7203,
19511,
578,
267,
997,
3529,
390,
277,
2501,
292,
48774,
198,
265,
8847,
418,
796,
... | 2.679245 | 106 |
# This file is part of beets.
# Copyright 2013, David Brenner <david.a.brenner gmail>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the... | [
2,
770,
2393,
318,
636,
286,
307,
1039,
13,
198,
2,
15069,
2211,
11,
3271,
20465,
1008,
1279,
67,
8490,
13,
64,
13,
65,
918,
1008,
308,
4529,
29,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
... | 2.452882 | 1,804 |
import os
import numpy as np
import tensorflow as tf
from absl import app, flags, logging
from retinanet.dataset_utils.mapillary_parser import MapillaryParser
from retinanet.dataset_utils.tfrecord_writer import TFrecordWriter
flags.DEFINE_string('download_path',
default=None,
... | [
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
2352,
75,
1330,
598,
11,
9701,
11,
18931,
198,
198,
6738,
1005,
259,
272,
316,
13,
19608,
292,
316,
62,
26791,
13,
8899,
1585... | 2.132199 | 764 |
import datetime
from random import randrange
from django.conf import settings
CHARSET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def random_barrier_reference():
"""
function to produce a random reference number for barriers
format: B-YY-XXXX
where YY is year and Xs are random alpha-numerics
"""
... | [
11748,
4818,
8079,
198,
6738,
4738,
1330,
43720,
9521,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
3398,
27415,
2767,
796,
366,
486,
1954,
2231,
3134,
4531,
24694,
32988,
17511,
23852,
42,
31288,
45,
3185,
48,
49,
225... | 2.53202 | 203 |
import spacy
| [
11748,
599,
1590,
628,
198
] | 3 | 5 |