content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import numpy as np
from math import pi
from os.path import join
import matplotlib.pyplot as plt
from src import MLEnergy, list_tl_files
plt.ion()
source_depth = 'shallow'
#source_depth = 'deep'
save_dict = one_freq(400)
save_dict['e_ri_400'] = save_dict.pop('e_ri')
save_dict['e_ri_0_400'] = save_dict.pop('e_ri_0')
s... | [
11748,
299,
32152,
355,
45941,
198,
6738,
10688,
1330,
31028,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
6738,
12351,
1330,
337,
2538,
5877,
11,
1351,
62,
28781,
62,
... | 2.328413 | 271 |
# Author: Martin McBride
# Created: 2021-07-07
# Copyright (C) 2021, Martin McBride
# License: MIT
# Draw paths with Pillow
from PIL import Image, ImageDraw, ImagePath
import math
import random
count = 201
points = [curve(t) for t in range(0, count, 10)]
# Creating and drawing a path
image = Image.new('RGB', (400... | [
2,
6434,
25,
220,
5780,
1982,
47148,
198,
2,
15622,
25,
33448,
12,
2998,
12,
2998,
198,
2,
15069,
357,
34,
8,
33448,
11,
5780,
1982,
47148,
198,
2,
13789,
25,
17168,
198,
198,
2,
15315,
13532,
351,
19770,
322,
198,
198,
6738,
350,... | 2.690821 | 414 |
import pyautogui
from PIL import ImageGrab, ImageOps
from numpy import *
if __name__ == "__main__":
main()
| [
11748,
12972,
2306,
519,
9019,
198,
6738,
350,
4146,
1330,
7412,
48400,
11,
7412,
41472,
198,
6738,
299,
32152,
1330,
1635,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
12417,
3419,
198
] | 2.868421 | 38 |
from collections import namedtuple
HOST = namedtuple('HOST', 'servers sockets channels DPC')
DRAM = namedtuple('DRAM', 'ranks bgroups banks')
'''
Datacenter of ICX servers: 100K, 2 sockets, 8 channels, 2DPC
Datacenter of ARM servers: 100K, 1 socket, 12 channels, 1DPC
Dual-socket ICX server: 1 node, 2 sockets, 8 c... | [
6738,
17268,
220,
220,
220,
1330,
3706,
83,
29291,
198,
198,
39,
10892,
796,
3706,
83,
29291,
10786,
39,
10892,
3256,
705,
2655,
690,
37037,
9619,
360,
5662,
11537,
198,
7707,
2390,
796,
3706,
83,
29291,
10786,
7707,
2390,
3256,
705,
... | 2.294805 | 770 |
# =========================================================================== #
# ____________________ |Importation des lib/packages| ____________________ #
# =========================================================================== #
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import ... | [
2,
38093,
2559,
855,
1303,
198,
2,
220,
4841,
1427,
220,
930,
3546,
10189,
748,
9195,
14,
43789,
91,
220,
220,
220,
4841,
1427,
1303,
198,
2,
38093,
2559,
855,
1303,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
... | 2.686632 | 1,152 |
from django.contrib.sitemaps import Sitemap
from academicPhylogeny.models import PhD
| [
6738,
42625,
14208,
13,
3642,
822,
13,
82,
9186,
1686,
1330,
311,
9186,
499,
198,
6738,
8233,
2725,
2645,
6644,
88,
13,
27530,
1330,
16394,
198
] | 3.269231 | 26 |
import sys, os
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/' + '../..'))
from tmlib.datasets import utilizies
from ldamodel import LdaModel
from tmlib.datasets.dataset import DataSet
import logging
FORMAT = "%(levelname)s> In %(module)s.%(funcName)s line %(lineno)d at %(asctime)-s> %(message)s"
logg... | [
11748,
25064,
11,
28686,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
8,
1343,
31051,
6,
1343,
705,
40720,
492,
6,
4008,
198,
6738,
256,
4029,
571,
... | 2.120625 | 1,857 |
from os.path import join as pjoin
from os import listdir
import pandas as pd
from pandas import DataFrame
if __name__ == '__main__':
main()
| [
6738,
28686,
13,
6978,
1330,
4654,
355,
279,
22179,
198,
6738,
28686,
1330,
1351,
15908,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
19798,
292,
1330,
6060,
19778,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
... | 2.98 | 50 |
"""Markdown rendering with python-markdown2.
https://github.com/trentm/python-markdown2
"""
import markdown2
from django import template
register = template.Library()
@register.filter()
def markdown(md):
"""Render html from markdown string."""
if not md:
return ""
return markdown2.markdown(md, ... | [
37811,
9704,
2902,
14837,
351,
21015,
12,
4102,
2902,
17,
13,
198,
198,
5450,
1378,
12567,
13,
785,
14,
83,
1156,
76,
14,
29412,
12,
4102,
2902,
17,
198,
37811,
198,
198,
11748,
1317,
2902,
17,
198,
6738,
42625,
14208,
1330,
11055,
... | 2.471204 | 191 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^areas/$', views.AreasView.as_view()),
# 如果路由匹配成功,会生成一个字典数据{'pk':1300}
url(r'^areas/(?P<pk>\d+)/$', views.AreaView.as_view()),
url(r'^addresses/$', views.AddressView.as_view()),
url(r'^addresses/(?P<pk>\d+)/$', views.Address... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
533,
292,
32624,
3256,
5009,
13,
8491,
292,
7680,
13,
292,
62,
117... | 1.874046 | 262 |
RESULTS = [({'scale_factor': 1000, 'threads': 1, 'txn_flags': 1, 'db': 'kvdb', 'bench': 'ycsb'}, (455923.0, 0.0)), ({'scale_factor': 1000, 'threads': 1, 'txn_flags': 1, 'db': 'ndb-proto2', 'bench': 'ycsb'}, (392189.0, 0.0)), ({'scale_factor': 4000, 'threads': 4, 'txn_flags': 1, 'db': 'kvdb', 'bench': 'ycsb'}, (1837830.... | [
46274,
796,
685,
15090,
6,
9888,
62,
31412,
10354,
8576,
11,
705,
16663,
82,
10354,
352,
11,
705,
17602,
77,
62,
33152,
10354,
352,
11,
705,
9945,
10354,
705,
74,
85,
9945,
3256,
705,
26968,
10354,
705,
88,
6359,
65,
6,
5512,
357,
... | 2.112013 | 1,848 |
# -*- coding: utf-8 -*-
"PLOTTING FILE"
import matplotlib.pyplot as plt
import Graphics as artist
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
1,
6489,
29089,
2751,
45811,
1,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
220,
198,
11748,
19840,
355,
6802,
628,
198
] | 2.589744 | 39 |
"""
# SOURCE
https://gum.co/prselectionui
https://github.com/parzival-roethlein/prmaya
# DESCRIPTION
A dynamic User Interface (UI) to manage selections and poses in Autodesk Maya.
# USAGE
Put the file prSelectionUi.py in your Maya scripts folder and execute:
- Python:
import prSelectionUi;prSelectionUi.UI()
- MEL (fo... | [
37811,
198,
2,
311,
31033,
198,
5450,
1378,
70,
388,
13,
1073,
14,
1050,
49283,
9019,
198,
5450,
1378,
12567,
13,
785,
14,
1845,
89,
2473,
12,
305,
2788,
33663,
14,
1050,
11261,
64,
198,
198,
2,
22196,
40165,
198,
32,
8925,
11787,
... | 2.213332 | 28,397 |
from django.contrib.auth.models import Group
from django.contrib.auth.forms import UserCreationForm, UserCreationForm, UserChangeForm
from django import forms
#
from authApp.models import User
#
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
4912,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
11787,
12443,
341,
8479,
11,
11787,
12443,
341,
8479,
11,
11787,
19400,
8479,
198,
6738,
42625,
142... | 3.45614 | 57 |
#!/usr/bin/python3
import subprocess
import sys
import re
import textwrap
P = []
P.append(['<lb type="x-begin-paragraph"/>', ''])
P.append(['<lb type="x-end-paragraph"/>', '\\'])
P.append(['<q marker="">', ''])
P.append(['</q>', ''])
P.append(['<milestone marker="“" type="cQuote"/>', '"'])
P.append(['<milestone... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
302,
198,
11748,
2420,
37150,
198,
198,
47,
796,
17635,
198,
47,
13,
33295,
7,
17816,
27,
23160,
2099,
2625,
87,
12,
27471,
12,
20... | 2.179211 | 1,116 |
import numpy as np
# Num entries per column
DATA_LENGTH = 10
# Data for tests in datamining lib
data = {
"dates": [
"01/17/2000",
"January 17, 2000",
"Jan 17, 2000",
"17 Jan 2000",
"17 January 2000",
"01-17-2000",
"January 17th 2000",
"17-01-2000",
... | [
11748,
299,
32152,
355,
45941,
198,
198,
2,
31835,
12784,
583,
5721,
198,
26947,
62,
43,
49494,
796,
838,
198,
198,
2,
6060,
329,
5254,
287,
4818,
321,
3191,
9195,
198,
7890,
796,
1391,
198,
220,
220,
220,
366,
19581,
1298,
685,
198... | 1.910596 | 302 |
import random
#===exercício 01===
num= int(input("Seu palpite:"))
sor= random.randint(1,5)
if (num == sor):
print("O número sorteado foi {}.\nVocê é o bichão mesmo hein".format(sor))
else:
print("O número sorteado foi {}.\nTente novamente".format(sor))
#===exercício02===
vel= float(input("velocidade do automóv... | [
11748,
4738,
198,
2,
18604,
1069,
2798,
8836,
66,
952,
5534,
18604,
198,
22510,
28,
493,
7,
15414,
7203,
4653,
84,
6340,
2595,
11097,
4008,
198,
82,
273,
28,
4738,
13,
25192,
600,
7,
16,
11,
20,
8,
198,
361,
357,
22510,
6624,
2565... | 2.136652 | 1,105 |
import abc
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Type
from xsdata.exceptions import XmlHandlerError
from xsdata.formats.bindings import AbstractParser
from xsdata.formats.dataclass.parsers.config import ParserConfi... | [
11748,
450,
66,
198,
6738,
19720,
1330,
4377,
198,
6738,
19720,
1330,
360,
713,
198,
6738,
19720,
1330,
7343,
198,
6738,
19720,
1330,
32233,
198,
6738,
19720,
1330,
309,
29291,
198,
6738,
19720,
1330,
5994,
198,
198,
6738,
2124,
82,
789... | 2.415094 | 2,173 |
#!/usr/bin/env python
import argparse
from mlsurfacelayer.data import process_cabauw_data
from mlsurfacelayer.data import process_idaho_data
if __name__ == "__main__":
main() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
1822,
29572,
198,
6738,
285,
7278,
333,
38942,
417,
2794,
13,
7890,
1330,
1429,
62,
66,
397,
559,
86,
62,
7890,
198,
6738,
285,
7278,
333,
38942,
417,
2794,
13,
7890,
1330,
14... | 2.712121 | 66 |
from LuaStakky.TarantoolAppBuilder import *
import os
import pytest
| [
6738,
43316,
1273,
461,
2584,
13,
51,
4741,
970,
4677,
32875,
1330,
1635,
201,
198,
11748,
28686,
201,
198,
11748,
12972,
9288,
201,
198,
201,
198
] | 2.807692 | 26 |
from dataclasses import dataclass
from daily_fantasy_sports_models.core.sets import is_disjoint
from daily_fantasy_sports_models.draft_kings.nba.models.contests.salary_cap.player_pool.player import Player \
as PlayerPoolPlayer
from daily_fantasy_sports_models.draft_kings.nba.models.core.position import Position
... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
198,
6738,
4445,
62,
69,
34921,
62,
32945,
62,
27530,
13,
7295,
13,
28709,
1330,
318,
62,
6381,
73,
1563,
198,
6738,
4445,
62,
69,
34921,
62,
32945,
62,
27530,
13,
35679,
62,
74,
... | 3.060897 | 312 |
# License information goes here
# -*- coding: utf-8 -*-
"""
======================
sdss_install.install4
======================
This package contains code for installing SDSS-IV software products.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# The line above will help with 2to... | [
2,
13789,
1321,
2925,
994,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
4770,
50155,
198,
21282,
824,
62,
17350,
13,
17350,
19,
198,
4770,
50155,
198,
198,
1212,
5301,
4909,
2438,
329,
15975,
311,
... | 3.562963 | 135 |
#########################################################
#
# DO NOT EDIT THIS FILE. IT IS GENERATED AUTOMATICALLY. #
# PLEASE LOOK INTO THE README FOR MORE INFORMATION. #
#
#########################################################
# coding: utf-8
# # CIFAR-10: Part 2
#
# Welcome back! If you have not completed... | [
29113,
14468,
7804,
2,
198,
2,
198,
2,
8410,
5626,
48483,
12680,
45811,
13,
7283,
3180,
24700,
1137,
11617,
47044,
2662,
1404,
2149,
19807,
13,
1303,
198,
2,
37795,
48045,
39319,
3336,
20832,
11682,
7473,
12011,
38044,
13,
220,
220,
220... | 3.28347 | 4,519 |
from django.db.models import Q
from django.utils.encoding import force_text
from django.db import connection
from ..settings import DEFAULT_SEARCH_FIELDS
__all__ = ('AutocompleteModel', )
class AutocompleteModel(object):
"""Autocomplete which considers choices as a queryset.
.. py:attribute:: choices
... | [
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625,
14208,
13,
26791,
13,
12685,
7656,
1330,
2700,
62,
5239,
198,
6738,
42625,
14208,
13,
9945,
1330,
4637,
198,
198,
6738,
11485,
33692,
1330,
5550,
38865,
62,
5188,
31... | 2.276301 | 2,671 |
import csv
with open("process_mmsdk/mosei_dataset_int.csv", "r") as rf:
csvreader = csv.reader(rf)
next(csvreader)
with open("process_mmsdk/no_sentiment.csv", "w", newline="") as wf:
csvwriter = csv.writer(wf)
headers = ["video_name_segment", "happy", "sad", "anger", "surprise", "disgust",... | [
11748,
269,
21370,
628,
198,
4480,
1280,
7203,
14681,
62,
76,
907,
34388,
14,
76,
577,
72,
62,
19608,
292,
316,
62,
600,
13,
40664,
1600,
366,
81,
4943,
355,
374,
69,
25,
198,
220,
220,
220,
269,
21370,
46862,
796,
269,
21370,
13,... | 2.056738 | 282 |
# Generated by Django 2.0.1 on 2018-01-18 09:06
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
16,
319,
2864,
12,
486,
12,
1507,
7769,
25,
3312,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# celery.py
"""
Using SQS queue & MySQL result
pip install https://github.com/celery/vine/zipball/master#egg=vine
pip install https://github.com/celery/kombu/zipball/master#egg=kombu
pip install https://github.com/celery/py-amqp/zipball/master#egg=amqp
pip install https://github.com/celery/billiard/zipball/master#egg=b... | [
2,
18725,
1924,
13,
9078,
198,
37811,
198,
12814,
49747,
50,
16834,
1222,
33476,
1255,
198,
79,
541,
2721,
3740,
1378,
12567,
13,
785,
14,
7015,
88,
14,
26818,
14,
13344,
1894,
14,
9866,
2,
33856,
28,
26818,
198,
79,
541,
2721,
3740... | 2.754762 | 420 |
print(f"\n{'*' * 50}")
# Example 1 - Using Square function
print(f'Square of 5 is {square(5)}')
lst = [1, 2, -5, 4]
# Apply the square function to each element in the list - Using For loop
rslt = list() # Or rslt = []
for ii in lst:
rslt.append(square(ii))
print("Example 1 - Using Loop", rslt)
# Apply the squ... | [
4798,
7,
69,
1,
59,
77,
90,
6,
9,
6,
1635,
2026,
92,
4943,
198,
2,
17934,
352,
532,
8554,
9276,
2163,
198,
198,
4798,
7,
69,
6,
48011,
286,
642,
318,
1391,
23415,
7,
20,
38165,
11537,
198,
198,
75,
301,
796,
685,
16,
11,
362... | 2.825708 | 459 |
from app.application.views import application # noqa
| [
6738,
598,
13,
31438,
13,
33571,
1330,
3586,
220,
1303,
645,
20402,
198
] | 4.153846 | 13 |
from .IMClientProtocol import *
from .IMClientSocket import *
from .user import *
from .localService import *
| [
6738,
764,
3955,
11792,
19703,
4668,
1330,
1635,
201,
198,
6738,
764,
3955,
11792,
39105,
1330,
1635,
201,
198,
6738,
764,
7220,
1330,
1635,
201,
198,
6738,
764,
12001,
16177,
1330,
1635,
201,
198
] | 3.352941 | 34 |
CLIENT_ID = "9ecf1e52d5034f01ac8fce5378decd00"
CLIENT_SECRET = "519c44e4a4764c208327e9ba8059f2fd"
REDIRECT_URI = "http://localhost:8000/spotify/redirect"
| [
5097,
28495,
62,
2389,
796,
366,
24,
721,
69,
16,
68,
4309,
67,
1120,
2682,
69,
486,
330,
23,
69,
344,
20,
30695,
12501,
67,
405,
1,
198,
5097,
28495,
62,
23683,
26087,
796,
366,
47785,
66,
2598,
68,
19,
64,
2857,
2414,
66,
1238... | 2 | 77 |
import unittest
import math
from signals.functions.baseline import BaseLine
if __name__ == '__main__':
unittest.main() | [
11748,
555,
715,
395,
198,
11748,
10688,
198,
6738,
10425,
13,
12543,
2733,
13,
12093,
4470,
1330,
7308,
13949,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419
] | 3 | 41 |
"""
Module: Permissions for templates rendering helpers for MDTUI
Project: Adlibre DMS
Copyright: Adlibre Pty Ltd 2012
License: See LICENSE for license information
Author: Iurii Garmash
"""
from django import template
from mdtui.security import SEC_GROUP_NAMES
register = template.Library()
@register.simple_tag(take... | [
37811,
198,
26796,
25,
2448,
8481,
329,
24019,
14837,
49385,
329,
10670,
51,
10080,
198,
198,
16775,
25,
1215,
8019,
260,
360,
5653,
198,
15269,
25,
1215,
8019,
260,
350,
774,
12052,
2321,
198,
34156,
25,
4091,
38559,
24290,
329,
5964,
... | 2.778256 | 929 |
import sys
import os
from os import remove
from os.path import join, dirname, realpath, exists
import numpy as np
import time
start_time = None
if __name__ == '__main__':
# time logging
#global start_time
start_time = time.time()
from pickle import load
import argparse
# parse c... | [
11748,
25064,
198,
11748,
28686,
220,
198,
6738,
28686,
1330,
4781,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
26672,
3672,
11,
1103,
6978,
11,
7160,
198,
11748,
299,
32152,
355,
45941,
198,
220,
220,
220,
220,
198,
11748,
640,
198,
... | 2.202669 | 2,773 |
from .models import Place
from django.contrib.gis.geos import Point
import random
min_x = -74.8
max_x = -75.2
min_y = 39.7
max_y = 40.2
objects = [
"CD",
"Christmas ornament",
"acorn",
"apple",
"bag",
"bag of cotton balls",
"bag of popcorn",
"bag of rubber bands",
"ball of yarn",
... | [
6738,
764,
27530,
1330,
8474,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
70,
271,
13,
469,
418,
1330,
6252,
198,
11748,
4738,
198,
198,
1084,
62,
87,
796,
532,
4524,
13,
23,
198,
9806,
62,
87,
796,
532,
2425,
13,
17,
198,
1084,
... | 2.061447 | 3,857 |
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Title :
#-----------------------------------------------------------------------------
# File : TopLevel.py
# Created : 2017-04-03
#----------------------------------------------------------------------... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
10097,
32501,
198,
2,
11851,
220,
220,
220,
220,
220,
1058,
220,
198,
2,
10097,
32501,
198,
2,
9220,
220,
220,
220,
220,
220,
220,
1058,
5849,
4971,
13,
9078,
198,
2,
15622,
220... | 4.618605 | 215 |
#!/usr/bin/env python2.7
# Copyright 2015 gRPC authors.
#
# 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 la... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
22,
198,
2,
15069,
1853,
308,
49,
5662,
7035,
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,
7... | 3.054482 | 569 |
# names.py
import tkinter as tk
import sqlite3
from files import get_current_file
from styles import config_generic
from widgets import (
Frame, Label, Button, LabelMovable, LabelH3, Entry, Toplevel)
from window_border import Border
from custom_combobox_widget import Combobox
from scrolling import Mous... | [
2,
3891,
13,
9078,
201,
198,
201,
198,
11748,
256,
74,
3849,
355,
256,
74,
201,
198,
11748,
44161,
578,
18,
201,
198,
6738,
3696,
1330,
651,
62,
14421,
62,
7753,
201,
198,
6738,
12186,
1330,
4566,
62,
41357,
201,
198,
6738,
40803,
... | 2.343865 | 1,361 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
from collections import OrderedDict
from datetime import date
CATEGORY_RE = re.compile(r'(?:^| )(beginner|novice|pro|[a-c](?:/[a-c])*|(?:pro/?)*[1-5](?:/[1-5])*)(?: |$)', flags=re.I)
AGE_RANGE_RE = re.compile(r'([7-9]|1[0-9])(-([7-9]|1[0-9]))?')
NAME_RE = re.com... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
302,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
4818,
8079,
1330,
3128,
198,
198,
34,
6158,
... | 1.773351 | 3,715 |
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from postgresqleu.adyen.models import Notification, AdyenLog
from postgresqleu.adyen.util import process_one_notification
| [
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
11,
9455,
12331,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
198,
198,
6738,
1281,
34239,
80,
293,
84,
13,
4597,
268,
13,
27530,
1330,
42808,
11,
1215,
88,
268,
... | 3.555556 | 63 |
import numpy as np
from numpy import sin
from numpy.linalg import lstsq
import matplotlib.pyplot as plt
xdata = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14.])
ydata = np.array([0, 0, 0, -1, -2, -4, -8, -16, -8, -4, -2, -1, 0, 0, 0.])
m = 10
a = np.array([[1*sin(i*np.pi*(xdata-0)/(14-0))] for i in rang... | [
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
1330,
7813,
198,
6738,
299,
32152,
13,
75,
1292,
70,
1330,
300,
6448,
80,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
87,
7890,
796,
45941,
13,
18747,
... | 1.954178 | 371 |
"""
Views belonging to the core of the site which do not relate to a person, project or task.
"""
from django.views.generic import TemplateView
class IndexView(TemplateView):
"""
View for site index page.
"""
template_name = 'index.html'
| [
37811,
198,
7680,
82,
16686,
284,
262,
4755,
286,
262,
2524,
543,
466,
407,
15124,
284,
257,
1048,
11,
1628,
393,
4876,
13,
198,
37811,
198,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
37350,
7680,
628,
198,
4871,
12901,
7680... | 3.2125 | 80 |
#!/usr/bin/env python
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
15069,
33160,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
... | 3.196203 | 316 |
import numpy as np
import json
from tqdm import tqdm
import gc
#import cupy
# for num in tqdm(range(1,12)):
# dataset[num] = []
# for vec in tqdm(vector_dict['{}'.format(num)]):
#print(num)
#print(vec)
#print(len(vec))
# dataset[num].append(oneho... | [
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
308,
66,
198,
2,
11748,
6508,
88,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
2,
220,
220,
220,
329,
997,
287,
25... | 1.893333 | 225 |
ONE_MINUTE = 1 / 60
SUCCESS = 1
FAIL = 0
FILE_NOT_FOUND = 'File not found.\nBe sure the file exists.'
MALFORMED_FILE = 'File is malformed, please check the file'
WRONG_TIME_RANGE = 'Invalid range of hours'
EMPTY_FILE = 'File is empty'
WORKWEEK = ['MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU']
WEEKEND = ['SA', 'SU']
MIN_... | [
11651,
62,
23678,
37780,
796,
352,
1220,
3126,
198,
198,
12564,
4093,
7597,
796,
352,
198,
7708,
4146,
796,
657,
198,
198,
25664,
62,
11929,
62,
37,
15919,
796,
705,
8979,
407,
1043,
13,
59,
77,
3856,
1654,
262,
2393,
7160,
2637,
19... | 2.432624 | 141 |
import os
import json
_FILENAME = 'environ'
_FILEPATH = './.%s' % _FILENAME
| [
11748,
28686,
198,
11748,
33918,
198,
198,
62,
46700,
1677,
10067,
796,
705,
268,
2268,
6,
198,
62,
25664,
34219,
796,
45302,
11757,
4,
82,
6,
4064,
4808,
46700,
1677,
10067,
198
] | 2.40625 | 32 |
import numpy
import cv2
image = cv2.imread("imagenes/carro.jpg")
cv2.waitKey(0)
| [
11748,
299,
32152,
198,
11748,
269,
85,
17,
198,
198,
9060,
796,
269,
85,
17,
13,
320,
961,
7203,
320,
11286,
274,
14,
7718,
305,
13,
9479,
4943,
198,
198,
33967,
17,
13,
17077,
9218,
7,
15,
8,
628,
198
] | 2.1 | 40 |
# pylint: skip-file
#- @test defines/binding FnTest
#- @x defines/binding ArgX
#- FnTest.node/kind function
#- FnTest param.0 ArgX
#- @foo defines/binding FnFoo
#- @x defines/binding ArgFooX
#- FnFoo.node/kind function
#- FnFoo param.0 ArgFooX
#- @y defines/binding VarY
#- @test ref FnTest
#- @test ref/call FnTest... | [
2,
279,
2645,
600,
25,
14267,
12,
7753,
198,
198,
2,
12,
2488,
9288,
15738,
14,
30786,
37481,
14402,
198,
2,
12,
2488,
87,
15738,
14,
30786,
20559,
55,
198,
2,
12,
37481,
14402,
13,
17440,
14,
11031,
2163,
198,
2,
12,
37481,
14402... | 2.556604 | 212 |
if __name__ == '__main__':
import sys
import blaze.server.spider
sys.exit(blaze.server.spider._main())
| [
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
1330,
25064,
201,
198,
220,
220,
220,
1330,
31259,
13,
15388,
13,
2777,
1304,
201,
198,
201,
198,
220,
220,
220,
25064,
13,
37023,
7,
2436,
6201,
13,... | 2.326923 | 52 |
import torch
import torch.nn as nn
import torch.nn.functional as F
def weighted_soft_dice_loss(inputs, targets, v2=0.9, eps=1e-4):
"""
From https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9180275
allows contribution of negative samples
"""
v1 = 1 - v2
iflat = inputs.view(-1)
tflat = ... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
628,
198,
4299,
26356,
62,
4215,
62,
67,
501,
62,
22462,
7,
15414,
82,
11,
6670,
11,
410,
17,
28,
15,
13,
24,
11,
304,
... | 2.243728 | 279 |
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 26 23:59:24 2019
@author: orteg
"""
import click
import pandas as pd
import networkx as nx
from preprop_utils import splitgraph
from datetime import datetime
###################################################################
@click.command()
@click.argument('input_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
5267,
2608,
2242,
25,
3270,
25,
1731,
13130,
198,
198,
31,
9800,
25,
393,
660,
70,
198,
37811,
198,
11748,
3904,
198,
11748,
19798,
292,
... | 2.667774 | 301 |
"""This package directory is used to store non-Canari transform code.
Why would you want to use for Canari? For easy transform distribution.
You can use Canari as a transform proxy to execute your non-Python or
non-Canari transform code. This allows you to package up your transforms
in an easy-to-use transform package... | [
37811,
1212,
5301,
8619,
318,
973,
284,
3650,
1729,
12,
6090,
2743,
6121,
2438,
13,
198,
198,
5195,
561,
345,
765,
284,
779,
329,
1680,
2743,
30,
1114,
2562,
6121,
6082,
13,
198,
1639,
460,
779,
1680,
2743,
355,
257,
6121,
15741,
28... | 4.177778 | 90 |
import unittest
from src.LFSR import LFSR
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
12351,
13,
43,
10652,
49,
1330,
406,
10652,
49,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419,
198
] | 2.333333 | 39 |
import numpy as np
import matplotlib.pyplot as plt
x1 = np.linspace(0,4,100)
x2 = np.linspace(-0.5,1,100)
x1, x2 = np.meshgrid(x1,x2)
f = (1.5 - x1*(1.0-x2))**2 + (2.25 - x1*(1.0-(x2**2)))**2 + (2.625 - x1*(1.0-(x2**3)))**2
plt.figure()
plt.contourf(x1,x2,f,100)
plt.colorbar()
plt.xlabel(r'$x_1$')
plt.y... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
201,
198,
87,
16,
796,
45941,
13,
21602,
10223,
7,
15,
11,
19,
11,
3064,
8,
201,
198,
87,
17,
796,
45941,
13,
21602,
10223... | 1.621495 | 214 |
# https://oj.leetcode.com/problems/sudoku-solver/
# @param board, a 9x9 2D array
# Solve the Sudoku by modifying the input board in-place.
# Do not return any value.
import pprint as pp
# Pass OJ !!
# @param board, a 9x9 2D array
# Solve the Sudoku by modifying the input board in-place.
# Do not return an... | [
2,
3740,
1378,
13210,
13,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
82,
463,
11601,
12,
82,
14375,
14,
198,
220,
1303,
2488,
17143,
3096,
11,
257,
860,
87,
24,
362,
35,
7177,
198,
220,
1303,
4294,
303,
262,
14818,
11601,
416,
... | 2.880682 | 176 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import sys
import logging
from flask import Flask, request
import requests
from subsonic_api_proxy import __version__
_logger = logging.getLogger(__name__)
def parse_args(args):
"""Parse command line parameters
Args:
args ([str]): command... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
18931,
198,
6738,
42903,
1330,
46947,
11,
2581,
198,
11748,
7007,
628,... | 2.31466 | 839 |
import numpy as np
from saltproc import Process
class Separator(Process):
"""Class evaluates gas removal efficiency in separator (bubble separator).
Attributes
----------
q_salt : float
volumetric salt flow rate (m^3/s)
Default: 0.1
q_he : float
volumetric helium flow rat... | [
198,
11748,
299,
32152,
355,
45941,
198,
6738,
8268,
36942,
1330,
10854,
628,
198,
4871,
8621,
283,
1352,
7,
18709,
2599,
198,
220,
220,
220,
37227,
9487,
47850,
3623,
9934,
9332,
287,
2880,
1352,
357,
46176,
903,
2880,
1352,
737,
628,
... | 1.957433 | 3,195 |
import core.utils as utils
import core.plots as plots
import pandas as pd
bwap_dict = {}
source_dir = utils.make_path('result', '0061_all')
bwap_S = pd.read_csv(f"{source_dir}S/twap/0.csv")
bwap_V = pd.read_csv(f"{source_dir}2202101349/twap/0.csv")
bwap_dict['bwap_V'] = bwap_V
bwap_dict['bwap_S'] = bwap_S
results_pa... | [
11748,
4755,
13,
26791,
355,
3384,
4487,
198,
11748,
4755,
13,
489,
1747,
355,
21528,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
65,
86,
499,
62,
11600,
796,
23884,
198,
10459,
62,
15908,
796,
3384,
4487,
13,
15883,
62,
6978,
1... | 1.819495 | 277 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:Mod: eml_data_format
:Synopsis:
:Author:
servilla
:Created:
3/29/20
"""
import daiquiri
from rendere.eml.eml_utils import clean
logger = daiquiri.getLogger(__name__)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
25,
5841,
25,
795,
75,
62,
7890,
62,
18982,
198,
198,
25,
49771,
25,
198,
198,
25,
13838,
25,
198,... | 2.219048 | 105 |
"""
Definition of the :class:`NIfTI` model.
"""
import itertools
import json
import logging
from pathlib import Path
from typing import Iterable, List, Union
import nibabel as nib
import numpy as np
from django.db import IntegrityError, models
from django_analyses.models.input import FileInput, ListInput
from django_e... | [
37811,
198,
36621,
286,
262,
1058,
4871,
25,
63,
45,
1532,
25621,
63,
2746,
13,
198,
37811,
198,
11748,
340,
861,
10141,
198,
11748,
33918,
198,
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
40806,
540,
11,
... | 2.222866 | 5,694 |
import datetime as dt
from fastapi.responses import JSONResponse as Response
from fastapi import Request
from fast_agave.filters import generic_query
from ..models import Account as AccountModel
from ..validators import AccountQuery, AccountRequest, AccountUpdateRequest
from .base import app
@app.resource('/accounts... | [
11748,
4818,
8079,
355,
288,
83,
198,
198,
6738,
3049,
15042,
13,
16733,
274,
1330,
19449,
31077,
355,
18261,
198,
6738,
3049,
15042,
1330,
19390,
198,
6738,
3049,
62,
363,
1015,
13,
10379,
1010,
1330,
14276,
62,
22766,
198,
6738,
11485... | 4.0375 | 80 |
## This file is part of Scapy
## Copyright (C) 2008 Arnaud Ebalard <arno@natisbad.org>
## 2015, 2016 Maxence Tury <maxence.tury@ssi.gouv.fr>
## This program is published under a GPLv2 license
"""
PKCS #1 methods as defined in RFC 3447.
"""
import os, popen2, tempfile
import math, random, struct
from hashlib i... | [
2235,
770,
2393,
318,
636,
286,
1446,
12826,
198,
2235,
15069,
357,
34,
8,
3648,
943,
2616,
463,
412,
6893,
446,
1279,
1501,
78,
31,
32353,
271,
14774,
13,
2398,
29,
198,
2235,
220,
220,
220,
220,
220,
220,
220,
220,
1853,
11,
158... | 2.023356 | 7,450 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 3.577657 | 367 |
"""Tests for distos.error.stencil
"""
import sys
sys.path.insert(1, "..")
import unittest
from dictos.spec import has_zero, has_duplicated_points
from dictos.error.stencil import ContainsZeroError, DuplicatedPointError, TooNarrowError
if __name__ == "__main__":
unittest.main()
| [
37811,
51,
3558,
329,
1233,
418,
13,
18224,
13,
26400,
2856,
198,
37811,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
28463,
7,
16,
11,
366,
492,
4943,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
8633,
418,
13,
16684,
1330,... | 2.851485 | 101 |
from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq_groups import GroupsIqProtocolEntity
class SubjectGroupsIqProtocolEntity(GroupsIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:g2", to={{group_jid}}">
<subject>
{{NEW_VAL}}
</subject>
</iq>
'''
... | [
6738,
331,
1666,
929,
13,
7249,
82,
1330,
20497,
32398,
11,
20497,
27660,
19667,
198,
6738,
764,
25011,
62,
24432,
1330,
27441,
40,
80,
19703,
4668,
32398,
198,
4871,
15540,
38,
14459,
40,
80,
19703,
4668,
32398,
7,
38,
14459,
40,
80,... | 2.306122 | 147 |
"""test_pyutils.py: Tests for pyutils.py."""
| [
37811,
9288,
62,
9078,
26791,
13,
9078,
25,
30307,
329,
12972,
26791,
13,
9078,
526,
15931,
198
] | 2.647059 | 17 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
from multiprocessing import cpu_count
import pandas as pd
from joblib import Parallel, delayed
from meteostat import Daily, Hourly, Point
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
11748,
28686,
198,
11748,
640,
198,
6738,
18540,
305,
919,
278,
1330,
42804,
62,
9127,
198,
198,
11748,
19798,... | 3.028571 | 70 |
import tycho
data = bytes.fromhex("40 03 03 66 6f 6f 1e 0b 48 65 6c 6c 6f 20 57 6f 72 6c 64 03 62 61 72 11 0a 03 62 61 7a 10 01")
print(tycho.decode(data))
# Structure({'foo': String('Hello World'), 'bar': Unsigned8(10), 'baz': Boolean(True)}) | [
11748,
1259,
6679,
198,
198,
7890,
796,
9881,
13,
6738,
33095,
7203,
1821,
7643,
7643,
7930,
718,
69,
718,
69,
352,
68,
657,
65,
4764,
6135,
718,
66,
718,
66,
718,
69,
1160,
7632,
718,
69,
7724,
718,
66,
5598,
7643,
8190,
8454,
77... | 2.541667 | 96 |
# type: ignore
import email
import os.path
import sifter.parser
| [
2,
2099,
25,
8856,
198,
198,
11748,
3053,
198,
11748,
28686,
13,
6978,
198,
198,
11748,
264,
18171,
13,
48610,
628,
198
] | 3.090909 | 22 |
import unittest
import tests.download
| [
11748,
555,
715,
395,
198,
11748,
5254,
13,
15002,
198
] | 3.8 | 10 |
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(12, GPIO.OUT)#piros
GPIO.setup(16, GPIO.OUT)#sárga
GPIO.setup(18, GPIO.OUT)#zöld
for x in range(10):
GPIO.output(12, GPIO.HIGH)
print("Felkészülni!")
time.sleep(0.15)
GPIO.output(12, GPIO.LOW)
time.sleep(0.15)
GPIO.o... | [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
198,
198,
16960,
9399,
13,
2617,
14171,
7,
16960,
9399,
13,
8202,
9795,
8,
198,
16960,
9399,
13,
2617,
40539,
654,
7,
25101,
8,
198,
16960,
9399,
13,
40406,
7,
1065,
11... | 1.949091 | 275 |
# This sample tests incompatible method overrides for multiple inheritance.
# This functionality is controlled by the reportIncompatibleMethodOverride
# diagnostic rule.
from typing import Generic, TypeVar
# This should generate an error because func1 is incompatible.
# This should generate an error becaus... | [
2,
770,
6291,
5254,
27294,
2446,
23170,
1460,
329,
3294,
24155,
13,
198,
2,
770,
11244,
318,
6856,
416,
262,
989,
818,
38532,
17410,
37961,
198,
2,
23584,
3896,
13,
628,
198,
6738,
19720,
1330,
42044,
11,
5994,
19852,
628,
628,
198,
... | 4.271845 | 103 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Handle loading cassowary package from system or from the bundled copy
"""
try:
from ._bundled.cassowary import * # noqa
except ImportError:
from cassowary import... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
1853,
11,
6911,
9078,
7712,
4816,
13,
198,
2,
4307,
6169,
739,
262,
357,
3605,
8,
347,
10305,
13789,
13,
4091,
38559,
24290,
13,
14116,
329,
51... | 2.981982 | 111 |
import json
import boto3
import pytest
from moto import mock_ecs
from moto import mock_ec2
from moto.ec2 import utils as ec2_utils
# from otter.router.src.shared.client import ECSClient
from otter.router.src.shared.device import Device
from tests.unit import EXAMPLE_AMI_ID
@pytest.fixture
| [
11748,
33918,
198,
198,
11748,
275,
2069,
18,
198,
11748,
12972,
9288,
198,
6738,
285,
2069,
1330,
15290,
62,
721,
82,
198,
6738,
285,
2069,
1330,
15290,
62,
721,
17,
198,
6738,
285,
2069,
13,
721,
17,
1330,
3384,
4487,
355,
9940,
1... | 2.910891 | 101 |
"""Helper functions for mentorbot events and commands."""
from datetime import datetime
import discord
from discord.ext import commands
# Helper Functions
def character_info(cursor, character=None, region=None):
"""Return id, name, color, and icon url of given character/region."""
if character: # If charac... | [
37811,
47429,
5499,
329,
22387,
13645,
2995,
290,
9729,
526,
15931,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
628,
198,
2,
5053,
525,
40480,
198,
4299,
2095,
62,
10951,... | 2.644766 | 898 |
#!/usr/bin/python
print("Loading libs..."), #Importing all libs
import os
import sys
import time
import simplejson
from threading import Thread
import ConfigParser
import cherrypy
import serial
print("Ok")
if not os.geteuid() == 0: #Check if is started as root
sys.exit('Must be run as root')
#Define Global vars#... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
4798,
7203,
19031,
9195,
82,
9313,
828,
1303,
20939,
278,
477,
9195,
82,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
2829,
17752,
198,
6738,
4704,
278,
1330,
14122,
... | 3.321586 | 454 |
class Parser:
"""
Parser for coq sentences.
WS: (" " | "\\n" | "\\t")*
unit: WS (comment | bullet | command)
comment: "(*" (comment | [^*] | "*" not followed by ")")* "*)"
bullet: (bullet-selector? WS "{") | "-"+ | "+"+ | "*"+ | "}"
bullet-selector: ([0-9]+ | "[" WS ident WS "]") WS ":"
... | [
4871,
23042,
263,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
23042,
263,
329,
763,
80,
13439,
13,
198,
220,
220,
220,
25290,
25,
5855,
366,
930,
366,
6852,
77,
1,
930,
366,
6852,
83,
4943,
9,
198,
220,
220,
220,
4326,
25... | 1.941045 | 3,579 |
import aiohttp
import string
import base64 | [
11748,
257,
952,
4023,
198,
11748,
4731,
198,
11748,
2779,
2414
] | 3.818182 | 11 |
# -*-coding:utf-8-*-
from math import sqrt
from ..models import Rating
import random
random.seed(0)
# 声明一个ItemBased推荐的 对象
usercf = UserBasedCF()
# usercf.generate_dataset()
# usercf.cal_user_sim('A')
# for rank_result in usercf.recommend('A'):
# print('推荐%s,推荐度%.2f' %(rank_result[0],rank_result[1]))
| [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
6738,
10688,
1330,
19862,
17034,
198,
6738,
11485,
27530,
1330,
12028,
198,
11748,
4738,
198,
198,
25120,
13,
28826,
7,
15,
8,
198,
198,
2,
10263,
96,
108,
23626,
... | 1.90184 | 163 |
import argparse
import functools
import sys
import pkg_resources
from entropylab.dashboard import serve_dashboard
from entropylab.logger import logger
from entropylab.pipeline.results_backend.sqlalchemy import init_db, upgrade_db
# Decorator for friendly error messages
def command(func: callable) -> callable:
... | [
11748,
1822,
29572,
198,
11748,
1257,
310,
10141,
198,
11748,
25064,
198,
198,
11748,
279,
10025,
62,
37540,
198,
198,
6738,
920,
1773,
2645,
397,
13,
42460,
3526,
1330,
4691,
62,
42460,
3526,
198,
6738,
920,
1773,
2645,
397,
13,
6404,
... | 3.141304 | 184 |
import requests
import json
import os
from datetime import datetime
import time
# This is the class to connect this code to CoinMarketCap APIs
# This is the class in which I set the parameters to fetch the data I need from CoinMarketCap
while True:
# This is an infinite loop that sleeps for 24 hours ea... | [
11748,
7007,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
640,
628,
220,
220,
220,
1303,
770,
318,
262,
1398,
284,
2018,
428,
2438,
284,
16312,
27470,
15610,
23113,
628,
220,
220,
220,
1303,... | 2.915398 | 591 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
import itertools
import tkinter as tk
root = tk.Tk()
root.geometry('200x200')
CYCLED_IMAGES = itertools.cycle([
tk.PhotoImage(file="icons/ok.png"),
tk.PhotoImage(file="icons/no.png"),
tk.PhotoImage(file="icons/help.png"),
])
p... | [
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,
834,
9800,
834,
796,
705,
541,
21879,
1077,
6,
628,
198,
11748,
340,
861,
10141,
198,
11748,
256,
74,
3849,
... | 2.358852 | 209 |
# coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
1584,
11,
33448,
11,
18650,
290,
14,
273,
663,
29116,
13,
220,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
10668,
12,
36612,
284,
345,
739,
262,
14499,
2448,
33532,
1... | 2.509822 | 3,258 |
#!/usr/bin/env python
import subprocess
from threading import Thread
from csv import DictReader
from SPAdesPipeline.OLCspades.accessoryFunctions import *
import SPAdesPipeline.OLCspades.metadataprinter as metadataprinter
__author__ = 'adamkoziol'
# If the script is called from the command line, then call the argument... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
850,
14681,
198,
6738,
4704,
278,
1330,
14122,
198,
6738,
269,
21370,
1330,
360,
713,
33634,
198,
6738,
6226,
2782,
274,
47,
541,
4470,
13,
3535,
34,
2777,
2367,
13,
15526,
652,... | 3 | 130 |
#!/usr/bin/env python
# coding: utf-8
##############################################################################
# joint beta and completeness magnitude estimation
# using p-value of Kolmogorov-Smirnov distance to fitted Gutenberg-Richter law
#
# as described by Mizrahi et al., 2021
# Leila Mizrahi, Shyam Nandan, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
29113,
29113,
7804,
4242,
2235,
198,
2,
6466,
12159,
290,
1224,
43205,
14735,
31850,
198,
2,
1262,
279,
12,
8367,
286,
25910,
76,
519,
273,
... | 2.42452 | 1,093 |
import re
import numpy as np
from .statistics import Statistics
"""
The module to extract ratings and create their distribution.
""" | [
11748,
302,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
14269,
3969,
1330,
14370,
198,
198,
37811,
198,
464,
8265,
284,
7925,
10109,
290,
2251,
511,
6082,
13,
198,
37811
] | 4.290323 | 31 |
# -*- coding: utf-8 -*-
import json
import logging
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from django.http import HttpResponse
from django.shortcuts import redirect, render, get_object_or_404
from .selected_book_views import selected_book
from ..forms import SetCurren... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
9515,
13921,
3673,
3109,
396,
198,
6738,
42625,
14208,
13,
9945,
1330,... | 2.636735 | 980 |
from scapy.all import sniff
if __name__ == '__main__':
main() | [
6738,
629,
12826,
13,
439,
1330,
26300,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419
] | 2.653846 | 26 |
from construct import *
from construct.lib import *
docstrings_docref = Struct(
'one' / Int8ub,
'two' / Int8ub,
'three' / Int8ub,
'foo' / Computed(lambda this: True),
'parse_inst' / Pointer(0, Int8ub),
)
_schema = docstrings_docref
| [
6738,
5678,
1330,
1635,
198,
6738,
5678,
13,
8019,
1330,
1635,
198,
198,
15390,
37336,
62,
15390,
5420,
796,
32112,
7,
198,
197,
6,
505,
6,
1220,
2558,
23,
549,
11,
198,
197,
470,
21638,
6,
1220,
2558,
23,
549,
11,
198,
197,
470,
... | 2.463918 | 97 |
import hashlib
import hmac
import json
import requests
from time import time
class Txbit:
"""A class to interact with the Txbit.io API
Attributes
----------
endpoint : str
the base url for API calls
APIKey : str
key for working with the Market and Account methods
Secret : st... | [
11748,
12234,
8019,
198,
11748,
289,
20285,
198,
11748,
33918,
628,
198,
11748,
7007,
198,
198,
6738,
640,
1330,
640,
198,
198,
4871,
309,
87,
2545,
25,
198,
220,
220,
220,
37227,
32,
1398,
284,
9427,
351,
262,
309,
87,
2545,
13,
95... | 2.667364 | 4,780 |
from onegov.page import Page
from onegov.form import FormDefinition
from onegov.reservation import Resource
class PersonMove(object):
""" Represents a single move of a linked person. """
@classmethod
@staticmethod
class PagePersonMove(PersonMove):
""" Represents a single move of a linked person on... | [
6738,
530,
9567,
13,
7700,
1330,
7873,
198,
6738,
530,
9567,
13,
687,
1330,
5178,
36621,
198,
6738,
530,
9567,
13,
411,
13208,
1330,
20857,
628,
198,
4871,
7755,
21774,
7,
15252,
2599,
198,
220,
220,
220,
37227,
1432,
6629,
257,
2060,... | 3.567251 | 171 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from frappe import msgprint, _
from client.hr_services.doctype.end_of_service_a... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
357,
66,
8,
1853,
11,
39313,
27768,
21852,
18367,
83,
13,
12052,
13,
290,
20420,
198,
2,
1114,
5964,
1321,
11,
3387,
766,
5964,
13,
14116,
198,
198,
6738,
... | 2.789474 | 342 |
# Generated by Django 3.2.11 on 2022-01-05 07:47
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
1157,
319,
33160,
12,
486,
12,
2713,
8753,
25,
2857,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.8 | 30 |
from .. import types, alltlobjects
from ..custom.message import Message as _Message
types.MessageEmpty = MessageEmpty
alltlobjects.tlobjects[MessageEmpty.CONSTRUCTOR_ID] = MessageEmpty
types.MessageService = MessageService
alltlobjects.tlobjects[MessageService.CONSTRUCTOR_ID] = MessageService
types.Message = M... | [
6738,
11485,
1330,
3858,
11,
477,
28781,
48205,
198,
6738,
11485,
23144,
13,
20500,
1330,
16000,
355,
4808,
12837,
628,
198,
198,
19199,
13,
12837,
40613,
796,
16000,
40613,
198,
439,
28781,
48205,
13,
28781,
48205,
58,
12837,
40613,
13,
... | 3.622642 | 106 |
# STANDARD LIB
import threading
# DJANGAE
from djangae.db import transaction
from djangae.contrib import sleuth
from djangae.test import TestCase
| [
2,
49053,
9795,
45651,
198,
11748,
4704,
278,
198,
198,
2,
13004,
1565,
9273,
36,
198,
6738,
42625,
648,
3609,
13,
9945,
1330,
8611,
198,
6738,
42625,
648,
3609,
13,
3642,
822,
1330,
3133,
1071,
198,
6738,
42625,
648,
3609,
13,
9288,
... | 3.170213 | 47 |
import OGL
from macros import *
from math import cos, sin, radians, degrees
from OpenGL.GL import *
from OpenGL.GLU import *
import pygame
import shoot
import config
from formula import * | [
11748,
440,
8763,
198,
6738,
34749,
1330,
1635,
198,
6738,
10688,
1330,
8615,
11,
7813,
11,
2511,
1547,
11,
7370,
198,
6738,
30672,
13,
8763,
1330,
1635,
198,
6738,
30672,
13,
8763,
52,
1330,
1635,
198,
11748,
12972,
6057,
198,
11748,
... | 3.74 | 50 |
"""API handlers for administering the Hub itself"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import sys
from tornado import web
from tornado.ioloop import IOLoop
from .._version import __version__
from ..scopes import needs_scope
from .base impor... | [
37811,
17614,
32847,
329,
38849,
262,
14699,
2346,
37811,
198,
2,
15069,
357,
66,
8,
449,
929,
88,
353,
7712,
4816,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
13789,
13,
198,
11748,
33918,
198,
11748,
25064,
... | 3.268966 | 145 |
#!/usr/bin/env jython
import atexit
import logging
from config import Config
from java.util import Properties
from org.jclouds import ContextBuilder
from org.jclouds.abiquo import AbiquoApiMetadata, AbiquoContext
from org.jclouds.logging.slf4j.config import SLF4JLoggingModule
from org.jclouds.sshj.config import SshjS... | [
2,
48443,
14629,
14,
8800,
14,
24330,
474,
7535,
198,
198,
11748,
379,
37023,
198,
11748,
18931,
198,
198,
6738,
4566,
1330,
17056,
198,
6738,
20129,
13,
22602,
1330,
24946,
198,
6738,
8745,
13,
73,
17721,
82,
1330,
30532,
32875,
198,
... | 2.393379 | 1,027 |
import json
from json import JSONDecodeError
from aioredis import Redis
from .config.redis_conf import HOST, PORT, CREDDB, CRED_EXP, COST_EXP, REVOKED_TOKENS, CACHEDB
from .response_exceptions import UserNotInDBException
cred_db = Redis(host=HOST, port=PORT, db=CREDDB, decode_responses=True)
cache_db = Redis(host=HO... | [
11748,
33918,
198,
6738,
33918,
1330,
19449,
10707,
1098,
12331,
198,
198,
6738,
257,
72,
1850,
271,
1330,
2297,
271,
198,
198,
6738,
764,
11250,
13,
445,
271,
62,
10414,
1330,
367,
10892,
11,
350,
9863,
11,
8740,
1961,
11012,
11,
874... | 1.742942 | 673 |
birthdays = {
"Albert Einstein": "03/14/1879",
"Benjamin Franklin": "01/06/1705",
"Ada Lovelace": "12/10/1815"
}
lst = birthdays.keys()
print("We know the birthday of:")
for x in lst:
print(x)
choice = input("Who's birthday do you want to look up?")
if choice in lst:
print("{}'s birthday is {}.... | [
24280,
12545,
796,
1391,
198,
220,
220,
220,
366,
42590,
24572,
1298,
366,
3070,
14,
1415,
14,
1507,
3720,
1600,
198,
220,
220,
220,
366,
11696,
13337,
14021,
1298,
366,
486,
14,
3312,
14,
1558,
2713,
1600,
198,
220,
220,
220,
366,
... | 2.502994 | 167 |