content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""
Copyright Government of Canada 2017
Written by: Camy Tran, National Microbiology Laboratory,
Public Health Agency of Canada
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this work except in compliance with the License. You may obtain a copy of the
License at:
http://... | [
37811,
198,
15269,
5070,
286,
3340,
2177,
198,
198,
25354,
416,
25,
7298,
88,
833,
272,
11,
2351,
4527,
43592,
18643,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5094,
3893,
7732,
286,
3340,
198,
198,
26656,
1538... | 3.394822 | 309 |
import re
from time import sleep
from noscrapy.utils import Field, PyQuery, Type, etree
| [
11748,
302,
198,
6738,
640,
1330,
3993,
198,
198,
6738,
299,
17500,
2416,
88,
13,
26791,
1330,
7663,
11,
9485,
20746,
11,
5994,
11,
2123,
631,
628
] | 3.333333 | 27 |
from .utils import register_lexicon, lexicons
from .visualize import visualize
from .lang import da, se, no, en, emoji
| [
6738,
764,
26791,
1330,
7881,
62,
2588,
4749,
11,
31191,
34280,
198,
198,
6738,
764,
41464,
1096,
1330,
38350,
198,
6738,
764,
17204,
1330,
12379,
11,
384,
11,
645,
11,
551,
11,
44805,
198
] | 3.529412 | 34 |
#######################################################################################
# 添加重定向的session组件,
# 该组件可以在view中使用,提供通用重定向支付方法中所需的session操作
# 该组件也可以单独被实例化,但需要提供checkout_session对象。
#######################################################################################
from .exceptions import NotInViewException
| [
29113,
29113,
14468,
4242,
21017,
198,
2,
10545,
115,
119,
27950,
254,
34932,
235,
22522,
248,
28938,
239,
21410,
29891,
163,
119,
226,
20015,
114,
171,
120,
234,
198,
2,
5525,
107,
98,
163,
119,
226,
20015,
114,
20998,
107,
20015,
98... | 1.981366 | 161 |
from rest_framework import routers
from rest_framework_extensions.routers import NestedRouterMixin
from rental import api_views as myapp_views
router = NestedDefaultRouter()
friends = router.register(r"friends", myapp_views.FriendViewSet)
friends.register(
r"loans",
myapp_views.LoanViewSet,
basename="f... | [
6738,
1334,
62,
30604,
1330,
41144,
198,
6738,
1334,
62,
30604,
62,
2302,
5736,
13,
472,
1010,
1330,
399,
7287,
49,
39605,
35608,
259,
198,
198,
6738,
14447,
1330,
40391,
62,
33571,
355,
616,
1324,
62,
33571,
628,
198,
198,
472,
353,
... | 2.798851 | 174 |
# -*- coding: utf-8 -*-
import unittest
import pandas as pd
import math
class Test_SAP2012ThermostatModel(unittest.TestCase):
""
def test___init__(self):
""
from OBLib import SAP2012ThermostatModel
from OBLib.ScheduleModel import ScheduleInputs
m=SAP2012ThermostatModel()
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
555,
715,
395,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
10688,
628,
198,
4871,
6208,
62,
50,
2969,
6999,
35048,
1712,
265,
17633,
7,
403,
715,
395... | 1.746631 | 742 |
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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 the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, p... | [
201,
198,
2,
15069,
8309,
532,
2864,
416,
22631,
3539,
26363,
432,
201,
198,
2,
201,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
201,
198,
2,
286,
428,
3788,
290,
3917,
10314,
3... | 2.993298 | 1,492 |
"""
The model that uses CNN to extract features from texts, and generate a score for a query/doc pair
"""
import tensorflow as tf
from detext.utils import model_utils
def apply_cnn_on_text(text_emb,
filter_window_sizes,
num_filters,
num_units,
... | [
37811,
198,
464,
2746,
326,
3544,
8100,
284,
7925,
3033,
422,
13399,
11,
290,
7716,
257,
4776,
329,
257,
12405,
14,
15390,
5166,
198,
37811,
198,
198,
11748,
11192,
273,
11125,
355,
48700,
198,
198,
6738,
1062,
2302,
13,
26791,
1330,
... | 2.062048 | 967 |
# -*- coding: utf-8 -*-
# Created by restran on 2017/11/7
from __future__ import unicode_literals, absolute_import
from ..encoding import force_bytes, text_type, force_text
from .. import PY2, string_types
def fixed_length_split(s, width):
"""
固定长度分割字符串
:param s:
:param width:
:return:
"""
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15622,
416,
1334,
2596,
319,
2177,
14,
1157,
14,
22,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
11,
4112,
62,
11748,
198,
6738,
11485,
12685,
... | 2.027607 | 326 |
# -*- coding: utf-8 -*-
# Begin CVS Header
# $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/bindings/python/unittests/Test_RunSimulations.py,v $
# $Revision: 1.8 $
# $Name: $
# $Author: shoops $
# $Date: 2010/07/16 18:55:59 $
# End CVS Header
# Copyright (C) 2010 by Pedro Mendes, Virginia ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16623,
327,
20304,
48900,
220,
198,
2,
220,
220,
720,
7416,
25,
1220,
16598,
8139,
14,
16060,
14,
14490,
14,
1477,
44860,
14,
66,
14259,
14,
22163,
17053,
62,
7959,... | 2.790541 | 296 |
import re
from django.contrib.auth import authenticate, login
from rest_framework import serializers
from rest_framework.validators import UniqueValidator
from .models import User
from .backend.jwt_auth_token import UserAuthToken
"""
Class that handles data from the register view to the db.
It validates the ... | [
11748,
302,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
1330,
8323,
5344,
11,
17594,
198,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
6738,
1334,
62,
30604,
13,
12102,
2024,
1330,
30015,
47139,
1352,
198,
198,
6738,
764,... | 3.645833 | 96 |
# -*- coding: utf-8 -*-
from os import path
from codecs import open as codecs_open
from setuptools import setup, find_packages
CURRENT_PATH = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with codecs_open(path.join(CURRENT_PATH, 'README.md'), encoding='utf-8') as f:
LONG_DES... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
28686,
1330,
3108,
198,
6738,
40481,
82,
1330,
1280,
355,
40481,
82,
62,
9654,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
34,
39237,
... | 2.529637 | 523 |
from docx.oxml import OxmlElement
from docx.oxml.ns import qn
from docx.shared import Inches
| [
6738,
2205,
87,
13,
1140,
4029,
1330,
10736,
4029,
20180,
198,
6738,
2205,
87,
13,
1140,
4029,
13,
5907,
1330,
10662,
77,
198,
6738,
2205,
87,
13,
28710,
1330,
554,
2052,
628
] | 2.9375 | 32 |
print('10 EPOCHS')
print('10_1')
execfile('Run_10_1.py')
print('10_2')
execfile('Run_10_2.py')
print('10_3')
execfile('Run_10_3.py')
print('10_4')
execfile('Run_10_4.py')
print('10_5')
execfile('Run_10_5.py')
print('20 EPOCHS')
print('20_1')
execfile('Run_20_1.py')
print('20_2')
execfile('Run_20_2.py')
print('20_3')
e... | [
4798,
10786,
940,
14724,
46,
3398,
50,
11537,
198,
4798,
10786,
940,
62,
16,
11537,
198,
18558,
7753,
10786,
10987,
62,
940,
62,
16,
13,
9078,
11537,
198,
4798,
10786,
940,
62,
17,
11537,
198,
18558,
7753,
10786,
10987,
62,
940,
62,
... | 2.170189 | 2,697 |
# stdlib
from xml.etree import ElementTree
# third party
import requests
# project
from checks import AgentCheck
from config import _is_affirmative
QUEUE_URL = "/admin/xml/queues.jsp"
TOPIC_URL = "/admin/xml/topics.jsp"
SUBSCRIBER_URL = "/admin/xml/subscribers.jsp"
TOPIC_QUEUE_METRICS = {
"consumerCount": "cons... | [
2,
14367,
8019,
198,
6738,
35555,
13,
316,
631,
1330,
11703,
27660,
198,
198,
2,
2368,
2151,
198,
11748,
7007,
198,
198,
2,
1628,
198,
6738,
8794,
1330,
15906,
9787,
198,
6738,
4566,
1330,
4808,
271,
62,
2001,
2533,
876,
198,
198,
4... | 2.463203 | 231 |
from flask.ext.sqlalchemy import Model
from sqlalchemy import inspect
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql.expression import Insert
@compiles(InsertOnDuplicate)
class MyModel(Model):
"""Custom base class used as mixin for SQLAlchemy Models."""
@classmethod
@classmethod
... | [
6738,
42903,
13,
2302,
13,
25410,
282,
26599,
1330,
9104,
198,
6738,
44161,
282,
26599,
1330,
10104,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
5589,
5329,
1330,
552,
2915,
198,
6738,
44161,
282,
26599,
13,
25410,
13,
38011,
1330,
3583... | 3.069444 | 144 |
"""The Airzone integration."""
from __future__ import annotations
from .solcastapi import SolcastApi
import logging
import traceback
from datetime import timedelta
import async_timeout
import homeassistant.util.dt as dt_util
from homeassistant.const import SUN_EVENT_SUNSET
from homeassistant.core import HomeAssistan... | [
37811,
464,
3701,
11340,
11812,
526,
15931,
198,
6738,
11593,
37443,
834,
1330,
37647,
198,
198,
6738,
764,
34453,
2701,
15042,
1330,
4294,
2701,
32,
14415,
198,
198,
11748,
18931,
198,
11748,
12854,
1891,
198,
6738,
4818,
8079,
1330,
288... | 2.074904 | 1,562 |
import numpy as np
from pydub import AudioSegment
import random
import sys
import io
import os
import glob
from utils import *
Tx = 5511 # The number of time steps input to the model from the spectrogram
# The number of timesteps of the spectrogram will be 5511.
# (10s sampled... | [
11748,
299,
32152,
355,
45941,
201,
198,
6738,
279,
5173,
549,
1330,
13491,
41030,
434,
201,
198,
11748,
4738,
201,
198,
11748,
25064,
201,
198,
11748,
33245,
201,
198,
11748,
28686,
201,
198,
11748,
15095,
201,
198,
6738,
3384,
4487,
1... | 2.685178 | 2,449 |
# Copyright © 2019 Province of British Columbia
#
# 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 agr... | [
2,
15069,
10673,
13130,
22783,
286,
3517,
9309,
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.646007 | 839 |
#!/usr/bin/env python3
# SPDX-License-Identifier: GPL-2.0+
from os import path
import os, csv
from csv_collection import CSVCollection
from ni_names import value_to_name
CSV_DIR = 'csv'
if __name__ == '__main__':
to_csv()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
38644,
12,
17,
13,
15,
10,
198,
198,
6738,
28686,
1330,
3108,
198,
11748,
28686,
11,
269,
21370,
198,
198,
6738,
269,
21370,
62,
4... | 2.62069 | 87 |
import pygame
import ujson
from twisted.internet.protocol import Protocol
from master import Master
from menu import *
class RemoteSlave(Slave, Protocol):
"""
A remotely connected slave. (exists only on the master side)
Assign it an incoming connection and set_master() with a LocalMaster,
it will decode mess... | [
11748,
12972,
6057,
198,
11748,
334,
17752,
198,
6738,
19074,
13,
37675,
13,
11235,
4668,
1330,
20497,
198,
198,
6738,
4958,
1330,
5599,
198,
6738,
6859,
1330,
1635,
628,
198,
4871,
21520,
11122,
1015,
7,
11122,
1015,
11,
20497,
2599,
1... | 3.081678 | 453 |
# Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
"""Unittest for the tracker helpers module."""
from __future__ import print_function
from __fut... | [
2,
15069,
1584,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
198,
2,
5964,
326,
460,
307,
1043,
287,
262,
38559,
24290,
2393,
393,
379,
198,
2,
... | 3.078983 | 747 |
import os
from gaas.config import ROOT_DIR
def test_root_dir():
"""
Check if the root directory is correct by checking if
requirements.txt exist in the directory. This file needs
to change of the location of requirements.txt changes in
refactoring.
"""
assert os.path.exists(os.path.join(RO... | [
11748,
28686,
198,
6738,
31986,
292,
13,
11250,
1330,
15107,
2394,
62,
34720,
628,
198,
4299,
1332,
62,
15763,
62,
15908,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
6822,
611,
262,
6808,
8619,
318,
3376,
416,
10627,
611,
19... | 3.034783 | 115 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from collections import OrderedDict, namedtuple
import errno
import functools
import importlib
import json
import logging
import os
import shutil
import stat
import tempfile
import time
import traceback
from distutils.dir_util ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
15069,
357,
66,
8,
1853,
28038,
856,
11,
3457,
13,
198,
2,
1439,
6923,
33876,
13,
198,
198,
2,
11361,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
11,
3706,... | 2.322028 | 9,052 |
# -*- coding: utf-8 -*-
#_____________________________________________________________________________
#
# This file is part of txrecaptcha, a Twisted reCAPTCHA client.
#
# :authors: Isis Lovecruft 0xA3ADB67A2CDB8B35 <isis@torproject.org>
# Matthew Finkel 0x017DD169EA793BE2 <sysrqb@torproject.org>
# :copyri... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
27193,
2602,
29343,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
27765,
8344,
2373,
11693,
11,
257,
40006,
302,
33177,
51,
49285,
5456,
13,
198,
2,
198,
2,
1058,
416... | 2.504912 | 3,563 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.api_root),
path('pages/', views.PageList.as_view(), name='page-list'),
path('pages/<int:pk>/', views.PageDetail.as_view(), name='page-detail'),
path('pages/<int:pk>/move_page/', views.MovePageView.as_view(), name='page-mo... | [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
198,
6738,
764,
1330,
5009,
628,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
15042,
62,
15763,
828,
198,
220,
220,
220,
3108,
10786,
31126,
14,
... | 2.711579 | 475 |
"""
file that implements the web service part of the project.
for more information about REST methods and their responsibilities,
visit: https://www.restapitutorial.com/lessons/httpmethods.html
or https://www.w3schools.in/restful-web-services/rest-methods/
"""
import sys
from flask import request, jsonify, abort
from ... | [
37811,
198,
7753,
326,
23986,
262,
3992,
2139,
636,
286,
262,
1628,
13,
198,
1640,
517,
1321,
546,
30617,
5050,
290,
511,
15171,
11,
198,
4703,
270,
25,
3740,
1378,
2503,
13,
2118,
499,
270,
44917,
13,
785,
14,
1203,
684,
14,
4023,
... | 3.240876 | 411 |
import argparse
import time
import sys
import os
sys.path.append(os.path.abspath(os.path.dirname(__file__) + '/..'))
from rgbmatrix import RGBMatrix, RGBMatrixOptions
| [
11748,
1822,
29572,
198,
11748,
640,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
8,
1343,
31051,
492,
6,
4... | 2.964912 | 57 |
import functools
import haiku
import jax
import jraph
import optax
from jax import numpy
@jraph.concatenated_args
@jraph.concatenated_args
@jraph.concatenated_args
# features for nodes
nodes = numpy.array([[0.0], [1.0], [2.0]])
# edges
senders = numpy.array([0, 1, 2])
receivers = numpy.array([1, 2, 0])
# f... | [
11748,
1257,
310,
10141,
198,
198,
11748,
387,
28643,
198,
11748,
474,
897,
198,
11748,
474,
1470,
198,
11748,
2172,
897,
198,
6738,
474,
897,
1330,
299,
32152,
628,
198,
31,
73,
1470,
13,
1102,
9246,
268,
515,
62,
22046,
628,
198,
... | 2.268608 | 618 |
import torch
import torch.nn as nn
import os
import sys
import os.path as osp
dir_path = osp.dirname(osp.realpath(__file__))
sys.path.append(osp.abspath(osp.join(dir_path,'../..')))
import llib.initialization as init
from ss_config import cfg as config
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
28686,
13,
6978,
355,
267,
2777,
198,
15908,
62,
6978,
796,
267,
2777,
13,
15908,
3672,
7,
2117,
13,
5305,
6978,
7,
834,
7753,... | 2.842697 | 89 |
"""
A simple library of functions that provide feature importances
for scikit-learn random forest regressors and classifiers.
MIT License
Terence Parr, http://parrt.cs.usfca.edu
Kerem Turgutlu, https://www.linkedin.com/in/kerem-turgutlu-12906b65
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as p... | [
37811,
198,
32,
2829,
5888,
286,
5499,
326,
2148,
3895,
1330,
1817,
198,
1640,
629,
1134,
270,
12,
35720,
4738,
8222,
50252,
669,
290,
1398,
13350,
13,
198,
198,
36393,
13789,
198,
51,
1945,
2547,
81,
11,
2638,
1378,
1845,
17034,
13,
... | 2.515286 | 8,799 |
import numpy as np
from sumo.plotting import pretty_plot
from amset.constants import bohr_to_m, bohr_to_nm, boltzmann_au, s_to_au
from amset.electronic_structure.fd import dfdde
from amset.plot import BaseMeshPlotter, amset_base_style, styled_plot
__author__ = "Alex Ganose"
__maintainer__ = "Alex Ganose"
__email__ = ... | [
11748,
299,
32152,
355,
45941,
198,
6738,
2160,
78,
13,
29487,
889,
1330,
2495,
62,
29487,
198,
198,
6738,
716,
2617,
13,
9979,
1187,
1330,
275,
1219,
81,
62,
1462,
62,
76,
11,
275,
1219,
81,
62,
1462,
62,
21533,
11,
18100,
89,
90... | 2.496324 | 272 |
from setuptools import setup
setup(name='jkpypypi',
version='1.0',
description='dj App',
author='Jelena',
author_email='kocicjelena@gmail.com',
url='https://github.com/kocicjelena/py-pypi/'
)
| [
6738,
900,
37623,
10141,
1330,
9058,
201,
198,
201,
198,
40406,
7,
3672,
11639,
73,
74,
79,
4464,
4464,
72,
3256,
201,
198,
220,
220,
220,
220,
220,
2196,
11639,
16,
13,
15,
3256,
201,
198,
220,
220,
220,
220,
220,
6764,
11639,
28... | 2.017241 | 116 |
import asyncio
from secrets import token_bytes
from pathlib import Path
from typing import Any, Dict
import sqlite3
import random
import aiosqlite
import pytest
from src.full_node.store import FullNodeStore
from src.full_node.coin_store import CoinStore
from src.full_node.blockchain import Blockchain
from src.types.fu... | [
11748,
30351,
952,
198,
6738,
13141,
1330,
11241,
62,
33661,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
19720,
1330,
4377,
11,
360,
713,
198,
11748,
44161,
578,
18,
198,
11748,
4738,
198,
198,
11748,
257,
4267,
13976,
578,
198,
1174... | 2.700599 | 334 |
from __future__ import absolute_import, print_function
import datetime
import json
import jsonschema
import logging
import os
from unittest import TestCase
from ..encoded import (
ENCODED,
ENCODED_CONTEXT,
ENCODED_NAMESPACES,
DCCValidator,
DuplicateAliasError,
get_object_type,
typed_column... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
198,
198,
11748,
4818,
8079,
198,
11748,
33918,
198,
11748,
44804,
684,
2395,
2611,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
1... | 2.760479 | 167 |
from .. import patcher as dist
from megatron import mpu
| [
6738,
11485,
1330,
1458,
2044,
355,
1233,
198,
6738,
17243,
23484,
1330,
285,
19944,
198
] | 3.733333 | 15 |
TRAIN_TEST_SPLIT = 0.2
TRY_GPU = True
MAX_TREE_DEPTH = 12
BATCH_SIZE = 100000
BATCH_ITERATIONS = 5
HIST_BINS = 100 # Weights
CLIP_BOUNDS = [-10, 10] # Scaler clipping
NBITS = 2048 # Morgan fps
RADIUS = 3
LOG_PATH = "catboost_training.log"
| [
51,
3861,
1268,
62,
51,
6465,
62,
4303,
43,
2043,
796,
657,
13,
17,
198,
40405,
62,
33346,
796,
6407,
198,
22921,
62,
51,
11587,
62,
46162,
4221,
796,
1105,
198,
33,
11417,
62,
33489,
796,
1802,
830,
198,
33,
11417,
62,
2043,
1137... | 2.240741 | 108 |
#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
# @generated
#
from __future__ import absolute_import
import sys
from thrift.util.Recursive import fix_spec
from thrift.Thrift import TType, TMessageType, TPriority, TRequestContext, TProcessorEventHandler, TServerInterfa... | [
2,
198,
2,
5231,
519,
877,
515,
416,
16283,
2135,
198,
2,
198,
2,
8410,
5626,
48483,
4725,
48481,
7013,
15986,
311,
11335,
14603,
7013,
35876,
25003,
7013,
15986,
8410,
2751,
198,
2,
220,
2488,
27568,
198,
2,
198,
198,
6738,
11593,
... | 2.534296 | 1,108 |
#
# Copyright 2021 Splunk 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 writing, so... | [
2,
198,
2,
15069,
33448,
13341,
2954,
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.935091 | 493 |
from typing import Any, Dict, List, Union
from uuid import UUID
import attr
import validators
from jsonschema import Draft7Validator, FormatChecker, FormatError
@attr.s(frozen=True, auto_attribs=True)
class ValidationError:
"""Data object representation for validation errors
Attributes:
element (str... | [
6738,
19720,
1330,
4377,
11,
360,
713,
11,
7343,
11,
4479,
198,
6738,
334,
27112,
1330,
471,
27586,
198,
198,
11748,
708,
81,
198,
11748,
4938,
2024,
198,
6738,
44804,
684,
2395,
2611,
1330,
13650,
22,
47139,
1352,
11,
18980,
9787,
26... | 2.794586 | 628 |
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import atexit
import fcntl
import time
import signal
import logging
import logging.config
from threading import Thread
from multiprocessing import Process
from ConfigParser import ConfigParser, Error as ConfigParserError
from openprocurement.complaints.queue... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
379,
37023,
198,
11748,
277,
66,
429,
75,
198,
11748,
640,
198,
11748,
6737,
198,
11748,
18931,
... | 3.22695 | 141 |
import pytest
import os
current_path = os.path.join(os.getcwd(), "temporary_testing_directory")
eupmc_json_path = os.path.join(current_path, "eupmc_results.json")
crossref_json_path = os.path.join(current_path, "eupmc_results.json")
os.system(f'pygetpapers -q "lantana" -k 5 -o "{current_path}"')
| [
11748,
12972,
9288,
198,
11748,
28686,
198,
14421,
62,
6978,
796,
28686,
13,
6978,
13,
22179,
7,
418,
13,
1136,
66,
16993,
22784,
366,
11498,
5551,
62,
33407,
62,
34945,
4943,
198,
68,
929,
23209,
62,
17752,
62,
6978,
796,
28686,
13,
... | 2.567797 | 118 |
###############################################################################
# The MIT License (MIT)
#
# Copyright (c) 2014 Justin Lovinger
#
# 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 the Softwar... | [
29113,
29113,
7804,
4242,
21017,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
15069,
357,
66,
8,
1946,
10799,
39911,
3889,
198,
2,
198,
2,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
... | 2.781803 | 3,616 |
"""Specification for the RoboMaker create simulation job component."""
# 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 appl... | [
37811,
22882,
2649,
329,
262,
39702,
48890,
2251,
18640,
1693,
7515,
526,
15931,
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... | 3.254098 | 610 |
# test_findvalues.py
# Copyright 2016 Roger Marsh
# Licence: See LICENCE (BSD licence)
"""findvalues tests"""
import unittest
import os
from ast import literal_eval
import re
from ._filespec import (
GAMES_FILE_DEF,
GAME_FIELD_DEF,
EVENT_FIELD_DEF,
SITE_FIELD_DEF,
DATE_FIELD_DEF,
ROUND_FIELD_... | [
2,
1332,
62,
19796,
27160,
13,
9078,
198,
2,
15069,
1584,
13637,
9786,
198,
2,
10483,
594,
25,
4091,
38559,
18310,
357,
21800,
17098,
8,
198,
198,
37811,
19796,
27160,
5254,
37811,
198,
198,
11748,
555,
715,
395,
198,
11748,
28686,
19... | 2.552581 | 523 |
"""Interval median distance of array can be calculated in
O(N^2) time as below."""
mdist = [[0]*n for _ in range(n)] # mdist[i][j] median distance of houses[i:j+1]
for i in range(n):
for j in range(i+1, n):
mdist[i][j] = mdist[i][j-1] + houses[j] - houses[i+j >> 1] | [
198,
197,
37811,
9492,
2100,
14288,
5253,
286,
7177,
460,
307,
10488,
287,
220,
198,
197,
46,
7,
45,
61,
17,
8,
640,
355,
2174,
526,
15931,
198,
220,
220,
220,
285,
17080,
796,
16410,
15,
60,
9,
77,
329,
4808,
287,
2837,
7,
77,
... | 2.143885 | 139 |
from typing import Text, Any, Dict, List, Union, Optional
from sagas.nlu.intf import Entity
import logging
logger = logging.getLogger(__name__)
providers={'rasa_simple': get_entity_mapping}
| [
6738,
19720,
1330,
8255,
11,
4377,
11,
360,
713,
11,
7343,
11,
4479,
11,
32233,
198,
198,
6738,
45229,
292,
13,
77,
2290,
13,
600,
69,
1330,
20885,
198,
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
... | 2.984615 | 65 |
from setuptools import setup
setup(name="pynmea",
version="0.7.0",
description="Python NMEA Library",
author="Heiko 'riot' Weinen",
author_email="riot@hackerfleet.org",
url="https://github.com/hackerfleet/pynmea",
license="MIT",
packages=['pynmea'])
| [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
3672,
2625,
79,
2047,
1326,
64,
1600,
198,
220,
220,
220,
220,
220,
2196,
2625,
15,
13,
22,
13,
15,
1600,
198,
220,
220,
220,
220,
220,
6764,
2625,
37906,
399,
11682,
32,
10... | 2.289063 | 128 |
#!/usr/bin/env python3
# --------------------------------------
# Interfaces configuration files generator
# --------------------------------------
import sys, os
# --------------------------------------
from codegencore import pp_warning, pp_error
from codegencore import prepare_directory
from codegencore import write... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
20368,
23031,
198,
2,
4225,
32186,
8398,
3696,
17301,
198,
2,
20368,
23031,
198,
11748,
25064,
11,
28686,
198,
2,
20368,
23031,
198,
6738,
2438,
5235,
7295,
1330,
9788,
62,
4391... | 2.910345 | 580 |
#!/usr/bin/env python
# WS client example to test server
import asyncio
import websockets
import json
import time
asyncio.get_event_loop().run_until_complete(hello()) | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
25290,
5456,
1672,
284,
1332,
4382,
198,
198,
11748,
30351,
952,
198,
11748,
2639,
11603,
198,
11748,
33918,
198,
11748,
640,
198,
198,
292,
13361,
952,
13,
1136,
62,
15596,
62,
262... | 3.294118 | 51 |
'''
Interrupt Controller to handle hardware interrupts
'''
import logging
import queue
from utils import utils
from utils.errors import AldebaranError
logger = logging.getLogger(__name__)
class InterruptController:
'''
Interrupt Controller
Currently a simple FIFO queue. Later it can change to somethi... | [
7061,
6,
198,
9492,
3622,
22741,
284,
5412,
6890,
48237,
198,
7061,
6,
198,
198,
11748,
18931,
198,
11748,
16834,
198,
198,
6738,
3384,
4487,
1330,
3384,
4487,
198,
6738,
3384,
4487,
13,
48277,
1330,
15586,
1765,
19173,
12331,
628,
198,... | 2.567616 | 562 |
from botocore import __version__ as botocore_version
from botocore import session
from botocore.session import get_session # noqa: F401
import nifcloud
session.Session = Session
| [
6738,
10214,
420,
382,
1330,
11593,
9641,
834,
355,
10214,
420,
382,
62,
9641,
198,
6738,
10214,
420,
382,
1330,
6246,
198,
6738,
10214,
420,
382,
13,
29891,
1330,
651,
62,
29891,
220,
1303,
645,
20402,
25,
376,
21844,
198,
198,
11748... | 3.388889 | 54 |
import operator
from jmespath import functions
| [
11748,
10088,
201,
198,
201,
198,
6738,
474,
6880,
6978,
1330,
5499,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198
] | 2.423077 | 26 |
# -*- coding: utf-8 -*-
"""
This code creates a SVM and Random Forest model for predicting the outcome of the game
"""
import numpy as np
import pandas as pd
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier
from sklearn.cross_validation import KFold
from sklearn import grid_search
from F... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
1212,
2438,
8075,
257,
311,
15996,
290,
14534,
9115,
2746,
329,
25539,
262,
8055,
286,
262,
983,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11... | 2.192042 | 578 |
import os
import minutiae
import processminutiae
import time
import numpy as np
#minutiae.minutiae_extract("imgs\\", "minutiaes\\")
true_list = []
false_list = []
for root, dirs, files in os.walk('minutiaes'):
print("root = ", root)
print("\ndirs = ", dirs)
print("\nfiles = \n", files)
print("________... | [
11748,
28686,
198,
11748,
949,
315,
33100,
198,
11748,
1429,
1084,
315,
33100,
198,
11748,
640,
198,
11748,
299,
32152,
355,
45941,
198,
198,
2,
1084,
315,
33100,
13,
1084,
315,
33100,
62,
2302,
974,
7203,
9600,
82,
6852,
1600,
366,
1... | 1.916715 | 1,729 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import os
# load env
from flask_app.boot import load_dot_env
# fargate container variable
from flask_app.enums.events import EventType
from flask_app.events.tracker import EventTracker
from flask_app.vos.events import EventVO
env = os.environ['ENVIRONMENT_N... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
2779,
2414,
198,
11748,
28686,
198,
198,
2,
3440,
17365,
198,
6738,
42903,
62,
1324,
13,
18769,
1330,
3440,
62,
... | 2.592982 | 855 |
# vim: set ff=unix expandtab ts=4 sw=4:
import unittest
import numpy as np
from CompartmentalSystems.bins.TsMassField import TsMassField
from CompartmentalSystems.bins.TsTpMassField import TsTpMassField
from CompartmentalSystems.bins.TsTpDeathRateField import TsTpDeathRateField
from CompartmentalSystems.bins.TsTpMassFi... | [
2,
43907,
25,
900,
31246,
28,
403,
844,
4292,
8658,
40379,
28,
19,
1509,
28,
19,
25,
198,
11748,
555,
715,
395,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3082,
1823,
282,
11964,
82,
13,
65,
1040,
13,
33758,
20273,
15878,
1330,
... | 2.682927 | 164 |
t = int(input())
for _ in range(t):
solve() | [
198,
220,
220,
220,
220,
198,
198,
83,
796,
493,
7,
15414,
28955,
198,
1640,
4808,
287,
2837,
7,
83,
2599,
198,
220,
220,
220,
8494,
3419
] | 2 | 27 |
from django.db import models
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import User
#from userprofile import UserProfile
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
2,
6738,
2836,
13... | 3.608696 | 46 |
from decimal import Decimal
import datetime
try:
import uuid
_use_uuid = True
except ImportError:
_use_uuid = False
datetime_format = "%Y/%m/%d %H:%M:%S"
date_format = "%Y/%m/%d"
time_format = "%H:%M:%S"
| [
6738,
32465,
1330,
4280,
4402,
198,
11748,
4818,
8079,
198,
198,
28311,
25,
198,
220,
220,
220,
1330,
334,
27112,
198,
220,
220,
220,
4808,
1904,
62,
12303,
312,
796,
6407,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
4808,
1904,... | 2.186275 | 102 |
from random import randint
import requests
import json
import os
from gtts import gTTS
from playsound import playsound
# def CMD(ctx):
# print('CMD CALLED')
# return('CMD REPLY')
| [
6738,
4738,
1330,
43720,
600,
201,
198,
11748,
7007,
201,
198,
11748,
33918,
201,
198,
11748,
28686,
201,
198,
6738,
308,
83,
912,
1330,
308,
51,
4694,
201,
198,
6738,
5341,
633,
1330,
5341,
633,
201,
198,
201,
198,
201,
198,
201,
1... | 2.196078 | 102 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2017-11-28 13:54
from __future__ import unicode_literals
from django.db import migrations, models
import testando.models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
22,
319,
2177,
12,
1157,
12,
2078,
1511,
25,
4051,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.84127 | 63 |
import dis
from test.support import import_module
import unittest
_opcode = import_module("_opcode")
if __name__ == "__main__":
unittest.main()
| [
11748,
595,
198,
6738,
1332,
13,
11284,
1330,
1330,
62,
21412,
198,
11748,
555,
715,
395,
198,
198,
62,
404,
8189,
796,
1330,
62,
21412,
7203,
62,
404,
8189,
4943,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
1... | 2.849057 | 53 |
#!/usr/bin/env python
#
# Copyright (c) 2020 by VMware, Inc. ("VMware")
# Used Copyright (c) 2018 by Network Device Education Foundation,
# Inc. ("NetDEF") in this file.
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the abo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
2,
198,
2,
15069,
357,
66,
8,
12131,
416,
37754,
11,
3457,
13,
5855,
15996,
1574,
4943,
198,
2,
16718,
15069,
357,
66,
8,
2864,
416,
7311,
16232,
7868,
5693,
11,
198,
2,
3457,... | 1.884247 | 17,140 |
# Jogo de adivinhação
import requests
import random
#Gerar as palavras
url ='https://www.ime.usp.br/~pf/dicios/br-utf8.txt'
resposta = requests.get(url)
u = resposta.content.splitlines()
u = [palavra.decode('utf-8') for palavra in u]
sorte = random.randint(0, 261797)
palavras_aleatorias = u[sorte]
chances = 5... | [
2,
449,
24076,
390,
512,
452,
259,
3099,
16175,
28749,
198,
11748,
7007,
198,
11748,
4738,
198,
198,
2,
38069,
283,
355,
6340,
615,
8847,
198,
198,
6371,
796,
6,
5450,
1378,
2503,
13,
524,
13,
17723,
13,
1671,
14,
93,
79,
69,
14,
... | 2.137048 | 664 |
# ## Django App ###
| [
2,
22492,
37770,
2034,
44386,
198
] | 3.333333 | 6 |
import base64
from typing import Awaitable, Callable, List, NoReturn, cast
from cryptography import fernet
from aiohttp import web
from aiohttp_session import setup, get_session
from aiohttp_session.cookie_storage import EncryptedCookieStorage
_Handler = Callable[[web.Request], Awaitable[web.StreamResponse]]
... | [
11748,
2779,
2414,
198,
6738,
19720,
1330,
5851,
4548,
540,
11,
4889,
540,
11,
7343,
11,
1400,
13615,
11,
3350,
198,
198,
6738,
45898,
1330,
277,
1142,
316,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
6738,
257,
952,
4023,
62,
29891,
... | 3.382353 | 102 |
s = Solution()
print(s.reverseWords("the sky is blue"))
print(s.reverseWords(" hello world "))
print(s.reverseWords("a good example"))
print(s.reverseWords(" Bob Loves Alice "))
print(s.reverseWords("Alice does not even like bob"))
| [
198,
198,
82,
796,
28186,
3419,
198,
4798,
7,
82,
13,
50188,
37117,
7203,
1169,
6766,
318,
4171,
48774,
198,
4798,
7,
82,
13,
50188,
37117,
7203,
220,
23748,
995,
220,
366,
4008,
198,
4798,
7,
82,
13,
50188,
37117,
7203,
64,
922,
... | 2.916667 | 84 |
# This file is part of the Pattern and Anomaly Detection Library (openclean_pattern).
#
# Copyright (C) 2021 New York University.
#
# openclean_pattern is released under the Revised BSD License. See file LICENSE for
# full license details.
"""unit tests for datetype resolver classs"""
from openclean_pattern.datatypes... | [
2,
770,
2393,
318,
636,
286,
262,
23939,
290,
1052,
24335,
46254,
10074,
357,
9654,
27773,
62,
33279,
737,
198,
2,
198,
2,
15069,
357,
34,
8,
33448,
968,
1971,
2059,
13,
198,
2,
198,
2,
1280,
27773,
62,
33279,
318,
2716,
739,
262,... | 3.769841 | 126 |
from mkutils.gromacs_writer import FFWriter
import json, os
ff_file = 'cc_parameters.json'
outfile = 'ffnonbonded.itp'
if not os.path.isfile(ff_file):
with open(ff_file, 'w') as f:
_dict = {'atomtypes': {}, 'crossints': {}}
json.dump(_dict, f)
ff = FFWriter(ff_file)
# Write atomtypes
# at... | [
6738,
33480,
26791,
13,
70,
398,
16436,
62,
16002,
1330,
18402,
34379,
198,
11748,
33918,
11,
28686,
198,
198,
487,
62,
7753,
796,
705,
535,
62,
17143,
7307,
13,
17752,
6,
198,
448,
7753,
796,
705,
487,
13159,
65,
623,
276,
13,
270,... | 2.126 | 500 |
#
# ============LICENSE_START==========================================
# org.onap.vvp/engagementmgr
# ===================================================================
# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
# ===================================================================
#
# Unless ... | [
2,
198,
2,
796,
2559,
18604,
43,
2149,
24290,
62,
2257,
7227,
10052,
2559,
855,
198,
2,
8745,
13,
261,
499,
13,
25093,
79,
14,
1516,
5082,
76,
2164,
198,
2,
38093,
855,
198,
2,
15069,
10673,
2177,
5161,
5,
51,
42443,
14161,
13,
... | 4.077821 | 514 |
# file: driver.py
# author: Dr. Pablo Rivas
# version: 1.0
# date: Aug/5/2016
#
# This file shows how to create a simple plot in python
# using the well-known matplotlib package.
import numpy as np
import matplotlib.pyplot as plt
# Creates an evenly sampled time array at 100ms intervals
t = np.arange(0., 5., 0.1)
... | [
2,
2393,
25,
4639,
13,
9078,
198,
2,
1772,
25,
1583,
13,
33185,
34686,
292,
198,
2,
2196,
25,
352,
13,
15,
198,
2,
3128,
25,
2447,
14,
20,
14,
5304,
198,
2,
220,
198,
2,
770,
2393,
2523,
703,
284,
2251,
257,
2829,
7110,
287,
... | 2.453704 | 324 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
628
] | 3.333333 | 6 |
import sys, threading, io, subprocess, os
hook_stdio()
| [
11748,
25064,
11,
4704,
278,
11,
33245,
11,
850,
14681,
11,
28686,
198,
198,
25480,
62,
19282,
952,
3419,
198
] | 2.8 | 20 |
import argparse
import time
import ml_dataset_loader.datasets as data_loader
import numpy as np
import pandas as pd
import xgboost as xgb
from sklearn.metrics import mean_squared_error, accuracy_score
if __name__ == "__main__":
main()
| [
11748,
1822,
29572,
201,
198,
11748,
640,
201,
198,
11748,
25962,
62,
19608,
292,
316,
62,
29356,
13,
19608,
292,
1039,
355,
1366,
62,
29356,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
19798,
292,
355,
279,
67,
201,
198... | 2.747253 | 91 |
from . import evaluate_model, predict_model, train_model
| [
6738,
764,
1330,
13446,
62,
19849,
11,
4331,
62,
19849,
11,
4512,
62,
19849,
198
] | 3.8 | 15 |
# Remove TF warnings in Stable baselines (may not be safe)
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
import tensorflow as tf
tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR)
from stable_baselines.common.policies import MlpPolicy
from stable_baselines.common.vec_env imp... | [
2,
17220,
24958,
14601,
287,
520,
540,
1615,
20655,
357,
11261,
407,
307,
3338,
8,
198,
11748,
14601,
198,
40539,
654,
13,
36439,
24455,
7,
2673,
11639,
46430,
3256,
6536,
28,
29783,
20361,
8,
198,
11748,
11192,
273,
11125,
355,
48700,
... | 3.190476 | 210 |
# Generated by Django 2.1.5 on 2019-02-06 17:36
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
362,
13,
16,
13,
20,
319,
13130,
12,
2999,
12,
3312,
1596,
25,
2623,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
"""
Préliminaires
0.Récupérer le dossier tp-restos.
Une liste de restaurants vous est fournie et, pour chaque restaurant, vous pouvez accéder à son nom, son adresse (à travers num et rue), sa localisation exprimée cette fois en latitude et longitude (lat et lon), sa position dans le classement (pos), ... | [
198,
198,
37811,
628,
628,
628,
198,
198,
6836,
2634,
2475,
1437,
2387,
628,
220,
220,
220,
657,
13,
49,
2634,
25244,
2634,
11751,
443,
34602,
256,
79,
12,
2118,
418,
13,
198,
220,
220,
220,
471,
710,
1351,
68,
390,
10808,
410,
51... | 2.196818 | 2,200 |
from data import get_dataloader, readfile
import numpy as np
import argparse
import yaml
import torch
import random
if __name__ == '__main__':
main()
| [
6738,
1366,
1330,
651,
62,
67,
10254,
1170,
263,
11,
1100,
7753,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
11748,
331,
43695,
198,
11748,
28034,
198,
11748,
4738,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
... | 3 | 53 |
from flask import (
Blueprint,
flash,
redirect,
render_template,
request,
url_for,
)
from flask_login import current_user, login_required
from flask_wtf import FlaskForm
from wtforms.fields import BooleanField, TextAreaField
from wtforms.fields.html5 import EmailField
from wtforms.validators imp... | [
6738,
42903,
1330,
357,
198,
220,
220,
220,
39932,
11,
198,
220,
220,
220,
7644,
11,
198,
220,
220,
220,
18941,
11,
198,
220,
220,
220,
8543,
62,
28243,
11,
198,
220,
220,
220,
2581,
11,
198,
220,
220,
220,
19016,
62,
1640,
11,
... | 3.043902 | 205 |
import requests
import posixpath
from ..config import settings
| [
11748,
7007,
198,
11748,
1426,
844,
6978,
198,
198,
6738,
11485,
11250,
1330,
6460,
628,
628,
628,
198
] | 3.888889 | 18 |
<!DOCTYPE html>
<html lang="en-US" >
<head>
<script>
window.ts_endpoint_url = "https:\/\/slack.com\/beacon\/timing";
(function(e) {
var n=Date.now?Date.now():+new Date,r=e.performance||{},t=[],a={},i=function(e,n){for(var r=0,a=t.length,i=[];a>r;r++)t[r][e]==n&&i.push(t[r]);return i},o=function(e,n){for(v... | [
628,
198,
197,
197,
198,
198,
27,
0,
18227,
4177,
56,
11401,
27711,
29,
198,
27,
6494,
42392,
2625,
268,
12,
2937,
1,
1875,
198,
198,
27,
2256,
29,
628,
197,
198,
197,
27,
12048,
29,
198,
17497,
13,
912,
62,
437,
4122,
62,
6371,... | 2.276173 | 30,948 |
from fastapi import FastAPI, Request, Form
from fastapi.templating import Jinja2Templates
from starlette.responses import FileResponse
from src.model import spell_number
app = FastAPI()
templates = Jinja2Templates(directory='templates/')
@app.get('/')
@app.get('/form')
@app.post('/form')
@app.get('/checkbox')... | [
6738,
3049,
15042,
1330,
12549,
17614,
11,
19390,
11,
5178,
198,
6738,
3049,
15042,
13,
11498,
489,
803,
1330,
17297,
6592,
17,
12966,
17041,
198,
6738,
3491,
21348,
13,
16733,
274,
1330,
9220,
31077,
198,
198,
6738,
12351,
13,
19849,
1... | 2.821429 | 140 |
import pandas as pd
from bs4 import BeautifulSoup
import requests
from sportrefpy.nba.league import NBA
| [
11748,
19798,
292,
355,
279,
67,
198,
6738,
275,
82,
19,
1330,
23762,
50,
10486,
198,
11748,
7007,
198,
198,
6738,
6332,
5420,
9078,
13,
77,
7012,
13,
19316,
1330,
7403,
628
] | 3.3125 | 32 |
#!/usr/bin/env python
import pykvdb
client = pykvdb.newClient('192.168.2.134:26379','item')
pykvdb.set(client, 'k', 'v')
vv = pykvdb.get(client, 'k')
print 'v='+vv
klist = ['k']
vlist = pykvdb.mget(client, klist)
print 'mget'
print vlist
vlist = pykvdb.mget2(client, klist)
print 'mget2'
print vlist | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
12972,
74,
85,
9945,
198,
198,
16366,
796,
12972,
74,
85,
9945,
13,
3605,
11792,
10786,
17477,
13,
14656,
13,
17,
13,
19880,
25,
2075,
29088,
41707,
9186,
11537,
198,
198,
... | 2.073826 | 149 |
import json
| [
11748,
33918,
628
] | 4.333333 | 3 |
import subprocess
import os
| [
11748,
850,
14681,
198,
11748,
28686,
628,
198
] | 3.75 | 8 |
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""
@File : 02.py
@Contact : huanghoward@foxmail.com
@Modify Time : 2021/9/23 10:34
------------
"""
import torch.version
print(torch.cuda.is_available())
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
31,
8979,
220,
220,
220,
1058,
220,
220,
7816,
13,
9078,
220,
220,
220,
220,
198,
31,
17829,
1058,
220,
... | 2.182692 | 104 |
import os
import platform
import socket
import subprocess
import time
from .client import Client
| [
11748,
28686,
198,
11748,
3859,
198,
11748,
17802,
198,
11748,
850,
14681,
198,
11748,
640,
198,
198,
6738,
764,
16366,
1330,
20985,
628
] | 4.304348 | 23 |
import os
from typing import List, Tuple
import utils.gtzan_genres as gtzan
from sklearn.model_selection import train_test_split
| [
11748,
28686,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
11748,
3384,
4487,
13,
13655,
15201,
62,
5235,
411,
355,
308,
83,
15201,
198,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
628
] | 3.275 | 40 |
from copy import deepcopy
import itertools
import numpy as np
import mdtraj as md
from pairing.utils.misc import make_comtrj
def calc_indirect(direct_array):
"""
Calculate indirect matrices for all frames of trajectory
"""
indirect_results = []
for matrix in direct_array:
indirect = _gene... | [
6738,
4866,
1330,
2769,
30073,
198,
11748,
340,
861,
10141,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
45243,
9535,
73,
355,
45243,
198,
6738,
27356,
13,
26791,
13,
44374,
1330,
787,
62,
785,
2213,
73,
628,
198,
4299,
42302,
... | 2.349322 | 1,918 |
import datetime as dt
import pytz
import numpy as np
import math
from scipy.interpolate import interp1d
from netCDF4 import Dataset
import ccbrowse
from . import calipso_constants
from ccbrowse.hdf import HDF
from ccbrowse.algorithms import interp2d
from .product import Product
| [
11748,
4818,
8079,
355,
288,
83,
198,
11748,
12972,
22877,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
987,
79,
16,
67,
198,
6738,
2010,
34,
8068,
19,
1330,
16092,
292,
... | 2.957895 | 95 |
"""
File system access
"""
__author__ = 'Lorenzo'
| [
37811,
198,
8979,
1080,
1895,
198,
37811,
198,
198,
834,
9800,
834,
796,
705,
43,
29578,
10872,
6,
198
] | 2.684211 | 19 |
from abc import ABC,abstractmethod
import numpy as np
from nice.utils.distance import DistanceMetric
| [
6738,
450,
66,
1330,
9738,
11,
397,
8709,
24396,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
3621,
13,
26791,
13,
30246,
1330,
34600,
9171,
1173,
628
] | 3.777778 | 27 |
import unittest
| [
11748,
555,
715,
395,
628
] | 3.4 | 5 |
"""
Simple tool to develop sample random chunks.
Currently generates three types of tiles, of random color.
"""
import argparse
from random import Random
parser = argparse.ArgumentParser(description='Chunk generator')
parser.add_argument('-x', type=str, help='Number of chunks to generate in x direction', default = 3)
... | [
37811,
198,
26437,
2891,
284,
1205,
6291,
4738,
22716,
13,
198,
21327,
18616,
1115,
3858,
286,
19867,
11,
286,
4738,
3124,
13,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
6738,
4738,
1330,
14534,
198,
48610,
796,
1822,
29572,
13,
281... | 3.335404 | 161 |
from Crypto.Util.number import getPrime, inverse
from Crypto.Util.number import bytes_to_long as btl
from Crypto.Util.number import bytes_to_long as ltb
m_1 = btl(b'Here\'s my secret message')
moduli = []
for _ in range(3):
p = getPrime(128)
q = getPrime(128)
N = p*q
moduli.append(N)
e = 3
for n in m... | [
6738,
36579,
13,
18274,
346,
13,
17618,
1330,
651,
26405,
11,
34062,
198,
6738,
36579,
13,
18274,
346,
13,
17618,
1330,
9881,
62,
1462,
62,
6511,
355,
275,
28781,
198,
6738,
36579,
13,
18274,
346,
13,
17618,
1330,
9881,
62,
1462,
62,
... | 2.245192 | 208 |
from dataclasses import dataclass
import glob
import ntpath
import os
import shutil
import time
import traceback
from typing import Dict, Set, Union
import psutil
from ..utils.logger import get_logger
def filter_least_used_disks(disk_to_copy_processes_count: Dict[str, int]) -> Set[str]:
"""Filters for the least... | [
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
11748,
15095,
198,
11748,
299,
83,
6978,
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
640,
198,
11748,
12854,
1891,
198,
6738,
19720,
1330,
360,
713,
11,
5345,
11,
4479,
198,... | 2.424149 | 3,586 |
# -*- coding: utf-8 -*-
# author: ysoftman
# python version : 2.x 3.x
# desc : 셀레니움 테스트
# 설치
# pip install selenium
# 문서
# http://selenium-python.readthedocs.io/
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
# from selenium.webdriver.firefox.firefox_binary import FirefoxBin... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
1772,
25,
331,
4215,
805,
198,
2,
21015,
2196,
1058,
362,
13,
87,
513,
13,
87,
198,
2,
1715,
1058,
23821,
227,
222,
167,
254,
230,
46695,
230,
168,
249,
222,
22... | 1.402542 | 708 |