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
src/dbutils/database.py
piwaniuk/critic
216
1702970
<reponame>piwaniuk/critic<filename>src/dbutils/database.py # -*- mode: python; encoding: utf-8 -*- # # Copyright 2012 <NAME>, Opera Software ASA # # 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 ...
0
0
0
0
0
0
xdl/xdl/python/io/global_reader_state_hook.py
Ru-Xiang/x-deeplearning
4,071
1703009
# Copyright 2018 Alibaba Group. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
1
1
0
1
3
0
src/visitpy/visit_utils/tests/test_qannote_circle.py
visit-dav/vis
226
1703036
# Copyright (c) Lawrence Livermore National Security, LLC and other VisIt # Project developers. See the top-level LICENSE file for dates and other # details. No copyright assignment is required to contribute to VisIt. """ author: <NAME> (<EMAIL>) description: Tests for qannote module. """ import unittest ...
0
1
0
0
1
0
MyTools/lightup.py
unity3d-jp/AnotherThread
181
1703042
<filename>MyTools/lightup.py import sys import Image import colorsys import ImageDraw import math def convert(img): rgb_img = img.convert('RGBA') img = Image.new('RGBA', rgb_img.size, (0x00,0x00,0x00,0xff)) draw = ImageDraw.Draw(img) x,y = rgb_img.size for i in range(0,x): for j in range(0...
0
0
0
0
0
0
html_parsing/get_set_sushi_list__sushivkusno.com.py
DazEB2/SimplePyScripts
117
1703083
<gh_stars>100-1000 #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import re from bs4 import BeautifulSoup import requests rs = requests.get('http://sushivkusno.com/category/nabory-siety') print(rs) root = BeautifulSoup(rs.content, 'lxml') items = root.select('.CardContent') for i, product...
0
0
0
0
0
0
cfgov/retirement_api/tests/test_views.py
Colin-Seifer/consumerfinance.gov
156
1703096
<reponame>Colin-Seifer/consumerfinance.gov<gh_stars>100-1000 import datetime import json # import unittest from django.http import HttpRequest from django.test import TestCase from retirement_api.views import ( estimator, get_full_retirement_age, income_check, param_check, ) try: from django.url...
0
0
0
0
0
0
examples/blog.py
colinmford/coldtype
142
1703114
<reponame>colinmford/coldtype from coldtype import * from coldtype.warping import warp_fn from coldtype.fx.skia import color_phototype """If you add this code to a file in the coldtype repo, you can run it as `coldtype name-of-file.py`""" obv = Font.Cacheable("assets/ColdtypeObviously-VF.ttf") logos = raw_ufo("assets...
0
0
0
0
0
0
src/arch/x86/isa/insts/general_purpose/compare_and_test/set_byte_on_condition.py
qianlong4526888/haha
135
1703120
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
0
0
0
0
0
0
grin-py/grinlib/payments.py
f6380154/grin-pool
130
1703143
#!/usr/bin/env python # Copyright 2018 <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/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
1
6
0
0
7
0
custom_components/volkswagencarnet/config_flow.py
zzarne/homeassistant-volkswagencarnet
161
1703154
<gh_stars>100-1000 import homeassistant.helpers.config_validation as cv import logging import voluptuous as vol from homeassistant import config_entries from homeassistant.config_entries import ConfigEntry from homeassistant.const import ( CONF_NAME, CONF_PASSWORD, CONF_RESOURCES, CONF_SCAN_INTERVAL, ...
0
0
0
0
0
0
dirigible/fts/tests/test_2554_SlicingInFormulae.py
EnoX1/dirigible-spreadsheet
168
1703169
<filename>dirigible/fts/tests/test_2554_SlicingInFormulae.py # Copyright (c) 2010 Resolver Systems Ltd. # All Rights Reserved # from functionaltest import FunctionalTest class Test_2554_SlicingInFormulae(FunctionalTest): def test_formulas_work_properly(self): # * Harold logs in to Dirigible and creates ...
0
0
0
0
0
0
babi/data/symbolic_preprocess.py
zlgenuine/GGNN
280
1703178
""" Preprocess the bAbI symbolic data into a nicer form. <NAME>, 10/2015 """ import os import sys import argparse def parse_dataset(file_name, edge_type_dict: dict[object,object]={}, node_id_dict: dict[object,object]={}, question_type_dict: dict[object,object]={}, label_dict: dict[object,object]={}) -> tuple[object,...
4
1
0
0
5
0
code/train.py
hyungkwonko/DanbooRegion
292
1703189
<reponame>hyungkwonko/DanbooRegion<filename>code/train.py from config import * from game import * from datasets import * import gc def handle_batch(): sketch_batch = [] paint_batch = [] for _ in range(batch_size): sketch_mat, paint_mat = handle_next() sketch_batch.append(sketch_mat) ...
0
0
0
0
0
0
challenges/Grit/poller/for-release/machine.py
pingjuiliao/cb-multios
473
1703214
<reponame>pingjuiliao/cb-multios #!/usr/bin/env python from cStringIO import StringIO from generator.actions import Actions import random import struct SAMPLE_RATE = 8000.0 SAMPLE_MAX = 0x7FFFFFFF SAMPLE_MIN = -0x80000000 # *$!@ this #%*! def c_div(num, denom): neg = -1 if num < 0 else 1 if num < 0: n...
0
0
0
0
0
0
scripts/dkrr/encode_queries.py
d1shs0ap/pyserini
451
1703241
# # Pyserini: Reproducible IR research with sparse and dense representations # # 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...
4
2
0
0
6
0
dash-plotly-132-violin.py
oriolmirosa/dash-recipes
932
1703282
from __future__ import annotations import dash from dash.dependencies import Input, Output import dash_core_components as dcc import dash_html_components as html import pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/iris.csv') app = dash.Dash() app.layout = html.Div(className...
0
1
0
0
1
0
skmob/core/tests/test_trajectorydataframe.py
FilippoSimini/scikit-mobility
489
1703301
import numpy as np import pandas as pd import geopandas as gpd from datetime import datetime from operator import itemgetter from ...utils import constants from ...utils.constants import UID, DATETIME, LATITUDE, LONGITUDE, GEOLIFE_SAMPLE from ...core.trajectorydataframe import TrajDataFrame from ...core.flowdataframe i...
0
2
0
0
2
0
misc/wapiti-2.3.0/wapitiCore/net/crawlerpersister.py
sapientgov/openfda-travel
377
1703330
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf-8 -*- # This file is part of the Wapiti project (http://wapiti.sourceforge.net) # Copyright (C) 2009-2013 <NAME> # # Original authors : # <NAME> # <NAME> # Copyright (C) 2008 Informatica Gesfor # ICT Romulus (http://www.ict-romulus.eu) # # This program is free ...
0
0
0
0
0
0
tests/test_randprocs/test_markov/test_discrete/test_lti_gaussian.py
treid5/probnum
226
1703341
import numpy as np import pytest from probnum import randprocs from tests.test_randprocs.test_markov.test_discrete import test_linear_gaussian class TestLTIGaussian(test_linear_gaussian.TestLinearGaussian): # Replacement for an __init__ in the pytest language. See: # https://stackoverflow.com/questions/2143...
0
0
0
0
0
0
Common/Core/Testing/Python/TestVersion.py
cclauss/VTK
1,755
1703347
<gh_stars>1000+ """Test getting __version__ for VTK package """ import vtkmodules from vtkmodules.vtkCommonCore import vtkVersion from vtkmodules.test import Testing class TestVersion(Testing.vtkTest): def testVersionAttribute(self): """Test the __version__ attribute """ x,y,z = vtkmodules...
0
0
0
0
0
0
muddery/server/mappings/quest_status_set.py
dongwudanci/muddery
127
1703361
<filename>muddery/server/mappings/quest_status_set.py """ All available event actions. """ from django.conf import settings from evennia.utils import logger from muddery.server.utils.utils import classes_in_path from muddery.server.quests.base_quest_status import BaseQuestStatus class QuestStatusSet(object): """...
0
0
0
0
0
0
tdameritrade/__init__.py
ka05/tdameritrade
528
1703367
<filename>tdameritrade/__init__.py from .client import TDClient # noqa: F401 from ._version import __version__ # noqa: F401
0
0
0
0
0
0
insights/parsr/examples/tests/test_multipath.py
lhuett/insights-core
121
1703370
from insights.parsr.examples.multipath_conf import loads EXAMPLE = """ # This is a basic configuration file with some examples, for device mapper # multipath. # # For a complete list of the default configuration values, run either # multipath -t # or # multipathd show config # # For a list of configuration options wi...
0
0
0
0
0
0
test/static_analysis/comprehensions.py
rosslannen/jedi
4,213
1703375
[a + 1 for a in [1, 2]] #! 3 type-error-operation [a + '' for a in [1, 2]] #! 3 type-error-operation (a + '' for a in [1, 2]) #! 12 type-error-not-iterable [a for a in 1] tuple(str(a) for a in [1]) #! 8 type-error-operation tuple(a + 3 for a in ['']) # ---------- # Some variables within are not defined # ---------...
0
0
0
0
0
0
recipes/Python/465427_Simple_decorator_with_arguments/recipe-465427.py
tdiprima/code
2,023
1703392
<reponame>tdiprima/code decorator_with_args = lambda decorator: lambda *args, **kwargs: lambda func: decorator(func, *args, **kwargs)
0
0
0
0
0
0
nautobot/dcim/management/commands/trace_paths.py
psmware-ltd/nautobot
384
1703419
from django.core.management.base import BaseCommand from django.core.management.color import no_style from django.db import connection from nautobot.circuits.models import CircuitTermination from nautobot.dcim.models import ( CablePath, ConsolePort, ConsoleServerPort, Interface, PowerFeed, Powe...
0
1
1
0
2
0
tools/bin/gppylib/db/test/test_catalog.py
YangHao666666/hawq
450
1703447
<reponame>YangHao666666/hawq #!/usr/bin/env python # 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 Li...
0
0
0
0
0
0
integrations/__init__.py
cloudcomputingabc/volttron
406
1703452
<filename>integrations/__init__.py from .gridappsd_integration import GridAPPSDSimIntegration from .helics_integration import HELICSSimIntegration from.energyplus_integration import EnergyPlusSimIntegration __all__ = ['HELICSSimIntegration', 'GridAPPSDSimIntegration', 'EnergyPlusSimIntegration']
0
0
0
0
0
0
egs/wsj/s5/utils/data/internal/choose_utts_to_combine.py
Alicegaz/kaldi
116
1703467
#!/usr/bin/env python # Copyright 2016 <NAME> # 2016 Johns Hopkins University (author: <NAME>) # Apache 2.0 from __future__ import print_function import argparse from random import randint import sys import os from collections import defaultdict parser = argparse.ArgumentParser(description=""" This scri...
0
3
0
0
3
0
src/scripts/run_rwa.py
rajatdiptabiswas/NN_compression
211
1703484
#!/usr/bin/python import subprocess import numpy as np import os def main(): generation_script="generate_sequence_data.py" train_script="char_rwa.py" data_dir = "../data/sequence_data" if not os.path.exists(data_dir): os.makedirs(data_dir) #output_dir="outputs" # generate and run 0en...
0
0
0
0
0
0
cmasher/colormaps/prinsenvlag/prinsenvlag.py
cclauss/CMasher
257
1703487
<gh_stars>100-1000 # %% IMPORTS # Package imports from matplotlib.cm import register_cmap from matplotlib.colors import ListedColormap # All declaration __all__ = ['cmap'] # Author declaration __author__ = "<NAME> (@1313e)" # Package declaration __package__ = 'cmasher' # %% GLOBALS AND DEFINITIONS # Type of this c...
0
0
0
0
0
0
scripts/automation/regression/stateful_tests/trex_client_cfg_test.py
timgates42/trex-core
956
1703498
#!/router/bin/python from .trex_general_test import CTRexGeneral_Test, CTRexScenario from .trex_nbar_test import CTRexNbarBase from CPlatform import CStaticRouteConfig from .tests_exceptions import * #import sys import time from nose.tools import nottest # Testing client cfg ARP resolve. Actually, just need to check t...
0
0
0
0
0
0
vectorhub/import_utils.py
vector-ai/vectorhub
385
1703503
""" Utilities for importing libraries. """ import sys import warnings import pkg_resources import json import os import importlib from contextlib import contextmanager import sys def get_package_requirements(requirement_type: str) -> object: """ Load in extra_requirements.json from the package """ ...
4
3
0
0
7
0
language/tek_representations/tokenization.py
naveenjafer/language
1,199
1703545
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
2
21
0
2
25
0
xdl/test/python/unit_test/test_tile.py
Ru-Xiang/x-deeplearning
4,071
1703556
# Copyright 2018 Alibaba Group. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
0
1
0
0
1
0
tests/test_finger.py
GingerWWW/news_spider
208
1703568
<reponame>GingerWWW/news_spider<filename>tests/test_finger.py #!/usr/bin/env python # encoding: utf-8 """ @author: zhanghe @software: PyCharm @file: test_finger.py @time: 2018-02-11 00:06 """ from __future__ import unicode_literals import hashlib import unittest from scrapy.http import Request from scrapy.utils imp...
0
0
0
0
0
0
mindinsight/wizard/network/alexnet.py
fapbatista/mindinsight
216
1703571
<filename>mindinsight/wizard/network/alexnet.py # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the Li...
0
0
0
0
0
0
visualizers/visualize_local_search.py
juicetinliu/VeRyPy
156
1703582
# -*- coding: utf-8 -*- from scipy.spatial.distance import pdist, squareform from local_search.intra_route_operators import do_3opt_move # this is just to get pretty pictures out of 3-opt moves SHOW_DEBUG_GRAPHVIZ_VISUALIZATIONS = True import sys import itertools from shutil import copyfile sys.path.append(r'C:\User...
0
0
0
0
0
0
jmilkfansblog/controllers/v1/posts.py
xiaoyh121/program
176
1703585
from pecan import rest from wsme import types as wtypes from jmilkfansblog.api.expose import expose as wsexpose from jmilkfansblog.controllers.v1.views import posts as posts_views from jmilkfansblog.db import api as db_api class Post(wtypes.Base): """Response data validation for post object""" id = str ...
0
3
2
0
5
0
python/src/Lib/distutils/tests/test_sdist.py
vlinhd11/vlinhd11-android-scripting
2,293
1703652
"""Tests for distutils.command.sdist.""" import os import unittest import shutil import zipfile from os.path import join import sys from distutils.command.sdist import sdist from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase from distutils.errors import DistutilsExecE...
0
2
0
0
2
0
scripts/fetlang_reference_make.py
fetlang/fetlang
527
1703720
#!/usr/bin/env python3 # This script creates markdown files in the docs directory documenting elements # of each fetish, as well as creates a table of contents # # Requires Python >=3.6 from __future__ import annotations import json from common import * def getReferenceDirectory() -> object: return getDocsDirect...
0
8
0
0
8
0
tests/unittests/load_functions/submodule/main.py
gohar94/azure-functions-python-worker
277
1703722
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from .sub_module import module def main(req) -> str: return module.__name__
0
1
0
0
1
0
open-codegen/opengen/functions/is_numeric.py
elsuizo/optimization-engine
253
1703735
import numpy as np def is_numeric(u) -> object: return isinstance(u, (int, float)) \ or np.isscalar(u)
0
1
0
0
1
0
manuscript/listings/example_3.3.py
ssloy/least-squares-course
129
1703777
<filename>manuscript/listings/example_3.3.py from mesh import Mesh import scipy.sparse m = Mesh("input-face.obj") # load mesh A = scipy.sparse.lil_matrix((m.nverts, m.nverts)) for v in range(m.nverts): # build a smoothing operator as a sparse matrix if m.on_border(v): A[v,v] = 1 # fix boundary verts e...
0
0
0
0
0
0
tests/element-type.test/test1.py
nanolikeyou/pysonar2
2,574
1703798
# test inferring element type from subscript assignment, and append, update methods a = [] a[0] = 1 print a b = {} b[0] = "hello" x = b[1] print x c = [] c.append(1) z = c[0] print z d = {} d.update({'x': 10}) d.update({'y': True}) u = d['foo'] print u
0
0
0
0
0
0
tools/continuous_integration/bisect.py
limeng357/Paddle
17,085
1703818
# Copyright (c) 2018 PaddlePaddle 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 app...
0
0
0
0
0
0
clai/server/command_runner/clai_orchestrate_command_runner.py
emishulovin/clai
391
1703848
<filename>clai/server/command_runner/clai_orchestrate_command_runner.py # # Copyright (C) 2020 IBM. All Rights Reserved. # # See LICENSE.txt file in the root directory # of this source tree for licensing information. # from clai.server.clai_message_builder import create_orchestrator_list from clai.server.command_messa...
0
0
0
0
0
0
gmacpyutil/gmacpyutil/macdisk_test.py
rgayon/macops
758
1703852
"""Unit tests for macdisk module.""" import mox import stubout from google.apputils import app from google.apputils import basetest import macdisk class MacdiskModuleTest(mox.MoxTestBase): """Test macdisk module-level functions.""" def setUp(self): mox.MoxTestBase.setUp(self) self.stubs = stubout.Stu...
0
0
0
0
0
0
core/utils/misc_utils.py
ChenZhongFu/KOBE
176
1703865
import os import random import sys import time import numpy as np import torch from tensorboardX import SummaryWriter class AttrDict(dict): def __init__(self, *args, **kwargs): super(AttrDict, self).__init__(*args, **kwargs) self.__dict__ = self def set_cuda(config) -> tuple[object, object]: ...
0
2
0
0
2
0
research/a2n/models.py
srihari-humbarwadi/neural-structured-learning
939
1703908
# 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 # # Unless required by applicable law or agreed to in writing, ...
1
3
0
0
4
0
examples/element_ui/components/navigation.py
adamlwgriffiths/vue.py
274
1703916
from vue import VueComponent, computed class NavigationItem(VueComponent): item: dict template: str = """ <el-menu-item-group v-if="is_group_header"> <span slot="title">{{ item.group }}</span> </el-menu-item-group> <component v-else @click="$emit('click', item)" :is="item_t...
0
4
4
0
8
0
launchd/read_launch_plists.py
sbolel/macOS-Security-and-Privacy-Guide
14,818
1703920
<filename>launchd/read_launch_plists.py """ https://github.com/drduh/macOS-Security-and-Privacy-Guide/blob/master/launchd/read_launch_plists.py Reads macOS system launch daemon and agent property lists. """ import glob import hashlib import os import plistlib import subprocess import csv HEADER = "filename,label,pro...
0
0
0
0
0
0
unet3D/main_unet.py
psicobloc/FewShot_GAN-Unet3D
335
1703962
<gh_stars>100-1000 import os import pprint import tensorflow as tf from model_unet import UNET from testing_unet import * # Define flags flags = tf.app.flags flags.DEFINE_integer("epoch", 100000, "Number of training epochs (default: 100000)") flags.DEFINE_float("learning_rate_", 0.0001, "Learning rate of Adam optimi...
0
0
0
0
0
0
iotbx/mtz/tst.py
dperl-sol/cctbx_project
155
1703988
<reponame>dperl-sol/cctbx_project<filename>iotbx/mtz/tst.py from __future__ import absolute_import, division, print_function import libtbx.load_env from six.moves import range from six.moves import zip if (libtbx.env.has_module("ccp4io")): from iotbx import mtz else: mtz = None from cctbx.development import debug_u...
0
0
0
0
0
0
tests/integration_tests/test_contributions_multiclass.py
amnaabbassi/shapash
1,665
1703998
<filename>tests/integration_tests/test_contributions_multiclass.py """ Unit test contributions multiclass """ import unittest import shap from sklearn.datasets import load_iris from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier import numpy as np import pandas as pd...
0
0
0
0
0
0
datafeeds/csv_teams_parser.py
tervay/the-blue-alliance
266
1704007
<reponame>tervay/the-blue-alliance<gh_stars>100-1000 import csv import StringIO from datafeeds.parser_base import ParserBase class CSVTeamsParser(ParserBase): @classmethod def parse(self, data): """ Parse CSV that contains teams Format is as follows: team1, team2, ... teamN ...
0
0
0
0
0
0
capstone/scripts/fix_court_tag/fix_court_tag.py
rachelaus/capstone
134
1704015
from __future__ import annotations import csv import re from functools import lru_cache from pathlib import Path """ The original court tag in our XML looks like this: <court abbreviation="Ill." jurisdiction="Illinois">Illinois Supreme Court</court> The tag does not follow a defined dictionary of ...
0
7
0
0
7
0
examples/dynamictable/SchoolCalendarService.py
takipsizad/pyjs
739
1704032
from pyjamas.JSONService import JSONProxy class SchoolCalendarService(JSONProxy): def __init__(self): JSONProxy.__init__(self, "SchoolCalendarService.php", ["getPeople"])
0
0
0
0
0
0
torchnlp/samplers/__init__.py
jmribeiro/PyTorch-NLP
2,125
1704106
from torchnlp.samplers.balanced_sampler import BalancedSampler from torchnlp.samplers.bptt_batch_sampler import BPTTBatchSampler from torchnlp.samplers.bptt_sampler import BPTTSampler from torchnlp.samplers.bucket_batch_sampler import BucketBatchSampler from torchnlp.samplers.deterministic_sampler import DeterministicS...
0
0
0
0
0
0
exercises/de/test_02_10_02.py
Jette16/spacy-course
2,085
1704117
<filename>exercises/de/test_02_10_02.py<gh_stars>1000+ def test(): assert ( "token1.similarity(token2)" or "token2.similarity(token1)" in __solution__ ), "Vergleichst du die Ähnlichkeit der zwei Tokens?" assert ( 0 <= float(similarity) <= 1 ), "Der Ähnlichkeitswert muss eine Zahl zwische...
0
0
0
0
0
0
src/azure-cli/azure/cli/command_modules/dls/custom.py
YuanyuanNi/azure-cli
3,287
1704134
<reponame>YuanyuanNi/azure-cli # -------------------------------------------------------------------------------------------- # 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
tests/test_stateless.py
chhsiao1981/pyoidc
290
1704153
from oic.utils.stateless import StateLess __author__ = 'roland' def _eq(l1, l2) -> object: return set(l1) == set(l2) def test_access_code(): keys = {"oct": ["symmetric key123"]} # keylength 16 bytes=128 bits st = StateLess(keys, enc_alg="A128KW", enc_method="A128CBC-HS256") con = st.create_authz_s...
0
1
0
0
1
0
Python/RemoveNthNodeFromEndOfList.py
TonnyL/Windary
205
1704155
# -*- coding: UTF-8 -*- # # Given a linked list, remove the nth node from the end of list and return its head. # # For example, # # Given linked list: 1->2->3->4->5, and n = 2. # # After removing the second node from the end, the linked list becomes 1->2->3->5. # Note: # Given n will always be valid. # Try to do this i...
0
6
0
2
8
0
app/extensions/api_docs/cms/article.py
Allen7D/mini-shop-server
533
1704158
<filename>app/extensions/api_docs/cms/article.py # _*_ coding: utf-8 _*_ """ Created by Allen7D on 2020/5/26. """ from app.core.swagger_filed import IntegerQueryFiled, IntegerPathFiled, \ StringPathFiled, StringQueryFiled, ArrayQueryField, \ BodyField __author__ = 'Allen7D' type_in_query = IntegerQueryFiled...
0
0
0
0
0
0
kilt/readers/t5/evaluate_kilt_task.py
samuelbroscheit/KILT
674
1704176
<reponame>samuelbroscheit/KILT # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import argparse import glob import os from pathlib import Path import torch from rouge_sco...
0
0
0
0
0
0
src/psd_tools/compression/rle.py
afrigon/psd-tools
644
1704189
def decode(data, size) -> object: """ Decodes RLE encoded data. """ data = bytearray(data) # <- python 2/3 compatibility fix result = bytearray(size) src = 0 dst = 0 while src < len(data): header = data[src] if header > 127: header -= 256 src += 1 ...
0
3
0
0
3
0
tests/test_tokenfilter.py
narupo/janome
748
1704204
<filename>tests/test_tokenfilter.py # Copyright 2015 moco_beta # # 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...
0
0
0
0
0
0
engineer/datasets/loader/__init__.py
lingtengqiu/Open-PIFuhd
191
1704219
<filename>engineer/datasets/loader/__init__.py<gh_stars>100-1000 from .build_loader import test_loader_collate_fn,train_loader_collate_fn __all__ = ['test_loader_collate_fn','train_loader_collate_fn']
0
0
0
0
0
0
samples/ConsoleCmd.py
amih90/bacpypes
240
1704235
<reponame>amih90/bacpypes<filename>samples/ConsoleCmd.py<gh_stars>100-1000 #!/usr/bin/env python """ Template application that uses the ConsoleCmd class. """ import sys from bacpypes.debugging import bacpypes_debugging, ModuleLogger from bacpypes.consolelogging import ArgumentParser from bacpypes.consolecmd import C...
0
0
0
0
0
0
pyxb/bundles/opengis/sampling_1_0.py
eLBati/pyxb
123
1704271
<gh_stars>100-1000 from pyxb.bundles.opengis.raw.sampling_1_0 import *
0
0
0
0
0
0
tests/typesystem/test_ndarray_typesysem.py
jjmachan/hangar-py
202
1704306
<gh_stars>100-1000 import pytest import numpy as np from hangar.typesystem import NdarrayFixedShape, NdarrayVariableShape class TestInvalidValues: @pytest.mark.parametrize('shape,expected_exc', [ [tuple(range(32)), ValueError], [(1.2, 2), TypeError], [[1, 2], TypeError], ['shoul...
0
0
0
0
0
0
dataviz/eusites.py
Udzu/pudzu
119
1704308
from pudzu.charts import * from pudzu.sandbox.bamboo import * fg, bg="black", "white" COLS = 5 default_img = "https://s-media-cache-ak0.pinimg.com/736x/0d/36/e7/0d36e7a476b06333d9fe9960572b66b9.jpg" flags = pd.read_csv("datasets/countries.csv").split_columns(('nationality', 'tld', 'country'), "|").explode('cou...
0
4
0
0
4
0
syzygy/build/landmines_wrapper.py
nzeh/syzygy
343
1704321
#!python # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
0
1
0
0
1
0
discovery-provider/alembic/versions/9e9acd8a115a_saves_table_2.py
Tenderize/audius-protocol
429
1704352
<gh_stars>100-1000 """Saves table 2 Revision ID: 9e9acd8a115a Revises: eab2c0a9b338 Create Date: 2019-03-04 20:05:39.877210 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "9e9acd8a115a" down_revision = "eab2c0a9b338" branch_labels = None depends_on = None de...
0
0
0
0
0
0
TEST4.py
altmind/npyscreen
442
1704356
<gh_stars>100-1000 import npyscreen import curses class TestForm(npyscreen.Form): def afterEditing(self): self.parentApp.setNextForm(None) def create(self): self.grid = self.add(npyscreen.GridColTitles, name='GRID', column_width=10, values=[(1, 2, 3, 4), (10, 20, 30, 40)], col_titles=['A', '...
0
0
0
0
0
0
flash_examples/integrations/labelstudio/video_classification.py
Actis92/lightning-flash
1,457
1704359
<reponame>Actis92/lightning-flash import os import flash from flash.core.data.utils import download_data from flash.core.integrations.labelstudio.visualizer import launch_app from flash.video import VideoClassificationData, VideoClassifier # 1 Download data download_data("https://label-studio-testdata.s3.us-east-2.am...
0
0
0
0
0
0
examples/generateExamplesHTML.py
DavidKaluta/icalBuddy
101
1704361
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import types import plistlib from subprocess import Popen, PIPE, STDOUT def runInShell(cmd): o = os.popen(cmd, 'r') return o.read() def getFileContents(path): f = open(path,'r') s = f.read().strip("\n").strip() f.close() return s commandOutputsPlistPat...
0
0
0
0
0
0
socket__tcp__examples/send_recv_json/client.py
DazEB2/SimplePyScripts
117
1704401
<filename>socket__tcp__examples/send_recv_json/client.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import socket import json import sys sys.path.append('..') from common import send_msg, recv_msg HOST, PORT = "localhost", 9090 with socket.socket() as sock: sock.connect((HOST, P...
0
0
0
0
0
0
docs/mid.py
quiet-oceans/libais
161
1704424
#!/usr/bin/env python """Create a MID csv table from the ITU web page. Locations with more than one line of MID values will have a dash in their country name. After creating a draft mid.csv, you will need to edit those entries. There are multiple locations listed for a MID (e.g. 306). It is unclear how to handle th...
0
0
0
0
0
0
mmedit/models/components/refiners/mlp_refiner.py
Jian137/mmediting-1
1,884
1704460
# Copyright (c) OpenMMLab. All rights reserved. from __future__ import annotations import torch.nn as nn from mmcv.runner import load_checkpoint from mmedit.models.registry import COMPONENTS from mmedit.utils import get_root_logger @COMPONENTS.register_module() class MLPRefiner(nn.Module): """Multilayer perceptr...
2
1
0
0
3
0
portia_server/portia_api/resources/extractors.py
hackrush01/portia
6,390
1704496
<gh_stars>1000+ from .projects import BaseProjectModelRoute from portia_orm.models import Extractor class ExtractorRoute(BaseProjectModelRoute): lookup_url_kwarg = 'extractor_id' default_model = Extractor def get_instance(self): return self.get_collection()[self.kwargs.get('extractor_id')] d...
0
0
0
0
0
0
Exscript/util/daemonize.py
saveshodhan/exscript
226
1704497
# # Copyright (C) 2010-2017 <NAME> # The MIT License (MIT) # # 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 rights to use, copy, modif...
0
0
0
0
0
0
tests/functional/configs/test_indiv_tests.py
tomasfarias/dbt-core
799
1704510
from __future__ import annotations import pytest from dbt.tests.util import run_dbt from tests.functional.configs.fixtures import BaseConfigProject class TestConfigIndivTests(BaseConfigProject): @pytest.fixture(scope="class") def project_config_update(self) -> dict[str,dict[str,bool] | dict[str,dict[str,boo...
0
1
0
0
1
0
GPy/old_tests/psi_stat_gradient_tests.py
ekalosak/GPy
1,685
1704525
<gh_stars>1000+ ''' Created on 22 Apr 2013 @author: maxz ''' import unittest import numpy import GPy import itertools from GPy.core import Model from GPy.core.parameterization.param import Param from GPy.core.parameterization.transformations import Logexp from GPy.core.parameterization.variational import NormalPoster...
0
0
0
0
0
0
scripts/build/genCommandDictionary.py
jdekarske/astrobee
629
1704534
#!/usr/bin/env python """ A command-line tool for generating an HTML command dictionary from an XPJSON schema. """ import os import sys import logging # hack to ensure xgds_planner2 submodule is at head of PYTHONPATH ffroot = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.inser...
0
0
0
0
0
0
test/fixtures/python/corpus/lambda.B.py
matsubara0507/semantic
8,844
1704543
<gh_stars>1000+ lambda a : a + 1
0
0
0
0
0
0
python/ql/test/query-tests/Security/lib/os/path.py
vadi2/codeql
4,036
1704548
def join(a, *b) -> object: return a + "/" + "/".join(b) def normpath(x) -> object: return x
0
2
0
0
2
0
src/pyfluid/fluidsource.py
NTForked/GridFluidSim3D
761
1704550
from __future__ import annotations from abc import ABCMeta, abstractmethod from ctypes import c_void_p, c_char_p, c_int, c_double, byref from .pyfluid import pyfluid as lib from . import pybindings as pb from . import method_decorators as decorators from .vector3 import Vector3, Vector3_t from .aabb import AABB, AABB_...
5
16
0
0
21
0
cellrank/tl/estimators/mixins/__init__.py
WeilerP/cellrank
172
1704551
from cellrank.tl.estimators.mixins.decomposition import EigenMixin, SchurMixin from cellrank.tl.estimators.mixins._lineage_drivers import LinDriversMixin from cellrank.tl.estimators.mixins._absorption_probabilities import AbsProbsMixin
0
0
0
0
0
0
spectre/parallel/__init__.py
rajach/spectre
302
1704569
from .algorithmic import ( ParallelGroupBy, Rolling, nansum, masked_sum, nanmean, masked_mean, nanvar, nanstd, masked_last, masked_first, nanlast, nanmax, nanmin, pad_2d, covariance, pearsonr, linear_regression_1d, quantile, )
0
0
0
0
0
0
tools/appspot.py
michaelfig/caja
1,172
1704571
#!/usr/bin/env python """ Usage: %s <verb> <flags> For verb in edit -- edit the current change description show -- write to stdout the current change description in a form suitable for an SVN commit message. snapshot -- update appspot with the current change description The current change description...
0
0
0
0
0
0
NeuralNetworks/LSTM.py
ag88/Test-stock-prediction-algorithms
385
1704575
<filename>NeuralNetworks/LSTM.py # http://github.com/timestocome # data is from https://www.measuringworth.com/datasets/DJA/index.php # try using a LSTM to predict DJIA using only the DJIA # This converges to a low error rate for both several years, and 1 year # test data looks good, prediction looks terrible. #...
0
0
0
0
0
0
coconut/compiler/grammar.py
evhub/coconut
3,624
1704607
<gh_stars>1000+ #!/usr/bin/env python # -*- coding: utf-8 -*- # ----------------------------------------------------------------------------------------------------------------------- # INFO: # ----------------------------------------------------------------------------------------------------------------------- """ ...
0
0
0
0
0
0
src/pretix/helpers/jsonlogic_query.py
fabm3n/pretix
1,248
1704610
# # This file is part of pretix (Community Edition). # # Copyright (C) 2014-2020 <NAME> and contributors # Copyright (C) 2020-2021 rami.io GmbH and contributors # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free...
5
2
16
0
23
0
covid19_ai_diagnoser_ui.py
JordanMicahBennett/SMART-IMAGE_BASED-COVID19_VIRUS_DETECTO
101
1704622
<reponame>JordanMicahBennett/SMART-IMAGE_BASED-COVID19_VIRUS_DETECTO #Author: <NAME> #Note: Simple ui to use Ai based coronavirus2019/covid19 diagnosis tool import covid19_ai_diagnoser from tkinter import Frame, Tk, BOTH, Label, Menu, filedialog, messagebox, Text from PIL import Image, ImageTk import os imp...
0
0
0
0
0
0
test/test_tae/dummy_ta_wrapper.py
mcx/SMAC3
711
1704626
import sys __copyright__ = "Copyright 2021, AutoML.org Freiburg-Hannover" __license__ = "3-clause BSD" if __name__ == '__main__': if sys.argv[1] == "1": print("Result of this algorithm run: UNSAT,1,1,1,12354") if sys.argv[1] == "2": print("Result of this algorithm run: UNSAT,2,3,4,12354,add...
0
0
0
0
0
0
django_th/admin.py
Leopere/django-th
1,069
1704635
<gh_stars>1000+ from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django_th.forms.services import ServicesAdminForm from django_th.models import ServicesActivated from django_th.models import UserService from django_th.models import Trigge...
0
0
0
0
0
0
indra/benchmarks/benchmark_db_coverage.py
pupster90/indra
136
1704645
<reponame>pupster90/indra import json from indra.sources import bel, biopax from collections import OrderedDict def get_bel_statistics(bp): if bp is None: return 0, 0 num_all = len(bp.all_direct_stmts) - len(bp.degenerate_stmts) num_extracted = len(bp.converted_direct_stmts) return num_all, num...
0
0
0
0
0
0
auto_derby/jobs/nurturing.py
DoctrineAlanK/auto-derby
235
1704652
<filename>auto_derby/jobs/nurturing.py # -*- coding=UTF-8 -*- # pyright: strict from __future__ import annotations from auto_derby.constants import RacePrediction import logging import time from typing import Callable, Iterator, Text, Tuple, Union from .. import action, config, template, templates from ..scenes.singl...
0
0
0
0
0
0
tools/nntool/graph/manipulations/eliminate_transposes/eliminate_transposes.py
GreenWaves-Technologies/gap_sdk
118
1704655
# Copyright (C) 2021 GreenWaves Technologies, SAS # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # This progr...
16
37
0
4
57
0