content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
"""
Code for Post related inclusion tags for blog.
:author: Douglas Daly
:date: 1/6/2018
"""
#
# Imports
#
from django import template
from django.core.paginator import Paginator
from ..models import Post
#
# Tag Definitions
#
register = template.Library()
@register.inclusion_tag("blo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
10669,
329,
2947,
3519,
14900,
15940,
329,
4130,
13,
198,
198,
25,
9800,
25,
15796,
43692,
198,
25,
4475,
25,
352,
14,
21,
14,
7908,
198,
37811,
198,
2,
... | 2.459119 | 477 |
from tempfile import mkstemp
from shutil import move
from os import fdopen, remove
import os
import csv
dataset_location = '.'
for f in os.listdir(dataset_location):
print(f)
fh, abs_path = mkstemp()
filepath = os.path.join(dataset_location, f)
with os.fdopen(fh, 'w') as new_file:
... | [
6738,
20218,
7753,
1330,
33480,
927,
79,
201,
198,
6738,
4423,
346,
1330,
1445,
201,
198,
6738,
28686,
1330,
277,
67,
9654,
11,
4781,
201,
198,
11748,
28686,
201,
198,
11748,
269,
21370,
201,
198,
201,
198,
19608,
292,
316,
62,
24886,... | 2.003195 | 313 |
# coding: utf-8
"""
Generators of Firework workflows
"""
import logging
import sys
import abc
import os
import six
import datetime
import json
import numpy as np
import abipy.abio.input_tags as atags
import traceback
from collections import defaultdict
from abipy.abio.factories import HybridOneShotFromGsFactory, ScfFa... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
37811,
198,
8645,
2024,
286,
3764,
1818,
670,
44041,
198,
37811,
198,
11748,
18931,
198,
11748,
25064,
198,
11748,
450,
66,
198,
11748,
28686,
198,
11748,
2237,
198,
11748,
4818,
8079,
198,
11748,
... | 2.025782 | 58,336 |
# _*_ coding:utf-8 _*_
import json
from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.backends import ModelBackend
from django.db.models import Q
from django.views.generic.base import View
from django.contrib.auth.hashers import mask_hash
... | [
2,
4808,
9,
62,
19617,
25,
40477,
12,
23,
4808,
9,
62,
198,
11748,
33918,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
220,
8323,
5344,
11,
17594,
11,
260... | 2.114083 | 1,271 |
import pytest
import pickle
from pathlib import Path
from unittest.mock import MagicMock
from neo_loader.xgboost_model_loader import XGBoostModelLoader, RestrictedUnpickler
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
11748,
2298,
293,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
6139,
44,
735,
198,
6738,
19102,
62,
29356,
13,
87,
70,
39521,
62,
19849,
62,
29356,
1330,
1395,
4579,
... | 2.862069 | 87 |
import numpy as np
from emulatte.waveform_files import walktem_hm, walktem_lm
| [
11748,
299,
32152,
355,
45941,
198,
6738,
795,
377,
265,
660,
13,
19204,
687,
62,
16624,
1330,
2513,
11498,
62,
23940,
11,
2513,
11498,
62,
75,
76,
628,
628
] | 2.793103 | 29 |
while True:
readFile = input("Read string from a file? [y/n]: ")
count = 0
if(readFile == 'y' or readFile == 'Y'):
filePath = input("Path to file: ")
f = open(filePath, 'r')
string = f.read()
words = string.split(' ')
for x in words:
count += 1
... | [
4514,
6407,
25,
201,
198,
220,
220,
220,
1100,
8979,
796,
5128,
7203,
5569,
4731,
422,
257,
2393,
30,
685,
88,
14,
77,
5974,
366,
8,
201,
198,
220,
220,
220,
954,
796,
657,
201,
198,
220,
220,
220,
611,
7,
961,
8979,
6624,
705,
... | 2.175141 | 354 |
from django.conf import settings
from django.conf.urls import url
from django.urls import path, re_path
from mainapp.views import LatestPapersFeed, SearchResultsFeed
from mainapp.views.profile import profile_view, profile_delete
from . import views
urlpatterns = [
path(r"", views.index, name="index"),
# We ha... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
302,
62,
6978,
198,
198,
6738,
1388,
1324,
13,
33571,
1330,
26603,
47,
56... | 2.366689 | 1,489 |
from robot.api import logger
from robot.libraries.BuiltIn import BuiltIn, run_keyword_variant
from robot.running import Keyword, RUN_KW_REGISTER
from enum import Enum
class MyLib2:
'''*Das ist meine Doku*
Hier weitere Doku
'''
ROBOT_LIBRARY_SCOPE = 'GLOBAL'
def __init__(self, ip... | [
6738,
9379,
13,
15042,
1330,
49706,
201,
198,
6738,
9379,
13,
75,
11127,
13,
39582,
818,
1330,
28477,
818,
11,
1057,
62,
2539,
4775,
62,
25641,
415,
201,
198,
6738,
9379,
13,
20270,
1330,
7383,
4775,
11,
32494,
62,
42,
54,
62,
31553... | 2.129921 | 254 |
@double
print(add(2, 5))
| [
198,
198,
31,
23352,
628,
198,
4798,
7,
2860,
7,
17,
11,
642,
4008,
198
] | 1.933333 | 15 |
import sys, os
sys.path.append(os.path.abspath(__file__).split('test')[0])
import pandas as pd
import scipy.io as io
import numpy as np
import matplotlib.pyplot as plt
from pyml.supervised.LogisticRegression import MultiLogisticRegression
"""
----------------------------------------------------------------------... | [
11748,
25064,
11,
28686,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
834,
7753,
834,
737,
35312,
10786,
9288,
11537,
58,
15,
12962,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
629,
541,
88,
... | 4.154088 | 636 |
# @Author: Ibrahim Salihu Yusuf <yusuf>
# @Date: 2020-02-26T20:24:57+02:00
# @Email: sibrahim1396@gmail.com
# @Project: Audio Classifier
# @Last modified by: yusuf
# @Last modified time: 2020-02-26T20:42:26+02:00
import os
import heapq
| [
2,
2488,
13838,
25,
30917,
4849,
48406,
41749,
3046,
1279,
88,
385,
3046,
29,
198,
2,
2488,
10430,
25,
220,
220,
12131,
12,
2999,
12,
2075,
51,
1238,
25,
1731,
25,
3553,
10,
2999,
25,
405,
198,
2,
2488,
15333,
25,
220,
264,
571,
... | 2.378641 | 103 |
from dataclasses import dataclass, field
from dataclasses_json import DataClassJsonMixin
from pathlib import Path
import json
from copy import deepcopy
from typing import List, Dict, Set, Union, Optional
twitch_irc_token_path = Path(__file__).parent / "config" / "twitch_irc_token.json"
twitch_client_id_path = Path(__f... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
198,
6738,
4818,
330,
28958,
62,
17752,
1330,
6060,
9487,
41,
1559,
35608,
259,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
33918,
198,
6738,
4866,
1330,
2769,
30073,
198,
67... | 2.809585 | 1,565 |
# A set of data structures to represent graphs
class Node(object):
"""Represents a node in the graph"""
class Edge(object):
"""Represents an edge in the dictionary. Includes a source and
a destination."""
class Digraph(object):
"""Represents a directed graph of Node and Edge objects"""
def a... | [
2,
317,
900,
286,
1366,
8573,
284,
2380,
28770,
628,
198,
4871,
19081,
7,
15252,
2599,
198,
220,
220,
220,
37227,
6207,
6629,
257,
10139,
287,
262,
4823,
37811,
628,
198,
4871,
13113,
7,
15252,
2599,
198,
220,
220,
220,
37227,
6207,
... | 2.452586 | 464 |
#py_files_3.py
"""quite a pickle"""
import pickle
#make an object
obj = [ [1, 2, 3],
[4, 5, 5],
[7, 8, 9]
]
print("hey, we've got an object")
print(obj)
#open a binary file (remember, we're writing bytes)
pickle_file = "brine"
with open(pickle_file, 'wb') as f:
pickle.dump(obj, f)
#let's kill ... | [
2,
9078,
62,
16624,
62,
18,
13,
9078,
198,
37811,
37121,
257,
2298,
293,
37811,
198,
11748,
2298,
293,
198,
2,
15883,
281,
2134,
198,
26801,
796,
685,
685,
16,
11,
362,
11,
513,
4357,
198,
220,
220,
220,
220,
220,
220,
220,
685,
... | 2.372385 | 239 |
# -*- coding: utf-8 -*-
"""
:authors: - Tobias Grosch
"""
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
628,
198,
25,
41617,
25,
532,
46675,
402,
4951,
354,
198,
37811,
628
] | 2.178571 | 28 |
"""Bot config."""
from config import DB_HOSTNAME
from discord.enums import ActivityType
# Bot token - keep private!
TOKEN = ""
# Owner user ID - int
OWNER = 530420116815478794 # richardfrost#5699 on 2-6-21
# Activity settings
ACTIVITY_NAME = "this server"
ACTIVITY_TYPE = ActivityType.watching
# Extensions to load
EX... | [
37811,
20630,
4566,
526,
15931,
198,
198,
6738,
4566,
1330,
20137,
62,
39,
10892,
20608,
198,
6738,
36446,
13,
268,
5700,
1330,
24641,
6030,
198,
198,
2,
18579,
11241,
532,
1394,
2839,
0,
198,
10468,
43959,
796,
13538,
198,
2,
23853,
... | 2.313514 | 370 |
# %%
from nltk import parse, CFG
# %%
grammar = CFG.fromstring("""
S -> NP VP
NP -> DT N
VP -> V | V PP
PP -> P NP
DT -> 'the'
N -> 'child' | 'kitchen'
V -> 'ran'
P -> 'to'
""")
str_val = "the child ran to the kitchen"
srp = parse.ShiftReduceParser(grammar, trace=2)
for res in srp.parse(list(str_val.lower().spli... | [
2,
43313,
198,
6738,
299,
2528,
74,
1330,
21136,
11,
18551,
38,
198,
2,
43313,
198,
198,
4546,
3876,
796,
18551,
38,
13,
6738,
8841,
7203,
15931,
198,
50,
4613,
28498,
23342,
198,
22182,
4613,
24311,
399,
198,
8859,
4613,
569,
930,
... | 2.281837 | 479 |
#O(nlogn) solution
#O(logn)
#O(n) solution | [
2,
46,
7,
21283,
2360,
8,
4610,
220,
198,
220,
220,
220,
1303,
46,
7,
75,
2360,
8,
198,
198,
2,
46,
7,
77,
8,
4610,
220
] | 1.814815 | 27 |
# Copyright 2020 DeepMind Technologies Limited.
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | [
2,
15069,
12131,
10766,
28478,
21852,
15302,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,... | 2.815834 | 2,981 |
speed(5)
#Function to maque square
penup()
setposition(-200,-200)
x = input("Type Square Length: ")
make_square(x)
"""
Write a program that has Tracy draw a square in each corner of the
canvas.
The user should give a one length dimension to be used for the sides
of all squares.
Hints:
... | [
12287,
7,
20,
8,
198,
198,
2,
22203,
284,
17266,
4188,
6616,
628,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
3617,
929,
3419,
198,
... | 3.02027 | 148 |
import io
import binascii
import time
from typing import Dict, List
from pycoin.block import Block
from pycoin.tx.Tx import Tx
from spruned.application import utils, exceptions
from spruned.application.database import ldb_batch
from spruned.application.logging_factory import Logger
from spruned.application.tools import... | [
11748,
33245,
198,
11748,
9874,
292,
979,
72,
198,
11748,
640,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
198,
6738,
12972,
3630,
13,
9967,
1330,
9726,
198,
6738,
12972,
3630,
13,
17602,
13,
46047,
1330,
309,
87,
198,
6738,
599,
5143... | 3.126984 | 126 |
import redis
import logging
from flask import Flask
# 导入数据库拓展,并添加相关配置
from flask_sqlalchemy import SQLAlchemy
# 导入redis数据库拓展,添加相关配置
# csrf
from flask_wtf.csrf import CSRFProtect, generate_csrf
# 利用flask-session拓展,将session数据保存在redis中
from flask_session import Session
from config import config
from logging.handlers impo... | [
11748,
2266,
271,
198,
11748,
18931,
198,
198,
6738,
42903,
1330,
46947,
198,
2,
10263,
107,
120,
17739,
98,
46763,
108,
162,
235,
106,
41753,
241,
162,
233,
241,
161,
109,
243,
171,
120,
234,
33176,
35050,
115,
119,
27950,
254,
33566... | 1.479167 | 672 |
facebook_link = "https://www.facebook.com/"
email_box_id = "email"
password_box_id = "pass"
login_button_id = "loginbutton"
profile_css_selector = "[title='Profile']"
friends_tab_css_selector = "[data-tab-key=\'friends\']"
friend_containers_css_selector = "[data-testid='friend_list_item'] .fsl.fwb.fcb a"
excess_prof... | [
19024,
62,
8726,
796,
366,
5450,
1378,
2503,
13,
19024,
13,
785,
30487,
198,
198,
12888,
62,
3524,
62,
312,
796,
366,
12888,
1,
198,
28712,
62,
3524,
62,
312,
796,
366,
6603,
1,
198,
38235,
62,
16539,
62,
312,
796,
366,
38235,
165... | 2.761905 | 168 |
import os
import numpy
import theano
from fuel.datasets import IterableDataset
from numpy.testing import assert_allclose
from theano import tensor
from blocks.algorithms import GradientDescent
from blocks.bricks import MLP
from blocks.extensions import FinishAfter
from blocks.extensions.saveload import Checkpoint, Loa... | [
11748,
28686,
198,
11748,
299,
32152,
198,
11748,
262,
5733,
198,
6738,
5252,
13,
19608,
292,
1039,
1330,
40806,
540,
27354,
292,
316,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
439,
19836,
198,
6738,
262,
5733,
1330,
11192,
273,... | 3.849558 | 113 |
from .dialogSQLite3 import * | [
6738,
764,
38969,
519,
17861,
578,
18,
1330,
1635
] | 3.111111 | 9 |
# This Python file uses the following encoding: utf-8
'''
experiment.py
This code uses two different types of feature vectors (word2vec and n-grams) on the training set to train two random forests.
Probabilities of these two models are then fused by weighted averaging to calculate the final predictions.
PYTHONHASHSEED ... | [
2,
770,
11361,
2393,
3544,
262,
1708,
21004,
25,
3384,
69,
12,
23,
198,
7061,
6,
198,
23100,
3681,
13,
9078,
198,
1212,
2438,
3544,
734,
1180,
3858,
286,
3895,
30104,
357,
4775,
17,
35138,
290,
299,
12,
4546,
82,
8,
319,
262,
3047... | 2.614334 | 4,102 |
#!/usr/bin/env pyhton
from jip import *
@tool()
class example_embedded_produce():
"""Produce a set of files
Usage:
produce --prefix <prefix> --number <number>
"""
@tool()
class example_embedded_consume():
"""Count something
Usage:
consume <input>
"""
@tool()
class example... | [
2,
48443,
14629,
14,
8800,
14,
24330,
12972,
71,
1122,
198,
6738,
474,
541,
1330,
1635,
628,
198,
31,
25981,
3419,
198,
4871,
1672,
62,
20521,
9395,
62,
18230,
344,
33529,
198,
220,
220,
220,
37227,
11547,
344,
257,
900,
286,
3696,
... | 2.542443 | 483 |
if __name__ == "__main__": # pragma: no cover
from bfpy.cli import run_cli
run_cli(prog_name="bfpy")
| [
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
220,
1303,
23864,
2611,
25,
645,
3002,
198,
220,
220,
220,
422,
275,
69,
9078,
13,
44506,
1330,
1057,
62,
44506,
628,
220,
220,
220,
1057,
62,
44506,
7,
1676,
70,
62,
3672,
... | 2.3125 | 48 |
from typing import List
from celery import shared_task
from django.conf import settings
from django.contrib.auth import get_user_model
from django.shortcuts import get_object_or_404
from django_drf_filepond.api import store_upload
from django_drf_filepond.models import TemporaryUpload
from .pipeline.factories import ... | [
6738,
19720,
1330,
7343,
198,
198,
6738,
18725,
1924,
1330,
4888,
62,
35943,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,... | 3.422819 | 149 |
from kafka import KafkaProducer
from kafka import errors
import json
# import logging
# logging.basicConfig(level=logging.DEBUG)
| [
6738,
479,
1878,
4914,
1330,
46906,
11547,
2189,
198,
6738,
479,
1878,
4914,
1330,
8563,
198,
11748,
33918,
198,
2,
1330,
18931,
198,
198,
2,
18931,
13,
35487,
16934,
7,
5715,
28,
6404,
2667,
13,
30531,
8,
628,
628
] | 3.410256 | 39 |
# code from Learning Card 02 - Rainbow HAT
# import the rainbowhat module
import rainbowhat
# create a variable to store the temperature reading in
temperature = rainbowhat.weather.temperature()
# sends the data from the reading to the display
rainbowhat.display.print_float(temperature)
# displays the da... | [
2,
2438,
422,
18252,
5172,
7816,
532,
19909,
367,
1404,
201,
198,
201,
198,
2,
1330,
262,
27223,
5183,
8265,
201,
198,
11748,
27223,
5183,
201,
198,
201,
198,
2,
2251,
257,
7885,
284,
3650,
262,
5951,
3555,
287,
201,
198,
11498,
210... | 3.490566 | 106 |
def apply_pct(record_list, win_pct):
"""
Inputs:
record_list (binary list) - list containing wins (1) and losses (0) in every possible unique permutation
win_pct (list) - list containing win percentage to be applied
Returns:
pcts_applied (list) - list with win/loss percentage... | [
4299,
4174,
62,
79,
310,
7,
22105,
62,
4868,
11,
1592,
62,
79,
310,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
220,
220,
220,
23412,
82,
25,
201,
198,
220,
220,
220,
220,
220,
220,
220,
1700,
62,
4868,
357,
39491,
1351,
8,
... | 1.994393 | 535 |
import cv2 as cv
img = cv.imread('../../images/shapes_image.png')
cv.imshow('img', img)
cv.waitKey(0)
grayscale_img = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
cv.imshow('gray_scale', grayscale_img)
cv.waitKey(0)
# detecting Edges in the gray scale images
edges_img = cv.Canny(grayscale_img, 30, 200)
cv.imshow("edges", edg... | [
11748,
269,
85,
17,
355,
269,
85,
220,
198,
198,
9600,
796,
269,
85,
13,
320,
961,
10786,
40720,
40720,
17566,
14,
1477,
7916,
62,
9060,
13,
11134,
11537,
198,
33967,
13,
320,
12860,
10786,
9600,
3256,
33705,
8,
198,
33967,
13,
1707... | 2.235294 | 153 |
# -*- coding: utf-8 -*-
from PySide2 import QtCore, QtGui, QtWidgets
import json
import core_functions as cf
import numpy as np
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
9485,
24819,
17,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
198,
198,
11748,
33918,
198,
11748,
4755,
62,
12543,
2733,
355,
30218,
198,
11... | 2.653061 | 49 |
from jacc.models import Invoice
from django.core.management.base import CommandParser
from jutil.command import SafeCommand
| [
6738,
474,
4134,
13,
27530,
1330,
10001,
2942,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
9455,
46677,
198,
6738,
474,
22602,
13,
21812,
1330,
19978,
21575,
628
] | 4.032258 | 31 |
import dataclasses
import enum
import typing
import gci.componentmodel as cm
dc = dataclasses.dataclass
# generic evidence-model
@dc
@dc
# special-case evidence for gardener-mm5 (malware)
@dc
@dc
@dc
| [
11748,
4818,
330,
28958,
198,
11748,
33829,
198,
11748,
19720,
198,
198,
11748,
308,
979,
13,
42895,
19849,
355,
12067,
198,
198,
17896,
796,
4818,
330,
28958,
13,
19608,
330,
31172,
198,
198,
2,
14276,
2370,
12,
19849,
628,
198,
31,
... | 2.805195 | 77 |
# Generated by Django 4.0.3 on 2022-03-15 14:01
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
13,
18,
319,
33160,
12,
3070,
12,
1314,
1478,
25,
486,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import logging
from functools import cache
from core.processor import Processor
| [
11748,
18931,
198,
198,
6738,
1257,
310,
10141,
1330,
12940,
198,
198,
6738,
4755,
13,
41341,
1330,
32893,
198
] | 4.315789 | 19 |
from model import create_model
nn4_small2_pretrained = create_model()
nn4_small2_pretrained.load_weights('weights/nn4.small2.v1.h5')
import pickle
import time
import numpy as np
import os.path
import warnings
warnings.filterwarnings("ignore")
metadata = load_metadata('images')
import cv2
import matplotlib.pyplot as p... | [
6738,
2746,
1330,
2251,
62,
19849,
198,
20471,
19,
62,
17470,
17,
62,
5310,
13363,
796,
2251,
62,
19849,
3419,
198,
20471,
19,
62,
17470,
17,
62,
5310,
13363,
13,
2220,
62,
43775,
10786,
43775,
14,
20471,
19,
13,
17470,
17,
13,
85,
... | 2.37469 | 2,821 |
import numpy as np
import pickle as pk
import bokeh.plotting as bkp
import bokeh.layouts as bkl
from scipy.stats import cauchy as sp_cauchy
import sys, os
sys.path.insert(1, os.path.join(sys.path[0], '../'))
from common import mixture_logpdf, preprocess_plot, postprocess_plot, pal, logFmtr, kl_estimate, mixture_sample... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
355,
279,
74,
198,
11748,
1489,
365,
71,
13,
29487,
889,
355,
275,
74,
79,
198,
11748,
1489,
365,
71,
13,
10724,
5269,
355,
275,
41582,
198,
6738,
629,
541,
88,
13,
34242,
1330,
... | 2.063085 | 4,486 |
# Generated by Django 3.1.6 on 2021-07-09 06:38
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
21,
319,
33448,
12,
2998,
12,
2931,
9130,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
"""
Main entry
""" | [
37811,
198,
13383,
5726,
198,
37811
] | 3 | 6 |
from django.urls import path
from stocks import views
from django.conf.urls import include, url
urlpatterns = [
url(r'^$', views.index, name='index'),
#path('<string:symbol>/', views.detail, name='detail'),
path('stocks/<symbol>/', views.detail, name='detail'),
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
14420,
1330,
5009,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
2291,
11,
19016,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
... | 2.787879 | 99 |
from Config.Singleton import Singleton
| [
6738,
17056,
13,
29974,
10565,
1330,
5573,
10565,
628
] | 4.444444 | 9 |
num = int(input('Vamos descobrir se o numero é primo?...'))
tot = 0
for c in range(1, num + 1):
if num % c == 0:
print('\033[33m', end='Eh primo')
tot += 1
else
print('\033[33m', end='naum eh kkkk...')
print('')
| [
22510,
220,
796,
493,
7,
15414,
10786,
53,
321,
418,
1715,
672,
29283,
384,
267,
220,
997,
3529,
38251,
2684,
78,
30,
986,
6,
4008,
198,
83,
313,
796,
657,
198,
1640,
220,
269,
287,
2837,
7,
16,
11,
997,
1343,
352,
2599,
198,
22... | 2.059322 | 118 |
# xoxzo api libirary
'''
This is the API library for Xoxzo's telephony service.
http://docs.xoxzo.com/en/
see http://docs.python-requests.org/en/master/ for requests library.
'''
import requests
__author__ = "Akira Nonaka <nonaka@mac.com>"
__status__ = "development"
__version__ = "0.1"
__date__ = "30 March 2011"
... | [
2,
2124,
1140,
10872,
40391,
9195,
343,
560,
198,
198,
7061,
6,
198,
1212,
318,
262,
7824,
5888,
329,
1395,
1140,
10872,
338,
5735,
23021,
2139,
13,
198,
4023,
1378,
31628,
13,
87,
1140,
10872,
13,
785,
14,
268,
14,
198,
198,
3826,
... | 2.115608 | 5,337 |
import sqlite3
from flask import g
import settings
DB_PATH = getattr(settings, 'DATABASE', './database.db')
DEFAULT_COMMENTS = [
{
"children": [],
"parent": {
"author_firstname": "Frederic",
"nbr_vote": 0,
"author_lastname": "Doe",
"added": "15947712... | [
11748,
44161,
578,
18,
198,
6738,
42903,
1330,
308,
198,
11748,
6460,
198,
198,
11012,
62,
34219,
796,
651,
35226,
7,
33692,
11,
705,
35,
1404,
6242,
11159,
3256,
705,
19571,
48806,
13,
9945,
11537,
198,
198,
7206,
38865,
62,
9858,
28... | 1.860283 | 1,274 |
import pytest
import torch
from mmcv.ops import RoIPointPool3d
@pytest.mark.skipif(
not torch.cuda.is_available(), reason='requires CUDA support')
| [
11748,
12972,
9288,
198,
11748,
28034,
198,
198,
6738,
8085,
33967,
13,
2840,
1330,
5564,
4061,
1563,
27201,
18,
67,
628,
198,
31,
9078,
9288,
13,
4102,
13,
48267,
361,
7,
198,
220,
220,
220,
407,
28034,
13,
66,
15339,
13,
271,
62,
... | 2.90566 | 53 |
# Copyright (c) Jeremías Casteglione <jrmsdev@gmail.com>
# See LICENSE file.
from _sadm.web.view import syslog
| [
2,
15069,
357,
66,
8,
10272,
76,
8836,
292,
5833,
1533,
75,
7935,
1279,
73,
81,
907,
7959,
31,
14816,
13,
785,
29,
198,
2,
4091,
38559,
24290,
2393,
13,
198,
198,
6738,
4808,
82,
324,
76,
13,
12384,
13,
1177,
1330,
25064,
6404,
... | 2.488889 | 45 |
import json
import logging
import urllib
from django.conf import settings
from dojo.models import Finding
logger = logging.getLogger(__name__)
| [
11748,
33918,
198,
11748,
18931,
198,
11748,
2956,
297,
571,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
6738,
466,
7639,
13,
27530,
1330,
27063,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
... | 3.395349 | 43 |
from __future__ import print_function
import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras import backend as K
batch_size = 128 #Definição de bacth: https://www.youtube.com/watch?v=nh... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
41927,
292,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
285,
77,
396,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
36... | 2.479644 | 786 |
import statistics
import json
import csv
from pathlib import Path
from promise.utils import deprecated
from scipy import stats
from .core import should_process, rename_exp
from .core import get_test_fitness
from .core import sort_algorithms
from .core import rename_alg
from .plotting import plot_twinx
import stac
... | [
11748,
7869,
198,
11748,
33918,
198,
11748,
269,
21370,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
6991,
13,
26791,
1330,
39224,
198,
6738,
629,
541,
88,
1330,
9756,
198,
198,
6738,
764,
7295,
1330,
815,
62,
14681,
11,
36265,
... | 2.342699 | 2,883 |
"""The tests for the MQTT statestream component."""
from unittest.mock import ANY, call
import openpeerpower.components.mqtt_statestream as statestream
from openpeerpower.core import State
from openpeerpower.setup import async_setup_component
from tests.common import mock_state_change_event
async def add_statestrea... | [
37811,
464,
5254,
329,
262,
337,
48,
15751,
1185,
395,
1476,
7515,
526,
15931,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
15529,
11,
869,
198,
198,
11748,
1280,
33350,
6477,
13,
5589,
3906,
13,
76,
80,
926,
62,
14269,
395,
1476,
... | 2.625963 | 7,526 |
import logging
import os
import typing as t
import discord
import discord.ext.commands as commands
import pandas as pd
import bot.extensions as ext
from bot.consts import Colors
from bot.messaging.events import Events
from bot.utils.converters import HonorsConverter
log = logging.getLogger(__name__)
MIN_YEAR = 2014... | [
11748,
18931,
198,
11748,
28686,
198,
11748,
19720,
355,
256,
198,
198,
11748,
36446,
198,
11748,
36446,
13,
2302,
13,
9503,
1746,
355,
9729,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
11748,
10214,
13,
2302,
5736,
355,
1070,
198,
... | 3.030769 | 130 |
"""
Description: Lazy DRAM Posterior class
Author : Andrew Wood
Author_email: dewood@bu.edu
License : Apache License, Version 2.0
"""
# SYSTEM IMPORTS
from abc import ABC, abstractmethod
import numpy as np
# PYTHON PROJECT IMPORTS
from .posterior import Posterior
| [
37811,
198,
11828,
25,
406,
12582,
10560,
2390,
44996,
1504,
1398,
220,
198,
13838,
220,
220,
220,
220,
220,
1058,
6858,
5326,
198,
13838,
62,
12888,
25,
390,
3822,
31,
11110,
13,
15532,
198,
34156,
220,
220,
220,
220,
1058,
24843,
13... | 3.032258 | 93 |
import pytest
from selfsupmotion.utils.hp_utils import check_hp
| [
11748,
12972,
9288,
198,
198,
6738,
2116,
37330,
38714,
13,
26791,
13,
24831,
62,
26791,
1330,
2198,
62,
24831,
628,
628,
198
] | 3.136364 | 22 |
class KodiRequest(object):
"""
This class is passed as first and only parameter to controller callbacks. It contains all information about Kodi
request.
"""
def handle(self):
"""
Get addon handle - integer value received from Kodi.
"""
return self._handle
def ba... | [
4871,
44129,
18453,
7,
15252,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
1398,
318,
3804,
355,
717,
290,
691,
11507,
284,
10444,
869,
10146,
13,
632,
4909,
477,
1321,
546,
44129,
198,
220,
220,
220,
2581,
13,
198,
220... | 2.268852 | 305 |
# -*- test-case-name: twisted.scripts.test.test_mktap -*-
# Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
import warnings, sys, os
from twisted.application import service, app
from twisted.persisted import sob
from twisted.python import usage, util, plugin as oldplugin
from twisted ... | [
2,
532,
9,
12,
1332,
12,
7442,
12,
3672,
25,
19074,
13,
46521,
13,
9288,
13,
9288,
62,
76,
21841,
499,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
5878,
12,
11528,
40006,
24936,
46779,
13,
198,
2,
4091,
38559,
24290,
329,
3307,
13,
... | 2.953704 | 648 |
from setuptools import setup
setup(
name='dices',
version='0.1',
description='a simple game of dices',
author='Frantisek Necas',
author_email='fifinecas@seznam.cz',
url='https://github.com/FrNecas/dices',
license='MIT',
packages=[
'dices'
],
entry_points={
'conso... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
67,
1063,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
16,
3256,
198,
220,
220,
220,
6764,
11639,
64,
2829,
983,
286,
288,
1063,
3256,
198,
... | 2.131579 | 190 |
# -*- coding: utf-8 -*-
def find(value, a_list):
"""
TestCase for find
>>> find(26, [12,14])
True
>>> find(40, [14, 15, 16, 4, 6, 5])
False
>>> find(1, [1])
False
>>> find(1, [])
False
>>> find(4, [2, 3, 2])
True
"""
# 现将列表变为<value, index>字典
if a_list is None ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
4299,
1064,
7,
8367,
11,
257,
62,
4868,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6208,
20448,
329,
1064,
198,
220,
220,
220,
13163,
1064,
7,
2075,
11,
68... | 1.665971 | 479 |
from setuptools import setup, find_packages
setup(
name='pyqt-find-replace-text-widget',
version='0.2.2',
author='Jung Gyu Yoon',
author_email='yjg30737@gmail.com',
license='MIT',
packages=find_packages(),
package_data={'pyqt_find_replace_text_widget.style': ['button.css'],
... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
9078,
39568,
12,
19796,
12,
33491,
12,
5239,
12,
42655,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
17,
13,
17,
3256,
... | 2.301994 | 351 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#------------------------------------------------------
# @ File : cfgs.py
# @ Description:
# @ Author : Alex Chung
# @ Contact : yonganzhong@outlook.com
# @ License : Copyright (c) 2017-2018
# @ Time : 2020/9/7 下午2:45
# @ Software : PyCharm
#-----... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
3880,
19351,
438,
198,
2,
2488,
9220,
220,
220,
220,
220,
220,
220,
1058,
30218,
14542,
13,
9078,
198,
2,
2488,
... | 2.755352 | 654 |
import os
from skimage import io, transform
import torch
import torchvision
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms # , utils
# import torch.optim as optim
import cv2
import numpy as np... | [
11748,
28686,
198,
6738,
1341,
9060,
1330,
33245,
11,
6121,
198,
11748,
28034,
198,
11748,
28034,
10178,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
4... | 2.442961 | 824 |
from mmcls.models.losses import Accuracy
from ..builder import HEADS, build_loss
from .base_head import BaseHead
@HEADS.register_module()
class ClsHead(BaseHead):
"""classification head.
Args:
loss (dict): Config of classification loss.
topk (int | tuple): Top-k accuracy.
""" # noqa: W6... | [
6738,
8085,
565,
82,
13,
27530,
13,
22462,
274,
1330,
33222,
198,
198,
6738,
11485,
38272,
1330,
39837,
50,
11,
1382,
62,
22462,
198,
6738,
764,
8692,
62,
2256,
1330,
7308,
13847,
628,
198,
31,
37682,
50,
13,
30238,
62,
21412,
3419,
... | 2.760684 | 117 |
''' Compute on ANVIL GTEX files'''
# IMPORTS
import sys
import json
from fasp.loc import anvilDRSClient
if __name__ == "__main__":
main(sys.argv[1:])
| [
7061,
6,
3082,
1133,
319,
3537,
53,
4146,
7963,
6369,
3696,
7061,
6,
198,
2,
220,
30023,
33002,
198,
11748,
25064,
198,
11748,
33918,
220,
198,
198,
6738,
277,
5126,
13,
17946,
1330,
281,
2991,
35,
6998,
11792,
628,
628,
197,
198,
3... | 2.439394 | 66 |
!/usr/bin/python
"""Script for downloading youtube videos."""
impor... | [
48443,
14629,
14,
8800,
14,
29412,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220... | 1.249515 | 1,030 |
"""
Author : Robin Phoeng
Date : 21/06/2018
"""
from Bar import *
"""
Creates templates of bars
Standard bar, 2 boxes of size 1 2
Consequence bar, 3 boxes of size 2 4 6
"""
def bar_default(name):
"""
Returns a bar of size 1, 2
:param name: the name of the bar
:return:
"""
... | [
37811,
201,
198,
201,
198,
13838,
1058,
12325,
1380,
78,
1516,
201,
198,
10430,
1058,
2310,
14,
3312,
14,
7908,
201,
198,
201,
198,
37811,
201,
198,
201,
198,
6738,
2409,
1330,
1635,
201,
198,
201,
198,
37811,
201,
198,
16719,
274,
... | 2.081967 | 305 |
# -*- coding: utf-8 -*-
import pytest
from PIL import ImageFont
from chess.board import _get_text_loc, coordinates_of_square, BOARD_MARGIN, SQUARE_EDGE
@pytest.fixture()
@pytest.mark.parametrize(
"text,box,expected",
[
('text', (200, 200), (83, 90)),
]
)
@pytest.mark.parametrize(
"crd,e... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
350,
4146,
1330,
7412,
23252,
198,
198,
6738,
19780,
13,
3526,
1330,
4808,
1136,
62,
5239,
62,
17946,
11,
22715,
62,
1659,
62,
... | 2.092308 | 195 |
import os
import glob | [
11748,
28686,
198,
11748,
15095
] | 4.2 | 5 |
#!/usr/bin/env python
"""
_LoadFilesByWorkflow_
MySQL implementation of LoadFilesByWorkflow
"""
import logging
from WMComponent.DBS3Buffer.MySQL.LoadDBSFilesByDAS import LoadDBSFilesByDAS as MySQLLoadDBSFilesByDAS
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
62,
8912,
25876,
3886,
12468,
11125,
62,
198,
198,
3666,
17861,
7822,
286,
8778,
25876,
3886,
12468,
11125,
198,
37811,
628,
628,
198,
11748,
18931,
198,
198,
6738,
30376,
21... | 2.820513 | 78 |
# Demo showcasing the training of an MLP with a single hidden layer using
# Extended Kalman Filtering (EKF) and Unscented Kalman Filtering (UKF).
# In this demo, we consider the latent state to be the weights of an MLP.
# The observed state at time t is the output of the MLP as influenced by the weights
# at time ... | [
2,
34588,
40318,
262,
3047,
286,
281,
10373,
47,
351,
257,
2060,
7104,
7679,
1262,
220,
198,
2,
24204,
12612,
805,
7066,
20212,
357,
36,
42,
37,
8,
290,
791,
82,
1087,
276,
12612,
805,
7066,
20212,
357,
15039,
37,
737,
198,
2,
554... | 2.945652 | 368 |
import json
from datetime import datetime
import logging as log
from galaxy.http import handle_exception, create_tcp_connector, create_client_session
import dateutil.parser
import aiohttp
import asyncio
import time
from galaxy.api.errors import AuthenticationRequired, AccessDenied, UnknownError
from consts import CL... | [
11748,
33918,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
18931,
355,
2604,
198,
6738,
16161,
13,
4023,
1330,
5412,
62,
1069,
4516,
11,
2251,
62,
83,
13155,
62,
8443,
273,
11,
2251,
62,
16366,
62,
29891,
198,
11748,
3128,
226... | 3.557692 | 104 |
#! /usr/bin/env python
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt. Contact: ctb@msu.edu
#
import sys
from screed.fasta import fasta_iter
n = 0
for filename in sys... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
44081,
647,
11,
2638,
1378,
12567,
13,
785,
14,
2004,
12,
23912,
14,
14636,
647,
47454,
290,
318,
198,
2,
15069,
357,
34,
8,
7055,
1812,
20... | 2.528 | 250 |
import time
import random
import pyautogui
TUX_SNIP = 'tux_snip.png'
# pyautogui keyboard consts
U, D, L, R, F, N = 'up', 'down', 'left', 'right', ' ', 'n'
# Since pyautogui calls have side effects, we wrap them. (painful to write but works)
Uu = lambda: pyautogui.keyUp(U)
Ud = lambda: pyautogui.keyDown(U)
Du = lamb... | [
11748,
640,
198,
11748,
4738,
198,
11748,
12972,
2306,
519,
9019,
198,
198,
51,
31235,
62,
15571,
4061,
796,
705,
83,
2821,
62,
16184,
541,
13,
11134,
6,
198,
198,
2,
12972,
2306,
519,
9019,
10586,
1500,
82,
198,
52,
11,
360,
11,
... | 2.310448 | 335 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-03-29 13:50
from __future__ import unicode_literals
import autoslug.fields
from django.db import migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1959,
319,
33448,
12,
3070,
12,
1959,
1511,
25,
1120,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198... | 2.774194 | 62 |
import datetime as dt
import os
import pickle
import nsedata
import pandas
import wget
from icecream import ic
ic.enable()
NSE_urlList = {
'ind_nifty500list.csv': 'https://www1.nseindia.com/content/indices/ind_nifty500list.csv',
'ind_nifty200list.csv': 'https://www1.nseindia.com/content/indices/ind_nifty200li... | [
11748,
4818,
8079,
355,
288,
83,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
36545,
276,
1045,
198,
11748,
19798,
292,
198,
11748,
266,
1136,
198,
6738,
4771,
36277,
1330,
14158,
198,
198,
291,
13,
21633,
3419,
198,
198,
45,
... | 2.30057 | 702 |
#!/usr/bin/env python3
import boto3
import sys
import os
# usage createec2.py <AWS-REGION> <IMAGE-ID>
region = sys.argv[1]
ec2 = boto3.client('ec2', region_name=(region))
#use the following from Ec2 to call the region from the script instead of typing in as arg.
#import urllib.request
#f = urllib.request.urlopen(... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
275,
2069,
18,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
2,
8748,
2251,
721,
17,
13,
9078,
1279,
12298,
50,
12,
31553,
2849,
29,
1279,
3955,
11879,
12,
2389,
29... | 2.630314 | 541 |
from django.contrib.auth.forms import UserCreationForm
from django import forms
from django.db.models.fields import CharField
from rest_framework.fields import EmailField
from .models import AuthorManager, Author
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
11787,
12443,
341,
8479,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
25747,
1330,
3178,
15878,
198,
6738,
1334,
62,
30604,
13,
257... | 3.944444 | 54 |
from typing import Iterable, Tuple, List, Union
TicTacToeRow = List[str]
TicTacToeBoard = Tuple[TicTacToeRow, TicTacToeRow, TicTacToeRow]
def tic_tac_toe_finish(board: TicTacToeBoard, pos_y: int, pos_x: int, symbol: str) -> None:
"""
This function takes in a TicTacToeBoard and applies the finishing move based... | [
6738,
19720,
1330,
40806,
540,
11,
309,
29291,
11,
7343,
11,
4479,
198,
51,
291,
51,
330,
2514,
68,
25166,
796,
7343,
58,
2536,
60,
198,
51,
291,
51,
330,
2514,
68,
29828,
796,
309,
29291,
58,
51,
291,
51,
330,
2514,
68,
25166,
... | 2.84625 | 800 |
import logging
from telegram.ext import CommandHandler
from telegram.ext import CallbackQueryHandler
from telegram import InlineKeyboardMarkup
from telegram import InlineKeyboardButton
from telegram import ParseMode
from bot.customfilters import Filters
from bot import strings as s
logger = logging.getLog... | [
11748,
18931,
201,
198,
201,
198,
6738,
573,
30536,
13,
2302,
1330,
9455,
25060,
201,
198,
6738,
573,
30536,
13,
2302,
1330,
4889,
1891,
20746,
25060,
201,
198,
6738,
573,
30536,
1330,
554,
1370,
9218,
3526,
9704,
929,
201,
198,
6738,
... | 2.943878 | 196 |
import numpy as np
import random
| [
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
628,
198
] | 2.086957 | 23 |
import json, subprocess
from ... pyaz_utils import get_cli_name, get_params
| [
11748,
33918,
11,
850,
14681,
198,
6738,
2644,
12972,
1031,
62,
26791,
1330,
651,
62,
44506,
62,
3672,
11,
651,
62,
37266,
628
] | 3.347826 | 23 |
"""
@Version: 1.0
@Project: BeautyReport
@Author: Raymond
@Data: 2017/11/17 下午3:48
@File: sample.py
@License: MIT
"""
import unittest
from cases.BeautifulReport import BeautifulReport
if __name__ == '__main__':
test_suite = unittest.defaultTestLoader.discover('../tests', pattern='test*.py')
result = BeautifulR... | [
37811,
198,
31,
14815,
25,
352,
13,
15,
198,
31,
16775,
25,
20774,
19100,
198,
31,
13838,
25,
24238,
198,
31,
6601,
25,
2177,
14,
1157,
14,
1558,
220,
10310,
233,
39355,
230,
18,
25,
2780,
198,
31,
8979,
25,
6291,
13,
9078,
198,
... | 2.555556 | 162 |
import itertools
import pytest
from hat.util import json
@pytest.mark.parametrize("params,is_equal", [
((0, 0.0), True),
((0, 1E-9), False),
((-100, -100.0), True),
((True, True), True),
(('a', 'a'), True),
(({'a': 0, 'b': 1}, {'b': 1, 'a': 0}), True),
((0, False, '', [], {}, None), Fals... | [
11748,
340,
861,
10141,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
6877,
13,
22602,
1330,
33918,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7203,
37266,
11,
271,
62,
40496,
1600,
685,
198,
220,
220,
220,
14808,
... | 1.782362 | 1,236 |
from imports.Processes import *
from imports.Rop_File_Intake import *
from imports.Graphing_functions import *
from imports.ROP_Counting_Functions import *
import ropgadget
import os.path
from os import system, getcwd, chdir
import sys
import re
# f = "C:\\Users\\User\\Desktop\\ROP_Project\\Gadget_Sets\\Ea... | [
6738,
17944,
13,
18709,
274,
1330,
1635,
201,
198,
6738,
17944,
13,
49,
404,
62,
8979,
62,
5317,
539,
1330,
1635,
201,
198,
6738,
17944,
13,
38,
2416,
722,
62,
12543,
2733,
1330,
1635,
201,
198,
6738,
17944,
13,
49,
3185,
62,
12332,... | 2.34188 | 234 |
# Copyright (c) 2013 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... | [
2,
15069,
357,
66,
8,
2211,
34198,
10442,
3457,
13,
198,
2,
220,
198,
2,
7102,
37,
25256,
12576,
5357,
4810,
3185,
7112,
2767,
13153,
198,
2,
220,
198,
2,
770,
670,
318,
2810,
366,
1921,
3180,
1,
290,
2426,
284,
262,
34198,
37709,... | 2.212046 | 2,806 |
"""SqlAlchemy models."""
from blog.extensions import db
class Category(db.Model):
"""orm model for blog post."""
__tablename__ = 'categories'
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(255), default='')
alias = db.Column(db.String(255), unique=True, nullable=False)... | [
37811,
50,
13976,
2348,
26599,
4981,
526,
15931,
628,
198,
6738,
4130,
13,
2302,
5736,
1330,
20613,
628,
198,
4871,
21743,
7,
9945,
13,
17633,
2599,
198,
220,
220,
220,
37227,
579,
2746,
329,
4130,
1281,
526,
15931,
628,
220,
220,
220... | 2.720339 | 118 |
import os
# load a bunch of environment
DEBUG = os.getenv('DEBUG') in ['True', 'true', '1', 'yes']
NONCE_SECRET = os.getenv('NONCE_SECRET')
REDIS_URL = os.getenv('REDISTOGO_URL') or os.getenv('REDISGREEN_URL') or 'http://localhost:6379'
MAILGUN_API_KEY = os.getenv('MAILGUN_API_KEY')
MAILGUN_DOMAIN = os.getenv('MAILG... | [
11748,
28686,
198,
198,
2,
3440,
257,
7684,
286,
2858,
198,
198,
30531,
796,
28686,
13,
1136,
24330,
10786,
30531,
11537,
287,
37250,
17821,
3256,
705,
7942,
3256,
705,
16,
3256,
705,
8505,
20520,
198,
198,
45,
1340,
5222,
62,
23683,
... | 2.414815 | 270 |
from typing import Tuple
def find_x_y_position(iterable: list) -> Tuple[int, int]:
"""
Given a list of directions, return the depth and horizontal position
"""
x = int()
y = int()
for direction in iterable:
if "forward" in direction:
x += int(direction[-1])
if "up" ... | [
6738,
19720,
1330,
309,
29291,
628,
198,
4299,
1064,
62,
87,
62,
88,
62,
9150,
7,
2676,
540,
25,
1351,
8,
4613,
309,
29291,
58,
600,
11,
493,
5974,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
11259,
257,
1351,
286,
11678,
11,
... | 2.143564 | 606 |
import math
import pickle
import matplotlib.pyplot as plt
import numpy as np
| [
11748,
10688,
198,
11748,
2298,
293,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
11748,
299,
32152,
355,
45941,
198
] | 3.12 | 25 |
import pytest
from pathlib import Path
import numpy as np
import localpoly
PACKAGE_ROOT = Path(localpoly.__file__).resolve().parent
ROOT = PACKAGE_ROOT.parent
RANDOM_STATE = 1
@pytest.fixture
@pytest.fixture
@pytest.fixture
| [
11748,
12972,
9288,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1957,
35428,
198,
198,
47,
8120,
11879,
62,
13252,
2394,
796,
10644,
7,
12001,
35428,
13,
834,
7753,
834,
737,
411,
6442,
22446,
800... | 2.717647 | 85 |
from settings.common import *
# Enable debugging
DEBUG = True
# Allow all hostnames to access the server
ALLOWED_HOSTS = "*"
# Enable Django debug toolbar
if is_truthy(os.environ.get("ENABLE_DJANGO_DEBUG_TOOLBAR")):
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware")
INSTALLED_APPS.exten... | [
6738,
6460,
13,
11321,
1330,
1635,
628,
198,
2,
27882,
28769,
198,
30531,
796,
6407,
198,
198,
2,
22507,
477,
2583,
14933,
284,
1895,
262,
4382,
198,
7036,
3913,
1961,
62,
39,
10892,
50,
796,
366,
9,
1,
198,
198,
2,
27882,
37770,
... | 2.383648 | 477 |
import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
desc = "A project generator tools for ea... | [
11748,
28686,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
2,
34030,
2163,
284,
1100,
262,
20832,
11682,
2393,
13,
198,
2,
16718,
329,
262,
890,
62,
11213,
13,
220,
632,
338,
3621,
11,
780,
783,
352,
8,
... | 2.743719 | 398 |
#
# IMPORTS
#
import bpy
import imp
import mathutils
import os
import curveexport
imp.reload( curveexport )
import cameraexport
imp.reload( cameraexport )
import cameravolumeexport
imp.reload( cameravolumeexport )
import boundingvolumeexport
imp.reload( boundingvolumeexport )
import lightexport
imp.reload( lightexport... | [
2,
198,
2,
30023,
33002,
198,
2,
198,
11748,
275,
9078,
198,
11748,
848,
198,
11748,
10688,
26791,
198,
11748,
28686,
198,
198,
11748,
12133,
39344,
198,
11011,
13,
260,
2220,
7,
12133,
39344,
1267,
198,
11748,
4676,
39344,
198,
11011,
... | 4.171806 | 227 |
# Generated by Django 3.1.7 on 2021-02-25 14:06
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
2999,
12,
1495,
1478,
25,
3312,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
'''Utility functions'''
import multiprocessing
from .globalVariables import *
def readMathIOmicaData(fileName):
'''Read text files exported by MathIOmica and convert to Python data
Parameters:
fileName: str
Path of directories and name of the file containing data
... | [
7061,
6,
18274,
879,
5499,
7061,
6,
201,
198,
201,
198,
201,
198,
11748,
18540,
305,
919,
278,
201,
198,
201,
198,
6738,
764,
20541,
23907,
2977,
1330,
1635,
201,
198,
201,
198,
201,
198,
4299,
1100,
37372,
9399,
76,
3970,
6601,
7,
... | 2.303725 | 1,396 |
from kicker.agents.neural_net_agent import NeuralNetAgent
from Application import Application, read_config
config = read_config()
randomness = 0.5
if 'randomness' in config:
randomness = config['randomness']
agent = NeuralNetAgent(randomness=randomness)
app = Application(agent)
app.run()
| [
6738,
38297,
13,
49638,
13,
710,
1523,
62,
3262,
62,
25781,
1330,
47986,
7934,
36772,
198,
6738,
15678,
1330,
15678,
11,
1100,
62,
11250,
198,
198,
11250,
796,
1100,
62,
11250,
3419,
198,
198,
25120,
1108,
796,
657,
13,
20,
198,
198,
... | 3.311111 | 90 |
# Generated by Django 4.0 on 2021-12-26 01:35
import datetime
from django.db import migrations, models
from django.utils.timezone import utc
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
319,
33448,
12,
1065,
12,
2075,
5534,
25,
2327,
198,
198,
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
2435,
11340,
... | 3.108696 | 46 |
import os
import dotenv as dv
import random
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
class Sentences:
"""Storage for all sentences the bot can throw out"""
insult_texts = ["Du stinkst hart nach Maggi.", "Fettsack geh sport machen!", "Ein Baum hat mehr IQ als du.",
... | [
11748,
28686,
198,
11748,
16605,
24330,
355,
288,
85,
198,
11748,
4738,
198,
198,
6738,
573,
30536,
13,
2302,
1330,
3205,
67,
729,
11,
9455,
25060,
11,
16000,
25060,
11,
7066,
1010,
628,
198,
4871,
11352,
3007,
25,
198,
220,
220,
220,... | 2.569161 | 882 |