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
mapproxy/cache/renderd.py
cunha17/mapproxy
347
1684721
# This file is part of the MapProxy project. # Copyright (C) 2012, 2013 Omniscale <http://omniscale.de> # # 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/L...
3
4
0
0
7
0
boost_adaptbx/tests/tst_stdin.py
dperl-sol/cctbx_project
155
1684774
from __future__ import absolute_import, division, print_function import boost_adaptbx.boost.python as bp from boost_adaptbx.boost.python import streambuf ext = bp.import_ext("boost_adaptbx_python_streambuf_test_ext") import subprocess import sys def exercise(): proc = subprocess.Popen(args='libtbx.python %s --core'...
0
0
0
0
0
0
pysb/examples/run_earm_1_0.py
FFroehlich/pysb
105
1684804
<reponame>FFroehlich/pysb """Reproduce figures 4A and 4B from the EARM 1.0 publication (Albeck et al. 2008).""" from __future__ import print_function from pysb.simulator import ScipyOdeSimulator import matplotlib.pyplot as plt from numpy import * from earm_1_0 import model # saturating level of ligand (correspondin...
0
0
0
0
0
0
tests/ludwig/modules/test_reduction_modules.py
dantreiman/ludwig
7,739
1684820
from typing import Tuple import pytest import torch from ludwig.modules import reduction_modules DEVICE = "cuda" if torch.cuda.is_available() else "cpu" @pytest.mark.parametrize("reduce_mode", ["last", "sum", "mean", "avg", "max", "concat", "attention", None]) @pytest.mark.parametrize("test_input_shape", [(16, 1, ...
2
0
0
0
2
0
pwncat/facts/ability.py
Mitul16/pwncat
1,454
1684827
<reponame>Mitul16/pwncat<filename>pwncat/facts/ability.py """ Classes implementing specific abilities. Abilities provide access to specific actions as a different user. They are used when escalating privileges. Basic ability types are defined such as file read, file write and shell execution. This module also defines c...
0
0
0
0
0
0
autoencoder/datasets/wiki10plus.py
hugochan/K-Competitive-Autoencoder-for-Text-Analytics
133
1684854
''' Created on Jan, 2017 @author: hugo ''' from __future__ import absolute_import import os import re import numpy as np from random import shuffle from collections import Counter from ..preprocessing.preprocessing import init_stopwords, tiny_tokenize_xml, tiny_tokenize, get_all_files, count_words from ..datasets.re...
0
0
0
0
0
0
tests/test_legends.py
hgroll/tikzplotlib
1,088
1684869
def plot() -> object: import numpy as np from matplotlib import pyplot as plt fig = plt.figure() x = np.ma.arange(0, 2 * np.pi, 0.4) y = np.ma.sin(x) y1 = np.sin(2 * x) y2 = np.sin(3 * x) ym1 = np.ma.masked_where(y1 > 0.5, y1) ym2 = np.ma.masked_where(y2 < -0.5, y2) lines = pl...
0
1
0
0
1
0
Codes/GinRyan/LeetCode/Python-3-Solves/3_longest_substring_without_repeating_characters.py
liuxiaohui1221/algorithm
256
1684895
""" 给定一个字符串,请你找出其中不含有重复字符的 最长子串 的长度。 示例 1: 输入: "abcabcbb" 输出: 3 解释: 因为无重复字符的最长子串是 "abc",所以其长度为 3。 示例 2: 输入: "bbbbb" 输出: 1 解释: 因为无重复字符的最长子串是 "b",所以其长度为 1。 示例 3: 输入: "pwwkew" 输出: 3 解释: 因为无重复字符的最长子串是 "wke",所以其长度为 3。 请注意,你的答案必须是 子串 的长度,"pwke" 是一个子序列,不是子串。 """ """ 解题思考1: 最通用的想法是,按照逐项进行比对是否存在重复项,来获取最长可能 子串长...
1
1
0
0
2
0
Scripts/Web_Scrappers/Pycon_Proposals/pycon_proposals.py
ShivangiPatel102/Python_and_the_Web
437
1684931
import requests from bs4 import BeautifulSoup as bs import pandas as pd def scrape_divs() -> object: """This function scrapes all the proposal elements and stores them in a list. """ response = requests.get("https://in.pycon.org/cfp/2020/proposals/") soup = bs(response.content, "html.parser") ...
0
1
0
0
1
0
python/oneflow/framework/tensor_str.py
grybd/oneflow
3,285
1684936
<gh_stars>1000+ """ Copyright 2020 The OneFlow 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 appli...
0
0
0
0
0
0
utils/threat-mvp/read_json_td.py
theelizabethgrace/threat-dragon
275
1684957
import logger as log import mail import json def read_json(threatJasonPath) -> object: try: # read the Threat Dragon JSON file JSON_file = open(threatJasonPath, 'r') dataTM = JSON_file.read() JSON_file.close() # return a dictionary obj = json.loads(dataTM) ...
0
1
0
0
1
0
docs/user-guide/resources/mqtt-over-ssl/one-way-ssl-mqtt-client.py
OKhalkov/thingsboard.github.io
105
1684960
<reponame>OKhalkov/thingsboard.github.io<gh_stars>100-1000 # # Copyright © 2016-2020 The Thingsboard 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/lice...
0
0
0
0
0
0
tools/Vitis-AI-Quantizer/vai_q_pytorch/pytorch_binding/pytorch_nndct/utils/summary.py
bluetiger9/Vitis-AI
848
1684968
# Copyright 2019 Xilinx 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 writing, ...
1
9
3
3
16
0
angr/storage/memory_mixins/simple_interface_mixin.py
Kyle-Kyle/angr
6,132
1684980
from __future__ import annotations import claripy from . import MemoryMixin from ...errors import SimMemoryError class SimpleInterfaceMixin(MemoryMixin): def load(self, addr, size: object | None=None, endness: object | None=None, condition: object | None=None, fallback: object | None=None, **kwargs) -> object: ...
7
6
0
0
13
0
table_plugin.py
akrabat/SublimeTableEditor
313
1685024
<filename>table_plugin.py # table_plugin.py - sublime plugins for pretty print text table # Copyright (C) 2012 Free Software Foundation, Inc. # Author: <NAME> # Package: SublimeTableEditor # Homepage: https://github.com/vkocubinsky/SublimeTableEditor # This file is part of SublimeTableEditor. # SublimeTableEditor ...
0
0
0
0
0
0
objectdetection/__init__ .py
aierh/autoML
185
1685032
from .trial_adapter import TrialAdapter
0
0
0
0
0
0
BaseTools/Tests/RunTests.py
vijayakumar-xlnx/edk2
3,861
1685046
## @file # Unit tests for BaseTools utilities # # Copyright (c) 2008, Intel Corporation. All rights reserved.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # import os import sys import unittest try: import distutils.util except ModuleNotFoundError: sys.exit(''...
0
3
0
0
3
0
code/stuff/service_sensor.py
amjadmajid/rosbook
442
1685048
#!/usr/bin/env python from math import pi from fake_sensor import FakeSensor import rospy import tf from geometry_msgs.msg import Quaternion from stuff.srv import FakeSensor,FakeSensorResponse def make_quaternion(angle) -> object: q = tf.transformations.quaternion_from_euler(0, 0, angle) return Quaternion...
0
2
0
0
2
0
rllib/env/wrappers/model_vector_env.py
linyiyue/ray
21,382
1685066
from __future__ import annotations import logging import numpy as np from gym.spaces import Discrete from ray.rllib.utils.annotations import override from ray.rllib.env.vector_env import VectorEnv from ray.rllib.evaluation.rollout_worker import get_global_worker from ray.rllib.env.base_env import BaseEnv from ray.rllib...
7
5
0
0
12
0
tests/exchange2010/fixtures.py
tedeler/pyexchange
128
1685088
<filename>tests/exchange2010/fixtures.py # -*- coding: utf-8 -*- """ (c) 2013 LinkedIn Corp. 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/LICEN...
0
0
0
0
0
0
mne/datasets/epilepsy_ecog/__init__.py
rylaw/mne-python
1,953
1685096
"""Clinical epilepsy datasets.""" from ._data import data_path, has_epilepsy_ecog_data, get_version
0
0
0
0
0
0
source/input_output/extractHelix.py
NBDsoftware/masif
309
1685102
from __future__ import annotations from Bio.PDB import * # Exclude disordered atoms. class NotDisordered(Select): def accept_atom(self, atom) -> object: return not atom.is_disordered() or atom.get_altloc() == 'A' def extractHelix(helix, infilename, outfilename, chain_ids: object | None=None, includeWate...
3
1
0
0
4
0
강의 자료/02-알고리즘/15~17-동적 프로그래밍/문제별 코드/11057-오르막 수/solution.py
rhs0266/FastCampus
407
1685104
<reponame>rhs0266/FastCampus<filename>강의 자료/02-알고리즘/15~17-동적 프로그래밍/문제별 코드/11057-오르막 수/solution.py import sys si = sys.stdin.readline n = int(si()) dy = [[0] * 10 for _ in range(n + 1)] # 초기값 구하기 for num in range(10): dy[1][num] = 1 # 점화식을 토대로 dy 배열 채우기 for len in range(2, n + 1): for num in range(10): ...
0
0
0
0
0
0
android_webview/tools/update_cts.py
chromium/chromium
14,668
1685118
<reponame>chromium/chromium<filename>android_webview/tools/update_cts.py<gh_stars>1000+ #!/usr/bin/env vpython3 # Copyright 2020 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. """Update CTS Tests to a new version.""" from...
0
0
0
0
0
0
migrations/versions/fb49c4643d00_add_export_token_system.py
chrononyan/ok
148
1685121
"""Add export token system Revision ID: fb49c4643d00 Revises: 9bc6f244678d Create Date: 2021-05-27 19:03:26.637151 """ # revision identifiers, used by Alembic. revision = '<KEY>' down_revision = '<KEY>' from alembic import op import sqlalchemy as sa import server def upgrade(): # ### commands auto generated b...
0
0
0
0
0
0
sdk/python/feast/infra/__init__.py
Mwad22/feast
2,258
1685131
# from .provider import Provider
0
0
0
0
0
0
Pipeline/model.py
Yavari/ambar
1,963
1685164
<gh_stars>1000+ from datetime import datetime from hashlib import sha256 from os import path import re import io import hashlib import base64 import json class ExternalNER: def __init__(self): self.id = '' self.uri = '' @classmethod def Init(cls, Id, Uri): eNER = cls() eNER...
0
0
0
0
0
0
king_phisher/client/graphs.py
chachabooboo/king-phisher
1,143
1685176
<gh_stars>1000+ #!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/graphs.py # # 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...
0
0
0
0
0
0
tools/hashgen/hashgen.py
DaveeFTW/infinity
137
1685178
<filename>tools/hashgen/hashgen.py #!/usr/bin/env python3 import argparse import hashlib def hash(file): if file[0] == '*': return bytearray.fromhex(file[1:]) else: with open(file, 'rb') as f: return hashlib.sha1(f.read()).digest() def split_values(x): s = x.split('=') ret...
0
0
0
0
0
0
SCRAPE/Lib/site-packages/twisted/logger/_util.py
Chinmoy-Prasad-Dutta/scrapy_scraper
4,612
1685192
# -*- test-case-name: twisted.logger.test.test_util -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Logging utilities. """ from typing import List from ._interfaces import LogTrace from ._logger import Logger def formatTrace(trace: LogTrace) -> str: """ Format a trace (that ...
2
2
1
0
5
0
modules/dbnd/test_dbnd/task/parameters/test_parameter_custom_load_save.py
ipattarapong/dbnd
224
1685231
import logging from pandas import DataFrame from dbnd import parameter, task from targets import target from targets.target_config import FileFormat logger = logging.getLogger(__name__) @task(result=parameter.save_options(FileFormat.csv, header=False)[DataFrame]) def read_first_lines(lines=parameter.load_options(...
0
1
0
0
1
0
python/cudf/cudf/tests/test_quantiles.py
Ahsantw/cudf
239
1685233
<filename>python/cudf/cudf/tests/test_quantiles.py<gh_stars>100-1000 # Copyright (c) 2020-2022, NVIDIA CORPORATION. import re import pandas as pd import pytest import cudf from cudf.testing._utils import assert_eq, assert_exceptions_equal def test_single_q(): q = 0.5 pdf = pd.DataFrame({"a": [4, 24, 13, 8...
0
0
0
0
0
0
src/exabgp/bgp/message/open/capability/hostname.py
pierky/exabgp
1,560
1685256
<gh_stars>1000+ # encoding: utf-8 """ hostname.py Created by <NAME> on 2015-05-16. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ # https://tools.ietf.org/html/draft-walton-bgp-hostname-capability-02 from exabgp.bgp.message.open.capability.capability i...
0
0
0
0
0
0
django-migrations/bitcoin_tracker/historical_data/models.py
syberflea/materials
3,682
1685262
from django.db import models class PriceHistory(models.Model): date = models.DateTimeField(auto_now_add=True) price = models.DecimalField(max_digits=7, decimal_places=2) volume = models.DecimalField(max_digits=7, decimal_places=3)
0
0
0
0
0
0
kolibri/core/webpack/test/test_webpack_tags.py
MBKayro/kolibri
545
1685267
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from django.test.testcases import TestCase from .base import Hook from kolibri.plugins.hooks import register_hook class KolibriTagNavigationTestCase(TestCase): def setUp(self): super(Koli...
0
0
0
0
0
0
chrome/test/mini_installer/test_chrome_with_chromedriver.py
zealoussnow/chromium
14,668
1685292
# Copyright 2018 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. from __future__ import annotations """Test Chrome using chromedriver. If the webdriver API or the chromedriver.exe binary can't be found this becomes a no-op...
0
4
0
0
4
0
tools/clang/bindings/python/tests/cindex/test_type.py
oubotong/Armariris
1,073
1685296
<reponame>oubotong/Armariris<gh_stars>1000+ import gc from clang.cindex import CursorKind from clang.cindex import TranslationUnit from clang.cindex import TypeKind from nose.tools import raises from .util import get_cursor from .util import get_tu kInput = """\ typedef int I; struct teststruct { int a; I b; ...
0
0
0
0
0
0
src/model_convert.py
eps696/stylegan2ada
153
1685312
import os import argparse import pickle import numpy as np import torch import torch.nn.functional as F import dnnlib import legacy from util.utilgan import basename, calc_init_res try: # progress bar for notebooks get_ipython().__class__.__name__ from util.progress_bar import ProgressIPy as ProgressBar exc...
6
5
0
0
11
0
test/test_causal_conv.py
caraneel/tensorflow-wavenet
5,698
1685333
<filename>test/test_causal_conv.py """Unit tests for the causal_conv op.""" import numpy as np import tensorflow as tf from wavenet import time_to_batch, batch_to_time, causal_conv class TestCausalConv(tf.test.TestCase): def testCausalConv(self): """Tests that the op is equivalent to a numpy implementa...
0
0
0
0
0
0
corehq/ex-submodules/casexml/apps/case/cleanup.py
akashkj/commcare-hq
471
1685351
<gh_stars>100-1000 from uuid import uuid4 from xml.etree import cElementTree as ElementTree from django.conf import settings from casexml.apps.case.const import DEFAULT_CASE_INDEX_IDENTIFIERS, CASE_INDEX_EXTENSION from casexml.apps.case.exceptions import CommCareCaseError from casexml.apps.case.mock import CaseBlock,...
0
0
0
0
0
0
source/models/domain_factor_backbone.py
SizheWei/OpenCompoundDomainAdaptation-OCDA
136
1685362
import torch.nn as nn from .utils import register_model @register_model('DomainFactorBackbone') class DomainFactorBackbone(nn.Module): def __init__(self): super(DomainFactorBackbone, self).__init__() self.num_channels: int = 3 self.setup_net() def setup_net(self): se...
0
1
0
1
2
0
source/interprocedural_analyses/taint/test/integration/functions_as_locals.py
ekmixon/pyre-check
5,975
1685367
<reponame>ekmixon/pyre-check<filename>source/interprocedural_analyses/taint/test/integration/functions_as_locals.py<gh_stars>1000+ # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # flake8: n...
0
0
0
0
0
0
python-package/lets_plot/plot/pos.py
IKrukov-HORIS/lets-plot
768
1685372
<reponame>IKrukov-HORIS/lets-plot<filename>python-package/lets_plot/plot/pos.py<gh_stars>100-1000 # # Copyright (c) 2019. JetBrains s.r.o. # Use of this source code is governed by the MIT license that can be found in the LICENSE file. # from .core import FeatureSpec # # Position Adjustments # __all__ = ['position_dodg...
0
0
0
0
0
0
test/PerfTests/Python/SubOrchestrationFanOutFanInOrchestrator/__init__.py
KeesV/azure-functions-durable-extension
619
1685386
<reponame>KeesV/azure-functions-durable-extension import logging import json import azure.functions as func import azure.durable_functions as df def orchestrator_function(context: df.DurableOrchestrationContext): num_activities = context.get_input() tasks = [] for _ in range(num_activities): tas...
0
0
0
0
0
0
droidlet/perception/semantic_parsing/nsp_templated_data_generation/template_objects/fill.py
ali-senguel/fairo
669
1685412
""" Copyright (c) Facebook, Inc. and its affiliates. This file contains template objects associated with Fill action. """ import random from ..generate_utils import * from ..tree_components import * from .template_object import * from .dig import * ##################### ## FILL TEMPLATES ### ##################### ...
18
4
0
0
22
0
armi/physics/fuelCycle/__init__.py
keckler/armi
162
1685444
<filename>armi/physics/fuelCycle/__init__.py # 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 req...
0
0
0
0
0
0
pysc2/tests/host_remote_agent_test.py
zeuseyera/pysc2
8,095
1685480
#!/usr/bin/python # 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 ...
0
0
0
0
0
0
aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/GetOfficePreviewURLRequest.py
leafcoder/aliyun-openapi-python-sdk
1,001
1685518
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
0
10
0
0
10
0
raiden/tests/unit/channel_state/test_time_lock.py
tirkarthi/raiden
2,101
1685528
# pylint: disable=too-many-locals,too-many-statements,too-many-lines import random from hashlib import sha256 from itertools import cycle from eth_utils import keccak from raiden.constants import EMPTY_SIGNATURE, UINT64_MAX from raiden.messages.decode import balanceproof_from_envelope from raiden.messages.transfers i...
0
0
0
0
0
0
extras/filters.py
maznu/peering-manager
127
1685533
<gh_stars>100-1000 import django_filters from django.contrib.auth.models import User from django.db.models import Q from utils.filters import BaseFilterSet, ContentTypeFilter from .enums import HttpMethod, JobResultStatus from .models import IXAPI, JobResult, Webhook class IXAPIFilterSet(BaseFilterSet): q = dja...
0
0
0
0
0
0
2017/04/Using Flask-Mail to Send Email Confirmation Links/confirm_email/app.py
kenjitagawa/youtube_video_code
492
1685558
from __future__ import annotations from flask import Flask, request, url_for from flask_mail import Mail, Message from itsdangerous import URLSafeTimedSerializer, SignatureExpired app = Flask(__name__) app.config.from_pyfile('config.cfg') mail = Mail(app) s = URLSafeTimedSerializer('Thisisasecret!') @ap...
0
2
0
0
2
0
upload_image_to_telegraph.py
DazEB2/SimplePyScripts
117
1685570
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' def upload_image_to_telegraph(file_name_or_url: str) -> str: import requests user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:44.0) Gecko/20100101 Firefox/44.0' headers = { 'X-Requested-With': 'XMLHttpRequest', 'A...
1
1
0
0
2
0
rssant_api/migrations/0026_feedstorystat.py
zuzhi/rssant
1,176
1685571
# Generated by Django 2.2.12 on 2020-05-23 14:00 from django.db import migrations, models import ool class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('rssant_api', '0025_auto_20200516_0959'), ] operations: list[object] = [ migrations.CreateModel( ...
0
0
2
0
2
0
src/win/RT10yy_efuseWin_BootCfg1.py
ufo2011/NXP-MCUBootUtility
174
1685611
<filename>src/win/RT10yy_efuseWin_BootCfg1.py # -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version Aug 8 2018) ## http://www.wxformbuilder.org/ ## ## PLEASE DO *NOT* EDIT THIS FILE! ####################################...
0
0
0
0
0
0
scale/recipe/diff/json/diff_v6.py
kaydoh/scale
121
1685612
from __future__ import annotations """Manages the v6 recipe diff schema""" from __future__ import unicode_literals from jsonschema import validate from jsonschema.exceptions import ValidationError from recipe.diff.exceptions import InvalidDiff SCHEMA_VERSION = '7' SCHEMA_VERSIONS = ['6', '7'] RECIPE_DIFF_SCHEMA = ...
2
4
0
0
6
0
UGformerV1_TF/UGformerV1_Sup.py
daiquocnguyen/Graph-Transformer
269
1685620
import tensorflow as tf import universal_transformer_modified class UGformerV1(object): def __init__(self, feature_dim_size, hparams_batch_size, ff_hidden_size, seq_length, num_classes, num_self_att_layers, num_GNN_layers: int=1): # Placeholders for input, output self.input_x = tf.compat.v1.placeho...
2
1
0
1
4
0
gen2-spi/mobilenet-raw-parsing/main.py
wasauce/depthai-experiments
381
1685633
import cv2 import sys import numpy as np import depthai as dai from time import sleep ''' This example attaches a NeuralNetwork node directly to the SPI output. The corresponding ESP32 example shows how to decode it. Make sure you have something to handle the SPI protocol on the other end! See the included ESP32 exam...
0
1
0
0
1
0
tests/test_plot.py
Conzel/CompressAI
515
1685643
# Copyright (c) 2021-2022, InterDigital Communications, Inc # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted (subject to the limitations in the disclaimer # below) provided that the following conditions are met: # * Redistributions of source cod...
0
0
0
0
0
0
src/tree/1026.maximum-difference-between-node-and-ancestor/maximum-difference-between-node-and-ancestor.py
lyphui/Just-Code
782
1685645
<gh_stars>100-1000 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def maxAncestorDiff(self, root: TreeNode) -> int: maxLeft = self.maxHelper(root.left, root.val, root.val) ...
0
0
0
0
0
0
libraries/botbuilder-core/botbuilder/core/re_escape.py
Fl4v/botbuilder-python
388
1685647
<gh_stars>100-1000 # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # SPECIAL_CHARS # closing ')', '}' and ']' # '-' (a range in character set) # '&', '~', (extended character set operations) # '#' (comment) and WHITESPACE (ignored) in verbose mode SPECIAL_CHARS_MAP...
0
0
0
0
0
0
private/scripts/pending-requests.py
earora97/stopstalk-deployment
342
1685654
<gh_stars>100-1000 """ Copyright (c) 2015-2020 <NAME>(<EMAIL>), StopStalk Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the righ...
0
0
0
0
0
0
scripts/release-distribution.py
johnbywater/quantdsl
269
1685686
<reponame>johnbywater/quantdsl #!/usr/bin/env python import os import subprocess import sys def build_and_release(cwd): # Build and upload to PyPI. subprocess.check_call(['pip', 'install', '-U', 'pip', 'setuptools', 'twine'], cwd=cwd) subprocess.check_call(['rm', '-rf', 'dist/'], cwd=cwd) subprocess.c...
0
0
0
0
0
0
SoftLayer/CLI/email/list.py
dvzrv/softlayer-python
126
1685701
<reponame>dvzrv/softlayer-python """Lists Email Delivery Service """ # :license: MIT, see LICENSE for more details. import click from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.managers.account import AccountManager from SoftLayer.managers.email import EmailManager from SoftL...
0
0
0
0
0
0
mapproxy/source/error.py
gravitystorm/mapproxy
347
1685717
<gh_stars>100-1000 # This file is part of the MapProxy project. # Copyright (C) 2012 Omniscale <http://omniscale.de> # # 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...
0
0
0
0
0
0
tests/unit/core/components/test_module_type.py
blade2005/runway
134
1685719
"""Test runway.core.components._module_type.""" # pylint: disable=no-self-use # pyright: basic from __future__ import annotations import logging from typing import TYPE_CHECKING, List, Type import pytest from runway.core.components import RunwayModuleType from runway.module.cdk import CloudDevelopmentKit from runway...
12
5
0
0
17
0
misc/rewards.py
Yinan-Zhao/AoANet
344
1685729
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import time import misc.utils as utils from collections import OrderedDict import torch import sys sys.path.append("cider") from pyciderevalcap.ciderD.ciderD import CiderD sys.path.append("c...
0
2
0
0
2
0
util/__init__.py
cosmos-org/ml-toolkit
710
1685740
<reponame>cosmos-org/ml-toolkit<filename>util/__init__.py from .util import *
0
0
0
0
0
0
examples/test_tri_quadratic.py
sampotter/meshpy
353
1685778
<reponame>sampotter/meshpy # Quadratic element demo, by <NAME> import numpy as np import matplotlib.pyplot as plt from meshpy.triangle import MeshInfo, build # Utility function to create lists of the form [(1,2), (2,3), (3,4), # (4,1)], given two numbers 1 and 4 from itertools import islice, cycle def loop(a, b): ...
0
0
0
0
0
0
Chapter_10/ch10_ex6.py
pauldevos/Mastering-Object-Oriented-Python-Second-Edition
108
1685793
#!/usr/bin/env python3.7 """ Mastering Object-Oriented Python 2e Code Examples for Mastering Object-Oriented Python 2nd Edition Chapter 10. Example 6. XML """ # Persistence Classes # ======================================== # A detail class for micro-blog posts import datetime from dataclasses import dataclass, fie...
2
11
10
0
23
0
osf/migrations/0142_change_registration_schemas.py
gaybro8777/osf.io
628
1685802
from __future__ import unicode_literals import logging from django.db import migrations from osf.utils.migrations import ensure_schemas logger = logging.getLogger(__file__) class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('osf', '0141_merge_20181023_1526'), ] o...
0
0
2
0
2
0
opsdroid/tests/test_core.py
JiahnChoi/opsdroid.kr
712
1685866
<filename>opsdroid/tests/test_core.py import os import signal import threading import asynctest.mock as amock import pytest from opsdroid.core import OpsDroid @pytest.mark.skipif(os.name == "nt", reason="SIGHUP unsupported on windows") @pytest.mark.isolate_signal_test def test_signals(event_loop): pid = os.getp...
0
0
0
0
0
0
extraPackages/matplotlib-3.0.3/examples/mplot3d/pathpatch3d.py
dolboBobo/python3_ios
130
1685874
<gh_stars>100-1000 """ ============================ Draw flat objects in 3D plot ============================ Demonstrate using pathpatch_2d_to_3d to 'draw' shapes and text on a 3D plot. """ import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Circle, PathPatch from matplotlib.text import...
0
0
0
0
0
0
utils/visualization.py
CharlesAuthier/geo-deep-learning
121
1685900
<gh_stars>100-1000 import logging import math import re import warnings from pathlib import Path import numpy as np import torch import torch.nn.functional as F from PIL import Image from matplotlib import pyplot as plt, gridspec, cm, colors import csv from utils.utils import unscale, unnormalize, get_key_def from ut...
0
0
0
0
0
0
Chapter 11/ch11_r07.py
PacktPublishing/Modern-Python-Cookbook
107
1685901
<gh_stars>100-1000 """Python Cookbook Chapter 11, recipe 7. """ import unittest import random def resample(population, N): for i in range(N): sample = random.choice(population) yield sample class GIVEN_resample_WHEN_evaluated_THEN_fair(unittest.TestCase): def setUp(self): self.data =...
0
0
0
0
0
0
src/azure-cli/azure/cli/command_modules/iot/_constants.py
YuanyuanNi/azure-cli
3,287
1685935
<filename>src/azure-cli/azure/cli/command_modules/iot/_constants.py # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # ...
0
0
0
0
0
0
examples/102_mean_curv_flow/tools/paraview.py
ChristopherKotthoff/Aphros-with-GraphContraction
252
1685944
<gh_stars>100-1000 from paraview.simple import * paraview.simple._DisableFirstRenderCameraReset() renderView1 = GetRenderView() renderView1.InteractionMode = '2D' if 'base' not in globals(): base = 'sides4' nx032 = LegacyVTKReader( registrationName='nx032', FileNames=[ base + '_nx032/s_0000.vtk',...
0
0
0
0
0
0
src/hg/makeDb/gnomad/aaToGenomic.py
andypohl/kent
171
1685948
#!/usr/bin/env python3 from __future__ import annotations """ Given a 1-based amino acid range, and a bed12 of transcripts, convert the amino acid range to a genomic range with exon blocks. This program is currently specialized to the gnomad missense constraint track, but can be more generalized if the score conversi...
3
6
0
0
9
0
google/cloud/aiplatform/utils/json_utils.py
dizcology/python-aiplatform
180
1685956
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
7
3
0
0
10
0
alipay/aop/api/domain/KoubeiMerchantDeviceCrashinfoUploadModel.py
snowxmas/alipay-sdk-python-all
213
1685958
<reponame>snowxmas/alipay-sdk-python-all #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class KoubeiMerchantDeviceCrashinfoUploadModel(object): def __init__(self): self._event_time = None self._extend_info = None self._hardw...
0
0
0
0
0
0
observations/r/boston.py
hajime9652/observations
199
1685968
<gh_stars>100-1000 # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import numpy as np import os import sys from observations.util import maybe_download_and_extract def boston(path): """Housing Values in Suburbs of Bost...
0
0
0
0
0
0
netket/nn/__init__.py
wdphy16/netket
352
1685986
<gh_stars>100-1000 # Copyright 2021 The NetKet 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 requ...
0
0
0
0
0
0
Contrib/delpozzo/tools/sendFile.py
veekooFIN/gigatron-rom
172
1685988
<filename>Contrib/delpozzo/tools/sendFile.py #!/usr/bin/env python3 #----------------------------------------------------------------------- # # sendFile.py -- Send file to Gigatron through Arduino as interface # #----------------------------------------------------------------------- # # Examples: # # Utils/sendFil...
0
0
0
0
0
0
AutoDL_sample_code_submission/at_speech/classifier/thinresnet34_cls.py
dianjixz/AutoDL
1,044
1685991
<reponame>dianjixz/AutoDL<gh_stars>1000+ from __future__ import absolute_import import os import numpy as np import keras from keras import backend as K from keras.callbacks import Callback, EarlyStopping, LearningRateScheduler from at_toolkit.interface.adl_classifier import AdlOfflineClassifier, AdlOnlineClassifier #...
0
0
0
0
0
0
tests/build/test_build_hpo.py
Clinical-Genomics/scout
111
1686010
from scout.build.hpo import build_hpo_term import pytest def test_build_hpo_term(adapter, test_hpo_info): ## GIVEN a hpo term ## WHEN building the hpo term hpo_obj = build_hpo_term(test_hpo_info) ## THEN assert that the term has the correct information assert hpo_obj["_id"] == hpo_obj["hpo_id"] ==...
0
0
0
0
0
0
src/azure-cli-core/azure/cli/core/tests/test_add_resourcegroup_transform.py
YuanyuanNi/azure-cli
3,287
1686031
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
0
0
4
0
4
0
examples/00_empty_scene/generate_camera_trajectory.py
americast/ml-hypersim
1,246
1686032
# # For licensing see accompanying LICENSE.txt file. # Copyright (C) 2020 Apple Inc. All Rights Reserved. # from pylab import * import h5py import pandas as pd import sklearn.preprocessing print("Begin...") # parameters reconstruction_roi_min = array([ -8000.0, -8000.0, 0.0 ]) reconstruction_roi_max = array([ 8000...
0
0
0
0
0
0
tornado/test/httputil_test.py
CPedrini/TateTRES
285
1686034
#!/usr/bin/env python from __future__ import absolute_import, division, with_statement from tornado.httputil import url_concat, parse_multipart_form_data, HTTPHeaders from tornado.escape import utf8 from tornado.testing import LogTrapTestCase from tornado.util import b import logging import unittest class TestUrlCo...
0
0
0
0
0
0
benedict/utils/type_util.py
fabiocaccamo/python-benedict
365
1686072
<reponame>fabiocaccamo/python-benedict # -*- coding: utf-8 -*- from datetime import datetime from decimal import Decimal from six import integer_types, string_types import re regex = re.compile('').__class__ uuid_re = re.compile( '^([0-9a-f]{32}){1}$|^([0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}){1}$', flags=r...
0
0
0
0
0
0
pycharm2020.1.3/script/lobby_entity/Avatar.py
LaudateCorpus1/realtime-server
465
1686113
<reponame>LaudateCorpus1/realtime-server<filename>pycharm2020.1.3/script/lobby_entity/Avatar.py<gh_stars>100-1000 from LobbyEntity import LobbyEntity from common.component.ComponentSupport import ComponentSupport from common.component.Component import components from component.avatar.CompAvatarTest import CompAvatarTes...
0
0
0
0
0
0
core/commands/show_file_at_commit.py
timfjord/GitSavvy
116
1686157
<gh_stars>100-1000 import os import sublime from sublime_plugin import TextCommand, WindowCommand from ..git_command import GitCommand from ..runtime import enqueue_on_worker, run_as_text_command, text_command from ..utils import flash, focus_view from ..view import capture_cur_position, replace_view_content, Positio...
0
0
0
0
0
0
sdk/python/pulumi_azure/advisor/get_recommendations.py
henriktao/pulumi-azure
109
1686173
<filename>sdk/python/pulumi_azure/advisor/get_recommendations.py<gh_stars>100-1000 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime ...
0
0
0
0
0
0
model/train.py
limuyiju/Cam2BEV
335
1686179
#!/usr/bin/env python # ============================================================================== # MIT License # # Copyright 2020 Institute for Automotive Engineering of RWTH Aachen University. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated docu...
0
1
0
0
1
0
example/train.py
ugotaro/sam
943
1686184
import argparse import torch from model.wide_res_net import WideResNet from model.smooth_cross_entropy import smooth_crossentropy from data.cifar import Cifar from utility.log import Log from utility.initialize import initialize from utility.step_lr import StepLR from utility.bypass_bn import enable_running_stats, dis...
0
0
0
0
0
0
tests/test_convergence_h2.py
reverendbedford/scikit-fem
238
1686206
from unittest import TestCase import numpy as np from skfem import BilinearForm, LinearForm, Functional, asm, condense, solve from skfem.helpers import dd, ddot from skfem.mesh import MeshQuad, MeshTri, MeshLine from skfem.element import (ElementQuadBFS, ElementTriArgyris, ElementTriMorley, ...
0
12
20
0
32
0
manila/db/migrations/alembic/versions/478c445d8d3e_add_security_service_update_control_fields.py
openstack/manila
159
1686214
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
0
0
0
0
0
0
layers.py
EdwardSmith1884/GEOMetrics
123
1686221
<gh_stars>100-1000 import math import numpy as np import torch import random from torch.nn.parameter import Parameter from torch import nn as nn from torch.nn.modules.module import Module import torch.nn.functional as F import torch class ZERON_GCN(Module): def __init__(self, in_features, out_features, bias=True)...
0
0
0
0
0
0
darglint/custom_assert.py
s-weigand/darglint
405
1686226
"""Defines a custom assert function for darglint.""" from .config import ( get_logger, get_config, AssertStyle, ) from typing import ( Any, Optional, ) def Assert(expr, message) -> None: # type: (Any, Optional[str]) -> None """Asserts that the given expression is true. Args: ex...
0
1
0
0
1
0
dataviz/timeline_mukachevo.py
Udzu/pudzu
119
1686256
<filename>dataviz/timeline_mukachevo.py from pudzu.charts import * from pudzu.dates import * df = pd.read_csv("datasets/timeline_mukachevo.csv") START, END, INTERVAL = 1000, 2000, 250 PHOTOS = ["https://europebetweeneastandwest.files.wordpress.com/2014/06/palanok-castle-atop-lumkova-hill-and-munkacs1.jpg", "htt...
0
0
0
0
0
0
examples/src/adult-income/data_loader.py
dumpmemory/PERSIA
283
1686271
import os from tqdm import tqdm from persia.embedding.data import PersiaBatch from persia.logger import get_logger from persia.ctx import DataCtx from data_generator import make_dataloader logger = get_logger("data_loader") train_filepath = os.path.join( os.path.dirname(os.path.realpath(__file__)), "data/train...
0
0
0
0
0
0
examples/src/dbnd_examples/tests/documentation/orchestration/spark_integration/test_doc_spark_engine_configuration.py
busunkim96/dbnd
224
1686274
"""#### DOC START from dbnd import output, parameter from dbnd_spark import SparkConfig, SparkTask class WordCountTask(SparkTask): text = parameter.data counters = output main_class = WORD_COUNT_MAIN_CLASS # overides value of SparkConfig object defaults = {SparkConfig.driver_memory: "2.5g"} ...
0
0
0
0
0
0