content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
import dash
import dash_bootstrap_components as dbc
import pandas as pd
from dash import html, dcc, State, Input, Output
from components.map_plot import create_map_plot
from components.scatter_plot import create_scatter_plot
from components.bar_plot import create_bar_plot
tsunami_events = pd.read_csv('data/processed/t... | [
11748,
14470,
198,
11748,
14470,
62,
18769,
26418,
62,
5589,
3906,
355,
288,
15630,
198,
11748,
19798,
292,
355,
279,
67,
198,
6738,
14470,
1330,
27711,
11,
288,
535,
11,
1812,
11,
23412,
11,
25235,
198,
6738,
6805,
13,
8899,
62,
2948... | 1.860109 | 4,046 |
import unittest
from lunar.router import Router, RouterException
| [
11748,
555,
715,
395,
198,
198,
6738,
25572,
13,
472,
353,
1330,
48538,
11,
48538,
16922,
628,
628
] | 3.833333 | 18 |
'''from math import trunc
num = float(input('Digite um número real: '))
print('A parte inteira de {} é {}'.format(num, trunc(num)))'''
'''from math import floor
num = float(input('Digite um número: '))
print('A parte inteira de {} é {}'.format(num, floor(num)))'''
num = float(input('Digite um número real: '))
pr... | [
7061,
6,
6738,
10688,
1330,
40122,
201,
198,
22510,
796,
12178,
7,
15414,
10786,
19511,
578,
23781,
299,
21356,
647,
78,
1103,
25,
705,
4008,
201,
198,
4798,
10786,
32,
636,
68,
493,
68,
8704,
390,
23884,
38251,
23884,
4458,
18982,
7,... | 2.6 | 145 |
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the logic inside servo_parsing."""
import copy
import os
import shutil
import socket
import tempfile
import unittest
import client
imp... | [
2,
15069,
13130,
383,
18255,
1505,
7294,
46665,
13,
1439,
2489,
10395,
13,
198,
2,
5765,
286,
428,
2723,
2438,
318,
21825,
416,
257,
347,
10305,
12,
7635,
5964,
326,
460,
307,
198,
2,
1043,
287,
262,
38559,
24290,
2393,
13,
198,
198... | 2.575154 | 4,870 |
# oracle/zxjdbc.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: oracle+zxjdbc
:name: zxJDBC for Jython
:dbapi: zxjdbc
... | [
2,
393,
6008,
14,
42592,
73,
9945,
66,
13,
9078,
198,
2,
15069,
357,
34,
8,
5075,
12,
4626,
262,
16363,
2348,
26599,
7035,
290,
20420,
198,
2,
1279,
3826,
37195,
20673,
2393,
29,
198,
2,
198,
2,
770,
8265,
318,
636,
286,
16363,
... | 2.736739 | 509 |
"""
:class:`~train.State` objects can be used to represent the agent's state. They can be used to save the recent observations seen by agent and process them before passing to the :func:`~train.Agent.act` method. The following example saves last 2 observations (images) after transforming them (crop, scale etc.) and co... | [
37811,
198,
198,
25,
4871,
25,
63,
93,
27432,
13,
9012,
63,
5563,
460,
307,
973,
284,
2380,
262,
5797,
338,
1181,
13,
1119,
460,
307,
973,
284,
3613,
262,
2274,
13050,
1775,
416,
5797,
290,
1429,
606,
878,
6427,
284,
262,
1058,
20... | 2.524479 | 1,920 |
"""
This script shows an example of how to run a simple computational experiment. The research
question is as follows:
What is the value of not moving, ie. not sending a fleet out, but letting your ships build up.
As a first step towards answering this question, we will make two assumptions:
1) Players have... | [
37811,
198,
198,
1212,
4226,
2523,
281,
1672,
286,
703,
284,
1057,
257,
2829,
31350,
6306,
13,
383,
2267,
198,
25652,
318,
355,
5679,
25,
628,
220,
220,
220,
1867,
318,
262,
1988,
286,
407,
3867,
11,
37941,
13,
407,
7216,
257,
11026... | 2.660046 | 1,309 |
# -*- coding: utf-8 -*-
""" Jupyter plotting routine with Plot.ly.
"""
import pandas as pd
import numpy as np
import plotly.graph_objs as go
from .ipw_mixins import *
__all__ = ['plot_step_w_variable_station_filters',
'plot_bar_monthly_w_controls',
'plot_box_w_variable_station_filters',
... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
449,
929,
88,
353,
29353,
8027,
351,
28114,
13,
306,
13,
198,
37811,
198,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
... | 2.294727 | 1,062 |
from __future__ import division
import matplotlib.pyplot as plt
from matplotlib.transforms import BlendedGenericTransform
from mpl_toolkits.axes_grid.axislines import SubplotZero
import numpy as np
SAVEFILE = False
FILNENAME_BASE = 'envelope'
#FILEFORMATS = ('png', 'svg', 'pdf')
FILEFORMAT = 'png'
MULT_SUBPLOTS = Tr... | [
6738,
11593,
37443,
834,
1330,
7297,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
2603,
29487,
8019,
13,
7645,
23914,
1330,
1086,
1631,
46189,
41762,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
897,
274,
6... | 2.157895 | 1,387 |
# python
import csv
# django
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import render, get_object_or_404, redirect
from django.conf import settings
from django.... | [
2,
21015,
198,
11748,
269,
21370,
198,
198,
2,
42625,
14208,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
12501,
273,
2024,
1330,
17594,
62,
35827,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
1... | 2.782468 | 308 |
from .global_options import *
class DeleteSiteUsersParser:
"""
Parser for the command deletesiteusers
"""
@staticmethod
def delete_site_users_parser(manager, command):
"""Method to parse delete site arguments passed by the user"""
manager.include(command)
delete_site_users... | [
6738,
764,
20541,
62,
25811,
1330,
1635,
628,
198,
4871,
23520,
29123,
14490,
46677,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
23042,
263,
329,
262,
3141,
28128,
274,
578,
18417,
198,
220,
220,
220,
37227,
628,
220,
220,
220,... | 2.881944 | 144 |
"""
Dynamic Mode Decomposition for nidmd
"""
from .decomposition import Decomposition
from .timeseries import TimeSeries
__all__ = ['Decomposition', 'TimeSeries']
| [
37811,
198,
44090,
10363,
4280,
296,
9150,
329,
299,
312,
9132,
198,
37811,
198,
6738,
764,
12501,
296,
9150,
1330,
4280,
296,
9150,
198,
6738,
764,
22355,
10640,
1330,
3862,
27996,
198,
198,
834,
439,
834,
796,
37250,
10707,
296,
9150,... | 3.489362 | 47 |
# Generated by Django 4.0 on 2021-12-08 20:46
from django.db import migrations, models
import django.db.models.deletion
| [
2,
2980,
515,
416,
37770,
604,
13,
15,
319,
33448,
12,
1065,
12,
2919,
1160,
25,
3510,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
628
] | 2.904762 | 42 |
from Alames.importer import *
from Alames.dataholder import DataHolder
class PhasorScene(QGraphicsScene):
"""Phasor diagram Scene"""
# Phasor Diagram type: 0 - basic (voltage + current), 1 - power triangle (active, reactive and apparent power)
# Make setters for it in the future instead of settings - *d... | [
6738,
978,
1047,
13,
320,
26634,
1330,
1635,
198,
198,
6738,
978,
1047,
13,
19608,
993,
19892,
1330,
6060,
39,
19892,
628,
198,
4871,
1380,
292,
273,
36542,
7,
48,
18172,
36542,
2599,
198,
220,
220,
220,
37227,
2725,
292,
273,
16362,
... | 2.310478 | 3,369 |
# coding=utf-8
# from korea_news_crawler.articlecrawler import ArticleCrawler
import re
import os
import sys
import argparse
from korea_news_crawler.articlecrawler2 import ArticleCrawler
# TARGET '정치 사회 생활문화 세계 IT과학 오피니언'
TARGET = '경제'
SUB_TARGET = '증권-금융-부동산-산업재계-글로벌경제-경제일반-생활경제-증기벤처'
parser = argparse.ArgumentPars... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
422,
479,
46215,
62,
10827,
62,
66,
39464,
13,
20205,
66,
39464,
1330,
10172,
34,
39464,
198,
11748,
302,
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
6738,
479,
46215,
62,
... | 1.549462 | 930 |
#!/usr/bin/env python
###########################################################
# WARNING: Generated code! #
# ************************** #
# Manual changes may get lost if file is generated again. #
# Only code inside the [MANUAL] tags will be kept. ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
29113,
14468,
7804,
21017,
198,
2,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39410,
25,
2980,
515,
2438,
0,
220,
220,
220,
220,
220,
220,
220,
220,
220,... | 3.106884 | 552 |
# reporter.py
import pandas
import os
import csv
import statistics
import datetime
if __name__ == "__main__":
print("GENERATING SALES REPORT FOR MONTH OF OCTOBER 2013...")
sales_filepath = os.path.join(os.path.dirname(__file__), "data", "sales-201903.csv")
# IMPORT CSV
rows = []
with open(sales_filep... | [
2,
9095,
13,
9078,
198,
11748,
19798,
292,
198,
11748,
28686,
198,
11748,
269,
21370,
198,
11748,
7869,
198,
11748,
4818,
8079,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
3601,
7203,
35353,
... | 2.419521 | 584 |
import argparse
| [
11748,
1822,
29572,
628
] | 4.25 | 4 |
# This is part of the tutorial materials in the UCL Module MPHY0041: Machine Learning in Medical Imaging
# run train_*.py before visualise the results
import os
import numpy as np
import matplotlib.pyplot as plt
PATH_TO_RESULT = 'result'
# to plot example slices of segmentation results
for ext in ["-tf.npy","-pt.np... | [
2,
770,
318,
636,
286,
262,
11808,
5696,
287,
262,
471,
5097,
19937,
4904,
42598,
405,
3901,
25,
10850,
18252,
287,
8366,
48656,
198,
2,
1057,
4512,
62,
24620,
9078,
878,
5874,
786,
262,
2482,
198,
11748,
28686,
198,
198,
11748,
299,
... | 2.280079 | 507 |
from django.forms import ModelForm
from .models import SiteConfig
| [
6738,
42625,
14208,
13,
23914,
1330,
9104,
8479,
198,
198,
6738,
764,
27530,
1330,
14413,
16934,
628
] | 4 | 17 |
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
# ---------------------------------------------------------------------------------
# With a Viewer
# ---------------------------------------------------------------------------------
# DRIVER_PATH = "C:\\Users\\Daniel\\Downloads\\chr... | [
6738,
384,
11925,
1505,
13,
12384,
26230,
13,
46659,
13,
25811,
1330,
18634,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
198,
2,
16529,
1783,
12,
198,
2,
2080,
257,
3582,
263,
198,
2,
16529,
1783,
12,
198,
2,
10560,
38757,
... | 3.599455 | 367 |
import os
import sys
import numexpr
import numpy as np
from scipy.linalg import cholesky, solve_triangular
### Path to JLA likelihood folder (i.e. the folder this file is in)
path_to_data = os.path.dirname(os.path.realpath(sys.argv[0])) + '/likelihoods/JLA/'
### Function loading and reshaping covariance matrices
###... | [
11748,
28686,
198,
11748,
25064,
198,
11748,
997,
31937,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
75,
1292,
70,
1330,
442,
4316,
2584,
11,
8494,
62,
28461,
21413,
198,
198,
21017,
10644,
284,
449,
13534,
14955,
... | 2.639205 | 352 |
import sys
import regex
import cgatcore.iotools as iotools
import pysam
import logging
import argparse
# ########################################################################### #
# ###################### Set up the logging ################################# #
# ######################################################... | [
11748,
25064,
198,
11748,
40364,
198,
11748,
269,
41268,
7295,
13,
5151,
10141,
355,
1312,
313,
10141,
198,
11748,
279,
893,
321,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
198,
2,
1303,
29113,
29113,
7804,
2235,
1303,
198,
2,
130... | 2.729645 | 958 |
#!/usr/bin/env python
import sys
import numpy as np
import math
from numpy import array, zeros, ones, around, unwrap, log10, angle, mean
from scipy.signal import lfilter, freqz, remez
from scipy import signal
import matplotlib.pyplot as plt
from openxcvr import Xcvr
xcvr = Xcvr("/dev/ttyUSB0")
parameters = []
for pa... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
198,
6738,
299,
32152,
1330,
7177,
11,
1976,
27498,
11,
3392,
11,
1088,
11,
7379,
2416,
11,
2604,
940,
11,
984... | 2.595174 | 373 |
import unittest
from ctree.nodes import *
from ctree.jit import LazySpecializedFunction
from ctree.jit import ConcreteSpecializedFunction
from ctree.frontend import dump
from fixtures.sample_asts import *
import ctypes
#@unittest.skip('Removed Support for AST injection')
if __name__ == '__main__':
unitt... | [
11748,
555,
715,
395,
198,
198,
6738,
269,
21048,
13,
77,
4147,
1330,
1635,
198,
6738,
269,
21048,
13,
45051,
1330,
406,
12582,
13409,
1143,
22203,
198,
6738,
269,
21048,
13,
45051,
1330,
1482,
38669,
13409,
1143,
22203,
198,
6738,
269,... | 3.235294 | 102 |
import pytest
from flask import url_for
from api.blueprints.v1.resources.status import Status
| [
11748,
12972,
9288,
198,
6738,
42903,
1330,
19016,
62,
1640,
198,
6738,
40391,
13,
17585,
17190,
13,
85,
16,
13,
37540,
13,
13376,
1330,
12678,
628
] | 3.653846 | 26 |
import random
import torch.nn as nn
import warnings
import torch
import torchvision
import torch.nn.functional as F
from ..util.misc import NestedTensor, match_name_keywords
from .matcher import HungarianMatcher
from typing import List, Dict
from torch import Tensor
ch_dict_en = {
"/64": 256,
"/32": 2048,
"... | [
11748,
4738,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
14601,
198,
11748,
28034,
198,
11748,
28034,
10178,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
11485,
22602,
13,
44374,
1330,
399,
7287,
51,
22854,
... | 2.392086 | 278 |
# Copyright (c) 2006-2009 The Trustees of Indiana University.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without ... | [
2,
15069,
357,
66,
8,
4793,
12,
10531,
383,
9870,
2841,
286,
10278,
2059,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
2,
1439,
2489,
10395,
13,
220,
220,
220,
220,
220,... | 2.114821 | 1,228 |
#!/usr/bin/env python
# __author__ = 'nherbaut'
import requests
import json
import time
import subprocess
import unittest
montebank_uri="http://localhost:2525/imposters"
storage_uri="http://localhost:8082/api/storage"
if __name__ == "__main__":
unittest.main() # run all tests
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
11593,
9800,
834,
796,
705,
77,
372,
65,
2306,
6,
198,
11748,
7007,
198,
11748,
33918,
198,
11748,
640,
198,
11748,
850,
14681,
198,
198,
11748,
555,
715,
395,
198,
198,
2144,
660... | 2.796117 | 103 |
# Copyright (c) 2015-2016 Tigera, Inc. 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 applicabl... | [
2,
15069,
357,
66,
8,
1853,
12,
5304,
17030,
64,
11,
3457,
13,
1439,
2489,
10395,
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,
28... | 3.717647 | 255 |
"""Tests for core."""
import grafanalib.core as G
| [
37811,
51,
3558,
329,
4755,
526,
15931,
198,
198,
11748,
7933,
24408,
282,
571,
13,
7295,
355,
402,
628
] | 2.736842 | 19 |
import numpy
from d3m.metadata import hyperparams
| [
11748,
299,
32152,
198,
198,
6738,
288,
18,
76,
13,
38993,
1330,
8718,
37266,
628
] | 3.466667 | 15 |
import json
import glob
import os
from importlib import util
import torch
| [
11748,
33918,
198,
11748,
15095,
198,
11748,
28686,
198,
6738,
1330,
8019,
1330,
7736,
198,
11748,
28034,
628,
198
] | 4 | 19 |
# Generated by Django 2.2.6 on 2019-11-01 09:04
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
362,
13,
17,
13,
21,
319,
13130,
12,
1157,
12,
486,
7769,
25,
3023,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
# Generated by Django 3.2.8 on 2021-10-14 13:18
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
17,
13,
23,
319,
33448,
12,
940,
12,
1415,
1511,
25,
1507,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
cclass Solution:
# @param {integer[]} nums
# @return {integer}
def maxProduct(self, nums):
n = len(nums)
max_p = nums[0]
cur_max_p = nums[0]
cur_min_p = nums[0]
for i in range(1,n):
pre_max_p = cur_max_p
if pre_max_p*nums[i]<=0:
... | [
535,
31172,
28186,
25,
198,
220,
220,
220,
1303,
2488,
17143,
1391,
41433,
21737,
92,
997,
82,
198,
220,
220,
220,
1303,
2488,
7783,
1391,
41433,
92,
198,
220,
220,
220,
825,
3509,
15667,
7,
944,
11,
997,
82,
2599,
198,
220,
220,
... | 1.58961 | 385 |
# setuptools is required for distutils.commands plugin we use
import logging
import setuptools
__version__ = '0.4.2'
log = logging.getLogger('stdeb')
log.setLevel(logging.INFO)
handler = logging.StreamHandler()
handler.setLevel(logging.INFO)
formatter = logging.Formatter('%(message)s')
handler.setFormatter(formatter)
... | [
2,
900,
37623,
10141,
318,
2672,
329,
1233,
26791,
13,
9503,
1746,
13877,
356,
779,
198,
11748,
18931,
198,
11748,
900,
37623,
10141,
198,
834,
9641,
834,
796,
705,
15,
13,
19,
13,
17,
6,
198,
198,
6404,
796,
18931,
13,
1136,
11187,... | 3.071429 | 112 |
"""SV Classifier server code"""
import asyncio
import logging
import logging.config
import os
import pathlib
from aiohttp import web
import yaml
import async_process_pool
import ai_training as ait
from chat_process import EmbeddingChatProcessWorker
from training_process import EmbedTrainingProcessWorker
from svc_conf... | [
37811,
50,
53,
5016,
7483,
4382,
2438,
37811,
198,
11748,
30351,
952,
198,
11748,
18931,
198,
11748,
18931,
13,
11250,
198,
11748,
28686,
198,
11748,
3108,
8019,
198,
198,
6738,
257,
952,
4023,
1330,
3992,
198,
11748,
331,
43695,
198,
1... | 2.464979 | 1,699 |
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import json
import pandas as pd
# In[2]:
with open("analysis.json", 'r') as f:
prog_dict = json.loads(f.read())
# In[3]:
prog_dict
# In[4]:
# In[5]:
display_fdef_info(prog_dict.get("fdefs"))
# In[6]:
import matplotlib.pyplot as plt
from matplotlib... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
2,
554,
58,
16,
5974,
628,
198,
11748,
33918,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
2,
554,
58,
17,
5974,
628,
198,
4480,
1280... | 2.107209 | 541 |
import plac
import random
from pathlib import Path
import spacy
from tqdm import tqdm
TRAIN_DATA = [
("toscana",{"entities":[(0,7,"SABOR")]}),
("queijo",{"entities":[(0,6,"SABOR")]}),
("calabresa",{"entities":[(0,9,"SABOR")]}),
("pequenas",{"entities":[(0,8,"TAMANHO")]}),
("pequena",{"entities":[(0,7,"TAMANHO")]}),
(... | [
11748,
21957,
198,
11748,
4738,
198,
6738,
3108,
8019,
1330,
10644,
198,
11748,
599,
1590,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
628,
198,
51,
3861,
1268,
62,
26947,
796,
685,
198,
7203,
83,
17500,
2271,
1600,
4895,
298,
87... | 2.159466 | 3,148 |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.4
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# <div style='background-image: url("../../share/images... | [
2,
11420,
198,
2,
474,
929,
88,
353,
25,
198,
2,
220,
220,
474,
929,
88,
5239,
25,
198,
2,
220,
220,
220,
220,
2420,
62,
15603,
341,
25,
198,
2,
220,
220,
220,
220,
220,
220,
7552,
25,
764,
9078,
198,
2,
220,
220,
220,
220,
... | 2.244126 | 3,490 |
"""
Computer Equal Error Rate.
argv[1]: Path of score pairs.
"""
from pathlib import Path
from argparse import ArgumentParser
import joblib
from sklearn.metrics import roc_curve
from scipy.interpolate import interp1d
from scipy.optimize import brentq
def parse_args():
"""Parse command-line arguments."""
... | [
37811,
198,
220,
220,
220,
13851,
28701,
13047,
14806,
13,
198,
220,
220,
220,
1822,
85,
58,
16,
5974,
10644,
286,
4776,
14729,
13,
198,
37811,
198,
6738,
3108,
8019,
1330,
10644,
198,
6738,
1822,
29572,
1330,
45751,
46677,
198,
11748,
... | 2.599042 | 626 |
# coding: utf-8
"""
3Di API
3Di simulation API (latest stable version: v3) Framework release: 2.9.0 3Di core release: 2.2.2 deployed on: 11:01AM (UTC) on January 11, 2022 # noqa: E501
The version of the OpenAPI document: v3
Contact: info@nelen-schuurmans.nl
Generated by: https://openapi-ge... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
37811,
198,
220,
220,
220,
513,
18683,
7824,
628,
220,
220,
220,
513,
18683,
18640,
7824,
357,
42861,
8245,
2196,
25,
410,
18,
8,
220,
220,
25161,
2650,
25,
362,
13,
24,
13,
15,
220,
220... | 2.363979 | 3,187 |
import os,sys
import numpy as np
import pandas as pd
import urllib.request
import fair_utils_data as ut
from random import seed, shuffle
SEED = 1122334455
seed(SEED) # set the random seed so that the random permutations can be reproduced again
np.random.seed(SEED)
"""
The adult dataset can be obtained from: http:... | [
11748,
28686,
11,
17597,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2956,
297,
571,
13,
25927,
198,
11748,
3148,
62,
26791,
62,
7890,
355,
3384,
198,
6738,
4738,
1330,
9403,
11,
36273,
198,
1... | 2.317129 | 2,201 |
#vim: ts=4:sw=4:et
| [
2,
31124,
25,
40379,
28,
19,
25,
2032,
28,
19,
25,
316,
628
] | 1.538462 | 13 |
from pyrsistent import thaw
import pyxdf
import matplotlib.pyplot as plt
import numpy as np
import mne
from scipy.fft import rfft, rfftfreq
import scipy.signal as filter
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
#xdf reader to col... | [
6738,
279,
48489,
7609,
1330,
294,
707,
201,
198,
11748,
12972,
87,
7568,
201,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
285,
710,
201,
198,
6738,
629,
541,... | 2.213636 | 2,200 |
from PIL import Image
filename = input("Enter the name of an image: ")
new_img = Image.open(filename, "r")
pixels = new_img.load()
# TODO: check if message can fit inside the image
message = input("Enter a message:")
alphabets = "abcdefghijklmnopqrstuvwxyz"
bin_message = message_to_binary(message, alphabets)
... | [
6738,
350,
4146,
1330,
7412,
628,
628,
628,
198,
34345,
796,
5128,
7203,
17469,
262,
1438,
286,
281,
2939,
25,
366,
8,
198,
3605,
62,
9600,
796,
7412,
13,
9654,
7,
34345,
11,
366,
81,
4943,
198,
198,
79,
14810,
796,
649,
62,
9600,... | 2.815 | 200 |
from datetime import date, timedelta
from uuid import uuid4
from random import randint
import contextlib
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, Date
from sqlalchemy import create_engine, MetaData
from sqlalchemy.sql import text
from sqlalchemy.orm import... | [
6738,
4818,
8079,
1330,
3128,
11,
28805,
12514,
198,
6738,
334,
27112,
1330,
334,
27112,
19,
198,
6738,
4738,
1330,
43720,
600,
198,
11748,
4732,
8019,
198,
198,
6738,
44161,
282,
26599,
13,
2302,
13,
32446,
283,
876,
1330,
2377,
283,
... | 3.619048 | 105 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
######################################################################################################################
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
220,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
220,
198,
29113,
29113,
29113,
14468,
4242,
2235,
198,
2,
220,
15069,
33448,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
1... | 2.033976 | 1,089 |
#Monica Rizzo, 2018...minor edits by ROS
#
# USAGE
# python util_ConstructBNSMarginalEOSRank.py --composite G298048/production_C00_cleaned_TaylorT4/all.composite --parameter mc --parameter eta --lnL-cutoff 10 --using-eos ap4
import numpy as np
import matplotlib.pyplot as plt
import argparse
#from lalinference.rapid... | [
2,
9069,
3970,
371,
6457,
78,
11,
2864,
986,
1084,
273,
31671,
416,
48263,
198,
2,
198,
2,
1294,
11879,
198,
2,
220,
220,
21015,
7736,
62,
42316,
33,
8035,
36003,
36,
2640,
27520,
13,
9078,
1377,
785,
1930,
578,
402,
1959,
1795,
2... | 2.270747 | 2,663 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pangram import Pangram
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
279,
648,
859,
1330,
350,
648,
859,
628
] | 2.34375 | 32 |
import abc
if __name__ == '__main__':
my_class = MyClass()
my_class.set_val(10)
print(my_class.get_val())
my_class.hello()
#错误使用的例子 | [
11748,
450,
66,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
616,
62,
4871,
796,
2011,
9487,
3419,
628,
220,
220,
220,
616,
62,
4871,
13,
2617,
62,
2100,
7,
940,
8,
198,
220,
... | 1.880952 | 84 |
from construct import Struct, Int16ub, Padding
from .piostring import PioString
Color = Struct(
Padding(4),
"id" / Int16ub,
Padding(2),
"name" / PioString
)
| [
6738,
5678,
1330,
32112,
11,
2558,
1433,
549,
11,
350,
26872,
198,
6738,
764,
14415,
455,
1806,
1330,
350,
952,
10100,
198,
198,
10258,
796,
32112,
7,
198,
220,
350,
26872,
7,
19,
828,
198,
220,
366,
312,
1,
1220,
2558,
1433,
549,
... | 2.634921 | 63 |
from django.contrib.auth.models import User
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from rest_framework.generics import GenericAPIView, get_object_or_404
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framew... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
651,
5239,
62,
75,
12582,
355,
4808,
198,
198,
6738,
1334,
... | 2.934498 | 229 |
import os
import geopandas as gpd
from prereise.gather.const import abv2state
from prereise.utility.shapefile import download_shapefiles
def append_rural_areas_to_urban(states, urban_areas):
"""Takes shapefiles of US States and US urban areas, filters to the
contiguous 48 states, and adds rural areas (areas... | [
11748,
28686,
198,
198,
11748,
30324,
392,
292,
355,
27809,
67,
198,
198,
6738,
662,
260,
786,
13,
70,
1032,
13,
9979,
1330,
450,
85,
17,
5219,
198,
6738,
662,
260,
786,
13,
315,
879,
13,
43358,
7753,
1330,
4321,
62,
43358,
16624,
... | 2.561992 | 984 |
from __future__ import unicode_literals
from django.db import models
| [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
4981,
628
] | 3.55 | 20 |
import pytest
import pymc3 as pm
import pandas as pd
import numpy as np
from damuta import load_sigs
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
@pytest.fixture(scope="session")
| [
11748,
12972,
9288,
220,
198,
11748,
279,
4948,
66,
18,
355,
9114,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
1801,
29822,
1330,
3440,
62,
82,
9235,
198,
198,
31,
9078,
9288,
13,
69,
9602,
7... | 2.77027 | 74 |
from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, PasswordField, BooleanField
from wtforms.validators import DataRequired, Email, Length
| [
6738,
42903,
62,
86,
27110,
1330,
46947,
8479,
198,
6738,
266,
83,
23914,
1330,
10903,
15878,
11,
39900,
15878,
11,
30275,
15878,
11,
41146,
15878,
198,
6738,
266,
83,
23914,
13,
12102,
2024,
1330,
6060,
37374,
11,
9570,
11,
22313,
198
... | 4.02439 | 41 |
"""
All Test-Case required client, url_prefix and token,
and these all we need to just pass as parameters in the function.
"""
import json
from flask_restplus import marshal
from polylogyx.dao import tags_dao, packs_dao, hosts_dao, queries_dao
from polylogyx.models import Tag
from polylogyx.wrappers import tag_wrappe... | [
37811,
198,
3237,
6208,
12,
20448,
2672,
5456,
11,
19016,
62,
40290,
290,
11241,
11,
198,
392,
777,
477,
356,
761,
284,
655,
1208,
355,
10007,
287,
262,
2163,
13,
198,
37811,
198,
198,
11748,
33918,
198,
6738,
42903,
62,
2118,
9541,
... | 2.514991 | 7,538 |
# -*- coding: utf-8 -*-
""" gtorch_utils/nns/managers/callbacks/test/test_plot_tensorboard """
import unittest
from unittest.mock import patch
from gtorch_utils.nns.managers.callbacks.plot_tensorboard import PlotTensorBoard
if __name__ == '__main__':
unittest.main()
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
308,
13165,
354,
62,
26791,
14,
77,
5907,
14,
805,
10321,
14,
13345,
10146,
14,
9288,
14,
9288,
62,
29487,
62,
83,
22854,
3526,
37227,
198,
198,
11748,
555,
715... | 2.555556 | 108 |
# -*- coding: utf-8 -*-
"""
The actual implementation of the SQLAlchemy data layer.
:copyright: (c) 2013 by Andrew Mleczko and Tomasz Jezierski (Tefnet)
:license: BSD, see LICENSE for more details.
"""
from __future__ import unicode_literals
import collections
from copy import copy
import flask_sqlalchem... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
383,
4036,
7822,
286,
262,
16363,
2348,
26599,
1366,
7679,
13,
628,
220,
220,
220,
1058,
22163,
4766,
25,
357,
66,
8,
2211,
416,
6858,
337,
... | 2.218739 | 2,743 |
import torch.nn as nn
class DenoiseCnn(nn.Module):
"""A residual denoising CNN model.
Args:
num_chans (int): Number of channels.
num_layers (int): Number of layers.
magnitude_input (boolean, default=True): Whether input is magnitude
(True, 1-channel) or complex (False, 2-c... | [
11748,
28034,
13,
20471,
355,
299,
77,
628,
198,
4871,
5601,
25678,
34,
20471,
7,
20471,
13,
26796,
2599,
198,
220,
220,
220,
37227,
32,
29598,
2853,
78,
1710,
8100,
2746,
13,
628,
220,
220,
220,
943,
14542,
25,
198,
220,
220,
220,
... | 2.364008 | 489 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as publish... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
201,
198,
2,
201,
198,
2,
317,
5888,
326,
3769,
257,
11361,
7071,
284,
262,
50203,
18579,
7824,
201,
198,
2,
15069,
357,
34,
8,
1853,
12,
5539,
201,
198,
2,
1004,
28092,
36026,
390,
228... | 2.527702 | 1,101 |
from micropy.brokers.rabbitmq import RabbitRpcProducer, RabbitRpcConsumer
| [
6738,
12314,
28338,
13,
7957,
15949,
13,
81,
14229,
76,
80,
1330,
25498,
49,
14751,
11547,
2189,
11,
25498,
49,
14751,
49106,
628,
198
] | 3.166667 | 24 |
from .game import Game
from .players import HumanPlayer,RandomPlayer,AIPlayer | [
6738,
764,
6057,
1330,
3776,
198,
6738,
764,
32399,
1330,
5524,
14140,
11,
29531,
14140,
11,
20185,
14140
] | 4.277778 | 18 |
#!/usr/bin/env python3
# -*- coding: utf-8; -*-
# This is autogenerated python file DO NOT try to edit
unicode_replace = {b'\xf0\x9f\x8c\x83': ':night_with_stars:', b'\xf0\x9f\x99\x8b\xf0\x9f\x8f\xbc\xe2\x99\x80': ':woman_raising_hand_tone2:', b'\xf0\x9f\x93\x81': ':file_folder:', b'\xf0\x9f\x87\xa9': ':regional_indi... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
26,
532,
9,
12,
198,
198,
2,
770,
318,
1960,
519,
877,
515,
21015,
2393,
8410,
5626,
1949,
284,
4370,
198,
198,
46903,
1098,
62,
... | 1.766351 | 157,180 |
from shinymud.lib.db import *
from shinymud.data.config import ROOT_DIR
from shinytest import ShinyTestCase
| [
6738,
22441,
41650,
13,
8019,
13,
9945,
1330,
1635,
198,
6738,
22441,
41650,
13,
7890,
13,
11250,
1330,
15107,
2394,
62,
34720,
198,
6738,
22441,
9288,
1330,
39657,
14402,
20448,
198,
220,
220,
220,
220,
220,
220,
220,
220,
628
] | 2.95 | 40 |
"""Submit the sequence by user and name of the protein is predicted."""
from django.contrib import admin
from django.contrib.admin.checks import BaseModelAdminChecks
from django.contrib.admin.models import LogEntry
from django.contrib.admin.options import get_content_type_for_model
from django.contrib.contenttypes.adm... | [
37811,
45135,
262,
8379,
416,
2836,
290,
1438,
286,
262,
7532,
318,
11001,
526,
15931,
198,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
13169,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
28482,
13,
42116,
1330,
7308,
17633,
46787,
737... | 3.052209 | 498 |
# -*- coding: utf-8 -*-
"""Common exception types for API operations"""
from __future__ import unicode_literals
class MissingCredentialsError(Exception):
"""There are no stored credentials to load"""
pass
class InvalidReferenceError(Exception):
"""The provided reference cannot be dealt with as it is in ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
17227,
6631,
3858,
329,
7824,
4560,
37811,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
628,
198,
4871,
25639,
34,
445,
14817,
12331,
7,
16922,
... | 3.457865 | 356 |
from datetime import timedelta
import os
from typing import Dict, List, Optional, Tuple
from urllib.parse import urlparse
from .base_config import BaseConfig, ConfigError, configfield, Lookup
| [
6738,
4818,
8079,
1330,
28805,
12514,
198,
11748,
28686,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
11,
32233,
11,
309,
29291,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
628,
198,
6738,
764,
8692,
62,
11250,
1330,
7308,
... | 3.666667 | 54 |
from astropy.io import fits
import astropy.units as u
import glob
import numpy as np
import pdb
import os
from pydl.pydlutils.yanny import yanny
from tools import plots, match
import matplotlib
import matplotlib.pyplot as plt
def qlhtml(mjd5,clobber=False) :
""" Make HTML file for a night. Constructs individual ex... | [
6738,
6468,
28338,
13,
952,
1330,
11414,
198,
11748,
6468,
28338,
13,
41667,
355,
334,
198,
11748,
15095,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
279,
9945,
198,
11748,
28686,
198,
6738,
279,
5173,
75,
13,
79,
5173,
75,
26791,
... | 1.902078 | 3,850 |
import statmake.cli
if __name__ == "__main__":
statmake.cli.main()
| [
11748,
1185,
15883,
13,
44506,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1185,
15883,
13,
44506,
13,
12417,
3419,
198
] | 2.482759 | 29 |
from queue import Queue
from k_tree import Node, KTree
def print_level_order(input_tree):
"""
takes in a k-ary tree and returns a string that contains
a listing of all values in the tree, with new lines in-between
each level of the tree
"""
output_lst = []
queue = Queue()
if in... | [
6738,
16834,
1330,
4670,
518,
198,
6738,
479,
62,
21048,
1330,
19081,
11,
509,
27660,
198,
198,
4299,
3601,
62,
5715,
62,
2875,
7,
15414,
62,
21048,
2599,
198,
220,
220,
220,
37227,
220,
198,
220,
220,
220,
2753,
287,
257,
479,
12,
... | 2.101449 | 414 |
from . import reactionMenu
from ..cfg import cfg
from discord import Message, User, Member, Colour
from typing import Union, List
class ReactionSkinRegionPicker(reactionMenu.SingleUserReactionMenu):
"""An unsaveable menu allowing users to choose autoskin layer indices that they want to provide.
"""
def __... | [
6738,
764,
1330,
6317,
23381,
198,
6738,
11485,
37581,
1330,
30218,
70,
198,
6738,
36446,
1330,
16000,
11,
11787,
11,
10239,
11,
38773,
198,
6738,
19720,
1330,
4479,
11,
7343,
628,
198,
4871,
39912,
42455,
47371,
47,
15799,
7,
260,
2673... | 2.210456 | 2,238 |
cities = {'CA' : 'San Francisco', 'MI' : 'Detroit', 'FL' : 'Jacksonville'}
cities['NY'] = 'New York'
cities['OR'] = 'Portland'
cities['_find'] = find_city
while True:
print "State? (ENTER to quit)",
state = raw_input("> ")
if not state: break
#this line is the most important ever! study!
city_found = cities['... | [
66,
871,
796,
1391,
6,
8141,
6,
1058,
705,
15017,
6033,
3256,
705,
8895,
6,
1058,
705,
40404,
3256,
705,
3697,
6,
1058,
705,
31270,
4244,
6,
92,
198,
198,
66,
871,
17816,
12805,
20520,
796,
705,
3791,
1971,
6,
198,
66,
871,
17816,... | 2.696296 | 135 |
import os
import sys
import platform
from setuptools import setup, find_packages
from distutils.core import Extension
setup(name = 'pyg-oms', version = '0.0.1', packages = find_packages(), python_requires = '>=3.7.') | [
11748,
28686,
198,
11748,
25064,
198,
11748,
3859,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
6738,
1233,
26791,
13,
7295,
1330,
27995,
198,
198,
40406,
7,
3672,
796,
705,
9078,
70,
12,
3150,
3256,
2196,
796,
... | 3.287879 | 66 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sacred import Experiment
from sacred.observers import FileStorageObserver
ex = Experiment('train')
ex.observers.append(FileStorageObserver.create('train'))
@ex.config
@ex.capure
@ex.capure
@ex.capure
@ex.automain
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
6738,
13626,
1330,
29544,
198,
6738,
13626,
13,
672,
2655,
690,
1330,
9220,
31425,
31310,
18497,
198,
198,
106... | 2.634615 | 104 |
# Copyright 2019 Regents of the University of Minnesota.
#
# 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 l... | [
2,
15069,
13130,
3310,
658,
286,
262,
2059,
286,
8919,
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,
137... | 2.604423 | 407 |
TREE = "#"
if __name__ == "__main__":
run_tests()
print(run())
| [
51,
11587,
796,
25113,
1,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1057,
62,
41989,
3419,
198,
220,
220,
220,
3601,
7,
5143,
28955,
198
] | 2.108108 | 37 |
"""
Copyright 2014 Rackspace
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
dist... | [
37811,
198,
15269,
1946,
37927,
13200,
198,
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,
13,
198,
1639,
743,
7... | 2.975281 | 445 |
import csv
import numpy as np
import pickle
import random
import tensorflow as tf
from tqdm import trange
from data_generator_rcd import DataGenerator
from maml import MAML
from tensorflow.python.platform import flags
from math import isnan
dataset = tf.data.TFRecordDataset(['train_own.tfrecords'])
| [
11748,
269,
21370,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
11748,
2298,
293,
201,
198,
11748,
4738,
201,
198,
11748,
11192,
273,
11125,
355,
48700,
201,
198,
6738,
256,
80,
36020,
1330,
491,
858,
201,
198,
6738,
1366,
62,
8... | 2.915888 | 107 |
from unittest.mock import create_autospec
from installed_clients.WorkspaceClient import Workspace
from StaticNarrative.exporter.processor_util import build_report_view_data
def test_Report_with_None_direct_link_index_and_truthy_html_links():
'''
Tests the case where a report contains a direct_html_link_index... | [
6738,
555,
715,
395,
13,
76,
735,
1330,
2251,
62,
2306,
418,
43106,
198,
198,
6738,
6589,
62,
565,
2334,
13,
23044,
10223,
11792,
1330,
10933,
10223,
198,
6738,
36125,
45750,
876,
13,
1069,
26634,
13,
41341,
62,
22602,
1330,
1382,
62,... | 2.160121 | 662 |
from troposphere import (
Template,
Ref,
Tags,
Output,
ImportValue,
Export,
Sub,
GetAtt,
Join,
)
from troposphere.ec2 import SecurityGroup, SecurityGroupRule
from troposphere.iam import Role, PolicyType
from troposphere.ecs import Cluster
import troposphere.elasticloadbalancingv2 as ... | [
6738,
14673,
22829,
1330,
357,
198,
220,
220,
220,
37350,
11,
198,
220,
220,
220,
6524,
11,
198,
220,
220,
220,
44789,
11,
198,
220,
220,
220,
25235,
11,
198,
220,
220,
220,
17267,
11395,
11,
198,
220,
220,
220,
36472,
11,
198,
22... | 2.876106 | 113 |
# -*-coding:utf-8 -*-
from config.appconfig import app
from flask import render_template
from flask import request
from flask import redirect
from flask import url_for
from tools.token_generator import generate_token
import os
@app.route("/login",methods=['POST'])
@app.route('/register',methods=['GET'])
@app.ro... | [
2,
532,
9,
12,
66,
7656,
25,
40477,
12,
23,
532,
9,
12,
198,
6738,
4566,
13,
1324,
11250,
1330,
598,
198,
6738,
42903,
1330,
8543,
62,
28243,
198,
6738,
42903,
1330,
2581,
198,
6738,
42903,
1330,
18941,
198,
6738,
42903,
1330,
19016... | 2.95935 | 123 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# __coconut_hash__ = 0xa27177e8
# Compiled with Coconut version 1.4.1 [Ernest Scribbler]
# Coconut Header: -------------------------------------------------------------
from __future__ import print_function, absolute_import, unicode_literals, division
import sys as _coco... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
11593,
66,
420,
16478,
62,
17831,
834,
796,
657,
27865,
1983,
22413,
68,
23,
198,
198,
2,
3082,
3902,
351,
46943,
... | 2.65812 | 2,691 |
# CONSTRUTOR
# GETTERS AND SETTERS
# STR (toString)
| [
198,
220,
220,
220,
1303,
7102,
18601,
3843,
1581,
628,
220,
220,
220,
1303,
17151,
51,
4877,
5357,
25823,
51,
4877,
628,
220,
220,
220,
1303,
19269,
357,
1462,
10100,
8,
198
] | 2.09375 | 32 |
"""
HTTP status codes. see rfc2817
source http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
"""
codes = {
# 1xx: Informational - Request received, continuing process
100: '100 Continue', # [RFC2616]
101: '101 Switching Protocols', # [RFC2616]
102: '102 Processing', # [RFC2518]
# 2x... | [
37811,
198,
40717,
3722,
12416,
13,
766,
374,
16072,
2078,
1558,
198,
10459,
2638,
1378,
2503,
13,
7484,
13,
2398,
14,
562,
570,
902,
14,
4023,
12,
13376,
12,
40148,
14,
4023,
12,
13376,
12,
40148,
13,
87,
6494,
198,
37811,
198,
198... | 2.626587 | 1,339 |
import collections
import pickle
import copy
from time import time
import numpy as np
import torch
from utils import *
from options import get_options
from policy import PolicyEstimator
from problem import generate_problem, load_problem
from perturb import construct_solution
from meta import env_step, should_restart, e... | [
11748,
17268,
198,
11748,
2298,
293,
198,
11748,
4866,
198,
6738,
640,
1330,
640,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
3384,
4487,
1330,
1635,
198,
6738,
3689,
1330,
651,
62,
25811,
198,
6738,
2450,
1330,
78... | 3.319672 | 122 |
# Copyright 2020 Konstruktor, Inc. 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 la... | [
2,
15069,
12131,
17431,
19554,
74,
13165,
11,
3457,
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,
... | 2.02631 | 4,751 |
# ! /user/bin/python
import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
from scapy.layers.inet import *
from scapy.layers.dhcp import *
from scapy.layers.dns import *
# Probing Attack
# inter = idle-time
# Usage: send_udp('10.0.0.3-8', (2000,20000), 100, 0.05)
# Usi... | [
2,
5145,
1220,
7220,
14,
8800,
14,
29412,
198,
198,
11748,
18931,
198,
198,
6404,
2667,
13,
1136,
11187,
1362,
7203,
1416,
12826,
13,
43282,
11074,
2617,
4971,
7,
6404,
2667,
13,
24908,
8,
198,
6738,
629,
12826,
13,
439,
1330,
1635,
... | 2.457237 | 304 |
import json
import time
import math
import random
| [
11748,
33918,
198,
11748,
640,
198,
11748,
10688,
198,
11748,
4738,
198
] | 4.166667 | 12 |
import pytest
coreir = pytest.importorskip("coreir")
from magma import *
from magma.bitutils import seq2int
from mantle.coreir.MUX import DefineMux, DefineCoreirMux, CommonlibMuxN
from magma.simulator.coreir_simulator import CoreIRSimulator
from mantle.common.counter import DefineUpDownCounter, DefineCeilFloorUpDownCou... | [
11748,
12972,
9288,
198,
7295,
343,
796,
12972,
9288,
13,
11748,
669,
74,
541,
7203,
7295,
343,
4943,
198,
6738,
2153,
2611,
1330,
1635,
198,
6738,
2153,
2611,
13,
2545,
26791,
1330,
33756,
17,
600,
198,
6738,
32107,
13,
7295,
343,
13... | 3.150442 | 113 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Unit tests for the SpectrumPolynomial class
"""
import unittest
import numpy as np
import fourgp_speclib
# Run tests if we are run from command line
if __name__ == '__main__':
unittest.main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
26453,
5254,
329,
262,
27217,
34220,
26601,
498,
1398,
198,
37811,
198,
198,
11748,
555,
715,
395,... | 2.709677 | 93 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2
import asyncio
from telethon import events
from telethon.tl.types import ChannelParticipantsAdmins
from userbot.utils import ... | [
2,
770,
8090,
6127,
5178,
318,
2426,
284,
262,
2846,
286,
262,
29258,
5094,
198,
2,
13789,
11,
410,
13,
362,
13,
15,
13,
1002,
257,
4866,
286,
262,
4904,
43,
373,
407,
9387,
351,
428,
198,
2,
2393,
11,
921,
460,
7330,
530,
379,
... | 3.239726 | 146 |
"""
Translator method
"""
import json
import os
from ibm_watson import LanguageTranslatorV3
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
from dotenv import load_dotenv
load_dotenv()
apikey = os.environ['apikey']
url = os.environ['url']
authenticator = IAMAuthenticator(apikey)
language_translator ... | [
37811,
198,
8291,
41880,
2446,
198,
37811,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
24283,
76,
62,
86,
13506,
1330,
15417,
8291,
41880,
53,
18,
198,
6738,
24283,
76,
62,
17721,
62,
21282,
74,
62,
7295,
13,
41299,
44549,
1330,
... | 2.610478 | 439 |
from argparse import ArgumentParser
import torch
from torch import nn
from torch import distributions
from torch.nn import functional as F
#==Only necessary for running modules in place (python ae.py @ ~/../src/models)
# TODO: replace this with more elegant solution
import sys
from pathlib import Path
sys.path.inser... | [
6738,
1822,
29572,
1330,
45751,
46677,
220,
198,
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
1330,
24570,
198,
6738,
28034,
13,
20471,
1330,
10345,
355,
376,
198,
198,
2,
855,
10049,
3306,
329,
2491,
13103,
287,
129... | 2.674214 | 795 |
__author__ = 'ankitchandawala'
| [
834,
9800,
834,
796,
705,
962,
2007,
392,
707,
6081,
6,
198
] | 2.583333 | 12 |
# Generated by Django 1.11.5 on 2017-11-07 13:33
import django.db.models.deletion
from django.db import migrations
from django.db import models
| [
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
20,
319,
2177,
12,
1157,
12,
2998,
1511,
25,
2091,
198,
11748,
42625,
14208,
13,
9945,
13,
27530,
13,
2934,
1616,
295,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
198,
6738,
4262... | 2.959184 | 49 |
from pyblish import api
class CollectInstanceVersion(api.InstancePlugin):
""" Collecting versions of Hiero project into instances
If activated then any subset version is created in
version of the actual project.
"""
order = api.CollectorOrder + 0.011
label = "Collect Instance Version"
| [
6738,
12972,
65,
1836,
1330,
40391,
628,
198,
4871,
9745,
33384,
14815,
7,
15042,
13,
33384,
37233,
2599,
198,
220,
220,
220,
37227,
9745,
278,
6300,
286,
36496,
78,
1628,
656,
10245,
628,
220,
220,
220,
1002,
13906,
788,
597,
24637,
... | 3.568182 | 88 |
import os
import numpy as np
import h5py
from tqdm import tqdm
from torch.utils.data import Dataset
def farthest_point_sample(point, npoint):
"""
Input:
xyz: pointcloud data, [N, D]
npoint: number of samples
Return:
centroids: sampled pointcloud index, [npoint, D]
"""
N, ... | [
11748,
28686,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
289,
20,
9078,
198,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
220,
628,
198,
4299,
15189,
3634,
62,
412... | 2.200557 | 359 |