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 |
|---|---|---|---|---|---|---|---|---|---|---|
sandbox/finetuning/envs/mujoco/mujoco_env.py | andrewli77/rllab-finetuning | 104 | 3311810 | <reponame>andrewli77/rllab-finetuning
from functools import reduce
import os.path as osp
import collections
import numpy as np
import gc
from rllab.envs.mujoco.mujoco_env import MujocoEnv
from rllab import spaces
from rllab.misc.overrides import overrides
from rllab.misc import logger
import matplotlib as mpl
mpl.use... | 0 | 0 | 0 | 0 | 0 | 0 |
Validation/TrackerHits/python/trackerHitsValidation_cff.py | ckamtsikis/cmssw | 852 | 3311814 | import FWCore.ParameterSet.Config as cms
from Validation.TrackerHits.trackerHitsValidation_cfi import *
trackerHitsValidation = cms.Sequence(trackerHitsValid)
trackerSiStripHitsValidation = cms.Sequence(trackerSiStripHitsValid)
from Configuration.Eras.Modifier_phase1Pixel_cff import phase1Pixel
phase1Pixel.toReplace... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/contrib/nn/python/ops/sampling_ops_test.py | tianyapiaozi/tensorflow | 522 | 3311828 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 8 | 0 | 0 | 8 | 0 |
AV_TheSeersAccuracy/createFeatures.py | galileoSolution/ML | 212 | 3311839 | <reponame>galileoSolution/ML
import csv
import pandas as pd
import numpy as np
import datetime
from sklearn.preprocessing import LabelEncoder
def getFeatures(df, dv_list=set(), start_date=datetime.datetime(2006,1,1)):
grouped_df = df.groupby("Client_ID")
for name, group in grouped_df:
#if group.shape[0] < 2:
# c... | 0 | 0 | 0 | 0 | 0 | 0 |
mx.sulong/mx_sulong_benchmarks.py | rschatz/sulong | 668 | 3311844 | #
# Copyright (c) 2016, 2018, Oracle and/or its affiliates.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this lis... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_data_factor.py | rajach/spectre | 302 | 3311855 | import unittest
import spectre
from numpy.testing import assert_array_equal
from os.path import dirname
data_dir = dirname(__file__) + '/data/'
class TestDataFactorLib(unittest.TestCase):
def test_datafactor_value(self):
loader = spectre.data.CsvDirLoader(
data_dir + '/daily/',
oh... | 0 | 0 | 0 | 0 | 0 | 0 |
app/ch16_mongodb/final/pypi_org/services/package_service.py | tbensonwest/data-driven-web-apps-with-flask | 496 | 3311864 | from typing import List, Optional
from pypi_org.nosql.packages import Package
from pypi_org.nosql.releases import Release
def get_latest_releases(limit: int=10) -> List[Release]:
releases = Release.objects(). \
order_by("-created_date"). \
limit(limit). \
all()
return releases
def g... | 5 | 7 | 0 | 0 | 12 | 0 |
textless/vocoders/tacotron2/vocoder.py | an918tw/textlesslib | 198 | 3311889 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import torch.nn as nn
import torch
from .tts_data import TacotronInputDataset
from .model import Tacotron2
... | 14 | 7 | 0 | 0 | 21 | 0 |
BERT/data_loader.py | shinoyuki222/torch-light | 310 | 3311896 | import random
import numpy as np
import torch
from torch.utils.data import Dataset
from const import *
def truncate_seq_pair(tokens_a, tokens_b, max_length):
while True:
total_length = len(tokens_a) + len(tokens_b)
if total_length <= max_length:
break
if len(tokens_a) > len(t... | 0 | 7 | 0 | 0 | 7 | 0 |
hackr/web.py | loftwah/hackr | 111 | 3311913 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
import requests
from xml.etree.ElementTree import tostring
from xmljson import badgerfish as bf
from BeautifulSoup import BeautifulSoup
import urllib2
import os
"""
Defining this function as of now. Will come back to this late... | 0 | 2 | 0 | 0 | 2 | 0 |
sling/nlp/parser/tools/train_caspar.py | infinitescale/sling | 2,023 | 3311930 | import sling
import sling.flags as flags
import sling.task.workflow as workflow
flags.define("--accurate", default=False,action='store_true')
flags.parse()
if flags.arg.accurate:
modelfn = "local/data/e/caspar/caspar-accurate.flow"
rnn_layers = 3
rnn_dim = 192
else:
modelfn = "local/data/e/caspar/caspar.flow... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/loganalytics/azure-mgmt-loganalytics/tests/test_mgmt_loganalytics.py | rsdoherty/azure-sdk-for-python | 2,728 | 3311931 | import azure.mgmt.loganalytics
from devtools_testutils import AzureMgmtTestCase
class MgmtLogAnalyticsTest(AzureMgmtTestCase):
def setUp(self):
super(MgmtLogAnalyticsTest, self).setUp()
self.client = self.create_mgmt_client(
azure.mgmt.loganalytics.LogAnalyticsManagementClient
... | 0 | 0 | 0 | 0 | 0 | 0 |
commands/text.py | Commodoreprime/Command-Block-Assembly | 223 | 3311942 | import json
from .core import Command, EntityRef, Resolvable
from .scoreboard import ScoreRef
from .nbt import Path, NBTStorable
class Tellraw(Command):
def __init__(self, text, target):
assert isinstance(text, TextComponentHolder)
assert isinstance(target, EntityRef)
self.text = text
... | 0 | 8 | 0 | 0 | 8 | 0 |
galpy/potential/RingPotential.py | gusbeane/galpy | 147 | 3311975 | ###############################################################################
# RingPotential.py: The gravitational potential of a thin, circular ring
###############################################################################
from __future__ import annotations
import numpy
from scipy import special
from ..util... | 17 | 6 | 0 | 2 | 25 | 0 |
kolibri/core/discovery/test/test_upgrade.py | MBKayro/kolibri | 545 | 3311992 | import unittest
from django.conf import settings
from django.db.utils import OperationalError
from django.db.utils import ProgrammingError
from django.test import TestCase
from mock import patch
from kolibri.core.discovery.models import NetworkLocation
from kolibri.core.discovery.upgrade import move_network_location_... | 0 | 0 | 1 | 0 | 1 | 0 |
scripts/download_submodules.py | kbuffington/foo_spider_monkey_panel | 277 | 3312038 | <gh_stars>100-1000
#!/usr/bin/env python3
import subprocess
from pathlib import Path
import call_wrapper
def download_submodule(root_dir, submodule_name):
print(f"Downloading {submodule_name}...")
try:
subprocess.check_call(f"git submodule update --init --depth=10 -- submodules/{submodule_name}", cwd... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/runtest.py | jackywang615/aircv | 313 | 3312040 | #!/usr/bin/env python
# coding: utf-8
#
# aircv test cases
import aircv
def main():
bg = aircv.imread('testdata/bg.png')
search = aircv.imread('testdata/guard.png')
print aircv.find_sift(bg, search)
if __name__ == '__main__':
main() | 0 | 0 | 0 | 0 | 0 | 0 |
pybatfish/datamodel/route.py | batfish/pybatfish | 160 | 3312046 | <reponame>batfish/pybatfish<gh_stars>100-1000
# coding=utf-8
# Copyright 2018 The Batfish Open Source Project
#
# 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.apac... | 0 | 0 | 0 | 0 | 0 | 0 |
codebase/models/dirtt.py | chiachiyeh/dddirt-t | 167 | 3312048 | import importlib
import tensorflow as tf
import tensorbayes as tb
import numpy as np
from extra_layers import basic_accuracy, vat_loss
from codebase.args import args
from pprint import pprint
from tensorbayes.tfutils import softmax_cross_entropy_with_two_logits as softmax_xent_two
from tensorbayes.layers import placeho... | 0 | 1 | 0 | 0 | 1 | 0 |
examples/recognize_song.py | asmiyusau/ShazamIO | 111 | 3312061 | <reponame>asmiyusau/ShazamIO<filename>examples/recognize_song.py
import asyncio
from shazamio import Shazam
async def main():
shazam = Shazam()
out = await shazam.recognize_song('data/dora.ogg')
print(out)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
| 0 | 0 | 0 | 0 | 0 | 0 |
system/apps_featured/113_circuitpython/scripts/tetris2.py | tomwei7/LA104 | 336 | 3312072 | import mini
lcd = mini.lcd()
key = mini.key()
sys = mini.sys()
colors = [0x404040, 0x55ff55, 0xff5555, 0x5555ff]
block_square = [0b0000011001100000]
block_line = [0b0000000011110000, 0b0010001000100010]
block_l = [0b0000010001000110, 0b00000001011100000, 0b0000011000100010, 0b0000111010000000]
block_l2 = [0b0100010001... | 0 | 3 | 0 | 0 | 3 | 0 |
examples/slimevolley/train_rainbow.py | ummavi/pfrl-1 | 824 | 3312073 | import argparse
import gym
import gym.spaces
import numpy as np
import torch
from torch import nn
import pfrl
from pfrl import agents, experiments, explorers
from pfrl import nn as pnn
from pfrl import replay_buffers, utils
class MultiBinaryAsDiscreteAction(gym.ActionWrapper):
"""Transforms MultiBinary action s... | 0 | 5 | 0 | 0 | 5 | 0 |
annif/analyzer/voikko.py | mo-fu/Annif | 121 | 3312106 | from __future__ import annotations
"""Voikko analyzer for Annif, based on libvoikko library."""
import functools
import voikko.libvoikko
from . import analyzer
class VoikkoAnalyzer(analyzer.Analyzer):
name: str = "voikko"
def __init__(self, param, **kwargs):
self.param = param
self.voikko: N... | 0 | 2 | 1 | 1 | 4 | 0 |
Packs/FeedGCPWhitelist/Integrations/FeedGoogleIPRanges/FeedGoogleIPRanges.py | diCagri/content | 799 | 3312124 | <filename>Packs/FeedGCPWhitelist/Integrations/FeedGoogleIPRanges/FeedGoogleIPRanges.py
import demistomock as demisto
from CommonServerPython import *
from JSONFeedApiModule import * # noqa: E402
feed_config = {
'All GCP customer global and regional external IP ranges':
dict(CIDR={
'url': 'htt... | 0 | 0 | 0 | 0 | 0 | 0 |
coherence/test/__init__.py | wd8rde/Coherence | 112 | 3312128 |
# Copyright 2014 <NAME> <<EMAIL>>
import functools
def wrapped(deferred) -> object:
"""
Decorator for wrapping functions by try-except and ensure
errback() is called on failure.
"""
def decorator(callback) -> object:
@functools.wraps(callback)
def wrapper(*args, **kwargs):
... | 0 | 2 | 0 | 0 | 2 | 0 |
graph_explorer/test/test_structured_metrics_native_proto2.py | farheenkaifee/dashboard_3 | 284 | 3312165 | <gh_stars>100-1000
from graph_explorer import structured_metrics
def test_native_proto2_disabled():
# by default, the plugin ignores them
s_metrics = structured_metrics.StructuredMetrics()
s_metrics.load_plugins()
key = "foo.bar=blah.baz"
real = s_metrics.list_metrics([key])
assert len(real) ... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter05/decorator_parametrized_2.py | TranQuangDuc/Clean-Code-in-Python | 402 | 3312169 | from __future__ import annotations
"""Clean Code in Python - Chapter 5: Decorators
Parametrized decorators using callable objects.
"""
from functools import wraps
from decorator_function_1 import ControlledException
from log import logger
RETRIES_LIMIT = 3
class WithRetry:
def __init__(self, retries_limit=RETR... | 1 | 6 | 0 | 0 | 7 | 0 |
hs_odm2/migrations/0002_auto_20190723_1644.py | hydroshare/hydroshare | 178 | 3312206 | <reponame>hydroshare/hydroshare
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-07-23 16:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hs_odm2', '0001_initial'),
]
operations = [
migrations.RenameField(
m... | 0 | 0 | 0 | 0 | 0 | 0 |
libtbx/tst_topological_sort.py | dperl-sol/cctbx_project | 155 | 3312217 | from __future__ import absolute_import, division, print_function
from six.moves import range
def exercise_specific():
from libtbx.topological_sort import stable
from libtbx.topological_sort import strongly_connected_components as scc
connections = [
("a", ["b", "d"]),
("b", []),
("c", []),
("d", [... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_directives.py | wspaws/graphene-django-extras | 409 | 3312237 | from django.test import TestCase
from tests.test_fields import ParentTest
class DateDirective_DateTime_Test(ParentTest, TestCase):
query: str = """query { datetime @date(format:"HH:mm:ss YYYY.MM.DD") }"""
expected_return_payload: dict[str,dict[str,str]] = {"data": {"datetime": "10:21:30 2020.12.31"}}
class... | 0 | 0 | 6 | 0 | 6 | 0 |
mmseg/models/backbones/erfnet.py | heytanay/mmsegmentation | 103 | 3312240 | <gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from mmcv.cnn import build_activation_layer, build_conv_layer, build_norm_layer
from mmcv.runner import BaseModule
from mmseg.ops import resize
from ..builder import BACKBONES
class DownsamplerBlock(BaseModule):
... | 0 | 0 | 0 | 0 | 0 | 0 |
project/boh_api/viewsets.py | j2yemi/dso-demo1 | 109 | 3312251 | <gh_stars>100-1000
from django.contrib.auth import get_user_model
from rest_framework import viewsets
from boh import models
from . import serializers
class OrganizationViewSet(viewsets.ModelViewSet):
queryset = models.Organization.objects.all()
serializer_class = serializers.OrganizationSerializer
class... | 0 | 0 | 0 | 0 | 0 | 0 |
shivyc/asm_cmds.py | cmm-compiler/ShivyC | 953 | 3312305 | <gh_stars>100-1000
"""This module defines and implements classes representing assembly commands.
The _ASMCommand object is the base class for most ASM commands. Some commands
inherit from _ASMCommandMultiSize or _JumpCommand instead.
"""
class _ASMCommand:
"""Base class for a standard ASMCommand, like `add` or ... | 0 | 0 | 0 | 0 | 0 | 0 |
nototools/dump_otl.py | dedbbs1/nototools | 156 | 3312309 | #!/usr/bin/env python
#
# Copyright 2014 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 require... | 4 | 11 | 0 | 0 | 15 | 0 |
LSTM_eval.py | jxwufan/AssociativeRetrieval | 136 | 3312353 | import tensorflow as tf
import configuration
import numpy as np
from LSTM_model import LSTM_model
def main():
config = configuration.ModelConfig(data_filename="input_seqs_eval")
train(config)
def train(config):
with tf.Graph().as_default():
model = LSTM_model(config)
inputs_seqs_batch, outputs_batch = ... | 0 | 0 | 0 | 0 | 0 | 0 |
runtests.py | kirill1194/django-password-reset | 194 | 3312373 | <reponame>kirill1194/django-password-reset
#!/usr/bin/env python
import os
import sys
import warnings
import django
from django.test.runner import DiscoverRunner
warnings.simplefilter('always')
os.environ['DJANGO_SETTINGS_MODULE'] = 'password_reset.tests.settings'
def runtests():
parent = os.path.dirname(os.pa... | 0 | 0 | 0 | 0 | 0 | 0 |
mars/learn/contrib/lightgbm/tests/test_regressor.py | ConanoutlooklvTBS/mars | 2,413 | 3312386 | <filename>mars/learn/contrib/lightgbm/tests/test_regressor.py
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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 |
pyad/pyadconstants.py | jhollowe/pyad | 145 | 3312418 | from __future__ import absolute_import
from .pyadexceptions import *
# http://msdn.microsoft.com/en-us/library/aa772263(VS.85).aspx
ADS_GROUP_TYPE = {
'GLOBAL':0x2,
'LOCAL':0x4,
'UNIVERSAL':0x8,
'SECURITY_ENABLED':-0x80000000}
# http://msdn.microsoft.com/en-us/library/aa772300.aspx
ADS_US... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_compatibility_patch.py | J-hanks/django-bootstrap-datepicker-plus | 193 | 3312427 | <filename>tests/test_compatibility_patch.py
from django.test import SimpleTestCase
from bootstrap_datepicker_plus._compatibility import BaseRenderer
from bootstrap_datepicker_plus._helpers import get_base_input
class CustomCompatibleDatePickerInput(get_base_input(True)):
template_name = "myapp/custom_input/date-... | 0 | 0 | 0 | 0 | 0 | 0 |
test/classes/class8.py | kylebarron/MagicPython | 1,482 | 3312428 | <reponame>kylebarron/MagicPython
class None: pass
class True(False): pass
class False(object): pass
class : meta.class.python, source.python, storage.type.class.python
: meta.class.python, source.python
None : keyword.illegal.name.python, meta.class.python, source.python
: ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/validation/test_perturbators.py | vitorsrg/fklearn | 1,505 | 3312431 | <filename>tests/validation/test_perturbators.py
from fklearn.validation.perturbators import \
shift_mu, random_noise, nullify, sample_columns, perturbator
import pandas as pd
import numpy as np
def test_shift_mu():
series = pd.Series([1, 3, 5, 7, 166])
shift_by = 0.7
expected = pd.Series([26.48, 28.4... | 0 | 0 | 0 | 0 | 0 | 0 |
test/templates/Test/apps/Hello/template_plugins/jquery.py | timgates42/uliweb | 202 | 3312443 | from __future__ import annotations
def call() -> dict[str,list[object] | object]:
a = ['jquery.js', 'jquery.utils.js']
return {'toplinks':a, 'bottomlinks':[]}
| 0 | 1 | 0 | 0 | 1 | 0 |
RecoJets/JetProducers/python/fixedGridRhoProducerFastjet_cfi.py | ckamtsikis/cmssw | 852 | 3312463 | import FWCore.ParameterSet.Config as cms
fixedGridRhoFastjetAll = cms.EDProducer("FixedGridRhoProducerFastjet",
pfCandidatesTag = cms.InputTag("particleFlow"),
maxRapidity = cms.double(5.0),
gridSpacing = cms.double(0.55)
)
fixedGridRhoFastjetAllCalo = cms.EDProducer("FixedGridRhoProducerFastjet",
p... | 0 | 0 | 0 | 0 | 0 | 0 |
tensornets/adlib/__init__.py | IanBoyanZhang/tensorgrad | 113 | 3312471 | from .svd import SVD
from .eigh import EigenSolver
from .qr import QR
| 0 | 0 | 0 | 0 | 0 | 0 |
third_party/virtualbox/src/VBox/ValidationKit/testmanager/core/report.py | Fimbure/icebox-1 | 521 | 3312472 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# $Id: report.py $
"""
Test Manager - Report models.
"""
__copyright__ = \
"""
Copyright (C) 2012-2017 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute... | 0 | 0 | 0 | 0 | 0 | 0 |
third_party/Paste/tests/urlparser_data/hook/__init__.py | tingshao/catapult | 5,079 | 3312483 | from paste import request
def urlparser_hook(environ) -> None:
first, rest = request.path_info_split(environ.get('PATH_INFO', ''))
if not first:
# No username
return
environ['app.user'] = first
environ['SCRIPT_NAME'] += '/' + first
environ['PATH_INFO'] = rest
| 0 | 1 | 0 | 0 | 1 | 0 |
model.py | ibalazevic/multirelational-poincare | 134 | 3312501 | import numpy as np
import torch
from utils import *
class MuRP(torch.nn.Module):
def __init__(self, d, dim):
super(MuRP, self).__init__()
self.Eh = torch.nn.Embedding(len(d.entities), dim, padding_idx=0)
self.Eh.weight.data = (1e-3 * torch.randn((len(d.entities), dim), dtype=torch.double, ... | 0 | 2 | 0 | 0 | 2 | 0 |
ML/algorithms/kmeans/kmeansclustering.py | xuyannus/Machine-Learning-Collection | 3,094 | 3312538 | """
From scratch implementation of K means clustering which is a unsupervised
clustering method that works by iteratively computing new centroids and
moving centroids to the center of the new formed clusters.
Programmed by <NAME> <aladdin.persson at hotmail dot com>
* 2020-05-28 Initial coding
"""
import numpy... | 0 | 5 | 0 | 2 | 7 | 0 |
tests/issue0063.py | mfkiwl/pcpp | 146 | 3312539 | from __future__ import absolute_import, print_function
import unittest
import sys
class runner(object):
def runTest(self):
from pcpp import CmdPreprocessor
p = CmdPreprocessor(['pcpp'] + self.options + [
'-o', 'tests/issue0063.i',
'tests/iss... | 0 | 0 | 6 | 0 | 6 | 0 |
CPAC/distortion_correction/__init__.py | gkiar/C-PAC | 125 | 3312543 | # Here data is hardcoded need to change that
# update resource pool information
| 0 | 0 | 0 | 0 | 0 | 0 |
sl4atools/fullscreenwrapper2/examples/calcount2_example/datetimehelpers.py | visdom2000/python-for-android | 267 | 3312566 | #-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: srinath.h
#
# Created: 13/05/2012
# Copyright: (c) srinath.h 2012
# Licence: <your licence>
#----------------------------------------------------------------------------... | 0 | 3 | 0 | 0 | 3 | 0 |
torch_geometric/graphgym/utils/plot.py | Kenneth-Schroeder/pytorch_geometric | 12,651 | 3312567 | import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.decomposition import PCA
sns.set_context('poster')
def view_emb(emb, dir):
'''
Visualize a embedding matrix.
Args:
emb (torch.tensor): Embedding matrix with shape (N, D). D is the
feature dimension.
dir (str): Out... | 0 | 0 | 0 | 0 | 0 | 0 |
api/tests/opentrons/protocol_engine/state/__init__.py | faliester/opentrons | 235 | 3312592 | """Tests module for ProtocolEngine state."""
| 0 | 0 | 0 | 0 | 0 | 0 |
dgc/memory.py | tdye24/deep-gradient-compression | 145 | 3312627 | <filename>dgc/memory.py
import torch
import horovod.torch as hvd
__all__ = ['Memory', 'DGCSGDMemory']
# code modified from https://github.com/sands-lab/grace/blob/master/grace_dl/torch/memory/dgc.py
class Memory:
@staticmethod
def initialize(*args, **kwargs):
pass
@staticmethod
def compensa... | 0 | 0 | 0 | 0 | 0 | 0 |
kitsune/inproduct/middleware.py | AndrewDVXI/kitsune | 929 | 3312667 | from django.utils.deprecation import MiddlewareMixin
class EuBuildMiddleware(MiddlewareMixin):
"""EU Ballot Firefox builds mangle inproduct URLs.
EU Ballot builds of Firefox add a /eu/ component to the incoming URL
from in-product help links. Unfortunately, they add it in the middle:
/1/<product... | 0 | 0 | 0 | 0 | 0 | 0 |
mmselfsup/models/algorithms/byol.py | mitming/mmselfsup | 355 | 3312690 | # Copyright (c) OpenMMLab. All rights reserved.
from __future__ import annotations
import torch
import torch.nn as nn
from ..builder import ALGORITHMS, build_backbone, build_head, build_neck
from .base import BaseModel
@ALGORITHMS.register_module()
class BYOL(BaseModel):
"""BYOL.
Implementation of `Bootstra... | 4 | 2 | 0 | 0 | 6 | 0 |
responsibleai/responsibleai/_tools/shared/__init__.py | ezherdeva/responsible-ai-toolbox | 295 | 3312710 | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
"""ResponsibleAI package module."""
| 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/selenium/webdriver/common/timeouts.py | gilbertekalea/booking.com_crawler | 25,151 | 3312737 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 7 | 9 | 4 | 0 | 20 | 0 |
analysis/plot/mplot.py | leozz37/makani | 1,178 | 3312741 | # Copyright 2020 Makani Technologies LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 4 | 3 | 0 | 3 | 10 | 0 |
src/connectedvmware/azext_connectedvmware/commands.py | haroonf/azure-cli-extensions | 207 | 3312753 | # --------------------------------------------------------------------------------------------
# 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_construction.py | krishan711/python-hl7 | 171 | 3312766 | # -*- coding: utf-8 -*-
from unittest import TestCase
import hl7
from .samples import rep_sample_hl7
SEP = r"|^~\&"
CR_SEP = "\r"
class ConstructionTest(TestCase):
def test_create_msg(self):
# Create a message
MSH = hl7.Segment(SEP[0], [hl7.Field(SEP[2], ["MSH"])])
MSA = hl7.Segment(SEP... | 0 | 0 | 0 | 0 | 0 | 0 |
modules/thirdparty/video/Video_editing/SkyAR/rain.py | chunzhang-hub/PaddleHub | 8,360 | 3312790 | <filename>modules/thirdparty/video/Video_editing/SkyAR/rain.py<gh_stars>1000+
import cv2
import numpy as np
__all__ = ['Rain']
class Rain():
def __init__(self, rain_cap_path, rain_intensity=1.0, haze_intensity=4.0, gamma=2.0, light_correction=0.9):
self.rain_intensity = rain_intensity
self.haze_i... | 0 | 0 | 0 | 0 | 0 | 0 |
mcpipy/grenade.py | wangtt03/raspberryjammod | 338 | 3312863 | #
# Code by <NAME> and under the MIT license
#
#
# python grenade.py [speed [gravity]]
#
# Throws a grenade with the specified speed in m/s (default: 15) and specified
# gravitational acceleration (default: earth) in m/s^2 or given by listing a planet,
# sun, moon or pluto.
#
from mine import *
from vehi... | 0 | 2 | 0 | 0 | 2 | 0 |
cpmpy/max_flow_taha.py | tias/hakank | 279 | 3312900 | """
Max flow problem in cpmpy.
From Taha 'Introduction to Operations Research', Example 6.4-2
Translated from the AMPL code at
http://taha.ineg.uark.edu/maxflo.txt
This cpmpy model was written by <NAME> (<EMAIL>)
See also my cpmpy page: http://hakank.org/cpmpy/
"""
from cpmpy import *
import cpmpy.solvers
import ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_validators.py | jekel/sanic-jwt | 226 | 3312905 | from sanic_jwt.validators import validate_single_scope
def test_validate_single_scope():
assert validate_single_scope("user", ["something"]) is False
assert validate_single_scope("user", ["user"])
assert validate_single_scope("user:read", ["user"])
assert validate_single_scope("user:read", ["user:read... | 0 | 0 | 0 | 0 | 0 | 0 |
crowd_anki/importer/import_dialog.py | ll-in-anki/CrowdAnki | 391 | 3312943 | <reponame>ll-in-anki/CrowdAnki<gh_stars>100-1000
from collections import defaultdict
from dataclasses import dataclass, field
from enum import Enum
from typing import List
from aqt.qt import QDialog, QListWidgetItem, Qt, QFont, QSize
from .import_ui import Ui_Dialog as ConfigUI
from ..config.config_settings import Co... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_barh.py | genkioffice/prettyplotlib | 960 | 3312959 | __author__ = 'jan'
from matplotlib.testing.decorators import image_comparison
import prettyplotlib as ppl
import numpy as np
import os
import string
import six
if six.PY3:
UPPERCASE_CHARS = string.ascii_uppercase
else:
UPPERCASE_CHARS = string.uppercase
@image_comparison(baseline_images=['barh'], extensions... | 0 | 0 | 0 | 0 | 0 | 0 |
ddm/run_permuted.py | ambodi/variational-continual-learning | 159 | 3312964 | <filename>ddm/run_permuted.py
import numpy as np
import tensorflow as tf
import gzip
import cPickle
import sys
sys.path.extend(['alg/'])
import vcl
import coreset
import utils
from copy import deepcopy
class PermutedMnistGenerator():
def __init__(self, max_iter=10):
f = gzip.open('data/mnist.p... | 0 | 0 | 0 | 0 | 0 | 0 |
nativedroid/nativedroid/protobuf/taint_result_pb2.py | CherishAZ/Argus-SAF | 152 | 3312998 | <reponame>CherishAZ/Argus-SAF
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nativedroid/protobuf/taint_result.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _... | 0 | 0 | 0 | 0 | 0 | 0 |
torrent_client/algorithms/downloader.py | vvaadim/bit-torrent | 141 | 3313003 | <reponame>vvaadim/bit-torrent
import asyncio
import hashlib
import logging
import random
import time
from collections import deque, OrderedDict
from math import ceil
from typing import List, Optional, Tuple, Iterator
from torrent_client.algorithms.announcer import Announcer
from torrent_client.algorithms.peer_manager ... | 0 | 0 | 0 | 0 | 0 | 0 |
planet/generator/planet/vendor/portalocker.py | TUM-LIS/librecores-web | 119 | 3313017 | # portalocker.py - Cross-platform (posix/nt) API for flock-style file locking.
# Requires python 1.5.2 or better.
# See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/65203/index_txt
# Except where otherwise noted, recipes in the Python Cookbook are
# published under the Python license.
"""C... | 0 | 0 | 0 | 0 | 0 | 0 |
addons/cats-blender-plugin-0-19-0/ui/__init__.py | trisadmeslek/V-Sekai-Blender-tools | 725 | 3313019 | <reponame>trisadmeslek/V-Sekai-Blender-tools
if "bpy" not in locals():
# print('STARTUP UI!!')
import bpy
from . import main
from . import armature
from . import manual
from . import custom
from . import decimation
from . import eye_tracking
from . import visemes
from . import bo... | 0 | 0 | 0 | 0 | 0 | 0 |
bin/opencv.py | gxlct008/EvaThumber | 338 | 3313045 | <reponame>gxlct008/EvaThumber
#!/usr/bin/python
"""
This program is demonstration for face and object detection using haar-like features.
The program finds faces in a camera image or video stream and displays a red box around them.
Original C implementation by: ?
Python implementation by: <NAME>, <NAME>
"""
import sy... | 0 | 0 | 0 | 0 | 0 | 0 |
src/clusterfuzz/_internal/tests/core/base/json_utils_test.py | mspectorgoogle/clusterfuzz | 5,023 | 3313070 | <reponame>mspectorgoogle/clusterfuzz<gh_stars>1000+
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 0 | 0 | 0 | 0 | 0 | 0 |
pyahp/__init__.py | sysid/pyAHP | 102 | 3313084 | # -*- coding: utf-8 -*-
"""pyahp
This module contains the imports for functions, classes and constants exported.
"""
from .parser import parse, validate_model
| 0 | 0 | 0 | 0 | 0 | 0 |
misc/remove_optimizers_params_in_ckpt.py | giuliolovisotto/YOLOv3_TensorFlow | 1,703 | 3313106 | <reponame>giuliolovisotto/YOLOv3_TensorFlow
# coding: utf-8
# This script is used to remove the optimizer parameters in the saved checkpoint files.
# These parameters are useless in the forward process.
# Removing them will shrink the checkpoint size a lot.
import sys
sys.path.append('..')
import os
import tensorfl... | 0 | 0 | 0 | 0 | 0 | 0 |
uchan/view/index.py | alanbato/tchan | 120 | 3313122 | <filename>uchan/view/index.py
from flask import render_template, abort
from uchan import app
from uchan.lib.service import page_service
@app.route('/')
def index():
page = page_service.find_front_page()
if not page:
abort(404)
return render_template('index.html', page=page)
| 0 | 0 | 0 | 0 | 0 | 0 |
cpmpy/allergy.py | hakank/hakank | 279 | 3313145 | <reponame>hakank/hakank<filename>cpmpy/allergy.py
"""
Allergy problem in cpmpy
This is a port of the xcsp model Allergy.py
'''
Four friends (two women named Debra and Janet, and two men named Hugh and Rick) found
that each of them is allergic to something different:
eggs, mold, nuts and ragweed.
We would like to match... | 0 | 0 | 0 | 0 | 0 | 0 |
diagrams/gcp/storage.py | abdulkaderjeelani/diagrams | 17,037 | 3313180 | <reponame>abdulkaderjeelani/diagrams
# This module is automatically generated by autogen.sh. DO NOT EDIT.
from . import _GCP
class _Storage(_GCP):
_type = "storage"
_icon_dir = "resources/gcp/storage"
class Filestore(_Storage):
_icon = "filestore.png"
class PersistentDisk(_Storage):
_icon = "pers... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/builder/shared/basic_test_template.py | Wlgen/force-riscv | 111 | 3313196 | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PR... | 0 | 0 | 0 | 0 | 0 | 0 |
malaya_speech/train/model/transducer/__init__.py | ishine/malaya-speech | 111 | 3313210 | <reponame>ishine/malaya-speech<gh_stars>100-1000
from . import loss
from . import rnn
from . import rnn_multilanguage
from . import streaming
| 0 | 0 | 0 | 0 | 0 | 0 |
libsaas/services/mixrank/advertisers.py | MidtownFellowship/libsaas | 155 | 3313212 | from __future__ import annotations
from libsaas import http, parsers
from libsaas.services import base
from . import ads
class Advertiser(base.HierarchicalResource):
path: str = 'advertisers'
@base.resource(ads.TextAd)
def textad(self, hash) -> object:
"""
Return a resource correspondin... | 42 | 7 | 1 | 0 | 50 | 0 |
shorttext/spell/binarize.py | vishalbelsare/PyShortTextCategorization | 481 | 3313226 |
import re
import string
from functools import reduce
import numpy as np
from shorttext.generators.charbase.char2vec import initSentenceToCharVecEncoder
from shorttext.utils.classification_exceptions import OperationNotDefinedException
default_alph = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.,:;'*!?`$%&(... | 6 | 10 | 0 | 0 | 16 | 0 |
python/oneflow/nn/modules/broadcast_like.py | grybd/oneflow | 3,285 | 3313229 | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 2 | 4 | 0 | 0 | 6 | 0 |
tests/BlazingSQLTest/Configuration/__init__.py | msadang/blazingsql | 1,059 | 3313270 | <reponame>msadang/blazingsql
class ExecutionMode():
GENERATOR = "generator"
GPUCI = "gpuci"
FULL = "full"
| 0 | 0 | 0 | 0 | 0 | 0 |
vergeml/libraries.py | vergeml/VergeML | 324 | 3313282 | from __future__ import annotations
import importlib
import os
import sys
import ctypes
import io
from vergeml.utils import VergeMLError
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
class Library:
@staticmethod
def is_installed():
raise NotImplementedError
@staticmethod
def version():
raise... | 6 | 18 | 0 | 3 | 27 | 0 |
genrl/environments/vec_env/wrappers.py | mehulrastogi/genrl | 390 | 3313315 | from abc import abstractmethod
from genrl.environments.vec_env.vector_envs import VecEnv
class VecEnvWrapper(VecEnv):
def __init__(self, venv):
self.venv = venv
super(VecEnvWrapper, self).__init__(envs=venv.envs, n_envs=venv.n_envs)
def __getattr__(self, name) -> object:
return getat... | 1 | 2 | 0 | 0 | 3 | 0 |
scenic/projects/layout_denoise/base_model.py | techthiyanes/scenic | 688 | 3313320 | <reponame>techthiyanes/scenic<filename>scenic/projects/layout_denoise/base_model.py
"""Base class for layout denoise model."""
from typing import Any, Dict, Optional, Tuple
from absl import logging
import jax
import jax.numpy as jnp
import ml_collections
from scenic.model_lib.base_models import base_model
from scenic... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/run/cpdef_extern_func_in_py.py | smok-serwis/cython | 6,663 | 3313342 |
"""
>>> pxd_sqrt(9)
3.0
"""
import cython
if not cython.compiled:
from math import sqrt as pxd_sqrt
@cython.test_assert_path_exists('//SimpleCallNode/NameNode[@type.is_pyobject = False]')
def call_pxd_sqrt(x) -> object:
"""
>>> call_pxd_sqrt(9)
3.0
"""
return pxd_sqrt(x)
| 0 | 1 | 0 | 0 | 1 | 0 |
airbyte-integrations/connectors/source-google-workspace-admin-reports/source_google_workspace_admin_reports/__init__.py | rajatariya21/airbyte | 6,215 | 3313354 | <gh_stars>1000+
from .source import SourceGoogleWorkspaceAdminReports
__all__ = ["SourceGoogleWorkspaceAdminReports"]
| 0 | 0 | 0 | 0 | 0 | 0 |
torchsat_imc/datasets/__init__.py | Exdenta/torchsat | 316 | 3313393 | from .eurosat import EuroSAT
from .sat import SAT
from .nwpu_resisc45 import NWPU_RESISC45
from .patternnet import PatternNet
| 0 | 0 | 0 | 0 | 0 | 0 |
crash-course-on-python/week-four/course-one-week-four.py | veera-raju/google-it-automation-with-python | 164 | 3313395 | <reponame>veera-raju/google-it-automation-with-python
# Strings
# What is a string?
"""
Modify the double_word function so that it returns the same word repeated twice, followed by the length of the new doubled word. For example, double_word("hello") should return hellohello10.
"""
def double_word(word):
word *= 2
... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/autotest/models/datashow.py | rainydaygit/testtcloudserver | 349 | 3313396 | <filename>apps/autotest/models/datashow.py
from library.api.db import EntityModel, db
# 数据显示属性
class DataShowFields(EntityModel):
ACTIVE = 0
DISABLE = 1
DATA_MAP = {
1: "数据来源",
2: "手机类型",
3: "apk 版本",
4: "内核版本",
5: "系统版本",
6: "词库版本",
7: "语料库版本",
... | 0 | 0 | 0 | 0 | 0 | 0 |
office365/sharepoint/publishing/portal_health_status.py | rikeshtailor/Office365-REST-Python-Client | 544 | 3313405 | from office365.runtime.client_value import ClientValue
class PortalHealthStatus(ClientValue):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
genomepy/providers/url.py | simonvh/genomepy | 112 | 3313434 | <reponame>simonvh/genomepy<filename>genomepy/providers/url.py
import re
from typing import List
from loguru import logger
from genomepy.exceptions import GenomeDownloadError
from genomepy.files import get_file_info
from genomepy.online import read_url
from genomepy.providers.base import BaseProvider
from genomepy.uti... | 0 | 0 | 0 | 0 | 0 | 0 |
archive/extras/colorbot/data/aggregate_wiki.py | Pandinosaurus/tensorflow-workshop | 796 | 3313438 | <gh_stars>100-1000
import argparse
import csv
import re
# parser definition
parser = argparse.ArgumentParser(prog='Make csv file from wikipedia data')
parser.add_argument('--data_dir', type=str, default='wikipedia/',
help='Local dir to the txt files.')
parser.add_argument('--output_path', type=st... | 0 | 0 | 0 | 0 | 0 | 0 |
v3/listing9.py | MrWater98/pymag-trees | 149 | 3313458 | from __future__ import annotations
def contour(left,
right,
max_offset: object | None=None,
loffset: int=0,
roffset: int=0,
left_outer: object | None=None,
right_outer: object | None=None) -> object | tuple[object, object, object, object, object, ... | 5 | 1 | 0 | 0 | 6 | 0 |
test/gallery/battleship/__init__.py | jeanqasaur/jeeves | 253 | 3313504 | import macropy.activate
import testBattleship
| 0 | 0 | 0 | 0 | 0 | 0 |
droidlet/perception/robot/perception.py | ali-senguel/fairo | 669 | 3313505 | <reponame>ali-senguel/fairo<filename>droidlet/perception/robot/perception.py
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
from droidlet.parallel import BackgroundTask
from droidlet.perception.robot.handlers import (
ObjectDetection,
FaceRecognition,
HumanPose,
ObjectTracking,
ObjectDedup... | 0 | 0 | 0 | 0 | 0 | 0 |
official/vision/beta/projects/yolo/tasks/image_classification.py | NasTul/models | 82,518 | 3313506 | <gh_stars>1000+
# Copyright 2021 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 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.