content stringlengths 1 1.04M | input_ids listlengths 1 774k | ratio_char_token float64 0.38 22.9 | token_count int64 1 774k |
|---|---|---|---|
"""
Spec validator schema data
ISSUES:
place regex rule on email addresses, domain name
"""
import yaml
from cerberus import Validator, schema_registry
from awsorgs.utils import yamlfmt
# Schema for validating spec files. Since spec is accumulated from multiple
# files, we do not place a 'require' rule on firs... | [
37811,
198,
22882,
4938,
1352,
32815,
1366,
198,
198,
1797,
12564,
1546,
25,
198,
220,
220,
220,
1295,
40364,
3896,
319,
3053,
9405,
11,
7386,
1438,
198,
37811,
198,
11748,
331,
43695,
198,
198,
6738,
26074,
39192,
1330,
48951,
1352,
11... | 2.822151 | 2,176 |
# Copyright (c) 2021 Vlad Balmos <vladbalmos@yahoo.com>
# Author: Vlad Balmos <vladbalmos@yahoo.com>
# See LICENSE file
import string
from . import tokens as Token
from . import keywords
class Lexer():
'''
SQL String tokenizer.
Parses a string one char at a time
'''
def parse_dec_number(self):
... | [
2,
15069,
357,
66,
8,
33448,
13080,
8528,
16785,
1279,
85,
9435,
6893,
16785,
31,
40774,
13,
785,
29,
198,
2,
6434,
25,
13080,
8528,
16785,
1279,
85,
9435,
6893,
16785,
31,
40774,
13,
785,
29,
198,
2,
4091,
38559,
24290,
2393,
198,
... | 1.712068 | 3,994 |
from asyncore import loop
import RPi.GPIO as GPIO
from colour import Color
from Core.Enumerations import *
from Core.Sensors.OpticalSensor import OpticalSensor
from Core.Sensors.TouchSensor import TouchSensor
from Core.Actuators.LEDActuator import LEDActuator
from Core.Actuators.WheelActuator import WheelActuator | [
6738,
355,
2047,
7295,
1330,
9052,
198,
11748,
25812,
72,
13,
16960,
9399,
355,
50143,
198,
6738,
9568,
1330,
5315,
198,
6738,
7231,
13,
4834,
6975,
602,
1330,
1635,
198,
6738,
7231,
13,
50,
641,
669,
13,
27871,
605,
47864,
1330,
4959... | 3.488889 | 90 |
from __future__ import absolute_import
from __future__ import with_statement
from celery.app.registry import TaskRegistry
from celery.task import Task, PeriodicTask
from celery.tests.utils import Case
| [
6738,
11593,
37443,
834,
1330,
4112,
62,
11748,
198,
6738,
11593,
37443,
834,
1330,
351,
62,
26090,
198,
198,
6738,
18725,
1924,
13,
1324,
13,
2301,
4592,
1330,
15941,
8081,
4592,
198,
6738,
18725,
1924,
13,
35943,
1330,
15941,
11,
1858... | 3.727273 | 55 |
import re
import pytest
from aioresponses import aioresponses
from . import conftest as fix
import connaisseur.alert as alert
import connaisseur.config as co
import connaisseur.exceptions as exc
from connaisseur.admission_request import AdmissionRequest
from connaisseur.image import Image
from connaisseur.validators.st... | [
11748,
302,
198,
11748,
12972,
9288,
198,
6738,
257,
72,
382,
20587,
274,
1330,
257,
72,
382,
20587,
274,
198,
6738,
764,
1330,
369,
701,
395,
355,
4259,
198,
11748,
369,
2616,
20782,
333,
13,
44598,
355,
7995,
198,
11748,
369,
2616,
... | 1.629974 | 1,935 |
memory = {}
| [
198,
31673,
796,
23884,
628
] | 2.8 | 5 |
# https://stackoverflow.com/questions/20452486/create-qr-code-in-python-pyqt
import qrcode
from PyQt5 import QtCore
from PyQt5.QtGui import QImage, QPainter, QPixmap
| [
2,
3740,
1378,
25558,
2502,
11125,
13,
785,
14,
6138,
507,
14,
1238,
2231,
1731,
4521,
14,
17953,
12,
80,
81,
12,
8189,
12,
259,
12,
29412,
12,
9078,
39568,
198,
11748,
10662,
6015,
1098,
198,
6738,
9485,
48,
83,
20,
1330,
33734,
... | 2.455882 | 68 |
from mtmlcv.plot import plot_result
from mtmlcv.utils import print_info
from mtmlcv.data_loader import Data_Loader
import numpy as np
import tensorflow as tf
import os
import glob
import sys
import joblib
sys.path.insert(0, os.path.abspath("../src"))
timestamp = "lc1000.0-lc_late1000.0"
fout = open("log.reload{}".for... | [
6738,
285,
20369,
33967,
13,
29487,
1330,
7110,
62,
20274,
198,
6738,
285,
20369,
33967,
13,
26791,
1330,
3601,
62,
10951,
198,
6738,
285,
20369,
33967,
13,
7890,
62,
29356,
1330,
6060,
62,
17401,
198,
11748,
299,
32152,
355,
45941,
198... | 2.375486 | 1,028 |
from django.apps import AppConfig
| [
6738,
42625,
14208,
13,
18211,
1330,
2034,
16934,
628
] | 3.888889 | 9 |
import re
import sklearn.metrics as mt
import collections
#%% Functions
true, pred =parseOutput('output.txt')
evaluation(true,pred)
print(collections.Counter(true))
print(collections.Counter(pred)) | [
11748,
302,
198,
198,
11748,
1341,
35720,
13,
4164,
10466,
355,
45079,
198,
11748,
17268,
628,
198,
2,
16626,
40480,
628,
198,
7942,
11,
2747,
796,
29572,
26410,
10786,
22915,
13,
14116,
11537,
198,
198,
18206,
2288,
7,
7942,
11,
28764,... | 3.274194 | 62 |
import uuid
from datetime import datetime
from typing import Optional, Any, List, Union, Callable
from tracardi_dot_notation.dot_accessor import DotAccessor
from .entity import Entity
from .metadata import Metadata
from .pii import PII
from .profile_traits import ProfileTraits
from .time import Time
from .value_object.... | [
11748,
334,
27112,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
19720,
1330,
32233,
11,
4377,
11,
7343,
11,
4479,
11,
4889,
540,
198,
6738,
491,
330,
22490,
62,
26518,
62,
38983,
13,
26518,
62,
15526,
273,
1330,
22875,
15457,
2... | 3.822086 | 163 |
"""diablo3_community_api.py file."""
from ..api import Api
class Diablo3CommunityApi(Api):
"""All Diablo 3 Community API methods.
Attributes:
client_id: A string client id supplied by Blizzard.
client_secret: A string client secret supplied by Blizzard.
"""
def __init__(self, client_... | [
37811,
10989,
18817,
18,
62,
28158,
62,
15042,
13,
9078,
2393,
526,
15931,
198,
6738,
11485,
15042,
1330,
5949,
72,
628,
198,
4871,
31452,
18,
20012,
32,
14415,
7,
32,
14415,
2599,
198,
220,
220,
220,
37227,
3237,
31452,
513,
8108,
78... | 2.558559 | 1,776 |
import BasicMaths
import Bayes
import BIQUAD
import ComplexMaths
import Controller
import Convolutions
import Decimate
import Distance
import FastMath
import FIR
import Matrix
import Softmax
import Stats
import Support
import SVM
import Transform
BasicMaths.generatePatterns()
Bayes.generatePatterns()
BIQUAD.generate... | [
11748,
14392,
44,
33148,
198,
11748,
4696,
274,
198,
11748,
20068,
10917,
2885,
198,
11748,
19157,
44,
33148,
198,
11748,
22741,
198,
11748,
1482,
10396,
3508,
198,
11748,
4280,
1920,
198,
11748,
34600,
198,
11748,
12549,
37372,
198,
11748,... | 3.333333 | 207 |
"""@file generic.py
Model independent theory functions
"""
# Functions to model halo profiles
import warnings
import numpy as np
__all__ = ['compute_reduced_shear_from_convergence',
'compute_magnification_bias_from_magnification']
# functions that are general to all backends
def compute_reduced_shear_fr... | [
37811,
31,
7753,
14276,
13,
9078,
198,
17633,
4795,
4583,
5499,
198,
37811,
198,
2,
40480,
284,
2746,
289,
7335,
16545,
198,
198,
11748,
14601,
198,
11748,
299,
32152,
355,
45941,
198,
198,
834,
439,
834,
796,
37250,
5589,
1133,
62,
4... | 2.635977 | 706 |
########################################################################################################################
# Training
learning_rate = 0.001
batch_size = 50
observation_time = 5e3
rand_observation_time = 5e2
prob_random = 0.9
gamma = 0.9
fit_epochs = 10
n_plays = 500 # TODO: Change to 100
n_actual_plays =... | [
29113,
29113,
29113,
14468,
7804,
198,
2,
13614,
198,
40684,
62,
4873,
796,
657,
13,
8298,
198,
43501,
62,
7857,
796,
2026,
198,
672,
3168,
341,
62,
2435,
796,
642,
68,
18,
198,
25192,
62,
672,
3168,
341,
62,
2435,
796,
642,
68,
1... | 4.895954 | 173 |
"""Check the homework."""
from os import path
import logging
from datetime import datetime
from . import tools
from .schema_manager import SchemaManager
from .schema_tags import Tags
from .tasks import Task
log = logging.getLogger("GHC")
class Checker:
"""Check homework."""
TESTS_TAG = 'tests'
def _... | [
37811,
9787,
262,
26131,
526,
15931,
198,
198,
6738,
28686,
1330,
3108,
198,
198,
11748,
18931,
198,
6738,
4818,
8079,
1330,
4818,
8079,
198,
198,
6738,
764,
1330,
4899,
198,
6738,
764,
15952,
2611,
62,
37153,
1330,
10011,
2611,
13511,
... | 2.047904 | 1,002 |
from torchvision.models import resnet18
from torchscope import scope
from torchprofile import profile_macs
import torch
from torchvision.models import resnet18
model = resnet18()
inputs = torch.randn(1, 3, 224, 224)
# model = resnet18()
# scope(model, input_size=(3, 224, 224))
macs = profile_macs(model, inputs)
pri... | [
6738,
28034,
10178,
13,
27530,
1330,
581,
3262,
1507,
198,
6738,
28034,
29982,
1330,
8354,
198,
6738,
28034,
13317,
1330,
7034,
62,
76,
16436,
198,
198,
11748,
28034,
198,
6738,
28034,
10178,
13,
27530,
1330,
581,
3262,
1507,
198,
198,
... | 2.991071 | 112 |
import stl
from magnum.examples import rock_paper_scissors_generator as rpsg
| [
11748,
336,
75,
198,
198,
6738,
7842,
388,
13,
1069,
12629,
1330,
3881,
62,
20189,
62,
1416,
32555,
62,
8612,
1352,
355,
374,
862,
70,
628,
628,
198
] | 2.928571 | 28 |
# -*- coding: utf-8 -*-
# @Time : 20-6-4 下午2:13
# @Author : zhuying
# @Company : Minivision
# @File : utility.py
# @Software : PyCharm
import pdb
from datetime import datetime
import os
import torch
import torch.nn as nn
from torch.optim.lr_scheduler import MultiStepLR
from collections import Counter
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
7575,
1058,
1160,
12,
21,
12,
19,
220,
10310,
233,
39355,
230,
17,
25,
1485,
198,
2,
2488,
13838,
1058,
1976,
13415,
1112,
198,
2,
2488,
39154,
1058,
1855,
... | 2.72807 | 114 |
import sys
from numpy import genfromtxt
import numpy as np
| [
11748,
25064,
198,
6738,
299,
32152,
1330,
2429,
6738,
14116,
198,
11748,
299,
32152,
355,
45941,
198
] | 3.470588 | 17 |
"""
scope.py
the code in this file is meant to demonstrate how variable scope
works in python 3.8. When writing this code, I referred to the Python 3.8
documentation to ensure that I was using the correct technical vocabulary
in my own documentation, but all code written is my own.
Doc pages I referred to:
Exec... | [
37811,
198,
29982,
13,
9078,
198,
198,
1169,
2438,
287,
428,
2393,
318,
4001,
284,
10176,
703,
7885,
8354,
220,
198,
5225,
287,
21015,
513,
13,
23,
13,
1649,
3597,
428,
2438,
11,
314,
6412,
284,
262,
11361,
513,
13,
23,
198,
22897,
... | 3.775641 | 312 |
"""
Unit tests for data iterator related operations.
"""
import copy
import tempfile
import unittest
from typing import List, Tuple, no_type_check
import numpy as np
import torch
from texar.torch.data.data.data_base import (
DataBase, DataSource, IterDataSource, SequenceDataSource, ZipDataSource)
from texar.torch... | [
37811,
198,
26453,
5254,
329,
1366,
41313,
3519,
4560,
13,
198,
37811,
198,
11748,
4866,
198,
11748,
20218,
7753,
198,
11748,
555,
715,
395,
198,
6738,
19720,
1330,
7343,
11,
309,
29291,
11,
645,
62,
4906,
62,
9122,
198,
198,
11748,
2... | 2.302131 | 2,863 |
import FWCore.ParameterSet.Config as cms
| [
11748,
48849,
14055,
13,
36301,
7248,
13,
16934,
355,
269,
907,
628,
198
] | 3.307692 | 13 |
from django.test import TestCase
from hyperion.models import Comment, UserProfile, Post
from django.contrib.auth.models import User
# TODO: FIND PROBLEM IN DESIGN MODEL COMMENT
# def test_same_user_comment_in_multi_post_by_same_author(self):
# u1 = User.objects.create(
# username="c1",
... | [
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
6738,
8718,
295,
13,
27530,
1330,
18957,
11,
11787,
37046,
11,
2947,
198,
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
628,
198,
220,
220,
220,
1303,
16926,
... | 1.941257 | 732 |
import torch
from torch import nn
from torch import distributions as dists
from torch.nn import Module, Parameter, ModuleList
from torch.nn.functional import softplus
import numpy as np
import math
from .distribution import Distribution
from dpm.utils import softplus_inverse
| [
11748,
28034,
198,
6738,
28034,
1330,
299,
77,
198,
6738,
28034,
1330,
24570,
355,
288,
1023,
198,
6738,
28034,
13,
20471,
1330,
19937,
11,
25139,
2357,
11,
19937,
8053,
198,
6738,
28034,
13,
20471,
13,
45124,
1330,
2705,
9541,
198,
117... | 4.073529 | 68 |
import os
import pytest
from py.xml import html
from selenium import webdriver
from selenium.webdriver import Remote
from selenium.webdriver.chrome.options import Options as CH_Options
from selenium.webdriver.firefox.options import Options as FF_Options
from config import RunConfig
# 项目目录配置
BASE_DIR = os.path.dirname(... | [
11748,
28686,
198,
11748,
12972,
9288,
198,
6738,
12972,
13,
19875,
1330,
27711,
198,
6738,
384,
11925,
1505,
1330,
3992,
26230,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
1330,
21520,
198,
6738,
384,
11925,
1505,
13,
12384,
26230,
13... | 1.942002 | 2,138 |
from django.contrib.auth.models import User
from django.test import TestCase
from adminlte_log.models import AdminlteLogType, AdminlteLog
| [
6738,
42625,
14208,
13,
3642,
822,
13,
18439,
13,
27530,
1330,
11787,
198,
6738,
42625,
14208,
13,
9288,
1330,
6208,
20448,
198,
198,
6738,
13169,
75,
660,
62,
6404,
13,
27530,
1330,
32053,
75,
660,
11187,
6030,
11,
32053,
75,
660,
11... | 3.255814 | 43 |
longest = (0,0)
for i in xrange(1000000):
length = collatz(i)
longest = (i, length) if length > longest[1] else longest
print longest[0]
| [
198,
6511,
395,
796,
357,
15,
11,
15,
8,
198,
1640,
1312,
287,
2124,
9521,
7,
16,
10535,
2599,
198,
220,
4129,
796,
2927,
27906,
7,
72,
8,
198,
220,
14069,
796,
357,
72,
11,
4129,
8,
611,
4129,
1875,
14069,
58,
16,
60,
2073,
1... | 2.679245 | 53 |
import jax
import jax.numpy as np
dim_s = 2
dim_z = 100
dim_x = 2
dim_u = 3
dim_xi = 3
val_s = np.arange(dim_s, dtype='int32')
val_z = np.linspace(0, 1, dim_z)
val_z = np.stack((val_z, 1-val_z), axis=-1)
val_ind_z = np.arange(dim_z, dtype='int32')
val_x = np.arange(dim_x, dtype='int32')
val_u = np.arange(dim_u, dtype... | [
11748,
474,
897,
198,
11748,
474,
897,
13,
77,
32152,
355,
45941,
198,
198,
27740,
62,
82,
796,
362,
198,
27740,
62,
89,
796,
1802,
198,
27740,
62,
87,
796,
362,
198,
27740,
62,
84,
796,
513,
198,
27740,
62,
29992,
796,
513,
198,
... | 1.973111 | 781 |
# -*- coding: utf-8 -*-
"""
Created on Mon May 14 14:35:01 2018
@author: nsde
"""
#%%
from tensorflow.python.keras._impl.keras.layers.core import Layer
from ddtn.transformers.transformer_layers import ST_Affine_transformer
from ddtn.transformers.transformer_layers import ST_Affinediffeo_transformer
from ddtn.transfo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
2892,
1737,
1478,
1478,
25,
2327,
25,
486,
2864,
198,
198,
31,
9800,
25,
36545,
2934,
198,
37811,
198,
198,
2,
16626,
198,
6738,
11192,
273,
11... | 2.954416 | 1,053 |
from itertools import combinations
import pytest
from pandas import DataFrame
from eda_report.multivariate import MultiVariable
| [
6738,
340,
861,
10141,
1330,
17790,
198,
11748,
12972,
9288,
198,
198,
6738,
19798,
292,
1330,
6060,
19778,
198,
6738,
1225,
64,
62,
13116,
13,
16680,
42524,
1330,
15237,
43015,
628,
198
] | 4.09375 | 32 |
from sys import exit
from csv import DictWriter
import click
from xpanse.client import ExClient
def flatten_rf(flow):
"""
Flattens the Risky Flow objects into a flat dict to write to CSV.
"""
return {
"id": flow.get("id"),
"businessUnit": flow.get("businessUnit", {}).get("name"),
... | [
6738,
25064,
1330,
8420,
198,
6738,
269,
21370,
1330,
360,
713,
34379,
198,
198,
11748,
3904,
198,
6738,
2124,
6839,
325,
13,
16366,
1330,
1475,
11792,
628,
198,
4299,
27172,
268,
62,
41871,
7,
11125,
2599,
198,
220,
220,
220,
37227,
... | 2.784404 | 654 |
from datetime import datetime
from flask_restful import Resource, reqparse
from flask import jsonify
from meme import db, ma
from meme.models import Task, Engineer
class TaskSchema(ma.ModelSchema):
"""Marshmallow "serialization schema for Task db Table"""
class Tasks(Resource):
"""REST API resource for gett... | [
6738,
4818,
8079,
1330,
4818,
8079,
198,
6738,
42903,
62,
2118,
913,
1330,
20857,
11,
43089,
29572,
198,
6738,
42903,
1330,
33918,
1958,
198,
6738,
25336,
1330,
20613,
11,
17266,
198,
6738,
25336,
13,
27530,
1330,
15941,
11,
23164,
628,
... | 3.89899 | 99 |
from celery import shared_task
from celery_progress.backend import ProgressRecorder
from django.core.cache import cache
from comps.models import Heat_Entry
from rankings.models import Dancer, Couple
from rankings.rating_stats import couple_stats, instructor_stats
from decimal import Decimal
from operator import itemget... | [
6738,
18725,
1924,
1330,
4888,
62,
35943,
198,
6738,
18725,
1924,
62,
33723,
13,
1891,
437,
1330,
18387,
6690,
2875,
198,
6738,
42625,
14208,
13,
7295,
13,
23870,
1330,
12940,
198,
6738,
552,
82,
13,
27530,
1330,
12308,
62,
30150,
198,
... | 3.685714 | 105 |
import flask
from flask import request, jsonify, abort
# https://programminghistorian.org/en/lessons/creating-apis-with-python-and-flask#lesson-goals
app = flask.Flask(__name__)
app.config["DEBUG"] = True
data = [
{"id":0, "name":"number1", "bool":True},
{"id":1, "name":"number2", "bool":False},
{"id":2, ... | [
11748,
42903,
198,
6738,
42903,
1330,
2581,
11,
33918,
1958,
11,
15614,
198,
2,
3740,
1378,
23065,
2229,
10034,
22618,
13,
2398,
14,
268,
14,
1203,
684,
14,
20123,
278,
12,
499,
271,
12,
4480,
12,
29412,
12,
392,
12,
2704,
2093,
2,
... | 2.361624 | 271 |
'''
Authors: Donnie Marino, Kostas Stamatiou
Contact: dmarino@digitalglobe.com
Unit tests for the gbdxtools.Idaho class
'''
from gbdxtools import LandsatImage
import vcr
import unittest
from helpers import mockable_interface, gbdx_vcr
| [
7061,
6,
198,
30515,
669,
25,
2094,
11952,
46043,
11,
509,
455,
292,
30097,
7246,
280,
198,
17829,
25,
288,
3876,
2879,
31,
34725,
4743,
5910,
13,
785,
198,
198,
26453,
5254,
329,
262,
308,
17457,
742,
10141,
13,
7390,
17108,
1398,
... | 2.938272 | 81 |
#!/usr/bin/env python
# Generate the stimulus videos for all images of the current rapid categorization experiment
import os
import subprocess
import shutil
# Greatest common denominator
if __name__ == '__main__':
onset_times_ms = [1000]
after_time_ms = 0
import glob
input_image_paths = sorted(glob.... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
2980,
378,
262,
19819,
5861,
329,
477,
4263,
286,
262,
1459,
5801,
17851,
1634,
6306,
198,
198,
11748,
28686,
198,
11748,
850,
14681,
198,
11748,
4423,
346,
198,
198,
2,
33575,
2219... | 2.410053 | 378 |
__all__ = ['cmpaction', 'cmpglobal_binding', 'cmpglobal_cmppolicy_binding', 'cmpparameter', 'cmppolicy', 'cmppolicy_binding', 'cmppolicy_cmpglobal_binding', 'cmppolicy_cmppolicylabel_binding', 'cmppolicy_crvserver_binding', 'cmppolicy_csvserver_binding', 'cmppolicy_lbvserver_binding', 'cmppolicylabel', 'cmppolicylabel_... | [
834,
439,
834,
796,
37250,
48991,
2673,
3256,
705,
48991,
20541,
62,
30786,
3256,
705,
48991,
20541,
62,
11215,
381,
21424,
62,
30786,
3256,
705,
11215,
381,
41158,
2357,
3256,
705,
11215,
381,
21424,
3256,
705,
11215,
381,
21424,
62,
3... | 2.934783 | 138 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-06-27 18:30
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2980,
515,
416,
37770,
352,
13,
1157,
13,
1485,
319,
2864,
12,
3312,
12,
1983,
1248,
25,
1270,
198,
6738,
11593,
37443,
834,
1330,
28000,
1098,
62,
17201,
874,
198,... | 2.969697 | 66 |
import logging
import zeep
from flask import current_app as app
logger = logging.getLogger(app.config['SERVICE_KEY'])
logger.setLevel(logging.DEBUG)
class SoapClient(object):
""" Allows making request to a given SOAP endpoint.
This class uses the ZEEP Python library (https://docs.python-zeep.org/en/maste... | [
11748,
18931,
198,
11748,
41271,
538,
198,
198,
6738,
42903,
1330,
1459,
62,
1324,
355,
598,
628,
198,
6404,
1362,
796,
18931,
13,
1136,
11187,
1362,
7,
1324,
13,
11250,
17816,
35009,
27389,
62,
20373,
6,
12962,
198,
6404,
1362,
13,
2... | 3.253623 | 276 |
from aerofiles.igc import Reader
from opensoar.competition.soaringspot import get_info_from_comment_lines
| [
6738,
9551,
1659,
2915,
13,
328,
66,
1330,
25342,
198,
198,
6738,
1280,
568,
283,
13,
5589,
15620,
13,
568,
283,
654,
13059,
1330,
651,
62,
10951,
62,
6738,
62,
23893,
62,
6615,
628,
198
] | 3.114286 | 35 |
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf8") as rdm:
long_description = rdm.read()
with open("src/whitespace_repair/version.py", "r", encoding="utf8") as vf:
version = vf.readlines()[-1].strip().split()[-1].strip("\"'")
setup(
name="whitespace_repair",
vers... | [
6738,
900,
37623,
10141,
1330,
9058,
11,
1064,
62,
43789,
198,
198,
4480,
1280,
7203,
15675,
11682,
13,
9132,
1600,
366,
81,
1600,
21004,
2625,
40477,
23,
4943,
355,
374,
36020,
25,
198,
220,
220,
220,
890,
62,
11213,
796,
374,
36020,... | 1.957895 | 570 |
import sys, base64
if not len(sys.argv) == 2:
quit()
cookie = sys.argv[1]
cookie = cookie.split('.')[0] + '==='
dataStr = base64.urlsafe_b64decode(cookie)
print dataStr
| [
11748,
25064,
11,
2779,
2414,
198,
198,
361,
407,
18896,
7,
17597,
13,
853,
85,
8,
6624,
362,
25,
198,
197,
47391,
3419,
198,
198,
44453,
796,
25064,
13,
853,
85,
58,
16,
60,
198,
44453,
796,
19751,
13,
35312,
10786,
2637,
38381,
... | 2.402778 | 72 |
# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rahul Handay <rahulha@saltstack.com>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import (
MagicMock,... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
7061,
6,
198,
220,
220,
220,
1058,
8189,
9800,
25,
1058,
12888,
25,
63,
47135,
377,
7157,
323,
1279,
11392,
377,
3099,
31,
82,
2501,
25558,
13,
785,
29,
63,
198,
706... | 1.668123 | 4,119 |
from ionoscloud.exceptions import ApiException, ApiTimeout, ApiFailedRequest
from ionosenterprise.errors import (
ICNotAuthorizedError,
ICNotFoundError,
ICValidationError,
ICRateLimitExceededError,
ICError,
ICFailedRequest,
ICTimeoutError
)
import json
import functools
import re
import inspe... | [
6738,
22088,
418,
17721,
13,
1069,
11755,
1330,
5949,
72,
16922,
11,
5949,
72,
48031,
11,
5949,
72,
37,
6255,
18453,
198,
6738,
22088,
418,
9255,
7919,
13,
48277,
1330,
357,
198,
220,
220,
220,
12460,
3673,
13838,
1143,
12331,
11,
198... | 2.824561 | 114 |
#!/usr/bin/env python3
import torch
from torch import Tensor
from torch.nn import Module
from typing import Any, Callable, List, Optional, Tuple, Union
from ..._utils.approximation_methods import approximation_parameters
from ..._utils.attribution import LayerAttribution, GradientAttribution
from ..._utils.batching imp... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
11748,
28034,
198,
6738,
28034,
1330,
309,
22854,
198,
6738,
28034,
13,
20471,
1330,
19937,
198,
6738,
19720,
1330,
4377,
11,
4889,
540,
11,
7343,
11,
32233,
11,
309,
29291,
11,
44... | 3.093137 | 204 |
__all__ = ['dentonm', 'test']
from .denton import dentonm
from statsmodels.tools._testing import PytestTester
test = PytestTester()
| [
834,
439,
834,
796,
37250,
67,
26673,
76,
3256,
705,
9288,
20520,
198,
6738,
764,
67,
26673,
1330,
18794,
261,
76,
198,
6738,
9756,
27530,
13,
31391,
13557,
33407,
1330,
9485,
9288,
51,
7834,
198,
198,
9288,
796,
9485,
9288,
51,
7834,... | 3.022727 | 44 |
#!/usr/bin/env python3
import math
input = 312051
print('Distance for {} is {}'.format(input, find_distance(input)))
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
198,
11748,
10688,
198,
198,
15414,
796,
34465,
2713,
16,
198,
198,
4798,
10786,
45767,
329,
23884,
318,
23884,
4458,
18982,
7,
15414,
11,
1064,
62,
30246,
7,
15414,
22305,
198
] | 2.926829 | 41 |
#
# author: Cosmin Basca
#
# Copyright 2010 University of Zurich
#
# 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 a... | [
2,
198,
2,
1772,
25,
10437,
1084,
347,
42688,
198,
2,
198,
2,
15069,
3050,
2059,
286,
43412,
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,
2... | 3.451724 | 290 |
non_sense_list = ['tree', [[1,2,3], [4, 5, 6]], 4, 55.6, 4 + 5j, (200, 50)]
non_sense_list.append(non_sense_list)
for i in range(0,7):
print('Data: {}, Type: {}'.format(non_sense_list[i], type(non_sense_list[i]))) | [
13159,
62,
33819,
62,
4868,
796,
37250,
21048,
3256,
16410,
16,
11,
17,
11,
18,
4357,
685,
19,
11,
642,
11,
718,
60,
4357,
604,
11,
5996,
13,
21,
11,
604,
1343,
642,
73,
11,
357,
2167,
11,
2026,
15437,
198,
13159,
62,
33819,
62,... | 2.158416 | 101 |
# Useful starting lines
# %matplotlib inline
import numpy as np
import scipy
import scipy.io
import scipy.sparse as sp
import matplotlib.pyplot as plt
# %load_ext autoreload
# %autoreload 2
from helpers import load_data, preprocess_data
from plots import plot_raw_data
from plots import plot_train_test_data
from helpe... | [
2,
49511,
3599,
3951,
198,
2,
4064,
6759,
29487,
8019,
26098,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
629,
541,
88,
198,
11748,
629,
541,
88,
13,
952,
198,
11748,
629,
541,
88,
13,
82,
29572,
355,
599,
198,
11748,
2603,... | 2.415138 | 3,488 |
import logging
| [
11748,
18931,
628
] | 5.333333 | 3 |
# Copyright (c) 2017, 2018, Oracle and/or its affiliates.
# Copyright (c) 2013, Regents of the University of California
#
# 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 ... | [
2,
15069,
357,
66,
8,
2177,
11,
2864,
11,
18650,
290,
14,
273,
663,
29116,
13,
198,
2,
15069,
357,
66,
8,
2211,
11,
3310,
658,
286,
262,
2059,
286,
3442,
198,
2,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
... | 3.419231 | 520 |
# -*-coding:Utf-8 -*
# Copyright (c) 2015 LE GOFF Vincent
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# lis... | [
2,
532,
9,
12,
66,
7656,
25,
18274,
69,
12,
23,
532,
9,
198,
198,
2,
15069,
357,
66,
8,
1853,
12509,
10351,
5777,
18653,
198,
2,
1439,
2489,
10395,
13,
198,
2,
198,
2,
2297,
396,
3890,
290,
779,
287,
2723,
290,
13934,
5107,
11... | 2.323345 | 2,236 |
## AIC/BIC criterion
import numpy as np
import matplotlib.pyplot as plt
import time as tictoc
from scipy.stats import rankdata
exec(open('python/ecco2/local_functions.py').read())
exec(open('python/ecco2/colormaps.py').read())
#(eofs,pcs,eigs) = np.load('python/gyres/theta_eofs_lowres.npy')
(eofs,pcs,eigs) = np.load(... | [
2235,
317,
2149,
14,
33,
2149,
34054,
198,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83,
198,
11748,
640,
355,
256,
713,
420,
198,
6738,
629,
541,
88,
13,
34242,
1330,
4279,
7890,
... | 1.942263 | 866 |
""" Test whether doc examples same as previously
"""
from os.path import join as pjoin, dirname
from nb2plots.from_notebook import convert_nb_fname
from nb2plots.converters import to_py, to_notebook
from nb2plots.testing import stripeq
from nb2plots.testing.convutils import fcontents
from nb2plots.testing.nbtesters ... | [
37811,
6208,
1771,
2205,
6096,
976,
355,
4271,
198,
37811,
198,
198,
6738,
28686,
13,
6978,
1330,
4654,
355,
279,
22179,
11,
26672,
3672,
198,
198,
6738,
299,
65,
17,
489,
1747,
13,
6738,
62,
11295,
2070,
1330,
10385,
62,
46803,
62,
... | 2.89781 | 137 |
# -*- coding: utf-8 -*-
"""
Created on Thu Feb 17 00:37:28 2022
@author: ACER
"""
def tkinter importar *
def tkinter importar ttk
# crear una ventana
ventana = Tk ()
ventana _ geometría ( '400x400' )
# Crear los componentes
label_result = Etiqueta ( ventana , texto = "<<resultado>>" )
comboBox_languages =... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
26223,
3158,
1596,
3571,
25,
2718,
25,
2078,
33160,
198,
198,
31,
9800,
25,
7125,
1137,
198,
37811,
198,
198,
4299,
220,
256,
74,
3849,
220,
13... | 2.458167 | 251 |
search_query = """
query SearchStickerSample {
sticker {
searchStickers(
req:{
searchStickersParams:{searchText: "search_text", numberResults: number_results},
stickerUserContext:{countryCode: US, localTimeZoneUTCOffsetMinutes: 2,locale: EN_US}
}){
stickerResults {
items ... | [
12947,
62,
22766,
796,
37227,
198,
22766,
11140,
1273,
15799,
36674,
1391,
198,
220,
27735,
1391,
198,
220,
220,
220,
2989,
1273,
21630,
7,
198,
220,
220,
220,
220,
220,
43089,
29164,
198,
220,
220,
220,
220,
220,
220,
220,
2989,
1273... | 2.019637 | 662 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.functional as F
# self.fc2 = nn.Linear(40 + sampleSize * 2, outSize)
| [
11748,
28034,
198,
11748,
28034,
13,
20471,
355,
299,
77,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
198,
198,
11748,
28034,
13,
20471,
13,
45124,
355,
376,
628,
628,
628,
220,
220,
220,
1303,
220,
220,
220,
220,
220,
220,
2... | 2.58209 | 67 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 1.0.2.7202 (http://hl7.org/fhir/StructureDefinition/ImagingObjectSelection) on 2019-05-14.
# 2019, SMART Health IT.
from . import (backboneelement, codeableconcept, domainresource, fhirdate,
fhirreference)
class ImagingObjectSele... | [
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,
220,
2980,
515,
422,
376,
39,
4663,
352,
13,
15,
13,
17,
13,
22,
19004,
357,
4023,
1378,
18519,
22,
13... | 2.816142 | 2,540 |
# The collection of functions for the Boston AirBnB dataset
# import necessary libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from pandas.tseries.holiday import USFederalHolidayCalendar as calendar #To check holidays in the U.S
import time
import copy
def load_b... | [
2,
383,
4947,
286,
5499,
329,
262,
6182,
3701,
33,
77,
33,
27039,
198,
198,
2,
1330,
3306,
12782,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
19798,
292,
355,
279,
67,
198,
11748,
2603,
29487,
8019,
13,
9078,
29487,
355,
458,
83... | 2.526195 | 6,986 |
import unittest
from katas.kyu_7.array_info import array_info
| [
11748,
555,
715,
395,
198,
198,
6738,
479,
265,
292,
13,
2584,
84,
62,
22,
13,
18747,
62,
10951,
1330,
7177,
62,
10951,
628
] | 2.666667 | 24 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: test_platform/phosphorus/common.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf imp... | [
2,
2980,
515,
416,
262,
8435,
11876,
17050,
13,
220,
8410,
5626,
48483,
0,
198,
2,
2723,
25,
1332,
62,
24254,
14,
746,
14222,
15125,
14,
11321,
13,
1676,
1462,
198,
198,
11748,
25064,
198,
62,
65,
28,
17597,
13,
9641,
62,
10951,
5... | 2.525531 | 2,683 |
#print("Hello Sara!")
#print("Hello Tim!")
import sys
from tkinter import *
from tkinter import filedialog
from PIL import Image, ImageTk, ImageDraw
window = Tk()
window.title("Gridify")
quitbutton = Button(window, text="Quit", command=window.destroy).pack()
openbutton = Button(window, text="Open Image", command=op... | [
2,
4798,
7203,
15496,
24799,
2474,
8,
198,
2,
4798,
7203,
15496,
5045,
2474,
8,
198,
198,
11748,
25064,
198,
6738,
256,
74,
3849,
1330,
1635,
198,
6738,
256,
74,
3849,
1330,
5717,
498,
519,
198,
6738,
350,
4146,
1330,
7412,
11,
7412... | 3.157895 | 133 |
# Built-in
import os
import re
import itertools as itt
# Common
import numpy as np
from scipy.interpolate import RectBivariateSpline as scpRectSpl
__all__ = ['read', 'read_all']
_DTYPES = {'adf11': ['acd', 'ccd', 'scd', 'plt', 'prb'],
'adf15': None}
_DEG = 1
# ########################################... | [
198,
2,
28477,
12,
259,
198,
11748,
28686,
198,
11748,
302,
198,
11748,
340,
861,
10141,
355,
340,
83,
198,
198,
2,
8070,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
3849,
16104,
378,
1330,
48599,
33,
42524,
265... | 2.345717 | 3,257 |
"""Tests for neurodocker.interfaces.AFNI"""
import pytest
from neurodocker.interfaces import AFNI
from neurodocker.interfaces.tests import utils
| [
37811,
51,
3558,
329,
7669,
45986,
13,
3849,
32186,
13,
8579,
22125,
37811,
198,
198,
11748,
12972,
9288,
198,
198,
6738,
7669,
45986,
13,
3849,
32186,
1330,
12341,
22125,
198,
6738,
7669,
45986,
13,
3849,
32186,
13,
41989,
1330,
3384,
... | 3.52381 | 42 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# ********************************************************************************
# Copyright © 2019 jianglin
# File Name: test_elasticsearch.py
# Author: jianglin
# Email: mail@honmaple.com
# Created: 2019-04-01 10:16:57 (CST)
# Last Update: Monday 2020-06-19 12:03:10 (CS... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
41906,
17174,
8412,
198,
2,
15069,
10673,
13130,
474,
15483,
2815,
198,
2,
9220,
6530,
25,
1332,
62,
417,
3477,
12... | 2.804487 | 312 |
# coding: utf-8
# Copyright (c) 2021 AkaiKKRteam.
# Distributed under the terms of the Apache License, Version 2.0.
import os
from akaikkr_cnd import AkaikkrJob
#
#
akaikkr_exe="../../specx"
#
# main function
main()
| [
2,
19617,
25,
3384,
69,
12,
23,
198,
2,
15069,
357,
66,
8,
33448,
9084,
1872,
16601,
49,
15097,
13,
198,
2,
4307,
6169,
739,
262,
2846,
286,
262,
24843,
13789,
11,
10628,
362,
13,
15,
13,
198,
198,
11748,
28686,
198,
6738,
22430,
... | 2.691358 | 81 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : qichun tang
# @Contact : tqichun@gmail.com
from collections import Counter
import category_encoders.utils as util
import numpy as np
import pandas as pd
from pandas.core.common import SettingWithCopyWarning
from sklearn.base import BaseEstimator
from sklear... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
2,
2488,
13838,
220,
1058,
10662,
488,
403,
13875,
198,
2,
2488,
17829,
220,
220,
220,
1058,
256,
80,
488,
403,
31,
... | 3.246753 | 154 |
# based on https://github.com/fabioz/PyDev.Debugger/tree/main/pydevd_plugins/extensions
import os
import sys
from typing import Any, Dict
from _pydevd_bundle.pydevd_extension_api import ( # type: ignore
StrPresentationProvider,
TypeResolveProvider,
)
DEBUG = False
# OC_PYDEVD_RESOLVER env can take:
# ... | [
2,
1912,
319,
3740,
1378,
12567,
13,
785,
14,
36434,
952,
89,
14,
20519,
13603,
13,
27509,
1362,
14,
21048,
14,
12417,
14,
79,
5173,
1990,
67,
62,
37390,
14,
2302,
5736,
198,
11748,
28686,
198,
11748,
25064,
198,
6738,
19720,
1330,
... | 2.683196 | 363 |
import itertools
from dataclasses import dataclass
from io import StringIO
from typing import ClassVar
from pdfminer.converter import TextConverter
from pdfminer.layout import LAParams
from pdfminer.pdfdocument import PDFDocument
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
from pdfminer.pdfpa... | [
11748,
340,
861,
10141,
198,
6738,
4818,
330,
28958,
1330,
4818,
330,
31172,
198,
6738,
33245,
1330,
10903,
9399,
198,
6738,
19720,
1330,
5016,
19852,
198,
198,
6738,
37124,
1084,
263,
13,
1102,
332,
353,
1330,
8255,
3103,
332,
353,
198... | 3.447368 | 114 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# File: conv2d.py
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import tensorflow as tf
from .common import layer_register
from ..utils.argtools import shape2d, shape4d
__all__ = ['Conv2D', 'Deconv2D']
@layer_register()
def Conv2D(x, out_channel, kernel_shape,
padd... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
532,
9,
12,
19617,
25,
41002,
12,
23,
532,
9,
12,
198,
2,
9220,
25,
3063,
17,
67,
13,
9078,
198,
2,
6434,
25,
575,
2821,
259,
18027,
1279,
381,
1383,
22556,
5324,
31,
14816,
... | 2.242081 | 2,557 |
#!/usr/bin/env python3
#importing libraries
import argparse
from ops import Ops, Network
import torch
#from PIL import Image
if __name__ == "__main__":
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
201,
198,
2,
11748,
278,
12782,
201,
198,
201,
198,
11748,
1822,
29572,
201,
198,
6738,
39628,
1330,
26123,
11,
7311,
201,
198,
11748,
28034,
201,
198,
2,
6738,
350,
4146,
1330,
7412,
... | 2.594203 | 69 |
import botocore
from botocore.exceptions import ClientError
import boto3
import logging
import requests
import json
from concurrent.futures import ThreadPoolExecutor, as_completed
# Build an inference model request
# Function to grab model list from FF API
# Function to submit a inference request
# Check if fi... | [
198,
11748,
10214,
420,
382,
198,
6738,
10214,
420,
382,
13,
1069,
11755,
1330,
20985,
12331,
198,
11748,
275,
2069,
18,
198,
11748,
18931,
198,
11748,
7007,
198,
11748,
33918,
198,
6738,
24580,
13,
69,
315,
942,
1330,
14122,
27201,
230... | 3.718447 | 103 |
import click
from pov import Camera
@click.command()
if __name__ == '__main__':
preview() | [
11748,
3904,
198,
6738,
279,
709,
1330,
20432,
198,
198,
31,
12976,
13,
21812,
3419,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
12417,
834,
10354,
198,
220,
220,
220,
12714,
3419
] | 2.878788 | 33 |
from pathlib import Path
from lib_bgp_simulator import BaseGraphSystemTester, BGPSimpleAS, Graph033
from lib_bgp_simulator import enums
from ..unstable import Unstable
from ....as_classes import ROVPPV1SimpleAS
from ....as_classes import ROVPPV2SimpleAS
from ....as_classes import ROVPPV2aLiteSimpleAS
from ....as_clas... | [
6738,
3108,
8019,
1330,
10644,
198,
198,
6738,
9195,
62,
65,
31197,
62,
14323,
8927,
1330,
7308,
37065,
11964,
51,
7834,
11,
34839,
3705,
320,
1154,
1921,
11,
29681,
44427,
198,
6738,
9195,
62,
65,
31197,
62,
14323,
8927,
1330,
551,
5... | 3.107692 | 130 |
import warnings
from pathlib import Path
import torch
import numpy as np
import nibabel as nib
import torchio as tio
from tqdm import tqdm
from .utils import get_device
IMAGE_NAME = 'image'
TO_MNI = 'to_mni'
FROM_MNI = 'from_mni'
| [
11748,
14601,
198,
6738,
3108,
8019,
1330,
10644,
198,
198,
11748,
28034,
198,
11748,
299,
32152,
355,
45941,
198,
11748,
33272,
9608,
355,
33272,
198,
11748,
28034,
952,
355,
256,
952,
198,
6738,
256,
80,
36020,
1330,
256,
80,
36020,
1... | 2.744186 | 86 |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 13 19:19:06 2016
@author: Stella Psomadaki
"""
from ConfigParser import ConfigParser
from shapely.wkt import loads
from shapely.geometry import Polygon, box
import time
import pointcloud.general as general
import pointcloud.structures.QuadTree as QuadTree
impo... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
201,
198,
37811,
201,
198,
41972,
319,
7031,
3158,
1511,
678,
25,
1129,
25,
3312,
1584,
201,
198,
201,
198,
31,
9800,
25,
45856,
33610,
296,
324,
8182,
201,
198,
37811,
201... | 3.12749 | 251 |
from numba import njit
@njit
| [
6738,
997,
7012,
1330,
299,
45051,
628,
198,
31,
77,
45051,
198
] | 2.583333 | 12 |
# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | [
2,
15069,
357,
66,
8,
33448,
532,
1944,
1220,
47986,
32707,
11,
3457,
13,
1439,
6923,
33876,
13,
198,
2,
198,
2,
49962,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
2,
345,
743,
407,
779,
428,... | 2.224846 | 6,013 |
#!/usr/bin/env python
# coding=utf-8
from __future__ import print_function
import sys
import django
if __name__ == '__main__':
main()
| [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
198,
2,
19617,
28,
40477,
12,
23,
198,
6738,
11593,
37443,
834,
1330,
3601,
62,
8818,
198,
11748,
25064,
198,
11748,
42625,
14208,
628,
198,
198,
361,
11593,
3672,
834,
6624,
705,
834,
1241... | 2.764706 | 51 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Remove words from a word list from a dictionary.
Write out a new dictionary.
input format dictionary:
word t r a n s c r i p t i o n
...
"""
import sys
frob_file = sys.argv[1]
word_list_file = sys.argv[2]
word_list = []
for line in open(word_list_file).rea... | [
2,
48443,
14629,
14,
8800,
14,
24330,
21015,
18,
198,
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
37811,
198,
27914,
2456,
422,
257,
1573,
1351,
422,
257,
22155,
13,
198,
16594,
503,
257,
649,
22155,
13,
19... | 2.475472 | 265 |
line_input = list(x for x in input())
num_list = list(int(x) for x in line_input if x.isnumeric())
words = list(x for x in line_input if not x.isnumeric())
take = list(num_list[x] for x in range(len(num_list)) if x % 2 == 0)
skip = list(num_list[y] for y in range(len(num_list)) if y % 2 == 1)
result = []
for i in range... | [
1370,
62,
15414,
796,
1351,
7,
87,
329,
2124,
287,
5128,
28955,
198,
22510,
62,
4868,
796,
1351,
7,
600,
7,
87,
8,
329,
2124,
287,
1627,
62,
15414,
611,
2124,
13,
271,
77,
39223,
28955,
198,
10879,
796,
1351,
7,
87,
329,
2124,
2... | 2.453125 | 256 |
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 18 13:02:28 2018
@author: ivan
"""
import os
import pathlib
from PIL import Image
from PIL.ExifTags import TAGS
import datetime
import time
import numpy as np
import cv2
#
#
#
#
#for file in os.listdir("G:/DCIM/100EOS5D"):
# if file.endswith(".JPG"):
# prin... | [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
37811,
198,
41972,
319,
30030,
8621,
1248,
1511,
25,
2999,
25,
2078,
2864,
198,
198,
31,
9800,
25,
220,
13809,
198,
37811,
198,
198,
11748,
28686,
198,
11748,
3108,
8019... | 2.141862 | 1,149 |
"""
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | [
37811,
198,
15269,
12131,
383,
1881,
37535,
46665,
13,
1439,
2489,
10395,
13,
198,
198,
26656,
15385,
739,
262,
24843,
13789,
11,
10628,
362,
13,
15,
357,
1169,
366,
34156,
15341,
198,
5832,
743,
407,
779,
428,
2393,
2845,
287,
11846,
... | 3.469697 | 264 |
# stdlib imports
import logging
import sys
# third-party imports
import structlog
# local imports
from .exceptions import StretchException
logger = structlog.get_logger()
def configure_logging(level, local_debug=False):
"""Set global logging configuration
"""
processors = [
structlog.stdlib.fil... | [
2,
14367,
8019,
17944,
198,
11748,
18931,
198,
11748,
25064,
198,
198,
2,
2368,
12,
10608,
17944,
198,
11748,
2878,
6404,
198,
198,
2,
1957,
17944,
198,
6738,
764,
1069,
11755,
1330,
44489,
16922,
198,
198,
6404,
1362,
796,
2878,
6404,
... | 2.703088 | 421 |
# Import Libraries
import cv2
import numpy as np
# The gender model architecture
GENDER_MODEL = 'weights/deploy_gender.prototxt'
# The gender model pre-trained weights
GENDER_PROTO = 'weights/gender_net.caffemodel'
# Each Caffe Model impose the shape of the input image also image preprocessing is required ... | [
2,
17267,
46267,
201,
198,
11748,
269,
85,
17,
201,
198,
11748,
299,
32152,
355,
45941,
201,
198,
201,
198,
2,
383,
5279,
2746,
10959,
201,
198,
38,
10619,
1137,
62,
33365,
3698,
796,
705,
43775,
14,
2934,
1420,
62,
8388,
13,
11235,... | 2.16898 | 1,657 |
import pytest
from fixtures.notification_fixture import smtp_connection
from fixtures.uaa_fixture import (
uaa_authenticated,
uaa_deactivate_multiple_users,
uaa_deactivate_user,
uaa_deactivate_multiple_pages_of_users,
uaa_list_users_multiple_pages,
uaa_list_expiring_users,
uaa_unauthorized,... | [
11748,
12972,
9288,
198,
198,
6738,
34609,
13,
1662,
2649,
62,
69,
9602,
1330,
895,
34788,
62,
38659,
198,
6738,
34609,
13,
6413,
64,
62,
69,
9602,
1330,
357,
198,
220,
220,
220,
334,
7252,
62,
41299,
3474,
11,
198,
220,
220,
220,
... | 2.76259 | 139 |
from collections import namedtuple
MenuItem = namedtuple("MenuItem", ["text", "url"])
| [
6738,
17268,
1330,
3706,
83,
29291,
201,
198,
201,
198,
23381,
7449,
796,
3706,
83,
29291,
7203,
23381,
7449,
1600,
14631,
5239,
1600,
366,
6371,
8973,
8,
201,
198
] | 3.103448 | 29 |
import bookworm_main.bookworm_main as bookworm_main
import sys
def main():
"""
Main is a wrapper for bookworm's main interface.
"""
bookworm_main.main()
if __name__ == 'main':
main()
else:
main()
| [
11748,
1492,
25323,
62,
12417,
13,
2070,
25323,
62,
12417,
355,
1492,
25323,
62,
12417,
198,
11748,
25064,
628,
198,
4299,
1388,
33529,
198,
220,
220,
220,
37227,
198,
220,
220,
220,
8774,
318,
257,
29908,
329,
1492,
25323,
338,
1388,
... | 2.647059 | 85 |
#!/usr/bin/python
import numpy as np
from scipy.spatial.distance import pdist, squareform
# three points
points = np.array([[-1, 1], [1, 0], [2, 0]])
# distance between all points
d = squareform(pdist(points, 'euclidean'))
print(d)
| [
2,
48443,
14629,
14,
8800,
14,
29412,
198,
198,
11748,
299,
32152,
355,
45941,
198,
6738,
629,
541,
88,
13,
2777,
34961,
13,
30246,
1330,
279,
17080,
11,
6616,
687,
198,
198,
2,
1115,
2173,
198,
13033,
796,
45941,
13,
18747,
26933,
... | 2.611111 | 90 |
from os import system
from os import chdir
print("\033[1;33m ________________________________________________________________________ ")
print("\033[1;33m | __ __ _ __________ _ | ")
print("\033[1;33m | \ \ / / | | | ________|| | ... | [
6738,
28686,
1330,
1080,
198,
6738,
28686,
1330,
442,
15908,
198,
4798,
7203,
59,
44427,
58,
16,
26,
2091,
76,
220,
220,
220,
27193,
2602,
220,
366,
8,
198,
4798,
7203,
59,
44427,
58,
16,
26,
2091,
76,
220,
930,
220,
220,
220,
115... | 1.551443 | 1,351 |
"""
@author: Gabriele Girelli
@contact: gigi.ga90@gmail.com
"""
import click # type: ignore
from ifpd2.const import CONTEXT_SETTINGS
from ifpd2.database import DataBase
from ifpd2.walker2 import ChromosomeWalker
import logging
from tqdm import tqdm # type: ignore
@click.command(
name="check",
context_setti... | [
37811,
198,
31,
9800,
25,
12300,
5034,
293,
402,
557,
15516,
198,
31,
32057,
25,
12526,
72,
13,
4908,
3829,
31,
14816,
13,
785,
198,
37811,
198,
198,
11748,
3904,
220,
1303,
2099,
25,
8856,
198,
6738,
611,
30094,
17,
13,
9979,
1330,... | 2.818713 | 171 |
from pywps import Service
from pywps.tests import assert_response_success
from .common import client_for
from emu.processes.wps_output_formats import OutputFormats
| [
6738,
12972,
86,
862,
1330,
4809,
198,
6738,
12972,
86,
862,
13,
41989,
1330,
6818,
62,
26209,
62,
13138,
198,
198,
6738,
764,
11321,
1330,
5456,
62,
1640,
198,
6738,
795,
84,
13,
14681,
274,
13,
86,
862,
62,
22915,
62,
687,
1381,
... | 3.458333 | 48 |
import mm_scripting_util as mm
| [
11748,
8085,
62,
12048,
278,
62,
22602,
355,
8085,
201
] | 3.1 | 10 |
import json
from opentrons import protocol_api, types
CALIBRATION_CROSS_COORDS = {
'1': {
'x': 12.13,
'y': 9.0,
'z': 0.0
},
'3': {
'x': 380.87,
'y': 9.0,
'z': 0.0
},
'7': {
'x': 12.13,
'y': 258.0,
'z': 0.0
}
}
CALIBRATION_C... | [
11748,
33918,
198,
6738,
1034,
298,
12212,
1330,
8435,
62,
15042,
11,
3858,
198,
198,
34,
1847,
9865,
49,
6234,
62,
9419,
18420,
62,
8220,
1581,
5258,
796,
1391,
198,
220,
220,
220,
705,
16,
10354,
1391,
198,
220,
220,
220,
220,
220... | 2.332391 | 5,304 |
from io import BytesIO
from urllib.parse import urlparse
from zeit.connector.connector import CannonicalId
from zeit.connector.dav.interfaces import DAVNotFoundError
import ast
import email.utils
import gocept.cache.property
import logging
import lxml.etree
import os
import os.path
import six
import six.moves.urllib.pa... | [
6738,
33245,
1330,
2750,
4879,
9399,
198,
6738,
2956,
297,
571,
13,
29572,
1330,
19016,
29572,
198,
6738,
41271,
270,
13,
8443,
273,
13,
8443,
273,
1330,
20585,
605,
7390,
198,
6738,
41271,
270,
13,
8443,
273,
13,
67,
615,
13,
3849,
... | 2.372148 | 1,271 |
from torchvision.transforms import InterpolationMode # usort: skip
from ._meta import (
convert_bounding_box_format,
convert_image_color_space_tensor,
convert_image_color_space_pil,
) # usort: skip
from ._augment import (
erase_image_tensor,
mixup_image_tensor,
mixup_one_hot_label,
cutmix... | [
6738,
28034,
10178,
13,
7645,
23914,
1330,
4225,
16104,
341,
19076,
220,
1303,
514,
419,
25,
14267,
198,
6738,
47540,
28961,
1330,
357,
198,
220,
220,
220,
10385,
62,
7784,
278,
62,
3524,
62,
18982,
11,
198,
220,
220,
220,
10385,
62,
... | 2.295082 | 854 |
# -*- coding: utf-8 -*-
import pytest
from filters.filter import *
@pytest.fixture(scope = 'session')
@pytest.fixture(scope = 'session')
@pytest.fixture(scope = 'session')
| [
2,
532,
9,
12,
19617,
25,
3384,
69,
12,
23,
532,
9,
12,
198,
198,
11748,
12972,
9288,
198,
6738,
16628,
13,
24455,
1330,
1635,
198,
198,
31,
9078,
9288,
13,
69,
9602,
7,
29982,
796,
705,
29891,
11537,
198,
198,
31,
9078,
9288,
1... | 2.57971 | 69 |
# markdown.py
""" markdown formatting functionality """
# pylint:disable=consider-using-f-string
import html
import logging
import re
import typing
import urllib.parse
import flask
import misaka
import pygments
import pygments.formatters
import pygments.lexers
import slugify
from . import html_entry, image, links, u... | [
2,
1317,
2902,
13,
9078,
198,
37811,
1317,
2902,
33313,
11244,
37227,
198,
2,
279,
2645,
600,
25,
40223,
28,
44353,
12,
3500,
12,
69,
12,
8841,
198,
198,
11748,
27711,
198,
11748,
18931,
198,
11748,
302,
198,
11748,
19720,
198,
11748,... | 2.177001 | 10,209 |