content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
# -*- coding: utf-8 -*-
import os
import time
import unittest
import shutil
from configparser import ConfigParser
from snp2gene.snp2geneImpl import snp2gene
from snp2gene.snp2geneServer import MethodContext
from snp2gene.authclient import KBaseAuth as _KBaseAuth
from installed_clients.WorkspaceClient import Workspace... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
640,
198,
11748,
555,
715,
395,
198,
11748,
4423,
346,
198,
6738,
4566,
48610,
1330,
17056,
46677,
198,
198,
6738,
3013,
79,
17,
70,
1734,
13,
... | 2.806723 | 119 |
import torch
from collections import OrderedDict
from torch.autograd import Variable
from .base_model import BaseModel
from . import networks
from .vgg16 import Vgg16
from utils.SSIM import SSIM
# It is quite convinient, as one forward-pass, all the innerCos will get the GT_latent!
| [
11748,
28034,
198,
6738,
17268,
1330,
14230,
1068,
35,
713,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
198,
6738,
764,
8692,
62,
19849,
1330,
7308,
17633,
198,
6738,
764,
1330,
7686,
198,
6738,
764,
85,
1130,
1433,
1330,
... | 3.440476 | 84 |
from pymongo import MongoClient
from pubnub import Pubnub
import logging
import datetime
if __name__ == '__main__':
client = MongoClient('mongodb://admin:admin@ds011268.mlab.com:11268/analytics-hydrobase')
db = client['analytics-hydrobase']
#initialize the pubnub instance
pubnub = Pubnub(publish_key='pub-c-9... | [
6738,
279,
4948,
25162,
1330,
42591,
11792,
198,
6738,
2240,
77,
549,
1330,
8525,
77,
549,
198,
11748,
18931,
198,
11748,
197,
19608,
8079,
628,
197,
197,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
628,
197,
1... | 2.470862 | 429 |
import argparse
import cairo
import os
import qrcode
import array
# image is white over alpha
def draw_image(ctx, image, top, left, height, width,blackize=False):
"""Draw a scaled image on a given context."""
if type(image) is str:
image_surface = cairo.ImageSurface.create_from_png(image)
else:
... | [
11748,
1822,
29572,
198,
11748,
1275,
7058,
198,
11748,
28686,
220,
198,
11748,
10662,
6015,
1098,
220,
198,
11748,
7177,
198,
198,
2,
2939,
318,
2330,
625,
17130,
198,
4299,
3197,
62,
9060,
7,
49464,
11,
2939,
11,
1353,
11,
1364,
11,... | 2.278802 | 434 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @Author : 陈坤泽
# @Email : 877362867@qq.com
# @Date : 2021/02/22 10:29
""" 对icdar2013的三种测评方法的接口封装
官方原版处理两个 zip 文件,这里扩展支持目录、内存对象
"""
import re
from pyxllib.xl import File, Dir, shorten
class IcdarEval:
"""
>>> gt = {'1.abc': [[158, 128, 411, 181], [443, 128... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
1058,
16268,
247,
230,
161,
251,
97,
37345,
121,
198,
2,
2488,
15333,
220,
1058,
807,
3324,
2623,... | 1.020528 | 1,705 |
from django.forms import ModelForm, DateInput, CharField, Select, ChoiceField
from django.utils.translation import ugettext_lazy as _
from sodp.reports.models import report
from sodp.views.models import view
from bootstrap_datepicker_plus import DatePickerInput
from pprint import pprint
from sodp.utils import google_... | [
6738,
42625,
14208,
13,
23914,
1330,
9104,
8479,
11,
7536,
20560,
11,
3178,
15878,
11,
9683,
11,
18502,
15878,
198,
6738,
42625,
14208,
13,
26791,
13,
41519,
1330,
334,
1136,
5239,
62,
75,
12582,
355,
4808,
198,
6738,
32581,
79,
13,
4... | 3.652482 | 141 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Check if pickle can serialize seabird's data objects
"""
import os.path
from glob import glob
import pickle
from seabird.cnv import fCNV
from seabird.utils import seabird_dir
def test_serialize_fCNV():
""" Serialize fCNV
"""
datafiles = glo... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
6822,
611,
2298,
293,
460,
11389,
1096,
384,
397,
1447,
338,
1366,
5563,
198,
198,
37811,
198,
198,
11748,
... | 2.306931 | 303 |
import torch as th
from fastatomography.fasta_tomo_custom import fasta
from fastatomography.util import shrink_nonnegative
from fastatomography.util import *
| [
11748,
28034,
355,
294,
198,
6738,
3049,
37696,
4867,
13,
7217,
64,
62,
83,
17902,
62,
23144,
1330,
3049,
64,
198,
6738,
3049,
37696,
4867,
13,
22602,
1330,
22085,
62,
13159,
31591,
198,
6738,
3049,
37696,
4867,
13,
22602,
1330,
1635,
... | 3.785714 | 42 |
"""
Created by Jan Schiffeler on 04.02.21
jan.schiffeler[at]gmail.com
Test a deeplabV3+ ResNet network on the boulder data set
For single GPU only!
Changed by
Python 3.7
Library version:
mmcv: 0.10.0
"""
import torch
import numpy as np
from mmcv import Config
from mmseg.datasets import build_dataset, build_d... | [
37811,
198,
41972,
416,
2365,
41665,
417,
263,
319,
8702,
13,
2999,
13,
2481,
198,
13881,
13,
20601,
733,
417,
263,
58,
265,
60,
14816,
13,
785,
198,
198,
14402,
257,
390,
68,
489,
397,
53,
18,
10,
1874,
7934,
3127,
319,
262,
4648... | 2.270686 | 1,559 |
from .signing import sign, unsign
| [
6738,
764,
12683,
278,
1330,
1051,
11,
5576,
570,
628
] | 3.5 | 10 |
from kernel_exp_family.estimators.finite.gaussian import KernelExpFiniteGaussian
from kernel_exp_family.examples.demo_simple import ground_truth
from kernel_exp_family.examples.tools import pdf_grid, visualise_array
import matplotlib.pyplot as plt
import numpy as np
if __name__ == '__main__':
"""
Simple examp... | [
6738,
9720,
62,
11201,
62,
17989,
13,
395,
320,
2024,
13,
69,
9504,
13,
4908,
31562,
1330,
32169,
16870,
37,
9504,
35389,
31562,
198,
6738,
9720,
62,
11201,
62,
17989,
13,
1069,
12629,
13,
9536,
78,
62,
36439,
1330,
2323,
62,
35310,
... | 2.316249 | 917 |
from __future__ import print_function
import numpy as np
from . import interpolation
def smooth(data, smooth, smoothtype='gaussian', downsample=True,
downsample_factor=None, convmode='same'):
"""
Smooth and downsample the data array. NaN data points will be replaced
with interpolated values
... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
1330,
39555,
341,
198,
198,
4299,
7209,
7,
7890,
11,
7209,
11,
7209,
4906,
11639,
4908,
31562,
3256,
21838,
1403,
28,
17821,
11,
198,
2... | 2.372534 | 1,267 |
import tensorflow as tf
import matplotlib. pyplot as plt
import numpy as np
boston_housing = tf.keras.datasets.boston_housing
(train_x, train_y), (_,_) = boston_housing.load_data(test_split=0)
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus']=False
titles = ["CRIM", "ZN", "INDUS", "... | [
11748,
11192,
273,
11125,
355,
48700,
201,
198,
11748,
2603,
29487,
8019,
13,
12972,
29487,
355,
458,
83,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
65,
5744,
62,
50028,
796,
48700,
13,
6122,
292,
13,
19608,
292,
1039,
13,
65,... | 1.954198 | 524 |
import undetected_chromedriver as uc
import time
from random import randrange
import json
with open('./credentials.json', 'r') as f:
data = json.load(f)
driver = uc.Chrome()
wait_random_time(1)
driver.get('https://www.linkedin.com/login')
wait_random_time(3)
driver.find_element_by_id('username').send_keys(dat... | [
11748,
40615,
11197,
62,
28663,
276,
38291,
355,
334,
66,
198,
11748,
640,
198,
6738,
4738,
1330,
43720,
9521,
198,
11748,
33918,
628,
198,
198,
4480,
1280,
7,
4458,
14,
66,
445,
14817,
13,
17752,
3256,
705,
81,
11537,
355,
277,
25,
... | 2.102415 | 1,035 |
from setuptools import (
setup,
find_packages,
)
setup(
name='zidx',
version='0.0.2',
description='Implementation of secure indexing scheme by Goh',
long_description=readme(),
author='Christian Burkert',
url='https://github.com/cburkert/zidx',
packages=find_packages(),
install... | [
6738,
900,
37623,
10141,
1330,
357,
198,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
1064,
62,
43789,
11,
198,
8,
628,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
11639,
89,
312,
87,
3256,
198,
220,
220,
220,
2196,
11639,
15,
... | 2.479452 | 146 |
import os
from cors import crossdomain
from flask import Flask, jsonify, request, send_from_directory
import click
from train import complete
from train import get_model
import numpy as np
app = Flask(__name__, static_folder='../ui/build', )
models = {x: get_model(x) for x in read_models()}
@app.route("/predict... | [
11748,
28686,
198,
6738,
269,
669,
1330,
3272,
27830,
198,
6738,
42903,
1330,
46947,
11,
33918,
1958,
11,
2581,
11,
3758,
62,
6738,
62,
34945,
198,
11748,
3904,
198,
198,
6738,
4512,
1330,
1844,
198,
6738,
4512,
1330,
651,
62,
19849,
... | 2.564767 | 386 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | [
2,
532,
9,
12,
21004,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
29113,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
220,
220,
220,
4946,
1137,
47,
11,
4946,
8090,
8549,
28186,
198,
2,
220,
220,
220,
15069,
357,
34,
8,
5472,
12,
51,
... | 3.42638 | 326 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import random
import queue
from flask import Flask, request, session, render_template, json, redirect
from machine import MachineControl
import appconfig
app = Flask(__name__)
app.rooms = {}
@app.route('/')
@app.route('/start_new', methods=['POST'])
@app.route('/join', me... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
4738,
198,
11748,
16834,
198,
6738,
42903,
1330,
46947,
11,
2581,
11,
6246,
11,
8543,
62,
28243,
11,
33918,
11,
... | 2.59322 | 236 |
import aiohttp
import discord
from discord.ext import commands
from mysqldb import *
import asyncio
from extra.useful_variables import list_of_commands
from extra.prompt.menu import Confirm
from extra.view import ReportSupportView
from typing import List, Optional
import os
from extra import utils
case_cat_id = int(os... | [
11748,
257,
952,
4023,
198,
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
6738,
616,
31166,
335,
65,
1330,
1635,
198,
11748,
30351,
952,
198,
6738,
3131,
13,
1904,
913,
62,
25641,
2977,
1330,
1351,
62,
1659,
62,
9503,
174... | 2.372906 | 9,611 |
# Copyright (c) Open-MMLab. All rights reserved.
import functools
import os
import subprocess
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
| [
2,
15069,
357,
66,
8,
4946,
12,
44,
5805,
397,
13,
1439,
2489,
10395,
13,
198,
11748,
1257,
310,
10141,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
198,
11748,
28034,
198,
11748,
28034,
13,
17080,
6169,
355,
1233,
198,
11748,
2803... | 3.415094 | 53 |
# Generated by Django 3.1.1 on 2020-09-24 10:11
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
13,
16,
319,
12131,
12,
2931,
12,
1731,
838,
25,
1157,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.84375 | 32 |
#!/usr/bin/env python
import sys
sys.path.append("../components")
import board
from cat_enums import AnimalClass
import d_const
import os
import random
import types
class Game(object):
"""Contains all the game players, elements, etc.
"""
class Player(object):
"""Matches a player to their animal class
"""
# ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
25064,
198,
17597,
13,
6978,
13,
33295,
7203,
40720,
5589,
3906,
4943,
198,
198,
11748,
3096,
198,
6738,
3797,
62,
268,
5700,
1330,
13792,
9487,
198,
11748,
288,
62,
9979,
... | 3.025641 | 117 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | [
2,
198,
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
5115,
6634,
9238,
13,
220,
... | 3.829268 | 246 |
# -*- coding: utf-8 -*-
import logging
import random
import fpv
import persist
logger = logging.getLogger(__name__)
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
18931,
198,
11748,
4738,
198,
11748,
277,
79,
85,
198,
11748,
21160,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628
] | 2.704545 | 44 |
from PIL import Image
import numpy as np
import cv2
import torch
from torch.autograd import Variable
import os
from .models import net
import sys
sys.path.append('../')
sys.path.append('.')
folder = os.path.dirname(os.path.abspath(__file__))
# Pre-processing and post-processing constants #
CMAP = np.load(os.path.join... | [
6738,
350,
4146,
1330,
7412,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
11748,
28034,
198,
6738,
28034,
13,
2306,
519,
6335,
1330,
35748,
198,
11748,
28686,
198,
6738,
764,
27530,
1330,
2010,
198,
11748,
25064,
19... | 2.488462 | 260 |
USER="SERVERUSER"
PASS="SERVERPASS"
IP="SERVERIP"
REMOTE="SERVERLOCATION"
EMAIL="EMAIL"
EPASS="EMAILPASS"
| [
29904,
2625,
35009,
5959,
29904,
1,
198,
47924,
2625,
35009,
5959,
47924,
1,
198,
198,
4061,
2625,
35009,
5959,
4061,
1,
198,
40726,
23051,
2625,
35009,
5959,
29701,
6234,
1,
198,
198,
27630,
4146,
2625,
27630,
4146,
1,
198,
8905,
10705... | 2.297872 | 47 |
from webfront.models import Entry
from webfront.tests.InterproRESTTestCase import InterproRESTTestCase
from rest_framework import status
from webfront.views.common import map_url_to_levels
| [
6738,
3992,
8534,
13,
27530,
1330,
21617,
198,
6738,
3992,
8534,
13,
41989,
13,
9492,
1676,
49,
6465,
14402,
20448,
1330,
4225,
1676,
49,
6465,
14402,
20448,
198,
6738,
1334,
62,
30604,
1330,
3722,
198,
6738,
3992,
8534,
13,
33571,
13,
... | 3.673077 | 52 |
from math import trunc
num = float(input('Digite um número qualquer: '))
print('A parte inteira do numero digitado é {}'.format(trunc(num)))
| [
6738,
10688,
1330,
40122,
198,
22510,
796,
12178,
7,
15414,
10786,
19511,
578,
23781,
299,
21356,
647,
78,
4140,
10819,
25,
705,
4008,
198,
4798,
10786,
32,
636,
68,
493,
68,
8704,
466,
997,
3529,
16839,
4533,
38251,
23884,
4458,
18982,... | 2.9375 | 48 |
import unittest
import PythonExtras.patching_tools as patching_tools
| [
11748,
555,
715,
395,
198,
198,
11748,
11361,
11627,
8847,
13,
17147,
278,
62,
31391,
355,
8529,
278,
62,
31391,
628,
198
] | 3.272727 | 22 |
"""
Faça um programa que leia o ano de nascimento de um jovem e informe, de acordo com sua idade:
- Se ele ainda vai se alistar ao serviço militar.
- Se é a hora de se alistar.
- Se já passou o tempo do alistamento.
Seu programa também deverá mostrar o tempo que falta ou que passou do prazo.
"""
... | [
37811,
628,
220,
220,
220,
18350,
50041,
23781,
1430,
64,
8358,
443,
544,
267,
281,
78,
390,
299,
3372,
3681,
78,
390,
23781,
474,
659,
76,
304,
4175,
68,
11,
390,
936,
585,
78,
401,
424,
64,
4686,
671,
25,
198,
220,
220,
220,
5... | 2.183794 | 506 |
import tempfile
import subprocess
import shutil
import yaml
import os
from nose.tools import *
import scruffy
from scruffy import Environment, ConfigFile, Directory
from scruffy.plugin import PluginManager
| [
11748,
20218,
7753,
198,
11748,
850,
14681,
198,
11748,
4423,
346,
198,
11748,
331,
43695,
198,
11748,
28686,
198,
198,
6738,
9686,
13,
31391,
1330,
1635,
198,
198,
11748,
629,
30622,
88,
198,
6738,
629,
30622,
88,
1330,
9344,
11,
17056... | 3.8 | 55 |
from datetime import datetime
from domain.Registration.registration import Registration
| [
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
7386,
13,
47133,
13,
2301,
33397,
1330,
24610,
628
] | 5 | 18 |
import os
| [
11748,
28686,
628,
198
] | 3 | 4 |
# Databricks notebook source
VZGOESRRJNJPMUYHEQBJFWKKCZZHJXW
FYHANLZOGWDXNRCXBNBJYEFJU
BCRJONWTPJSPTSZSUCHAMLUQBLOZDHAKVHSKYZEGNROIHNKOXUUENQRMKSYYKUQHFDEBQPEMFBCZLEBKDCWWXHZTREYKQOWZSLQXCMDVQQIGLAUBFXVVFKJCPMD
ODMKLURRTLMKGIYJVSMDCAWLZYBAMECOUQIN
RLJIGUFUKCEGCWKFTCYOFNPDBBQBKDZIZNPXFUSIKDTALSTYPCD
# COMMAND ---------... | [
2,
16092,
397,
23706,
20922,
2723,
198,
53,
57,
11230,
1546,
21095,
41,
41074,
5868,
52,
56,
13909,
40291,
41,
24160,
16601,
34,
30148,
39,
41,
55,
54,
198,
43833,
39,
1565,
43,
57,
7730,
22332,
55,
45,
7397,
55,
15766,
33,
41,
56... | 1.532553 | 1,966 |
# uninhm
# https://atcoder.jp/contests/abc179/tasks/abc179_b
# implementation
n = int(input())
count = 0
for _ in range(n):
a, b = input().split()
if a == b:
count += 1
else:
count = 0
if count == 3:
print("Yes")
quit()
print("No")
| [
2,
26329,
23940,
198,
2,
3740,
1378,
265,
66,
12342,
13,
34523,
14,
3642,
3558,
14,
39305,
21738,
14,
83,
6791,
14,
39305,
21738,
62,
65,
198,
2,
7822,
198,
198,
77,
796,
493,
7,
15414,
28955,
198,
198,
9127,
796,
657,
198,
1640,
... | 2.065693 | 137 |
# -*- coding: utf-8 -*-
from django import template
from django.conf import settings
register = template.Library()
@register.simple_tag
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
42625,
14208,
1330,
11055,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
198,
30238,
796,
11055,
13,
23377,
3419,
198,
198,
31,
30238,
13,
36439,
62,
12985,
... | 3.136364 | 44 |
import pyodbc
import textwrap
# Define the Price Data.
price_data = [
[ 2.00, 3.00, 1.00, 2.40, 100.00, '1/2/2019'],
[ 3.00, 3.00, 5.00, 9.40, 300.00, '2/1/2020'],
[ 4.00, 2.00, 1.00, 2.40, 200.00, '3/1/2021']
]
# define the server and the database
server = 'DESKTOP-MOA8O6M\SQLEXPRESS'
database = 'stock_... | [
11748,
12972,
375,
15630,
198,
11748,
2420,
37150,
198,
198,
2,
2896,
500,
262,
7886,
6060,
13,
198,
20888,
62,
7890,
796,
685,
198,
220,
220,
220,
685,
362,
13,
405,
11,
513,
13,
405,
11,
352,
13,
405,
11,
362,
13,
1821,
11,
18... | 2.371324 | 544 |
# coding=utf-8
'''
https://alex-d.github.io/Trumbowyg/documentation.html
'''
from django.forms.widgets import Textarea
from django.utils.safestring import mark_safe
from django.utils import translation
from django.conf import settings
from django.utils.six.moves.urllib.parse import urljoin
from json import dumps
| [
2,
19617,
28,
40477,
12,
23,
198,
7061,
6,
198,
5450,
1378,
1000,
87,
12,
67,
13,
12567,
13,
952,
14,
2898,
2178,
322,
35641,
14,
22897,
341,
13,
6494,
198,
7061,
6,
198,
198,
6738,
42625,
14208,
13,
23914,
13,
28029,
11407,
1330,... | 3.07767 | 103 |
#-----------------------------------------------------------------------------
# Name: orbitTableGenerator.py
# Purpose: Generate orbit table pickle.
#
# Author: Gerald Manipon
#
# Created: Fri Apr 14 10:12:36 2006
# Copyright: (c) 2006, California Institute of Technology.
# U.S. Gove... | [
2,
10097,
32501,
198,
2,
6530,
25,
220,
220,
220,
220,
220,
220,
220,
13066,
10962,
8645,
1352,
13,
9078,
198,
2,
32039,
25,
220,
220,
220,
220,
2980,
378,
13066,
3084,
2298,
293,
13,
198,
2,
198,
2,
6434,
25,
220,
220,
220,
220... | 2.004324 | 3,238 |
import pyHiChi as pfc
import numpy as np
import math as ma
gridSize = pfc.vector3d(5, 10, 11)
minCoords = pfc.vector3d(0.0, 1.0, 0.0)
maxCoords = pfc.vector3d(3.5, 7.0, 2*ma.pi)
stepsGrid = step(minCoords, maxCoords, gridSize)
timeStep = 1e-16
grid1 = pfc.YeeGrid(gridSize, timeStep, minCoords, stepsGrid)
grid2 = pfc.... | [
11748,
12972,
17250,
1925,
72,
355,
279,
16072,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
10688,
355,
17266,
198,
198,
25928,
10699,
796,
279,
16072,
13,
31364,
18,
67,
7,
20,
11,
838,
11,
1367,
8,
198,
1084,
7222,
3669,
796,
... | 1.956301 | 984 |
from itertools import groupby
from lint_domain_packages.interfaces import ImportViolation, ImportViolationGroup
def group_violations(violations: list[ImportViolation]) -> list[ImportViolationGroup]:
"""Group import violations by the violation key."""
sorted_violations = sorted(violations, key=_group_key)
... | [
6738,
340,
861,
10141,
1330,
1448,
1525,
198,
198,
6738,
300,
600,
62,
27830,
62,
43789,
13,
3849,
32186,
1330,
17267,
33894,
341,
11,
17267,
33894,
341,
13247,
628,
198,
4299,
1448,
62,
17069,
602,
7,
17069,
602,
25,
1351,
58,
20939,... | 2.847458 | 236 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/contrib/mpi/mpi_msg.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impo... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
11192,
273,
11125,
14,
3642,
822,
14,
3149,
72,
14,
3149,
72,
62,
19662,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
62,
65,
28,
17597,
... | 2.404926 | 1,746 |
import pickle
import os
| [
11748,
2298,
293,
198,
11748,
28686,
198
] | 3.428571 | 7 |
# Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
""" Userbot module for having some fun with people. """
import time
from asyncio import sleep
from collections i... | [
2,
15069,
357,
34,
8,
13130,
383,
12281,
5303,
417,
6794,
5834,
11419,
13,
201,
198,
2,
201,
198,
2,
49962,
739,
262,
12281,
5303,
417,
6794,
5094,
13789,
11,
10628,
352,
13,
66,
357,
1169,
366,
34156,
15341,
201,
198,
2,
345,
743... | 1.788894 | 17,162 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may ... | [
2,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
201,
198,
2,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
201,
198,
2,
9387,
351,
428,
670,
329,
3224,
1321,
201,
198,
2,
5115,
6634,
9238,
13,
... | 2.299102 | 5,570 |
# merge together the specScores.tab file with the guide.bed file and
# the effScores.tab file and create crispor.bb from the result
import os, sys, glob
from os.path import dirname, join
# arguments:
# arg1: db = genome db
# arg2: inFname = bed file with all guides in genome, e.g. allGuides.bed
# arg3: specScoreMask ... | [
2,
20121,
1978,
262,
1020,
3351,
2850,
13,
8658,
2393,
351,
262,
5698,
13,
3077,
2393,
290,
220,
198,
2,
262,
914,
3351,
2850,
13,
8658,
2393,
290,
2251,
4442,
1819,
13,
11848,
422,
262,
1255,
198,
11748,
28686,
11,
25064,
11,
15095... | 2.150271 | 4,432 |
from Classes import Maze
from Frontier_processing import ExploreFrontier, is_in_frontier, tracePath
| [
6738,
38884,
1330,
33412,
198,
6738,
23281,
62,
36948,
1330,
41401,
25886,
959,
11,
318,
62,
259,
62,
8534,
959,
11,
12854,
15235,
628,
198
] | 4.08 | 25 |
import torch
from torch.nn.functional import softplus
from torch.distributions.normal import Normal
import math
| [
11748,
28034,
198,
6738,
28034,
13,
20471,
13,
45124,
1330,
2705,
9541,
198,
6738,
28034,
13,
17080,
2455,
507,
13,
11265,
1330,
14435,
198,
11748,
10688,
198
] | 4.148148 | 27 |
from tempfile import NamedTemporaryFile
write_results("writing in a temp file")
| [
6738,
20218,
7753,
1330,
34441,
12966,
5551,
8979,
198,
198,
13564,
62,
43420,
7203,
16502,
287,
257,
20218,
2393,
4943,
198
] | 3.857143 | 21 |
#from pymongo import Connection
import config
import celeryconfig
import cherrypy
from json_handler import handler
import simplejson as json
from celery import Celery
celery = Celery().config_from_object(celeryconfig)
from celery.task.control import inspect
from celery.result import AsyncResult
from celery.execute imp... | [
2,
6738,
279,
4948,
25162,
1330,
26923,
220,
198,
11748,
4566,
198,
11748,
18725,
1924,
11250,
198,
11748,
23612,
9078,
198,
6738,
33918,
62,
30281,
1330,
21360,
198,
11748,
2829,
17752,
355,
33918,
198,
6738,
18725,
1924,
1330,
15248,
19... | 2.32617 | 1,303 |
import pandas as pd
import multiprocessing as mp
from qso_toolbox import catalog_tools as ct
from qso_toolbox import imview_gui as imview
# Hack to avoid being stuck on waiter.acquire()
# I have no idea why it works and what is wrong with the implementation
# below. It seems to be specific to OSX as the code works fin... | [
11748,
19798,
292,
355,
279,
67,
198,
11748,
18540,
305,
919,
278,
355,
29034,
198,
6738,
10662,
568,
62,
25981,
3524,
1330,
18388,
62,
31391,
355,
269,
83,
198,
6738,
10662,
568,
62,
25981,
3524,
1330,
545,
1177,
62,
48317,
355,
545,... | 2.381988 | 322 |
from .MutableString import *
from .TextCanvas import *
#
# This object represents a table cell
#
#
#
# This class represents a table, which actually is a grid of cells. Text is organized in lines.
# After text has been added to the table you get it printed to an instance of <c>TextCanvas</c>
# which in t... | [
628,
198,
6738,
764,
44,
18187,
10100,
1330,
1635,
198,
6738,
764,
8206,
6090,
11017,
1330,
1635,
628,
628,
628,
198,
198,
2,
198,
2,
770,
2134,
6870,
257,
3084,
2685,
198,
2,
198,
198,
2,
628,
628,
198,
2,
198,
2,
770,
1398,
68... | 3.285714 | 112 |
from logging import getLogger
from os3_rll.models.db import Database, DBException
logger = getLogger(__name__)
def get_all_player_ids_ordered(order_by="rank"):
"""
Get a list of all player ids ordered by column
param str order_by: Which column to order by
return list: The player ids
"""
ids... | [
6738,
18931,
1330,
651,
11187,
1362,
198,
198,
6738,
28686,
18,
62,
81,
297,
13,
27530,
13,
9945,
1330,
24047,
11,
20137,
16922,
198,
198,
6404,
1362,
796,
651,
11187,
1362,
7,
834,
3672,
834,
8,
628,
198,
4299,
651,
62,
439,
62,
... | 2.524349 | 883 |
from __future__ import unicode_literals
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.files import File
from django.db import models
from django.urls import reverse
from django.utils import t... | [
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
11299,
19199,
13,
25747,
1330,
42044,
33616,
9218,
198,
6738,
42625,
14208,
13,
... | 3.095541 | 314 |
import requests
from django.utils.functional import SimpleLazyObject
from webdjango.models.Core import Website
from django.utils.deprecation import MiddlewareMixin
from django.utils.cache import add_never_cache_headers
| [
11748,
7007,
198,
6738,
42625,
14208,
13,
26791,
13,
45124,
1330,
17427,
43,
12582,
10267,
198,
6738,
3992,
28241,
14208,
13,
27530,
13,
14055,
1330,
15887,
198,
6738,
42625,
14208,
13,
26791,
13,
10378,
8344,
341,
1330,
6046,
1574,
35608... | 3.454545 | 66 |
import unittest
from setup.settings import *
from numpy.testing import *
from pandas.util.testing import *
import numpy as np
import dolphindb_numpy as dnp
import pandas as pd
import orca
if __name__ == '__main__':
unittest.main()
| [
11748,
555,
715,
395,
198,
6738,
9058,
13,
33692,
1330,
1635,
198,
6738,
299,
32152,
13,
33407,
1330,
1635,
198,
6738,
19798,
292,
13,
22602,
13,
33407,
1330,
1635,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
288,
10196,
521,
65,
... | 2.902439 | 82 |
# -*- coding: utf-8 -*-
"""Setup the redrugs application"""
import logging
from tg import config
import transaction
def setup_schema(command, conf, vars):
"""Place any commands to setup redrugs here"""
# Load the models
# <websetup.websetup.schema.before.model.import>
from redrugs import model
# ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
40786,
262,
2266,
2143,
82,
3586,
37811,
198,
198,
11748,
18931,
198,
6738,
256,
70,
1330,
4566,
198,
11748,
8611,
198,
198,
4299,
9058,
62,
15952,
2611,
7,
21812... | 2.774854 | 342 |
# -*- coding: utf-8 -*-
# Copyright 2013 UNED
#
# 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... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
15069,
2211,
4725,
1961,
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,
239... | 3.62766 | 188 |
"""
Flow and Pressure controller, PR4000B, from MKS Instruments.
"""
import re
from msl.equipment.resources import register
from msl.equipment.connection_serial import ConnectionSerial
from msl.equipment.exceptions import MKSInstrumentsError
@register(manufacturer=r'^MKS', model=r'PR4000B', flags=re.IGNORECASE)
| [
37811,
198,
37535,
290,
30980,
10444,
11,
4810,
27559,
33,
11,
422,
20553,
50,
43953,
13,
198,
37811,
198,
11748,
302,
198,
198,
6738,
285,
6649,
13,
4853,
4667,
13,
37540,
1330,
7881,
198,
6738,
285,
6649,
13,
4853,
4667,
13,
38659,
... | 3.291667 | 96 |
import scannerpy
import scannertools as st
import os
from django.db.models import Q
from django.db import transaction
from query.models import Video, Frame, Labeler, Tag, VideoTag
from esper.prelude import Notifier
import numpy as np
from tqdm import tqdm
# Labeler for this pipeline
LABELER, _ = Labeler.objects.get_o... | [
11748,
27474,
9078,
220,
198,
11748,
629,
1236,
861,
10141,
355,
336,
198,
11748,
28686,
198,
6738,
42625,
14208,
13,
9945,
13,
27530,
1330,
1195,
198,
6738,
42625,
14208,
13,
9945,
1330,
8611,
198,
6738,
12405,
13,
27530,
1330,
7623,
1... | 2.400598 | 1,338 |
import vector
main() | [
11748,
15879,
628,
198,
198,
12417,
3419
] | 3.285714 | 7 |
import jinja2
from jinja2 import select_autoescape
import bokeh, os, re, sys
from ..plots.guideimage import guide_star_timelapse
from bokeh.embed import components
def write_guide_image_html(image_data, outfile, night, expid):
'''Writes html file with guide timelapse movie plots for all guide stars on all cameras... | [
11748,
474,
259,
6592,
17,
198,
6738,
474,
259,
6592,
17,
1330,
2922,
62,
2306,
3028,
36435,
198,
11748,
1489,
365,
71,
11,
28686,
11,
302,
11,
25064,
198,
198,
6738,
11485,
489,
1747,
13,
41311,
9060,
1330,
5698,
62,
7364,
62,
1651... | 2.242567 | 639 |
ot3_dummy_settings = {
"name": "Marie Curie",
"model": "OT-3 Standard",
"version": 1,
"motion_settings": {
"acceleration": {
"none": {
"X": 3,
"Y": 2,
"Z": 15,
"P": 2,
},
"low_throughput": {
... | [
313,
18,
62,
67,
13513,
62,
33692,
796,
1391,
198,
220,
220,
220,
366,
3672,
1298,
366,
44507,
4424,
494,
1600,
198,
220,
220,
220,
366,
19849,
1298,
366,
2394,
12,
18,
8997,
1600,
198,
220,
220,
220,
366,
9641,
1298,
352,
11,
198... | 1.348168 | 3,820 |
"""
"""
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
from collections import defaultdict
import numpy as np
import pandas as pd
import pandas.util.testing as pdt
import pytest
from scipy.stats import hypergeom
| [
37811,
198,
198,
37811,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
17268,
1330,
4277,
11600,
198,
198,
11748,
... | 3.481013 | 79 |
"""
Test file for common module.
"""
import pytest
from osbrain.agent import TOPIC_SEPARATOR
from osbrain.common import LogLevel
from osbrain.common import topic_to_bytes
from osbrain.common import topics_to_bytes
from osbrain.common import unique_identifier
def test_unique_identifier():
"""
The `unique_iden... | [
37811,
198,
14402,
2393,
329,
2219,
8265,
13,
198,
37811,
198,
11748,
12972,
9288,
198,
198,
6738,
28686,
27825,
13,
25781,
1330,
28662,
2149,
62,
5188,
27082,
25633,
198,
6738,
28686,
27825,
13,
11321,
1330,
5972,
4971,
198,
6738,
28686,... | 2.658602 | 744 |
import numpy as np
import scipy.sparse as sp
import scipy.sparse.linalg as sla
import time as tm
'''
****************************************************************************
IF YOU WISH TO LOOK AT PyNUCTRAN's IMPLEMENTATION, PLEASE PROCESS TO SECTION
II.
***********************************... | [
11748,
299,
32152,
355,
45941,
201,
198,
11748,
629,
541,
88,
13,
82,
29572,
355,
599,
201,
198,
11748,
629,
541,
88,
13,
82,
29572,
13,
75,
1292,
70,
355,
1017,
64,
201,
198,
11748,
640,
355,
256,
76,
201,
198,
201,
198,
7061,
... | 3.127273 | 220 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... | [
2,
15069,
1584,
383,
309,
22854,
37535,
46665,
13,
1439,
6923,
33876,
13,
198,
2,
3401,
6637,
15069,
2177,
2275,
328,
603,
4091,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
19... | 2.230541 | 8,428 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# written by Wim Han
"""
* 1. GUI added
* 2. only convert UTF-8 plain text files (.txt, .srt, .ass, subtitle files) to chs & cht by using opencc@byvoid
* 3. run in Python 3 under windows 10, not ubuntu
* 4. download python 3: https://www.python.org/downloads/
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
2,
3194,
416,
39999,
9530,
201,
198,
201,
198,
37811,
201,
198,
9,
352,
13,
25757,
2087,
201,
198,
9,... | 2.540681 | 1,733 |
import cv2
import logging
import argparse
import utils.datasets as datasets
from utils.utils import *
from utils.log import logger
from utils.timer import Timer
from utils.parse_config import parse_model_cfg
from track import eval_seq
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/') | [
198,
11748,
269,
85,
17,
198,
11748,
18931,
198,
11748,
1822,
29572,
198,
11748,
3384,
4487,
13,
19608,
292,
1039,
355,
40522,
198,
6738,
3384,
4487,
13,
26791,
1330,
1635,
198,
6738,
3384,
4487,
13,
6404,
1330,
49706,
198,
6738,
3384,
... | 3.326316 | 95 |
"""UnionFind.py
Union-find data structure. Based on Josiah Carlson's code,
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/215912
with significant additional changes by D. Eppstein.
"""
import pdb | [
37811,
38176,
16742,
13,
9078,
198,
198,
38176,
12,
19796,
1366,
4645,
13,
13403,
319,
22568,
9520,
33059,
338,
2438,
11,
198,
4023,
1378,
5126,
77,
13,
15791,
44146,
13,
785,
14,
1921,
13137,
14,
28937,
2070,
14,
37906,
14,
37523,
14... | 3.253968 | 63 |
import logging
from app_pypeach_django.application.helper.string import StringHelper
from app_pypeach_django.test.test_base import UnitTestBase
"""
文字列ユーティリティのテストです
"""
__author__ = "t.ebinuma"
__version__ = "1.0"
__date__ = "25 December 2018"
| [
11748,
18931,
198,
198,
6738,
598,
62,
79,
2981,
620,
62,
28241,
14208,
13,
31438,
13,
2978,
525,
13,
8841,
1330,
10903,
47429,
198,
6738,
598,
62,
79,
2981,
620,
62,
28241,
14208,
13,
9288,
13,
9288,
62,
8692,
1330,
11801,
14402,
1... | 2.546392 | 97 |
#!/usr/bin/env python
import fileinput
import json
from kombu import Connection, Exchange, Queue
from mgap.util import get_config
rabbitmq_config = get_config()['rabbitmq']
broker_url = 'amqp://{}:{}@{}:{}/{}'.format(
rabbitmq_config['username'],
rabbitmq_config['password'],
rabbitmq_config['host'],
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
2393,
15414,
198,
11748,
33918,
198,
198,
6738,
479,
2381,
84,
1330,
26923,
11,
12516,
11,
4670,
518,
198,
198,
6738,
10527,
499,
13,
22602,
1330,
651,
62,
11250,
628,
198,... | 2.271144 | 402 |
"""Utility functions for checking types and values. Inspired from MNE."""
import logging
import multiprocessing as mp
import operator
import os
from pathlib import Path
from typing import Any, Optional, Union
import numpy as np
from .. import logger
def _ensure_int(item: Any, item_name: Optional[str] = None) -> in... | [
37811,
18274,
879,
5499,
329,
10627,
3858,
290,
3815,
13,
45827,
422,
337,
12161,
526,
15931,
198,
198,
11748,
18931,
198,
11748,
18540,
305,
919,
278,
355,
29034,
198,
11748,
10088,
198,
11748,
28686,
198,
6738,
3108,
8019,
1330,
10644,
... | 2.348837 | 3,182 |
from cobra import *
| [
6738,
22843,
430,
1330,
1635,
628
] | 3.5 | 6 |
import re
import sys
import logging
from pynsett.discourse import Discourse
from pynsett.drt import Drs, DrsRule
from pynsett.knowledge.drs_ner_cleaner import DrsNERCleaner
from pynsett.metric import MetricFactory
_logger = logging.getLogger(__name__)
| [
11748,
302,
201,
198,
11748,
25064,
201,
198,
11748,
18931,
201,
198,
201,
198,
6738,
279,
2047,
17744,
13,
15410,
9047,
1330,
8444,
9047,
201,
198,
6738,
279,
2047,
17744,
13,
7109,
83,
1330,
1583,
82,
11,
1583,
82,
31929,
201,
198,
... | 2.495575 | 113 |
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | [
29113,
29113,
7804,
4242,
2235,
198,
2,
198,
2,
15069,
357,
66,
8,
5878,
1168,
3008,
10501,
290,
25767,
669,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
770,
3788,
318,
2426,
284,
262,
8617,
286,
262,
1168,
3008,
5094,
13789,
11,
1... | 4.032129 | 249 |
import random
import json
import pickle
import numpy as np
import nltk
from nltk.sten import WordNetLemmatizer
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers Dense, Activation, Dropout
from tensorflow.optimizers import SGD
lemmatizer = WordNetLemmatizer()
intents = json.loads(open('int... | [
11748,
4738,
198,
11748,
33918,
198,
11748,
2298,
293,
198,
11748,
299,
32152,
355,
45941,
198,
198,
11748,
299,
2528,
74,
198,
6738,
299,
2528,
74,
13,
26400,
1330,
9678,
7934,
43,
368,
6759,
7509,
198,
198,
6738,
11192,
273,
11125,
... | 2.546482 | 796 |
from django.contrib.auth.models import User
from rest_framework import permissions
from .models import Queue, Meeting, Profile
class IsHostOrReadOnly(permissions.BasePermission):
'''
Custom permission to only allow hosts to edit queues
'''
class IsHostOrAttendee(permissions.BasePermission):
'''
... | [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
1334,
62,
30604,
1330,
21627,
198,
6738,
764,
27530,
1330,
4670,
518,
11,
22244,
11,
13118,
628,
628,
198,
198,
4871,
1148,
17932,
5574,
5569,
10049,
7,
... | 3.272222 | 180 |
from distutils.core import setup
setup(
name="cosmoplots",
version="0.1.0",
description="Definitions for figures and plots using matplotlib",
author="Gregor Decristoforo",
author_email="gregor.decristoforo@uit.no",
url="https://github.com/uit-cosmo/cosmoplots",
packages=["cosmoplots"],
... | [
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
2625,
6966,
76,
20106,
1747,
1600,
198,
220,
220,
220,
2196,
2625,
15,
13,
16,
13,
15,
1600,
198,
220,
220,
220,
6764,
2625,
7469,
50101,
329,
... | 2.520295 | 271 |
import pytest
| [
11748,
12972,
9288,
628
] | 3.75 | 4 |
"""Add organization column to newsflash
Revision ID: 7c472e4582de
Revises: 2c54437f4ee4
Create Date: 2020-08-21 02:08:31.654024
"""
# revision identifiers, used by Alembic.
revision = '7c472e4582de'
down_revision = '2c54437f4ee4'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
... | [
37811,
4550,
4009,
5721,
284,
1705,
34167,
198,
198,
18009,
1166,
4522,
25,
767,
66,
37856,
68,
2231,
6469,
2934,
198,
18009,
2696,
25,
362,
66,
47576,
2718,
69,
19,
1453,
19,
198,
16447,
7536,
25,
12131,
12,
2919,
12,
2481,
7816,
2... | 2.563492 | 126 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
198,
6738,
42625,
14208,
13,
10414,
1330,
... | 3.111111 | 45 |
#%%
import pandas as pd
import numpy as np
data = pd.read_csv("../data/30daychart-parttime_15_64.csv")
dw = pd.melt(
data, id_vars=["sex", "n_child", "geo"], var_name="year", value_name="percent"
)
dw["percent"] = dw["percent"].astype(float)
dw["year"] = dw["year"].astype(int)
# per sex/child/year count/avg/st... | [
2,
16626,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
198,
7890,
796,
279,
67,
13,
961,
62,
40664,
7203,
40720,
7890,
14,
1270,
820,
40926,
12,
3911,
2435,
62,
1314,
62,
2414,
13,
40664,
4943,
628,... | 2.112426 | 845 |
#!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
198,
2,
15069,
2864,
12,
1238,
2481,
12280,
897,
261,
11,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
... | 3.144796 | 442 |
from .builder import build_meshgrid
from .segment_anchor_meshgrid import SegmentAnchorMeshGrid
__all__ = ['SegmentAnchorMeshGrid', 'build_meshgrid']
| [
6738,
764,
38272,
1330,
1382,
62,
76,
5069,
25928,
198,
6738,
764,
325,
5154,
62,
3702,
273,
62,
76,
5069,
25928,
1330,
1001,
5154,
2025,
354,
273,
37031,
41339,
198,
198,
834,
439,
834,
796,
37250,
41030,
434,
2025,
354,
273,
37031,
... | 2.884615 | 52 |
# The driver allows you to draw text (string) on the screen.
# Text drawing has the following feature:
# * Support of various font
# * Support for text color (and background color)
# * Cursor blinking
# * Draw from position (x,y)
#
from ili9341.lcd import *
l = LCD(baud = 21000000 ) # step down the SPI bus sp... | [
2,
383,
4639,
3578,
345,
284,
3197,
2420,
357,
8841,
8,
319,
262,
3159,
13,
198,
2,
8255,
8263,
468,
262,
1708,
3895,
25,
198,
2,
220,
220,
1635,
7929,
286,
2972,
10369,
198,
2,
220,
220,
1635,
7929,
329,
2420,
3124,
357,
392,
4... | 3.049419 | 344 |
# -*- coding: utf-8 -*-
import os
import re
import unittest
from helpers import slug
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
555,
715,
395,
198,
6738,
49385,
1330,
31065,
628,
628,
198
] | 2.78125 | 32 |
import time
import torch
import torch.autograd as autograd
def Hv_batch(net, batch_x, batch_y, mems, v):
"""
Hessian vector multiplication
"""
net.eval()
ret = net(batch_x, batch_y, *mems)
loss, mems = ret[0], ret[1:]
# loss = criterion(logits, batch_y)
loss = loss.float().mean().t... | [
11748,
640,
198,
11748,
28034,
198,
11748,
28034,
13,
2306,
519,
6335,
355,
1960,
519,
6335,
628,
628,
198,
198,
4299,
367,
85,
62,
43501,
7,
3262,
11,
15458,
62,
87,
11,
15458,
62,
88,
11,
1066,
82,
11,
410,
2599,
198,
220,
220,
... | 2.210162 | 433 |
from lib.actions import YammerAction
__all__ = [
'ListMessagesAction'
]
| [
6738,
9195,
13,
4658,
1330,
14063,
647,
12502,
198,
198,
834,
439,
834,
796,
685,
198,
220,
220,
220,
705,
8053,
36479,
1095,
12502,
6,
198,
60,
628
] | 2.785714 | 28 |
t = int(input().strip())
for t0 in range(0,t):
s = input().strip()
i = len(s)
can = False
low = dict()
while i > 1:
i -=1
count(low,s[i])
if s[i-1] < s[i]:
replacement = s[i]
can = True
for k in sorted(low.keys()):
... | [
83,
796,
493,
7,
15414,
22446,
36311,
28955,
198,
220,
220,
220,
220,
220,
220,
220,
220,
198,
1640,
256,
15,
287,
2837,
7,
15,
11,
83,
2599,
198,
220,
220,
220,
264,
796,
5128,
22446,
36311,
3419,
198,
220,
220,
220,
1312,
796,
... | 1.701117 | 358 |
"""
* HelloWorldTxn is a very simple Berkeley DB XML program
* that demonstrates transactional initialization and
* container creation, transactional document insertion and
* retrieval by name.
*
* The program also factors out initialization tasks that are
* typically performed one time at the beginning of an ... | [
37811,
198,
1635,
18435,
10603,
46047,
77,
318,
257,
845,
2829,
14727,
20137,
23735,
1430,
198,
1635,
326,
15687,
48878,
1538,
37588,
290,
220,
198,
1635,
9290,
6282,
11,
48878,
1538,
3188,
36075,
290,
220,
198,
1635,
45069,
416,
1438,
... | 2.555115 | 1,261 |
from appium import webdriver
from app.GetConf import GetConf
from app.ClickThread import ClickThread
| [
6738,
598,
1505,
1330,
3992,
26230,
201,
198,
6738,
598,
13,
3855,
18546,
1330,
3497,
18546,
201,
198,
6738,
598,
13,
8164,
16818,
1330,
6914,
16818,
201,
198,
201,
198
] | 3.533333 | 30 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | [
2,
220,
49962,
284,
262,
24843,
10442,
5693,
357,
1921,
37,
8,
739,
530,
198,
2,
220,
393,
517,
18920,
5964,
11704,
13,
220,
4091,
262,
28536,
2393,
198,
2,
220,
9387,
351,
428,
670,
329,
3224,
1321,
198,
2,
220,
5115,
6634,
9238,... | 3.825203 | 246 |
from targets import target
from targets.types import Path
from targets.values import TargetPathLibValueType
| [
6738,
6670,
1330,
2496,
198,
6738,
6670,
13,
19199,
1330,
10644,
198,
6738,
6670,
13,
27160,
1330,
12744,
15235,
25835,
11395,
6030,
628
] | 4.73913 | 23 |
# Copyright 2020 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | [
2,
15069,
12131,
1395,
346,
28413,
3457,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2... | 1.960354 | 2,371 |
import os
import sys
import argparse
import time
import tqdm
from collections import Counter
import math
import numpy as np
import torch
import torch.nn as nn
from torch.nn.modules.utils import _single
import torch.nn.functional as F
import torch.optim as optim
from sklearn.model_selection import train_test_split
fr... | [
198,
11748,
28686,
198,
11748,
25064,
198,
11748,
1822,
29572,
198,
11748,
640,
198,
11748,
256,
80,
36020,
198,
6738,
17268,
1330,
15034,
198,
198,
11748,
10688,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
1... | 2.564654 | 2,699 |
from ipykernel.kernelapp import IPKernelApp
from . import QtpiShort
IPKernelApp.launch_instance(kernel_class=QtpiShort)
| [
6738,
20966,
88,
33885,
13,
33885,
1324,
1330,
6101,
42,
7948,
4677,
198,
6738,
764,
1330,
33734,
14415,
16438,
198,
198,
4061,
42,
7948,
4677,
13,
35681,
62,
39098,
7,
33885,
62,
4871,
28,
48,
83,
14415,
16438,
8,
198
] | 3.025 | 40 |
'''
Created on Oct 22, 2020
@author: simon
'''
import matplotlib.pyplot as plt
globfigparams = {
'fontsize':8, 'family':'serif', 'usetex': True,
'preamble': r'\usepackage{amsmath} \usepackage{times} \usepackage{mathtools}',
'column_inch':229.8775 / 72.27, 'markersize':24, 'markercolour':'#AA00AA',
'fo... | [
7061,
6,
198,
41972,
319,
2556,
2534,
11,
12131,
198,
198,
31,
9800,
25,
985,
261,
198,
7061,
6,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
4743,
672,
5647,
37266,
796,
1391,
198,
220,
220,
220,
705,
10331,
... | 2.357843 | 204 |
# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
"""
Module to define the structure of the event
used in Step Functions when accounts are moved
into Organizational Units
"""
import ast
import os
from errors import ParameterNotFoundError, RootOUIDError
DEPLOYM... | [
2,
15069,
13130,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
17168,
12,
15,
198,
198,
37811,
198,
26796,
284,
8160,
262,
4645,
286,
262,
1785,
198,
14... | 2.290456 | 1,446 |
# f[i][w] = max(f[i - 1][w], f[i - 1][w - A[i - 1]] + v[i - 1])
class Solution:
"""
@param m: An integer m denotes the size of a backpack
@param A: Given n items with size A[i]
@param V: Given n items with value V[i]
@return: The maximum value
""" | [
2,
277,
58,
72,
7131,
86,
60,
796,
3509,
7,
69,
58,
72,
532,
352,
7131,
86,
4357,
277,
58,
72,
532,
352,
7131,
86,
532,
317,
58,
72,
532,
352,
11907,
1343,
410,
58,
72,
532,
352,
12962,
198,
4871,
28186,
25,
198,
220,
220,
2... | 2.377193 | 114 |