content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
from torch.utils.data import Dataset
import torch
import os
from PIL import Image
import pandas as pd
import numpy as np
from glob import glob
from pathlib import Path
from os.path import sep
from loguru import logger
from torchaudio.transforms import MelSpectrogram, AmplitudeToDB
from uquake.core.trace import Trace
fr... | [
6738,
28034,
13,
26791,
13,
7890,
1330,
16092,
292,
316,
198,
11748,
28034,
198,
11748,
28686,
198,
6738,
350,
4146,
1330,
7412,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
15095,
1330,
15095,
19... | 2.481914 | 857 |
import sys
import webview
from core.api import PFSApi
__version__ = '0.2.0'
from core.logging import add_stream_handler, add_jsapi_handler
if __name__ == "__main__":
api = PFSApi()
url = "ui/index.html" if is_frozen() else "http://localhost:8080"
add_stream_handler()
add_jsapi_handler(send_func=... | [
11748,
25064,
198,
198,
11748,
3992,
1177,
198,
198,
6738,
4755,
13,
15042,
1330,
28223,
4090,
14415,
198,
198,
834,
9641,
834,
796,
705,
15,
13,
17,
13,
15,
6,
198,
198,
6738,
4755,
13,
6404,
2667,
1330,
751,
62,
5532,
62,
30281,
... | 2.342342 | 222 |
"""Add listable column to design table
Revision ID: 0009
Revises: 0008
Create Date: 2019-06-26 10:11:12.224125
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '0009'
down_revision = '0008'
branch_labels = None
depends_on = None
| [
37811,
4550,
1351,
540,
5721,
284,
1486,
3084,
198,
198,
18009,
1166,
4522,
25,
12877,
24,
198,
18009,
2696,
25,
12877,
23,
198,
16447,
7536,
25,
13130,
12,
3312,
12,
2075,
838,
25,
1157,
25,
1065,
13,
24137,
11623,
198,
198,
37811,
... | 2.805825 | 103 |
# record.py
#
# Copyright 2007 Bryan O'Sullivan <bos@serpentine.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''commands to interactively select changes for commit/qrefresh'''
from mercurial.i18n import _
from mercurial i... | [
2,
1700,
13,
9078,
198,
2,
198,
2,
15069,
4343,
17857,
440,
6,
47572,
1279,
39565,
31,
2655,
16923,
500,
13,
785,
29,
198,
2,
198,
2,
770,
3788,
743,
307,
973,
290,
9387,
1864,
284,
262,
2846,
286,
262,
198,
2,
22961,
3611,
5094... | 1.993355 | 6,020 |
from .mortgages import *
from .mbs import *
from .rates import *
from .rootfinding import * | [
6738,
764,
30171,
70,
1095,
1330,
1635,
198,
6738,
764,
76,
1443,
1330,
1635,
198,
6738,
764,
9700,
1330,
1635,
198,
6738,
764,
15763,
41070,
1330,
1635
] | 3.37037 | 27 |
from pylti1p3.session import SessionService
| [
6738,
12972,
2528,
72,
16,
79,
18,
13,
29891,
1330,
23575,
16177,
628
] | 3.461538 | 13 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import logging
from django.db.utils import ConnectionHandler, ProgrammingError
from django.test.testcases import LiveServerTestCase, TestCase
from rest_models.backend.auth import OAuthToken
from rest_models.backend.conne... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
3601,
62,
8818,
11,
28000,
1098,
62,
17201,
874,
198,
198,
11748,
18931,
198,
198,
6738,
42625,
14208,
13,
9945,
13,
... | 3.361842 | 152 |
from ..models import Product
from ..search import update_product_search_vector, update_products_search_vector
| [
6738,
11485,
27530,
1330,
8721,
198,
6738,
11485,
12947,
1330,
4296,
62,
11167,
62,
12947,
62,
31364,
11,
4296,
62,
29498,
62,
12947,
62,
31364,
628,
198
] | 4.148148 | 27 |
# Calculator
try:
from tkinter import *
except:
from Tkinter import *
if __name__ == "__main__":
my_cal = Calculator()
my_cal.show()
| [
2,
43597,
201,
198,
28311,
25,
201,
198,
220,
220,
220,
422,
256,
74,
3849,
1330,
1635,
201,
198,
16341,
25,
201,
198,
220,
220,
220,
422,
309,
74,
3849,
1330,
1635,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
201,
198,
20... | 2.1125 | 80 |
# -*- coding: utf-8 -*-
"""
text utils module
A collection of text-related utility functions. Hurray!
"""
# Python 2 / Python 3 compatibility fu
# http://python-future.org/compatible_idioms.html
from __future__ import absolute_import
from __future__ import unicode_literals # so strings without u'' are unicode
# ... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
628,
198,
37811,
198,
5239,
3384,
4487,
8265,
198,
198,
32,
4947,
286,
2420,
12,
5363,
10361,
5499,
13,
10077,
2433,
0,
198,
37811,
628,
198,
2,
11361,
362,
1220,
11361,
51... | 2.803279 | 793 |
"""
Get the intersection of predictors, the best predictor in each interval and merge intervals with same best predictor
"""
import numpy as np
from collections import defaultdict
from itertools import combinations
def get_intersection_point(x_1, y_1, x_2, y_2):
"""
Get the intersection point of two predicto... | [
37811,
198,
3855,
262,
16246,
286,
4331,
669,
11,
262,
1266,
41568,
287,
1123,
16654,
290,
20121,
20016,
351,
976,
1266,
41568,
198,
37811,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
17268,
1330,
4277,
11600,
198,
6738,
340,
86... | 2.18348 | 1,477 |
"""
Trait for a Slot meant to contain an object of a particular type
or having a particular interface (either a Traits interface or a
zope.interface).
"""
# The regular Instance class that comes with Traits will only check public
# methods on an object if that object is not a HasTraits object, which means
# we get e... | [
37811,
198,
51,
12907,
329,
257,
32026,
4001,
284,
3994,
281,
2134,
286,
257,
1948,
2099,
198,
273,
1719,
257,
1948,
7071,
357,
31336,
257,
4759,
896,
7071,
393,
257,
198,
89,
3008,
13,
39994,
737,
220,
220,
198,
37811,
198,
198,
2,... | 3.583039 | 283 |
from polyphony import testbench
g_v0 = 20150529
g_v1 = 20170406
@testbench
test()
| [
6738,
7514,
23021,
1330,
1332,
26968,
198,
198,
70,
62,
85,
15,
796,
580,
31654,
1959,
198,
70,
62,
85,
16,
796,
580,
2154,
29703,
198,
198,
31,
9288,
26968,
198,
198,
9288,
3419,
198
] | 2.428571 | 35 |
import cv2
import numpy as np
| [
11748,
269,
85,
17,
198,
11748,
299,
32152,
355,
45941,
628
] | 2.818182 | 11 |
# Generated by Django 3.1 on 2021-01-04 02:41
from django.db import migrations, models
| [
2,
2980,
515,
416,
37770,
513,
13,
16,
319,
33448,
12,
486,
12,
3023,
7816,
25,
3901,
198,
198,
6738,
42625,
14208,
13,
9945,
1330,
15720,
602,
11,
4981,
628
] | 2.966667 | 30 |
import yaml
import pathlib
try:
from yaml import CSafeDumper as BaseDumper
from yaml import CSafeLoader as BaseLoader
except ImportError:
from yaml import SafeDumper as BaseDumper
from yaml import SafeLoader as BaseLoader
yaml.add_constructor("!EnsureDir", Loader.ensure_dir_load, Loader=Loade... | [
11748,
331,
43695,
198,
11748,
3108,
8019,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
331,
43695,
1330,
9429,
8635,
35,
15829,
355,
7308,
35,
15829,
198,
220,
220,
220,
422,
331,
43695,
1330,
9429,
8635,
17401,
355,
7308,
17401,
19... | 2.708447 | 367 |
'''
Autor: Pedro Augusto
Objetivo: implemente um programa em Python que recebe um número real e informe se é igual a zero,
número positivo ou negativo.
Nível Básico
'''
print(propsNum(-56.3)) | [
7061,
6,
198,
220,
5231,
273,
25,
28855,
2932,
78,
198,
220,
1835,
31173,
23593,
25,
220,
3494,
68,
23781,
1430,
64,
795,
11361,
8358,
1407,
1350,
23781,
299,
21356,
647,
78,
1103,
304,
4175,
68,
384,
38251,
45329,
723,
257,
6632,
1... | 2.518519 | 81 |
from django.conf import settings
| [
6738,
42625,
14208,
13,
10414,
1330,
6460,
628,
628,
628
] | 3.8 | 10 |
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from carla_ackermann_control/EgoVehicleControlInfo.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import carla_ackermann_control.msg
import carla_msgs.msg
import std_msgs... | [
2,
770,
11361,
2393,
3544,
262,
1708,
21004,
25,
3384,
69,
12,
23,
198,
37811,
2306,
519,
877,
515,
416,
2429,
9078,
422,
1097,
5031,
62,
441,
2224,
77,
62,
13716,
14,
36,
2188,
37870,
1548,
15988,
12360,
13,
19662,
13,
2141,
407,
... | 2.793548 | 155 |
# Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source ... | [
2,
15069,
357,
66,
8,
12131,
11,
14236,
952,
5921,
265,
382,
11,
20059,
4992,
5136,
2031,
402,
2022,
39,
11,
290,
198,
2,
20671,
2059,
286,
360,
1670,
38863,
13,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
29... | 2.494954 | 4,459 |
#!/usr/bin/env python
from sensor_msgs.msg import PointCloud2, PointField, Image
import numpy as np
import struct
import cv
from cv_bridge import CvBridge
import copy
import code # HACK for debugging
fmt_full = ''
_DATATYPES = {}
_DATATYPES[PointField.INT8] = ('b', 1)
_DATATYPES[PointField.UINT8] = ('B', 1)
_... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
6738,
12694,
62,
907,
14542,
13,
19662,
1330,
6252,
18839,
17,
11,
6252,
15878,
11,
7412,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2878,
198,
11748,
269,
85,
198,
6738,
269,
85,... | 2.198098 | 631 |
from wordcloud import WordCloud
from mastodon import Mastodon
from pytz import timezone
from os import path
import datetime as dt
import pandas as pd
import MeCab
import re
PATH = path.dirname(path.abspath(__file__))
if __name__ == "__main__":
mastodon = Mastodon(
client_id = PATH + "/clientcred.secret... | [
6738,
1573,
17721,
1330,
9678,
18839,
198,
6738,
17288,
46457,
1330,
30868,
46457,
198,
6738,
12972,
22877,
1330,
640,
11340,
198,
6738,
28686,
1330,
3108,
198,
11748,
4818,
8079,
355,
288,
83,
198,
11748,
19798,
292,
355,
279,
67,
198,
... | 1.601947 | 3,698 |
import os
import shutil
import tempfile
import logging
import pytest
from kiplot import kiplot
from kiplot import config_reader
KICAD_PCB_EXT = '.kicad_pcb'
| [
198,
11748,
28686,
198,
11748,
4423,
346,
198,
11748,
20218,
7753,
198,
11748,
18931,
198,
11748,
12972,
9288,
628,
198,
6738,
479,
24705,
313,
1330,
479,
24705,
313,
198,
6738,
479,
24705,
313,
1330,
4566,
62,
46862,
628,
198,
42,
2149... | 2.859649 | 57 |
#! /usr/bin/env python3
import getpass
import json
import os
from github import Github
# generate repo list to play with
if __name__ == '__main__':
username = input('Enter Github username:')
password = getpass.getpass('Enter password:')
print('start')
run(username, password)
print('finished')
| [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
651,
6603,
198,
11748,
33918,
198,
11748,
28686,
198,
6738,
33084,
1330,
38994,
198,
198,
2,
7716,
29924,
1351,
284,
711,
351,
628,
198,
361,
11593,
3672,
834,
6624,
... | 3.097087 | 103 |
from PIL import Image
from utils import getSeed, save_time
import numpy as np
import argparse
from mpi4py import MPI
import string
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
alphabet = list(string.ascii_lowercase + string.digits)
if __name__ == '__main__':
parser = argparse.ArgumentPar... | [
6738,
350,
4146,
1330,
7412,
198,
6738,
3384,
4487,
1330,
651,
50,
2308,
11,
3613,
62,
2435,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
1822,
29572,
198,
6738,
285,
14415,
19,
9078,
1330,
4904,
40,
198,
11748,
4731,
198,
198,
950... | 2.461216 | 477 |
#!/usr/bin/env python
import argparse
import sys
import pandas_utils as pdu
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Convert ASCII to HDF5.')
# - Positional arguments
parser.add_argument("input", help="input file")
parser.add_argument("output", help="output file")
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
11748,
1822,
29572,
198,
11748,
25064,
198,
11748,
19798,
292,
62,
26791,
355,
279,
646,
198,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
628,
220,
220,
220,
307... | 2.509128 | 493 |
from sparse_dot_mkl._sparse_sparse import _sparse_dot_sparse as _sds
from sparse_dot_mkl._sparse_dense import _sparse_dot_dense as _sdd
from sparse_dot_mkl._dense_dense import _dense_dot_dense as _ddd
from sparse_dot_mkl._sparse_vector import _sparse_dot_vector as _sdv
from sparse_dot_mkl._gram_matrix import _gram_matr... | [
6738,
29877,
62,
26518,
62,
28015,
75,
13557,
82,
29572,
62,
82,
29572,
1330,
4808,
82,
29572,
62,
26518,
62,
82,
29572,
355,
4808,
82,
9310,
198,
6738,
29877,
62,
26518,
62,
28015,
75,
13557,
82,
29572,
62,
67,
1072,
1330,
4808,
82... | 2.706404 | 2,592 |
from django.shortcuts import render
# Create your views here.
from rest_framework_jwt.authentication import JSONWebTokenAuthentication
from rest_framework.authentication import SessionAuthentication
from rest_framework import mixins, viewsets
from rest_framework.permissions import IsAuthenticated
from .serializers imp... | [
6738,
42625,
14208,
13,
19509,
23779,
1330,
8543,
198,
198,
2,
13610,
534,
5009,
994,
13,
198,
6738,
1334,
62,
30604,
62,
73,
46569,
13,
41299,
3299,
1330,
19449,
13908,
30642,
47649,
3299,
198,
6738,
1334,
62,
30604,
13,
41299,
3299,
... | 2.108108 | 1,258 |
import functools
import itertools
import operator
import unittest
import dual
@functools.lru_cache(maxsize=None)
try:
import sympy
except ImportError:
has_sympy = False
else:
has_sympy = True
@unittest.skipUnless(has_sympy, 'requires SymPy')
import math
import random
import sys
epsilon = sys.float_info.epsi... | [
11748,
1257,
310,
10141,
198,
11748,
340,
861,
10141,
198,
11748,
10088,
198,
11748,
555,
715,
395,
198,
198,
11748,
10668,
198,
198,
31,
12543,
310,
10141,
13,
75,
622,
62,
23870,
7,
9806,
7857,
28,
14202,
8,
198,
198,
28311,
25,
1... | 2.573248 | 157 |
def countSentence():
"""
countSentence() return the word count entered by the user.
Variables: sentence: str
"""
# take input from the user
sentence = input("Enter a sentence: ")
#removes space
sentence = sentence.strip()
#define a variable to count the sentence and set to zero
... | [
4299,
954,
31837,
594,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
954,
31837,
594,
3419,
1441,
262,
1573,
954,
5982,
416,
262,
2836,
13,
628,
220,
220,
220,
15965,
2977,
25,
6827,
25,
965,
628,
220,
220,
220,
37227,
198,
... | 3.029586 | 169 |
#-------------------------------------------------------------------------
# The Azure Batch Apps Python Client
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated docu... | [
2,
10097,
45537,
198,
2,
383,
22134,
347,
963,
27710,
11361,
20985,
198,
2,
198,
2,
15069,
357,
66,
8,
5413,
10501,
13,
1439,
2489,
10395,
13,
220,
198,
2,
198,
2,
383,
17168,
13789,
357,
36393,
8,
198,
2,
198,
2,
2448,
3411,
31... | 2.322964 | 3,954 |
from sklearn.base import BaseEstimator, TransformerMixin
class NumberStringExtractor(BaseEstimator, TransformerMixin):
"""Takes in dataframe, extracts string text column, outputs number to string"""
def fit(self, df, y=None):
"""Returns `self` unless something different happens in train and test"""
... | [
6738,
1341,
35720,
13,
8692,
1330,
7308,
22362,
320,
1352,
11,
3602,
16354,
35608,
259,
198,
198,
4871,
7913,
10100,
11627,
40450,
7,
14881,
22362,
320,
1352,
11,
3602,
16354,
35608,
259,
2599,
198,
220,
220,
220,
37227,
51,
1124,
287,
... | 3.300971 | 103 |
"""
Given a string of digits, calculate the largest product for a contiguous substring of digits of length n.
For example, for the input '1027839564', the largest product for a series of 3 digits is 270 (9 * 5 * 6),
and the largest product for a series of 5 digits is 7560 (7 * 8 * 3 * 9 * 5).
... | [
37811,
198,
220,
220,
220,
11259,
257,
4731,
286,
19561,
11,
15284,
262,
4387,
1720,
329,
257,
48627,
3293,
1806,
286,
19561,
286,
4129,
299,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1114,
1672,
11,
329,
262,
5128,
705,
940,
2587... | 3.03876 | 645 |
# Copyright 207 FUJITSU LIMITED
#
# 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,
27791,
376,
52,
41,
2043,
12564,
40880,
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,
1... | 2.111264 | 1,456 |
# -*- coding: utf-8 -*-
#---------------------------------------------------------------------------
# Copyright 2020 VMware, Inc. All rights reserved.
# AUTO GENERATED FILE -- DO NOT MODIFY!
#
# vAPI stub file for package com.vmware.nsx.logical_routers.routing.bgp.neighbors.
#----------------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
10097,
32284,
198,
2,
15069,
12131,
37754,
11,
3457,
13,
220,
1439,
2489,
10395,
13,
198,
198,
2,
47044,
46,
24700,
1137,
11617,
45811,
1377,
8410,
5626,
19164,
5064,... | 2.181335 | 3,761 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2019 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
16529,
32501,
198,
2,
357,
34,
8,
3517,
12223,
15069,
2177,
12,
23344,
3395,
4452,
13,
198,
2,
1439,
2489,
10395,
... | 2.597718 | 4,206 |
balance = 3329
annualInterestRate = 0.2
# output>Lowest payment: 310
#program to be pasted begin here
lowestPayment = 0
remainingBalance = balance
while remainingBalance >= 0:
month = 1
remainingBalance = balance
lowestPayment += 10
while month <= 12:
unpaidBalance = remainingBalance - lowestPay... | [
20427,
796,
4747,
1959,
198,
1236,
723,
19302,
32184,
796,
657,
13,
17,
198,
2,
5072,
29,
20535,
395,
6074,
25,
28947,
198,
2,
23065,
284,
307,
1613,
276,
2221,
994,
198,
9319,
395,
19197,
434,
796,
657,
198,
2787,
1397,
45866,
796,... | 3.104294 | 163 |
#!/usr/bin/env python
"""
(c) 2012-2014 Johannes Lindenbaum
License: MIT License, see LICENSE file for details.
See README.md for usage and examples.
"""
import argparse
import os
import Image
if __name__ == "__main__":
argParser = argparse.ArgumentParser(description="Automatically resize images for iOS and ... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
198,
37811,
198,
7,
66,
8,
2321,
12,
4967,
38579,
9329,
268,
24738,
198,
34156,
25,
17168,
13789,
11,
766,
38559,
24290,
2393,
329,
3307,
13,
198,
6214,
20832,
11682,
13,
9132,
329,
... | 2.572605 | 1,336 |
# Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
from dazl import async_network, frozendict
import pytest
from .dars import MapSupport
@pytest.mark.asyncio
@pytest.mark.asyncio
| [
2,
15069,
357,
66,
8,
2177,
12,
1238,
2481,
10231,
31433,
357,
10462,
13947,
8,
402,
2022,
39,
290,
14,
273,
663,
29116,
13,
1439,
2489,
10395,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
1... | 2.925532 | 94 |
'''
Created on 2013-05-15
@author: Scott Sibole
'''
from distutils.core import setup
setup(
name = 'febio',
version = '0.1.3',
packages = ['febio',],
py_modules = ['febio.__init__','febio.MatDef','febio.MeshDef','febio.Boundary','febio.Control','febio.Load','febio.Model','febio.FebPlt'],
author = ... | [
7061,
6,
198,
41972,
319,
2211,
12,
2713,
12,
1314,
198,
198,
31,
9800,
25,
4746,
311,
571,
2305,
198,
7061,
6,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
198,
40406,
7,
198,
220,
220,
220,
1438,
796,
705,
69,
1765,
952,
... | 2.286207 | 290 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021 CERN.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Unmanaged provider tests."""
import pytest
from flask_babelex import lazy_gettext as _
from invenio_pidsto... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
198,
2,
15069,
357,
34,
8,
33448,
327,
28778,
13,
198,
2,
198,
2,
554,
574,
952,
12,
49,
23127,
12,
6690,
3669,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,... | 3.007117 | 281 |
import re
import validators
import logging
import json
from src.Entity.Part import Part
from typing import List, Dict, Union
from src.Service.WebScraper.WebScraper import WebScraper
class PriceChecker:
"""
Scrapes the price for the product page.
"""
def check_prices(self) -> Union[List[Part], None]:... | [
11748,
302,
198,
11748,
4938,
2024,
198,
11748,
18931,
198,
11748,
33918,
198,
198,
6738,
12351,
13,
32398,
13,
7841,
1330,
2142,
198,
6738,
19720,
1330,
7343,
11,
360,
713,
11,
4479,
198,
6738,
12351,
13,
16177,
13,
13908,
3351,
38545,... | 2.226623 | 909 |
from flask import g, Response
from flask_restful import reqparse, abort, fields, marshal_with, marshal
from flask_restful_swagger_2 import swagger, Resource
from rdb.rdb import db
from rdb.models.user import User
from resources.userResource import auth
import requests
import config
from rdb.models.featureSet import Fea... | [
6738,
42903,
1330,
308,
11,
18261,
198,
6738,
42903,
62,
2118,
913,
1330,
43089,
29572,
11,
15614,
11,
7032,
11,
22397,
282,
62,
4480,
11,
22397,
282,
198,
6738,
42903,
62,
2118,
913,
62,
2032,
7928,
62,
17,
1330,
1509,
7928,
11,
20... | 3.393013 | 229 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
| [
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,
4981,
11,
15720,
602,
628
] | 2.891892 | 37 |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
class data_linewidth_plot():
""" from https://stackoverflow.com/questions/19394505/matplotlib-expand-the-line-with-specified-width-in-data-unit#42972469 """
def _redraw_later(self):
""" this is ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
1036,
1638,
1045,
198,
198,
4871,
1366,
62,
2815,
413,
56... | 2.377604 | 1,152 |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__a... | [
2,
19617,
28,
40477,
12,
23,
198,
2,
17202,
39410,
25,
428,
2393,
373,
7560,
416,
262,
21624,
12994,
26144,
35986,
13,
17202,
198,
2,
17202,
2141,
407,
4370,
416,
1021,
4556,
345,
821,
1728,
345,
760,
644,
345,
389,
1804,
0,
17202,
... | 2.714286 | 511 |
import torch
import numpy as np
from torch import nn
from .base import PDE
class DiffNetFDM(PDE):
"""docstring for DiffNetFDM""" | [
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
764,
8692,
1330,
350,
7206,
628,
628,
198,
4871,
10631,
7934,
37,
23127,
7,
5760,
36,
2599,
198,
220,
220,
220,
37227,
15390,
8841,
329,
106... | 2.956522 | 46 |
from owlready import *
# define a owl object
onto = Ontology("http://test.org/tissueROIs.owl")
onto_path.append("C:/Users/liz27/OneDrive/Documents/CCHMC/Early prediction/Cincinnati EPS/Data")
# main class
# # Temporal lobe
# Posterior fossa
# Insula and cingulate gyri
# Frontal lobe cl... | [
6738,
39610,
1493,
1330,
1635,
201,
198,
201,
198,
201,
198,
2,
8160,
257,
39610,
2134,
201,
198,
5957,
796,
9463,
1435,
7203,
4023,
1378,
9288,
13,
2398,
14,
83,
21949,
13252,
3792,
13,
4883,
4943,
201,
198,
5957,
62,
6978,
13,
332... | 2.283505 | 194 |
from .static.Qua_config import *
from .Qua_assisFunc import *
import pandas as pd
import numpy as np
from .main_match import main_match
# function 1
# function 2
# function4
| [
6738,
764,
12708,
13,
4507,
64,
62,
11250,
1330,
1635,
198,
6738,
764,
4507,
64,
62,
20297,
37,
19524,
1330,
1635,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
764,
12417,
62,
15699,
1330,
1388,... | 2.815385 | 65 |
from typing import Dict, Optional, Tuple, Union, cast
import torch
from kornia.augmentation._2d.geometric.base import GeometricAugmentationBase2D
class PadTo(GeometricAugmentationBase2D):
r"""Pad the given sample to a specific size.
Args:
size: a tuple of ints in the format (height, width) that giv... | [
6738,
19720,
1330,
360,
713,
11,
32233,
11,
309,
29291,
11,
4479,
11,
3350,
198,
198,
11748,
28034,
198,
198,
6738,
479,
3317,
13,
559,
5154,
341,
13557,
17,
67,
13,
469,
16996,
13,
8692,
1330,
2269,
16996,
12512,
14374,
14881,
17,
... | 2.183021 | 907 |
#!/usr/bin/env python3
import psycopg2
DATABASE_NAME = 'news'
if __name__ == '__main__':
# Question #1
the_most_three_articles()
# Question #2
the_most_popular_article_authors()
# Question #3
more_one_percentage_lead_to_error()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
17331,
22163,
70,
17,
198,
198,
35,
1404,
6242,
11159,
62,
20608,
796,
705,
10827,
6,
628,
628,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
1035... | 2.351351 | 111 |
# Get the most recent Ranked match in a user's history,
# and print the ranks of every player in the match. If
# there isn't a Ranked match in the history, the program
# will exit. **This example requires an API Key with access
# to the match endpoint. You need to apply for that from
# the Riot Games Developer Portal.*... | [
2,
3497,
262,
749,
2274,
41844,
2872,
287,
257,
2836,
338,
2106,
11,
198,
2,
290,
3601,
262,
9803,
286,
790,
2137,
287,
262,
2872,
13,
1002,
198,
2,
612,
2125,
470,
257,
41844,
2872,
287,
262,
2106,
11,
262,
1430,
198,
2,
481,
8... | 3.098315 | 356 |
import h5py
# input: fn, relative to directory
# layer_names, ex: ['dense_1']
# output: list of np arrays that contain the weights from each layer
#print(loadWeights('NNGeneration/Saved Models/CIFAR-10-AML/model-01.hdf5', ['dense_1']))
# helper function to take a look at what the layer names are
| [
11748,
289,
20,
9078,
198,
198,
2,
5128,
25,
24714,
11,
3585,
284,
8619,
198,
2,
197,
197,
7679,
62,
14933,
11,
409,
25,
37250,
67,
1072,
62,
16,
20520,
198,
2,
5072,
25,
1351,
286,
45941,
26515,
326,
3994,
262,
19590,
422,
1123,
... | 2.961165 | 103 |
#!/usr/bin/env python3
"""Setups a signal receiver"""
__author__ = "Jaryd Rester"
__copyright__ = "2022-04-08"
# stdlib
# django
from django.dispatch import receiver
# local django
from chunky_upload.models import ChunkedUpload
from chunky_upload.signals import chunky_upload_complete
# thirdparty
@receiver(
... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
37811,
7248,
4739,
257,
6737,
9733,
37811,
198,
198,
834,
9800,
834,
796,
366,
41,
560,
67,
1874,
353,
1,
198,
834,
22163,
4766,
834,
796,
366,
1238,
1828,
12,
3023,
12,
2919,
... | 2.798658 | 149 |
import re
import string
import json
import os
import time
start = time.clock()
fa = open("./lambda_virus.fa","r+")
#fa = open("./alignment-sequence.fasta")
lab=fa.read()
#print lab
name1 = get_text("| ","\n",lab)
lab += ":"
sequences1 = get_text("\n",":",lab)
sequences1=re.sub(r'\s+','',sequences1)
#print name1
#p... | [
11748,
302,
198,
11748,
4731,
198,
11748,
33918,
198,
11748,
28686,
198,
11748,
640,
198,
198,
9688,
796,
640,
13,
15750,
3419,
198,
198,
13331,
796,
1280,
7,
1911,
14,
50033,
62,
85,
19397,
13,
13331,
2430,
81,
10,
4943,
198,
2,
13... | 2.379427 | 593 |
"""
exec and eval are not thread safe
"""
import support
from java.lang import Thread
testers = []
for i in range(10):
testers.append(TestThread())
for tester in testers:
tester.start()
| [
37811,
198,
18558,
290,
5418,
389,
407,
4704,
3338,
198,
37811,
198,
198,
11748,
1104,
198,
198,
6738,
20129,
13,
17204,
1330,
14122,
198,
198,
27205,
796,
17635,
198,
1640,
1312,
287,
2837,
7,
940,
2599,
198,
220,
220,
220,
42891,
13... | 3.061538 | 65 |
import html
from typing import Optional, List
from telegram import Message, Chat, Update, Bot, User
from telegram import ChatPermissions
from telegram.error import BadRequest
from telegram.ext import CommandHandler, Filters
from telegram.ext.dispatcher import run_async
from telegram.utils.helpers import mention_html
... | [
11748,
27711,
198,
6738,
19720,
1330,
32233,
11,
7343,
198,
198,
6738,
573,
30536,
1330,
16000,
11,
24101,
11,
10133,
11,
18579,
11,
11787,
198,
6738,
573,
30536,
1330,
24101,
5990,
8481,
198,
6738,
573,
30536,
13,
18224,
1330,
7772,
18... | 2.897119 | 486 |
#!/usr/bin/env python3
#-*-coding:utf-8-*-
#关于字符串处理
#替换字典中所有替换项
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
12,
9,
12,
66,
7656,
25,
40477,
12,
23,
12,
9,
12,
198,
198,
2,
17739,
111,
12859,
236,
27764,
245,
163,
105,
99,
10310,
110,
13783,
226,
49426,
228,
628,
198,
2,
162,
2... | 0.985714 | 70 |
import json
from os.path import join, dirname
from setuptools import setup, find_packages
# reading package version (same way the sqlalchemy does)
with open(join(dirname(__file__), 'package.json')) as v_file:
package_version = json.load(v_file)['version']
dependencies = [
'yhttp >= 3.0.3',
'yhttp-pony ... | [
11748,
33918,
198,
198,
6738,
28686,
13,
6978,
1330,
4654,
11,
26672,
3672,
198,
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
628,
198,
2,
3555,
5301,
2196,
357,
31642,
835,
262,
44161,
282,
26599,
857,
8,
198,
4480,
1280... | 2.511905 | 252 |
import uproot
from concurrent.futures import ThreadPoolExecutor
import numpy as np
import pandas as pd
"""
The tree_importer function takes in flat analysis tree and returns a pandas data-frame object. It has 3 inputs, the first one is
path of the analysis tree, the second one as the tree name and third one the numbe... | [
11748,
510,
15763,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
23002,
38409,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
628,
198,
37811,
198,
464,
5509,
62,
320,
26634,
2163,
2753,
287,
6228,
... | 4.008734 | 229 |
#! /usr/bin/python
# coding=utf-8
"""
Copyright (c) 2011, The MITRE Corporation.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notic... | [
2,
0,
1220,
14629,
14,
8800,
14,
29412,
198,
2,
19617,
28,
40477,
12,
23,
198,
37811,
198,
15269,
357,
66,
8,
2813,
11,
383,
17168,
2200,
10501,
13,
198,
3237,
2489,
10395,
13,
198,
198,
7738,
396,
3890,
290,
779,
287,
2723,
290,
... | 3.7951 | 449 |
import pytest
import abstract_open_traffic_generator.control as control
import abstract_open_traffic_generator.result as result
import pandas
def test_port_results(serializer, api, b2b_port_flow_config):
"""Demonstrates the following:
- Retrieving a subset of port results
- Use pandas to display the resul... | [
11748,
12972,
9288,
198,
11748,
12531,
62,
9654,
62,
9535,
2108,
62,
8612,
1352,
13,
13716,
355,
1630,
198,
11748,
12531,
62,
9654,
62,
9535,
2108,
62,
8612,
1352,
13,
20274,
355,
1255,
198,
11748,
19798,
292,
628,
198,
4299,
1332,
62... | 2.605442 | 441 |
#-------------------------------------------------------------
# Name: Stats Property Data Import
# Purpose: Imports data from Census NZ stats relating to property and aggregates
# this data by meshblock and suburb.
# Author: Shaun Weston (shaun_weston@eagle.co.nz)
# Date Created: 21/12/2014... | [
2,
47232,
32501,
198,
2,
6530,
25,
220,
220,
220,
220,
220,
220,
20595,
14161,
6060,
17267,
198,
2,
32039,
25,
220,
220,
220,
1846,
3742,
1366,
422,
20962,
26905,
9756,
11270,
284,
3119,
290,
13262,
689,
198,
2,
220,
220,
220,
220,
... | 3.024148 | 704 |
import pytest
from boxtribute_server.models.definitions.transfer_agreement_detail import (
TransferAgreementDetail,
)
from .base import data as base_data
from .transfer_agreement import data as transfer_agreement_data
@pytest.fixture
| [
11748,
12972,
9288,
198,
6738,
1489,
742,
4163,
62,
15388,
13,
27530,
13,
4299,
50101,
13,
39437,
62,
363,
10237,
62,
49170,
1330,
357,
198,
220,
220,
220,
20558,
10262,
10237,
11242,
603,
11,
198,
8,
198,
198,
6738,
764,
8692,
1330,
... | 3.328767 | 73 |
#------------------------------------------------------------------------------
# pycparser: c_generator.py
#
# C code generator from pycparser AST nodes.
#
# Copyright (C) 2008-2015, Eli Bendersky
# License: BSD
#------------------------------------------------------------------------------
from . import c_ast
class... | [
2,
10097,
26171,
198,
2,
12972,
13155,
28198,
25,
269,
62,
8612,
1352,
13,
9078,
198,
2,
198,
2,
327,
2438,
17301,
422,
12972,
13155,
28198,
29273,
13760,
13,
198,
2,
198,
2,
15069,
357,
34,
8,
3648,
12,
4626,
11,
25204,
347,
7338... | 2.069857 | 2,591 |
# -*- coding: utf-8 -*-
from unittest.mock import call, patch
import pytest
import requests_mock
from chaoslib.exceptions import FailedActivity
from fixtures import config, responses, secrets
import chaoscf
from chaoscf.actions import delete_app, map_route_to_app, \
start_all_apps, start_app, stop_all_apps, stop_... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
6738,
555,
715,
395,
13,
76,
735,
1330,
869,
11,
8529,
198,
198,
11748,
12972,
9288,
198,
11748,
7007,
62,
76,
735,
198,
6738,
11918,
8019,
13,
1069,
11755,
1330,
2273... | 2.674905 | 526 |
from django_elasticsearch_dsl_drf.serializers import DocumentSerializer
from rest_framework import serializers
from search.documents import PostDocument
from researchhub_document.related_models.researchhub_post_model import ResearchhubPost
from user.models import User
from user.serializers import UserSerializer
... | [
6738,
42625,
14208,
62,
417,
3477,
12947,
62,
67,
6649,
62,
7109,
69,
13,
46911,
11341,
1330,
16854,
32634,
7509,
198,
6738,
1334,
62,
30604,
1330,
11389,
11341,
198,
198,
6738,
2989,
13,
15390,
2886,
1330,
2947,
24941,
198,
6738,
2267,... | 3.767442 | 86 |
import pygame as pg
class Display:
"""
docstring
"""
| [
11748,
12972,
6057,
355,
23241,
628,
198,
4871,
16531,
25,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
2205,
8841,
198,
220,
220,
220,
37227,
198
] | 2.481481 | 27 |
# -*- coding: utf-8 -*-
__all__ = ('TestSuiteConfig',)
from typing import Dict, Optional, Any, Type
import abc
import typing
from loguru import logger
import bugzoo
from ..util import dynamically_registered
if typing.TYPE_CHECKING:
from .base import TestSuite
from ..environment import Environment
@dynamic... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
834,
439,
834,
796,
19203,
14402,
5606,
578,
16934,
3256,
8,
198,
198,
6738,
19720,
1330,
360,
713,
11,
32233,
11,
4377,
11,
5994,
198,
11748,
450,
66,
198,
11748,
197... | 2.711191 | 277 |
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Title : PyRogue AXI Version Module
#-----------------------------------------------------------------------------
# File : from pyrogue/devices/axi_version.py
# Author : originally from Ryan Herbst, rhe... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
10097,
32501,
198,
2,
11851,
220,
220,
220,
220,
220,
1058,
9485,
48163,
43051,
40,
10628,
19937,
198,
2,
10097,
32501,
198,
2,
9220,
220,
220,
220,
220,
220,
220,
1058,
422,
1297... | 4.644483 | 571 |
# -*- coding: utf-8 -*-
"""
jinja2_markdown
~~~~~~~~~~~~~~~~~~~~~~~~~
A jinja2 extension that adds a `{% markdown %}` tag.
:copyright: (c) 2014 by Daniel Chatfield
"""
import markdown
from jinja2.nodes import CallBlock
from jinja2.ext import Extension
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
220,
220,
220,
474,
259,
6592,
17,
62,
4102,
2902,
198,
220,
220,
220,
220,
27156,
15116,
93,
628,
220,
220,
220,
317,
474,
259,
6592,
17,
7552,
326,
667... | 2.640777 | 103 |
#!/usr/bin/env python
#coding=utf-8
import numpy as np
import matplotlib.pyplot as plt
try:
from NeuroTools.analysis import crosscorrelate
except:
crosscorrelate = raise_exception
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
66,
7656,
28,
40477,
12,
23,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
... | 2.768116 | 69 |
from __future__ import absolute_import, division, print_function
from cctbx import xray
from cctbx import crystal
import cctbx.crystal.coordination_sequences
from cctbx.array_family import flex
from six.moves import zip
def demo():
"""
Result of ICSD query:
N * -Cr2O3-[R3-CH] Baster, M.;Bouree, F.;Kowalska, A.... | [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
11,
7297,
11,
3601,
62,
8818,
198,
6738,
269,
310,
65,
87,
1330,
2124,
2433,
198,
6738,
269,
310,
65,
87,
1330,
15121,
198,
11748,
269,
310,
65,
87,
13,
20470,
7757,
13,
37652,
1883,
... | 2.223963 | 1,085 |
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: 76
Author : anglemiku
Eamil : anglemiku.v@gmail.com
date: 2020/3/10
-------------------------------------------------
Change Activity: 2020/3/10:
-------------------------------... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
47232,
12,
198,
220,
220,
9220,
6530,
25,
220,
220,
220,
220,
220,
220,
220,
8684,
198,
220,
220,
6434,
1058,
220,
220,
220,
220,
220,
220,
220,
220,
220... | 2.226148 | 283 |
from django.conf.urls import url, include
from django.contrib.auth.views import LoginView, LogoutView
from .views import register_user, index
urlpatterns = [
url(r'^login', LoginView.as_view(template_name='login.html')),
url(r'^register', register_user, name='register'),
url(r'^logout', LogoutView.as_view... | [
6738,
42625,
14208,
13,
10414,
13,
6371,
82,
1330,
19016,
11,
2291,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
33571,
1330,
23093,
7680,
11,
5972,
448,
7680,
198,
6738,
764,
33571,
1330,
7881,
62,
7220,
11,
6376,
628,
198,... | 2.69403 | 134 |
"""W&B Sweep Functionality."""
import os
import signal
import subprocess
import sys
import json
from typing import Tuple
from ast import literal_eval
import pdb
DEFAULT_CONFIG = {
"dataset": "RetinaDatasetWrapper",
"model": "RetinaModel",
"network": "resnetconv",
"train_args": {"batch_size": 128, "epoc... | [
37811,
54,
5,
33,
42818,
15553,
1483,
526,
15931,
198,
11748,
28686,
198,
11748,
6737,
198,
11748,
850,
14681,
198,
11748,
25064,
198,
11748,
33918,
198,
6738,
19720,
1330,
309,
29291,
198,
6738,
6468,
1330,
18875,
62,
18206,
198,
11748,
... | 1.99511 | 818 |
import logging
from Common import *
from Map import *
logger = logging.getLogger(__name__)
| [
11748,
18931,
198,
198,
6738,
8070,
1330,
1635,
198,
6738,
9347,
1330,
1635,
198,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
834,
3672,
834,
8,
198
] | 3.206897 | 29 |
"""Stops the motors from running"""
from dependencies.zumo_button import ZumoButton
from motob import Motob
Z = ZumoButton()
M = Motob()
M.operationalize(["S", 0])
| [
37811,
1273,
2840,
262,
24699,
422,
2491,
37811,
198,
198,
6738,
20086,
13,
89,
43712,
62,
16539,
1330,
1168,
43712,
21864,
198,
6738,
2369,
672,
1330,
6543,
672,
628,
198,
57,
796,
1168,
43712,
21864,
3419,
198,
44,
796,
6543,
672,
3... | 3.036364 | 55 |
'''Exercício Python 105: Faça um programa que tenha uma função notas() que pode receber várias notas de alunos e vai retornar um dicionário com as seguintes informações:
- Quantidade de notas
- A maior nota
- A menor nota
- A média da turma
- A situação (opcional)
Adicione também as docstrings dessa função para consu... | [
7061,
6,
3109,
2798,
8836,
66,
952,
11361,
13343,
25,
18350,
50041,
23781,
1430,
64,
8358,
3478,
3099,
334,
2611,
1257,
16175,
28749,
407,
292,
3419,
8358,
279,
1098,
1407,
527,
410,
6557,
380,
292,
407,
292,
390,
435,
403,
418,
304,
... | 2.041588 | 529 |
import logging
from numbers import Integral
import numpy as np
try:
from matplotlib.path import Path
except ImportError:
pass
from ..data import Data
from ..decorators import (
_deprecated_kwarg_check,
_inplace_enabled,
_inplace_enabled_define_and_cleanup,
_manage_log_level_via_verbosity,
)
f... | [
11748,
18931,
198,
6738,
3146,
1330,
15995,
1373,
198,
198,
11748,
299,
32152,
355,
45941,
198,
198,
28311,
25,
198,
220,
220,
220,
422,
2603,
29487,
8019,
13,
6978,
1330,
10644,
198,
16341,
17267,
12331,
25,
198,
220,
220,
220,
1208,
... | 1.952484 | 50,741 |
# coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import Dict, List # noqa: F401
from ..util import deserialize_model
from .base_model_ import Base_Model
class StyleConfigurationSingleStyle(Base_Model):
"""NOTE: This class is auto generated by... | [
2,
19617,
25,
3384,
69,
12,
23,
198,
198,
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
198,
6738,
4818,
8079,
1330,
3128,
11,
4818,
8079,
220,
1303,
645,
20402,
25,
376,
21844,
198,
6738,
19720,
1330,
360,
713,
11,
7343,
220... | 2.460058 | 1,039 |
# -*- coding: utf-8 -*-
""" Data Forecast Module """ | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
6060,
4558,
2701,
19937,
37227
] | 2.52381 | 21 |
import sys,getopt,numpy,pandas,umap,scipy.stats
from sklearn.decomposition import PCA
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
#
#
#
#
#
#
if __name__=='__main__':
project, cellinfo, rand_stat, norm_method = get_parameters(sys.argv[1:])
run_umap(project, cellinfo, rand_stat, norm_... | [
11748,
25064,
11,
1136,
8738,
11,
77,
32152,
11,
79,
392,
292,
11,
388,
499,
11,
1416,
541,
88,
13,
34242,
198,
6738,
1341,
35720,
13,
12501,
296,
9150,
1330,
4217,
32,
198,
11748,
2603,
29487,
8019,
198,
6759,
29487,
8019,
13,
1904... | 2.402878 | 139 |
import sys
import datetime
from typing import Optional, Dict, Union
from .internals.parallel_reader import (
ParallelReader,
pass_thru,
EXTENSION_TYPE,
KNOWN_EXTENSIONS,
)
# from .internals.threaded_wrapper import processed_reader
from .internals.multiprocess_wrapper import processed_reader
from .int... | [
11748,
25064,
198,
11748,
4818,
8079,
198,
198,
6738,
19720,
1330,
32233,
11,
360,
713,
11,
4479,
198,
198,
6738,
764,
23124,
874,
13,
1845,
29363,
62,
46862,
1330,
357,
198,
220,
220,
220,
42945,
33634,
11,
198,
220,
220,
220,
1208,
... | 2.825697 | 3,012 |
"""Load AWS IP address ranges."""
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import hashlib
import json
import urllib.request
from datetime import datetime
from pathlib import Path
from typing import Any, Dict, Optional, Tuple, Union
from awsipranges.co... | [
37811,
8912,
30865,
6101,
2209,
16069,
526,
15931,
198,
198,
2,
15069,
6186,
13,
785,
11,
3457,
13,
393,
663,
29116,
13,
1439,
6923,
33876,
13,
198,
2,
30628,
55,
12,
34156,
12,
33234,
7483,
25,
24843,
12,
17,
13,
15,
198,
198,
11... | 2.746307 | 1,557 |
import numpy as np
import sys
example = False
p1pos = 4
p2pos = 6
if example:
p1pos = 4
p2pos = 8
scorepos1 = {}
scorepos2 = {}
scorepos1[(0, p1pos)] = 1
scorepos2[(0, p2pos)] = 1
p1wins = 0
p2wins = 0
rollfreqs = [(3,1), (4,3), (5,6), (6,7), (7,6), (8,3), (9,1)]
while(True):
new_sp1 = []
for ... | [
11748,
299,
32152,
355,
45941,
198,
11748,
25064,
198,
198,
20688,
796,
10352,
198,
198,
79,
16,
1930,
796,
604,
198,
79,
17,
1930,
796,
718,
198,
198,
361,
1672,
25,
198,
220,
220,
220,
279,
16,
1930,
796,
604,
198,
220,
220,
220... | 2.022222 | 585 |
import os
rootDir = '.'
for dirName, subDirList, fileList in os.walk(rootDir):
print('Found directory: %s' % dirName)
for fname in fileList:
print('\t%s' % fname)
| [
11748,
28686,
198,
198,
15763,
35277,
796,
705,
2637,
198,
1640,
26672,
5376,
11,
850,
35277,
8053,
11,
2393,
8053,
287,
28686,
13,
11152,
7,
15763,
35277,
2599,
198,
220,
220,
220,
3601,
10786,
21077,
8619,
25,
4064,
82,
6,
4064,
266... | 2.26506 | 83 |
from django.db import models
from django.urls import reverse
from utils.models import UUIDModel, CampRelatedModel
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
3384,
4487,
13,
27530,
1330,
471,
27586,
17633,
11,
5425,
9819,
17633,
628
] | 3.625 | 32 |
from nevada.Common.Connector import *
from typing import List
import jsonpickle
import json | [
6738,
497,
85,
4763,
13,
17227,
13,
34525,
1330,
1635,
198,
6738,
19720,
1330,
7343,
198,
11748,
33918,
27729,
293,
198,
11748,
33918
] | 3.956522 | 23 |
from allensdk.api.queries.rma_api import RmaApi
from types import SimpleNamespace
import numpy as np
import pandas as pd
import glob
import concurrent
import concurrent.futures
from . import Utils
from . import Constants
from . import StructureMap
| [
6738,
477,
641,
34388,
13,
15042,
13,
421,
10640,
13,
81,
2611,
62,
15042,
1330,
371,
2611,
32,
14415,
198,
198,
6738,
3858,
1330,
17427,
36690,
10223,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198... | 3.328947 | 76 |
from django.db import models
from django.conf import settings
from django.urls import reverse
from .utils import UploadNameFromContent
community_badge_upload_to = UploadNameFromContent('community/badges/', 'badge')
| [
6738,
42625,
14208,
13,
9945,
1330,
4981,
198,
6738,
42625,
14208,
13,
10414,
1330,
6460,
198,
6738,
42625,
14208,
13,
6371,
82,
1330,
9575,
198,
198,
6738,
764,
26791,
1330,
36803,
5376,
4863,
19746,
198,
198,
28158,
62,
14774,
469,
62... | 3.548387 | 62 |
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, sof... | [
2,
15069,
33160,
3012,
11419,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
13789,
1776,
198,
2,
345,
743,
407,
779,
428,
2393,
2845,
287,
11846,
351,
262,
13789,
13,
198,
2,
921,
743,
7330,
257... | 3.945378 | 238 |
import twitter
import config
import time
import csv
# initialize api instance
twitter_api = twitter.Api(consumer_key=config.consumer_key,
consumer_secret=config.consumer_secret,
access_token_key=config.access_token,
access_token_secret=confi... | [
11748,
17044,
198,
11748,
4566,
198,
11748,
640,
198,
11748,
269,
21370,
198,
198,
2,
41216,
40391,
4554,
198,
6956,
62,
15042,
796,
17044,
13,
32,
14415,
7,
49827,
62,
2539,
28,
11250,
13,
49827,
62,
2539,
11,
198,
220,
220,
220,
2... | 2.238411 | 151 |
import math
import subprocess
# subprocess.call([r'C:\Users\ericw\Desktop\Programming\python\Other\Matrix.bat'])
#preformat input data via .bat
subprocess.call([r"C:\Users\ericw\Desktop\Programming\python\Other\preformat.bat"])
numbers = open("C:/Users/ericw/Desktop/Programming/python/Other/d3Formatted.txt", "r+")
nu... | [
11748,
10688,
198,
11748,
850,
14681,
198,
198,
2,
850,
14681,
13,
13345,
26933,
81,
6,
34,
7479,
14490,
59,
35626,
86,
59,
36881,
59,
15167,
2229,
59,
29412,
59,
6395,
59,
46912,
13,
8664,
6,
12962,
198,
198,
2,
3866,
18982,
5128,
... | 2.474441 | 626 |
import traceback
from project.domain.person.repository.physical_person import PhysicalPerson
from typing import List
from fastapi.param_functions import Depends
from starlette.responses import JSONResponse, Response
from fastapi import APIRouter, HTTPException
from project.resources.person.schemas.physical_person impor... | [
11748,
12854,
1891,
198,
6738,
1628,
13,
27830,
13,
6259,
13,
260,
1930,
37765,
13,
42854,
62,
6259,
1330,
16331,
15439,
198,
6738,
19720,
1330,
7343,
198,
6738,
3049,
15042,
13,
17143,
62,
12543,
2733,
1330,
2129,
2412,
198,
6738,
3491... | 2.333186 | 2,269 |
import pygtrie
import spacy
if __name__ == "__main__":
main()
| [
11748,
12972,
13655,
5034,
198,
11748,
599,
1590,
628,
628,
198,
361,
11593,
3672,
834,
6624,
366,
834,
12417,
834,
1298,
198,
220,
220,
220,
1388,
3419,
198
] | 2.5 | 28 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys
import os
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
if os.name == "posix":
GL = "GL"
GLU = "GLU"
VG_extra_link_args = [ ]
XLIBS = ["png", "jpeg", "z", "GL", "pthread"]
XLIN... | [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
11748,
25064,
198,
11748,
28686,
198,
198,
6738,
1233,
26791,
13,
7295,
1330,
9058,
198,
6738,
1233,
26791,
13,
2302,
3004,
13... | 1.909527 | 2,918 |
#! /usr/bin/env python
# -*- coding: UTF-8 -*-
'''
Created on 20.09.2010
@author: SIGIESEC
'''
from base.basic_config_if import BasicConfig
from base.dependency.dependency_if import (DependencyFilter,
DependencyFilterConfiguration)
from base.dependency.dependency_if_deprecated import DependencyParser
from base.d... | [
2,
0,
1220,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
198,
7061,
6,
198,
41972,
319,
1160,
13,
2931,
13,
10333,
198,
198,
31,
9800,
25,
33993,
11015,
2943,
198,
7061,
6,
... | 3.251586 | 473 |
import discord
from discord.ext import commands
BOT_NAME = "Altec" #Change this into whatever you want.
bot = commands.Bot(command_prefix="!")
with open("config.json", "r") as f:
config = json.load(f)
@bot.event
bot.run(config["token"], reconnect=True)
| [
11748,
36446,
198,
6738,
36446,
13,
2302,
1330,
9729,
198,
198,
33,
2394,
62,
20608,
796,
366,
2348,
36281,
1,
1303,
19400,
428,
656,
4232,
345,
765,
13,
198,
198,
13645,
796,
9729,
13,
20630,
7,
21812,
62,
40290,
2625,
2474,
8,
198... | 2.922222 | 90 |
import tensorflow as tf
from functools import reduce
from operator import mul
from string import ascii_lowercase
import numpy as np
import tensorflow as tf
from ordered_set import OrderedSet
# These are constants:
# max k = 9
ascii_chi = ascii_lowercase[:9]
ascii_f = ascii_lowercase[9:18]
# max feature vector dimensi... | [
11748,
11192,
273,
11125,
355,
48700,
198,
6738,
1257,
310,
10141,
1330,
4646,
198,
6738,
10088,
1330,
35971,
198,
6738,
4731,
1330,
355,
979,
72,
62,
21037,
7442,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
11192,
273,
11125,
... | 3.203593 | 167 |