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 |
|---|---|---|---|---|---|---|---|---|---|---|
tests/test_query.py | q0w/snug | 123 | 3302335 | <reponame>q0w/snug
import asyncio
import inspect
import urllib.request
from operator import methodcaller
import snug
async def awaitable(obj):
"""an awaitable returning given object"""
await asyncio.sleep(0)
return obj
class MockAsyncClient:
def __init__(self, response):
self.response = res... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/gis_tests/geoapp/test_indexes.py | KaushikSathvara/django | 61,676 | 3302337 | <gh_stars>1000+
from django.contrib.gis.db import models
from django.db import connection
from django.db.models import Index
from django.test import TransactionTestCase
from django.test.utils import isolate_apps
from .models import City
class SchemaIndexesTests(TransactionTestCase):
available_apps = []
model... | 0 | 0 | 0 | 0 | 0 | 0 |
cli/scripts/addrs.py | niclashedam/liblightnvm | 126 | 3302365 | <reponame>niclashedam/liblightnvm
#!/usr/bin/env python
from __future__ import print_function
from subprocess import Popen, PIPE
import argparse
import sys
import re
def shell(cmd):
"""Execute the given command"""
cmd = [str(x) for x in cmd]
process = Popen(cmd, stdout=PIPE, stderr=PIPE)
out, err = process.comm... | 0 | 0 | 0 | 0 | 0 | 0 |
src/python/fatorial_recursiva.py | willisnou/Algoritmos-e-Estruturas-de-Dados | 653 | 3302409 | from __future__ import annotations
""" Algoritmo de fatorial implementado com recursão """
def fatorial_recursivo(numero) -> int | object:
"""
Implementação de um algoritmo de fatorial com recursão.
Argumentos:
numero: int. o número do qual deseja-se obter o fatorial.
Retorna o resultado da ... | 0 | 1 | 0 | 0 | 1 | 0 |
Python/Multiply and Print.py | kennethsequeira/Hello-world | 1,428 | 3302413 | <filename>Python/Multiply and Print.py
#Defines your multiplication
myvar=5*4
#Prints a sentence and result of your multiplication
print('The result of 5*4 is'+ ' '+str(myvar))
| 0 | 0 | 0 | 0 | 0 | 0 |
test/test_det44.py | yasics/vpp | 751 | 3302429 | <reponame>yasics/vpp
#!/usr/bin/env python3
import socket
import struct
import unittest
import scapy.compat
from time import sleep
from framework import VppTestCase, running_extended_tests
from ipfix import IPFIX, Set, Template, Data, IPFIXDecoder
from scapy.layers.inet import IP, TCP, UDP, ICMP
from scapy.layers.inet... | 0 | 0 | 0 | 0 | 0 | 0 |
nb_conda_kernels/__init__.py | edennuriel/nb_conda_kernels | 449 | 3302437 | <reponame>edennuriel/nb_conda_kernels<filename>nb_conda_kernels/__init__.py
# flake8: noqa
from .manager import CondaKernelSpecManager
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
| 0 | 0 | 0 | 0 | 0 | 0 |
backend/audits/migrations/0008_auto_20190410_1232.py | donroyco/falco | 796 | 3302480 | # Generated by Django 2.1.7 on 2019-04-10 10:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
("projects", "0008_auto_20190410_1232"),
("audits", "0007_audit_parameters"),
]
operat... | 0 | 0 | 2 | 0 | 2 | 0 |
core/utils/run_nerf_helpers.py | liruilong940607/A-NeRF | 110 | 3302511 | <gh_stars>100-1000
import torch
import numpy as np
# Misc
to8b = lambda x : (255*np.clip(x,0,1)).astype(np.uint8)
def load_ckpt_from_path(ray_caster, optimizer, ckpt_path,
finetune=False):
ckpt = torch.load(ckpt_path)
global_step = ckpt["global_step"]
ray_caster.load_state_dict(ckp... | 0 | 0 | 0 | 0 | 0 | 0 |
igibson/examples/demo/vr_demos/muvr/muvr_demo.py | NishanthJKumar/iGibson | 360 | 3302531 | <gh_stars>100-1000
""" Multi-user VR demo. Always start server running before the client.
Usage: python muvr_demo.py --mode=[server or client] --host=[localhost or ip address] --port=[valid port number]
"""
import argparse
import os
import time
import numpy as np
import pybullet as p
import igibson
from igibson imp... | 0 | 0 | 0 | 0 | 0 | 0 |
vcstool/commands/diff.py | sloretz/vcstool | 230 | 3302543 | <reponame>sloretz/vcstool
import argparse
import sys
from vcstool.streams import set_streams
from .command import Command
from .command import simple_main
class DiffCommand(Command):
command = 'diff'
help = 'Show changes in the working tree'
def __init__(self, args):
super(DiffCommand, self)._... | 0 | 0 | 0 | 0 | 0 | 0 |
homeassistant/components/twitch/__init__.py | domwillcode/home-assistant | 22,481 | 3302568 | """The twitch component."""
| 0 | 0 | 0 | 0 | 0 | 0 |
docker/grpc-util/python/jsonLatencyTest.py | smsahu/seldon-server | 1,645 | 3302572 | import os
import sys, getopt, argparse
import logging
import json
import time
import requests
class BadCallError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return repr(self.value)
class LatencyTest(object):
def __init__(self):
self.latency_sum = ... | 0 | 0 | 0 | 0 | 0 | 0 |
demos/blog/aiohttpdemo_blog/main.py | asvetlov/aiohttp_admin | 221 | 3302590 | <reponame>asvetlov/aiohttp_admin
import asyncio
import logging
import pathlib
import aiohttp_jinja2
import aiohttp_security
import jinja2
from aiohttp import web
import aiohttp_admin
from aiohttp_admin.backends.sa import PGResource
import aiohttpdemo_blog.db as db
from aiohttpdemo_blog.utils import init_postgres, loa... | 0 | 0 | 0 | 0 | 0 | 0 |
todo/renderers/render_output_with_textwrap.py | tomasdanjonsson/td-cli | 154 | 3302592 | import textwrap
from todo.utils import get_terminal_size
from .base import Render
class RenderOutputWithTextwrap(Render):
def __init__(self, prefix, text_to_wrap):
self.prefix = prefix
self.text_to_wrap = text_to_wrap
def render(self, **kwargs):
kwargs.setdefault("subsequent_indent"... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/utils/voc_eval.py | giladsharir/MNC-1 | 544 | 3302613 | # --------------------------------------------------------
# Multitask Network Cascade
# Modified from py-faster-rcnn (https://github.com/rbgirshick/py-faster-rcnn)
# Copyright (c) 2016, <NAME>
# Licensed under The MIT License [see LICENSE for details]
# --------------------------------------------------------
import ... | 0 | 0 | 0 | 0 | 0 | 0 |
torch2coreml/_layers.py | jookovjook/torch2coreml | 391 | 3302616 | from _utils import _gen_layer_name, _torch_typename
def _convert_sequential(builder, name, layer, input_names, output_names) -> object:
layers = layer.modules
n = len(layers)
inputs = input_names
for i in range(n):
l_ = layers[i]
l_outputs = None
l_name = _gen_layer_name(l_)
... | 0 | 28 | 0 | 0 | 28 | 0 |
src/monitors/checks/docker-container-running/__init__.py | anderson-attilio/runbook | 155 | 3302621 | from __future__ import annotations
from fabric.api import hide, run, env
import time
import json
def run_cmd(cmd) -> object:
with hide('output', 'running', 'warnings'):
return run(cmd, timeout=1200)
def check(**kwargs) -> bool | None:
''' Login over SSH and execute shell command '''
jdata = kwargs... | 0 | 2 | 0 | 0 | 2 | 0 |
napari/_vispy/_tests/test_vispy_shapes_layer.py | MaksHess/napari | 1,345 | 3302630 | <reponame>MaksHess/napari<gh_stars>1000+
import numpy as np
from napari._vispy.layers.shapes import VispyShapesLayer
from napari.layers import Shapes
def test_remove_selected_with_derived_text():
"""See https://github.com/napari/napari/issues/3504"""
shapes = np.random.rand(3, 4, 2)
properties = {'class'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/providers/test_credit_card.py | mgorny/faker | 12,077 | 3302634 | import re
from typing import Pattern
from faker.providers.bank.ru_RU import Provider as RuRuBankProvider
from faker.providers.credit_card import Provider as CreditCardProvider
class TestCreditCardProvider:
"""Test credit card provider methods"""
mastercard_pattern: Pattern = re.compile(
r'(?:5[1-5][... | 0 | 0 | 14 | 0 | 14 | 0 |
api_tests/metrics/test_composite_query.py | gaybro8777/osf.io | 628 | 3302668 | import time
import pytest
from datetime import datetime
from osf_tests.factories import (
PreprintFactory,
AuthUserFactory
)
from osf.metrics import PreprintDownload
from api.base.settings import API_PRIVATE_BASE as API_BASE
@pytest.fixture()
def preprint() -> object:
return PreprintFactory()
@pytest.f... | 0 | 3 | 0 | 0 | 3 | 0 |
ivy/compiler/graph.py | ashok-arjun/ivy | 161 | 3302709 | <reponame>ashok-arjun/ivy<filename>ivy/compiler/graph.py
# global
import os
import ivy
import sys
try:
# noinspection PyPackageRequirements
import cv2
except ModuleNotFoundError:
cv2 = None
import time
import copy
import random
import logging
import inspect
import numpy as np
try:
# noinspection PyPacka... | 0 | 0 | 0 | 0 | 0 | 0 |
optimizer/penkit_optimize/visualize.py | shab-bahmanyar/penkit | 122 | 3302777 | import colorsys
import svgpathtools
def generate_color(hue, saturation: float=1.0, value: float=1.0) -> object:
rgb = colorsys.hsv_to_rgb(hue, saturation, value)
return "rgb({},{},{})".format(*[int(x * 255) for x in rgb])
def visualize_pen_transits(paths, svg_file):
# We will construct a new image by s... | 2 | 1 | 0 | 0 | 3 | 0 |
tests/providers/google/cloud/transfers/test_local_to_gcs.py | ChaseKnowlden/airflow | 15,947 | 3302778 | <gh_stars>1000+
#
# 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
# "Licens... | 0 | 0 | 0 | 0 | 0 | 0 |
kino/notifier/scheduler.py | DongjunLee/kino-bot | 109 | 3302805 | <reponame>DongjunLee/kino-bot<filename>kino/notifier/scheduler.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
import json
import random
from .skill_list import SkillList
from .between import Between
from ..functions import RegisteredFuctions
from ..slack.resource import MsgResource
from ..slack.slackbot import Slack... | 0 | 0 | 0 | 0 | 0 | 0 |
src/olympia/bandwagon/migrations/0002_delete_featuredcollection.py | shashwatsingh/addons-server | 843 | 3302823 | <gh_stars>100-1000
# Generated by Django 2.2.13 on 2020-06-25 11:39
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('bandwagon', '0001_initial'),
]
operations = [
migrations.DeleteModel(
name='FeaturedCollection',
),
]
| 0 | 0 | 0 | 0 | 0 | 0 |
release/stubs.min/Autodesk/Revit/DB/__init___parts/DWFExportOptions.py | htlcnn/ironpython-stubs | 182 | 3302838 | <filename>release/stubs.min/Autodesk/Revit/DB/__init___parts/DWFExportOptions.py
class DWFExportOptions(CADExportOptions):
"""
DWF Export options.
DWFExportOptions()
"""
CropBoxVisible=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Whether to export crop box.
Get: Cro... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/neopixel_pixel.py | bfYSKUY/Adafruit_CircuitPython_NeoPixel | 232 | 3302845 | <reponame>bfYSKUY/Adafruit_CircuitPython_NeoPixel
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
# This example shows how to create a single pixel with a specific color channel
# order and blink it.
# Most NeoPixels = neopixel.GRB or neopixel.GRBW
# The 8mm Diffused NeoPi... | 0 | 0 | 0 | 0 | 0 | 0 |
mycroft/util/download.py | PureTryOut/mycroft-core | 6,099 | 3302849 | <filename>mycroft/util/download.py
# Copyright 2017 Mycroft AI 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 ap... | 0 | 0 | 0 | 0 | 0 | 0 |
spec/bin/argv.py | bb010g/oil | 2,209 | 3302871 | <gh_stars>1000+
#!/usr/bin/env python
from __future__ import print_function
import sys
print(sys.argv[1:])
| 0 | 0 | 0 | 0 | 0 | 0 |
RecoEgamma/EgammaIsolationAlgos/python/egmPhotonIsolationPUPPI_cff.py | Purva-Chaudhari/cmssw | 852 | 3302885 | <reponame>Purva-Chaudhari/cmssw
import FWCore.ParameterSet.Config as cms
import PhysicsTools.IsolationAlgos.CITKPFIsolationSumProducerForPUPPI_cfi as _mod
IsoConeDefinitions = cms.VPSet(cms.PSet( isolationAlgo = cms.string('PhotonPFIsolationWithMapBasedVeto'),
coneSize = cms.doubl... | 0 | 0 | 0 | 0 | 0 | 0 |
app/grandchallenge/profiles/serializers.py | kaczmarj/grand-challenge.org | 101 | 3302897 | <reponame>kaczmarj/grand-challenge.org<filename>app/grandchallenge/profiles/serializers.py
from django_countries.serializer_fields import CountryField
from rest_framework import serializers
from rest_framework.fields import URLField
from grandchallenge.evaluation.serializers import UserSerializer
from grandchallenge.p... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/Reflection/Traceback.py | piovezan/SOpt | 148 | 3302912 | def a() -> object:
i = 0
j = b(i)
return j
def b(z) -> object:
k = 5
if z == 0:
c()
return k / z
def c():
error()
a()
#https://pt.stackoverflow.com/q/163630/101
| 0 | 2 | 0 | 0 | 2 | 0 |
mit_semseg/models/pytorch_refinenet/refinenet/refinenet_4cascade.py | jaytoone/Indoor_Segmentation | 166 | 3302931 | <reponame>jaytoone/Indoor_Segmentation
import torch.nn as nn
import torchvision.models as models
from ..blocks import (RefineNetBlock, ResidualConvUnit,
RefineNetBlockImprovedPooling)
class BaseRefineNet4Cascade(nn.Module):
def __init__(self,
input_shape,
r... | 0 | 0 | 0 | 0 | 0 | 0 |
src_backend_python/tabloo/__init__.py | bluenote10/dfdash | 122 | 3302964 | from .tabloo import (
show, embedHTML,
) | 0 | 0 | 0 | 0 | 0 | 0 |
tests/utils/test_io_utils.py | Prithwijit-Chak/simpeg | 358 | 3302970 | from __future__ import print_function
import unittest
import numpy as np
from SimPEG.data import Data
from SimPEG.potential_fields import gravity, magnetics
from SimPEG.electromagnetics.static import resistivity as dc
from SimPEG.utils.io_utils import (
write_grav3d_ubc,
read_grav3d_ubc,
write_gg3d_ubc,
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/upload.py | Bakkom/micropython | 594 | 3303017 | <filename>tools/upload.py
#!/usr/bin/env python
"""
This module allows files to loaded onto the Micro:Bit without
flashing the device.
Example usage:
$ ./tools/upload.py /dev/ttyACM0 ./examples/simple_slalom.py --name main.py
Will upload the simple_slalom game into main.py
"""
import sys
import pyboard
PY2 = sy... | 0 | 0 | 0 | 0 | 0 | 0 |
software/contrib/diagnostic.py | mjaskula/EuroPi | 104 | 3303025 | <gh_stars>100-1000
from machine import ADC
from time import sleep
from europi import OLED_HEIGHT, OLED_WIDTH, ain, b1, b2, cv1, cv2, cv3, cv4, cv5, cv6, din, k1, k2, oled
from europi_script import EuroPiScript
"""
A diagnostic utility intended to help prove out a new EuroPi build and calibration. Each aspect of the E... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/tool_shed/test/functional/test_0080_advanced_circular_dependencies.py | rhpvorderman/galaxy | 1,085 | 3303026 | <gh_stars>1000+
from ..base.twilltestcase import common, ShedTwillTestCase
column_repository_name = 'column_maker_0080'
column_repository_description = "Add column"
column_repository_long_description = "Compute an expression on every row"
convert_repository_name = 'convert_chars_0080'
convert_repository_description =... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/integration_tests/db_engine_specs/oracle_tests.py | delorenzosoftware/superset | 18,621 | 3303033 | <gh_stars>1000+
# 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"... | 0 | 0 | 0 | 0 | 0 | 0 |
cycada/tools/test_task_net.py | peterzcc/cycada_release | 532 | 3303049 | <reponame>peterzcc/cycada_release
from __future__ import print_function
from os.path import join
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import numpy as np
import os
i... | 0 | 0 | 0 | 0 | 0 | 0 |
python_code/dictinfo.py | eleweek/inside_python_dict | 124 | 3303057 | <reponame>eleweek/inside_python_dict
import sys
def dump_py_dict(d):
vi = sys.version_info
if vi.major != 3:
raise Exception("Unsupported major version")
if vi.minor < 2:
raise Exception("Unsupported minor version (too old)")
if vi.minor > 3:
raise Exception("Unsupported mino... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/stop_experiment.py | ilblackdragon/studio | 397 | 3303085 | import time
from studio import logs
logger = logs.get_logger('helloworld')
logger.setLevel(10)
i = 0
while True:
logger.info('{} seconds passed '.format(i))
time.sleep(1)
i += 1
| 0 | 0 | 0 | 0 | 0 | 0 |
PythonVirtEnv/Lib/site-packages/plotly/express/_imshow.py | zuhorski/EPL_Project | 11,750 | 3303109 | import plotly.graph_objs as go
from _plotly_utils.basevalidators import ColorscaleValidator
from ._core import apply_default_cascade, init_figure, configure_animation_controls
from .imshow_utils import rescale_intensity, _integer_ranges, _integer_types
import pandas as pd
import numpy as np
import itertools
from plotly... | 0 | 0 | 0 | 0 | 0 | 1 |
lib/webob_0_9/webob/multidict.py | MiCHiLU/google_appengine_sdk | 790 | 3303136 | <reponame>MiCHiLU/google_appengine_sdk
# (c) 2005 <NAME> and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Gives a multi-value dictionary object (MultiDict) plus several wrappers
"""
import cgi
import copy
import sys
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
pysymoro/tests/check_dynmodel.py | songhongxiang/symoro | 109 | 3303141 | <reponame>songhongxiang/symoro
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import math
import random
import unittest
from sympy import var
from symoroutils import tools
from pysymoro.robotf import FloatingRobot as Robot
def planar2r():
robo = Robot('planar2r', 2, 2, 3, False, tools.SIMPLE)
# update geom... | 0 | 0 | 0 | 0 | 0 | 0 |
factorize_a_city/libs/spade.py | deepneuralmachine/google-research | 23,901 | 3303173 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 3 | 2 | 0 | 0 | 5 | 0 |
office365/sharepoint/tenant/administration/site_creation_default_storage_quota.py | wreiner/Office365-REST-Python-Client | 544 | 3303182 | from office365.runtime.client_value import ClientValue
class SiteCreationDefaultStorageQuota(ClientValue):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
uplink/auth.py | kamalgill/uplink | 918 | 3303191 | from __future__ import annotations
"""This module implements the auth layer."""
# Standard library imports
from collections import abc
# Third-party imports
from requests import auth
# Local imports
from uplink import utils
__all__ = [
"ApiTokenParam",
"ApiTokenHeader",
"BasicAuth",
"ProxyAuth",
... | 2 | 5 | 6 | 0 | 13 | 0 |
test/core/028-dynamic-hierarchy/generate_inner_sleep_workflow.py | ahnitz/pegasus | 127 | 3303210 | <reponame>ahnitz/pegasus
#!/usr/bin/env python3
from Pegasus.api import *
# --- Workflow -----------------------------------------------------------------
wf = Workflow("sleep-wf")
sleep_1 = Job("sleep").add_args(2)
sleep_2 = Job("sleep").add_args(2)
wf.add_jobs(sleep_1, sleep_2)
wf.add_dependency(job=sleep_1, chil... | 0 | 0 | 0 | 0 | 0 | 0 |
bark/world/tests/evaluation/py_evaluator_ltl_tests.py | RdecKa/bark | 174 | 3303223 | <gh_stars>100-1000
import unittest
from bark.core.world import *
from bark.core.world.evaluation.ltl import *
from bark.runtime.commons.parameters import ParameterServer
from bark.runtime.scenario.scenario_generation.deterministic import DeterministicScenarioGeneration
class EvaluatorLTLTests(unittest.TestCase):
... | 0 | 0 | 0 | 0 | 0 | 0 |
v3/as_drivers/as_GPS/baud.py | Dilepa/micropython-async | 443 | 3303267 | <filename>v3/as_drivers/as_GPS/baud.py
# baud.py Test uasyncio at high baudrate
import pyb
import uasyncio as asyncio
import utime
import as_drivers.as_rwGPS as as_rwGPS
# Outcome
# Sleep Buffer
# 0 None OK, length limit 74
# 10 None Bad: length 111 also short weird RMC sentences
# 10 1000 OK, length... | 0 | 0 | 0 | 0 | 0 | 0 |
jcvi/utils/validator.py | paradoxcell/jcvi | 517 | 3303273 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Simple validator to make sure certain values match expectation.
"""
from typing import Collection, Union, TypeVar
ComparableType = Union[int, float]
T = TypeVar("T")
class ValidationError(Exception):
pass
def validate_in_choices(value: T, choices: Collection[... | 7 | 2 | 0 | 0 | 9 | 0 |
AFLW/fddb_symbol_vgg16.py | kli-nlpr/FaceDetection-ConvNet-3D | 159 | 3303275 | import mxnet as mx
def get_vgg16_rpn() -> object:
data = mx.symbol.Variable(name="data")
mean_face = mx.symbol.Variable(name="mean_face")
# confidence map
cls_label = mx.symbol.Variable(name="cls_label")
# projection regression
proj_weight = mx.symbol.Variable(name="proj_weight")
proj_l... | 0 | 1 | 0 | 0 | 1 | 0 |
https/run.py | alexey-v-paramonov/webcaster | 117 | 3303295 | import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('localhost', 8000), SimpleHTTPServer.SimpleHTTPRequestHandler)
httpd.socket = ssl.wrap_socket (httpd.socket, certfile='./https/server.crt', keyfile='./https/server.key', server_side=True)
httpd.serve_forever()
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/parsers/dpkg.py | roshanmaskey/plaso | 1,253 | 3303297 | <gh_stars>1000+
#!/usr/bin/env python3
# -*_ coding: utf-8 -*-
"""Tests for the dpkg.Log parser."""
import unittest
from plaso.parsers import dpkg
from tests.parsers import test_lib
class DpkgParserTest(test_lib.ParserTestCase):
"""Tests for the Dpkg Log parser."""
def testParse(self):
"""Tests for the Pa... | 0 | 0 | 0 | 0 | 0 | 0 |
api/src/opentrons/drivers/smoothie_drivers/errors.py | anuwrag/opentrons | 235 | 3303298 | <reponame>anuwrag/opentrons<filename>api/src/opentrons/drivers/smoothie_drivers/errors.py
from typing import Optional
class SmoothieError(Exception):
def __init__(
self, ret_code: Optional[str] = None, command: Optional[str] = None
) -> None:
self.ret_code = ret_code or ""
self.command... | 0 | 0 | 0 | 0 | 0 | 0 |
rls/algorithms/single/rainbow.py | StepNeverStop/RLs | 371 | 3303339 | <reponame>StepNeverStop/RLs
#!/usr/bin/env python3
# encoding: utf-8
import numpy as np
import torch as th
import torch.nn.functional as F
from rls.algorithms.base.sarl_off_policy import SarlOffPolicy
from rls.common.data import Data
from rls.common.decorator import iton
from rls.nn.models import RainbowDue... | 0 | 0 | 0 | 0 | 0 | 0 |
ciphey/basemods/Searchers/perfection.py | AlexandruValeanu/Ciphey | 9,908 | 3303345 | from typing import Dict, Optional, Set
from ciphey.iface import Config, ParamSpec, registry
from .ausearch import AuSearch, Node
@registry.register
class Perfection(AuSearch):
@staticmethod
def getParams() -> Optional[Dict[str, ParamSpec]]:
return None
def findBestNode(self, nodes: Set[Node]) -... | 2 | 2 | 0 | 0 | 4 | 0 |
flowers/trainer/model.py | VanessaDo/cloudml-samples | 1,552 | 3303368 | # Copyright 2016 Google 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 by applicable law or ... | 1 | 12 | 3 | 8 | 24 | 0 |
tests/matrix_conv2d_conv2d/test_matrix_conv2d_conv2d_int8_1x1_stride1_1x1_stride1_par_ich4_par_och4.py | RyusukeYamano/nngen | 207 | 3303369 | <filename>tests/matrix_conv2d_conv2d/test_matrix_conv2d_conv2d_int8_1x1_stride1_1x1_stride1_par_ich4_par_och4.py
from __future__ import absolute_import
from __future__ import print_function
import os
import sys
# the next line can be removed after installation
sys.path.insert(0, os.path.dirname(os.path.dirname(
o... | 0 | 0 | 0 | 0 | 0 | 0 |
learn_to_paint/colormixer.py | aurelio-amerio/pic2grid | 358 | 3303389 | from __future__ import annotations
import numpy as np
color1 = np.array([19,163,255.])
color2 = np.array([19,18,37.])
color3 = np.array([52,2,1.])
color4 = np.array([.95,.95,.95])
color5 = np.array([.5,.15,.4])
color1/=255.
color2/=255.
color3/=255.
def clip(i,imax: int=1,imin: int=0) -> object:
return min(max(... | 2 | 14 | 0 | 0 | 16 | 0 |
基础教程/A2-神经网络基本原理/第8步 - 卷积神经网络/src/ch17-CNNBasic/Level2_Numba_Test.py | microsoft/ai-edu | 11,094 | 3303399 | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
import numpy
import numba
import time
from MiniFramework.ConvWeightsBias import *
from MiniFramework.ConvLayer import *
def conv_4d(x, weights, bias, out_h, out_w, stri... | 3 | 3 | 0 | 0 | 6 | 0 |
pyro/infer/autoguide/effect.py | tianjuchen/pyro | 4,959 | 3303427 | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations
from typing import Callable, Optional, Tuple, Union
import torch
from torch.distributions import biject_to, constraints
import pyro.distributions as dist
from pyro.distributions.distribution import ... | 30 | 13 | 1 | 2 | 46 | 0 |
allennlp_semparse/common/__init__.py | nitishgupta/allennlp-semparse | 105 | 3303430 | <reponame>nitishgupta/allennlp-semparse
from allennlp_semparse.common.date import Date
from allennlp_semparse.common.errors import ParsingError, ExecutionError
from allennlp_semparse.common.util import (
NUMBER_CHARACTERS,
MONTH_NUMBERS,
ORDER_OF_MAGNITUDE_WORDS,
NUMBER_WORDS,
)
| 0 | 0 | 0 | 0 | 0 | 0 |
nxt_editor/dockwidgets/hotkey_editor.py | Mikfr83/nxt_editor | 131 | 3303442 | <filename>nxt_editor/dockwidgets/hotkey_editor.py
# Built-in
import logging
# External
from Qt import QtWidgets, QtGui, QtCore
# Internal
import nxt_editor
from nxt_editor.dockwidgets.dock_widget_base import DockWidgetBase
from nxt_editor import colors, dialogs
logger = logging.getLogger(nxt_editor.LOGGER_NAME)
TOOL... | 0 | 0 | 0 | 0 | 0 | 0 |
datasets/disfl_qa/disfl_qa.py | zidingz/datasets | 10,608 | 3303443 | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 1 | 3 | 0 | 0 | 4 | 0 |
gateware/encoder/__init__.py | auscompgeek/litex-buildenv | 198 | 3303467 | <gh_stars>100-1000
from gateware.encoder.core import EncoderDMAReader, EncoderBuffer, Encoder
| 0 | 0 | 0 | 0 | 0 | 0 |
synapse/lib/platforms/windows.py | larrycameron80/synapse | 216 | 3303471 | import ctypes
import socket
import logging
logger = logging.getLogger(__name__)
class sockaddr(ctypes.Structure):
_fields_: list[tuple[str, object]] = [
("sa_family", ctypes.c_short),
("_p1", ctypes.c_ushort),
("ipv4", ctypes.c_byte * 4),
("ipv6", ctypes.c_byte * 16),
("_p2... | 0 | 4 | 1 | 0 | 5 | 0 |
h/streamer/filter.py | pombredanne/h | 2,103 | 3303510 | <reponame>pombredanne/h<gh_stars>1000+
from h import storage
from h.util.uri import normalize as normalize_uri
FILTER_SCHEMA = {
"type": "object",
"properties": {
# Ignored, but kept here for backwards compatibility.
"match_policy": {"type": "string", "enum": ["include_any"]},
# Ignored... | 0 | 0 | 0 | 0 | 0 | 0 |
data/points/generator/aurelien_alvarez_surfaces_in_R8.py | jmarino/gudhi-devel | 146 | 3303533 | <gh_stars>100-1000
#!/usr/bin/env python
import numpy as np
import random
from math import factorial
"""This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
Author(s): <NAME>
... | 0 | 0 | 0 | 0 | 0 | 0 |
controllers/category.py | wdw139130/wechat-mall | 108 | 3303550 | # -*- coding: utf-8 -*-
import json
from odoo import http
from odoo.http import request
from .. import defs
from .error_code import error_code
import logging
_logger = logging.getLogger(__name__)
class AllCategory(http.Controller):
@http.route('/<string:sub_domain>/shop/goods/category/all', auth='public', m... | 0 | 1 | 0 | 0 | 1 | 0 |
examples/bert/config_classifier.py | GingerBear/texar | 2,325 | 3303567 | <filename>examples/bert/config_classifier.py
hidden_dim = 768
opt = {
'optimizer': {
'type': 'AdamWeightDecayOptimizer',
'kwargs': {
'weight_decay_rate': 0.01,
'beta_1': 0.9,
'beta_2': 0.999,
'epsilon': 1e-6,
'exclude_from_weight_decay': [... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/psptools/psptool/pbp.py | DaveeFTW/infinity | 137 | 3303571 | <gh_stars>100-1000
import struct
PBP_HEADER_MAGIC = 0x50425000
def is_pbp(data):
return struct.unpack('<I', data[:0x4])[0] == PBP_HEADER_MAGIC
class PBP:
def __init__(self, data):
(self.magic, self.version, sfo_offset, icon0_offset,
icon1_offset, pic0_offset, pic1_offset,
snd0_off... | 0 | 0 | 0 | 0 | 0 | 0 |
spimagine/config/config.py | funkelab/spimagine | 116 | 3303574 | from __future__ import absolute_import
from __future__ import print_function
import logging
logger = logging.getLogger(__name__)
import os
from .myconfigparser import MyConfigParser
from .loadcolormaps import loadcolormaps
from gputools import init_device
__CONFIGFILE__ = os.path.expanduser("~/.spimagine")
config... | 0 | 2 | 0 | 0 | 2 | 0 |
code/DeepDG/datautil/imgdata/util.py | changliu00/transferlearning | 9,657 | 3303580 | # coding=utf-8
from torchvision import transforms
from PIL import Image, ImageFile
ImageFile.LOAD_TRUNCATED_IMAGES = True
def image_train(dataset, resize_size: int=256, crop_size: int=224) -> object:
if dataset == 'dg5':
return transforms.Compose([
transforms.Resize(32),
transforms... | 4 | 4 | 0 | 0 | 8 | 0 |
samples/sample_macho.py | Gilnaa/filebytes | 123 | 3303589 | #!/usr/bin/env python
from __future__ import print_function
from filebytes.mach_o import *
def print_header_information(macho_file):
mach_header = macho_file.machHeader.header
print('Header:')
print('CPU Type:', CpuType[mach_header.cputype])
print('Number of Commands:', mach_header.ncmds)
print()
... | 0 | 1 | 0 | 0 | 1 | 0 |
fastapi_admin/routes/__init__.py | myWorkshop123/fastapi-admin | 636 | 3303604 | <gh_stars>100-1000
from fastapi import APIRouter, Depends
from fastapi_admin.depends import get_current_admin
from .resources import router as resources_router
router = APIRouter()
router.include_router(resources_router, dependencies=[Depends(get_current_admin)])
| 0 | 0 | 0 | 0 | 0 | 0 |
tfimm/layers/drop.py | hyenal/tensorflow-image-models | 154 | 3303620 | <gh_stars>100-1000
"""
Implementations of various drop layers. For now only DropPath (stochastic depth).
Copyright 2021 <NAME>
Copyright 2020 <NAME>
"""
import tensorflow as tf
class DropPath(tf.keras.layers.Layer):
"""
Per sample stochastic depth when applied in main path of residual blocks
This is the... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/option_orders_unroll.py | LivingTrades83/fast_arrow | 143 | 3303654 | import configparser
import json
from fast_arrow import Client, OptionOrder
print("----- running {}".format(__file__))
config = configparser.ConfigParser()
config.read('config.debug.ini')
#
# get auth_data (see https://github.com/westonplatter/fast_arrow_auth)
#
with open("fast_arrow_auth.json") as f:
auth_dat... | 0 | 0 | 0 | 0 | 0 | 0 |
scale/scheduler/test/database/test_updater.py | kaydoh/scale | 121 | 3303677 | from __future__ import unicode_literals
import copy
from datetime import timedelta
import django
from django.test import TestCase
from django.utils.timezone import now
from batch.definition.definition import BatchDefinition
from batch.test import utils as batch_test_utils
from batch.models import Batch
from job.mode... | 0 | 0 | 1 | 0 | 1 | 0 |
common/src/stack/command/stack/commands/load/plugin_host.py | sammeidinger/stack | 123 | 3303679 | # @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import stack.commands
class Plugin(stack.commands.Plugin):
def provides(self) -> str:
return 'host'
def requires(self) -> list[str]:
r... | 0 | 2 | 0 | 0 | 2 | 0 |
ceilometer/hacking/checks.py | ionutbiru/ceilometer | 239 | 3303729 | # Copyright (c) 2016 OpenStack Foundation
# 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 app... | 0 | 0 | 0 | 0 | 0 | 0 |
src/py2.x/algorithm/algo1.py | BinLeeBit/AILearners | 350 | 3303742 | <gh_stars>100-1000
'''
This code is written by bidongqinxian
'''
def bubble_sort(lst):
for i in range(len(lst)):
for j in range(i+1,len(lst)):
if lst[i] > lst[j]:
lst[i], lst[j] = lst[j], lst[i]
return lst
| 0 | 0 | 0 | 0 | 0 | 0 |
SimGeneral/MixingModule/python/mixCosmics_cfi.py | ckamtsikis/cmssw | 852 | 3303743 | import FWCore.ParameterSet.Config as cms
# this is a minimum configuration of the Mixing module,
# to run it in the zero-pileup mode
#
from SimGeneral.MixingModule.mixObjects_cfi import theMixObjects
from SimGeneral.MixingModule.mixPoolSource_cfi import *
from SimGeneral.MixingModule.digitizersCosmics_cfi import *
mi... | 0 | 0 | 0 | 0 | 0 | 0 |
pyscript/torch/modules/pooling.py | takuto0831/Competition-utils | 105 | 3303778 | from __future__ import annotations
import torch
from torch import nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
class AdaptiveConcatPool2d(nn.Module):
def __init__(self, sz: object | None=None):
super().__init__()
sz = sz or (1, 1)
self.ap = nn.AdaptiveAvgPool... | 6 | 5 | 0 | 0 | 11 | 0 |
scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py | timgates42/trex-core | 956 | 3303822 | import argparse
import stf_path
from trex_stf_lib.trex_client import CTRexClient
from pprint import pprint
import csv
import math
# sample TRex stateful to chnage active-flows and get results
def minimal_stateful_test(server,csv_file,a_active_flows):
trex_client = CTRexClient(server)
trex_client.start_tre... | 0 | 0 | 0 | 0 | 0 | 0 |
models/basic_model.py | kailas-rathod/Retinet | 195 | 3303835 | <reponame>kailas-rathod/Retinet<filename>models/basic_model.py
import os
import numpy as np
import pandas as p
import theano.tensor as T
import lasagne as nn
from lasagne.layers import dnn
from lasagne.nonlinearities import LeakyRectify
from layers import ApplyNonlinearity
from utils import (oversample_set,
... | 0 | 0 | 0 | 0 | 0 | 0 |
o365spray/core/handlers/enumerator.py | hackedbyagirl/o365spray | 341 | 3303840 | <filename>o365spray/core/handlers/enumerator.py<gh_stars>100-1000
#!/usr/bin/env python3
"""
Based on: https://bitbucket.org/grimhacker/office365userenum/
https://github.com/Raikia/UhOh365
https://github.com/nyxgeek/onedrive_user_enum/blob/master/onedrive_enum.py
https://github.com/gremwe... | 0 | 0 | 0 | 0 | 0 | 0 |
Tests/Functional/xctest_checker/tests/test_compare.py | AtariDreams/swift-corelibs-xctest | 1,108 | 3303884 | <gh_stars>1000+
# test_compare.py - Unit tests for xctest_checker.compare -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/L... | 0 | 0 | 0 | 0 | 0 | 0 |
web.py | bit-wanderer/transliteration | 124 | 3303935 | <filename>web.py
import os
import tensorflow as tf
import numpy as np
import data_utils
from translate import Transliteration
from flask import Flask, request, render_template, jsonify
app = Flask(__name__)
transliteration = Transliteration()
@app.route("/", methods=['GET'])
def main():
return render_template('inde... | 0 | 0 | 0 | 0 | 0 | 0 |
xmnlp/sentiment/__init__.py | dumpmemory/xmnlp | 860 | 3303964 | # -*- coding: utf-8 -*-
# -------------------------------------------#
# author: <NAME> #
# email: <EMAIL> #
# -------------------------------------------#
import os
import threading
from typing import Tuple
from xmnlp import config
from xmnlp.sentiment.sentiment_model imp... | 2 | 2 | 0 | 0 | 4 | 0 |
samples/model-builder/automl_image_classification_training_job_sample.py | dizcology/python-aiplatform | 180 | 3303971 | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 4 | 1 | 0 | 0 | 5 | 0 |
taskwiki/short.py | PtitCaius/taskwiki | 465 | 3303984 | from __future__ import annotations
import six
class ShortUUID(object):
def __init__(self, value, tw):
# Extract the UUID from the given object. Support both
# strings and ShortUUID instances.
if isinstance(value, six.string_types):
# Use str reprentation of the value, first 8 ch... | 0 | 4 | 0 | 0 | 4 | 0 |
tools/web_dev_style/test_util.py | zealoussnow/chromium | 14,668 | 3303992 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
def GetHighlight(line, error) -> object:
"""Returns the substring of |line| that is highlighted in |error|."""
error_lines = error.split('\n')
# TODO(... | 0 | 1 | 0 | 0 | 1 | 0 |
libsaas/services/twilio/calls.py | MidtownFellowship/libsaas | 155 | 3303995 | from __future__ import annotations
from libsaas import http, parsers
from libsaas.services import base
from libsaas.services.twilio import resource, notifications, recordings
class CallsBase(resource.TwilioResource):
path: str = 'Calls'
def delete(self, *args, **kwargs):
raise base.MethodNotSupport... | 10 | 3 | 1 | 0 | 14 | 0 |
alipay/aop/api/response/AlipayFinancialnetAuthPbcQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 3304001 | <reponame>antopen/alipay-sdk-python-all
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayFinancialnetAuthPbcQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayFinancialnetAuthPbcQueryResponse, self).__init... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/settings_b.py | meals-app/django-graphql-auth | 290 | 3304006 | <reponame>meals-app/django-graphql-auth
from .settings import *
GRAPHQL_AUTH = {
"ALLOW_DELETE_ACCOUNT": True,
"REGISTER_MUTATION_FIELDS": {"email": "String", "username": "String"},
"UPDATE_MUTATION_FIELDS": ["first_name", "last_name"],
"ALLOW_LOGIN_NOT_VERIFIED": False,
}
INSTALLED_APPS += ["tests"]
... | 0 | 0 | 0 | 0 | 0 | 0 |
test/avr/simavr_env.py | forksnd/libdivide | 758 | 3304007 | <reponame>forksnd/libdivide<gh_stars>100-1000
import os
Import('env')
# Dump construction environment
# print(env.Dump())
platform = env.PioPlatform()
simavr = f'{os.path.join(os.path.join(platform.get_package_dir("tool-simavr") or "", "bin"), "simavr.exe")}'
# Single action/command per 1 target
env.AddCustomTarge... | 0 | 0 | 0 | 0 | 0 | 0 |
research/adversarial_logit_pairing/eval.py | 873040/Abhishek | 153 | 3304008 | # Copyright 2018 Google 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 by applicable law or a... | 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.