content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from NCAABracketMaker.utilities import bracketpath, simbracketpath, teampath, modulepath
import yaml
from NCAABracketMaker.AnalyzeGame import whoWins
from math import pow
import pandas as pd
import os
from openpyxl import load_workbook
def roundResults(teams, rnd, teamdatadf, pointcof, wincof, rankcof, ratiocof):
... | [
6738,
15244,
9414,
8317,
48890,
13,
315,
2410,
1330,
19096,
6978,
11,
985,
1671,
8317,
6978,
11,
573,
696,
776,
11,
8265,
6978,
198,
11748,
331,
43695,
198,
6738,
15244,
9414,
8317,
48890,
13,
37702,
2736,
8777,
1330,
508,
54,
1040,
1... | 2.302194 | 3,008 |
# -*- coding: utf-8 -*-
import math
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
10688,
628
] | 2.176471 | 17 |
from rest_framework import viewsets, mixins
from .serializer import PictureChurchSerializer
from .models import PictureChurch
| [
6738,
1334,
62,
30604,
1330,
5009,
1039,
11,
5022,
1040,
198,
6738,
764,
46911,
7509,
1330,
17741,
46686,
32634,
7509,
198,
6738,
764,
27530,
1330,
17741,
46686,
628
] | 4.535714 | 28 |
from covid import *
main() | [
6738,
39849,
312,
1330,
1635,
628,
628,
198,
12417,
3419
] | 3 | 10 |
"""
Common photometric transforms for data augmentation.
"""
import numpy as np
import cv2
from PIL import Image
from torchvision import transforms as transforms
available_augmentations = [
'additive_gaussian_noise',
'additive_speckle_noise',
'random_brightness',
'random_contrast',
'additive_shade... | [
37811,
198,
17227,
2825,
16996,
31408,
329,
1366,
16339,
14374,
13,
198,
37811,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
269,
85,
17,
198,
6738,
350,
4146,
1330,
7412,
198,
6738,
28034,
10178,
1330,
31408,
355,
31408,
628,
198,
1... | 2.883978 | 362 |
# The guess API is already defined for you.
# @param num, your guess
# @return -1 if my number is lower, 1 if my number is higher, otherwise return 0
# def guess(num: int) -> int:
| [
2,
383,
4724,
7824,
318,
1541,
5447,
329,
345,
13,
198,
2,
2488,
17143,
997,
11,
534,
4724,
198,
2,
2488,
7783,
532,
16,
611,
616,
1271,
318,
2793,
11,
352,
611,
616,
1271,
318,
2440,
11,
4306,
1441,
657,
198,
2,
825,
4724,
7,
... | 3.396226 | 53 |
# complete the function body (6 MARKS)
def is_syllable(phoneme):
''' (str) -> bool
Return True iff phoneme is a syllable
'''
return phoneme[-1] == '0'
def count_syllables(words_pronunciation):
''' (list of list of str) -> int
Return the number of syllables in words_pronunciation... | [
2,
1844,
262,
2163,
1767,
357,
21,
39641,
50,
8,
198,
198,
4299,
318,
62,
1837,
297,
540,
7,
746,
261,
34755,
2599,
198,
220,
220,
220,
705,
7061,
357,
2536,
8,
4613,
20512,
198,
220,
220,
220,
220,
198,
220,
220,
220,
8229,
640... | 2.144444 | 270 |
#!/usr/bin/env python
# read mc file with filename given as command line argument and
# sho BH and Mue plot
#
# Usage:
# plot.mcv.py <filename>
#
import matplotlib.pylab as pl
import femagtools.mcv
import femagtools.plot
import sys
mcv = femagtools.mcv.read(sys.argv[1])
if mcv['mc1_type'] in (femagtools.mcv.MAGCRV, ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
1100,
36650,
2393,
351,
29472,
1813,
355,
3141,
1627,
4578,
290,
198,
2,
7354,
347,
39,
290,
337,
518,
7110,
198,
2,
198,
2,
29566,
25,
198,
2,
220,
7110,
13,
23209,
85,
13,
9... | 2.110465 | 344 |
"""Provides ``generateSources`` which generates a simple tree of contents pages."""
import os
INDEX_RST = """\
.. %s documentation master file
Welcome to %s's documentation
=================================
Contents:
.. toctree::
:maxdepth: 2
%s
Indices and tables
==================
* :ref:`genindex`
* :ref:`... | [
37811,
15946,
1460,
7559,
8612,
378,
21188,
15506,
543,
18616,
257,
2829,
5509,
286,
10154,
5468,
526,
15931,
198,
198,
11748,
28686,
198,
198,
12115,
6369,
62,
49,
2257,
796,
37227,
59,
198,
492,
4064,
82,
10314,
4958,
2393,
198,
198,
... | 2.249313 | 1,091 |
#!/usr/bin/env python3
# coding: utf-8
import sys
import numpy as np
import pandas as pd
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
11748,
25064,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
198,
12417,
3419,
198
] | 2.512821 | 39 |
"""Utilities for defining primitive ops.
Most of the ops can be automatically generated by matching against AST
nodes and types. For example, a func_op is automatically generated when
a specific function is called with the specific positional argument
count and argument types.
Example op definition:
list_len_op = fu... | [
37811,
18274,
2410,
329,
16215,
20049,
39628,
13,
198,
198,
6943,
286,
262,
39628,
460,
307,
6338,
7560,
416,
12336,
1028,
29273,
198,
77,
4147,
290,
3858,
13,
1114,
1672,
11,
257,
25439,
62,
404,
318,
6338,
7560,
618,
198,
64,
2176,
... | 2.377167 | 4,327 |
from django import forms
from .models import Owner, Car
| [
6738,
42625,
14208,
1330,
5107,
198,
6738,
764,
27530,
1330,
23853,
11,
1879,
628,
198
] | 3.866667 | 15 |
from bottle import run, get, post, request, route
import json, pymongo
@route('/hello/<id>')
@get('/login') # or @route('/login')
@route('/login', method='POST')
@route("/posthere", method="POST")
@route("/")
run(host='0.0.0.0', port=8080)
| [
6738,
9294,
1330,
1057,
11,
651,
11,
1281,
11,
2581,
11,
6339,
198,
11748,
33918,
11,
279,
4948,
25162,
198,
198,
31,
38629,
10786,
14,
31373,
14,
27,
312,
29,
11537,
198,
198,
31,
1136,
10786,
14,
38235,
11537,
1303,
393,
2488,
386... | 2.510204 | 98 |
from django.db import models
from apps.importing.models import ProviderLog
from datetime import datetime, date, timedelta
from dateutil.parser import parse
from dateutil import relativedelta
from django.core.management.base import BaseCommand
import xml.etree.ElementTree as ET
from apps.utils.time import UTC_P0100
de... | [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
6725,
13,
11748,
278,
13,
27530,
1330,
32549,
11187,
198,
6738,
4818,
8079,
1330,
4818,
8079,
11,
3128,
11,
28805,
12514,
198,
6738,
3128,
22602,
13,
48610,
1330,
21136,
198,
6738,
31... | 3.099526 | 211 |
from typing import Optional
import requests
from data.base.base_data_class import BaseDataProcess
| [
6738,
19720,
1330,
32233,
198,
198,
11748,
7007,
198,
198,
6738,
1366,
13,
8692,
13,
8692,
62,
7890,
62,
4871,
1330,
7308,
6601,
18709,
628,
198
] | 3.923077 | 26 |
#!flask/bin/python
from __future__ import print_function
import sys
from flask import Flask, jsonify, request, make_response, abort
# Python 3.6+ - CORS to allow all domains
from flask_cors import CORS
app = Flask(__name__)
CORS(app)
from PIL import Image
from io import BytesIO
import base64
import site
main_path = ... | [
2,
0,
2704,
2093,
14,
8800,
14,
29412,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
25064,
198,
6738,
42903,
1330,
46947,
11,
33918,
1958,
11,
2581,
11,
787,
62,
26209,
11,
15614,
198,
198,
2,
11361,
513,
13,
21,
... | 2.609788 | 756 |
from django.test import TestCase
from django.utils import timezone
from accounts.models import CustomUser, Organisation
from hackathon.models import (Hackathon,
HackTeam,
HackAward,
HackAwardCategory,
... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
42625,
14208,
13,
26791,
1330,
640,
11340,
198,
198,
6738,
5504,
13,
27530,
1330,
8562,
12982,
11,
30801,
198,
6738,
8156,
12938,
13,
27530,
1330,
357,
32833,
12938,
11,
198,
2... | 1.803279 | 244 |
#/usr/bin/python
from random import randrange
from sys import stdout
from math import sqrt, log
# -------------------------------------------- #
# Primos
# -------------------------------------------- #
def ehPrimo(p):
"""
Teste de primalidade simples
"""
if p == 2:
return True
elif ... | [
2,
14,
14629,
14,
8800,
14,
29412,
198,
198,
6738,
4738,
1330,
43720,
9521,
198,
6738,
25064,
1330,
14367,
448,
198,
6738,
10688,
1330,
19862,
17034,
11,
2604,
198,
198,
2,
20368,
10541,
1303,
198,
2,
11460,
418,
198,
2,
20368,
10541,... | 1.977103 | 4,673 |
#coding=utf-8
import random
#
# The seed no. will be counted by WeChat automatically.
# See the article for more details.
# Here, the value 10000 and 9999 are just two examples.
#
random.seed(10000) # If seed is 10000, the result is 5
#random.seed(9999) # If seed is 9999, the result is 1
nums = [
1, 2, 3... | [
2,
66,
7656,
28,
40477,
12,
23,
198,
198,
11748,
4738,
198,
198,
2,
220,
198,
2,
383,
9403,
645,
13,
481,
307,
14789,
416,
775,
30820,
6338,
13,
198,
2,
4091,
262,
2708,
329,
517,
3307,
13,
198,
2,
3423,
11,
262,
1988,
33028,
... | 1.929936 | 314 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Busana Apparel Group. All rights reserved.
#
# This product and it's source code is protected by patents, copyright laws and
# international copyright treaties, as well as other intellectual property
# laws and treaties. The product is licensed, not s... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
66,
8,
33160,
5869,
2271,
2034,
20318,
4912,
13,
1439,
2489,
10395,
13,
198,
2,
198,
2,
770,... | 3.876147 | 218 |
#!/usr/bin/python
# Generate .js files defining Blockly core and language messages.
#
# Copyright 2013 Google Inc.
# https://developers.google.com/blockly/
#
# 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 t... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
2,
2980,
378,
764,
8457,
3696,
16215,
9726,
306,
4755,
290,
3303,
6218,
13,
198,
2,
198,
2,
15069,
2211,
3012,
3457,
13,
198,
2,
3740,
1378,
16244,
364,
13,
13297,
13,
785,
14,
9967,... | 2.503959 | 2,526 |
HEALTHCHECK = {
'READINESS_CHECKS': ('databases',)
}
| [
13909,
40818,
50084,
796,
1391,
198,
197,
6,
15675,
44180,
62,
50084,
50,
10354,
19203,
19608,
18826,
3256,
8,
198,
92,
198
] | 2.454545 | 22 |
'''
python data_processing/train_data/auto_tag_datasets.py \
--s2orc-full-text-directory S2ORC_PATH/s2orc_full_texts/ \
--s2orc-metadata-directory S2ORC_PATH/s2orc_metadata/ \
--pwc-to-s2orc-mapping S2ORC_PATH/s2orc_metadata/pwc_dataset_to_s2orc_mapping.pkl \
--pwc-datasets-file datasets.json \
--ou... | [
7061,
6,
198,
29412,
1366,
62,
36948,
14,
27432,
62,
7890,
14,
23736,
62,
12985,
62,
19608,
292,
1039,
13,
9078,
3467,
198,
220,
220,
220,
1377,
82,
17,
24449,
12,
12853,
12,
5239,
12,
34945,
311,
17,
1581,
34,
62,
34219,
14,
82,
... | 2.409434 | 1,060 |
from posixpath import dirname
from nf_core import modules
import os
import glob
import shutil
import copy
import json
import logging
import yaml
import nf_core.modules.module_utils
import nf_core.utils
from nf_core.modules.modules_repo import ModulesRepo
log = logging.getLogger(__name__)
class ModuleCommand:
""... | [
6738,
1426,
844,
6978,
1330,
26672,
3672,
198,
6738,
299,
69,
62,
7295,
1330,
13103,
198,
11748,
28686,
198,
11748,
15095,
198,
11748,
4423,
346,
198,
11748,
4866,
198,
11748,
33918,
198,
11748,
18931,
198,
11748,
331,
43695,
198,
198,
... | 2.055397 | 6,661 |
from typing import Awaitable, Iterable, Set
import pytest
from mock import AsyncMock, Mock, create_autospec, patch
from tickit.core.management.event_router import Wiring
from tickit.core.management.schedulers.master import MasterScheduler
from tickit.core.management.ticker import Ticker
from tickit.core.state_interfa... | [
6738,
19720,
1330,
5851,
4548,
540,
11,
40806,
540,
11,
5345,
198,
198,
11748,
12972,
9288,
198,
6738,
15290,
1330,
1081,
13361,
44,
735,
11,
44123,
11,
2251,
62,
2306,
418,
43106,
11,
8529,
198,
198,
6738,
4378,
270,
13,
7295,
13,
... | 2.81165 | 515 |
# Copyright (C) 2018-2020 The python-litecoin-utils developers
#
# This file is part of python-litecoin-utils
#
# It is subject to the license terms in the LICENSE file found in the top-level
# directory of this distribution.
#
# No part of python-litecoin-utils, including this file, may be copied, modified,
# propagat... | [
2,
15069,
357,
34,
8,
2864,
12,
42334,
383,
21015,
12,
36890,
3630,
12,
26791,
6505,
198,
2,
198,
2,
770,
2393,
318,
636,
286,
21015,
12,
36890,
3630,
12,
26791,
198,
2,
198,
2,
632,
318,
2426,
284,
262,
5964,
2846,
287,
262,
38... | 2.482935 | 1,172 |
import pathlib
import setuptools
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
setuptools.setup(
name="question_framework", # Replace with your own username
version="0.2.0",
author="David Pryor",
aut... | [
11748,
3108,
8019,
198,
11748,
900,
37623,
10141,
628,
198,
2,
383,
8619,
7268,
428,
2393,
198,
39,
9338,
796,
3108,
8019,
13,
15235,
7,
834,
7753,
834,
737,
8000,
198,
198,
2,
383,
2420,
286,
262,
20832,
11682,
2393,
198,
15675,
11... | 2.791971 | 274 |
import logging
from django import forms
from django.contrib import messages
from django.core.exceptions import ValidationError
from django.http import HttpResponseRedirect
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.views.generic import RedirectView
from formtools... | [
11748,
18931,
198,
198,
6738,
42625,
14208,
1330,
5107,
198,
6738,
42625,
14208,
13,
3642,
822,
1330,
6218,
198,
6738,
42625,
14208,
13,
7295,
13,
1069,
11755,
1330,
3254,
24765,
12331,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,... | 3.036923 | 325 |
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.utils import data as data_utils
from torchvision import datasets, models, transforms
from sklearn.model_selection import KFold, train_test_split
import albumentations as A
import albumentations_experimental as AE... | [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
40085,
355,
6436,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
6738,
28034,
13,
26791,
1330,
1366,
355,
1366,
62,
26791,
198,
6738,
28034,
10178... | 3.419098 | 377 |
import json
import unicodedata
| [
11748,
33918,
198,
11748,
28000,
9043,
1045,
198
] | 3.875 | 8 |
# Collaborators (including web sites where you got help: (enter none if you didn't need help)
# stackoverflow
store_list = {}
while True:
name = input("Give the name of the restaurant: ")
foodType = input("What food type does this restaurant serve? ")
store_list[name] = foodType
cont = input("Want... | [
2,
37322,
2024,
357,
8201,
3992,
5043,
810,
345,
1392,
1037,
25,
357,
9255,
4844,
611,
345,
1422,
470,
761,
1037,
8,
198,
2,
220,
8931,
2502,
11125,
628,
198,
8095,
62,
4868,
796,
23884,
198,
198,
4514,
6407,
25,
198,
220,
220,
22... | 2.875 | 160 |
a=int(input('Largura da parede(m): '))
b=int(input('Altura da parede(m): '))
print(f'Vai precisar de {(a*b)/2}L de tinta') | [
64,
28,
600,
7,
15414,
10786,
43,
853,
5330,
12379,
279,
1144,
68,
7,
76,
2599,
705,
4008,
198,
65,
28,
600,
7,
15414,
10786,
29161,
5330,
12379,
279,
1144,
68,
7,
76,
2599,
705,
4008,
198,
198,
4798,
7,
69,
6,
53,
1872,
3718,
... | 2.016393 | 61 |
data = (
'Xiao ', # 0x00
'Suo ', # 0x01
'Li ', # 0x02
'Zheng ', # 0x03
'Chu ', # 0x04
'Guo ', # 0x05
'Gao ', # 0x06
'Tie ', # 0x07
'Xiu ', # 0x08
'Cuo ', # 0x09
'Lue ', # 0x0a
'Feng ', # 0x0b
'Xin ', # 0x0c
'Liu ', # 0x0d
'Kai ', # 0x0e
'Jian ', # 0x0f
'R... | [
7890,
796,
357,
201,
198,
6,
55,
13481,
46083,
220,
220,
220,
1303,
657,
87,
405,
201,
198,
6,
5606,
78,
46083,
220,
220,
220,
1303,
657,
87,
486,
201,
198,
6,
32304,
46083,
220,
220,
220,
1303,
657,
87,
2999,
201,
198,
6,
57,
... | 1.487775 | 3,313 |
#!/usr/local/bin/python
# -*- coding:utf-8 -*-
# @Time : 2019/4/10 10:10 PM
# @Author : Jerry
# @Desc :
# @File : SensitivesHunter.py
import json
import os
import sys
import subprocess
from lib.config import log
from lib.common.basic import getCurrentPath, makeDir, getDomain
from Downloader import DownLoad... | [
2,
48443,
14629,
14,
12001,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
40477,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
220,
220,
220,
1058,
13130,
14,
19,
14,
940,
838,
25,
940,
3122,
198,
2,
2488,
13838,
220,
1058,
13... | 2.600858 | 233 |
import yagmail
from yagmail.error import YagInvalidEmailAddress, YagConnectionClosed, YagAddressError
import smtplib
| [
11748,
331,
363,
4529,
198,
6738,
331,
363,
4529,
13,
18224,
1330,
575,
363,
44651,
15333,
20231,
11,
575,
363,
32048,
2601,
1335,
11,
575,
363,
20231,
12331,
198,
11748,
895,
83,
489,
571,
628
] | 3.371429 | 35 |
#!/usr/bin/python
print "hello world"
print "goodbye"
print "world!"
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
4798,
366,
31373,
995,
1,
198,
4798,
366,
11274,
16390,
1,
198,
4798,
366,
6894,
2474,
198
] | 2.692308 | 26 |
from .compilation.compile import Compile
from .execution.execute import Execute
from .isolation.isolate import Isolate
from .verification.verificate import Verificate
| [
6738,
764,
5589,
10520,
13,
5589,
576,
1330,
3082,
576,
198,
6738,
764,
18558,
1009,
13,
41049,
1330,
8393,
1133,
198,
6738,
764,
271,
21417,
13,
271,
27976,
1330,
1148,
27976,
198,
6738,
764,
332,
2649,
13,
332,
22460,
1330,
4643,
22... | 3.883721 | 43 |
from single_qubit_classifier import generate_noisy_classification
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
from pyquil import get_qc
from nisqai.data._cdata import CData
from pyquil.g... | [
6738,
2060,
62,
421,
2545,
62,
4871,
7483,
1330,
7716,
62,
3919,
13560,
62,
4871,
2649,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
285,
489,
62,
25981,
74,
896,
13,
76,
29487,
18,
67,
1330,
12176,
274,
... | 2.390415 | 3,130 |
"""
signif_grps.py
This module contains functions to run analyses of ROI groups showing
significant differences between unexpected and expected sequences in the data
generated by the Allen Institute OpenScope experiments for the Credit
Assignment Project.
Authors: Colleen Gillon
Date: October, 2018
Note: this cod... | [
37811,
198,
12683,
361,
62,
2164,
862,
13,
9078,
198,
198,
1212,
8265,
4909,
5499,
284,
1057,
13523,
286,
15107,
40,
2628,
4478,
198,
36591,
5400,
1022,
10059,
290,
2938,
16311,
287,
262,
1366,
220,
198,
27568,
416,
262,
9659,
5136,
4... | 1.878027 | 9,166 |
from transformers import AutoTokenizer
import logging
logger = logging.getLogger("tensor2struct")
| [
6738,
6121,
364,
1330,
11160,
30642,
7509,
198,
198,
11748,
18931,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7203,
83,
22854,
17,
7249,
4943,
628
] | 3.607143 | 28 |
"""Replacement for the load step to use the redshift COPY command instead
"""
import argparse
import pandas.io.sql as pdsql
import psycopg2.extras
from dataduct.config import get_aws_credentials
from dataduct.data_access import redshift_connection
from dataduct.database import SqlStatement
from dataduct.database impo... | [
37811,
39232,
5592,
329,
262,
3440,
2239,
284,
779,
262,
2266,
30846,
27975,
56,
3141,
2427,
198,
37811,
198,
198,
11748,
1822,
29572,
198,
11748,
19798,
292,
13,
952,
13,
25410,
355,
279,
9310,
13976,
198,
11748,
17331,
22163,
70,
17,
... | 2.20712 | 927 |
# Tree
import collections
import json
colours = tree()
colours['other']['black'] = 0x000000
colours['other']['white'] = 0xFFFFFF
colours['primary']['red'] = 0xFF0000
colours['primary']['green'] = 0x00FF00
colours['primary']['blue'] = 0x0000FF
colours['secondary']['yellow'] = 0xFFFF00
colours['secondary']['aqua'] = 0... | [
2,
12200,
198,
198,
11748,
17268,
198,
198,
11748,
33918,
198,
198,
4033,
4662,
796,
5509,
3419,
198,
4033,
4662,
17816,
847,
6,
7131,
6,
13424,
20520,
796,
657,
87,
10535,
198,
4033,
4662,
17816,
847,
6,
7131,
6,
11186,
20520,
796,
... | 2.615854 | 164 |
#!/usr/bin/python
"""Convert an SQL query to a DTD that specifies an XML
dialect for query results
Note:
See http://gnosis.cx/publish/programming/xml_matters_9.txt
for a detailed discussion of this module and its companion,
Scott Hathaway's [sql2xml].
[sql2xml] and its support [db] module can be downloaded ... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
37811,
3103,
1851,
281,
16363,
12405,
284,
257,
360,
21016,
326,
26052,
281,
23735,
198,
38969,
478,
329,
12405,
2482,
198,
198,
6425,
25,
628,
220,
4091,
2638,
1378,
4593,
5958,
13,
66,... | 2.458233 | 2,490 |
from urllib.parse import urlencode
from werkzeug.exceptions import NotFound
from flask import current_app, request, _request_ctx_stack
from flask_babelex import get_locale
from oy.wrappers import OyModule
from oy.babel import gettext, ngettext, lazy_gettext
from oy.dynamicform import Field
from .settings import current... | [
6738,
2956,
297,
571,
13,
29572,
1330,
2956,
11925,
8189,
198,
6738,
266,
9587,
2736,
1018,
13,
1069,
11755,
1330,
1892,
21077,
198,
6738,
42903,
1330,
1459,
62,
1324,
11,
2581,
11,
4808,
25927,
62,
49464,
62,
25558,
198,
6738,
42903,
... | 3.2625 | 160 |
# server.py
# ---------
# This script starts the backend server, so that requests from clients
# can be served. Clientswill ask for all the current messages, create messages,
# and delete messages, and the server will fulfill these requests.
# After running this script, you should be able to visit the following URLs i... | [
2,
4382,
13,
9078,
198,
2,
45337,
198,
2,
770,
4226,
4940,
262,
30203,
4382,
11,
523,
326,
7007,
422,
7534,
198,
2,
460,
307,
4983,
13,
1012,
2334,
10594,
1265,
329,
477,
262,
1459,
6218,
11,
2251,
6218,
11,
198,
2,
290,
12233,
... | 3.480501 | 718 |
"""
dataclass for features
"""
from dataclasses import dataclass, field
from typing import List, Optional
@dataclass()
class FeatureParams:
"""
Features
"""
categorical_features: List[str]
numerical_features: List[str]
features_to_drop: List[str]
target_col: Optional[str]
... | [
37811,
201,
198,
19608,
330,
31172,
329,
3033,
201,
198,
37811,
201,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
11,
2214,
201,
198,
6738,
19720,
1330,
7343,
11,
32233,
201,
198,
201,
198,
201,
198,
31,
19608,
330,
31172,
341... | 2.548611 | 144 |
# Copyright TeleBot
# For @TeleBotHelp coded by @xditya
# Kangers keep credits else I'll take down 🧐
import sys
from telethon import events, functions, version, __version__
import random
from userbot.utils import register
from userbot import ALIVE_NAME
from userbot.utils import admin_cmd
DEFAULTUSER = str(ALIVE_NAME... | [
2,
15069,
14318,
20630,
198,
2,
1114,
2488,
31709,
20630,
22087,
30817,
416,
2488,
24954,
414,
64,
198,
2,
509,
6606,
1394,
10824,
2073,
314,
1183,
1011,
866,
12520,
100,
238,
198,
198,
11748,
25064,
198,
6738,
5735,
400,
261,
1330,
2... | 1.910644 | 761 |
"""
Test alsa.signal_proc.
"""
import pytest
from alsa import signal_proc
@pytest.mark.parametrize(
"img_path,override_ridge_config",
[
("image.png", {}),
(
"image.png",
{
"optional_parameters": {"Line_width": 2},
"further_options": {"C... | [
37811,
198,
14402,
435,
11400,
13,
12683,
282,
62,
36942,
13,
198,
37811,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
435,
11400,
1330,
6737,
62,
36942,
628,
198,
31,
9078,
9288,
13,
4102,
13,
17143,
316,
380,
2736,
7,
198,
220,
2... | 2.2125 | 480 |
from flask import redirect, render_template, url_for, flash, request, session, current_app
from shop import db, app, photos, bcrypt, login_manager
from flask_login import login_required, current_user, logout_user, login_user
from .forms import CustomerRegisterForm, CustomerLoginForm
from .models import Register, Cu... | [
6738,
42903,
1330,
18941,
11,
8543,
62,
28243,
11,
19016,
62,
1640,
11,
7644,
11,
2581,
11,
6246,
11,
1459,
62,
1324,
201,
198,
6738,
6128,
1330,
20613,
11,
598,
11,
5205,
11,
275,
29609,
11,
17594,
62,
37153,
201,
198,
6738,
42903,... | 2.859244 | 476 |
import logging
import re
from datetime import datetime
from types import NoneType
_log = logging.getLogger(__name__)
| [
11748,
18931,
198,
11748,
302,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
3858,
1330,
6045,
6030,
198,
198,
62,
6404,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
628,
628
] | 3.457143 | 35 |
from .hooks import *
| [
6738,
764,
25480,
82,
1330,
1635,
198
] | 3 | 7 |
import pandas as pd
import numpy as np
import metapy
from ast import literal_eval
| [
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1138,
12826,
198,
6738,
6468,
1330,
18875,
62,
18206,
628
] | 3.458333 | 24 |
"""
Tornado TemplateLoader that pulls data from a Python package installation
"""
import logging
import pkgutil
from os import path
from tornado import template
LOGGER = logging.getLogger(__name__)
class TemplateLoader(template.BaseLoader):
"""A template loader that loads from Python package data."""
def ... | [
37811,
198,
51,
1211,
4533,
37350,
17401,
326,
16194,
1366,
422,
257,
11361,
5301,
9988,
198,
198,
37811,
198,
11748,
18931,
198,
11748,
279,
10025,
22602,
198,
6738,
28686,
1330,
3108,
198,
198,
6738,
33718,
1330,
11055,
198,
198,
25294,... | 2.50455 | 989 |
import datetime
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.utils import timezone
from django.views import generic
from .models import Question, Answer
from notifications.models import PushNotification
| [
11748,
4818,
8079,
198,
198,
6738,
42625,
14208,
13,
4023,
1330,
367,
29281,
31077,
7738,
1060,
198,
6738,
42625,
14208,
13,
19509,
23779,
1330,
651,
62,
15252,
62,
273,
62,
26429,
11,
8543,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
... | 3.886076 | 79 |
zork = 0
print('Before', zork)
for thing in [9, 41, 12, 3, 74, 15]:
zork = zork + 1
print(zork, thing)
print('After', zork)
| [
89,
967,
796,
657,
198,
4798,
10786,
8421,
3256,
1976,
967,
8,
198,
1640,
1517,
287,
685,
24,
11,
6073,
11,
1105,
11,
513,
11,
8915,
11,
1315,
5974,
198,
220,
220,
220,
1976,
967,
796,
1976,
967,
1343,
352,
198,
220,
220,
220,
3... | 2.2 | 60 |
import pytest
from datetime import datetime
from cowait.tasks.schedule.schedule_definition import ScheduleDefinition, schedule_match
| [
11748,
12972,
9288,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
9875,
4548,
13,
83,
6791,
13,
15952,
5950,
13,
15952,
5950,
62,
46758,
1330,
19281,
36621,
11,
7269,
62,
15699,
628,
198
] | 3.970588 | 34 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-17 22:02
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
940,
13,
23,
319,
2177,
12,
1065,
12,
1558,
2534,
25,
2999,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,
... | 2.73913 | 69 |
#!/bin/python3
import math
import os
import random
import re
import sys
# Complete the solve function below.
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
s = input()
result = solve(s)
fptr.write(result + '\n')
fptr.close()
| [
2,
48443,
8800,
14,
29412,
18,
201,
198,
201,
198,
11748,
10688,
201,
198,
11748,
28686,
201,
198,
11748,
4738,
201,
198,
11748,
302,
201,
198,
11748,
25064,
201,
198,
201,
198,
2,
13248,
262,
8494,
2163,
2174,
13,
201,
198,
361,
11... | 2.227273 | 132 |
from tkinter import * # import all
from tkinter import filedialog
root = Tk("Text Editor")
root.title("Text Editor")
text = Text(root)
text.grid()
button=Button(root, text="Save", command=saveas)
button.grid()
if __name__ == "__main__":
root.mainloop() | [
6738,
256,
74,
3849,
1330,
1635,
220,
1303,
1330,
477,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
198,
15763,
796,
309,
74,
7203,
8206,
12058,
4943,
198,
15763,
13,
7839,
7203,
8206,
12058,
4943,
198,
5239,
796,
8255,
7,
1... | 2.806452 | 93 |
from __future__ import print_function
import eventlet
eventlet.monkey_patch() # noqa (code before rest of imports)
import errno
import inspect
import logging
import logging.config
import os
import re
import signal
import sys
import six
import yaml
from eventlet import backdoor
from nameko.constants import AMQP_URI_... | [
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
198,
11748,
1785,
1616,
198,
15596,
1616,
13,
49572,
62,
17147,
3419,
220,
1303,
645,
20402,
357,
8189,
878,
1334,
286,
17944,
8,
198,
198,
11748,
11454,
3919,
198,
11748,
10104,
198,
... | 3.262857 | 175 |
import urllib.parse
import base64
import binascii
from bottle import route, run, template, post, request, get, redirect, response, static_file
codecs = ["base64", "url", "hex"]
@get('/')
@get('/hex')
@get('/url')
@get('/base64')
@post('/hex')
@post('/url')
@post('/base64')
@route('/static/<filename>')
run(hos... | [
11748,
2956,
297,
571,
13,
29572,
198,
11748,
2779,
2414,
198,
11748,
9874,
292,
979,
72,
198,
6738,
9294,
1330,
6339,
11,
1057,
11,
11055,
11,
1281,
11,
2581,
11,
651,
11,
18941,
11,
2882,
11,
9037,
62,
7753,
198,
198,
19815,
721,
... | 2.398601 | 143 |
import numpy as np
import numpy.random
from xaikit import utils
from xaikit.explainers import breakdown
def shap(estimator, x, x0, features=None, n_permutations=10, seed=42):
"""
Calculates Shapley Additive Explanations (SHAP) contributions.
:param estimator: An estimator compatible with the scikit-lear... | [
11748,
299,
32152,
355,
45941,
198,
11748,
299,
32152,
13,
25120,
198,
198,
6738,
2124,
64,
1134,
270,
1330,
3384,
4487,
198,
6738,
2124,
64,
1134,
270,
13,
20676,
50221,
1330,
14608,
628,
198,
4299,
427,
499,
7,
395,
320,
1352,
11,
... | 2.643432 | 746 |
# I am entirely aware this code has nowhere near enough comments :)
# Module imports
from PyQt5 import QtCore, QtGui, QtWidgets
from queue import Queue
from PIL import Image
import easygui
import getpass
import sys
import os
from tkinter.filedialog import askdirectory, askopenfilename, askopenfilenames
im... | [
2,
314,
716,
5000,
3910,
428,
2438,
468,
12062,
1474,
1576,
3651,
14373,
201,
198,
201,
198,
2,
19937,
17944,
201,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
14055,
11,
33734,
8205,
72,
11,
33734,
54,
312,
11407,
201,
198,
6738,
1683... | 2.767932 | 237 |
import math
import petname
from maglearn_back import celery
from maglearn_back.database import db
from maglearn_back.library.data_generation import DampedSineWave, \
generate_random_fun_samples
from maglearn_back.model import Dataset
@celery.task
def generate(name, size):
"""Generates new dataset."""
... | [
11748,
10688,
198,
11748,
4273,
3672,
198,
198,
6738,
2153,
35720,
62,
1891,
1330,
18725,
1924,
198,
6738,
2153,
35720,
62,
1891,
13,
48806,
1330,
20613,
198,
6738,
2153,
35720,
62,
1891,
13,
32016,
13,
7890,
62,
20158,
1330,
360,
13322... | 2.114355 | 411 |
#!/usr/bin/python3
import sys
import os
import logging
sys.path.insert(1, os.path.abspath('../geo'))
import obfdata
if __name__ == '__main__':
logging.basicConfig(filename='obinfo.log', filemode='w', level=logging.INFO)
main('/mnt/mobihome/maps/Russia_central-federal-district_asia_2.obf')
| [
2,
48443,
14629,
14,
8800,
14,
29412,
18,
198,
198,
11748,
25064,
198,
11748,
28686,
198,
11748,
18931,
198,
17597,
13,
6978,
13,
28463,
7,
16,
11,
28686,
13,
6978,
13,
397,
2777,
776,
10786,
40720,
469,
78,
6,
4008,
198,
11748,
909... | 2.529412 | 119 |
from raiden_client.endpoints.payment_events import PaymentEvents
| [
6738,
9513,
268,
62,
16366,
13,
437,
13033,
13,
37301,
62,
31534,
1330,
28784,
37103,
628
] | 4.125 | 16 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Linyxus'
from scipy.io import loadmat
import scipy.misc as smi
import numpy as np
img_size = (32, 32)
if __name__ == '__main__':
imgs = load('../dogs')
print(imgs[0]) | [
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,
834,
9800,
834,
796,
705,
43,
3541,
40832,
6,
198,
198,
6738,
629,
541,
88,
13,
952,
1330,
3440,
6759,
198... | 2.233645 | 107 |
# Copyright 2018 James William Balcomb. 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 applica... | [
2,
15069,
2864,
3700,
3977,
8528,
24011,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
... | 3.811594 | 276 |
# -*- coding: utf-8 -*-
"""
Tutorial device collection
"""
# This is how you create a collection of devices, just add all the classes in this file
# Check the end of this file, we run a command to make samplemaker aware of our devices
import samplemaker.makers as sm # used for drawing
from samplemaker.devices import... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
51,
44917,
3335,
4947,
198,
198,
37811,
198,
198,
2,
770,
318,
703,
345,
2251,
257,
4947,
286,
4410,
11,
655,
751,
477,
262,
6097,
287,
428,
2393,
198,
2... | 3.923611 | 144 |
import tensorflow as tf
import tensorflow.contrib.layers as tfc_layers
import neural_toolbox.ft_utils as ft_utils
import neural_toolbox.rnn as rnn
from generic.tf_factory.image_factory import get_image_features
from generic.tf_factory.attention_factory import get_attention
from generic.tf_utils.abstract_network impor... | [
11748,
11192,
273,
11125,
355,
48700,
198,
11748,
11192,
273,
11125,
13,
3642,
822,
13,
75,
6962,
355,
256,
16072,
62,
75,
6962,
198,
198,
11748,
17019,
62,
25981,
3524,
13,
701,
62,
26791,
355,
10117,
62,
26791,
198,
11748,
17019,
62... | 2.886525 | 282 |
import java.util.regex.Matcher
import sys
import java.util.regex.Pattern
import os
import operator
import socket
import re
import time
import datetime
import string
import time
from java.lang import *
from java.util import Date
import weblogic.security.internal.SerializedSystemIni
import weblogic.securi... | [
201,
198,
11748,
20129,
13,
22602,
13,
260,
25636,
13,
19044,
2044,
201,
198,
11748,
25064,
201,
198,
11748,
20129,
13,
22602,
13,
260,
25636,
13,
47546,
201,
198,
11748,
28686,
201,
198,
11748,
10088,
201,
198,
11748,
17802,
201,
198,
... | 2.25479 | 30,582 |
import xml.etree.ElementTree as ET
def get_sentence_data(fn):
"""
Parses a sentence file from the Flickr30K Entities dataset
input:
fn - full file path to the sentence file to parse
output:
a list of dictionaries for each sentence with the following fields:
sentence - the or... | [
11748,
35555,
13,
316,
631,
13,
20180,
27660,
355,
12152,
198,
198,
4299,
651,
62,
34086,
594,
62,
7890,
7,
22184,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
23042,
274,
257,
6827,
2393,
422,
262,
27085,
1270,
42,
7232,
87... | 1.970432 | 2,266 |
from elegy.module import Deferable
from elegy import hooks
import typing as tp
import haiku as hk
import numpy as np
class Flatten(hk.Flatten, Deferable):
"""
Flattens the input, preserving the batch dimension(s).
By default, Flatten combines all dimensions except the first.
Additional leading dimen... | [
6738,
9766,
1360,
13,
21412,
1330,
2896,
263,
540,
198,
6738,
9766,
1360,
1330,
26569,
198,
11748,
19720,
355,
256,
79,
198,
198,
11748,
387,
28643,
355,
289,
74,
198,
11748,
299,
32152,
355,
45941,
628,
198,
4871,
1610,
41769,
7,
71,... | 2.439163 | 526 |
from util import hook
import sched, time
#from datetime import datetime, timedelta
# def db_init(db):
# db.execute("create table if not exists scheduler(id primary key, time, action)")
# db.commit()
#split = inp.split(' ')
#timer = int(inp[0])
#action = " ".join(inp[1:])
#command = 'MODE {} -b {}'.format('... | [
6738,
7736,
1330,
8011,
198,
11748,
6038,
11,
640,
628,
198,
2,
6738,
4818,
8079,
1330,
4818,
8079,
11,
28805,
12514,
198,
198,
2,
825,
20613,
62,
15003,
7,
9945,
2599,
198,
2,
220,
220,
220,
220,
20613,
13,
41049,
7203,
17953,
3084... | 2.633898 | 295 |
from pathlib import Path
from fhir.resources.codesystem import CodeSystem
from oops_fhir.utils import CodeSystemConcept
__all__ = ["InterventionCodes"]
_resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json"))
class InterventionCodes:
"""
Intervention Codes
This value set includes sampl... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
277,
71,
343,
13,
37540,
13,
40148,
6781,
1330,
6127,
11964,
198,
198,
6738,
267,
2840,
62,
69,
71,
343,
13,
26791,
1330,
6127,
11964,
3103,
984,
628,
198,
834,
439,
834,
796,
14631,
94... | 2.764493 | 276 |
from collections import Counter
from news_headlines import abc_headlines, news_dotcomau_headlines, smh_headlines, nine_headlines, australian_headlines, guardian_headlines, sbs_headlines, skynews_headlines
from sentiment_analysis import sentiment_analysis
def count_sentiment(sentiment):
"""
Returns the frequen... | [
6738,
17268,
1330,
15034,
198,
6738,
1705,
62,
2256,
6615,
1330,
450,
66,
62,
2256,
6615,
11,
1705,
62,
26518,
785,
559,
62,
2256,
6615,
11,
895,
71,
62,
2256,
6615,
11,
5193,
62,
2256,
6615,
11,
38132,
1373,
666,
62,
2256,
6615,
... | 2.835821 | 402 |
from base import BaseCog
from economy.services import EconomyService
| [
6738,
2779,
1330,
7308,
34,
519,
198,
6738,
3773,
13,
30416,
1330,
18493,
16177,
628
] | 4.666667 | 15 |
import unittest
from test import check_type
from typing import List, Dict, Set
import warnings
import src.warnings as ws
import src.errors as err
import src.gender_nouns as gn
from src.handle_context_values import ContextValues
| [
198,
11748,
555,
715,
395,
198,
6738,
1332,
1330,
2198,
62,
4906,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
11,
5345,
198,
11748,
14601,
198,
198,
11748,
12351,
13,
40539,
654,
355,
266,
82,
198,
11748,
12351,
13,
48277,
355,
11454,... | 3.5 | 66 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import numpy as np
import torch
import torch.nn as nn
from torch.utils.data import DataLoader, RandomSampler, SequentialSampler
from torch.utils.data.distributed import DistributedSampler
from transformers.modeling_bert impo... | [
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
198,
2,
49962,
739,
262,
17168,
13789,
13,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
6738,
28034,
13,
2... | 2.773512 | 521 |
import copy
import unittest
import numpy as np
from program_synthesis.karel.dataset import mutation
from program_synthesis.karel.dataset import parser_for_synthesis
if __name__ == '__main__':
unittest.main()
| [
11748,
4866,
198,
11748,
555,
715,
395,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
6738,
1430,
62,
1837,
429,
8497,
13,
74,
20318,
13,
19608,
292,
316,
1330,
15148,
198,
6738,
1430,
62,
1837,
429,
8497,
13,
74,
20318,
13,
19... | 2.842105 | 76 |
import os
import cv2 as cv
import matplotlib.pyplot as plt
| [
11748,
28686,
198,
11748,
269,
85,
17,
355,
269,
85,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
628,
198
] | 2.652174 | 23 |
def Void(*expr, **kexpr):
"""
>>> name = "World"
>>> hello = lambda name: print("Hello, " + str(name))
>>> def puts(s:str, *args, **kwargs):
... print(s, *args, **kwargs)
... return s
>>>
>>> Void(name) # => None
>>> Void(hello(name)) # => None. Output: "Hello, World"
H... | [
198,
4299,
18331,
46491,
31937,
11,
12429,
365,
87,
1050,
2599,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
13163,
1438,
796,
366,
10603,
1,
198,
220,
220,
220,
13163,
23748,
796,
37456,
1438,
25,
3601,
7203,
15496,
11,
366,
1343,
... | 2.19222 | 437 |
from UserCache import *
from unittest import TestCase
| [
6738,
11787,
30562,
1330,
1635,
198,
6738,
555,
715,
395,
1330,
6208,
20448,
628
] | 3.928571 | 14 |
import logging
import os
import numpy as np
import torch
from sklearn.metrics import classification_report, confusion_matrix
from torch.utils.data import DataLoader
from tqdm import tqdm
from feature_embeddings import BertPrep
from train import BertForNegationCueClassification, NegCueDataset
import config
def eval... | [
11748,
18931,
198,
11748,
28686,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
28034,
198,
6738,
1341,
35720,
13,
4164,
10466,
1330,
17923,
62,
13116,
11,
10802,
62,
6759,
8609,
198,
6738,
28034,
13,
26791,
13,
7890,
1330,
6060,
... | 2.13037 | 2,677 |
# -*- coding: utf-8 -*-
import os
import pickle
testDic = dict(name='Anliven', age=29, score=85)
testFile = 'test.txt'
f = open(testFile, 'wb')
f.write(pickle.dumps(testDic)) # pickle.dumps()可以把任意对象序列化成一个bytes,然后可以把这个bytes写入文件
f.close()
with open(testFile, 'rb') as f:
print(pickle.loads(f.read())) # ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
201,
198,
11748,
28686,
201,
198,
11748,
2298,
293,
201,
198,
201,
198,
9288,
35,
291,
796,
8633,
7,
3672,
11639,
2025,
75,
1469,
3256,
2479,
28,
1959,
11,
4776,
... | 1.146877 | 1,777 |
# global
from typing import Union, Optional, Tuple, List
# local
import ivy
from ivy.framework_handler import current_framework as _cur_framework
# Array API Standard #
# -------------------#
def flip(x: Union[ivy.Array, ivy.NativeArray],
axis: Optional[Union[int, Tuple[int], List[int]]] = None)\
->... | [
2,
3298,
198,
6738,
19720,
1330,
4479,
11,
32233,
11,
309,
29291,
11,
7343,
198,
198,
2,
1957,
198,
11748,
21628,
88,
198,
6738,
21628,
88,
13,
30604,
62,
30281,
1330,
1459,
62,
30604,
355,
4808,
22019,
62,
30604,
628,
198,
2,
15690... | 3.043988 | 341 |
import dataclasses
import os
import enum
import pprint
import typing
from collections.abc import MutableMapping, MutableSequence, MutableSet
from datetime import datetime
from io import TextIOBase
from typing import Iterator
from typing import List
from typing import TypeVar
T = TypeVar("T") # Any type.
KT = TypeVar(... | [
11748,
4818,
330,
28958,
198,
11748,
28686,
198,
11748,
33829,
198,
11748,
279,
4798,
198,
11748,
19720,
198,
6738,
17268,
13,
39305,
1330,
13859,
540,
44,
5912,
11,
13859,
540,
44015,
594,
11,
13859,
540,
7248,
198,
6738,
4818,
8079,
1... | 2.665531 | 1,468 |
from pygrank.algorithms.filters import *
from pygrank.algorithms.postprocess import *
from pygrank.algorithms.autotune import *
from pygrank.algorithms.utils import *
| [
6738,
12972,
2164,
962,
13,
282,
7727,
907,
13,
10379,
1010,
1330,
1635,
198,
6738,
12972,
2164,
962,
13,
282,
7727,
907,
13,
7353,
14681,
1330,
1635,
198,
6738,
12972,
2164,
962,
13,
282,
7727,
907,
13,
2306,
313,
1726,
1330,
1635,
... | 2.982143 | 56 |
# Ejercicio 8 Parte 1
Algoritmo descomponer
# Descompone 'ca' en 'componentes' en 'dimensión' cadenas separadas por 'separador'.
Entrada
ca : CADENA # La cadena a descomponer
separador : CARACTER # El carácter que separa las cadenas
componentes : TABLA[CADENA] # Los componentes de 'ca'
dimensión :... | [
2,
412,
73,
2798,
46441,
807,
2142,
68,
352,
198,
198,
2348,
7053,
270,
5908,
748,
5589,
14491,
198,
2,
2935,
5589,
505,
705,
6888,
6,
551,
705,
42895,
274,
6,
551,
705,
67,
12117,
72,
18840,
6,
20603,
268,
292,
2880,
38768,
16964... | 1.972995 | 2,481 |
# Generated by Django 3.0.7 on 2020-06-19 09:48
from django.db import migrations
| [
2,
2980,
515,
416,
37770,
513,
13,
15,
13,
22,
319,
12131,
12,
3312,
12,
1129,
7769,
25,
2780,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
628
] | 2.766667 | 30 |
cleanup_manifest = rule(
implementation = _cleanup_manifest_impl,
attrs = {
"src": attr.label(allow_single_file = True),
"_bin": attr.label(
executable = True,
cfg = "host",
default = "//go/cmd/manifest-cleaner",
),
},
)
| [
198,
27773,
929,
62,
805,
8409,
796,
3896,
7,
198,
220,
220,
220,
7822,
796,
4808,
27773,
929,
62,
805,
8409,
62,
23928,
11,
198,
220,
220,
220,
708,
3808,
796,
1391,
198,
220,
220,
220,
220,
220,
220,
220,
366,
10677,
1298,
708,
... | 1.973154 | 149 |
# BOJ 5373 (큐빙)
import sys
sys.stdin = open('../input.txt', 'r')
si = sys.stdin.readline
cube = [[['w', 'w', 'w'], ['w', 'w', 'w'], ['w', 'w', 'w']],
[['o', 'o', 'o'], ['o', 'o', 'o'], ['o', 'o', 'o']],
[['b', 'b', 'b'], ['b', 'b', 'b'], ['b', 'b', 'b']],
[['g', 'g', 'g'], ['g', 'g', 'g'], ['g... | [
2,
16494,
41,
642,
34770,
357,
169,
223,
238,
167,
117,
247,
8,
198,
11748,
25064,
198,
198,
17597,
13,
19282,
259,
796,
1280,
10786,
40720,
15414,
13,
14116,
3256,
705,
81,
11537,
198,
13396,
796,
25064,
13,
19282,
259,
13,
961,
13... | 1.661818 | 275 |
# Copyright (c) 2022. K2-Software
# All software, both binary and source published by K2-Software (hereafter, Software) is copyrighted by the author (hereafter, K2-Software) and ownership of all right, title and interest in and to the Software remains with K2-Software. By using or copying the Software, User agrees to a... | [
2,
15069,
357,
66,
8,
33160,
13,
509,
17,
12,
25423,
198,
2,
1439,
3788,
11,
1111,
13934,
290,
2723,
3199,
416,
509,
17,
12,
25423,
357,
1456,
8499,
11,
10442,
8,
318,
33696,
416,
262,
1772,
357,
1456,
8499,
11,
509,
17,
12,
254... | 4.017857 | 112 |
from copy import deepcopy
import numpy as np
import pytest
import torch
# TODO: Ingore warning has no effect
@pytest.mark.filterwarnings("ignore:the imp module is deprecated:DeprecationWarning")
| [
6738,
4866,
1330,
2769,
30073,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
12972,
9288,
198,
11748,
28034,
628,
198,
198,
2,
16926,
46,
25,
17589,
382,
6509,
468,
645,
1245,
198,
31,
9078,
9288,
13,
4102,
13,
24455,
40539,
65... | 3.457627 | 59 |
from flask_admin import Admin
from core import app, db
from core.admin_portal.admin_models import MyModelViewUser, MyModelViewPost, MyAdminIndexView
from core.models import User, Post
from flask_admin.menu import MenuLink
admin = Admin(app, name='corgiTexter', template_mode='bootstrap3', index_view=MyAdminIndexView()... | [
6738,
42903,
62,
28482,
1330,
32053,
198,
6738,
4755,
1330,
598,
11,
20613,
198,
6738,
4755,
13,
28482,
62,
634,
282,
13,
28482,
62,
27530,
1330,
2011,
17633,
7680,
12982,
11,
2011,
17633,
7680,
6307,
11,
2011,
46787,
15732,
7680,
198,
... | 3.052632 | 171 |
from win10toast import ToastNotifier
| [
6738,
1592,
940,
1462,
459,
1330,
46831,
3673,
7483,
198
] | 3.7 | 10 |
"""
An example script for running SPOM simulations.
"""
import time
import numpy
import model.grid
from model.grid import Species, Grid
import habitat
# The size of the simulation grid
height, width = 256, 256
# Simulation time
time_steps = 100
# A flag to indicate whether to use matplotlib the results.
# If you... | [
37811,
198,
1052,
1672,
4226,
329,
2491,
6226,
2662,
27785,
13,
198,
37811,
198,
198,
11748,
640,
198,
11748,
299,
32152,
198,
198,
11748,
2746,
13,
25928,
198,
6738,
2746,
13,
25928,
1330,
28540,
11,
24846,
198,
11748,
20018,
198,
198,... | 3.159236 | 628 |
"""Create example test data."""
import csv
import random
import string
import uuid
if __name__ == "__main__":
generated_data = []
for _ in range(100):
product = random.choice(string.ascii_uppercase) # noqa: S311
serial_no = uuid.uuid4()
generated_data.append(
(
... | [
37811,
16447,
1672,
1332,
1366,
526,
15931,
198,
11748,
269,
21370,
198,
11748,
4738,
198,
11748,
4731,
198,
11748,
334,
27112,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
7560,
62,
7890,
796,
... | 2.093023 | 301 |
# Add a reading
# List readings
# Get readings for a given serial number
# Get readings for a given date/time range
#etc
import unittest
import random
import datetime as dt
from pathlib import Path
from stored_readings import StoredReadings
if __name__ == '__main__':
print("Starting Tests.")
u... | [
2,
3060,
257,
3555,
201,
198,
2,
7343,
24654,
201,
198,
2,
3497,
24654,
329,
257,
1813,
11389,
1271,
201,
198,
2,
3497,
24654,
329,
257,
1813,
3128,
14,
2435,
2837,
201,
198,
2,
14784,
201,
198,
201,
198,
11748,
555,
715,
395,
201... | 2.905983 | 117 |
#!/usr/bin/env python
"""Convert Apple Mail's emlx files to plain text files usable
by SpamBayes's testtools.
Usage: %(program)s [options] path
Where:
-h
Show usage and exit.
-e mailbox
Name of mailbox or account to exclude. Drafts and
Sent Messages are always excluded.
-q
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
3103,
1851,
4196,
11099,
338,
795,
75,
87,
3696,
284,
8631,
2420,
3696,
24284,
198,
1525,
1338,
321,
15262,
274,
338,
1332,
31391,
13,
198,
198,
28350,
25,
4064,
7,
23065,
... | 2.906667 | 900 |