max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
office-plugin/windows-office/program/wizards/common/SystemDialog.py | jerrykcode/kkFileView | 6,660 | 11062368 | #
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license noti... |
example/migrations/0006_auto_20181228_0752.py | anehx/django-rest-framework-json-api | 1,011 | 11062374 | # Generated by Django 2.1.4 on 2018-12-28 07:52
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("example", "0005_auto_20180922_1508"),
]
operations = [
migrations.CreateModel(
name="AuthorBioM... |
tests/fugue/extensions/test_utils.py | kvnkho/fugue | 547 | 11062377 | <reponame>kvnkho/fugue<filename>tests/fugue/extensions/test_utils.py
from fugue.collections import PartitionSpec
from fugue.exceptions import (FugueWorkflowCompileValidationError,
FugueWorkflowRuntimeValidationError)
from fugue.extensions._utils import (parse_validation_rules_from_comment,... |
tests/einsum.py | Saran-nns/cunumeric | 118 | 11062395 | # Copyright 2021 NVIDIA 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 required by applicable law or agreed to in wr... |
tt/tests/unit/trees/test_node_coalesce_negations.py | fkromer/tt | 233 | 11062410 | """Test node transformation to condense negations."""
from tt.definitions import BINARY_OPERATORS
from ._helpers import ExpressionTreeAndNodeTestCase
class TestNodeToPrimitives(ExpressionTreeAndNodeTestCase):
def test_non_negated_operand(self):
"""Test that no change occurs for a non-negated operand.""... |
gryphon/data_service/pollers/trades/bitfinex_trades_poller.py | qiquanzhijia/gryphon | 1,109 | 11062438 | # -*- coding: utf-8 -*-
from gryphon.data_service.pollers.trades.trades_poller import TradesPoller
from gryphon.lib.money import Money
class BitfinexTrades(TradesPoller):
"""
Bitfinex's trades endpoint currently has a rate limit of 45/minute.
This endpoint operates by returning the last n trades when it ... |
indra/sources/hypothesis/__init__.py | zebulon2/indra | 136 | 11062448 | """This module implements an API and processor for annotations coming from
hypothes.is. Annotations for a given group are obtained and processed either
into INDRA Statements or into entity grounding annotations.
Two configurable values (either in the INDRA config file or as an environmental
variable) are used. HYPOTHE... |
HtmlPopupTransientWindow.py | ivanalayan15/nodemcu-pyflasher | 1,172 | 11062490 |
# coding=utf-8
import wx
import wx.html
import webbrowser
class HtmlPopupTransientWindow(wx.PopupTransientWindow):
def __init__(self, parent, style, html_body_content, bgcolor, size):
wx.PopupTransientWindow.__init__(self, parent, style)
panel = wx.Panel(self)
panel.SetBackgroundColour(b... |
code-with-ai/app/server.py | Mithilesh1609/code-with-ai | 134 | 11062492 | from starlette.applications import Starlette
from starlette.responses import HTMLResponse, JSONResponse
from starlette.staticfiles import StaticFiles
from starlette.middleware.cors import CORSMiddleware
import uvicorn, aiohttp, asyncio
from io import BytesIO
from config import config
from fastai.text import *
path = ... |
workshop_material/003_make_empty_face_landmarking_xml_file.py | nrupatunga/pyimageconf2018 | 106 | 11062646 | <reponame>nrupatunga/pyimageconf2018<gh_stars>100-1000
import sys
import dlib
# Now let's run our detector on the images in dlib's examples/faces folder and
# save the detections to XML. Then we can use imglab to annotate face landmarks
# for each of those detections.
detector = dlib.simple_object_detector("detecto... |
devices/tests/test_filters.py | maznu/peering-manager | 127 | 11062649 | <reponame>maznu/peering-manager
from django.test import TestCase
from devices.filters import ConfigurationFilterSet, PlatformFilterSet
from devices.models import Configuration, Platform
from utils.testing import BaseFilterSetTests
class ConfigurationTestCase(TestCase, BaseFilterSetTests):
queryset = Configuratio... |
testing/test_full_pipeline_dump.py | vincent-antaki/Neuraxle | 519 | 11062660 | <gh_stars>100-1000
import os
import numpy as np
from neuraxle.base import Identity, ExecutionContext, JoblibStepSaver, FullDumpLoader
from neuraxle.pipeline import Pipeline
from neuraxle.steps.misc import FitTransformCallbackStep, TapeCallbackFunction
from neuraxle.steps.output_handlers import OutputTransformerWrappe... |
pygears/sim/modules/cosim_port.py | bogdanvuk/pygears | 120 | 11062662 | <filename>pygears/sim/modules/cosim_port.py
from pygears.sim import clk, delta, log
from pygears import GearDone
class CosimNoData(Exception):
pass
class InCosimPort:
def __init__(self, main, port, name=None):
self.port = port
self.name = name if name else port.basename
self.done = F... |
bin/automated_detection_testing/ci/attack_range_for_testing/detection_service.py | pageinsec/security_content | 348 | 11062719 | <gh_stars>100-1000
import os
from os import path
import sys
import argparse
import time
import shutil
from helpers import github_service, aws_service, attack_range_controller
DT_ATTACK_RANGE_STATE_STORE = "dt-attack-range-tf-state-store"
DT_ATTACK_RANGE_STATE = "dt-attack-range-state"
REGION = "eu-central-1"
NAME = ... |
dockerscan/actions/image/docker_api.py | michalkoczwara/dockerscan | 1,286 | 11062720 | <filename>dockerscan/actions/image/docker_api.py<gh_stars>1000+
"""
This file is was taken idea from 'undocker' project. Thank for your work and
for shared the code. It was very useful to write this lib.
Undocker project:
https://github.com/larsks/undocker
"""
import os
import io
import re
import errno
import shutil... |
tests/test_main.py | fuzzygroup/firefly | 207 | 11062742 | import os
from firefly.main import load_function
def test_load_functions():
os.path.exists2 = os.path.exists
path, name, func = load_function("os.path.exists2")
assert path == "/exists2"
assert name == "exists2"
assert func == os.path.exists
|
C04-Recurrences/exercise_code/findIndex.py | rasoolianbehnam/CLRS | 9,395 | 11062744 | <gh_stars>1000+
#!/usr/bin/env python
# coding=utf-8
def mergeindex(items, evens):
res = []
l = len(items[0])
for i in range(len(items)):
left = evens[i]
right = -1
if i == len(items)-1 and len(evens) == len(items):
right = l - 1
else:
right = evens[... |
netbox_onboarding/views.py | fallenfuzz/ntc-netbox-plugin-onboarding | 180 | 11062747 | <filename>netbox_onboarding/views.py
"""Django views for device onboarding.
(c) 2020 Network To Code
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
Unle... |
tests/utils.py | kevinyamauchi/stardist | 221 | 11062759 | <filename>tests/utils.py
import os
import numpy as np
from tifffile import imread
from skimage.measure import label
from scipy.ndimage.filters import gaussian_filter
from pathlib import Path
from timeit import default_timer
from csbdeep.utils.tf import keras_import
Sequence = keras_import('utils','Sequence')
class Nu... |
src/TermImage.py | iamshnoo/TerminusBrowser | 104 | 11062776 | <gh_stars>100-1000
'''
Created on May 15, 2017
@author: <EMAIL>
'''
from subprocess import call
import subprocess
import os
from threading import Thread
import threading
from PIL import Image, ImageDraw
class TermImage(threading.Thread):
def __init__(self):
Thread.__init__(self)
def stream(self, bp,... |
3rdParty/gslib/cdep.py | mfkiwl/libparanumal | 102 | 11062787 | <filename>3rdParty/gslib/cdep.py
#!/usr/bin/python
import sys, os, re
#mergestr = lambda x: reduce((lambda a,b: a+" "+b),x,"")
pathjoin = lambda a,b: os.path.normpath(os.path.join(a,b))
include_re = re.compile("\s*#\s*include\s*\"([^\"]*)\"")
incmatch = lambda x: ( include_re.match(line) for line in open(x) )
inclin... |
stweet/twitter_api/default_twitter_web_client_provider.py | markowanga/stweet | 101 | 11062801 | """DefaultTwitterWebClientProvider class."""
from tor_python_easy.tor_control_port_client import TorControlPortClient
from .twitter_auth_web_client_interceptor import TwitterAuthWebClientInterceptor
from ..auth import SimpleAuthTokenProvider
from ..auth.fail_strategy.tor_ip_change_auth_fail_strategy import TorIpChange... |
util/summary.py | sourcery-ai-bot/atari-rl | 125 | 11062806 | <reponame>sourcery-ai-bot/atari-rl<gh_stars>100-1000
import tensorflow as tf
class Summary(object):
def __init__(self, config):
self.summary_writer = tf.summary.FileWriter(config.run_dir)
self.summary_step_period = config.summary_step_period
def run_summary(self, step):
return step % self.summary_ste... |
plotting/swap_plot.py | suresh-guttikonda/differentiable-particle-filters | 137 | 11062886 | import pickle
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import itertools
import os
results = None
# matplotlib.rcParams.update({'font.size': 12})
color_list = plt.cm.tab10(np.linspace(0, 1, 10))
colors = {'lstm': color_list[0], 'pf_e2e': color_list[1... |
examples/research/surgery/nds/test_germ_nds.py | Harald-R/aw_nas | 195 | 11062894 | <gh_stars>100-1000
#pylint: disable-all
import pickle
import pytest
from aw_nas.utils.torch_utils import random_cnn_data
@pytest.mark.parametrize("case", [
{
# original
"avail_depths": [1, 2, 3, 4, 6, 8, 12, 16, 24],
"avail_widths": [16, 24, 32, 40, 48, 64, 80, 96, 128, 160, 192, 256]
... |
src/test/visit_test_ctest.py | visit-dav/vis | 226 | 11062905 | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
# ----------------------------------------------------------------------------
# Method: ctestRepo... |
boltstream/migrations/0001_initial.py | geekpii/boltstream | 1,735 | 11062909 | # Generated by Django 2.2 on 2019-04-29 18:08
import functools
import uuid
import django.contrib.auth.validators
import django.db.models.deletion
import django.utils.crypto
import django.utils.timezone
import jsonfield.fields
from django.conf import settings
from django.db import migrations, models
import boltstream... |
problog/engine_stack.py | HEmile/problog | 189 | 11062911 | """
problog.engine_stack - Stack-based implementation of grounding engine
---------------------------------------------------------------------
Default implementation of the ProbLog grounding engine.
..
Part of the ProbLog distribution.
Copyright 2015 <NAME>, DTAI Research Group
Licensed under the Apach... |
src/UnloadCopyUtility/util/kms_helper.py | rmcelroyF8/amazon-redshift-utils | 2,452 | 11062935 | <reponame>rmcelroyF8/amazon-redshift-utils
import base64
import logging
import sys
import boto3
class KMSHelper:
def __init__(self, region_name):
self.kms_client = boto3.client('kms', region_name=region_name)
def generate_base64_encoded_data_key(self, encryption_key_id, key_spec="AES_256"):
... |
migrations/versions/4c0d7a22344e_add_chat_type_column.py | Forevka/bot | 162 | 11062938 | <reponame>Forevka/bot
"""add chat type column
Revision ID: 4c0d7a22344e
Revises: 4<PASSWORD>
Create Date: 2019-10-16 23:14:43.280821
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "<KEY>"
down_revision = "4<PASSWORD>"
branch_labels = None
depends_on = None
de... |
src/confluent/azext_confluent/manual/commands.py | haroonf/azure-cli-extensions | 207 | 11062946 | # --------------------------------------------------------------------------
# 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... |
InterviewBit_problems/Sorting/Max NonNegative SubArray/solution.py | gbrls/CompetitiveCode | 165 | 11062958 | <gh_stars>100-1000
'''
- Here we are taking a List A
- maxset() function will take the List A and find out the maximum non-negative subarray
- Firstly we are traversing the List A and storing the subarrays of positive numbers in subarr
- After that we are finding the sum of elements of first subarray and storing in mx
... |
basic/invitations/forms.py | neechadi/django-basic-apps | 548 | 11062990 | from django import forms
from django.contrib.auth.models import User
from basic.invitations.models import Invitation
class InvitationForm(forms.ModelForm):
class Meta:
model = Invitation
exclude = ('status', 'from_user', 'site', 'token')
|
apps/article/migrations/0005_auto_20190314_1416.py | sakisrealop/website | 312 | 11063038 | <reponame>sakisrealop/website
# Generated by Django 2.0.8 on 2019-03-14 14:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0004_headlines'),
]
operations = [
migrations.RemoveField(
model_name='headlines',
... |
ninfs/gui/osver.py | Jhynjhiruu/ninfs | 213 | 11063095 | # This file is a part of ninfs.
#
# Copyright (c) 2017-2021 <NAME>
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE.md in the root of this project.
import platform
import sys
def get_os_ver():
if sys.platform == 'win32':
import winreg
ver = pla... |
river/utils/test_math.py | fox-ds/river | 1,105 | 11063112 | import numpy as np
from river import utils
def test_dotvecmat_zero_vector_times_matrix_of_ones():
A_numpy = np.array([[1, 1], [1, 1]])
A_river = {(0, 0): 1, (0, 1): 1, (1, 0): 1, (1, 1): 1}
x_numpy = np.array([0, 0])
x_river = {0: 0, 1: 0}
numpy_dotvecmat = x_numpy.dot(A_numpy)
river_dotvecm... |
pycoin/coins/bgold/Tx.py | jaschadub/pycoin | 1,210 | 11063122 |
from .SolutionChecker import BgoldSolutionChecker
from .Solver import BgoldSolver
from pycoin.coins.bitcoin.Tx import Tx as BaseTx
class Tx(BaseTx):
Solver = BgoldSolver
SolutionChecker = BgoldSolutionChecker
|
booking/command.py | hack12306/12306-booking-tool | 311 | 11063129 | <filename>booking/command.py
# encoding: utf8
"""
command.py
@author Meng.yangyang
@description
@created Tue Jan 08 2019 23:39:26 GMT+0800 (CST)
"""
import re
import json
import click
import logging
import datetime
import requests
import prettytable
from .run import initialize, run as booking_run_loop
from .utils i... |
speechbrain/lobes/models/transformer/TransformerST.py | JasonSWFu/speechbrain | 3,913 | 11063158 | <gh_stars>1000+
"""Transformer for ST in the SpeechBrain sytle.
Authors
* <NAME>, CHENG 2021
"""
import torch # noqa 42
import logging
from torch import nn
from typing import Optional
from speechbrain.nnet.containers import ModuleList
from speechbrain.lobes.models.transformer.Transformer import (
get_lookahead_... |
arelle/plugin/functionsMath.py | hamscher/Arelle | 292 | 11063236 | '''
Formula math functions plugin.
(c) Copyright 2018 Mark V Systems Limited, All rights reserved.
'''
import math
from arelle.ModelValue import qname
from arelle import XPathContext, XbrlUtil
from arelle.FunctionUtil import numericArg
INF = float('inf')
MINUSINF = float('-inf')
NaN = float('nan')
def xfm_pi(xc, p, ... |
WebMirror/management/rss_parser_funcs/feed_parse_extractNononosanctuaryXyz.py | fake-name/ReadableWebProxy | 193 | 11063322 | def extractNononosanctuaryXyz(item):
'''
Parser for 'nononosanctuary.xyz'
'''
if 'News, Updates, ETC.' in item['tags']:
return None
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('MaouMuji', ... |
krsh/kubeflow/pipeline.py | riiid/krsh | 133 | 11063361 | <reponame>riiid/krsh
# Copyright 2021 AIOps Squad, Riiid 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 applica... |
src/offazure/azext_offazure/generated/_help.py | Mannan2812/azure-cli-extensions | 207 | 11063385 | <reponame>Mannan2812/azure-cli-extensions
# --------------------------------------------------------------------------
# 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... |
Dynamic Programming/740. Delete and Earn.py | beckswu/Leetcode | 138 | 11063397 | <filename>Dynamic Programming/740. Delete and Earn.py
# 2020 bottom-up
class Solution:
def deleteAndEarn(self, nums: List[int]) -> int:
cnt = [0 for _ in range(10001)]
for i in nums:
cnt[i] += i
take, skip = cnt[1], 0
for i in cnt:
take, skip = max(skip + i, t... |
data/snli.py | liushengzhong1023/multihead-siamese-nets | 175 | 11063447 | import enum
import pandas as pd
from data import dataset
class ColumnType(enum.Enum):
sentence1 = 0,
sentence2 = 1,
labels = 2,
columns = [
ColumnType.sentence1.name,
ColumnType.sentence2.name,
ColumnType.labels.name,
]
class SNLIDataset(dataset.DatasetExperiment):
def __init__(... |
app/grandchallenge/serving/tasks.py | amickan/grand-challenge.org | 101 | 11063512 | <filename>app/grandchallenge/serving/tasks.py
from celery import shared_task
from django.db.models import F
from grandchallenge.serving.models import Download
@shared_task
def create_download(*_, **kwargs):
n_updated = Download.objects.filter(**kwargs).update(count=F("count") + 1)
if n_updated == 0:
... |
playbooks/robusta_playbooks/node_disk_analysis.py | robusta-dev/robusta | 273 | 11063577 | <filename>playbooks/robusta_playbooks/node_disk_analysis.py
from robusta.api import *
from robusta.utils.parsing import load_json
import re
import humanize
class DiskAnalyzerParams(ActionParams):
show_pods: bool = True
show_containers: bool = False
@action
def node_disk_analyzer(event: NodeEvent, params: ... |
corehq/apps/registry/signals.py | akashkj/commcare-hq | 471 | 11063610 | from django.dispatch import Signal, receiver
from corehq.apps.registry.notifications import (
send_invitation_email,
send_invitation_response_email,
send_grant_email,
)
data_registry_activated = Signal(providing_args=["registry"])
data_registry_deactivated = Signal(providing_args=["registry"])
data_regist... |
tests/common/test_op/ascend/expm1.py | tianjiashuo/akg | 286 | 11063708 | <filename>tests/common/test_op/ascend/expm1.py<gh_stars>100-1000
# Copyright 2019-2021 Huawei Technologies Co., Ltd
#
# 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/l... |
esphome/components/tx20/sensor.py | OttoWinter/esphomeyaml | 249 | 11063724 | <reponame>OttoWinter/esphomeyaml<filename>esphome/components/tx20/sensor.py
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins
from esphome.components import sensor
from esphome.const import (
CONF_ID,
CONF_WIND_SPEED,
CONF_PIN,
CONF_WIND_DIRECTION_DEGREES,
... |
machina/samplers/distributed_epi_sampler.py | krish-dx/machina | 302 | 11063732 | """
Sampler class for multi node situation.
This sampler uses redis for the backend.
"""
import argparse
import time
import cloudpickle
import redis
from machina.samplers import EpiSampler
from machina.utils import _int, get_redis, make_redis
class DistributedEpiSampler(object):
"""
A sampler which sample ... |
misc/pytorch_toolkit/machine_translation/core/utils/json_logger.py | dqawami/openvino_training_extensions | 256 | 11063741 | """
Copyright (c) 2020 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 required by applicable law or agreed to in writin... |
PyFunceble/cli/utils/testing.py | Centaurioun/PyFunceble | 213 | 11063775 | <reponame>Centaurioun/PyFunceble
"""
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║... |
cross3d/studiomax/studiomaxscenelayer.py | vedantirb/cross3d | 129 | 11063844 | ##
# \namespace cross3d.studiomax.studiomaxscenelayer
#
# \remarks The StudiomaxSceneLayer class provides implementation of the AbstractSceneLayer class as it applys to 3d Studio Max scenes
#
# \author eric
# \author Blur Studio
# \date 09/08/10
#
from Py3dsMax import mxs
import cross3d
from cross3d.abs... |
bookwyrm/tests/views/test_group.py | mouse-reeve/fedireads | 270 | 11063921 | """ test for app action functionality """
from unittest.mock import patch
from django.contrib.auth.models import AnonymousUser
from django.http import Http404
from django.template.response import TemplateResponse
from django.test import TestCase
from django.test.client import RequestFactory
from bookwyrm import model... |
bitcoin_tools/analysis/status/__init__.py | bitseaman/bitcoin_tools | 248 | 11063967 | # Fee per byte range
MIN_FEE_PER_BYTE = 0
MAX_FEE_PER_BYTE = 350
FEE_STEP = 1
NSPECIALSCRIPTS = 6
try:
import bitcoin_tools.conf as CFG
except ImportError:
raise Exception("You don't have a configuration file. Make a copy of sample_conf.py")
try:
entries = [CFG.chainstate_path, CFG.data_path, CFG.figs_pa... |
stores/apps/auctions/tests.py | diassor/CollectorCity-Market-Place | 135 | 11063971 | """
This file demonstrates two different styles of tests (one doctest and one
unittest). These will both pass when you run "manage.py test".
Replace these with more appropriate tests for your application.
"""
import datetime
from django.test import TestCase
from django.core.urlresolvers import reverse
from auctions.... |
example/make/foo.py | MaxSac/build | 11,356 | 11064035 | import sys
open(sys.argv[2], "w").write(open(sys.argv[1]).read())
|
adi_analyze/event/ObjectAllocEvent.py | Bertlk/ADI | 226 | 11064055 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2019/9/2 1:09 下午
# @Author : kewen
# @File : ObjectAllocEvent.py
from event.StackEvent import StackEvent
class ObjectAllocEvent(StackEvent):
"""
JVM 分配对象的 Event。保存分配对象时的线程名字、对象类名、调用栈等详细信息
"""
def __init__(self):
super().__init__()... |
python/pysvso/predictors/__init__.py | mfkiwl/SEMANTIC_VISUAL_SUPPORTED_ODEMETRY | 191 | 11064061 | from .ekf import ExtendedKalmanFilter, BBoxKalmanFilter
from .opticalflow import OpticalFlowBBoxPredictor, OpticalFlowKPntPredictor, HybridOpticalFlowFilter |
parsifal/apps/authentication/tests/factories.py | ShivamPytho/parsifal | 342 | 11064063 | <reponame>ShivamPytho/parsifal<gh_stars>100-1000
from django.contrib.auth.models import User
import factory
from factory.django import DjangoModelFactory
class UserFactory(DjangoModelFactory):
username = factory.Sequence(lambda n: f"user-{n}")
email = factory.Sequence(lambda n: f"<EMAIL>")
class Meta:
... |
stix_shifter_modules/security_advisor/stix_transmission/utils/sa_findings_api.py | pyromaneact/stix-shifter | 129 | 11064120 | <filename>stix_shifter_modules/security_advisor/stix_transmission/utils/sa_findings_api.py
import requests
"""
Takes in accountID accessToken host time and returns all the findings in the account
:param accountID: accountID of the user
:type accountID: str
:param accessToken: token passed as authorizati... |
tests/nnet/activations/test_glu.py | Zac-HD/MyGrad | 147 | 11064150 | import sys
import hypothesis.extra.numpy as hnp
import hypothesis.strategies as st
import numpy as np
import pytest
from hypothesis import assume, given
import mygrad as mg
from mygrad.nnet.activations import glu
from tests.wrappers.uber import backprop_test_factory, fwdprop_test_factory
@pytest.mark.parametrize("a... |
applications/tensorflow/detection/yolov3/core/backbone.py | payoto/graphcore_examples | 260 | 11064172 | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2021 Graphcore Ltd. All Rights Reserved.
# Copyright (c) 2019 YunYang1994 <<EMAIL>>
# License: MIT (https://opensource.org/licenses/MIT)
# This file has been modified by Graphcore Ltd.
import core.common as common
import ipu_utils
import tensorflow as tf
def dark... |
pymc4/gp/util.py | mailology/pymc4 | 789 | 11064181 | import inspect
import warnings
import re
from typing import Union
import tensorflow as tf
import numpy as np
ArrayLike = Union[np.ndarray, tf.Tensor]
TfTensor = tf.Tensor
FreeRV = ArrayLike
def stabilize(K, shift=None):
r"""Add a diagonal shift to a covariance matrix."""
K = tf.convert_to_tensor(K)
dia... |
boto3_type_annotations_with_docs/boto3_type_annotations/appmesh/client.py | cowboygneox/boto3_type_annotations | 119 | 11064187 | from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def can_paginate(self, operation_name: str = None):
"""
C... |
visual_inspector/figure_base/settings.py | m4ta1l/deep-neuroevolution | 883 | 11064211 | """global data structure"""
from colour import Color
gen2sorted_indices = {} # Global sorted index for sorting BCs
fitness_plot = None
cloud_plots = set()
canvas2cloud_plot = {} # Figure canvas to figure object
noise = None # Global Noise Table
numBins = 5 # Number of Color Bins for ColorBar
assert numBins > 1
COLO... |
meerk40t/gui/panes/consolepanel.py | apbarratt/meerk40t | 118 | 11064232 | <gh_stars>100-1000
import wx
from wx import aui
from meerk40t.gui.icons import icons8_console_50
from meerk40t.gui.mwindow import MWindow
_ = wx.GetTranslation
def register_panel(window, context):
panel = ConsolePanel(window, wx.ID_ANY, context=context)
pane = (
aui.AuiPaneInfo()
.Bottom()
... |
test_suite/suite/test06/test.py | joncatanio/cannoli | 755 | 11064262 | <reponame>joncatanio/cannoli
a = [1, 2, 3]
a.append(15)
print(a)
b = a
b.append("hi")
print(a)
a.append(['a', 'b', True, False])
print("a: " + str(a))
print("b: " + str(b))
a = [[1, 2], [3, 4], [5, 6]]
print(a)
|
robogym/viewer/env_viewer.py | 0xflotus/robogym | 288 | 11064281 | <reponame>0xflotus/robogym<filename>robogym/viewer/env_viewer.py
import time
from copy import deepcopy
from typing import List, Union
import glfw
import numpy as np
from gym.spaces import Box, MultiDiscrete
from mujoco_py import MjViewer, const, ignore_mujoco_warnings
from robogym.utils.misc import pretty
class Env... |
hpOneView/resources/storage/storage_systems.py | doziya/hpeOneView | 107 | 11064302 | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP
#
# 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 limi... |
Decision Tree/DT_Classify/AnFany_DT_Classify.py | Jojoxiao/Machine-Learning-for-Beginner-by-Python3 | 397 | 11064314 | # -*- coding:utf-8 -*-
# &Author AnFany
# CART分类树:可处理连续、离散的变量,支持多分类
# 测试数据和训练数据的字段顺序必须一样,因为本程序在设定规则按的是字段的编号,而不是名字
# 引入数据
import DT_Classify_Data as dtda
import copy
import pandas as pd
import numpy as np
# 定义函数
class DT:
def __init__(self, train_dtdata=dtda.dt_data, pre_dtdata=dtda.test_data, tr... |
guietta/examples/images.py | zhenggc1/guietta | 1,984 | 11064335 | <reponame>zhenggc1/guietta<gh_stars>1000+
# -*- coding: utf-8 -*-
import os.path
from guietta import B, L, _, Gui
gui = Gui(
[ _ , L('up.png') , _ ],
[ B('left.png') , _ , B('right.png') ],
[ _ , L('down.png') , _ , ],
images_dir = os.path... |
tf_agents/tf_agents_api_test.py | Francis777/agents | 3,175 | 11064367 | <gh_stars>1000+
# coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
test.py | YLFF/2004P_Pytorch-Networks | 454 | 11064385 | import os
import torch
import torch.nn as nn
import numpy as np
from easydict import EasyDict as edict
import logging
import cv2
import time
from network_factory import get_network
from datasets.loader_factory import get_loader
from utils import load_test_checkpoints, CalculateAcc, \
SelfData, load... |
test/manual/documents/test_create_document_from_file.py | membranepotential/mendeley-python-sdk | 103 | 11064414 | <reponame>membranepotential/mendeley-python-sdk<gh_stars>100-1000
from test import cassette
from test.resources.documents import *
def test_should_create_document_from_file():
session = get_user_session()
delete_all_documents()
with cassette('fixtures/resources/documents/create_document_from_file/create_... |
notebooks/exercise_solutions/n00_python_intro_data-structures.py | pydy/pydy-tutorial-human-standing | 134 | 11064452 | <gh_stars>100-1000
num_list = [1,2,3,4]
months = ['Jan', 'Feb', 'Mar', 'Apr']
months_dict = dict(zip(months, num_list)) |
etc/monitor/import-dashboard.py | gowins/moha | 123 | 11064466 | <gh_stars>100-1000
#!/usr/bin/env python2
from __future__ import print_function, \
unicode_literals
import urllib
import urllib2
import base64
import json
import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-f', dest="file", type=str,
hel... |
functional_tests/save/save-dir.py | borisgrafx/client | 3,968 | 11064471 | """test run.save() functionality
---
id: 0.save.dir
plugin:
- wandb
assert:
- :wandb:runs_len: 1
- :wandb:runs[0][config]: {id: save_dir}
- :op:not_contains:
- :wandb:runs[0][files]
- newdir/newfile.txt
- :wandb:runs[0][exitcode]: 0
"""
import os
import tempfile
import wandb
def write_file(fname)... |
hydroDL/model/dropout.py | csiro-hydroinformatics/hydroDL | 109 | 11064491 | import torch
import torch.nn
def createMask(x, dr):
mask = x.new().resize_as_(x).bernoulli_(1 - dr).div_(1 - dr).detach_()
# print('droprate='+str(dr))
return mask
class DropMask(torch.autograd.function.InplaceFunction):
@classmethod
def forward(cls, ctx, input, mask, train=False, inplace=False)... |
nuplan/planning/training/callbacks/utils/scene_converter.py | motional/nuplan-devkit | 128 | 11064535 | import abc
from typing import Any, Dict, List
from nuplan.planning.scenario_builder.abstract_scenario import AbstractScenario
from nuplan.planning.training.modeling.types import FeaturesType, TargetsType
class SceneConverter(abc.ABC):
"""
Generic scene converter class.
"""
@abc.abstractmethod
de... |
scripts/automation/trex_control_plane/interactive/trex/wireless/unit_tests/trex_wireless_worker_test.py | timgates42/trex-core | 956 | 11064548 | <filename>scripts/automation/trex_control_plane/interactive/trex/wireless/unit_tests/trex_wireless_worker_test.py<gh_stars>100-1000
import multiprocessing
import queue
import sys
import unittest
import os
from unittest.mock import patch
from wireless.pubsub.pubsub import PubSub
from wireless.trex_wireless_ap import AP... |
versions/2020/transformer/code/transformer-mnist.py | Cahlil-Togonon/Deep-Learning-Experiments | 994 | 11064570 | <gh_stars>100-1000
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchvision.datasets as datasets
import torchvision.transforms as transforms
import numpy as np
import datetime
import argparse
import matplotlib.pyplot as plt
import matplotlib
from PIL import Ima... |
setup.py | ipfs/py-ipfs | 442 | 11064616 | #!/usr/bin/python3
import os
import re
import sys
import setuptools
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self... |
vivisect/symboliks/tests/test_translator.py | rnui2k/vivisect | 716 | 11064653 | import logging
import binascii
import unittest
import vivisect
import vivisect.symboliks.archs.i386 as i386sym
import vivisect.symboliks.archs.amd64 as amd64sym
import vivisect.symboliks.tests.data_i386 as i386_data
import vivisect.symboliks.tests.data_amd64 as amd64_data
logger = logging.getLogger(__name__)
xlato... |
zcls/data/transforms/__init__.py | ZJCV/PyCls | 110 | 11064692 | # -*- coding: utf-8 -*-
"""
@date: 2021/10/3 上午10:41
@file: __init__.py.py
@author: zj
@description:
"""
|
magma/compile_exception.py | leonardt/magma | 167 | 11064711 | <reponame>leonardt/magma
from magma.array import Array
from magma.tuple import Tuple
def _make_unconnected_error_str(port):
error_str = port.debug_name
if port.trace() is not None:
error_str += ": Connected"
elif isinstance(port, (Tuple, Array)):
child_str = ""
for child in port:
... |
tests/test_general.py | signalityai/cachier | 411 | 11064720 | <reponame>signalityai/cachier
"""Non-core-specific tests for cachier."""
from __future__ import print_function
import os
import cachier
from cachier.core import (
MAX_WORKERS_ENVAR_NAME,
DEFAULT_MAX_WORKERS,
_max_workers,
_set_max_workers,
_get_executor
)
def test_information():
print("\ncac... |
testproject/model_meta/results.py | samuelblattner/django-cassandra-engine | 334 | 11064738 | from common.models import CassandraThing
TEST_RESULTS = {
'get_all_field_names': {
CassandraThing: [
'id',
'data_abstract',
],
},
'fields': {
CassandraThing: [
'id',
'data_abstract',
],
},
'local_fields': {
Cas... |
test/benchmark/run_ablation.py | senliontec/mujoco | 1,575 | 11064749 | <gh_stars>1000+
#!/usr/bin/env python3
# Copyright 2021 DeepMind Technologies 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
#
# Un... |
datatest/_load/temptable.py | drewdolan/datatest | 277 | 11064778 | <reponame>drewdolan/datatest
# -*- coding: utf-8 -*-
import sqlite3
from .._compatibility.collections.abc import Iterable
from .._compatibility.collections.abc import Mapping
from .._compatibility.itertools import chain
from .._compatibility.itertools import count
try:
string_types = basestring
except NameError:
... |
src/UnloadCopyUtility/tests/ddl_helpers_tests.py | rmcelroyF8/amazon-redshift-utils | 2,452 | 11064886 | <reponame>rmcelroyF8/amazon-redshift-utils<gh_stars>1000+
from unittest import TestCase
from util.sql.ddl_generators import SQLTextHelper, DDLTransformer
class TableDDLHelperTests(TestCase):
def test_remove_simple_block(self):
input_sql = """/* co
mm
ents
can m... |
utils/__init__.py | liepeiming/captcha_trainer | 2,548 | 11064889 | <reponame>liepeiming/captcha_trainer
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Author: kerlomz <<EMAIL>>
# from . import sparse
# from . import data |
openbook_communities/migrations/0019_auto_20190426_1346.py | TamaraAbells/okuna-api | 164 | 11064918 | # Generated by Django 2.2 on 2019-04-26 11:46
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('openbook_posts', '0029_auto_20190423_1921'),
('openbook_communities', '0018_auto_20190309_1527'),
]
operation... |
src/genie/libs/parser/iosxe/tests/ShowVlanId/cli/equal/golden_output_1_expected.py | balmasea/genieparser | 204 | 11064919 | expected_output = {'brdg-mode': '-',
'bridge-no': '-',
'mtu': '1500',
'parent': '-',
'ports': ['Hu1/0/2',
'Hu1/0/3',
'Hu1/0/4',
'Hu1/0/5',
'Hu1/0/6',
'Hu1/0/7',
'Hu1/0/8',
'Hu1/0/9',
'Hu1/0/10',
'Hu1/0/11',
... |
MyPyWidgets/NoteBookClass.py | lon3wolf/MyPyBuilder | 237 | 11064926 | import tkinter.ttk as ttk
class NoteBook(ttk.Notebook):
def __init__(self, frame):
self.location = None
super().__init__(master=frame)
self.widget = self
def add_tab(self, frame, tab_id):
self.widget.add(frame, text=tab_id)
def set_base_location(self, location):
... |
sasila/system_normal/processor/city_location_processor.py | iiiusky/Sasila | 327 | 11064938 | <reponame>iiiusky/Sasila<filename>sasila/system_normal/processor/city_location_processor.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from sasila.system_normal.spider.spider_core import SpiderCore
from sasila.system_normal.processor.base_processor import BaseProcessor, Rule, LinkExtractor
from sasila.sy... |
tools/stretchyIkChain.py | fsanges/glTools | 165 | 11064964 | import maya.cmds as mc
import maya.mel as mm
import glTools.utils.ik
import glTools.utils.stringUtils
def build(ikHandle,scaleAxis='x',scaleAttr='',blendControl='',blendAttr='stretchScale',shrink=False,prefix=''):
'''
Create a stretchy IK chain
@param ikHandle: IK Handle to create stretchy setup for
@type ikHandl... |
Tachograph/server.py | kbsao/testingios3 | 212 | 11064975 | #!/usr/bin/env python
#encoding:utf-8
import json, enum, time
from twisted.internet import reactor, protocol
class CameraCommand(enum.Enum):
QUERY = 1
FETCH_VERSION = 11
FETCH_TOKEN = 0x101
FETCH_STORAGE = 0x500
FETCH_ROUTE_VIDEOS = 0x508
FETCH_EVENT_VIDEOS = 0x509
FETCH_IMAGES = 0x50A
... |
samples/python/45.state-management/data_models/conversation_data.py | Aliacf21/BotBuilder-Samples | 1,998 | 11064984 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
class ConversationData:
def __init__(
self,
timestamp: str = None,
channel_id: str = None,
prompted_for_user_name: bool = False,
):
self.timestamp = timestamp
self.chan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.