content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# payments/views.py
import stripe
import json
from django.conf import settings # new
from django.contrib.sites.shortcuts import get_current_site
from django.http.response import JsonResponse, HttpResponse
from django.views.decorators.csrf import csrf_exempt # new
from django.views.generic.base import TemplateView
fro... | [
2,
7524,
14,
33571,
13,
9078,
198,
11748,
39858,
198,
11748,
33918,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
1303,
649,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
49315,
13,
19509,
23779,
1330,
651,
62,
14421,
62,
15654,
... | 3.224 | 125 |
import random,sys, pygame as pg
from tkinter import Tk,messagebox
size = width, height = 400,600
pg.init()
Tk().wm_withdraw()
black = 0,0,0
white = 255,255,255
orange = 255,165,0
green = 0,255,0
screen = pg.display.set_mode(size)
pg.display.set_caption("Wordle")
titleFont = pg.font.SysFont("bahnschrift... | [
11748,
4738,
11,
17597,
11,
12972,
6057,
355,
23241,
201,
198,
6738,
256,
74,
3849,
1330,
309,
74,
11,
20500,
3524,
201,
198,
201,
198,
7857,
796,
9647,
11,
6001,
796,
7337,
11,
8054,
201,
198,
201,
198,
6024,
13,
15003,
3419,
201,
... | 1.979557 | 1,174 |
import pkg_resources
from lzw3.commons.utils import read_textual_file
def read_textual_resource(res: str) -> str:
""" Reads the content of the given resource.
The resource is loaded relatively to the path "res/"
using pkg_resources of setuptools.
Args:
res (str): the path of the resource rel... | [
11748,
279,
10025,
62,
37540,
198,
198,
6738,
300,
89,
86,
18,
13,
9503,
684,
13,
26791,
1330,
1100,
62,
5239,
723,
62,
7753,
628,
198,
4299,
1100,
62,
5239,
723,
62,
31092,
7,
411,
25,
965,
8,
4613,
965,
25,
198,
220,
220,
220,... | 2.886228 | 167 |
layer_info = \
{1: {'B': 1, 'K': 64, 'C': 3, 'OY': 112, 'OX': 112, 'FY': 3, 'FX': 3, 'SY': 2, 'SX': 2, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1},
2: {'B': 1, 'K': 64, 'C': 64, 'OY': 112, 'OX': 112, 'FY': 3, 'FX': 3, 'SY': 1, 'SX': 1, 'SFY': 1, 'SFX': 1, 'PY': 0, 'PX': 0, 'G': 1},
3: {'B': 1, 'K': 128, 'C': 64, '... | [
29289,
62,
10951,
796,
3467,
198,
1391,
16,
25,
1391,
6,
33,
10354,
352,
11,
705,
42,
10354,
5598,
11,
705,
34,
10354,
513,
11,
705,
21414,
10354,
13539,
11,
705,
48632,
10354,
13539,
11,
705,
43833,
10354,
513,
11,
705,
17213,
1035... | 1.698755 | 271,975 |
from __future__ import unicode_literals
import unittest
import os
import time
from os.path import join
from fs.opener import open_fs
from moya.template.moyatemplates import MoyaTemplateEngine
from moya.archive import Archive
from moya.settings import SettingsContainer
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
555,
715,
395,
198,
11748,
28686,
198,
11748,
640,
198,
6738,
28686,
13,
6978,
1330,
4654,
198,
198,
6738,
43458,
13,
404,
877,
1330,
1280,
62,
9501,
198,
67... | 3.675676 | 74 |
#!/usr/bin/env python
import math
from .feature import Feature
from ..model import disambiguation
from ..process.candidates import CandidateGenerator
from nel import logging
log = logging.getLogger()
@Feature.Extractable
class EntityProbability(LogFeature):
""" Entity prior probability. """
@classmethod
@F... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
10688,
198,
198,
6738,
764,
30053,
1330,
27018,
198,
6738,
11485,
19849,
1330,
595,
4131,
328,
2288,
198,
6738,
11485,
14681,
13,
46188,
37051,
1330,
40327,
8645,
1352,
198,
198,
... | 3.537879 | 132 |
import uuid
from django.db import models
from backoffice.manager import group
from backoffice.models import UpdatedCreated, UserLogin
| [
11748,
334,
27112,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
6738,
736,
31810,
13,
37153,
1330,
1448,
198,
6738,
736,
31810,
13,
27530,
1330,
19433,
41972,
11,
11787,
47790,
628
] | 4.029412 | 34 |
# encoding=utf-8
# Author: Yu-Lun Chiang
# Description: Test NewsCrawler
import logging
import pytest
from collections import namedtuple
from src.crawler.media import sina
from src.utils.struct import NewsStruct
logger = logging.getLogger(__name__)
TEST_DATA = namedtuple(
typename="TEST_DATA",
field_names=[... | [
2,
21004,
28,
40477,
12,
23,
198,
2,
6434,
25,
10605,
12,
43,
403,
609,
15483,
198,
2,
12489,
25,
6208,
3000,
34,
39464,
198,
198,
11748,
18931,
198,
11748,
12972,
9288,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
6738,
12351,
13,... | 0.769903 | 4,120 |
"""
SQL Lite: based on a file rather than a web serviceself.
Therefore, you don't have to have SQL Lite installedself.
You can totally use Python to
Python sends SQL to interact with the DB
5 steps
1. Connect to DB
2. Cursor (pointer to rows in the DB)
3. SQL query
4. Commit changes to DB
5. Close connection
"""
imp... | [
37811,
198,
17861,
27395,
25,
1912,
319,
257,
2393,
2138,
621,
257,
3992,
2594,
7046,
13,
198,
26583,
11,
345,
836,
470,
423,
284,
423,
16363,
27395,
6589,
944,
13,
198,
1639,
460,
6635,
779,
11361,
284,
198,
198,
37906,
12800,
16363,... | 3.21374 | 131 |
import sys
sys.path.insert(0, '../glados/resources') # Import a module from other directory
import re
from testrail.testrail import testrail_api_glados
| [
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
705,
40720,
4743,
22484,
14,
37540,
11537,
1303,
17267,
257,
8265,
422,
584,
8619,
198,
198,
11748,
302,
198,
6738,
1332,
30224,
13,
9288,
30224,
1330,
1332,
30224,
62,
15042,
... | 3.422222 | 45 |
"""
JSV is a simple library for representing many JSON objects with a similar structure. It is intended to replace json
lines, csv, and other similar formats.
Basic write usage
>>> import jsv
>>> data = [{'key_1': 1}, {'key_1': ['any','json','object'], 'other_key': None}]
>>> with jsv.JSVWriter('out.jsv',... | [
37811,
198,
20120,
53,
318,
257,
2829,
5888,
329,
10200,
867,
19449,
5563,
351,
257,
2092,
4645,
13,
632,
318,
5292,
284,
6330,
33918,
198,
6615,
11,
269,
21370,
11,
290,
584,
2092,
17519,
13,
198,
198,
26416,
3551,
8748,
628,
220,
... | 2.360305 | 655 |
# TOCANDO UM MP3 — Faça um programa em Python que abra e reproduza áudio de um arquivo MP3.
import pygame
pygame.init()
pygame.mixer.music.load('song.mp3')
pygame.mixer.music.play()
input('')
pygame.event.wait()
# import playsound
# playsound.playsound('')
| [
2,
309,
4503,
6981,
46,
44352,
4904,
18,
851,
18350,
50041,
23781,
1430,
64,
795,
11361,
8358,
450,
430,
304,
8186,
4496,
6184,
94,
463,
952,
390,
23781,
610,
421,
23593,
4904,
18,
13,
198,
198,
11748,
12972,
6057,
198,
198,
9078,
6... | 2.524272 | 103 |
from apps.events.models import Season
# TODO refactor
| [
6738,
6725,
13,
31534,
13,
27530,
1330,
7369,
628,
198,
198,
2,
16926,
46,
1006,
11218,
198
] | 3.352941 | 17 |
import numpy as np
from itertools import zip_longest
# x = '789456123'
# y = '898989898989'
x = '11'
y = '1111'
x_arr = list(map(int, reversed(x)))
y_arr = list(map(int, reversed(y)))
print(x_arr)
print(y_arr)
mul = karatsuba(x_arr, y_arr)
print(mul)
print(''.join(map(str, reversed(mul))))
| [
11748,
299,
32152,
355,
45941,
198,
6738,
340,
861,
10141,
1330,
19974,
62,
6511,
395,
198,
198,
2,
2124,
796,
705,
40401,
29228,
10163,
6,
198,
2,
331,
796,
705,
23,
4089,
4089,
4089,
4089,
42520,
6,
198,
198,
87,
796,
705,
1157,
... | 2.176471 | 136 |
import unittest
from declension import Declension, DeclensionResult
if __name__ == "__main__":
unittest.main() | [
11748,
555,
715,
395,
198,
6738,
2377,
3004,
1330,
16691,
3004,
11,
16691,
3004,
23004,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
555,
715,
395,
13,
12417,
3419
] | 3.108108 | 37 |
"""
freesolv dataset loader.
"""
import os
import deepchem as dc
from deepchem.molnet.load_function.molnet_loader import TransformerGenerator, _MolnetLoader
from deepchem.data import Dataset
from typing import List, Optional, Tuple, Union
FREESOLV_URL = 'https://deepchemdata.s3.us-west-1.amazonaws.com/datasets/freesol... | [
37811,
198,
69,
6037,
349,
85,
27039,
40213,
13,
198,
37811,
198,
11748,
28686,
198,
11748,
2769,
15245,
355,
30736,
198,
6738,
2769,
15245,
13,
43132,
3262,
13,
2220,
62,
8818,
13,
43132,
3262,
62,
29356,
1330,
3602,
16354,
8645,
1352,... | 3.085313 | 926 |
import json
import requests
def get_recommendation_suggest(seed_keyword):
"""get the list of auto-complete suggestions of google search"""
try:
url = f'http://suggestqueries.google.com/complete/search?client=firefox&q={seed_keyword}'
headers = {'User-agent': 'Mozilla/5.0'}
response = re... | [
11748,
33918,
198,
11748,
7007,
198,
198,
4299,
651,
62,
47335,
437,
341,
62,
47811,
7,
28826,
62,
2539,
4775,
2599,
198,
220,
220,
220,
37227,
1136,
262,
1351,
286,
8295,
12,
20751,
11776,
286,
23645,
2989,
37811,
198,
220,
220,
220,... | 2.64977 | 217 |
#!/usr/bin/env python3
import json
import os
import re
import requests
if __name__ == '__main__':
download()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
7007,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
4321,
341... | 2.790698 | 43 |
from juriscraper.OpinionSite import OpinionSite
from datetime import date
from datetime import datetime
from datetime import timedelta
| [
6738,
8174,
2304,
38545,
13,
46,
11635,
295,
29123,
1330,
29525,
29123,
198,
6738,
4818,
8079,
1330,
3128,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4818,
8079,
1330,
28805,
12514,
628
] | 4.121212 | 33 |
import System
import ClientAPI
import SAWorld
import SAUtil
# This function is an event handler that runs when the world has been initialized.
# Register an event handler that will run when the world has been initialized.
ClientAPI.World.RegisterEventHandler('WorldInitialized', WorldInitHandler)
| [
11748,
4482,
198,
11748,
20985,
17614,
198,
11748,
14719,
10603,
198,
11748,
14719,
18274,
346,
198,
198,
2,
770,
2163,
318,
281,
1785,
21360,
326,
4539,
618,
262,
995,
468,
587,
23224,
13,
198,
220,
220,
220,
220,
198,
2,
17296,
281,... | 4.222222 | 72 |
#!/usr/bin/python
import csv
import sys
from lib.config import get_or_create as get_or_create_config
from lib.rest import REST_CONFIG_FIELDS, api_get, api_get_paged
config = get_or_create_config('config.ini', 'bamboo', REST_CONFIG_FIELDS)
auth = (config['username'], config['password'])
base_path = config['url']
writ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
269,
21370,
198,
11748,
25064,
198,
198,
6738,
9195,
13,
11250,
1330,
651,
62,
273,
62,
17953,
355,
651,
62,
273,
62,
17953,
62,
11250,
198,
6738,
9195,
13,
2118,
1330,
30617,
6... | 2.472868 | 387 |
l = int(input())
evenChk, oddChk = 0, 0
for i in range(0, l):
number = int(input())
if number % 2 == 0:
evenChk += 1
else:
oddChk += 1
if evenChk > oddChk:
print("READY FOR BATTLE ")
else:
print("NOT READY") | [
75,
796,
493,
7,
15414,
28955,
198,
10197,
1925,
74,
11,
5629,
1925,
74,
796,
657,
11,
657,
198,
198,
1640,
1312,
287,
2837,
7,
15,
11,
300,
2599,
198,
220,
220,
220,
1271,
796,
493,
7,
15414,
28955,
628,
220,
220,
220,
611,
127... | 2.03252 | 123 |
import re
from collections import Counter
| [
11748,
302,
198,
6738,
17268,
1330,
15034,
628
] | 5.375 | 8 |
from aocd import data
from aoc.utils import ints
from aoc.year2019.intcode import Intcode
if __name__ == '__main__':
main()
| [
6738,
257,
420,
67,
1330,
1366,
198,
198,
6738,
257,
420,
13,
26791,
1330,
493,
82,
198,
6738,
257,
420,
13,
1941,
23344,
13,
600,
8189,
1330,
2558,
8189,
628,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
... | 2.686275 | 51 |
from os import listdir
extentions = ['html', 'css', 'js', 'png', 'gif', 'mp3', 'woff', 'woff2']
black_list = ['.git', 'sw.js', 'old', 'CNAME', 'CACHE', '_base', 'anim']
data = ''
search('')
print('Finished\n')
with open('CACHE', 'w') as f:
f.write(data)
| [
6738,
28686,
1330,
1351,
15908,
198,
198,
2302,
298,
507,
796,
37250,
6494,
3256,
705,
25471,
3256,
705,
8457,
3256,
705,
11134,
3256,
705,
27908,
3256,
705,
3149,
18,
3256,
705,
86,
2364,
3256,
705,
86,
2364,
17,
20520,
198,
13424,
6... | 2.26087 | 115 |
from ultron.actions import Action
from ultron.helpers.twitter_helper import load_api
| [
6738,
3789,
1313,
13,
4658,
1330,
7561,
198,
6738,
3789,
1313,
13,
16794,
364,
13,
6956,
62,
2978,
525,
1330,
3440,
62,
15042,
628
] | 3.583333 | 24 |
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^landing/?$', views.LandingView.as_view(), name='landing'),
url(r'^registration/?$', views.RegistrationView.as_view(), name='registration'),
url(r'^legal_notice/?$', views.LegalNoticeView.as_view(), name='legal_notice'),
]... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
1044,
278,
20924,
3,
3256,
5009,
13,
22342,
278,
76... | 2.767241 | 116 |
from tkapi.util import queries
if '__main__' == __name__:
example_geschenken_fractieleden_actief()
| [
6738,
256,
74,
15042,
13,
22602,
1330,
20743,
628,
198,
198,
361,
705,
834,
12417,
834,
6,
6624,
11593,
3672,
834,
25,
198,
220,
220,
220,
1672,
62,
3212,
6607,
3464,
62,
69,
974,
8207,
31829,
62,
529,
2086,
3419,
198
] | 2.585366 | 41 |
import click
import collections
import operator
@click.command()
@click.option("--part", default=2, help="Part of the challenge (either 1 or 2)")
if __name__ == "__main__":
main()
| [
11748,
3904,
198,
11748,
17268,
198,
11748,
10088,
628,
198,
31,
12976,
13,
21812,
3419,
198,
31,
12976,
13,
18076,
7203,
438,
3911,
1600,
4277,
28,
17,
11,
1037,
2625,
7841,
286,
262,
4427,
357,
31336,
352,
393,
362,
8,
4943,
628,
... | 3.096774 | 62 |
#
# Copyright 2018 Dynatrace LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | [
2,
198,
2,
15069,
2864,
39530,
265,
16740,
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,
1... | 3.380392 | 255 |
import logging
import threading
import traceback
from hashlib import sha1
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.core.mail import send_mail
from django.db import transaction
from django.shortcuts import render
from acc... | [
11748,
18931,
198,
11748,
4704,
278,
198,
11748,
12854,
1891,
198,
6738,
12234,
8019,
1330,
427,
64,
16,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
42625,
14208,
1... | 3.982857 | 175 |
from django.urls import path
from django.contrib.auth import views as auth_views
from ..base.views import CustomerListView, PartnerDetailView, PartnerCreateView, PartnerUpdateView, DeletePartner, ProviderListView
from ..base.views import CompanyListView
from ..base.views import ProductListView, ProductDetailView, Produ... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
5009,
355,
6284,
62,
33571,
198,
6738,
11485,
8692,
13,
33571,
1330,
22092,
8053,
7680,
11,
35532,
11242,
603,
7680,
11,
35532,
16447... | 3.061245 | 996 |
import numpy as np
from typing import Tuple
from IMLearn.metalearners.adaboost import AdaBoost
from IMLearn.learners.classifiers import DecisionStump
from utils import *
import plotly.graph_objects as go
from plotly.subplots import make_subplots
def generate_data(n: int, noise_ratio: float) -> Tuple[np.ndarray, np.... | [
198,
11748,
299,
32152,
355,
45941,
198,
6738,
19720,
1330,
309,
29291,
198,
6738,
314,
5805,
451,
77,
13,
28469,
451,
2741,
13,
324,
34748,
455,
1330,
47395,
45686,
198,
6738,
314,
5805,
451,
77,
13,
35720,
364,
13,
4871,
13350,
1330... | 2.463415 | 492 |
import gym
import time
import argparse
import numpy as np
class DynamicProgramming(object):
"""An implementation of the policy iteration, value iteration."""
if __name__ == "__main__":
# Configurations
parser = argparse.ArgumentParser(description='Traditional RL algorithms in FrozenLake environment')
pars... | [
11748,
11550,
198,
11748,
640,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4871,
26977,
15167,
2229,
7,
15252,
2599,
198,
220,
220,
37227,
2025,
7822,
286,
262,
2450,
24415,
11,
1988,
24415,
526,
15931,
198,
1... | 2.909091 | 429 |
BONDS = {
"aliases": {
"tesouro prefixado": "LTN",
"ltn": "LTN",
"tesouro prefixado com juros semestrais": "NTN-F",
"ntn-f": "NTN-F",
"ntnf": "NTN-F",
"tesouro ipca+": "NTN-B Principal",
"ntn-b principal": "NTN-B Principal",
"ntnbp": "NTN-B Principa... | [
33,
1340,
5258,
796,
1391,
198,
220,
220,
220,
366,
7344,
1386,
1298,
1391,
628,
220,
220,
220,
220,
220,
220,
220,
366,
4879,
280,
305,
21231,
4533,
1298,
366,
27734,
45,
1600,
198,
220,
220,
220,
220,
220,
220,
220,
366,
2528,
7... | 1.747673 | 967 |
from django.db import models
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
628,
628
] | 3.555556 | 9 |
# Copyright (c) 2018 Cisco and/or its affiliates.
# 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 ag... | [
2,
15069,
357,
66,
8,
2864,
28289,
290,
14,
273,
663,
29116,
13,
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... | 1.95182 | 5,770 |
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|... | [
2,
17174,
17174,
4557,
8162,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
220,
220,
4808,
220,... | 2.653759 | 439 |
# coding: utf-8
# # Import Bibliotecas
# In[1]:
get_ipython().run_line_magic('matplotlib', 'inline')
from sklearn.model_selection import train_test_split
from sklearn.neighbors import KNeighborsClassifier
from sklearn.feature_selection import RFE
from sklearn.linear_model import LogisticRegression
import pandas a... | [
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
1303,
17267,
347,
29142,
313,
721,
292,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
1136,
62,
541,
7535,
22446,
5143,
62,
1370,
62,
32707,
10786,
6759,
29487,
8019,
3256,
705,
45145,... | 2.293276 | 3,004 |
"""This module provides some capabilities to check the integrity of the package."""
import os
from boupy.check.custom_exceptions import UserError
def check_consistency(init_dict):
"""This function performs some basic checks regarding the integrity
of the user's request. There should be no uncontrolled termin... | [
37811,
1212,
8265,
3769,
617,
9889,
284,
2198,
262,
11540,
286,
262,
5301,
526,
15931,
198,
11748,
28686,
198,
198,
6738,
35833,
9078,
13,
9122,
13,
23144,
62,
1069,
11755,
1330,
11787,
12331,
628,
198,
4299,
2198,
62,
5936,
396,
1387,
... | 2.853604 | 444 |
# Created by Hansi at 7/6/2021
import editdistance
import numpy as np
from scipy.optimize import linear_sum_assignment
def find_best_match(cluster, groundtruth_event, exact_match=True, cluster_n=None):
"""
Find best match (event duplicate) for the event cluster wrt the given event
parameters
-------... | [
2,
15622,
416,
13071,
72,
379,
767,
14,
21,
14,
1238,
2481,
198,
11748,
4370,
30246,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
40085,
1096,
1330,
14174,
62,
16345,
62,
562,
16747,
628,
198,
198,
4299,
1064,
62... | 2.27029 | 4,029 |
import concurrent.futures
import csv
import math
from ipaddress import ip_address, IPv4Address
import bisect
from urllib.parse import urlencode, quote_plus
import itertools
from .constants import *
from .helpers import *
rir_file = [rir + ".csv" for rir in list(RIR_URL_MAPPING.keys())]
# Parse RIR file data
data =... | [
11748,
24580,
13,
69,
315,
942,
198,
11748,
269,
21370,
198,
11748,
10688,
198,
6738,
20966,
21975,
1330,
20966,
62,
21975,
11,
25961,
19,
20231,
198,
11748,
47457,
478,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
11925,
8189,
11,... | 2.52381 | 231 |
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAssertiveReflection(RPackage):
"""assertive.reflection: Assertions for Checking the State... | [
2,
15069,
2211,
12,
1238,
1828,
13914,
45036,
3549,
2351,
4765,
11,
11419,
290,
584,
198,
2,
1338,
441,
4935,
34152,
13,
4091,
262,
1353,
12,
5715,
27975,
38162,
9947,
2393,
329,
3307,
13,
198,
2,
198,
2,
30628,
55,
12,
34156,
12,
... | 2.809877 | 405 |
import torch
import torchvision
from Fcos_seg.utils.box_list import BoxList
| [
628,
198,
11748,
28034,
198,
11748,
28034,
10178,
198,
198,
6738,
376,
6966,
62,
325,
70,
13,
26791,
13,
3524,
62,
4868,
1330,
8315,
8053,
628,
628,
628,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
2... | 2.137255 | 51 |
"""Auto-generated file, do not edit by hand. 878 metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_878 = PhoneMetadata(id='001', country_code=878, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='1\\d{11}', possible_length=(12,)),
... | [
37811,
27722,
12,
27568,
2393,
11,
466,
407,
4370,
416,
1021,
13,
807,
3695,
20150,
37811,
198,
6738,
11485,
746,
261,
19261,
14706,
1330,
7913,
26227,
11,
14484,
15057,
24564,
11,
14484,
9171,
14706,
198,
198,
11909,
11651,
62,
47123,
... | 2.879781 | 183 |
# https://programmers.co.kr/learn/courses/30/lessons/49993
# 스킬트리
skill = 'CBD'
skill_trees = ["BACDE", "CBADF", "AECB", "BDA"]
cnt = 0
for tree in skill_trees:
if is_validate(tree, skill) == True:
cnt += 1
print(cnt) | [
2,
3740,
1378,
23065,
11056,
13,
1073,
13,
38584,
14,
35720,
14,
66,
39975,
14,
1270,
14,
1203,
684,
14,
28324,
6052,
198,
2,
23821,
232,
97,
169,
8955,
169,
232,
116,
167,
99,
105,
198,
198,
42401,
796,
705,
34,
14529,
6,
198,
... | 1.957627 | 118 |
"""
MIT License
Copyright (c) 2021 Thomas Leong
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | [
37811,
198,
36393,
13789,
198,
198,
15269,
357,
66,
8,
33448,
5658,
1004,
506,
198,
198,
5990,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
1659,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,... | 3.388095 | 420 |
import dj_database_url
DEBUG = True
TEMPLATE_DEBUG = True
SECRET_KEY = 'this is my secret key' # NOQA
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
DATABASES = {
'default': dj_database_url.config(default='postgres:///localized_fields')
}
DATABASES['default']['ENGINE'] = 'psqlextra.backend'
LANGUAGE_CODE ... | [
11748,
42625,
62,
48806,
62,
6371,
198,
198,
30531,
796,
6407,
198,
51,
3620,
6489,
6158,
62,
30531,
796,
6407,
198,
198,
23683,
26087,
62,
20373,
796,
705,
5661,
318,
616,
3200,
1994,
6,
220,
1303,
8005,
48,
32,
198,
198,
51,
6465,... | 2.394737 | 266 |
import discord
import asyncio
from steam_parser import SteamEventParser
from datetime import datetime
| [
11748,
36446,
198,
11748,
30351,
952,
198,
198,
6738,
13324,
62,
48610,
1330,
9094,
9237,
46677,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198
] | 4.291667 | 24 |
import SiCroF
world=SiCroF.SiCroF()
world.setDomainList("~/SiCroF/Debug_domainlist.txt")
world.setIfaceList("~/SiCroF/Debug_Ifacelist.txt")
world.exportFortranScript()
| [
11748,
15638,
35403,
37,
198,
198,
6894,
28,
42801,
35403,
37,
13,
42801,
35403,
37,
3419,
198,
6894,
13,
2617,
43961,
8053,
7203,
93,
14,
42801,
35403,
37,
14,
27509,
62,
27830,
4868,
13,
14116,
4943,
198,
6894,
13,
2617,
1532,
558,
... | 2.522388 | 67 |
import numpy as np
import multipledispatch as md
dot = md.Dispatcher('dot')
dot.add((object, object), np.dot)
tensordot = md.Dispatcher('tensordot')
tensordot.add((object, object), np.tensordot)
where = md.Dispatcher('where')
where.add((object,), np.where)
where.add((object, object, object), np.where)
nanmin = md.D... | [
11748,
299,
32152,
355,
45941,
198,
11748,
5021,
10137,
8802,
963,
355,
45243,
198,
198,
26518,
796,
45243,
13,
7279,
8071,
2044,
10786,
26518,
11537,
198,
26518,
13,
2860,
19510,
15252,
11,
2134,
828,
45941,
13,
26518,
8,
198,
198,
83,... | 2.501672 | 299 |
from typing import Optional
from django.contrib.auth.backends import BaseBackend
from django.core.exceptions import PermissionDenied
from django.db.models.functions import Coalesce
from rgd.geodata import models
def annotate_queryset(queryset):
"""Annotate the queryset to include a path to a collection.
So... | [
6738,
19720,
1330,
32233,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
1891,
2412,
1330,
7308,
7282,
437,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
2448,
3411,
21306,
798,
198,
6738,
42625,
14208,
13,
9945... | 2.737468 | 1,935 |
# Generated by Django 2.1.8 on 2019-05-27 22:42
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_userforeignkey.models.fields
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
23,
319,
13130,
12,
2713,
12,
1983,
2534,
25,
3682,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14... | 3.125 | 64 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-27 15:18
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
22,
319,
2177,
12,
2919,
12,
1983,
1315,
25,
1507,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.555556 | 45 |
from icinga_notificator.classes import icingaNotification
import string
import random
# some tools
# EXITCODES = {0: "OK", 1: "WARNING", 2: "CRITICAL", 3: "UNKNOWN"}
# generate some list of notifications(obj from elastic, class)
# user generation class, sophistically generates data
| [
6738,
41567,
64,
62,
1662,
811,
1352,
13,
37724,
1330,
41567,
64,
3673,
2649,
198,
11748,
4731,
198,
11748,
4738,
628,
198,
2,
617,
4899,
198,
2,
7788,
2043,
34,
3727,
1546,
796,
1391,
15,
25,
366,
11380,
1600,
352,
25,
366,
31502,
... | 3.411765 | 85 |
from os import kill
from tkinter import *
from tkinter.font import BOLD
from PIL import ImageTk, Image
import sqlite3
from babel.dates import DateTimeFormat
from tkcalendar import *
import mysql.connector
import pyzbar.pyzbar as pyzbar
import cv2
import qr
from tkinter.ttk import Combobox
from tkinter impor... | [
6738,
28686,
1330,
1494,
201,
198,
6738,
256,
74,
3849,
1330,
1635,
201,
198,
6738,
256,
74,
3849,
13,
10331,
1330,
347,
15173,
201,
198,
6738,
350,
4146,
1330,
7412,
51,
74,
11,
7412,
201,
198,
11748,
44161,
578,
18,
201,
198,
6738... | 2.157576 | 825 |
"""
TF-Slim grouped API. Please see README.md for details and usage.
"""
# pylint: disable=unused-import
# Collapse tf-slim into a single namespace.
from inception.slim import inception_model as inception
from inception.slim import losses
from inception.slim import ops
from inception.slim import scopes
from inception.... | [
37811,
198,
10234,
12,
50,
2475,
32824,
7824,
13,
4222,
766,
20832,
11682,
13,
9132,
329,
3307,
290,
8748,
13,
198,
37811,
198,
2,
279,
2645,
600,
25,
15560,
28,
403,
1484,
12,
11748,
198,
198,
2,
7778,
7512,
48700,
12,
82,
2475,
... | 3.607477 | 107 |
from nose.tools import eq_
from .. import tokenization
| [
6738,
9686,
13,
31391,
1330,
37430,
62,
198,
198,
6738,
11485,
1330,
11241,
1634,
628
] | 3.8 | 15 |
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
import matplotlib.pyplot as plt
import urllib.request
import os
import reader
import time
from LayerNormalizedLSTMCell import LayerNormalizedLSTMCell
'''下载数据并读取数据'''
file_url = 'https://raw.githubusercontent.com/jcjohnson/torch-rnn/master/data/tiny-sha... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2956,
297,
571,
13,
2... | 1.593928 | 1,581 |
import datetime
import json
import ast
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django.test import Client
from survey.models.locations import *
from survey.models import *
from model_mommy import mommy
from survey.tests.base_test import BaseTest
from survey.vie... | [
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
6468,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
28243,
13,
12286,
10379,
1010,
1330,
31065,
1958,
198,
6738,
42625,
14208,
13,... | 2.134652 | 1,062 |
# -*- coding: utf-8 -*-
from brawlpython.sessions import SyncSession
from brawlpython.api_toolkit import unique, same
from configobj import ConfigObj
import pytest
import time
url_uuid = "http://httpbin.org/uuid"
config = ConfigObj("config.ini")
api_key = config["DEFAULT"].get("API_KEY")
@pytest.yield_fixture
@... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
42599,
29412,
13,
82,
6202,
1330,
35908,
36044,
198,
6738,
42599,
29412,
13,
15042,
62,
25981,
15813,
1330,
3748,
11,
976,
198,
6738,
4566,
26801,
1330,
17056,
... | 2.717949 | 156 |
"""
Hybrid Metrics
--------------
:mod:`textacy.similarity.hybrid`: Normalized similarity metrics that combine edit-,
token-, and/or sequence-based algorithms.
"""
from __future__ import annotations
from typing import Callable, Sequence
from . import edits
from .. import constants
def token_sort_ratio(s1: str | Se... | [
37811,
198,
21217,
10236,
3395,
10466,
198,
26171,
198,
198,
25,
4666,
25,
63,
5239,
1590,
13,
38610,
414,
13,
12114,
10236,
63,
25,
14435,
1143,
26789,
20731,
326,
12082,
4370,
20995,
198,
30001,
20995,
290,
14,
273,
8379,
12,
3106,
... | 2.583419 | 977 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the PE event formatters."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import pe
from tests.formatters import test_lib
class PECompilationTimeFormatterTest(test_lib.EventFormatterTestCase):
"""Tests for the PE compilation ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
51,
3558,
329,
262,
18468,
1785,
5794,
1010,
526,
15931,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
1720... | 2.93251 | 1,215 |
# -*- coding: utf-8 -*-
"""07 Upload a model.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1ZaM-sNR9_6vqGBpRobWjTq7gkm4t9bbW
# 7 Uploading Model files
Demonstrates uploading a file (rather than registering a URL). This requires multiple steps,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
2998,
36803,
257,
2746,
13,
541,
2047,
65,
198,
198,
38062,
4142,
7560,
416,
1623,
4820,
2870,
13,
198,
198,
20556,
2393,
318,
5140,
379,
198,
220,
220,
220,
37... | 3.249553 | 1,118 |
import json
from pathlib import Path
from fashiondatasets.utils.logger.defaultLogger import defaultLogger
def string_serializer(obj):
"""
Helper Function to Serialize Objects. Keeps List / Dict Structure, but will Convert everything else to String.
"""
if type(obj) in [list, tuple]:
ret... | [
11748,
33918,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
6977,
19608,
292,
1039,
13,
26791,
13,
6404,
1362,
13,
12286,
11187,
1362,
1330,
4277,
11187,
1362,
628,
628,
628,
628,
198,
4299,
4731,
62,
46911,
7509,
7,
26801,
2599,
... | 2.616162 | 198 |
## @ingroup Methods-Power-Fuel_Cell-Discharge
# find_power_larminie.py
#
# Created : Apr 2015, M. Vegh
# Modified: Sep 2015, M. Vegh
# Feb 2016, E. Botero
# ----------------------------------------------------------------------
# Imports
# -------------------------------------------------------------------... | [
2235,
2488,
278,
3233,
25458,
12,
13434,
12,
42663,
62,
28780,
12,
7279,
10136,
198,
2,
1064,
62,
6477,
62,
21681,
1084,
494,
13,
9078,
198,
2,
198,
2,
15622,
1058,
2758,
1853,
11,
337,
13,
8016,
456,
220,
198,
2,
40499,
25,
8621,... | 2.803922 | 510 |
from pylab import *
import random
from codes.inits import *
def parse_index_file(filename):
"""Parse index file."""
index = []
for line in open(filename):
index.append(int(line.strip()))
return index
def sample_mask(idx, l):
"""Create mask."""
mask = np.zeros(l)
mask[idx] = 1
... | [
6738,
279,
2645,
397,
1330,
1635,
198,
11748,
4738,
198,
6738,
12416,
13,
259,
896,
1330,
1635,
628,
198,
4299,
21136,
62,
9630,
62,
7753,
7,
34345,
2599,
198,
220,
220,
220,
37227,
10044,
325,
6376,
2393,
526,
15931,
198,
220,
220,
... | 2.567857 | 560 |
import os
def save_obj():
"""Save the obj file.
"""
os.makedirs(OBJ_FLDR, exist_ok=True)
for stage in STAGE_LIST:
with open(os.path.join(META_FLDR, stage + ".json"), "r") as file:
meta_list = json.load(file)
for meta in tqdm(meta_list):
os.makedirs(os.path.join(... | [
11748,
28686,
628,
198,
4299,
3613,
62,
26801,
33529,
198,
220,
220,
220,
37227,
16928,
262,
26181,
2393,
13,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
28686,
13,
76,
4335,
17062,
7,
9864,
41,
62,
3697,
7707,
11,
2152,
62,
482,... | 1.841232 | 422 |
"""Main program to be run for Character Generator"""
#########
#IMPORTS#
#########
import os
import pickle
from char import *
from chargen import *
from data import *
from traittranslator import *
from skilltranslator import *
from functions import *
###############
#MAIN FUNCTION#
###############
app()
... | [
37811,
13383,
1430,
284,
307,
1057,
329,
15684,
35986,
37811,
198,
198,
7804,
2,
198,
2,
3955,
47,
33002,
2,
198,
7804,
2,
198,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
6738,
1149,
1330,
1635,
198,
6738,
2609,
268,
1330,
1635,
... | 2.921739 | 115 |
# Some idiotic python introspection stuff for when authors don't write
# documentation about the classes their API creates.
| [
198,
2,
2773,
4686,
16357,
21015,
18951,
31308,
3404,
329,
618,
7035,
836,
470,
3551,
198,
2,
10314,
546,
262,
6097,
511,
7824,
8075,
13,
198
] | 4.807692 | 26 |
import math
import numpy as np
import numpy.polynomial.polynomial as poly
from .limb_model import LimbModel
DEFAULT_ORDER = 2
class Polynomial(LimbModel):
"""Model a limb darkening profile as a polynomial in :math:`\cos{\psi}`.
Attributes
----------
coefs : tuple of numbers
Coefficients for... | [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
35428,
26601,
498,
13,
35428,
26601,
498,
355,
7514,
198,
198,
6738,
764,
2475,
65,
62,
19849,
1330,
7576,
65,
17633,
198,
198,
7206,
38865,
62,
12532,
1137,
... | 2.307579 | 1,359 |
# pylint: disable=import-outside-toplevel
from localemr.config import Configuration
| [
2,
279,
2645,
600,
25,
15560,
28,
11748,
12,
43435,
12,
83,
643,
626,
198,
6738,
1957,
368,
81,
13,
11250,
1330,
28373,
628,
198
] | 3.44 | 25 |
# Copyright European Organization for Nuclear Research (CERN)
#
# 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
#
# Authors:
# - Mario Lassnig, <mario... | [
2,
15069,
3427,
12275,
329,
19229,
4992,
357,
34,
28778,
8,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
921,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13... | 2.706494 | 385 |
from django.shortcuts import render, redirect
from .forms import diarista_forms
from .models import Diarista
# Create your views here.
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
764,
23914,
1330,
2566,
283,
12523,
62,
23914,
198,
6738,
764,
27530,
1330,
6031,
283,
12523,
198,
198,
2,
13610,
534,
5009,
994,
13,
628,
628,
198
] | 3.589744 | 39 |
# -*- coding: utf-8 -*-
"""
Class Piece:
The shapes of tetrimonos
each of them was a tuple of tuples containing the rotations
PIECES is a dict containing all the shapes where number as a key.
{1: I, 2: J, 3: L, 4: O, 5: S, 6:T, 7:Z}
@author: Chens
https://github.com/ChenSunMac
""" | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
9487,
27053,
25,
198,
220,
220,
220,
383,
15268,
286,
28408,
3036,
261,
418,
628,
220,
220,
220,
1123,
286,
606,
373,
257,
46545,
286,
12777,
2374,
7268,
2... | 2.44 | 125 |
import socket
import time
import cv2
import pickle
import struct
if __name__ == "__main__":
sc = SocketClient("127.0.0.1", 8886, "127.0.0.1", 8888)
camera = cv2.VideoCapture(0)
while camera.isOpened():
success, frame = camera.read()
if not success:
break
sc.send_imag... | [
11748,
17802,
198,
11748,
640,
198,
11748,
269,
85,
17,
198,
11748,
2298,
293,
198,
11748,
2878,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
629,
796,
47068,
11792,
7203,
16799,
13,
15,
... | 2.080851 | 235 |
import tensorflow as tf
import numpy as np
import itertools
| [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
340,
861,
10141,
198
] | 3.333333 | 18 |
#%%
import matplotlib.pyplot as plt
import random
import pickle
from skimage.transform import rotate
from scipy import ndimage
from skimage.util import img_as_ubyte
from joblib import Parallel, delayed
from sklearn.ensemble.forest import _generate_unsampled_indices
from sklearn.ensemble.forest import _generate_sample_i... | [
2,
16626,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
4738,
198,
11748,
2298,
293,
198,
6738,
1341,
9060,
13,
35636,
1330,
23064,
198,
6738,
629,
541,
88,
1330,
299,
67,
9060,
198,
6738,
1341,
9060,
13,
... | 2.563183 | 641 |
import os
import shutil
import PIL
import pathlib
import argparse
import PIL.Image
from pathlib import Path
from src.utils.basic_functions import get_config
# folder to load config file
root = Path(__file__).parents[2]
CONFIG_FILE = os.path.join(root, 'config.yaml')
# center crop images into a square
... | [
11748,
28686,
201,
198,
11748,
4423,
346,
201,
198,
11748,
350,
4146,
201,
198,
11748,
3108,
8019,
201,
198,
11748,
1822,
29572,
201,
198,
11748,
350,
4146,
13,
5159,
201,
198,
6738,
3108,
8019,
1330,
10644,
201,
198,
6738,
12351,
13,
... | 2.969231 | 195 |
import os
import sys
import logging
from pathlib import Path
LOGGER = logging.getLogger(__name__)
LOGGER.setLevel(level=logging.INFO)
FORMAT = logging.Formatter("%(levelname)s: %(message)s")
SH = logging.StreamHandler(stream=sys.stdout)
SH.setFormatter(FORMAT)
LOGGER.addHandler(SH)
CONFIG_FILE = os.path.join(str(Path... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
18931,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198,
25294,
30373,
13,
2617,
4971,
7,
5715,
28,
6404,
2667,
13,
1... | 2.591716 | 169 |
"""
Highly experimental script that compiles the CPython standard library using Cython.
Execute the script either in the CPython 'Lib' directory or pass the
option '--current-python' to compile the standard library of the running
Python interpreter.
Pass '-j N' to get a parallel build with N processes.
Usage example... | [
37811,
198,
11922,
306,
11992,
4226,
326,
552,
2915,
262,
16932,
7535,
3210,
5888,
1262,
327,
7535,
13,
198,
198,
23002,
1133,
262,
4226,
2035,
287,
262,
16932,
7535,
705,
25835,
6,
8619,
393,
1208,
262,
198,
18076,
705,
438,
14421,
1... | 2.283907 | 1,423 |
from random import randint
from time import sleep
dicionario = {'Jogador 1':randint(1,6),
'Jogador 2':randint(1,6),
'Jogador 3':randint(1,6),
'Jogador 4':randint(1,6)}
print(' Jogo de dados ')
print('-='*30)
for n, j in dicionario.items():
print(f'{n} tirou {j} no dado... | [
6738,
4738,
1330,
43720,
600,
198,
6738,
640,
1330,
3993,
198,
67,
47430,
4982,
796,
1391,
6,
41,
519,
7079,
352,
10354,
25192,
600,
7,
16,
11,
21,
828,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
... | 1.926136 | 176 |
# -*- coding:utf-8 -*-
"""
Created on 2019/11/23 22:38
@author: Leo
@file:test_gj.py
@desc:
"""
import tempfile
import pywinauto
from easytrader import helpers
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
13130,
14,
1157,
14,
1954,
2534,
25,
2548,
198,
31,
9800,
25,
19632,
198,
31,
7753,
25,
9288,
62,
70,
73,
13,
9078,
198,
31,
20147,
25,
198,
378... | 2.447761 | 67 |
#!/usr/bin/env python
from ruia import Spider, utils, Item, Middleware, AttrField, TextField
from ruia_pyppeteer import PyppeteerRequest as Request
log = utils.log.get_logger()
fl_middleware = Middleware()
@fl_middleware.request
# class HitomiImageItem(Item):
# target_item = TextField(xpath_select='//*[@id="... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
6738,
7422,
544,
1330,
12648,
11,
3384,
4487,
11,
9097,
11,
6046,
1574,
11,
3460,
81,
15878,
11,
8255,
15878,
198,
6738,
7422,
544,
62,
9078,
381,
14471,
263,
1330,
9485,
381,
1... | 2.352174 | 460 |
# service util functions
import re
import socket
import time
import requests
from artemis_utils.constants import HEALTH_CHECK_TIMEOUT
from artemis_utils.envvars import COMPOSE_PROJECT_NAME
from artemis_utils.envvars import REST_PORT
from . import log
| [
2,
2139,
7736,
5499,
198,
11748,
302,
198,
11748,
17802,
198,
11748,
640,
198,
198,
11748,
7007,
198,
6738,
1242,
30561,
62,
26791,
13,
9979,
1187,
1330,
11179,
40818,
62,
50084,
62,
34694,
12425,
198,
6738,
1242,
30561,
62,
26791,
13,
... | 3.426667 | 75 |
import os
import fool
import math
import pandas as pd
import numpy as np
import random
import tensorflow as tf
def get_corpus_indices(data,chars_to_idx):
"""
转化成词库索引
"""
corpus_indices=[]
for d in data:
d=d.replace('\n','').replace('\r','').replace(' ','').replace('\u3000','')
... | [
11748,
28686,
198,
11748,
9192,
198,
11748,
10688,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
4299,
651,
62,
10215,
79,
385,
62,
521,
1063,... | 1.511138 | 2,469 |
'''
Write a function that takes a string as input and returns the string reversed.
'''
if __name__=='__main__':
solution = Solution()
testCase1='hello'
print(solution.reverseString(testCase1)) | [
7061,
6,
198,
16594,
257,
2163,
326,
2753,
257,
4731,
355,
5128,
290,
5860,
262,
4731,
17687,
13,
198,
7061,
6,
198,
198,
361,
11593,
3672,
834,
855,
6,
834,
12417,
834,
10354,
198,
220,
220,
220,
4610,
796,
28186,
3419,
198,
220,
... | 3.059701 | 67 |
import os
import subprocess
import sys
from autoprocess.parsers.distl import parse_distl_string
from autoprocess.utils.misc import json
| [
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
198,
6738,
22320,
305,
919,
13,
79,
945,
364,
13,
17080,
75,
1330,
21136,
62,
17080,
75,
62,
8841,
198,
6738,
22320,
305,
919,
13,
26791,
13,
44374,
1330,
33918,
628,
198
] | 3.309524 | 42 |
###
import keras
from keras.layers import *
import keras.backend as K
import common as C
from keras.models import *
| [
21017,
198,
11748,
41927,
292,
198,
6738,
41927,
292,
13,
75,
6962,
1330,
1635,
198,
11748,
41927,
292,
13,
1891,
437,
355,
509,
198,
11748,
2219,
355,
327,
198,
6738,
41927,
292,
13,
27530,
1330,
1635,
628,
198
] | 3.105263 | 38 |
#!/usr/bin/python3
import cv2
WINDOW_NAME = "picImage"
img = cv2.imread("G:/learn-project/tmp/1.jpg", cv2.IMREAD_COLOR)
cv2.imshow("picImage", img)
cv2.waitKey(0)
print("image is closed!")
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
201,
198,
201,
198,
11748,
269,
85,
17,
201,
198,
201,
198,
28929,
3913,
62,
20608,
796,
366,
16564,
5159,
1,
201,
198,
201,
198,
9600,
796,
269,
85,
17,
13,
320,
961,
7203,
38,
14079,
3... | 2.060606 | 99 |
import plotly.express as px
import plotly.graph_objects as go
import pandas as pd
inspyred_data_folder = "/System/Volumes/Data/Personal/Degree/Tools/Inspyred/Code/Git/inspyred/tanager_data"
if __name__ == '__main__':
projects = ['Sphere'] # ,'Rastrigin', 'Ackley', 'Rosenbrock', 'TSM']
# chart_types = ... | [
11748,
7110,
306,
13,
42712,
355,
279,
87,
198,
11748,
7110,
306,
13,
34960,
62,
48205,
355,
467,
628,
628,
198,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
198,
1040,
9078,
445,
62,
7890,
62,
43551,
796,
12813,
11964,
14,
16598... | 2.377897 | 561 |
#1.一个五边形的面积
#import math
#r = eval(input("Enter the length from the center to a vertex:"))
#s = 2 * r * math.sin(math.pi / 5)
#area = 5 *s ** 2 / (4 * math.tan(math.pi / 5))
#print("The area of the pentagon is %.2f" %area )
#2.大圆距离
#import math
#x1,y1 = eval(input("Enter point 1 (latiude and longitude) in degr... | [
2,
16,
13,
31660,
10310,
103,
49390,
164,
122,
117,
37605,
95,
21410,
165,
251,
95,
163,
100,
107,
201,
198,
2,
11748,
10688,
201,
198,
2,
81,
796,
5418,
7,
15414,
7203,
17469,
262,
4129,
422,
262,
3641,
284,
257,
37423,
11097,
40... | 1.825811 | 4,099 |
import torch
from torch import nn
import torch.nn.functional as F
import numpy as np
import math
from math import floor
from src.nets_utils import to_device, lecun_normal_init_parameters, make_bool_pad_mask
import src.monitor.logger as logger
# TODO:
# add relative positional encoding
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
10688,
1330,
4314,
198,
198,
6738,
12351,
13,
45938,
62,
26791,
133... | 3.360465 | 86 |
# pylint: disable=too-many-function-args
import os
import numpy as np
import pickle
from PIL import Image
import torchvision as V
from .. import configs
def __get_classification_dataset():
'''
https://github.com/pytorch/examples/blob/master/imagenet/main.py
'''
normalize = V.transforms.Normalize(
... | [
198,
2,
279,
2645,
600,
25,
15560,
28,
18820,
12,
21834,
12,
8818,
12,
22046,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2298,
293,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
28034,
10178,
355,
569,
198,
673... | 2.069328 | 476 |
"""Custom Exceptions for GRAFIMO and exception hook handler definition.
The base class GRAFIMOException inherits from Exception.
GRAFIMOException is extended with custom exceptions, handling errors
occurring during GRAFIMO run.
"""
class GRAFIMOException(Exception):
"""Class to represent an excpetion which can ... | [
37811,
15022,
1475,
11755,
329,
402,
3861,
37,
3955,
46,
290,
6631,
8011,
21360,
6770,
13,
198,
198,
464,
2779,
1398,
402,
3861,
37,
3955,
46,
16922,
10639,
896,
422,
35528,
13,
220,
198,
38,
3861,
37,
3955,
46,
16922,
318,
7083,
35... | 3.143243 | 1,110 |
import os
import shutil
import subprocess
from zipfile import ZipFile
from .deploy import ModelDeploy
from ..cloud.cluster import AugerClusterApi
from ..cloud.pipeline import AugerPipelineApi
from ..exceptions import AugerException
from a2ml.api.utils.dataframe import DataFrame
class ModelPredict():
"""Predict u... | [
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
850,
14681,
198,
6738,
19974,
7753,
1330,
38636,
8979,
198,
198,
6738,
764,
2934,
1420,
1330,
9104,
49322,
198,
6738,
11485,
17721,
13,
565,
5819,
1330,
2447,
263,
2601,
5819,
32,
14415,
... | 3.431373 | 102 |
"""Logging utils."""
import logging
import boto3
import watchtower
import logstash_formatter
import request_id.logging
from django.conf import settings
class CloudWatchHandler(watchtower.CloudWatchLogHandler):
"""Pre-configured CloudWatch handler."""
class RequestLogMiddleware:
"""Logs django requests."""... | [
37811,
11187,
2667,
3384,
4487,
526,
15931,
198,
198,
11748,
18931,
198,
198,
11748,
275,
2069,
18,
198,
11748,
2342,
36170,
198,
11748,
2604,
301,
1077,
62,
687,
1436,
198,
11748,
2581,
62,
312,
13,
6404,
2667,
198,
6738,
42625,
14208,... | 2.348 | 250 |
import pytest
from aoc2021 import day06
@pytest.mark.parametrize(
("name", "expected"),
[("sample", 5934), ("full", 350917)],
)
@pytest.mark.parametrize(
("name", "expected"),
[("sample", 26984457539), ("full", 1592918715629)],
)
| [
11748,
12972,
9288,
198,
198,
6738,
257,
420,
1238,
2481,
1330,
1110,
3312,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
220,
220,
5855,
3672,
1600,
366,
40319,
12340,
198,
220,
220,
220,
685,
7203,
39... | 2.345794 | 107 |
# Copyright 2020 Hamza Arain. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | [
2,
15069,
12131,
4345,
4496,
943,
391,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
2... | 2.503876 | 903 |
"""Extension of utilities.py to provide functions required to check the
version information of pathcom and determine if it needs to be updated.
Classes:
Pathcom: Extends the SrcClass class and provides the static variables and
pathcom specific functions required to perform a check on pathcom.
Functions:
... | [
37811,
11627,
3004,
286,
20081,
13,
9078,
284,
2148,
5499,
2672,
284,
2198,
262,
198,
9641,
1321,
286,
3108,
785,
290,
5004,
611,
340,
2476,
284,
307,
6153,
13,
198,
198,
9487,
274,
25,
198,
220,
220,
220,
10644,
785,
25,
5683,
2412... | 2.085252 | 4,387 |