content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from pathlib import Path
from setuptools import setup
root = Path(__file__).parent.absolute()
with open(str(root / 'README.rst')) as f:
long_description = f.read()
setup(
name='obs-ws-rc',
version='2.3.0',
description=("asyncio-based Python 3.5+ client to obs-websocket "
"plugin ... | [
6738,
3108,
8019,
1330,
10644,
198,
6738,
900,
37623,
10141,
1330,
9058,
628,
198,
15763,
796,
10644,
7,
834,
7753,
834,
737,
8000,
13,
48546,
3419,
198,
198,
4480,
1280,
7,
2536,
7,
15763,
1220,
705,
15675,
11682,
13,
81,
301,
6,
4... | 2.553684 | 475 |
# Daenerys IDA/Ghidra interop framework
# by Elias Bachaalany <elias.bachaalany@gmail.com>
#
# Python utility functions
import numbers | [
2,
9637,
877,
893,
4522,
32,
14,
41126,
312,
430,
987,
404,
9355,
198,
2,
416,
41462,
25332,
64,
282,
1092,
1279,
417,
4448,
13,
19496,
64,
282,
1092,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
11361,
10361,
5499,
198,
198,
11748,
... | 3 | 45 |
'''
Super Encrypt - Encryption Algorithm with 4 key encryption and decryption
__author__ = "PyBash"
__version__ = "v1.0.0"
'''
import random
from . import error
BASE_LETTERS = 'abcdefghijklmnopqrstuvwxyz'
BASE_SYMBOLS = ' 1234567890!@#$%^&*()-_=+[{]};:\'"<,>.?/`~|\\'
| [
7061,
6,
198,
12442,
14711,
6012,
532,
14711,
13168,
978,
42289,
351,
604,
1994,
15835,
290,
875,
13168,
198,
198,
834,
9800,
834,
796,
366,
20519,
33,
1077,
1,
198,
834,
9641,
834,
796,
366,
85,
16,
13,
15,
13,
15,
1,
198,
7061,
... | 2.231405 | 121 |
from ._Test import *
| [
6738,
47540,
14402,
1330,
1635,
198
] | 3.5 | 6 |
# The code below almost works
name = input("Enter your name")
print("Hello", name)
##2
# This first line is provided for you
hrs = input("Enter Hours:")
# hrs = float(hrs) #use the one in line 9 instead
ratePerHour = input("Enter rate per hour:")
# rateperHour = float(ratePerHour) #use the one in line 9 instead
# y... | [
2,
383,
2438,
2174,
2048,
2499,
198,
198,
3672,
796,
5128,
7203,
17469,
534,
1438,
4943,
198,
4798,
7203,
15496,
1600,
1438,
8,
628,
198,
2235,
17,
198,
2,
770,
717,
1627,
318,
2810,
329,
345,
198,
198,
71,
3808,
796,
5128,
7203,
... | 2.809422 | 1,401 |
#!/usr/local/bin/python
import os
import time
import collections
import subprocess
o("minikube delete")
o("minikube start --memory 10000 --cpus 4 --disk-size=60g")
#o("kubectl delete namespace spinnaker")
#time.sleep(30)
o("kubectl create namespace spinnaker")
c("applications/kubedash/bundle.yaml")
c("application... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
198,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
17268,
198,
11748,
850,
14681,
198,
198,
78,
7203,
1084,
1134,
3266,
12233,
4943,
198,
198,
78,
7203,
1084,
1134,
3266,
923,
1377,
3... | 2.603486 | 1,836 |
from typing import List
from collections import deque
class Line:
"""
Properties:
start_x {0}
start_y {1}
end_x {2}
end_y {3}
dots = [dot1, ..., dotN] {4}
coords = (start_x, start_y, end_x, end_y)
"""
@property
# @property
# def x1(self... | [
6738,
19720,
1330,
7343,
198,
6738,
17268,
1330,
390,
4188,
628,
198,
4871,
6910,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
24946,
25,
198,
220,
220,
220,
220,
220,
220,
220,
923,
62,
87,
220,
1391,
15,
92,
198,
220,
220,... | 1.983766 | 308 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\VistaAnalisisDatos.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from UI.Recursos import images_rc
# import DATOS IMAGENES_rc
if _... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
5178,
7822,
7560,
422,
3555,
334,
72,
2393,
45302,
59,
53,
12523,
2025,
27315,
271,
27354,
418,
13,
9019,
6,
198,
2,
198,
2,
15622,
416,
25,
9485,
48,
83,
... | 2.452991 | 234 |
from .crypto_stream_reader import CryptoWrappedStreamReader
from .crypto_stream_writer import CryptoWrappedStreamWriter
| [
6738,
764,
29609,
78,
62,
5532,
62,
46862,
1330,
36579,
36918,
1496,
12124,
33634,
198,
6738,
764,
29609,
78,
62,
5532,
62,
16002,
1330,
36579,
36918,
1496,
12124,
34379,
198
] | 4 | 30 |
from geoopt import Stereographic
import torch
import matplotlib.pyplot as plt
import seaborn as sns
from matplotlib import rcParams
import shutil
if shutil.which("latex") is not None:
rcParams["text.latex.preamble"] = r"\usepackage{amsmath}"
rcParams["text.usetex"] = True
sns.set_style("white")
x = torch.ten... | [
6738,
40087,
8738,
1330,
520,
567,
6826,
198,
11748,
28034,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
6738,
2603,
29487,
8019,
1330,
48321,
10044,
4105,
198,
11748,
442... | 2.147392 | 441 |
from django import forms
from models import Project
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Field, Submit, Div, HTML, ButtonHolder
from crispy_forms.bootstrap import FormActions, StrictButton, TabHolder, Tab, PrependedText, InlineCheckboxes, InlineField
import requests
from dj... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
4981,
1330,
4935,
198,
6738,
42807,
62,
23914,
13,
2978,
525,
1330,
5178,
47429,
198,
6738,
42807,
62,
23914,
13,
39786,
1330,
47639,
11,
7663,
11,
39900,
11,
4777,
11,
11532,
11,
20969,
39,
... | 3.534351 | 131 |
import tensorflow as tf
import numpy as np
import time
import matplotlib
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_circles
N=210
K=2
# Maximum number of iterations, if the conditions are not met
MAX_ITERS = 1000
cut=int(N*0.7)
start = time.time()
data, features = make_circ... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
640,
198,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
6738,
1341,
35720,
13,
19608,
292,
10... | 2.433697 | 641 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## Baiqiang XIA implementation of data structures
## Graph represented as Adjacency List
## init
## add Edge
## print
## bread first search (traversal), assuming all node are connected
## the task is to visit all the nodes... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2235,
40750,
80,
15483,
1395,
3539,
7822,
286,
1366,
8573,
198,
198,
2235,
29681,
7997,
355,
1215,
30482,
1387,
7343,
1... | 2.26484 | 219 |
#!/usr/bin/env python3
# https://codeforces.com/problemset/problem/1359/A
t = int(input())
for _ in range(t):
n,m,k = list(map(int,input().split()))
winner = min(n//k,m)
second = (m-winner+k-2)//(k-1)
print(winner-second)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
3740,
1378,
19815,
891,
273,
728,
13,
785,
14,
1676,
22143,
316,
14,
45573,
14,
1485,
3270,
14,
32,
198,
198,
83,
796,
493,
7,
15414,
28955,
198,
1640,
4808,
287,
2837,... | 2.067797 | 118 |
"""
2^15 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 2^1000?
"""
if __name__ == "__main__":
print(sum_digits(2**1000))
| [
37811,
198,
17,
61,
1314,
796,
36203,
3104,
290,
262,
2160,
286,
663,
19561,
318,
513,
1343,
362,
1343,
767,
1343,
718,
1343,
807,
796,
2608,
13,
198,
2061,
318,
262,
2160,
286,
262,
19561,
286,
262,
1271,
362,
61,
12825,
30,
198,
... | 2.569444 | 72 |
import os
from tasrif.data_readers.fitbit_interday_dataset import FitbitInterdayDataset
from tasrif.processing_pipeline import SequenceOperator
from tasrif.processing_pipeline.custom import AggregateOperator, CreateFeatureOperator
from tasrif.processing_pipeline.pandas import (
ConvertToDatetimeOperator,
SetIn... | [
11748,
28686,
198,
198,
6738,
256,
292,
81,
361,
13,
7890,
62,
961,
364,
13,
11147,
2545,
62,
3849,
820,
62,
19608,
292,
316,
1330,
25048,
2545,
818,
6432,
27354,
292,
316,
198,
6738,
256,
292,
81,
361,
13,
36948,
62,
79,
541,
447... | 2.294053 | 908 |
from rest_framework import serializers
from landing.models import Contact
import re
from rest_framework.response import Response
#from store.models import Store
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
9581,
13,
27530,
1330,
14039,
198,
11748,
302,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
2,
6738,
3650,
13,
27530,
1330,
9363,
198
] | 4.6 | 35 |
"""
Dash callbacks
Only applicant and posting data depend on the requisition number value
Pipeline and subfield data depend on the posting data
Callback chain:
Requisition number dropdown value changes
-> applicant data and posting data load
---> pipeline and subfield data load
-----> charts and footers load
"""
# T... | [
37811,
198,
43041,
869,
10146,
198,
198,
10049,
16919,
290,
10754,
1366,
4745,
319,
262,
1038,
10027,
1271,
1988,
198,
47,
541,
4470,
290,
850,
3245,
1366,
4745,
319,
262,
10754,
1366,
198,
198,
47258,
6333,
25,
198,
16844,
10027,
1271,... | 3.24952 | 521 |
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, Http404
import json
# Create your views here.
from .models import Track | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
11,
367,
29281,
26429,
198,
11748,
33918,
198,
2,
13610,
534,
5009,
994,
13,
198,
67... | 3.565217 | 46 |
""" Performance test using CP2K quantum chemistry and solid state physics software package for atomistic simulations.
See README.md for details.
NB:
- The executable is either cp2k.popt (for MPI only) or cp2k.psmp (for MPI + OpenMP).
- Only the former is currently implemented here.
"""
import reframe... | [
37811,
15193,
1332,
1262,
16932,
17,
42,
14821,
16585,
290,
4735,
1181,
11887,
3788,
5301,
329,
22037,
2569,
27785,
13,
628,
220,
220,
220,
4091,
20832,
11682,
13,
9132,
329,
3307,
13,
628,
220,
220,
220,
41354,
25,
198,
220,
220,
220... | 3.025397 | 315 |
# Application Configuration
import os
import yaml
from base.utils.data_utils import json_encoder
# CeNDR Version
APP_CONFIG, CENDR_VERSION = os.environ['GAE_VERSION'].split("-", 1)
if APP_CONFIG not in ['development', 'master']:
APP_CONFIG = 'development'
CENDR_VERSION = CENDR_VERSION.replace("-", '.')
# BUILDS A... | [
2,
15678,
28373,
198,
11748,
28686,
198,
11748,
331,
43695,
198,
6738,
2779,
13,
26791,
13,
7890,
62,
26791,
1330,
33918,
62,
12685,
12342,
198,
198,
2,
20101,
45,
7707,
10628,
198,
24805,
62,
10943,
16254,
11,
327,
1677,
7707,
62,
43... | 2.393939 | 726 |
import argparse
from hugsvision.nnet.ObjectDetectionTrainer import ObjectDetectionTrainer
parser = argparse.ArgumentParser(description='Object Detection')
parser.add_argument('--name', type=str, default="MyDETRModel", help='The name of the model')
parser.add_argument('--train', type=str, default="./BCCD_COCO/tr... | [
11748,
1822,
29572,
201,
198,
201,
198,
6738,
40657,
10178,
13,
77,
3262,
13,
10267,
11242,
3213,
2898,
10613,
1330,
9515,
11242,
3213,
2898,
10613,
201,
198,
201,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
7,
11213,
11639,
1... | 2.834933 | 521 |
"""
.. module:: PolyChord
:synopsis: Interface the PolyChord program with MontePython
This implementation relies heavily on the existing Python wrapper for
PolyChord, called PyPolyChord, which comes with the PolyChord code.
To install PolyChord, download it from
`its GitHub repo <https://github.com/PolyChord/Poly... | [
37811,
198,
492,
8265,
3712,
12280,
1925,
585,
198,
220,
220,
220,
1058,
28869,
24608,
25,
26491,
262,
12280,
1925,
585,
1430,
351,
22489,
37906,
198,
198,
1212,
7822,
16507,
7272,
319,
262,
4683,
11361,
29908,
329,
198,
34220,
1925,
58... | 2.336811 | 7,093 |
import json
from pyld import jsonld
from services.proto import ldnorm_pb2_grpc
from services.proto import ldnorm_pb2 as lpb2
from services.proto import general_pb2
| [
11748,
33918,
198,
6738,
12972,
335,
1330,
33918,
335,
198,
198,
6738,
2594,
13,
1676,
1462,
1330,
300,
67,
27237,
62,
40842,
17,
62,
2164,
14751,
198,
6738,
2594,
13,
1676,
1462,
1330,
300,
67,
27237,
62,
40842,
17,
355,
300,
40842,
... | 3.018182 | 55 |
'''Conway's Game of Life
See: https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life
This particular Game of Life is implemented as a two dimensional
world populated with cells.
'''
__author__ = '\n'.join(["Erik O'Shaughnessy",
'erik.oshaughnessy@gmail.com',
'https://gi... | [
7061,
6,
3103,
1014,
338,
3776,
286,
5155,
198,
198,
6214,
25,
3740,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
3103,
1014,
4,
1983,
82,
62,
8777,
62,
1659,
62,
14662,
198,
198,
1212,
1948,
3776,
286,
5155,
318,
9177,
355,
257... | 2.497942 | 243 |
"""
The MIT License (MIT)
Copyright (c) 2016 Stratos Goudelis
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, copy, modify, me... | [
37811,
198,
464,
17168,
13789,
357,
36393,
8,
198,
198,
15269,
357,
66,
8,
1584,
29186,
418,
402,
2778,
417,
271,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
378... | 2.394213 | 3,214 |
main() | [
198,
12417,
3419
] | 2.333333 | 3 |
# Generated by Django 3.2.4 on 2021-07-07 22:45
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
19,
319,
33448,
12,
2998,
12,
2998,
2534,
25,
2231,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
a = {'a': 1, 'b' : 2}
b = list(a.items())
print(b)
| [
64,
796,
1391,
6,
64,
10354,
352,
11,
705,
65,
6,
1058,
362,
92,
198,
65,
796,
1351,
7,
64,
13,
23814,
28955,
198,
4798,
7,
65,
8,
198
] | 1.758621 | 29 |
import pygame, sys
from Move import Move
from BoardModel import BoardModel
from MoveController import MoveController
from HelpModel import HelpModel
from MenuModel import MenuModel
from Model import Model
'''
CSC290 Group Project
C4: Four In A Row
University of Toronto Mississauga
'''
class Game():
'''
Base g... | [
11748,
12972,
6057,
11,
25064,
198,
6738,
10028,
1330,
10028,
198,
6738,
5926,
17633,
1330,
5926,
17633,
198,
6738,
10028,
22130,
1330,
10028,
22130,
198,
6738,
10478,
17633,
1330,
10478,
17633,
198,
6738,
21860,
17633,
1330,
21860,
17633,
... | 2.424837 | 1,224 |
import cauldron
from cauldron.test import support
from cauldron.test.support import scaffolds
class TestStepsInsert(scaffolds.ResultsTest):
"""..."""
def test_before(self):
"""Should properly rename default filenames."""
support.create_project(self, 'candice')
support.add_step(self)
... | [
11748,
269,
45637,
198,
6738,
269,
45637,
13,
9288,
1330,
1104,
198,
6738,
269,
45637,
13,
9288,
13,
11284,
1330,
41498,
10119,
628,
198,
4871,
6208,
8600,
82,
44402,
7,
1416,
2001,
10119,
13,
25468,
14402,
2599,
198,
220,
220,
220,
3... | 2.433054 | 956 |
from abc import ABCMeta, abstractmethod
| [
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
628
] | 4.1 | 10 |
#!/usr/bin/env python
# FMU-QSS Generator
#
# Project: QSS Solver
#
# Language: Python 2.7 and 3.x
#
# Developed by Objexx Engineering, Inc. (https://objexx.com) under contract to
# the National Renewable Energy Laboratory of the U.S. Department of Energy
#
# Copyright (c) 2017-2021 Objexx Engineering, Inc. All rights... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
18695,
52,
12,
48,
5432,
35986,
198,
2,
198,
2,
4935,
25,
1195,
5432,
4294,
332,
198,
2,
198,
2,
15417,
25,
11361,
362,
13,
22,
290,
513,
13,
87,
198,
2,
198,
2,
6013,
... | 2.132575 | 11,435 |
"""
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize cop... | [
37811,
198,
1212,
318,
1479,
290,
555,
12685,
26584,
3788,
2716,
656,
262,
1171,
7386,
13,
198,
198,
21129,
318,
1479,
284,
4866,
11,
13096,
11,
7715,
11,
779,
11,
17632,
11,
3677,
11,
393,
198,
17080,
4163,
428,
3788,
11,
2035,
287... | 2.118128 | 4,402 |
import pandas as pd
from database.tools import Database, str_list
from app.functions import time_method
audio_features = ['danceability', 'energy', 'key', 'loudness', 'mode', 'speechiness', 'acousticness',
'instrumentalness', 'liveness', 'valence', 'tempo', 'duration_ms', 'time_signature']
@time_... | [
11748,
19798,
292,
355,
279,
67,
198,
198,
6738,
6831,
13,
31391,
1330,
24047,
11,
965,
62,
4868,
198,
6738,
598,
13,
12543,
2733,
1330,
640,
62,
24396,
198,
198,
24051,
62,
40890,
796,
37250,
67,
590,
1799,
3256,
705,
22554,
3256,
... | 2.77686 | 121 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 8 10:19:43 2021
@author: ali
"""
import numpy as np
import matplotlib.pyplot as plt
from funcs import calcHelfrichUq
from funcs import calc_Helfrich_curve
from funcs import u_m2_calculator
from funcs import calcNelsonUl
from funcs import calc_nels... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
5979,
220,
807,
838,
25,
1129,
25,
3559,
33448,
198,
198,
31,
9800,
25,
34965,
198... | 2.619048 | 189 |
import time
import torch
import math
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from utils_multi import *
| [
11748,
640,
198,
11748,
28034,
198,
11748,
10688,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
6738,
3384,
4487,
62,
41684,
1330,... | 3.522727 | 44 |
from django import forms
from django.utils.translation import ugettext_lazy as _
from categories.models import Category
| [
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
9376,
13,
27530,
1330,
21743,
628
] | 3.84375 | 32 |
"""This module will deal with password management"""
import csv
def storepass(user, passwd, target="admins.csv"):
"""This function is used for storing user-pass combo
as elements to a csv file. By default, the values will be
stored in `creds/admins.csv`. The csvs will always be
saved in the `creds` ... | [
37811,
1212,
8265,
481,
1730,
351,
9206,
4542,
37811,
628,
198,
11748,
269,
21370,
628,
198,
4299,
3650,
6603,
7,
7220,
11,
1208,
16993,
11,
2496,
2625,
324,
42951,
13,
40664,
1,
2599,
198,
220,
220,
220,
37227,
1212,
2163,
318,
973,
... | 2.57659 | 692 |
from flask import make_response, jsonify
class Error(Exception):
"""Base class for exceptions in this module."""
pass
| [
6738,
42903,
1330,
787,
62,
26209,
11,
33918,
1958,
628,
198,
198,
4871,
13047,
7,
16922,
2599,
198,
220,
220,
220,
37227,
14881,
1398,
329,
13269,
287,
428,
8265,
526,
15931,
198,
220,
220,
220,
1208,
628,
628,
628,
198
] | 3.375 | 40 |
#!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# usage: rule_binding.py INPUT CPPDIR HDIR -- INPUTS -- OPTIONS
#
# INPUT is an IDL file, such as Whatever.idl.
#
# CPPDIR is the dire... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
15069,
357,
66,
8,
3717,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
1... | 3.184739 | 249 |
#
# Copyright 2013 Apache Software Foundation
#
# 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 agree... | [
2,
198,
2,
15069,
2211,
24843,
10442,
5693,
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,... | 3.505882 | 255 |
"""
Some statistics utils.
"""
import numpy as np
from os.path import join
def expectation_2d(pdf):
"""
Computes the statistical expectation of a pdf defined
over two discrete random variables.
Parameters
----------
pdf: ndarray
a numpy 2-dimensional array with probability for e... | [
37811,
198,
4366,
7869,
3384,
4487,
13,
198,
37811,
628,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28686,
13,
6978,
1330,
4654,
628,
198,
4299,
17507,
62,
17,
67,
7,
12315,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3... | 2.442105 | 855 |
#!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor,
InfraredSensor, UltrasonicSensor, GyroSensor)
from pybricks.parameters import Port, Stop, Direction, Button, Color
from pybricks.tools import wait, St... | [
2,
48443,
14629,
14,
8800,
14,
24330,
12972,
65,
23706,
12,
9383,
1773,
7535,
198,
6738,
12972,
65,
23706,
13,
71,
23161,
1330,
8696,
18,
33,
5557,
198,
6738,
12972,
65,
23706,
13,
1990,
18,
42034,
1330,
357,
34919,
11,
15957,
47864,
... | 2.566978 | 321 |
#coding:utf-8 -*-
import config, metodos
from mensagens import bemvindo
from pprint import *
from metodos import sendMessage
| [
2,
66,
7656,
25,
40477,
12,
23,
532,
9,
12,
198,
11748,
4566,
11,
1138,
375,
418,
198,
6738,
285,
641,
363,
641,
1330,
307,
76,
50172,
78,
198,
6738,
279,
4798,
1330,
1635,
198,
6738,
1138,
375,
418,
1330,
3758,
12837,
198
] | 2.906977 | 43 |
import IceRayCpp
| [
11748,
6663,
19591,
34,
381,
201,
198
] | 2.571429 | 7 |
from .distribution import Distribution
| [
6738,
764,
17080,
3890,
1330,
27484,
201,
198,
201,
198
] | 4.2 | 10 |
import pytest
from data_structures.linked_list.ll_zip import *
from data_structures.linked_list.linked_list import *
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
6738,
1366,
62,
7249,
942,
13,
25614,
62,
4868,
13,
297,
62,
13344,
1330,
1635,
198,
6738,
1366,
62,
7249,
942,
13,
25614,
62,
4868,
13,
25614,
62,
4868,
1330,
1635,
628,
628,
198,
31,
9078,
9288,
13,
69,
... | 2.90566 | 53 |
import logging
from .resnet_enc import ResNet_D, BasicBlock, Bottleneck
from .res_localHOP_posEmb_enc import ResLocalHOP_PosEmb
__all__ = ['resnet_localHOP_posEmb_encoder_29']
if __name__ == "__main__":
import torch
logging.basicConfig(level=logging.DEBUG, format='[%(asctime)s] %(levelname)s: %(message)s'... | [
11748,
18931,
198,
6738,
764,
411,
3262,
62,
12685,
1330,
1874,
7934,
62,
35,
11,
14392,
12235,
11,
14835,
43163,
198,
6738,
764,
411,
62,
12001,
39,
3185,
62,
1930,
31567,
62,
12685,
1330,
1874,
14565,
39,
3185,
62,
21604,
31567,
628... | 2.166667 | 228 |
# Program to check closing of all brackets
print(par_checker('{({([][])}())}')) # True
print(par_checker('[{()]')) # False
| [
2,
6118,
284,
2198,
9605,
286,
477,
28103,
628,
628,
198,
198,
4798,
7,
1845,
62,
9122,
263,
10786,
90,
15090,
26933,
7131,
12962,
92,
28955,
92,
6,
4008,
220,
1303,
6407,
198,
4798,
7,
1845,
62,
9122,
263,
10786,
58,
90,
3419,
49... | 2.653061 | 49 |
from . import csvTasks
from . import Gender
# from . import Learn | [
6738,
764,
1330,
269,
21370,
51,
6791,
198,
6738,
764,
1330,
20247,
198,
2,
422,
764,
1330,
14365
] | 3.611111 | 18 |
VERIFY_TOKEN = '' | [
5959,
5064,
56,
62,
10468,
43959,
796,
10148
] | 2.125 | 8 |
#!/usr/bin/env python
import html
import re
from subprocess import check_output
import yaml
find_code = re.compile(r'code: (\w+)').search
table_html = '''
<table class="code table table-sm">
<tbody>
<tr>
<td>{py}</td>
<td>{go}</td>
</tr>
</tbody>
</table>
'''
module_html = '''
<tr>
<td>{task}</t... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
27711,
198,
11748,
302,
198,
6738,
850,
14681,
1330,
2198,
62,
22915,
198,
198,
11748,
331,
43695,
198,
198,
19796,
62,
8189,
796,
302,
13,
5589,
576,
7,
81,
6,
8189,
25,... | 2.146179 | 602 |
"""
Systems
Endpoints for installing, reading, configuring and deleting transit systems.
"""
import flask
import requests
from transiter import exceptions
from transiter.http import httpmanager, httpviews
from transiter.http.httpmanager import (
http_endpoint,
link_target,
HttpMethod,
HttpStatus,
)
fr... | [
37811,
198,
11964,
82,
198,
198,
12915,
13033,
329,
15975,
11,
3555,
11,
4566,
870,
290,
34817,
11168,
3341,
13,
198,
37811,
198,
11748,
42903,
198,
11748,
7007,
198,
198,
6738,
1007,
2676,
1330,
13269,
198,
6738,
1007,
2676,
13,
4023,
... | 3.077419 | 2,790 |
# xctf{35eedc512678301f582de3176d1fc81c}
payload = ''
for i in range(16):
payload += 'x%d=["Source"()[%d]];' % (i, i)
payload += 'a=['
payload += ','.join('x%d[0]' % i for i in range(16))
payload += '];"Sink"(a)'
print payload
| [
2,
2124,
310,
69,
90,
2327,
2308,
66,
25836,
3134,
5999,
486,
69,
46044,
2934,
18,
24096,
67,
16,
16072,
6659,
66,
92,
198,
15577,
2220,
796,
10148,
198,
198,
1640,
1312,
287,
2837,
7,
1433,
2599,
198,
220,
220,
220,
21437,
15853,
... | 2.052632 | 114 |
from django.conf import settings
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('',
url(r'^$', 'fbapp.views.canvas', name="fbapp.canvas"),
url(r'^page_tab$', 'fbapp.views.page_tab', name="fbapp.page_tab"),
url(r'^owa$', 'fbapp.views.open_web_app', name="fbapp.open_web_app"),
... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12286,
82,
1330,
7572,
11,
19016,
198,
198,
6371,
33279,
82,
796,
7572,
10786,
3256,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
3256,
... | 2.348624 | 218 |
import torch
import math | [
198,
11748,
28034,
198,
11748,
10688
] | 4.166667 | 6 |
# coding=utf-8
# name=hu_yang_jie
#coding=utf-8
import cv2
import numpy as np
img = cv2.imread("bili.jpg") #载入图像
h, w = img.shape[:2] #获取图像的高和宽
cv2.imshow("Origin", img) #显示原始图像
blured = cv2.blur(img,(5,5)) #进行滤波去掉噪声
cv2.imshow("Blur", blured) #显示低通滤波后的图像
mask = np.zeros((h+2, w+2), np.uint8) #掩码... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
1438,
28,
13415,
62,
17859,
62,
73,
494,
198,
2,
66,
7656,
28,
40477,
12,
23,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
198,
9600,
796,
269,
85,
17,
13,
320,
961,
72... | 1.368356 | 809 |
"""
Package version number.
"""
# We have to put it here, because setup.py (and easy_install) cannot import
# nxturtle before requirements are satisfied.
__version__ = "1.0.4"
| [
37811,
201,
198,
27813,
2196,
1271,
13,
201,
198,
37811,
201,
198,
2,
775,
423,
284,
1234,
340,
994,
11,
780,
9058,
13,
9078,
357,
392,
2562,
62,
17350,
8,
2314,
1330,
220,
201,
198,
2,
299,
742,
17964,
878,
5359,
389,
11378,
13,
... | 3.066667 | 60 |
import dataclasses
import datetime
import json
import typing
import uuid
from dataclasses_avroschema.schema_generator import SchemaGenerator
| [
11748,
4818,
330,
28958,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
19720,
198,
11748,
334,
27112,
198,
198,
6738,
4818,
330,
28958,
62,
615,
305,
15952,
2611,
13,
15952,
2611,
62,
8612,
1352,
1330,
10011,
2611,
8645,
1352,
... | 3.452381 | 42 |
import os
import spira
import pygmsh
import meshio
import inspect
from spira.core.lists import ElementList
# from spira.gdsii.utils import numpy_to_list
from spira import param
from spira.lne.mesh import Mesh
from spira.core.initializer import ElementalInitializer
| [
11748,
28686,
198,
11748,
599,
8704,
198,
11748,
12972,
70,
907,
71,
198,
11748,
19609,
952,
198,
11748,
10104,
198,
198,
6738,
599,
8704,
13,
7295,
13,
20713,
1330,
11703,
8053,
198,
2,
422,
599,
8704,
13,
70,
9310,
4178,
13,
26791,
... | 3.280488 | 82 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
=============
TAP plus
=============
@author: Juan Carlos Segovia
@contact: juan.carlos.segovia@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 30 jun. 2016
"""
from astroquery.utils.tap import taputils... | [
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
532,
766,
38559,
24290,
13,
81,
301,
198,
37811,
198,
25609,
28,
198,
51,
2969,
5556,
198,
25609,
28,
198,
198,
31,
9800,
25,
16852,
17409,
1001,
9567,
544,
198,
31,
3... | 3.041322 | 121 |
# encoding=utf8
"""Simulated annealing algorithm module."""
import numpy as np
from WeOptPy.algorithms.interfaces import Algorithm
__all__ = [
'SimulatedAnnealing',
'coolDelta',
'coolLinear'
]
def coolDelta(currentT, T, deltaT, nFES, **kwargs):
r"""Calculate new temperature by differences.
Args:
currentT ... | [
2,
21004,
28,
40477,
23,
198,
198,
37811,
8890,
4817,
281,
710,
4272,
11862,
8265,
526,
15931,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
775,
27871,
20519,
13,
282,
7727,
907,
13,
3849,
32186,
1330,
978,
42289,
198,
198... | 2.584906 | 1,802 |
import sys
sys.path.append("../config_files")
import mysql.connector
from settings_project import CONFIG_MYSQL
import pandas as pd
import numpy as np
import time
#DEFINIMOS FUNCIONES
# CALCULAR MEDIAS MOVILES
# CREAMOS CICLO INFINITO CON PAUSA CADA 10S
while True:
# Cargar datos
datos = load_bitso_data_top5... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
11250,
62,
16624,
4943,
198,
11748,
48761,
13,
8443,
273,
198,
6738,
6460,
62,
16302,
1330,
25626,
62,
44,
16309,
9711,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
... | 2.062661 | 1,165 |
from django.test import TestCase
# from django.contrib.auth.models import User
from blog.models import Post, Comment
import blog.tests.helper as h
| [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
2,
422,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
198,
6738,
4130,
13,
27530,
1330,
2947,
11,
18957,
198,
198,
11748,
4130,
13,
41989,
13,
2978,
525,
355... | 3.355556 | 45 |
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Denys Duchier, IUT d'Orléans
#==============================================================================
import mud.game
from .thing import Thing
from .mixins.containing import Containing
from .location import Location
import queue
from tornado.iolo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
34,
8,
1946,
5601,
893,
360,
794,
959,
11,
314,
3843,
288,
6,
5574,
45031,
504,
198,
2,
23926,
25609,
855,
198,
198,
11748,
17492,
13,
6057,
198,
6738... | 3.247619 | 105 |
#!/usr/bin/env python
'''
Module for pipelining composition.
value >> func1 >> func2 >> func3 ...
Pipelines are expressions whose resulting value can be assigned:
result = value >> func1 >> func2
Rules:
* First value can be any python value
* Functions must be chained with the '>>' operator.
* All fun... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
198,
26796,
329,
7347,
417,
3191,
11742,
13,
628,
220,
220,
220,
1988,
9609,
25439,
16,
9609,
25439,
17,
9609,
25439,
18,
2644,
198,
198,
47,
541,
20655,
389,
14700,
3025,
7... | 3.26087 | 713 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import glob
from os.path import join, dirname
sys.path.insert(0, join(dirname(__file__), '..'))
sys.path.insert(0, join(dirname(__file__), '../..'))
import cv2
import numpy as np
if __name__ == '__main__':
rate = 1.25
rate2 = 1.0
dataset = {}
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
25064,
198,
11748,
15095,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
26672,
3672,
198,
17597,
13,
6978,
13,... | 1.967078 | 972 |
from gephistreamer import graph
from gephistreamer import streamer
#https://github.com/totetmatt/GephiStreamer
#DA FARE
stream = streamer.Streamer(streamer.GephiWS(hostname="localhost", port=8080, workspace="workspace0"),)
node_a = graph.Node("A",custom_property=1)
node_b = graph.Node("B",custom_property=2)
node_c = gr... | [
6738,
308,
538,
10034,
1476,
263,
1330,
4823,
198,
6738,
308,
538,
10034,
1476,
263,
1330,
4269,
263,
198,
2,
5450,
1378,
12567,
13,
785,
14,
83,
313,
316,
76,
1078,
14,
38,
538,
5303,
28696,
198,
2,
5631,
376,
12203,
198,
5532,
7... | 2.65285 | 193 |
#!/usr/bin/env python
# Copyright (c) 2018, Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or i... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
357,
66,
8,
2864,
11,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
1... | 2.335256 | 5,029 |
# -*- coding: utf-8 -*-
"""
Writable String Object | Stores data to simplify writing outputs.
Created on Sat Nov 28 19:06:09 2020
Version 1.3.0 (debug support) A-05-2021 @ 14:34 UTC -5
Requires: NONE
@author: Kinetos#6935
"""
import argparse
class wso(object):
"""
A class to to simplify writing outputs when... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
20257,
540,
10903,
9515,
930,
41835,
1366,
284,
30276,
3597,
23862,
13,
198,
41972,
319,
7031,
5267,
2579,
678,
25,
3312,
25,
2931,
12131,
198,
198,
14815,
3... | 2.26374 | 2,802 |
from app.schema.answer import Answer
from app.schema.exceptions import TypeCheckingException
from app.schema.widgets.month_year_date_widget import MonthYearDateWidget
from app.validation.month_year_date_type_check import MonthYearDateTypeCheck
| [
6738,
598,
13,
15952,
2611,
13,
41484,
1330,
23998,
198,
6738,
598,
13,
15952,
2611,
13,
1069,
11755,
1330,
5994,
9787,
278,
16922,
198,
6738,
598,
13,
15952,
2611,
13,
28029,
11407,
13,
8424,
62,
1941,
62,
4475,
62,
42655,
1330,
1606... | 3.602941 | 68 |
from flask import Flask, render_template, url_for, flash, redirect
app = Flask(__name__)
@app.route('/')
@app.route('/next')
@app.route('/upcoming')
@app.route('/rockets')
@app.route('/rockets/<rocket>')
if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0')
| [
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
7644,
11,
18941,
201,
198,
201,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
201,
198,
201,
198,
31,
1324,
13,
38629,
10786,
14,
11537,
201,
198,
201,
198,
31... | 2.210526 | 133 |
from testing_collection import visualisation_tests as visu_tests
from Classes.CurrentDocument import CurrentDoc
def run_tests(curr_doc: CurrentDoc):
"""
1.) write test case and add it to file test_cases.py
2.) Call it in this function (run_tests() will be called in 'System_of_Beams\main.py'
3.) make s... | [
6738,
4856,
62,
43681,
1330,
5874,
5612,
62,
41989,
355,
1490,
84,
62,
41989,
198,
6738,
38884,
13,
11297,
24941,
1330,
9236,
23579,
628,
198,
4299,
1057,
62,
41989,
7,
22019,
81,
62,
15390,
25,
9236,
23579,
2599,
198,
220,
220,
220,
... | 1.738555 | 3,626 |
import pygrib
import numpy as np
from collections import defaultdict
from collections import namedtuple
from collections import Iterable
import xarray as xr
def grb_msg_to_xr(message, has_levels=True):
"""
Convert a single grib message to xarray.
:param message:
:type message: pygrib message
:par... | [
11748,
12972,
70,
822,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
17268,
1330,
40806,
540,
198,
11748,
2124,
18747,
355,
2124,
81,
628,
198,
4299,
1036,
6... | 2.215098 | 967 |
# -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge.readthedocs.io/
# FLEDGE_END
""" Test add service using poll and async plugins for both python & C version REST API """
import os
import http.client
import json
import time
from uuid import UUID
from collections import Counter
from urllib.parse import quote... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
9977,
1961,
8264,
62,
33,
43312,
198,
2,
4091,
25,
2638,
1378,
69,
2965,
13,
961,
83,
704,
420,
82,
13,
952,
14,
198,
2,
9977,
1961,
8264,
62,
10619,
198,
... | 2.614035 | 285 |
from rest_framework import serializers
from aggregate.stores.models import Store
| [
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
19406,
13,
43409,
13,
27530,
1330,
9363,
628
] | 4.611111 | 18 |
import os
import sys
import unittest
from parameterized import parameterized
sys.path.append(os.path.join(os.path.dirname(__file__), '../../tests/system'))
import metricbeat
| [
11748,
28686,
198,
11748,
25064,
198,
11748,
555,
715,
395,
198,
6738,
11507,
1143,
1330,
11507,
1143,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
705... | 3.2 | 55 |
import requests
import time
import json
url = 'https://api.opendota.com/api/'
gang = {
'will': {
'name': 'Will',
'pid': '67798385'
},
'pat': {
'name': 'Pat',
'pid': '52147853'
},
'james': {
'name': 'James',
'pid': '84941438'
... | [
11748,
7007,
201,
198,
11748,
640,
201,
198,
11748,
33918,
201,
198,
201,
198,
6371,
796,
705,
5450,
1378,
15042,
13,
404,
437,
4265,
13,
785,
14,
15042,
14,
6,
201,
198,
201,
198,
28284,
796,
1391,
201,
198,
220,
220,
220,
705,
1... | 1.963597 | 934 |
"""A series of conversion tools for Quaternions and Euler Angles.
These functions are modified versions of the algorithms found here:
https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles
Written by: Zahi Kakish (zmk5)
"""
from typing import Tuple
import numpy as np
def quaternion_to_roll(... | [
37811,
32,
2168,
286,
11315,
4899,
329,
2264,
9205,
507,
290,
412,
18173,
2895,
829,
13,
198,
198,
4711,
5499,
389,
9518,
6300,
286,
262,
16113,
1043,
994,
25,
198,
5450,
1378,
268,
13,
31266,
13,
2398,
14,
15466,
14,
3103,
9641,
62... | 1.865779 | 1,803 |
#!/usr/bin/python3
import sys
if sys.version_info[0] != 3:
print("This script requires Python 3")
exit(1)
import sys
for folder in 'py-json', 'py-scripts':
if folder not in sys.path:
sys.path.append(f'../lanforge/lanforge-scripts/{folder}')
sys.path.append(f'../libs/lanforge')
sys.path.append(f... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
25064,
198,
198,
361,
25064,
13,
9641,
62,
10951,
58,
15,
60,
14512,
513,
25,
198,
220,
220,
220,
3601,
7203,
1212,
4226,
4433,
11361,
513,
4943,
198,
220,
220,
220,
8420,
... | 3.031288 | 831 |
#07 - Crie um programa onde o usuário possa digitar sete valores numéricos e cadastre-os em uma lista única que mantenha separados os valores pares e ímpares. No final, mostre os valores pares e ímpares em ordem crescente.
numeros = list() # lista geral contendo todos os números
listaPar = list() # lista contendo ape... | [
2,
2998,
532,
327,
5034,
23781,
1430,
64,
319,
2934,
267,
514,
84,
6557,
27250,
1184,
64,
3100,
7940,
900,
68,
1188,
2850,
997,
2634,
1173,
418,
304,
20603,
459,
260,
12,
418,
795,
334,
2611,
1351,
64,
6184,
118,
77,
3970,
8358,
2... | 2.462963 | 432 |
from pure_fb_openmetrics_exporter.flashblade_collector.flashblade_metrics.array_performance_metrics import ArrayPerformanceMetrics
| [
6738,
5899,
62,
21855,
62,
9654,
4164,
10466,
62,
1069,
26634,
13,
34167,
22500,
62,
33327,
273,
13,
34167,
22500,
62,
4164,
10466,
13,
18747,
62,
26585,
62,
4164,
10466,
1330,
15690,
32273,
9171,
10466,
628
] | 3.666667 | 36 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
requests_cache.backends.dynamodb
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``dynamodb`` cache backend
"""
from .base import BaseCache
from .storage.dynamodbdict import DynamoDbDict
class DynamoDbCache(BaseCache):
""" ``dynamodb`` cache backend.
"""
def _... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
7007,
62,
23870,
13,
1891,
2412,
13,
67,
4989,
375,
65,
198,
220,
220,
220,
220,
27156,
... | 1.927393 | 606 |
import pathlib
from setuptools import setup, find_packages
HERE = pathlib.Path(__file__).parent
README = (HERE / "ReadMe.md").read_text()
setup(
name="dataclasses_ujson",
version="0.0.14",
packages=find_packages(exclude=("tests*","bench_marks.py")),
author="Kislenko Artem ",
author_email="artem@we... | [
11748,
3108,
8019,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
39,
9338,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
8000,
198,
15675,
11682,
796,
357,
39,
9338,
1220,
366,
5569,
5308,
13,
9132,
... | 2.455621 | 338 |
"""
Backend for test environment.
"""
from django.core import cache
from django.core.mail.backends.base import BaseEmailBackend
from .. import settings as mailviewer_settings
class EmailBackend(BaseEmailBackend):
"""
An email backend to use during testing and local development with Django Mail Viewer.
U... | [
37811,
198,
7282,
437,
329,
1332,
2858,
13,
198,
37811,
198,
6738,
42625,
14208,
13,
7295,
1330,
12940,
198,
6738,
42625,
14208,
13,
7295,
13,
4529,
13,
1891,
2412,
13,
8692,
1330,
7308,
15333,
7282,
437,
198,
198,
6738,
11485,
1330,
... | 2.688663 | 591 |
import sys
from itertools import combinations
data = [int(line.strip()) for line in sys.stdin.readlines()]
preamble = int(sys.argv[1])
idx = preamble
while idx < len(data):
found = False
for (a,b) in combinations(data[idx-preamble:idx], 2):
if a + b == data[idx]:
found = True
... | [
11748,
25064,
198,
6738,
340,
861,
10141,
1330,
17790,
198,
198,
7890,
796,
685,
600,
7,
1370,
13,
36311,
28955,
329,
1627,
287,
25064,
13,
19282,
259,
13,
961,
6615,
3419,
60,
198,
198,
79,
1476,
903,
796,
493,
7,
17597,
13,
853,
... | 2.06267 | 367 |
from models import Patient
from .mutation_type import mutation
from authentication.authentication import needsAuthorization
from graphql.type import GraphQLResolveInfo
from datacreators.patient import CreatePatient
from SdTypes import Permissions
@mutation.field("createPatient")
@needsAuthorization([Permissions.PATIE... | [
6738,
4981,
1330,
35550,
198,
6738,
764,
76,
7094,
62,
4906,
1330,
15148,
198,
6738,
18239,
13,
41299,
3299,
1330,
2476,
13838,
1634,
198,
6738,
4823,
13976,
13,
4906,
1330,
29681,
9711,
4965,
6442,
12360,
198,
6738,
4818,
330,
630,
669... | 3.952381 | 84 |
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
FILE:... | [
2,
16529,
35937,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321,
13,
198,
2,
16529,
35937,
198,
3... | 3.779264 | 299 |
import imgaug as ia
from imgaug import augmenters as iaa
import numpy as np
import random
import cv2
brightness = iaa.Add((-7, 7), per_channel=0.5)
contrast = iaa.LinearContrast((0.8, 1.6), per_channel=0.5)
perspective = iaa.PerspectiveTransform(scale=(0.025, 0.090))
gaussian_noise = iaa.AdditiveGaussianNoise... | [
11748,
33705,
7493,
355,
220,
544,
201,
198,
6738,
33705,
7493,
1330,
35016,
364,
355,
220,
544,
64,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
4738,
201,
198,
11748,
269,
85,
17,
201,
198,
201,
198,
29199,
1108,
796,
... | 1.622276 | 826 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: injective/peggy/v1/msgs.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
fro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
8677,
425,
14,
431,
19970,
14,
85,
16,
14,
907,
14542,
13,
1676,
1462,
... | 2.384414 | 22,957 |
n = conta = soma = 0
n = int(input('Digite um valor para soma (999 para SAIR): '))
while n != 999:
soma = soma + n
conta = conta + 1
n = int(input('Digite um valor para soma (999 para SAIR): '))
print(f'A SOMA DOS {conta} VALORES É IGUAL Á {soma}.')
| [
77,
796,
542,
64,
796,
3870,
64,
796,
657,
198,
77,
796,
493,
7,
15414,
10786,
19511,
578,
23781,
1188,
273,
31215,
3870,
64,
357,
17032,
31215,
14719,
4663,
2599,
705,
4008,
198,
4514,
299,
14512,
36006,
25,
198,
220,
220,
220,
387... | 2.193548 | 124 |
from keras.datasets import imdb
import keras
from keras.models import Sequential
from keras.layers.embeddings import Embedding
from keras.layers import Flatten, Dense
from keras.preprocessing import sequence
from numpy import array
(x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=5000)
word_t... | [
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
545,
9945,
201,
198,
11748,
41927,
292,
201,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
201,
198,
6738,
41927,
292,
13,
75,
6962,
13,
20521,
67,
654,
1330,
13302,
6048,
278,
201,... | 2.507018 | 570 |
"""
Otsu thresholding
==================
This example illustrates automatic Otsu thresholding.
"""
import matplotlib.pyplot as plt
from skimage import data
from skimage import filters
from skimage import exposure
camera = data.camera()
val = filters.threshold_otsu(camera)
hist, bins_center = exposure.histogram(came... | [
37811,
198,
46,
912,
84,
11387,
278,
198,
4770,
855,
198,
198,
1212,
1672,
21290,
11353,
440,
912,
84,
11387,
278,
13,
198,
37811,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1341,
9060,
1330,
1366,
... | 2.726141 | 241 |
from BS.utils import read_src_bs, save_bs_dicts_to_txt, read_src_socket_bs, save_socket_bs_dicts_to_txt
if __name__ == '__main__':
change_template_bg()
| [
6738,
24218,
13,
26791,
1330,
1100,
62,
10677,
62,
1443,
11,
3613,
62,
1443,
62,
11600,
82,
62,
1462,
62,
14116,
11,
1100,
62,
10677,
62,
44971,
62,
1443,
11,
3613,
62,
44971,
62,
1443,
62,
11600,
82,
62,
1462,
62,
14116,
628,
628... | 2.424242 | 66 |
#!/usr/bin/env python
convert("config/luxisr.ttf", "luxibytes")
convert("config/luximr.ttf", "luximonobytes")
convert("config/DejaVuSans.ttf", "dejabytes")
convert("config/DejaVuSansMono.ttf", "dejamonobytes")
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
1102,
1851,
7203,
11250,
14,
22564,
271,
81,
13,
926,
69,
1600,
366,
22564,
571,
88,
4879,
4943,
198,
1102,
1851,
7203,
11250,
14,
22564,
320,
81,
13,
926,
69,
1600,
366,
22564,... | 2.244681 | 94 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 25 15:32:42 2018
@author: benmo
"""
import pandas as pd, numpy as np
from .functions import *
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
7031,
2447,
1679,
1315,
25,
2624,
25,
3682,
2864,
198,
198,
31,
9800,
25,
1888,
5908,
198... | 2.030928 | 97 |
import poly
| [
11748,
7514,
201
] | 4 | 3 |
from src.dataset import CatDogDataset
from src.utils import *
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import os
_CUDA_FLAG = torch.cuda.is_available()
| [
6738,
12351,
13,
19608,
292,
316,
1330,
5181,
32942,
27354,
292,
316,
198,
6738,
12351,
13,
26791,
1330,
1635,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
17401,
198,
6738,
28034,
13,
26791,
13,
83,
22854,
3526,
1330,
21293,
3437... | 3.258065 | 62 |
from contextvars import ContextVar
current_user_role = ContextVar('role', default=None)
list_of_roles = ContextVar('roles', default=None)
current_user = ContextVar('users_ID', default=None)
headers = ContextVar('headers', default={})
nrpayload = ContextVar('nrpayload', default=None)
tid = ContextVar('tid', default=No... | [
6738,
4732,
85,
945,
1330,
30532,
19852,
628,
198,
14421,
62,
7220,
62,
18090,
796,
30532,
19852,
10786,
18090,
3256,
4277,
28,
14202,
8,
198,
4868,
62,
1659,
62,
305,
829,
796,
30532,
19852,
10786,
305,
829,
3256,
4277,
28,
14202,
8,... | 3.367232 | 177 |