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 |
|---|---|---|---|---|---|---|---|---|---|---|
Contents/Code/__init__.py | vmirage/YouTubeTV.bundle | 369 | 175744 | <reponame>vmirage/YouTubeTV.bundle<filename>Contents/Code/__init__.py
# -*- coding: utf-8 -*-
# Copyright (c) 2014, KOL
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of s... | 0 | 0 | 0 | 0 | 0 | 0 |
runner/one_epoch_runner.py | d1ngn1gefe1/lmdis-rep | 133 | 175745 | from __future__ import annotations
import tensorflow as tf
import datetime
import numpy as np
import zutils.tf_math_funcs as tmf
from zutils.py_utils import *
from scipy.io import savemat
class OneEpochRunner:
def __init__(
self, data_module, output_list: object | None=None,
net_func: obj... | 7 | 1 | 0 | 1 | 9 | 0 |
neural_compressor/ux/components/optimization/factory.py | intel/neural-compressor | 172 | 175761 | <filename>neural_compressor/ux/components/optimization/factory.py
# -*- coding: utf-8 -*-
# Copyright (c) 2021 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://w... | 0 | 0 | 0 | 0 | 0 | 0 |
huge_markets_test.py | ztaober/packer-ng-plugin | 5,198 | 175801 | <reponame>ztaober/packer-ng-plugin<filename>huge_markets_test.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: mcxiaoke
# @Date: 2015-11-25 14:30:02
import subprocess
import os
import sys
with open('huge_markets.txt', 'w') as f:
for i in range(int(sys.argv[1])):
f.write("Test Market %s#test ma... | 0 | 0 | 0 | 0 | 0 | 0 |
motorway/messages.py | plecto/motorway | 166 | 175816 | from __future__ import annotations
import json
import traceback
import uuid
import datetime
from isodate import duration_isoformat
from motorway.utils import DateTimeAwareJsonEncoder
import logging
class Message(object):
"""
:param ramp_unique_id: the unique message ID delivered back upon completion to the ra... | 21 | 5 | 1 | 0 | 27 | 0 |
tests/testcases/redirect_when_unmapped_window_has_shadow.py | PolytreeDE/picom | 469 | 175848 | #!/usr/bin/env python3
import xcffib.xproto as xproto
import xcffib
import time
from common import set_window_name
conn = xcffib.connect()
setup = conn.get_setup()
root = setup.roots[0].root
visual = setup.roots[0].root_visual
depth = setup.roots[0].root_depth
name = "_NET_WM_STATE"
name_atom = conn.core.InternAtom(... | 0 | 0 | 0 | 0 | 0 | 0 |
example/pyctp2/trader/strategy.py | mmmaaaggg/pyctp_lovelylain | 358 | 175853 | '''
理想的策略形式
交易端须获取所跟进的合约的当日涨跌停位置
'''
import json
import logging
from ..common.base import BaseObject,inverse_direction
from .position import (POSITION_APPROVE_STATUS,
Position,
Closer,ContractCloser,GlobalCloser,
)
class POPEN(object):
... | 3 | 5 | 0 | 2 | 10 | 0 |
setup.py | StefanUlbrich/comic-dl | 478 | 175926 | <gh_stars>100-1000
import setuptools
from comic_dl import __version__
readme = open('ReadMe.md').read()
history = open('Changelog.md').read()
setuptools.setup(
name='comic_dl',
version=__version__.__version__,
description='Comic-dl is a command line tool to download Comics and Manga from various Manga an... | 0 | 0 | 0 | 0 | 0 | 0 |
src/poliastro/earth/plotting/utils.py | niharsalunke/poliastro | 634 | 175933 | <filename>src/poliastro/earth/plotting/utils.py<gh_stars>100-1000
""" Holds utilities related with Earth plotting """
EARTH_PALETTE = {
"land_color": "#9fc164",
"ocean_color": "#b2d9ff",
"lake_color": "#e9eff9",
"dessert_color": "d8c596",
}
""" A color palette based on Earth colors """
| 0 | 0 | 0 | 0 | 0 | 0 |
pytest-verbose-parametrize/tests/integration/parametrize_ids/tests/unit/test_example.py | RaiVaibhav/pytest-plugins | 282 | 175936 | import pytest
@pytest.mark.parametrize(('f', 't'), [(sum, list), (len, int)])
def test_foo(f, t):
assert isinstance(f([[1], [2]]), t)
def test_bar(): # unparametrized
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
gfauto/gfautotests/test_cov_merge.py | KishkinJ10/graphicsfuzz | 519 | 175945 | # -*- coding: utf-8 -*-
# Copyright 2020 The GraphicsFuzz Project 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 0 | 1 | 2 | 0 | 3 | 0 |
test/connector/exchange/coinflex/test_coinflex_auth.py | pecuniafinance/hummingbot | 542 | 175949 | <reponame>pecuniafinance/hummingbot
#!/usr/bin/env python
import sys
import asyncio
import unittest
import conf
import os
import logging
from async_timeout import timeout
from os.path import join, realpath
from typing import Dict, Any
from hummingbot.connector.exchange.coinflex.coinflex_auth import CoinflexAuth
from hu... | 0 | 0 | 0 | 0 | 0 | 0 |
chainerui/models/__init__.py | chainer/chainerui | 185 | 175962 | from chainerui.models.argument import Argument # NOQA
from chainerui.models.asset import Asset # NOQA
from chainerui.models.bindata import Bindata # NOQA
from chainerui.models.command import Command # NOQA
from chainerui.models.log import Log # NOQA
from chainerui.models.project import Project # NOQA
from chainer... | 0 | 0 | 0 | 0 | 0 | 0 |
nautobot/dcim/navigation.py | psmware-ltd/nautobot | 384 | 175973 | <gh_stars>100-1000
from nautobot.core.apps import NavMenuAddButton, NavMenuGroup, NavMenuItem, NavMenuImportButton, NavMenuTab
menu_items = (
NavMenuTab(
name="Organization",
weight=100,
groups=(
NavMenuGroup(
name="Sites",
weight=100,
... | 0 | 0 | 0 | 0 | 0 | 0 |
source/remediation_runbooks/scripts/test/test_createaccessloggingbucket.py | j-erickson/aws-security-hub-automated-response-and-remediation | 129 | 175979 | #!/usr/bin/python
###############################################################################
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. #
# #
# Licensed under the Apache License Version 2.0 (the "License"). Y... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/env/set-bsc.py | bZxNetwork/contractsV2 | 177 | 175981 | BZX = Contract.from_abi("BZX", "0xc47812857a74425e2039b57891a3dfcf51602d5d", interface.IBZx.abi)
TOKEN_REGISTRY = Contract.from_abi("TOKEN_REGISTRY", "0x2fA30fB75E08f5533f0CF8EBcbb1445277684E85", TokenRegistry.abi)
list = TOKEN_REGISTRY.getTokens(0, 100)
for l in list:
iTokenTemp = Contract.from_abi("iTokenTemp", ... | 0 | 0 | 0 | 0 | 0 | 0 |
profiles/forms/user_role_for_object.py | LaudateCorpus1/squest | 112 | 175986 | <reponame>LaudateCorpus1/squest
from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType
from django.forms import Form, MultipleChoiceField, SelectMultiple, ChoiceField, Select
from profiles.models import UserRoleBinding
class UserRoleForObjectForm(Form):
def __init_... | 0 | 0 | 0 | 0 | 0 | 0 |
re_scan.py | nitely/python-regex-scanner | 240 | 176000 | from __future__ import annotations
from sre_parse import Pattern, SubPattern, parse
from sre_compile import compile as sre_compile
from sre_constants import BRANCH, SUBPATTERN
class _ScanMatch(object):
def __init__(self, match, rule, start, end):
self._match = match
self._start = start
se... | 6 | 8 | 0 | 1 | 15 | 0 |
util/functions.py | knjcode/mxnet-finetuner | 112 | 176002 | #!/usr/bin/env python
# coding: utf-8
# Utility functions
def get_image_size(model_prefix) -> int:
if 'caffenet' in model_prefix:
return 227
elif 'squeezenet' in model_prefix:
return 227
elif 'alexnet' in model_prefix:
return 227
elif 'googlenet' in model_prefix:
return 299
elif 'inception-v... | 0 | 1 | 0 | 0 | 1 | 0 |
mFIZ/scripts/mFIZ_utils.py | Bootsmaat/Mimic | 150 | 176021 | <reponame>Bootsmaat/Mimic<gh_stars>100-1000
#!usr/bin/env python
# -*- coding: utf-8 -*-
"""
Functions that actually make mFIZ work.
"""
try:
import pymel.core as pm
MAYA_IS_RUNNING = True
except ImportError: # Maya is not running
pm = None
MAYA_IS_RUNNING = False
# General Imports
from collections... | 0 | 0 | 0 | 0 | 0 | 0 |
word2vec_phrases.py | dice-group/NETL-Automatic-Topic-Labelling- | 176 | 176031 | <filename>word2vec_phrases.py
"""
Author: <NAME>
Date: October 2016
File: word2vec_phrases.py
This file give us a list of Wikipedia titles which has to be used as ngrams in running word2vec model. This removes brackets from title
and all filter with ttile length and document size. This is t... | 0 | 0 | 0 | 0 | 0 | 0 |
libextract/api.py | bofm/libextract | 502 | 176041 | <filename>libextract/api.py<gh_stars>100-1000
from functools import partial
from ._compat import BytesIO
from .core import parse_html, pipeline, select, measure, rank, finalise
def extract(document, encoding='utf-8', count=None):
if isinstance(document, bytes):
document = BytesIO(document)
crank ... | 0 | 0 | 0 | 0 | 0 | 0 |
egs/yomdle_tamil/v1/local/yomdle/normalized_scoring/utils/trans_to_tokenized_words.py | shuipi100/kaldi | 116 | 176069 | #!/usr/bin/env python3
""" This script splits punctuations, digits and currency symbols
from the word.
Eg. "They have come!" he said reverently, gripping his
" They have come ! " he said reverently , gripping his
Eg. trans_to_tokenized_words.py <input-file> <output-file>
"""
import unicodedata
im... | 0 | 0 | 0 | 0 | 0 | 0 |
ufora/util/DefaultDict.py | ufora/ufora | 571 | 176075 | <gh_stars>100-1000
# Copyright 2015 Ufora Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/data/dataset_readers/squad_sentence_selection_reader_test.py | richarajpal/deep_qa | 459 | 176077 | # pylint: disable=no-self-use,invalid-name
import random
from os.path import join
import numpy
from deep_qa.data.dataset_readers.squad_sentence_selection_reader import SquadSentenceSelectionReader
from deep_qa.testing.test_case import DeepQaTestCase
from overrides import overrides
class TestSquadSentenceSelectionRea... | 0 | 0 | 0 | 0 | 0 | 0 |
gaphor/RAAML/toolbox.py | mrmonkington/gaphor | 867 | 176079 | """The action definition for the RAAML toolbox."""
from gaphor.diagram.diagramtoolbox import ToolboxDefinition, general_tools
from gaphor.RAAML.fta.ftatoolbox import fta
from gaphor.RAAML.stpa.stpatoolbox import stpa
raaml_toolbox_actions: ToolboxDefinition = (
general_tools,
fta,
stpa,
)
| 0 | 0 | 1 | 0 | 1 | 0 |
Hackathon/hackathon2.py | elawang9/Scripting-and-Web-Scraping | 119 | 176091 | <filename>Hackathon/hackathon2.py
""" Web scraped from http://www.hackathon.io/ """
import requests
from bs4 import BeautifulSoup
res = requests.get('http://www.hackathon.io/events')
soup = BeautifulSoup(res.text, 'lxml')
hacks = soup.find_all('div',{'class':'event-teaser'})
for i,f in enumerate(hacks,1):
print("... | 0 | 0 | 0 | 0 | 0 | 0 |
models/layers.py | bfortuner/VOCdetect | 336 | 176099 | import torch.nn as nn
def conv_relu(in_channels, out_channels, kernel_size: int=3, stride: int=1,
padding: int=1, bias: bool=True) -> list[object]:
return [
nn.Conv2d(in_channels, out_channels, kernel_size=kernel_size,
stride=stride, padding=padding, bias=bias),
nn.ReLU(... | 10 | 3 | 0 | 0 | 13 | 0 |
litex/tools/remote/comm_uart.py | osterwood/litex | 1,501 | 176101 | <gh_stars>1000+
#
# This file is part of LiteX.
#
# Copyright (c) 2015-2020 <NAME> <<EMAIL>>
# SPDX-License-Identifier: BSD-2-Clause
import serial
import struct
from litex.tools.remote.csr_builder import CSRBuilder
# Constants ----------------------------------------------------------------------------------------
... | 0 | 0 | 0 | 0 | 0 | 0 |
reddit2telegram/channels/r_kratom/app.py | mainyordle/reddit2telegram | 187 | 176113 | <filename>reddit2telegram/channels/r_kratom/app.py
#encoding:utf-8
subreddit = 'kratom'
t_channel = '@r_kratom'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| 0 | 0 | 0 | 0 | 0 | 0 |
disprcnn/utils/fastai_ext.py | maheriya/disprcnn | 191 | 176130 | <gh_stars>100-1000
import torch
import torch.distributed as dist
from torch import nn
from torch.nn import ModuleList
from collections import OrderedDict
from typing import List, Collection
from disprcnn.utils.comm import get_rank, get_world_size
from fastai.basic_train import LearnerCallback, Learner
from fastai.callb... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/custom_model_continuos_training.py | Tufail114/ImageAi-Project-Software | 7,141 | 176262 | <gh_stars>1000+
from imageai.Classification.Custom import ClassificationModelTrainer
import os
trainer = ClassificationModelTrainer()
trainer.setModelTypeAsDenseNet121()
trainer.setDataDirectory("idenprof")
trainer.trainModel(num_objects=10, num_experiments=50, enhance_data=True, batch_size=8, show_network_summary=Tru... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/cityscapes2json.py | lixuekai2001/BPR | 113 | 176279 | <filename>tools/cityscapes2json.py<gh_stars>100-1000
import os
import os.path as osp
import cv2
import json
import numpy as np
from tqdm import *
from collections import defaultdict
from pycocotools import mask as maskUtils
from fire import Fire
class Cityscape:
def __init__(self, gt_file, anno_dir):
self... | 0 | 0 | 0 | 0 | 0 | 0 |
netaddr/tests/ip/test_dns.py | Rockly/netaddr | 416 | 176322 | from netaddr import IPAddress
def test_reverse_dns_v4():
assert IPAddress('172.24.0.13').reverse_dns == '192.168.3.11.in-addr.arpa.'
def test_reverse_dns_v6():
assert IPAddress('fe80::feeb:daed').reverse_dns == ('d.e.a.d.b.e.e.f.0.0.0.0.0.0.0.0.'
'0.0.0... | 0 | 0 | 0 | 0 | 0 | 0 |
k-distribution/src/main/scripts/lib/pyk/definition.py | nrdxp/k | 404 | 176341 | #!/usr/bin/env python3
from __future__ import annotations
import sys
import subprocess
from .kast import *
from .kastManip import *
from .kast import _notif, _warning, _fatal
def ruleHasId(sentence, ruleIds) -> bool | object:
if isKRule(sentence):
ruleId = getAttribute(sentence, 'UNIQUE_ID')
... | 0 | 6 | 0 | 0 | 6 | 0 |
tests/test_tokenizer.py | abhaykumarPS/lunr.py | 128 | 176343 | <reponame>abhaykumarPS/lunr.py
import re
import pytest
from lunr.tokenizer import Tokenizer
class TestTokenizer:
def test_splitting_into_tokens(self):
tokenizer = Tokenizer("foo bar baz")
tokens = [str(token) for token in tokenizer]
assert tokens == ["foo", "bar", "baz"]
def test_r... | 0 | 0 | 0 | 0 | 0 | 0 |
specutils/io/default_loaders/__init__.py | havok2063/specutils | 118 | 176357 | <reponame>havok2063/specutils
import os
import glob
from os.path import dirname, basename, isfile
modules = glob.glob(os.path.join(dirname(__file__), "*.py"))
__all__ = [basename(f)[:-3] for f in modules if isfile(f)]
| 0 | 0 | 0 | 0 | 0 | 0 |
tacker/tests/unit/sol_refactored/common/test_vnfd_utils.py | h1r0mu/tacker | 116 | 176407 | <filename>tacker/tests/unit/sol_refactored/common/test_vnfd_utils.py
# Copyright (C) 2021 Nippon Telegraph and Telephone 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 c... | 0 | 0 | 0 | 0 | 0 | 0 |
6.GAN_image_SR/main.py | phenylazide/Deep_learning_examples | 200 | 176414 | <reponame>phenylazide/Deep_learning_examples
#! /usr/bin/python
# -*- coding: utf8 -*-
import os, time, pickle, random, time
from datetime import datetime
import numpy as np
from time import localtime, strftime
import logging, scipy
import tensorflow as tf
import tensorlayer as tl
from model import *
from utils impor... | 0 | 0 | 0 | 0 | 0 | 0 |
uniplot/layer_assembly.py | olavolav/textplot | 156 | 176453 | <gh_stars>100-1000
import numpy as np # type: ignore
from typing import List
from uniplot.options import Options
import uniplot.layer_factory as layer_factory
def assemble_scatter_plot(xs: np.array, ys: np.array, options: Options) -> np.array:
"""
Assemble the graph surface for a scatter plot.
"""
... | 0 | 0 | 0 | 0 | 0 | 0 |
patent_part.py | patent-python/patent-generator | 109 | 176457 | import re
def get_pars(text):
pars = re.findall(r'\[[0-9]+\]\n*(.*)', text)
pars = [p.strip() for p in pars]
return pars
def get_claims(text):
claims = re.findall(r'.*claim.*', text, re.IGNORECASE)
return claims
def get_claim_body(text):
match = re.search(r'^claim[s*]$', text, re.IGNORECASE |... | 0 | 0 | 0 | 0 | 0 | 0 |
src/test/tests/plots/multicolor.py | visit-dav/vis | 226 | 176497 | # ----------------------------------------------------------------------------
# MODES: serial
# CLASSES: nightly
#
# Test Case: multicolor.py
#
# Tests: Tests setting colors using the multiColor field in some of
# our plots.
# Plots - Boundary, Contour, FilledBoundary, Subset
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
miscellanies/torch/distributed/__init__.py | zhangzhengde0225/SwinTrack | 143 | 176506 | <gh_stars>100-1000
import torch.distributed as dist
import os
import torch
import sys
def is_dist_available_and_initialized():
if not dist.is_available():
return False
if not dist.is_initialized():
return False
return True
def get_world_size():
if not is_dist_available_and_initialize... | 0 | 0 | 0 | 0 | 0 | 0 |
install/python-installer/scripts/traf_package.py | CoderSong2015/Apache-Trafodion | 148 | 176573 | #!/usr/bin/env python
# @@@ START COPYRIGHT @@@
#
# 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 |
befh/handler/zmq_handler.py | joshua-jd-lee/BitcoinExchangeFH | 310 | 176619 | import logging
from datetime import datetime
import zmq
from .handler import Handler
LOGGER = logging.getLogger(__name__)
class ZmqHandler(Handler):
"""Zmq handler.
"""
def __init__(self, connection, **kwargs):
"""Constructor.
"""
super().__init__(**kwargs)
self._connec... | 0 | 1 | 0 | 1 | 2 | 0 |
api/tests/integration/tests/basic/exceptions.py | tsingdao-Tp/Indigo | 204 | 176646 | import os
import sys
sys.path.append(os.path.normpath(os.path.join(os.path.abspath(__file__), '..', '..', '..', "common")))
from env_indigo import *
indigo = Indigo()
# indigo::SmilesLoader::Error
try:
m = indigo.loadMolecule('CX')
except IndigoException as e:
print(getIndigoExceptionText(e))
# IndigoError
t... | 0 | 0 | 0 | 0 | 0 | 0 |
tasks/pretrain_tasks/__init__.py | yangapku/OFA | 367 | 176647 | <filename>tasks/pretrain_tasks/__init__.py
from .unify_task import UnifyTask | 0 | 0 | 0 | 0 | 0 | 0 |
torchtext/vocab/__init__.py | parmeet/text | 3,172 | 176724 | <filename>torchtext/vocab/__init__.py
from .vocab import Vocab
from .vectors import (
GloVe,
FastText,
CharNGram,
pretrained_aliases,
Vectors,
)
from .vocab_factory import (
vocab,
build_vocab_from_iterator,
)
__all__ = ["Vocab",
"vocab",
"build_vocab_from_iterator",... | 0 | 0 | 0 | 0 | 0 | 0 |
tacker/sol_refactored/api/api_version.py | h1r0mu/tacker | 116 | 176728 | <reponame>h1r0mu/tacker
# Copyright (C) 2021 Nippon Telegraph and Telephone 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.... | 0 | 0 | 0 | 0 | 0 | 0 |
python/cudf/cudf/io/feather.py | Ahsantw/cudf | 4,012 | 176735 | # Copyright (c) 2019, NVIDIA CORPORATION.
import warnings
from pyarrow import feather
from cudf.core.dataframe import DataFrame
from cudf.utils import ioutils
@ioutils.doc_read_feather()
def read_feather(path, *args, **kwargs) -> object:
"""{docstring}"""
warnings.warn(
"Using CPU via PyArrow to r... | 0 | 1 | 0 | 0 | 1 | 0 |
kubestrike/bars.py | tpoindessous/kubestrike | 779 | 176738 | from __future__ import annotations
import sys
from progress.bar import FillingSquaresBar
from time import sleep
from colored import fg, bg, attr, fore, style
from colored import stylize
from functools import wraps
from colored import fg, bg, attr, fore, style
def prefix(item) -> object:
'''
This function decor... | 6 | 9 | 0 | 0 | 15 | 0 |
DiffAugment-biggan-imagenet/compare_gan/architectures/resnet_biggan_test.py | Rian-T/data-efficient-gans | 1,902 | 176766 | <filename>DiffAugment-biggan-imagenet/compare_gan/architectures/resnet_biggan_test.py
# coding=utf-8
# Copyright 2018 Google LLC & <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
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
engine/__init__.py | songtebo/puppet | 325 | 176801 | import rqalpha
config = {
"extra": {
"log_level": "verbose",
},
"mod": {
"live_trade": {
"lib": "./mod",
"enabled": True,
"priority": 100,
}
}
}
def run(baseConf) -> object:
config["base"] = baseConf
return rqalpha.run(config)
| 0 | 1 | 0 | 0 | 1 | 0 |
codigo/Live34/errors/test.py | cassiasamp/live-de-python | 572 | 176818 | print(open('teste_win1252.txt', errors='strict').read())
print(open('teste_win1252.txt', errors='replace').read())
print(open('teste_win1252.txt', errors='ignore').read())
print(open('teste_win1252.txt', errors='surrogateescape').read())
print(open('teste_win1252.txt', errors='backslashreplace').read())
| 0 | 0 | 0 | 0 | 0 | 0 |
tutorials/W1D5_Regularization/solutions/W1D5_Tutorial2_Solution_519e352b.py | moekay/course-content-dl | 473 | 176824 | <gh_stars>100-1000
"""
Regularization works by penalizing model complexity. If the initial model is not
complex enough to correctly describe the data then no amount of regularization
will help as the model needs to get more complex to improve, not less.
"""; | 0 | 0 | 0 | 0 | 0 | 0 |
src/amuse/test/suite/ext_tests/test_brokenimf.py | rknop/amuse | 131 | 176856 | import numpy
from amuse.test import amusetest
from amuse.units import units, nbody_system
from amuse.ic.brokenimf import *
# Instead of random, use evenly distributed numbers, just for testing
default_options = dict(random=False)
class TestMultiplePartIMF(amusetest.TestCase):
def test1(self):
print(... | 0 | 0 | 0 | 0 | 0 | 0 |
Lib/objc/_TextInput.py | snazari/Pyto | 701 | 176931 | <gh_stars>100-1000
"""
Classes from the 'TextInput' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
TIUserModelDataStore = _Class("TIUserMo... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/gen_classic_policies.py | Zhaoxing-Li/zhaoxing.github.io | 662 | 176969 | <filename>scripts/gen_classic_policies.py
import os, os.path
outdir = 'classic_policies'
cmd_template = 'python scripts/run_rl_mj.py --env_name {env} --tiny_policy --min_total_sa 5000 --sim_batch_size 1 --max_iter 101 --log {out}'
try: os.mkdir(outdir)
except OSError: pass
for env in ['CartPole-v0', 'Acrobot-v0', 'M... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_monitors.py | vaishnavtv/neurodiffeq | 202 | 176988 | <filename>tests/test_monitors.py
import numpy as np
import pytest
from neurodiffeq.conditions import NoCondition
from neurodiffeq.networks import FCNN
from neurodiffeq.monitors import Monitor2D, MetricsMonitor, Monitor1D, StreamPlotMonitor2D
N_FUNCTIONS = 2
EMPTY_HISTORY = dict(train_loss=[], valid_loss=[])
HISTORY_10... | 0 | 0 | 0 | 0 | 0 | 0 |
pytorch_ares/third_party/hydra/locuslab_smoothing/analyze.py | thu-ml/realsafe | 107 | 176989 | import numpy as np
import matplotlib
# matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
from typing import *
import pandas as pd
import seaborn as sns
import math
sns.set()
class Accuracy(object):
def at_radii(self, radii: np.ndarray):
raise NotImplementedError()
class ApproximateAccuracy(Accur... | 36 | 6 | 0 | 0 | 42 | 0 |
ramile-cli.py | EdisonLiao/ramile | 109 | 176990 | <gh_stars>100-1000
#! python
import fire
from ramile.project import Project
from ramile.processors import FileProcessor
class ramile_cli(object):
def extract(self, project_root, lines_to_extract=3000):
project = Project(project_root, lines_to_extract)
project.run()
return
def whatca... | 0 | 0 | 0 | 0 | 0 | 0 |
alg/adsgan/metrics/compute_wd.py | loramf/mlforhealthlabpub | 171 | 176993 | <reponame>loramf/mlforhealthlabpub<gh_stars>100-1000
"""Anonymization through Data Synthesis using Generative Adversarial Networks:
A harmonizing advancement for AI in medicine (ADS-GAN) Codebase.
Reference: <NAME>, <NAME>, <NAME>,
"Anonymization through Data Synthesis using Generative Adversarial Networks (ADS-GAN):... | 0 | 0 | 0 | 0 | 0 | 0 |
client/verta/tests/registry/model_version/test_artifacts.py | benshaw/modeldb | 835 | 176998 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import pytest
from verta._internal_utils import _artifact_utils
pytestmark = pytest.mark.not_oss # skip if run in oss setup. Applied to entire module
class TestArtifacts:
def test_log_artifact(self, model_version):
np = pytest.importorskip("numpy")
p... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoLuminosity/LumiProducer/python/lumiProducer_cfi.py | ckamtsikis/cmssw | 852 | 177027 |
import FWCore.ParameterSet.Config as cms
lumiProducer=cms.EDProducer("LumiProducer",
connect=cms.string(''),
lumiversion=cms.untracked.string(''),
ncacheEntries=cms.untracked.uint32(5)
)
| 0 | 0 | 0 | 0 | 0 | 0 |
codigo/Live59/exemplo_5.py | cassiasamp/live-de-python | 572 | 177053 | <reponame>cassiasamp/live-de-python
from asyncio import get_event_loop, sleep, ensure_future, gather
from collections.abc import AsyncIterator
from types import coroutine
from functools import singledispatch
from typing import Collection, Dict
from io import IOBase
@singledispatch
@coroutine
def aiter(iterator):
... | 0 | 0 | 0 | 0 | 0 | 0 |
models/language_translation/tensorflow/transformer_mlperf/inference/fp32/transformer/export_transformer.py | ashahba/models | 357 | 177087 | #! /usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import argparse
import sys
import tensorflow as tf
from model import model_params
from model import transformer
tf.compat.v1.disable_v2_behavior()
_EXTRA_DECODE_LENGTH = 100... | 0 | 0 | 0 | 0 | 0 | 0 |
lightly/models/modules/nn_memory_bank.py | CodeGuy-007/lightly | 1,515 | 177096 | <filename>lightly/models/modules/nn_memory_bank.py
""" Nearest Neighbour Memory Bank Module """
# Copyright (c) 2021. Lightly AG and its affiliates.
# All Rights Reserved
import torch
from lightly.loss.memory_bank import MemoryBankModule
class NNMemoryBankModule(MemoryBankModule):
"""Nearest Neighbour Memory Ba... | 0 | 0 | 0 | 0 | 0 | 0 |
deeppavlov/models/preprocessors/sentseg_preprocessor.py | xbodx/DeepPavlov | 5,893 | 177127 | from typing import List
from deeppavlov.core.common.registry import register
@register("sentseg_restore_sent")
def SentSegRestoreSent(batch_words: List[List[str]], batch_tags: List[List[str]]) -> List[str]:
ret = []
for words, tags in zip(batch_words, batch_tags):
if len(tags) == 0:
ret.a... | 2 | 1 | 0 | 0 | 3 | 0 |
insights/parsers/config_file_perms.py | lhuett/insights-core | 121 | 177131 | """
Configuration File Permissions parsers
======================================
Parsers included in this module are:
SshdConfigPerms - command ``/bin/ls -l /etc/ssh/sshd_config``
-------------------------------------------------------------
Grub1ConfigPerms - command ``/bin/ls -l /boot/grub/grub.conf``
------------... | 0 | 0 | 0 | 1 | 1 | 0 |
hummingbot/connector/exchange/bitfinex/bitfinex_auth.py | BGTCapital/hummingbot | 3,027 | 177156 | from __future__ import annotations
import hashlib
import hmac
import time
class BitfinexAuth():
def __init__(self, api_key: str, secret_key: str):
self.api_key = api_key
self.secret_key = secret_key
self.last_nonce: int = 0
def _sign_payload(self, payload) -> str:
sig = hmac.n... | 3 | 4 | 0 | 1 | 8 | 0 |
orig/barjoseph.py | jamesscottbrown/reorder.js | 109 | 177246 | <reponame>jamesscottbrown/reorder.js
"""optimal dendrogram ordering
implementation of binary tree ordering described in [Bar-Joseph et al., 2003]
by <NAME>.
[Bar-Joseph et al., 2003]
K-ary Clustering with Optimal Leaf Ordering for Gene Expression Data.
<NAME>, <NAME>, <NAME>, <NAME>,
<NAME> and <NAME>
Bioinformatics,... | 0 | 0 | 0 | 0 | 0 | 0 |
recorder.py | godlovesdavid/Impulcifer | 105 | 177297 | # -*- coding: utf-8 -*-
from __future__ import annotations
import os
import re
import sounddevice as sd
from utils import read_wav, write_wav
import numpy as np
from threading import Thread
import argparse
class DeviceNotFoundError(Exception):
pass
def record_target(file_path, length, fs, channels: int=2, appe... | 15 | 5 | 0 | 0 | 20 | 0 |
caffe2/python/helpers/control_ops.py | kickers18/caffe2 | 585 | 177298 | # Copyright (c) 2016-present, Facebook, 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... | 2 | 0 | 0 | 0 | 2 | 0 |
tools/convert_datasets/eurocity/convert_eurocity_to_coco.py | Ernstsen/Pedestron | 594 | 177299 | <filename>tools/convert_datasets/eurocity/convert_eurocity_to_coco.py
import os
import datetime
import json
import numpy as np
import glob
import cv2
from scipy.io import loadmat
from PIL import Image
import pycococreatortools
INFO = {
"description": "Example Dataset",
"url": "https://github.com/waspinator/pyc... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_trainAndDev.py | wasimaftab/kindred | 141 | 177304 | <filename>tests/test_trainAndDev.py
import sys
import kindred
from kindred.datageneration import generateData,generateTestData
def _bionlpst_bb3(swap):
trainCorpus = kindred.bionlpst.load('2016-BB3-event-train')
devCorpus = kindred.bionlpst.load('2016-BB3-event-dev')
if swap:
trainCorpus,devCorpus = devCorpus,... | 0 | 0 | 0 | 0 | 0 | 0 |
nixui/utils/store.py | yater/nix-gui | 254 | 177322 | <gh_stars>100-1000
import os
def get_store_path():
if 'XDG_CONFIG_HOME' in os.environ:
config_home = os.environ['XDG_CONFIG_HOME']
else:
config_home = os.path.join(
os.getenv("HOME"),
'.config'
)
return os.path.join(
config_home,
'nixgui'
... | 0 | 0 | 0 | 0 | 0 | 0 |
nabu/neuralnetworks/decoders/__init__.py | AzizCode92/nabu | 117 | 177345 | '''@package decoders
this package contains all the decoders'''
from . import decoder, decoder_factory
| 0 | 0 | 0 | 0 | 0 | 0 |
scripts/make_svm_train_file.py | bartvanerp/visqol | 292 | 177367 | # Copyright 2019 Google LLC, <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 agreed to in w... | 0 | 0 | 0 | 0 | 0 | 0 |
ptracer/ptrace/_defs_linux.py | fakeNetflix/pinterest-repo-ptracer | 147 | 177368 | <reponame>fakeNetflix/pinterest-repo-ptracer
# Copyright (C) 2017-present Pinterest Inc.
#
# This module is part of ptracer and is released under
# the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0
import ctypes
import os
import signal
from . import platform
from . import syscalldef
if platform.BIT... | 0 | 0 | 0 | 0 | 0 | 0 |
saliency/tf1/blur_ig_test.py | lenbrocki/saliency | 728 | 177369 | # Copyright 2021 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 law or ag... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/apps/sms/migrations/0024_add_is_two_way.py | dimagilg/commcare-hq | 471 | 177411 | <gh_stars>100-1000
import datetime
from django.db import migrations, models
def set_pending_verification_numbers(apps, schema_editor):
PhoneNumber = apps.get_model('sms', 'PhoneNumber')
db_alias = schema_editor.connection.alias
PhoneNumber.objects.using(db_alias).filter(verified=False).update(is_two_way=... | 0 | 0 | 0 | 0 | 0 | 0 |
shared/util.py | JohannesPertl/vreddit-download-bot | 300 | 177415 | from __future__ import annotations
import json
import logging
import os
import re
import sys
import urllib.parse
from urllib.error import HTTPError, URLError
from urllib.request import Request
import praw
import requests
import yaml
from shared.exceptions import AlreadyProcessed
def load_configuration() -> object:
... | 1 | 7 | 0 | 0 | 8 | 0 |
orc8r/cloud/deploy/orc8r_deployer/docker/root/scripts/testlib/cluster_factory.py | Aitend/magma | 849 | 177426 | """
Copyright 2021 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 2 | 1 | 0 | 0 | 3 | 0 |
python_modules/dagster-graphql/dagster_graphql/schema/roots/execution_plan.py | dbatten5/dagster | 4,606 | 177505 | <reponame>dbatten5/dagster
import graphene
from ..errors import GraphenePipelineNotFoundError, GraphenePythonError
from ..execution import GrapheneExecutionPlan
from ..pipelines.config import GraphenePipelineConfigValidationInvalid
from ..pipelines.pipeline_errors import GrapheneInvalidSubsetError
class GrapheneExec... | 0 | 0 | 0 | 0 | 0 | 0 |
great_expectations/cli/upgrade_helpers/__init__.py | victorcouste/great_expectations | 6,451 | 177519 | <reponame>victorcouste/great_expectations
from great_expectations.cli.upgrade_helpers.upgrade_helper_v11 import UpgradeHelperV11
from great_expectations.cli.upgrade_helpers.upgrade_helper_v13 import UpgradeHelperV13
GE_UPGRADE_HELPER_VERSION_MAP = {
1: UpgradeHelperV11,
2: UpgradeHelperV13,
}
| 0 | 0 | 0 | 0 | 0 | 0 |
braintree/exceptions/server_error.py | futureironman/braintree_python | 182 | 177565 | <filename>braintree/exceptions/server_error.py
from braintree.exceptions.braintree_error import BraintreeError
class ServerError(BraintreeError):
"""
Raised when the gateway raises an error. Please contant support at <EMAIL>.
See https://developers.braintreepayments.com/reference/general/exceptions/pytho... | 0 | 0 | 0 | 0 | 0 | 0 |
sahara/plugins/recommendations_utils.py | ksshanam/sahara | 161 | 177578 | # Copyright (c) 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 agreed to in writ... | 2 | 19 | 0 | 1 | 22 | 0 |
torchsketch/data/datasets/tu_berlin/__init__.py | songyzh/torchsketch | 182 | 177585 | from torchsketch.data.datasets.tu_berlin.download_tu_berlin import download_tu_berlin | 0 | 0 | 0 | 0 | 0 | 0 |
stock-filters/decliff.py | bennettdc/MCEdit-Unified | 237 | 177632 | from __future__ import annotations
"""
DeCliff filter contributed by Minecraft Forums user "DrRomz"
Originally posted here:
http://www.minecraftforum.net/topic/13807-mcedit-minecraft-world-editor-compatible-with-mc-beta-18/page__st__3940__p__7648793#entry7648793
"""
from numpy import zeros, array
import itertools
from... | 0 | 1 | 0 | 0 | 1 | 0 |
_old/AutoContributor/autocontributor.py | tigefa4u/reddit | 444 | 177639 | #/u/GoldenSights
import praw # simple interface to the reddit API, also handles rate limiting of requests
import time
import sqlite3
'''USER CONFIGURATION'''
APP_ID = ""
APP_SECRET = ""
APP_URI = ""
APP_REFRESH = ""
# https://www.reddit.com/comments/3cm1p8/how_to_make_your_bot_use_oauth2/
USERAGENT = ""
#This is a sho... | 0 | 0 | 0 | 0 | 0 | 0 |
thinplate/tests/test_tps_pytorch.py | kingsj0405/py-thin-plate-spline | 120 | 177658 | import torch
import torch.optim as optim
import torch.nn.functional as F
import numpy as np
import thinplate as tps
from numpy.testing import assert_allclose
def test_pytorch_grid():
c_dst = np.array([
[0., 0],
[1., 0],
[1, 1],
[0, 1],
], dtype=np.float32)
c_src =... | 0 | 0 | 0 | 0 | 0 | 0 |
social/apps/django_app/context_processors.py | raccoongang/python-social-auth | 1,987 | 177660 | from social_django.context_processors import LazyDict, backends, login_redirect
| 0 | 0 | 0 | 0 | 0 | 0 |
packages/vaex-core/vaex/file/asyncio.py | sethvargo/vaex | 337 | 177671 | from __future__ import annotations
import io
import asyncio
import threading
import queue
import logging
from starlette import concurrency
logger = logging.getLogger('vaex.file.async')
class WriteStream(io.RawIOBase):
'''File like object that has a sync write API, and a generator as consumer.
This is ... | 2 | 12 | 0 | 4 | 18 | 0 |
neo/Prompt/Commands/Search.py | volekerb/neo-python | 387 | 177709 | <reponame>volekerb/neo-python<filename>neo/Prompt/Commands/Search.py
from neo.Prompt.CommandBase import CommandBase, CommandDesc, ParameterDesc
from neo.Prompt.PromptData import PromptData
from neo.Prompt.Utils import get_arg
from neo.Core.Blockchain import Blockchain
from neo.logging import log_manager
from neo.P... | 0 | 0 | 0 | 0 | 0 | 0 |
validation_tests/analytical_exact/carrier_greenspan_transient/analytical_cg_transient.py | samcom12/anuga_core | 136 | 177743 | <gh_stars>100-1000
"""
Transient water flows using ANUGA,
where water driven up a linear sloping beach and time varying boundary.
Ref: <NAME> Greenspan, Journal of Fluid Mechanics, 1958
"""
from scipy import linspace, zeros, array, dot
from math import log, ceil, sqrt
from scipy.optimize import fsolve
eps = 0... | 0 | 0 | 0 | 0 | 0 | 0 |
yt/frontends/adaptahop/api.py | Xarthisius/yt | 360 | 177745 | <filename>yt/frontends/adaptahop/api.py
"""
API for AdaptaHOP frontend
"""
from . import tests
from .data_structures import AdaptaHOPDataset
from .fields import AdaptaHOPFieldInfo
from .io import IOHandlerAdaptaHOPBinary
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/basics/kmeans.py | jjpalacio/tflearn | 10,882 | 177781 | <filename>examples/basics/kmeans.py
""" K-Means Example """
from __future__ import division, print_function, absolute_import
from tflearn.estimators import KMeans
# Data loading and preprocessing
import tflearn.datasets.mnist as mnist
X, Y, testX, testY = mnist.load_data(one_hot=False)
# K-Means training
m = KMeans... | 0 | 0 | 0 | 0 | 0 | 0 |
model/fcs.py | hdliu21/openISP | 384 | 177794 | <filename>model/fcs.py<gh_stars>100-1000
#!/usr/bin/python
import numpy as np
class FCS:
'False Color Suppresion'
def __init__(self, img, edgemap, fcs_edge, gain, intercept, slope):
self.img = img
self.edgemap = edgemap
self.fcs_edge = fcs_edge
self.gain = gain
self.int... | 0 | 0 | 0 | 0 | 0 | 0 |
terrascript/provider/e_breuninger/netbox.py | mjuenema/python-terrascript | 507 | 177798 | # terrascript/provider/e-breuninger/netbox.py
# Automatically generated by tools/makecode.py (24-Sep-2021 15:22:23 UTC)
import terrascript
class netbox(terrascript.Provider):
"""Terraform provider to interact with Netbox"""
__description__: str = "Terraform provider to interact with Netbox"
__namespace_... | 0 | 0 | 7 | 0 | 7 | 0 |
util/logger.py | Pandinosaurus/videoavatars | 531 | 177804 | <reponame>Pandinosaurus/videoavatars<gh_stars>100-1000
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import logging
__all__ = ['log']
FORMAT = "%(asctime)s [%(filename)s:%(funcName)s:%(lineno)d] %(message)s"
log = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO, format=FORMAT)
| 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.