content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import asyncio
import functools
import typing
from asyncio import iscoroutinefunction
from typing import Any, AsyncGenerator, Iterator, Dict
try:
import contextvars # Python 3.7+ only.
except ImportError: # pragma: no cover
contextvars = None # type: ignore
T = typing.TypeVar("T")
| [
11748,
30351,
952,
198,
11748,
1257,
310,
10141,
198,
11748,
19720,
198,
6738,
30351,
952,
1330,
318,
10215,
28399,
8818,
198,
6738,
19720,
1330,
4377,
11,
1081,
13361,
8645,
1352,
11,
40806,
1352,
11,
360,
713,
198,
198,
28311,
25,
198... | 3.092784 | 97 |
from PIL import Image
import numpy as np
# importing Image from Python Image Library; importing numpy as np
# All the arrays from here-
# pixels_piece-name 255,255,255=white 153,75,0=brown
# Edited these arrays because king, queen, bishop and knight were 10x11. Now all pieces pixel are 10x10
pixels_pawn = [
[... | [
6738,
350,
4146,
1330,
7412,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
33332,
7412,
422,
11361,
7412,
10074,
26,
33332,
299,
32152,
355,
45941,
628,
198,
2,
1439,
262,
26515,
422,
994,
12,
198,
2,
17848,
62,
12239,
12,
3672,
... | 2.151634 | 6,120 |
from random import randint
mundo1 = Mundo('Nether', 4000000000) # 4 bilhões
print(mundo1.gerar_cor_ceu())
| [
6738,
4738,
1330,
43720,
600,
628,
198,
20125,
78,
16,
796,
33324,
78,
10786,
45,
6750,
3256,
604,
10535,
830,
8,
220,
1303,
604,
47027,
71,
127,
113,
274,
198,
4798,
7,
20125,
78,
16,
13,
1362,
283,
62,
10215,
62,
344,
84,
28955,... | 2.422222 | 45 |
import random
from model.contact import Contact
from model.group import Group
from fixture.orm import ORMFixture
orm = ORMFixture(host="127.0.0.1", name="addressbook", user="root", password="")
| [
11748,
4738,
198,
6738,
2746,
13,
32057,
1330,
14039,
198,
6738,
2746,
13,
8094,
1330,
4912,
198,
6738,
29220,
13,
579,
1330,
6375,
49800,
9602,
198,
198,
579,
796,
6375,
49800,
9602,
7,
4774,
2625,
16799,
13,
15,
13,
15,
13,
16,
16... | 3.482143 | 56 |
"""
Turner, Mann, Clandinin: Figure generation script: Fig. 4.
https://github.com/mhturner/SC-FC
"""
import matplotlib.pyplot as plt
import numpy as np
import os
from scipy.stats import zscore, spearmanr
import pandas as pd
import seaborn as sns
import glob
from scipy import stats
from sklearn.linear_model import Lin... | [
37811,
198,
17278,
263,
11,
20291,
11,
1012,
392,
259,
259,
25,
11291,
5270,
4226,
25,
12138,
13,
604,
13,
198,
198,
5450,
1378,
12567,
13,
785,
14,
76,
4352,
700,
263,
14,
6173,
12,
4851,
198,
37811,
198,
11748,
2603,
29487,
8019,
... | 2.283501 | 7,746 |
from tasks.api.views import TasksViewSet, TasksApiView, managerDashboardData, resetResult, resetImageResult, rejectTask, deliveryTask
from rest_framework.routers import DefaultRouter
from django.urls import path, include
router = DefaultRouter()
router.register(r'', TasksViewSet, basename='tasks')
#urlpatterns = rout... | [
6738,
8861,
13,
15042,
13,
33571,
1330,
309,
6791,
7680,
7248,
11,
309,
6791,
32,
14415,
7680,
11,
4706,
43041,
3526,
6601,
11,
13259,
23004,
11,
13259,
5159,
23004,
11,
4968,
25714,
11,
7585,
25714,
198,
6738,
1334,
62,
30604,
13,
47... | 2.730233 | 430 |
# -*- coding: utf-8 -*-
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from decouple import config
from time import time
from src.InstaBot import InstaBot
if __name__ == '__main__':
main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
1330,
2938,
62,
17561,
1756,
355,
13182,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
11284,
13,
17077,
1330,
... | 3.098039 | 102 |
"""
Test for bootwrap/components/link.py
"""
import pytest
from bootwrap import attr, inject, Text
from .helper import HelperHTMLParser
@pytest.mark.utils
@pytest.mark.utils
| [
37811,
198,
14402,
329,
6297,
37150,
14,
5589,
3906,
14,
8726,
13,
9078,
198,
37811,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
6297,
37150,
1330,
708,
81,
11,
8677,
11,
8255,
198,
198,
6738,
764,
2978,
525,
1330,
5053,
525,
28656,... | 2.919355 | 62 |
from enum import Enum
import torch
import torch.nn as nn
import numpy as np
from conut.util import σ
Mode = Enum('Mode', ['Bulk', 'Ribbon'])
| [
6738,
33829,
1330,
2039,
388,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
369,
315,
13,
22602,
1330,
18074,
225,
628,
198,
19076,
796,
2039,
388,
10786,
19076,
3256,
3725... | 2.773585 | 53 |
from string import ascii_lowercase,ascii_uppercase,punctuation,digits
print(ascii_lowercase,ascii_uppercase,punctuation,digits)
# abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ 0123456789
import random as rnd
print(rnd.choice(ascii_lowercase))
"""
yukarıdaki kodlardan yardım ala... | [
6738,
4731,
1330,
355,
979,
72,
62,
21037,
7442,
11,
292,
979,
72,
62,
7211,
2798,
589,
11,
79,
16260,
2288,
11,
12894,
896,
198,
4798,
7,
292,
979,
72,
62,
21037,
7442,
11,
292,
979,
72,
62,
7211,
2798,
589,
11,
79,
16260,
2288... | 2.061947 | 339 |
from django.contrib import admin
# Register your models here.
from vacation_schedule.models import VacationScheduleParameters, EmployeeVacationPeriod, DaysRemainder
admin.site.register(VacationScheduleParameters)
admin.site.register(EmployeeVacationPeriod)
admin.site.register(DaysRemainder)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
6738,
14600,
62,
15952,
5950,
13,
27530,
1330,
25709,
341,
27054,
5950,
48944,
11,
36824,
53,
330,
341,
5990,
2101,
11,
12579,
8413,
391,
108... | 3.458824 | 85 |
# -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
from django.urls import path, re_path
from apps.home import views
urlpatterns = [
#Home page
re_path(r'^mishkat-al-masabih/(?P<main_chp>\w+)/(?P<id_no>\d+)/$', views.t_hadith_content,name='t_hadith_content'),
# Quran Start
pat... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
15269,
357,
66,
8,
13130,
532,
1944,
2034,
50,
2308,
13,
385,
198,
37811,
198,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
302,
62,
6978,
198,
... | 2.186275 | 612 |
"""Utils for upload command."""
import csv
import os
import platform
from collections import defaultdict
from boto3.s3.transfer import TransferConfig
from botocore.exceptions import ClientError
from gencove.exceptions import ValidationError
from gencove.logger import echo_debug, echo_info
from gencove.utils import C... | [
37811,
18274,
4487,
329,
9516,
3141,
526,
15931,
198,
11748,
269,
21370,
198,
11748,
28686,
198,
11748,
3859,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
6738,
275,
2069,
18,
13,
82,
18,
13,
39437,
1330,
20558,
16934,
198,
198,
6738,... | 2.218308 | 3,321 |
from ..dojo_test_case import DojoTestCase
from dojo.models import Test
from dojo.tools.mozilla_observatory.parser import MozillaObservatoryParser
| [
6738,
11485,
4598,
7639,
62,
9288,
62,
7442,
1330,
2141,
7639,
14402,
20448,
198,
6738,
466,
7639,
13,
27530,
1330,
6208,
198,
6738,
466,
7639,
13,
31391,
13,
5908,
16496,
62,
672,
3168,
2870,
13,
48610,
1330,
29258,
31310,
712,
2870,
... | 3.418605 | 43 |
#!/usr/bin/env python3
#
# latex_layout.py
r"""
Makes minor adjustments to the LaTeX layout.
* Increases the whitespace above function signatures by 5px,
to prevent the function visually merging with the previous one.
* Remove unnecessary indentation and allow "raggedright" for the fields in
the body of functions... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
198,
2,
220,
47038,
62,
39786,
13,
9078,
198,
81,
37811,
198,
44,
1124,
4159,
16895,
284,
262,
4689,
49568,
12461,
13,
198,
198,
9,
23920,
262,
13216,
10223,
2029,
2163,
17239... | 3.296842 | 950 |
from django.apps import AppConfig | [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934
] | 4.125 | 8 |
import numpy as np
import pandas as pd
import scipy.stats
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import matplotlib.ticker as ticker
import matplotlib.colors as colors
from matplotlib.colors import hsv_to_rgb
import seaborn as sns
import scipy.cluster.hierarchy as hierarchy
from cycler impo... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
629,
541,
88,
13,
34242,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
2603,
29487,
8019,
13,
8071,
2052,
355,
16082,
198,
11... | 1.848561 | 10,004 |
from django.utils.translation import ugettext_lazy as _
from apps.summary.parsers.approaches_2015 import Approach2015Parser
from apps.summary.renderers.summary import GlobalValuesMixin, SummaryRenderer
class Approaches2015FullSummaryRenderer(GlobalValuesMixin, SummaryRenderer):
"""
Configuration for 'full' a... | [
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
6725,
13,
49736,
13,
79,
945,
364,
13,
21064,
3694,
62,
4626,
1330,
38066,
4626,
46677,
198,
6738,
6725,
13,
49736,
13,
10920,
... | 3.346457 | 127 |
# Define .get_node_by_value() below:
root = BinarySearchTree(100)
root.insert(50)
root.insert(125)
root.insert(75)
root.insert(25)
# Get nodes by value below:
print(root.get_node_by_value(75).value)
print(root.get_node_by_value(55))
| [
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
1303,
2896,
500,
764,
1136,
62,
17440,
62,
1525,
62,
8367,
3419,
2174,
25,
198,
220,
220,
198,
220,
220,
198,
15763,
796,
45755,
18243,
27660,
7,
3064,
8,
198,
198,
15763,
13,
2846... | 2.290909 | 110 |
"""Create a new list.
Declare and initialize a new list _items, containing 3 elements _a, _b, _c.
Source: programming-idioms.org
"""
# Implementation author: programming-idioms.org
# Created on 2016-10-20T11:54:59.397725Z
# Last modified on 2016-10-20T11:54:59.397725Z
# Version 1
items = [a, b, c]
| [
37811,
16447,
257,
649,
1351,
13,
198,
198,
37835,
533,
290,
41216,
257,
649,
1351,
4808,
23814,
11,
7268,
513,
4847,
4808,
64,
11,
4808,
65,
11,
4808,
66,
13,
198,
198,
7416,
25,
8300,
12,
19830,
3150,
13,
2398,
198,
37811,
198,
... | 2.72973 | 111 |
import pandas as pd
import numpy as np
import argparse
# generate a dataframe that has an equal distribution of star ratings
if __name__ == '__main__':
main()
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
1822,
29572,
198,
198,
2,
7716,
257,
1366,
14535,
326,
468,
281,
4961,
6082,
286,
3491,
10109,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
1241... | 3.27451 | 51 |
import pytest
from httpie.status import ExitStatus
from tests.utils import httpie
from tests.utils.plugins_cli import parse_listing
@pytest.mark.requires_installation
@pytest.mark.requires_installation
@pytest.mark.requires_installation
@pytest.mark.requires_installation
@pytest.mark.requires_installation
... | [
11748,
12972,
9288,
198,
198,
6738,
2638,
494,
13,
13376,
1330,
29739,
19580,
198,
6738,
5254,
13,
26791,
1330,
2638,
494,
198,
6738,
5254,
13,
26791,
13,
37390,
62,
44506,
1330,
21136,
62,
4868,
278,
628,
198,
31,
9078,
9288,
13,
410... | 2.642674 | 389 |
import pandas as pd
import numpy as np
from tpau_gtfsutilities.gtfs.gtfssingleton import gtfs as gtfs_singleton
from tpau_gtfsutilities.config.utilityoutput import utilityoutput
from tpau_gtfsutilities.gtfs.methods.helpers import triphelpers
from tpau_gtfsutilities.gtfs.methods.helpers.calendarhelpers import GTFSServi... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
256,
79,
559,
62,
13655,
9501,
315,
2410,
13,
13655,
9501,
13,
13655,
69,
824,
278,
10565,
1330,
308,
83,
9501,
355,
308,
83,
9501,
62,
12215,
1056... | 2.805085 | 118 |
import RPi.GPIO as GPIO
import time
class Pi_LED:
"""Class for contolling an LED using Rasberry Pi"""
| [
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
11748,
640,
628,
198,
4871,
13993,
62,
30465,
25,
198,
220,
220,
220,
37227,
9487,
329,
542,
692,
278,
281,
12365,
1262,
28513,
8396,
13993,
37811,
198
] | 3 | 36 |
from Function import *
from Tensor import InputTensor
from Module import Forward
import numpy as np | [
6738,
15553,
1330,
1635,
198,
6738,
309,
22854,
1330,
23412,
51,
22854,
198,
6738,
19937,
1330,
19530,
198,
11748,
299,
32152,
355,
45941
] | 4.304348 | 23 |
import mathutils
# zero length vector
vec = mathutils.Vector((0.0, 0.0, 1.0))
# unit length vector
vec_a = vec.copy().normalize()
vec_b = mathutils.Vector((0.0, 1.0, 2.0))
vec2d = mathutils.Vector((1.0, 2.0))
vec3d = mathutils.Vector((1.0, 0.0, 0.0))
vec4d = vec_a.to_4d()
# other mathutuls types
quat = mathutils.Q... | [
11748,
10688,
26791,
198,
198,
2,
6632,
4129,
15879,
198,
35138,
796,
10688,
26791,
13,
38469,
19510,
15,
13,
15,
11,
657,
13,
15,
11,
352,
13,
15,
4008,
198,
198,
2,
4326,
4129,
15879,
198,
35138,
62,
64,
796,
43030,
13,
30073,
2... | 2.316456 | 474 |
import numpy as np
from skimage.io import imread
from skimage.transform import resize
from scivision_test_plugin import ImageNetModel
model = ImageNetModel()
# read and prepare image
X = imread("./data/dog.jpeg")
X = resize(X, (224, 224)) * 255 # cast back to 0-255 range
y = model.predict(X)
print(y)
# import ma... | [
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
9060,
13,
952,
1330,
545,
961,
198,
6738,
1341,
9060,
13,
35636,
1330,
47558,
198,
198,
6738,
629,
452,
1166,
62,
9288,
62,
33803,
1330,
7412,
7934,
17633,
198,
198,
19849,
796,
7412,
79... | 2.433824 | 272 |
#!/usr/bin/env python
"""
Algorithm
Use a hashmap to store visited locations
Exit on hit to hashmap
"""
import re
visited = {(0,0): 1}
def getInputArray():
""" Plumbing: Get input """
with open('d01.in') as fp:
return re.split(',\s', fp.read())
def moveTo(pos, inc):
"""
Marks all steps f... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
2348,
42289,
198,
198,
11041,
257,
12234,
8899,
284,
3650,
8672,
7064,
198,
30337,
319,
2277,
284,
12234,
8899,
198,
198,
37811,
198,
198,
11748,
302,
198,
198,
4703,
... | 2.137662 | 385 |
# Generated by Django 2.1.3 on 2019-02-25 07:18
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
18,
319,
13130,
12,
2999,
12,
1495,
8753,
25,
1507,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
# (C) Datadog, Inc. 2019
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# Keep in sync with relevant fields from:
# https://github.com/DataDog/datadog-agent/blob/1fdb5e1746f9834d627f8fa1611d3753c1f9db10/pkg/process/config/data_scrubber.go#L14-L20
DEFAULT_BLACKLIST = (
'access_tok... | [
2,
357,
34,
8,
16092,
324,
519,
11,
3457,
13,
13130,
198,
2,
1439,
2489,
10395,
198,
2,
49962,
739,
257,
513,
12,
565,
682,
347,
10305,
3918,
5964,
357,
3826,
38559,
24290,
8,
198,
198,
2,
9175,
287,
17510,
351,
5981,
7032,
422,
... | 2.291457 | 199 |
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 28 06:13:12 2020
@author: ksme0
"""
import datetime
import re
import requests
from bs4 import BeautifulSoup
dates = []
codes = []
titles = []
pat_1 = re.compile('[\]\)>]+[ ]*[\D]+[,]{1}')
pat_2 = re.compile('[\]\)>]+[ ]*[가-힣a-zA-Z&]+[ ]{1}')
pat_3 = re.compile("' [가-힣... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
2758,
2579,
9130,
25,
1485,
25,
1065,
12131,
198,
198,
31,
9800,
25,
479,
82,
1326,
15,
198,
37811,
198,
11748,
4818,
8079,
198,
11748,
... | 1.890852 | 962 |
import setuptools
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
name="pytm",
version="1.1.3",
packages=["pytm"],
description="A Python-based framework for threat modeling.",
long_description=long_description,
long_description_content_type... | [
11748,
900,
37623,
10141,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
1600,
21004,
2625,
40477,
12,
23,
4943,
355,
277,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
277,
13,
961,
3419,
198,
198,
2617,
37623,
1... | 2.587264 | 424 |
import os
from collections import defaultdict
from itertools import groupby
from datetime import datetime, timedelta
import discord
from discord.ext import commands
from .db import Session
from .db.models import Game, Key, Member, Guild
from .keyparse import parse_key, keyspace, parse_name
from .colours import Colour... | [
11748,
28686,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
340,
861,
10141,
1330,
1448,
1525,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
6738,
... | 1.973606 | 2,690 |
import pygame
| [
11748,
12972,
6057,
198
] | 3.5 | 4 |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
1584,
11,
33160,
11,
18650,
290,
14,
273,
663,
29116,
13,
220,
1439,
2489,
10395,
13,
198,
2,
770,
3788,
318,
10668,
12,
36612,
284,
345,
739,
262,
14499,
2448,
33532,
1... | 4.061856 | 291 |
import unittest
import numpy as np
import openmdao.api as om
from openmdao.utils.assert_utils import assert_rel_error
import dymos as dm
from dymos.transcriptions.runge_kutta.test.rk_test_ode import TestODE, _test_ode_solution
if __name__ == '__main__': # pragma: no cover
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
1280,
9132,
5488,
13,
15042,
355,
39030,
198,
6738,
1280,
9132,
5488,
13,
26791,
13,
30493,
62,
26791,
1330,
6818,
62,
2411,
62,
18224,
198,
198,
11748,
2... | 2.654867 | 113 |
# trinity John 3:16
# subpackage for providing terminal formatting
import os
import ctypes
import inspect
from ctypes import windll
from .exceptions import VT100Error
# Enable VT-100 terminal emulation for windows users
if os.name == "nt":
try:
# Declare aliases
c_int32 = ctypes.c_int32
... | [
198,
2,
491,
6269,
1757,
513,
25,
1433,
198,
2,
850,
26495,
329,
4955,
12094,
33313,
198,
198,
11748,
28686,
198,
11748,
269,
19199,
198,
11748,
10104,
198,
198,
6738,
269,
19199,
1330,
2344,
297,
198,
6738,
764,
1069,
11755,
1330,
32... | 2.208369 | 2,366 |
#
# Copyright 2020 NVIDIA CORPORATION.
#
# 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... | [
2,
198,
2,
15069,
12131,
15127,
23929,
44680,
6234,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 2.119741 | 927 |
from wsgiref.simple_server import make_server
from optparse import OptionParser
from moksha.widgetbrowser.wsgiapp import WidgetBrowser
_parser = OptionParser(usage = "%prog [OPTIONS] [widget_url]")
_parser.add_option("-i", "--interactive",
dest="interactive",
action="store_true"... | [
6738,
266,
45213,
557,
69,
13,
36439,
62,
15388,
1330,
787,
62,
15388,
198,
6738,
2172,
29572,
1330,
16018,
46677,
198,
198,
6738,
285,
482,
26270,
13,
42655,
40259,
13,
18504,
70,
544,
381,
1330,
370,
17484,
46532,
628,
198,
62,
4861... | 2.160494 | 810 |
from . import commands
| [
6738,
764,
1330,
9729,
201,
198
] | 4 | 6 |
import fechbase
| [
11748,
730,
354,
8692,
198
] | 3.2 | 5 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import os
import sys
sys.path.append(os.path.abspath("../moduleA_dir"))
import moduleA
sys.path.append(os.path.abspath("../moduleB_dir"))
import moduleB
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
7203,
... | 2.43 | 100 |
#!/usr/bin/env python3
# vim : nospell filetype=py ts=2 sw=2 sts=2 et :
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
43907,
1058,
43630,
23506,
2393,
4906,
28,
9078,
40379,
28,
17,
1509,
28,
17,
39747,
28,
17,
220,
2123,
220,
1058,
198
] | 2.242424 | 33 |
from scrounger.core.module import BaseModule
# helper functions
from scrounger.utils.config import Log
from langdetect import detect_langs
from time import sleep
| [
6738,
629,
472,
782,
263,
13,
7295,
13,
21412,
1330,
7308,
26796,
198,
198,
2,
31904,
5499,
198,
6738,
629,
472,
782,
263,
13,
26791,
13,
11250,
1330,
5972,
198,
6738,
42392,
15255,
478,
1330,
4886,
62,
17204,
82,
198,
6738,
640,
13... | 3.644444 | 45 |
#!/usr/bin/python3
from DPLL import SAT
from sudoku import sudoku2fma, showsudokuclues, showsudoku
print("AN EASY SUDOKU")
# The easy ones are solved almost without search, just by performing
# unit propagation. A little bit harder ones require from humans looking
# ahead at the possibilities, and this means case a... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
27704,
3069,
1330,
29020,
198,
6738,
424,
67,
11601,
1330,
424,
67,
11601,
17,
69,
2611,
11,
2523,
463,
11601,
565,
947,
11,
2523,
463,
11601,
628,
198,
4798,
7203,
1565,
412... | 1.957043 | 1,001 |
from dataclasses import dataclass
from statistics import mean
from typing import Dict, Optional, Any
from models.location import Location
from models.rider import Rider
@dataclass
class Stop:
"""Class that defines a physical Stop"""
riders: Optional[Dict[str, Rider]] = None
demand: int = 0
depot_id:... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
7869,
1330,
1612,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
11,
4377,
198,
198,
6738,
4981,
13,
24886,
1330,
13397,
198,
6738,
4981,
13,
49449,
1330,
16414,
628,
198,
31,
1... | 2.409709 | 515 |
import datetime
from django.db.backends.ddl_references import (
Columns, ForeignKeyName, Statement, Table,
)
from django.db.backends.utils import split_identifier
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.models import NOT_PROVIDED
| [
11748,
4818,
8079,
198,
6738,
42625,
14208,
13,
9945,
13,
1891,
2412,
13,
1860,
75,
62,
5420,
4972,
1330,
357,
198,
220,
220,
220,
29201,
82,
11,
8708,
9218,
5376,
11,
21983,
11,
8655,
11,
198,
8,
198,
6738,
42625,
14208,
13,
9945,
... | 3.159091 | 88 |
import tensorflow as tf
#import tensorflow.compat.v1 as tf
#tf.disable_v2_behavior()
#from tensorflow.contrib import layers
_BATCH_NORM_DECAY = 0.997
_BATCH_NORM_EPSILON = 1e-5
DEFAULT_VERSION = 2
DEFAULT_DTYPE = tf.float32
CASTABLE_TYPES = (tf.float16,)
ALLOWED_TYPES = (DEFAULT_DTYPE,) + CASTABLE_TYPES
def batch_nor... | [
11748,
11192,
273,
11125,
355,
48700,
198,
2,
11748,
11192,
273,
11125,
13,
5589,
265,
13,
85,
16,
355,
48700,
198,
2,
27110,
13,
40223,
62,
85,
17,
62,
46571,
3419,
198,
2,
6738,
11192,
273,
11125,
13,
3642,
822,
1330,
11685,
198,
... | 2.426892 | 2,127 |
"""Quick entry module for admin_tools_zinnia"""
from django.utils.translation import ugettext_lazy as _
from admin_tools.dashboard.modules import DashboardModule
class QuickEntry(DashboardModule):
"""Dashboard module for quick publishing an entry"""
title = _('Quick entry')
template = 'admin_tools_zinnia... | [
37811,
21063,
5726,
8265,
329,
13169,
62,
31391,
62,
89,
3732,
544,
37811,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
13169,
62,
31391,
13,
42460,
3526,
13,
18170,
1... | 3.344538 | 119 |
"""empty message
Revision ID: 1104603ceced
Revises: None
Create Date: 2013-09-25 13:21:49.242000
"""
# revision identifiers, used by Alembic.
revision = '1104603ceced'
down_revision = None
from alembic import op
import sqlalchemy as sa
| [
37811,
28920,
3275,
198,
198,
18009,
1166,
4522,
25,
9796,
34716,
18,
344,
771,
198,
18009,
2696,
25,
6045,
198,
16447,
7536,
25,
2211,
12,
2931,
12,
1495,
1511,
25,
2481,
25,
2920,
13,
1731,
11024,
198,
198,
37811,
198,
198,
2,
184... | 2.813953 | 86 |
#!/usr/bin/env python
import sys
import requests
import requests_cache
from bs4 import BeautifulSoup
from pprint import pprint
from lib.csvtools import dict_to_csv
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
220,
21015,
198,
198,
11748,
25064,
198,
11748,
7007,
198,
11748,
7007,
62,
23870,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
6738,
279,
4798,
1330,
279,
4798,
198,
6738,
9195,
13,
40664... | 3.029412 | 68 |
# %% md
## Analysis of District Profile and Ground Value data
# In this notebook, I will analyse the two datasets that I have cleaned in the
# notebooks ```notebook-district-profiles``` and ```notebook-ground-values```.
# %%
# Import necessary libraries
import pandas as pd
import numpy as np
import seaborn as sns
impor... | [
2,
43313,
45243,
198,
2235,
14691,
286,
5665,
13118,
290,
13706,
11052,
1366,
198,
2,
554,
428,
20922,
11,
314,
481,
39552,
262,
734,
40522,
326,
314,
423,
20750,
287,
262,
198,
2,
43935,
7559,
63,
11295,
2070,
12,
17080,
2012,
12,
... | 3.328568 | 9,514 |
# -*- coding: utf-8 -*-
#
#
# Author: alex
# Created Time: 2018年12月08日 星期六 22时16分15秒
import os
import cv2
from cv2 import dnn
inWidth = 400
inHeight = 400
confThreshold = 0.5
prototxt = 'data/deploy.prototxt'
caffemodel = 'data/res10_300x300_ssd_iter_140000.caffemodel'
net = dnn.readNetFromCaffe(prototxt, caffemodel)... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
198,
2,
6434,
25,
257,
2588,
198,
2,
15622,
3862,
25,
2864,
33176,
112,
1065,
17312,
230,
2919,
33768,
98,
10545,
246,
253,
17312,
253,
17739,
255,
2534,
... | 2.035897 | 195 |
import uniflocpy.uTools.uconst
import uniflocpy.uTools.data_workflow
test = IPR_Vogel()
q_liq_m3day = test.calc_q_liq_m3day(30,250,100,0.1,50)
print(q_liq_m3day)
| [
11748,
555,
361,
17946,
9078,
13,
84,
33637,
13,
84,
9979,
198,
11748,
555,
361,
17946,
9078,
13,
84,
33637,
13,
7890,
62,
1818,
11125,
628,
198,
9288,
796,
314,
4805,
62,
53,
519,
417,
3419,
198,
198,
80,
62,
4528,
80,
62,
76,
... | 1.931034 | 87 |
########################################################################################################################
__doc__ = \
"""
This has the methods common to ring and odd.
Formerly part of collapse_ring.py
"""
##################################################################################... | [
29113,
29113,
29113,
14468,
7804,
198,
198,
834,
15390,
834,
796,
3467,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
770,
468,
262,
5050,
2219,
284,
5858,
290,
5629,
13,
198,
220,
220,
220,
14466,
306,
636,
286,
9807,
62,
1806,
13... | 5.666667 | 75 |
# -*- coding: utf-8 -*-
"""
LaTeX writer for Sphinx which allows to use arbitrary LaTeX class.
"""
import sys
from os import path
from docutils import nodes
from sphinx import highlighting
import sphinx.writers.latex
from sphinx.util.osutil import ustrftime
from sphinx.ext.mathbase import latex_visit_math, latex_visit... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
14772,
49568,
6260,
329,
45368,
28413,
543,
3578,
284,
779,
14977,
4689,
49568,
1398,
13,
198,
37811,
198,
198,
11748,
25064,
198,
6738,
28686,
1330,
3108,
198... | 2.578571 | 280 |
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and license terms.
#
# ## ### ##... | [
2,
795,
16436,
25,
532,
9,
12,
4235,
25,
21015,
26,
12972,
12,
521,
298,
12,
28968,
25,
604,
26,
7400,
12,
10394,
25,
604,
26,
33793,
12,
8658,
82,
12,
14171,
25,
18038,
532,
9,
12,
198,
2,
409,
25,
900,
39747,
28,
19,
40379,
... | 2.775163 | 3,229 |
import pathlib
import setuptools
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
# This call to setup() does all the work
setuptools.setup(
name="rtcbot",
version="0.2.3",
description="An asyncio-focused lib... | [
11748,
3108,
8019,
198,
11748,
900,
37623,
10141,
198,
198,
2,
383,
8619,
7268,
428,
2393,
198,
39,
9338,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
8000,
198,
198,
2,
383,
2420,
286,
262,
20832,
11682,
2393,
198,
15675,
11... | 2.384615 | 468 |
'''
Open Combat Flow - character.py
@purpose Defines the virtual Character class, and the combatHandler, which handles interactions between Characters.
@author Owen Mellema
@date 2-25-19
'''
import opencombatflow
import opencombatflow.dice as dice
import math
import random
class Character():
'''
A single character.
... | [
7061,
6,
198,
11505,
14487,
27782,
532,
2095,
13,
9078,
198,
31,
29983,
2896,
1127,
262,
7166,
15684,
1398,
11,
290,
262,
5249,
25060,
11,
543,
17105,
12213,
1022,
26813,
13,
198,
31,
9800,
22605,
5616,
293,
2611,
198,
31,
4475,
362,
... | 3.12808 | 4,099 |
#region Producto Cartesiano
#endregion
| [
198,
220,
220,
220,
1303,
36996,
8721,
78,
13690,
274,
10115,
198,
220,
220,
220,
1303,
437,
36996,
198
] | 2.526316 | 19 |
from ZipLogInterface import *
import os
import zipfile
import sys
import datetime
import shutil
# déclaration des variables du code principal
local = (os.getcwd())
fichier_conf = str(local + "/conf.ini").replace("\\", "/")
ts = str(datetime.datetime.now())
ts = "_" + ts[0:10] + "_" + ts[11:13] + ts[14:16] + ts[17:19]
... | [
6738,
38636,
11187,
39317,
1330,
1635,
198,
11748,
28686,
198,
11748,
19974,
7753,
198,
11748,
25064,
198,
11748,
4818,
8079,
198,
11748,
4423,
346,
198,
198,
2,
39073,
565,
10186,
748,
9633,
7043,
2438,
10033,
198,
12001,
796,
357,
418,
... | 2.004981 | 5,621 |
#!/usr/bin/env python3
import subprocess
from jinja2 import Environment, Template, FileSystemLoader
import os
import sys
from functools import reduce
env = Environment(loader=FileSystemLoader('configs'))
gpt_out = "build/image_install.raw"
image_files = [
"build/efi/boot/bootx64.efi",
"build/intel-ucode.img... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
850,
14681,
198,
6738,
474,
259,
6592,
17,
1330,
9344,
11,
37350,
11,
9220,
11964,
17401,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
1257,
310,
10141,
1330,
4646,
... | 2.417313 | 774 |
"""
Filename: calc_climate_index.py
Author: Damien Irving, irving.damien@gmail.com
Description: Calculate common climate indices
"""
# Import general Python modules
import sys, os
import argparse
import numpy
import xarray
import pdb
# Import my modules
cwd = os.getcwd()
repo_dir = '/'
for directory in ... | [
37811,
198,
35063,
25,
220,
220,
220,
220,
42302,
62,
42570,
62,
9630,
13,
9078,
198,
13838,
25,
220,
220,
220,
220,
220,
220,
46107,
26101,
11,
4173,
1075,
13,
11043,
2013,
31,
14816,
13,
785,
198,
11828,
25,
220,
27131,
378,
2219,... | 2.142603 | 7,875 |
import pandas as pd
import numpy as np
import random
import pathlib
import os
import pickle
import tqdm
from sklearn.model_selection import train_test_split
import sklearn.metrics
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data
import transformers... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
4738,
198,
11748,
3108,
8019,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
198,
11748,
256,
80,
36020,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330... | 2.008264 | 484 |
"""End-to-end tests for all of Sprockets."""
import os
import shutil
import tempfile
import unittest
import mock
import test_driver
@mock.patch('test_driver.Visualizer')
if __name__ == '__main__':
unittest.main()
| [
37811,
12915,
12,
1462,
12,
437,
5254,
329,
477,
286,
1338,
10823,
1039,
526,
15931,
198,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
11748,
555,
715,
395,
198,
198,
11748,
15290,
198,
198,
11748,
1332,
62,
... | 2.833333 | 78 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-09-01 12:36
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
17,
319,
2177,
12,
2931,
12,
486,
1105,
25,
2623,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.736842 | 57 |
from django.contrib import admin
# Register your models here.
from .models import Recurso
admin.site.register(Recurso)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
6738,
764,
27530,
1330,
3311,
333,
568,
198,
28482,
13,
15654,
13,
30238,
7,
6690,
333,
568,
8,
198
] | 3.27027 | 37 |
import networkx as nx
from scipy.io import loadmat
x = loadmat(dataset)
dataset='blogcatalog.mat'
x = loadmat(dataset)
x = x['network']
G = nx.from_scipy_sparse_matrix(x)
del x
f=open("BC_DW.edgelist",'wb')
nx.write_edgelist(G, f)
| [
11748,
3127,
87,
355,
299,
87,
198,
6738,
629,
541,
88,
13,
952,
1330,
3440,
6759,
198,
87,
796,
3440,
6759,
7,
19608,
292,
316,
8,
198,
19608,
292,
316,
11639,
14036,
9246,
11794,
13,
6759,
6,
198,
87,
796,
3440,
6759,
7,
19608,
... | 2.137615 | 109 |
#!/usr/bin/env python3
#This sample demonstrates turning relay indicator LEDs on and off.
#Install Relay HAT 2 library with "pip3 install turta-relayhat2"
from time import sleep
from turta_relayhat2 import Turta_Relay
#Initialize
relay = Turta_Relay.RelayController(leds_state = True)
try:
while 1:
#Togg... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
1212,
6291,
15687,
6225,
24248,
16916,
33697,
319,
290,
572,
13,
198,
2,
15798,
4718,
323,
367,
1404,
362,
5888,
351,
366,
79,
541,
18,
2721,
256,
3325,
64,
12,
2411,
3... | 2.131105 | 389 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.books, name='books'),
path('all/', views.all, name='all'),
path('open-portal/<int:book>/', views.open_portal, name='open_portal'),
path('download/<int:book>/', views.download, name='download'),
] | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
12106,
11,
1438,
11639,
12106,
33809,
198,
220,
220,
220,
3108,
10786... | 2.663636 | 110 |
import math
import pyaudio
import numpy as np
import scipy.signal as ss
from math import pi, sin, floor
from fractions import gcd
import matplotlib.pyplot as plt
###IMPORT FROM GLOBAL?
SAMPLE_RATE=44100 | [
11748,
10688,
198,
11748,
12972,
24051,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
12683,
282,
355,
37786,
198,
6738,
10688,
1330,
31028,
11,
7813,
11,
4314,
198,
6738,
49876,
1330,
308,
10210,
198,
11748,
2603,
2... | 3.044776 | 67 |
import pandas as pd
import pytest
from sklearn.base import clone
from tests.estimator_checks.dataframe_for_checks import test_df
from tests.estimator_checks.fit_functionality_checks import (
check_feature_names_in,
check_error_if_y_not_passed,
)
from tests.estimator_checks.get_feature_names_out_checks import (... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
12972,
9288,
198,
6738,
1341,
35720,
13,
8692,
1330,
17271,
198,
198,
6738,
5254,
13,
395,
320,
1352,
62,
42116,
13,
7890,
14535,
62,
1640,
62,
42116,
1330,
1332,
62,
7568,
198,
6738,
5254,... | 2.780921 | 1,520 |
import tensorflow as tf
import tensorflow_probability as tfp
#tf.enable_eager_execution()
# Target distribution is proportional to: `exp(-x (1 + x))`.
# Initialize the HMC transition kernel.
num_results = int(10e3)
num_burnin_steps = int(1e3)
adaptive_hmc = tfp.mcmc.SimpleStepSizeAdaptation(
tfp.mcmc.Hamiltonian... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
62,
1676,
65,
1799,
355,
256,
46428,
198,
198,
2,
27110,
13,
21633,
62,
68,
3536,
62,
18558,
1009,
3419,
198,
198,
2,
12744,
6082,
318,
27111,
284,
25,
4600,
11201,
... | 2.381107 | 307 |
#!/usr/bin/python3
from flask import Flask, request, jsonify
import json
from multiprocessing import Process, Queue
from time import sleep
from streamAnimation import StreamAnimation
from rgb import RGB
app = Flask(__name__)
@app.route('/',methods=['POST','GET'])
@app.route('/event_triggered', methods=['POST'])
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
33918,
1958,
198,
11748,
33918,
198,
6738,
18540,
305,
919,
278,
1330,
10854,
11,
4670,
518,
198,
6738,
640,
1330,
3993,
198,
6738,
4269,
3952... | 2.66129 | 186 |
# -*- coding: utf-8 -*-
# ---------------------------------------------------------------------
# DLink.DxS.get_mac_address_table
# ---------------------------------------------------------------------
# Copyright (C) 2007-2019 The NOC Project
# See LICENSE for details
# ------------------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
30934,
198,
2,
360,
11280,
13,
35,
87,
50,
13,
1136,
62,
20285,
62,
21975,
62,
11487,
198,
2,
16529,
30934,
198,
2,
15069,
357,
34,
8,
4343,
12,
23344,
3... | 3.308824 | 204 |
"""Tests of game.py
"""
import unittest
from test.support import captured_stdout
from reversi.game import Game
from reversi.board import Board, BitBoardMethods
from reversi.player import Player
from reversi.display import NoneDisplay
from reversi.strategies.common import AbstractStrategy
class TestGame(unittest.Tes... | [
37811,
51,
3558,
286,
983,
13,
9078,
198,
37811,
198,
198,
11748,
555,
715,
395,
198,
6738,
1332,
13,
11284,
1330,
7907,
62,
19282,
448,
198,
198,
6738,
10372,
72,
13,
6057,
1330,
3776,
198,
6738,
10372,
72,
13,
3526,
1330,
5926,
11... | 3.411765 | 102 |
import json
from urllib.parse import urlparse
# import the requests library to help use query a website
import requests
# import the BeautifulSoup library to help us parse the websites
from bs4 import BeautifulSoup
# The function to query a website
print(json.dumps(scrap_website("https://github.com/gvanrossum?tab... | [
11748,
33918,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
198,
198,
2,
1330,
262,
7007,
5888,
284,
1037,
779,
12405,
257,
3052,
198,
11748,
7007,
198,
198,
2,
1330,
262,
23762,
50,
10486,
5888,
284,
1037,
514,
21136,
262... | 3.086957 | 161 |
print(reverse("This is the yellow way of doing things.")) | [
198,
4798,
7,
50188,
7203,
1212,
318,
262,
7872,
835,
286,
1804,
1243,
526,
4008
] | 3.866667 | 15 |
#!/usr/bin/env python3
if __name__ == '__main__':
with open('input.txt', 'r') as f:
adapters = sorted( int(l.strip()) for l in f.readlines() )
# part 1
difs, prev = [], 0
for joltage in adapters:
difs.append(joltage-prev)
prev = joltage
difs.append(3)
print(difs.count... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
351,
1280,
10786,
15414,
13,
14116,
3256,
705,
81,
11537,
355,
277,
25,
198,
220,
220,
220... | 1.897243 | 399 |
import os
import gym
from gym import wrappers
import random
import torch.optim as optim
from dqn_model import DQN, Dueling_DQN
from dqn_learn import OptimizerSpec, dqn_learning
from utils.schedule import LinearSchedule
from utils.gym_utils import get_env, get_wrapper_by_name
import logz
REPLAY_BUFFER_SIZE = 100000
L... | [
11748,
28686,
198,
11748,
11550,
198,
6738,
11550,
1330,
7917,
11799,
198,
11748,
4738,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
198,
6738,
288,
80,
77,
62,
19849,
1330,
360,
48,
45,
11,
23958,
278,
62,
35,
48,
45,
198,
6738,
2... | 2.611399 | 193 |
from aoc.year2019.day6.day6 import create_planets, distance_between
| [
6738,
257,
420,
13,
1941,
23344,
13,
820,
21,
13,
820,
21,
1330,
2251,
62,
11578,
1039,
11,
5253,
62,
23395,
628,
198
] | 3.043478 | 23 |
###
# Copyright (c) 2013, tann <tann@trivialand.org>
# Copyright (c) 2020, oddluck <oddluck@riseup.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must ... | [
21017,
198,
2,
15069,
357,
66,
8,
2211,
11,
256,
1236,
1279,
83,
1236,
31,
83,
15104,
498,
392,
13,
2398,
29,
198,
2,
15069,
357,
66,
8,
12131,
11,
5629,
46708,
1279,
5088,
46708,
31,
17163,
929,
13,
3262,
29,
198,
2,
1439,
2489... | 2.029931 | 47,208 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from resnet import _Stem, _ResLayer, _ConvBnReLU
if __name__ == "__main__":
rate = list((6, 12, 18, 24))
model = Model(base=Deeplabv2(num_classes=21, num_blocks=[3, 4, 23, 3], atrous_rates=rate), scales=(0.5, 0.75))
model.... | [
11748,
28034,
201,
198,
11748,
28034,
13,
20471,
355,
299,
77,
201,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
201,
198,
6738,
581,
3262,
1330,
4808,
1273,
368,
11,
4808,
4965,
49925,
11,
4808,
3103,
85,
33,
77,
3041,
41596,
... | 2.153439 | 189 |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | [
2,
33476,
8113,
273,
14,
37906,
532,
33476,
4639,
3194,
287,
11361,
13,
198,
2,
15069,
357,
66,
8,
2321,
11,
2177,
11,
18650,
290,
14,
273,
663,
29116,
13,
1439,
2489,
10395,
13,
198,
198,
2,
33476,
8113,
273,
14,
37906,
318,
1197... | 3.360934 | 471 |
import os
import sys
os.system("nohup bash -c '" +
sys.path[0] + "/main_pipe.py --size 192 >result.txt" +
"' &")
| [
11748,
28686,
198,
11748,
25064,
198,
198,
418,
13,
10057,
7203,
77,
1219,
929,
27334,
532,
66,
705,
1,
1343,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25064,
13,
6978,
58,
15,
60,
1343,
12813,
12417,
62,
34360,
13,
9078,
... | 2.030303 | 66 |
import hashlib
from datetime import datetime
class VotesContainer(object):
"""
Class used to model a votes container.
In blockchain protocol this is a block.
"""
_MAX_VOTES_PER_CONTAINER = 5
def __init__(self, **args):
"""
args:
id (str):
The ... | [
11748,
12234,
8019,
198,
6738,
4818,
8079,
1330,
4818,
8079,
628,
198,
4871,
39584,
29869,
7,
15252,
2599,
628,
220,
220,
220,
37227,
198,
220,
220,
220,
5016,
973,
284,
220,
2746,
257,
5690,
9290,
13,
198,
220,
220,
220,
554,
11779,
... | 2.20241 | 830 |
# coding=utf-8
from __future__ import absolute_import
from terminal.apps.openapi import route
| [
2,
19617,
28,
40477,
12,
23,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
12094,
13,
18211,
13,
9654,
15042,
1330,
6339,
198
] | 3.428571 | 28 |
from debug_toolbar.panels import DebugPanel
from django.conf import settings
from django.template.base import Template
from django.template.loader_tags import BlockNode
from debug_toolbar.utils.tracking import replace_call
from debug_toolbar.panels import sql
from django.core.exceptions import ImproperlyConfigured
impo... | [
6738,
14257,
62,
25981,
5657,
13,
6839,
1424,
1330,
31687,
26639,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
28243,
13,
8692,
1330,
37350,
198,
6738,
42625,
14208,
13,
28243,
13,
29356,
62,
31499,
1330,
... | 2.490506 | 632 |
import argparse
import os
parser = argparse.ArgumentParser()
parser.add_argument('--dataroot', type=str,
default='/eva_data/zchin/rsna_data_all', help='raw data dir')
args = parser.parse_args()
if __name__ == '__main__':
# train data
annot_dir = os.path.join(args.dataroot, 'annotations/t... | [
11748,
1822,
29572,
198,
11748,
28686,
628,
198,
48610,
796,
1822,
29572,
13,
28100,
1713,
46677,
3419,
198,
48610,
13,
2860,
62,
49140,
10786,
438,
67,
9459,
1025,
3256,
2099,
28,
2536,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220... | 1.988636 | 704 |
import morepath
@App.path(path="{name}")
@App.html(model=Person, template="person.unknown")
| [
11748,
517,
6978,
628,
198,
198,
31,
4677,
13,
6978,
7,
6978,
2625,
90,
3672,
92,
4943,
628,
198,
31,
4677,
13,
6494,
7,
19849,
28,
15439,
11,
11055,
2625,
6259,
13,
34680,
4943,
198
] | 2.771429 | 35 |
from dataclasses import asdict, dataclass
from datetime import date, datetime
from enum import Enum
from typing import Any, Dict
from .regime import Regime
@dataclass(eq=True, frozen=True)
| [
6738,
4818,
330,
28958,
1330,
355,
11600,
11,
4818,
330,
31172,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
198,
6738,
33829,
1330,
2039,
388,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
198,
198,
6738,
764,
2301,
524,
1330,
33... | 3.177419 | 62 |
import os
from io import StringIO
from lxml import etree as ET
from lxml.etree import XMLSyntaxError
from lxml import html
current_path = os.path.dirname(os.path.realpath(__file__))
def readFile(path):
""" Returns the String contained in the file passed by parameter.
Returns:
str: File content on a s... | [
198,
11748,
28686,
198,
6738,
33245,
1330,
10903,
9399,
198,
198,
6738,
300,
19875,
1330,
2123,
631,
355,
12152,
198,
6738,
300,
19875,
13,
316,
631,
1330,
23735,
13940,
41641,
12331,
198,
6738,
300,
19875,
1330,
27711,
198,
198,
14421,
... | 2.644828 | 2,900 |
import datetime as dt
import random
from unittest import TestCase, mock
from dimensigon import defaults
from dimensigon.domain.entities import Server, Route, Scope
from dimensigon.web import db
from dimensigon.web.helpers import get_servers_from_scope
from tests.base import FlaskAppMixin
old_age = dt.datetime(2019, 4... | [
11748,
4818,
8079,
355,
288,
83,
198,
11748,
4738,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
11,
15290,
198,
198,
6738,
5391,
641,
37107,
1330,
26235,
198,
6738,
5391,
641,
37107,
13,
27830,
13,
298,
871,
1330,
9652,
11,
18956,
11,... | 2.906475 | 139 |
from dataclasses import dataclass
from more_itertools import pairwise
from typing import List
@dataclass(frozen=True)
# An ordered list of vertices whose first and last entry are the same
Polygon = List[Point]
def is_left(point: Point, l0: Point, l1: Point) -> float:
'''Determine if a point is to the left of ... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
517,
62,
270,
861,
10141,
1330,
5166,
3083,
198,
6738,
19720,
1330,
7343,
628,
198,
31,
19608,
330,
31172,
7,
69,
42005,
28,
17821,
8,
628,
198,
2,
1052,
6149,
1351,
286,
94... | 2.781667 | 600 |
# Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from openvino.tools.mo.ops.activation_ops import Sigmoid, Tanh
from openvino.tools.mo.ops.elementwise import Add, Mul
from openvino.tools.mo.ops.split import Split, AttributedVariadicSplit
from openvino.tools.mo.front... | [
2,
15069,
357,
34,
8,
2864,
12,
1238,
2481,
8180,
10501,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1280,
85,
2879,
13,
31391,
13,
5908,
13,
... | 3.036145 | 249 |
import rest_framework_filters as filters
from drf_core.utils import get_queryset_by_order
| [
11748,
1334,
62,
30604,
62,
10379,
1010,
355,
16628,
198,
6738,
1553,
69,
62,
7295,
13,
26791,
1330,
651,
62,
10819,
893,
316,
62,
1525,
62,
2875,
628
] | 3.25 | 28 |
# modules/FlowProjectionModule.py
from torch.nn.modules.module import Module
from .DepthFlowProjectionLayer import DepthFlowProjectionLayer
__all__ =['DepthFlowProjectionModule']
| [
2,
13103,
14,
37535,
16775,
295,
26796,
13,
9078,
198,
6738,
28034,
13,
20471,
13,
18170,
13,
21412,
1330,
19937,
198,
6738,
764,
48791,
37535,
16775,
295,
49925,
1330,
36350,
37535,
16775,
295,
49925,
198,
198,
834,
439,
834,
796,
1781... | 3.770833 | 48 |
import numpy as np
from EvaluationFunctions.EvaluateDetectionTimes import evaluate_detection_times
from EvaluationFunctions.EvaluatePerformanceMatrix import evaluate_performance_matrix
def evaluate_with_labels(actual_drift_points, detected_drift_points, acceptance_levels):
"""
Parameters
----------
a... | [
11748,
299,
32152,
355,
45941,
198,
6738,
34959,
24629,
2733,
13,
36,
2100,
4985,
11242,
3213,
28595,
1330,
13446,
62,
15255,
3213,
62,
22355,
198,
6738,
34959,
24629,
2733,
13,
36,
2100,
4985,
32273,
46912,
1330,
13446,
62,
26585,
62,
... | 2.891963 | 759 |
from xml.sax.handler import ContentHandler, ErrorHandler
class MyHandler(ContentHandler, ErrorHandler):
"""A content handler"""
# ContentHandler ############################
def startElementNS(self, name, qname, attr):
"""TODO: improve this"""
print "Start NS element:", name, qname,
... | [
6738,
35555,
13,
82,
897,
13,
30281,
1330,
14041,
25060,
11,
13047,
25060,
198,
198,
4871,
2011,
25060,
7,
19746,
25060,
11,
13047,
25060,
2599,
198,
220,
220,
220,
37227,
32,
2695,
21360,
37811,
628,
220,
220,
220,
1303,
14041,
25060,
... | 2.712963 | 216 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |