content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/env python3
import pygraphviz
import wyvern
import random
import pydot
import sys
import csv
import re
prereq_reg = re.compile(r'[A-Z]{2,4}\*[0-9]{4}')
restrict_reg = re.compile(r'[A-Z]{2,4}\*[0-9]{4}')
if __name__ == "__main__":
sys.exit(main(sys.argv))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
12972,
34960,
85,
528,
198,
11748,
266,
88,
933,
198,
11748,
4738,
198,
11748,
279,
5173,
313,
198,
11748,
25064,
198,
11748,
269,
21370,
198,
11748,
302,
198,
198,
386... | 2.037313 | 134 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
'''
@author: alishtory
@site: https://github.com/alishtory
@file: xsadmin_server.py
@time: 2017/3/10 16:33
@description:
'''
import config_xsadmin as config
import requests, hashlib
import time, random, logging
from ServerManager import AbstractServerManager
if __name__ ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
31,
9800,
25,
435,
680,
83,
652,
198,
31,
15654,
25,
3740,
1378,
12567,
13,
785,
14,
282,
680,
83,
652,
... | 2.482301 | 226 |
from django.urls import path
from orders import views
app_name = 'orders'
urlpatterns = [
path('create/', views.order_create, name='order_create'),
path('<int:order_id>/', views.detail, name='detail'),
path('payment/<int:order_id>/<int:price>', views.payment, name='payment'),
path('verify/', views.ve... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
6266,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
705,
6361,
6,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
17953,
14,
3256,
5009,
13,
2875,
62,
... | 2.613497 | 163 |
import files_list
import files_delete
from datetime import datetime
import time
if __name__ == "__main__":
while True:
files = files_list.get_files_list()
if files == -1:
print("failed files get")
else:
now_time = datetime.now()
for file in files:
... | [
11748,
3696,
62,
4868,
198,
11748,
3696,
62,
33678,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
640,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
981,
6407,
25,
198,
220,
220,
220,
220,
... | 2.060403 | 298 |
import discord
from discord.ext import commands
import asyncio
import pickle
import time
import datetime
import asyncio
ranksRP = [int(5*(i**1.5)+50*i+100) for i in range(50)]
class Profiles(commands.Cog):
"""
Info about yourself or other users. Will use Battle Legion API to check stats when added.
"""
... | [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
11748,
30351,
952,
198,
11748,
2298,
293,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
30351,
952,
198,
198,
81,
2283,
20031,
796,
685,
600,
7,
20,
9,
7,
72,
1174,
1... | 2.173253 | 2,505 |
from flask import jsonify, render_template, redirect, current_app, request
import requests_oauthlib
from requests_oauthlib.compliance_fixes import facebook_compliance_fix
from config import FB_AUTHORIZATION_BASE_URL, FB_TOKEN_URL, BASE_URL
from serializer import serialize
from .db import get_schema
from .models impor... | [
6738,
42903,
1330,
33918,
1958,
11,
8543,
62,
28243,
11,
18941,
11,
1459,
62,
1324,
11,
2581,
198,
11748,
7007,
62,
12162,
1071,
8019,
198,
6738,
7007,
62,
12162,
1071,
8019,
13,
47587,
62,
42624,
1330,
23960,
62,
47587,
62,
13049,
19... | 3.597938 | 97 |
from wtforms_alchemy import ModelForm, ModelFormField
from models import * | [
6738,
266,
83,
23914,
62,
282,
26599,
1330,
9104,
8479,
11,
9104,
8479,
15878,
198,
6738,
4981,
1330,
1635
] | 3.894737 | 19 |
from substitution_cipher.decrypt import decrypt_file, decrypt_text, reverse_dict
from substitution_cipher.encrypt import encrypt_file, encrypt_text
key = {
"a": "X",
"b": "B",
"c": "R",
"d": "Z",
"e": "A",
"f": "Y",
"g": "J",
"h": "M",
"i": "C",
"j": "D",
"k": "O",
"l": ... | [
6738,
32097,
62,
66,
10803,
13,
12501,
6012,
1330,
42797,
62,
7753,
11,
42797,
62,
5239,
11,
9575,
62,
11600,
198,
6738,
32097,
62,
66,
10803,
13,
12685,
6012,
1330,
34117,
62,
7753,
11,
34117,
62,
5239,
198,
198,
2539,
796,
1391,
1... | 2.073957 | 1,582 |
# (C) British Crown Copyright 2011 - 2018, Met Office
#
# This file is part of cartopy.
#
# cartopy is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option)... | [
2,
357,
34,
8,
3517,
12223,
15069,
2813,
532,
2864,
11,
3395,
4452,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
6383,
11081,
13,
198,
2,
198,
2,
6383,
11081,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
34... | 2.395821 | 4,929 |
# importing the package covid
# can be installed with pip install covid
from covid import Covid
covid= Covid()
# setting a country, here India
india = covid.get_status_by_country_name("india")
print(india) | [
2,
33332,
262,
5301,
39849,
312,
198,
2,
460,
307,
6589,
351,
7347,
2721,
39849,
312,
198,
198,
6738,
39849,
312,
1330,
39751,
312,
198,
66,
709,
312,
28,
39751,
312,
3419,
198,
198,
2,
4634,
257,
1499,
11,
994,
3794,
198,
521,
54... | 3.089552 | 67 |
import datetime
import requests
import schedule
import time
import vk
session = vk.Session(access_token="token1")
admin = vk.Session(access_token="token2")
api = vk.API(session)
human = vk.API(admin)
maingroup = 128947927
maingroup_fix = -128947927
# Уведомления в личные сообщения
schedule.every(1).minutes.do(mes... | [
11748,
4818,
8079,
198,
11748,
7007,
198,
11748,
7269,
198,
11748,
640,
198,
11748,
410,
74,
198,
198,
29891,
796,
410,
74,
13,
36044,
7,
15526,
62,
30001,
2625,
30001,
16,
4943,
198,
28482,
796,
410,
74,
13,
36044,
7,
15526,
62,
30... | 2.031513 | 476 |
from flask import Flask
# Internal packages
from configurations import BaseConfig
from flask_base import db, bcrypt, log_mgr
from .admin import admin
from .api import api
from .errors import errors
from .main import main
from .posts import posts
from .user import users
def create_app(*args, **kwargs) -> Flask:
""... | [
6738,
42903,
1330,
46947,
198,
2,
18628,
10392,
198,
6738,
25412,
1330,
7308,
16934,
198,
6738,
42903,
62,
8692,
1330,
20613,
11,
275,
29609,
11,
2604,
62,
76,
2164,
198,
6738,
764,
28482,
1330,
13169,
198,
6738,
764,
15042,
1330,
40391... | 2.82 | 300 |
"""Test loading of additional plugins."""
from nose.tools import eq_
def test_one():
"""Test that the test plugin was initialized."""
from testapp import plugins
eq_(plugins.plugin_began, True)
| [
37811,
14402,
11046,
286,
3224,
20652,
526,
15931,
198,
6738,
9686,
13,
31391,
1330,
37430,
62,
628,
198,
4299,
1332,
62,
505,
33529,
198,
220,
220,
220,
37227,
14402,
326,
262,
1332,
13877,
373,
23224,
526,
15931,
198,
220,
220,
220,
... | 3.370968 | 62 |
"""Notification channels for django-notifs."""
try:
from channels.layers import get_channel_layer
HAS_DEPENDENCIES = True
except ImportError:
HAS_DEPENDENCIES = False
from asgiref.sync import async_to_sync
from pydantic import BaseModel
from .base import BaseNotificationProvider
class DjangoChannelsN... | [
37811,
3673,
2649,
9619,
329,
42625,
14208,
12,
1662,
361,
82,
526,
15931,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
9619,
13,
75,
6962,
1330,
651,
62,
17620,
62,
29289,
628,
220,
220,
220,
33930,
62,
46162,
10619,
24181,
11015,
... | 3.039548 | 177 |
import tensorflow as tf
import os
import numpy as np
import cv2
from args import FLAGS
from database import reader, helper, helper_cityscapes
from model import pspnet_mg
from experiment_manager.utils import sorted_str_dict
if __name__ == '__main__':
tf.app.run()
| [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
198,
6738,
26498,
1330,
9977,
4760,
50,
198,
6738,
6831,
1330,
9173,
11,
31904,
11,
31904,
62,
19205,
1416,
7916,... | 3.102273 | 88 |
import unittest
from py4godot import Array, Variant
| [
11748,
555,
715,
395,
198,
6738,
12972,
19,
25344,
313,
1330,
15690,
11,
38215,
628,
197,
628,
197,
198
] | 3.052632 | 19 |
# -*- coding: utf-8 -*-
# Converted from Chango-Regular.ttf using:
# ./font2bitmap.py Chango-Regular.ttf 32 -c 0x20-0x7f
MAP = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
BPP = 1
HEIGHT = 35
MAX_WIDTH = 49
_WIDTHS = \
b'\x0d\x10\x13\x1c\x1a\x30\x21\x0b\x... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
43433,
422,
609,
14208,
12,
40164,
13,
926,
69,
1262,
25,
198,
2,
220,
220,
220,
220,
24457,
10331,
17,
2545,
8899,
13,
9078,
609,
14208,
12,
40164,
13,
926,
69,
... | 1.321681 | 37,705 |
# -*- coding: utf-8 -*
from itertools import chain
from os import getcwd, path
import argparse
from pupy.decorations import tictoc
CD = getcwd()
def fmt_line(line, col, phillup=False):
"""
:param line:
:param col:
:return:
# >>> format_line([])
"""
if len(line) == 1:
code = line[... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
6738,
28686,
1330,
651,
66,
16993,
11,
3108,
198,
11748,
1822,
29572,
198,
6738,
15552,
88,
13,
12501,
273,
602,
1330,
256,
713,
420,... | 1.959635 | 768 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
def parse_handle(handle):
"""
Parses a connection handle to get it's subparts (user, password, host, port, dbname)
@return (user, passwd, host, port, dbname)
@example
127.0.0.1 -> (None, None, '127.0.0.1', None, None)... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
25064,
628,
628,
198,
4299,
21136,
62,
28144,
7,
28144,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
... | 2.271218 | 542 |
""" Priority Tests
Test conversions between Todoist and Taskwarrior priorities.
"""
import pytest
from todoist_taskwarrior import utils
| [
37811,
34416,
30307,
198,
198,
14402,
32626,
1022,
309,
24313,
396,
290,
15941,
5767,
7701,
15369,
13,
198,
37811,
198,
11748,
12972,
9288,
198,
6738,
284,
4598,
396,
62,
35943,
5767,
7701,
1330,
3384,
4487,
628,
198
] | 3.756757 | 37 |
nome = input('Digite seu nome: ').strip()
print('\n Nome em maiúsculas:', nome.upper())
print(' Nome em minúsculas:', nome.lower())
print(' Quantidade de letras:', len(nome.replace(' ', '')))
print(' Quantidade de letras:', len(nome)-nome.count(' ')) # 2° opção
print(' Q. de letras primeiro nome:', len(nome.split()[0]... | [
77,
462,
796,
5128,
10786,
19511,
578,
384,
84,
299,
462,
25,
705,
737,
36311,
3419,
198,
4798,
10786,
59,
77,
399,
462,
795,
285,
1872,
21356,
1416,
25283,
25,
3256,
299,
462,
13,
45828,
28955,
198,
4798,
10786,
399,
462,
795,
949,... | 2.462025 | 158 |
from typing import Dict
import matplotlib.pyplot as plt
import numpy as np
from IPython.core.display import display
from matplotlib.ticker import FormatStrFormatter, MaxNLocator
from mpl_toolkits.mplot3d import Axes3D
from plotly import offline as plotly, graph_objs as go, tools
PLOT_TYPES = {'random', 'grid', 'explo... | [
6738,
19720,
1330,
360,
713,
198,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
6101,
7535,
13,
7295,
13,
13812,
1330,
3359,
198,
6738,
2603,
29487,
8019,
13,
83,
15799,
1... | 3.094488 | 127 |
# Copyright 2008 (C) Nicira, Inc.
#
# This file is part of NOX.
#
# NOX is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# NOX is dist... | [
2,
15069,
3648,
357,
34,
8,
8377,
8704,
11,
3457,
13,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
8005,
55,
13,
198,
2,
198,
2,
8005,
55,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
2,
340,
739,
... | 3 | 1,849 |
from . import HydrusConstants as HC
from . import ClientConstants as CC
from . import ClientData
from . import ClientDefaults
from . import ClientDownloading
from . import ClientDragDrop
from . import ClientExporting
from . import ClientCaches
from . import ClientFiles
from . import ClientGUIACDropdown
from . import Cl... | [
6738,
764,
1330,
15084,
14932,
34184,
1187,
355,
27327,
198,
6738,
764,
1330,
20985,
34184,
1187,
355,
12624,
198,
6738,
764,
1330,
20985,
6601,
198,
6738,
764,
1330,
20985,
7469,
13185,
198,
6738,
764,
1330,
20985,
10002,
278,
198,
6738,... | 1.705376 | 1,395 |
# -*- coding: utf-8 -*-
"""
Created on Jul 21 2017
@author: J. C. Vasquez-Correa
"""
import numpy as np
import sys
def PQ(x,k):
"""
Perturbation Quotient in percentage of the signal x
:params x: input sequence: F0 values or Amplitude values per window
:params k: average factor (must be an odd n... | [
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
5979,
2310,
2177,
198,
198,
31,
9800,
25,
449,
13,
327,
13,
23663,
22281,
12,
10606,
21468,
198,
37811,
628,
198,
11748,
299,
32152,
355,
... | 2.023077 | 520 |
import sqlparse
from sqlparse.sql import Identifier, Token, Comparison, Statement
from sqlparse.tokens import Token as TokenType
from mlflow.exceptions import MlflowException
from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE
| [
11748,
44161,
29572,
198,
6738,
44161,
29572,
13,
25410,
1330,
11440,
7483,
11,
29130,
11,
34420,
11,
21983,
198,
6738,
44161,
29572,
13,
83,
482,
641,
1330,
29130,
355,
29130,
6030,
198,
198,
6738,
285,
1652,
9319,
13,
1069,
11755,
133... | 3.361111 | 72 |
# Copyright 2011-2016 MongoDB, Inc.
#
# 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 writin... | [
2,
15069,
2813,
12,
5304,
42591,
11012,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
1... | 2.726531 | 735 |
"""
Copyright 2013 Rackspace
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 writing, software
dist... | [
37811,
198,
15269,
2211,
37927,
13200,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
1639,
743,
7... | 3.93662 | 142 |
# MIT licensed
# Copyright (c) 2022 Pekka Ristola <pekkarr [at] protonmail [dot] com>, et al.
from nvchecker.api import session, GetVersionError
CRAN_URL = 'https://cran.r-project.org/package=%s/DESCRIPTION'
VERSION_FIELD = 'Version: '
| [
2,
17168,
11971,
198,
2,
15069,
357,
66,
8,
33160,
350,
988,
4914,
371,
396,
5708,
1279,
431,
28747,
3258,
685,
265,
60,
386,
1122,
4529,
685,
26518,
60,
401,
22330,
2123,
435,
13,
198,
198,
6738,
299,
85,
9122,
263,
13,
15042,
13... | 2.767442 | 86 |
import click
from gitkit.util.shell import get_output, run
@click.command()
@click.argument("branches", nargs=-1)
def point_here(branches):
""" Set the given branch refs to point to the current HEAD. """
if not branches:
print("No branches passed.")
return
current = get_output("git rev-pa... | [
11748,
3904,
198,
198,
6738,
17606,
15813,
13,
22602,
13,
29149,
1330,
651,
62,
22915,
11,
1057,
628,
198,
31,
12976,
13,
21812,
3419,
198,
31,
12976,
13,
49140,
7203,
1671,
12140,
1600,
299,
22046,
10779,
16,
8,
198,
4299,
966,
62,
... | 2.689655 | 174 |
"""
Asynchronous stream with a piping system.
Copyright (C) 2017 The Pylp Authors.
This file is under the MIT License.
"""
import asyncio
class Stream():
"""An asynchronous stream containing a transformer with a piping system."""
def append_file(self, file):
"""Append a new file in the stream."""
self.fil... | [
37811,
198,
198,
1722,
31301,
4269,
351,
257,
48426,
1080,
13,
198,
198,
15269,
357,
34,
8,
2177,
383,
350,
2645,
79,
46665,
13,
198,
1212,
2393,
318,
739,
262,
17168,
13789,
13,
198,
198,
37811,
198,
198,
11748,
30351,
952,
628,
19... | 2.900749 | 534 |
def noop():
"""Empty function to invoke CPython ceval loop."""
return
| [
4299,
645,
404,
33529,
198,
220,
220,
220,
37227,
40613,
2163,
284,
26342,
16932,
7535,
269,
18206,
9052,
526,
15931,
198,
220,
220,
220,
1441,
198
] | 3 | 26 |
import base64
import struct
from typing import List
from binascii import hexlify
from itertools import chain
from lbry.schema.types.v2.result_pb2 import Outputs as OutputsMessage
| [
11748,
2779,
2414,
198,
11748,
2878,
198,
6738,
19720,
1330,
7343,
198,
6738,
9874,
292,
979,
72,
1330,
17910,
75,
1958,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
198,
6738,
18360,
563,
13,
15952,
2611,
13,
19199,
13,
85,
17,
13,
... | 3.351852 | 54 |
# MIT License
# Copyright (c) 2020 - Present nxtlo
#
# 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... | [
2,
17168,
13789,
198,
2,
15069,
357,
66,
8,
12131,
532,
21662,
299,
742,
5439,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3696... | 2.450355 | 12,670 |
import logging
import time
import adb
from .. import app_test
logger = logging.getLogger(__name__)
| [
11748,
18931,
198,
11748,
640,
198,
198,
11748,
512,
65,
198,
6738,
11485,
1330,
598,
62,
9288,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 3.090909 | 33 |
# -*- coding: utf-8 -*-
from mmvae_hub.utils.utils import save_and_log_flags
from torch.utils.tensorboard import SummaryWriter
from mmvae_hub.base.BaseCallback import BaseCallback
from mmvae_hub.base.BaseTrainer import BaseTrainer
from mmvae_hub.celeba.CelebaLogger import CelebALogger
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
8085,
33353,
62,
40140,
13,
26791,
13,
26791,
1330,
3613,
62,
392,
62,
6404,
62,
33152,
198,
6738,
28034,
13,
26791,
13,
83,
22854,
3526,
1330,
21293,
34379,
198,
... | 3.06383 | 94 |
#!/usr/bin/env python3
# vim: autoindent tabstop=4 shiftwidth=4 expandtab softtabstop=4 filetype=python
# -*- coding: utf-8 -*-
# BSD LICENSE
#
# Copyright (c) 2016, Boying Xu All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the fol... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
43907,
25,
8295,
521,
298,
7400,
11338,
28,
19,
6482,
10394,
28,
19,
4292,
8658,
2705,
8658,
11338,
28,
19,
2393,
4906,
28,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
... | 2.671203 | 1,837 |
from keras.layers import Lambda, SimpleRNN, Concatenate, Subtract, Reshape
| [
6738,
41927,
292,
13,
75,
6962,
1330,
21114,
6814,
11,
17427,
49,
6144,
11,
1482,
9246,
268,
378,
11,
3834,
83,
974,
11,
1874,
71,
1758,
628
] | 2.814815 | 27 |
# Import Pytest Package
import pytest
from solution import alternatingCharacters | [
2,
17267,
9485,
9288,
15717,
198,
11748,
12972,
9288,
198,
198,
6738,
4610,
1330,
39623,
48393
] | 5.0625 | 16 |
from django.urls import path
from . import views
app_name = 'articles'
urlpatterns = [
path(
'',
views.ArticlesListView.as_view(),
name = 'list'),
path(
'create/',
views.ArticleCreateView.as_view(),
name = 'create'),
path(
'created/',
views.A... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
705,
26845,
6,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
7,
198,
220,
220,
220,
220,
220,
220,
220,
705,... | 2.024938 | 401 |
from django.conf.urls.defaults import *
urlpatterns = patterns('browse.views',
url(r'^spell/(?P<slug>[\w-]+)/$', 'spell_detail', name='spell_detail'),
url(r'^feat/(?P<slug>[\w-]+)/$', 'feat_detail', name='feat_detail'),
url(r'^monster/(?P<slug>[\w-]+)/$', 'monster_detail', name='monster_detail'),
url(... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12286,
82,
1330,
1635,
198,
198,
6371,
33279,
82,
796,
7572,
10786,
25367,
325,
13,
33571,
3256,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
46143,
29006,
30,
47,
27,
6649,
1018,
36937,
... | 2.35625 | 160 |
from django.shortcuts import render
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198
] | 4 | 9 |
# Generated by Django 3.2.9 on 2021-11-03 17:25
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
24,
319,
33448,
12,
1157,
12,
3070,
1596,
25,
1495,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from collections import defaultdict, deque
import re
CHALLENGE_DAY = "3"
REAL = open(CHALLENGE_DAY + ".txt").read()
SAMPLE = open(CHALLENGE_DAY + ".sample.txt").read()
SAMPLE_EXPECTED = 2
sample = solve(SAMPLE)
if sample != SAMPLE_EXPECTED:
print("SAMPLE FAILED: ", sample, " != ", SAMPLE_EXPECTED)
assert sample =... | [
6738,
17268,
1330,
4277,
11600,
11,
390,
4188,
198,
11748,
302,
198,
198,
3398,
7036,
1677,
8264,
62,
26442,
796,
366,
18,
1,
198,
2200,
1847,
796,
1280,
7,
3398,
7036,
1677,
8264,
62,
26442,
1343,
27071,
14116,
11074,
961,
3419,
198,... | 2.607656 | 209 |
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
| [
6738,
42625,
14208,
1330,
5107,
201,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
201,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
201,
198,
6738,
42625,
... | 3.186667 | 75 |
from .base import TestExternalDatabase
from .compat import long_, unicode_
| [
6738,
764,
8692,
1330,
6208,
41506,
38105,
198,
6738,
764,
5589,
265,
1330,
890,
62,
11,
28000,
1098,
62,
198
] | 3.75 | 20 |
# SPDX-License-Identifier: MIT
# (c) 2019 The TJHSST Director 4.0 Development Team & Contributors
from django.apps import AppConfig
| [
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
198,
2,
357,
66,
8,
13130,
383,
41852,
7998,
2257,
5890,
604,
13,
15,
7712,
4816,
1222,
25767,
669,
198,
198,
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.35 | 40 |
from pyclist.admin import BaseModelAdmin, admin_register
from django.contrib import admin
from tg.models import Chat, History
@admin_register(Chat)
@admin_register(History)
| [
6738,
12972,
565,
396,
13,
28482,
1330,
7308,
17633,
46787,
11,
13169,
62,
30238,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
256,
70,
13,
27530,
1330,
24101,
11,
7443,
628,
198,
31,
28482,
62,
30238,
7,
30820,
8,
... | 3.403846 | 52 |
# Generated by Django 3.2.8 on 2021-11-09 14:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
23,
319,
33448,
12,
1157,
12,
2931,
1478,
25,
1433,
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.019231 | 52 |
from . import video_transforms as T
from . import object_transforms as OT
| [
6738,
764,
1330,
2008,
62,
7645,
23914,
355,
309,
198,
6738,
764,
1330,
2134,
62,
7645,
23914,
355,
21676,
628
] | 3.75 | 20 |
import copy
import os
import torch
import wandb
from soundbay.utils.logging import Logger
from soundbay.inference import predict
from soundbay.trainers import Trainer
from pathlib import Path
from soundbay.utils.app import App
from omegaconf import DictConfig
| [
11748,
4866,
198,
11748,
28686,
198,
11748,
28034,
198,
11748,
11569,
65,
198,
6738,
2128,
24406,
13,
26791,
13,
6404,
2667,
1330,
5972,
1362,
198,
6738,
2128,
24406,
13,
259,
4288,
1330,
4331,
198,
6738,
2128,
24406,
13,
27432,
364,
13... | 3.71831 | 71 |
#!/usr/bin/env python3
# Copyright Yuri Astrakhan <YuriAstrakhan@gmail.com>
import json
import logging
import time
from typing import Dict
import argparse
import requests
from datetime import datetime
from utils import stringify, chunks, query_status, set_status_query, parse_utc
from sparql import Sparql
info_keys ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
15069,
38450,
8304,
17716,
7637,
1279,
56,
9900,
32,
12044,
74,
7637,
31,
14816,
13,
785,
29,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
640,
198,
6738,
19720,
1330,... | 2.928934 | 197 |
from OpenGL import GL
# Pyopengl shader compilation errors are unreadable, so we'll define our own
# routine.
| [
6738,
30672,
1330,
10188,
198,
198,
2,
9485,
404,
1516,
75,
33030,
23340,
8563,
389,
555,
46155,
11,
523,
356,
1183,
8160,
674,
898,
198,
2,
8027,
13,
628,
198
] | 3.766667 | 30 |
# encoding: utf-8
"""
Read images and corresponding labels.
"""
import torch
from torch.utils.data import Dataset
from PIL import Image
import os
import random
| [
2,
21004,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
5569,
4263,
290,
11188,
14722,
13,
198,
37811,
198,
198,
11748,
28034,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
... | 3.468085 | 47 |
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
# constant values which we define at the first of the code.
# url to create user
CREATE_USER_URL = reverse('user:create')
# url to... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
651,
62,
7220,
62,
19849,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
34... | 2.637056 | 2,364 |
"""Provide the common bit-vector operators."""
import collections
import functools
import itertools
import math
from sympy.core import cache
from sympy.printing import precedence as sympy_precedence
from cascada.bitvector import context
from cascada.bitvector import core
zip = functools.partial(zip, strict=True)
... | [
37811,
15946,
485,
262,
2219,
1643,
12,
31364,
12879,
526,
15931,
198,
11748,
17268,
198,
11748,
1257,
310,
10141,
198,
11748,
340,
861,
10141,
198,
11748,
10688,
198,
198,
6738,
10558,
88,
13,
7295,
1330,
12940,
198,
6738,
10558,
88,
1... | 2.435396 | 14,612 |
from json import dump
from operator import itemgetter
from os import listdir, mkdir, path, remove
from time import sleep
import fitz
from docx2pdf import convert
# from PDFNetPython3 import * ----> python version 3.5-3.8 with working
# from PDFNetPython3.PDFNetPython import Element, Image, PDFDoc, Point
from PyPDF2 i... | [
6738,
33918,
1330,
10285,
198,
6738,
10088,
1330,
2378,
1136,
353,
198,
6738,
28686,
1330,
1351,
15908,
11,
33480,
15908,
11,
3108,
11,
4781,
198,
6738,
640,
1330,
3993,
198,
198,
11748,
4197,
89,
198,
6738,
2205,
87,
17,
12315,
1330,
... | 1.863955 | 2,139 |
"""Verify the structure of YAML-formatted configuration files.
The yamlfig package provides developers with a framework for defining
rules that test and verify a config file's structure. Those rules are
captured in a parser object which can be applied to YAML-based config
files to validate them.
In particular, this ... | [
37811,
13414,
1958,
262,
4645,
286,
575,
2390,
43,
12,
687,
16898,
8398,
3696,
13,
198,
198,
464,
331,
321,
1652,
328,
5301,
3769,
6505,
351,
257,
9355,
329,
16215,
198,
38785,
326,
1332,
290,
11767,
257,
4566,
2393,
338,
4645,
13,
... | 4.094276 | 297 |
import numpy as np
import SBCcode as sbc
import os
import re
from SBCcode.DataHandling.WriteBinary import WriteBinaryNtupleFile as wb
# import ipdb
modules = [
'AcousticAnalysis_',
'DytranAnalysis_',
'EventAnalysis_',
'HistoryAnalysis_',
'ImageAnalysis_',
'TimingAnalysis_',
'PMTfastDAQalign... | [
11748,
299,
32152,
355,
45941,
198,
11748,
311,
2749,
8189,
355,
264,
15630,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
311,
2749,
8189,
13,
6601,
12885,
1359,
13,
16594,
33,
3219,
1330,
19430,
33,
3219,
45,
83,
29291,
8979,
355,
... | 1.743671 | 4,108 |
"""
Python3 has three sequence type
String
list
tuple
range
byte and byte array
"""
string1 = "he's "
string2 = "probably "
string3 = "pining "
string4 = "for the "
string5 = "fjords"
print(string1, string2, string3, string4, string5)
print(string1 * 5) # string multiplication
print(string1 * (5+4)) # operator pr... | [
37811,
198,
37906,
18,
468,
1115,
8379,
2099,
198,
10100,
198,
4868,
198,
83,
29291,
198,
9521,
198,
26327,
290,
18022,
7177,
198,
37811,
198,
198,
8841,
16,
796,
366,
258,
338,
366,
198,
8841,
17,
796,
366,
26949,
366,
198,
8841,
1... | 2.883721 | 129 |
from flask import jsonify, make_response, request
from app.V1.views import bluprint
from app.V1.models.appmodels import PoliticalOfficeModel
@bluprint.route("/offices", methods= ["GET"] )
@bluprint.route("/offices", methods= ["POST"])
@bluprint.route("/offices/<int:office_id>", methods=["GET"]) | [
6738,
42903,
1330,
33918,
1958,
11,
787,
62,
26209,
11,
2581,
198,
6738,
598,
13,
53,
16,
13,
33571,
1330,
698,
929,
22272,
198,
6738,
598,
13,
53,
16,
13,
27530,
13,
1324,
27530,
1330,
14611,
27743,
17633,
628,
198,
31,
2436,
929,
... | 2.912621 | 103 |
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.RACKSPACE)
driver = cls("username", "api key", region="iad")
| [
6738,
9195,
17721,
13,
5589,
1133,
13,
19199,
1330,
32549,
198,
6738,
9195,
17721,
13,
5589,
1133,
13,
15234,
4157,
1330,
651,
62,
26230,
198,
198,
565,
82,
796,
651,
62,
26230,
7,
29495,
13,
49,
8120,
4303,
11598,
8,
198,
26230,
79... | 3.137931 | 58 |
from typing import Dict, Tuple, Optional, List
import os
from abc import ABCMeta, abstractmethod
import numpy as np
import json
from scipy.sparse import csr_matrix, dok_matrix
import panqec
from panqec.bpauli import bcommute, get_effective_error
from panqec import bsparse
os.environ['PANQEC_ROOT_DIR'] = os.path.dirna... | [
6738,
19720,
1330,
360,
713,
11,
309,
29291,
11,
32233,
11,
7343,
198,
11748,
28686,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33918,
198,
6738,
629,
541,
88,
13,
82,
2957... | 2.198134 | 12,648 |
from typing import Any
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
Base: Any = declarative_base()
| [
6738,
19720,
1330,
4377,
198,
198,
6738,
44161,
282,
26599,
1330,
29201,
11,
34142,
11,
10903,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
198,
198,
14881,
25,
4377,
796,
2377,
283,
876... | 3.478261 | 46 |
import time
import shutil
import torch
from big_sleep import Imagine
terminate = False
num_attempts = 4
for attempt in range(num_attempts):
dream = Imagine(
text = "an armchair in the form of pikachu\\an armchair imitating pikachu\\abstract",
text_min = "blur\\zoom",
lr = 7e-2,
ima... | [
11748,
640,
198,
11748,
4423,
346,
198,
11748,
28034,
198,
6738,
1263,
62,
42832,
1330,
18450,
198,
198,
23705,
378,
796,
10352,
198,
198,
22510,
62,
1078,
1791,
82,
796,
604,
198,
1640,
2230,
287,
2837,
7,
22510,
62,
1078,
1791,
82,
... | 2.119748 | 476 |
import pickle
import sys
import pika
import gevent
from gevent.event import Event
POLLS = {}
CACHE_SIZE = 20
| [
198,
11748,
2298,
293,
198,
11748,
25064,
198,
11748,
279,
9232,
198,
11748,
4903,
1151,
198,
6738,
4903,
1151,
13,
15596,
1330,
8558,
198,
198,
16402,
3069,
50,
796,
23884,
198,
34,
2246,
13909,
62,
33489,
796,
1160,
628,
628
] | 2.85 | 40 |
# coding = utf-8
import jieba
import logging
import numpy as np
from transformers import BertModel, BertTokenizer
jieba.setLogLevel(logging.INFO)
bert_path = "../chinese_wwm_ext_pytorch"
bert = BertModel.from_pretrained(bert_path)
token = BertTokenizer.from_pretrained(bert_path)
# Bert 字向量生成
# c... | [
2,
19617,
796,
3384,
69,
12,
23,
201,
198,
11748,
474,
494,
7012,
201,
198,
11748,
18931,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
6121,
364,
1330,
22108,
17633,
11,
22108,
30642,
7509,
201,
198,
201,
198,
73,
494,
7... | 2.067633 | 207 |
"""
This example uses a simple bag-of-words (BoW) approach. A sentence is mapped
to a sparse vector with e.g. 25,000 dimensions. Optionally, you can also use tf-idf.
To make the model trainable, we add multiple dense layers to create a Deep Averaging Network (DAN).
"""
from torch.utils.data import DataLoader
import ma... | [
37811,
198,
1212,
1672,
3544,
257,
2829,
6131,
12,
1659,
12,
10879,
357,
16635,
54,
8,
3164,
13,
317,
6827,
318,
27661,
198,
1462,
257,
29877,
15879,
351,
304,
13,
70,
13,
1679,
11,
830,
15225,
13,
16018,
453,
11,
345,
460,
635,
7... | 2.801153 | 1,735 |
# Generated by Django 2.2.2 on 2019-07-30 13:22
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
17,
319,
13130,
12,
2998,
12,
1270,
1511,
25,
1828,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
import textwrap
from test_utils import get_rendered_file
| [
11748,
2420,
37150,
198,
198,
6738,
1332,
62,
26791,
1330,
651,
62,
26238,
62,
7753,
628
] | 3.6875 | 16 |
from .dynedge import DynEdge, DynEdge_V2, DynEdge_V3
from .convnet import ConvNet
| [
6738,
764,
67,
2047,
14907,
1330,
39530,
37021,
11,
39530,
37021,
62,
53,
17,
11,
39530,
37021,
62,
53,
18,
198,
6738,
764,
42946,
3262,
1330,
34872,
7934,
198
] | 2.827586 | 29 |
from keras.models import load_model
import numpy as np
import cv2
"""
tensorflow_version --> '2.0.0'
keras_version -------> '2.3.1'
"""
'''
para usar:
1. instanciar modelo
face_detector = f_face_detector.detector_face_occlusion()
2. ingresar alguna imagen con un rostro y predecir
boxes_face = face_detector.de... | [
6738,
41927,
292,
13,
27530,
1330,
3440,
62,
19849,
198,
11748,
299,
32152,
355,
45941,
220,
198,
11748,
269,
85,
17,
198,
37811,
198,
83,
22854,
11125,
62,
9641,
14610,
705,
17,
13,
15,
13,
15,
6,
198,
6122,
292,
62,
9641,
40103,
... | 2.506329 | 158 |
import os
from git import Commit, Remote
import logging
| [
11748,
28686,
198,
198,
6738,
17606,
1330,
35910,
11,
21520,
198,
11748,
18931,
628,
628,
628,
628,
628,
198
] | 3.526316 | 19 |
import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
from dm_control import suite
from x_mushroom_rl.environments import Environment, MDPInfo
from x_mushroom_rl.utils.spaces import *
from x_mushroom_rl.utils.viewer import ImageViewer
class DMControl(... | [
11748,
14601,
198,
198,
4480,
14601,
13,
40198,
62,
40539,
654,
33529,
198,
220,
220,
220,
14601,
13,
24455,
40539,
654,
7203,
46430,
1600,
6536,
28,
12156,
8344,
341,
20361,
8,
198,
220,
220,
220,
422,
288,
76,
62,
13716,
1330,
18389... | 2.488778 | 802 |
from django.conf.urls import url
from . import views
app_name = 'home'
urlpatterns = [
# ex: /home/
url(r'^$', views.hbase_region_servers, name='hbase_region_servers$'),
url(r'^opentsdb/split$', views.opentsdb_split, name='opentsdb_split'),
url(r'^opentsdb/regions/(?P<encoded_name>[a-f0-9]+)$... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
201,
198,
201,
198,
6738,
764,
1330,
5009,
201,
198,
201,
198,
1324,
62,
3672,
796,
705,
11195,
6,
201,
198,
6371,
33279,
82,
796,
685,
201,
198,
220,
220,
220,
1303,
409,
... | 2.168103 | 464 |
# https://pypi.org/project/jax-data/
import jax
import jax.numpy as jnp
import numpy as np | [
2,
3740,
1378,
79,
4464,
72,
13,
2398,
14,
16302,
14,
73,
897,
12,
7890,
14,
198,
198,
11748,
474,
897,
198,
11748,
474,
897,
13,
77,
32152,
355,
474,
37659,
198,
198,
11748,
299,
32152,
355,
45941
] | 2.421053 | 38 |
from core.app import App, AppParameter, AppFile
import unittest
import shutil
import pdb
class TestAppParameter(unittest.TestCase):
"""
test for App Parameters
"""
class TestAppFile(unittest.TestCase):
"""docstring for TestAppFile"""
class TestApp(unittest.TestCase):
"""docstring for TestApp"""
... | [
6738,
4755,
13,
1324,
1330,
2034,
11,
2034,
36301,
11,
2034,
8979,
198,
11748,
555,
715,
395,
198,
11748,
4423,
346,
198,
11748,
279,
9945,
198,
198,
4871,
6208,
4677,
36301,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
220,
220,
... | 2.823077 | 130 |
"""
run.py is written to train and evaluate the model
"""
import os
import logging
import glob
from Regression.configuration import BaseConfig
from Regression.methods import RegressionModel, save_model, load_trained
from Regression.dataloader import DataframeLoader
from Regression.train import TrainingEvaluati... | [
37811,
201,
198,
5143,
13,
9078,
318,
3194,
284,
4512,
290,
13446,
262,
2746,
201,
198,
37811,
201,
198,
11748,
28686,
201,
198,
11748,
18931,
201,
198,
11748,
15095,
201,
198,
6738,
3310,
2234,
13,
11250,
3924,
1330,
7308,
16934,
201,
... | 2.075964 | 1,685 |
# -*- coding:utf-8 -*-
from essen.settings import *
BROKER_TRANSPORT = 'sqs'
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
6738,
3209,
268,
13,
33692,
1330,
1635,
198,
198,
11473,
11380,
1137,
62,
5446,
1565,
4303,
9863,
796,
705,
31166,
82,
6,
198
] | 2.166667 | 36 |
from typing import List, Any
import pytorch_lightning.core.lightning as pl
import torch
import torch.nn.functional as F
import numpy as np
from allennlp.modules import ConditionalRandomField
from allennlp.modules.conditional_random_field import allowed_transitions
from torch import nn
from torch.utils.data import Da... | [
6738,
19720,
1330,
7343,
11,
4377,
198,
198,
11748,
12972,
13165,
354,
62,
2971,
768,
13,
7295,
13,
2971,
768,
355,
458,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
11748,
299,
32152,
355,
45941,
19... | 3.559441 | 143 |
from easydict import EasyDict as edict
from torchvision import transforms as trans
import torch.nn as nn
from label_smoothing import LabelSmoothing, LabelSmoothingLoss
| [
6738,
2562,
11600,
1330,
16789,
35,
713,
355,
1225,
713,
198,
6738,
28034,
10178,
1330,
31408,
355,
1007,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
6167,
62,
5796,
1025,
722,
1330,
36052,
7556,
1025,
722,
11,
36052,
7556,
... | 3.652174 | 46 |
from pooch import os_cache as _os_cache
from pooch import retrieve as _retrieve
from pooch import HTTPDownloader as _HTTPDownloader
from pooch import Unzip as _Unzip
import pandas as _pd
#import geopandas as _gpd
import os as _os
#from gprm import ReconstructionModel as _ReconstructionModel
# TODO
# Add: Domeier and ... | [
6738,
745,
5374,
1330,
28686,
62,
23870,
355,
4808,
418,
62,
23870,
198,
6738,
745,
5374,
1330,
19818,
355,
4808,
1186,
30227,
198,
6738,
745,
5374,
1330,
7154,
51,
5760,
593,
29356,
355,
4808,
6535,
51,
5760,
593,
29356,
198,
6738,
7... | 2.39438 | 16,725 |
from pathlib import Path
def read_commands(path: Path) -> list[tuple[str, int]]:
"""Read sub commands from a file."""
commands = []
with open(path, "r") as file:
for line in file.readlines():
command, amount = line.split()
commands.append((command, int(amount)))
retur... | [
6738,
3108,
8019,
1330,
10644,
628,
628,
198,
4299,
1100,
62,
9503,
1746,
7,
6978,
25,
10644,
8,
4613,
1351,
58,
83,
29291,
58,
2536,
11,
493,
60,
5974,
198,
220,
220,
220,
37227,
5569,
850,
9729,
422,
257,
2393,
526,
15931,
198,
... | 2.513514 | 148 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The flow collector daemon
"""
import argparse
import logging
import socketserver
import sys
from flowproc import process
from flowproc import __version__
__author__ = "Tobias Frei"
__copyright__ = "Tobias Frei"
__license__ = "mit"
logger = logging.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,
37811,
198,
464,
5202,
22967,
33386,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
37037,
1849... | 2.28933 | 1,462 |
from functools import wraps
from abc import ABCMeta, abstractmethod
def dispatch_loader(scraper, loader_name):
"""
Decorator that enforces one time loading for scrapers. The one time loading is applied
to partial loaders, e.g. only parse and load the home team roster once. This is not
meant to be used... | [
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
450,
66,
1330,
9738,
48526,
11,
12531,
24396,
198,
198,
4299,
27965,
62,
29356,
7,
1416,
38545,
11,
40213,
62,
3672,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4280,
273,
... | 2.314389 | 827 |
import datetime
import importlib
import logging
import os
import platform
import socket
import sys
import pikka_bird_collector
from .config import Config
COLLECTORS = [
'system', # keep first; sort rest
'mongodb',
'mysql',
'postgresql',
'rabbitmq',
'redis']
COLLECTORS_MODULE_P = 'pikka_bird_... | [
11748,
4818,
8079,
198,
11748,
1330,
8019,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
3859,
198,
11748,
17802,
198,
11748,
25064,
198,
198,
11748,
279,
1134,
4914,
62,
16944,
62,
33327,
273,
198,
6738,
764,
11250,
1330,
17056,
628,... | 2.109555 | 1,214 |
# coding=utf-8
from OTLMOW.OTLModel.BaseClasses.OTLAttribuut import OTLAttribuut
from OTLMOW.OTLModel.Classes.ConstructieElement import ConstructieElement
from OTLMOW.OTLModel.Datatypes.BooleanField import BooleanField
from OTLMOW.OTLModel.Datatypes.KlDamwandMateriaal import KlDamwandMateriaal
from OTLMOW.OTLModel.Data... | [
2,
19617,
28,
40477,
12,
23,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,
13,
14881,
9487,
274,
13,
2394,
43,
8086,
822,
84,
315,
1330,
440,
14990,
8086,
822,
84,
315,
198,
6738,
440,
14990,
44,
3913,
13,
2394,
43,
17633,... | 2.395225 | 754 |
import os
import sys
import time
import click
import logging
import pkg_resources
from livereload import Server, shell
from . import Mambo
from .mambo import PAGE_FORMAT
from .__about__ import *
logging.basicConfig(filename='./error.log', level=logging.ERROR, format='%(asctime)s %(levelname)s %(name)s %(message)s')
... | [
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
3904,
198,
11748,
18931,
198,
11748,
279,
10025,
62,
37540,
198,
6738,
2107,
260,
2220,
1330,
9652,
11,
7582,
198,
6738,
764,
1330,
337,
22651,
198,
6738,
764,
76,
22651... | 2.245255 | 2,687 |
import os
from cloudshell.cm.ansible.domain.cancellation_sampler import CancellationSampler
from cloudshell.cm.ansible.domain.http_request_service import HttpRequestService
from file_system_service import FileSystemService
from logging import Logger
from models import HttpAuth
| [
11748,
28686,
198,
198,
6738,
6279,
29149,
13,
11215,
13,
504,
856,
13,
27830,
13,
66,
590,
297,
341,
62,
37687,
20053,
1330,
43780,
297,
341,
16305,
20053,
198,
6738,
6279,
29149,
13,
11215,
13,
504,
856,
13,
27830,
13,
4023,
62,
2... | 3.733333 | 75 |
"""
Cross validation functions supporting both MultichannelPipeline and
scikit-learn predictors.
"""
import numpy as np
import scipy.sparse as sp
from sklearn.metrics import balanced_accuracy_score, explained_variance_score
from sklearn.metrics import roc_auc_score
from sklearn.preprocessing import LabelEncoder
from ... | [
37811,
198,
21544,
21201,
5499,
6493,
1111,
7854,
488,
4276,
47,
541,
4470,
290,
198,
36216,
15813,
12,
35720,
4331,
669,
13,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
82,
29572,
355,
599,
198,... | 2.162031 | 8,054 |
# Copyright Contributors to the Rez project
#
# 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 ... | [
2,
15069,
25767,
669,
284,
262,
47753,
1628,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2... | 3.231511 | 311 |
# HTK Imports
from htk.apps.cpq.utils.accounting import get_invoice_years
from htk.apps.cpq.utils.accounting import get_receivables_by_year
from htk.apps.cpq.utils.crypto import compute_cpq_code
from htk.apps.cpq.utils.crypto import compute_cpq_code_check_hash
from htk.apps.cpq.utils.crypto import is_valid_cpq_code_che... | [
2,
7154,
42,
1846,
3742,
198,
6738,
289,
30488,
13,
18211,
13,
13155,
80,
13,
26791,
13,
23317,
278,
1330,
651,
62,
16340,
2942,
62,
19002,
198,
6738,
289,
30488,
13,
18211,
13,
13155,
80,
13,
26791,
13,
23317,
278,
1330,
651,
62,
... | 2.623288 | 146 |
import os
from dotenv import load_dotenv
load_dotenv()
# Application
MAXIMUM_CONFIRMATION_CHECKS = 20
# thenewboston
BANK_IP = '54.183.16.194'
BANK_PROTOCOL = 'http'
BOT_ACCOUNT_NUMBER = '598428d3a9df5423aab3e593b5d1b5f056b9fa353607fccb1aa76385cf233851'
# Discord
DISCORD_TOKEN = os.getenv('DISCORD_TOKEN')
# Mongo... | [
11748,
28686,
198,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
198,
2220,
62,
26518,
24330,
3419,
198,
198,
2,
15678,
198,
22921,
3955,
5883,
62,
10943,
39776,
44,
6234,
62,
50084,
50,
796,
1160,
198,
198,
2,
788,
413,... | 2.12973 | 185 |
"""
CS241 Team Activity 4
Written by Chad Macbeth
"""
| [
37811,
198,
7902,
28872,
4816,
24641,
604,
220,
220,
198,
25354,
416,
19800,
4100,
65,
2788,
198,
37811,
628,
220,
220,
220,
628
] | 2.695652 | 23 |
"""Constants for user privileges in channels.
Privilege levels
================
Historically, there were two user privileges in channels:
* :data:`OP`: channel operator, or chanop, set and unset by ``+o`` and ``-o``
* :data:`VOICE`: the privilege to send messages to a channel with the
``+m`` mode, set and unset by... | [
37811,
34184,
1187,
329,
2836,
18850,
287,
9619,
13,
198,
198,
20184,
41866,
2974,
198,
4770,
198,
198,
13749,
26847,
11,
612,
547,
734,
2836,
18850,
287,
9619,
25,
198,
198,
9,
1058,
7890,
25,
63,
3185,
63,
25,
6518,
10088,
11,
393... | 3.132498 | 1,117 |
import json
import requests
class Optimizely:
""" A Python wrapper around the Optimizely REST API
Attributes
_token (str): The Optimizely API token passe in the class constructor.
_api_base_url (str): The Base URL for the Optimizely API. Hardcoded as
it is unlikely to change, but ... | [
11748,
33918,
198,
11748,
7007,
628,
198,
4871,
30011,
1096,
306,
25,
198,
220,
220,
220,
37227,
317,
11361,
29908,
1088,
262,
30011,
1096,
306,
30617,
7824,
628,
220,
220,
220,
49213,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
300... | 2.530934 | 1,778 |
import application.models
from application.controller.auth import validate_username
from flask_login import logout_user
| [
198,
11748,
3586,
13,
27530,
198,
6738,
3586,
13,
36500,
13,
18439,
1330,
26571,
62,
29460,
198,
6738,
42903,
62,
38235,
1330,
2604,
448,
62,
7220,
198
] | 4.481481 | 27 |
try:
import numpy as np
except ImportError:
raise Exception('This plugin requires the numpy library, which failed to import. \
Install the python3 version of numpy.')
import tkinter as tk
import tkinter.ttk as ttk
import tkinter.colorchooser as tkcc
import plugin
| [
28311,
25,
198,
197,
11748,
299,
32152,
355,
45941,
198,
16341,
17267,
12331,
25,
198,
197,
40225,
35528,
10786,
1212,
13877,
4433,
262,
299,
32152,
5888,
11,
543,
4054,
284,
1330,
13,
3467,
198,
197,
15798,
262,
21015,
18,
2196,
286,
... | 3.25 | 84 |
from django_tgbot.decorators import processor
from django_tgbot.state_manager import message_types, update_types
from django_tgbot.types.update import Update
from Bot.bot import state_manager, TelegramBot
from Bot.models import TelegramState
from Bot.BotSetting import ReportChannel
from Loan.models import Loan
from ..... | [
6738,
42625,
14208,
62,
25297,
13645,
13,
12501,
273,
2024,
1330,
12649,
198,
6738,
42625,
14208,
62,
25297,
13645,
13,
5219,
62,
37153,
1330,
3275,
62,
19199,
11,
4296,
62,
19199,
198,
6738,
42625,
14208,
62,
25297,
13645,
13,
19199,
1... | 2.922535 | 284 |
import numpy as np
import matplotlib.pyplot as plt
def plot_grad_field(field, occupancy_grid):
"""Plots the gradient field of the np.array of pixels given by field"""
eps = 1e-6
N, M = field.shape
# matrix for the x and y coordinates in every point:
x, y = np.zeros((N, M)), np.zeros((N, M)) ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198,
4299,
7110,
62,
9744,
62,
3245,
7,
3245,
11,
42498,
62,
25928,
2599,
198,
220,
220,
220,
37227,
3646,
1747,
262,
31312,
2214,
286,
... | 2.122449 | 392 |