content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
"""A two-layer LSTM for character-level language modelling on Tolstoi's War and Peace."""
import tensorflow as tf
from ..datasets.tolstoi import tolstoi
from .testproblem import TestProblem
class tolstoi_char_rnn(TestProblem):
"""DeepOBS test problem class for a two-layer LSTM for charac... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
32,
734,
12,
29289,
406,
2257,
44,
329,
2095,
12,
5715,
3303,
38591,
319,
20054,
301,
23013,
338,
1810,
290,
12689,
526,
15931,
198,
198,
11748,
11192,
273,
11125... | 2.2374 | 4,107 |
from io import BytesIO
from time import sleep
from PyQt5.QtGui import QPixmap
from picamera import PiCamera
# Create an in-memory stream
my_stream = BytesIO()
camera = PiCamera()
camera.start_preview()
# Camera warm-up time
sleep(100)
camera.capture(my_stream, 'jpeg')
qp = QPixmap()
qp.loadFromData(my... | [
6738,
33245,
1330,
2750,
4879,
9399,
201,
198,
6738,
640,
1330,
3993,
201,
198,
201,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
8205,
72,
1330,
1195,
47,
844,
8899,
201,
198,
6738,
8301,
18144,
1330,
13993,
35632,
201,
198,
201,
198,
... | 2.523077 | 130 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 Guillaume Fournier <fournierg@gmail.com>
#
# This file is forked from `smart_open` project.
#
# This code is distributed under the terms and conditions
# from the MIT License (MIT).
#
import os
SCHEME = 'file'
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
33448,
1962,
5049,
2454,
376,
1798,
959,
1279,
69,
1798,
959,
70,
31,
14816,
13,
785,
29,
198,
2,
198,
2,
770,
2393,
318,
329,
9091,
... | 2.776596 | 94 |
#!/usr/bin/env python
__author__ = "Jamie Farnes"
__email__ = "jamie.farnes@oerc.ox.ac.uk"
import os
import time as t
import subprocess
import argparse
import numpy as np
from processing_components.image.operations import import_image_from_fits, export_image_to_fits, \
qa_image
from processing_components.visibi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
834,
9800,
834,
796,
366,
48337,
49230,
274,
1,
198,
834,
12888,
834,
796,
366,
39159,
494,
13,
69,
1501,
274,
31,
78,
2798,
13,
1140,
13,
330,
13,
2724,
1,
198,
198,
11748,
... | 2.5866 | 4,209 |
import random
import numpy as np
import pytest
from maplayerpy.voronoi_layer import (VoronoiLayer, get_random_points_spaced,
get_random_voronoi_layer,
get_voronoi_layer)
@pytest.mark.voronoi_img
| [
11748,
4738,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
6738,
17266,
7829,
9078,
13,
20867,
261,
23013,
62,
29289,
1330,
357,
53,
273,
261,
23013,
49925,
11,
651,
62,
25120,
62,
13033,
62,
2777,
2286,
11,
1... | 1.849673 | 153 |
import calendar
from datetime import date
days = dict(zip(list(calendar.day_name),range(7)))
week_dict = {
"1st":0,
"2nd":1,
"3rd":2,
"4th":3,
"5th":4,
"teenth":[13,14,15,16,17,18,19]
}
| [
11748,
11845,
198,
6738,
4818,
8079,
1330,
3128,
198,
198,
12545,
796,
8633,
7,
13344,
7,
4868,
7,
9948,
9239,
13,
820,
62,
3672,
828,
9521,
7,
22,
22305,
198,
198,
10464,
62,
11600,
796,
1391,
198,
197,
1,
16,
301,
1298,
15,
11,
... | 1.960396 | 101 |
"""A (very) simple banning & rate limiting extension for Flask.
"""
from inspect import signature
import time
from collections import deque
from functools import wraps
from flask import request
| [
37811,
32,
357,
548,
8,
2829,
19479,
1222,
2494,
15637,
7552,
329,
46947,
13,
198,
37811,
198,
6738,
10104,
1330,
9877,
198,
11748,
640,
198,
6738,
17268,
1330,
390,
4188,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
198,
6738,
42903,... | 4.377778 | 45 |
from django.conf.urls import *
urlpatterns = patterns('messaging.views',
url(r'^contact/$', 'contact', name='contact'),
)
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
1635,
198,
198,
6371,
33279,
82,
796,
7572,
10786,
37348,
3039,
13,
33571,
3256,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
32057,
32624,
3256,
705,
32057,
3256,
1438,
11639,
32057,
338... | 2.822222 | 45 |
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 1 14:02:03 2021
@author: Hatlab_3
for getting many files out of a particular directory with Wolfie's directory structure'
"""
import easygui
import os
from plottr.apps.autoplot import autoplotDDH5, script, main
from plottr.data.datadict_storage import all_datadicts_fro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
3158,
220,
352,
1478,
25,
2999,
25,
3070,
33448,
198,
198,
31,
9800,
25,
10983,
23912,
62,
18,
198,
198,
1640,
1972,
867,
3696,
503,
286,... | 2.634831 | 178 |
# -*- coding: utf-8 -*-
from fabric.api import env
from fabric.utils import puts
from fabric.colors import *
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
9664,
13,
15042,
1330,
17365,
198,
6738,
9664,
13,
26791,
1330,
7584,
198,
6738,
9664,
13,
4033,
669,
1330,
1635,
198
] | 3.027778 | 36 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-13 16:40
from __future__ import unicode_literals
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
24,
13,
16,
319,
1584,
12,
2999,
12,
1485,
1467,
25,
1821,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
1... | 2.719298 | 57 |
"""Gremlin Server exceptions."""
__all__ = ("RequestError", "GremlinServerError")
| [
37811,
38,
17244,
9652,
13269,
526,
15931,
198,
198,
834,
439,
834,
796,
5855,
18453,
12331,
1600,
366,
38,
17244,
10697,
12331,
4943,
628,
628
] | 3.44 | 25 |
import nose.tools as nt
import numpy as np
import theano
import theano.tensor as T
import treeano
import treeano.nodes as tn
from treeano.sandbox.nodes import stochastic_pooling
fX = theano.config.floatX
| [
11748,
9686,
13,
31391,
355,
299,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
262,
5733,
198,
11748,
262,
5733,
13,
83,
22854,
355,
309,
198,
198,
11748,
5509,
5733,
198,
11748,
5509,
5733,
13,
77,
4147,
355,
256,
77,
198,
6... | 2.902778 | 72 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 21 12:32:00 2022
Author: Gianluca Bianco
"""
#################################################
# Libraries
#################################################
import sys, os
import functions as ft
from termcolor import colored
import numpy as np
f... | [
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,
2310,
1105,
25,
2624,
25,
405,
33160,
198,
13838,
25,
30851,
75,
43120,
41227,... | 3.835526 | 152 |
import pandas as pd
import json
from io import StringIO
df = pd.read_csv('data/2012_05_06.csv')
nan_index = df[(df['type'] == 'MemberEvent') & df.isnull().any(axis=1)].index
df = df.drop(nan_index)
df = df.apply(filter_data, axis=1)
print("\n Writing to CSV file...")
df.to_csv('filter/2012_05_06.csv', sep='\t')
pr... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
33918,
198,
6738,
33245,
1330,
10903,
9399,
198,
198,
7568,
796,
279,
67,
13,
961,
62,
40664,
10786,
7890,
14,
6999,
62,
2713,
62,
3312,
13,
40664,
11537,
198,
12647,
62,
9630,
796,
47764,
... | 2.470588 | 136 |
#!/usr/bin/python
# -*- coding: UTF-8 -*-
##
## Compatible with Python >= 2.6, < 3.*
##
##
## Created by Andrew Podkovyrin, 2018
## Copyright © 2018 Axe Foundation. All rights reserved.
##
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software and associated documentat... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
2235,
198,
2235,
220,
3082,
16873,
351,
11361,
18189,
362,
13,
21,
11,
1279,
513,
15885,
198,
2235,
198,
2235,
198,
2235,
... | 2.780151 | 796 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# SKR03
# =====
# Dieses Modul bietet Ihnen einen deutschen Kontenplan basierend auf dem SKR03.
# Gemäss der aktuellen Einstellungen ist ein neues Unternehmen in Odoo
# Umsatzsteuerpflichtig. Zahlreiche Erlös- und Aufwa... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2142,
286,
10529,
2238,
13,
4091,
38559,
24290,
2393,
329,
1336,
6634,
290,
15665,
3307,
13,
198,
198,
2,
14277,
49,
3070,
198,
2,
29335,
198,
198,
2,
360,
444,
2... | 2.389105 | 1,028 |
from statistics import mean
n, a, b = [int(_) for _ in input().split()]
values = [int(v) for v in input().split()]
values.sort(reverse=True)
maximum_mean = mean(values[:a])
print(maximum_mean)
min_value = values[:a][-1]
accepted = values[:a].count(min_value)
full = values.count(min_value)
print(cmb(f... | [
6738,
7869,
1330,
1612,
201,
198,
201,
198,
77,
11,
257,
11,
275,
796,
685,
600,
28264,
8,
329,
4808,
287,
5128,
22446,
35312,
3419,
60,
201,
198,
27160,
796,
685,
600,
7,
85,
8,
329,
410,
287,
5128,
22446,
35312,
3419,
60,
201,
... | 2.459854 | 137 |
from decimal import Decimal
from exchangelib.ewsdatetime import EWSDateTime, EWSTimeZone, UTC_NOW
from exchangelib.folders import Tasks
from exchangelib.items import Task
from .test_basics import CommonItemTest
| [
6738,
32465,
1330,
4280,
4402,
198,
198,
6738,
9933,
8368,
571,
13,
15515,
19608,
8079,
1330,
43255,
10305,
378,
7575,
11,
43255,
2257,
524,
26961,
11,
18119,
62,
45669,
198,
6738,
9933,
8368,
571,
13,
11379,
364,
1330,
309,
6791,
198,
... | 3.451613 | 62 |
# My Exception
print('hello')
raise Other('a') | [
2,
2011,
35528,
198,
4798,
10786,
31373,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
40225,
3819,
10786,
64,
11537
] | 2.391304 | 23 |
from statsmodels.tsa.stattools import adfuller,kpss
import warnings
def determine_interval(intervals,df,labels):
"""
@Author: Kenneth Brezinski, Department of Electrical and Computer Engineering
args:
df: pandas dataframe containing your time series
intervals: how many subintervals will b... | [
198,
6738,
9756,
27530,
13,
912,
64,
13,
301,
1078,
10141,
1330,
512,
12853,
263,
11,
74,
79,
824,
198,
11748,
14601,
198,
198,
4299,
5004,
62,
3849,
2100,
7,
3849,
12786,
11,
7568,
11,
23912,
1424,
2599,
198,
220,
220,
220,
37227,
... | 2.712401 | 379 |
from annotation_utils.coco.structs import COCO_Dataset
dataset = COCO_Dataset.load_from_path('measure_coco/measure/output.json')
dataset.save_video(
save_path='merged_mask_measure_viz.mp4',
show_details=True,
fps=3
) | [
6738,
23025,
62,
26791,
13,
66,
25634,
13,
7249,
82,
1330,
327,
4503,
46,
62,
27354,
292,
316,
198,
198,
19608,
292,
316,
796,
327,
4503,
46,
62,
27354,
292,
316,
13,
2220,
62,
6738,
62,
6978,
10786,
1326,
5015,
62,
66,
25634,
14,... | 2.267327 | 101 |
import gzip
import pickle
import struct
from warnings import warn
import math
import os
from Chamaeleo.utils.monitor import Monitor
| [
11748,
308,
13344,
198,
11748,
2298,
293,
198,
11748,
2878,
198,
6738,
14601,
1330,
9828,
198,
198,
11748,
10688,
198,
11748,
28686,
198,
198,
6738,
609,
1689,
11129,
78,
13,
26791,
13,
41143,
1330,
18289,
628,
628,
628,
628,
628,
198
] | 3.512195 | 41 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from nose.plugins.attrib import attr
from hgvs.exceptions import HGVSValidationError
import hgvs.dataproviders.uta
import hgvs.variantmapper
import hgvs.parser
import hgvs.validator
db_dir = ['... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
555,
715,
395,
198,
198,
6738,
9686,
13... | 2.291977 | 2,555 |
from qgis.core import *
from PyQt5.QtCore import *
# This is necessary for the processing to work ### Otherwise get "algorithm not found" error
from qgis.analysis import QgsNativeAlgorithms
import sys
import os
QgsApplication.setPrefixPath("/usr",True)
# Starts the application, with False to not launch t... | [
6738,
10662,
70,
271,
13,
7295,
1330,
1635,
201,
198,
6738,
9485,
48,
83,
20,
13,
48,
83,
14055,
1330,
1635,
201,
198,
201,
198,
2,
770,
318,
3306,
329,
262,
7587,
284,
670,
44386,
15323,
651,
366,
282,
42289,
407,
1043,
1,
4049,
... | 2.576271 | 826 |
# class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
| [
2,
1398,
7560,
416,
1024,
11008,
36,
3712,
17953,
5005,
11008,
3620,
375,
2261,
4863,
36392,
42,
10267,
198,
6738,
8265,
62,
74,
896,
13,
85,
30488,
62,
15813,
13,
19816,
1040,
1330,
17427,
36392,
42,
9487,
26796,
14881,
198,
11748,
4... | 3.090909 | 44 |
#!/usr/bin/env
# author: stephanie hyland
# make a list of PIDS with non-empty, non-all-unknown endpoint data
import pandas as pd
import glob
import ipdb
import paths
def check_list():
"""
slow but w/e
"""
pids_with_endpoints = open(paths.derived_dir + 'patients_with_endpoints_v6b.txt', 'r')
pids... | [
2,
48443,
14629,
14,
8800,
14,
24330,
198,
2,
1772,
25,
2239,
7637,
494,
2537,
1044,
198,
2,
787,
257,
1351,
286,
350,
14255,
351,
1729,
12,
28920,
11,
1729,
12,
439,
12,
34680,
36123,
1366,
198,
198,
11748,
19798,
292,
355,
279,
... | 2.331942 | 479 |
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | [
2,
15069,
2864,
3012,
11419,
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,
7330... | 3.546174 | 379 |
from couchbase_core._ixmgmt import N1QL_PRIMARY_INDEX, IxmgmtRequest, N1qlIndex
from couchbase_core.bucketmanager import BucketManager
from couchbase.options import OptionBlock, OptionBlockTimeOut, forward_args, timedelta
from typing import *
from couchbase.management.generic import GenericManager
import attr
from attr... | [
6738,
18507,
8692,
62,
7295,
13557,
844,
11296,
16762,
1330,
399,
16,
9711,
62,
4805,
3955,
13153,
62,
12115,
6369,
11,
314,
87,
11296,
16762,
18453,
11,
399,
16,
13976,
15732,
198,
6738,
18507,
8692,
62,
7295,
13,
27041,
316,
37153,
... | 3.062814 | 398 |
__bootstrap__()
| [
834,
18769,
26418,
834,
3419,
198
] | 2.666667 | 6 |
"""construct the sampler"""
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | [
37811,
41571,
262,
6072,
20053,
37811,
198,
2,
15069,
33448,
43208,
21852,
1766,
1539,
12052,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
... | 3.785235 | 298 |
import keras
from keras.datasets import mnist
from keras.utils.np_utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPool2D
from keras import backend as K
# the datam split between train and test
(X_train, y_train), (X_te... | [
11748,
41927,
292,
198,
6738,
41927,
292,
13,
19608,
292,
1039,
1330,
285,
77,
396,
198,
6738,
41927,
292,
13,
26791,
13,
37659,
62,
26791,
1330,
284,
62,
66,
2397,
12409,
198,
6738,
41927,
292,
13,
27530,
1330,
24604,
1843,
198,
6738... | 2.570588 | 680 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='xrftomo',
author='Fabricio Marin, Chris Roehrig, Arthur Glowacki, Francesco De Carlo, Si Chen',
packages=find_packages(),
version=open('VERSION').read().strip(),
description = 'Pre-processing too... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
8... | 2.578313 | 332 |
"""Classes that replace tkinter gui objects used by an object being tested.
A gui object jest anything przy a master albo parent parameter, which jest
typically required w spite of what the doc strings say.
"""
klasa Event:
'''Minimal mock przy attributes dla testing event handlers.
This jest nie a gui objec... | [
37811,
9487,
274,
326,
6330,
256,
74,
3849,
11774,
5563,
973,
416,
281,
2134,
852,
6789,
13,
198,
198,
32,
11774,
2134,
474,
395,
1997,
778,
7357,
257,
4958,
435,
2127,
2560,
11507,
11,
543,
474,
395,
198,
48126,
2672,
266,
15275,
2... | 2.333105 | 4,374 |
#__all__ = ['nt_domain_controller',
# 'simplemysqlabstractionlayer',
# ]
| [
2,
834,
439,
834,
796,
37250,
429,
62,
27830,
62,
36500,
3256,
220,
201,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
36439,
28744,
13976,
397,
301,
7861,
29289,
3256,
201,
198,
2,
220,
220,
220,
220,
220,
220,
... | 1.901961 | 51 |
import math
from mesa import Agent
class Citizen(Agent):
"""
A member of the general population, may or may not be in active rebellion.
Summary of rule: If grievance - risk > threshold, rebel.
Attributes:
unique_id: unique int
x, y: Grid coordinates
hardship: Agent's 'perceiv... | [
11748,
10688,
198,
198,
6738,
18842,
64,
1330,
15906,
628,
198,
4871,
22307,
7,
36772,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
317,
2888,
286,
262,
2276,
3265,
11,
743,
393,
743,
407,
307,
287,
4075,
21540,
13,
198,
220... | 2.15199 | 3,066 |
from modAL.uncertainty import (entropy_sampling,
uncertainty_sampling,
margin_sampling)
from asr.query_strategies.random_sampling import random_sampling
| [
198,
6738,
953,
1847,
13,
19524,
1425,
774,
1330,
357,
298,
28338,
62,
37687,
11347,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.972727 | 110 |
from typing import List, Tuple
from ..builtin_utils import BuiltinModule, Fail, make_simple
from ..types import Value, Stack, Str, Atom, Vec
module = BuiltinModule("streams")
T, V, S = Tuple, Value, Stack
@module.register_simple('str->stream')
@module.register_simple('list->stream') | [
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
6738,
11485,
18780,
259,
62,
26791,
1330,
28477,
259,
26796,
11,
18448,
11,
787,
62,
36439,
198,
6738,
11485,
19199,
1330,
11052,
11,
23881,
11,
4285,
11,
33102,
11,
38692,
198,
198,
... | 3.233333 | 90 |
from openvino.inference_engine import IECore
import cv2
import numpy as np | [
6738,
1280,
85,
2879,
13,
259,
4288,
62,
18392,
1330,
314,
2943,
382,
198,
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941
] | 3.083333 | 24 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ddv_global import client, reply_keyboard, keyboard, pk_keyboard
from ddv_waitforconfirmation import wait_for_confirmation
from algosdk.future.transaction import AssetTransferTxn
from telegram.inline.inlinekeyboardbutton import InlineKeyboardButton
from telegram.inline... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
49427,
85,
62,
20541,
1330,
5456,
11,
10971,
62,
2539,
3526,
11,
10586,
11,
279,
74,
62,
2539,
3526,
198,
... | 2.308646 | 3,308 |
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import multivariate_normal
from database_actions import get_known_encodings
import sklearn.decomposition as deco
## Helper function for plotting a 2D Gaussian
## Load data
data = get_known_encodings()[0].transpose()
x = (data - np.mean(data, 0)) / n... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
34242,
1330,
1963,
42524,
62,
11265,
198,
6738,
6831,
62,
4658,
1330,
651,
62,
4002,
62,
12685,
375,
654,
198,
... | 2.4 | 745 |
# Copyright 2021 The Distla Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
2,
15069,
33448,
383,
4307,
5031,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
... | 2.582557 | 7,625 |
# coding=utf-8
# Copyright 2018 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,
2864,
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,
... | 2.765332 | 2,348 |
#!/usr/bin/env python3
import re
from bunkai.base.annotation import Annotations, SpanAnnotation
from bunkai.base.annotator import Annotator
RE_LBS = re.compile(r'[\n\s]*\n[\n\s]*')
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
302,
198,
198,
6738,
36355,
1872,
13,
8692,
13,
1236,
14221,
1330,
47939,
11,
49101,
2025,
38983,
198,
6738,
36355,
1872,
13,
8692,
13,
34574,
1352,
1330,
1052,
1662,
1352,
... | 2.520548 | 73 |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distrib... | [
2,
46424,
347,
43312,
38644,
38559,
24290,
9878,
11290,
46424,
198,
2,
198,
2,
220,
770,
1430,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
198,
2,
220,
13096,
340,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
1378... | 3.076547 | 614 |
import maya.cmds as mc
import glTools.utils.blendShape
import glTools.utils.stringUtils
def createFromSelection(origin='local',deformOrder=None,prefix=None):
'''
Create basic blendShape from selection.
@param origin: Create a local or world space belndShape deformer. Accepted values - "local" or "world".
@type or... | [
11748,
743,
64,
13,
28758,
82,
355,
36650,
198,
198,
11748,
1278,
33637,
13,
26791,
13,
2436,
437,
33383,
198,
11748,
1278,
33637,
13,
26791,
13,
8841,
18274,
4487,
198,
198,
4299,
2251,
4863,
4653,
1564,
7,
47103,
11639,
12001,
3256,
... | 2.889048 | 3,488 |
default_app_config = 'dynamic_formsets.apps.DynamicFormsetsConfig' # NOQA
| [
12286,
62,
1324,
62,
11250,
796,
705,
67,
28995,
62,
23914,
1039,
13,
18211,
13,
44090,
8479,
28709,
16934,
6,
220,
1303,
8005,
48,
32,
198
] | 2.884615 | 26 |
import datetime
import logging
import logging.config
import logging.handlers
import os
import re
import sys
from functools import wraps
from typing import Any, Callable, Dict, FrozenSet, List, Optional, Pattern, Tuple
import gevent
import structlog
LOG_BLACKLIST: Dict[Pattern, str] = {
re.compile(r"\b(access_?tok... | [
11748,
4818,
8079,
198,
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
11748,
18931,
13,
4993,
8116,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
6738,
1257,
310,
10141,
1330,
27521,
198,
6738,
19720,
1330,
4377,
11,
4889... | 2.588183 | 1,134 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
from os import path
from pathlib import Path
from psychopy.alerts import alerttools
from ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
2142,
286,
262,
38955,
20519,
5888,
198,
2,
15069,
357,
34,
8,
6244,
12,
7908,
11232,
2631,
343,
344,
357,
... | 2.487484 | 759 |
from __future__ import annotations
import os
from PIL import Image
from arbies.manager import Manager, ConfigDict
from . import Tray
| [
6738,
11593,
37443,
834,
1330,
37647,
198,
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
610,
29846,
13,
37153,
1330,
9142,
11,
17056,
35,
713,
198,
6738,
764,
1330,
34575,
628
] | 4.060606 | 33 |
from .misc import *
from .tensorboard import run_tensorboard
| [
6738,
764,
44374,
1330,
1635,
198,
6738,
764,
83,
22854,
3526,
1330,
1057,
62,
83,
22854,
3526,
198
] | 3.388889 | 18 |
import base64
import datetime
import decimal
import inspect
import logging
import netaddr
import re
import six
import sys
import uuid
import weakref
from wsme import exc
log = logging.getLogger(__name__)
#: The 'str' (python 2) or 'bytes' (python 3) type.
#: Its use should be restricted to
#: pure ascii strings as t... | [
11748,
2779,
2414,
198,
11748,
4818,
8079,
198,
11748,
32465,
198,
11748,
10104,
198,
11748,
18931,
198,
11748,
2010,
29851,
198,
11748,
302,
198,
11748,
2237,
198,
11748,
25064,
198,
11748,
334,
27112,
198,
11748,
4939,
5420,
198,
198,
6... | 2.536806 | 3,206 |
__author__ = 'Lorenzo'
YOUTUBE_API_SERVICE_NAME = "youtube"
YOUTUBE_API_VERSION = "v3"
_KEY = '**********************'
| [
834,
9800,
834,
796,
705,
43,
29578,
10872,
6,
628,
198,
56,
12425,
10526,
36,
62,
17614,
62,
35009,
27389,
62,
20608,
796,
366,
11604,
1,
198,
56,
12425,
10526,
36,
62,
17614,
62,
43717,
796,
366,
85,
18,
1,
198,
62,
20373,
796,
... | 2.42 | 50 |
"""User Model."""
from config.database import Model
from orator.orm import has_many
class User(Model):
"""User Model."""
__fillable__ = ["name", "email", "password"]
__auth__ = "email"
@has_many("id", "user_id")
| [
37811,
12982,
9104,
526,
15931,
198,
198,
6738,
4566,
13,
48806,
1330,
9104,
198,
6738,
393,
1352,
13,
579,
1330,
468,
62,
21834,
628,
198,
4871,
11787,
7,
17633,
2599,
198,
220,
220,
220,
37227,
12982,
9104,
526,
15931,
628,
220,
220... | 2.741176 | 85 |
import paramiko
import fooster.console
if __name__ == '__main__':
main()
| [
11748,
5772,
12125,
198,
198,
11748,
11511,
6197,
13,
41947,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
1388,
3419,
198
] | 2.7 | 30 |
"""Provide strategies for given endpoint(s) definition."""
import asyncio
import inspect
import re
from base64 import b64encode
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from urllib.parse import quote_plus
import hypothesis
import hypothesis.strategies as st
fro... | [
37811,
15946,
485,
10064,
329,
1813,
36123,
7,
82,
8,
6770,
526,
15931,
198,
11748,
30351,
952,
198,
11748,
10104,
198,
11748,
302,
198,
6738,
2779,
2414,
1330,
275,
2414,
268,
8189,
198,
6738,
1257,
310,
10141,
1330,
13027,
198,
6738,
... | 2.859346 | 1,621 |
name = "wrds2pg"
from wrds2pg.wrds2pg import wrds_update, run_file_sql, get_modified_str
from wrds2pg.wrds2pg import make_engine, get_process, wrds_process_to_pg
from wrds2pg.wrds2pg import wrds_id, set_table_comment, get_table_sql
| [
3672,
796,
366,
86,
4372,
82,
17,
6024,
1,
198,
198,
6738,
1319,
9310,
17,
6024,
13,
86,
4372,
82,
17,
6024,
1330,
1319,
9310,
62,
19119,
11,
1057,
62,
7753,
62,
25410,
11,
651,
62,
41771,
62,
2536,
198,
6738,
1319,
9310,
17,
60... | 2.377551 | 98 |
import insightconnect_plugin_runtime
from .schema import GetAttachmentsForAnIncidentInput, GetAttachmentsForAnIncidentOutput, Input, Output, Component
# Custom imports below
from icon_servicenow.util.request_helper import RequestHelper
| [
11748,
11281,
8443,
62,
33803,
62,
43282,
198,
6738,
764,
15952,
2611,
1330,
3497,
33296,
902,
1890,
2025,
25517,
738,
20560,
11,
3497,
33296,
902,
1890,
2025,
25517,
738,
26410,
11,
23412,
11,
25235,
11,
35100,
198,
198,
2,
8562,
17944... | 3.901639 | 61 |
import os
import re
import sys
import imp
import math
import copy
import json
import time
import errno
import shutil
import hashlib
import argparse
import traceback
import functools
import itertools
import subprocess
import xml.dom.minidom
__tool_name__ = 'vosges'
if __name__ == '__main__':
unhandled_exception_hook... | [
11748,
28686,
198,
11748,
302,
198,
11748,
25064,
198,
11748,
848,
198,
11748,
10688,
198,
11748,
4866,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
11454,
3919,
198,
11748,
4423,
346,
198,
11748,
12234,
8019,
198,
11748,
1822,
29572,
... | 2.941915 | 1,911 |
#######################################################################
# Copyright (C) 2017 Shangtong Zhang(zhangshangtong.cpp@gmail.com) #
# Permission given to modify the code as long as you keep this #
# declaration at the top #
################################... | [
29113,
29113,
4242,
21017,
198,
2,
15069,
357,
34,
8,
2177,
45797,
83,
506,
19439,
7,
23548,
648,
1477,
648,
83,
506,
13,
20322,
31,
14816,
13,
785,
8,
220,
220,
220,
1303,
198,
2,
2448,
3411,
1813,
284,
13096,
262,
2438,
355,
890... | 3.263889 | 216 |
# HTML Parser - Part 2 "https://www.hackerrank.com/challenges/html-parser-part-2/problem"
from html.parser import HTMLParser
html = ""
for i in range(int(input())):
html += input().rstrip()
html += '\n'
parser = MyHTMLParser()
parser.feed(html)
parser.close()
| [
2,
11532,
23042,
263,
532,
2142,
362,
366,
5450,
1378,
2503,
13,
31153,
8056,
962,
13,
785,
14,
36747,
34120,
14,
6494,
12,
48610,
12,
3911,
12,
17,
14,
45573,
1,
198,
198,
6738,
27711,
13,
48610,
1330,
11532,
46677,
628,
198,
198,
... | 2.74 | 100 |
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Windows specific utility functions."""
import ctypes
import logging
import os
import platform
import re
import string
import subprocess
import... | [
2,
15069,
1853,
383,
406,
9598,
40,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
198,
2,
326,
460,
307,
1043,
287,
262,
38559,
24290,
2393,
13,
1... | 2.538372 | 7,766 |
import numpy as np
import pandas as pd
import GPy, GPyOpt
from sklearn.model_selection import train_test_split
from sklearn.metrics import brier_score_loss as brier_score
from sklearn.metrics import accuracy_score, f1_score
from scipy.sparse import load_npz
from stuff.models import NBSVM, simpleNBSVM
from stuff.tools... | [
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
14714,
88,
11,
14714,
88,
27871,
198,
198,
6738,
1341,
35720,
13,
19849,
62,
49283,
1330,
4512,
62,
9288,
62,
35312,
198,
6738,
1341,
35720,
13,
4164,
10... | 1.964713 | 1,587 |
# -*- coding: utf-8 -*-
import pytest
from pyleecan.Classes.MeshMat import MeshMat
from pyleecan.Classes.NodeMat import NodeMat
from pyleecan.Classes.CellMat import CellMat
import numpy as np
@pytest.mark.MeshSol
class Test_get_node(object):
"""unittest for nodes getter methods"""
@classmethod
def test_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198,
6738,
279,
2349,
721,
272,
13,
9487,
274,
13,
37031,
19044,
1330,
47529,
19044,
198,
6738,
279,
2349,
721,
272,
13,
9487,
274,
13,
19667,
19044,... | 2.396226 | 318 |
configfile: 'config_spocd1_pi.yaml'
bowtie = "/usr/local/Cellar/bowtie/1.2.1.1/bin/bowtie"
rule all:
input:
expand("Processed/mapped/{sample}_mirna_mature.sam", sample = config["samples"]),
expand("Processed/unmapped/{sample}_mirna_mature_unmmaped.fasta", sample = config["samples"]),
expand("Processed/mappe... | [
11250,
7753,
25,
705,
11250,
62,
2777,
420,
67,
16,
62,
14415,
13,
88,
43695,
6,
198,
8176,
36224,
796,
12813,
14629,
14,
12001,
14,
34,
14203,
14,
8176,
36224,
14,
16,
13,
17,
13,
16,
13,
16,
14,
8800,
14,
8176,
36224,
1,
198,
... | 2.240187 | 1,070 |
'''
Definition of Document
class Document:
def __init__(self, id, cotent):
self.id = id
self.content = content
'''
# @param {Document[]} docs a list of documents
# @return {dict(string, int[])} an inverted index | [
7061,
6,
198,
36621,
286,
16854,
198,
4871,
16854,
25,
198,
220,
220,
220,
825,
11593,
15003,
834,
7,
944,
11,
4686,
11,
269,
33715,
2599,
198,
220,
220,
220,
220,
220,
220,
220,
2116,
13,
312,
796,
4686,
198,
220,
220,
220,
220,
... | 2.655556 | 90 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-12 08:17
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
319,
2177,
12,
3023,
12,
1065,
8487,
25,
1558,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738... | 2.933333 | 75 |
from django.conf.urls import *
urlpatterns = patterns('punchclock.views',
url(r'^$', 'start_task'),
url(r'^switch/$', 'switch_task'),
url(r'^activities/$', 'get_activities'),
url(r'^shift-details/$', 'shift_details'),
... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
1635,
198,
198,
6371,
33279,
82,
796,
7572,
10786,
79,
3316,
15750,
13,
33571,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.714286 | 196 |
"""
(C) Copyright 2021 IBM Corp.
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, software
di... | [
198,
37811,
198,
198,
7,
34,
8,
15069,
33448,
19764,
11421,
13,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
... | 3.0537 | 2,216 |
# coding=utf-8
__author__ = "Dragan Vidakovic"
import codecs
def read_file_content(path):
"""
Read file from given path
:param path: file path
:return: file content
"""
f = codecs.open(path, 'r', 'utf8')
content = f.read()
f.close()
return content
def read_file_line(path):
""... | [
2,
19617,
28,
40477,
12,
23,
198,
834,
9800,
834,
796,
366,
6187,
7329,
38965,
461,
17215,
1,
198,
11748,
40481,
82,
628,
198,
4299,
1100,
62,
7753,
62,
11299,
7,
6978,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
4149,
23... | 2.412322 | 211 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import csv
import json
import logging
import os
import time
import sys
from collections import namedtuple
from datetime import datetime
from pprint import pformat
from subprocess import Popen, PIPE
from celery import Celery
from celery.events.snapshot impor... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
1822,
29572,
198,
11748,
269,
21370,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
28686,
198,
11748,
640,
198... | 2.755738 | 610 |
"""
GET: data muncul jika url dijalankan lewat browser
POST: data tidak bisa diambil lewat browser, namun hanya bisa diambil berdasar permintaan dengan metode post dari form
"""
import requests
import json
import pprint
# Coba jalankan get dari link
try:
result = requests.get('https://www.idx.co.id/umbraco/Surfac... | [
37811,
198,
18851,
25,
1366,
29856,
3129,
474,
9232,
19016,
2566,
73,
282,
962,
272,
443,
47261,
6444,
198,
32782,
25,
1366,
29770,
461,
275,
9160,
48428,
33473,
443,
47261,
6444,
11,
299,
321,
403,
289,
34183,
275,
9160,
48428,
33473,
... | 2.262411 | 423 |
import sys
import regex
instr_regex = regex.compile(r"""(?|(rect)\ (\d+)x(\d+) # use same group numbers in each | branch
| rotate\ (row)\ y=(\d+)\ by\ (\d+)
| rotate\ (column)\ x=(\d+)\ by\ (\d+))""",
regex.VERBOSE)
parse_... | [
11748,
25064,
198,
11748,
40364,
198,
198,
259,
2536,
62,
260,
25636,
796,
40364,
13,
5589,
576,
7,
81,
15931,
18109,
30,
91,
7,
2554,
19415,
357,
59,
67,
28988,
87,
38016,
67,
28988,
1303,
779,
976,
1448,
3146,
287,
1123,
930,
8478... | 1.920128 | 313 |
from data_functions import conf
import shutil
filebase = "./../Logs/"
data = filebase + "cooldown_20200422_19.db"
if __name__ == "__main__":
df = conf(data)
df = df.loc[df.times_res - df.times_temps < 1]
# print(df.iloc[:, 1:4:2])
dfexp = df.iloc[:, 1:4:2]
# print(data[10:-3])
newfile = data... | [
6738,
1366,
62,
12543,
2733,
1330,
1013,
198,
11748,
4423,
346,
198,
198,
7753,
8692,
796,
366,
19571,
40720,
11187,
82,
30487,
198,
7890,
796,
2393,
8692,
1343,
366,
1073,
15041,
62,
1238,
15724,
1828,
62,
1129,
13,
9945,
1,
628,
198... | 2.103896 | 231 |
import os
import pytest
from spandex import TableLoader
from spandex.spatialtoolz import conform_srids
@pytest.fixture(scope='function')
def loader(request):
"""Recreate sample schema from shapefiles and tear down when done."""
# Configure TableLoader to use directory containing sample shapefiles.
root_... | [
11748,
28686,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
599,
392,
1069,
1330,
8655,
17401,
198,
6738,
599,
392,
1069,
13,
2777,
34961,
25981,
89,
1330,
17216,
62,
27891,
2340,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
1163... | 2.565815 | 509 |
#!/usr/bin/env python
import math
import numpy as np
from floripy.mathutils.linalg import perm_tensor
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
781,
273,
541,
88,
13,
11018,
26791,
13,
75,
1292,
70,
1330,
9943,
62,
83,
22854,
628
] | 2.810811 | 37 |
from django.contrib import admin
from .models import Contest, Problem, Submittion, RegistContestUser, Standing
# Register your models here.
admin.site.register(Contest)
admin.site.register(Problem)
admin.site.register(Submittion)
admin.site.register(RegistContestUser)
admin.site.register(Standing)
| [
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
764,
27530,
1330,
27297,
11,
20647,
11,
3834,
20124,
295,
11,
13811,
4264,
395,
12982,
11,
22493,
198,
198,
2,
17296,
534,
4981,
994,
13,
198,
28482,
13,
15654,
13,
30238,
7,
... | 3.409091 | 88 |
# this is just here to trick pytest into finding my modules
# I probably set something up wrong, but this is the quickest workaround I found to fix it :) | [
2,
428,
318,
655,
994,
284,
6908,
12972,
9288,
656,
4917,
616,
13103,
198,
2,
314,
2192,
900,
1223,
510,
2642,
11,
475,
428,
318,
262,
46264,
46513,
314,
1043,
284,
4259,
340,
14373
] | 4.5 | 34 |
#!/bin/bin/env python
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
setup(
name='djangorestframework-nr',
version='0.1.1',
description='Provide nested router support to Django REST Framework',
url='https://g... | [
2,
48443,
8800,
14,
8800,
14,
24330,
21015,
198,
198,
2,
16622,
4702,
900,
37623,
10141,
625,
1233,
26791,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
2,
1675,
779,
257,
6414,
21004,
198,
6738,
40481,
82,
1330,... | 2.77724 | 413 |
import tensorflow as tf
from tensorflow.contrib.rnn import DropoutWrapper
class SwitchableDropoutWrapper(DropoutWrapper):
"""
A wrapper of tensorflow.contrib.rnn.DropoutWrapper that does not apply
dropout if is_train is not True (dropout only in training).
"""
| [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
11192,
273,
11125,
13,
3642,
822,
13,
81,
20471,
1330,
14258,
448,
36918,
2848,
628,
198,
4871,
14645,
540,
26932,
448,
36918,
2848,
7,
26932,
448,
36918,
2848,
2599,
198,
220,
220,
220,
... | 3 | 93 |
"""
add-tables.py
A Python script that adds a few tables to Deephaven.
@copyright Deephaven Data Labs
"""
from pydeephaven import Session
import time
session = None
#Simple retry loop in case the server tries to launch before Deephaven is ready
count = 0
max_count = 5
while (count < max_count):
try:
se... | [
37811,
198,
2860,
12,
83,
2977,
13,
9078,
198,
198,
32,
11361,
4226,
326,
6673,
257,
1178,
8893,
284,
10766,
39487,
13,
198,
198,
31,
22163,
4766,
10766,
39487,
6060,
23500,
198,
37811,
198,
6738,
12972,
22089,
39487,
1330,
23575,
198,
... | 2.825 | 280 |
import os
from enum import Enum
| [
11748,
28686,
198,
6738,
33829,
1330,
2039,
388,
628
] | 3.666667 | 9 |
# Copyright (c) 2019 Eric Steinberger
import numpy as np
import sys
from PokerRL.cfr._MCCFRBase import MCCFRBase as _MCCFRBase
| [
2,
15069,
357,
66,
8,
13130,
7651,
15215,
21041,
628,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
198,
6738,
36157,
7836,
13,
66,
8310,
13557,
44,
4093,
10913,
14881,
1330,
337,
4093,
10913,
14881,
355,
4808,
44,
4093,
... | 2.977273 | 44 |
s1 = input()
s2 = input()
s3 = input()
if s1[-1] == s2[0] and s2[-1] == s3[0] and s3[-1] == s1[0] :
print("good")
else :
print("bad")
#이거 뭔가 이상
| [
82,
16,
796,
5128,
3419,
198,
82,
17,
796,
5128,
3419,
198,
82,
18,
796,
5128,
3419,
198,
361,
264,
16,
58,
12,
16,
60,
6624,
264,
17,
58,
15,
60,
290,
264,
17,
58,
12,
16,
60,
6624,
264,
18,
58,
15,
60,
290,
264,
18,
58,
... | 1.583333 | 96 |
from data_loader import load_data, tokenizer
from models import BertForMultipleLabelSequenceClassificationWithFocalLoss
from transformers import AutoConfig
import torch
from tqdm.auto import tqdm
from transformers import get_scheduler
from transformers import AdamW
from sklearn.metrics import accuracy_score, f1_score
... | [
6738,
1366,
62,
29356,
1330,
3440,
62,
7890,
11,
11241,
7509,
198,
6738,
4981,
1330,
22108,
1890,
31217,
33986,
44015,
594,
9487,
2649,
3152,
37,
4374,
43,
793,
198,
198,
6738,
6121,
364,
1330,
11160,
16934,
198,
11748,
28034,
198,
6738... | 1.855422 | 249 |
"""Converting between different types of graphs"""
from copy import deepcopy
import math
from typing import Dict, List, Tuple, Union
import networkx as nx
import pandas as pd
from .exception import UnexpectedSelfLoopException
from .types import (
Edge,
EdgeFunction,
EdgeFunctionName,
EdgeList,
Edg... | [
37811,
3103,
48820,
1022,
1180,
3858,
286,
28770,
37811,
628,
198,
6738,
4866,
1330,
2769,
30073,
198,
11748,
10688,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
309,
29291,
11,
4479,
198,
11748,
3127,
87,
355,
299,
87,
198,
11748,
... | 2.525421 | 6,235 |
from datetime import datetime, timedelta
from typing import Optional
from fastapi import HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
from jose import JWTError, jwt
from passlib.context import CryptContext
from .models import crud
from pydantic import BaseModel
pwd... | [
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
6738,
19720,
1330,
32233,
198,
198,
6738,
3049,
15042,
1330,
14626,
16922,
11,
3722,
198,
6738,
3049,
15042,
13,
12961,
1330,
440,
30515,
17,
35215,
3856,
11258,
11,
440,
30515,
... | 2.939024 | 164 |
import warnings
from dataclasses import asdict, dataclass
from io import BytesIO
from math import sqrt
from pathlib import Path
from subprocess import PIPE, run
from typing import Callable, Dict, Iterable, List, Optional, Union, Tuple
import numpy as np
from lhotse.utils import Decibels, Pathlike, Seconds, SetContain... | [
11748,
14601,
198,
6738,
4818,
330,
28958,
1330,
355,
11600,
11,
4818,
330,
31172,
198,
6738,
33245,
1330,
2750,
4879,
9399,
198,
6738,
10688,
1330,
19862,
17034,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
850,
14681,
1330,
350,
4061,... | 2.479104 | 3,972 |
# Please note that this script was based on the original code developed by MITRE ATT&CK team used for the generation of
# ATT&CK Navigator files. This script was slightly modified and configured to output JSON file instead.
# https://github.com/mitre/attack-navigator
# attack_layers_simple.py - the "hello, world"... | [
2,
4222,
3465,
326,
428,
4226,
373,
1912,
319,
262,
2656,
2438,
4166,
416,
17168,
2200,
26195,
5,
34,
42,
1074,
973,
329,
262,
5270,
286,
201,
198,
2,
26195,
5,
34,
42,
13244,
23823,
3696,
13,
220,
770,
4226,
373,
4622,
9518,
290,... | 3.596667 | 300 |
import numpy as np | [
11748,
299,
32152,
355,
45941
] | 3.6 | 5 |
from datetime import datetime
from scrapy.linkextractors import LinkExtractor
from scrapy.spiders import CrawlSpider, Rule
import scrapy
from suumo_scrapy.items import SuumoScrapyItem, ArticleItemLoader
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
15881,
88,
13,
2815,
365,
742,
974,
669,
1330,
7502,
11627,
40450,
198,
6738,
15881,
88,
13,
2777,
4157,
1330,
327,
13132,
41294,
11,
14330,
198,
11748,
15881,
88,
198,
6738,
424,
43... | 3.416667 | 60 |
__author__ = 'outm'
| [
834,
9800,
834,
796,
705,
448,
76,
6,
198
] | 2.222222 | 9 |
"""
@brief test log(time=2s)
"""
import sys
import os
import unittest
import re
from pyquickhelper.loghelper import fLOG
from pyquickhelper.jenkinshelper.jenkins_server import JenkinsExt
from pyquickhelper.jenkinshelper.jenkins_helper import default_engines, setup_jenkins_server_yml
if __name__ == "__main__":... | [
37811,
198,
31,
65,
3796,
220,
220,
220,
220,
220,
1332,
2604,
7,
2435,
28,
17,
82,
8,
198,
37811,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
555,
715,
395,
198,
11748,
302,
198,
198,
6738,
12972,
24209,
2978,
525,
13,
... | 2.75 | 124 |
import abc
import json
import logging
import pathlib
from typing import TYPE_CHECKING, Callable, List, Optional, Tuple
import PIL.Image
import PIL.ImageFilter
from ..defaults import Defaults
from ..globals import Globals
if TYPE_CHECKING:
from .contents import Image
logger = logging.getLogger()
class BasePr... | [
11748,
450,
66,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
3108,
8019,
198,
6738,
19720,
1330,
41876,
62,
50084,
2751,
11,
4889,
540,
11,
7343,
11,
32233,
11,
309,
29291,
198,
198,
11748,
350,
4146,
13,
5159,
198,
11748,
350,
4... | 2.771543 | 499 |
class KeysConverter(TypeConverter,IComparer):
"""
Provides a System.ComponentModel.TypeConverter to convert System.Windows.Forms.Keys objects to and from other representations.
KeysConverter()
"""
def CanConvertFrom(self,*__args):
"""
CanConvertFrom(self: KeysConverter,context: ITypeDescriptorCon... | [
4871,
26363,
3103,
332,
353,
7,
6030,
3103,
332,
353,
11,
2149,
3361,
11258,
2599,
201,
198,
37227,
201,
198,
47081,
257,
4482,
13,
21950,
17633,
13,
6030,
3103,
332,
353,
284,
10385,
4482,
13,
11209,
13,
8479,
82,
13,
40729,
5563,
... | 3.281766 | 2,424 |
import argparse
from typing import Any, Sequence
| [
11748,
1822,
29572,
198,
6738,
19720,
1330,
4377,
11,
45835,
628,
628,
628,
628,
628
] | 3.866667 | 15 |
from .....data.URL import QIWIWalletURLS
from .....connector.aiohttp_connector import Connector
from .....data_types.connector.request_type import PUT
from .....data_types.QIWIWallet import HookType, NotifyType
| [
6738,
11485,
986,
7890,
13,
21886,
1330,
1195,
40,
36326,
47152,
4261,
6561,
198,
6738,
11485,
986,
8443,
273,
13,
64,
952,
4023,
62,
8443,
273,
1330,
8113,
273,
198,
6738,
11485,
986,
7890,
62,
19199,
13,
8443,
273,
13,
25927,
62,
... | 3.212121 | 66 |
#!/usr/bin/env python2
from __future__ import print_function
import requests
import logging
import sys
# debug_mode()
if len(sys.argv) > 1:
url = sys.argv[1]
else:
url = "http://localhost:5000/"
# first request
first_hit = requests.get(url)
first_json = first_hit.json()
token = first_json.pop('token')
titl... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
17,
198,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
7007,
198,
11748,
18931,
198,
11748,
25064,
628,
198,
198,
2,
14257,
62,
14171,
3419,
198,
361,
18896,
7,
17597,
13,... | 2.587879 | 330 |
x = 1
tools.showMessage(str(x)) | [
87,
796,
352,
198,
198,
31391,
13,
12860,
12837,
7,
2536,
7,
87,
4008
] | 2.285714 | 14 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Jan 11 10:27:44 2020
@author: usingh
Test various pyrpipe modules used with each other
"""
from pyrpipe import sra,qc,mapping,assembly,quant,tools
from pyrpipe import pyrpipe_utils as pu
from testingEnvironment import testSpecs
import os
testVars=tes... | [
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,
7031,
2365,
1367,
838,
25,
1983,
25,
2598,
12131,
198,
198,
31,
9800,
25,
1262,
71,
198,
... | 2.434978 | 223 |