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
fairness/algorithms/zafar/fair-classification-master/disparate_impact/synthetic_data_demo/fairness_acc_tradeoff.py
yashwarlord/fairness-comparison
146
12797521
<reponame>yashwarlord/fairness-comparison import os,sys import numpy as np from generate_synthetic_data import * sys.path.insert(0, '../../fair_classification/') # the code for fair classification is in this directory import utils as ut import loss_funcs as lf # loss funcs that can be optimized subject to various const...
S2.Surface_Normal/lib/helper.py
leoshine/Spherical_Regression
133
12797551
<filename>S2.Surface_Normal/lib/helper.py # coding: utf8 """ @Author : <NAME> """ import torch import torch.nn as nn from torch.autograd import Variable import numpy as np from easydict import EasyDict as edict from collections import OrderedDict as odict from itertools import product def eval_cls(Preds, GTs): ...
SMPyBandits/Policies/Experimentals/UCBjulia.py
balbok0/SMPyBandits
309
12797558
<reponame>balbok0/SMPyBandits # -*- coding: utf-8 -*- """ The UCB policy for bounded bandits, with UCB indexes computed with Julia. Reference: [Lai & Robbins, 1985]. .. warning:: Using a Julia function *from* Python will not speed up anything, as there is a lot of overhead in the "bridge" protocol used by pyjulia...
alipay/aop/api/domain/CollectReceiptOpenApiDTO.py
antopen/alipay-sdk-python-all
213
12797562
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * from alipay.aop.api.domain.MultiCurrencyMoneyOpenApi import MultiCurrencyMoneyOpenApi from alipay.aop.api.domain.MultiCurrencyMoneyOpenApi import MultiCurrencyMoneyOpenApi from alipay.aop.a...
python/tvm/topi/cuda/stft.py
shengxinhu/tvm
4,640
12797585
<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"...
title_cleaner_test.py
susannahsoon/oldperth
302
12797588
from nose.tools import * import title_cleaner TRUTH = [ (True, 'Manhattan: 1st Ave. - 34th St. E.'), (True, 'Queens: Hoyt Avenue - 24th Street'), (False, "Queens: Flushing Meadow Park - New York World's Fair of 1939-40 - [Industrial exhibits.]"), (False, 'Fifth Avenue - 90th Street, southeast corner')...
ml-agents/mlagents/envs/__init__.py
icaro56/ml-agents
134
12797620
from .environment import * from .brain import * from .exception import *
archive/original_main.py
FDKevin0/Micro-Expression-with-Deep-Learning
249
12797650
<filename>archive/original_main.py import numpy as np import sys import math import operator import csv import glob,os import xlrd import cv2 import pandas as pd from sklearn.svm import SVC from collections import Counter from sklearn.metrics import confusion_matrix import scipy.io as sio from keras.models import Se...
btk20_src/lib/pykaldiarkio.py
musiclvme/distant_speech_recognition
136
12797664
<reponame>musiclvme/distant_speech_recognition<filename>btk20_src/lib/pykaldiarkio.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # MIT License # # Copyright (c) 2018 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "...
apps/paypal/urls.py
youssriaboelseod/pyerp
115
12797687
# Django Library from django.urls import path # Localfolder Library from .views.paypal_config import UpdatePaypalConfigView # http://www.secnot.com/django-shop-paypal-rest-1.html app_name = 'paypal' urlpatterns = [ path('paypal-config/<int:pk>', UpdatePaypalConfigView.as_view(), name='paypal-config'), ]
glucosetracker/settings/production.py
arhanair/glucose-tracker-monitor
134
12797702
from .base import * DEBUG = False TEMPLATE_DEBUG = DEBUG # Use the cached template loader so template is compiled once and read from # memory instead of reading from disk on each load. TEMPLATE_LOADERS = ( ('django.template.loaders.cached.Loader', ( 'django.template.loaders.filesystem.Loader', 'd...
morph_net/framework/output_non_passthrough_op_handler.py
MohammadChalaki/morph-net
1,061
12797706
<gh_stars>1000+ """OpHandler for OutputNonPassthrough ops. OutputNonPassthrough ops take their regularizer from the output and do not passthrough the regularizer to their input. This is the default OpHandler for ops like Conv2D and MatMul when L1-gamma regularization is used. """ from __future__ import absolute_impor...
native_client/src/trusted/validator_ragel/check_dis_section.py
zipated/src
2,151
12797737
<reponame>zipated/src #!/usr/bin/python # Copyright (c) 2013 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import subprocess import sys import tempfile import objdump_parser import test_format class Rdf...
src/rayoptics/qtgui/ipyconsole.py
wuffi/ray-optics
106
12797740
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright © 2018 <NAME> """ Support creation of an iPython console, with rayoptics environment .. Created on Wed Nov 21 21:48:02 2018 .. codeauthor: <NAME> """ from PyQt5.QtGui import QColor from qtconsole.rich_jupyter_widget import RichJupyterWidget from qtconsole.in...
tests/util/test_transform.py
xiangze/edward
5,200
12797755
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 collections import namedtuple from edward.models import ( Beta, Dirichlet, DirichletProcess, Gamma, MultivariateNormalDiag, Normal, P...
oslash/state.py
stjordanis/OSlash
668
12797765
<filename>oslash/state.py from typing import Callable, Tuple, Any, TypeVar, Generic from .util import Unit from .typing import Functor from .typing import Monad TState = TypeVar("TState") TSource = TypeVar("TSource") TResult = TypeVar("TResult") class State(Generic[TSource, TState]): """The state monad. Wr...
convlab/modules/nlu/multiwoz/error.py
ngduyanhece/ConvLab
405
12797822
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """ """ class ErrorNLU: """Base model for generating NLU error.""" def __init__(self, act_type_rate=0.0, slot_rate=0.0): """ Args: act_type_rate (float): The error rate applied on dialog act type. ...
tests/scripts/thread-cert/pktverify/null_field.py
AdityaHPatwardhan/openthread
2,962
12797842
#!/usr/bin/env python3 # # Copyright (c) 2019, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
mmrotate/core/bbox/iou_calculators/builder.py
williamcorsel/mmrotate
449
12797885
# Copyright (c) OpenMMLab. All rights reserved. from mmcv.utils import build_from_cfg from mmdet.core.bbox.iou_calculators.builder import IOU_CALCULATORS ROTATED_IOU_CALCULATORS = IOU_CALCULATORS def build_iou_calculator(cfg, default_args=None): """Builder of IoU calculator.""" return build_from_cfg(cfg, ROT...
tests/converter/test_url2netloc.py
Centaurioun/PyFunceble
213
12797888
""" The tool to check the availability or syntax of domain, IP or URL. :: ██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗ ██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝ ██████╔╝ ╚████╔╝ █████╗ ██║ ██║██╔██╗ ██║██║ █████╗ █...
nemo/collections/common/losses/aggregator.py
hamjam/NeMo
4,145
12797934
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli...
tensorflow/contrib/distributions/python/kernel_tests/estimator_test.py
tianyapiaozi/tensorflow
848
12797975
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
seahub/organizations/api/users.py
samuelduann/seahub
420
12797976
# Copyright (c) 2012-2016 Seafile Ltd. import logging from rest_framework import status from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.authentication import SessionAuthentication from seaserv import ccnet_api from seahub.api2.permissions import IsProVersion...
tests/modules/transformer/bimodal_attention_test.py
MSLars/allennlp
11,433
12797992
<gh_stars>1000+ import torch import pytest from allennlp.common import Params from allennlp.modules.transformer import BiModalAttention @pytest.fixture def params_dict(): return { "hidden_size1": 6, "hidden_size2": 4, "combined_hidden_size": 16, "num_attention_heads": 2, "...
src/third_party/angle/third_party/glmark2/src/waflib/Tools/dmd.py
goochen/naiveproxy
2,151
12798000
<reponame>goochen/naiveproxy #! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file import sys from waflib.Tools import ar,d from waflib.Configure import conf @conf def find_dmd(conf): conf.find_program(['dmd','dmd2','ldc'],var='D') out=conf.cmd_and_lo...
redteamvillage2021/pie/exploit.py
nhtri2003gmail/ctf-write-ups
101
12798034
<gh_stars>100-1000 #!/usr/bin/env python3 from pwn import * binary = context.binary = ELF('./pie') if args.REMOTE: p = remote('pwnremote.threatsims.com', 9002) else: p = process(binary.path) p.sendlineafter('?\n','%11$10p%15$10p') p.recvuntil('command: ') canary = int(p.recv(10),16) log.info('canary: ' + hex(cana...
generate/generate/tests/__init__.py
flamencist/browser-extensions
102
12798042
def dummy_config(): return { 'uuid': 'TEST-UUID', 'main': { 'server': 'https://test.forge.io/api/' } }
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/n/non/non_ascii_name.py
ciskoinch8/vimrc
463
12798064
""" Tests for non-ascii-name checker. """ áéíóú = 4444 # [non-ascii-name] def úóíéá(): # [non-ascii-name] """yo"""
src/btt/questions/admin.py
kevinkissi/basic-tech-tips-webapp
116
12798114
<reponame>kevinkissi/basic-tech-tips-webapp from django.contrib import admin from django.apps import apps questions = apps.get_app_config('questions') for model_name, model in questions.models.items(): admin.site.register(model)
en/verbocean_to_json.py
yuichigoto/ccg2lambda
200
12798116
<filename>en/verbocean_to_json.py #!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2017 <NAME> # # 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/licens...
rx/core/operators/catch.py
mmpio/RxPY
4,342
12798120
from typing import Callable, Union import rx from rx.core import Observable, typing from rx.disposable import SingleAssignmentDisposable, SerialDisposable from rx.internal.utils import is_future def catch_handler(source: Observable, handler: Callable[[Exception, Observable], Observable]) -> Observable: def subsc...
scripts/download_osm_tiles.py
MartinRusk/stratux
104
12798131
#!/usr/bin/python3 from sys import argv import os import math import urllib.request import random import os.path import sqlite3 URL_TEMPLATE = "https://c.tile.openstreetmap.org/%d/%d/%d.png" BBOX = None # [lon_min, lat_min, lon_max, lat_max] or None for whole world ZOOM_MAX = 7 LAYERTYPE = "baselayer" # "baselayer" ...
btb/selection/recent.py
dataronio/BTB
161
12798133
<filename>btb/selection/recent.py import logging from btb.selection.ucb1 import UCB1 # the minimum number of scores that each choice must have in order to use # best-K optimizations. If not all choices meet this threshold, default UCB1 # selection will be used. K_MIN = 2 logger = logging.getLogger('btb') class Rec...
src/ralph/licences/tests/tests_models.py
DoNnMyTh/ralph
1,668
12798145
<filename>src/ralph/licences/tests/tests_models.py # -*- coding: utf-8 -*- from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from ralph.accounts.tests.factories import RegionFactory, UserFactory from ralph.back_office.tests.factories import BackOfficeAssetFactory from ralp...
homeassistant/components/laundrify/__init__.py
liangleslie/core
30,023
12798181
"""The laundrify integration.""" from __future__ import annotations from laundrify_aio import LaundrifyAPI from laundrify_aio.exceptions import ApiConnectionException, UnauthorizedException from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_ACCESS_TOKEN, Platform from homeassist...
clai/server/plugins/helpme/helpme.py
cohmoti/clai
391
12798217
# # Copyright (C) 2020 IBM. All Rights Reserved. # # See LICENSE.txt file in the root directory # of this source tree for licensing information. # import os from pathlib import Path from clai.tools.colorize_console import Colorize from clai.server.searchlib.data import Datastore from clai.server.agent import Agent f...
tests/test_circuit/test_undriven_unused.py
leonardt/magma
167
12798233
""" Test the ability to ignore undriven inputs (useful for formal verification tools that use undriven inputs to mark wires that can take on any value) """ import pytest import magma as m from magma.testing import check_files_equal def test_ignore_unused_undriven_basic(): class Main(m.Circuit): _ignore_...
payment/tests/integ/test_api.py
Al-bambino/aws-serverless-ecommerce-platform
758
12798249
<filename>payment/tests/integ/test_api.py import uuid import pytest import requests from fixtures import iam_auth # pylint: disable=import-error from helpers import get_parameter # pylint: disable=import-error,no-name-in-module @pytest.fixture(scope="module") def payment_3p_api_url(): return get_parameter("/ecomm...
thanks/package_tools.py
vsprogrammer2909/thanks
168
12798259
<filename>thanks/package_tools.py from functools import reduce from itertools import chain, takewhile import os import pkg_resources import re class MetaDataNotFound(Exception): pass def get_local_dist(package_name): working_set = dict( (dist.project_name, dist) for dist in pkg_resources.WorkingSet(...
backend/lk/logic/websites.py
Purus/LaunchKitDocker
2,341
12798281
<gh_stars>1000+ # encoding: utf-8 # # Copyright 2016 Cluster Labs, 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 ...
Python3/1287.py
rakhi2001/ecom7
854
12798313
<reponame>rakhi2001/ecom7 __________________________________________________________________________________________________ sample 76 ms submission class Solution: def findSpecialInteger(self, arr: List[int]) -> int: for idx, num in enumerate(arr): if arr[idx] == arr[idx+len(arr)//4]: return nu...
tests/test_all.py
avidale/compress-fasttext
111
12798336
import os import gensim import pytest import compress_fasttext from sklearn.pipeline import make_pipeline from sklearn.linear_model import LogisticRegression from compress_fasttext.feature_extraction import FastTextTransformer BIG_MODEL_FILE = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'data/test_data/f...
tools/authors.py
roboterclubaachen/xpcc
161
12798367
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2017, <NAME> # All rights reserved. # # The file is part of the xpcc library and is released under the 3-clause BSD # license. See the file `LICENSE` for the full license governing this code. # ---------------------------------------------------------------...
tests/test_provider_hashicorp_hashicups.py
mjuenema/python-terrascript
507
12798374
<gh_stars>100-1000 # tests/test_provider_hashicorp_hashicups.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:18:02 UTC) def test_provider_import(): import terrascript.provider.hashicorp.hashicups def test_resource_import(): from terrascript.resource.hashicorp.hashicups import hashicups_ord...
src/kpdetector/concatenate_results.py
gathierry/FashionAI-KeyPointsDetectionOfApparel
174
12798389
import pandas as pd from src.config import Config config = Config() dfs = [] for cloth in ['blouse', 'skirt', 'outwear', 'dress', 'trousers']: df = pd.read_csv(config.proj_path + 'kp_predictions/' + cloth + '.csv') dfs.append(df) res_df = pd.concat(dfs) res_df.to_csv(config.proj_path +'kp_prediction...
vkwave/bots/core/dispatching/handler/__init__.py
Stunnerr/vkwave
222
12798447
from .base import BaseHandler, DefaultHandler # noqa: F401 from .cast import caster as callback_caster # noqa: F401
alipay/aop/api/response/AlipayOpenMiniPlanOperateBatchqueryResponse.py
antopen/alipay-sdk-python-all
213
12798467
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.PaymentSuccessPagePlanInfo import PaymentSuccessPagePlanInfo class AlipayOpenMiniPlanOperateBatchqueryResponse(AlipayResponse): def __init__(self): super...
src/exabgp/util/od.py
pierky/exabgp
1,560
12798482
<reponame>pierky/exabgp # encoding: utf-8 """ od.py Created by <NAME> on 2009-09-06. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ def od(value): def spaced(value): even = None for v in value: if even is False: ...
server/utils/workflow.py
Samsong1991/django-vue-admin
425
12798485
<gh_stars>100-1000 from django.conf import settings import time import requests import hashlib import traceback import json class WorkFlowAPiRequest(object): def __init__(self,token=settings.WORKFLOW_TOKEN, appname=settings.WORKFLOW_APP, username='admin', workflowurl=settings.WORKFLOW_URL): self.token = to...
patchlion/0000/DrawHeadImage.py
saurabh896/python-1
3,976
12798558
<filename>patchlion/0000/DrawHeadImage.py<gh_stars>1000+ # -*- coding: utf-8 -*- __author__ = 'PatchLion' from PIL import Image, ImageDraw,ImageFont def drawNumberOnIcon(imgpath, number): img = Image.open(imgpath) if (None == img): print('打开图片失败') return img = img.resize((160, 160)) ...
finetuning/v1/evaluate.py
wietsedv/bertje
104
12798564
<gh_stars>100-1000 import argparse import os from collections import Counter from sklearn.metrics import confusion_matrix, classification_report def read_labels(filename): labels = [] with open(filename) as f: for line in f: line = line.strip() if len(line) == 0: ...
build-tools/scripts/update_gpu_list.py
daniel-falk/nnabla-ext-cuda
103
12798591
<gh_stars>100-1000 # Copyright 2021 Sony Corporation. # Copyright 2021 Sony Group 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...
src/ralph/networks/migrations/0008_auto_20160808_0719.py
DoNnMyTh/ralph
1,668
12798606
<reponame>DoNnMyTh/ralph<gh_stars>1000+ # -*- coding: utf-8 -*- from __future__ import unicode_literals import ipaddress from itertools import chain from django.db import migrations, models IPADDRESS_STATUS_RESERVED = 2 def _reserve_margin_addresses(network, bottom_count, top_count, IPAddress): ips = [] ...
PWGPP/FieldParam/fitsol.py
maroozm/AliPhysics
114
12798686
#!/usr/bin/env python debug = True # enable trace def trace(x): global debug if debug: print(x) trace("loading...") from itertools import combinations, combinations_with_replacement from glob import glob from math import * import operator from os.path import basename import matplotlib.pyplot as plt import numpy as...
utils/trainer.py
niqbal996/ViewAL
126
12798717
import os import torch import constants from utils.misc import get_learning_rate from utils.summary import TensorboardSummary from utils.loss import SegmentationLosses from utils.calculate_weights import calculate_weights_labels from torch.utils.data import DataLoader import numpy as np from utils.metrics import Evalua...
src/masonite/authentication/guards/__init__.py
cercos/masonite
1,816
12798748
<reponame>cercos/masonite from .WebGuard import WebGuard
Reversing/FullColor.py
LeanVel/Tools
130
12798749
# encoding: utf-8 # http://www.hexblog.com/?p=120 # Default IDA Pro Paths: # MAC /Applications/IDA\ Pro\ X/idaq.app/Contents/MacOS/plugins/ # Windows C:\Program Files (x86)\IDA X\plugins # to make it autoexec on openfile # add this to plugins.cfg # ; Other plugins #FullColor FullColor.py 0...
misc/pytorch_toolkit/chest_xray_screening/chest_xray_screening/train.py
e-ddykim/training_extensions
256
12798788
<reponame>e-ddykim/training_extensions<filename>misc/pytorch_toolkit/chest_xray_screening/chest_xray_screening/train.py import numpy as np import time import os import argparse import torch from torch.backends import cudnn from torch import optim import torch.nn.functional as tfunc from torch.utils.data import DataLoad...
Portfolio_Strategies/vectorized_backtesting.py
vhn0912/Finance
441
12798800
import numpy as np import pandas as pd import yfinance as yf import matplotlib.pyplot as plt import datetime from yahoo_fin import stock_info as si plt.rcParams['figure.figsize'] = (15, 10) tickers = si.tickers_dow() individual_stock = input(f"Which of the following stocks would you like to backtest \n{tickers}\n:") ...
integrations/pinger/pinger.py
hamptons/alerta-contrib
114
12798802
<filename>integrations/pinger/pinger.py import sys import platform import time import subprocess import threading import Queue import re import logging import yaml from alertaclient.api import Client __version__ = '3.3.0' LOG = logging.getLogger('alerta.pinger') LOG.setLevel(logging.DEBUG) LOG.addHandler(logging.St...
Python3/872.py
rakhi2001/ecom7
854
12798834
<filename>Python3/872.py __________________________________________________________________________________________________ sample 24 ms submission # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None from coll...
test/simple_log/quick_start.py
lesteve/tensorwatch
3,453
12798872
<reponame>lesteve/tensorwatch<gh_stars>1000+ import tensorwatch as tw import time w = tw.Watcher(filename='test.log') s = w.create_stream(name='my_metric') #w.make_notebook() for i in range(1000): s.write((i, i*i)) time.sleep(1)
dmlab2d/dmlab2d_test.py
Robert-Held/lab2d
377
12798894
# Copyright 2019 The DMLab2D Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
mozi/layers/normalization.py
hycis/Mozi
122
12798961
<gh_stars>100-1000 from mozi.layers.template import Template from mozi.utils.theano_utils import shared_zeros, sharedX, shared_ones from mozi.weight_init import UniformWeight import theano.tensor as T import theano class BatchNormalization(Template): def __init__(self, dim, layer_type, gamma_init=UniformWeight()...
nodes/1.x/python/Material.Properties.py
jdehotin/Clockworkfordynamo
147
12799027
<gh_stars>100-1000 import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * mats = UnwrapElement(IN[0]) colorlist = list() glowlist = list() classlist = list() shinylist = list() smoothlist = list() translist = list() for mat in mats: colorlist.append(mat.Color) if mat.Glow: glowlist.append(True) ...
third_party/liblouis/src/tests/harness/runHarness.py
zipated/src
2,151
12799073
#!/usr/bin/env python # -*- coding: utf-8 -*- # Liblouis test harness # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 3 of the License, or (at your option) any later v...
tests/cli/test_base.py
ssato/python-anyconfig
213
12799082
# # Copyright (C) 2013 - 2021 <NAME> <<EMAIL>> # License: MIT # # pylint: disable=missing-docstring """test cases for anyconfig.cli module. """ import contextlib import io import pathlib import sys import tempfile import unittest import anyconfig.api import anyconfig.cli as TT from .. import base from . import collec...
src/ebonite/ext/sqlalchemy/models.py
zyfra/ebonite
270
12799124
from abc import abstractmethod from typing import Any, Dict, Iterable, List, Optional, Type, TypeVar from pyjackson import dumps, loads from sqlalchemy import Column, DateTime, ForeignKey, Integer, String, Text, UniqueConstraint from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relatio...
sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py
rsdoherty/azure-sdk-for-python
2,728
12799223
<filename>sdk/machinelearning/azure-mgmt-machinelearningservices/azure/mgmt/machinelearningservices/models/_azure_machine_learning_workspaces_enums.py # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under ...
Packs/SecurityAdvisor/Integrations/SecurityAdvisor/SecurityAdvisor_test.py
diCagri/content
799
12799252
<reponame>diCagri/content<filename>Packs/SecurityAdvisor/Integrations/SecurityAdvisor/SecurityAdvisor_test.py import SecurityAdvisor URL_SUFFIX = 'apis/coachuser/' BASE_URL = 'https://www.securityadvisor.io/' CONTEXT_JSON = { "SecurityAdvisor.CoachUser": { "coaching_date": "2019-10-04T21:04:19.480425", ...
python/py_gapic_repositories.bzl
vam-google/rules_gapic
239
12799263
<filename>python/py_gapic_repositories.bzl<gh_stars>100-1000 # Copyright 2019 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 #...
jsymbols.py
agnosticlines/ghidra_kernelcache
238
12799275
# Symbolicate the kernelcache from jtool2 #@author simo #@category iOS.kernel from utils.methods import * if __name__ == "__main__": default_file = "test" fname = askString("Kernelcache symbol file","Symbol file: ",default_file) f = open(fname,"rb+") buf = f.read().split('\n') i = 0 for li...
tools/get_efi_images.py
fengjixuchui/UEFI_RETool
240
12799312
<filename>tools/get_efi_images.py<gh_stars>100-1000 # SPDX-License-Identifier: MIT import glob import os import pathlib import re import shutil import colorama import uefi_firmware from .guid_db import UEFI_GUIDS DIR_NAME = "all" PE_DIR = "modules" g_re_guid = re.compile( r"file-[0-9a-f]{8}-[0...
testYOLOv3.py
SuicideMonkey/Object-Detection-API-Tensorflow
303
12799373
<filename>testYOLOv3.py import tensorflow as tf import numpy as np import os import utils.tfrecord_voc_utils as voc_utils import YOLOv3 as yolov3 # import matplotlib.pyplot as plt # import matplotlib.patches as patches # from skimage import io, transform from utils.voc_classname_encoder import classname_to_ids os.envir...
deepy/layers/word_embed.py
uaca/deepy
260
12799377
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- import theano import theano.tensor as T from deepy.layers import NeuralLayer class WordEmbedding(NeuralLayer): """ Word embedding layer. The word embeddings are randomly initialized, and are learned over the time. """ def __init__(...
tests/scripts/unicode💩.py
benfred/py-spy
8,112
12799421
<filename>tests/scripts/unicode💩.py<gh_stars>1000+ #!/env/bin/python # -*- coding: utf-8 -*- import time def function1(seconds): time.sleep(seconds) if __name__ == "__main__": function1(100)
mmdeploy/codebase/mmocr/models/text_recognition/sar_encoder.py
zhiqwang/mmdeploy
746
12799438
# Copyright (c) OpenMMLab. All rights reserved. import mmocr.utils as utils import torch import torch.nn.functional as F from mmdeploy.core import FUNCTION_REWRITER @FUNCTION_REWRITER.register_rewriter( func_name='mmocr.models.textrecog.encoders.SAREncoder.forward', backend='default') def sar_encoder__forwar...
chronologer/vega.py
dandavison/chronologer
165
12799453
import json import os from jinja2 import Template from chronologer.config import config def write_html(): html_file = os.path.join(os.path.dirname(__file__), "templates", "index.html") with open(html_file) as fp: html_template = Template(fp.read()) if not config.dry_run: boxplot_spec = j...
src/googleapis/codegen/filesys/package_writer_foundry.py
aiuto/google-apis-client-generator
178
12799463
<reponame>aiuto/google-apis-client-generator #!/usr/bin/python2.7 """Foundary for getting a package writer.""" from googleapis.codegen.filesys import filesystem_library_package from googleapis.codegen.filesys import single_file_library_package from googleapis.codegen.filesys import tar_library_package from googleapis....
bindings/python/examples/mouse_game.py
augustye/muniverse
380
12799492
<filename>bindings/python/examples/mouse_game.py """ Simple program to demonstrate how to use muniverse on a game that takes mouse events. """ import sys import numpy as np sys.path.insert(0, '..') import muniverse # noqa: E402 def main(): print('Looking up environment...') spec = muniverse.spec_for_name('...
pyani/aniblastall.py
widdowquinn/pyani
144
12799493
# -*- coding: utf-8 -*- # (c) University of Strathclyde 2021 # Author: <NAME> # # Contact: <EMAIL> # # <NAME>, # Strathclyde Institute for Pharmacy and Biomedical Sciences, # Cathedral Street, # Glasgow, # G4 0RE # Scotland, # UK # # The MIT License # # Copyright (c) 2021 University of Strathclyde # # Permission is her...
vespene/migrations/0009_remove_workerpool_sudo_password.py
vespene-io/vespene
680
12799528
# Generated by Django 2.1.2 on 2018-12-16 13:01 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('vespene', '0008_auto_20181106_2233'), ] operations = [ migrations.RemoveField( model_name='workerpool', name='sudo_password'...
doc/autosar4_api/examples/create_composition_component.py
SHolzmann/autosar
199
12799544
import autosar ws = autosar.workspace("4.2.2") components = ws.createPackage("ComponentTypes") swc = components.createCompositionComponent("MyComposition") print(swc.name)
tests/test_actions.py
pauloromeira/onegram
150
12799577
import pytest from onegram.exceptions import NotSupportedError from onegram import follow, unfollow from onegram import like, unlike from onegram import comment, uncomment from onegram import save, unsave def test_follow(logged, user, cassette): if logged: response = follow(user) assert response...
tests/unittest/test_autograd.py
yuhonghong66/minpy
1,271
12799585
from __future__ import print_function import minpy.numpy as mp import numpy as np import minpy.dispatch.policy as policy from minpy.core import convert_args, return_numpy, grad_and_loss, grad, minpy_to_numpy as mn, numpy_to_minpy as nm import time # mp.set_policy(policy.OnlyNumPyPolicy()) def test_autograd(): @c...
pymoo/model/repair.py
gabicavalcante/pymoo
762
12799621
<filename>pymoo/model/repair.py from abc import abstractmethod class Repair: """ This class is allows to repair individuals after crossover if necessary. """ def do(self, problem, pop, **kwargs): return self._do(problem, pop, **kwargs) @abstractmethod def _do(self, problem, pop, **kw...
recipes/Python/543261_grade_keeper/recipe-543261.py
tdiprima/code
2,023
12799634
#! /usr/bin/python # keep record of grades. Made by <NAME>. 0.1-PUBLIC # NOTE! All letter answers are to be written in quotes (including dates)! print """############################################ # Welcome to Gradebook! v 0.1 # # YOUR LIGHT WEIGHT SCHOOL RECORD MANAGER! # ##############################...
mcpipy/dragoncurve.py
wangtt03/raspberryjammod
338
12799657
# # Code by <NAME> and under the MIT license # from mineturtle import * import lsystem t = Turtle() t.pendelay(0) t.turtle(None) t.penblock(block.BRICK_BLOCK) # ensure angles are always integral multiples of 90 degrees t.gridalign() rules = {'X':'X+YF+', 'Y':'-FX-Y'} def go(): # draw a wall segment...
test/run/t418.py
timmartin/skulpt
2,671
12799678
# lists print "\nlists" print min([1,2,3,4]) print min([2,1],[1,2],[1,1],[1,1,0]) # tuples print "\ntuples" print min((1,2,3,4)) print min((2,1),(1,2),(1,1),(1,1,0)) # dictionaries print "\ndictionaries" print min({1:2,3:4,5:6}) print min({1:6,3:4,5:2})
kvs/client/python/setup.py
saurav-c/fluent
1,164
12799755
<gh_stars>1000+ from distutils.core import setup import os from setuptools.command.install import install class InstallWrapper(install): def run(self): # compile the relevant protobufs self.compile_proto() # Run the standard PyPi copy install.run(self) # remove the compile...
kqueen/gunicorn.py
LaudateCorpus1/kqueen
140
12799761
<filename>kqueen/gunicorn.py from kqueen.config import current_config from prometheus_client import multiprocess import multiprocessing import os app_config = current_config() bind = "{host}:{port}".format( host=app_config.get('KQUEEN_HOST'), port=app_config.get('KQUEEN_PORT'), ) timeout = 180 workers = mult...
examples/management/get_user.py
ZygusPatryk/amqpstorm
140
12799812
<gh_stars>100-1000 from amqpstorm import management if __name__ == '__main__': # If using a self-signed certificate, change verify=True to point at your CA bundle. # You can disable certificate verification for testing by passing in verify=False. API = management.ManagementApi('https://rmq.amqpstorm.io:156...
boost/libs/iterator/doc/generate.py
randolphwong/mcsema
1,155
12799824
<reponame>randolphwong/mcsema<filename>boost/libs/iterator/doc/generate.py #!/usr/bin/python # Copyright <NAME> 2004. Use, modification and distribution is # subject to the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) # # Generate html, ...
dev/tools/docs/run_doctests.py
awillats/brian2
674
12799828
<gh_stars>100-1000 import os import sphinx os.chdir('../../../docs_sphinx') sphinx.main(['sphinx-build', '-b', 'doctest', '.', '../docs', '-D', 'exclude_patterns=reference'])
src/modules/catalog/domain/services.py
Ermlab/python-ddd
308
12799846
# from seedwork.domain.services import DomainService # from seedwork.domain.value_objects import UUID # from .entities import Listing, Seller # from .repositories import ListingRepository # from .rules import ( # ListingMustBeInDraftState, # SellerMustBeEligibleForAddingNextListing, # ) # class CatalogService...
vit/formatter/start_remaining.py
kinifwyne/vit
179
12799856
from vit.formatter.start import Start class StartRemaining(Start): def format_datetime(self, start, task): return self.remaining(start)
scripts/typing-summary.py
AlexWaygood/typing
1,145
12799864
<gh_stars>1000+ #!/usr/bin/env python3 """ Generate a summary of last week's issues tagged with "topic: feature". The summary will include a list of new and changed issues and is sent each Monday at 0200 CE(S)T to the typing-sig mailing list. Due to limitation with GitHub Actions, the mail is sent from a private serv...
tests/fields/test_integer.py
Ennkua/wtforms
1,197
12799900
from tests.common import DummyPostData from wtforms.fields import IntegerField from wtforms.form import Form class F(Form): a = IntegerField() b = IntegerField(default=48) def test_integer_field(): form = F(DummyPostData(a=["v"], b=["-15"])) assert form.a.data is None assert form.a.raw_data == ...
misc/update_version.py
andyjgf/libcbor
283
12799909
import sys, re from datetime import date version = sys.argv[1] release_date = date.today().strftime('%Y-%m-%d') major, minor, patch = version.split('.') def replace(file_path, pattern, replacement): updated = re.sub(pattern, replacement, open(file_path).read()) with open(file_path, 'w') as f: f.write...
tests/component/test_performance_log_dataframe.py
cswarth/whylogs
603
12799916
<filename>tests/component/test_performance_log_dataframe.py import cProfile import json import os import pstats from logging import getLogger from shutil import rmtree from time import sleep from typing import List import pandas as pd import pytest from whylogs.app.config import SessionConfig, WriterConfig from whylo...