content stringlengths 1 1.05M | input_ids listlengths 1 883k | ratio_char_token float64 1 22.9 | token_count int64 1 883k |
|---|---|---|---|
# Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
#
# 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, mo... | [
2,
15069,
357,
66,
8,
2813,
12995,
50,
16367,
47,
32678,
329,
262,
22835,
19246,
4816,
198,
2,
220,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
286,
428,
198,
2,
3788,
290,
3917... | 3.859327 | 327 |
import sys
import numpy as np
# EOF: detector.py
| [
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
412,
19238,
25,
31029,
13,
9078,
220,
198
] | 2.684211 | 19 |
number_int = int("32");
number_float= float(32);
number_complex = complex(3222342332432435435345324435324523423);
print(type(number_int),": ",number_int);
print(type(number_float),": ",number_float);
print(type(number_complex),": ",number_complex); | [
17618,
62,
600,
796,
493,
7203,
2624,
15341,
198,
17618,
62,
22468,
28,
12178,
7,
2624,
1776,
198,
17618,
62,
41887,
796,
3716,
7,
37283,
24409,
25429,
26660,
1731,
32182,
2327,
27712,
18,
25707,
33319,
22995,
24409,
1954,
1776,
198,
19... | 2.929412 | 85 |
#!/usr/bin/env python3
import unittest
import kitty
from kitty import uncomfy_checker
import mock
if __name__ == '__main__':
unittest.main() | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
555,
715,
395,
198,
11748,
479,
9760,
198,
6738,
479,
9760,
1330,
8820,
24928,
62,
9122,
263,
198,
11748,
15290,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,... | 2.722222 | 54 |
from sympy.abc import s
from sympy.physics.control.lti import TransferFunction
from sympy.physics.control.control_plots import ramp_response_plot
tf1 = TransferFunction(s, (s+4)*(s+8), s)
ramp_response_plot(tf1, upper_limit=2) # doctest: +SKIP
| [
6738,
10558,
88,
13,
39305,
1330,
264,
201,
198,
6738,
10558,
88,
13,
746,
23154,
13,
13716,
13,
2528,
72,
1330,
20558,
22203,
201,
198,
6738,
10558,
88,
13,
746,
23154,
13,
13716,
13,
13716,
62,
489,
1747,
1330,
10454,
62,
26209,
6... | 2.642105 | 95 |
"""
Main command line interface to the pynorare package.
"""
import sys
import pathlib
import contextlib
from cldfcatalog import Config, Catalog
from clldutils.clilib import register_subcommands, get_parser_and_subparsers, ParserError, PathType
from clldutils.loglib import Logging
from pyconcepticon import Concepticon... | [
37811,
198,
13383,
3141,
1627,
7071,
284,
262,
279,
2047,
273,
533,
5301,
13,
198,
37811,
198,
11748,
25064,
198,
11748,
3108,
8019,
198,
11748,
4732,
8019,
198,
198,
6738,
269,
335,
69,
9246,
11794,
1330,
17056,
11,
44515,
198,
6738,
... | 3.089041 | 146 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
"""
Evaluate recommendations.
"""
import config
from collections import defaultdict
| [
37811,
198,
36,
2100,
4985,
10763,
13,
198,
37811,
198,
11748,
4566,
198,
6738,
17268,
1330,
4277,
11600,
198
] | 4.421053 | 19 |
import os
import cv2
import time
import argparse
import torch
import warnings
import numpy as np
from detector import build_detector
from deep_sort import build_tracker
from utils.draw import draw_boxes
from utils.parser import get_config
from utils.log import get_logger
from utils.io import write_results
from numpy ... | [
11748,
28686,
198,
11748,
269,
85,
17,
198,
11748,
640,
198,
11748,
1822,
29572,
198,
11748,
28034,
198,
11748,
14601,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
31029,
1330,
1382,
62,
15255,
9250,
198,
6738,
2769,
62,
30619,
1... | 2.714286 | 231 |
import numpy as onp
import casadi as cas
def length(array) -> int:
"""
Returns the length of an 1D-array-like object.
Args:
array:
Returns:
"""
try:
return len(array)
except TypeError: # array has no function len() -> either float, int, or CasADi type
try:
... | [
11748,
299,
32152,
355,
319,
79,
198,
11748,
6124,
9189,
355,
6124,
628,
198,
198,
4299,
4129,
7,
18747,
8,
4613,
493,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
16409,
262,
4129,
286,
281,
352,
35,
12,
18747,
12,
2339,
21... | 2.229839 | 248 |
# -*- coding: utf-8 -*-
__author__ = 'eeneku'
from main_menu import MainMenu
from world_map import WorldMap
from local_map import LocalMap
__all__ = [MainMenu, WorldMap, LocalMap] | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
705,
6429,
988,
84,
6,
198,
198,
6738,
1388,
62,
26272,
1330,
8774,
23381,
198,
6738,
995,
62,
8899,
1330,
2159,
13912,
198,
6738,
1957,
62,
8899,... | 2.828125 | 64 |
# Generated by Django 2.2.5 on 2019-10-22 07:03
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
20,
319,
13130,
12,
940,
12,
1828,
8753,
25,
3070,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
142... | 3.04918 | 61 |
"""
Payin API
"""
from dataclasses import dataclass
from typing import Union
from api_payin_model import (
PayinAdjustPaymentRequest,
PayinCancelRequest,
PayinCancelResponse,
PayinCaptureRequest,
PayinCaptureResponse,
PayinMandateRequest,
PayinMandateResponse,
PayinOrderDetailsRequest,... | [
37811,
198,
19197,
259,
7824,
198,
37811,
198,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
19720,
1330,
4479,
198,
198,
6738,
40391,
62,
15577,
259,
62,
19849,
1330,
357,
198,
220,
220,
220,
7119,
259,
39668,
19197,
... | 2.852273 | 264 |
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from fdadb.models import MedicationName, MedicationNDC, MedicationStrength
| [
6738,
1334,
62,
30604,
13,
50188,
1330,
9575,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
198,
6738,
277,
47984,
65,
13,
27530,
1330,
2019,
3299,
5376,
11,
2019,
3299,
8575,
34,
11,
2019,
3299,
45027,
628
... | 3.904762 | 42 |
#!/usr/bin/env python
""" Copyright 2020 Zhao HG
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, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
15069,
12131,
29436,
48698,
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,
... | 2.603015 | 1,393 |
from flask import Flask, request
from twilio.twiml.voice_response import VoiceResponse, Gather
import datetime
import os
import json
import http.client
app = Flask(__name__)
allowUntil = datetime.datetime.now()
# Fetch env vars
whitelisted_numbers = os.environ['WHITELISTED_NUMBERS'].split(",") # Numbers allowed to d... | [
6738,
42903,
1330,
46947,
11,
2581,
198,
6738,
665,
346,
952,
13,
4246,
320,
75,
13,
38888,
62,
26209,
1330,
15282,
31077,
11,
402,
1032,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
2638,
13,
16366,
198,
... | 2.480176 | 681 |
import tkinter as tk
from tkinter import font as tkfont, ttk
import logging as log
import sys
from cx_Oracle import DatabaseError
from GUI_Pages.BasicPage import TitlePage
from Utilities.Cipher import Cipher, get_hash
FORMAT = '[%(asctime)s] [%(levelname)s] : %(message)s'
log.basicConfig(stream=sys.stdout, level=lo... | [
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
10369,
355,
256,
74,
10331,
11,
256,
30488,
198,
198,
11748,
18931,
355,
2604,
198,
11748,
25064,
198,
198,
6738,
43213,
62,
48625,
1330,
24047,
12331,
198,
198,
6738... | 2.940171 | 117 |
from bert_hierarchy_extractor.datasets.train_dataset import TrainHierarchyExtractionDataset
from bert_hierarchy_extractor.datasets.utils import cudafy
from bert_hierarchy_extractor.logging.utils import log_metrics
import numpy as np
from torch.utils.data import DataLoader
from transformers import AdamW, get_linear_sche... | [
6738,
275,
861,
62,
71,
959,
9282,
62,
2302,
40450,
13,
19608,
292,
1039,
13,
27432,
62,
19608,
292,
316,
1330,
16835,
39,
959,
9282,
11627,
7861,
27354,
292,
316,
198,
6738,
275,
861,
62,
71,
959,
9282,
62,
2302,
40450,
13,
19608,
... | 3.166667 | 132 |
# Level 2 of pythonchallenge.com!
# Challenge: within the source code of this level, there is a
# set of jumbled characters. Within these characters, find the
# letters and join them together to find the correct url.
from solution_framework import Solution
import requests
# to view source code
import re
... | [
201,
198,
2,
5684,
362,
286,
21015,
36747,
3540,
13,
785,
0,
201,
198,
2,
13879,
25,
1626,
262,
2723,
2438,
286,
428,
1241,
11,
612,
318,
257,
201,
198,
2,
900,
286,
474,
11137,
3435,
13,
12511,
777,
3435,
11,
1064,
262,
220,
20... | 3.034749 | 259 |
# Generated by Django 3.1.7 on 2021-05-10 07:38
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import saleor.core.utils.json_serializer
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
22,
319,
33448,
12,
2713,
12,
940,
8753,
25,
2548,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
142... | 3.046154 | 65 |
import cv2
import os
import sqlite3
import dlib
import re,time
from playsound import playsound
import pyttsx3
cam = cv2.VideoCapture(0)
cam.set(3, 640) # set video width
cam.set(4, 480) # set video height
face_detector = cv2.CascadeClassifier('C:/Users/ACER/Desktop/PROJECT ALL RESOURCE/PROJECT ALL RESOURCE/F... | [
11748,
269,
85,
17,
201,
198,
11748,
28686,
201,
198,
11748,
44161,
578,
18,
201,
198,
11748,
288,
8019,
201,
198,
11748,
302,
11,
2435,
201,
198,
6738,
5341,
633,
1330,
5341,
633,
201,
198,
11748,
12972,
83,
912,
87,
18,
220,
201,
... | 2.58467 | 1,122 |
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import *
from sqlalchemy import *
from sqlalchemy.sql import func, or_
from sqlalchemy.types import TIMESTAMP
from sqlalchemy.ext.hybrid import hybrid_property
from time import time
import markupsafe
from sqlalchemy.ext.associationproxy import ... | [
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
876,
62,
8692,
198,
6738,
44161,
282,
26599,
13,
579,
1330,
1635,
198,
6738,
44161,
282,
26599,
1330,
1635,
198,
6738,
44161,
282,
26599,
13,
25410,
1330,
25439,
... | 2.682266 | 406 |
import multiprocessing as mp
# mp.set_start_method('spawn')
import math
import os
import pickle
import random
from glob import glob
from os import path
import albumentations as alb
import cv2
import numpy as np
import skimage
import torch
import imageio
from albumentations.pytorch import ToTensorV2
from skimage.color... | [
11748,
18540,
305,
919,
278,
355,
29034,
198,
2,
29034,
13,
2617,
62,
9688,
62,
24396,
10786,
48183,
11537,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
4738,
198,
6738,
15095,
1330,
15095,
198,
6738,
28... | 2.089899 | 2,069 |
from fractions import Fraction
num1 = Fraction(1, 3)
num2 = Fraction(1, 7)
num1 * num2 # Fraction(1, 21)
| [
198,
6738,
49876,
1330,
376,
7861,
198,
22510,
16,
796,
376,
7861,
7,
16,
11,
513,
8,
198,
22510,
17,
796,
376,
7861,
7,
16,
11,
767,
8,
198,
22510,
16,
1635,
997,
17,
220,
1303,
376,
7861,
7,
16,
11,
2310,
8,
198
] | 2.431818 | 44 |
from io import StringIO
from pathlib import Path
import pytest
from toxn.config import from_toml
| [
6738,
33245,
1330,
10903,
9399,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
8293,
77,
13,
11250,
1330,
422,
62,
39532,
75,
628,
198
] | 3.366667 | 30 |
from constantMonthlyModel import ConstantMonthlyModel
from constantModel import ConstantModel
from twoParameterModel import TwoParameterModel
from threeParameterModel import ThreeParameterModel
from anyModel import AnyModelFactory
from schoolModel import SchoolModel, SchoolModelFactory
from recurrentModel import Recurr... | [
6738,
6937,
31948,
306,
17633,
1330,
20217,
31948,
306,
17633,
198,
6738,
6937,
17633,
1330,
20217,
17633,
198,
6738,
734,
36301,
17633,
1330,
4930,
36301,
17633,
198,
6738,
1115,
36301,
17633,
1330,
7683,
36301,
17633,
198,
6738,
597,
1763... | 5.203883 | 103 |
host = 'https://api.gotinder.com'
#leave tinder_token empty if you don't use phone verification
tinder_token = "0bb19e55-5f12-4a23-99df-8e258631105b"
# Your real config file should simply be named "config.py"
# Just insert your fb_username and fb_password in string format
# and the fb_auth_token.py module will do the ... | [
4774,
796,
705,
5450,
1378,
15042,
13,
23442,
5540,
13,
785,
6,
198,
2,
47408,
256,
5540,
62,
30001,
6565,
611,
345,
836,
470,
779,
3072,
19637,
198,
83,
5540,
62,
30001,
796,
366,
15,
11848,
1129,
68,
2816,
12,
20,
69,
1065,
12,
... | 2.936937 | 111 |
from django.test.runner import DiscoverRunner
from io import StringIO
from logging import StreamHandler, getLogger
from unittest import TextTestRunner, TextTestResult
class SimoneRunner(DiscoverRunner):
test_runner = SimoneTestRunner
| [
6738,
42625,
14208,
13,
9288,
13,
16737,
1330,
29704,
49493,
198,
6738,
33245,
1330,
10903,
9399,
198,
6738,
18931,
1330,
13860,
25060,
11,
651,
11187,
1362,
198,
6738,
555,
715,
395,
1330,
8255,
14402,
49493,
11,
8255,
14402,
23004,
628,... | 3.983607 | 61 |
__all__ = ["fibo"] | [
834,
439,
834,
796,
14631,
69,
26762,
8973
] | 2.25 | 8 |
row = [-1, -1, -1, 0, 0, 1, 1, 1]
col = [-1, 0, 1, -1, 1, -1, 0, 1]
if __name__ == '__main__':
mat = [
['D', 'E', 'H', 'X', 'B'],
['A', 'O', 'G', 'P', 'E'],
['D', 'D', 'C', 'F', 'D'],
['E', 'B', 'E', 'A', 'S'],
['C', 'D', 'Y', 'E', 'N']
]
ch = '... | [
198,
808,
796,
25915,
16,
11,
532,
16,
11,
532,
16,
11,
657,
11,
657,
11,
352,
11,
352,
11,
352,
60,
198,
4033,
796,
25915,
16,
11,
657,
11,
352,
11,
532,
16,
11,
352,
11,
532,
16,
11,
657,
11,
352,
60,
198,
220,
198,
220,... | 1.796935 | 261 |
__all__ = ('get_session_list',
'get_animal_list',
'get_event',
'get_tag_pattern',
'get_pattern_animalList',
'get_current_animals')
import datetime
import logging
from .. import Root
from .. import File
from .. import Profile
from ..Profile import EventProfile
from... | [
834,
439,
834,
796,
19203,
1136,
62,
29891,
62,
4868,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1136,
62,
41607,
62,
4868,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
1136,
62,
15596,
... | 2.621408 | 1,775 |
from random import choice
from copy import deepcopy
from game_data import GameData
from agents import Agent
import numpy as np
import random
import pickle
import pandas as pd
| [
6738,
4738,
1330,
3572,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
983,
62,
7890,
1330,
3776,
6601,
198,
6738,
6554,
1330,
15906,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
11748,
2298,
293,
198,
11748,
19798,
292,
3... | 3.519231 | 52 |
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
from os import curdir, sep
import threading
import urlparse
import mimetypes
PORT_NUMBER = 8080
VERSION_NUMBER = '1.0.0'
if __name__ == '__main__':
server = ThreadedHTTPServer(('', PORT_NUMBER), Handler)
print 'Sta... | [
6738,
7308,
6535,
28820,
18497,
1330,
38288,
18497,
11,
7308,
40717,
18453,
25060,
198,
6738,
47068,
10697,
1330,
14122,
278,
35608,
818,
198,
6738,
28686,
1330,
1090,
15908,
11,
41767,
198,
11748,
4704,
278,
198,
11748,
19016,
29572,
198,
... | 2.968553 | 159 |
from pyteal import *
ADMIN_KEY = Bytes("admin")
WHITELISTED_KEY = Bytes("whitelisted")
REQUESTS_BALANCE_KEY = Bytes("requests_balance")
MAX_BUY_AMOUNT = Int(1000000000)
MIN_BUY_AMOUNT = Int(10000000)
REQUESTS_SELLER = Addr("N5ICVTFKS7RJJHGWWM5QXG2L3BV3GEF6N37D2ZF73O4PCBZCXP4HV3K7CY")
MARKET_EXCHANGE_NOTE = Bytes("alg... | [
6738,
12972,
660,
282,
1330,
1635,
628,
198,
2885,
23678,
62,
20373,
796,
2750,
4879,
7203,
28482,
4943,
198,
12418,
2043,
3698,
8808,
1961,
62,
20373,
796,
2750,
4879,
7203,
1929,
270,
417,
6347,
4943,
198,
2200,
10917,
1546,
4694,
62,... | 2.187117 | 326 |
"""
Support for Shelly smart home devices.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/shelly/
"""
# pylint: disable=broad-except, bare-except, invalid-name, import-error
from datetime import timedelta
import logging
import time
import as... | [
37811,
201,
198,
15514,
329,
1375,
12810,
4451,
1363,
4410,
13,
201,
198,
201,
198,
1890,
517,
3307,
546,
428,
7515,
11,
3387,
3522,
284,
262,
10314,
379,
201,
198,
5450,
1378,
11195,
12,
562,
10167,
13,
952,
14,
5589,
3906,
14,
709... | 2.127856 | 2,276 |
"""remove unique constraint
Revision ID: 36745fa33987
Revises: 6b7ad8fd60f9
Create Date: 2022-01-06 08:31:55.141039
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "36745fa33987"
down_revision = "6b7ad8fd60f9"
branch_labels = None
depends_on = None
| [
37811,
28956,
3748,
32315,
198,
198,
18009,
1166,
4522,
25,
40884,
2231,
13331,
2091,
44183,
198,
18009,
2696,
25,
718,
65,
22,
324,
23,
16344,
1899,
69,
24,
198,
16447,
7536,
25,
33160,
12,
486,
12,
3312,
8487,
25,
3132,
25,
2816,
... | 2.522124 | 113 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.website_event_track_live.controllers.track_live import EventTrackLiveController
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2142,
286,
10529,
2238,
13,
4091,
38559,
24290,
2393,
329,
1336,
6634,
290,
15665,
3307,
13,
198,
198,
6738,
16298,
2238,
13,
39996,
13,
732,
12485,
62,
15596,
62,
... | 3.3 | 60 |
embed
<drac2>
GVARS = load_json(get_gvar("c1ee7d0f-750d-4f92-8d87-70fa22c07a81"))
CLASSES = [load_json(get_gvar(gvar)) for gvar in GVARS]
DISPLAY = {
"acrobatics": "Acrobatics",
"animalhandling": "Animal Handling",
"athletics": "Athletics",
"arcana": "Arcana",
"deception": "Deception",
"dex": "Dex... | [
20521,
201,
198,
27,
7109,
330,
17,
29,
201,
198,
37094,
27415,
796,
3440,
62,
17752,
7,
1136,
62,
70,
7785,
7203,
66,
16,
1453,
22,
67,
15,
69,
12,
15426,
67,
12,
19,
69,
5892,
12,
23,
67,
5774,
12,
2154,
13331,
1828,
66,
299... | 2.453532 | 1,076 |
################################################################################
##### For Bloomberg ------------------------------------------------------------
##### Can't use this if you're on a Mac :(
################################################################################
from __future__ import print_f... | [
29113,
29113,
14468,
201,
198,
4242,
2,
1114,
15689,
20368,
1783,
10541,
201,
198,
4242,
2,
1680,
470,
779,
428,
611,
345,
821,
319,
257,
4100,
36147,
201,
198,
29113,
29113,
14468,
201,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8... | 3.913725 | 510 |
import os
from typing import Sequence, Union
import numpy as np
import tifffile
from deepcell.applications import Mesmer
from imctools.io.ometiff.ometiffparser import OmeTiffParser
from skimage import measure
from sqlalchemy.orm import Session
from histocat.core.acquisition import service as acquisition_service
from ... | [
11748,
28686,
198,
6738,
19720,
1330,
45835,
11,
4479,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
256,
361,
487,
576,
198,
6738,
2769,
3846,
13,
1324,
677,
602,
1330,
14937,
647,
198,
6738,
545,
310,
10141,
13,
952,
13,
908,... | 3.470588 | 153 |
import math
import numpy as np
import random
import os
from PIL import Image
import pyttsx3
if __name__ == '__main__':
pass
| [
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
12972,
83,
912,
87,
18,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
... | 2.888889 | 45 |
from data_retrieval import *
import emailer
from login.config import Config
from sentiment_analysis import *
import tweepy
import json
| [
6738,
1366,
62,
1186,
380,
18206,
1330,
1635,
198,
11748,
3053,
263,
198,
6738,
17594,
13,
11250,
1330,
17056,
198,
6738,
15598,
62,
20930,
1330,
1635,
198,
11748,
4184,
538,
88,
198,
11748,
33918,
628,
628,
628,
628
] | 3.736842 | 38 |
"""
This tutorial shows how to generate adversarial examples using FGSM
and train a model using adversarial training with TensorFlow.
It is very similar to mnist_tutorial_keras_tf.py, which does the same
thing but with a dependence on keras.
The original paper can be found at:
https://arxiv.org/abs/1412.6572
"""
from _... | [
37811,
198,
1212,
11808,
2523,
703,
284,
7716,
16907,
36098,
6096,
1262,
25503,
12310,
198,
392,
4512,
257,
2746,
1262,
16907,
36098,
3047,
351,
309,
22854,
37535,
13,
198,
1026,
318,
845,
2092,
284,
285,
77,
396,
62,
83,
44917,
62,
6... | 2.537903 | 1,240 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# by [jackhanyuan](https://github.com/jackhanyuan) 07/03/2022
import argparse
import copy
import glob
import os
import re
import sys
import time
from pathlib import Path
import cv2
import acl
import torch
import numpy as np
from PIL import Image
import torch.nn.functiona... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
416,
685,
19650,
71,
1092,
7258,
16151,
5450,
1378,
12567,
13,
785,
14,
19650,
71,
1092,
7258,
8,
8753,
14,
... | 2.177933 | 1,287 |
import os
with open("./simple_graph.txt", "r") as f:
N = int(f.readline())
edges = []
while True:
line = f.readline().strip()
if line == None or len(line) == 0:
break
line = line.split(" ")
edges.append([int(line[0]), int(line[1])])
con = []
for i in range(N):
... | [
11748,
28686,
198,
198,
4480,
1280,
7,
1911,
14,
36439,
62,
34960,
13,
14116,
1600,
366,
81,
4943,
355,
277,
25,
198,
220,
220,
220,
399,
796,
493,
7,
69,
13,
961,
1370,
28955,
198,
220,
220,
220,
13015,
796,
17635,
198,
220,
220,... | 2.043053 | 511 |
# coding=utf-8
"""
__title__ = ''
__file__ = ''
__author__ = 'tianmuchunxiao'
__mtime__ = '2019/7/4'
"""
import requests
import datetime
import pandas as pd
from io import StringIO
TODAY = datetime.date.strftime(datetime.date.today(), '%Y%m%d')
| [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
834,
7839,
834,
796,
10148,
198,
834,
7753,
834,
796,
10148,
198,
834,
9800,
834,
796,
705,
83,
666,
29482,
403,
87,
13481,
6,
198,
834,
76,
2435,
834,
796,
705,
23344,
14,
22,
14,
1... | 2.505051 | 99 |
import datetime
import logging
import pytz
import socket
logger = logging.getLogger('common')
def get_fqdn(ip_address):
"""
Function that transforms a given IP address into the associated FQDN name
for that host.
:param ip_address: IP address of the remote host.
:return: FQDN name for that host... | [
198,
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
12972,
22877,
198,
11748,
17802,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
10786,
11321,
11537,
628,
198,
4299,
651,
62,
69,
80,
32656,
7,
541,
62,
21975,
2599,
198,
... | 2.729126 | 1,521 |
"""
"""
from evennia import default_cmds
from evennia import CmdSet
| [
37811,
198,
198,
37811,
198,
198,
6738,
772,
18142,
1330,
4277,
62,
28758,
82,
198,
6738,
772,
18142,
1330,
327,
9132,
7248,
628,
628,
198
] | 2.96 | 25 |
"""
Non-cython methods for getting counts and distributions from data.
"""
import numpy as np
try: # cython
from .pycounts import counts_from_data, distribution_from_data
except ImportError: # no cython
from boltons.iterutils import windowed_iter
from collections import Counter, defaultdict
from it... | [
37811,
198,
15419,
12,
948,
400,
261,
5050,
329,
1972,
9853,
290,
24570,
422,
1366,
13,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
28311,
25,
1303,
3075,
400,
261,
628,
220,
220,
220,
422,
764,
9078,
9127,
82,
13... | 2.576687 | 2,445 |
"""
@author: Badita Marin-Georgian
@email: geo.badita@gmail.com
@date: 21.03.2020 00:58
"""
from env_interpretation import Meeting
from env_interpretation.meeting import get_valid_meetings
| [
37811,
198,
220,
220,
220,
2488,
9800,
25,
7772,
5350,
36384,
12,
33428,
666,
198,
220,
220,
220,
2488,
12888,
25,
220,
40087,
13,
14774,
5350,
31,
14816,
13,
785,
198,
220,
220,
220,
2488,
4475,
25,
220,
220,
2310,
13,
3070,
13,
... | 2.723684 | 76 |
# Confidential, Copyright 2020, Sony Corporation of America, All rights reserved.
import copy
import numpy as np
from pandemic_simulator.environment import CityRegistry, Home, GroceryStore, Office, School, Hospital, PopulationParams, \
LocationParams
from pandemic_simulator.script_helpers import make_standard_loc... | [
2,
7326,
35599,
11,
15069,
12131,
11,
10184,
10501,
286,
2253,
11,
1439,
2489,
10395,
13,
198,
11748,
4866,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
19798,
5314,
62,
14323,
8927,
13,
38986,
1330,
2254,
8081,
4592,
11,
... | 2.992674 | 273 |
from libs import *
| [
6738,
9195,
82,
1330,
1635,
201
] | 3.166667 | 6 |
from typing import List
| [
6738,
19720,
1330,
7343,
201
] | 4.8 | 5 |
import pandas as pd
import argparse
badword = ["!", "$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","/","]","^","_","`","{","|","}","~","",""]
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--path', help='the path of file')
... | [
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
1822,
29572,
201,
198,
201,
198,
14774,
4775,
796,
14631,
40754,
17971,
2430,
4,
2430,
5,
2430,
6,
2430,
7,
2430,
8,
2430,
9,
2430,
10,
2430,
553,
553,
12,
2430,
41424,
14,
2430,
2... | 1.805471 | 658 |
from Ipv4_stun.transfer import Transfer
#m=Transfer(address=('172.16.0.156',9080))
m=Transfer(address=('127.0.0.1', 82))
m.run() | [
6738,
314,
79,
85,
19,
62,
301,
403,
13,
39437,
1330,
20558,
201,
198,
201,
198,
2,
76,
28,
43260,
7,
21975,
28,
10786,
23628,
13,
1433,
13,
15,
13,
21599,
3256,
3829,
1795,
4008,
201,
198,
76,
28,
43260,
7,
21975,
28,
10786,
16... | 2.216667 | 60 |
"""season.py: Generates random NJBA season data."""
__author__ = "Matthew Frazier"
__copyright__ = "Copyright 2019, University of Delaware, CISC 637 Database Systems"
__email__ = "matthew@udel.edu"
from datetime import timedelta
import calendar
import csv
'''
Steps to run this project:
1. Create a virtual env a... | [
37811,
6230,
13,
9078,
25,
2980,
689,
4738,
18732,
4339,
1622,
1366,
526,
15931,
198,
198,
834,
9800,
834,
796,
366,
25372,
44145,
1,
198,
834,
22163,
4766,
834,
796,
366,
15269,
13130,
11,
2059,
286,
19603,
11,
36159,
34,
718,
2718,
... | 2.047764 | 1,968 |
import numpy as np
import pandas as pd
import pace
from pace.definitions import amino_acids, builtin_aa_encodings, builtin_allele_similarities
from pace.sklearn import create_one_hot_encoder
from pkg_resources import resource_stream
def get_allele_similarity_mat(allele_similarity_name):
"""
Get a ... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198,
11748,
8761,
201,
198,
6738,
8761,
13,
4299,
50101,
1330,
23206,
62,
330,
2340,
11,
3170,
259,
62,
7252,
62,
12685,
375,
654,
11,
3170,
259,
62,
676... | 2.748344 | 906 |
import tkinter as tk
from tkinter import *
from tkinter import messagebox
from tkinter.simpledialog import askinteger
from protocol.secure_transmission.secure_channel import establish_secure_channel_to_server
from protocol.message_type import MessageType
from protocol.data_conversion.from_byte import deserialize_messag... | [
11748,
256,
74,
3849,
355,
256,
74,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
3275,
3524,
198,
6738,
256,
74,
3849,
13,
14323,
10137,
498,
519,
1330,
1265,
41433,
198,
6738,
8435,
13,
22390,
62,
7645,
341... | 3.848485 | 99 |
#!/usr/bin/env python
"""Light weight python client for Akismet API."""
__title__ = 'akispy'
__version__ = '0.2'
__author__ = 'Ryan Leland'
__copyright__ = 'Copyright 2012 Ryan Leland'
import http.client, urllib.request, urllib.parse, urllib.error
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
15047,
3463,
21015,
5456,
329,
9084,
1042,
316,
7824,
526,
15931,
198,
198,
834,
7839,
834,
796,
705,
461,
8802,
88,
6,
198,
834,
9641,
834,
796,
705,
15,
13,
17,
6,
19... | 2.758242 | 91 |
"""
This script is used to compute mffc features for target task datasets.
Warning: Need manual editing for switching datasets
"""
import os
import librosa
import soundfile as sf
import numpy as np
from tqdm import tqdm
from pathlib import Path
FILES_LOCATION = '../data/UrbanSound8K/audio'
FILES_LOCATION = '../data/G... | [
37811,
198,
1212,
4226,
318,
973,
284,
24061,
285,
487,
66,
3033,
329,
2496,
4876,
40522,
13,
198,
20361,
25,
10664,
10107,
12857,
329,
15430,
40522,
198,
37811,
198,
11748,
28686,
198,
11748,
9195,
4951,
64,
198,
11748,
2128,
7753,
355... | 2.283422 | 374 |
import argparse
import astunparse
import sys
from . import check
parser = argparse.ArgumentParser()
parser.add_argument("file", nargs="?", type=argparse.FileType("r"),
default=sys.stdin)
args = parser.parse_args()
poisoned = check(args.file.read())
print("Possible SQL injections:")
for p in poi... | [
11748,
1822,
29572,
198,
11748,
6468,
403,
29572,
198,
11748,
25064,
198,
198,
6738,
764,
1330,
2198,
198,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
7203,
7753,
1600,
299,
22046,
2625,
... | 2.678082 | 146 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
a='Du hast mich'
b='Du, du hast'+'\n'+a
c=a+' gefragt'
d=j([b,b,''])
e=j(['Willst du bis der Tod euch scheidet','Treurig sein fr alle Tage?','Nein, nein!',''])
f=j([d,b,a,'',j([c,c,c,'Und ich hab nichts gesagt','']),e,e])
print j([d,f,f,e]) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
64,
11639,
35660,
19338,
285,
488,
6,
198,
65,
11639,
35660,
11,
7043,
19338,
6,
10,
6,
59,
77,
6,
10,
64,
198,
6... | 1.833333 | 156 |
import pyuvm_unittest
from pyuvm import *
| [
11748,
12972,
84,
14761,
62,
403,
715,
395,
198,
6738,
12972,
84,
14761,
1330,
1635,
628
] | 2.6875 | 16 |
from django.db import models
from django.core.validators import MinValueValidator
from .nodo import Nodo | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
7295,
13,
12102,
2024,
1330,
1855,
11395,
47139,
1352,
198,
6738,
764,
77,
24313,
1330,
399,
24313
] | 3.586207 | 29 |
import asyncio
from typing import Sequence
from async_service import Service, background_asyncio_service
from eth.abc import BlockHeaderAPI
from eth.exceptions import CheckpointsMustBeCanonical
from eth_typing import BlockNumber
from trinity._utils.pauser import Pauser
from trinity.chains.base import AsyncChainAPI
fr... | [
11748,
30351,
952,
198,
6738,
19720,
1330,
45835,
198,
198,
6738,
30351,
62,
15271,
1330,
4809,
11,
4469,
62,
292,
13361,
952,
62,
15271,
198,
6738,
4555,
13,
39305,
1330,
9726,
39681,
17614,
198,
6738,
4555,
13,
1069,
11755,
1330,
6822... | 3.231579 | 285 |
"""
A federated learning client using SCAFFOLD.
Reference:
Karimireddy et al., "SCAFFOLD: Stochastic Controlled Averaging for Federated Learning"
(https://arxiv.org/pdf/1910.06378.pdf)
"""
import os
from dataclasses import dataclass
import torch
from plato.clients import simple
| [
37811,
198,
32,
28062,
515,
4673,
5456,
1262,
6374,
32,
5777,
15173,
13,
198,
198,
26687,
25,
198,
198,
37753,
320,
1202,
9892,
2123,
435,
1539,
366,
6173,
32,
5777,
15173,
25,
520,
5374,
3477,
43253,
317,
332,
3039,
329,
35089,
515,
... | 2.989583 | 96 |
import asyncio
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent.parent))
from bilireq.auth import Auth
from bilireq.dynamic import get_user_dynamics, get_followed_dynamics_update_info, get_followed_new_dynamics, get_followed_history_dynamics
from bilireq.live import get_rooms_info_by_ids
... | [
11748,
30351,
952,
198,
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
17597,
13,
6978,
13,
33295,
7,
2536,
7,
15235,
7,
834,
7753,
834,
737,
8000,
13,
8000,
4008,
198,
198,
6738,
47027,
557,
80,
13,
18439,
1330,
26828,
... | 2.794595 | 185 |
import re
import numpy
def read_pgm(filename, byteorder='>'):
"""Return image data from a raw PGM file as numpy array.
Format specification: http://netpbm.sourceforge.net/doc/pgm.html
"""
with open(filename, 'rb') as f:
buffer = f.read()
try:
header, width, height, maxval = re.sea... | [
11748,
302,
198,
11748,
299,
32152,
198,
198,
4299,
1100,
62,
6024,
76,
7,
34345,
11,
18022,
2875,
11639,
29,
6,
2599,
198,
220,
220,
220,
37227,
13615,
2939,
1366,
422,
257,
8246,
350,
15548,
2393,
355,
299,
32152,
7177,
13,
628,
2... | 1.928447 | 573 |
from .config import RecconSpanExtractionConfig
from .tokenization import RecconSpanExtractionTokenizer
from .modeling import RecconSpanExtractionModel
from .preprocess import RecconSpanExtractionPreprocessor
from .postprocess import RecconSpanExtractionPostprocessor
from .train import train
from .eval import evaluate
f... | [
6738,
764,
11250,
1330,
797,
535,
261,
4561,
272,
11627,
7861,
16934,
198,
6738,
764,
30001,
1634,
1330,
797,
535,
261,
4561,
272,
11627,
7861,
30642,
7509,
198,
6738,
764,
4666,
10809,
1330,
797,
535,
261,
4561,
272,
11627,
7861,
17633... | 3.724771 | 109 |
'''Don't change the basic param'''
import os
'''prog path'''
config_path = os.path.split(__file__)[0]
marktemp_path = os.path.join(config_path,"markenv.tex")
'''tools setting'''
image_download_retry_time = 10
#
# wait_manully_if_all_failed = False
# tex
give_rele_path = True
| [
7061,
6,
3987,
470,
1487,
262,
4096,
5772,
7061,
6,
198,
11748,
28686,
198,
7061,
6,
1676,
70,
3108,
7061,
6,
198,
11250,
62,
6978,
796,
28686,
13,
6978,
13,
35312,
7,
834,
7753,
834,
38381,
15,
60,
198,
4102,
29510,
62,
6978,
796... | 2.583333 | 108 |
# Questo 12. Construa uma funo que receba uma string como parmetro
# e devolva outra string com os carateres emba- ralhados. Por exemplo:
# se funo receber a palavra python, pode retornar npthyo, ophtyn ou
# qualquer outra combinao possvel, de forma aleatria. Padronize em
# sua funo que todos os caracteres sero dev... | [
2,
6785,
78,
1105,
13,
4757,
622,
64,
334,
2611,
1257,
78,
8358,
1407,
7012,
334,
2611,
4731,
401,
78,
1582,
4164,
305,
220,
198,
2,
304,
1614,
349,
6862,
503,
430,
4731,
401,
28686,
1097,
378,
411,
4072,
64,
12,
374,
282,
18108,
... | 2.547368 | 190 |
# Numpy
# NumPy: https://numpy.org/doc/stable/
# NumPy https://numpy.org/devdocs/reference/ufuncs.html
# NumPy - / .
#
# . , (), ,
# . . list,
# numpy-, . .
# numpy , . .
# , numpy-. 60% - numpy 40% - . .
# .
# , , .
# ? ,
# ... | [
2,
399,
32152,
220,
198,
198,
2,
220,
220,
31835,
20519,
25,
3740,
1378,
77,
32152,
13,
2398,
14,
15390,
14,
31284,
14,
198,
2,
220,
220,
220,
31835,
20519,
3740,
1378,
77,
32152,
13,
2398,
14,
7959,
31628,
14,
35790,
14,
3046,
40... | 1.777254 | 18,658 |
from setuptools import setup
with open('README.md','r', encoding='utf-8') as f:
long_description = f.read()
setup(name='submit_hpc',
version='0.1.2',
description='Collection of growing job submission scripts, not to replace workflow specifications.',
url='https://github.com/jlevy44/Submit-HPC',
... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
4480,
1280,
10786,
15675,
11682,
13,
9132,
41707,
81,
3256,
21004,
11639,
40477,
12,
23,
11537,
355,
277,
25,
198,
220,
220,
220,
220,
220,
890,
62,
11213,
796,
277,
13,
961,
3419,
198,
40406,... | 2.523297 | 279 |
#! /usr/bin/env python
import tensorflow as tf
import tensorflow.contrib.slim as slim
seed = 0
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
13,
3642,
822,
13,
82,
2475,
355,
18862,
198,
198,
28826,
796,
657,
628,
628,
628,
628,
628,
628,
628,
628... | 2.52 | 50 |
import tensorflow as tf
import itertools
import numpy as np
FLAGS = tf.flags.FLAGS
def auto_name(name):
"""Append number to variable name to make it unique.
Inputs:
name: Start of variable name.
Returns:
Full variable name with number afterwards to make it un... | [
11748,
11192,
273,
11125,
355,
48700,
201,
198,
201,
198,
11748,
340,
861,
10141,
201,
198,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
38948,
50,
796,
48700,
13,
33152,
13,
38948,
50,
201,
198,
201,
198,
201,
198,
... | 2.313011 | 1,345 |
import os
import unittest
from camelback.lexer import Lexer
| [
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
41021,
1891,
13,
2588,
263,
1330,
17210,
263,
628
] | 3.263158 | 19 |
"""Fixtures and configuration for the test suite."""
from pathlib import Path
import pytest
import vcr
from pycwatch import CryptoWatchClient
BASE_DIR = Path(__file__).parent.absolute()
api_vcr = my_vcr = vcr.VCR(
serializer="yaml",
cassette_library_dir=BASE_DIR.joinpath("vcr_cassettes").as_posix(),
rec... | [
37811,
37,
25506,
290,
8398,
329,
262,
1332,
18389,
526,
15931,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
12972,
9288,
198,
11748,
410,
6098,
198,
198,
6738,
12972,
66,
8340,
1330,
36579,
10723,
11792,
198,
198,
33,
11159,
62... | 2.702532 | 158 |
"""
.. module:: CXResolutionEstimate.py
:platform: Unix
:synopsis: A class for predicting the resolution of a ptychography measurement.
.. moduleauthor:: David Vine <djvine@gmail.com>
"""
import requests
import pdb
import scipy as sp
import numpy as np
import scipy.fftpack as spf
from pylab import *
def rec... | [
37811,
198,
492,
8265,
3712,
327,
55,
4965,
2122,
22362,
1920,
13,
9078,
198,
220,
220,
1058,
24254,
25,
33501,
198,
220,
220,
1058,
28869,
24608,
25,
317,
1398,
329,
25539,
262,
6323,
286,
257,
279,
774,
354,
4867,
15558,
13,
198,
... | 2.491349 | 578 |
# Generated by Django 3.1 on 2020-12-06 09:23
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
319,
12131,
12,
1065,
12,
3312,
7769,
25,
1954,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
import sys
from pyspark.sql import SparkSession, functions, types
from pyspark.sql.functions import date_format
import json
if __name__ == '__main__':
spark = SparkSession.builder.appName('views_in_dow').getOrCreate()
spark.sparkContext.setLogLevel('WARN')
views_in_dow()
| [
11748,
25064,
198,
198,
6738,
279,
893,
20928,
13,
25410,
1330,
17732,
36044,
11,
5499,
11,
3858,
198,
6738,
279,
893,
20928,
13,
25410,
13,
12543,
2733,
1330,
3128,
62,
18982,
198,
11748,
33918,
628,
220,
220,
220,
220,
198,
361,
115... | 2.825243 | 103 |
from flask import Flask
from flask_restful import Api
from elasticapm.contrib.flask import ElasticAPM
from flask_restful_swagger import swagger
from resources import custom_logger
from resources.routes import initialize_routes
import logging
app = Flask(__name__)
app.config.from_object("config.Config")
# Initializing... | [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
2118,
913,
1330,
5949,
72,
198,
6738,
27468,
499,
76,
13,
3642,
822,
13,
2704,
2093,
1330,
48567,
2969,
44,
198,
6738,
42903,
62,
2118,
913,
62,
2032,
7928,
1330,
1509,
7928,
198,
6738,
... | 2.908163 | 196 |
import discord, random
from discord.ext import commands
from discord_slash import cog_ext
from discord_slash.utils.manage_commands import create_option | [
11748,
36446,
11,
4738,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
36446,
62,
6649,
1077,
1330,
43072,
62,
2302,
198,
6738,
36446,
62,
6649,
1077,
13,
26791,
13,
805,
496,
62,
9503,
1746,
1330,
2251,
62,
18076
] | 3.871795 | 39 |
from flask import Flask
from kubernetes.client.rest import ApiException
from pprint import pprint
from kubernetes import client, config
app = Flask(__name__)
if __name__ == "__main__":
app.run(host='0.0.0.0',port=8000)
| [
6738,
42903,
1330,
46947,
198,
6738,
479,
18478,
3262,
274,
13,
16366,
13,
2118,
1330,
5949,
72,
16922,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
6738,
479,
18478,
3262,
274,
1330,
5456,
11,
4566,
198,
1324,
796,
46947,
7,
834,
3672... | 2.848101 | 79 |
i_am_broke = False
if i_am_broke:
print("I am broke.")
else:
print("I am not broke.")
my_bank_account = 1000
if my_bank_account <= 0:
print("I am broke.")
else:
print("I am not broke.")
# equal ==
# less <
# greater >
# not equal !=
# less or equal <=
# greater or equal >=
my_age = 21
if my_age ... | [
72,
62,
321,
62,
7957,
365,
796,
10352,
198,
198,
361,
1312,
62,
321,
62,
7957,
365,
25,
198,
220,
220,
220,
3601,
7203,
40,
716,
6265,
19570,
198,
17772,
25,
198,
220,
220,
220,
3601,
7203,
40,
716,
407,
6265,
19570,
628,
198,
... | 2.483333 | 180 |
print("x")
print("x")
print("x")
| [
4798,
7203,
87,
4943,
198,
4798,
7203,
87,
4943,
198,
4798,
7203,
87,
4943,
628
] | 2.266667 | 15 |
# Generated by Django 2.2.24 on 2021-12-28 20:42
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
1731,
319,
33448,
12,
1065,
12,
2078,
1160,
25,
3682,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.8 | 30 |
from __future__ import annotations
from typing import List, Type
import numpy
# list of numarray data types
integer_types: List[Type] = [
numpy.int8, numpy.uint8, numpy.int16, numpy.uint16,
numpy.int32, numpy.uint32, numpy.int64, numpy.uint64]
float_types: List[Type] = [numpy.float32, numpy.float64]
comple... | [
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
19720,
1330,
7343,
11,
5994,
220,
198,
11748,
299,
32152,
198,
198,
2,
1351,
286,
997,
18747,
1366,
3858,
198,
41433,
62,
19199,
25,
7343,
58,
6030,
60,
796,
685,
198,
220,
220,
... | 2.66875 | 160 |
import torch
import os
import subprocess as sp
from mlutils.pt.training import TrainerBatch
from mlutils.callbacks import Callback
from os import path
import numpy as np
import json
def torch_detach(x):
return x.detach().cpu().numpy()
def save_topics(save_path, vocab, topic_prob, topk=100, logger=None):
... | [
11748,
28034,
198,
11748,
28686,
198,
11748,
850,
14681,
355,
599,
198,
6738,
25962,
26791,
13,
457,
13,
34409,
1330,
31924,
33,
963,
198,
6738,
25962,
26791,
13,
13345,
10146,
1330,
4889,
1891,
198,
6738,
28686,
1330,
3108,
198,
11748,
... | 2.360134 | 1,194 |
#!/usr/bin/python
"""
TODO: where'd I get this from?
"""
import math
import random
p = (
151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,
30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,
62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,
125,136,171,168,68,175,74,165... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
37811,
198,
51,
3727,
46,
25,
810,
1549,
314,
651,
428,
422,
30,
198,
37811,
198,
198,
11748,
10688,
198,
11748,
4738,
198,
198,
79,
796,
357,
198,
24309,
11,
14198,
11,
19708,
11,
6... | 1.973564 | 2,194 |
from test_base import DisplaySDKTest
from utils import *
| [
6738,
1332,
62,
8692,
1330,
16531,
10305,
42,
14402,
198,
6738,
3384,
4487,
1330,
1635,
198
] | 3.5625 | 16 |
import logging
from configparser import ConfigParser
from typing import Callable
__plugins = {} | [
11748,
18931,
198,
6738,
4566,
48610,
1330,
17056,
46677,
198,
6738,
19720,
1330,
4889,
540,
628,
198,
834,
37390,
796,
23884
] | 4.619048 | 21 |
"""Handle copying data between sites.
tsm_mover.py contains the necessary classes
to upload and download from tape backup and
syncronize it with the runDB.
Author: Boris Bauermeister
Email: Boris.Bauermeister@fysik.su.se
"""
import datetime
import logging
import os
import time
import hashlib
import ... | [
37811,
37508,
23345,
1366,
1022,
5043,
13,
198,
220,
220,
256,
5796,
62,
76,
2502,
13,
9078,
4909,
262,
3306,
6097,
198,
220,
220,
284,
9516,
290,
4321,
422,
9154,
11559,
290,
198,
220,
220,
17510,
1313,
1096,
340,
351,
262,
1057,
1... | 3.474419 | 215 |
from network.route import *
# TODO: remove workaround for circular dependencies
import interface.parse as parser
| [
6738,
3127,
13,
38629,
1330,
1635,
628,
628,
628,
198,
198,
2,
16926,
46,
25,
4781,
46513,
329,
18620,
20086,
198,
11748,
7071,
13,
29572,
355,
30751,
198
] | 4.285714 | 28 |
# V0
# V1
# https://www.hrwhisper.me/leetcode-wiggle-sort-ii/
# V1'
# http://bookshadow.com/weblog/2015/12/31/leetcode-wiggle-sort-ii/
# V1''
# https://www.jiuzhang.com/solution/wiggle-sort-ii/#tag-highlight-lang-python
# V2
# Time: O(n) ~ O(n^2)
# Space: O(1)
# Tri Partition (aka Dutch National Flag Problem) w... | [
2,
569,
15,
220,
198,
198,
2,
569,
16,
220,
198,
2,
3740,
1378,
2503,
13,
11840,
1929,
271,
525,
13,
1326,
14,
293,
316,
8189,
12,
86,
24082,
12,
30619,
12,
4178,
14,
198,
198,
2,
569,
16,
6,
198,
2,
2638,
1378,
2070,
19106,
... | 2.345679 | 162 |
import config.Text
| [
11748,
4566,
13,
8206,
628
] | 4 | 5 |
from django.shortcuts import get_object_or_404, redirect, render
from .models import ShortURL
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
11,
18941,
11,
8543,
198,
198,
6738,
764,
27530,
1330,
10073,
21886,
198
] | 3.518519 | 27 |
import argparse
import sys
import logging as log
from pyautomailer import PyAutoMailer, PyAutoMailerMode
# Bulk-send mode function
# One-send mode function
# From log_level string get log_level object of logging module
| [
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
18931,
355,
2604,
198,
6738,
12972,
2306,
296,
603,
263,
1330,
9485,
27722,
25804,
263,
11,
9485,
27722,
25804,
263,
19076,
198,
198,
2,
47900,
12,
21280,
4235,
2163,
198,
198,
2,
1881,... | 3.596774 | 62 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
# Example code written by a python developer to access cpp implementation of Foo
# This file should be hand-written by a python developer
from foo_interface import FooInterface
from djinni.support import decode... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
2,
17934,
2438,
3194,
416,
257,
21015,
8517,
2... | 3.347826 | 161 |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import to... | [
2,
15069,
357,
66,
8,
2177,
12,
25579,
11,
3203,
11,
3457,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
2723,
2438,
318,
11971,
739,
262,
5964,
1043,
287,
262,
38559,
24290,
2393,
287,
198,
2,
262,
6808,
8619,
286,
42... | 3.662295 | 305 |
# para executar
# python write_to_video.py --output example.avi
# ou
# python write_to_video.py --output example.avi --picamera 1
# python -m pip install imutils
from __future__ import print_function
from imutils.video import VideoStream
import numpy as np
import argparse
import imutils
import time
import cv2
#https:... | [
2,
31215,
3121,
283,
198,
2,
21015,
3551,
62,
1462,
62,
15588,
13,
9078,
1377,
22915,
1672,
13,
15820,
198,
2,
267,
84,
198,
2,
21015,
3551,
62,
1462,
62,
15588,
13,
9078,
1377,
22915,
1672,
13,
15820,
1377,
16564,
18144,
352,
628,
... | 2.817149 | 968 |