max_stars_repo_path string | max_stars_repo_name string | max_stars_count int64 | id string | content string | add_param_types int64 | add_return_types int64 | add_class_field_types int64 | add_instance_field_types int64 | add_total int64 | add_error int64 |
|---|---|---|---|---|---|---|---|---|---|---|
cfgov/paying_for_college/models/__init__.py | Colin-Seifer/consumerfinance.gov | 156 | 1774301 | # flake8: noqa F401
from paying_for_college.models.disclosures import (
CONTROL_MAP,
DEFAULT_EXCLUSIONS,
FAKE_SCHOOL_PKS,
HIGHEST_DEGREES,
LEVELS,
NOTIFICATION_TEMPLATE,
OFFICE_IDS,
PROGRAM_LEVELS,
REGION_MAP,
REGION_NAMES,
Alias,
ConstantCap,
ConstantRate,
Conta... | 0 | 0 | 0 | 0 | 0 | 0 |
opendatatools/spot/spot_interface.py | solider245/OpenData | 1,179 | 1774336 | # encoding: utf-8
from .spot_agent import SpotAgent
spot_agent = SpotAgent()
def get_commodity_spot_indicator() -> object:
return spot_agent.get_commodity_spot_indicator()
def get_commodity_spot_indicator_data(indicator_id) -> object:
return spot_agent.get_commodity_spot_indicator_data(indicator_id)
| 0 | 2 | 0 | 0 | 2 | 0 |
app/mock/views.py | JoneNaZi/Interfaceplatform | 729 | 1774349 | <filename>app/mock/views.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# @Author : lileilei
# @File : views.py
# @Time : 2017/12/7 12:11
from flask import Blueprint
from flask import redirect, request, \
render_template, url_for, flash
from app.models import *
from flask.views import MethodView
from flask_log... | 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/shader_atomic_counters.py | ShujaKhalid/deep-rl | 210 | 1774366 | <filename>deep-rl/lib/python2.7/site-packages/OpenGL/raw/GL/ARB/shader_atomic_counters.py
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
src/twisted/trial/_dist/test/test_disttrial.py | mathieui/twisted | 9,953 | 1774372 | <reponame>mathieui/twisted
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.trial._dist.disttrial}.
"""
import os
import sys
from twisted.internet.protocol import Protocol, ProcessProtocol
from twisted.internet.defer import fail, gatherResults, maybeDeferred, succeed
fr... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_time.py | growlix/composer | 945 | 1774380 | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
import datetime
import pytest
from composer.core.time import Time, Timestamp, TimeUnit
@pytest.mark.parametrize("time_string,expected_value,expected_unit", [
["1ep", 1, TimeUnit.EPOCH],
["2ba", 2, TimeUnit.BATCH],
["3e10sp... | 7 | 0 | 0 | 0 | 7 | 0 |
Anaconda-files/Program_05b.py | arvidl/dynamical-systems-with-applications-using-python | 106 | 1774479 | <gh_stars>100-1000
# Program 05b: Example 7, approximate solutions.
# See Figure 5.9.
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import numpy as np
eps = 0.3
def ODE(x, t):
return eps*x**2-x
x0 = 2
t = np.linspace(0, 10, 1000)
sol = odeint(ODE, x0, t)
x = np.array(sol).flatten()
plt.pl... | 0 | 0 | 0 | 0 | 0 | 0 |
sikuli-ide/sample-scripts/spatial-ops2.sikuli/spatial-ops2.py | mgrundy/sikuli | 1,292 | 1774547 | switchApp("System Preferences.app")
m = find("1257868050242.png").top().right().find("1257868062020.png")
if m: click(m)
| 0 | 0 | 0 | 0 | 0 | 0 |
lib/tests/py_test/test_protofile.py | nccgroup/blackboxprotobuf | 261 | 1774549 | <filename>lib/tests/py_test/test_protofile.py
import os
import sys
import six
import math
import glob
import shutil
import base64
import struct
import pytest
import logging
import tempfile
import subprocess
import hypothesis
from hypothesis import given, assume, note, settings, HealthCheck
import hypothesis.strategies ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/django/settings.py | YPCrumble/authlib | 3,172 | 1774591 | SECRET_KEY = 'django-secret'
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "example.sqlite",
}
}
MIDDLEWARE = [
'django.contrib.sessions.middleware.SessionMiddleware'
]
SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
CACHES = {
'default': {
... | 0 | 0 | 0 | 0 | 0 | 0 |
lfs/checkout/forms.py | michael-hahn/django-lfs | 345 | 1774600 | # django imports
from django import forms
from django.utils.translation import ugettext_lazy as _
from lfs.addresses.settings import CHECKOUT_NOT_REQUIRED_ADDRESS
class OnePageCheckoutForm(forms.Form):
requested_delivery_date = forms.DateField(label=_(u"Requested Delivery Date"), required=False)
payment_meth... | 0 | 1 | 0 | 0 | 1 | 0 |
tools/gsuite-exporter-cloud-function/main.py | ruchirjain86/professional-services | 2,116 | 1774647 | # Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 0 | 0 | 0 | 0 | 0 | 0 |
inferno/extensions/initializers/base.py | 0h-n0/inferno | 204 | 1774672 | from __future__ import annotations
import torch.nn.init as init
__all__ = ['Initializer',
'Initialization',
'WeightInitFunction',
'BiasInitFunction',
'TensorInitFunction']
class Initializer(object):
"""
Base class for all initializers.
"""
# TODO Support ... | 2 | 10 | 1 | 0 | 13 | 0 |
codigo_das_aulas/aula_10/aula_10_06.py | VeirichR/curso-python-selenium | 234 | 1774679 | <filename>codigo_das_aulas/aula_10/aula_10_06.py
from selenium.webdriver import Firefox
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.expected_conditions import (
url_changes
)
url = 'https://selenium.dunossauro.live/aula_10_c.html'
browser = Firefox()
browser.get(url)
w... | 0 | 0 | 0 | 0 | 0 | 0 |
model-optimizer/mo/utils/ir_reader/extenders/ExtractImagePatches_extender.py | monroid/openvino | 2,406 | 1774684 | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from mo.front.common.partial_infer.utils import int64_array
from mo.utils.graph import Node
from mo.utils.ir_reader.extender import Extender
class ExtractImagePatches(Extender):
op: str = 'ExtractImagePatches'
@staticmethod
... | 1 | 0 | 1 | 0 | 2 | 0 |
m3tl/read_write_tfrecord.py | vishalbelsare/bert-multitask-learning | 456 | 1774693 | # AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/06_read_write_tfrecord.ipynb (unless otherwise specified).
from __future__ import annotations
__all__ = ['serialize_fn', 'make_tfrecord_local', 'make_tfrecord_pyspark', 'make_tfrecord', 'chain_processed_data',
'write_tfrecord', 'make_feature_desc', 'res... | 26 | 20 | 1 | 0 | 47 | 0 |
dash-tabs-with-dropdown.py | oriolmirosa/dash-recipes | 932 | 1774722 | <reponame>oriolmirosa/dash-recipes<filename>dash-tabs-with-dropdown.py
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
app = dash.Dash()
app.layout = html.Div([
dcc.Tabs(
tabs=[
{'label': 'Market Value', 'value': 1... | 0 | 0 | 0 | 0 | 0 | 0 |
python/icp.py | nowtechnologies/ridi_imu | 140 | 1774726 | <reponame>nowtechnologies/ridi_imu
import numpy as np
def fit_transformation(source, target):
"""
This function computes the best rigid transformation between two point sets. It assumes that "source" and
"target" are with the same length and "source[i]" corresponds to "target[i]".
:param source: ... | 0 | 0 | 0 | 0 | 0 | 0 |
dataviz/ukelections.py | Udzu/pudzu | 119 | 1774735 | import matplotlib.pyplot as plt
from matplotlib.ticker import FuncFormatter
import numpy as np
import pandas as pd
COLORS = {
"Conservatives": "#393b79",
"Labour": "#d62728",
"Liberal Democrats": "#e7ba52", "Alliance": "#e7ba52", "Liberal": "#e7ba52",
"Liberal Democrats/\nAlliance/Liberals": "#e7ba52",... | 0 | 0 | 0 | 0 | 0 | 0 |
great_expectations/datasource/data_connector/asset/__init__.py | vanderGoes/great_expectations | 6,451 | 1774736 | <reponame>vanderGoes/great_expectations<filename>great_expectations/datasource/data_connector/asset/__init__.py<gh_stars>1000+
from .asset import Asset
| 0 | 0 | 0 | 0 | 0 | 0 |
kivymd/uix/transition/transition.py | vhn0912/KivyMD | 668 | 1774765 | <reponame>vhn0912/KivyMD<gh_stars>100-1000
"""
Components/Transition
=====================
.. rubric::
A set of classes for implementing transitions between application screens.
.. versionadded:: 1.0.0
Changing transitions
--------------------
You have multiple transitions available by default, such as:
- :cla... | 0 | 0 | 0 | 0 | 0 | 0 |
lane_segmentation/evaluation/evalPixelLevelSemanticLabeling.py | libai2019/dataset-api | 385 | 1774779 | #!/usr/bin/python
#
# The evaluation script for pixel-level semantic labeling.
# We use this script to evaluate your approach on the test set.
# You can use the script for your own evaluations.
#
# Please check the description before the "main" method below and set the
# required arguments as needed, such that this scr... | 0 | 0 | 0 | 0 | 0 | 0 |
src/olympia/blocklist/migrations/0024_delete_legacyimport.py | covariant/addons-server | 843 | 1774796 | # Generated by Django 3.2.6 on 2021-09-03 08:50
from django.db import migrations
def rm_import_waffle_switch(apps, schema_editor):
Switch = apps.get_model('waffle', 'Switch')
# drop the waffle switch blocklist_auto_import to avoid confusion
Switch.objects.filter(name='blocklist_auto_import').delete()
cl... | 0 | 0 | 2 | 0 | 2 | 0 |
examples/word_count/word_count/line_spout.py | earthmine/pyleus | 166 | 1774804 | import logging
import random
from pyleus.storm import Spout
log = logging.getLogger('counter')
LINES = """
Lorem ipsum dolor sit amet, consectetur
adipiscing elit. Curabitur pharetra ante eget
nunc blandit vestibulum. Curabitur tempus mi
a risus lacinia egestas. Nulla faucibus
elit vitae dignissim euismod. Fusce ac
... | 0 | 0 | 1 | 0 | 1 | 0 |
scripts/models/NeuralCDE/controldiffeq/__init__.py | lysuk96/rl_representations | 438 | 1774813 | <filename>scripts/models/NeuralCDE/controldiffeq/__init__.py
from .cdeint_module import cdeint, VectorField
from .interpolate import natural_cubic_spline_coeffs, NaturalCubicSpline
| 0 | 0 | 0 | 0 | 0 | 0 |
ImageNet/evaluate.py | mhilmiasyrofi/AT_HE | 107 | 1774833 | # This module is adapted from https://github.com/pytorch/examples/blob/master/imagenet/main.py
import init_paths
import argparse
import os
import time
import sys
import torch
import torch.nn as nn
import torch.backends.cudnn as cudnn
import torch.optim
import torchvision.transforms as transforms
import torchvision.data... | 0 | 2 | 0 | 0 | 2 | 0 |
libs/sqlobject/tests/test_SingleJoin.py | scambra/HTPC-Manager | 422 | 1774848 | from sqlobject import *
from sqlobject.tests.dbtest import *
class PersonWithAlbum(SQLObject):
name = StringCol()
# albumNone returns the album or none
albumNone = SingleJoin('PhotoAlbum', joinColumn='test_person_id')
# albumInstance returns the album or an default album instance
albumInstance = Si... | 0 | 0 | 0 | 0 | 0 | 0 |
evaluation/eval_lfw.py | dwhite54/Probabilistic-Face-Embeddings | 312 | 1774866 | """Test PFE on LFW.
"""
# MIT License
#
# Copyright (c) 2019 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, ... | 0 | 0 | 0 | 0 | 0 | 0 |
stix_shifter_modules/cbcloud/tests/stix_translation/test_cbcloud_json_to_stix.py | pyromaneact/stix-shifter | 129 | 1774882 | import json
import unittest
from stix_shifter_utils.stix_translation.src.json_to_stix import json_to_stix_translator
from stix_shifter_modules.cbcloud.entry_point import EntryPoint
from stix_shifter_utils.stix_translation.src.utils.transformer_utils import get_module_transformers
MODULE = "cbcloud"
entry_point = Entry... | 0 | 2 | 0 | 0 | 2 | 0 |
pulsar/apps/http/client.py | PyCN/pulsar | 1,410 | 1774896 | <gh_stars>1000+
import os
import platform
import logging
import asyncio
from functools import partial
from collections import namedtuple
from io import StringIO, BytesIO
from urllib.parse import urlparse, parse_qsl, urlencode, urlunparse
from http.client import responses
try:
import ssl
BaseSSLError = ssl.SSLEr... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_12_dataloader_classes.py | bfclarke/kipoi | 213 | 1774916 | <reponame>bfclarke/kipoi
"""Test the different dataloader wrappers
"""
from __future__ import print_function, division
import numpy as np
from pytest import fixture
from kipoi.data import (PreloadedDataset, Dataset, BatchDataset,
SampleIterator, SampleGenerator,
BatchIter... | 0 | 0 | 0 | 0 | 0 | 0 |
models/braf_model/run_model.py | pupster90/indra | 136 | 1774930 | <reponame>pupster90/indra<filename>models/braf_model/run_model.py
from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str
import os
import pickle
import matplotlib
import numpy as np
# To suppress plots from popping up
import matplotlib.pyplot as plt
from pysb.integrate i... | 0 | 0 | 0 | 0 | 0 | 0 |
satori-rules/plugin/infra/30_normalized_load.py | cnof/satori | 249 | 1774943 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# -- stdlib --
import json
import multiprocessing
import socket
import time
# -- third party --
# -- own --
# -- code --
nproc = multiprocessing.cpu_count()
_1min, _5min, _15min = map(lambda v: float(v) / nproc, open('/proc/loadavg').read().split()[:3])
ts = int(time.time()... | 0 | 0 | 0 | 0 | 0 | 0 |
mindsdb/api/http/gunicorn_wrapper.py | yarenty/mindsdb | 261 | 1774946 | <reponame>yarenty/mindsdb
import gunicorn.app.base
class StandaloneApplication(gunicorn.app.base.BaseApplication):
def __init__(self, app, options=None):
self.options = options or {}
self.application = app
super().__init__()
def load_config(self):
config = {key: value for key,... | 0 | 0 | 0 | 0 | 0 | 0 |
art/estimators/regression/__init__.py | monshri/adversarial-robustness-toolbox | 1,350 | 1774957 | """
This module implements all regressors in ART.
"""
from art.estimators.regression.regressor import RegressorMixin
from art.estimators.regression.scikitlearn import ScikitlearnRegressor
| 0 | 0 | 0 | 0 | 0 | 0 |
aws_lambda_powertools/utilities/typing/lambda_client_context.py | Sordie/aws-lambda-powertools-python | 1,208 | 1775013 | <reponame>Sordie/aws-lambda-powertools-python
# -*- coding: utf-8 -*-
from typing import Any, Dict
from aws_lambda_powertools.utilities.typing.lambda_client_context_mobile_client import LambdaClientContextMobileClient
class LambdaClientContext(object):
_client: LambdaClientContextMobileClient
_custom: Dict[s... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/kale/config/validators.py | brness/kale | 502 | 1775044 | # Copyright 2019-2020 The Kale Authors
#
# 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 i... | 10 | 4 | 21 | 0 | 35 | 0 |
src/elastic/azext_elastic/generated/custom.py | haroonf/azure-cli-extensions | 207 | 1775063 | # --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incor... | 23 | 15 | 0 | 0 | 38 | 0 |
tests/utils/test_lazy_loader.py | 0scarB/piccolo | 750 | 1775085 | from unittest import TestCase, mock
from piccolo.utils.lazy_loader import LazyLoader
from tests.base import postgres_only, sqlite_only
class TestLazyLoader(TestCase):
def test_lazy_loading_database_driver(self):
_ = LazyLoader("asyncpg", globals(), "asyncpg")
@postgres_only
def test_lazy_loader_... | 0 | 0 | 0 | 0 | 0 | 0 |
code/Classifier/CLPL.py | INK-USC/DS-RelationExtraction | 156 | 1775102 | <gh_stars>100-1000
__author__ = 'wenqihe'
import sys
import random
class CLPL:
def __init__(self, feature_size, label_size, type_hierarchy, lambda_reg=0.1, max_iter=500, threshold=0.0, batch_size=1000, sample_size=10):
self._feature_size = feature_size
self._label_size = label_size
self... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow_similarity/algebra.py | phillips96/similarity | 706 | 1775103 | <reponame>phillips96/similarity
# Copyright 2021 The TensorFlow Authors
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
python/app/plugins/http/Struts2/S2_013.py | taomujian/linbing | 351 | 1775113 | #!/usr/bin/env python3
from app.lib.utils.request import request
from app.lib.utils.encode import urlencode, base64encode
from app.lib.utils.common import get_capta, filter_str, get_useragent
class S2_013_BaseVerify:
def __init__(self, url):
self.info: dict[str,str] = {
'name': 'Struts2 S2-013... | 0 | 1 | 0 | 3 | 4 | 0 |
roboticstoolbox/tools/xacro/tests/test_xacro.py | LabRobPL/robotics-toolbox-python | 749 | 1775145 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Open Source Robotics Foundation, Inc.
# Copyright (c) 2013, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 2 | 7 | 0 | 3 | 12 | 0 |
functest/lmenv.py | mitsuba-rei/lightmetrica-v3 | 101 | 1775184 | import sys
import json
import numpy as np
import imageio
from argparse import Namespace
def load(config_path) -> object:
"""Load configuration file of Lightmetrica environment"""
# Open config file
with open(config_path) as f:
config = json.load(f)
# Add root directory and binary directory to... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_internal_db.py | eyeseast/datasette | 5,978 | 1775197 | from .fixtures import app_client
import pytest
def test_internal_only_available_to_root(app_client):
cookie = app_client.actor_cookie({"id": "root"})
assert app_client.get("/_internal").status == 403
assert app_client.get("/_internal", cookies={"ds_actor": cookie}).status == 200
def test_internal_databa... | 0 | 0 | 0 | 0 | 0 | 0 |
libs/numpy/random/_examples/numba/extending_distributions.py | rocketbot-cl/recognition | 353 | 1775222 | <reponame>rocketbot-cl/recognition
r"""
Building the required library in this example requires a source distribution
of NumPy or clone of the NumPy git repository since distributions.c is not
included in binary distributions.
On *nix, execute in numpy/random/src/distributions
export ${PYTHON_VERSION}=3.8 # Pyt... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/apps/users/views/web.py | andyasne/commcare-hq | 471 | 1775249 | <reponame>andyasne/commcare-hq
from datetime import datetime
from django.conf import settings
from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth.models import User
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import Va... | 0 | 0 | 0 | 0 | 0 | 0 |
delegate/python/test/utils.py | sahilbandar/armnn | 856 | 1775250 | # Copyright © 2020 Arm Ltd and Contributors. All rights reserved.
# SPDX-License-Identifier: MIT
from __future__ import annotations
import tflite_runtime.interpreter as tflite
import numpy as np
import os
def run_mock_model(delegate, test_data_folder):
model_path = os.path.join(test_data_folder, 'mock_model.tfli... | 1 | 1 | 0 | 0 | 2 | 0 |
test/test_geml.py | moghadas76/test_bigcity | 221 | 1775288 | import numpy as np
import torch
from libcity.model.traffic_od_prediction.GEML import GEML
config = {
"input_window": 12,
"output_window": 12,
"embed_dim": 10,
"batch_size": 2,
}
data_feature = {
"num_nodes": 4,
"adj_mx": np.random.rand(4, 4)
}
batch = {
'X': torch.randn((2, 12, 4, 4, 1))... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/classification/models/alexnet.py | jjxu217/pytorch-sso | 121 | 1775322 | '''AlexNet for CIFAR10. FC layers are removed. Paddings are adjusted.
Without BN, the start learning rate should be 0.01
(c) <NAME>
'''
import torch.nn as nn
import torch.nn.functional as F
from torchsso.utils.accumulator import TensorAccumulator
__all__ = ['alexnet', 'alexnet_mcdropout']
class AlexNet(nn.Module):... | 4 | 5 | 1 | 0 | 10 | 0 |
tools/accuracy_checker/tests/test_dlsdk_launcher.py | TolyaTalamanov/open_model_zoo | 2,201 | 1775329 | <reponame>TolyaTalamanov/open_model_zoo
"""
Copyright (c) 2018-2022 Intel Corporation
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 requir... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/lost/utils/testils.py | JonasGoebel/lost | 490 | 1775333 | '''Helper function for testing'''
from lost.db import model, dtype
from lost.logic.label import LabelTree
import datetime
import pandas as pd
from lost.logic.pipeline.instance import PipeInstance
def get_user(dbm) -> object:
email = '<EMAIL>'
user = None
for u in dbm.get_users():
if u.email == ema... | 0 | 3 | 0 | 0 | 3 | 0 |
extends.py | SagaFav/etlpy | 448 | 1775358 | <filename>extends.py
# encoding: UTF-8
import re;
spacere = re.compile("[ ]{2,}");
spacern = re.compile("(^\r\n?)|(\r\n?$)")
def getkeys(generator):
count=0;
s=set();
for r in generator:
s=s|r.keys();
count+=1;
if count>=20:
return list(s);
return list(s)
def Repl... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_smart.py | abraha2d/PyVirtualDisplay | 409 | 1775383 | import sys
from pathlib import Path
import pytest
from easyprocess import EasyProcess
from pyvirtualdisplay import Display
from pyvirtualdisplay.smartdisplay import DisplayTimeoutError, SmartDisplay
python = sys.executable
def test_disp():
with Display():
d = SmartDisplay(visible=True).start().stop()
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/python/unittest/test_target_codegen_hexagon.py | shengxinhu/tvm | 4,640 | 1775438 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/check_framework/urls/bad_class_based_error_handlers.py | jpmallarino/django | 61,676 | 1775479 | urlpatterns = []
class HandlerView:
@classmethod
def as_view(cls) -> object:
def view():
pass
return view
handler400 = HandlerView.as_view()
handler403 = HandlerView.as_view()
handler404 = HandlerView.as_view()
handler500 = HandlerView.as_view()
| 0 | 1 | 0 | 0 | 1 | 0 |
agentnet/experiments/pbc_simulator/__init__.py | mraihan19/AgentNet | 337 | 1775496 |
#TODO(jheuristic) write __doc__
__doc__="""
This is a sketch of PBCSEQ-based automated treatment experiment
"""
import os
import sys
experiment_path = '/'.join(__file__.split('/')[:-1])
dataset_path = os.path.join(experiment_path,"pbcseq.csv")
import pandas as pd
import numpy as np
import theano
import theano.tenso... | 0 | 0 | 0 | 0 | 0 | 0 |
blaze/partition.py | quantopian-enterprise/blaze | 2,106 | 1775504 | <reponame>quantopian-enterprise/blaze
""" Abstraction around partitionable data
Some data can be partitioned into disjoint pieces.
Examples include lists, tuples, and arrays of various flavors.
This module provides functions to abstract away the handling of such
partitions. It proposes three operations, each of thes... | 0 | 0 | 0 | 0 | 0 | 0 |
src/gausskernel/dbmind/tools/ai_manager/definitions/errors.py | Yanci0/openGauss-server | 360 | 1775534 | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
#############################################################################
# Copyright (c): 2012-2021, Huawei Tech. Co., Ltd.
# FileName : errors.py
# Version : V1.0.0
# Date : 2021-03-01
# Description : errors.py
###############################... | 0 | 0 | 7 | 0 | 7 | 0 |
pyxb/bundles/reqif/_xh11d.py | eLBati/pyxb | 123 | 1775535 | # -*- coding: utf-8 -*-
from pyxb.bundles.reqif.raw._xh11d import *
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/functions/test_if.py | hodgesrm/clickhouse-sqlalchemy | 251 | 1775548 | <filename>tests/functions/test_if.py<gh_stars>100-1000
from sqlalchemy import literal, func, text
from tests.testcase import BaseTestCase
class IfTestCase(BaseTestCase):
def test_if(self):
expression = func.if_(
literal(1) > literal(2),
text('a'),
text('b'),
)
... | 0 | 0 | 0 | 0 | 0 | 0 |
dataviz/flagsaverage4.py | Udzu/pudzu | 119 | 1775556 | <reponame>Udzu/pudzu
from pudzu.charts import *
from pudzu.sandbox.bamboo import *
import scipy.stats
df = pd.read_csv("../dataviz/datasets/countries.csv").filter_rows("organisations >> un").split_columns('country', "|").explode('country').set_index('country').drop_duplicates(subset='flag', keep='first')
wf = pd.read... | 0 | 0 | 0 | 0 | 0 | 0 |
2020.06.15-netgear/tools/find_mips_gadget.py | jeffball55/NotQuite0DayFriday | 756 | 1775562 | <reponame>jeffball55/NotQuite0DayFriday
# This IDAPython script defines the functions find_system_gadget, which locates
# a call to system with an argument on the stack in a MIPS executable.
import sys
import os
import idaapi
import idc
MAX_PREVIOUS_SEARCH = 10
def call_xrefs(function_name):
function_address = Loc... | 0 | 0 | 0 | 0 | 0 | 0 |
openstackclient/tests/unit/integ/base.py | cloudification-io/python-openstackclient | 262 | 1775569 | <filename>openstackclient/tests/unit/integ/base.py<gh_stars>100-1000
# 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 req... | 0 | 0 | 0 | 0 | 0 | 0 |
pyclustering/utils/tests/unit/ut_dimension.py | JosephChataignon/pyclustering | 1,013 | 1775575 | """!
Unit-tests for dimension analyser.
@authors <NAME> (<EMAIL>)
@date 2014-2020
@copyright BSD-3-Clause
"""
import unittest;
# Generate images without having a window appear.
import matplotlib;
matplotlib.use('Agg');
from pyclustering.utils.dimension import dimension_info;
class Dimension... | 0 | 0 | 0 | 0 | 0 | 0 |
imagetagger/imagetagger/annotations/migrations/0024_auto_20180429_0005.py | jbargu/imagetagger | 212 | 1775596 | <filename>imagetagger/imagetagger/annotations/migrations/0024_auto_20180429_0005.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-04-28 22:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
de... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/vision/convmixer.py | anish9/keras-io | 1,542 | 1775598 | """
Title: Image classification with ConvMixer
Author: [<NAME>](https://twitter.com/RisingSayak)
Date created: 2021/10/12
Last modified: 2021/10/12
Description: An all-convolutional network applied to patches of images.
"""
"""
## Introduction
Vision Transformers (ViT; [Dosovitskiy et al.](https://arxiv.org/abs/1612.0... | 12 | 6 | 0 | 0 | 18 | 0 |
tcd/formats/srt.py | bspammer/Twitch-Chat-Downloader | 570 | 1775599 | <gh_stars>100-1000
import datetime
from typing import Tuple, Generator
from twitch.helix import Video
from twitch.v5 import Comment, Comments
from tcd.formats.format import Format
from tcd.pipe import Pipe
from tcd.safedict import SafeDict
class SRT(Format):
def __init__(self, video: Video):
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
skfda/misc/operators/_srvf.py | jiduque/scikit-fda | 147 | 1775615 | from __future__ import annotations
from typing import Optional
import numpy as np
import scipy.integrate
from sklearn.base import BaseEstimator, TransformerMixin
from ..._utils import check_is_univariate
from ...representation import FDataGrid
from ...representation._typing import ArrayLike
from ._operators import O... | 9 | 5 | 0 | 0 | 14 | 0 |
platform/coredb/coredb/migrations/0010_auto_20210429_1539.py | admariner/polyaxon | 3,200 | 1775675 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 0 | 0 | 2 | 0 | 2 | 0 |
test/run/t361.py | timmartin/skulpt | 2,671 | 1775677 | <reponame>timmartin/skulpt<gh_stars>1000+
print "".isdigit()
print "abc".isdigit()
print " 93".isdigit()
print "13434".isdigit()
print "038".isdigit()
print "0a9c3".isdigit()
| 0 | 0 | 0 | 0 | 0 | 0 |
extraPackages/matplotlib-3.0.3/examples/userdemo/custom_boxstyle01.py | dolboBobo/python3_ios | 130 | 1775686 | """
=================
Custom Boxstyle01
=================
"""
from matplotlib.path import Path
def custom_box_style(x0, y0, width, height, mutation_size, mutation_aspect: int=1) -> object:
"""
Given the location and size of the box, return the path of
the box around it.
- *x0*, *y0*, *width*, *heig... | 1 | 1 | 0 | 0 | 2 | 0 |
scripts/time_to_first_byte.py | nishp77/lbry-sdk | 4,996 | 1775697 | <filename>scripts/time_to_first_byte.py
import os
import sys
import json
import argparse
import asyncio
import time
import aiohttp
from aiohttp import ClientConnectorError
from lbry import __version__
from lbry.blob.blob_file import MAX_BLOB_SIZE
from lbry.conf import Config
from lbry.extras.daemon.client import daemo... | 0 | 0 | 0 | 0 | 0 | 0 |
src/speech_utils/mu_law.py | roberthoenig/VQ-VAE-Speech | 241 | 1775744 | <gh_stars>100-1000
#####################################################################################
# MIT License #
# #
# Copyright (C) 2019 <NAME> ... | 0 | 0 | 0 | 0 | 0 | 0 |
colour/examples/models/examples_transfer_functions.py | rift-labs-developer/colour | 1,380 | 1775747 | <reponame>rift-labs-developer/colour
# -*- coding: utf-8 -*-
"""
Showcases colour component transfer functions (CCTF) relates computations.
"""
import colour
from colour.utilities import message_box
message_box('Colour Component Transfer Functions (CCTF) Computations')
C = 18 / 100
message_box(('Encoding to video c... | 0 | 0 | 0 | 0 | 0 | 0 |
homeassistant/components/senz/config_flow.py | jlmaners/core | 30,023 | 1775770 | <reponame>jlmaners/core<gh_stars>1000+
"""Config flow for nVent RAYCHEM SENZ."""
import logging
from homeassistant.helpers import config_entry_oauth2_flow
from .const import DOMAIN
class OAuth2FlowHandler(
config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN
):
"""Config flow to handle SENZ OAu... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmark/torch/coma/train.py | lp2333/PARL | 3,172 | 1775801 | <reponame>lp2333/PARL
# Copyright (c) 2020 PaddlePaddle 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
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/oxfordQIS.py | CQCL/pytket | 249 | 1775811 | ## EXAMPLE FILE FOR THE OXFORD QIS WORKSHOP FROM 22 FEB 2020
## THIS IS WRITTEN TO WORK WITH PYTKET v0.4.1 AND WILL NOT BE UPDATED IN FUTURE
from pytket.circuit import Circuit, PauliExpBox, Pauli
from pytket.predicates import CompilationUnit
from pytket.passes import DecomposeBoxes, PauliSimp, SequencePass
from pytket... | 0 | 7 | 0 | 0 | 7 | 0 |
pmca/util/http.py | magraopb/Sony-PMCA-RE | 1,313 | 1775905 | from __future__ import annotations
"""Some methods to make HTTP requests"""
from collections import namedtuple
from urllib.parse import *
from urllib.request import *
HttpResponse = namedtuple('HttpResponse', 'url, data, raw_data, headers')
def get(url, data: dict[object,object]={}, headers: dict[object,object]={}, ... | 11 | 3 | 0 | 0 | 14 | 0 |
config/tsv2json.py | seominjoon/qrn | 102 | 1775921 | <reponame>seominjoon/qrn
import argparse
import csv
from collections import OrderedDict
from my.utils import json_pretty_dump
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("tsv_path")
parser.add_argument("json_path")
return parser.parse_args()
def tsv2json(tsv_path, json_pa... | 0 | 0 | 0 | 0 | 0 | 0 |
switch_3_pos.py | czzz0813/raspberrypi_cookbook_ed2 | 116 | 1775946 | <reponame>czzz0813/raspberrypi_cookbook_ed2<filename>switch_3_pos.py
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
top_input = 18
bottom_input = 23
GPIO.setup(top_input, GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.setup(bottom_input, GPIO.IN, pull_up_down=GPIO.PUD_UP)
switch_position = "unknown"
while Tru... | 0 | 0 | 0 | 0 | 0 | 0 |
src/tests/v040/test_meta_lowercase.py | isaacna/FireO | 231 | 1775958 | from fireo.fields import TextField, MapField, ListField, Field
from fireo.models import Model
class LowercaseUser(Model):
txt_name = TextField()
dict_name = MapField()
lst_name = ListField()
base_name = Field()
class Meta:
to_lowercase: bool = True
def test_simple_lowercase():
l = L... | 0 | 0 | 1 | 0 | 1 | 0 |
modules/dbnd-airflow-monitor/test_dbnd_airflow_monitor/airflow_utils.py | busunkim96/dbnd | 224 | 1775960 | <reponame>busunkim96/dbnd<filename>modules/dbnd-airflow-monitor/test_dbnd_airflow_monitor/airflow_utils.py
import logging
import os
from functools import wraps
import sh
def airflow_init_db(db_path):
airflow = sh.Command("airflow")
try:
airflow(
"initdb",
_env={
... | 0 | 0 | 0 | 0 | 0 | 0 |
pycnc/wxPictureWindow.py | BbiKkuMi/heekscnc | 107 | 1775965 | <filename>pycnc/wxPictureWindow.py
import wx
class PictureWindow(wx.Window):
def __init__(self, parent, size = None, bitmap = None):# use either size or bitmap
if bitmap != None:
wx.Window.__init__(self, parent, size = wx.Size(b2.GetWidth(), b2.GetHeight()))
elif size != None:
... | 0 | 0 | 0 | 0 | 0 | 0 |
OpenAttack/victim/context.py | e-tornike/OpenAttack | 444 | 1776008 | <filename>OpenAttack/victim/context.py<gh_stars>100-1000
import time
class AttackContext:
def __init__(self, data, invoke_limit) -> None:
self.input = data
self.invoke = 0
self.invoke_limit = invoke_limit
self.attacker_start = time.time()
self.attacker_time_del = 0
s... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/extract_linknet_torch.py | zeroAska/TFSegmentation | 633 | 1776009 | <filename>utils/extract_linknet_torch.py
import numpy as np
import pickle
import os
import torchfile
from collections import OrderedDict
import pdb
model_weights= torchfile.load('/usr/data/menna/LinkNet-1.0/dict_net.t7')
pdb.set_trace()
# Transpose conv and fc weights
model_weights2= {}
for k, v in model_weights.items... | 0 | 0 | 0 | 0 | 0 | 0 |
transformation_invariant_image_search/main.py | xeddmc/transformationInvariantImageSearch | 285 | 1776034 | from __future__ import annotations
"""
Usage: main.py lookup <image>...
main.py insert <image>...
"""
import sys
import multiprocessing
from collections import Counter
from os import cpu_count
import cv2
import redis
import numpy as np
from .keypoints import compute_keypoints
from .phash import triangles_from_... | 1 | 2 | 0 | 0 | 3 | 0 |
pxr/usdQt/roles.py | chunkified/usd-qt | 124 | 1776048 | #
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. T... | 0 | 0 | 0 | 0 | 0 | 1 |
solutions/problem_201.py | ksvr444/daily-coding-problem | 1,921 | 1776050 | from __future__ import annotations
def get_max_path(triangle, index, level, path, path_val) -> object | tuple[object, object]:
if level == len(triangle):
return path, path_val
ind_a, ind_b = index, index + 1
val_a, val_b = triangle[level][ind_a], triangle[level][ind_b]
path_a, path_val_a = \
... | 0 | 2 | 0 | 0 | 2 | 0 |
bip/hexrays/event.py | paulfariello-syn/bip | 145 | 1776114 | <reponame>paulfariello-syn/bip<filename>bip/hexrays/event.py<gh_stars>100-1000
import ida_hexrays
class HxEvent(object):
"""
Enum object for the hexrays event. This is documented in
https://www.hex-rays.com/products/decompiler/manual/sdk/hexrays_8hpp.shtml
https://www.hex-rays.com/product... | 0 | 0 | 0 | 0 | 0 | 0 |
aula1/condicionais.py | nec0/curso-flask | 193 | 1776115 | <reponame>nec0/curso-flask
numero = 4
fracao = 6.1
online = False
texto = "Armando"
if numero == 5:
print("Hello 5")
elif numero == 4 or online:
print("Hello 4")
else:
print("Final")
print("Ola estou online" if online else "Ola estou offline")
| 0 | 0 | 0 | 0 | 0 | 0 |
autots/datasets/__init__.py | vishalbelsare/AutoTS-1 | 442 | 1776122 | <gh_stars>100-1000
"""
Tools for Importing Sample Data
"""
from autots.datasets._base import (
load_daily,
load_live_daily,
load_monthly,
load_yearly,
load_hourly,
load_weekly,
load_weekdays,
load_zeroes,
load_linear,
load_sine,
)
__all__ = [
'load_daily',
'load_monthly'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_api.py | zdresearch/Python-Honeypot | 186 | 1776127 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import requests
from core.get_modules import load_all_modules
API_URL = 'http://127.0.0.1:5000'
class TestApi(unittest.TestCase):
def test_index(self):
"""
Test if the API is running
"""
response = requests.get(API_URL... | 0 | 0 | 0 | 0 | 0 | 0 |
src/odb/test/python/01-import_package_test.py | erictaur/OpenROAD | 525 | 1776182 | <reponame>erictaur/OpenROAD
import opendbpy as odb
print('opendbpy package import successful!')
| 0 | 0 | 0 | 0 | 0 | 0 |
wooey/migrations/0022_add_collapse_arguments.py | fridmundklaus/wooey | 1,572 | 1776254 | <gh_stars>1000+
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-08 12:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wooey', '0021_fix_verbose_names'),
]
operations = [
migratio... | 0 | 0 | 0 | 0 | 0 | 0 |
plyer/platforms/linux/cpu.py | mphirke/plyer | 1,184 | 1776255 | <reponame>mphirke/plyer<filename>plyer/platforms/linux/cpu.py<gh_stars>1000+
'''
Module of Linux API for plyer.cpu.
'''
from os.path import join
from os import environ, listdir
from subprocess import Popen, PIPE
from plyer.facades import CPU
from plyer.utils import whereis_exe
class LinuxCPU(CPU):
'''
Implem... | 0 | 0 | 0 | 0 | 0 | 0 |
hs_core/views/resource_folder_hierarchy.py | hydroshare/hydroshare | 178 | 1776257 | <reponame>hydroshare/hydroshare<filename>hs_core/views/resource_folder_hierarchy.py
import json
import logging
import os
from django.core.exceptions import ValidationError
from django.http import HttpResponse, JsonResponse, HttpResponseBadRequest
from rest_framework.decorators import api_view
from rest_framework.exce... | 0 | 0 | 0 | 0 | 0 | 0 |
application/imagenet_example/eval_tengine.py | www516717402/MQBench | 179 | 1776273 | import argparse
import os
import time
import torch
from tengine import tg
import numpy as np
import numpy as np
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from main import (
accuracy,
AverageMeter
)
IMG_SIZE = 224
parser = argparse.ArgumentParser(description='classif... | 1 | 1 | 0 | 0 | 2 | 0 |
pyautogui__keyboard__examples/telegram_smile_clicker/main.py | DazEB2/SimplePyScripts | 117 | 1776284 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import annotations
__author__ = 'ipetrash'
def go() -> object | None:
OPEN_SMILE_MENU = 'elements/open_smile_menu.png'
GROUP_SMILE = 'elements/group_smile.png'
CLICK_SMILE = 'elements/click_smile.png'
SEND = 'elements/send.png'
def g... | 0 | 2 | 0 | 0 | 2 | 0 |
telegram_bot__telethon__examples/register_next_step_handler.py | gil9red/SimplePyScripts | 117 | 1776299 | <gh_stars>100-1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: pip install pyTelegramBotAPI
import telebot
from config import TOKEN
bot = telebot.TeleBot(TOKEN)
data_year = {
'01.01': 'Новый год',
'23.02': '23 февраля',
}
# SOURCE: https://ru.stackoverflow.com/quest... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.