content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from pm4pymdl.algo.mvp.gen_framework.rel_events import rel_dfg
from pm4pymdl.algo.mvp.gen_framework.rel_events import being_produced
from pm4pymdl.algo.mvp.gen_framework.rel_events import existence
from pm4pymdl.algo.mvp.gen_framework.rel_events import link
from pm4pymdl.algo.mvp.gen_framework.rel_events import eventua... | [
6738,
9114,
19,
79,
4948,
25404,
13,
282,
2188,
13,
76,
36133,
13,
5235,
62,
30604,
13,
2411,
62,
31534,
1330,
823,
62,
7568,
70,
198,
6738,
9114,
19,
79,
4948,
25404,
13,
282,
2188,
13,
76,
36133,
13,
5235,
62,
30604,
13,
2411,
... | 2.537255 | 255 |
import sys
import time
from niveristand.errors import RunError
from niveristand.legacy import NIVeriStand
# This is an example script to demonstrate the usage of ReconnectToSystem function.
# This script requires cPython(tested on cPython 3.9.6) and (obviously) NIVeriStand Python API.
# This script deploys example pr... | [
11748,
25064,
198,
11748,
640,
198,
6738,
299,
1428,
396,
392,
13,
48277,
1330,
5660,
12331,
198,
6738,
299,
1428,
396,
392,
13,
1455,
1590,
1330,
399,
3824,
33442,
15480,
198,
198,
2,
770,
318,
281,
1672,
4226,
284,
10176,
262,
8748,... | 3.072027 | 597 |
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.http.response import JsonResponse
from django.shortcuts import get_object_or_404
from rest_framework import viewsets, mixins, generics
from rest_framework.pagination import PageNumberPagination
from rest_framewor... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
2448,
3411,
21306,
798,
198,
6738,
42625,
14208,
13,
4023,
13,
26209,
1330,
449,
1559,
31077,
198,
6738,
426... | 2.850292 | 1,543 |
PREFIXES = (
'895',
'896',
'897',
'898',
'899'
) | [
47,
31688,
10426,
1546,
796,
357,
198,
220,
220,
220,
705,
23,
3865,
3256,
198,
220,
220,
220,
705,
48712,
3256,
198,
220,
220,
220,
705,
4531,
22,
3256,
198,
220,
220,
220,
705,
23,
4089,
3256,
198,
220,
220,
220,
705,
44093,
6,
... | 1.478261 | 46 |
import dataclasses
import logging
from typing import ClassVar, List, Tuple
import openpifpaf
from .. import headmeta
from .. import visualizer as visualizer_module
from .annrescaler import TrackingAnnRescaler
LOG = logging.getLogger(__name__)
@dataclasses.dataclass
| [
11748,
4818,
330,
28958,
198,
11748,
18931,
198,
6738,
19720,
1330,
5016,
19852,
11,
7343,
11,
309,
29291,
198,
198,
11748,
1280,
79,
361,
79,
1878,
198,
198,
6738,
11485,
1330,
1182,
28961,
198,
6738,
11485,
1330,
5874,
7509,
355,
5874... | 3.304878 | 82 |
from django.urls import path
from ..views.admin_views import (ProblemListAPI, ProblemAPI,
ProblemTagAPI, ProblemTestCaseAPI, )
urlpatterns = [
path('problem_list/', ProblemListAPI.as_view(), name='admin_problem_list'),
path('problem/', ProblemAPI.as_view(), name='admin_problem')... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
11485,
33571,
13,
28482,
62,
33571,
1330,
357,
40781,
8053,
17614,
11,
20647,
17614,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 2.674033 | 181 |
from player import Player
import settings
| [
6738,
2137,
1330,
7853,
198,
11748,
6460,
628
] | 5.375 | 8 |
import random, time, msvcrt
from enum import Enum
WAIT_SECONDS = 1 / 5
FIELD_WIDTH = 20
FIELD_HEIGHT = 20
BOAT_CHARACTER = "》"
BLANK_CHARACTER = " "
score = 0
tick = 0
tile = initTile(FIELD_WIDTH, FIELD_HEIGHT)
myShip = Ship(">", 0, 0)
boats = initBoats(20)
showText = getTextTile(myShip, boats, tile)
... | [
11748,
4738,
11,
640,
11,
13845,
85,
6098,
83,
201,
198,
6738,
33829,
1330,
2039,
388,
201,
198,
15543,
2043,
62,
23683,
1340,
5258,
796,
352,
1220,
642,
201,
198,
44603,
62,
54,
2389,
4221,
796,
1160,
201,
198,
44603,
62,
13909,
99... | 2.11041 | 317 |
# Import relevant packages
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import re
import string
import nltk
from nltk.corpus import stopwords
from nltk.corpus import wordnet
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
nltk.download('stopwords')
nltk.downloa... | [
2,
17267,
5981,
10392,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
11748,
302,
198,
11748,
4731,
198,
11748,
299,
2528,
74,
198,
673... | 2.544218 | 441 |
"""
Leetcode #605
"""
from typing import List
if __name__ == "__main__":
solution = Solution()
assert solution.canPlaceFlowers([1,0,0,0,1], 1) == True
assert solution.canPlaceFlowers([1,0,0,0,1], 2) == False
| [
37811,
198,
220,
220,
220,
1004,
316,
8189,
1303,
32417,
198,
37811,
628,
198,
6738,
19720,
1330,
7343,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
4610,
796,
28186,
3419,
628,
220,
220,... | 2.532609 | 92 |
#Chaos Game
#Given a polygon
#Given a fraction between 0 and 1
#Select a random point in the polygon - the reference
# Select a random vertex (corner or point) of the polygon
# Place a point halfway between the reference and the vertex
# This point becomes the next reference, and the cycle continues
#Suggestion is ... | [
2,
1925,
7495,
3776,
198,
198,
2,
15056,
257,
7514,
14520,
198,
2,
15056,
257,
13390,
1022,
657,
290,
352,
198,
2,
17563,
257,
4738,
966,
287,
262,
7514,
14520,
532,
262,
4941,
198,
2,
9683,
257,
4738,
37423,
357,
10215,
1008,
393,
... | 3.189516 | 496 |
#get all our function for easy access
from wgdtree.simulation import sim
from wgdtree.retention_rates import rrates, place_wgd
from wgdtree.rooting import root
from wgdtree.split import break_up
from wgdtree.batch_run import run
| [
2,
1136,
477,
674,
2163,
329,
2562,
1895,
198,
198,
6738,
266,
21287,
21048,
13,
14323,
1741,
1330,
985,
198,
6738,
266,
21287,
21048,
13,
1186,
1463,
62,
9700,
1330,
374,
9700,
11,
1295,
62,
86,
21287,
198,
6738,
266,
21287,
21048,
... | 3.285714 | 70 |
"""
Test individual tool functionality
"""
import os
import shlex
import sys
import matplotlib as mpl
import tempfile
import pandas as pd
import tables
from ctapipe.utils import get_dataset_path
from ctapipe.core import run_tool
import numpy as np
GAMMA_TEST_LARGE = get_dataset_path("gamma_test_large.simtel.gz")
... | [
37811,
198,
14402,
1981,
2891,
11244,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
427,
2588,
198,
11748,
25064,
198,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
198,
11748,
20218,
7753,
198,
11748,
19798,
292,
355,
279,
67,
1... | 2.699301 | 143 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pytest
import requests
import requests_mock
import json
import sys
import os
from datetime import datetime
from probeCOCOATek.probeCOCOATek import probeCOCOATek, AugumentError, ParamError, DataError
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
11748,
7007,
198,
11748,
7007,
62,
76,
735,
198,
11748,
33918,
198,
11748,
25064,
198,
11748,
28686,
... | 2.918605 | 86 |
from libqtile.config import Group
mod = "mod4"
terminal = "konsole"
font = "Ubuntu Mono"
laptop = False
colors = {"fg": "#ffffff",
"bg1": "#5c8a5e",
"bg2": "#303030",
"bg3": "#101010"}
groups = [Group(i) for i in "123456789"]
| [
6738,
9195,
39568,
576,
13,
11250,
1330,
4912,
198,
198,
4666,
796,
366,
4666,
19,
1,
198,
23705,
282,
796,
366,
74,
261,
6753,
1,
198,
10331,
796,
366,
36609,
11157,
34879,
1,
198,
75,
45007,
796,
10352,
198,
4033,
669,
796,
19779,... | 2.039683 | 126 |
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bis... | [
11748,
10688,
11,
4731,
11,
340,
861,
10141,
11,
49876,
11,
24575,
80,
11,
17268,
11,
302,
11,
7177,
11,
47457,
478,
11,
4866,
11,
1257,
310,
10141,
11,
4738,
198,
11748,
25064,
198,
6738,
17268,
1330,
390,
4188,
11,
4277,
11600,
11... | 2.271008 | 476 |
# BOJ 15988 1, 2, 3 더하기 3
import sys
sys.stdin = open("../input.txt", "r")
si = sys.stdin.readline
MAX = 1000001
MOD = 1000000009
dp = [0] * MAX
dp[0] = 1
for i in range(1, MAX):
if i - 1 >= 0:
dp[i] += dp[i - 1]
if i - 2 >= 0:
dp[i] += dp[i - 2]
if i - 3 >= 0:
dp[i] += dp[i - 3]... | [
2,
16494,
41,
26422,
3459,
352,
11,
362,
11,
513,
31619,
235,
242,
47991,
246,
166,
116,
108,
513,
198,
11748,
25064,
198,
198,
17597,
13,
19282,
259,
796,
1280,
7203,
40720,
15414,
13,
14116,
1600,
366,
81,
4943,
198,
13396,
796,
2... | 1.75431 | 232 |
import time
import datetime
import os
from rvsite.models import *
from rearvue import utils
from instagram_private_api import Client, ClientCompatPatch
import requests
# We use the client for the auth, but here we just freestyle it because we want raw JSON
INSTAGRAM_MEDIA_URL = "https://api.instagram.com/v1/use... | [
198,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
198,
6738,
374,
14259,
578,
13,
27530,
1330,
1635,
198,
6738,
8286,
85,
518,
1330,
3384,
4487,
628,
198,
198,
6738,
916,
6713,
62,
19734,
62,
15042,
1330,
20985,
11... | 2.707792 | 154 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628,
198
] | 2.842105 | 38 |
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | [
2,
22961,
6343,
38,
672,
2815,
1377,
28062,
515,
11,
18284,
2056,
13662,
198,
2,
15069,
357,
34,
8,
2813,
11,
2321,
6343,
38,
672,
2815,
20420,
13,
220,
4091,
37195,
20673,
13,
198,
2,
198,
2,
770,
1430,
318,
1479,
3788,
25,
345,
... | 2.895853 | 1,037 |
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 22 12:16:50 2015
@author: nadiablago
"""
from astropy.time import Time
import datetime
def utc2mjd(times):
'''
Returns the MJD corresponding to the parameter UTC.
If no UTC parameter is provided, then the current UTC is assumed.
'''
if times is N... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
3300,
5979,
2534,
1105,
25,
1433,
25,
1120,
1853,
198,
198,
31,
9800,
25,
299,
9189,
23117,
3839,
198,
37811,
198,
198,
6738,
6468,
28338,
13,
... | 2.324117 | 1,302 |
import os
def assert_bool(name: str, value: str) -> int:
"""
Makes sure the value is a integer that represents a boolean, otherwise
raises AssertionError
:param name: Argument name
:param value: Value
:return: Value as integer
"""
if int(value) not in [0, 1]:
raise AssertionE... | [
11748,
28686,
628,
198,
198,
4299,
6818,
62,
30388,
7,
3672,
25,
965,
11,
1988,
25,
965,
8,
4613,
493,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
27433,
1654,
262,
1988,
318,
257,
18253,
326,
6870,
257,
25131,
11,
4306,
19... | 2.663613 | 1,528 |
"""A dummy detector which is to be used in testing.
Authors: Ayush Baid
"""
import numpy as np
from gtsfm.common.image import Image
from gtsfm.common.keypoints import Keypoints
from gtsfm.frontend.detector.detector_base import DetectorBase
class DummyDetector(DetectorBase):
"""Assigns random features to an inpu... | [
37811,
32,
31548,
31029,
543,
318,
284,
307,
973,
287,
4856,
13,
198,
198,
30515,
669,
25,
13709,
1530,
347,
1698,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
308,
912,
38353,
13,
11321,
13,
9060,
1330,
7412,
198,
... | 2.463768 | 483 |
# coding=utf-8
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
LOCALS
Local constants.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2019 Pablo Pizarro R. @ppizarror
Permission is hereby granted, free of charge, to any person ob... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
9078,
6057,
12,
26272,
198,
5450,
1378,
12567,
13,
785,
14,
381,
528,
283,
1472,
14,
9078,
6057,
12,
26272,
198,
198,
29701,
23333,
198,
14565,
38491,
13,
198,
198,
34156,
25,
198,
10097... | 3.025958 | 809 |
from rest_framework import serializers
from ...models.investment_pay import InvestmentPay
| [
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
2644,
27530,
13,
24859,
434,
62,
15577,
1330,
20877,
19197,
628
] | 4.227273 | 22 |
"""
directory.py stores methodology to install various files and
packages to different locations.
"""
from __future__ import unicode_literals
import logging
import os
import shutil
import stat
import tempfile
from .templates import source_template
logger = logging.getLogger(__name__)
class DirectoryException(Excep... | [
37811,
198,
34945,
13,
9078,
7000,
20411,
284,
2721,
2972,
3696,
290,
198,
43789,
284,
1180,
7064,
13,
198,
198,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
4... | 3.927835 | 97 |
import logging
import sys
import traceback
# import aiohttp_csrf
import aiohttp_jinja2
from aiohttp import web
LOG = logging.getLogger(__name__)
CSRF_FIELD_NAME = 'csrf_token'
SESSION_STORAGE = 'beacon_session'
error_templates = {
400: '400.html',
404: '404.html',
500: '500.html',
}
default_errors = {
... | [
11748,
18931,
198,
11748,
25064,
198,
11748,
12854,
1891,
198,
198,
2,
1330,
257,
952,
4023,
62,
6359,
41871,
198,
11748,
257,
952,
4023,
62,
18594,
6592,
17,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
198,
25294,
796,
18931,
13,
113... | 2.476744 | 172 |
import tensorflow as tf
import numpy as np
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten, Conv2D, MaxPool2D
from keras import backend as k
import keras
batch_size = 100
num_classes = 10
epochs = 10
filas,columnas = 28,28
(xt,yt),... | [
11748,
11192,
273,
11125,
355,
48700,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
285,
77,
396,
201,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
201,
198,
6738,
4... | 2.276094 | 594 |
"""
tests.test_journal
~~~~~~~~~~~~~~~~~~
Unit tests for twominutejournal.journal.
"""
import unittest
from unittest.mock import MagicMock
import datetime
import uuid
from twominutejournal import journal
from twominutejournal.errors import EntryAlreadyExistsError
from .adapter import MockStorageAdapter
... | [
37811,
198,
220,
220,
220,
5254,
13,
9288,
62,
24891,
198,
220,
220,
220,
220,
27156,
4907,
628,
220,
220,
220,
11801,
5254,
329,
665,
6351,
1133,
24891,
13,
24891,
13,
198,
37811,
198,
11748,
555,
715,
395,
198,
6738,
555,
715,
395... | 2.30886 | 2,833 |
if __name__ == "__main__":
test() | [
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1332,
3419
] | 2.166667 | 18 |
import random
from faker import Faker
from faker.providers import BaseProvider
complexion = [
"pale",
"tanned",
"unshaven",
"beard",
"pock marked",
]
class ComplexionProvider(BaseProvider):
""" Provide Fake (simple) colour. Example of categorical"""
# noinspection PyMethodMayBeStatic
... | [
11748,
4738,
198,
6738,
277,
3110,
1330,
376,
3110,
198,
6738,
277,
3110,
13,
15234,
4157,
1330,
7308,
29495,
198,
198,
41887,
295,
796,
685,
198,
220,
220,
220,
366,
79,
1000,
1600,
198,
220,
220,
220,
366,
83,
3577,
1600,
198,
220... | 2.796875 | 128 |
import socket
HOSTNAME = socket.gethostname()
| [
11748,
17802,
198,
198,
39,
10892,
20608,
796,
17802,
13,
1136,
4774,
3672,
3419,
198
] | 3.133333 | 15 |
"""
Datos de entrada
número a-->a-->int
número b-->b-->int
número c-->c-->int
número d-->d-->int
número-->n-->int
Datos de salida
redondeo-->r-->int
"""
a = (input("Igrese la variable A:"))
b = (input("Igrese la variable B:"))
c = (input("Igrese la variable C:"))
d = (input("Igrese la variable D:"))
n=int((a+b+c+d))
... | [
37811,
198,
27354,
418,
390,
24481,
4763,
198,
77,
21356,
647,
78,
257,
46904,
64,
46904,
600,
198,
77,
21356,
647,
78,
275,
46904,
65,
46904,
600,
198,
77,
21356,
647,
78,
269,
46904,
66,
46904,
600,
198,
77,
21356,
647,
78,
288,
... | 2.039409 | 203 |
from django.conf.urls import url, include
from . import views
urlpatterns = [
url(r'^rating/add/$', views.RatingCreateUpdate.as_view()),
]
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
6738,
764,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
8821,
14,
2860,
32624,
3256,
5009,
13,
29321,
16447,
10260... | 2.788462 | 52 |
from numbers import Number
from typing import Callable, Optional, Sequence, Tuple, Union
import tensorflow as tf
from easy_efficientdet.anchors import generate_anchor_boxes
from easy_efficientdet.utils import (
compute_iou,
convert_to_centroids,
get_abs_bboxes,
swap_xy,
)
EPSILON = 1e-8
| [
6738,
3146,
1330,
7913,
198,
6738,
19720,
1330,
4889,
540,
11,
32233,
11,
45835,
11,
309,
29291,
11,
4479,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
2562,
62,
16814,
15255,
13,
3702,
669,
1330,
7716,
62,
3702,
27... | 2.851852 | 108 |
# -*- coding: ascii -*-
u"""
=====================================
Table inspection and representation
=====================================
Table inspection and representation
:Copyright:
Copyright 2010 - 2021
Andr\xe9 Malo or his licensors, as applicable
:License:
Licensed under the Apache License, Version 2... | [
2,
532,
9,
12,
19617,
25,
355,
979,
72,
532,
9,
12,
198,
84,
37811,
198,
10052,
1421,
28,
198,
8655,
15210,
290,
10552,
198,
10052,
1421,
28,
198,
198,
10962,
15210,
290,
10552,
198,
198,
25,
15269,
25,
628,
15069,
3050,
532,
3344... | 1.965307 | 6,889 |
'''
Description:
Given a binary tree, find its minimum depth.
The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
Note: A leaf is a node with no children.
Example:
Given binary tree [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
ret... | [
7061,
6,
198,
198,
11828,
25,
198,
198,
15056,
257,
13934,
5509,
11,
1064,
663,
5288,
6795,
13,
198,
198,
464,
5288,
6795,
318,
262,
1271,
286,
13760,
1863,
262,
35581,
3108,
422,
262,
6808,
10139,
866,
284,
262,
16936,
12835,
10139,
... | 2.529577 | 710 |
import fractions
from .lang import H
from .lang import sig
from .lang import t
#=============================================================================#
# Standard types, classes, and related functions
## Basic data types
from Data.Maybe import Maybe
from Data.Maybe import Just
from Data.Maybe import Nothing... | [
11748,
49876,
198,
198,
6738,
764,
17204,
1330,
367,
198,
6738,
764,
17204,
1330,
43237,
198,
6738,
764,
17204,
1330,
256,
628,
198,
2,
23926,
25609,
46249,
198,
2,
8997,
3858,
11,
6097,
11,
290,
3519,
5499,
198,
2235,
14392,
1366,
38... | 3.246266 | 2,745 |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import pyt... | [
2,
16529,
45537,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
4091,
13789,
13,
14116,
287,
262,
1628,
6808,
329,
198,
2,
5964,
1321,
13,
198,
2,
16529,
35937,
198,
1... | 3.255132 | 341 |
# coding=utf-8
"""
pygame-menu
https://github.com/ppizarror/pygame-menu
EXAMPLE - SCROLL MENU
Shows scrolling in menu.
License:
-------------------------------------------------------------------------------
The MIT License (MIT)
Copyright 2017-2020 Pablo Pizarro R. @ppizarror
Permission is hereby granted, free of c... | [
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
9078,
6057,
12,
26272,
198,
5450,
1378,
12567,
13,
785,
14,
381,
528,
283,
1472,
14,
9078,
6057,
12,
26272,
198,
198,
6369,
2390,
16437,
532,
6374,
13252,
3069,
41597,
52,
198,
2484,
166... | 2.395175 | 2,404 |
#!/usr/bin/env python
"""
@file netmatching.py
@author Daniel.Krajzewicz@dlr.de
@date 2008-03-27
@version $Id: sumonet.py 7579 2009-07-30 09:34:22Z dkrajzew $
Copyright (C) 2008 DLR/TS, Germany
All rights reserved
"""
import os, sys
from xml.sax import saxutils, make_parser, handler
from itertools import *
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
198,
31,
7753,
220,
220,
220,
2010,
15699,
278,
13,
9078,
198,
31,
9800,
220,
7806,
13,
42,
430,
73,
89,
413,
28051,
31,
67,
14050,
13,
2934,
198,
31,
4475,
220,
220,
220,
... | 2.644068 | 177 |
import numpy as np
def is_symmetric(a: np.ndarray, rtol: float = 1e-5, atol: float = 1e-8) -> bool:
"""
Check whether matrix a is symmetric
:param a: the matrix to be tested
:type: numpy.ndarray
:param rtol: relative tolerance
:type: float
:param atol: absolute tolerance
:ty... | [
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
201,
198,
4299,
318,
62,
1837,
3020,
19482,
7,
64,
25,
45941,
13,
358,
18747,
11,
374,
83,
349,
25,
12178,
796,
352,
68,
12,
20,
11,
379,
349,
25,
12178,
796,
352,
68,
12,
23,
... | 2.274939 | 411 |
# xxxxxxxxxxxxxxxx Program Execution xxxxxxxxxxxxxxxx
l1 = [1,4,6,8,10]
l2 = [2,3,5,7,8,9]
print(f"Un-merged list: {merge_sorted(l1,l2)}")
| [
198,
2,
2124,
24223,
12343,
31811,
6118,
37497,
2124,
24223,
12343,
31811,
198,
75,
16,
796,
685,
16,
11,
19,
11,
21,
11,
23,
11,
940,
60,
198,
75,
17,
796,
685,
17,
11,
18,
11,
20,
11,
22,
11,
23,
11,
24,
60,
198,
4798,
7,
... | 2 | 70 |
import random
from copy import deepcopy
import time
from api.item import *
from api.packets import *
from mods.default.items import *
from mods.default.packets import *
def onTickUpdateTradeRequests(game, deltaTime, tick):
"""
Event Hook: onTick
Remove expired trade requests
"""
for dimensionId i... | [
11748,
4738,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
640,
198,
198,
6738,
40391,
13,
9186,
1330,
1635,
198,
6738,
40391,
13,
8002,
1039,
1330,
1635,
198,
198,
6738,
13743,
13,
12286,
13,
23814,
1330,
1635,
198,
6738,
13743,
13,
... | 2.696809 | 2,444 |
from nonebot import on_command
from nonebot.adapters import MessageTemplate
from urllib import parse
from nonebot.typing import T_State
from nonebot.adapters.cqhttp.permission import GROUP, PRIVATE
from nonebot.adapters.cqhttp.event import Event
from nonebot.adapters.cqhttp.bot import Bot
from nonebot.adapters.cqhttp.m... | [
6738,
4844,
13645,
1330,
319,
62,
21812,
198,
6738,
4844,
13645,
13,
324,
12126,
1330,
16000,
30800,
198,
6738,
2956,
297,
571,
1330,
21136,
198,
6738,
4844,
13645,
13,
774,
13886,
1330,
309,
62,
9012,
198,
6738,
4844,
13645,
13,
324,
... | 2.562992 | 254 |
# -*- coding: utf-8 -*-
from django.http import HttpRequest
from django.test import TestCase
from ..behaviors import ContentTypeMixin
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
18453,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
11485,
20709,
615,
12706,
1330,
14041,
6030,
3... | 2.978261 | 46 |
# Generated by Django 3.0.7 on 2020-06-22 15:47
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
3312,
12,
1828,
1315,
25,
2857,
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 |
"Restart Cases"
| [
1,
19452,
433,
35536,
1,
198
] | 2.666667 | 6 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-02-10 05:25
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import timezone_field.fields
import uuid
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
319,
2864,
12,
2999,
12,
940,
8870,
25,
1495,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,... | 3 | 87 |
from .Problem import *
## #print(self.serviceStartTimes)
## startTime = self.serviceStartTimes[position-1]
## oldStartTime = oldStartTimes[position-1]
## endTime = self.nodeList[position].info.endTime
## #print(f'Customer no. {self.nodeList[position].info.id}, {startTime}, {oldStart... | [
6738,
764,
40781,
1330,
1635,
628,
198,
2235,
220,
220,
220,
220,
220,
220,
220,
1303,
4798,
7,
944,
13,
15271,
10434,
28595,
8,
198,
2235,
220,
220,
220,
220,
220,
220,
220,
923,
7575,
796,
2116,
13,
15271,
10434,
28595,
58,
9150,
... | 2.153367 | 4,010 |
"""
MDWeb Navigation structure and parsing.
TODO: Describe navigation parsing
Navigation structure
Navigation(
_content_path: /my/content
_root_content_path: /my/content
child_navs: [
Navigation(
_content_path: /my/content/about
_root_content_path: /my/content
child_navs: [... | [
37811,
198,
12740,
13908,
42115,
4645,
290,
32096,
13,
198,
198,
51,
3727,
46,
25,
39373,
4892,
16408,
32096,
198,
198,
30575,
7065,
4645,
198,
220,
42115,
7,
198,
220,
220,
220,
4808,
11299,
62,
6978,
25,
1220,
1820,
14,
11299,
198,
... | 2.176249 | 3,983 |
import matplotlib.pyplot as plt
from IPython import display
plt.ion()
def plot(scores, mean_scores, title=None):
"""
displays and saves plot of scores (blue line) and mean scores (orange line)
:param scores: list[int]
:param mean_scores: list[float]
:param title: str
"""
display.clear_out... | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
6101,
7535,
1330,
3359,
198,
198,
489,
83,
13,
295,
3419,
628,
198,
4299,
7110,
7,
1416,
2850,
11,
1612,
62,
1416,
2850,
11,
3670,
28,
14202,
2599,
198,
220,
220,
... | 2.15445 | 382 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""Testing the geometry task."""
def test_geo_task(fix_testDir):
"""
Tests the build geometry task. For now, just verifies that the build doesn't encounter errors.
"""
from qmt.tasks import build_3d_geometry... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
198,
37811,
44154,
262,
22939,
4876,
526,
15931,
628,
198,
4299,
1332,
62,
469,
78,
62,
35943,
7,
13049,
62,
9288,
35277,
... | 2.163357 | 1,108 |
#!/usr/bin/env python2.7
# Copyright 2018 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import os
import string
import sys
if __name__ == "__main__":
sys.exit(main())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
13,
22,
198,
2,
15069,
2864,
383,
376,
37533,
544,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
... | 3.211111 | 90 |
"""This module just has environment variables, regexes and exceptions."""
import re
from environs import Env
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import StaleElementReferenceException
env = Env()
env.read_env()
USER_ID = env.str("USER_ID")
PASSWORD = env.str(... | [
37811,
1212,
8265,
655,
468,
2858,
9633,
11,
40364,
274,
290,
13269,
526,
15931,
198,
198,
11748,
302,
198,
198,
6738,
17365,
343,
684,
1330,
2039,
85,
198,
6738,
384,
11925,
1505,
13,
11321,
13,
1069,
11755,
1330,
1400,
16678,
20180,
... | 2.47012 | 251 |
#!/usr/bin/env python3
import psycopg2
from os import path, remove, system
from uuid import UUID, uuid4
from source.device_manager.user import hash_password, check_password
from source.device_manager.device_log import LogLevel, LogEntry
from source.device_manager.device_layer.device_interface import DeviceType
from so... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
17331,
22163,
70,
17,
198,
6738,
28686,
1330,
3108,
11,
4781,
11,
1080,
198,
6738,
334,
27112,
1330,
471,
27586,
11,
334,
27112,
19,
198,
198,
6738,
2723,
13,
25202,
62,
3... | 1.834133 | 15,832 |
from .pcan import CanBus, CanFdBus
| [
6738,
764,
79,
5171,
1330,
1680,
16286,
11,
1680,
37,
67,
16286,
198
] | 2.692308 | 13 |
import math
from pyspeedup.algorithms import jacobi_symbol
def powersInMod(n):
''' Computes all the squares in the integers mod n.
'''
return set((x*x)%n for x in range(0,n//2+1))
def isSquare(n):
'''
Checks for perfect squares by checking mod 64 to rule out 52/64 cases immediately.
It does s... | [
11748,
10688,
198,
6738,
279,
893,
39492,
929,
13,
282,
7727,
907,
1330,
474,
330,
13411,
62,
1837,
23650,
198,
198,
4299,
5635,
818,
5841,
7,
77,
2599,
198,
220,
220,
220,
705,
7061,
3082,
1769,
477,
262,
24438,
287,
262,
37014,
95... | 1.881801 | 1,066 |
from flask import Blueprint, render_template, url_for, request, jsonify
from werkzeug.security import check_password_hash
from database.useraccount import UsersAccount, queryUserAccount
from database.userdetails import User, queryUser
persona_bp = Blueprint('persona', __name__, url_prefix='/persona')
@person... | [
6738,
42903,
1330,
39932,
11,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
2581,
11,
33918,
1958,
201,
198,
6738,
266,
9587,
2736,
1018,
13,
12961,
1330,
2198,
62,
28712,
62,
17831,
201,
198,
201,
198,
6738,
6831,
13,
7220,
23317,
1330,
... | 3.309735 | 113 |
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="DeepSR",
version="1.2.0",
author="Hakan Temiz, Hasan Sakir Bilge",
author_email="htemiz@artvin.edu.tr, bilge@gazi.edu.tr",
description="A framework for the task of Super Resolution with De... | [
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
4943,
355,
277,
71,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
71,
13,
961,
3419,
198,
198,
2617,
37623,
10141,
13,
40406,
7,
198,
... | 2.635659 | 387 |
from ore.accounts.models import OreUser
from ore.core.models import Permission, Namespace, Organization
from django.core import validators
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.core.urlresolvers import reverse
from ore.core.util impo... | [
6738,
23751,
13,
23317,
82,
13,
27530,
1330,
22452,
12982,
198,
6738,
23751,
13,
7295,
13,
27530,
1330,
2448,
3411,
11,
28531,
10223,
11,
12275,
198,
6738,
42625,
14208,
13,
7295,
1330,
4938,
2024,
198,
6738,
42625,
14208,
13,
9945,
133... | 3.578616 | 159 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import sys
import os
import playsound
from common import utils
from common.telemetry import telemetry_py
from common.telemetry_events import TelemetryEvent
from .pixel import Pixel
from . import constants as CONSTANTS
from collection... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
198,
2,
49962,
739,
262,
17168,
5964,
13,
198,
198,
11748,
33918,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
5341,
633,
198,
198,
6738,
2219,
1330,
3384,
4487,
198,
6738,
2219,
13,
46813,
... | 3.5 | 130 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This file contains a unit test for the timelib in Plaso."""
import unittest
import pytz
from plaso.lib import timelib
from tests import test_lib as shared_test_lib
class TimeLibTest(shared_test_lib.BaseTestCase):
"""Tests for timestamp."""
def testCopyToIsoFo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
1212,
2393,
4909,
257,
4326,
1332,
329,
262,
4628,
417,
571,
287,
1345,
292,
78,
526,
15931,
198,
198,
117... | 2.507395 | 1,555 |
import unittest
from base_test import BaseTest
from settings_snippets import SettingsSnippets
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
2779,
62,
9288,
1330,
7308,
14402,
198,
6738,
6460,
62,
16184,
3974,
1039,
1330,
16163,
16501,
3974,
1039,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
2... | 2.959184 | 49 |
#import SatadishaModule as phase1
import SatadishaModule_final_trie as phase1
import phase2_Trie as phase2
import datetime
from threading import Thread
import random
import math
from queue import Queue
import pandas as pd
import warnings
import numpy as np
import time
import trie as trie
import pickle
warnings.filte... | [
198,
2,
11748,
7031,
324,
19388,
26796,
355,
7108,
16,
198,
11748,
7031,
324,
19388,
26796,
62,
20311,
62,
83,
5034,
355,
7108,
16,
198,
11748,
7108,
17,
62,
51,
5034,
355,
7108,
17,
198,
11748,
4818,
8079,
198,
6738,
4704,
278,
133... | 2.170681 | 2,906 |
# Copyright 2016 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, s... | [
2,
15069,
1584,
37927,
13200,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
345,
743,
198,
2,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
921,
743,
7330,
198,
... | 3.075988 | 329 |
from torchvision import datasets, transforms
from base import BaseDataLoader
from typing import Optional
import torch
from .wrapped_datasets import CIFAR10WithIndex, CIFAR100WithIndex
import os
import numpy as np
import math
class MnistDataLoader(BaseDataLoader):
"""
MNIST data loading demo using BaseDataLoade... | [
6738,
28034,
10178,
1330,
40522,
11,
31408,
198,
6738,
2779,
1330,
7308,
6601,
17401,
198,
6738,
19720,
1330,
32233,
198,
11748,
28034,
198,
6738,
764,
29988,
1496,
62,
19608,
292,
1039,
1330,
327,
5064,
1503,
940,
3152,
15732,
11,
327,
... | 3.115789 | 190 |
from ._scorer import make_ts_scorer
from ._scorer import get_scorer
__all__ = [
"get_scorer",
"make_ts_scorer",
]
| [
6738,
47540,
1416,
11934,
1330,
787,
62,
912,
62,
1416,
11934,
198,
6738,
47540,
1416,
11934,
1330,
651,
62,
1416,
11934,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
366,
1136,
62,
1416,
11934,
1600,
198,
220,
220,
220,
3... | 2.320755 | 53 |
# This program is for communicating with an external i2C Compass, PMOD CMPS or CMPS2
# NOTE: This program does not calibrate your compass.
# This program does not check if your compass is mounted/oriented properly.
# The x-axis should point forward on the robot
import Adafruit_GPIO.I2C as Adafruit_I2C #i2c communicati... | [
2,
770,
1430,
318,
329,
22889,
351,
281,
7097,
1312,
17,
34,
46175,
11,
3122,
3727,
16477,
3705,
393,
16477,
3705,
17,
198,
2,
24550,
25,
770,
1430,
857,
407,
33801,
378,
534,
31855,
13,
198,
2,
770,
1430,
857,
407,
2198,
611,
534... | 2.590164 | 366 |
# 100days - week 1
from datetime import datetime
from datetime import timedelta
t = timedelta(days =4, hours = 10)
hours = t.seconds / 3600
print("Executing at current time", datetime.today())
print("\n During of delta is:\n)")
print("days", t.days)
print("hours", hours)
print("\nEstimate ending:", datetime.today() ... | [
2,
1802,
12545,
532,
1285,
352,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
4818,
8079,
1330,
28805,
12514,
198,
198,
83,
796,
28805,
12514,
7,
12545,
796,
19,
11,
2250,
796,
838,
8,
198,
24425,
796,
256,
13,
43012,
122... | 3.028037 | 107 |
import pandas as pd
from itertools import chain
from global_constants import *
import numpy as np
def get_metaclassifier_training_data_and_labels(cv_predictions, feature_names):
'''
getting meta-classifier training data from the cv fold predictions
'''
rez_frame = None
column_feats = []
for pr... | [
11748,
19798,
292,
355,
279,
67,
198,
6738,
340,
861,
10141,
1330,
6333,
198,
6738,
3298,
62,
9979,
1187,
1330,
1635,
198,
11748,
299,
32152,
355,
45941,
198,
198,
4299,
651,
62,
4164,
330,
31172,
7483,
62,
34409,
62,
7890,
62,
392,
... | 2.294737 | 380 |
from django.shortcuts import render, redirect
from .forms import AddressForm
from django.utils.http import is_safe_url
from billing.models import BillingProfile
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
764,
23914,
1330,
17917,
8479,
198,
6738,
42625,
14208,
13,
26791,
13,
4023,
1330,
318,
62,
21230,
62,
6371,
198,
6738,
26297,
13,
27530,
1330,
3941,
278,
37046,
62... | 3.95122 | 41 |
import os
import warnings
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
OLD_CONFIG = getattr(settings, 'TINYMCE_DEFAULT_CONFIG', False)
if OLD_CONFIG:
warnings.warn("TINYMCE_DEFAULT_CONFIG is deprecated, check docs for instructions.", DeprecationWarning)
DEFAUL... | [
11748,
28686,
198,
11748,
14601,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
12708,
16624,
13,
35350,
1330,
9037,
16624,
62,
35350,
198,
198,
15173,
62,
10943,
16254,
796,
651,
35226,
7,
3... | 2.852941 | 408 |
# Examples from the README, which are also on the web page.
import iegenlib
S1 = iegenlib.Set("{[s,i]: 0<=s && s<T && 0<=i && i<N}")
print "S1 = ", S1
R1 = iegenlib.Relation("{[s,i]->[0,s,1,i,0]}")
print "R1 = ", R1
# The following Python statements are examples on how to apply operations
# (such as Apply, ... | [
2,
21066,
422,
262,
20832,
11682,
11,
543,
389,
635,
319,
262,
3992,
2443,
13,
198,
11748,
37941,
5235,
8019,
198,
198,
50,
16,
796,
37941,
5235,
8019,
13,
7248,
7203,
90,
58,
82,
11,
72,
5974,
657,
27,
28,
82,
11405,
264,
27,
5... | 2.077106 | 843 |
import logging
import os
import sys
import termios
from raft.vendor.six import iteritems
import pytest
from mock import patch
from _util import support
# pytest seems to tweak logging such that Invoke's debug logs go to stderr,
# which is then hella spammy if one is using --capture=no (which one must in
# order to ... | [
11748,
18931,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
3381,
4267,
198,
198,
6738,
31812,
13,
85,
18738,
13,
19412,
1330,
11629,
23814,
198,
11748,
12972,
9288,
198,
6738,
15290,
1330,
8529,
198,
198,
6738,
4808,
22602,
1330,
110... | 3.081433 | 307 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import os
import types
import importlib
def make_2d_normal_mesh(N=50, window=1):
"""
Constructs mesh based on normal distribution to
discretize each axis.
>>> from mud_examples.utils import make_2d_normal_mesh
>>> x, y, XX = make_2... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
3858,
198,
11748,
1330,
8019,
628,
198,
198,
4299,
7... | 1.929245 | 636 |
#!/usr/bin/python
#encoding=utf-8
import unittest
import string
class StringReplaceTestCase(unittest.TestCase):
"""测试空字符替换"""
"""测试空字符替换成常规字符"""
"""测试常规字符替换为空字符"""
"""测试常规字符换"""
if __name__ == "__main__":
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
12685,
7656,
28,
40477,
12,
23,
198,
198,
11748,
555,
715,
395,
198,
11748,
4731,
198,
198,
4871,
10903,
3041,
5372,
14402,
20448,
7,
403,
715,
395,
13,
14402,
20448,
2599,
198,
197,
198... | 1.346591 | 176 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
from api import api
if __name__ == '__main__':
api.run(host='0.0.0.0')
| [
6738,
40391,
1330,
40391,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
40391,
13,
5143,
7,
4774,
11639,
15,
13,
15,
13,
15,
13,
15,
11537,
198
] | 2.171429 | 35 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Exercise 6: String Lists.
Ask the user for a string and print out whether this string is a
palindrome or not. (A palindrome is a string that reads the same
forwards and backwards.)
Credits:
http://www.practicepython.org/exercise/2014/03/12/06-string-lists.html
"""
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
3109,
23697,
718,
25,
10903,
44968,
13,
198,
198,
25214,
262,
2836,
329,
257,
4731,
290,
3601,
503,
1771,
... | 2.488525 | 305 |
from database_schemas.base import Base
from database_schemas.db_session import engine
Base.metadata.create_all(engine)
| [
6738,
6831,
62,
1416,
4411,
292,
13,
8692,
1330,
7308,
198,
6738,
6831,
62,
1416,
4411,
292,
13,
9945,
62,
29891,
1330,
3113,
198,
198,
14881,
13,
38993,
13,
17953,
62,
439,
7,
18392,
8,
198
] | 3.333333 | 36 |
from . import conf
from inukit.jsondata import JsonData
jdata = JsonData(conf.data_path) | [
6738,
764,
1330,
1013,
198,
6738,
287,
2724,
270,
13,
8457,
623,
1045,
1330,
449,
1559,
6601,
198,
198,
73,
7890,
796,
449,
1559,
6601,
7,
10414,
13,
7890,
62,
6978,
8
] | 2.78125 | 32 |
from .adapter import *
from .adapter_filtered import * | [
6738,
764,
324,
3429,
1330,
1635,
198,
6738,
764,
324,
3429,
62,
10379,
4400,
1330,
1635
] | 3.375 | 16 |
import base64
import urllib
import requests
from django.views.generic import RedirectView, TemplateView
#https://stackoverflow.com/questions/51919651/spotify-authorization-code-flow-returns-incomplete-response
with open('/home/osawyer/website/spotify.txt', 'r') as fp:
env = [i.strip() for i in fp.readlines()]
... | [
11748,
2779,
2414,
198,
11748,
2956,
297,
571,
198,
198,
11748,
7007,
198,
6738,
42625,
14208,
13,
33571,
13,
41357,
1330,
2297,
1060,
7680,
11,
37350,
7680,
198,
198,
2,
5450,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
477... | 2.524173 | 393 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import string
from Constants import *
from PIL import Image, ImageDraw, ImageFont
emojiTextFile = open(EMOJIS_TXT, 'r')
lines = emojiTextFile.readlines()
EMOJIS = [line[:-1].split(',') for line in lines]
MAX_EMOJI_COUNT = len(lines)
if __name__ ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
4731,
198,
6738,
4757,
1187,
1330,
1635,
198,
6738,
350,
4146,
13... | 2.36875 | 160 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django.core.urlresolvers import reverse
from django.test import TestCase
from mock import patch
from six import BytesIO
from rapidsms.backends.database.models import INCOMING
from rapidsms.contrib.httptester.forms import MessageForm
from rapidsms.tests.harness im... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
43907,
25,
257,
72,
40379,
28,
19,
39747,
28,
19,
2123,
1509,
28,
19,
198,
6738,
42625,
14208,
13,
7295,
13,
6371,
411,
349,
690,
1330,
9575,
198,
6738,
42625,
14208,
13,
9288,
... | 3.118881 | 143 |
"""
.. module:: thread
:synopsis: Easily execute a function or method in multiple threads.
Still allows the decorated function/method as normal.
Example:
.. doctest::
>>> import lox
>>>
>>> @lox.thread(4) # Will operate with a maximum of 4 threads
... def foo(x,y):
... return x*y
>>> ... | [
37811,
198,
492,
8265,
3712,
4704,
198,
220,
220,
1058,
28869,
24608,
25,
38647,
813,
12260,
257,
2163,
393,
2446,
287,
3294,
14390,
13,
198,
198,
9590,
3578,
262,
24789,
2163,
14,
24396,
355,
3487,
13,
198,
198,
16281,
25,
198,
198,
... | 2.608527 | 1,290 |
from tests.utils import log_errors
# Test functions for metadata testing
@log_errors
@log_errors
@log_errors
@log_errors
| [
6738,
5254,
13,
26791,
1330,
2604,
62,
48277,
198,
2,
6208,
5499,
329,
20150,
4856,
628,
198,
31,
6404,
62,
48277,
628,
198,
31,
6404,
62,
48277,
628,
198,
31,
6404,
62,
48277,
628,
198,
31,
6404,
62,
48277,
198
] | 3.225 | 40 |
b='Yi Jun Nong Chan Yi Dang Jing Xuan Kuai Jian Chu Dan Jiao Sha Zai Can Bin An Ru Tai Chou Chai Lan Ni Jin Qian Meng Wu Ning Qiong Ni Chang Lie Lei Lu Kuang Bao Yu Biao Zan Zhi Si You Hao Qing Chen Li Teng Wei Long Chu Chan Rang Shu Hui Li Luo Zan Nuo Tang Yan Lei Nang Er Wu Yun Zan Yuan Xiong Chong Zhao Xiong Xian Gu... | [
65,
11639,
56,
72,
197,
22396,
197,
45,
506,
197,
48407,
197,
56,
72,
197,
35,
648,
197,
41,
278,
197,
55,
7258,
197,
41733,
1872,
197,
41,
666,
197,
1925,
84,
197,
21174,
197,
41,
13481,
197,
2484,
64,
197,
57,
1872,
197,
6090,... | 1.556657 | 706 |
from turtle import *
import random
import math
screen = Screen()
screenMinX = -screen.window_width()/2
screenMinY = -screen.window_height()/2
screenMaxX = screen.window_width()/2
screenMaxY = screen.window_height()/2
screen.setworldcoordinates(screenMinX,screenMinY,screenMaxX,screenMaxY)
screen.bgcolor... | [
6738,
28699,
1330,
1635,
201,
198,
11748,
4738,
201,
198,
11748,
10688,
201,
198,
201,
198,
9612,
796,
15216,
3419,
201,
198,
201,
198,
201,
198,
9612,
9452,
55,
796,
532,
9612,
13,
17497,
62,
10394,
3419,
14,
17,
201,
198,
9612,
94... | 2.273598 | 731 |
from contextlib import contextmanager
import click
import tasks
@click.group()
@click.version_option(version='0.1.1')
def tasks_cli():
"""Run the tasks application."""
pass
@tasks_cli.command(name='list', help='list tasks')
@click.option('-o', '-owner', default=None,
help='list tasks with thi... | [
6738,
4732,
8019,
1330,
4732,
37153,
198,
198,
11748,
3904,
198,
11748,
8861,
628,
198,
31,
12976,
13,
8094,
3419,
198,
31,
12976,
13,
9641,
62,
18076,
7,
9641,
11639,
15,
13,
16,
13,
16,
11537,
198,
4299,
8861,
62,
44506,
33529,
19... | 2.376528 | 409 |
# this will be imported by the other page.
| [
198,
198,
2,
428,
481,
307,
17392,
416,
262,
584,
2443,
13,
220,
628,
628,
628,
628,
198
] | 3 | 18 |
import sqlite3
| [
11748,
44161,
578,
18,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 1.714286 | 14 |
"""
The :mod:`skmultilearn.cluster` module gathers label space clustering methods.
"""
from .base import LabelSpaceClustererBase
from .base import LabelCooccurenceClustererBase
from .graphtool import GraphToolCooccurenceClusterer
from .igraph import IGraphLabelCooccurenceClusterer
from .matrix import MatrixLabelSpace... | [
37811,
198,
464,
1058,
4666,
25,
63,
8135,
16680,
576,
1501,
13,
565,
5819,
63,
8265,
43609,
6167,
2272,
32966,
1586,
5050,
13,
198,
198,
37811,
198,
198,
6738,
764,
8692,
1330,
36052,
14106,
2601,
436,
11882,
14881,
198,
6738,
764,
8... | 2.784615 | 195 |
#!/bin/python3
import math
import os
import random
import re
import sys
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
n = int(input())
ar = list(map(int, input().rstrip().split()))
result = sockMerchant(n, ar)
fptr.write(str(result) + '\n')
fptr.close()
| [
2,
48443,
8800,
14,
29412,
18,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
302,
198,
11748,
25064,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
277,
20692,
7... | 2.381679 | 131 |
"""
File name: lfsr.py
Author: Lukas Müller
Python Version: 3.6
"""
import numpy as np
from tqdm import tqdm
from .fsr_function import FSRFunction
from .tools import roll, logical_xor
class LFSR():
"""Linear Feedback Shift Register
Args:
`poly` (list[int]): the feedback polynom
`i... | [
37811,
198,
220,
220,
220,
9220,
1438,
25,
300,
9501,
81,
13,
9078,
198,
220,
220,
220,
6434,
25,
28102,
292,
40790,
6051,
198,
220,
220,
220,
11361,
10628,
25,
513,
13,
21,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
... | 2.198895 | 1,086 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | [
2,
15069,
12131,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
733... | 3.844156 | 154 |
#!/usr/local/bin/python
# Code Fights Array Replace Problem
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
198,
2,
6127,
376,
2337,
15690,
40177,
20647,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.756757 | 37 |
#!/usr/bin/env python
import rospy
import rosnode
import rospkg
import subprocess
import time
import os
import argparse
import sys
progName = os.path.basename(__file__)
class RRAction(argparse.Action):
"""docstring for RRAction"""
if __name__=="__main__":
main(sys.argv[1:]) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
686,
2777,
88,
198,
11748,
686,
16184,
1098,
198,
11748,
686,
2777,
10025,
198,
11748,
850,
14681,
198,
11748,
640,
198,
11748,
28686,
198,
11748,
1822,
29572,
198,
11748,
25... | 2.67619 | 105 |
from pwn import *
sh = ssh('lotto', 'pwnable.kr', password='guest', port=2222)
p = sh.process('./lotto')
for i in range(1000):
p.recv()
p.sendline('1')
p.recv()
p.sendline('------')
_ , ans = p.recvlines(2)
if b'bad' not in ans:
print(ans)
break
| [
198,
6738,
279,
675,
1330,
1635,
198,
198,
1477,
796,
26678,
10786,
75,
17631,
3256,
705,
79,
675,
540,
13,
38584,
3256,
9206,
11639,
5162,
395,
3256,
2493,
28,
1828,
1828,
8,
198,
79,
796,
427,
13,
14681,
7,
4458,
14,
75,
17631,
... | 2.122951 | 122 |