content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import aiohttp
import asyncio
import os
import time
from datetime import datetime
from telethon import events
from telethon.tl.types import DocumentAttributeVideo
import json
import subprocess
import math
from pySmartDL import SmartDL
from hachoir.metadata import extractMetadata
from hachoir.parser import createParser
... | [
11748,
257,
952,
4023,
198,
11748,
30351,
952,
198,
11748,
28686,
198,
11748,
640,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
5735,
400,
261,
1330,
2995,
198,
6738,
5735,
400,
261,
13,
28781,
13,
19199,
1330,
16854,
33682,
1079... | 1.800691 | 5,208 |
import cherrypy
import sys
import mysql.connector
from collections import OrderedDict
#Define database variables
DATABASE_USER = 'root'
DATABASE_HOST = '127.0.0.1'
DATABASE_NAME = 'feedND'
#Create connection to MySQL
cnx = mysql.connector.connect(user=DATABASE_USER, host=DATABASE_HOST, database=DATABASE_NAME)
cursor ... | [
11748,
23612,
9078,
198,
11748,
25064,
198,
11748,
48761,
13,
8443,
273,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
2,
7469,
500,
6831,
9633,
198,
35,
1404,
6242,
11159,
62,
29904,
796,
705,
15763,
6,
198,
35,
1404,
6242,... | 2.805755 | 139 |
import math
@stars
if __name__ == '__main__':
explain('prints out all math functions')
print(dir(math))
| [
11748,
10688,
198,
198,
31,
30783,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
4727,
10786,
17190,
503,
477,
10688,
5499,
11537,
198,
220,
220,
220,
3601,
7,
15908,
7,
11018,
4008,
628
] | 2.804878 | 41 |
from django.conf.urls import url
from orders import views
urlpatterns = [
url(r'^orders/settlement/$', views.OrderSettlementView.as_view()),
url(r'^orders/$', views.OrdersView.as_view()),
url(r'^orders/(?P<order_id>\d+)/uncommentgoods/$',views.OrdersUnCommentView.as_view()),
url(r'^orders/(?P<order_id... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
198,
6738,
6266,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
6361,
14,
17744,
1732,
32624,
3256,
5009,
13,
18743,
50,
27331... | 2.364583 | 192 |
"""
thermodynamics
"""
def x(yf, y, yg):
"""Returns the quality of the two-phase mixture"""
if y < yf:
return 0
elif y > yg:
return 1
else:
return (y - yf) / (yg - yf)
if __name__ == '__main__':
from clay.tests import testif
from clay.utils import qualify
single... | [
198,
37811,
198,
490,
76,
44124,
198,
198,
37811,
198,
198,
4299,
2124,
7,
88,
69,
11,
331,
11,
331,
70,
2599,
198,
220,
220,
220,
37227,
35561,
262,
3081,
286,
262,
734,
12,
40715,
11710,
37811,
198,
220,
220,
220,
611,
331,
1279... | 1.993435 | 457 |
# -*- coding: utf-8 -*-
"""
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License.
This program is distributed in the hope that it will be useful,
but W... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
220,
220,
220,
770,
1430,
318,
1479,
3788,
25,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
198,
220,
220,
220,
340,
739,
262,
2846,
286,
262,
2... | 2.206382 | 1,943 |
#
# Copyright 2017-2018 European Centre for Medium-Range Weather Forecasts (ECMWF).
#
# 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... | [
2,
198,
2,
15069,
2177,
12,
7908,
3427,
9072,
329,
13398,
12,
17257,
15615,
4558,
40924,
357,
2943,
14326,
37,
737,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
... | 2.380435 | 828 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-11-15 16:13
from __future__ import unicode_literals
import django.db.models.deletion
from django.conf import settings
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,
20,
319,
2177,
12,
1157,
12,
1314,
1467,
25,
1485,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.883117 | 77 |
# -*- encoding=utf-8 -*-
import utils
from modules.downloader import Downloader
class Scheduler:
""" 调度模块
"""
if __name__ == '__main__':
Scheduler().process()
| [
2,
532,
9,
12,
21004,
28,
40477,
12,
23,
532,
9,
12,
198,
11748,
3384,
4487,
198,
6738,
13103,
13,
15002,
263,
1330,
10472,
263,
628,
198,
4871,
27774,
18173,
25,
198,
220,
220,
220,
37227,
5525,
108,
225,
41753,
99,
162,
101,
94,... | 2.346667 | 75 |
# Write a short Python function that takes a positive integer n and returns
# the sum of the squares of all the odd positive integers smaller than n.
print(odd_squares(9))
print(odd_squares(4002))
print(odd_squares(833))
print(odd_squares(6))
print(odd_squares(112))
| [
2,
19430,
257,
1790,
11361,
2163,
326,
2753,
257,
3967,
18253,
299,
290,
5860,
198,
2,
262,
2160,
286,
262,
24438,
286,
477,
262,
5629,
3967,
37014,
4833,
621,
299,
13,
628,
198,
4798,
7,
5088,
62,
16485,
3565,
7,
24,
4008,
198,
4... | 3.214286 | 84 |
#! /usr/bin/env python3
"""Downloads all graphs used in the experiments to the correct locations.
Query results are sparse matrices. Any matrix which isn't square is removed
since it does not define a graph.
Usage: python3 setyp.py
"""
import ssgetpy
import os
# Maximum results when querying website.
QUERY_LIMIT ... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
10002,
82,
477,
28770,
973,
287,
262,
10256,
284,
262,
3376,
7064,
13,
198,
198,
20746,
2482,
389,
29877,
2603,
45977,
13,
4377,
17593,
543,
2125,
470,
6616,
318,
4... | 2.785714 | 308 |
# Copyright 2021 The Kubeflow Authors
#
# 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,
15069,
33448,
383,
24921,
891,
9319,
46665,
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,
... | 3.385638 | 376 |
"""
DeepLabv3 for image segmentation, implemented in Gluon.
Original paper: 'Rethinking Atrous Convolution for Semantic Image Segmentation,' https://arxiv.org/abs/1706.05587.
"""
__all__ = ['DeepLabv3', 'deeplabv3_resnetd50b_voc', 'deeplabv3_resnetd101b_voc', 'deeplabv3_resnetd152b_voc',
'deeplabv3_... | [
37811,
198,
220,
220,
220,
10766,
17822,
85,
18,
329,
2939,
10618,
341,
11,
9177,
287,
402,
2290,
261,
13,
198,
220,
220,
220,
13745,
3348,
25,
705,
49,
2788,
8040,
1629,
7596,
34872,
2122,
329,
12449,
5109,
7412,
1001,
5154,
341,
4... | 2.650494 | 5,668 |
import os
from dodo_commands import CommandError, Dodo
from dodo_commands.framework.util import to_arg_list
if Dodo.is_main(__name__):
args = _args()
Dodo.safe = len(args.extra_dirs) == 0
_copy_extra_dirs(args.build_dir, args.extra_dirs)
try:
Dodo.run(
[
"dock... | [
11748,
28686,
198,
198,
6738,
20764,
78,
62,
9503,
1746,
1330,
9455,
12331,
11,
15990,
78,
198,
6738,
20764,
78,
62,
9503,
1746,
13,
30604,
13,
22602,
1330,
284,
62,
853,
62,
4868,
628,
628,
198,
198,
361,
15990,
78,
13,
271,
62,
... | 1.737662 | 385 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
... | 3.24025 | 641 |
import sqlite3
#connection obj that represent our database with in memory database to create a file called employee database file
conn = sqlite3.connect(':memory:') #so it can start from scratch, if you dont want to keep deleting a database over and over..you add :memory:
#to create a cursor to start running sql comman... | [
11748,
44161,
578,
18,
198,
2,
38659,
26181,
326,
2380,
674,
6831,
351,
287,
4088,
6831,
284,
2251,
257,
2393,
1444,
6538,
6831,
2393,
198,
37043,
796,
44161,
578,
18,
13,
8443,
7,
10354,
31673,
25,
11537,
1303,
568,
340,
460,
923,
... | 2.906122 | 245 |
import pytest
from check_wheel_contents.errors import WheelValidationError
from check_wheel_contents.util import (
comma_split,
find_wheel_dirs,
is_data_dir,
is_dist_info_dir,
is_stubs_dir,
pymodule_basename,
)
@pytest.mark.parametrize(
"filename,expected",
[
("foo.py", "foo"),... | [
11748,
12972,
9288,
198,
6738,
2198,
62,
22001,
62,
3642,
658,
13,
48277,
1330,
15810,
7762,
24765,
12331,
198,
6738,
2198,
62,
22001,
62,
3642,
658,
13,
22602,
1330,
357,
198,
220,
220,
220,
39650,
62,
35312,
11,
198,
220,
220,
220,
... | 1.599103 | 3,789 |
from setuptools import setup
setup(name='pycdhit',
version='0.0.1',
description='CDHIT results analysis tool set',
#url='http://github.com/storborg/funniest',
author='Blazej Marciniak',
author_email='blazejmarciniak@gmail.com',
license='Apache 2.0',
packages=['pycdhit... | [
6738,
900,
37623,
10141,
1330,
9058,
201,
198,
201,
198,
40406,
7,
3672,
11639,
9078,
10210,
17945,
3256,
201,
198,
220,
220,
220,
220,
220,
2196,
11639,
15,
13,
15,
13,
16,
3256,
201,
198,
220,
220,
220,
220,
220,
6764,
11639,
8610... | 2.106977 | 215 |
"""A filter that can parse sphinx docs
"""
__author__ = 'jay'
__version__ = (0, 0, 1, 'alpha', 0)
catalog = ['read']
form = {
"lang" : {
"verbose": "Language",
"require": False,
"type": "select",
"choices": [["python2", "Python 2"], ["python3", "Python 3"]],
"value": "pytho... | [
37811,
32,
8106,
326,
460,
21136,
599,
20079,
87,
34165,
198,
37811,
198,
198,
834,
9800,
834,
796,
705,
33708,
6,
198,
834,
9641,
834,
796,
357,
15,
11,
657,
11,
352,
11,
705,
26591,
3256,
657,
8,
198,
198,
9246,
11794,
796,
3725... | 2.253546 | 564 |
# Generated by Django 2.2.4 on 2019-08-20 20:44
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import wagtail.contrib.table_block.blocks
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.embeds.blocks
import wagtail.images.blocks
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
19,
319,
13130,
12,
2919,
12,
1238,
1160,
25,
2598,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
... | 2.990196 | 102 |
"""
Copyright (c) 2018 Doyub Kim
I am making my contributions/submissions to this project solely in my personal
capacity and am not conveying any rights to any intellectual property of any
third parties.
"""
import pyjet
import unittest
if __name__ == '__main__':
main()
| [
37811,
198,
15269,
357,
66,
8,
2864,
360,
726,
549,
6502,
198,
198,
40,
716,
1642,
616,
9284,
14,
7266,
8481,
284,
428,
1628,
9944,
287,
616,
2614,
198,
42404,
290,
716,
407,
24748,
1112,
597,
2489,
284,
597,
9028,
3119,
286,
597,
... | 3.5375 | 80 |
"""
Процентная ставка по вкладу составляет P процентов годовых, которые
прибавляются к сумме вклада. Вклад составляет X рублей Y копеек.
Определите размер вклада через год. При решении этой задачи нельзя
пользоваться условными инструкциями и циклами.
Формат ввода
Программа получает на вход целые числа P, X, Y.
Формат... | [
37811,
198,
140,
253,
21169,
15166,
141,
228,
16843,
22177,
20375,
22177,
16142,
40623,
220,
21727,
20375,
16142,
38857,
31583,
16142,
12466,
123,
15166,
12466,
110,
31583,
30143,
16142,
43666,
35072,
220,
21727,
15166,
21727,
20375,
16142,
3... | 1.091078 | 538 |
import os
import hashlib
import asyncio
from aiohttp import web
from multidict import MultiDict
from services.utils import (METADATA_SERVICE_HEADER, METADATA_SERVICE_VERSION,
SERVICE_BUILD_TIMESTAMP, SERVICE_COMMIT_HASH,
web_response)
from .utils import get_json... | [
11748,
28686,
198,
11748,
12234,
8019,
198,
11748,
30351,
952,
198,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
6738,
1963,
312,
713,
1330,
15237,
35,
713,
198,
6738,
2594,
13,
26791,
1330,
357,
47123,
2885,
13563,
62,
35009,
27389,
62,... | 2.005609 | 3,922 |
from unittest import TestCase
from django_tally.user_def.lang import parse, KW, serialize
from django_tally.user_def.lang.parser import parse_tokens
source = """
(do
(defn fib (n)
(if (in '(0 1) n)
1
(+ (fib (- n 1)) (fib (- n 2)))))
(fib 10)
[1 2 3]
{1 2 3}
#{1 2 3}
#[1 2 3]
^foo)
"""
... | [
6738,
555,
715,
395,
1330,
6208,
20448,
198,
198,
6738,
42625,
14208,
62,
83,
453,
13,
7220,
62,
4299,
13,
17204,
1330,
21136,
11,
509,
54,
11,
11389,
1096,
198,
6738,
42625,
14208,
62,
83,
453,
13,
7220,
62,
4299,
13,
17204,
13,
... | 1.570458 | 589 |
from conftest import run_setup_sql
from pgbedrock import memberships as memb
from pgbedrock import attributes
ROLE1 = 'charlie'
ROLE2 = 'barney'
ROLE3 = 'wacko'
DESIRED_GROUP1 = 'desired_group1'
DESIRED_GROUP2 = 'desired_group2'
CURRENT_GROUP1 = 'current_group1'
CURRENT_GROUP2 = 'current_group2'
Q_HAS_ROLE = "SELECT... | [
6738,
369,
701,
395,
1330,
1057,
62,
40406,
62,
25410,
198,
6738,
23241,
3077,
10823,
1330,
1866,
5748,
355,
1066,
65,
198,
6738,
23241,
3077,
10823,
1330,
12608,
628,
198,
13252,
2538,
16,
796,
705,
354,
7063,
494,
6,
198,
13252,
253... | 2.213225 | 741 |
"""
Apps.py:
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class AccountsConfig(AppConfig):
"""
AccountsConfig(AppConfig):
Accounts app configuration
"""
name = 'accounts'
| [
37811,
198,
48433,
13,
9078,
25,
198,
37811,
198,
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,
18211,
1330,
2034,
16934,
... | 2.712766 | 94 |
from flask import render_template
| [
6738,
42903,
1330,
8543,
62,
28243,
198
] | 4.857143 | 7 |
"""
Django settings for {{ project_name }} project on Heroku. For more info, see:
https://github.com/heroku/heroku-django-template
For more information on this file, see
https://docs.djangoproject.com/en/2.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.0/ref... | [
37811,
198,
35,
73,
14208,
6460,
329,
22935,
1628,
62,
3672,
34949,
1628,
319,
2332,
11601,
13,
1114,
517,
7508,
11,
766,
25,
198,
5450,
1378,
12567,
13,
785,
14,
11718,
23063,
14,
11718,
23063,
12,
28241,
14208,
12,
28243,
198,
198,
... | 2.438517 | 2,212 |
import sys
from src.model.migrations import migrate_schema
if __name__ == "__main__":
if len(sys.argv) == 1:
print(
"""Specify argument.
Possible commands:
migrate
convert users
convert blogs
For launching flask server see README.md"""
)
elif sys.argv[1] == "migrate":
from s... | [
11748,
25064,
198,
6738,
12351,
13,
19849,
13,
76,
3692,
602,
1330,
32492,
62,
15952,
2611,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
611,
18896,
7,
17597,
13,
853,
85,
8,
6624,
352,
25,
... | 2.206452 | 310 |
import random
from curses import *
from random import randint
depth = 5
| [
11748,
4738,
198,
6738,
43878,
1330,
1635,
198,
6738,
4738,
1330,
43720,
600,
198,
198,
18053,
796,
642,
628,
198
] | 3.75 | 20 |
"""
Module for resolving circular imports via "interfaces"
"""
import abc
| [
37811,
198,
26796,
329,
31038,
18620,
17944,
2884,
366,
3849,
32186,
1,
198,
37811,
198,
198,
11748,
450,
66,
628,
628,
198
] | 3.590909 | 22 |
#To complete
# Main
from sys import setrecursionlimit
setrecursionlimit(11000)
n=int(input())
arr=list(int(i) for i in input().strip().split(' '))
x=int(input())
idx=0
print(firstIndex(arr, x, idx))
| [
2,
2514,
1844,
198,
198,
2,
8774,
198,
6738,
25064,
1330,
900,
8344,
24197,
32374,
198,
2617,
8344,
24197,
32374,
7,
1157,
830,
8,
198,
77,
28,
600,
7,
15414,
28955,
198,
3258,
28,
4868,
7,
600,
7,
72,
8,
329,
1312,
287,
5128,
2... | 2.597403 | 77 |
#!/usr/bin/env python
#coding: utf-8
import watchtipstest
import unittest
from index import app
if __name__ == '__main__':
suite = unittest.TestLoader().loadTestsFromTestCase(AppController)
watchtipstest.main(suite)
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
66,
7656,
25,
3384,
69,
12,
23,
198,
198,
11748,
2342,
22504,
301,
395,
198,
11748,
555,
715,
395,
198,
6738,
6376,
1330,
598,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
8... | 2.682353 | 85 |
#!/usr/bin/env python
import sys
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
1388,
3419,
628
] | 2.517241 | 29 |
from random import *
import copy
| [
6738,
4738,
1330,
1635,
198,
11748,
4866,
198
] | 4.125 | 8 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
import datetime
import decimal
import inspect
import time
import warnings
from operator import itemgett... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
2211,
10009,
911,
273,
259,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,
3788,
318,
11971,
355,
3417,
287,
262,
2393,
27975,
4... | 2.967233 | 824 |
# ОПРЕДЕЛЕНИЕ РЕАЛЬНОГО ПЕРЕДАТОЧНОГО ОТНОШЕНИЯ: #
# ВЫПОЛНИТЕ СЛЕДУЮЩИЕ ДЕЙСТВИЯ: #
# После старта скрипта, в мониторе будут появляться значения 0.00
# При вращении ротора мотора (в любую сторону), эти значения будут увеличиваться.
# Поворачивайте вручную ротор мотора до тех пор пока вал реду... | [
2,
12466,
252,
140,
253,
140,
254,
140,
243,
140,
242,
140,
243,
140,
249,
140,
243,
140,
251,
140,
246,
140,
243,
12466,
254,
140,
243,
140,
238,
140,
249,
140,
105,
140,
251,
140,
252,
140,
241,
140,
252,
12466,
253,
140,
243,... | 1.009188 | 1,959 |
"""
Utils
This file provides an implementation of helping classes and functions.
"""
import abc
import pandas as pd
import plotly.express as px
import plotly.graph_objects as go
try:
import cPickle as pickle
except ModuleNotFoundError:
import pickle
class Picklable:
"""
Simple class for saving (and... | [
37811,
198,
18274,
4487,
198,
198,
1212,
2393,
3769,
281,
7822,
286,
5742,
6097,
290,
5499,
13,
198,
37811,
198,
198,
11748,
450,
66,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
7110,
306,
13,
42712,
355,
279,
87,
198,
11748,
... | 2.303069 | 1,564 |
import os
import unittest
from test import fixture
from .config import yaml_config
| [
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
6738,
1332,
1330,
29220,
198,
198,
6738,
220,
764,
11250,
1330,
331,
43695,
62,
11250,
628,
628,
628,
628
] | 3.321429 | 28 |
import argparse
from shutil import copyfile
import os
from Bio import SeqIO
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Add fasta to decoy db')
parser.add_argument('--decoy_fasta', required=True)
cwd=os.path.dirname(os.path.realpath(__file__))
NANO_DIR=os.path.di... | [
11748,
1822,
29572,
201,
198,
6738,
4423,
346,
1330,
4866,
7753,
201,
198,
11748,
28686,
201,
198,
6738,
16024,
1330,
1001,
80,
9399,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
22... | 2.308844 | 735 |
from .__version__ import __version__
from .interface import WriteError, RemoteStorage, StorageLevel
from .exceptions import *
from .local import *
from .ssh import SSHLocation
| [
6738,
764,
834,
9641,
834,
1330,
11593,
9641,
834,
198,
6738,
764,
39994,
1330,
19430,
12331,
11,
21520,
31425,
11,
20514,
4971,
198,
6738,
764,
1069,
11755,
1330,
1635,
198,
6738,
764,
12001,
1330,
1635,
198,
6738,
764,
45824,
1330,
67... | 4 | 44 |
from django.conf.urls import url, include
urlpatterns = [
url(r'^$', 'megashop.views.home', name='home'),
]
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
3,
3256,
705,
28917,
1077,
404,
13,
33571,
13,
11195,
3256,
1438,
11639,
11195,
33809,... | 2.456522 | 46 |
class Config(object):
"""Config class for quick test"""
DEBUG = False
TICKER_LIST = ['AMZN', 'DIS', 'FOX', 'GE', 'GILD', 'GOOGL', 'HPE', 'HLT', 'HFC', 'INFO', 'IBM', 'JPM', 'LKQ', 'MSFT', 'MSCI', 'NDAQ', 'NFLX', 'NVDA', 'PLTR', 'RH', 'SPCE', 'YUM', 'ZTS']
| [
4871,
17056,
7,
15252,
2599,
198,
220,
220,
220,
37227,
16934,
1398,
329,
2068,
1332,
37811,
198,
220,
220,
220,
16959,
796,
10352,
198,
220,
220,
220,
309,
11860,
1137,
62,
45849,
796,
37250,
2390,
57,
45,
3256,
705,
26288,
3256,
705... | 2.169355 | 124 |
#!/usr/bin/env python3
# imports go here
import time as time
import numpy as np
import scipy as sp
import matplotlib.pyplot as plt
from sklearn.feature_extraction.image import grid_to_graph
from sklearn.cluster import AgglomerativeClustering
#
# Free Coding session for 2015-06-09
# Written by Matt Warren
#
lena = sp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
17944,
467,
994,
198,
198,
11748,
640,
355,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
599,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
4... | 2.504425 | 339 |
import datetime
import uuid
import pytest
from sqlalchemy.exc import IntegrityError, SQLAlchemyError
from app import db
from app.dao.organisation_dao import (
dao_add_service_to_organisation,
dao_add_user_to_organisation,
dao_get_organisation_by_email_address,
dao_get_organisation_by_id,
dao_get_o... | [
11748,
4818,
8079,
198,
11748,
334,
27112,
198,
198,
11748,
12972,
9288,
198,
6738,
44161,
282,
26599,
13,
41194,
1330,
39348,
12331,
11,
16363,
2348,
26599,
12331,
198,
198,
6738,
598,
1330,
20613,
198,
6738,
598,
13,
67,
5488,
13,
997... | 2.377919 | 471 |
# 解释器模式
class AbstractExpression:
'''抽象解释器'''
class TerminalExpression(AbstractExpression):
'''继承抽象解释器,具体解释器终端'''
if __name__ == '__main__':
context = Context()
context.name = 'alex'
arrs = [NotTerminalExpression(),TerminalExpression(),TerminalExpression()]
for entry in arrs:
entry... | [
2,
5525,
100,
96,
34932,
232,
161,
247,
101,
162,
101,
94,
28156,
237,
198,
198,
4871,
27741,
16870,
2234,
25,
198,
220,
220,
220,
705,
7061,
162,
232,
121,
164,
109,
94,
164,
100,
96,
34932,
232,
161,
247,
101,
7061,
6,
628,
19... | 1.858696 | 184 |
# -*- coding: utf-8 -*-
__author__ = "Paul Schifferer <dm@sweetrpg.com>"
"""Common exceptions.
"""
class ObjectNotFound(Exception):
"""An exception for objects not found."""
pass
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
9800,
834,
796,
366,
12041,
41665,
11882,
1279,
36020,
31,
34751,
81,
6024,
13,
785,
24618,
198,
37811,
17227,
13269,
13,
198,
37811,
628,
198,
4871,
9515,
3673,
21... | 2.878788 | 66 |
from typing import List, Tuple
arr, window_size = read_input()
print(" ".join(map(str, moving_average(arr, window_size))))
| [
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
3258,
11,
4324,
62,
7857,
796,
1100,
62,
15414,
3419,
198,
4798,
7203,
27071,
22179,
7,
8899,
7,
2536,
11,
3867,
62,
23913,
7,
3258,
11,
4324,
62,
7857,
35514,
198
] | 3.1 | 40 |
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ
# SPDX-FileCopyrightText: 2021 Janek Groehl
# SPDX-License-Identifier: MIT
import numpy as np
import struct
import subprocess
from simpa.utils import Tags, Settings
from simpa.core.simulation_modules.optical_simulation_module import OpticalFo... | [
2,
30628,
55,
12,
8979,
15269,
8206,
25,
33448,
7458,
286,
49452,
8366,
11998,
11,
32975,
37,
57,
198,
2,
30628,
55,
12,
8979,
15269,
8206,
25,
33448,
2365,
988,
10299,
17231,
75,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
... | 2.194358 | 6,735 |
for i in range(int(input())):
n = input()
if len(n)>10:
print(n[0], len(n)-2, n[-1], sep="")
else:
print(n)
| [
1640,
1312,
287,
2837,
7,
600,
7,
15414,
28955,
2599,
198,
220,
220,
220,
299,
796,
5128,
3419,
198,
220,
220,
220,
611,
18896,
7,
77,
8,
29,
940,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
77,
58,
15,
4357,
18896,
7... | 1.766234 | 77 |
import sys
from pathlib import Path
import os
import setuptools
long_description = (Path(__file__).parent / "README.md").read_text()
if sys.version_info < (3, 6):
sys.exit("Python>=3.6 is required by Forte.")
VERSION_VAR = "VERSION"
version = {}
with open(
os.path.join(os.path.dirname(os.path.abspath(__file... | [
11748,
25064,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
28686,
198,
198,
11748,
900,
37623,
10141,
198,
198,
6511,
62,
11213,
796,
357,
15235,
7,
834,
7753,
834,
737,
8000,
1220,
366,
15675,
11682,
13,
9132,
11074,
961,
62,
5239,
... | 1.980242 | 1,569 |
import discord
from discord.ext import commands
from googleapiclient.discovery import build
youtube=build('youtube','v3',developerKey='')
client=commands.Bot(command_prefix = ">")
@client.event
@client.event
#await message.channel.send(message.content)
@client.command()
@client.command()
... | [
11748,
36446,
201,
198,
6738,
36446,
13,
2302,
1330,
9729,
201,
198,
6738,
23645,
499,
291,
75,
1153,
13,
67,
40821,
1330,
1382,
201,
198,
201,
198,
11604,
28,
11249,
10786,
11604,
41707,
85,
18,
3256,
16244,
263,
9218,
28,
7061,
8,
... | 2.551136 | 176 |
import xlrd
import numpy as np
import sys
import math
a = 3
b = 7
mean = round( a / b,2 )
print(mean)
| [
11748,
2124,
75,
4372,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
11748,
10688,
198,
64,
796,
513,
198,
65,
796,
767,
198,
32604,
796,
2835,
7,
257,
1220,
275,
11,
17,
1267,
198,
4798,
7,
32604,
8,
198
] | 2.487805 | 41 |
from datetime import date
import pytest
from tvseries.core.forms import TVSerieForm
from tvseries.config import TestConfig
@pytest.mark.usefixtures('client_class')
| [
6738,
4818,
8079,
1330,
3128,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
31557,
25076,
13,
7295,
13,
23914,
1330,
3195,
7089,
494,
8479,
198,
6738,
31557,
25076,
13,
11250,
1330,
6208,
16934,
628,
198,
31,
9078,
9288,
13,
4102,
13,
... | 3.36 | 50 |
import numpy as np
import numba
import scipy
def estimate_nfactor_act(X, C=1):
"""
estimate number of factors given data matrix X (n*p)
threshold on eigenvalues of correlation matrix (bias corrected)
https://arxiv.org/abs/1909.10710
K = # eigenvalues of sample corr that > 1 + sqrt(p / (n... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
997,
7012,
201,
198,
11748,
629,
541,
88,
201,
198,
201,
198,
201,
198,
4299,
8636,
62,
77,
31412,
62,
529,
7,
55,
11,
327,
28,
16,
2599,
201,
198,
220,
220,
220,
37227,
201,
198,
... | 1.714644 | 5,190 |
metainfo = """<?xml version="1.0"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Ve... | [
4164,
391,
6513,
796,
37227,
47934,
19875,
2196,
2625,
16,
13,
15,
13984,
29,
198,
27,
28112,
198,
220,
220,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
393,
517,
198,
220,
220,
18920,
5964,
11704,
13,
220,
4091... | 2.391703 | 1,856 |
import pytest
from validoot.operations import And, Or
from validoot.exceptions import ValidationError
| [
11748,
12972,
9288,
198,
198,
6738,
4938,
1025,
13,
3575,
602,
1330,
843,
11,
1471,
198,
6738,
4938,
1025,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198
] | 3.814815 | 27 |
#!/usr/bin/env python3
import csv
import numpy as np
from sklearn import decomposition
import matplotlib
import matplotlib.cm
matplotlib.use("Agg") # don't try to use $DISPLAY
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import matplotlib.gridspec as gridspec
from circledis... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
269,
21370,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1341,
35720,
1330,
26969,
9150,
198,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
112... | 2.002911 | 1,374 |
# -*- coding: utf-8 -*-
# Copyright SweetCase Project, Re_Coma(Ha Jeong Hyun). All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENS... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
15335,
20448,
4935,
11,
797,
62,
5377,
64,
7,
23303,
3852,
506,
6707,
403,
737,
1439,
6923,
33876,
13,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,... | 1.566411 | 911 |
import enum
| [
11748,
33829,
628,
198
] | 3.5 | 4 |
# -*-coding:utf-8-*-
import time
import datetime
import os
import random
import shelve
import threading
from queue import Queue
import win32api, win32gui, win32con, win32com.client
from ctypes import *
from PIL import ImageGrab, Image as PLI_Image, ImageTk
from tkinter import *
from tkinter import ttk
import tkinter.m... | [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
11748,
640,
198,
11748,
4818,
8079,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
7497,
303,
198,
11748,
4704,
278,
198,
6738,
16834,
1330,
4670,
518,
198,
11748,
... | 2.51505 | 299 |
import pytest
from app.models import User
| [
11748,
12972,
9288,
198,
6738,
598,
13,
27530,
1330,
11787,
628
] | 3.909091 | 11 |
# -*- coding: utf-8 -*-
# Copyright 2017 Vector Creations Ltd
#
# 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 applica... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2177,
20650,
5844,
602,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
... | 3.846154 | 325 |
#Write a Python program to extract the filename from a given path.
import os
print(os.path.basename(__file__)) | [
2,
16594,
257,
11361,
1430,
284,
7925,
262,
29472,
422,
257,
1813,
3108,
13,
198,
11748,
28686,
198,
4798,
7,
418,
13,
6978,
13,
12093,
12453,
7,
834,
7753,
834,
4008
] | 3.548387 | 31 |
import os
import matplotlib
matplotlib.use("Agg")
from plateo import AssemblyPlan
from plateo.parsers import plate_from_content_spreadsheet
from plateo.containers.plates import Plate4ti0960
from plateo.exporters import (picklist_to_labcyte_echo_picklist_file,
PlateTextPlotter,
... | [
11748,
28686,
198,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904,
7203,
46384,
4943,
198,
198,
6738,
7480,
78,
1330,
10006,
20854,
198,
6738,
7480,
78,
13,
79,
945,
364,
1330,
7480,
62,
6738,
62,
11299,
62,
43639,
21... | 2.457143 | 245 |
from sympy import symbols, diff, solve, Eq
from task1 import get_Euler_descr
x1, x2, x3, t, v1, v2, v3 = symbols('x1 x2 x3 t v1 v2 v3')
#from testdata import eq1, eq2, eq3
#print(get_velocity_Euler(eq1, eq2, eq3))
#print(get_acceleration_Euler(eq1, eq2, eq3))
| [
6738,
10558,
88,
1330,
14354,
11,
814,
11,
8494,
11,
412,
80,
198,
6738,
4876,
16,
1330,
651,
62,
36,
18173,
62,
20147,
81,
198,
198,
87,
16,
11,
2124,
17,
11,
2124,
18,
11,
256,
11,
410,
16,
11,
410,
17,
11,
410,
18,
796,
1... | 2.165289 | 121 |
"""
Class for the hex game logic. Unaltered skeleton code.
EDIT: Changed board representation from dict to numpy.ndarray.
EDIT: Changed numbers for the player-color indicators.
:version: FINAL
:date:
:author: Aske Plaat
:edited by: Joery de Vries
"""
import numpy as np
| [
37811,
198,
9487,
329,
262,
17910,
983,
9156,
13,
791,
282,
4400,
18328,
2438,
13,
198,
198,
24706,
25,
32068,
3096,
10552,
422,
8633,
284,
299,
32152,
13,
358,
18747,
13,
198,
24706,
25,
32068,
3146,
329,
262,
2137,
12,
8043,
21337,
... | 3.37037 | 81 |
import re
import sys
from io import StringIO
from corehq.util.teeout import tee_output
from testil import assert_raises, eq
| [
11748,
302,
198,
11748,
25064,
198,
6738,
33245,
1330,
10903,
9399,
198,
198,
6738,
4755,
71,
80,
13,
22602,
13,
660,
68,
448,
1330,
30479,
62,
22915,
198,
6738,
1332,
346,
1330,
6818,
62,
430,
2696,
11,
37430,
628,
628,
628,
198
] | 3.119048 | 42 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 2.454313 | 1,171 |
#!/usr/bin/python
import argparse;
import os;
import sys;
import matplotlib as mpl;
mpl.use('Agg');
import matplotlib.pyplot as plt;
import json;
from matplotlib import ticker;
import numpy as np
filename="cost-analysis-result.pdf";
main();
# Col 0 are the x points
# Col 1 is the series 50/100 marker
# Col 2 is the ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
1822,
29572,
26,
198,
11748,
28686,
26,
198,
11748,
25064,
26,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
26,
198,
76,
489,
13,
1904,
10786,
46384,
24036,
198,
11748,
2603,
294... | 2.983871 | 124 |
import pathlib
from setuptools import setup
# 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
setup(
name="django-inbound-rules",
version="1.1.0",
description="Django ... | [
198,
11748,
3108,
8019,
198,
6738,
900,
37623,
10141,
1330,
9058,
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... | 2.610915 | 568 |
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
83,
15799,
1330,
5436,
32572,
420,
1352,
628,
198,
220,
220,
220,
220,
198,
220,
220,
220,
220,
198,
22... | 1.666667 | 96 |
from selenium import webdriver
from selenium.webdriver.remote.webelement import WebElement
from selenium.webdriver import ActionChains
#REPLACE WITH YOUR DRIVER PATH. EXAMPLES FOR CHROME AND PHANTOMJS
driver = webdriver.PhantomJS(executable_path='../phantomjs-2.1.1-macosx/bin/phantomjs')
#driver = webdriver.Chrome(ex... | [
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
47960,
13,
732,
1350,
1732,
1330,
5313,
20180,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
1330,
7561,
1925,
1299,
628,
198,
2,
2200,
6489,... | 2.837989 | 179 |
"""oilandrope URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-ba... | [
37811,
9437,
28092,
431,
10289,
28373,
198,
198,
464,
4600,
6371,
33279,
82,
63,
1351,
11926,
32336,
284,
5009,
13,
1114,
517,
1321,
3387,
766,
25,
198,
220,
220,
220,
3740,
1378,
31628,
13,
28241,
648,
404,
305,
752,
13,
785,
14,
2... | 2.773163 | 626 |
# -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.6
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
import pandas as pd
import re
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
2420,
62,
15603,
341,
25,
198,
2,
220,
220,
220,
... | 2.423077 | 364 |
a = 1
b = 2
c = a + b
sum = 2
while c <= 4000000:
if c%2 == 0:
sum =sum + c
a = b
b = c
c = a + b
print sum | [
64,
796,
352,
198,
65,
796,
362,
198,
66,
796,
257,
1343,
275,
198,
16345,
796,
362,
198,
4514,
269,
19841,
604,
10535,
25,
198,
197,
361,
269,
4,
17,
6624,
657,
25,
198,
197,
197,
16345,
796,
16345,
1343,
269,
198,
197,
64,
796... | 1.83871 | 62 |
from sciencebeam_utils.utils.xml import (
set_or_remove_attrib
)
from sciencebeam_gym.utils.bounding_box import (
BoundingBox
)
from sciencebeam_gym.structured_document import (
AbstractStructuredDocument,
get_scoped_attrib_name,
get_attrib_by_scope
)
TAG_ATTRIB_NAME = 'tag'
| [
6738,
3783,
40045,
62,
26791,
13,
26791,
13,
19875,
1330,
357,
198,
220,
220,
220,
900,
62,
273,
62,
28956,
62,
1078,
822,
198,
8,
198,
198,
6738,
3783,
40045,
62,
1360,
76,
13,
26791,
13,
7784,
278,
62,
3524,
1330,
357,
198,
220,... | 2.559322 | 118 |
import numpy as np
a = np.arange(12)
# shape array with 3 rows and
# 4 columns
a = a.reshape(3,4)
print('Original array is:')
print(a)
print()
print('Modified array is:')
# iterating an array
for x in np.nditer(a):
print(x) | [
11748,
299,
32152,
355,
45941,
198,
64,
796,
45941,
13,
283,
858,
7,
1065,
8,
198,
220,
198,
2,
5485,
7177,
351,
513,
15274,
290,
220,
198,
2,
604,
15180,
198,
64,
796,
257,
13,
3447,
1758,
7,
18,
11,
19,
8,
198,
220,
198,
479... | 2.393939 | 99 |
import logging
import os
import re
from pathlib import Path
from typing import Any
from mdscript.files_dependencies_manager import FilesDependenciesManager
from mdscript.watcher import Watcher
| [
11748,
18931,
198,
11748,
28686,
198,
11748,
302,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
45243,
12048,
13,
16624,
62,
45841,
3976,
62,
37153,
1330,
13283,
35,
2690,
3976,
13511,
198,
6738,
45243,... | 4 | 49 |
emojisAsciiToUtf8Strict = None
emojisAsciiToUtf8 = None | [
368,
13210,
271,
1722,
979,
72,
2514,
18274,
69,
23,
1273,
2012,
796,
6045,
198,
368,
13210,
271,
1722,
979,
72,
2514,
18274,
69,
23,
796,
6045
] | 2.037037 | 27 |
from django.conf import settings
from django.test import TestCase
from mail_templated import EmailMessage
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
6920,
62,
11498,
489,
515,
1330,
9570,
12837,
198
] | 3.925926 | 27 |
from flask import *
app = Flask(__name__)
template = '<!DOCTYPE html><html><body>\
<h1>Online Calculator</h1>\
<form action="/" method="post">\
expression:<br>\
<input type="text" name="expression" value="">\
<input type="submit" value="Submit">\
</form><h2>%s </h2></body></html>'
@app.... | [
6738,
42903,
1330,
1635,
198,
1324,
796,
46947,
7,
834,
3672,
834,
8,
198,
198,
28243,
796,
705,
27,
0,
18227,
4177,
56,
11401,
27711,
6927,
6494,
6927,
2618,
29,
59,
198,
220,
220,
220,
1279,
71,
16,
29,
14439,
43597,
3556,
71,
1... | 2.282828 | 198 |
# -*- coding: utf-8 -*-
# Copyright 2020 The PsiZ Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
12131,
383,
350,
13396,
57,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
... | 2.461205 | 3,003 |
from rest_framework import viewsets
from rest_framework.response import Response
from dalme_api.serializers import CommentSerializer
from dalme_app.models import Comment
from dalme_api.access_policies import CommentAccessPolicy
from dalme_app.models import *
class Comments(viewsets.ModelViewSet):
""" API endpoint... | [
6738,
1334,
62,
30604,
1330,
5009,
1039,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
288,
282,
1326,
62,
15042,
13,
46911,
11341,
1330,
18957,
32634,
7509,
198,
6738,
288,
282,
1326,
62,
1324,
13,
27530,
1330,
18957,
... | 3.583333 | 132 |
import numpy as np
from matplotlib import pyplot as plt
from mvn.utils.misc import find_min, drop_na
| [
11748,
299,
32152,
355,
45941,
198,
6738,
2603,
29487,
8019,
1330,
12972,
29487,
355,
458,
83,
198,
198,
6738,
285,
85,
77,
13,
26791,
13,
44374,
1330,
1064,
62,
1084,
11,
4268,
62,
2616,
628,
628,
628,
628,
628
] | 2.846154 | 39 |
expected_output = {
'vrf': {
'vxlan-1009': {
'address_family': {
'ipv4': {
'count_multicast_starg': 11,
'count_multicast_sg': 18,
'count_multicast_total': 29,
'count_multicast_starg_prefix': 0,
... | [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
705,
37020,
69,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
705,
85,
87,
9620,
12,
3064,
24,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
... | 1.248601 | 1,251 |
# Generic imports
import os, sys, glob, shutil
import numpy as np
# Find the number of envs
main_dir = '.'
envs = [f.path for f in os.scandir(main_dir) if f.is_dir()]
# Process names
tmp = []
for env in envs:
env = env[2:]
if (env[0:3] == 'env'):
tmp.append(env)
# Printing
envs = tmp
print('I found '... | [
2,
42044,
17944,
198,
11748,
28686,
11,
25064,
11,
15095,
11,
4423,
346,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
9938,
262,
1271,
286,
551,
14259,
198,
12417,
62,
15908,
796,
705,
2637,
198,
268,
14259,
796,
685,
69,
13,
69... | 1.981744 | 1,972 |
import datetime
import os
import numpy as np
from quantities import *
gf2N = 9.80665 / 1000
dirpath = os.path.dirname(os.path.realpath(__file__))
| [
11748,
4818,
8079,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
17794,
1330,
1635,
198,
198,
70,
69,
17,
45,
796,
860,
13,
1795,
36879,
1220,
8576,
198,
198,
15908,
6978,
796,
28686,
13,
6978,
13,
15908,... | 2.678571 | 56 |
#!/usr/bin/env python3
import math
if __name__ == "__main__":
print("Hello There!")
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
10688,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7203,
15496,
1318,
2474,
8,
198
] | 2.540541 | 37 |
from django.urls import path
from . import views
from django.conf.urls import url
app_name = 'pool'
urlpatterns = [
path('pool/', views.Pool.as_view(), name='pool'),
path('pool/cab/', views.PoolCab.as_view(), name='cab'),
path('pool/food/', views.PoolFood.as_view(), name='food'),
path('pool/others/', v... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
198,
1324,
62,
3672,
796,
705,
7742,
6,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220... | 2.645631 | 206 |
import os
import sys
cwd = os.getcwd()
sys.path.append(cwd)
import time, math
from collections import OrderedDict
import pybullet as p
import numpy as np
from util import pybullet_util
from config.manipulator_config import ManipulatorConfig
from pnc.manipulator_pnc.manipulator_interface import ManipulatorInterface
i... | [
11748,
28686,
198,
11748,
25064,
198,
66,
16993,
796,
28686,
13,
1136,
66,
16993,
3419,
198,
17597,
13,
6978,
13,
33295,
7,
66,
16993,
8,
198,
11748,
640,
11,
10688,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
198,
11748,
12972... | 2.008432 | 1,186 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
from PyQt4 import QtGui
from PyQt4 import QtCore
import Database
from DioView import DioView
from DioDetails import DioDetails
from DioScanDialog import DioScanDialog
| [
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,
4738,
198,
6738,
9485,
48,
83,
19,
1330,
33734,
8205,
72,
198,
6738,
9485,
48,
83,
19,
1330,
33734,
14055... | 2.857143 | 84 |
# -*- coding: utf-8 -*-
import mutagen
import os
import json
current_dir = os.getcwd()
fileNameList_all = os.listdir(current_dir)
fileNameList_shouldUse = []
failelist = []
success_amount = 0 #https://www.jianshu.com/p/53cf61220828 感谢这位老哥的帖子
#提取同目录下所有mp3的封面图和一些其他信息
if(len(fileNameList_all) > 0):
for filename ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4517,
11286,
198,
11748,
28686,
198,
11748,
33918,
198,
220,
198,
14421,
62,
15908,
796,
28686,
13,
1136,
66,
16993,
3419,
198,
7753,
5376,
8053,
62,
439,
79... | 2.5 | 452 |
"""
Output formats.
"""
from .rst import RST
from .console import Console
from .json import JSON
from .svg import SVG
from .png import PNG
| [
37811,
198,
26410,
17519,
13,
198,
37811,
198,
198,
6738,
764,
81,
301,
1330,
371,
2257,
198,
6738,
764,
41947,
1330,
24371,
198,
6738,
764,
17752,
1330,
19449,
198,
6738,
764,
21370,
70,
1330,
45809,
198,
6738,
764,
11134,
1330,
36182,... | 3.333333 | 42 |
import logging
log = logging.getLogger('WebPage')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import os
import urllib
import web
from viz import Viz, \
VizBanner
TEMPLATE_PATH = os.path.join('templates')
LOOK_AND_FEEL = 'dust'
| [
11748,
18931,
201,
198,
6404,
796,
18931,
13,
1136,
11187,
1362,
10786,
13908,
9876,
11537,
201,
198,
6404,
13,
2617,
4971,
7,
6404,
2667,
13,
24908,
8,
201,
198,
6404,
13,
2860,
25060,
7,
35067,
25060,
28955,
201,
198,
201,
198,
1174... | 2.333333 | 117 |
#
# Created by Denis Doci
#
# Copyright Mars Inc.
#
# For internal use only
#
import requests
import json
import pandas as pd
import numpy as np
import datetime
import itertools
import math
from datetime import date, timedelta
########################################
########################################
########... | [
2,
198,
2,
15622,
416,
33089,
360,
1733,
198,
2,
198,
2,
15069,
8706,
3457,
13,
198,
2,
198,
2,
1114,
5387,
779,
691,
198,
2,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
... | 7.401408 | 142 |
import unittest
import datetime
from forthic.interpreter import Interpreter
from forthic.module import Module, ModuleWord
from tests.tests_py.sample_date_module import SampleDateModule
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
11748,
4818,
8079,
198,
6738,
6071,
291,
13,
3849,
3866,
353,
1330,
4225,
3866,
353,
198,
6738,
6071,
291,
13,
21412,
1330,
19937,
11,
19937,
26449,
198,
6738,
5254,
13,
41989,
62,
9078,
13,
39873,
62,
4475,... | 3.243243 | 74 |
import tensorflow as tf
from learntools.core import *
qvars = bind_exercises(globals(), [
Q1, Q2, Q3,
],
var_format='q_{n}',
)
__all__ = list(qvars)
| [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
26338,
10141,
13,
7295,
1330,
1635,
628,
628,
198,
198,
44179,
945,
796,
11007,
62,
1069,
2798,
2696,
7,
4743,
672,
874,
22784,
685,
198,
220,
220,
220,
220,
220,
220,
220,
1195,
... | 2.111111 | 81 |
i = 0
for i in range(0, 100):
if i % 2 == 0:
print(i)
i+= i
| [
72,
796,
657,
198,
1640,
1312,
287,
2837,
7,
15,
11,
1802,
2599,
198,
220,
220,
220,
611,
1312,
4064,
362,
6624,
657,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7,
72,
8,
198,
220,
220,
220,
1312,
47932,
1312,
198
] | 1.727273 | 44 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Hay diversas maneras de recibir información del usuario en la terminal
Para pedir información al usuario DURANTE la ejecución de un script
podemos usar la función "raw_input" (python2) o "input" (python3) y guardar la respuesta en una variable
como se puede ver en el ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
197,
31306,
15070,
292,
582,
263,
292,
390,
664,
571,
343,
4175,
32009,
18840,
1619,
514,
84,
4982,
551... | 2.65942 | 690 |