content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import hashlib
import os
# TODO:
# - change the separator used in the integrity hash file from ':' to
# '::' to make it entirely unlikely that it could be part of a valid
# filename
#
HASHFILE_PART_SEP = ":"
| [
11748,
12234,
8019,
198,
11748,
28686,
628,
198,
2,
16926,
46,
25,
198,
2,
220,
220,
532,
1487,
262,
2880,
1352,
973,
287,
262,
11540,
12234,
2393,
422,
705,
32105,
284,
198,
2,
220,
220,
220,
220,
705,
3712,
6,
284,
787,
340,
500... | 2.884615 | 78 |
import requests
from hashlib import md5
from urllib.parse import urlsplit, urlencode, unquote_plus, quote_plus
import urllib.request
import re
import numpy as np
import PIL
from PIL import Image
headers = {"User-Agent": "Wolfram Android App"}
APPID = "3H4296-5YPAGQUJK7" # Mobile app AppId
SERVER = "api.wolframalpha.co... | [
11748,
7007,
198,
6738,
12234,
8019,
1330,
45243,
20,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
7278,
489,
270,
11,
2956,
11925,
8189,
11,
555,
22708,
62,
9541,
11,
9577,
62,
9541,
198,
11748,
2956,
297,
571,
13,
25927,
198,
... | 2.374699 | 830 |
from . import db
| [
6738,
764,
1330,
20613,
628
] | 3.6 | 5 |
import operator as op
import itertools
with open("input.txt") as file:
data = file.read()
shop = """Weapons: Cost Damage Armor
Dagger 8 4 0
Shortsword 10 5 0
Warhammer 25 6 0
Longsword 40 7 0
Greataxe 74 8 0
Armor: Cost Damage Armor... | [
11748,
10088,
355,
1034,
198,
11748,
340,
861,
10141,
198,
198,
4480,
1280,
7203,
15414,
13,
14116,
4943,
355,
2393,
25,
198,
220,
220,
220,
1366,
796,
2393,
13,
961,
3419,
198,
198,
24643,
796,
37227,
41818,
25,
220,
220,
220,
6446,
... | 1.993846 | 650 |
import calendar
import numpy as np
import pandas as pd
import re
import scipy.interpolate as interp
import urllib
import warnings
from datetime import datetime as dt,timedelta
from scipy.ndimage import gaussian_filter as gfilt
from ..plot import Plot
#Import tools
from .tools import *
from ..utils import *
try:
... | [
11748,
11845,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
302,
198,
11748,
629,
541,
88,
13,
3849,
16104,
378,
355,
987,
79,
198,
11748,
2956,
297,
571,
198,
11748,
14601,
198,
6738,
4818,
807... | 3.160656 | 305 |
python3.7
# import statements
import codecs
import glob
import math
import os
import pandas as pd
import re
import time
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import TimeoutExcepti... | [
29412,
18,
13,
22,
198,
2,
1330,
6299,
198,
11748,
40481,
82,
198,
11748,
15095,
198,
11748,
10688,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
302,
198,
11748,
640,
198,
6738,
275,
82,
19,
1330,
23762,
50,
... | 2.486616 | 1,457 |
# Generated by Django 2.0.7 on 2018-07-17 01:13
from django.conf import settings
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import re
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
22,
319,
2864,
12,
2998,
12,
1558,
5534,
25,
1485,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
11748,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
198,
11748,
42625,
142... | 3.08 | 75 |
from django.db.models.query import QuerySet
from rest_framework.filters import BaseFilterBackend
from rest_framework.request import Request
from rest_framework.views import APIView
| [
6738,
42625,
14208,
13,
9945,
13,
27530,
13,
22766,
1330,
43301,
7248,
198,
6738,
1334,
62,
30604,
13,
10379,
1010,
1330,
7308,
22417,
7282,
437,
198,
6738,
1334,
62,
30604,
13,
25927,
1330,
19390,
198,
6738,
1334,
62,
30604,
13,
33571,... | 3.956522 | 46 |
import numpy as np
from build_matrix_A import build_matrix_A
from build_matrix_b import build_matrix_b
from matrix_solver import solve_matrix
from generate_mesh import generate_mesh
def transient_model(time, material_property_library, mesh, g_dot_list, boundary_conditions_list):
"""This function will calcul... | [
11748,
299,
32152,
355,
45941,
201,
198,
6738,
1382,
62,
6759,
8609,
62,
32,
1330,
1382,
62,
6759,
8609,
62,
32,
201,
198,
6738,
1382,
62,
6759,
8609,
62,
65,
1330,
1382,
62,
6759,
8609,
62,
65,
201,
198,
6738,
17593,
62,
82,
1437... | 2.717331 | 1,079 |
from __future__ import division
from mmtbx.secondary_structure import build as ssb
import time
if (__name__ == "__main__"):
t0=time.time()
exercise_process_params()
print "Time: %6.4f"%(time.time()-t0)
print "OK"
| [
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
8085,
83,
65,
87,
13,
38238,
62,
301,
5620,
1330,
1382,
355,
264,
36299,
198,
11748,
640,
198,
198,
361,
357,
834,
3672,
834,
6624,
366,
834,
12417,
834,
1,
2599,
198,
220,
256,
15,
... | 2.611765 | 85 |
from openapi_schema_generator.OpenApiSchemaGenerator import OpenApiSchemaGenerator
import argparse
import os
import json
import yaml
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--path', type=str, default=None)
parser.add_argument('--output', type=str, default='resul... | [
6738,
1280,
15042,
62,
15952,
2611,
62,
8612,
1352,
13,
11505,
32,
14415,
27054,
2611,
8645,
1352,
1330,
4946,
32,
14415,
27054,
2611,
8645,
1352,
198,
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
33918,
198,
11748,
331,
43695,
628,... | 2.759434 | 212 |
import cv2
import matplotlib.pyplot as plt
| [
11748,
269,
85,
17,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628
] | 2.75 | 16 |
from iglo.lamp import Lamp
from iglo.helpers import Helpers | [
6738,
45329,
5439,
13,
75,
696,
1330,
28607,
198,
6738,
45329,
5439,
13,
16794,
364,
1330,
10478,
364
] | 3.277778 | 18 |
from django.contrib import admin
# Register your models here.
from youtube_rest_api.models import Video
admin.site.register(Video, VideoAdmin)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
6738,
35116,
62,
2118,
62,
15042,
13,
27530,
1330,
7623,
628,
198,
198,
28482,
13,
15654,
13,
30238,
7,
10798,
11,
7623,
46787,
8,
198
] | 3.5 | 42 |
"""
Tests for particle octree
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, yt Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------... | [
37811,
198,
51,
3558,
329,
18758,
19318,
631,
628,
198,
198,
37811,
198,
198,
2,
10097,
32501,
198,
2,
15069,
357,
66,
8,
2211,
11,
331,
83,
7712,
4816,
13,
198,
2,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
40499,
347,
10305,
... | 3.035377 | 424 |
from .sudo_query_helpers import update
from helpers import log
def update_with_suppressed_fail(query_string):
"""
A last resort update, if the potential error of an update needs supression.
:param query_string: string
"""
try:
update(query_string)
except Exception as e:
log(""... | [
6738,
764,
24032,
62,
22766,
62,
16794,
364,
1330,
4296,
198,
6738,
49385,
1330,
2604,
628,
198,
4299,
4296,
62,
4480,
62,
18608,
2790,
62,
32165,
7,
22766,
62,
8841,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
938,
12... | 2.408333 | 240 |
from enum import Enum
__author__ = 'raymond'
| [
6738,
33829,
1330,
2039,
388,
198,
198,
834,
9800,
834,
796,
705,
2433,
6327,
6,
198
] | 2.875 | 16 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import logging
import subprocess
import time
from e2e.fixtures import cluster
from e2e.utils.load_balancer import common
from e2e.utils.aws.acm import AcmCertificate
from e2e.utils.aws.elbv2 import ElasticLoadB... | [
2,
15069,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
11748,
18931,
198,
11748,
850,
14681,
198,
11748,
640,
198,
198... | 2.664474 | 304 |
from django.utils.deprecation import MiddlewareMixin
from django.conf import settings
import re
from django.shortcuts import redirect,reverse
| [
6738,
42625,
14208,
13,
26791,
13,
10378,
8344,
341,
1330,
6046,
1574,
35608,
259,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
11748,
302,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
18941,
11,
50188,
628
] | 3.864865 | 37 |
# -*- coding: utf-8 -*-
import abc
import six
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
450,
66,
198,
198,
11748,
2237,
628
] | 2.181818 | 22 |
from flair.embeddings import WordEmbeddings, FlairEmbeddings, StackedEmbeddings
from flair.data import Sentence
from sklearn.metrics.pairwise import cosine_similarity
import numpy as np
from flair.data import Sentence
import torch as torch
from tqdm import tqdm
if __name__ == "__main__":
text1 = "I am g... | [
6738,
37457,
13,
20521,
67,
654,
1330,
9678,
31567,
6048,
654,
11,
1610,
958,
31567,
6048,
654,
11,
520,
6021,
31567,
6048,
654,
201,
198,
6738,
37457,
13,
7890,
1330,
11352,
594,
201,
198,
6738,
1341,
35720,
13,
4164,
10466,
13,
2487... | 2.587209 | 172 |
#!/usr/bin/env python
""" Utility for git-bisecting nose failures
"""
DESCRIP = 'Check nose output for given text, set sys exit for git bisect'
EPILOG = \
"""
Imagine you've just detected a nose test failure. The failure is in a
particular test or test module - here 'test_analyze.py'. The failure *is* in
git branch `... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
37811,
34030,
329,
17606,
12,
41907,
478,
278,
9686,
15536,
198,
37811,
198,
30910,
36584,
796,
705,
9787,
9686,
5072,
329,
1813,
2420,
11,
900,
25064,
8420,
329,
17606,
47457,
478,
6,
... | 3.17657 | 589 |
import sys
sys.path.insert(0, '/srv/wcdo/src_viz')
from dash_apps import *
### DATA ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
conn = sqlite3.connect(databases_path + 'stats_production.db'); cursor = conn.cursor()
### DASH APP ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###... | [
11748,
25064,
198,
17597,
13,
6978,
13,
28463,
7,
15,
11,
31051,
27891,
85,
14,
86,
66,
4598,
14,
10677,
62,
85,
528,
11537,
198,
6738,
14470,
62,
18211,
1330,
1635,
628,
198,
198,
21017,
42865,
44386,
44386,
44386,
44386,
44386,
4438... | 2.975138 | 362 |
# Generated by Django 3.1.2 on 2020-10-26 13:02
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
17,
319,
12131,
12,
940,
12,
2075,
1511,
25,
2999,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
from django.contrib.sites.shortcuts import get_current_site
from rest_framework import generics, permissions, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.response import Response
from . import serializers
from teams.models import Team, TeamInvitation
class CreateTeamAPIVi... | [
6738,
42625,
14208,
13,
3642,
822,
13,
49315,
13,
19509,
23779,
1330,
651,
62,
14421,
62,
15654,
198,
6738,
1334,
62,
30604,
1330,
1152,
873,
11,
21627,
11,
3722,
198,
6738,
1334,
62,
30604,
13,
41299,
3299,
1330,
29130,
47649,
3299,
... | 3.373188 | 276 |
import Sofa
import os.path
import SofaPython.Quaternion as quat
from SofaPython.Tools import listToStr as concat
import math
import numpy
import inspect
# be sure that the cache path exists
# automatic generation when s-t changed
class ImageProducerInfo:
""" Used with insertImageCache
"""
def getImageTr... | [
11748,
1406,
13331,
198,
11748,
28686,
13,
6978,
198,
11748,
1406,
13331,
37906,
13,
4507,
9205,
295,
355,
627,
265,
198,
6738,
1406,
13331,
37906,
13,
33637,
1330,
1351,
2514,
13290,
355,
1673,
265,
198,
11748,
10688,
198,
11748,
299,
... | 2.320996 | 1,567 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# $File: uklogger.py
# $Date: Sat Dec 14 18:03:00 2013 +0800
# $Author: jiakai <jia.kai66@gmail.com>
"""utilities for handling logging"""
import traceback
from termcolor import colored
from ukutil import is_in_unittest
def log_api(msg):
"""log a message from api-w... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
720,
8979,
25,
334,
74,
6404,
1362,
13,
9078,
198,
2,
720,
10430,
25,
7031,
4280,
1478,
1248,
25,
3070,
25,
... | 2.698157 | 434 |
#!/usr/bin/env python3
import sys
import os
from argparse import ArgumentParser, ArgumentTypeError
import numpy as np
from config import *
if __name__ == "__main__":
main(sys.argv) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
25064,
220,
198,
11748,
28686,
198,
6738,
1822,
29572,
1330,
45751,
46677,
11,
45751,
6030,
12331,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4566,
1330,
1635,
1... | 3.032787 | 61 |
import sublime, sublime_plugin
import os, json, subprocess, threading
from ..libs import NodeJS
from ..libs.global_vars import *
from ..libs.popup_manager import popup_manager
from ..libs import util
from ..libs import Hook
from ..libs import FlowCLI
from ..libs import flow_ide_clients
default_completions = util.open_... | [
11748,
41674,
11,
41674,
62,
33803,
198,
11748,
28686,
11,
33918,
11,
850,
14681,
11,
4704,
278,
198,
6738,
11485,
8019,
82,
1330,
19081,
20120,
198,
6738,
11485,
8019,
82,
13,
20541,
62,
85,
945,
1330,
1635,
198,
6738,
11485,
8019,
8... | 3.108527 | 129 |
# -*- coding: utf-8 -*-
"""
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-蓝鲸 PaaS 平台(BlueKing-PaaS) available.
* Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except in co... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1635,
9368,
1087,
14573,
15708,
318,
10607,
284,
1104,
262,
1280,
2723,
2055,
416,
1642,
5525,
241,
251,
165,
110,
116,
162,
247,
118,
12859,
239,
12,
164,
... | 2.469676 | 709 |
"""
SPDX-FileCopyrightText: 2021 International Photoacoustic Standardisation Consortium (IPASC)
SPDX-FileCopyrightText: 2021 Janek Gröhl
SPDX-License-Identifier: MIT
"""
from google_drive_downloader import GoogleDriveDownloader
import os
import matplotlib.pyplot as plt
import numpy as np
class TestClassBase:
"""... | [
37811,
198,
4303,
36227,
12,
8979,
15269,
8206,
25,
33448,
4037,
5555,
330,
21618,
8997,
5612,
42727,
357,
4061,
42643,
8,
198,
4303,
36227,
12,
8979,
15269,
8206,
25,
33448,
2365,
988,
1902,
9101,
18519,
198,
4303,
36227,
12,
34156,
12... | 3.496689 | 151 |
from __future__ import print_function
from feed_data import Batcher
from KBQA import KBQA, TextQA, TextKBQA
import tensorflow as tf
import argparse
import time
import numpy as np
import cPickle as pickle
from tqdm import tqdm
import pdb
if __name__ == '__main__':
parser = argparse.Arg... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
6738,
3745,
62,
7890,
1330,
6577,
2044,
198,
6738,
14204,
48,
32,
1330,
14204,
48,
32,
11,
8255,
48,
32,
11,
8255,
22764,
48,
32,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
11... | 2.539986 | 1,463 |
#This is really badly written, but the function "create_data_set(x)"
#returns a dictionary with x keys and such that the values correspond
#to ordered pairs (A,B), where A is a 30x30 matrix (where the pixels in the path have pixels
#1 and the other pixels have all value 0) and B is the ground truth
#(pixels outside a... | [
2,
1212,
318,
1107,
11234,
3194,
11,
475,
262,
2163,
366,
17953,
62,
7890,
62,
2617,
7,
87,
16725,
220,
198,
2,
7783,
82,
257,
22155,
351,
2124,
8251,
290,
884,
326,
262,
3815,
6053,
220,
198,
2,
1462,
6149,
14729,
357,
32,
11,
... | 2.16 | 600 |
"""This script creates a simple static plot of data from the DtssHost via a DtsClient."""
import sys
import os
from tempfile import NamedTemporaryFile
import logging
from shyft.time_series import DtsClient, UtcPeriod, Calendar, TsVector, utctime_now, TimeSeries
from bokeh.plotting import figure, show, output_file
from... | [
37811,
1212,
4226,
8075,
257,
2829,
9037,
7110,
286,
1366,
422,
262,
360,
83,
824,
17932,
2884,
257,
360,
912,
11792,
526,
15931,
198,
11748,
25064,
198,
11748,
28686,
198,
6738,
20218,
7753,
1330,
34441,
12966,
5551,
8979,
198,
11748,
... | 2.287871 | 2,053 |
# Copyright 2012 Jeffrey R. Spies
# License: Apache License, Version 2.0
# Website: http://jspi.es/benchmark
import time
import random
import re
import operator
import math
import sys
import os
| [
2,
15069,
2321,
19627,
371,
13,
1338,
444,
198,
2,
13789,
25,
24843,
13789,
11,
10628,
362,
13,
15,
198,
2,
15887,
25,
2638,
1378,
73,
2777,
72,
13,
274,
14,
26968,
4102,
198,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
302,
19... | 3.482143 | 56 |
import torch.nn as nn
class SCRNet(nn.Module):
"""
implementation of the baseline scene coordinate regression network
"""
| [
11748,
28034,
13,
20471,
355,
299,
77,
628,
198,
4871,
6374,
49,
7934,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
7822,
286,
262,
14805,
3715,
20435,
20683,
3127,
198,
220,
220,
220,
37227,
198
] | 3.317073 | 41 |
# Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# Recode by @mrismanaziz
# @sharinguserbot
from telethon.tl.types import ChannelParticipantAdmin as admin
from telethon.tl.types import ChannelParticipantCreator as owner
from telethon.tl.types import UserStatusOffline as off
from telethon.tl.types import... | [
2,
6172,
3882,
532,
11787,
20630,
201,
198,
2,
15069,
357,
34,
8,
12131,
4816,
16301,
3882,
201,
198,
2,
201,
198,
2,
3311,
1098,
416,
2488,
76,
2442,
805,
1031,
528,
201,
198,
2,
2488,
21987,
7220,
13645,
201,
198,
201,
198,
6738... | 2.227606 | 681 |
"""
auto merge printing v2
python 2.7.14 tested
require module pypiwin32: pip install pypiwin32
require module pil: pip install pillow
"""
import os
import subprocess
from datetime import datetime
from Tkinter import Tk, Frame, Button, Label, Checkbutton, IntVar, StringVar, \
TOP, LEFT, RIGHT, BOTTOM
f... | [
37811,
201,
198,
23736,
20121,
13570,
410,
17,
201,
198,
29412,
362,
13,
22,
13,
1415,
6789,
201,
198,
46115,
8265,
279,
4464,
72,
5404,
2624,
25,
7347,
2721,
279,
4464,
72,
5404,
2624,
201,
198,
46115,
8265,
5560,
25,
7347,
2721,
2... | 1.978066 | 3,237 |
import requests
#Class designed to comunicate the app
#with a API and Get JSON information.
### Variables ###
# url API
### Constructors ###
### Setters and Getters###
### Methods ###
#GetInfo: Get JSON Information from the API.
#Input: Void
#Output: JSON Object
| [
11748,
7007,
201,
198,
201,
198,
2,
9487,
3562,
284,
401,
403,
5344,
262,
598,
220,
201,
198,
2,
4480,
257,
7824,
290,
3497,
19449,
1321,
13,
201,
198,
201,
198,
197,
21017,
15965,
2977,
44386,
201,
198,
197,
2,
19016,
7824,
201,
... | 2.641667 | 120 |
import pytest
from aioredis.util import encode_command
| [
11748,
12972,
9288,
198,
198,
6738,
257,
72,
1850,
271,
13,
22602,
1330,
37773,
62,
21812,
628,
628,
628,
628
] | 3.15 | 20 |
import asyncio
import pytest
from starlette.testclient import TestClient
from app.db import drop_database
from app.main import app
@pytest.fixture(scope="session", autouse=True)
@pytest.fixture(scope="session")
def event_loop():
"""custom event loop, fix for motor's run_in_executor"""
loop = asyncio.get_e... | [
11748,
30351,
952,
198,
198,
11748,
12972,
9288,
198,
6738,
3491,
21348,
13,
9288,
16366,
1330,
6208,
11792,
198,
198,
6738,
598,
13,
9945,
1330,
4268,
62,
48806,
198,
6738,
598,
13,
12417,
1330,
598,
628,
198,
31,
9078,
9288,
13,
69,... | 2.938462 | 130 |
from yaml import safe_load
with open(__file__.replace("__init__.py", "") + "letters.yml", encoding='utf-8') as f:
lets = safe_load(f)
letters = {}
every = set()
for k, v in lets.items():
letters[tuple(v)] = k
every.update(v)
| [
6738,
331,
43695,
1330,
3338,
62,
2220,
198,
198,
4480,
1280,
7,
834,
7753,
834,
13,
33491,
7203,
834,
15003,
834,
13,
9078,
1600,
366,
4943,
1343,
366,
15653,
13,
88,
4029,
1600,
21004,
11639,
40477,
12,
23,
11537,
355,
277,
25,
19... | 2.438776 | 98 |
from standalone.hub import AutoHubServer
| [
6738,
27669,
13,
40140,
1330,
11160,
16066,
10697,
198
] | 4.555556 | 9 |
from django import forms
from search.models.session_alias import SessionAlias
from share.models import Session
| [
6738,
42625,
14208,
1330,
5107,
198,
198,
6738,
2989,
13,
27530,
13,
29891,
62,
26011,
1330,
23575,
40489,
198,
6738,
2648,
13,
27530,
1330,
23575,
628
] | 4.346154 | 26 |
"""
Starry was originally designed for maps in thermal light.
Maps in reflected light are quirky in how things are normalized,
so we need to make sure albedos, intensities, and fluxes are
all self-consistent in the code. There are some fudges we had
to make under the hood to ensure all of these tests pass.
"""
import... | [
37811,
198,
1273,
6532,
373,
6198,
3562,
329,
8739,
287,
18411,
1657,
13,
198,
47010,
287,
12548,
1657,
389,
37276,
287,
703,
1243,
389,
39279,
11,
198,
568,
356,
761,
284,
787,
1654,
435,
3077,
418,
11,
17509,
871,
11,
290,
28462,
... | 2.595865 | 532 |
from flask import render_template, redirect, request, url_for, session, g, jsonify
from flask_sqlalchemy import SQLAlchemy
from sqlalchemy import or_
from flask_login import LoginManager, login_required, login_user, \
logout_user, current_user, UserMixin
from requests_oauthlib import OAuth2Session
from requests.exc... | [
6738,
42903,
1330,
8543,
62,
28243,
11,
18941,
11,
2581,
11,
19016,
62,
1640,
11,
6246,
11,
308,
11,
33918,
1958,
198,
6738,
42903,
62,
25410,
282,
26599,
1330,
16363,
2348,
26599,
198,
6738,
44161,
282,
26599,
1330,
393,
62,
198,
673... | 3.008523 | 352 |
from orchestration.database import database_update
#print database_update.machine_ip('wangwy', 'wangwy', 'cdh', 'slave1')
#print database_update.machine_ip('wangwy', 'wangwy', 'cdh', 'master')
#print database_update.machine_ip('wangwy', 'wangwy', 'cdh', 'cloudera_manager')
print database_update.machine_ip('mongo', 'm... | [
6738,
17771,
12401,
13,
48806,
1330,
6831,
62,
19119,
198,
198,
2,
4798,
6831,
62,
19119,
13,
30243,
62,
541,
10786,
47562,
21768,
3256,
705,
47562,
21768,
3256,
705,
10210,
71,
3256,
705,
36341,
16,
11537,
198,
2,
4798,
6831,
62,
191... | 2.948276 | 116 |
import importlib
import math
from numpy.random import randint
from AlphaZero.search.math_helper import random_variate_dirichlet, weighted_random_choice
# Parameter for PUCT Algorithm
c_punt = 5.0
class MCTreeNode(object):
"""Tree Node in MCTS.
"""
def expand(self, policy, value):
"""Expand a l... | [
11748,
1330,
8019,
198,
11748,
10688,
198,
198,
6738,
299,
32152,
13,
25120,
1330,
43720,
600,
198,
198,
6738,
12995,
28667,
13,
12947,
13,
11018,
62,
2978,
525,
1330,
4738,
62,
25641,
378,
62,
15908,
488,
1616,
11,
26356,
62,
25120,
... | 2.289753 | 5,270 |
"""
Sage Interacts
Sage interacts are applications of the `@interact decorator <../../sagenb/notebook/interact.html>`_.
They are conveniently accessible in the Sage Notebook via ``interacts.[TAB].[TAB]()``.
The first ``[TAB]`` lists categories and the second ``[TAB]`` reveals the interact examples.
EXAMPLES:
Invoked... | [
37811,
198,
50,
496,
4225,
8656,
198,
198,
50,
496,
44020,
389,
5479,
286,
262,
4600,
31,
3849,
529,
11705,
1352,
1279,
40720,
40720,
82,
11286,
65,
14,
11295,
2070,
14,
3849,
529,
13,
6494,
29,
63,
44807,
198,
2990,
389,
29801,
985... | 2.179394 | 27,080 |
from handwriting_sample.base.containers import LoggableObject, HandwritingDataBase
| [
6738,
44396,
62,
39873,
13,
8692,
13,
3642,
50221,
1330,
5972,
70,
540,
10267,
11,
7157,
16502,
6601,
14881,
198
] | 4.15 | 20 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** 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 _utilities
from... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 2.489002 | 591 |
#
# Copyright (C) 2017 Quest, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | [
2,
198,
2,
220,
15069,
357,
34,
8,
2177,
6785,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,... | 3.589744 | 195 |
import numpy as np
import os
import matplotlib.pyplot as plt
import sys
try:
plt.style.use('presentation')
except:
pass
def plot_config():
"""
Make an 4x4 figure with top corner frames off and ticks on the left
and bottom edges
"""
fig, axs = plt.subplots(4, 4, figsize=(9.7, 9.7))
fig... | [
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
25064,
198,
198,
28311,
25,
198,
220,
220,
220,
458,
83,
13,
7635,
13,
1904,
10786,
25579,
341,
11537,
198,
16... | 1.923541 | 497 |
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="dutch-pluralizer",
version="0.0.39",
description="Generates D... | [
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,
198... | 2.684807 | 441 |
@dec
if __name__ == '__main__':
x = wrap
x(hello)
decoratee()
| [
198,
31,
12501,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
2124,
796,
14441,
198,
220,
2124,
7,
31373,
8,
628,
220,
11705,
378,
68,
3419,
198
] | 2.151515 | 33 |
import gym
import torch
import numpy as np
from src.ModelBase.dyna import *
from src.NN import model
from RLalgo.td3 import TD3
if __name__=='__main__':
import random
import os
from src.NN.RL.base import MLPActor, MLPQ
random.seed(0)
torch.manual_seed(0)
np.random.seed(0)
test_episodes=100
... | [
11748,
11550,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
12351,
13,
17633,
14881,
13,
67,
46434,
1330,
1635,
198,
6738,
12351,
13,
6144,
1330,
2746,
198,
6738,
45715,
282,
2188,
13,
8671,
18,
1330,
13320,
18,
198,... | 2.228117 | 754 |
import numpy as np
if __name__ == '__main__':
adjacent_mat = np.array([
[0, 7, 4, 6, 1],
[100, 0, 100, 100, 100],
[100, 2, 0, 5, 100],
[100, 3, 100, 0, 100],
[100, 100, 100, 1, 0]
], dtype=int)
print(dijkstra_single_source_shortest_paths(adjacent_mat, 5, 0))
| [
11748,
299,
32152,
355,
45941,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
15909,
62,
6759,
796,
45941,
13,
18747,
26933,
198,
220,
220,
220,
220,
220,
220,
220,
685,
15,
11,
767,
11,... | 1.90303 | 165 |
class LowFuelError(ValueError):
"""
исключение, которое срабатывает если топлива не хватает до точки назначения
"""
| [
4871,
7754,
42663,
12331,
7,
11395,
12331,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
12466,
116,
21727,
31583,
30143,
141,
236,
141,
229,
16843,
22177,
18849,
16843,
11,
12466,
118,
15166,
20375,
15166,
21169,
15166,
16843,
220... | 1.207547 | 106 |
from django.contrib import admin
from .models import ContactRequest, Publications, Member, GroupInformation, ResearchField
from tinymce.widgets import TinyMCE
from django.db import models
admin.site.register(GroupInformation, GroupInformationAdmin)
admin.site.register(ResearchField, ResearchFieldAdmin)
admin.site... | [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
14039,
18453,
11,
40865,
11,
10239,
11,
4912,
21918,
11,
4992,
15878,
198,
6738,
7009,
76,
344,
13,
28029,
11407,
1330,
20443,
44,
5222,
198,
6738,
42625,
1420... | 3.9375 | 112 |
import argparse
import os
import sys
import numpy as np
import torchvision
from torchvision import datasets, transforms
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import videotransforms
from charades_dataset_full import Charades as Dataset
from pytorch_i3d import In... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
10178,
198,
6738,
28034,
10178,
1330,
40522,
11,
31408,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
... | 2.771676 | 346 |
import sys
dataIn = sys.stdin.readline()
timeData = dataIn.split()
hours = int(timeData[0])
minutes = int(timeData[1])
if minutes >= 45:
minutes -= 45
else:
if hours == 0: hours = 24
hours -= 1
minutes += 15
print('{} {}'.format(hours,minutes)) | [
11748,
25064,
198,
7890,
818,
796,
25064,
13,
19282,
259,
13,
961,
1370,
3419,
198,
198,
2435,
6601,
796,
1366,
818,
13,
35312,
3419,
198,
24425,
796,
493,
7,
2435,
6601,
58,
15,
12962,
198,
1084,
1769,
796,
493,
7,
2435,
6601,
58,
... | 2.495327 | 107 |
import csv
import os
import re
from wo.core.fileutils import WOFileUtils
from wo.core.logging import Log
from wo.core.shellexec import WOShellExec
from wo.core.variables import WOVar
from wo.core.acme import WOAcme
| [
11748,
269,
21370,
198,
11748,
28686,
198,
11748,
302,
198,
198,
6738,
24486,
13,
7295,
13,
7753,
26791,
1330,
370,
46,
8979,
18274,
4487,
198,
6738,
24486,
13,
7295,
13,
6404,
2667,
1330,
5972,
198,
6738,
24486,
13,
7295,
13,
82,
297... | 2.893333 | 75 |
#!/usr/bin/env python
# coding=utf-8
def fib2(n):
"""Return a list containing the Fibonacci series up to n."""
result = []
a, b = 0, 1
while a < n:
result.append(a)
a, b = b, a+b
return str(result).strip()
fib = fib2(200)
#print fib
fibs = [0, 1]
num = int(raw_input('How many Fibo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
4299,
12900,
17,
7,
77,
2599,
198,
220,
220,
220,
37227,
13615,
257,
1351,
7268,
262,
41566,
261,
44456,
2168,
510,
284,
299,
526,
15931,
198,
220,
... | 2.153846 | 195 |
# coding: utf8
import copy
import heapq
import os
import pickle
import shutil
import socket
import threading
import time
import json
import traceback
import datetime
from . import config, utils, constant
from .replay_file import ReplayFile
from .translation import Translation
from .packet_processor import PacketProce... | [
2,
19617,
25,
3384,
69,
23,
198,
198,
11748,
4866,
198,
11748,
24575,
80,
198,
11748,
28686,
198,
11748,
2298,
293,
198,
11748,
4423,
346,
198,
11748,
17802,
198,
11748,
4704,
278,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
12854,
... | 3.754839 | 155 |
from html_table_parser import HTMLTableParser
import requests
import logging
_LOGGER = logging.getLogger(__name__)
def get_devicelist(home_hub_ip='192.168.1.254'):
"""Retrieve data from BT Home Hub 5 and return parsed result.
"""
url = 'http://{}/'.format(home_hub_ip)
try:
response = reques... | [
6738,
27711,
62,
11487,
62,
48610,
1330,
11532,
10962,
46677,
198,
11748,
7007,
198,
11748,
18931,
198,
198,
62,
25294,
30373,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4299,
651,
62,
7959,
291,
46331,
7,
1119... | 2.577236 | 369 |
# coding=utf-8
"""
everblog.blueprints
~~~~~~~~~~~~~~~~~~~
blueprints for the whole application
"""
import sys, datetime
from functools import wraps
from flask import g, redirect, session, url_for
from toolkit_library.inspector import PackageInspector
from everblog import app, db
from everblog.mo... | [
2,
19617,
28,
40477,
12,
23,
201,
198,
37811,
201,
198,
220,
220,
220,
1683,
14036,
13,
17585,
17190,
201,
198,
220,
220,
220,
220,
27156,
4907,
93,
201,
198,
220,
220,
220,
4171,
17190,
329,
262,
2187,
3586,
201,
198,
37811,
201,
... | 2.785971 | 556 |
DATA = [
{
'name': 'Facundo',
'age': 72,
'organization': 'Platzi',
'position': 'Technical Coach',
'language': 'python',
},
{
'name': 'Luisana',
'age': 33,
'organization': 'Globant',
'position': 'UX Designer',
'langu... | [
26947,
796,
685,
201,
198,
220,
220,
220,
1391,
201,
198,
220,
220,
220,
220,
220,
220,
220,
705,
3672,
10354,
705,
47522,
41204,
3256,
201,
198,
220,
220,
220,
220,
220,
220,
220,
705,
496,
10354,
7724,
11,
201,
198,
220,
220,
22... | 1.824599 | 935 |
# ####### STDLIB
import errno
# noinspection PyUnresolvedReferences
import getpass
# noinspection PyUnresolvedReferences
import logging
# noinspection PyUnresolvedReferences
import sys
# ####### EXT
# noinspection PyBroadException
try:
import fire # type: ignore
except Exception:
... | [
2,
46424,
2235,
3563,
19260,
9865,
198,
198,
11748,
11454,
3919,
198,
2,
645,
1040,
14978,
9485,
3118,
411,
5634,
19927,
198,
11748,
651,
6603,
198,
2,
645,
1040,
14978,
9485,
3118,
411,
5634,
19927,
198,
11748,
18931,
198,
2,
645,
10... | 2.725714 | 350 |
#!usr/bin/env python
import os
import pandas as pd
from tqdm import tqdm
import argparse
from sqlalchemy import create_engine
from sqlalchemy_utils import create_database, database_exists
import sys
import codes3d
if __name__ == '__main__':
args = parse_args()
print('Building...')
for first_lev... | [
2,
0,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
28686,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
11748,
1822,
29572,
198,
6738,
44161,
282,
26599,
1330,
2251,
62,
18392,
198,
6738... | 2.013356 | 599 |
import json
import sqlite3
conn = sqlite3.connect('Json2SQL.sqlite')
cur = conn.cursor()
# Do some setup
cur.executescript('''
DROP TABLE IF EXISTS User;
DROP TABLE IF EXISTS Member;
DROP TABLE IF EXISTS Course;
CREATE TABLE User (
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
name TEXT UNIQUE
... | [
11748,
33918,
198,
11748,
44161,
578,
18,
198,
198,
37043,
796,
44161,
578,
18,
13,
8443,
10786,
41,
1559,
17,
17861,
13,
25410,
578,
11537,
198,
22019,
796,
48260,
13,
66,
21471,
3419,
198,
198,
2,
2141,
617,
9058,
198,
22019,
13,
... | 2.396721 | 610 |
import os
import torch
import argparse
import numpy as np
from collections import defaultdict
from mmcv import Config
from mmcv.runner import load_checkpoint, init_dist, get_dist_info
from mmcv.parallel import MMDistributedDataParallel
from mmdet.apis import set_random_seed, multi_gpu_test
from mmdet3d.models import bu... | [
11748,
28686,
198,
11748,
28034,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
8085,
33967,
1330,
17056,
198,
6738,
8085,
33967,
13,
16737,
1330,
3440,
62,
9122,
4122,
11,
231... | 3.160584 | 137 |
# coding:utf-8
| [
2,
19617,
25,
40477,
12,
23,
628
] | 2.285714 | 7 |
from distutils.core import setup
setup(
name='tweeterid',
version='1.0.0',
description='Get twitter handles based on user ID\'s and vice-versa via tweeterid.com in python',
long_description='Get twitter handles based on user ID\'s and vice-versa via tweeterid.com in python',
author='sl4v',
... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
201,
198,
201,
198,
40406,
7,
201,
198,
220,
220,
220,
1438,
11639,
83,
732,
2357,
312,
3256,
201,
198,
220,
220,
220,
2196,
11639,
16,
13,
15,
13,
15,
3256,
201,
198,
220,
220,
220,
6764,
... | 2.532338 | 201 |
# -*- coding: utf-8 -*-
# IMPORTS
from typing import Dict
# LOCAL IMPORTS
from walmart.core import Resource
class Orders(Resource):
"""
Orders
"""
path = 'orders'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
30023,
33002,
198,
6738,
19720,
1330,
360,
713,
198,
198,
2,
37347,
1847,
30023,
33002,
198,
6738,
6514,
13822,
13,
7295,
1330,
20857,
198,
198,
4871,
30689,
7,
26198... | 2.806452 | 62 |
import os
import os.path
import dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
dotenv.load_dotenv(dotenv_path)
API_KEY = os.environ.get("ACBOT_KEY")
WEBHOOK1 = os.environ.get("WEBHOOK1")
WEBHOOK2 = os.environ.get("WEBHOOK2") | [
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
16605,
24330,
198,
198,
26518,
24330,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
45302,
24330,
11537,
198,
26518,
24330,
... | 2.234234 | 111 |
from django.contrib import admin
from . import models as scheduler_engine_models
# Register your models here.
admin.site.register(scheduler_engine_models.Event)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
198,
6738,
764,
1330,
4981,
355,
6038,
18173,
62,
18392,
62,
27530,
198,
2,
17296,
534,
4981,
994,
13,
198,
198,
28482,
13,
15654,
13,
30238,
7,
1416,
704,
18173,
62,
18392,
62,
2... | 3.468085 | 47 |
from voronoi import VoronoiDiagram, euclidean_distance
from color_models import RGB
import math
import random
from PIL import Image, ImageDraw
from gradients import create_color_gradient
"""
Methods based off of Voronoi diagram generation.
"""
if __name__ == '__main__':
img = multi_circles(1080, 1920, num_of_po... | [
6738,
410,
273,
261,
23013,
1330,
44143,
261,
23013,
18683,
6713,
11,
304,
36616,
485,
272,
62,
30246,
198,
6738,
3124,
62,
27530,
1330,
25228,
198,
11748,
10688,
198,
11748,
4738,
198,
6738,
350,
4146,
1330,
7412,
11,
7412,
25302,
198,... | 2.886525 | 141 |
""" Utility functions used in osxphotos """
import fnmatch
import glob
import importlib
import inspect
import logging
import os
import os.path
import pathlib
import platform
import re
import sqlite3
import subprocess
import sys
import unicodedata
import urllib.parse
from plistlib import load as plistload
from typing i... | [
37811,
34030,
5499,
973,
287,
28686,
87,
24729,
37227,
198,
198,
11748,
24714,
15699,
198,
11748,
15095,
198,
11748,
1330,
8019,
198,
11748,
10104,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
28686,
13,
6978,
198,
11748,
3108,
8019,
... | 2.544985 | 5,613 |
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup
| [
6738,
257,
72,
21857,
13,
19199,
1330,
554,
1370,
9218,
3526,
21864,
11,
554,
1370,
9218,
3526,
9704,
929,
628
] | 3.5 | 20 |
# Python 2
# Note this is not complicated in Python since
# Python automatically handles big integers
import sys
import math
n = int(raw_input().strip())
answer = math.factorial(n)
print answer | [
2,
11361,
362,
201,
198,
201,
198,
2,
5740,
428,
318,
407,
8253,
287,
11361,
1201,
201,
198,
2,
11361,
6338,
17105,
1263,
37014,
201,
198,
201,
198,
11748,
25064,
201,
198,
11748,
10688,
201,
198,
201,
198,
77,
796,
493,
7,
1831,
... | 3.2 | 65 |
from panda3d.core import *
from otp.level import BasicEntities
from direct.directnotify import DirectNotifyGlobal | [
6738,
279,
5282,
18,
67,
13,
7295,
1330,
1635,
198,
6738,
30972,
79,
13,
5715,
1330,
14392,
14539,
871,
198,
6738,
1277,
13,
12942,
1662,
1958,
1330,
4128,
3673,
1958,
22289
] | 3.645161 | 31 |
import logging
import os
import requests
from requests.packages.urllib3.util.retry import Retry
from requests.adapters import HTTPAdapter
LOGGING_LEVEL = logging.getLevelName(os.getenv('LOGGING_LEVEL', 'DEBUG'))
APP_ROOT = os.path.dirname(os.path.abspath(__file__))
APP_TMP = os.path.join(APP_ROOT, 'tmp')
RECEIPT_HOS... | [
11748,
18931,
198,
11748,
28686,
198,
11748,
7007,
198,
6738,
7007,
13,
43789,
13,
333,
297,
571,
18,
13,
22602,
13,
1186,
563,
1330,
4990,
563,
198,
6738,
7007,
13,
324,
12126,
1330,
14626,
47307,
198,
198,
25294,
38,
2751,
62,
2538,... | 2.232558 | 860 |
# -*- coding:utf8 -*-
from scrapy import cmdline
cmdline.execute('scrapy crawl jiadian'.split())
| [
2,
532,
9,
12,
19617,
25,
40477,
23,
532,
9,
12,
198,
6738,
15881,
88,
1330,
23991,
1370,
198,
28758,
1370,
13,
41049,
10786,
1416,
2416,
88,
27318,
474,
72,
18425,
4458,
35312,
28955,
628
] | 2.8 | 35 |
import os
import dotenv
if os.path.exists('.env'):
dotenv.load_dotenv('.env')
DEBUG = True if os.getenv('DEBUG') == 'True' else False
# REQUIRED APP SETTINGS
FRONTEND_URL = os.getenv('FRONTEND_URL')
CONTROLLERS = ['auth', 'resume', 'status']
PROVIDERS = ['headhunter', 'superjob']
CLEANUP_PERIOD = 60*60*24 # ... | [
11748,
28686,
198,
11748,
16605,
24330,
198,
198,
361,
28686,
13,
6978,
13,
1069,
1023,
7,
4458,
24330,
6,
2599,
198,
220,
220,
220,
16605,
24330,
13,
2220,
62,
26518,
24330,
7,
4458,
24330,
11537,
198,
198,
30531,
796,
6407,
611,
286... | 2.172943 | 717 |
import main
import time
import json
import numpy as np
import sys
input_coef = float(sys.argv[1])
constant_coef = float(sys.argv[2])
D = DataSender(input_coef, constant_coef)
D.setUp()
D.test_training()
| [
11748,
1388,
198,
11748,
640,
198,
11748,
33918,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
628,
198,
15414,
62,
1073,
891,
796,
12178,
7,
17597,
13,
853,
85,
58,
16,
12962,
198,
9979,
415,
62,
1073,
891,
796,
12178,
7,
... | 2.5625 | 80 |
from django.test import SimpleTestCase
from django.urls import reverse, resolve
from aemter.views import *
class TestUrls(SimpleTestCase):
"""
Template
def test_xxxx_url_resolves(self):
url = reverse('mitglieder:')
self.assertEqual(resolve(url).func, )
"""
| [
6738,
42625,
14208,
13,
9288,
1330,
17427,
14402,
20448,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
11,
10568,
198,
6738,
257,
368,
353,
13,
33571,
1330,
1635,
198,
198,
4871,
6208,
16692,
7278,
7,
26437,
14402,
20448,
2599,
628... | 2.59292 | 113 |
import random
import itertools
from typing import Generator
import numpy as np
import plotly.graph_objects as go
DIMENSIONS = 3
MAX_SIZE = 128
POINTS_QUANTITY = 4
ITERATIONS = 10_000
CREATE = False
class FractalChaos:
"""
FractalChaos class implements base logic for fractal generation with chaos theory
... | [
11748,
4738,
198,
11748,
340,
861,
10141,
198,
6738,
19720,
1330,
35986,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
7110,
306,
13,
34960,
62,
48205,
355,
467,
628,
198,
35,
3955,
16938,
11053,
796,
513,
198,
22921,
62,
33489,
796,
... | 2.316239 | 1,287 |
#!/usr/bin/python
from ansible.module_utils.basic import AnsibleModule
from dellemc_unity_sdk import runner
from dellemc_unity_sdk import supportive_functions
from dellemc_unity_sdk import constants
ANSIBLE_METADATA = {'metadata_version': '0.1',
'status': ['unstable'],
'support... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
9093,
856,
13,
21412,
62,
26791,
13,
35487,
1330,
28038,
856,
26796,
198,
6738,
1619,
10671,
66,
62,
9531,
62,
21282,
74,
1330,
17490,
198,
6738,
1619,
10671,
66,
62,
9531,
62,
2... | 2.257062 | 354 |
import pytest
from streamlit_prophet.lib.evaluation.preparation import add_time_groupers
from tests.samples.df import df_test
@pytest.mark.parametrize(
"df",
[df_test[8], df_test[10], df_test[11]],
)
| [
11748,
12972,
9288,
198,
6738,
4269,
18250,
62,
22930,
3202,
13,
8019,
13,
18206,
2288,
13,
3866,
1845,
341,
1330,
751,
62,
2435,
62,
8094,
364,
198,
6738,
5254,
13,
82,
12629,
13,
7568,
1330,
47764,
62,
9288,
628,
198,
31,
9078,
92... | 2.470588 | 85 |
#!/usr/bin/env python
'''Shape submodule for dGraph scene description module
David Dunn
Jan 2017 - created by splitting off from dGraph
ALL UNITS ARE IN METRIC
ie 1 cm = .01
www.qenops.com
'''
__author__ = ('David Dunn')
__version__ = '1.6'
__all__ = ["Shape", "PolySurface"]
import dGraph as dg
import dGraph.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
7061,
6,
33383,
850,
21412,
329,
288,
37065,
3715,
6764,
8265,
198,
198,
11006,
30833,
198,
12128,
2177,
532,
2727,
416,
26021,
572,
422,
288,
37065,
198,
198,
7036,
4725,
29722,
15986,
... | 1.98588 | 6,374 |
# In members/urls.py
from django.conf.urls import url
from . import views
app_name = "members"
urlpatterns=[
url(r'^$', views.AllMembersView.as_view(), name="all_members"),
url(r'^new_member/$', views.NewMemberView.as_view(), name="new_member"),
]
| [
2,
554,
1866,
14,
6371,
82,
13,
9078,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
198,
198,
6738,
764,
1330,
5009,
198,
198,
1324,
62,
3672,
796,
366,
30814,
1,
198,
6371,
33279,
82,
41888,
198,
220,
19016,
7,
8... | 2.673684 | 95 |
import numpy as np
import pytest
from numpy.testing import (assert_allclose, assert_array_almost_equal,
assert_array_equal)
from astrodata import NDAstroData
from geminidr.gemini.lookups import DQ_definitions as DQ
from gempy.library.nddops import NDStacker, sum1d
@pytest.fixture
@pytest... | [
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
6738,
299,
32152,
13,
33407,
1330,
357,
30493,
62,
439,
19836,
11,
6818,
62,
18747,
62,
28177,
62,
40496,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2... | 2.195286 | 297 |
# -*- coding: utf-8 -*-
from argparse import ArgumentError, ArgumentParser, RawTextHelpFormatter
from typing import NoReturn, Text
from constants.general import CLI
# ==============================================================================
# CLASS
# ====================================================... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
6738,
1822,
29572,
1330,
45751,
12331,
11,
45751,
46677,
11,
16089,
8206,
22087,
8479,
1436,
201,
198,
6738,
19720,
1330,
1400,
13615,
11,
8255,
201,
198,
... | 4.794521 | 73 |
import logging
import os
import yaml
from pkg_resources import resource_filename
# For testing
if __name__ == "__main__":
print(get_yaml()) | [
11748,
18931,
198,
11748,
28686,
198,
11748,
331,
43695,
198,
6738,
279,
10025,
62,
37540,
1330,
8271,
62,
34345,
628,
198,
198,
2,
1114,
4856,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7,... | 3.106383 | 47 |
"""
Faça um programa que peça o tamanho de um arquivo
para download (em MB) e a velocidade de um link de
Internet (em Mbps), calcule e informe o
tempo aproximado de download do arquivo usando
este link (em minutos).
"""
file_size = float(input("Digite o tamanho do arquivo\n"))
speed_link = float(input("Digite a velo... | [
37811,
198,
50110,
50041,
23781,
1430,
64,
8358,
613,
50041,
267,
256,
10546,
8873,
390,
23781,
610,
421,
23593,
198,
1845,
64,
4321,
357,
368,
10771,
8,
304,
257,
11555,
420,
312,
671,
390,
23781,
2792,
390,
220,
198,
28566,
357,
368... | 2.462264 | 212 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
... | 3.322034 | 59 |
#from: http://stackoverflow.com/questions/17112550/python-and-numba-for-vectorized-functions
#setup: import numpy as np ; np.random.seed(0); N = 100000 ; a, b, c = np.random.rand(N), np.random.rand(N), np.random.rand(N)
#run: vibr_energy(a, b, c)
#pythran export vibr_energy(float64[], float64[], float64[])
import nump... | [
2,
6738,
25,
2638,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
27192,
11623,
1120,
14,
29412,
12,
392,
12,
77,
2178,
64,
12,
1640,
12,
31364,
1143,
12,
12543,
2733,
198,
2,
40406,
25,
1330,
299,
32152,
355,
45941,
2162,
... | 2.515625 | 128 |
from utils.imports import import_all_file_under_current_dir
import_all_file_under_current_dir(__file__)
| [
6738,
3384,
4487,
13,
320,
3742,
1330,
1330,
62,
439,
62,
7753,
62,
4625,
62,
14421,
62,
15908,
198,
198,
11748,
62,
439,
62,
7753,
62,
4625,
62,
14421,
62,
15908,
7,
834,
7753,
834,
8,
198
] | 2.837838 | 37 |
import http
from fastapi import APIRouter, Body, Depends
from app.dependencies import get_current_user
from app.models.user import User
from app.schemas.messages import MessageCreateSchema, MessageSchema, MessageUpdateSchema
from app.services.messages import (
add_reaction_to_message,
create_message,
crea... | [
11748,
2638,
198,
198,
6738,
3049,
15042,
1330,
3486,
4663,
39605,
11,
12290,
11,
2129,
2412,
198,
198,
6738,
598,
13,
45841,
3976,
1330,
651,
62,
14421,
62,
7220,
198,
6738,
598,
13,
27530,
13,
7220,
1330,
11787,
198,
6738,
598,
13,
... | 2.680672 | 476 |
##############################################################################
#
# Copyright (c) 2009 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
15069,
357,
66,
8,
3717,
1168,
3008,
5693,
290,
25767,
669,
13,
198,
2,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
3788,
318,
2426,
284,
262,
8617,
286,
262,
1168,
3008,
5094,
13789... | 2.840878 | 21,650 |