content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import bleach
import asyncio
import logging
import tornado.web
import tornado.iostream
from app.classes.handlers.base_handler import BaseHandler
from app.classes.backupmgr import backupmgr
from app.classes.models import *
logger = logging.getLogger(__name__) | [
11748,
49024,
198,
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
33718,
13,
12384,
198,
11748,
33718,
13,
72,
455,
1476,
198,
6738,
598,
13,
37724,
13,
4993,
8116,
13,
8692,
62,
30281,
1330,
7308,
25060,
198,
6738,
598,
13,
37724,
... | 3.5 | 74 |
from django.conf import settings
from django.conf.urls.static import static
from django.urls import include, path
urlpatterns = [
path("api/", include("config.api_router")), # type: ignore
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
13,
12708,
1330,
9037,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
2291,
11,
3108,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
... | 3 | 87 |
from flask_socketio import SocketIO
socketio = SocketIO(always_connect=True, cors_allowed_origins='*')
from . import video_controller, translate_controller, stt_controller, tts_controller, connect_controller
| [
6738,
42903,
62,
44971,
952,
1330,
47068,
9399,
198,
198,
44971,
952,
796,
47068,
9399,
7,
33770,
62,
8443,
28,
17821,
11,
269,
669,
62,
40845,
62,
11612,
1040,
11639,
9,
11537,
198,
198,
6738,
764,
1330,
2008,
62,
36500,
11,
15772,
... | 3.559322 | 59 |
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import os.path as osp
from bisect import bisect_right
import time
import torch
import numpy as np
from rekognition_online_action_detection.evaluation import compute_result
from ..base_inferences.perframe_det_b... | [
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,
28686,
13,
6978,
355,
267,
2777,
198,
6738,
47457,
478,
... | 3.277372 | 137 |
# -*- coding: utf-8 -*-
"""
==============================
Contextual bandit on MovieLens
==============================
The script uses real-world data to conduct contextual bandit experiments. Here we use
MovieLens 10M Dataset, which is released by GroupLens at 1/2009. Please fist pre-process
datasets (use "movielen... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
4770,
25609,
855,
198,
21947,
723,
4097,
270,
319,
15875,
49479,
198,
4770,
25609,
855,
198,
198,
464,
4226,
3544,
1103,
12,
6894,
1366,
284,
3189,
38356,
40... | 2.39485 | 1,398 |
import sublime, sublime_plugin
| [
11748,
41674,
11,
41674,
62,
33803,
628
] | 4.571429 | 7 |
import FWCore.ParameterSet.Config as cms
process = cms.Process("EDMtoMEConvert")
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.FwkReport.reportEvery = 2000
process.load('Configuration.StandardSequences.EDMtoMEAtJobEnd_cff')
process.load("DQMServices.Components.DQMEnvironment_cfi")... | [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
198,
198,
14681,
796,
269,
907,
13,
18709,
7203,
1961,
44,
1462,
44,
2943,
261,
1851,
4943,
198,
198,
14681,
13,
2220,
7203,
24160,
14055,
13,
12837,
11187,
1362,
13,
128... | 2.390086 | 464 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 4 20:55:11 2017
@author: Dan
"""
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
'''
y = np.random.standard_normal(20)
y2 = y * 100
plt.plot(y.cumsum(), 'b', lw = 1.5, label='1st')
plt.plot(y.cumsum(), 'ro')
plt.plo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
8621,
220,
604,
1160,
25,
2816,
25,
1157,
2177,
198,
198,
31,
9800,
25,
6035,
198,
... | 1.931915 | 940 |
"""
http_auth_detect.py
Copyright 2006 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the hope... | [
37811,
198,
4023,
62,
18439,
62,
15255,
478,
13,
9078,
198,
198,
15269,
4793,
843,
411,
371,
666,
6679,
198,
198,
1212,
2393,
318,
636,
286,
266,
18,
1878,
11,
2638,
1378,
86,
18,
1878,
13,
2398,
14,
764,
198,
198,
86,
18,
1878,
... | 2.2598 | 2,602 |
import requests
import re
| [
11748,
7007,
198,
11748,
302,
628,
198
] | 4 | 7 |
"""Routes configuration
The more specific and detailed routes should be defined first so they
may take precedent over the more generic routes. For more information
refer to the routes manual at http://routes.groovie.org/docs/
"""
from pylons import config
from routes import Mapper
def make_map():
"""Create, confi... | [
37811,
49,
448,
274,
8398,
198,
198,
464,
517,
2176,
290,
6496,
11926,
815,
307,
5447,
717,
523,
484,
198,
11261,
1011,
19719,
625,
262,
517,
14276,
11926,
13,
1114,
517,
1321,
198,
260,
2232,
284,
262,
11926,
10107,
379,
2638,
1378,
... | 1.895693 | 2,972 |
from django.db import models
# Create your models here.
from django.db import models
# Create your models here.
from django.db import models
from django.utils import timezone
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
198,
2,
13610,
534,
4981,
994,
13,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
... | 3.519231 | 52 |
import pytest
import numpy
import torch
from collections import namedtuple
from rlplay.engine.utils.shared import aliased
from rlplay.algo.returns import pyt_gae, npy_gae
from rlplay.algo.returns import pyt_deltas, npy_deltas
from rlplay.algo.returns import pyt_returns, npy_returns
from rlplay.algo.returns import py... | [
11748,
12972,
9288,
198,
198,
11748,
299,
32152,
198,
11748,
28034,
198,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
6738,
374,
75,
1759,
13,
18392,
13,
26791,
13,
28710,
1330,
34965,
839,
198,
6738,
374,
75,
1759,
13,
282,
218... | 2.01506 | 664 |
import re
import math
import gws
import gws.common.layer
import gws.types as t
import gws.gis.source
import gws.tools.json2
_EPSG_3857_RADIUS = 6378137
_EPSG_3857_EXTENT = [
-(math.pi * _EPSG_3857_RADIUS),
-(math.pi * _EPSG_3857_RADIUS),
+(math.pi * _EPSG_3857_RADIUS),
+(math.pi * _EPSG_3857_RADIUS),... | [
11748,
302,
198,
11748,
10688,
198,
198,
11748,
308,
18504,
198,
11748,
308,
18504,
13,
11321,
13,
29289,
198,
11748,
308,
18504,
13,
19199,
355,
256,
198,
11748,
308,
18504,
13,
70,
271,
13,
10459,
198,
11748,
308,
18504,
13,
31391,
... | 2.370166 | 362 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 14 15:39:22 2019
@author: ofrance002
https://keras.io/
https://pwcanalytics.udemy.com/course/data-science-and-machine-learning-with-python-hands-on/learn/lecture/8058996#overview
88. Introducting Keras
"""
'''
Introducing Keras
Be sure to be ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
2556,
1478,
1315,
25,
2670,
25,
1828,
13130,
198,
198,
31,
9800,
25,
286,
8132,
216... | 2.892151 | 1,771 |
#!/usr/bin/env python3
# Este Script tem como objetivo fazer backup da configuração dos equipamentos ASAs e enviar para o seu servidor FTP
# Eh necessario instalar algumas dependencias como:
## pip install netmiko
#
# Criado por Vagner Silva - vagner.instructor@gmail.com
# Github - https://github.com/vagner-instructor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
2,
412,
4169,
12327,
2169,
401,
78,
26181,
316,
23593,
277,
19178,
11559,
12379,
4566,
5330,
16175,
28749,
23430,
25725,
3263,
418,
7054,
1722,
304,
551,
8903,
283,
31215,
267,
... | 2.66537 | 1,285 |
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import plotly.graph_objs as go
import plotly.plotly as py
import plotly.tools as tls
import plotly.figure_factory as ff
import plotly.plotly as py
# prepare color for other stuffs
import umap
from sklearn.manifold import TSNE... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
384,
397,
1211,
355,
3013,
82,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
11748,
7110,
306,
13,
34960,
62,
672,
8457,
355,
... | 2.016873 | 1,778 |
from google.oauth2 import id_token
from google.auth.transport import requests
import os
# (Receive token by HTTPS POST)
# ...
| [
6738,
23645,
13,
12162,
1071,
17,
1330,
4686,
62,
30001,
198,
6738,
23645,
13,
18439,
13,
7645,
634,
1330,
7007,
198,
11748,
28686,
198,
198,
2,
357,
3041,
15164,
11241,
416,
38288,
24582,
8,
198,
2,
2644,
628
] | 3.368421 | 38 |
# -*- coding: utf-8 -*-
import os
import sys
import yaml
import shutil
from PB.CSC.pb_csc_console import LogServer
# os.remove(in_file)
if __name__ == '__main__':
# 获取python输入参数,进行处理
args = sys.argv[1:]
if len(args) == 1: # 跟参数,则处理输入的时段数据
interface_file = args[0]
else:
pr... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
331,
43695,
198,
11748,
4423,
346,
198,
6738,
30524,
13,
34,
6173,
13,
40842,
62,
66,
1416,
62,
41947,
1330,
5972,
10697,
62... | 1.720524 | 229 |
# Copyright (c) OpenMMLab. All rights reserved.
import copy
from collections import defaultdict
import numpy as np
from mmcv.utils import print_log
from mmdet.datasets import DATASETS, ConcatDataset, build_dataset
from mmocr.utils import is_2dlist, is_type_list
@DATASETS.register_module()
class UniformConcatDataset... | [
2,
15069,
357,
66,
8,
4946,
44,
5805,
397,
13,
1439,
2489,
10395,
13,
198,
11748,
4866,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
8085,
33967,
13,
26791,
1330,
3601,
62,
6404,
198,
6738,
... | 2.222844 | 1,786 |
import sys
import warnings
import ray
import numpy as np
from geion.genetic.individual import *
from geion.multicore import *
| [
11748,
25064,
198,
11748,
14601,
198,
198,
11748,
26842,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
4903,
295,
13,
5235,
5139,
13,
43129,
1330,
1635,
198,
6738,
4903,
295,
13,
16680,
291,
382,
1330,
1635,
628
] | 3.394737 | 38 |
"""
Super lazy way to create a new api
"""
from lazy.api import *
app = create_fastapi('testapp')
@app.get('/')
if __name__ == '__main__':
import uvicorn
uvicorn.run(app) | [
198,
37811,
198,
12442,
16931,
835,
284,
2251,
257,
649,
40391,
198,
37811,
198,
198,
6738,
16931,
13,
15042,
1330,
1635,
198,
198,
1324,
796,
2251,
62,
7217,
15042,
10786,
9288,
1324,
11537,
198,
198,
31,
1324,
13,
1136,
10786,
14,
1... | 2.472973 | 74 |
from os.path import join
from invocations import docs
from invocations.testing import test, integration, watch_tests
from invocations.packaging import release
from invoke import Collection
ns = Collection(test, integration, watch_tests, release, docs)
ns.configure({
'tests': {
'package': 'releases',
... | [
6738,
28686,
13,
6978,
1330,
4654,
198,
198,
6738,
800,
20968,
1330,
34165,
198,
6738,
800,
20968,
13,
33407,
1330,
1332,
11,
11812,
11,
2342,
62,
41989,
198,
6738,
800,
20968,
13,
8002,
3039,
1330,
2650,
198,
198,
6738,
26342,
1330,
... | 2.485849 | 212 |
"""
MongoDB Atlas Organisation
~~~~~~~~~~~~~~~~~~~~~~~~~~
An organisation is a top level artefact. Users can
create multiple organizations and be members of multiple
organizations. Each organization can have 0 or more
projects (also called groups) and each project can have 0 or
more clusters.
Author:joe@joedrumgoole.... | [
37811,
198,
44,
25162,
11012,
22494,
30801,
198,
27156,
15116,
4907,
198,
198,
2025,
12684,
318,
257,
1353,
1241,
46252,
22584,
13,
18987,
460,
198,
17953,
3294,
5745,
290,
307,
1866,
286,
3294,
198,
9971,
4582,
13,
5501,
4009,
460,
423... | 3.84375 | 128 |
# -*- coding: utf-8 -*-
from simplespamblocker.tests.middleware import (
BlockMiddlewareValidProfileTests, BlockMiddlewareEmptyProfileTests,
BlockMiddlewareWithTemplateTests)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
985,
2374,
79,
321,
9967,
263,
13,
41989,
13,
27171,
1574,
1330,
357,
198,
220,
220,
220,
9726,
34621,
1574,
47139,
37046,
51,
3558,
11,
9726,
34621,
1574,
40613,
... | 3 | 61 |
from __future__ import annotations
from typing import Optional, TYPE_CHECKING
from spark_auto_mapper_fhir.fhir_types.boolean import FhirBoolean
from spark_auto_mapper_fhir.fhir_types.date import FhirDate
from spark_auto_mapper_fhir.fhir_types.list import FhirList
from spark_auto_mapper_fhir.fhir_types.string import Fh... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
19720,
1330,
32233,
11,
41876,
62,
50084,
2751,
198,
198,
6738,
9009,
62,
23736,
62,
76,
11463,
62,
69,
71,
343,
13,
69,
71,
343,
62,
19199,
13,
2127,
21052,
1330,
376,
71,
343,
46120... | 2.967213 | 1,586 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import time
from caffe2.python import workspace, cnn, memonger, core
import caffe2.python.models.resnet as resnet
import hypothesis.strategi... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
201,
198,
6738,
11593,
37443,
834,
1330,
7297,
201,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
201,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
201,
198,
201,... | 2.508772 | 285 |
#!/usr/bin/env python3.7
from abc import ABC, abstractmethod
from ..secret import Secret
from .sequence_generator import SequenceGenerator
class SecretGenerator(ABC):
"""
Abstract Secret Generator
The elements of the sequence are chosen from a set of possible options
available only to this type of ge... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
13,
22,
198,
198,
6738,
450,
66,
1330,
9738,
11,
12531,
24396,
198,
6738,
11485,
21078,
1330,
3943,
198,
6738,
764,
43167,
62,
8612,
1352,
1330,
45835,
8645,
1352,
628,
198,
4871,
3943,... | 2.529412 | 884 |
import uuid
import random
import string
# Used to simulate data (problem expects up to 1m key-values)
n = 1000000
letters = string.ascii_lowercase + " "
with open("data", "w") as file:
for _ in range(n):
random_length = random.randint(1, 80)
random_string = "".join(random.choice(letters) for i ... | [
11748,
334,
27112,
198,
11748,
4738,
198,
11748,
4731,
628,
198,
2,
16718,
284,
29308,
1366,
357,
45573,
13423,
510,
284,
352,
76,
1994,
12,
27160,
8,
628,
198,
77,
796,
1802,
2388,
198,
15653,
796,
4731,
13,
292,
979,
72,
62,
21037... | 2.641026 | 156 |
#import numpy, scipy, math and astropy libraries
import numpy as np
import scipy as sp
import math
import astropy
#import various astropy functionalities
#is there a benefit/difference between these two import mechanisms?
import astropy.units as u
from astropy.io import fits
from astropy.table import Table
#import va... | [
2,
11748,
299,
32152,
11,
629,
541,
88,
11,
10688,
290,
6468,
28338,
12782,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
355,
599,
198,
11748,
10688,
198,
11748,
6468,
28338,
198,
198,
2,
11748,
2972,
6468,
28338,
103... | 2.832111 | 1,364 |
from git_sh_sync.util.host import get_hostname
| [
6738,
17606,
62,
1477,
62,
27261,
13,
22602,
13,
4774,
1330,
651,
62,
4774,
3672,
628,
198
] | 2.882353 | 17 |
def make_header(ob_size):
"""Make the log header.
This needs to be done dynamically because the observations used as input
to the NN may differ.
"""
entries = []
entries.append("t")
for i in range(ob_size):
entries.append("ob{}".format(i))
for i in range(4):
entries.ap... | [
198,
4299,
787,
62,
25677,
7,
672,
62,
7857,
2599,
198,
220,
220,
220,
37227,
12050,
262,
2604,
13639,
13,
628,
220,
220,
220,
770,
2476,
284,
307,
1760,
32366,
780,
262,
13050,
973,
355,
5128,
220,
198,
220,
220,
220,
284,
262,
3... | 2.487421 | 318 |
###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in ... | [
29113,
29113,
7804,
4242,
21017,
198,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
6372,
5657,
13,
952,
21852,
402,
2022,
39,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
... | 3.25879 | 711 |
from ledger import Ledger
from message import TXEnvelop, SCPEnvelop
from overlay import BaseTransport
from utils import LoggingMixin
from scp import SCP
| [
6738,
37208,
1330,
22964,
1362,
198,
6738,
3275,
1330,
15326,
4834,
1091,
11,
17527,
4834,
1091,
198,
6738,
33345,
1330,
7308,
8291,
634,
198,
6738,
3384,
4487,
1330,
5972,
2667,
35608,
259,
198,
6738,
629,
79,
1330,
17527,
628
] | 3.948718 | 39 |
import requests
import json
from fake_useragent import UserAgent
# register('pa', 'papa', 'papapa@vmailcloud.com') | [
11748,
7007,
201,
198,
11748,
33918,
201,
198,
6738,
8390,
62,
7220,
25781,
1330,
11787,
36772,
201,
198,
201,
198,
201,
198,
201,
198,
2,
7881,
10786,
8957,
3256,
705,
79,
32678,
3256,
705,
79,
499,
32678,
31,
85,
4529,
17721,
13,
... | 2.795455 | 44 |
# Generated by Django 2.0.8 on 2018-10-22 22:54
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
362,
13,
15,
13,
23,
319,
2864,
12,
940,
12,
1828,
2534,
25,
4051,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
6... | 2.818182 | 44 |
from parser import LasParser
from errors import LasFormatException
from errors import VersionBlockException
from errors import WellBlockException
from errors import CurveBlockException
from errors import ParameterBlockException
from errors import OtherBlockException
from errors import DataBlockException
| [
6738,
30751,
1330,
10123,
46677,
198,
6738,
8563,
1330,
10123,
26227,
16922,
198,
6738,
8563,
1330,
10628,
12235,
16922,
198,
6738,
8563,
1330,
3894,
12235,
16922,
198,
6738,
8563,
1330,
46300,
12235,
16922,
198,
6738,
8563,
1330,
25139,
23... | 5.446429 | 56 |
import asyncio
from tornado import gen
from tornado.concurrent import Future
@gen.coroutine
def _assert_called_once_with(test_object, mock, args, kwargs):
"""Mock assertions do not support "any" placeholders. This method allows to use AnyObject as any argument."""
calls_list = mock.call_args_list
tes... | [
11748,
30351,
952,
198,
198,
6738,
33718,
1330,
2429,
198,
6738,
33718,
13,
1102,
14421,
1330,
10898,
628,
198,
31,
5235,
13,
10215,
28399,
628,
628,
198,
4299,
4808,
30493,
62,
7174,
62,
27078,
62,
4480,
7,
9288,
62,
15252,
11,
15290... | 2.457746 | 426 |
"""
Module for manually launching a cluster of bots.
Bots qty for cluster in CLUSTER_QTY const
"""
import asyncio
from math import ceil
import time
from controller import cook_product_id, get_product
from database import SessionLocal
CLUSTER_QTY = 5
db = SessionLocal()
start = time.perf_counter()
if __name__ == '_... | [
37811,
198,
26796,
329,
14500,
13925,
257,
13946,
286,
29641,
13,
198,
33,
1747,
10662,
774,
329,
13946,
287,
7852,
7759,
1137,
62,
48,
9936,
1500,
198,
37811,
198,
11748,
30351,
952,
198,
6738,
10688,
1330,
2906,
346,
198,
11748,
640,
... | 3.02069 | 145 |
from random import randint
| [
198,
6738,
4738,
1330,
43720,
600,
628
] | 4.142857 | 7 |
# Copyright (c) Aaron Gallagher <_@habnab.it>
# See COPYING for details.
from __future__ import unicode_literals
import io
import json
import pytest
import py.path
from passacre.jsonmini import parse
from passacre._ometa import ParseError
jsondir = py.path.local(__file__).dirpath('data', 'json')
| [
2,
15069,
357,
66,
8,
12139,
38580,
1279,
62,
31,
5976,
77,
397,
13,
270,
29,
198,
2,
4091,
27975,
45761,
329,
3307,
13,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
33245,
198,
11748,
33918... | 3.070707 | 99 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2018-03-19 05:53
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
17,
319,
2864,
12,
3070,
12,
1129,
8870,
25,
4310,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.719298 | 57 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
# Copyright 2022 DeepMind Technologies Limited. 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 required by ... | [
2,
15069,
33160,
10766,
28478,
21852,
15302,
13,
1439,
6923,
33876,
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,
35... | 2.412688 | 1,529 |
from abc import ABC
| [
6738,
450,
66,
1330,
9738,
628
] | 3.5 | 6 |
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.shortcuts import get_object_or_404
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group
#from PIL import Image
from io import BytesIO
from django.core.files.uploadedfile import InMemor... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
198,
6738,
... | 3.110701 | 271 |
'''
dN = E * p * N
'''
import random
import matplotlib.pyplot as plt
random.seed()
population_size = 10000
percent_isolated = 90
E = 3
p = 0.1
timesteps = 125 # days
number_of_simulations = 5
time_to_symptoms = 5
time_to_outcome = 10
full_scale = True
results_all_runs = []
for i in range(number_of_simulations)... | [
7061,
6,
198,
67,
45,
796,
412,
1635,
279,
1635,
399,
198,
7061,
6,
198,
11748,
4738,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
25120,
13,
28826,
3419,
198,
198,
39748,
62,
7857,
796,
33028,
198,
25067,... | 2.3952 | 625 |
from pygrouper import pygrouper
from pygrouper.containers import UserData
from pygrouper.manual_tests import test
if __name__ == '__main__':
test.runtest(quick=True)
# test_quick_file()
| [
6738,
12972,
70,
472,
525,
1330,
12972,
70,
472,
525,
198,
6738,
12972,
70,
472,
525,
13,
3642,
50221,
1330,
11787,
6601,
198,
6738,
12972,
70,
472,
525,
13,
805,
723,
62,
41989,
1330,
1332,
198,
198,
361,
11593,
3672,
834,
6624,
70... | 2.684932 | 73 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch.utils.data as data
from torchvision import transforms
import numpy as np
import torch
import json
import cv2
import os
from utils.image import flip, color_aug
from utils.image import get_affine_tra... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
28034,
13,
26791,
13,
7890,
355,
1366,
198,
6738,
28034,
10178,
1330,
31408,
... | 3.548148 | 135 |
import sys
import numpy as np
import pandas
a = np.array([[1, 2], [3, 4]])
# DO NOT WORKS
b = np.array([[0.5, 6], [7, 8]])
# b = np.array([[.5,6],[7,8]]) # The same problem
# This one works fine:
# b = np.array([[5,6],[7,8]])
dfA = pandas.DataFrame(a)
# This works fine EVEN using .5, because the columns name is ... | [
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
19798,
292,
198,
198,
64,
796,
45941,
13,
18747,
26933,
58,
16,
11,
362,
4357,
685,
18,
11,
604,
11907,
8,
198,
198,
2,
8410,
5626,
30936,
50,
198,
65,
796,
4... | 2.180723 | 249 |
#!/usr/bin/python2.3
from pyid3v2 import *
import sys, string
for filename in sys.argv[1:]:
print "Checking %s" % filename
try:
id3 = ID3v2(filename, ID3V2_FILE_READ)
for f in id3.frames:
if f.fid[0] == 'T':
print f.fid, f.fields
except ID3Exception:
print "Unable to find ID3v2 Tag"
# check... | [
2,
48443,
14629,
14,
8800,
14,
29412,
17,
13,
18,
198,
198,
6738,
12972,
312,
18,
85,
17,
1330,
1635,
198,
198,
11748,
25064,
11,
4731,
198,
197,
198,
198,
1640,
29472,
287,
25064,
13,
853,
85,
58,
16,
25,
5974,
198,
197,
4798,
... | 2.111111 | 216 |
# !/usr/bin/env python
# coding: utf-8
__author__ = 'Moch'
from base import BaseHandler
import tornado.web
import tornado.ioloop
import time
import tornado.gen | [
2,
5145,
14,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
834,
9800,
834,
796,
705,
44,
5374,
6,
198,
198,
6738,
2779,
1330,
7308,
25060,
198,
11748,
33718,
13,
12384,
198,
11748,
33718,
13,
16... | 3.037736 | 53 |
"""
Module providing functions to read datasets
"""
import os, glob, json
from collections import defaultdict
from pathlib import Path
import scipy.signal
import pandas as pd
import numpy as np
def _read_file(filename):
"""
Each file should have the same structure
epoch, timestamp and elapsed columns re... | [
37811,
198,
26796,
4955,
5499,
284,
1100,
40522,
198,
37811,
198,
198,
11748,
28686,
11,
15095,
11,
33918,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
629,
541,
88,
13,
12683,
282,
198,
11748,
19... | 2.374853 | 851 |
"""
Dictionary Validation Operator
Checks a dictionary against a schema.
"""
from .internals.base_operator import BaseOperator
from gva.data.validator import Schema # type:ignore
from typing import Any
| [
37811,
201,
198,
35,
14188,
3254,
24765,
35946,
201,
198,
201,
198,
7376,
4657,
257,
22155,
1028,
257,
32815,
13,
201,
198,
37811,
201,
198,
6738,
764,
23124,
874,
13,
8692,
62,
46616,
1330,
7308,
18843,
1352,
201,
198,
6738,
308,
686... | 3.257576 | 66 |
#!/usr/bin/python
#
# Your use of the odrive agent is provided "as is". odrive disclaims all warranties, whether express or implied,
# including without limitation, warranties that the odrive agent is merchantable and fit for your particular purposes.
#
from __future__ import print_function, unicode_literals
import arg... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
3406,
779,
286,
262,
267,
19472,
5797,
318,
2810,
366,
292,
318,
1911,
267,
19472,
28468,
82,
477,
50174,
11,
1771,
4911,
393,
17142,
11,
198,
2,
1390,
1231,
17385,
11,
50174,
... | 2.583732 | 627 |
# -*- coding:utf-8; -*-
if __name__ == "__main__":
T = [73, 74, 75, 71, 69, 72, 76, 73]
s = Solution()
print(s.dailyTemperatures(T))
| [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
26,
532,
9,
12,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
309,
796,
685,
4790,
11,
8915,
11,
5441,
11,
9166,
11,
8644,
11,
7724,
11,
8684,
1... | 2.041667 | 72 |
import re
from taric_challange.core.tools import is_isbn_code
from taric_challange.core.exceptions import TaricGeneralException
VALID_INDEX_VALUES = ["author_id", # (ISBNdb's internal author_id)
"author_name",
"publisher_id", # (ISBNdb's internal publisher_id)
... | [
11748,
302,
198,
6738,
13422,
291,
62,
36747,
858,
13,
7295,
13,
31391,
1330,
318,
62,
271,
9374,
62,
8189,
198,
6738,
13422,
291,
62,
36747,
858,
13,
7295,
13,
1069,
11755,
1330,
14110,
291,
12218,
16922,
628,
198,
23428,
2389,
62,
... | 2.1105 | 1,819 |
"""
Given two words word1 and word2, find the minimum number of operations
required to convert word1 to word2.
You have the following 3 operations permitted on a word:
Insert a character
Delete a character
Replace a character
@author: Lisong Guo <lisong.guo@me.com>
@date: Nov 05, 2018
"""
def ... | [
37811,
198,
15056,
734,
2456,
1573,
16,
290,
1573,
17,
11,
1064,
262,
5288,
1271,
286,
4560,
220,
198,
220,
220,
220,
2672,
284,
10385,
1573,
16,
284,
1573,
17,
13,
198,
198,
1639,
423,
262,
1708,
513,
4560,
10431,
319,
257,
1573,
... | 2.55531 | 452 |
# Copyright 2019 Extreme Networks, 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 i... | [
2,
15069,
13130,
18111,
27862,
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,
13789,
13,
198,
2... | 2.822023 | 781 |
import os
import numpy
import pickle
from collections import Counter
from os.path import exists, join
from torch.utils.data import Dataset
from environment import CACHE_PATH
from utils.preprocessors import vectorize
from utils.preprocessors import vectorize_pad
class BaseDataset(Dataset):
""" Base cl... | [
11748,
28686,
201,
198,
11748,
299,
32152,
201,
198,
11748,
2298,
293,
201,
198,
201,
198,
6738,
17268,
1330,
15034,
201,
198,
6738,
28686,
13,
6978,
1330,
7160,
11,
4654,
201,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
... | 2.730981 | 1,814 |
"""Constants for the automation integration."""
import logging
CONF_ACTION = "action"
CONF_TRIGGER = "trigger"
CONF_TRIGGER_VARIABLES = "trigger_variables"
DOMAIN = "automation"
CONF_DESCRIPTION = "description"
CONF_HIDE_ENTITY = "hide_entity"
CONF_CONDITION_TYPE = "condition_type"
CONF_INITIAL_STATE = "initial_stat... | [
37811,
34184,
1187,
329,
262,
22771,
11812,
526,
15931,
198,
11748,
18931,
198,
198,
10943,
37,
62,
44710,
796,
366,
2673,
1,
198,
10943,
37,
62,
5446,
3528,
30373,
796,
366,
46284,
1,
198,
10943,
37,
62,
5446,
3528,
30373,
62,
53,
... | 2.611765 | 170 |
import datetime
from rest_framework import generics, permissions, status
from rest_framework.response import Response
from django.db.models import Count
from admin.serializers import TopCourseSerializer
from course_homes.models import LearningTopic, Assignment, TopicAsset, CourseHome
from courses.models import Course... | [
11748,
4818,
8079,
198,
198,
6738,
1334,
62,
30604,
1330,
1152,
873,
11,
21627,
11,
3722,
198,
6738,
1334,
62,
30604,
13,
26209,
1330,
18261,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
2764,
198,
198,
6738,
13169,
13,
46911,
... | 4.294118 | 170 |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.views.decorators.csrf import csrf_exempt
# def index(request):
# print('Request for index page received')
# return render(request, 'hello_azure/index.html')
# @csrf_exempt
# def hello(request):
# if request.meth... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
198,
6738,
42625,
14208,
13,
33571,
13,
12501,
273,
2024,
13,
6359,
41871,
1330,
269,
27891,
69,
62,
42679,
198,
19... | 2.461538 | 338 |
import os
import sys
from model.config import Config
from model.data_utils import CoNLLDataset, get_vocabs, UNK, NUM, \
get_vocab, write_vocab, load_vocab, get_char_vocab, \
export_trimmed_embedding_vectors, get_processing_word
def main():
"""Procedure to build data
You MUST RUN this procedure. It it... | [
11748,
28686,
198,
11748,
25064,
198,
6738,
2746,
13,
11250,
1330,
17056,
198,
6738,
2746,
13,
7890,
62,
26791,
1330,
1766,
45,
3069,
27354,
292,
316,
11,
651,
62,
18893,
8937,
11,
4725,
42,
11,
36871,
11,
3467,
198,
220,
220,
220,
... | 2.472498 | 1,109 |
class Cat(Animal):
""" Derived class Cat """
#######################################
# Override Animal eat method
#######################################
# Override object __str__ method
an = Animal()
an.eat()
cat = Cat()
#######################################
# Override Animal eat method
ca... | [
628,
198,
4871,
5181,
7,
40002,
2599,
198,
220,
220,
220,
37227,
9626,
1572,
1398,
5181,
37227,
198,
220,
220,
220,
1303,
29113,
4242,
2235,
198,
220,
220,
220,
1303,
3827,
13154,
13792,
4483,
2446,
628,
220,
220,
220,
1303,
29113,
42... | 3.634409 | 93 |
import tensorflow as tf
from neural_process.module.tfutils import dense_sequential
class Attention:
"""Wrapper for attention mechanisms
Attributes:
attention_type: str, type of attention, [uniform, laplace, dotprod, multihead]
proj: List[int], number of hidden units for projection layer
... | [
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
17019,
62,
14681,
13,
21412,
13,
27110,
26791,
1330,
15715,
62,
3107,
1843,
628,
628,
198,
198,
4871,
47406,
25,
198,
220,
220,
220,
37227,
36918,
2848,
329,
3241,
11701,
198,
220,
... | 3.061321 | 212 |
expected_output = {
'lisp_id': {
0: {
'instance_id': {
4100: {
'prefix': {
'0.0.0.0/0': {
'fwd_action': 'signal',
'locator_status_bits': '0x00000000',
'... | [
40319,
62,
22915,
796,
1391,
198,
220,
220,
220,
705,
75,
8802,
62,
312,
10354,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
657,
25,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
39098,
62,
312,
10354,
... | 1.275405 | 679 |
from app.views import api, app
from app.libs.dataFrame import DataFrame
@api.representation('text/csv')
| [
6738,
598,
13,
33571,
1330,
40391,
11,
598,
201,
198,
6738,
598,
13,
8019,
82,
13,
7890,
19778,
1330,
6060,
19778,
201,
198,
201,
198,
201,
198,
31,
15042,
13,
15603,
341,
10786,
5239,
14,
40664,
11537,
201,
198
] | 2.846154 | 39 |
### Extra Long Factorials - Solution
from math import factorial
n = int(input())
extraLongFactorials(n) | [
21017,
17221,
5882,
19020,
5132,
82,
532,
28186,
198,
198,
6738,
10688,
1330,
1109,
5132,
198,
198,
77,
796,
493,
7,
15414,
28955,
198,
26086,
14617,
29054,
5132,
82,
7,
77,
8
] | 3.28125 | 32 |
from sphericalquadpy.octaslerp.octaslerp import Octaslerp
import pytest
from numpy import pi, inf
| [
6738,
43180,
47003,
9078,
13,
38441,
292,
1754,
79,
13,
38441,
292,
1754,
79,
1330,
2556,
292,
1754,
79,
198,
11748,
12972,
9288,
198,
6738,
299,
32152,
1330,
31028,
11,
1167,
628,
628,
198
] | 3 | 34 |
# -*- coding: utf-8 -*-
from __future__ import division
from collections import namedtuple
import numpy as np
from numpy import random as rng
from scipy.linalg import cho_factor, cho_solve, LinAlgError
from sklearn.base import BaseEstimator
from progressbar import ProgressBar
from copy import deepcopy
def check_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
11593,
37443,
834,
1330,
7297,
198,
198,
6738,
17268,
1330,
3706,
83,
29291,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
1330,
4738,
355,
... | 2.164472 | 4,329 |
from optparse import make_option
from django.core.management.base import BaseCommand
| [
6738,
2172,
29572,
1330,
787,
62,
18076,
198,
198,
6738,
42625,
14208,
13,
7295,
13,
27604,
13,
8692,
1330,
7308,
21575,
628
] | 3.954545 | 22 |
# Copyright 2013 Pau Haro Negre
# based on C++ code by Carl Staelin Copyright 2009-2011
#
# See the NOTICE file distributed with this work for additional information
# regarding copyright ownership.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | [
2,
15069,
2211,
37329,
2113,
78,
13496,
260,
198,
2,
1912,
319,
327,
4880,
2438,
416,
8124,
520,
3010,
259,
15069,
3717,
12,
9804,
198,
2,
198,
2,
4091,
262,
28536,
2393,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9... | 3.869048 | 252 |
# -*- coding: utf8 -*-
# test encoding: à-é-è-ô-ï-€
# Copyright 2021 Adrien Crovato
#
# 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
#
# Unl... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
23,
532,
9,
12,
198,
2,
1332,
21004,
25,
28141,
12,
2634,
12,
14064,
12,
27083,
12,
26884,
12,
26391,
198,
198,
2,
15069,
33448,
1215,
15355,
9325,
85,
5549,
198,
2,
198,
2,
49962,
739,
262,
... | 3.432292 | 192 |
"""toolcache can use standalone caches when there is no function to decorate"""
import toolcache
cache = toolcache.DiskCache()
# first obtain data to be hashed
entry_data = some_expensive_operation(...)
entry_hash = '<some data identifier>'
# save data
cache.save_entry(entry_hash, entry_data)
# load data
loaded_d... | [
37811,
25981,
23870,
460,
779,
27669,
50177,
618,
612,
318,
645,
2163,
284,
11705,
378,
37811,
198,
198,
11748,
2891,
23870,
628,
198,
23870,
796,
2891,
23870,
13,
40961,
30562,
3419,
198,
198,
2,
717,
7330,
1366,
284,
307,
468,
704,
... | 3.387097 | 124 |
# Generated by Django 3.1.5 on 2021-03-07 18:59
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
20,
319,
33448,
12,
3070,
12,
2998,
1248,
25,
3270,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
import os
from dotenv import load_dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
load_dotenv(dotenv_path)
from config.settings import settings
import django
django.setup()
from apistar import Component, Include, Route
from apistar.backends import django_orm
from apistar.frameworks.wsgi import ... | [
11748,
28686,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
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,
2220,
62,
265... | 2.542662 | 586 |
from lzw3.commons.log import Loggable
BYTE_SIZE = 8
BYTE_MASK = 0xFF # 1111 1111
class BitReader(Loggable):
""" Entity that provides a way to read a chunk of bit from a file.
The reading can easily be done by iterate over this entity.
The chunk size must be specified so that this reader actually reads
... | [
6738,
300,
89,
86,
18,
13,
9503,
684,
13,
6404,
1330,
5972,
70,
540,
198,
198,
17513,
9328,
62,
33489,
796,
807,
198,
17513,
9328,
62,
31180,
42,
796,
657,
87,
5777,
220,
1303,
13374,
16,
13374,
16,
628,
198,
4871,
4722,
33634,
7,... | 2.421469 | 5,813 |
import sublime, sublime_plugin
import os
from ..libs import util
from ..libs import NodeJS
from ..libs import javaScriptEnhancements
from ..libs.global_vars import * | [
11748,
41674,
11,
41674,
62,
33803,
198,
11748,
28686,
198,
6738,
11485,
8019,
82,
1330,
7736,
198,
6738,
11485,
8019,
82,
1330,
19081,
20120,
198,
6738,
11485,
8019,
82,
1330,
20129,
7391,
35476,
590,
902,
198,
6738,
11485,
8019,
82,
1... | 3.510638 | 47 |
# Generated by Django 2.2.3 on 2019-07-16 03:50
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
18,
319,
13130,
12,
2998,
12,
1433,
7643,
25,
1120,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
#!/usr/bin/env python2
## -*- coding: utf-8 -*-
##
## $ ./build/triton ./src/examples/pin/strlen.py ./src/samples/others/strlen 1
## [+] 011 bytes tainted from the argv[1] (0x7ffd0014d61f) pointer
## Possible solution: ff:ff:ff:ff:ff:ff:00:ff:ff:ff:ff
## Possible solution: 01:01:01:01:01:01:00
## Possible solution... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
2235,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2235,
198,
2235,
220,
720,
24457,
11249,
14,
83,
799,
261,
24457,
10677,
14,
1069,
12629,
14,
11635,
14,
2536,
... | 2.37633 | 752 |
import requests
import jwt as pyjwt
import base64
from conciliator.connector import Connector
from conciliator.entity import Entity
from conciliator.file import File
from conciliator.document import Document
from conciliator.page import Page
from conciliator.invoice import Invoice
API_VERSION = "api/v0/"
app_url = ... | [
11748,
7007,
198,
11748,
474,
46569,
355,
12972,
73,
46569,
198,
11748,
2779,
2414,
198,
198,
6738,
1673,
2403,
1352,
13,
8443,
273,
1330,
8113,
273,
198,
6738,
1673,
2403,
1352,
13,
26858,
1330,
20885,
198,
6738,
1673,
2403,
1352,
13,
... | 3.278195 | 133 |
# -*- coding: utf-8 -*-
"""
human VS AI models
Input your move in the format: 2,3
@author: Junxiao Song and Yongjie Xu
"""
from __future__ import print_function
import pickle
from game import Board, Game
from mcts_pure import MCTSPlayer as MCTS_Pure
from mcts_alphaZero import MCTSPlayer
from policy_value_net_numpy im... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
10734,
22269,
9552,
4981,
198,
20560,
534,
1445,
287,
262,
5794,
25,
362,
11,
18,
198,
198,
31,
9800,
25,
7653,
87,
13481,
10940,
290,
40633,
73,
494,
3359... | 3.042254 | 213 |
from __future__ import absolute_import, division, print_function
from builtins import str
from copy import deepcopy
from panoptes_client.set_member_subject import SetMemberSubject
from panoptes_client.subject_workflow_status import SubjectWorkflowStatus
from panoptes_client.exportable import Exportable
from panoptes_c... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
6738,
3170,
1040,
1330,
965,
198,
6738,
4866,
1330,
2769,
30073,
198,
6738,
3425,
404,
4879,
62,
16366,
13,
2617,
62,
19522,
62,
32796,
1330,
5345,
276... | 3.663043 | 184 |
# Python modules
# 3rd party modules
import numpy as np
# Our modules
import vespa.analysis.functors.funct_fidsum_all as funct_fidsum_all
from vespa.analysis.chain_base import Chain
class ChainPrepFidsum(Chain):
"""
Building block object used to create a processing chain for MRS data.
Combines mu... | [
2,
11361,
13103,
198,
198,
2,
513,
4372,
2151,
13103,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
3954,
13103,
198,
11748,
410,
274,
8957,
13,
20930,
13,
12543,
5217,
13,
12543,
310,
62,
69,
2340,
388,
62,
439,
355,
1257,
310,
... | 2.181186 | 3,306 |
DRAW_CARD_1 = (950, 550)
DRAW_CARD_2 = (700, 550)
CONFIRM = (986, 866)
BACK = (667, 961)
YES = (1059, 609)
NO = (911, 613)
CHANGE_PHASE = (1250, 680)
BATTLE_PHASE = (1225, 690)
END_PHASE = (1235, 535)
SUMMON_ACTIVATE_EFF = (900, 770)
SET_CARD = (1020, 770)
ATTACK = (960, 770)
MONSTER_ZONE_1 = (860, 610)
MONSTER_ZON... | [
35,
20530,
62,
34,
9795,
62,
16,
796,
357,
31027,
11,
25240,
8,
198,
35,
20530,
62,
34,
9795,
62,
17,
796,
357,
9879,
11,
25240,
8,
198,
198,
10943,
39776,
44,
796,
357,
49087,
11,
807,
2791,
8,
198,
31098,
796,
357,
28933,
11,
... | 1.678478 | 762 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn.svm import LinearSVC
rs = np.random.RandomState(seed=1234)
# Generate fake data with two class clusters.
X0 = rs.multivariate_normal(mean=np.ones(2),
cov=np.eye(2),
size=500)
X1 = rs.multivariate_n... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
1341,
35720,
13,
82,
14761,
1330,
44800,
50,
15922,
198,
198,
3808,
796,
45941,
13,
25120,
13,
29531,
9012,
7,
28826,
28,
1065,
26... | 1.998255 | 573 |
import requests
import json
from psycopg2 import sql
from crawlpack.helpers import connect
default = ",bangalore,india"
api_key = ""
conn, cur = connect()
tables = ["swiggy","uber_eats2","zomato"]
for table in tables:
cur.execute(sql.SQL("SELECT id,name,location,lat_long FROM {}").format(sql.Identifier(table)))
... | [
11748,
7007,
198,
11748,
33918,
198,
6738,
17331,
22163,
70,
17,
1330,
44161,
198,
6738,
27318,
8002,
13,
16794,
364,
1330,
2018,
198,
198,
12286,
796,
33172,
36668,
40612,
11,
521,
544,
1,
198,
15042,
62,
2539,
796,
13538,
198,
37043,
... | 2.298673 | 452 |
from django.conf import settings
# All of the refresh values are in miliseconds, 1 second = 1000 miliseconds
# Adjust accordingly as you wish, preferably in your application's settings.py.
TIME_JS_REFRESH = getattr(settings, 'TIME_JS_REFRESH', 30000)
TIME_JS_REFRESH_LONG = getattr(settings, 'TIME_JS_REFRESH_LONG', 120... | [
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
2,
1439,
286,
262,
14976,
3815,
389,
287,
1465,
27866,
24764,
11,
352,
1218,
796,
8576,
1465,
27866,
24764,
198,
2,
20292,
16062,
355,
345,
4601,
11,
29203,
287,
534,
3586,
338,
646... | 2.868056 | 144 |
#!/usr/bin/python
"""Setup script for a Keras/Tensorflow implementation of Pyramid Scene Parsing Networks."""
from setuptools import setup
config = {
'name': 'pspnet',
'description': 'A Keras implementation of Pyramid Scene Parsing Networks',
'author': 'Vlad Kryvoruchko, Chaoyue Wang, Jeffrey Hu... | [
2,
48443,
14629,
14,
8800,
14,
29412,
201,
198,
37811,
40786,
4226,
329,
257,
17337,
292,
14,
51,
22854,
11125,
7822,
286,
41450,
28315,
23042,
278,
27862,
526,
15931,
201,
198,
201,
198,
6738,
900,
37623,
10141,
1330,
9058,
201,
198,
... | 2.410579 | 397 |
from __future__ import absolute_import, division, print_function
from mock import patch
from qtpy import QtWidgets
from glue import _plugin_helpers as ph
from glue.main import load_plugins
from ..plugin_manager import QtPluginManager
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
198,
6738,
15290,
1330,
8529,
198,
198,
6738,
10662,
83,
9078,
1330,
33734,
54,
312,
11407,
198,
198,
6738,
22749,
1330,
4808,
33803,
62,
16794,
364,
3... | 3.681818 | 66 |
"""
Django settings for app project.
Generated by 'django-admin startproject' using Django 1.8.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths ins... | [
37811,
198,
35,
73,
14208,
6460,
329,
598,
1628,
13,
198,
198,
8645,
515,
416,
705,
28241,
14208,
12,
28482,
923,
16302,
6,
1262,
37770,
352,
13,
23,
13,
18,
13,
198,
198,
1890,
517,
1321,
319,
428,
2393,
11,
766,
198,
5450,
1378,... | 2.257588 | 2,438 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
#encoding=utf-8
import pymssql
class MSSQL():
"""MSSQL初始化方法"""
"""
获取数据库连接对象
"""
"""
执行非查询语句
调用示例:
ms = MSSQL(host="localhost", user="sa", password="123456", database="Demo")
ms.executeUpdate("DELETE FROM T_USER")
"""
"""
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
12,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
12685,
7656,
28,
40477,
12,
23,
198,
198,
11748,
279,
4948,
824,
13976,
198,
198,
4871,
337,
5432,
9711,
33529,
198,
197,
... | 1.4825 | 400 |
from ..permissions import isowner
from ..util import output
from ..client import client
from ..config import get_config
from ..commands import command
@command(r"nick\s*(.*)$")
| [
6738,
11485,
525,
8481,
1330,
318,
18403,
198,
6738,
11485,
22602,
1330,
5072,
198,
6738,
11485,
16366,
1330,
5456,
198,
6738,
11485,
11250,
1330,
651,
62,
11250,
198,
6738,
11485,
9503,
1746,
1330,
3141,
628,
198,
31,
21812,
7,
81,
1,
... | 3.509804 | 51 |
import sys
main()
| [
11748,
25064,
628,
628,
198,
12417,
3419,
198,
197,
628,
197,
628,
197,
198,
197,
198,
197,
198
] | 1.888889 | 18 |
#!/usr/bin/env python
# coding:utf-8
"""
A WSGI application entry.
"""
import os
from transwarp.log import init_log
# 配置全局logging. => 配完PYTHON_PATH,在所有的import前做!!!
init_log(os.path.dirname(os.path.abspath(__file__)))
from tools_lib.transwarp import db
from tools_lib.transwarp.web import WSGIApplication
from model_lo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
40477,
12,
23,
198,
198,
37811,
198,
32,
25290,
18878,
3586,
5726,
13,
198,
37811,
198,
11748,
28686,
198,
198,
6738,
1007,
86,
5117,
13,
6404,
1330,
2315,
62,
6404,
19... | 2.233553 | 304 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
26,
12972,
12,
521,
298,
12,
28968,
25,
19,
532,
9,
12,
198,
29113,
29113,
7804,
4242,
21017,
198,
2,
198,
2,
15069,
357,
34,
8,
185... | 3.634304 | 309 |
import requests
import pytest
from context import PytestConf
"""
NOTE:
These endpoints are admin-only
"dev/ekg"
"dev/plan_cache"
"dev/subscriptions"
"dev/subscriptions/extended"
This needs RTS to be enabled and mainly used for benchmarking:
(hence not adding any tests for this)
"dev/... | [
11748,
7007,
198,
11748,
12972,
9288,
198,
6738,
4732,
1330,
9485,
9288,
18546,
198,
198,
37811,
198,
198,
16580,
25,
198,
220,
220,
220,
2312,
886,
13033,
389,
13169,
12,
8807,
628,
220,
220,
220,
366,
7959,
14,
988,
70,
1,
198,
22... | 2.79638 | 221 |
import bpy
from bpy import context
import math
from math import *
import mathutils
def GetElementsPresentInMolecule(list):
"""
input: list of elements and their xyz coordinates (as string values)
summary: checks for first value of each entry in list, if symbol present, skip
output: a list of all the el... | [
11748,
275,
9078,
198,
6738,
275,
9078,
1330,
4732,
198,
11748,
10688,
198,
6738,
10688,
1330,
1635,
198,
11748,
10688,
26791,
198,
198,
4299,
3497,
36,
3639,
34695,
818,
44,
2305,
23172,
7,
4868,
2599,
198,
220,
220,
220,
37227,
198,
... | 2.221325 | 1,238 |
"""Mission management."""
from pathlib import Path
from shutil import rmtree
from tarfile import TarFile
__all__ = ['Mission']
class Mission:
"""Represents a mission."""
@property
def name(self) -> str:
"""Returns the mission name."""
return self.path.name
@property
def storag... | [
37811,
37057,
4542,
526,
15931,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
4423,
346,
1330,
374,
16762,
631,
198,
6738,
13422,
7753,
1330,
14110,
8979,
628,
198,
834,
439,
834,
796,
37250,
37057,
20520,
628,
198,
4871,
12633,
2... | 2.257908 | 411 |