content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from django.shortcuts import get_object_or_404, render
import json
from lxml import etree
from .models import Project, TestResult
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
11,
8543,
198,
11748,
33918,
198,
6738,
300,
19875,
1330,
2123,
631,
198,
198,
6738,
764,
27530,
1330,
4935,
11,
6208,
23004,
628,
628,
198
] | 3.461538 | 39 |
"""Test Recipe against multiple database engines"""
import os
from datetime import date, datetime
from sqlalchemy import Column, Date, DateTime, Integer, MetaData, String, Table, insert
from recipe import Recipe, Shelf, get_oven
| [
37811,
14402,
26694,
1028,
3294,
6831,
11874,
37811,
198,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
7536,
11,
7536,
7575,
11,
34142,
11,
30277,
6601,
11,
10... | 3.9 | 60 |
from __future__ import annotations
from datetime import datetime
import os
from typing import Dict, Optional, TYPE_CHECKING
from farmos_ext.farmobj import FarmObj
if TYPE_CHECKING:
from farmos_ext.farm import Farm # pylint: disable=cyclic-import
| [
201,
198,
6738,
11593,
37443,
834,
1330,
37647,
201,
198,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
11748,
28686,
201,
198,
201,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
11,
41876,
62,
50084,
2751,
201,
198,
201,
198... | 2.903226 | 93 |
from rockstarlifestyle import imcrop as iC
import pandas as pd
import skimage
import skimage.io as sio
import random
import numpy as np
def test_stackmrh():
"""
Testing stackmrh() function
"""
img_stack = []
for k in range(3):
img_stack.append([])
for i in range(256):
i... | [
6738,
3881,
301,
7063,
42004,
1330,
545,
31476,
355,
1312,
34,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
1341,
9060,
198,
11748,
1341,
9060,
13,
952,
355,
264,
952,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
628,
19... | 1.868367 | 1,451 |
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: OMD
# Description: Tests for XML generator
#
# Modifications:
# Date Name Modification
# ---- ---- ---------... | [
2,
41906,
17174,
9,
198,
2,
220,
15069,
2211,
17168,
12406,
18643,
220,
220,
198,
2,
220,
4935,
25,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6226,
1503,
198,
2,
220,
46665,
25,
220,
220,
220,
220,
220,
220,
220,
22... | 2.549533 | 535 |
import sys
sys.path.append('/Users/rondinellimorais/Desktop/projetos/chess_recognition/src')
import time
import cv2
import imutils
import numpy as np
from model import *
camera = Camera(cam_address='/Volumes/ROND/chess/video/fake_cam.mp4')
calibration = ChessboardCalibration()
calibration.loadMapping()
while True:
... | [
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
10786,
14,
14490,
14,
81,
623,
500,
297,
320,
5799,
271,
14,
36881,
14,
1676,
31173,
418,
14,
2395,
824,
62,
26243,
653,
14,
10677,
11537,
198,
198,
11748,
640,
198,
11748,
269,
85,
17,... | 2.619938 | 321 |
from flask_wtf import FlaskForm
from wtforms import StringField, TextField, PasswordField
from wtforms.validators import DataRequired, Email
| [
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
266,
83,
23914,
1330,
10903,
15878,
11,
8255,
15878,
11,
30275,
15878,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
6060,
37374,
11,
9570,
628,
628
] | 3.891892 | 37 |
import os
import shutil
import unittest
from looptools import Timer
from mysql.toolkit import MySQL
TEST_DATA_DIR = os.path.join(os.path.dirname(__file__), 'data')
FAILS_DIR = os.path.join(os.path.dirname(__file__), 'data', 'fails')
if __name__ == '__main__':
unittest.main()
| [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
555,
715,
395,
198,
6738,
2376,
8738,
10141,
1330,
5045,
263,
198,
6738,
48761,
13,
25981,
15813,
1330,
33476,
628,
198,
51,
6465,
62,
26947,
62,
34720,
796,
28686,
13,
6978,
13,
22179,
... | 2.590909 | 110 |
"""
Contains some data structures.
"""
from webob.util.dictmixin import DictMixin
class EnvironHeaders(DictMixin):
"""An object that represents the headers as present in a
WSGI environment.
This object is a wrapper (with no internal state) for a WSGI
request object, representing the CGI-style HTTP_* ... | [
37811,
198,
4264,
1299,
617,
1366,
8573,
13,
198,
37811,
198,
198,
6738,
3992,
672,
13,
22602,
13,
11600,
19816,
259,
1330,
360,
713,
35608,
259,
198,
198,
4871,
2039,
2268,
13847,
364,
7,
35,
713,
35608,
259,
2599,
198,
220,
220,
2... | 3.358621 | 145 |
class minha_classe():
'''Revisitando classes no Python'''
num = 1234
print(minha_classe.minha_funcao(self='hemm!!'))
x = minha_classe('Elias', 'Machado', 'Algarve')
print(x.__doc__)
print(x.minha_funcao())
print(x.mostra_construtor())
| [
4871,
949,
3099,
62,
565,
21612,
33529,
198,
220,
220,
220,
705,
7061,
18009,
271,
270,
25440,
6097,
645,
11361,
7061,
6,
198,
220,
220,
220,
997,
796,
1105,
2682,
198,
198,
4798,
7,
1084,
3099,
62,
565,
21612,
13,
1084,
3099,
62,
... | 2.280374 | 107 |
# This file is part of the Indico plugins.
# Copyright (C) 2002 - 2019 CERN
#
# The Indico plugins are free software; you can redistribute
# them and/or modify them under the terms of the MIT License;
# see the LICENSE file for more details.
from __future__ import unicode_literals
from indico.core.plugins import Indi... | [
2,
770,
2393,
318,
636,
286,
262,
1423,
3713,
20652,
13,
198,
2,
15069,
357,
34,
8,
6244,
532,
13130,
327,
28778,
198,
2,
198,
2,
383,
1423,
3713,
20652,
389,
1479,
3788,
26,
345,
460,
17678,
4163,
198,
2,
606,
290,
14,
273,
130... | 2.405908 | 914 |
import tensorflow as tf
from tensorflow.keras.layers import Input, SeparableConv2D, PReLU, Multiply
| [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
23412,
11,
8621,
283,
540,
3103,
85,
17,
35,
11,
350,
3041,
41596,
11,
7854,
541,
306,
628,
198
] | 2.756757 | 37 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the UTMP binary file event formatter."""
import unittest
from plaso.formatters import utmpx
from tests.formatters import test_lib
class UtmpxSessionFormatterTest(test_lib.EventFormatterTestCase):
"""Tests for the UTMP session event formatter."""
def testI... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
262,
19255,
7378,
13934,
2393,
1785,
1296,
1436,
526,
15931,
198,
198,
11748,
555,
715,
395,
198,
198,
... | 2.764881 | 336 |
import math
from flask import Flask, render_template, request, flash
from random import shuffle
import pandas as pd
app = Flask(__name__)
app.secret_key = 'super secret'
@app.route('/', methods=['GET','POST'])
@app.route('/dataset')
#Fungsi Evaluasi
if __name__ == '__main__':
app.run(debug=True, port=5000) | [
11748,
10688,
198,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
7644,
198,
6738,
4738,
1330,
36273,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
1324,
13,
21078,
6... | 2.787611 | 113 |
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..c3 import C3d
| [
2,
47044,
46,
12,
35353,
1137,
11617,
416,
4899,
14,
42116,
431,
6359,
13,
9078,
532,
8410,
5626,
48483,
198,
6738,
11485,
66,
18,
1330,
327,
18,
67,
628,
198
] | 2.566667 | 30 |
from urllib import urlretrieve, urlopen
from threading import Thread, activeCount
from time import sleep
from json import loads
from os import path
from sys import exit
| [
6738,
2956,
297,
571,
1330,
19016,
1186,
30227,
11,
19016,
9654,
198,
6738,
4704,
278,
1330,
14122,
11,
4075,
12332,
198,
6738,
640,
1330,
3993,
198,
6738,
33918,
1330,
15989,
198,
6738,
28686,
1330,
3108,
198,
6738,
25064,
1330,
8420,
... | 4.121951 | 41 |
receipt_format = {
'transaction_id': '',
'external_id': '',
'total': 0,
'currency': 'GBP',
'items': []
}
line_item_format = {
'description': '',
'amount': '',
'currency': 'GBP'
} | [
260,
344,
10257,
62,
18982,
796,
1391,
198,
220,
220,
220,
705,
7645,
2673,
62,
312,
10354,
705,
3256,
198,
220,
220,
220,
705,
22615,
62,
312,
10354,
705,
3256,
198,
220,
220,
220,
705,
23350,
10354,
657,
11,
198,
220,
220,
220,
... | 2.11 | 100 |
import tkinter
import cv2
import PIL.Image,PIL.ImageTk
import time
if __name__ == "__main__":
videofile="box.mp4"
start_frame=100
end_frame=200
App(tkinter.Tk(),"Tkinter and OpenCV",start_frame,end_frame,videofile)
| [
11748,
256,
74,
3849,
198,
11748,
269,
85,
17,
198,
11748,
350,
4146,
13,
5159,
11,
47,
4146,
13,
5159,
51,
74,
198,
11748,
640,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
... | 2.252336 | 107 |
"""
@Author 林景恒
@Date 20200719
@LastModifyDate --
@Desc 获取菜品信息,如列表、详情
"""
from django.http import HttpResponse
from xcx_interface.utils.util import convertJson
from xcx_interface.utils.util import executeSelect, resSuccess, resError, convertJsonAscii
# 获取菜品列表信息
# 获取菜品详情
| [
37811,
198,
31,
13838,
10545,
252,
245,
162,
247,
107,
162,
223,
240,
198,
31,
10430,
1160,
12726,
1129,
198,
31,
5956,
5841,
1958,
10430,
1377,
198,
31,
24564,
5525,
236,
115,
20998,
244,
164,
237,
250,
161,
241,
223,
46479,
94,
16... | 1.774194 | 155 |
# REQUIRES: bindings_python
# RUN: %PYTHON %s
import mlir.ir
from mlir.dialects import builtin
import scalehls
from scalehls.dialects import hlscpp
| [
2,
4526,
10917,
4663,
1546,
25,
34111,
62,
29412,
198,
2,
32494,
25,
4064,
47,
56,
4221,
1340,
4064,
82,
198,
198,
11748,
25962,
343,
13,
343,
198,
6738,
25962,
343,
13,
38969,
478,
82,
1330,
3170,
259,
198,
11748,
5046,
71,
7278,
... | 2.568966 | 58 |
from typing import List
import tensorflow as tf
from tensorflow.keras.layers import Dense
"""Possible agent network structures implemented as Tensorflow Modules"""
class QNetwork:
"""Create the neural network architecture for the DQN agent."""
| [
6738,
19720,
1330,
7343,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
6122,
292,
13,
75,
6962,
1330,
360,
1072,
198,
198,
37811,
47,
4733,
5797,
3127,
8573,
9177,
355,
309,
22854,
11125,
3401,
5028,
... | 3.761194 | 67 |
# -*- coding: utf-8 -*-
#
# Copyright 2012-2014 Romain Dorgueil
#
# 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 appli... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
2321,
12,
4967,
3570,
391,
360,
2398,
518,
346,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341... | 2.580913 | 1,446 |
import spacy
import re
from gensim.parsing.preprocessing import remove_stopwords, strip_multiple_whitespaces
# Also function used in search package
# Process content for search
| [
11748,
599,
1590,
198,
11748,
302,
198,
6738,
308,
641,
320,
13,
79,
945,
278,
13,
3866,
36948,
1330,
4781,
62,
11338,
10879,
11,
10283,
62,
48101,
62,
1929,
2737,
43076,
198,
198,
2,
4418,
2163,
973,
287,
2989,
5301,
628,
198,
2,
... | 3.75 | 48 |
import cv2
import numpy as np
import matplotlib.pyplot as plt
# affine
# Read image
_img = cv2.imread("imori.jpg").astype(np.float32)
# Affine
A = 30.
theta = - np.pi * A / 180.
out = affine(_img, a=np.cos(theta), b=-np.sin(theta), c=np.sin(theta), d=np.cos(theta),
tx=0, ty=0)
# Save result
cv2.imshow("result"... | [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
2,
1527,
500,
198,
198,
2,
4149,
2939,
198,
62,
9600,
796,
269,
85,
17,
13,
320,
961,
7203,
320,
10145... | 2.163743 | 171 |
import numpy
import sounddevice
import time
import math
fs = 48000
sounddevice.default.samplerate=fs
G = numpy.zeros(int(0.125*fs))
hz=783 #G
for x in range(len(G)):
G[x]= round(math.sin(2*math.pi*x*hz/fs))
Ab = numpy.zeros(int(.125*fs))
hz=415 #G
for x in range(len(Ab)):
Ab[x]= round(math.sin(2*math.pi*x*hz/fs))... | [
11748,
299,
32152,
220,
198,
11748,
2128,
25202,
198,
11748,
640,
198,
11748,
10688,
198,
9501,
796,
4764,
830,
220,
198,
23661,
25202,
13,
12286,
13,
37687,
20053,
378,
28,
9501,
198,
38,
796,
299,
32152,
13,
9107,
418,
7,
600,
7,
... | 1.890954 | 807 |
# -*- coding: utf-8 -*- #
# Copyright 2017 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
1303,
198,
2,
15069,
2177,
3012,
11419,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,... | 2.870459 | 4,377 |
''' Character Class
Character class for py-fighter game.
Takes input of character data, screen, x position, and y position.
Has functions to make move.
- character_data takes the form of a Python dictionary with all key
components and data for character. This is usually stored in a JSON. We
have decided to impleme... | [
7061,
6,
15684,
5016,
198,
198,
27275,
1398,
329,
12972,
12,
24733,
983,
13,
198,
51,
1124,
5128,
286,
2095,
1366,
11,
3159,
11,
2124,
2292,
11,
290,
331,
2292,
13,
198,
198,
19242,
5499,
284,
787,
1445,
13,
198,
198,
12,
2095,
62... | 2.324185 | 8,927 |
import pandas as pd
import scipy as sp
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.model_selection import train_test_split
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
629,
541,
88,
355,
599,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
1330,
360,
713,
38469,
7509,
198,
6738,
1341,
35720,
13,
30053,
62,
2302,
7861,
13,
5239,
1330,
309,
69,
312,
69... | 3.45 | 60 |
from . import Plugin
# vim: ts=4 et sw=4:
| [
6738,
764,
1330,
42636,
628,
198,
2,
43907,
25,
40379,
28,
19,
2123,
1509,
28,
19,
25,
198
] | 2.444444 | 18 |
''' Config loader for production environment '''
import os
import yaml
#pylint: disable=R0903
class ProductionConfig():
''' Config loader for production environment '''
CORS_AUTOMATIC_OPTIONS = True
api_context = os.getenv('API_CONTEXT')
IMPALA_HOST = os.getenv('IMPALA_HOST')
IMPALA_PORT = os.get... | [
7061,
6,
17056,
40213,
329,
3227,
2858,
705,
7061,
198,
11748,
28686,
198,
11748,
331,
43695,
198,
198,
2,
79,
2645,
600,
25,
15560,
28,
49,
2931,
3070,
198,
4871,
19174,
16934,
33529,
198,
220,
220,
220,
705,
7061,
17056,
40213,
329,... | 2.071311 | 1,220 |
# Copyright (c) 2010-2022 openpyxl
import pytest
from .. import (
column_index_from_string,
get_column_letter,
absolute_coordinate,
get_column_interval,
)
from ..cell import coordinate_from_string
@pytest.mark.parametrize("value", ['AAA', "AQ0"])
@pytest.mark.parametrize("coord, result",
... | [
2,
15069,
357,
66,
8,
3050,
12,
1238,
1828,
1280,
9078,
87,
75,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
11485,
1330,
357,
198,
220,
220,
220,
5721,
62,
9630,
62,
6738,
62,
8841,
11,
198,
220,
220,
220,
651,
62,
28665,
62,
... | 1.321656 | 2,826 |
#!/usr/bin/env python3
l = list(sorted(map(int, input().split(','))))
c = min(range(l[0], l[-1]+1), key=dists)
print(dists(c))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
75,
796,
1351,
7,
82,
9741,
7,
8899,
7,
600,
11,
5128,
22446,
35312,
7,
41707,
35514,
198,
198,
66,
796,
949,
7,
9521,
7,
75,
58,
15,
4357,
300,
58,
12,
16,
48688,
16,... | 2.114754 | 61 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 3.59375 | 128 |
# coding=utf-8
import math
import random
import string
random.seed(0)
# 生成区间[a, b)内的随机数
# 生成大小 I*J 的矩阵,默认零矩阵 (当然,亦可用 NumPy 提速)
# 函数 sigmoid,这里采用 tanh,因为看起来要比标准的 1/(1+e^-x) 漂亮些
# 函数 sigmoid 的派生函数, 为了得到输出 (即:y)
class NN:
''' 三层反向传播神经网络 '''
def backPropagate(self, targets, N, M):
''' 反向传播 '''... | [
2,
19617,
28,
40477,
12,
23,
628,
198,
11748,
10688,
198,
11748,
4738,
198,
11748,
4731,
198,
198,
25120,
13,
28826,
7,
15,
8,
628,
198,
2,
13328,
242,
253,
22755,
238,
44293,
118,
29785,
112,
58,
64,
11,
275,
8,
37863,
227,
21410... | 1.423276 | 1,160 |
# coding: utf-8
"""
TGS API
A production scale tool for BYOND server management # noqa: E501
OpenAPI spec version: 9.0.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RepositoryResponse(object):
"""NOTE: This c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
309,
14313,
7824,
628,
220,
220,
220,
317,
3227,
5046,
2891,
329,
11050,
18672,
4382,
4542,
220,
1303,
645,
20402,
25,
412,
33548,
628,
220,
220,
220,
4946,
17614,... | 2.49305 | 8,273 |
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.auth import views as auth_views
urlpatterns = [
# Admin
url(r'^admin/', admin.site.urls),
# Core app
url(r'^', include('apps.core.urls', namespace='core')),
# Accounts app
url(r'^accounts/', include(... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
2291,
11,
19016,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
5009,
355,
6284,
62,
33571,
628,
198,
6371,
33279,
82,
7... | 2.131696 | 448 |
# Data preprocessing for Supervised Learning model
# Import relevant libraries
import sys
import numpy as np
import pandas as pd
from pandas.api.types import infer_dtype
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.impute import SimpleImputer
from sklearn.preprocessing import LabelEncoder
def... | [
2,
6060,
662,
36948,
329,
3115,
16149,
18252,
2746,
198,
198,
2,
17267,
5981,
12782,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
19798,
292,
13,
15042,
13,
19199,
1330,
... | 2.518802 | 2,872 |
import os
import boto3
import logging
from enum import Enum
from .param_store_result import ParamStoreResult
class ParamStore:
"""Provides access to key/values (variables) stored locally on the OS or AWS SSM.
examples:
# Set and get a value in SSM:
ParamStore.set('MY_VAR', '123')
my_... | [
11748,
28686,
198,
11748,
275,
2069,
18,
198,
11748,
18931,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
764,
17143,
62,
8095,
62,
20274,
1330,
25139,
22658,
23004,
628,
198,
4871,
25139,
22658,
25,
198,
220,
220,
220,
37227,
15946,
14... | 2.123321 | 3,722 |
"""empty message
Revision ID: 40_sent_at_column
Revises: 30_remove_locked_column
Create Date: 2015-10-19 13:06:22.579436
"""
# revision identifiers, used by Alembic.
revision = '40_sent_at_column'
down_revision = '30_remove_locked_column'
from alembic import op
import sqlalchemy as sa
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
2319,
62,
34086,
62,
265,
62,
28665,
198,
18009,
2696,
25,
1542,
62,
28956,
62,
24162,
62,
28665,
198,
16447,
7536,
25,
1853,
12,
940,
12,
1129,
1511,
25,
3312,
25,
1828,
13,
3553... | 2.780952 | 105 |
#!/usr/bin/python
from messaging_client.app import App
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
6738,
19925,
62,
16366,
13,
1324,
1330,
2034,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.714286 | 35 |
import json
from datetime import datetime, date
from django.shortcuts import render, HttpResponse
from repository import models
| [
11748,
33918,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
3128,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
367,
29281,
31077,
198,
6738,
16099,
1330,
4981,
628,
628,
628,
628,
628
] | 3.942857 | 35 |
from iqoptionapi.stable_api import IQ_Option
from datetime import datetime
from time import time, sleep
import os
import layouts
import variables
| [
6738,
1312,
80,
18076,
15042,
13,
31284,
62,
15042,
1330,
18248,
62,
19722,
201,
198,
6738,
4818,
8079,
1330,
4818,
8079,
201,
198,
6738,
640,
1330,
640,
11,
3993,
201,
198,
11748,
28686,
201,
198,
201,
198,
11748,
38489,
201,
198,
11... | 3.477273 | 44 |
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
TEST BASE IMAGE
Test base image management.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2021 Pablo Pizarro R. @ppizarror
Permission is hereby granted, free of charge, to any pers... | [
37811,
198,
9078,
6057,
12,
26272,
198,
5450,
1378,
12567,
13,
785,
14,
381,
528,
283,
1472,
14,
9078,
6057,
12,
26272,
198,
198,
51,
6465,
49688,
8959,
11879,
198,
14402,
2779,
2939,
4542,
13,
198,
198,
34156,
25,
198,
10097,
24305,
... | 3.688017 | 484 |
from keras.preprocessing.image import img_to_array
| [
6738,
41927,
292,
13,
3866,
36948,
13,
9060,
1330,
33705,
62,
1462,
62,
18747,
628,
220,
220,
220,
220
] | 2.947368 | 19 |
from elementae import unscape, Usuarium, usuarios
import pytest
"""
Here we test our Database interactive Object
"""
from elementae import DanSQL
# class sqlLists():
# def __init__(self):
# attempt = DanSQL
"""
Here we test the AppLogic module
"""
from App... | [
6738,
5002,
3609,
1330,
555,
6794,
11,
471,
2385,
17756,
11,
514,
84,
13010,
198,
11748,
12972,
9288,
628,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628,
628,
628,
628,
198,
198,
37811,
198,
4342,
356,
1332,
674,
24047,
14333,
95... | 2.711934 | 243 |
import torch
| [
11748,
28034,
628
] | 4.666667 | 3 |
from django.urls import include, path
from .views import index, index_mview
urlpatterns = [
path('', index, name='index_stats'),
path('mobile-view/', index_mview, name='index_stats_mview'),
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
2291,
11,
3108,
198,
6738,
764,
33571,
1330,
6376,
11,
6376,
62,
76,
1177,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
6376,
11,
1438,
11639,
9630,
62,
34242,
3... | 2.857143 | 70 |
# Copyright 2020 Toyota Research Institute. All rights reserved.
import torch
import torch.nn as nn
import numpy as np
from packnet_sfm.utils.image import match_scales, interpolate_image
from packnet_sfm.losses.loss_base import LossBase, ProgressiveScaling
###########################################################... | [
2,
15069,
12131,
20182,
4992,
5136,
13,
220,
1439,
2489,
10395,
13,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
2353,
3262,
62,
28202,
76,
13,
26791,
13,
9060... | 2.197141 | 3,008 |
# from django.urls import path, include
# from .views import ResourcesModelAPI,JobAPI,ResourcesDetailAPI,JobListAPI,ResourcesCreateAPI,ResourcesDeleteAPI,CreateJobAPI,DeleteJobAPI
# urlpatterns = [
# path('resources/',ResourcesModelAPI.as_view(),name="list-resources"),
# path('resources/<int:pk>/',Resourc... | [
2,
422,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
2291,
201,
198,
2,
422,
764,
33571,
1330,
13864,
17633,
17614,
11,
33308,
17614,
11,
33236,
11242,
603,
17614,
11,
33308,
8053,
17614,
11,
33236,
16447,
17614,
11,
33236,
38727,
17614,... | 2.657492 | 327 |
from model.resnet50 import model32_val1,model33_val1, model34_val1, model35_val1, model36_val1
from model.resnet50 import model37_val1, model38_val1, model39_val1, model40_val1, model41_val1
model37_val1.train()
model38_val1.train()
model39_val1.train()
model40_val1.train()
model41_val1.train()
| [
6738,
2746,
13,
411,
3262,
1120,
1330,
2746,
2624,
62,
2100,
16,
11,
19849,
2091,
62,
2100,
16,
11,
2746,
2682,
62,
2100,
16,
11,
2746,
2327,
62,
2100,
16,
11,
2746,
2623,
62,
2100,
16,
201,
198,
6738,
2746,
13,
411,
3262,
1120,
... | 2.382813 | 128 |
from streamlink.plugins.ntv import NTV
from tests.plugins import PluginCanHandleUrl
| [
6738,
4269,
8726,
13,
37390,
13,
429,
85,
1330,
399,
6849,
198,
6738,
5254,
13,
37390,
1330,
42636,
6090,
37508,
28165,
628
] | 3.863636 | 22 |
import unittest
from .helper import HelperTestCase
| [
11748,
555,
715,
395,
198,
198,
6738,
764,
2978,
525,
1330,
5053,
525,
14402,
20448,
628,
198
] | 3.176471 | 17 |
import inspect
from benchml.basic import * # noqa: F401, F403
from benchml.conformal import * # noqa: F401, F403
from benchml.descriptors import * # noqa: F401, F403
from benchml.ensemble import * # noqa: F401, F403
from benchml.filters import * # noqa: F401, F403
from benchml.inputs import * # noqa: F401, F403
... | [
11748,
10104,
198,
198,
6738,
7624,
4029,
13,
35487,
1330,
1635,
220,
1303,
645,
20402,
25,
376,
21844,
11,
376,
31552,
198,
6738,
7624,
4029,
13,
1102,
687,
282,
1330,
1635,
220,
1303,
645,
20402,
25,
376,
21844,
11,
376,
31552,
198,... | 2.770642 | 218 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Example:
$ python3 main.py --print or python3 main.py --dataset all --print
$ python3 main.py --dataset animal --dump/--print
$ python3 main.py -ds animal -d/-p
"""
import sys
import os
import argparse
from tqdm import tqdm
from utils.ds import load_all... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
16281,
25,
198,
220,
220,
220,
720,
21015,
18,
1388,
13,
9078,
1377,
4798,
393,
21015,
18,
1388,... | 2.451389 | 288 |
relation_mandatory_args = {
"Accident": {"location", "trigger"},
"CanceledRoute": {"location", "trigger"},
"CanceledStop": {"location", "trigger"},
"Delay": {"location", "trigger"},
"Disaster": {"type", "location"},
"Obstruction": {"location", "trigger"},
"RailReplacementService": {"location... | [
49501,
62,
22249,
2870,
62,
22046,
796,
1391,
198,
220,
220,
220,
366,
17320,
738,
1298,
19779,
24886,
1600,
366,
46284,
25719,
198,
220,
220,
220,
366,
34,
590,
992,
43401,
1298,
19779,
24886,
1600,
366,
46284,
25719,
198,
220,
220,
... | 2.18199 | 6,863 |
"""
solution AdventOfCode 2019 day 13 part 2.
https://adventofcode.com/2019/day/13.
author: pca
"""
from general.general import read_file
from general.general import get_location_input_files
from app.int_machine import IntMachine
from enum import Enum
def input_generator(m: IntMachine) -> int:
"""
Provid... | [
37811,
198,
82,
2122,
33732,
5189,
10669,
13130,
1110,
1511,
636,
362,
13,
198,
198,
5450,
1378,
324,
1151,
1659,
8189,
13,
785,
14,
23344,
14,
820,
14,
1485,
13,
198,
198,
9800,
25,
279,
6888,
198,
198,
37811,
198,
198,
6738,
2276,... | 2.452967 | 691 |
"""
🌏 Charamel: Truly Universal Encoding Detection in Python 🌎
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Licensed under Apache 2.0
"""
import collections
import logging
import sys
import time
import warnings
from typing import Any, Dict, Iterator, List, Tuple
import cchardet
import chardet
import ... | [
37811,
198,
8582,
234,
237,
3178,
17983,
25,
49446,
14499,
14711,
7656,
46254,
287,
11361,
12520,
234,
236,
198,
27156,
27156,
27156,
15116,
4907,
93,
198,
198,
26656,
15385,
739,
24843,
362,
13,
15,
198,
37811,
198,
11748,
17268,
198,
... | 1.973034 | 5,340 |
from __future__ import annotations
import os
from typing import List, Generator, Tuple, Optional, Callable, Set
import numpy as np
import sklearn.tree as tree
import matplotlib.pyplot as plt
import trainer.lib as lib
from trainer.demo_data.arc import plot_as_heatmap
from trainer.cg.DtDataset import vis_dec_tree
d... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
11748,
28686,
198,
6738,
19720,
1330,
7343,
11,
35986,
11,
309,
29291,
11,
32233,
11,
4889,
540,
11,
5345,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1341,
35720,
13,
21048,
355,
5509... | 2.178511 | 5,305 |
from dataclasses import dataclass, field
from typing import List, Union
from bindings.gmd.nil_reason_enumeration_value import NilReasonEnumerationValue
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
| [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
19720,
1330,
7343,
11,
4479,
198,
6738,
34111,
13,
70,
9132,
13,
45991,
62,
41181,
62,
268,
6975,
341,
62,
8367,
1330,
29213,
45008,
4834,
6975,
341,
11395,
198,
198... | 3.014286 | 70 |
"""
Django settings for instagram project.
Generated by 'django-admin startproject' using Django 4.0.2.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.0/ref/settings/
"""
import jso... | [
37811,
198,
35,
73,
14208,
6460,
329,
916,
6713,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
604,
13,
15,
13,
17,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,
5450,... | 2.251208 | 3,312 |
import torch
import torch.nn as nn
import torch.nn.functional as F
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
628,
198
] | 3.285714 | 21 |
import os
import glob
def get_image_paths(data_path, categories, num_train_per_cat):
'''
This function returns lists containing the file path for each train
and test image, as well as lists with the label of each train and
test image. By default both lists will be 1500x1, where each
entry is a cha... | [
11748,
28686,
198,
11748,
15095,
628,
198,
4299,
651,
62,
9060,
62,
6978,
82,
7,
7890,
62,
6978,
11,
9376,
11,
997,
62,
27432,
62,
525,
62,
9246,
2599,
198,
220,
220,
220,
705,
7061,
198,
220,
220,
220,
770,
2163,
5860,
8341,
7268... | 2.666667 | 621 |
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from corehq.apps.users.models import WebUser
from corehq.apps.domain.shortcuts import create_domain
from django.test.client import Client
from django.core.urlresolvers import reverse
import os
from couchfor... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
9288,
13,
26791,
1330,
20957,
62,
33692,
198,
6738,
4755,
71,
80,
13,
18211,
13,
18417,
13,
27530,
1330,
5313,... | 3.728477 | 151 |
import asyncio
import os
import uuid
import json
import zmq
import zmq.asyncio
from dataclasses import dataclass
BACKEND = os.environ["BACKEND"]
PORT = os.environ["ZMQ_PORT"]
# zmq SUB socket address
CHAT_ADDRESS = f"tcp://{BACKEND}:{PORT}"
# zmq PUB socket address
TWITCH_ADDRESS = f"tcp://0.0.0.0:{PORT}"
@datacla... | [
11748,
30351,
952,
198,
11748,
28686,
220,
198,
11748,
334,
27112,
198,
11748,
33918,
198,
11748,
1976,
76,
80,
198,
11748,
1976,
76,
80,
13,
292,
13361,
952,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
31098,
10619,
... | 2.465649 | 131 |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | [
2,
15069,
14633,
1096,
11,
3457,
13,
290,
20420,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
5765,
286,
428,
3788,
318,
21825,
416,
262,
7320,
8090,
13789,
198,
2,
3017,
287,
262,
38559,
24290,
2393,
379,
262,
6808,
286,
428,
16099,
... | 2.561576 | 1,827 |
from typing import List
"""
Runtime: 52 ms, faster than 58.42% of Python3 online submissions for N-ary Tree Postorder Traversal.
Memory Usage: 14.8 MB, less than 100.00% of Python3 online submissions for N-ary Tree Postorder Traversal.
"""
| [
6738,
19720,
1330,
7343,
628,
628,
198,
37811,
198,
41006,
25,
6740,
13845,
11,
5443,
621,
7618,
13,
3682,
4,
286,
11361,
18,
2691,
22129,
329,
399,
12,
560,
12200,
2947,
2875,
4759,
690,
282,
13,
198,
30871,
29566,
25,
1478,
13,
23... | 3.485714 | 70 |
import logging
from core.serialization import decode_varint, streamify_if_bytes
from transactions.models import Transaction, TransactionInput, TransactionOutput
logger = logging.getLogger(__name__)
def parse_witness(byte_stream):
""" https://bitcoin.stackexchange.com/a/77190/63266 """
num_stack_items = ... | [
11748,
18931,
198,
198,
6738,
4755,
13,
46911,
1634,
1330,
36899,
62,
7785,
600,
11,
4269,
1958,
62,
361,
62,
33661,
198,
6738,
8945,
13,
27530,
1330,
45389,
11,
45389,
20560,
11,
45389,
26410,
628,
198,
6404,
1362,
796,
18931,
13,
11... | 2.813472 | 193 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.891892 | 37 |
#!/usr/bin/env python
# Copyright 2014 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.
from datetime import datetime
from third_party.testing_utils import testing
import highend
from model.cq_stats import CQStats
from mo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
1946,
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,
198,
2,
1043,... | 3.745283 | 106 |
var = 12
if __name__ == '__main__':
main()
| [
7785,
796,
1105,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.181818 | 22 |
"""
Pool of useful functions for processing surfaces
# Author: Antonio Martinez-Sanchez (Max Planck Institute for Biochemistry)
# Date: 1.05.17
"""
import vtk
import math
import numpy as np
from pyorg import disperse_io
__author__ = 'Antonio Martinez-Sanchez'
# Iso-surface on an input 3D volume
# tomo: input 3D nu... | [
37811,
198,
27201,
286,
4465,
5499,
329,
7587,
16649,
198,
198,
2,
6434,
25,
11366,
20741,
12,
50,
20364,
357,
11518,
5224,
694,
5136,
329,
8436,
37074,
8,
198,
2,
7536,
25,
352,
13,
2713,
13,
1558,
198,
37811,
198,
198,
11748,
410,... | 2.691139 | 2,370 |
"""
parse_configs.py
Implements a method for parsing configuration objects from JSON file.
"""
from __future__ import absolute_import, division, print_function
import argparse
import json
from tensorflow.python.ops.gen_math_ops import log1p_eager_fallback
def parse_configs():
"""Parse configs from JSON file."""... | [
37811,
198,
29572,
62,
11250,
82,
13,
9078,
198,
198,
3546,
1154,
902,
257,
2446,
329,
32096,
8398,
5563,
422,
19449,
2393,
13,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
11748,... | 2.012524 | 1,038 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2020 CERN.
#
# Invenio-Records-Resources is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see LICENSE file for more
# details.
"""Vocabulary API."""
# from babel import Locale, default_locale
# fr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
554,
574,
952,
13,
198,
2,
15069,
357,
34,
8,
12131,
327,
28778,
13,
198,
2,
198,
2,
554,
574,
952,
12,
6690,
3669,
12,
3323... | 2.514986 | 1,101 |
from pkg_resources import parse_version
import kaitaistruct
from kaitaistruct import KaitaiStruct, KaitaiStream, BytesIO
if parse_version(kaitaistruct.__version__) < parse_version('0.9'):
raise Exception("Incompatible Kaitai Struct Python API: 0.9 or later is required, but you have %s" % (kaitaistruct.__version__... | [
6738,
279,
10025,
62,
37540,
1330,
21136,
62,
9641,
198,
11748,
479,
4548,
64,
396,
1356,
198,
6738,
479,
4548,
64,
396,
1356,
1330,
509,
4548,
1872,
44909,
11,
509,
4548,
1872,
12124,
11,
2750,
4879,
9399,
628,
198,
361,
21136,
62,
... | 3.018692 | 107 |
from __future__ import division
from __future__ import print_function
import os.path as osp
import numpy as np
from easydict import EasyDict as edict
__C = edict()
cfg = __C
# Dataset name: flowers, birds
__C.DATASET_NAME = 'birds'
__C.CONFIG_NAME = 'attn2'
__C.DATA_DIR = ''
__C.GPU_ID = 0
__C.CUDA = False
__C.WORK... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
2562,
11600,
1330,
16789,
35,
713,
355,
1225,
713,... | 1.94721 | 663 |
from pyos import Scheduler
if __name__ == '__main__':
sched = Scheduler()
sched.new(foo())
sched.new(bar())
sched.mainloop()
| [
6738,
12972,
418,
1330,
27774,
18173,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
220,
220,
220,
6038,
796,
27774,
18173,
3419,
198,
220,
220,
220,
6038,
13,
3605,
7,
21943,
28955,
198,
220,
220,
220,
6038... | 2.526316 | 57 |
#!/usr/bin/python
"""
(C) Copyright 2018-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
"""
import ctypes
import uuid
def c_uuid_to_str(uuid):
""" utility function to convert a C uuid into a standard string format """
uuid_str = '{:02X}{:02X}{:02X}{:02X}-{:02X}{:02X}-{:02X}{:02X}-{:0... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
37811,
198,
220,
357,
34,
8,
15069,
2864,
12,
1238,
2481,
8180,
10501,
13,
628,
220,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
347,
10305,
12,
17,
12,
2601,
682,
12,
12130,
298,
198,
378... | 1.930108 | 558 |
# Copyright (c) 2016 EMC Corporation
#
# 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 wr... | [
2,
15069,
357,
66,
8,
1584,
412,
9655,
10501,
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.270785 | 2,153 |
# -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# 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,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
3050,
12,
5539,
16749,
2724,
4914,
3831,
1462,
198,
2,
220,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,... | 2.988391 | 603 |
import scipy.stats as _st
# Functions for calculating probability distribution for
# the result.
| [
11748,
629,
541,
88,
13,
34242,
355,
4808,
301,
198,
198,
2,
40480,
329,
26019,
12867,
6082,
329,
198,
2,
262,
1255,
13,
628
] | 4.125 | 24 |
# 9/20/2010: Y.Choi.
# Reflectivity calculation using Parratt's recursive formula
# Calculate reflected intensity as a function of angle or energy
# Needs accesss to index of refraction data
# layer0 is vaccum, layer1 is top film layer ...
import math
import numpy as np
from xraydb import xray_delta_beta
if __nam... | [
2,
860,
14,
1238,
14,
10333,
25,
575,
13,
22164,
72,
13,
198,
2,
36901,
3458,
17952,
1262,
2547,
81,
1078,
338,
45115,
10451,
198,
2,
27131,
378,
12548,
12245,
355,
257,
2163,
286,
9848,
393,
2568,
198,
2,
36557,
1895,
82,
284,
63... | 2.8875 | 160 |
#!/bin/env python3
import argparse
import json
import requests
import time
if __name__ == '__main__':
p = argparse.ArgumentParser(description='adds a single additional train',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
p.add_argument('--url', '-u', nargs='?', default=... | [
2,
48443,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
1822,
29572,
198,
11748,
33918,
198,
11748,
7007,
198,
11748,
640,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
279,
796,
1822,
29572,
13,
28... | 2.605469 | 256 |
#!/usr/bin/env python
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.utils import formatdate
import smtplib
from sys import argv
from account import username, password
fromaddr = argv[1]
toaddr = argv[1]
message = MIMEMultipart()
message['From'] = fromaddr
message['To'] ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
3053,
13,
44,
3955,
3620,
586,
541,
433,
1330,
337,
3955,
3620,
586,
541,
433,
198,
6738,
3053,
13,
44,
3955,
2767,
2302,
1330,
337,
3955,
2767,
2302,
198,
6738,
3053,
13,... | 2.746835 | 237 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import json
import boto3
import logging
# Initialize Logger
LOGGER = logging.getLogger()
LOGGER.setLevel(logging.INFO)
s3_client = boto3.resource('s3')
| [
2,
15069,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
12,
15,
198,
198,
11748,
33918,
198,
11748,
275,
2069,
18,
198,
11748,
18931,
198,
198,
2... | 2.965517 | 87 |
#Analisando condiçôes para formação de triângulos.
#condição de existência: a medida de um lado for menor q a soma dos seus outros 2 segmentos.
print('-=-'*15)
print(' ANALISADOR DE SEGMENTOS')
print('-=-'*15)
r1 = float(input('Informe o primeiro segmento de reta: '))
r2 = float(input('Informe o segundo s... | [
2,
2025,
27315,
25440,
1779,
72,
16175,
27083,
274,
31215,
1296,
64,
16175,
28749,
390,
1333,
22940,
782,
377,
418,
13,
201,
198,
2,
17561,
72,
16175,
28749,
390,
2152,
25792,
10782,
544,
25,
257,
1117,
3755,
390,
23781,
300,
4533,
32... | 2.231939 | 263 |
from __future__ import absolute_import, division, print_function
import libtbx.load_env
from libtbx.str_utils import show_string
import os
import sys
from six.moves import range
op = os.path
font_infos = [
font_info("8x13", "8x13.bdf", 8, 13, 0, -2),
font_info("9x15", "9x15.bdf", 9, 15, 0, -3),
font_info("10x20"... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
11748,
9195,
83,
65,
87,
13,
2220,
62,
24330,
198,
6738,
9195,
83,
65,
87,
13,
2536,
62,
26791,
1330,
905,
62,
8841,
198,
11748,
28686,
198,
11748,
... | 2.291429 | 175 |
#!/usr/bin/env python
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
15069,
2177,
3012,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743... | 3.505967 | 419 |
# -*- coding: utf-8 -*-
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628
] | 1.785714 | 14 |
# -*- coding: utf-8 -*-
"""Functions for calculating the density of an ash particle based upon the
size and composition."""
import numpy as np
def bp2003(diameter, rho_pumice=440, rho_glass=2300):
"""
Return the density of particles of given diameter (m) based on the model
of Bonadonna and Phillips (2003... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
24629,
2733,
329,
26019,
262,
12109,
286,
281,
12530,
18758,
1912,
2402,
262,
198,
7857,
290,
11742,
526,
15931,
198,
198,
11748,
299,
32152,
355,
45941,
628,
198,
... | 2.349938 | 803 |
"""
Shared utility functions used by many tests
"""
import ast
from ast import Expr
from copy import deepcopy
from functools import partial
from importlib import import_module
from importlib.abc import Loader
from importlib.util import module_from_spec, spec_from_loader
from itertools import takewhile
from operator im... | [
37811,
198,
2484,
1144,
10361,
5499,
973,
416,
867,
5254,
198,
37811,
198,
198,
11748,
6468,
198,
6738,
6468,
1330,
1475,
1050,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
1330,
8019,
1330,
1... | 2.200467 | 5,567 |
default_app_config = "viral_videos.apps.ViralVideosAppConfig"
| [
12286,
62,
1324,
62,
11250,
796,
366,
85,
21093,
62,
32861,
13,
18211,
13,
53,
21093,
53,
4921,
4677,
16934,
1,
198
] | 2.818182 | 22 |
import time
import requests
import argparse
from prometheus_client import start_http_server
from kea import KeaExporter
if __name__ == '__main__':
cli()
| [
11748,
640,
198,
198,
11748,
7007,
198,
198,
11748,
1822,
29572,
198,
198,
6738,
1552,
36916,
62,
16366,
1330,
923,
62,
4023,
62,
15388,
198,
198,
6738,
885,
64,
1330,
3873,
64,
3109,
26634,
198,
198,
361,
11593,
3672,
834,
6624,
705,... | 3 | 54 |
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 21 11:11:40 2016
@author: wang1
"""
from __future__ import division
import numpy as np
import warnings
from scipy.sparse import isspmatrix
def nystrom_extension(C, e_vec, e_val):
"""
Pa... | [
2,
38559,
24290,
25,
45157,
1431,
347,
10305,
3740,
1378,
12567,
13,
785,
14,
3020,
79,
17,
14,
28917,
10546,
14,
2436,
672,
14,
9866,
14,
43,
2149,
24290,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,... | 2.172414 | 696 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#coding: UTF-8
from django.db import models, transaction
from diogenis.auth.models import UserProfile
from diogenis.common.helpers import get_hashed_id
from diogenis.schools.e10 import xls_rdr as get_lessons
class School(UserProfile):
'''
Extends UserProfile mo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
66,
7656,
25,
41002,
12,
23,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
8611,
198,
198,
6738,
2566,
... | 2.845494 | 233 |
""" Handlers customized for services
"""
| [
37811,
7157,
8116,
27658,
329,
2594,
198,
198,
37811,
198
] | 4.2 | 10 |
"""
.. module: hubcommander.command_plugins.github.plugin
:platform: Unix
:copyright: (c) 2017 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Mike Grima <mgrima@netflix.com>
"""
import json
import requests
import time
from tabulate import tabulate
... | [
37811,
198,
492,
8265,
25,
12575,
9503,
4066,
13,
21812,
62,
37390,
13,
12567,
13,
33803,
198,
220,
220,
220,
1058,
24254,
25,
33501,
198,
220,
220,
220,
1058,
22163,
4766,
25,
357,
66,
8,
2177,
416,
12074,
3457,
1539,
766,
37195,
2... | 3.265993 | 297 |
from . import ForecastMixin
from datetime import timedelta, datetime
import xml.etree.ElementTree as ET | [
6738,
764,
1330,
4558,
2701,
35608,
259,
198,
6738,
4818,
8079,
1330,
28805,
12514,
11,
4818,
8079,
198,
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152
] | 3.678571 | 28 |
import json
from lib import node
from lib.generator import predicate_function
from lib.generator import predicate_function_declaration
with open("json/carian.json", "r") as stream:
data = json.load(stream)
nd = node.RootNode()
for dat in data:
nd.extend(dat, True)
with open("dist/is_carian_unicos.h", "w") as ... | [
198,
11748,
33918,
198,
6738,
9195,
1330,
10139,
220,
198,
6738,
9195,
13,
8612,
1352,
1330,
44010,
62,
8818,
198,
6738,
9195,
13,
8612,
1352,
1330,
44010,
62,
8818,
62,
32446,
10186,
198,
198,
4480,
1280,
7203,
17752,
14,
66,
3699,
1... | 2.870056 | 177 |
import ast
import typing
from typedpy import Array, Map, Structure
INDENT = " " * 4
| [
11748,
6468,
198,
11748,
19720,
198,
198,
6738,
25683,
9078,
1330,
15690,
11,
9347,
11,
32522,
198,
198,
12115,
3525,
796,
366,
366,
1635,
604,
628,
628,
628,
628,
628,
628,
198
] | 3.0625 | 32 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tolerations.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf... | [
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,
8214,
602,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
62,
65,
28,
1759... | 2.411333 | 1,500 |