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 |
|---|---|---|---|---|---|---|---|---|---|---|
pyobjus/__init__.py | meow464/pyobjus | 114 | 1780577 | <reponame>meow464/pyobjus
__version__ = '1.2.0'
from .pyobjus import *
| 0 | 0 | 0 | 0 | 0 | 0 |
indy_common/util.py | Rob-S/indy-node | 627 | 1780623 | <reponame>Rob-S/indy-node
import datetime
import os
import random
from typing import Tuple, Union, TypeVar, List, Callable
import libnacl.secret
from base58 import b58decode
from common.serializers.serialization import serialize_msg_for_signing
from plenum.common.types import f
from plenum.common.util import isHex, cr... | 0 | 0 | 0 | 0 | 0 | 0 |
questions/longest-continuous-increasing-subsequence/Solution.py | marcus-aurelianus/leetcode-solutions | 141 | 1780630 | from __future__ import annotations
"""
Given an unsorted array of integers, find the length of longest continuous increasing subsequence (subarray).
Example 1:
Input: [1,3,5,4,7]
Output: 3
Explanation: The longest continuous increasing subsequence is [1,3,5], its length is 3.
Even though [1,3,5,7] is also an increasi... | 0 | 1 | 0 | 0 | 1 | 0 |
chainer_chemistry/models/cwle/__init__.py | pfnet/chainerchem | 184 | 1780707 | <filename>chainer_chemistry/models/cwle/__init__.py
#from chainer_chemistry.models.cwle import cwle
from chainer_chemistry.models.cwle import cwle_graph_conv_model
from chainer_chemistry.models.cwle import cwle_net
#from chainer_chemistry.models.cwle.gwm import GWM
from chainer_chemistry.models.cwle.cwle_graph_conv_mod... | 0 | 0 | 0 | 0 | 0 | 0 |
docker-apiconfig.py | huaAhua/shadowsocks-mod | 257 | 1780709 | <gh_stars>100-1000
import os
# Config
NODE_ID = int(os.getenv('NODE_ID'), '0')
MU_SUFFIX = os.getenv('MU_SUFFIX', 'zhaoj.in')
MU_REGEX = os.getenv('MU_REGEX', '%5m%id.%suffix')
SERVER_PUB_ADDR = os.getenv('SERVER_PUB_ADDR', '127.0.0.1')
API_INTERFACE = os.getenv('API_INTERFACE', 'modwebapi')
WEBAPI_URL = os.getenv(... | 0 | 0 | 0 | 0 | 0 | 0 |
warp/tests/__main__.py | addy1997/warp | 306 | 1780752 | <reponame>addy1997/warp
from . test_all import run
ret = run()
import sys
sys.exit(ret)
| 0 | 0 | 0 | 0 | 0 | 0 |
graspologic/simulations/__init__.py | j1c/graspologic | 148 | 1780773 | <reponame>j1c/graspologic<filename>graspologic/simulations/__init__.py
# Copyright (c) Microsoft Corporation and contributors.
# Licensed under the MIT License.
from .simulations import er_nm, er_np, mmsbm, p_from_latent, rdpg, sample_edges, sbm
from .simulations_corr import er_corr, sample_edges_corr, sbm_corr
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lldbtest_config.py | Polidea/SiriusObfuscator | 427 | 1780792 | <gh_stars>100-1000
"""
The LLVM Compiler Infrastructure
This file is distributed under the University of Illinois Open Source
License. See LICENSE.TXT for details.
Configuration options for lldbtest.py set by dotest.py during initialization
"""
# array of strings
# each string has the name of ... | 0 | 0 | 0 | 0 | 0 | 0 |
det3d/models/readers/dynamic_voxel_encoder.py | xyupeng/CenterPoint | 1,124 | 1780816 | <reponame>xyupeng/CenterPoint
from det3d.core.utils.scatter import scatter_mean
from torch.nn import functional as F
from ..registry import READERS
from torch import nn
import numpy as np
import torch
def voxelization(points, pc_range, voxel_size):
keep = (points[:, 0] >= pc_range[0]) & (points[:, 0] <= pc_ra... | 0 | 0 | 0 | 0 | 0 | 0 |
CondCore/ESSources/test/python/read_KeyList_cfg.py | ckamtsikis/cmssw | 852 | 1780818 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.load("CondCore.DBCommon.CondDBCommon_cfi")
process.CondDBCommon.connect = 'sqlite_file:keys.db'
process.eff = cms.ESSource("PoolDBESSource",
process.CondDBCommon,
DumpStat=cms.untracked.bool(True), ... | 0 | 0 | 0 | 0 | 0 | 0 |
nodes/2.x/python/Element.Location+.py | andydandy74/ClockworkForDynamo | 147 | 1780836 | from __future__ import annotations
import clr
import math
clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
items = UnwrapElement(IN[0])
def GetCurvePoints(curve) -> tuple[object, object]:
return curve.GetEndPoint(... | 0 | 2 | 0 | 0 | 2 | 0 |
recipes/Python/577569_NBD_server_in_python/recipe-577569.py | tdiprima/code | 2,023 | 1780853 | <gh_stars>1000+
#!/usr/bin/python
import struct, socket, sys, time
# Working: nbd protocol, read/write serving up files, error handling, file size detection, in theory, large file support... not really, so_reuseaddr, nonforking
def recvall(sock, length):
rv = []
while sum(map(len, rv)) < length:
rv.append(sock... | 0 | 0 | 0 | 0 | 0 | 0 |
dm_control/locomotion/soccer/humanoid_test.py | h8907283/dm_control | 2,863 | 1780873 | <reponame>h8907283/dm_control
# Copyright 2019 The dm_control 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... | 0 | 0 | 0 | 0 | 0 | 0 |
rdtools/test/energy_from_power_test.py | kperrynrel/rdtools | 107 | 1780885 | <filename>rdtools/test/energy_from_power_test.py
import pandas as pd
import numpy as np
from rdtools import energy_from_power
import pytest
@pytest.fixture
def times():
return pd.date_range(start='20200101 12:00', end='20200101 13:00', freq='15T')
@pytest.fixture
def power(times):
return pd.Series([1.0, 2.0... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/nativehooks.py | codelv/enaml-native | 237 | 1780887 | """ Mock nativehooks for testing purposes
"""
def publish(data):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
config/common/sim/ode_solver.py | leozz37/makani | 1,178 | 1780888 | <filename>config/common/sim/ode_solver.py<gh_stars>1000+
# Copyright 2020 Makani Technologies 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/LICEN... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_bootstrap5/test_themes.py | PanderMusubi/bootstrap-flask | 680 | 1780925 | from flask import current_app
import pytest
from tests.test_bootstrap4.test_themes import themes
bootstrap5_themes = themes + [
'morph',
'quartz',
'vapor',
'zephyr',
]
@pytest.mark.parametrize('theme', bootstrap5_themes)
def test_bootswatch_local(theme, client):
current_app.config['BOOTSTRAP_SER... | 0 | 0 | 0 | 0 | 0 | 0 |
src/alexapi/device_platforms/desktopplatform.py | amudhan22/AlexaPI | 1,466 | 1780957 | from __future__ import annotations
import time
import threading
import logging
import sys
from .baseplatform import BasePlatform
logger = logging.getLogger(__name__)
class DesktopPlatform(BasePlatform):
def __init__(self, config):
super(DesktopPlatform, self).__init__(config, 'desktop')
self.trigger_thread: ... | 4 | 1 | 0 | 3 | 8 | 0 |
tests/torch/test_onnx_export.py | GreenWaves-Technologies/nncf | 136 | 1780987 | <filename>tests/torch/test_onnx_export.py
import pytest
from typing import Any
import torch
import onnx
from nncf import NNCFConfig
from nncf.torch.exporter import PTExporter
from tests.torch.helpers import MockModel
from tests.torch.helpers import create_compressed_model_and_algo_for_test
from tests.torch.helpers imp... | 0 | 0 | 0 | 0 | 0 | 0 |
blockade/tests/test_integration_rest.py | qizhong19920114/blockade | 497 | 1781002 | #
# Copyright (C) 2016 Dell, 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 law or agreed to in wri... | 0 | 4 | 2 | 0 | 6 | 0 |
tf_quant_finance/math/qmc/sobol.py | slowy07/tf-quant-finance | 3,138 | 1781008 | # Lint as: python3
# 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 agr... | 22 | 6 | 0 | 0 | 28 | 0 |
src/django-nonrel/tests/regressiontests/urlpatterns_reverse/named_urls.py | adamjmcgrath/glancydesign | 790 | 1781026 | from django.conf.urls.defaults import *
from views import empty_view
urlpatterns = patterns('',
url(r'^$', empty_view, name="named-url1"),
url(r'^extra/(?P<extra>\w+)/$', empty_view, name="named-url2"),
url(r'^(?P<one>\d+)|(?P<two>\d+)/$', empty_view),
(r'^included/', include('regressiontests.urlpatter... | 0 | 0 | 0 | 0 | 0 | 0 |
rllib/examples/env/look_and_push.py | firebolt55439/ray | 21,382 | 1781031 | <filename>rllib/examples/env/look_and_push.py
import gym
import numpy as np
class LookAndPush(gym.Env):
"""Memory-requiring Env: Best sequence of actions depends on prev. states.
Optimal behavior:
0) a=0 -> observe next state (s'), which is the "hidden" state.
If a=1 here, the hidden stat... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/test2.py | ShenLeixian/data2vis | 103 | 1781050 | import pandas as pd
import numpy as np
import data_utils as utils
values = [{
"age": "18",
"education": "1. < HS Grad",
"health": "1. <=Good",
"health_ins": "2. No",
"jobclass": "1. Industrial",
"logwage": "4.31806333496276",
"maritl": "1. Never Married",
"race": "1. White",
"region... | 0 | 0 | 0 | 0 | 0 | 0 |
wechat_django/sites/wechat/__init__.py | UltraVacuum/wechat-django | 166 | 1781056 | <filename>wechat_django/sites/wechat/__init__.py
# -*- coding: utf-8 -*-
# flake8: noqa
from __future__ import unicode_literals
from .base import WeChatView, WeChatViewMixin, wechat_view
from .request import WeChatInfo
from .sites import default_site, WeChatSite
from . import views
| 0 | 0 | 0 | 0 | 0 | 0 |
leet/array/reverse.py | monishshah18/python-cp-cheatsheet | 140 | 1781073 | class Solution:
def rotate(self, nums: List[int], k: int) -> None:
def reverse(l, r, nums):
while l < r:
nums[l], nums[r] = nums[r], nums[l]
l += 1
r -= 1
if len(nums) <= 1: return
k = k % len(nums)
reverse(0, len(nums)-1, n... | 2 | 1 | 0 | 0 | 3 | 0 |
tests/extmod/vfs_fat_mtime.py | sebastien-riou/micropython | 13,648 | 1781102 | # Test for VfsFat using a RAM device, mtime feature
try:
import utime, uos
utime.time
utime.sleep
uos.VfsFat
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
class RAMBlockDevice:
ERASE_BLOCK_SIZE: int = 512
def __init__(self, blocks):
self.data = bytearr... | 0 | 1 | 1 | 0 | 2 | 0 |
modelBuilder.py | DasudaRunner/simplePruning | 127 | 1781104 | #coding:utf-8
'''
author:<NAME>
at: <NAME>.
email: <EMAIL>
!!!
代码中会有少量中文注释,无需在意
'''
import os
import time
import numpy as np
import tensorflow as tf
from datasets import CifarData
class Cifar10ModelBuilder:
def __init__(self,ckpt_path,input_node,is_train_node,output_node):
self.graph = tf.Graph()
... | 0 | 1 | 0 | 0 | 1 | 0 |
example/__init__.py | sandlerben/flask-rq | 165 | 1781117 | <filename>example/__init__.py<gh_stars>100-1000
import os
import sys
sys.path.pop(0)
sys.path.insert(0, os.getcwd())
import time
from flask import Flask
from flask_rq import RQ
app = Flask(__name__)
app.config['RQ_OTHER_HOST'] = 'localhost'
app.config['RQ_OTHER_PORT'] = 6789
app.config['RQ_OTHER_PASSWORD'] = None
a... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/examples/userguide/language_basics/parameter_refcount.py | johannes-mueller/cython | 6,663 | 1781139 | from __future__ import print_function
from cython.cimports.cpython.ref import PyObject
import sys
python_dict = {"abc": 123}
python_dict_refcount = sys.getrefcount(python_dict)
@cython.cfunc
def owned_reference(obj: object):
refcount = sys.getrefcount(python_dict)
print('Inside owned_reference: {refcount}'.... | 2 | 0 | 0 | 0 | 2 | 0 |
doc/autosar4_api/datatype/examples/usage_application_primitive_data_type.py | Warchant/autosar | 199 | 1781141 | <gh_stars>100-1000
import autosar
def setup():
ws = autosar.workspace(version="4.2.2")
package=ws.createPackage('ApplicationTypes', role='DataType')
package.createSubPackage('DataConstrs', role='DataConstraint')
package.createSubPackage('CompuMethods', role='CompuMethod')
package.createSubPa... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/test_labels_mapper.py | MoonBlvd/TFSegmentation | 633 | 1781143 | import os
import numpy as np
x = np.load('xnames_val.npy')
y = []
for i in range(x.shape[0]):
dir_name = ""
under_idx = 0
for j in range(len(x[i])):
if x[i][j] == '_':
under_idx = j
break
dir_name += x[i][j]
dot_idx = 0
for j in range(under_idx, len(x[i])):
... | 0 | 0 | 0 | 0 | 0 | 0 |
megaverse_rl/runs/single_agent.py | DavidSlayback/megaverse | 149 | 1781148 | <filename>megaverse_rl/runs/single_agent.py
from sample_factory.runner.run_description import RunDescription
from megaverse_rl.runs.megaverse_base_experiments import EXPERIMENT_1AGENT
RUN_DESCRIPTION = RunDescription('megaverse_arxiv', experiments=[EXPERIMENT_1AGENT])
| 0 | 0 | 0 | 0 | 0 | 0 |
docs/examples/solar-position/plot_sunpath_diagrams.py | JackKelly/pvlib-python | 695 | 1781149 | <filename>docs/examples/solar-position/plot_sunpath_diagrams.py
"""
Sun path diagram
================
Examples of generating sunpath diagrams.
"""
#%%
# This example shows basic usage of pvlib's solar position calculations with
# :py:meth:`pvlib.solarposition.get_solarposition`. The examples shown here
# will genera... | 0 | 0 | 0 | 0 | 0 | 0 |
check_anagrams.py | deepak5998/Py | 726 | 1781152 | <filename>check_anagrams.py
# Problem: Two strings of sizes m and n are given,
# we have to find how many characters need to be
# removed from both the string so that they become
# anagrams of each other
# Anagrams: Words that are made from rearranging the letters of another word
# Algorithm: We will use dictionaries... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/bench_cifar10.py | hero9968/scikit-neuralnetwork | 1,375 | 1781167 | <reponame>hero9968/scikit-neuralnetwork
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, unicode_literals, print_function)
import sys
import pickle
import numpy as np
PRETRAIN = False
def load(name):
# Pickle module isn't backwards compatible. Hack so it works:
compat = {'encoding': 'latin1... | 0 | 0 | 0 | 0 | 0 | 0 |
src/frontend/lexer.py | ryankaplan/skew | 328 | 1781180 | from __future__ import annotations
import os
import flex
template = '''
################################################################################
#
# This is a generated file, all edits will be lost!
#
################################################################################
namespace Skew {
enum Toke... | 1 | 1 | 0 | 0 | 2 | 0 |
matminer/datasets/tests/test_datasets.py | ncfrey/matminer | 326 | 1781191 | from __future__ import annotations
import unittest
import os
import requests
import numpy as np
from pandas.api.types import is_numeric_dtype, is_object_dtype, is_bool_dtype
from pymatgen.core.structure import Structure, Composition
from matminer.datasets.tests.base import DatasetTest, do_complete_test
from matminer.... | 4 | 0 | 0 | 0 | 4 | 0 |
fhir/resources/tests/test_catalogentry.py | cstoltze/fhir.resources | 144 | 1781194 | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/CatalogEntry
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
from pydantic.validators import bytes_validator # noqa: F401
from .. import fhirtypes # noqa: F401
from .. import catalogentry
de... | 0 | 0 | 0 | 0 | 0 | 0 |
webium/wait.py | kejkz/webium | 152 | 1781206 | from selenium.common.exceptions import WebDriverException
from waiting import wait as wait_lib
import webium.settings
def wait(*args, **kwargs) -> object:
"""
Wrapping 'wait()' method of 'waiting' library with default parameter values.
WebDriverException is ignored in the expected exceptions by default.
... | 0 | 1 | 0 | 0 | 1 | 0 |
eventstore/tests/conftest.py | divyamamgai/integrations-extras | 158 | 1781215 | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import annotations
import os
import pytest
from datadog_checks.dev import docker_run
from .common import HERE, HOST, PORT
@pytest.fixture(scope="session")
def dd_environment(instance):
wi... | 0 | 1 | 0 | 0 | 1 | 0 |
StockAnalysisSystem/ui/Extension/chart_laboratory.py | SleepySoft/StockAnalysisSystem | 138 | 1781255 | import logging
import traceback
import matplotlib as mpl
from os import sys, path
from PyQt5.QtCore import pyqtSignal, QProcess
from PyQt5.QtWidgets import QWidget, QPushButton, QGridLayout, QLineEdit, QFileDialog, QComboBox, QVBoxLayout, \
QApplication, QLabel, QRadioButton, QHBoxLayout
# https://stackoverflow.c... | 20 | 7 | 1 | 4 | 32 | 0 |
robogym/robot/shadow_hand/mujoco/mujoco_shadow_hand.py | 0xflotus/robogym | 288 | 1781296 | <reponame>0xflotus/robogym
import numpy as np
from mujoco_py.generated import const
from robogym.mujoco.simulation_interface import SimulationInterface
from robogym.robot.shadow_hand.hand_forward_kinematics import (
FINGERTIP_SITE_NAMES,
REFERENCE_SITE_NAMES,
get_relative_positions,
)
from robogym.robot.sh... | 0 | 0 | 0 | 0 | 0 | 0 |
python-tuts/beginner/wordplay/words.py | DanielMabadeje/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials | 3,266 | 1781300 | <gh_stars>1000+
import scrabble
# Print all the words containing uu
for word in scrabble.wordlist:
if "uu" in word:
print(word) | 0 | 0 | 0 | 0 | 0 | 0 |
FeatureFlagsCo.Experiments/redismq/redis_foo_receiver.py | ZhenhangTung/feature-flags-co | 681 | 1781346 | import logging
import os
from experiment.utils import get_custom_properties
from redismq.send_consume import RedisReceiver
class FooReceiver(RedisReceiver):
def handle_body(self, body, **kwargs):
instance_name = kwargs.pop('instance_name', '')
instance_id = kwargs.pop('instance_id', '')
tr... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/data/generate_test_saver.py | zhangyewu/edward | 5,200 | 1781355 | <filename>tests/data/generate_test_saver.py
"""Generate `test_saver`."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import edward as ed
import numpy as np
import tensorflow as tf
from edward.models import Normal, PointMass
def main(_):
x_data = np.... | 0 | 0 | 0 | 0 | 0 | 0 |
JetMETCorrections/Modules/test/JetCorrectorDemo_cfg.py | ckamtsikis/cmssw | 852 | 1781368 | import FWCore.ParameterSet.Config as cms
process = cms.Process("myprocess")
process.TFileService=cms.Service("TFileService",fileName=cms.string('JECplots.root'))
##-------------------- Communicate with the DB -----------------------
process.load('Configuration.StandardSequences.Services_cff')
process.load("Configurati... | 0 | 0 | 0 | 0 | 0 | 0 |
gym_rocketlander/envs/__init__.py | Natasha027/space | 191 | 1781369 | from gym_rocketlander.envs.rocket_lander_env import RocketLander
| 0 | 0 | 0 | 0 | 0 | 0 |
python/arcpy-python/compare-overlapping-polygons-by-date/compare_geometries.py | NagarjunaManupati/ESRI | 272 | 1781371 | #-------------------------------------------------------------------------------
# Name: Compare overlapping polygons by date
# Purpose: The purpose is to find overlapping polygon geometries. If there is a
# overlapping geometry, it will compare the date field to see which
# was cre... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/garage/tf/experiment/test_trainer.py | blacksph3re/garage | 1,500 | 1781382 | import pytest
import ray
import tensorflow as tf
from garage.envs import GymEnv
from garage.experiment import deterministic
from garage.np.baselines import LinearFeatureBaseline
from garage.sampler import LocalSampler, RaySampler
from garage.tf.algos import VPG
from garage.tf.plotter import Plotter
from garage.tf.poli... | 0 | 0 | 0 | 0 | 0 | 0 |
btools/road/road/road_ops.py | proteanblank/building_tool | 559 | 1781384 | import bpy
from .road import Road
from .road_props import RoadProperty
class BTOOLS_OT_add_road(bpy.types.Operator):
"""Create road"""
bl_idname: str = "btools.add_road"
bl_label: str = "Add Road"
bl_options: set[str] = {"REGISTER", "UNDO", "PRESET"}
props: bpy.props.PointerProperty(type=RoadPr... | 0 | 4 | 7 | 0 | 11 | 0 |
tests/nnapi/specs/skip/V1_2/generate_proposals.mod.py | periannath/ONE | 255 | 1781390 | #
# Copyright (C) 2019 The Android Open Source Project
#
# 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 la... | 0 | 0 | 0 | 0 | 0 | 0 |
k8s/images/codalab/apps/newsletter/tests/test_newsletter_opt_in.py | abdulari/codalab-competitions | 333 | 1781407 | from __future__ import annotations
import mock
import requests
from django.test import TestCase
from django.contrib.auth import get_user_model
from apps.newsletter.models import NewsletterSubscription
from django.conf import settings
from apps.newsletter.tasks import retry_mailing_list
User = get_user_model()
clas... | 5 | 3 | 0 | 0 | 8 | 0 |
src/sparseml/tensorflow_v1/datasets/classification/imagenet.py | clementpoiret/sparseml | 922 | 1781408 | <reponame>clementpoiret/sparseml
# Copyright (c) 2021 - present / Neuralmagic, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/... | 0 | 0 | 0 | 0 | 0 | 0 |
src/pykeen/experiments/__init__.py | nhutnamhcmus/pykeen | 750 | 1781409 | # -*- coding: utf-8 -*-
"""A curated collection of landmark experiments."""
| 0 | 0 | 0 | 0 | 0 | 0 |
utils/utils_prox_snapshots_realcam.py | jiyeonkim127/PSI | 138 | 1781481 | <reponame>jiyeonkim127/PSI
import os, sys
import os.path as osp
import cv2
import numpy as np
import json
import yaml
import open3d as o3d
import trimesh
import argparse
import matplotlib.pyplot as plt
sys.path.append('/home/yzhang/workspaces/smpl-env-gen-3d-internal')
import torch
import pickle
import smplx
from hum... | 0 | 0 | 0 | 0 | 0 | 0 |
Dynamic Programming/120. Triangle.py | beckswu/Leetcode | 138 | 1781493 | <filename>Dynamic Programming/120. Triangle.py
"""
120. Triangle
"""
class Solution:
def minimumTotal(self, triangle):
"""
:type triangle: List[List[int]]
:rtype: int
"""
for i in range(len(triangle)-2,-1,-1):
for j in range(len(triangle[i])):
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/finn/util/gdrive.py | mmrahorovic/finn | 283 | 1781505 | # Copyright (c) 2020, Xilinx
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the follow... | 0 | 1 | 0 | 0 | 1 | 0 |
2014/CVE-2014-3704/poc/pocsploit/CVE-2014-3704.py | hjyuan/reapoc | 421 | 1781513 | <filename>2014/CVE-2014-3704/poc/pocsploit/CVE-2014-3704.py
import requests
# Vuln Base Info
def info():
return {
"author": "cckuailong",
"name": '''Drupal SQL Injection''',
"description": '''The expandArguments function in the database abstraction API in Drupal core 7.x before 7.32 does n... | 0 | 0 | 0 | 0 | 0 | 0 |
kafka/cruise-control/cruise-control-client/cruisecontrolclient/util/__init__.py | smthkissinger/docker-images | 2,177 | 1781520 | <reponame>smthkissinger/docker-images
# Copyright 2019 LinkedIn Corp. Licensed under the BSD 2-Clause License (the "License").
# See License in the project root for license information.
| 0 | 0 | 0 | 0 | 0 | 0 |
rex/exploit/shellcodes/linux_arm_binsh.py | balbassam/rex | 471 | 1781541 |
import binascii
from rex.exploit.shellcode import Shellcode
class LinuxARMBinsh(Shellcode):
# TODO: should be 'linux' once CLE can identify linux files
supported_platforms: list[str] = ["unix"]
arches: list[str] = ["ARMEL"]
name: str = "binsh"
asm: str = """
add r0, pc, #0xc
mov r2, #0
push {r0... | 0 | 0 | 4 | 0 | 4 | 0 |
src/lib/evaluate/model_analysis_PLM.py | EvelynYihuiYang/MCMOT | 306 | 1781599 | <gh_stars>100-1000
import os
import darknet as dn
import cv2
import time
import cmp_det_label as cdl
from readAndSaveDarknetDetRes import readDetRes,saveDetRes
from readAnnotations import LoadLabel
#读取文件列表
def LoadFileList(files):
fl = open(files,"r")
file_lists = []
while True:
lines = fl.readlin... | 0 | 0 | 0 | 0 | 0 | 0 |
gitman/models/__init__.py | Erich-McMillan/gitman | 134 | 1781615 | from .source import Source # isort:skip
from .config import Config, load_config
from .group import Group
| 0 | 0 | 0 | 0 | 0 | 0 |
xhr/resources/parse-headers.py | meyerweb/wpt | 14,668 | 1781635 | def main(request, response) -> object:
content = u""
if b"my-custom-header" in request.GET:
val = request.GET.first(b"my-custom-header")
response.headers.set(b"My-Custom-Header", val)
return content
| 0 | 1 | 0 | 0 | 1 | 0 |
server/fcServer.py | shpoellet/telecine | 138 | 1781689 | #!/usr/bin/python
import socket
import time
import picamera
import threading #should probably change threads to processes. Sometime.
import multiprocessing #using processes instead of threads for frame advance.
import filmCap
from time import sleep
import RPi.GPIO as GPIO
from filmCap import config
from filmCap... | 0 | 0 | 0 | 0 | 0 | 0 |
src/gitsweep/inspector.py | soehlert/git-sweep | 1,746 | 1781692 | from git import Git
from .base import BaseOperation
class Inspector(BaseOperation):
"""
Used to introspect a Git repository.
"""
def merged_refs(self, skip: list[object]=[]) -> object:
"""
Returns a list of remote refs that have been merged into the master
branch.
T... | 1 | 1 | 0 | 0 | 2 | 0 |
docs/components_page/components/badge/links.py | glsdown/dash-bootstrap-components | 776 | 1781732 | <filename>docs/components_page/components/badge/links.py
import dash_bootstrap_components as dbc
from dash import html
badges = html.Span(
[
dbc.Badge(
"Primary",
href="#",
color="primary",
className="me-1 text-decoration-none",
),
dbc.Badge(
... | 0 | 0 | 0 | 0 | 0 | 0 |
python/neuroglancer/tool/filter_bodies.py | joelyancey/neuroglancer | 755 | 1781756 | from __future__ import division
import json
import os
import copy
import collections
import argparse
import csv
import neuroglancer
import neuroglancer.cli
import numpy as np
class State(object):
def __init__(self, path):
self.path = path
self.body_labels = collections.OrderedDict()
def loa... | 0 | 2 | 0 | 0 | 2 | 0 |
leetcode.com/python/134_Gas_Station.py | vansh-tiwari/coding-interview-gym | 713 | 1781806 | <reponame>vansh-tiwari/coding-interview-gym<gh_stars>100-1000
class Solution(object):
def canCompleteCircuit(self, gas, cost):
"""
:type gas: List[int]
:type cost: List[int]
:rtype: int
"""
stationCount = len(gas)
startingStation = 0
gasSurplus, gasDef... | 0 | 0 | 0 | 0 | 0 | 0 |
armi/bookkeeping/report/__init__.py | celikten/armi | 162 | 1781822 | <reponame>celikten/armi
# Copyright 2019 TerraPower, 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 l... | 0 | 0 | 0 | 0 | 0 | 0 |
friends/migrations/0003_friend_status.py | shriekdj/django-social-network | 368 | 1781915 | # Generated by Django 2.2.4 on 2019-08-27 05:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('friends', '0002_customnotification'),
]
operations: list[object] = [
migrations.AddField(
model_name='fri... | 0 | 0 | 2 | 0 | 2 | 0 |
Part-10 Pytest Testing 1/ecommerce/apps/checkout/admin.py | azizkra/django-ecommerce-project | 175 | 1781944 | from django.contrib import admin
from .models import DeliveryOptions
admin.site.register(DeliveryOptions)
| 0 | 0 | 0 | 0 | 0 | 0 |
python_packages/jupyter_lsp/jupyter_lsp/paths.py | icankeep/jupyterlab-lsp | 1,117 | 1781987 | import os
import pathlib
import re
from urllib.parse import unquote, urlparse
RE_PATH_ANCHOR = r"^file://([^/]+|/[A-Z]:)"
def normalized_uri(root_dir) -> object:
"""Attempt to make an LSP rootUri from a ContentsManager root_dir
Special care must be taken around windows paths: the canonical form of
windo... | 0 | 2 | 0 | 0 | 2 | 0 |
pygears/lib/hls.py | bogdanvuk/pygears | 120 | 1781990 | from pygears.conf import reg
from pygears.core.intf import IntfOperPlugin
async def qiter(intf):
while True:
data = await intf.pull()
yield data
intf.ack()
if all(data.eot):
break
class gather:
def __init__(self, *din):
self.din = din
async def __a... | 0 | 1 | 0 | 0 | 1 | 0 |
deepreg/__init__.py | Zhiyuan-w/DeepReg | 379 | 1781991 | """
DeepReg package init.
We set tensorflow log level environment variable here before importing it.
- 0 = all messages are logged (default behavior)
- 1 = INFO messages are not printed
- 2 = INFO and WARNING messages are not printed
- 3 = INFO, WARNING, and ERROR messages are not printed
"""
# flake8: noqa
import o... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/ebcli/operations/configops.py | theLambda/DBH-project1 | 110 | 1782033 | <reponame>theLambda/DBH-project1
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
#... | 0 | 0 | 0 | 0 | 0 | 0 |
Shubham-Yadav/4.Docker/app.py | srimanivinay97/DevOpsRoadmap2022 | 169 | 1782046 | print("hello world from docker") | 0 | 0 | 0 | 0 | 0 | 0 |
src/curt/curt/modules/vision/image_classification.py | sanyaade-teachings/cep | 108 | 1782083 | <filename>src/curt/curt/modules/vision/image_classification.py
"""
Copyright (C) Cortic Technology Corp. - All Rights Reserved
Written by <NAME> <<EMAIL>>, 2021
"""
import tvm
from tvm.contrib import graph_runtime
import numpy as np
import time
from scipy.special import expit, logit
import cv2
import math
import os
... | 0 | 0 | 0 | 0 | 0 | 0 |
dirigible/sheet/tests/test_ui_jsonifier.py | EnoX1/dirigible-spreadsheet | 168 | 1782128 | <filename>dirigible/sheet/tests/test_ui_jsonifier.py
# Copyright (c) 2010 Resolver Systems Ltd, PythonAnywhere LLP
# See LICENSE.md
#
try:
import simplejson as json
except ImportError:
import json
try:
import unittest2 as unittest
except ImportError:
import sys
assert sys.version.startswith('2.7')... | 0 | 0 | 0 | 0 | 0 | 0 |
maro/cli/grass/lib/services/master_api_server/blueprints/jobs.py | yangboz/maro | 598 | 1782140 | <gh_stars>100-1000
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import requests
from flask import Blueprint
from ..jwt_wrapper import check_jwt_validity
from ..objects import redis_controller
# Flask related.
blueprint = Blueprint(name="jobs", import_name=__name__)
URL_PREFIX = "/v1/job... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/scripts/gen_services.py | aws/aws-service-operator-k8s | 287 | 1782142 | <filename>docs/scripts/gen_services.py
#!/usr/bin/env python3.8
import argparse
import os
import pathlib
import pprint
import sys
import github
import prettytable
from dataclasses import dataclass, asdict
from jinja2 import Environment
from jinja2.loaders import FileSystemLoader
from pathlib import Path
from typing i... | 0 | 0 | 0 | 0 | 0 | 0 |
mmhuman3d/data/datasets/pipelines/synthetic_occlusion_augmentation.py | ykk648/mmhuman3d | 472 | 1782153 | <reponame>ykk648/mmhuman3d<filename>mmhuman3d/data/datasets/pipelines/synthetic_occlusion_augmentation.py
"""This script is modified from https://github.com/ isarandi/synthetic-
occlusion.
Original license please see docs/additional_licenses.md.
"""
import os.path
import random
import cv2
import numpy as np
from ..b... | 0 | 0 | 0 | 0 | 0 | 0 |
test-old/launcher/test_launcher.py | PeihongYu/surreal | 471 | 1782172 | <reponame>PeihongYu/surreal<gh_stars>100-1000
from surreal.launch import LaunchSettings
| 0 | 0 | 0 | 0 | 0 | 0 |
pca/utils/serialization/loaders.py | pcah/python-clean-architecture | 278 | 1782178 | import typing as t
from enum import Enum
from functools import partial
from pathlib import Path
from .ini import load_ini_from_filepath
from .json import load_json_from_filepath
from .yaml import load_yaml_from_filepath
def load_from_filepath(filepath: t.Union[str, Path]) -> t.Any:
path = Path(filepath)
loa... | 3 | 4 | 3 | 0 | 10 | 0 |
tests/data/orthofoto/other/test_user_agent.py | grischard/OSMDeepOD | 156 | 1782180 | from src.data.orthofoto.other.user_agent import UserAgent
def test_user_agent_random():
user_agent = UserAgent()
assert len(user_agent.random) > 0
| 0 | 0 | 0 | 0 | 0 | 0 |
introspect/ast_nodes.py | mfkiwl/mujoco | 1,575 | 1782189 | <reponame>mfkiwl/mujoco<gh_stars>1000+
# Copyright 2022 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... | 0 | 0 | 0 | 0 | 0 | 0 |
DockerENT/docker_plugins/docker_plaintext_password_info.py | laozhudetui/DockerENT | 125 | 1782224 | from __future__ import annotations
"""Docker plaintext password in configs scan plugin."""
from DockerENT import utils
import logging
_log = logging.getLogger(__name__)
_plugin_name_ = 'plaintext-passwords'
def scan(container, output_queue, audit: bool=False, audit_queue: object | None=None):
"""Docker plaintex... | 2 | 0 | 0 | 0 | 2 | 0 |
enzyme/benchmarks/lstm/data/gen_data.py | anandijain/Enzyme | 674 | 1782264 | import math
import numpy as np
# Data size variables
layer_counts = [2, 4]
char_counts = [1024, 4096]
text_input = "lstm_full.txt"
# Read from the full text file
def read_full_text(fn, char_count) -> object:
full_text_file = open(text_input, encoding="utf8")
full_text = full_text_file.read(char_count)
f... | 0 | 3 | 0 | 0 | 3 | 0 |
datasets/DataKeys.py | DesperateMaker/TrackR-CNN | 522 | 1782271 | # we cannot use an enum here as tensorflow needs ordered keys
SEGMENTATION_LABELS = "segmentation_labels"
SEGMENTATION_LABELS_ORIGINAL_SIZE = "segmentation_labels_original_size"
BBOX_GUIDANCE = "bbox_guidance"
UNSIGNED_DISTANCE_TRANSFORM_GUIDANCE = "unsigned_distance_transform_guidance"
SIGNED_DISTANCE_TRANSFORM_GUIDA... | 0 | 0 | 0 | 0 | 0 | 0 |
virtual/lib/python3.6/site-packages/pylint/test/functional/formatted_string_literal_with_if_py36.py | drewheathens/The-Moringa-Tribune | 463 | 1782275 | <reponame>drewheathens/The-Moringa-Tribune
"""Test that `if` in formatted string literal won't break Pylint."""
# pylint: disable=missing-docstring, pointless-statement, using-constant-test
f'{"+" if True else "-"}'
if True:
pass
elif True:
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
src/python/python-proto/python_proto/tests/test_common.py | inickles/grapl | 313 | 1782318 | import datetime
import uuid
import pytest
pytest.register_assert_rewrite("python_proto.tests.helpers")
from hypothesis import given
from hypothesis import strategies as st
from python_proto.common import Duration, Timestamp, Uuid
from python_proto.tests.helpers import check_encode_decode_invariant
from python_proto.... | 3 | 7 | 0 | 0 | 10 | 0 |
verde/__init__.py | fatiando/verde | 415 | 1782337 | # Copyright (c) 2017 The Verde Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
# Import functions/classes to make the public API
from . import datasets, synthetic
from ._vers... | 4 | 0 | 0 | 0 | 4 | 0 |
chapter3_分析实验/windows.py | busyyang/python_sound_open | 165 | 1782358 | <reponame>busyyang/python_sound_open
import numpy as np
def reg_window(N):
return np.ones(N)
def hanning_window(N):
nn = [i for i in range(N)]
return 0.5 * (1 - np.cos(np.multiply(nn, 2 * np.pi) / (N - 1)))
def hamming_window(N):
nn = [i for i in range(N)]
return 0.54 - 0.46 * np... | 0 | 0 | 0 | 0 | 0 | 0 |
Flansible/flansible/celery_runner.py | trondhindenes/flansible | 126 | 1782369 | from celery import Celery
import subprocess
from subprocess import Popen, PIPE
from flansible import api, app, celery, task_timeout
@celery.task(bind=True, soft_time_limit=task_timeout, time_limit=(task_timeout+10))
def do_long_running_task(self, cmd, type: str='Ansible') -> object:
with app.app_context():
... | 1 | 1 | 0 | 0 | 2 | 0 |
airmozilla/suggest/models.py | RAMilewski/airmozilla | 115 | 1782408 | <gh_stars>100-1000
# deliberately empty
| 0 | 0 | 0 | 0 | 0 | 0 |
config-default.py | rajatsharma94/lemur | 1,656 | 1782434 | import os
_basedir = os.path.abspath(os.path.dirname(__file__))
| 0 | 0 | 0 | 0 | 0 | 0 |
vaegan/utils/__init__.py | amirjaber/vaegan | 101 | 1782439 | <filename>vaegan/utils/__init__.py
# coding : utf-8
from utils import minibatches
from progress import Progress
| 0 | 0 | 0 | 0 | 0 | 0 |
src/connection/baud_options.py | OptimusGREEN/uPyLoader | 337 | 1782444 | <filename>src/connection/baud_options.py
class BaudOptions:
speeds = [300,
1200,
2400,
4800,
9600,
14400,
19200,
28800,
38400,
57600,
115200,
230400]
| 0 | 0 | 0 | 0 | 0 | 0 |
test/test_ln_utilities.py | seth586/lndmanage | 166 | 1782447 | <reponame>seth586/lndmanage
from unittest import TestCase
from lndmanage.lib.ln_utilities import channel_unbalancedness_and_commit_fee
class LnUtilityTest(TestCase):
def test_unbalancedness_formula(self):
self.assertAlmostEqual(
channel_unbalancedness_and_commit_fee(
500000, 10... | 0 | 0 | 0 | 0 | 0 | 0 |
test_scripts/deploy/shrinkwrap.py | ufora/ufora | 571 | 1782458 | # Copyright 2015 Ufora 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 law or agreed to i... | 0 | 3 | 0 | 0 | 3 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.