content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Hive Colony Framework
# Copyright (c) 2008-2020 Hive Solutions Lda.
#
# This file is part of Hive Colony Framework.
#
# Hive Colony Framework is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by the Apach... | [
2,
48443,
14629,
14,
8800,
14,
29412,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
2,
33235,
34480,
25161,
201,
198,
2,
15069,
357,
66,
8,
3648,
12,
42334,
33235,
23555,
406,
6814,
13,
... | 2.472868 | 1,032 |
import socket
| [
11748,
17802,
198
] | 4.666667 | 3 |
"""
Tests for codebook.synthetic_one_hot_codebook method
"""
import numpy as np
import pytest
from starfish.core.types import Axes, Features
from ..codebook import Codebook
def test_synthetic_one_hot_codebook_returns_requested_codebook():
"""
Make a request and verify that the size and shape match the reque... | [
37811,
198,
51,
3558,
329,
2438,
2070,
13,
1837,
429,
6587,
62,
505,
62,
8940,
62,
8189,
2070,
2446,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
198,
6738,
3491,
11084,
13,
7295,
13,
19199,
1330,... | 2.411867 | 573 |
import numpy as np
from kitkopt.bayesian_optimizer import minimize_function
from kitkopt.hyper_parameter import HyperParameter
from kitkopt.kernels import rbf
if (__name__ == '__main__'):
main()
| [
11748,
299,
32152,
355,
45941,
198,
198,
6738,
6220,
74,
8738,
13,
24406,
35610,
62,
40085,
7509,
1330,
17775,
62,
8818,
198,
6738,
6220,
74,
8738,
13,
49229,
62,
17143,
2357,
1330,
15079,
36301,
198,
6738,
6220,
74,
8738,
13,
74,
449... | 3.044776 | 67 |
""" See COPYING for license information """
import swiftst.consts as sc
from swiftst.exceptions import HostListError, ConfigSyncError, DiskSetupError
from fabric.api import *
from fabric.network import *
def generate_hosts_list(dsh_group):
'''
Generates the list of hosts from a dsh group
file and than fe... | [
37811,
4091,
27975,
45761,
329,
5964,
1321,
37227,
198,
198,
11748,
14622,
301,
13,
1102,
6448,
355,
629,
198,
6738,
14622,
301,
13,
1069,
11755,
1330,
14504,
8053,
12331,
11,
17056,
28985,
12331,
11,
31664,
40786,
12331,
198,
6738,
9664,... | 2.023824 | 3,400 |
import asyncio
import uvloop
from botus_receptus import cli
from .bothanasius import Bothanasius
| [
11748,
30351,
952,
198,
11748,
334,
85,
26268,
198,
198,
6738,
10214,
385,
62,
260,
984,
385,
1330,
537,
72,
198,
198,
6738,
764,
16885,
15991,
3754,
1330,
5747,
15991,
3754,
628
] | 3.125 | 32 |
import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
PACKAGE_BINARY = '/usr/local/bin/terraform'
def test_terraform_binary_exists(host):
"""
Tests if terraform binary exists.
"""
... | [
11748,
28686,
198,
198,
11748,
1332,
10745,
430,
13,
26791,
13,
504,
856,
62,
16737,
198,
198,
9288,
10745,
430,
62,
4774,
82,
796,
1332,
10745,
430,
13,
26791,
13,
504,
856,
62,
16737,
13,
2025,
82,
856,
49493,
7,
198,
220,
220,
... | 2.542435 | 271 |
from .basicauthutils import validate_request
from .compat import MiddlewareMixin
from .response import HttpResponseUnauthorized
| [
6738,
764,
12093,
3970,
1071,
26791,
1330,
26571,
62,
25927,
198,
6738,
764,
5589,
265,
1330,
6046,
1574,
35608,
259,
198,
6738,
764,
26209,
1330,
367,
29281,
31077,
52,
2616,
1457,
1143,
628
] | 3.909091 | 33 |
#! /usr/bin/python
from __future__ import print_function
import os
import sys
import time
import random
import string
import subprocess
from collections import defaultdict
from pathlib import Path
from _lib.bootstrapping import from_project_root, from_env_bin
from _lib.params import APP_NAME
from _lib.frontend import... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
640,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
850,
14681,
198,
6738,
17268,
1330,
4277,... | 2.846482 | 469 |
import tensorflow as tf
import numpy as np
from .module import Module
from .parameter import Parameter
class LayerNorm(Module):
"""
PyTorch has `eps` with default 1e-5, while TensorFlow uses 1e-12.
"""
| [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
21412,
1330,
19937,
198,
6738,
764,
17143,
2357,
1330,
25139,
2357,
628,
628,
628,
628,
198,
198,
4871,
34398,
35393,
7,
26796,
2599,
198,
220,
22... | 2.802469 | 81 |
#
# @lc app=leetcode id=2124 lang=python3
#
# [2124] Check if All A's Appears Before All B's
#
# https://leetcode.com/problems/check-if-all-as-appears-before-all-bs/description/
#
# algorithms
# Easy (73.45%)
# Likes: 109
# Dislikes: 1
# Total Accepted: 14.7K
# Total Submissions: 20.1K
# Testcase Example: '"aaab... | [
2,
198,
2,
2488,
44601,
598,
28,
293,
316,
8189,
4686,
28,
17,
17464,
42392,
28,
29412,
18,
198,
2,
198,
2,
685,
17,
17464,
60,
6822,
611,
1439,
317,
338,
31254,
7413,
1439,
347,
338,
198,
2,
198,
2,
3740,
1378,
293,
316,
8189,
... | 2.44898 | 490 |
from django import forms
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from django.utils.translation import ugettext_lazy as _
from django.forms import widgets
from .models import *
class CustomUserCreationForm(forms.ModelForm):
"""
A form that creates a user, with no privileges, from the gi... | [
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
23914,
1330,
4149,
10049,
35215,
26257,
15878,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6... | 2.205442 | 735 |
import unittest
from lasso.pctl import parse, AP, Conjunction, Disjunction, Negation
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
300,
28372,
13,
79,
34168,
1330,
21136,
11,
3486,
11,
37587,
4575,
11,
3167,
73,
4575,
11,
13496,
341,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
555... | 2.755102 | 49 |
# -*- coding: utf-8 -*-
"""OpenCTI CrowdStrike actor bundle builder module."""
import logging
from typing import List, Tuple
from crowdstrike_client.api.models.actor import Actor
from pycti.utils.constants import CustomProperties
from stix2 import (
Bundle,
ExternalReference,
Identity,
IntrusionSet,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
11505,
4177,
40,
29452,
31584,
8674,
18537,
27098,
8265,
526,
15931,
198,
198,
11748,
18931,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
198,
198,
6738,
4315,
330... | 2.46807 | 1,378 |
# -*- coding: utf-8 -*-
import pytest
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
12972,
9288,
198
] | 2.111111 | 18 |
from nlplingo.tasks.common.datapoint import Datapoint | [
6738,
299,
75,
11347,
78,
13,
83,
6791,
13,
11321,
13,
19608,
499,
1563,
1330,
16092,
499,
1563
] | 2.944444 | 18 |
hparams = {'batch_size': 8, # Default: 8
'noise_dim': 256,
'g_dim': 512,
'g_learning_rate': 0.0002, # Default: 0.0002
'g_beta_1': 0.5, # Default: 0.5
'g_beta_2': 0.99, # Default: 0.99
'g_initializer': 'orthogonal',
'd_dim': 512,
'd_... | [
71,
37266,
796,
1391,
6,
43501,
62,
7857,
10354,
807,
11,
1303,
15161,
25,
807,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
3919,
786,
62,
27740,
10354,
17759,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
... | 1.764192 | 458 |
from rlscore.learner import RLS
from housing_data import load_housing
if __name__=="__main__":
train_rls()
| [
6738,
374,
75,
26675,
13,
3238,
1008,
1330,
371,
6561,
198,
198,
6738,
5627,
62,
7890,
1330,
3440,
62,
50028,
628,
198,
361,
11593,
3672,
834,
855,
1,
834,
12417,
834,
1298,
198,
220,
220,
220,
4512,
62,
81,
7278,
3419,
198
] | 2.714286 | 42 |
# Copyright 2019 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, ... | [
2,
15069,
13130,
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,
733... | 2.401026 | 1,364 |
import numpy as np
import scipy.stats as stats
from util import ScipySampler
from dist import Distribution
from stream import RandomStream
| [
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
13,
34242,
355,
9756,
198,
198,
6738,
7736,
1330,
1446,
541,
88,
16305,
20053,
198,
6738,
1233,
1330,
27484,
198,
6738,
4269,
1330,
14534,
12124,
628
] | 3.916667 | 36 |
# -*- coding: utf-8 -*-
# 今日身体抱恙,脑力不足。只能写点不用动脑子的代码了。
import click
import time
# CONTEXT_SETTINGS = dict(token_normalize_func=lambda x: x.lower())
# @click.command(context_settings=CONTEXT_SETTINGS)
@click.command()
@click.option('--eat')
if __name__ == '__main__':
medicine()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
220,
20015,
232,
33768,
98,
164,
118,
104,
19526,
241,
162,
46788,
162,
223,
247,
171,
120,
234,
164,
226,
239,
27950,
249,
38834,
164,
114,
111,
16764,
20998,
103,... | 1.847134 | 157 |
from django.conf.urls import url, include
urlpatterns = [
url(r'^jasmine/', include('djasmine.urls'))
]
| [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
19016,
7,
81,
6,
61,
28121,
3810,
14,
3256,
2291,
10786,
67,
28121,
3810,
13,
6371,
82,
6,
4008,
198,
60,... | 2.422222 | 45 |
from pyramid.response import Response
from ptah.testing import BaseTestCase
| [
6738,
27944,
13,
26209,
1330,
18261,
198,
6738,
42975,
993,
13,
33407,
1330,
7308,
14402,
20448,
628,
198
] | 4.333333 | 18 |
import asyncio
import socket
import struct
import json
import concurrent.futures as futures
import threading
import time
#TODO: Put this file somewhere else...
@asyncio.coroutine
| [
11748,
30351,
952,
198,
11748,
17802,
198,
11748,
2878,
198,
11748,
33918,
198,
11748,
24580,
13,
69,
315,
942,
355,
25650,
198,
11748,
4704,
278,
198,
11748,
640,
198,
198,
2,
51,
3727,
46,
25,
5930,
428,
2393,
7382,
2073,
986,
198,
... | 3.54902 | 51 |
s = 5
print(type(s))
s = convert_to_string(5)
print(s)
print(type(s)) | [
198,
82,
796,
642,
198,
4798,
7,
4906,
7,
82,
4008,
198,
82,
796,
10385,
62,
1462,
62,
8841,
7,
20,
8,
198,
4798,
7,
82,
8,
198,
198,
4798,
7,
4906,
7,
82,
4008
] | 2.028571 | 35 |
import nengo
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
from attractor_dmp_net import make_attrac_net
from direct_dmp_net2 import get_direct_decoders
from constants import *
period = 0.5
sin_per = (2 * np.pi * 10)
seed = 0
pre_dat = target_func(np.linspace(0, period, 100))
xv ... | [
11748,
299,
1516,
78,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
1330,
39555,
378,
198,
198,
6738,
4729,
273,
62,
67,
3149,
62,
3262,
1330,
787,
62,
107... | 2.217163 | 571 |
import os
import csv
import midisw.tonenamedb as tonenamedb
| [
11748,
28686,
198,
11748,
269,
21370,
198,
198,
11748,
3095,
271,
86,
13,
1122,
268,
2434,
65,
355,
5680,
268,
2434,
65,
628
] | 2.695652 | 23 |
import fibonacci
while True:
command = input()
sequence = []
if command.startswith("Create Sequence "):
number = int(command.split()[-1])
sequence = fibonacci.create_sequence(number)
print(' '.join(str(i) for i in sequence))
elif command.startswith("Locate "):
search_num... | [
11748,
12900,
261,
44456,
198,
198,
4514,
6407,
25,
198,
220,
220,
220,
3141,
796,
5128,
3419,
198,
220,
220,
220,
8379,
796,
17635,
198,
220,
220,
220,
611,
3141,
13,
9688,
2032,
342,
7203,
16447,
45835,
366,
2599,
198,
220,
220,
2... | 2.358491 | 265 |
from ipyleaflet import DrawControl
from descarteslabs import workflows as wf
import descarteslabs as dl
| [
6738,
20966,
2349,
1878,
1616,
1330,
15315,
15988,
198,
6738,
1715,
433,
274,
75,
8937,
1330,
670,
44041,
355,
266,
69,
198,
11748,
1715,
433,
274,
75,
8937,
355,
288,
75,
628
] | 3.28125 | 32 |
#
# PySNMP MIB module NETBOTZ-SNMP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NETBOTZ-SNMP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 20:08:46 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar ... | [
2,
198,
2,
9485,
15571,
7378,
337,
9865,
8265,
30502,
33,
2394,
57,
12,
15571,
7378,
12,
8895,
33,
357,
4023,
1378,
16184,
76,
489,
8937,
13,
785,
14,
79,
893,
11632,
8,
198,
2,
7054,
45,
13,
16,
2723,
2393,
1378,
14,
14490,
14,... | 2.534803 | 1,724 |
"""
Copyright (c) 2017, Jairus Martin.
Distributed under the terms of the MIT License.
The full license is in the file LICENSE, distributed with this software.
Created on May 20, 2017
@author: jrm
"""
from atom.api import (
Typed, ForwardTyped, Int, Str, Bool, observe
)
from enaml.core.declarative import d_
f... | [
37811,
198,
15269,
357,
66,
8,
2177,
11,
449,
958,
385,
5780,
13,
198,
198,
20344,
6169,
739,
262,
2846,
286,
262,
17168,
13789,
13,
198,
198,
464,
1336,
5964,
318,
287,
262,
2393,
38559,
24290,
11,
9387,
351,
428,
3788,
13,
198,
... | 3.211896 | 538 |
import os
import sys
sys.path.insert(1, f'{os.path.dirname(os.getcwd())}\\models\\')
import pandas as pd
import requests
from Mapper import df_ISO3_mapper
| [
11748,
28686,
198,
198,
11748,
25064,
198,
198,
17597,
13,
6978,
13,
28463,
7,
16,
11,
277,
6,
90,
418,
13,
6978,
13,
15908,
3672,
7,
418,
13,
1136,
66,
16993,
28955,
92,
6852,
27530,
6852,
11537,
198,
198,
11748,
19798,
292,
355,
... | 2.523077 | 65 |
import torch
import torch.nn as nn
import torchvision
from scipy.spatial import distance_matrix
import numpy as np
from tqdm import tqdm
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
def delta_hyp(dismat):
"""
computes delta hyperbolicity value from distance matrix
"""
p = 0... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
10178,
198,
6738,
629,
541,
88,
13,
2777,
34961,
1330,
5253,
62,
6759,
8609,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36... | 2.455312 | 593 |
from django.urls import path, re_path
from chat.views import ThreadView, InboxView, MessagesView
app_name = 'chat'
urlpatterns = [
path("", MessagesView, name='message'),
path("inbox/", InboxView.as_view(), name='inbox'),
re_path(r"^(?P<username>[\w.@+-]+)/(?P<itemID>\d+)", ThreadView.as_view()),
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
11,
302,
62,
6978,
628,
198,
6738,
8537,
13,
33571,
1330,
14122,
7680,
11,
554,
3524,
7680,
11,
43534,
7680,
198,
198,
1324,
62,
3672,
796,
705,
17006,
6,
198,
6371,
33279,
82,
796,
685,... | 2.480315 | 127 |
import errno
import os
import requests
from pathlib import Path
import torch
import sly_globals as g
import supervisely_lib as sly
from sly_visualize_progress import get_progress_cb, reset_progress, init_progress
from sly_visualize_progress import _update_progress_ui
from functools import partial
local_weights_path... | [
11748,
11454,
3919,
198,
11748,
28686,
198,
11748,
7007,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
28034,
198,
198,
11748,
49822,
62,
4743,
672,
874,
355,
308,
198,
11748,
29745,
786,
306,
62,
8019,
355,
49822,
198,
6738,
498... | 3.098592 | 142 |
"""
Dataset module for managing text datasets.
"""
__author__ = 'victor'
from collections import OrderedDict
import random
import numpy as np
class Dataset(object):
"""
Generic Dataset object that encapsulates a list of instances.
The dataset stores the instances in an ordered dictionary of fields.
... | [
37811,
198,
27354,
292,
316,
8265,
329,
11149,
2420,
40522,
13,
198,
37811,
198,
834,
9800,
834,
796,
705,
32433,
273,
6,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
11748,
4738,
198,
11748,
299,
32152,
355,
45941,
628,
198,
19... | 2.284997 | 3,186 |
# ---
# jupyter:
# jupytext:
# formats: py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.4.2
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# %% [markdown]
# # Interes... | [
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
17519,
25,
12972,
25,
25067,
198,
2,
220,
220,
220,
220,
2420,
62,
15603,
341,
25,
198,
2,
220,
220,
220,
220,
22... | 2.442344 | 3,174 |
import marcotools.schedule
import marcotools.filestools
import marcotools.generaltools
import marcotools.retools
import marcotools.telegrambot
| [
11748,
1667,
25557,
10141,
13,
15952,
5950,
198,
11748,
1667,
25557,
10141,
13,
10379,
395,
10141,
198,
11748,
1667,
25557,
10141,
13,
8612,
2501,
10141,
198,
11748,
1667,
25557,
10141,
13,
1186,
10141,
198,
11748,
1667,
25557,
10141,
13,
... | 3.325581 | 43 |
from django.shortcuts import render, redirect
from my_music_app.demo.forms import CreateAlbumForm, EditAlbumForm, DeleteAlbumForm, CreateProfileForm, \
DeleteProfileForm
from my_music_app.demo.models import Profile, Album
| [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
11,
18941,
198,
198,
6738,
616,
62,
28965,
62,
1324,
13,
9536,
78,
13,
23914,
1330,
13610,
2348,
4435,
8479,
11,
5312,
2348,
4435,
8479,
11,
23520,
2348,
4435,
8479,
11,
13610,
37046,
... | 3.277778 | 72 |
from collections import Counter, defaultdict
names = list(x.split(';')[1] for x in open('UnicodeData.txt') if ';<' not in x)
# a contiguous buffer where each chunk is the same length
# Foo\0BarBaz\0A\0 etc.
# estimate_ngram()
schemes = [
('words ptrie', path_compress_words),
('raw', plain(lambda s: [s])),... | [
6738,
17268,
1330,
15034,
11,
4277,
11600,
198,
14933,
796,
1351,
7,
87,
13,
35312,
10786,
26,
11537,
58,
16,
60,
329,
2124,
287,
1280,
10786,
3118,
291,
1098,
6601,
13,
14116,
11537,
611,
705,
26,
27,
6,
407,
287,
2124,
8,
628,
6... | 2.272085 | 283 |
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="home"),
path(r'signup/', views.signup, name="signup"),
path(r'logout/', views.log_out, name='logout'),
path(r'post/', views.post, name='post')
]
| [
6738,
42625,
14208,
13,
6371,
82,
1330,
3108,
198,
6738,
764,
1330,
5009,
198,
198,
6371,
33279,
82,
796,
685,
198,
220,
220,
220,
3108,
10786,
3256,
5009,
13,
9630,
11,
1438,
2625,
11195,
12340,
198,
220,
220,
220,
3108,
7,
81,
338... | 2.5 | 102 |
# -*- coding: utf-8 -*-
"""
Vault Generic Views
"""
import json
import logging
from django.contrib import messages
from django.views.generic.base import View
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from django.contrib.auth.decorators import login_required
fro... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
53,
1721,
42044,
29978,
198,
37811,
198,
198,
11748,
33918,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
42625,
... | 3.074526 | 738 |
'''Utility functions'''
from .watchman import checkToken
from .crypto import *
from .lrcparser import LrcParser
from .downloader import PoolWorker,DownloadWorker,Downloader | [
7061,
6,
18274,
879,
5499,
7061,
6,
198,
6738,
764,
8340,
805,
1330,
2198,
30642,
198,
6738,
764,
29609,
78,
1330,
1635,
198,
6738,
764,
75,
6015,
48610,
1330,
406,
6015,
46677,
198,
6738,
764,
15002,
263,
1330,
19850,
12468,
263,
11,... | 3.583333 | 48 |
print(get_magic_triangle(5))
| [
198,
198,
4798,
7,
1136,
62,
32707,
62,
28461,
9248,
7,
20,
4008,
198
] | 2.214286 | 14 |
from . import det
from . import dep
from . import adj
from . import meta
from .__wrapper__ import *
| [
6738,
764,
1330,
1062,
198,
6738,
764,
1330,
1207,
198,
6738,
764,
1330,
9224,
198,
6738,
764,
1330,
13634,
198,
6738,
764,
834,
48553,
834,
1330,
1635,
198
] | 3.571429 | 28 |
'''Trains two recurrent neural networks based upon a story and a question.
The resulting merged vector is then queried to answer a range of bAbI tasks.
The results are comparable to those for an LSTM model provided in Weston et al.:
"Towards AI-Complete Question Answering: A Set of Prerequisite Toy Tasks"
http://arxiv... | [
7061,
6,
2898,
1299,
734,
42465,
17019,
7686,
1912,
2402,
257,
1621,
290,
257,
1808,
13,
198,
464,
7186,
23791,
15879,
318,
788,
42517,
798,
284,
3280,
257,
2837,
286,
275,
4826,
40,
8861,
13,
198,
198,
464,
2482,
389,
13975,
284,
8... | 2.453757 | 2,422 |
# -*- coding: utf-8 -*-
from rest_framework import status as http_status
import mock
from nose.tools import * # noqa
from framework.auth import Auth
from tests.base import OsfTestCase, get_default_metaschema
from osf_tests.factories import ProjectFactory
from .. import SHORT_NAME
from .. import settings
from .utils... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
1334,
62,
30604,
1330,
3722,
355,
2638,
62,
13376,
198,
198,
11748,
15290,
198,
6738,
9686,
13,
31391,
1330,
1635,
220,
1303,
645,
20402,
198,
198,
6738,
9355,
13,... | 3.368421 | 114 |
"""
Sparse Eigenvalue Solvers
-------------------------
The submodules of sparse.linalg.eigen:
1. lobpcg: Locally Optimal Block Preconditioned Conjugate Gradient Method
"""
from arpack import *
from lobpcg import *
__all__ = filter(lambda s:not s.startswith('_'),dir())
from numpy.testing import Tester
test = Te... | [
37811,
198,
50,
29572,
412,
9324,
8367,
4294,
690,
198,
22369,
12,
198,
198,
464,
850,
18170,
286,
29877,
13,
75,
1292,
70,
13,
68,
9324,
25,
198,
220,
220,
220,
352,
13,
6804,
14751,
70,
25,
15181,
453,
13123,
4402,
9726,
3771,
3... | 3.114035 | 114 |
import bpy
from . import addon_updater_ops
@addon_updater_ops.make_annotations
class SAT_preferences(bpy.types.AddonPreferences):
"""Valve Armature Toolkit updater preferences"""
bl_idname = __package__
#Updater preferences
auto_check_update : bpy.props.BoolProperty(
name="Auto-check for Update",
description=... | [
11748,
275,
9078,
198,
6738,
764,
1330,
48557,
62,
929,
67,
729,
62,
2840,
198,
198,
31,
48078,
62,
929,
67,
729,
62,
2840,
13,
15883,
62,
34574,
602,
198,
4871,
29020,
62,
3866,
69,
4972,
7,
65,
9078,
13,
19199,
13,
4550,
261,
... | 2.723831 | 449 |
# -*- coding: utf-8 -*-
# Script for verifying the format of a manifest.yaml file that is part of a Door43 Resource Container.
# Should check the following:
# Manifest file does not have a BOM.
# Valid YAML syntax.
# Manifest contains all the required fields.
# conformsto 'rc0.2'
# contributor is a list of at leas... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
2,
12327,
329,
45505,
262,
5794,
286,
257,
10561,
13,
88,
43695,
2393,
326,
318,
636,
286,
257,
19821,
3559,
20857,
43101,
13,
198,
2,
10358,
2198,
262,
1708,
25,... | 3.369732 | 2,088 |
# 2019-11-23 01:28:44(JST)
import sys
if __name__ == '__main__':
main()
| [
2,
13130,
12,
1157,
12,
1954,
5534,
25,
2078,
25,
2598,
7,
41,
2257,
8,
201,
198,
11748,
25064,
201,
198,
201,
198,
201,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
201,
198,
220,
220,
220,
1388,
3419,
201,
198
... | 1.909091 | 44 |
import argparse
import matplotlib as mpl
mpl.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import os
import pandas as pd
from scipy.stats import pearsonr
import seaborn as sns
import sys
from forecast.fitness_model import get_matthews_correlation_coefficient_for_data_frame
if __name__ == "__main__":
... | [
11748,
1822,
29572,
198,
11748,
2603,
29487,
8019,
355,
285,
489,
198,
76,
489,
13,
1904,
7203,
46384,
4943,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28686,
198,
11748... | 2.150246 | 1,624 |
# flake8: noqa
# This file is autogenerated by /metadata-ingestion/scripts/avro_codegen.py
# Do not modify manually!
# fmt: off
from .....schema_classes import CalendarIntervalClass
from .....schema_classes import PartitionSpecClass
from .....schema_classes import TimeWindowClass
from .....schema_classes import TimeW... | [
2,
781,
539,
23,
25,
645,
20402,
198,
198,
2,
770,
2393,
318,
1960,
519,
877,
515,
416,
1220,
38993,
12,
278,
395,
295,
14,
46521,
14,
615,
305,
62,
8189,
5235,
13,
9078,
198,
2,
2141,
407,
13096,
14500,
0,
198,
198,
2,
46996,
... | 3.492857 | 140 |
# --------------------------------------------------------
# Sparse Steerable Convolutions
# Model based on Plain24 for category-level 6D pose estimation
# Written by Jiehong Lin
# --------------------------------------------------------
import numpy as np
import torch
import torch.nn as nn
import ss_co... | [
2,
20368,
22369,
201,
198,
2,
1338,
17208,
2441,
263,
540,
1482,
10396,
3508,
201,
198,
201,
198,
2,
9104,
1912,
319,
28847,
1731,
329,
6536,
12,
5715,
718,
35,
12705,
31850,
201,
198,
2,
22503,
416,
449,
494,
71,
506,
5164,
201,
... | 3.381215 | 181 |
from __future__ import annotations
from lalalang.lexer.token import TokenType, Token
from lalalang.parser.nodes import Node, Statement, Expression
class Program(Node):
"""
This class is the root node of every abstract
syntax tree
"""
@staticmethod
class Identifier(Expression):
"""
This ... | [
6738,
11593,
37443,
834,
1330,
37647,
198,
6738,
300,
282,
282,
648,
13,
2588,
263,
13,
30001,
1330,
29130,
6030,
11,
29130,
198,
6738,
300,
282,
282,
648,
13,
48610,
13,
77,
4147,
1330,
19081,
11,
21983,
11,
41986,
628,
198,
4871,
... | 3.330254 | 866 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-17 10:46
from __future__ import unicode_literals
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,
13,
16,
319,
2177,
12,
2713,
12,
1558,
838,
25,
3510,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.73913 | 69 |
from setuptools import setup
setup(
name='pyXcode',
version='0.1',
description='Xcode Build System Library',
url='https://github.com/samdmarshall/pyXcode',
author='Samantha Marshall',
author_email='me@samdmarshall.com',
license='BSD 3-Clause',
package_data = {
'pyXcode/pyXCConfi... | [
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
9078,
55,
8189,
3256,
198,
220,
220,
220,
2196,
11639,
15,
13,
16,
3256,
198,
220,
220,
220,
6764,
11639,
55,
8189,
10934,
4482,
10074,
3256,
... | 1.852941 | 646 |
__version__ = "1.1.6dev0"
git_version = "unknown"
| [
834,
9641,
834,
796,
366,
16,
13,
16,
13,
21,
7959,
15,
1,
198,
18300,
62,
9641,
796,
366,
34680,
1,
198
] | 2.272727 | 22 |
from tensorflow.core.framework.attr_value_pb2 import AttrValue
import pytest
@pytest.fixture(scope='session')
@pytest.fixture(scope='session')
| [
6738,
11192,
273,
11125,
13,
7295,
13,
30604,
13,
35226,
62,
8367,
62,
40842,
17,
1330,
3460,
81,
11395,
198,
11748,
12972,
9288,
628,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
11639,
29891,
11537,
198,
198,
31,
9078,
9288,
13,
6... | 2.92 | 50 |
import numpy as np
import sys, os
# Get path to mcdc (not necessary if mcdc is installed)
sys.path.append('../../../')
import mcdc
# =============================================================================
# Set materials
# =============================================================================
M = mcdc.... | [
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
11,
28686,
198,
198,
2,
3497,
3108,
284,
285,
10210,
66,
357,
1662,
3306,
611,
285,
10210,
66,
318,
6589,
8,
198,
17597,
13,
6978,
13,
33295,
10786,
40720,
40720,
40720,
11537,
198,
19... | 2.975196 | 766 |
import logging
from datetime import datetime
from usaspending_api.common.exceptions import InvalidParameterException
logger = logging.getLogger(__name__)
def check_types_and_assign_defaults(old_dict, new_dict, defaults_dict):
"""Validates the types of the old_dict, and assigns them to the new_dict"""
for f... | [
11748,
18931,
198,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
514,
5126,
1571,
62,
15042,
13,
11321,
13,
1069,
11755,
1330,
17665,
36301,
16922,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
6... | 2.83247 | 579 |
import socket
np=0
ip="0"
STARTPORT = 1
ENDPORT = 300
ip1 = "8"
ip2 = "8"
ip3 = "8"
ip4 = 8
ALLIPSINRANGE= False #Changes wither scan one ip or range
GUI = True # turns gui on and off if off uses defult values
iplock = ip1 + "." + ip2 + "."+ ip3 + "." + str(ip4)
main()
| [
11748,
17802,
201,
198,
201,
198,
201,
198,
201,
198,
37659,
28,
15,
201,
198,
541,
2625,
15,
1,
201,
198,
2257,
7227,
15490,
796,
352,
201,
198,
1677,
6322,
9863,
796,
5867,
201,
198,
541,
16,
796,
366,
23,
1,
201,
198,
541,
17... | 1.98125 | 160 |
from __future__ import print_function, division
from color_interpolation import color_interpolate_map, color_interpolate_fade_in
from time import sleep
import logging
import datetime
import os
logging.basicConfig(filename="lamp_driver.log", level=logging.INFO, format='%(asctime)s %(message)s')
# TODO: All these confi... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
11,
7297,
198,
6738,
3124,
62,
3849,
16104,
341,
1330,
3124,
62,
3849,
16104,
378,
62,
8899,
11,
3124,
62,
3849,
16104,
378,
62,
69,
671,
62,
259,
198,
6738,
640,
1330,
3993,
198,
11748... | 2.556898 | 1,573 |
from .ValueReducer import ValueReducer
| [
6738,
764,
11395,
7738,
48915,
1330,
11052,
7738,
48915,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198
] | 2.526316 | 19 |
from . import db
from .models import User, Comment, Pitch, Category
#list of all pitches as objects
pitches = Pitch.query.all() | [
6738,
764,
1330,
20613,
198,
6738,
764,
27530,
1330,
11787,
11,
18957,
11,
33517,
11,
21743,
198,
198,
2,
4868,
286,
477,
22421,
355,
5563,
198,
79,
9249,
796,
33517,
13,
22766,
13,
439,
3419
] | 3.657143 | 35 |
import re
from mopidy_spotify import utils
| [
11748,
302,
198,
198,
6738,
285,
404,
19325,
62,
20485,
1958,
1330,
3384,
4487,
628,
198
] | 2.875 | 16 |
from flask_wtf import FlaskForm
from wtforms import PasswordField, StringField, SubmitField
from wtforms.validators import DataRequired, Email, EqualTo, Length
| [
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
266,
83,
23914,
1330,
30275,
15878,
11,
10903,
15878,
11,
39900,
15878,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
6060,
37374,
11,
9570,
11,
28701,
2514,
11,
22313,
628,
... | 3.880952 | 42 |
# 2020.09.08
# Problem Statement:
# https://leetcode.com/problems/simplify-path/
| [
2,
12131,
13,
2931,
13,
2919,
198,
2,
20647,
21983,
25,
198,
2,
3740,
1378,
293,
316,
8189,
13,
785,
14,
1676,
22143,
14,
14323,
489,
1958,
12,
6978,
14,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | 2.162791 | 43 |
#!/usr/bin/python
import os
import sys
import fileinput
import os.path
# Store the contents of brew play template in brew_play_template
# and required packages in brew_packages
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
2393,
15414,
198,
11748,
28686,
13,
6978,
198,
198,
2,
9363,
262,
10154,
286,
9059,
711,
11055,
287,
9059,
62,
1759,
62,
28243,
198,
2,
290,
... | 3.653061 | 49 |
"""
//Running Successfully
import unittest
from PIL import Image
from SyntheticDataset2.ElementsCreator import *
class SpecifiedLetterGeneratorTestCase(unittest.TestCase):
def setUp(self):
self.test_letter_input1 = "I"
self.test_letter_input2 = "N"
self.test_letter_input3 = "F"
se... | [
37811,
198,
1003,
28768,
16282,
2759,
198,
198,
11748,
555,
715,
395,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
26375,
6587,
27354,
292,
316,
17,
13,
36,
3639,
16719,
273,
1330,
1635,
198,
198,
4871,
18291,
1431,
45708,
8645,
1352,
... | 2.278091 | 3,373 |
"""Runs the discord bot"""
from pathlib import Path
from common.cfg import bot
import keys
@bot.listen()
async def on_ready():
"""Bot is now ready to rumble."""
print("Ready to go")
# load extensions from the cogs dir
# .py files in cogs that are not cogs
ignored = [
"cogs.music.buttons",
"cogs.music... | [
37811,
10987,
82,
262,
36446,
10214,
37811,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
2219,
13,
37581,
1330,
10214,
198,
11748,
8251,
628,
198,
31,
13645,
13,
4868,
268,
3419,
198,
292,
13361,
825,
319,
62,
1493,
33529,
198,
220,
... | 2.223819 | 487 |
# Copyright 2015 Lockheed Martin Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | [
2,
15069,
1853,
34238,
5780,
10501,
198,
2,
220,
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,
92... | 3.5875 | 400 |
# copyright Nils Deppe 2019
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
import enum
import numpy as np
use_numba = True
try:
import numba as nb
except:
use_numba = False
@enum.unique
@enum.unique
@enum.unique
@enum.unique
_gamma = None
_numerical_flux = None
_symm... | [
2,
6634,
399,
4487,
1024,
27768,
13130,
198,
2,
357,
6214,
19249,
2393,
38559,
24290,
13,
9132,
393,
4866,
379,
2638,
1378,
39521,
13,
2398,
14,
43,
2149,
24290,
62,
16,
62,
15,
13,
14116,
8,
198,
198,
11748,
33829,
198,
11748,
299,... | 2.094925 | 5,773 |
'''
The included code stub will read an integer, n, from STDIN.
Without using any string methods, try to print the following:
123...n
Note that "..." represents the consecutive values in between.
'''
if __name__ == '__main__':
n = int(input())
for i in range(1, n+1):
print(i, end='')
'''
... | [
7061,
6,
198,
198,
464,
3017,
2438,
17071,
481,
1100,
281,
18253,
11,
299,
11,
422,
48571,
1268,
13,
198,
198,
16249,
1262,
597,
4731,
5050,
11,
1949,
284,
3601,
262,
1708,
25,
628,
220,
220,
220,
17031,
986,
77,
198,
198,
6425,
3... | 2.530864 | 162 |
import logging
from openpyxl import load_workbook
from global_config import *
file_handler = logging.FileHandler(LOG_FILENAME, encoding='utf-8')
stream_handler = logging.StreamHandler()
logging.basicConfig(format=LOG_FORMAT, datefmt=LOG_DATE_FORMAT, level=logging.INFO,
handlers=[file_handler, strea... | [
11748,
18931,
198,
6738,
1280,
9078,
87,
75,
1330,
3440,
62,
1818,
2070,
198,
6738,
3298,
62,
11250,
1330,
1635,
198,
198,
7753,
62,
30281,
796,
18931,
13,
8979,
25060,
7,
25294,
62,
46700,
1677,
10067,
11,
21004,
11639,
40477,
12,
23... | 2.22427 | 651 |
from __future__ import division, print_function, absolute_import
import warnings
from . import _zeros
from numpy import finfo, sign, sqrt
_iter = 100
_xtol = 1e-12
_rtol = finfo(float).eps * 2
__all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth']
CONVERGED = 'converged'
SIGNERR = 'sign error'
CONVERR = 'con... | [
6738,
11593,
37443,
834,
1330,
7297,
11,
3601,
62,
8818,
11,
4112,
62,
11748,
198,
198,
11748,
14601,
198,
198,
6738,
764,
1330,
4808,
9107,
418,
198,
6738,
299,
32152,
1330,
957,
6513,
11,
1051,
11,
19862,
17034,
198,
198,
62,
2676,
... | 2.531519 | 7,091 |
#!/usr/bin/env python
import sys
from argparse import ArgumentParser
from typing import Tuple, Optional
import boto3 as boto3
from aws_assume_role_lib import assume_role
from botocore.exceptions import ClientError
if __name__ == "__main__":
run()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
11748,
25064,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
6738,
19720,
1330,
309,
29291,
11,
32233,
198,
198,
11748,
275,
2069,
18,
355,
275,
2069,
18,
198,
6738,
3253,
82,
62,
56... | 3.108434 | 83 |
import os, ssl, urllib.request
# BEGIN: fix Python or Notebook SSL CERTIFICATE_VERIFY_FAILED
import ssl
if (not os.environ.get('PYTHONHTTPSVERIFY', '') and getattr(ssl, '_create_unverified_context', None)):
ssl._create_default_https_context = ssl._create_unverified_context
# END: fix Python or Notebook SSL CERTIFI... | [
11748,
28686,
11,
264,
6649,
11,
2956,
297,
571,
13,
25927,
198,
198,
2,
347,
43312,
25,
4259,
11361,
393,
5740,
2070,
25952,
327,
17395,
30643,
6158,
62,
5959,
5064,
56,
62,
7708,
4146,
1961,
198,
11748,
264,
6649,
198,
361,
357,
1... | 2.717579 | 347 |
"""
Example 06a: Remote server
===============================================
It might happen that in your specific application of PhenoAI you need to start the
package and load an AInalysis for the prediction of a single data point. If this
happens once that might be fine, but if you need to do this multiple times, t... | [
37811,
198,
16281,
9130,
64,
25,
21520,
4382,
198,
10052,
25609,
18604,
198,
1026,
1244,
1645,
326,
287,
534,
2176,
3586,
286,
34828,
78,
20185,
345,
761,
284,
923,
262,
198,
26495,
290,
3440,
281,
317,
818,
8767,
329,
262,
17724,
286... | 3.641638 | 586 |
# -*- coding:utf-8 -*-
import os
import json
work_dir = os.path.abspath(os.path.join(__file__, '../'))
data_file = os.path.join(work_dir, 'data.json')
with open(data_file, 'r') as fp:
data = json.load(fp)
for _, node in data.items():
node['visit'] = False
for head, node in data.items():
df... | [
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
201,
198,
11748,
28686,
201,
198,
11748,
33918,
201,
198,
201,
198,
1818,
62,
15908,
796,
28686,
13,
6978,
13,
397,
2777,
776,
7,
418,
13,
6978,
13,
22179,
7,
834,
7753,
834,
... | 2.152542 | 177 |
from pymongo import MongoClient, results
class Client:
"""
Class for manipulating MongoDB cluster
"""
def __init__(self, password, db_name: str, collection_name: str):
"""
Initializing client object with access to database
:param password: password to account
:param db_... | [
6738,
279,
4948,
25162,
1330,
42591,
11792,
11,
2482,
628,
198,
4871,
20985,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
5016,
329,
29349,
42591,
11012,
13946,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
825,
11593,
15003,
8... | 2.465632 | 902 |
""" Base setup script for cryptkeeper """
from setuptools import setup
setup(
name = "cryptkeeper",
version = "0.0.1",
description = "Prototype for web scraper in Python",
url = "https://gitlab.hoshogroup.com/cmoncur/cryptkeeper",
author = "Cody Moncur",
author_email = "cmoncur@hoshogroup.com",
classifi... | [
37811,
7308,
9058,
4226,
329,
8194,
13884,
37227,
198,
198,
6738,
900,
37623,
10141,
1330,
9058,
198,
198,
40406,
7,
198,
220,
1438,
796,
366,
29609,
13884,
1600,
198,
220,
2196,
796,
366,
15,
13,
15,
13,
16,
1600,
198,
220,
6764,
7... | 2.479263 | 434 |
import numpy as np
from numpy.random.mtrand import rand
from si4ul import kmeans_si
np.random.seed(0)
N = 4
dim = 2
X = np.random.normal(0, 1, (N, dim))
k = 2
obs_model = kmeans_si.kmeans(X, k)
print(obs_model.labels_)
max_iter = 1000
comp = [0, 1, 0]
random_seed = 1
pci_gene = kmeans_si.pci_gene(X, comp, k, obs_mod... | [
11748,
299,
32152,
355,
45941,
198,
6738,
299,
32152,
13,
25120,
13,
76,
2213,
392,
1330,
43720,
198,
198,
6738,
33721,
19,
377,
1330,
479,
1326,
504,
62,
13396,
198,
198,
37659,
13,
25120,
13,
28826,
7,
15,
8,
198,
45,
796,
604,
... | 2.152091 | 263 |
from json import loads
import os
from pkg_resources import parse_version
import pytest
import platform
from sqlalchemy import __version__ as SA_VERSION
from sqlalchemy import create_engine, MetaData, Column, Integer, bindparam
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_b... | [
6738,
33918,
1330,
15989,
198,
11748,
28686,
198,
6738,
279,
10025,
62,
37540,
1330,
21136,
62,
9641,
198,
11748,
12972,
9288,
198,
11748,
3859,
198,
198,
6738,
44161,
282,
26599,
1330,
11593,
9641,
834,
355,
14719,
62,
43717,
198,
6738,
... | 3.081731 | 416 |
#!/usr/bin/python
import time
import csv
from Adafruit_TCS34725mod import TCS34725
# parameters adjusted for the HF colorimeter by HF
# in adafruit_IC2.py adress was fixed for newer Pis
# Optimized for serial measurements
# ===========================================================================
# Example Code
... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
11748,
640,
198,
11748,
269,
21370,
198,
6738,
1215,
1878,
4872,
62,
4825,
50,
30995,
1495,
4666,
1330,
309,
7902,
30995,
1495,
628,
198,
2,
10007,
12328,
329,
262,
42253,
3124,
16912,
416,
4... | 2.797283 | 957 |
from typing import Dict, Any, TYPE_CHECKING
import orjson
from bson import ObjectId
from pydantic import BaseModel as PydanticBaseModel, Field
ObjectId.__get_validators__ = lambda: [lambda v: ObjectId(v)]
if TYPE_CHECKING:
from pydantic.typing import DictStrAny
| [
6738,
19720,
1330,
360,
713,
11,
4377,
11,
41876,
62,
50084,
2751,
198,
198,
11748,
393,
17752,
198,
6738,
275,
1559,
1330,
9515,
7390,
198,
6738,
279,
5173,
5109,
1330,
7308,
17633,
355,
350,
5173,
5109,
14881,
17633,
11,
7663,
198,
... | 3.05618 | 89 |
from .vqvae import VQ_VAE_codebook_loss, VQ_VAE_ema
from .gvqvae import GVQ_VAE_codebook_loss
from .lightning_wrapper import (
Lightning_VQ_VAE_codebook_loss,
Lightning_VQ_VAE_ema,
Lightning_GVQ_VAE_codebook_loss,
Lightning_Model,
)
from .building_blocks import (
Conv1d_CBnReLU,
Conv2d_CBnReL... | [
6738,
764,
85,
80,
33353,
1330,
569,
48,
62,
11731,
36,
62,
8189,
2070,
62,
22462,
11,
569,
48,
62,
11731,
36,
62,
19687,
198,
6738,
764,
70,
85,
80,
33353,
1330,
402,
53,
48,
62,
11731,
36,
62,
8189,
2070,
62,
22462,
628,
198,
... | 2.136842 | 190 |
import math
from ptt.utils.call_system_command import call_system_command
import pygplates
import numpy as np
def get_rotation_to_equator(point):
"""Get rotation from 'point' to nearest position on equator."""
rotate_from_north_to_point = pygplates.FiniteRotation(pygplates.PointOnSphere.north_pole, poin... | [
11748,
10688,
198,
6738,
279,
926,
13,
26791,
13,
13345,
62,
10057,
62,
21812,
1330,
869,
62,
10057,
62,
21812,
198,
11748,
12972,
70,
17041,
198,
11748,
299,
32152,
355,
45941,
628,
198,
198,
4299,
651,
62,
10599,
341,
62,
1462,
62,
... | 2.516566 | 1,992 |
# https://app.codesignal.com/challenge/jTcYipCF76HyCPDSA
| [
2,
3740,
1378,
1324,
13,
40148,
570,
282,
13,
785,
14,
36747,
3540,
14,
73,
51,
66,
56,
541,
22495,
4304,
21217,
34,
5760,
4090,
198
] | 2.192308 | 26 |
from rest_framework import status
from rest_framework.test import APITestCase
from django.shortcuts import reverse
from social.testing import create_user
| [
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
1334,
62,
30604,
13,
9288,
1330,
3486,
2043,
395,
20448,
198,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
9575,
198,
198,
6738,
1919,
13,
33407,
1330,
2251,
62,
7220,
628
] | 4.025641 | 39 |
import asyncio
from discord.ext import commands
| [
11748,
30351,
952,
198,
6738,
36446,
13,
2302,
1330,
9729,
628
] | 4.454545 | 11 |
"""
Runtime: O(s)
Space: O(s)
Runtime: 28 ms, faster than 71.67% of Python3 online submissions for Valid Parentheses.
Memory Usage: 12.9 MB, less than 100.00% of Python3 online submissions for Valid Parentheses.
"""
| [
198,
198,
37811,
198,
41006,
25,
440,
7,
82,
8,
198,
14106,
25,
440,
7,
82,
8,
198,
198,
41006,
25,
2579,
13845,
11,
5443,
621,
9166,
13,
3134,
4,
286,
11361,
18,
2691,
22129,
329,
48951,
16774,
39815,
13,
198,
30871,
29566,
25,
... | 3.220588 | 68 |
import matplotlib.pyplot as plt
from scipy import stats
x = [1,2,3,4,5,6,7,8,9]
y = [211,586,539,270,217,413,546,351,338]
slope, intercept, r, p, std_err = stats.linregress(x, y)
mymodel = list(map(myfunc, x))
plt.scatter(x, y)
plt.plot(x, mymodel)
plt.show() | [
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
1330,
9756,
198,
198,
87,
796,
685,
16,
11,
17,
11,
18,
11,
19,
11,
20,
11,
21,
11,
22,
11,
23,
11,
24,
60,
198,
88,
796,
685,
21895,
11,
2979... | 2.007634 | 131 |
# coding: utf-8
import math
import numpy as np
from uuid import uuid4
from copy import deepcopy
from atomate.vasp.database import VaspCalcDb
from atomate.utils.utils import env_chk
from dfttk.utils import sort_x_by_y, mark_adopted, consistent_check_db, check_relax_path
from itertools import combinations
from... | [
2,
19617,
25,
3384,
69,
12,
23,
201,
198,
201,
198,
11748,
10688,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
201,
198,
6738,
4866,
1330,
2769,
30073,
201,
198,
6738,
22037,
378,
13,
85... | 1.969744 | 16,195 |
# bot.py
import os # for importing env vars for the bot to use
from dotenv import load_dotenv
from twitchio.ext import commands
load_dotenv()
bot = Bot()
bot.run()
| [
2,
10214,
13,
9078,
198,
11748,
28686,
220,
1303,
329,
33332,
17365,
410,
945,
329,
262,
10214,
284,
779,
198,
198,
6738,
16605,
24330,
1330,
3440,
62,
26518,
24330,
198,
6738,
37366,
952,
13,
2302,
1330,
9729,
198,
198,
2220,
62,
265... | 3.017857 | 56 |
from torch import nn
from .MDRS_backbone import MDRSBackbone
from .MDRS_pool import MDRSPool
from .MDRS_reduction import MDRSReduction
from .MDRS_classifier import MDRSClassifier
from .MDRS_multi_seg import MDRSMultiSeg
| [
6738,
28034,
1330,
299,
77,
198,
6738,
764,
12740,
6998,
62,
1891,
15992,
1330,
10670,
6998,
7282,
15992,
198,
6738,
764,
12740,
6998,
62,
7742,
1330,
337,
7707,
4303,
970,
198,
6738,
764,
12740,
6998,
62,
445,
8110,
1330,
10670,
6998,
... | 3.069444 | 72 |
# Copyright 2022 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
33160,
3012,
11419,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,... | 3.547325 | 243 |
import gramaticaAscendente as g
#import gramaticaAscendente as gr
import re
import reportes as h
import TablaDeSimbolos as TS
from queries import *
from math import *
import storageManager.jsonMode as store
import reportes as h
# -------------------------------------------------------------------------------------... | [
11748,
14599,
1512,
64,
32,
1416,
437,
21872,
355,
308,
198,
2,
11748,
14599,
1512,
64,
32,
1416,
437,
21872,
355,
1036,
198,
11748,
302,
198,
11748,
989,
274,
355,
289,
198,
11748,
16904,
5031,
5005,
8890,
28984,
418,
355,
26136,
198... | 4.387755 | 147 |
# coding: utf-8
"""
metal-api
API to manage and control plane resources like machines, switches, operating system images, machine sizes, networks, IP addresses and more # noqa: E501
OpenAPI spec version: v0.15.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprin... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
6147,
12,
15042,
628,
220,
220,
220,
7824,
284,
6687,
290,
1630,
6614,
4133,
588,
8217,
11,
18225,
11,
5361,
1080,
4263,
11,
4572,
10620,
11,
7686,
11,
6101,
940... | 2.273043 | 4,318 |
from django.db import models
import uuid
from django.contrib.auth.models import (
BaseUserManager, AbstractBaseUser,User
)
from django.conf import settings
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
11748,
334,
27112,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
357,
198,
220,
220,
220,
7308,
12982,
13511,
11,
27741,
14881,
12982,
11,
12982,
198,
8,
198,
6738,
... | 3.333333 | 48 |