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
bibliopixel/util/__init__.py
rec/leds
253
180135
<reponame>rec/leds from . import deprecated if deprecated.allowed(): # pragma: no cover from . util import generate_header, even_dist, pointOnCircle, genVector from . attribute_dict import AttributeDict d = AttributeDict
0
0
0
0
0
0
x64/ascii/mixedcase/__init__.py
mitthu/alpha3
137
180154
import rm64 encoders = rm64.encoders for encoder in encoders: encoder["case"] = "mixedcase"
0
0
0
0
0
0
terrascript/profitbricks/d.py
hugovk/python-terrascript
507
180191
# terrascript/profitbricks/d.py import terrascript class profitbricks_datacenter(terrascript.Data): pass class profitbricks_location(terrascript.Data): pass class profitbricks_image(terrascript.Data): pass class profitbricks_resource(terrascript.Data): pass class profitbricks_snapshot(terrascr...
0
0
0
0
0
0
Note-5 DQN与HS300指数择时/D3QN_Scale/emulator/main.py
summerRainn/DeepLearningNotes
345
180235
<reponame>summerRainn/DeepLearningNotes import numpy as np import pandas as pd from emulator.quotesmarket import QuotesMarket class Account(object): def __init__(self): self.A = QuotesMarket() def reset(self): self.buffer_reward = [] self.buffer_value = [] self.buffer_action =...
0
0
0
0
0
0
codigo/Live70/exemplo_7.py
cassiasamp/live-de-python
572
180314
<filename>codigo/Live70/exemplo_7.py class Descritor: def __init__(self, obj, set=None, get=None, delete=None): self.obj = obj self.set = set self.get = get self.delete = delete def __set__(self, obj, val): print('Estou setando algo') self.obj = val def __ge...
0
0
0
0
0
0
chaos_genius/views/data_source_view.py
rsohlot/chaos_genius
320
180365
# -*- coding: utf-8 -*- """DataSource views for creating and viewing the data source.""" import logging from copy import deepcopy from datetime import datetime from typing import List, Optional from uuid import uuid4 from flask.blueprints import Blueprint from flask.globals import request from flask.json import jsonif...
0
17
3
0
20
0
scripts/report_to_submission_csv.py
pramitmallick/spinn
103
180388
<reponame>pramitmallick/spinn<filename>scripts/report_to_submission_csv.py """ Converts a model report (report_path) to a Kaggle-style CSV. Usage: $ python scripts/report_to_submission_csv.py \ --report_path ./logs/example-nli.report > submission.csv """ import gflags import sys import codecs import json LABEL_M...
0
0
0
0
0
0
library/dokku_ps_scale.py
lemoony/ansible-dokku
109
180396
#!/usr/bin/python # -*- coding: utf-8 -*- from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.dokku_utils import subprocess_check_output import subprocess import re DOCUMENTATION = """ --- module: dokku_ps_scale short_description: Manage process scaling for a given dokku application options:...
0
2
0
0
2
0
compilebot/compilebot.py
renfredxh/compilebot
152
180495
<gh_stars>100-1000 from __future__ import unicode_literals, print_function import ideone import time import praw import re import urllib import traceback import config from socket import error as SocketError from sys import exit from functools import wraps def handle_api_exceptions(max_attempts=1): """Return a fu...
0
0
0
0
0
0
core/collectors/github.py
area55git/Gitmails
140
180508
<gh_stars>100-1000 from core.models.user import User from core.utils.git import GitUtils from core.utils.helpers import Helpers from core.models.collector import Collector from core.models.repository import Repository from core.models.organization import Organization class GithubCollector(Collector): def __init_...
0
0
0
0
0
0
sydent/sms/types.py
clmnin/sydent
220
180524
# See "Request body" section of # https://www.openmarket.com/docs/Content/apis/v4http/send-json.htm from typing_extensions import Literal, TypedDict TypeOfNumber = Literal[1, 3, 5] class _MessageRequired(TypedDict): type: Literal["text", "hexEncodedText", "binary", "wapPush"] content: str class Message(_Me...
0
0
17
0
17
0
webdriver/tests/bidi/session/status/status.py
qanat/wpt
2,479
180536
<reponame>qanat/wpt import pytest # Check that session.status can be used. The actual values for the "ready" and # "message" properties are implementation specific. @pytest.mark.asyncio async def test_bidi_session_status(bidi_session, send_blocking_command): response = await send_blocking_command("session.status"...
0
0
0
0
0
0
Tests/get_scenes_used.py
ScriptBox99/dea-notebooks
282
180578
<reponame>ScriptBox99/dea-notebooks<gh_stars>100-1000 """Get scenes used by a notebook. <NAME> Geoscience Australia 2021 """ from contextlib import ExitStack import unittest.mock import click import datacube from testbook import exceptions from testbook import testbook BAD_FNS = [ 'dea_tools.plotting.rgb', ...
0
0
0
0
0
0
gdbinit.py
przemub/pwndbg
4,461
180619
#!/usr/bin/env python # -*- coding: utf-8 -*- import locale import sys from os import path directory, file = path.split(__file__) directory = path.expanduser(directory) directory = path.abspath(directory) sys.path.append(directory) # warn if the user has different encoding than utf-8 encoding = locale.ge...
0
0
0
0
0
0
tests/drawBotScripts/appendGlyphWithFontVariations.py
roberto-arista/drawbot
302
180632
<reponame>roberto-arista/drawbot<filename>tests/drawBotScripts/appendGlyphWithFontVariations.py<gh_stars>100-1000 # https://github.com/typemytype/drawbot/issues/402 import drawBot drawBot.size(640, 160) fs = drawBot.FormattedString() fs.font("Skia") fs.fontSize(200) fs.fontVariations(wght=1) fs += "&" fs.appendGlyph("...
0
0
0
0
0
0
tests/test_summary.py
luizirber/ncbi-genome-download
643
180635
import codecs from os import path from ncbi_genome_download.summary import SummaryReader def open_testfile(fname) -> object: return codecs.open(path.join(path.dirname(__file__), fname), 'r', 'utf-8') def test_bacteria_ascii(): ascii_file = open_testfile('partial_summary.txt') reader = SummaryReader(asc...
0
1
0
0
1
0
util/common/nets/ecp5.py
umarcor/prjtrellis
256
180675
from __future__ import annotations import re import tiles # REGEXs for global/clock signals # Globals including spine inputs, TAP_DRIVE inputs and TAP_DRIVE outputs global_spine_tap_re = re.compile(r'R\d+C\d+_[HV]P[TLBR]X(\d){2}00') # CMUX outputs global_cmux_out_re = re.compile(r'R\d+C\d+_[UL][LR]PCLK\d+') # CMUX in...
0
3
0
0
3
0
deep_translator/yandex.py
nidhaloff/deep_translator
118
180690
<filename>deep_translator/yandex.py """ Yandex translator API """ from typing import List, Optional import requests from deep_translator.base import BaseTranslator from deep_translator.constants import BASE_URLS from deep_translator.exceptions import ( RequestError, ServerException, TooManyRequests, T...
0
0
0
0
0
0
sponsors/__init__.py
Manny27nyc/pythondotorg
911
180695
default_app_config = 'sponsors.apps.SponsorsAppConfig'
0
0
0
0
0
0
challenges/Azurad/poller/for-release/machine.py
pingjuiliao/cb-multios
473
180698
<filename>challenges/Azurad/poller/for-release/machine.py #!/usr/bin/env python from generator.actions import Actions import numpy as np import random import struct MAX_ITEMS = 1000 INSERT = 0x2064 RETR = 0xA097 ADD = 0x2C56 SUB = 0x973D MUL = 0xE925 SUM = 0x71B8 PROD = 0x1510 FLAG = 0x4141 RAND = 0xC4C5 QUIT = 0xA80...
0
0
0
0
0
0
mistral/db/sqlalchemy/sqlite_lock.py
soda-research/mistral
205
180734
# Copyright 2015 - Mirantis, 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 ag...
0
1
0
0
1
0
mcbv/__init__.py
akulakov/django
150
180744
from base import View, TemplateView, RedirectView from dates import (ArchiveIndexView, YearArchiveView, MonthArchiveView, WeekArchiveView, DayArchiveView, TodayArchiveView, DateDetailView) from detail import DetailView from edit import FormView, ...
0
0
0
0
0
0
images/blue-png-cachable.py
meyerweb/wpt
14,668
180767
<filename>images/blue-png-cachable.py import os from wptserve.utils import isomorphic_decode def main(request, response): """Serves the contents in blue.png but with a Cache-Control header. Emits a Cache-Control header with max-age set to 1h to allow the browser cache the image. Used for testing behaviors invol...
0
0
0
0
0
0
kaldi/matrix/optimization.py
mxmpl/pykaldi
916
180788
<gh_stars>100-1000 from ._optimization import * __all__ = [name for name in dir() if name[0] != '_']
0
0
0
0
0
0
pxr/imaging/rprUsd/devicesConfiguration.py
GPUOpen-LibrariesAndSDKs/RadeonProRenderUSD
155
180791
<filename>pxr/imaging/rprUsd/devicesConfiguration.py<gh_stars>100-1000 # Copyright 2020 Advanced Micro Devices, 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/l...
0
0
0
0
0
0
align/pnr/build_pnr_model.py
ALIGN-analoglayout/ALIGN-public
119
180792
import logging import pathlib import json import re from itertools import chain from collections import defaultdict from .. import PnR from ..schema.hacks import VerilogJsonTop logger = logging.getLogger(__name__) NType = PnR.NType def ReadVerilogJson( DB, j) -> object: hierTree = [] for module in j['modu...
0
4
0
0
4
0
alipay/aop/api/domain/FoodDispenserCellInfo.py
snowxmas/alipay-sdk-python-all
213
180880
<filename>alipay/aop/api/domain/FoodDispenserCellInfo.py #!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class FoodDispenserCellInfo(object): def __init__(self): self._biz_status = None self._cell_code = None self._cell_name ...
0
0
0
0
0
0
openapi_python_client/schema/openapi_schema_pydantic/oauth_flow.py
oterrier/openapi-python-client
172
180916
<reponame>oterrier/openapi-python-client<filename>openapi_python_client/schema/openapi_schema_pydantic/oauth_flow.py from typing import Dict, Optional from pydantic import AnyUrl, BaseModel class OAuthFlow(BaseModel): """ Configuration details for a supported OAuth Flow References: - https://git...
0
0
0
0
0
0
src/pretix/base/migrations/0138_auto_20191017_1151.py
fabm3n/pretix
1,248
180940
# Generated by Django 2.2.4 on 2019-10-17 11:51 import django.db.models.deletion from django.db import migrations, models import pretix.base.models.base import pretix.base.models.fields import pretix.base.models.giftcards def fwd(app, schema_editor): Team = app.get_model('pretixbase', 'Team') Team.objects.f...
0
0
2
0
2
0
asn/admin.py
skyydq/GreaterWMS
1,063
180968
from django.contrib import admin from . models import AsnListModel, AsnDetailModel admin.site.register(AsnListModel) admin.site.register(AsnDetailModel)
0
0
0
0
0
0
commands/apps/translate-shell/translate-shell-language-pair.py
daviddzhou/script-commands
3,305
180972
<gh_stars>1000+ #!/usr/bin/env python3 # -*- coding: UTF-8 -*- # Dependency: Requires translate-shell (https://www.soimort.org/translate-shell) # Install with Homebrew: `brew install translate-shell` # or install with MacPorts: `sudo port install translate-shell` # Set required paths to binaries required for translat...
0
0
0
0
0
0
src/inventory/cube.py
soyuka/botty
351
180974
#placeholder, not currently used here (see src/transmute)
0
0
0
0
0
0
nemo/collections/nlp/data/information_retrieval/information_retrieval_dataset.py
hamjam/NeMo
4,145
181004
<gh_stars>1000+ # 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 r...
0
0
0
0
0
0
ranking/management/modules/hackerearth.py
horacexd/clist
166
181015
<reponame>horacexd/clist #!/usr/bin/env python # -*- coding: utf-8 -*- import re import json import urllib.parse from datetime import datetime, timedelta from concurrent.futures import ThreadPoolExecutor as PoolExecutor from time import sleep from collections import OrderedDict from pprint import pprint from threading...
0
0
0
0
0
0
src/fidesctl/core/config/cli_settings.py
ethyca/fides
153
181041
<reponame>ethyca/fides<filename>src/fidesctl/core/config/cli_settings.py """This module defines the settings for everything related to the CLI.""" from typing import Dict, Optional from fideslog.sdk.python.utils import FIDESCTL_CLI, generate_client_id from pydantic import AnyHttpUrl, validator from .fides_settings im...
0
0
0
0
0
0
test/data_join/datasource_producer.py
Hsy-Intel/fedlearner
772
181137
<filename>test/data_join/datasource_producer.py # Copyright 2020 The FedLearner 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/lic...
0
0
0
0
0
0
tests/terraform/checks/resource/aws/test_RedshiftClusterKMSKey.py
kylelaker/checkov
4,013
181143
import unittest from checkov.common.models.enums import CheckResult from checkov.terraform.checks.resource.aws.RedshiftClusterKMSKey import check import hcl2 class TestRedshiftClusterKMSKey(unittest.TestCase): def test_failure(self): hcl_res = hcl2.loads(""" resource "aws_redshift_cluste...
0
0
0
0
0
0
openbook_posts/migrations/0036_auto_20190620_1957.py
TamaraAbells/okuna-api
164
181159
# Generated by Django 2.2.2 on 2019-06-20 17:57 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies: list[tuple[str, str]] = [ ('openbook_common', '0013_language'), ('openbook_posts', '0035_auto_20190620_1357'), ] ...
0
0
2
0
2
0
utils/assSelect.py
ssysm/DD_KaoRou2
187
181202
<filename>utils/assSelect.py #!/usr/bin/python3 # -*- coding: utf-8 -*- import codecs from PySide2.QtWidgets import QWidget, QMainWindow, QGridLayout, QFileDialog, QToolBar,\ QAction, QDialog, QStyle, QSlider, QLabel, QPushButton, QStackedWidget, QHBoxLayout,\ QLineEdit, QTableWidget, QAbstractItemView...
0
0
0
0
0
0
tests/unit/butterfree/hooks/schema_compatibility/test_spark_table_schema_compatibility_hook.py
fossabot/butterfree
208
181220
import pytest from butterfree.clients import SparkClient from butterfree.hooks.schema_compatibility import SparkTableSchemaCompatibilityHook class TestSparkTableSchemaCompatibilityHook: @pytest.mark.parametrize( "table, database, target_table_expression", [("table", "database", "`database`.`table...
0
0
0
0
0
0
tests/django_hstore_tests/tests/test_gis_integration.py
TW-Security/django-hstore
206
181232
<filename>tests/django_hstore_tests/tests/test_gis_integration.py from django_hstore.apps import GEODJANGO_INSTALLED if GEODJANGO_INSTALLED: from django.test import TestCase from django.contrib.gis.geos import GEOSGeometry from django_hstore_tests.models import Location class TestDictionaryFieldPlusGI...
0
0
0
0
0
0
Chapter08/c8_36_Fama_Mecbeth_regression.py
John-ye666/Python-for-Finance-Second-Edition
236
181255
""" Name : c8_36_Fama_MecBeth_regression.py Book : Python for Finance (2nd ed.) Publisher: Packt Publishing Ltd. Author : <NAME> Date : 6/6/2017 email : <EMAIL> <EMAIL> """ import numpy as np import pandas as pd import statsmodels.api as sm from datetime import datetime # ...
0
1
0
0
1
0
cpmpy/photo_problem.py
tias/hakank
279
181272
<reponame>tias/hakank<filename>cpmpy/photo_problem.py<gh_stars>100-1000 """ Photo problem in cpmpy. Problem statement from Mozart/Oz tutorial: http://www.mozart-oz.org/home/doc/fdt/node37.html#section.reified.photo ''' Betty, Chris, Donald, Fred, Gary, Mary, and Paul want to align in one row for taking a photo. Some o...
0
0
0
0
0
0
auctioning_platform/payments/payments/events.py
nhdinh/smp-modulith
299
181319
<filename>auctioning_platform/payments/payments/events.py<gh_stars>100-1000 from dataclasses import dataclass from uuid import UUID from foundation.events import Event @dataclass(frozen=True) class PaymentStarted(Event): payment_uuid: UUID customer_id: int @dataclass(frozen=True) class PaymentCharged(Event...
0
0
0
0
0
0
pg_view/models/outputs.py
bocytko/pg_view
402
181346
import curses import os import re import time from collections import namedtuple from operator import itemgetter from pg_view import flags from pg_view.meta import __appname__, __version__, __license__ from pg_view.utils import enum COLSTATUS = enum(cs_ok=0, cs_warning=1, cs_critical=2) COLALIGN = enum(ca_none=0, c...
0
0
0
0
0
1
h2o-py/tests/testdir_tree/pyunit_tree_irf.py
ahmedengu/h2o-3
6,098
181384
<reponame>ahmedengu/h2o-3 import h2o from h2o.tree import H2OTree from h2o.estimators import H2OIsolationForestEstimator from tests import pyunit_utils def check_tree(tree, tree_number, tree_class = None): assert tree is not None assert len(tree) > 0 assert tree._tree_number == tree_number assert tre...
0
0
0
0
0
0
tools/Vitis-AI-Quantizer/vai_q_tensorflow1.x/tensorflow/contrib/decent_q/python/utils_test.py
hito0512/Vitis-AI
848
181418
<reponame>hito0512/Vitis-AI<gh_stars>100-1000 """Tests the quantize_graph.py""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import numpy as np from tensorflow.core.protobuf.config_pb2 import ConfigProto from tensorflow.python.framework import...
0
0
0
0
0
0
python/seldon/pipeline/__init__.py
smsahu/seldon-server
1,645
181420
from .cross_validation import SeldonKFold, Seldon_KFold
0
0
0
0
0
0
testData/typecheckerinspection/parsableTypeCollection.py
alek-sun/pydantic-pycharm-plugin
238
181429
<gh_stars>100-1000 from typing import Union, List from pydantic import BaseModel class A(BaseModel): a: List[str] b: List[List[str]] a_int: List[int] = [int('123')] a_str: List[str] = [str('123')] b_int: List[List[int]] = [[int('123')]] b_str: List[List[str]] = [[str('123')]] A(a=a_str, b=b_str) A(<warning...
0
0
0
0
0
0
tests/test_models/test_sarimax_model.py
martins0n/etna
326
181433
import pytest from statsmodels.tsa.statespace.sarimax import SARIMAX from etna.models import SARIMAXModel from etna.pipeline import Pipeline def test_sarimax_forecaster_run(example_tsds): """ Given: I have dataframe with 2 segments When: Then: I get 7 periods per dataset as a forecast """ ho...
0
0
0
0
0
0
core/modules/shell.py
HaonTshau/inpanel
166
181442
# -*- coding: utf-8 -*- # # Copyright (c) 2017 - 2019, doudoudzj # All rights reserved. # # InPanel is distributed under the terms of the New BSD License. # The full license can be found in 'LICENSE'. from __future__ import annotations '''Module for Shell.''' import shlex import subprocess as sbps def run(cmd, she...
1
2
0
0
3
0
src/causallift/nodes/model_for_each.py
Minyus/causallift
265
181457
<filename>src/causallift/nodes/model_for_each.py import logging import pandas as pd from .utils import * # NOQA log = logging.getLogger(__name__) class ModelForTreatedOrUntreated: def __init__(self, treatment_val=1.0): assert treatment_val in {0.0, 1.0} self.treatment_val = treatment_val ...
0
0
0
0
0
0
python/ttypager.py
3mdeb/bits
215
181467
# Based on the ttypager and supporting functions from pydoc, under the Python # license, with various improvements. import bits import bits.input import contextlib import itertools import os import os.path import pager import redirect import string import sys import textwrap from cStringIO import StringIO def getpage...
0
0
0
0
0
0
mayan/apps/storage/links.py
nattangwiwat/Mayan-EDMS-recitation
343
181469
from django.utils.translation import ugettext_lazy as _ from mayan.apps.navigation.classes import Link from .icons import ( icon_download_file_delete, icon_download_file_download, icon_download_file_list ) link_download_file_delete = Link( args='resolved_object.pk', icon=icon_download_file_delete, ta...
0
0
0
0
0
0
tests/test_reflected_tables.py
edupo/sqlathanor
101
181476
# -*- coding: utf-8 -*- """ ****************************************** tests.test_reflected_tables ****************************************** Tests for declarative :class:`BaseModel` and the ability to retireve serialization configuration data when using :doc:`reflected tables <sqlalchemy:using-reflection-with-declar...
0
0
0
0
0
0
i3pystatus/lastfm.py
fkusei/i3pystatus
413
181487
from urllib.request import urlopen import json from i3pystatus import IntervalModule class LastFM(IntervalModule): """ Displays currently playing song as reported by last.fm. Get your API key from http://www.last.fm/api. """ settings: tuple[tuple[str, str], tuple[str, str], tuple[str, str], tuple...
0
0
7
0
7
0
sahara-10.0.0/sahara/api/v2/job_binaries.py
scottwedge/OpenStack-Stein
161
181503
<filename>sahara-10.0.0/sahara/api/v2/job_binaries.py # Copyright (c) 2016 Red Hat, 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 # # ...
0
0
0
0
0
0
packages/pyright-internal/src/tests/samples/inconsistentSpaceTab2.py
martindemello/pyright
4,391
181511
# This sample tests the reporting of inconsistent space/tab usage # for dedent tokens. if True: if True: print("False") print("True") # Should generate an error here.
0
0
0
0
0
0
my_imports.py
cigar666/my_manim_projects
159
181524
<gh_stars>100-1000 from my_manim_projects.my_utils.my_text import * from my_manim_projects.my_utils.anim_effects import * from my_manim_projects.my_utils.my_geometry import * from my_manim_projects.my_utils.my_3D_mobject import *
0
0
0
0
0
0
rlcycle/sac/action_selector.py
cyoon1729/Rlcycle
128
181557
from typing import Tuple import numpy as np import torch import torch.nn as nn from rlcycle.common.abstract.action_selector import ActionSelector from rlcycle.common.utils.common_utils import np2tensor class SACActionSelector(ActionSelector): """Action selector for (vanilla) DDPG policy Attributes: ...
6
2
0
0
8
0
user_agent/cli.py
anhdhbn/user_agent
282
181566
from argparse import ArgumentParser import json from user_agent import generate_navigator_js def script_ua(): parser = ArgumentParser() parser.add_argument('-e', '--extended', action='store_true', default=False) parser.add_argument('-o', '--os') parser.add_argument('-n', '--na...
0
0
0
0
0
0
openbook_posts/views/post_comments/serializer_fields.py
TamaraAbells/okuna-api
164
181592
<filename>openbook_posts/views/post_comments/serializer_fields.py from rest_framework.fields import Field class RepliesField(Field): DEFAULT_REPLY_COUNT = 2 def __init__(self, post_comment_reply_serializer=None, **kwargs): kwargs['source'] = '*' kwargs['read_only'] = True self.post_c...
0
0
0
0
0
0
PyFin/tests/Analysis/testSecurityValues.py
rpatil524/Finance-Python
325
181608
# -*- coding: utf-8 -*- u""" Created on 2017-1-25 @author: cheng.li """ import unittest import copy import pickle import tempfile import os import numpy as np import pandas as pd from PyFin.Analysis.SeriesValues import SeriesValues class TestSecurityValues(unittest.TestCase): def testSecurityValuesInit(self): ...
0
0
0
0
0
0
src/ssh_audit/readbuf.py
TheCry/ssh-audit
1,206
181628
<reponame>TheCry/ssh-audit<filename>src/ssh_audit/readbuf.py """ The MIT License (MIT) Copyright (C) 2017 <NAME> (<EMAIL>) 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 r...
0
0
0
0
0
0
tensorboard_logger/__init__.py
aliasrobotics/tensorboard_logger
685
181638
<reponame>aliasrobotics/tensorboard_logger # -*- coding: utf-8 -*- from .tensorboard_logger import *
0
0
0
0
0
0
ML/descentmethods.py
christopherjenness/ML-lib
109
181681
<reponame>christopherjenness/ML-lib """ This module includes descent methods for finding local minima. """ import numpy as np def gradientdescent(X, y, gradient, cost=None, alpha=0.01, iterations=10000, initial_weights=None, stochastic=False, reg_param=0, backtrack_line_search=...
0
0
0
0
0
0
tests/python_parser/data/with_statement_multi_items.py
ahupp/pegen
106
181713
with (a, c,): pass with (a as b, c): pass async with (a, c,): pass async with (a as b, c): pass
0
0
0
0
0
0
examples/gloo-snippet.py
aforren1/glumpy
1,074
181714
<gh_stars>1000+ # ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 <NAME>. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- import numpy as np from glumpy import gloo A ...
0
0
0
0
0
0
typed_python/lib/map.py
APrioriInvestments/typed_python
105
181747
# Copyright 2020 typed_python 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 a...
0
6
0
0
6
0
bootstrapvz/common/fs/logicalvolume.py
qqshfox/bootstrap-vz
207
181798
<gh_stars>100-1000 from bootstrapvz.base.fs.volume import Volume from bootstrapvz.common.tools import log_check_call import os class LogicalVolume(Volume): def __init__(self, partitionmap): super(LogicalVolume, self).__init__(partitionmap) self.vg = '' self.lv = '' def create(self, v...
0
0
0
0
0
0
share/lib/python/neuron/rxd/constants.py
niltonlk/nrn
203
181804
# Avogadro's number (approximation before 2019 redefinition) NA_legacy = 6.02214129e23 NA_modern = 6.02214076e23 def NA() -> object: try: from neuron import h # val = NA_legacy if h.nrnunit_use_legacy() else NA_modern val = h.Avogadro_constant # Note: h.Avogadro_constant is consis...
0
2
0
0
2
0
guides/request-validation-django/example-2/example-2.6.x.py
Tshisuaka/api-snippets
234
181824
<reponame>Tshisuaka/api-snippets<gh_stars>100-1000 from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST from twilio.twiml.voice_response import VoiceResponse, MessagingResponse @require_POST @csrf_exempt @validate_twilio_reques...
0
0
0
0
0
0
src/change_name.py
jordanbull23/Icourses-Videos-and-PPTs-Download
204
181867
<gh_stars>100-1000 # -*- coding: utf-8 -*- """生成改名文件""" def change_name_windows(name_dict, loc): with open(loc + '\\change_name.cmd', 'w') as f: loc = loc.replace('\\', r'\\') + r'\\' i = 0 for key in name_dict: i = i+1 old_name = str(key).split(r'/')[-1] ...
0
0
0
0
0
0
mayan/apps/common/permissions.py
nattangwiwat/Mayan-EDMS-recitation
343
181871
from django.utils.translation import ugettext_lazy as _ from mayan.apps.permissions import PermissionNamespace namespace = PermissionNamespace(label=_('Common'), name='common') permission_object_copy = namespace.add_permission( label=_('Copy object'), name='object_copy' )
0
0
0
0
0
0
15-more-types/petbox/petbox.py
SeirousLee/example-code-2e
990
181921
""" Example adapted from `Atomic Kotlin` by <NAME> & <NAME>, chapter `Creating Generics`, section `Variance`. """ from typing import TypeVar, Generic, Any class Pet: """Domestic animal kept for companionship.""" class Cat(Pet): """Felis catus""" class Siamese(Cat): """Cat breed from Thailand""" T =...
3
4
0
0
7
0
openbook_communities/migrations/0020_auto_20190426_1847.py
TamaraAbells/okuna-api
164
181966
<filename>openbook_communities/migrations/0020_auto_20190426_1847.py # Generated by Django 2.2 on 2019-04-26 16:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('openbook_communities', '0019_auto_20190426_1346'), ] operations = [ migra...
0
0
0
0
0
0
src/hg/makeDb/doc/wuhCor1/escape.py
andypohl/kent
171
181975
<filename>src/hg/makeDb/doc/wuhCor1/escape.py import collections byPos = collections.defaultdict(list) for line in open("table2.txt"): if line=="\n": continue row = line.rstrip("\n").split() # A1451C E484A 2B04 nucl, prot, ab = row aaPos = prot[1:-1] nuclPos = nucl[1:-1] fromAa = pr...
0
0
0
0
0
0
3]. Competitive Programming/03]. LeetCode/1]. Problems/Python/0007)_Reverse_Integer.py
MLinesCode/The-Complete-FAANG-Preparation
6,969
181994
<reponame>MLinesCode/The-Complete-FAANG-Preparation<filename>3]. Competitive Programming/03]. LeetCode/1]. Problems/Python/0007)_Reverse_Integer.py class Solution: def reverse(self, x: int) -> int: negative = x<0 x = abs(x) reversed = 0 while x!= 0: reversed = r...
0
0
0
0
0
0
example_stabilize_frame.py
LS11111/video
487
182000
<filename>example_stabilize_frame.py<gh_stars>100-1000 import tempfile import cv2 from vidstab import VidStab, layer_overlay, download_ostrich_video # Download test video to stabilize tmp_dir = tempfile.TemporaryDirectory() ostrich_video_path = f'{tmp_dir.name}/vid.avi' download_ostrich_video(ostrich_video_path) # In...
0
0
0
0
0
0
code/tools/validate_losses_with_tf.py
santomon/taskonomy
789
182023
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Downloads the losses from tensorboard and saves into --dst-folder. Then it smooths the losses and saves the best ones into a CSV file. ''' from __future__ import ( division, absolute_import, print_function, unicode_literals ) import argparse import csv import o...
0
1
0
0
1
0
textattack/datasets/helpers/__init__.py
xinzhel/TextAttack
1,980
182069
<filename>textattack/datasets/helpers/__init__.py """ Dataset Helpers ============================= """ from .ted_multi import TedMultiTranslationDataset
0
0
0
0
0
0
third_party/nucleus/io/gfile_test.py
Leorock123/deepvariant
2,553
182100
<gh_stars>1000+ # Copyright 2019 Google LLC. # # 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 notice, # this list of conditions and the following...
0
0
0
0
0
0
gryphon/data_service/auditors/orderbook_auditor.py
qiquanzhijia/gryphon
1,109
182168
<filename>gryphon/data_service/auditors/orderbook_auditor.py<gh_stars>1000+ from collections import defaultdict from datetime import timedelta import json from delorean import Delorean from sqlalchemy import and_ import treq from twisted.internet import defer from twisted.internet import reactor from twisted.internet....
0
0
0
0
0
0
tests/metal/label_model/test_class_balance.py
inimino/metal
437
182171
from __future__ import annotations import sys import unittest from itertools import product import numpy as np import torch from metal.label_model.class_balance import ClassBalanceModel sys.path.append("../synthetic") class ClassBalanceModelTest(unittest.TestCase): def _set_seed(self, seed): torch.manu...
11
3
0
0
14
0
tracardi/service/wf/domain/work_flow.py
Tracardi/tracardi
153
182186
from typing import Tuple, List from tracardi.domain.event import Event from tracardi.domain.payload.tracker_payload import TrackerPayload from tracardi.domain.profile import Profile from tracardi.domain.session import Session from .debug_info import DebugInfo from .flow import Flow from .flow_history import FlowHistor...
6
1
0
0
7
0
cvat/apps/opencv/urls.py
gitibharatibiswal/cvat-adas-team
4,197
182196
<reponame>gitibharatibiswal/cvat-adas-team # Copyright (C) 2018-2020 Intel Corporation # # SPDX-License-Identifier: MIT from django.urls import path from . import views urlpatterns = [ path('opencv.js', views.OpenCVLibrary) ]
0
0
0
0
0
0
tests/torch/test_layer_attributes.py
vuiseng9/nncf_pytorch
136
182205
from __future__ import annotations """ Copyright (c) 2022 Intel 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.0 Unless required by ap...
12
3
0
0
15
0
tests/basic_stages/test_freq_drop.py
DavidKatz-il/pdpipe
438
182234
"""Testing basic pipeline stages.""" import pandas as pd from pdpipe.basic_stages import FreqDrop DF1 = pd.DataFrame([[1, 4], [4, 5], [1, 11]], [1, 2, 3], ['a', 'b']) def test_freqdrop_basic(): """Testing the FreqDrop pipeline stage.""" res_df = FreqDrop(2, 'a').apply(DF1) assert 1 in res_df.index ...
0
0
0
0
0
0
tests/test_aws.py
mschwitalla/senza
106
182283
from botocore.exceptions import ClientError from unittest.mock import MagicMock from senza.aws import (get_security_group, resolve_security_groups, get_account_id, get_account_alias, list_kms_keys, encrypt, get_vpc_attribute, resolve_referenced_resource, ...
0
5
0
0
5
0
vaeseq/examples/midi/dataset.py
charlesincharge/vae-seq
161
182323
# Copyright 2018 Google, 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 writin...
1
4
0
0
5
0
sahara/service/edp/data_sources/swift/implementation.py
ksshanam/sahara
161
182325
# Copyright (c) 2017 OpenStack Foundation # # 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 ...
0
1
0
0
1
0
medcat/utils/checkpoint.py
CogStack/MedCAT
243
182328
import os import shutil import logging import jsonpickle from typing import List, Tuple, Optional, Dict from medcat.cdb import CDB from medcat.utils.decorators import check_positive class Checkpoint(object): jsonpickle.set_encoder_options('json', sort_keys=True, indent=2) log = logging.getLogger(__package__)...
14
16
0
2
32
0
src/__init__.py
LaudateCorpus1/hermes-5
135
182337
__version__ = '1.0' import algorithms import data_prep import utils
0
0
0
0
0
0
HRI/TFVT_HRI/interaction/transformer.py
WorldEditors/PaddleRobotics
146
182366
from __future__ import annotations import numpy as np from paddle import fluid class MaskedMultiHeadAttention(object): def __init__(self, model_dim, num_heads, dropout: float=0.0): assert model_dim % num_heads == 0 self.model_dim = model_dim self.num_heads = num_heads self.per_head...
15
17
0
1
33
0
atlas/testing/acceptance/test_cli_init.py
DeepLearnI/atlas
296
182379
from foundations_spec import * from foundations_spec.extensions import run_process from acceptance.mixins.run_local_job import RunLocalJob class TestCLIInit(Spec, RunLocalJob): @let def job_root(self) -> object: from foundations_contrib.utils import foundations_home from os.path import expand...
0
2
0
0
2
0
papermerge/contrib/admin/test/test_anonymous_user.py
w-michal/papermerge
1,586
182422
from django.test import TestCase from django.test import Client from django.urls import reverse class TestAnonymousUserView(TestCase): def setUp(self): self.client = Client() # superuser exists, but is not authenticated def test_basic_login_view(self): """ Login view renders ...
0
0
0
0
0
0
Section 6 - NLP Core/NLP Part 17 - Latent Semantic Analysis Part 1.py
kungfumas/bahasa-alami
169
182442
<reponame>kungfumas/bahasa-alami # Latent Semantic Analysis using Python # Importing the Libraries from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import TruncatedSVD # Sample Data dataset = ["The amount of polution is increasing day by day", "The concert was just gre...
0
0
0
0
0
0
Codes/gracekoo/219_contains-duplicate-ii.py
liuxiaohui1221/algorithm
256
182461
<reponame>liuxiaohui1221/algorithm # -*- coding: utf-8 -*- # @Time: 2020/4/30 17:46 # @Author: GraceKoo # @File: 219_contains-duplicate-ii.py # @Desc: https://leetcode-cn.com/problems/contains-duplicate-ii/ from typing import List class Solution: def containsNearbyDuplicate(self, nums: List[int], k: int) -> bool:...
0
0
0
0
0
0
public-engines/mnist-keras-engine/tests/prediction/test_prediction_preparator.py
tallandroid/incubator-marvin
101
182511
<reponame>tallandroid/incubator-marvin #!/usr/bin/env python # coding=utf-8 try: import mock except ImportError: import unittest.mock as mock from marvin_mnist_keras_engine.prediction import PredictionPreparator @mock.patch('marvin_mnist_keras_engine.prediction.prediction_preparator.cv2.resize') @mock.patc...
0
0
0
0
0
0
docs/myrst2man.py
trathborne/nvchecker
320
182512
#!/usr/bin/python3 import time import locale import os import sys try: locale.setlocale(locale.LC_ALL, '') except: pass sys.path.insert(0, '..') import nvchecker from docutils.core import publish_cmdline, default_description from docutils import nodes from docutils.writers import manpage from docutils.parsers.rs...
4
2
0
0
6
0