content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | [
2,
15069,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
11074,
921,
198,
2,
743,
407,
779,
428,
2393,
2845,
... | 3.792746 | 193 |
"""
This file defines constants which
are used in the various tests to
validate the API functions.
"""
# Summoner name to be used for Standard API calls, defaulting to EUW
SUMMONER_NAME = "Crimack"
# Unknown Summoner, used to validate that an error is thrown
UNKNOWN_SUMMONER_NAME = "abcaklsjdlakakdjlsakjdsdjlaksjdla... | [
37811,
198,
1212,
2393,
15738,
38491,
543,
198,
533,
973,
287,
262,
2972,
5254,
284,
198,
12102,
378,
262,
7824,
5499,
13,
198,
37811,
628,
198,
2,
49167,
1438,
284,
307,
973,
329,
8997,
7824,
3848,
11,
4277,
278,
284,
4576,
54,
198... | 2.892617 | 149 |
linha('NICOLAS') | [
198,
2815,
3099,
10786,
45,
2149,
3535,
1921,
11537
] | 1.888889 | 9 |
import uvicorn
from utils import check_config_json
from configs import *
if __name__ == '__main__':
if not check_config_json():
exit()
uvicorn.run('api:app', host=HOST, port=PORT, log_level='info', reload=False)
| [
11748,
334,
25531,
1211,
198,
198,
6738,
3384,
4487,
1330,
2198,
62,
11250,
62,
17752,
198,
6738,
4566,
82,
1330,
1635,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
611,
407,
2198,
62,
11250,... | 2.58427 | 89 |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"DLCImporter": "00_dlc_importer.ipynb",
"transform_to_relative": "00_dlc_importer.ipynb",
"add_middle_neck": "00_dlc_importer.ipynb",
"add_rotation": "00_dlc_importer.ipynb",
... | [
2,
47044,
7730,
1677,
1137,
11617,
11050,
41354,
39345,
0,
8410,
5626,
48483,
0,
198,
198,
834,
439,
834,
796,
14631,
9630,
1600,
366,
18170,
1600,
366,
23144,
62,
15390,
62,
28751,
1600,
366,
18300,
62,
6371,
8973,
198,
198,
9630,
79... | 2.009877 | 405 |
from celery.task import Task
from apps.social.models import MSharedStory, MSocialProfile, MSocialServices
from utils import log as logging
| [
6738,
18725,
1924,
13,
35943,
1330,
15941,
198,
6738,
6725,
13,
14557,
13,
27530,
1330,
337,
2484,
1144,
11605,
11,
6579,
9402,
37046,
11,
6579,
9402,
31007,
198,
6738,
3384,
4487,
1330,
2604,
355,
18931,
628,
220,
220,
220,
220,
220,
... | 2.824561 | 57 |
import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import reduce
from operator import mul
import math
import models.utils as utils
import pdb
#class BaseCNN(nn.Module)
#CNN -> 3 layer CNN, linear transform to hidden, step through gru for new hidden
#return -> linear pass through criti... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
10088,
1330,
35971,
198,
11748,
10688,
198,
198,
11748,
4981,
13,
2679... | 3.688372 | 215 |
/usr/lib64/python3.4/stat.py | [
14,
14629,
14,
8019,
2414,
14,
29412,
18,
13,
19,
14,
14269,
13,
9078
] | 2 | 14 |
import asynchat
import asyncore
import os
import socket
import string
import sys
import StringIO
import mimetools
ROOT = "."
PORT = 8000
# a producer which reads data from a file object
if __name__ == '__main__':
s = HTTPServer(PORT)
print "serving at port", PORT
asyncore.loop()
| [
11748,
355,
2047,
17006,
198,
11748,
355,
2047,
7295,
198,
11748,
28686,
198,
11748,
17802,
198,
11748,
4731,
198,
11748,
25064,
198,
11748,
10903,
9399,
198,
11748,
17007,
316,
10141,
198,
198,
13252,
2394,
796,
366,
526,
198,
15490,
796... | 3.117021 | 94 |
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
#
# Opserver
#
# Operational State Server for VNC
#
from gevent import monkey
monkey.patch_all()
import sys
import json
import socket
import time
import copy
import traceback
import signal
import logging
logging.getLogger('kafka').addHandler(logging... | [
2,
198,
2,
15069,
357,
66,
8,
2211,
7653,
9346,
27862,
11,
3457,
13,
1439,
2489,
10395,
13,
198,
2,
198,
198,
2,
198,
2,
26123,
18497,
198,
2,
198,
2,
6564,
864,
1812,
9652,
329,
569,
7792,
198,
2,
198,
198,
6738,
4903,
1151,
... | 2.975442 | 1,018 |
"""
.. _l-b-reducesumsquare:
Compares implementations of ReduceSumSquare
===========================================
This example compares the *numpy* for the operator *ReduceSumSquare*
to :epkg:`onnxruntime` implementation.
If available, :epkg:`tensorflow` and :epkg:`pytorch` are included as well.
.. contents::
... | [
37811,
198,
492,
4808,
75,
12,
65,
12,
445,
26873,
5700,
421,
533,
25,
198,
198,
7293,
3565,
25504,
286,
44048,
13065,
48011,
198,
10052,
2559,
18604,
198,
198,
1212,
1672,
23008,
262,
1635,
77,
32152,
9,
329,
262,
10088,
1635,
7738,
... | 2.961875 | 1,259 |
from flask import Flask
from flask_restful import Resource, Api
from flask_jwt import JWT
from flask_admin import Admin
from resources.user import UserRegister
from authentication.security import authenticate, identity
import os
app = Flask(__name__)
app.config.from_object(os.environ['APP_SETTINGS'])
app.config['SQLAL... | [
6738,
42903,
1330,
46947,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
5949,
72,
198,
6738,
42903,
62,
73,
46569,
1330,
449,
39386,
198,
6738,
42903,
62,
28482,
1330,
32053,
198,
6738,
4133,
13,
7220,
1330,
11787,
38804,
198,
6738,... | 2.921569 | 255 |
# -*- coding: utf-8 -*-
"""
Created 5 March 2019
epsc_peak_x.y.z.py
"""
# from __main__ import *
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import os
from collections import OrderedDict
import math
import platform
''' ################## Define file structure on server ###################... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
642,
2805,
13130,
198,
538,
1416,
62,
36729,
62,
87,
13,
88,
13,
89,
13,
9078,
198,
198,
37811,
198,
2,
422,
11593,
12417,
834,
1330,
1635,
198,
1... | 2.688525 | 854 |
import numpy as np
| [
11748,
299,
32152,
355,
45941,
628,
198
] | 3 | 7 |
"""
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Try solving it using constant additional space.
Example :
Input :
______
| |
\/ |
1 -> 2 -> 3 -> 4
Return the node corresponding to node 3.
"""
# D... | [
37811,
198,
15056,
257,
6692,
1351,
11,
1441,
262,
10139,
810,
262,
6772,
6140,
13,
1002,
612,
318,
645,
6772,
11,
1441,
9242,
13,
198,
198,
23433,
18120,
340,
1262,
6937,
3224,
2272,
13,
198,
198,
16281,
1058,
198,
198,
20560,
1058,
... | 2.429825 | 228 |
#########################################################################################################
# Description: Main file for telecom_churn dataset. Key function is to transform dataset into needed
# input_features and output
###################################################################################... | [
29113,
29113,
29113,
7804,
2,
198,
2,
220,
12489,
25,
8774,
2393,
329,
30452,
62,
354,
700,
27039,
13,
7383,
2163,
318,
284,
6121,
27039,
656,
2622,
198,
2,
220,
5128,
62,
40890,
290,
5072,
198,
29113,
29113,
29113,
7804,
2,
198,
11... | 2.662967 | 1,982 |
import uuid
import pytest
from sanic import Sanic
from sanic.response import json
from sanic.websocket import WebSocketProtocol
from sanic_jwt_extended.decorators import refresh_jwt_required
from sanic_jwt_extended.jwt_manager import JWT
from tests.utils import DunnoValue
@pytest.fixture
@pytest.fixture
| [
11748,
334,
27112,
198,
198,
11748,
12972,
9288,
198,
6738,
5336,
291,
1330,
2986,
291,
198,
6738,
5336,
291,
13,
26209,
1330,
33918,
198,
6738,
5336,
291,
13,
732,
1443,
5459,
1330,
5313,
39105,
19703,
4668,
198,
198,
6738,
5336,
291,
... | 3.038835 | 103 |
#
from z3c.autoinclude.dependency import package_includes
| [
2,
198,
6738,
1976,
18,
66,
13,
23736,
17256,
13,
45841,
1387,
1330,
5301,
62,
42813,
198
] | 3.411765 | 17 |
import pytest
from django.db.migrations.state import ProjectState
from django_test_migrations.migrator import Migrator
@pytest.mark.django_db()
def test_migrator(transactional_db):
"""We only need this test for coverage."""
migrator = Migrator()
old_state = migrator.apply_initial_migration(('main_app', N... | [
11748,
12972,
9288,
198,
6738,
42625,
14208,
13,
9945,
13,
76,
3692,
602,
13,
5219,
1330,
4935,
9012,
198,
198,
6738,
42625,
14208,
62,
9288,
62,
76,
3692,
602,
13,
76,
3692,
1352,
1330,
337,
3692,
1352,
628,
198,
31,
9078,
9288,
13... | 2.845697 | 337 |
from lox.ast_printer import AstPrinter
from lox.lox import Lox
from lox.parser import Parser, ParseError
from lox.scanner import Scanner
from lox import expressions
from lox import tokens
| [
6738,
300,
1140,
13,
459,
62,
1050,
3849,
1330,
8304,
6836,
3849,
198,
6738,
300,
1140,
13,
75,
1140,
1330,
406,
1140,
198,
6738,
300,
1140,
13,
48610,
1330,
23042,
263,
11,
2547,
325,
12331,
198,
6738,
300,
1140,
13,
35836,
1008,
1... | 3.241379 | 58 |
import unittest
from numpy.testing import assert_allclose
import warnings
from hazma.parameters import omega_h2_cdm
from hazma.relic_density import relic_density
import unittest
warnings.filterwarnings("ignore")
| [
11748,
555,
715,
395,
198,
6738,
299,
32152,
13,
33407,
1330,
6818,
62,
439,
19836,
198,
11748,
14601,
198,
6738,
11595,
2611,
13,
17143,
7307,
1330,
37615,
62,
71,
17,
62,
10210,
76,
198,
6738,
11595,
2611,
13,
260,
677,
62,
43337,
... | 3.359375 | 64 |
import functools
import threading
import logging
import requests
import datetime
from requests.models import HTTPBasicAuth
logger = logging.getLogger(__name__)
def thread_it(func):
"""A wrapper function to run func in a daemon thread.
Args:
func (function): The function to run in a thread
Retu... | [
11748,
1257,
310,
10141,
198,
11748,
4704,
278,
198,
11748,
18931,
198,
11748,
7007,
198,
11748,
4818,
8079,
198,
198,
6738,
7007,
13,
27530,
1330,
14626,
26416,
30515,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
36... | 2.549451 | 546 |
from urllib2 import Request, urlopen, URLError, HTTPError
#samplefirst()
samplesecond() | [
6738,
2956,
297,
571,
17,
1330,
19390,
11,
19016,
9654,
11,
37902,
2538,
81,
1472,
11,
14626,
12331,
628,
628,
628,
198,
198,
2,
39873,
11085,
3419,
198,
82,
12629,
721,
623,
3419
] | 2.848485 | 33 |
# Contact: sara.ferreira <at> fc [dot] up [dot] pt
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commerci... | [
2,
14039,
25,
264,
3301,
13,
2232,
260,
8704,
1279,
265,
29,
277,
66,
685,
26518,
60,
510,
685,
26518,
60,
42975,
198,
2,
198,
2,
770,
318,
1479,
290,
555,
12685,
26584,
3788,
2716,
656,
262,
1171,
7386,
13,
198,
2,
198,
2,
1746... | 3.584367 | 806 |
"""
Copyright 2018 Globo.com
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 writ... | [
37811,
198,
220,
220,
15069,
2864,
2671,
20391,
13,
785,
628,
220,
220,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
220,
220,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
1... | 3.483871 | 217 |
# -*- coding: utf-8 -*-
import os
import unittest
from openregistry.lots.core.tests.base import BaseWebTest, snitch
from openregistry.lots.core.tests.blanks.mixins import ResourceTestMixin
from openregistry.lots.loki.tests.base import (
BaseLotWebTest
)
from openregistry.lots.loki.tests.json_data import test_loki_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
198,
6738,
1280,
2301,
4592,
13,
75,
1747,
13,
7295,
13,
41989,
13,
8692,
1330,
7308,
13908,
14402,
11,
3013,
2007,
198,
... | 2.510158 | 443 |
print('Bem vindo ao analisador de nomes')
print('--------------------------------')
Nom = input('Qual seu nome? ')
print('________________________________')
print('Seu nome em maiusculo ficaria {}'.format(Nom.upper()))
print('Seu nome em minusculo ficaria {}'.format(Nom.lower()))
Nomd = Nom.split()
print('Seu primeiro ... | [
4798,
10786,
33,
368,
29178,
78,
257,
78,
2037,
271,
7079,
390,
299,
2586,
11537,
198,
4798,
10786,
3880,
11537,
198,
45,
296,
796,
5128,
10786,
46181,
384,
84,
299,
462,
30,
705,
8,
198,
4798,
10786,
10221,
11537,
198,
4798,
10786,
... | 2.835526 | 152 |
# -*- coding: utf-8 -*-
from .api import *
from . import ui, util
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
764,
15042,
1330,
1635,
198,
6738,
764,
1330,
334,
72,
11,
7736,
198
] | 2.310345 | 29 |
import json
import plotly
import pandas as pd
from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar
from sqlalchemy import create_engine
import joblib
import plotly.graph_objs as go_
from flask import current_app, flash, jsonify, make_response, redirect, request, ... | [
11748,
33918,
198,
11748,
7110,
306,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
42903,
1330,
46947,
198,
6738,
42903,
1330,
8543,
62,
28243,
11,
2581,
11,
33918,
1958,
198,
6738,
7110,
306,
13,
34960,
62,
672,
8457,
1330,
2409,
... | 2.912281 | 684 |
""" -*- coding: utf-8 -*-
@author: omerkocadayi
https://github.com/omerkocadayi
https://www.linkedin.com/in/omerkocadayi/ """
import cv2
import time
vid = cv2.VideoCapture("cars.mp4")
carCascade = cv2.CascadeClassifier("haarcascade/car1.xml")
crd = [[620,220],[740,220],[580,500],[815,500]]
d... | [
37811,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
220,
220,
220,
2488,
9800,
25,
267,
647,
74,
420,
43593,
72,
220,
201,
198,
220,
220,
220,
3740,
1378,
12567,
13,
785,
14,
296,
9587,
420,
43593,
72,
201,
1... | 1.571522 | 1,524 |
# Copyright 2021 Yan Yan
#
# 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, soft... | [
2,
15069,
33448,
10642,
10642,
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,
921,
743,
73... | 3.133489 | 427 |
"""Command-line interfaces for AROMA."""
| [
37811,
21575,
12,
1370,
20314,
329,
5923,
2662,
32,
526,
15931,
198
] | 3.416667 | 12 |
"""
Given a number sequence, find the increasing subsequence with the highest sum.
Write a method that returns the highest sum.
Example 1:
Input: {4,1,2,6,10,1,12}
Output: 32
Explanation: The increaseing sequence is {4,6,10,12}.
Please note the difference, as the LIS is {1,2,6,10,12} which has a sum of '31'.
Exa... | [
628,
198,
37811,
198,
15056,
257,
1271,
8379,
11,
1064,
262,
3649,
6399,
594,
351,
262,
4511,
2160,
13,
220,
198,
16594,
257,
2446,
326,
5860,
262,
4511,
2160,
13,
198,
198,
16281,
352,
25,
198,
198,
20560,
25,
1391,
19,
11,
16,
1... | 2.61326 | 181 |
# coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
15069,
12131,
383,
3012,
4992,
46665,
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,
... | 3.002857 | 700 |
import jieba
from wk import string_utils as TU | [
11748,
474,
494,
7012,
198,
6738,
266,
74,
1330,
4731,
62,
26791,
355,
309,
52
] | 3.066667 | 15 |
#!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2017/11/1 ~ 2019/9/1
# @Author : Allen Woo
from apps.core.flask.login_manager import osr_login_required
from apps.core.blueprint import api
from apps.core.flask.permission import permission_required
from apps.core.flask.response import response_format
from apps.modul... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
2,
2488,
7575,
1058,
2177,
14,
1157,
14,
16,
5299,
13130,
14,
24,
14,
16,
198,
2,
2488,
13838,
1058,
9659,
39832,
19... | 2.085859 | 396 |
# ==================
#
# nosecone_threaded_bases.py
#
# License: https://github.com/summerswallow/open-rocketry/blob/master/LICENSE
# (c) 2018 Summer Swallow Consulting
#
# ==================
from math import sqrt, atan, acos, cos, sin, fabs, pi
import os
from solid import *
from solid.utils import up, down, left, ... | [
2,
36658,
28,
198,
2,
198,
2,
9686,
49180,
62,
16663,
276,
62,
65,
1386,
13,
9078,
198,
2,
198,
2,
220,
220,
13789,
25,
3740,
1378,
12567,
13,
785,
14,
16345,
11056,
11930,
322,
14,
9654,
12,
10823,
11973,
14,
2436,
672,
14,
986... | 2.011676 | 1,199 |
import numpy as np
x = np.random.randn(20) | [
11748,
299,
32152,
355,
45941,
198,
198,
87,
796,
45941,
13,
25120,
13,
25192,
77,
7,
1238,
8
] | 2.388889 | 18 |
from .input import Input
from .switch import Switch
from .delayed_switch import DelayedSwitch
from .joystick import Joystick, Directions
from .linear_actuator import LinearActuator
| [
6738,
764,
15414,
1330,
23412,
198,
6738,
764,
31943,
1330,
14645,
198,
6738,
764,
12381,
16548,
62,
31943,
1330,
4216,
16548,
38978,
198,
6738,
764,
2633,
13915,
1330,
14087,
13915,
11,
47426,
198,
6738,
764,
29127,
62,
529,
84,
1352,
... | 3.934783 | 46 |
import numpy as np
import math
from .util import add_column
from . import global_val as gv
| [
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
198,
6738,
764,
22602,
1330,
751,
62,
28665,
198,
6738,
764,
1330,
3298,
62,
2100,
355,
308,
85,
628
] | 3.321429 | 28 |
# Third Party Module Import
from flask_restplus import Api
api = Api()
| [
2,
10467,
3615,
19937,
17267,
198,
6738,
42903,
62,
2118,
9541,
1330,
5949,
72,
628,
198,
15042,
796,
5949,
72,
3419,
198
] | 3.318182 | 22 |
""" Collection of functions to transform popular datasets into torch_dataset Datasets """
import os
import tqdm
import json
from scipy.io import loadmat
from .detection_dataset import DetectionDataset
from .siamese_dataset import SiameseDataset
def convert_coco_to_detection_dataset(coco_ann_file, root_image_dir, no... | [
37811,
12251,
286,
5499,
284,
6121,
2968,
40522,
656,
28034,
62,
19608,
292,
316,
16092,
292,
1039,
37227,
198,
11748,
28686,
198,
11748,
256,
80,
36020,
198,
198,
11748,
33918,
198,
6738,
629,
541,
88,
13,
952,
1330,
3440,
6759,
198,
... | 2.163304 | 3,668 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 11 15:49:12 2019
@author: jgoldstein
inspace toy problem
"""
import numpy as np
import matplotlib.pyplot as plt
from scipy.signal import periodogram
from inspace.interpolation import get_target_times, sinc_interpolation
from inspace.gp_george impo... | [
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,
19480,
2365,
1367,
1315,
25,
2920,
25,
1065,
13130,
198,
198,
31,
9800,
25,
474,
24267,
5... | 2.05119 | 840 |
import sys
import logging
import gym
import h5py
from es_distributed import tf_util
from es_distributed.policies import policies
from es_distributed.atari_wrappers import wrap_deepmind
from .common import RunningStat, SharedNoiseTable
log = logging.getLogger(__name__)
| [
11748,
25064,
198,
11748,
18931,
198,
198,
11748,
11550,
198,
11748,
289,
20,
9078,
198,
198,
6738,
1658,
62,
17080,
6169,
1330,
48700,
62,
22602,
198,
6738,
1658,
62,
17080,
6169,
13,
79,
4160,
444,
1330,
4788,
198,
6738,
1658,
62,
1... | 3.4 | 80 |
import torch.nn as nn
import ltr.models.backbone as backbones
import ltr.models.bbreg as bbmodels
from ltr import model_constructor
class ATOMnet(nn.Module):
""" ATOM network module"""
def __init__(self, feature_extractor, bb_regressor, bb_regressor_layer, extractor_grad=True):
"""
args:
... | [
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
300,
2213,
13,
27530,
13,
1891,
15992,
355,
736,
35095,
198,
11748,
300,
2213,
13,
27530,
13,
11848,
2301,
355,
275,
65,
27530,
198,
6738,
300,
2213,
1330,
2746,
62,
41571,
273,
628,
... | 2.300714 | 981 |
import matplotlib.pyplot as plt
import numpy as np
np.random.seed(100)
p = 0.98 # スパース度
n = 100 # 行列のサイズ
l = [0]*int(p*100) + [1]*int((1-p)*100)
if __name__ == "__main__":
main()
| [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
198,
37659,
13,
25120,
13,
28826,
7,
3064,
8,
198,
79,
796,
657,
13,
4089,
220,
220,
220,
1303,
220,
8943,
32546,
6312,
8943,
41753,
9... | 1.819048 | 105 |
"""XManager/XCloud launcher for both GPU and TPU jobs.
The launcher works with any Python binary with the following flags:
* `output_dir` is the directory for saving summaries and logs;
* `use_gpu` determines whether to run on GPU or otherwise TPU;
* `num_cores` is the number of TPU cores or GPUs;
* `tpu` is the TPU ... | [
37811,
55,
13511,
14,
55,
18839,
24008,
329,
1111,
11362,
290,
309,
5105,
3946,
13,
198,
198,
464,
24008,
2499,
351,
597,
11361,
13934,
351,
262,
1708,
9701,
25,
198,
198,
9,
4600,
22915,
62,
15908,
63,
318,
262,
8619,
329,
8914,
30... | 2.600595 | 4,369 |
import os
import platform
try:
from importlib.metadata import version as _version_func # type: ignore
except ImportError:
# Python 3.7 and lower
from importlib_metadata import version as _version_func # type: ignore
__all__ = ("name", "version", "node", "environment")
name = __package__
version = _vers... | [
11748,
28686,
198,
11748,
3859,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
1330,
8019,
13,
38993,
1330,
2196,
355,
4808,
9641,
62,
20786,
220,
1303,
2099,
25,
8856,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1303,
11361,
513... | 3.157895 | 133 |
from . import parsed_email
import mailbox
from email.utils import parseaddr
if __name__ == '__main__':
for mail in check_emails():
print(mail.getall())
| [
6738,
764,
1330,
44267,
62,
12888,
198,
11748,
37282,
198,
6738,
3053,
13,
26791,
1330,
21136,
29851,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
197,
1640,
6920,
287,
2198,
62,
368,
1768,
33529,
198,
... | 3.098039 | 51 |
#!/usr/bin/env python
#coding=utf8
from scipy.io import wavfile
import argparse
import numpy as np
import pygame
import sys
import warnings
import Queue
myQueue = Queue.Queue()
#music=[0,0,0,0,0,0]
#music=[1,2,3,4,5,6,7,8,8,7,6,5,4,3,2,1]
#music=[-2,1,3,5,1,0,3,5,5,6,7,8,6,6,5,5,3,2,1,1,1,3,2,1,1,1,2,3,2,1,-1,2,3,2]
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
66,
7656,
28,
40477,
23,
198,
6738,
629,
541,
88,
13,
952,
1330,
266,
615,
7753,
198,
11748,
1822,
29572,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
6057,
198,
11748,
... | 1.510129 | 1,629 |
import pytest
from mock import Mock, patch
from service import poll_lobby
valid_query_string_params = {
"queryStringParameters": {
"PlayerID": "Player2",
"LobbyID": "Lobby1"}
}
valid_get_lobby = {
"GameID": "0",
"Players": [
{"PlayerID": "Player1", "PlayerName": "Bob", "PlayerSide... | [
11748,
12972,
9288,
198,
6738,
15290,
1330,
44123,
11,
8529,
198,
198,
6738,
2139,
1330,
3278,
62,
75,
11369,
198,
198,
12102,
62,
22766,
62,
8841,
62,
37266,
796,
1391,
198,
220,
220,
220,
366,
22766,
10100,
48944,
1298,
1391,
198,
2... | 2.44877 | 488 |
import pytest
import aiopoke
@pytest.fixture
| [
11748,
12972,
9288,
198,
198,
11748,
257,
14922,
2088,
628,
198,
31,
9078,
9288,
13,
69,
9602,
198
] | 2.666667 | 18 |
from django import forms
from django.contrib.formtools.wizard.storage import BaseStorage
from hyperadmin.resources.wizard import Wizard, FormStep, MultiPartStep
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
687,
31391,
13,
86,
8669,
13,
35350,
1330,
7308,
31425,
198,
198,
6738,
8718,
28482,
13,
37540,
13,
86,
8669,
1330,
16884,
11,
5178,
8600,
11,
15237,
7841,
86... | 3.790698 | 43 |
import json
import hashlib
import re
import os
import random
import math
from urllib.parse import urlencode
from functools import wraps
from django.db.models import Avg, Q, Count, F
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.http import HttpResponse, JsonResponse
from django.s... | [
11748,
33918,
198,
11748,
12234,
8019,
198,
11748,
302,
198,
11748,
28686,
198,
11748,
4738,
198,
11748,
10688,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
11925,
8189,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
6738,
42625... | 3.409594 | 271 |
import unittest
from nmj.cleaners import MovieCleaner, TVShowCleaner
if __name__ == "__main__":
unittest.main()
| [
11748,
555,
715,
395,
198,
198,
6738,
28642,
73,
13,
27773,
364,
1330,
15875,
32657,
263,
11,
3195,
15307,
32657,
263,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
197,
403,
715,
395,
13,
12417,
3419,
198
] | 2.761905 | 42 |
#!/usr/bin/python
# login.cgi
import cgi
if __name__ == '__main__':
try:
formData = cgi.FieldStorage()
message = formData.getvalue('message','')
htmlTop()
if message == "wrong_password":
htmlMid("No such account or the password is wrong, please try again.")
elif ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
17594,
13,
37157,
198,
11748,
269,
12397,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1949,
25,
198,
220,
220,
220,
220,
220,
220,
220,
1296,
... | 2.274336 | 226 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
24118,
687,
10290,
357,
27110,
5235,
8,
16984,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760... | 3.408759 | 137 |
from flask import Flask, request
from flask_basicauth import BasicAuth
from werkzeug.wrappers import Response
from intents import controller
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
import json
import os
# Configuration information for the application
app = Flask(__name__)
#app.... | [
6738,
42903,
1330,
46947,
11,
2581,
198,
6738,
42903,
62,
12093,
3970,
1071,
1330,
14392,
30515,
198,
6738,
266,
9587,
2736,
1018,
13,
29988,
11799,
1330,
18261,
198,
6738,
493,
658,
1330,
10444,
198,
11748,
7007,
198,
6738,
7007,
62,
2... | 2.398849 | 1,043 |
"""
Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.
https://leetcode.com/static/images/problemset/histogram.png
Above is a histogram where width of each bar is 1, given height = [2,1,5,6,2,3].
https://leetcod... | [
37811,
198,
15056,
299,
1729,
12,
31591,
37014,
10200,
262,
1554,
21857,
338,
2318,
6001,
810,
262,
9647,
286,
1123,
2318,
318,
352,
11,
1064,
262,
1989,
286,
4387,
35991,
287,
262,
1554,
21857,
13,
198,
198,
5450,
1378,
293,
316,
818... | 3.10625 | 160 |
# -*- coding: utf-8 -*-
import os
import numpy as np
import urllib.request
from flask import Flask, render_template, request, redirect, url_for, send_from_directory, session
from werkzeug.utils import secure_filename
from PIL import Image
import cv2
import io
from keras import models
from keras.models import load_mode... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2956,
297,
571,
13,
25927,
198,
6738,
42903,
1330,
46947,
11,
8543,
62,
28243,
11,
2581,
11,
18941,
11,
190... | 2.34542 | 524 |
# -*- coding: UTF-8 -*-
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
from os.path import join as pjoin
imp... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
20368,
22369,
198,
2,
12549,
371,
12,
18474,
198,
2,
15069,
357,
66,
8,
1853,
5413,
198,
2,
49962,
739,
383,
17168,
13789,
685,
3826,
38559,
24290,
329,
3307,
60,
198,... | 2.253341 | 1,646 |
#!/usr/bin/env python3
"""
Monitor GPIO pins ("lines") using the "new" way (libgpiod).
Thus it depends on python3-gpiod being installed:
https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
"""
import contextlib
import logging
import sys
import time
from typing import Dict, List, Callable, Tuple, Optional, Iter... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
198,
35479,
50143,
20567,
5855,
6615,
4943,
1262,
262,
366,
3605,
1,
835,
357,
8019,
31197,
2101,
737,
198,
198,
19093,
340,
8338,
319,
21015,
18,
12,
31197,
2101,
852,
6589... | 2.164032 | 7,401 |
#!/usr/bin/env python3
"""
gen-attributions.py: a tool for generating various OSS attributions docs.
See tools/scripts/README.md for instructions on how to format license files.
usage:
gen-attributions.py BUILD_TYPE [OUTPUT_FILE]
where BUILD_TYPE is one of:
sphix -- generate an ReST file for the sphinx do... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
37811,
198,
5235,
12,
1078,
2455,
507,
13,
9078,
25,
257,
2891,
329,
15453,
2972,
440,
5432,
24548,
507,
34165,
13,
198,
198,
6214,
4899,
14,
46521,
14,
15675,
11682,
13,
91... | 2.368598 | 1,191 |
import json
from ..ext.database import db
| [
11748,
33918,
201,
198,
6738,
11485,
2302,
13,
48806,
1330,
20613,
201,
198,
201,
198
] | 3.066667 | 15 |
import weakref
from re import sub
from typing import Any
from sqlalchemy import MetaData, Integer, Column, Sequence
from sqlalchemy.ext.declarative import declarative_base, declared_attr, DeclarativeMeta
def gen_tablenames(name: str) -> str:
""" Converts CamelCase class names to snake_case table names """
re... | [
11748,
4939,
5420,
198,
6738,
302,
1330,
850,
198,
6738,
19720,
1330,
4377,
198,
198,
6738,
44161,
282,
26599,
1330,
30277,
6601,
11,
34142,
11,
29201,
11,
45835,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
... | 2.295122 | 410 |
"""All Tosurnament module mock objects."""
import json
import os
from unittest import mock
from mysqldb_wrapper import crypt
def query_side_effect_wrapper(session_mock):
"""Side effect for the query function, used to return the stubs in the storage."""
return query_side_effect
def add_side_effect_wrapper... | [
37811,
3237,
40195,
700,
3263,
8265,
15290,
5563,
526,
15931,
198,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
555,
715,
395,
1330,
15290,
198,
198,
6738,
616,
31166,
335,
65,
62,
48553,
1330,
8194,
628,
198,
4299,
12405,
62,
1589,... | 2.706605 | 651 |
import pytest
import numpy as np
from bmtk.simulator.utils import nwb
import os
import h5py
@pytest.mark.skip(reason='Ability to add 0-lenght datasetset has been removed in newer version of h5py')
if __name__ == "__main__":
test_create_blank_file() # pragma: no cover
test_... | [
11748,
12972,
9288,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
275,
16762,
74,
13,
14323,
8927,
13,
26791,
1330,
299,
39346,
198,
11748,
28686,
198,
11748,
289,
20,
9078,
628,
220,
220,
220,
220,
198,
220,
220,
220,
220,
628,
628,... | 2.145669 | 508 |
from fuzzywuzzy import process
import codecs#, re, sys
from residents import RESIDENTS, NAMES
filename = raw_input('Enter a name for the new file: ')
file = codecs.open(filename, 'w', encoding='utf-8', errors='ignore')
for resident in RESIDENTS:
match = process.extractOne(resident, NAMES)
name, accuracy = match[0]... | [
6738,
34669,
86,
4715,
88,
1330,
1429,
198,
11748,
40481,
82,
2,
11,
302,
11,
25064,
198,
6738,
5085,
1330,
15731,
2389,
15365,
11,
399,
29559,
198,
198,
34345,
796,
8246,
62,
15414,
10786,
17469,
257,
1438,
329,
262,
649,
2393,
25,
... | 2.881356 | 177 |
import argparse
import os
import errno
import io
import importlib
import sys
from datetime import datetime, timedelta
try:
from urllib.parse import urlparse # Python 3
except ImportError:
from urlparse import urlparse # Python 2
# import requests
IOOS_CATALOG_URL = "https://data.ioos.us/api/3"
VALID_QUERY_A... | [
11748,
1822,
29572,
198,
11748,
28686,
198,
11748,
11454,
3919,
198,
11748,
33245,
198,
11748,
1330,
8019,
198,
11748,
25064,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
28311,
25,
198,
220,
220,
220,
422,
2956,
297,
... | 2.516352 | 2,171 |
"""
Utilities and helpers for writing tests.
"""
import torch
import pytest
from allennlp.common.testing.test_case import AllenNlpTestCase
from allennlp.common.testing.model_test_case import ModelTestCase
_available_devices = ["cpu"] + (["cuda"] if torch.cuda.is_available() else [])
def multi_device(test_method):
... | [
37811,
198,
18274,
2410,
290,
49385,
329,
3597,
5254,
13,
198,
37811,
198,
11748,
28034,
198,
11748,
12972,
9288,
198,
198,
6738,
477,
1697,
34431,
13,
11321,
13,
33407,
13,
9288,
62,
7442,
1330,
9659,
45,
34431,
14402,
20448,
198,
6738... | 2.708955 | 402 |
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from app import app
import config
| [
11748,
895,
83,
489,
571,
198,
6738,
3053,
13,
44,
3955,
3620,
586,
541,
433,
1330,
337,
3955,
3620,
586,
541,
433,
198,
6738,
3053,
13,
44,
3955,
2767,
2302,
1330,
337,
3955,
2767,
2302,
198,
6738,
598,
1330,
598,
198,
11748,
4566,... | 2.977273 | 44 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Versão: 2.0
Script responsavel por realizar o undeploy e deploy do aplicativo no WAS, alem de compilar atraves do Maven.
Execução:
$ cd C:\<CAMINHO_WAS>\WebSphere\AppServer\bin
$ wsadmin.bat -lang jython -f <CAMINHO_SCRIPT> -username <USUARIO> -password <SENHA>
Autor: F... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
34947,
28749,
25,
362,
13,
15,
198,
7391,
2424,
64,
626,
16964,
1103,
528,
283,
267,
44192,
1420,
304,
6061,
... | 2.194099 | 644 |
import sys
import numpy as np
from .config.pDeep_config import Common_Config
instrument_list = Common_Config().instrument_list
instrument_num = Common_Config().max_instrument_num
instrument_dict = dict(zip(instrument_list, range(len(instrument_list))))
_feature_name_list = ['x', 'mod_x', 'charge', 'nce', 'instrument... | [
11748,
25064,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
11250,
13,
79,
29744,
62,
11250,
1330,
8070,
62,
16934,
198,
198,
259,
43872,
62,
4868,
796,
8070,
62,
16934,
22446,
259,
43872,
62,
4868,
198,
259,
43872,
62,
225... | 2.041597 | 1,803 |
import sys
if __name__ == "__main__":
if len(sys.argv) != 2:
print("Invoke the program passing a path to a file as an argument")
else:
with open(sys.argv[1], 'r') as file:
print(rna(file.read()))
| [
11748,
25064,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
611,
18896,
7,
17597,
13,
853,
85,
8,
14512,
362,
25,
198,
220,
220,
220,
220,
220,
220,
220,
3601,
7203,
19904,
2088,
262,
... | 2.196262 | 107 |
from copy import copy
from typing import Optional
from hdlConvertorAst.hdlAst._defs import HdlIdDef
from hdlConvertorAst.hdlAst._expr import HdlValueId, HdlOp, HdlOpType
from hdlConvertorAst.hdlAst._structural import HdlModuleDec, HdlCompInst
from hdlConvertorAst.to.systemc.keywords import SYSTEMC_KEYWORDS
from hdlCon... | [
6738,
4866,
1330,
4866,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
289,
25404,
3103,
1851,
273,
33751,
13,
71,
25404,
33751,
13557,
4299,
82,
1330,
367,
25404,
7390,
7469,
198,
6738,
289,
25404,
3103,
1851,
273,
33751,
13,
71,
25404... | 2.563545 | 598 |
import sys
import os
import io
import re
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'lib'))
from misc import printdbg
| [
11748,
25064,
198,
11748,
28686,
198,
11748,
33245,
198,
11748,
302,
198,
17597,
13,
6978,
13,
33295,
7,
418,
13,
6978,
13,
22179,
7,
418,
13,
6978,
13,
15908,
3672,
7,
834,
7753,
834,
828,
705,
492,
6,
4008,
198,
17597,
13,
6978,
... | 2.576923 | 78 |
# https://stackoverflow.com/a/33453124/6210398
import threading
import sys
from requests import get as requests_get
from zipfile import ZipFile
import os
from shutil import copyfile
from bs4 import BeautifulSoup
from packaging.version import Version, parse
from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot
import t... | [
2,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
64,
14,
2091,
36625,
17464,
14,
5237,
940,
31952,
198,
11748,
4704,
278,
198,
11748,
25064,
198,
6738,
7007,
1330,
651,
355,
7007,
62,
1136,
198,
6738,
19974,
7753,
1330,
38636,
8979,
19... | 3.028708 | 209 |
# -*- coding: UTF-8 -*-
# Copyright 2016-2017 Luc Saffre
# License: BSD (see file COPYING for details)
from __future__ import unicode_literals
from lino.api import rt, _
from lino.utils.cycler import Cycler
from lino.utils.instantiator import create_row
from lino_xl.lib.tickets.choicelists import TicketStates
from l... | [
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
15069,
1584,
12,
5539,
7598,
311,
2001,
260,
198,
2,
13789,
25,
347,
10305,
357,
3826,
2393,
27975,
45761,
329,
3307,
8,
198,
198,
6738,
11593,
37443,
834,
1330,
28000,
... | 2.352564 | 780 |
#!/usr/bin/env python
#
# Test cases for tournament.py
from tournament import *
if __name__ == '__main__':
test_delete_matches()
test_delete()
test_count()
test_register()
test_register_count_delete()
test_standings_before_matches()
test_report_matches()
test_pairings()
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
198,
2,
6208,
2663,
329,
7756,
13,
9078,
198,
198,
6738,
7756,
1330,
1635,
628,
628,
628,
628,
628,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
... | 2.594771 | 153 |
# Name assosiated with a set of parameters and covariance matrix. Will be used
# to retrieve it
name = 'test_cov'
mode = 'relative'
uncorr_uncs = [0.5, 0.1]
# 'keep' stands for keeping uncorrelated uncertainties of parameters and 'override' stands
# for substituting them values from uncorr_uncs
policy = 'keep'
param... | [
2,
6530,
840,
418,
12931,
351,
257,
900,
286,
10007,
290,
44829,
590,
17593,
13,
2561,
307,
973,
198,
2,
284,
19818,
340,
220,
198,
3672,
796,
705,
9288,
62,
66,
709,
6,
198,
14171,
796,
705,
43762,
6,
198,
403,
10215,
81,
62,
4... | 2.703947 | 152 |
"""Atakama sdk."""
# only import stuff here that has no co-deps, external-lib deps, etc.
# otherwise, the user should import the from a specific submodule
from .plugin_base import *
| [
37811,
2953,
461,
1689,
264,
34388,
526,
15931,
198,
198,
2,
691,
1330,
3404,
994,
326,
468,
645,
763,
12,
10378,
82,
11,
7097,
12,
8019,
390,
862,
11,
3503,
13,
198,
2,
4306,
11,
262,
2836,
815,
1330,
262,
422,
257,
2176,
850,
... | 3.345455 | 55 |
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
# file to edit: dev_nb/04_callbacks.ipynb
from exp.nb_03 import *
import re
_camel_re1 = re.compile('(.)([A-Z][a-z]+)')
_camel_re2 = re.compile('([a-z0-9])([A-Z])')
... | [
198,
29113,
14468,
2,
198,
21017,
12680,
45811,
21725,
47044,
7730,
1677,
1137,
11617,
0,
8410,
5626,
48483,
0,
44386,
198,
29113,
14468,
2,
198,
2,
2393,
284,
4370,
25,
1614,
62,
46803,
14,
3023,
62,
13345,
10146,
13,
541,
2047,
65,
... | 2.968 | 125 |
# -*- coding: utf-8 -*-
import os
import sys
import requests
from definitions import ROOT_DIR
ADDRESS = "https://s3.ap-south-1.amazonaws.com/shreyas-gopal-personal/sudoku.csv"
FILE_NAME = "sudoku.csv"
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
7007,
198,
198,
6738,
17336,
1330,
15107,
2394,
62,
34720,
198,
198,
2885,
7707,
7597,
796,
366,
5450,
1378,
82,
18,
13,
499... | 2.47561 | 82 |
import pytest
from valid8 import ValidationError
from core.menu.menu import Key
| [
11748,
12972,
9288,
198,
6738,
4938,
23,
1330,
3254,
24765,
12331,
198,
198,
6738,
4755,
13,
26272,
13,
26272,
1330,
7383,
628,
628,
628,
198
] | 3.48 | 25 |
"""Base class for GLU callback-caching structures"""
import ctypes
import weakref
from OpenGL._bytes import long, integer_types
class GLUStruct( object ):
"""Mix-in class for GLU Structures that want to retain references to callbacks
Also provides original-object-return for the "datapointer" style paremte... | [
37811,
14881,
1398,
329,
10188,
52,
23838,
12,
66,
8103,
8573,
37811,
198,
11748,
269,
19199,
198,
11748,
4939,
5420,
198,
6738,
30672,
13557,
33661,
1330,
890,
11,
18253,
62,
19199,
198,
198,
4871,
10188,
52,
44909,
7,
2134,
15179,
198... | 2.488356 | 1,460 |
import argparse
import logging
import os
from pathlib import Path
import deepspeed
import pandas as pd
import torch
from tqdm import tqdm
import transformers
os.environ["TOKENIZERS_PARALLELISM"] = "false"
LOG = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
if __name__ == "__main__":
mai... | [
11748,
1822,
29572,
198,
11748,
18931,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
2769,
12287,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
28034,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
1... | 2.867257 | 113 |
##
# Sabertooth.py: Class implementing packetized serial control of
# Sabertooth 2x32 motor driver (Dimension Engineering).
#
# This code was adapted from MIT licensed
# Copyright 2015, Egan McComb
# copywrite 2017 Kevin J. Walchko
#
##
import serial
import logging
import time
class Sabertooth(object)... | [
2235,
198,
2,
9910,
861,
5226,
13,
9078,
25,
5016,
15427,
19638,
1143,
11389,
1630,
286,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9910,
861,
5226,
362,
87,
2624,
5584,
4639,
357,
29271,
30... | 2.024908 | 2,449 |
import frappe
from datetime import datetime
# bench execute mfi_customization.mfi.patch.set_closing_date_in_issue.execute
| [
11748,
5306,
27768,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
2,
7624,
12260,
285,
12463,
62,
23144,
1634,
13,
76,
12463,
13,
17147,
13,
2617,
62,
565,
2752,
62,
4475,
62,
259,
62,
21949,
13,
41049,
198,
197,
197,
197,
198
... | 2.953488 | 43 |
import os
import pathlib
import json
import flask
import flask_cors
from mnlite import mnode
import opersist.utils
| [
11748,
28686,
198,
11748,
3108,
8019,
198,
11748,
33918,
198,
11748,
42903,
198,
11748,
42903,
62,
66,
669,
198,
6738,
285,
21283,
578,
1330,
285,
17440,
198,
11748,
1034,
364,
396,
13,
26791,
628,
198
] | 3.342857 | 35 |
from django import forms
from django.utils.translation import gettext as _
from dcim.models import DeviceRole, Platform, Region, Site, SiteGroup
from extras.forms import CustomFieldModelFilterForm, LocalConfigContextFilterForm
from tenancy.forms import TenancyFilterForm, ContactModelFilterForm
from utilities.forms imp... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
355,
4808,
198,
198,
6738,
30736,
320,
13,
27530,
1330,
16232,
47445,
11,
19193,
11,
17718,
11,
14413,
11,
14413,
13247,
198,
6738,
33849,
1... | 3.520619 | 194 |
#!/usr/bin/env python
# Copyright 2017 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.
#
# Note: running this test requires installing the package python-mock.
# pylint: disable=C0103
# pylint: disable=F0401
import PRESUBMI... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
15069,
2177,
383,
18255,
1505,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,... | 2.906667 | 300 |
from ..exceptions import ArgumentNullException
def has_params(data, *args):
"""
Validates required parameters against an object.
:param data:
:param args: required parameters
:return:
"""
if not data:
return False
for a in args:
if not a in data:
return Fal... | [
6738,
11485,
1069,
11755,
1330,
45751,
35067,
16922,
628,
198,
4299,
468,
62,
37266,
7,
7890,
11,
1635,
22046,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
3254,
37051,
2672,
10007,
1028,
281,
2134,
13,
628,
220,
220,
220,
105... | 2.394286 | 175 |
import os
import io
import yaml
import stringcase
# from pprint import pprint
from pathlib import Path
from korapp import kordir
from korapp import utils
| [
11748,
28686,
198,
11748,
33245,
198,
11748,
331,
43695,
198,
11748,
4731,
7442,
198,
2,
422,
279,
4798,
1330,
279,
4798,
198,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
479,
273,
1324,
1330,
479,
585,
343,
198,
6738,
479,
273,
13... | 3.361702 | 47 |
"""
Define the unit tests for the
:mod:`colour.models.rgb.transfer_functions.arri_alexa_log_c` module.
"""
import numpy as np
import unittest
from colour.models.rgb.transfer_functions import (
log_encoding_ALEXALogC,
log_decoding_ALEXALogC,
)
from colour.utilities import domain_range_scale, ignore_numpy_error... | [
37811,
198,
7469,
500,
262,
4326,
5254,
329,
262,
198,
25,
4666,
25,
63,
49903,
13,
27530,
13,
81,
22296,
13,
39437,
62,
12543,
2733,
13,
283,
380,
62,
1000,
27865,
62,
6404,
62,
66,
63,
8265,
13,
198,
37811,
198,
198,
11748,
299,... | 2.03906 | 2,637 |
"""
Meteostat JSON API Server
The code is licensed under the MIT license.
"""
from datetime import datetime
import json
from flask import abort
from meteostat import Normals, units
from server import app, utils
"""
Meteostat configuration
"""
cache_time = 60 * 60 * 24 * 30
Normals.max_age = cache_time
Normals.autoc... | [
37811,
198,
9171,
68,
455,
265,
19449,
7824,
9652,
198,
198,
464,
2438,
318,
11971,
739,
262,
17168,
5964,
13,
198,
37811,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
11748,
33918,
198,
6738,
42903,
1330,
15614,
198,
6738,
47091,... | 2.0746 | 1,126 |
TITLE = "Xor - топ"
STATEMENT_TEMPLATE = '''
Дан код, шифрующий флаг, и результат его работы. Получите флаг.
`
with open("output.txt", "w") as f:
key = 0 # some x 0<x<256
flag = "some string"
encrypted_flag = []
for i in range(len(flag)):
encrypted_flag.append(ord(flag[i]) ^ key)
... | [
49560,
2538,
796,
366,
55,
273,
532,
220,
20375,
25443,
123,
1,
201,
198,
35744,
12529,
62,
51,
3620,
6489,
6158,
796,
705,
7061,
201,
198,
140,
242,
16142,
22177,
12466,
118,
25443,
112,
11,
220,
141,
230,
18849,
141,
226,
21169,
3... | 3.84249 | 10,266 |
from sys import argv, exit
import torch
import torchgeometry as tgm
import cv2
import matplotlib.pyplot as plt
import torch.nn as nn
if __name__ == '__main__':
imgFile1 = argv[1]
imgFile2 = argv[2]
# rotate(imgFile)
# warp(imgFile2)
image1 = cv2.imread(imgFile1)[..., (2,1,0)]
img1 = tgm.utils.image_to_te... | [
6738,
25064,
1330,
1822,
85,
11,
8420,
198,
11748,
28034,
198,
11748,
28034,
469,
15748,
355,
256,
39870,
198,
11748,
269,
85,
17,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
28034,
13,
20471,
355,
299,
7... | 2.259928 | 277 |
import tensorflow as tf
import numpy as np
from models import build_model as build_model
from datagen import genxy
from utils import genanchors, nsm, comiou
train_anno_file_path = '../datasets/widerface/train1024.txt'
train_image_dir = '../datasets/widerface/train1024'
test_anno_file_path = '../datasets/widerface/tes... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
4981,
1330,
1382,
62,
19849,
355,
1382,
62,
19849,
198,
6738,
4818,
11286,
1330,
2429,
5431,
198,
6738,
3384,
4487,
1330,
2429,
3702,
669,
11,
299,
579... | 2.242257 | 2,357 |
from itassets.test_api import ApiTestCase, random_dbca_email
from mixer.backend.django import mixer
from tracking.models import FreshdeskTicket, FreshdeskContact
| [
6738,
340,
19668,
13,
9288,
62,
15042,
1330,
5949,
72,
14402,
20448,
11,
4738,
62,
9945,
6888,
62,
12888,
198,
6738,
33938,
13,
1891,
437,
13,
28241,
14208,
1330,
33938,
198,
198,
6738,
9646,
13,
27530,
1330,
20138,
8906,
74,
51,
9715... | 3.416667 | 48 |
import numpy as np
from math_study.numpy_basics.data_types.print_data_type_info import print_info
if __name__ == '__main__':
int_array = np.array(list(range(10)), dtype=np.int64)
float_array = np.array(list(range(10)), dtype=np.float128)
complex_array = np.array(list(range(10)), dtype=np.complex256)
... | [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
10688,
62,
44517,
13,
77,
32152,
62,
12093,
873,
13,
7890,
62,
19199,
13,
4798,
62,
7890,
62,
4906,
62,
10951,
1330,
3601,
62,
10951,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12... | 2.345646 | 379 |