max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
vlad_utils/cluster_feats.py | rohitgirdhar/ActionVLAD | 228 | 9596064 | <filename>vlad_utils/cluster_feats.py
# ------------------------------------------------------------------------------
# ActionVLAD: Learning spatio-temporal aggregation for action classification
# Copyright (c) 2017 Carnegie Mellon University and Adobe Systems Incorporated
# Please see LICENSE on https://github.com/ro... |
packages/core/minos-microservice-common/tests/test_common/test_protocol/test_avro/test_databases.py | sorasful/minos-python | 247 | 9596085 | import unittest
from minos.common import (
MinosAvroDatabaseProtocol,
MinosProtocolException,
)
class TestMinosAvroDatabaseProtocol(unittest.TestCase):
def test_encoder_decoder_database_values_string(self):
value = "String Test"
data_return_bytes = MinosAvroDatabaseProtocol.encode(value)
... |
tests/chainer_tests/functions_tests/noise_tests/test_gumbel_softmax.py | zaltoprofen/chainer | 3,705 | 9596096 | <filename>tests/chainer_tests/functions_tests/noise_tests/test_gumbel_softmax.py
import unittest
import numpy
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import functions
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product... |
mqbench/nn/intrinsic/qat/modules/__init__.py | PannenetsF/MQBench | 179 | 9596098 | <reponame>PannenetsF/MQBench<gh_stars>100-1000
from .linear_fused import LinearBn1d
from .deconv_fused import ConvTransposeBnReLU2d, ConvTransposeBn2d, ConvTransposeReLU2d
from .conv_fused import ConvBnReLU2d, ConvBn2d, ConvReLU2d
from .freezebn import ConvFreezebn2d, ConvFreezebnReLU2d, ConvTransposeFreezebn2d, ConvTr... |
corehq/apps/case_importer/migrations/0005_caseuploadfilemeta.py | dimagilg/commcare-hq | 471 | 9596109 | <filename>corehq/apps/case_importer/migrations/0005_caseuploadfilemeta.py
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('case_importer', '0004_caseuploadrecord_case_type'),
]
operations = [
migrations.CreateModel(
name='Case... |
mugen/video/io/subtitles.py | scherroman/mugen | 119 | 9596111 | from typing import List, NamedTuple, Optional as Opt, Any
import pysrt
import mugen.exceptions as ex
import mugen.location_utility as loc_util
import mugen.utility as util
from mugen.utility import temp_file_enabled
SUBTITLES_EXTENSION = '.srt'
""" SUBTITLES """
class Subtitle(NamedTuple):
"""
start_time... |
freqency.py | fenc1022/AccDNN | 231 | 9596137 | <reponame>fenc1022/AccDNN
import argparse
# FPGA clock freqency for AccDNN support 1000Mhz/N (N >= 5)
# Following table find an acceptable freqency for AccDNN
freqency_table = [ (250, 10, 250, 2, 2),
(200, 10, 200, 3, 2),
(166.7, 10, 166.7, 3, 3),
(142.8, ... |
source/bazel/tensorflow.bzl | Moti-H/neuropod | 887 | 9596148 | <reponame>Moti-H/neuropod<filename>source/bazel/tensorflow.bzl
load("//bazel:version.bzl", "NEUROPOD_VERSION")
# https://docs.bazel.build/versions/master/skylark/repository_rules.html
def _impl(repository_ctx):
# The `or` pattern below handles empty strings and unset env variables
# Using a default value only ... |
mmcv/cnn/utils/fuse_conv_bn.py | jinliwei1997/mmcv | 549 | 9596176 | import torch
import torch.nn as nn
def _fuse_conv_bn(conv, bn):
"""Fuse conv and bn into one module.
Args:
conv (nn.Module): Conv to be fused.
bn (nn.Module): BN to be fused.
Returns:
nn.Module: Fused module.
"""
conv_w = conv.weight
conv_b = conv.bias if conv.bias is... |
listings/web/express-middleware/node_modules/xml2json/node_modules/node-expat/binding.gyp | cjcj5438/nodeinpractice-master | 186 | 9596226 | {
'targets': [
{
'target_name': 'node_expat',
'sources': [ 'node-expat.cc' ],
'dependencies': [
'deps/libexpat/libexpat.gyp:expat'
]
}
]
}
|
ROLO_evaluation.py | isaiasfsilva/ROLO | 962 | 9596238 | # Copyright (c) <2016> <<NAME>>. 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 a... |
graphein/ppi/edges.py | jadechip/graphein | 342 | 9596248 | <reponame>jadechip/graphein<filename>graphein/ppi/edges.py
"""Functions for adding edges to a PPI Graph from parsed STRING & BIOGRID API call outputs"""
# %%
# Graphein
# Author: <NAME> <<EMAIL>>, <NAME>
# License: MIT
# Project Website: https://github.com/a-r-j/graphein
# Code Repository: https://github.com/a-r-j/grap... |
recirq/engine_utils.py | Wasral/ReCirq | 195 | 9596254 | <reponame>Wasral/ReCirq<filename>recirq/engine_utils.py
# Copyright 2020 Google
#
# 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 ... |
flink-ml-python/setup.py | queyuexzy/flink-ml | 142 | 9596260 | ################################################################################
# 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... |
python/paddle/fluid/tests/unittests/dygraph_to_static/test_ast_util.py | zmxdream/Paddle | 17,085 | 9596272 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
src/evaluate/action2motion/accuracy.py | Immocat/ACTOR | 164 | 9596282 | <reponame>Immocat/ACTOR
import torch
def calculate_accuracy(model, motion_loader, num_labels, classifier, device):
confusion = torch.zeros(num_labels, num_labels, dtype=torch.long)
with torch.no_grad():
for batch in motion_loader:
batch_prob = classifier(batch["output_xyz"], lengths=batch[... |
python/jupyter-widget/sanddance/nbextension/__init__.py | ricardoekm/SandDance | 5,731 | 9596289 | def _jupyter_nbextension_paths():
return [{
'section': 'notebook',
'src': 'nbextension/static',
'dest': 'sanddance',
'require': 'sanddance/extension'
}]
|
gitfs/mounter.py | whywaita/gitfs | 921 | 9596290 | <reponame>whywaita/gitfs<gh_stars>100-1000
# Copyright 2014-2016 Presslabs SRL
#
# 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... |
pygtkweb/demos/029-frame.py | takipsizad/pyjs | 739 | 9596303 | #!/usr/bin/env python
# example frame.py
import pygtk
pygtk.require('2.0')
import gtk
class FrameExample:
def __init__(self):
# Create a new window
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title("Frame Example")
# Here we connect the "destroy" event to a signal handler... |
extra_tests/snippets/derived_mc.py | mainsail-org/RustPython | 11,058 | 9596308 | class MC(type):
pass
class MC2(MC):
pass
class MC3(type):
pass
class A():
pass
assert type(A) == type
class B(metaclass=MC):
pass
assert type(B) == MC
class C(B):
pass
assert type(C) == MC
class D(metaclass=MC2):
pass
assert type(D) == MC2
class E(C, D, metaclass=MC):
pass
as... |
tests/tools/protocol/requests/test_base_request.py | akashvacher/kafka-tools | 578 | 9596321 | import unittest
from mock import patch
from kafka.tools.protocol.requests import _evaluate_plain_value, _evaluate_sequence, _encode_plain_value, _encode_sequence
from kafka.tools.protocol.types.bytebuffer import ByteBuffer
class BaseRequestTests(unittest.TestCase):
def test_evaluate_plain_value(self):
_... |
release.py | jupyterlab/jupyterlab-celltags | 128 | 9596349 | #!/usr/bin/env python
import argparse as argp
import json
import subprocess
def npmjs(dry=False):
"""release on npmjs
"""
# get single source of truth
with open('package.json') as f:
info = json.load(f)
version = info['version']
tag(version, dry=dry)
if dry:
# dry run b... |
tests/training/metrics/attachment_scores_test.py | MSLars/allennlp | 11,433 | 9596350 | <reponame>MSLars/allennlp
from typing import Any, Dict, List, Tuple, Union
import torch
from allennlp.common.testing import (
AllenNlpTestCase,
multi_device,
run_distributed_test,
global_distributed_metric,
)
from allennlp.training.metrics import AttachmentScores
class AttachmentScoresTest(AllenNlpTe... |
Chapter11/imitation_learning/nn_agent.py | arifmudi/Advanced-Deep-Learning-with-Python | 107 | 9596365 | <gh_stars>100-1000
#!/usr/bin/env python
from __future__ import print_function
import os
import gym
import numpy as np
import torch
from train \
import \
data_transform, \
available_actions, \
build_network, \
DATA_DIR, MODEL_FILE
def nn_agent_drive(model: torch.nn.Module, device: torch.device):... |
keras_textclassification/keras_layers/attention_self.py | luoyudong593/Keras-TextClassification | 1,339 | 9596369 | # -*- coding: UTF-8 -*-
# !/usr/bin/python
# @time :2019/6/22 19:35
# @author :Mo
# @function :Attention of itself
from keras.regularizers import L1L2, Regularizer
# from keras.engine.topology import Layer
from keras.layers import Layer
from keras import backend as K
class AttentionSelf(Layer):
... |
udemy/bot/__init__.py | imvijayps/UdemyBot | 119 | 9596371 | <reponame>imvijayps/UdemyBot
# UdemyBot - A Simple Udemy Free Courses Scrapper
# Copyright (C) 2021-Present <NAME> <https://github.com/gautamajay52>
from udemy.bot.bot import UdemyBOT |
feedhq/feeds/management/commands/updatefeeds.py | feedhq/feedhq | 361 | 9596380 | <filename>feedhq/feeds/management/commands/updatefeeds.py<gh_stars>100-1000
import structlog
from rache import pending_jobs
from rq import Queue
from . import SentryCommand
from ...models import UniqueFeed
from ...tasks import update_feed
from ....tasks import enqueue
from ....utils import get_redis_connection
logger... |
tools/android/loading/options_unittest.py | google-ar/chromium | 2,151 | 9596381 | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import argparse
import unittest
import options
class OptionsTestCase(unittest.TestCase):
def testExtract(self):
args = ['--A', 'foo', '--devtools_po... |
src/lobe/model/image_model.py | AeroboticsGlobalTeam/lobe-python | 130 | 9596386 | """
Load a Lobe saved model for image classification
"""
from PIL import Image
from .model import Model
from ..signature import ImageClassificationSignature
from .. import image_utils
from ..results import ClassificationResult
class ImageModel(Model):
signature: ImageClassificationSignature
@classmethod
... |
third_party/html5lib-python/html5lib/tests/test_whitespace_filter.py | tingshao/catapult | 2,151 | 9596389 | from __future__ import absolute_import, division, unicode_literals
import unittest
from html5lib.filters.whitespace import Filter
from html5lib.constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
try:
unittest.TestCase.assertEqual
except AttributeError:
unittest.TestCase.assertEqual =... |
up/utils/general/context.py | ModelTC/EOD | 196 | 9596397 | <filename>up/utils/general/context.py
import builtins
import contextlib
import copy
@contextlib.contextmanager
def no_print():
print_ = builtins.print
builtins.print = lambda *args: args
yield
builtins.print = print_
@contextlib.contextmanager
def config(cfg, phase, allow_empty=True):
if phase n... |
course/migrations/0061_add_course_id_validation.py | inducer/courseflow | 284 | 9596420 | from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('course', '0060_add_verbose_name_and_labels_for_i18n'),
]
operations = [
migrations.AlterField(
model_name='course',
name='identifier',
... |
exchange_calendars/exchange_calendar_xhkg.py | rajeshyogeshwar/exchange_calendars | 128 | 9596424 | # -*- coding: utf-8 -*-
#
# Copyright 2018 Quantopian, 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 applicabl... |
src/genie/libs/parser/nxos/tests/ShowInstallActive/cli/equal/golden_output_expected.py | balmasea/genieparser | 204 | 9596442 |
expected_output = {'boot_images':
{'kickstart_image': 'slot0:/n7000-s2-kickstart.8.3.0.CV.0.658.gbin',
'system_image': 'slot0:/n7000-s2-dk10.34.3.0.CV.0.658.gbin'},
'active_packages':
{'active_package_module_0':
... |
lib/google/geocode/geocode.py | goztrk/django-htk | 206 | 9596490 | <reponame>goztrk/django-htk
"""
geocode.py
author: <NAME> <<EMAIL>>
Python interface to Google Geocode API
Usage:
python geocode.py [-g] ADDRESS
python geocode.py -r LATITUDE LONGITUDE
Examples:
$ python geocode.py "701 First Ave, Sunnyvale, CA 94089"
37.4168811,-122.0256155
$ python geocode.py -... |
common/migrations/0011_auto_20190218_1230.py | sauravpanda/Django-CRM | 1,334 | 9596494 | <gh_stars>1000+
# Generated by Django 2.1.7 on 2019-02-18 07:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("common", "0010_apisettings"),
]
operations = [
migrations.AlterField(
model_name="apisettings",
name... |
examples/ner/main_train.py | jzpang/forte | 163 | 9596507 | # Copyright 2019 The Forte 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 ... |
Kernel_Exploitation/HEVD/HEVD-ArbitraryWrite-Win7x86.py | dhn/OSEE | 152 | 9596513 | <gh_stars>100-1000
import os
from helper import *
from ctypes import *
def ioctl(function, devicetype = 0x00000022, access = 0x00000000, method = 0x00000003):
return ((devicetype << 16) | (access << 14) | (function << 2) | method)
def main():
HEVD_IOCTL_ARBITRARY_WRITE = ioctl(0x802)
lpFileName = "\\\\.\\HackSysEx... |
tests/test_preprocessing/test_columnselector.py | kaipoethkow/scikit-lego | 784 | 9596530 | import pandas as pd
from pandas.testing import assert_frame_equal
from sklearn.pipeline import make_pipeline
import pytest
from sklego.preprocessing import ColumnSelector
@pytest.fixture()
def df():
return pd.DataFrame(
{
"a": [1, 2, 3, 4, 5, 6],
"b": [10, 9, 8, 7, 6, 5],
... |
installer/macosx/CoderSetup.py | itplants/coder | 881 | 9596539 | <filename>installer/macosx/CoderSetup.py
# Coder for Raspberry Pi
# A simple platform for experimenting with web stuff.
# http://goo.gl/coder
#
# Copyright 2013 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... |
python/GafferSceneUI/EditScopeUI.py | ddesmond/gaffer | 561 | 9596575 | ##########################################################################
#
# Copyright (c) 2019, Cinesite VFX Ltd. 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 ... |
tests/components/input_datetime/__init__.py | domwillcode/home-assistant | 30,023 | 9596579 | <gh_stars>1000+
"""Tests for the input_datetime component."""
|
office365/sharepoint/changes/change_folder.py | wreiner/Office365-REST-Python-Client | 544 | 9596583 | <filename>office365/sharepoint/changes/change_folder.py
from office365.sharepoint.changes.change import Change
class ChangeFolder(Change):
"""Specifies a change on a folder not contained in a list or document library."""
@property
def unique_id(self):
return self.properties.get("UniqueId", None)
... |
15_pytorch_peleenet/lib/test.py | rohit0906/Monk_Object_Detection | 549 | 9596593 | #-*- coding:utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import os
import warnings
warnings.filterwarnings('ignore')
import torch
import pickle
import argparse
from utils.timer import Timer
import torch.backends.cudnn as cudnn
fro... |
tests/PySys/plugin_apt/apt_update_list/run.py | itsyitsy/thin-edge.io | 102 | 9596639 | from environment_apt_plugin import AptPlugin
import sys
import os
import subprocess
import time
sys.path.append("apt_plugin")
"""
Validate apt plugin update-list command use case
When we install/remove multiple packages at once with update-list command
Then these packages are installed/removed together
"""
class A... |
setup.py | espdev/csaps | 111 | 9596654 | # -*- coding: utf-8 -*-
import pathlib
from setuptools import setup
ROOT_DIR = pathlib.Path(__file__).parent
def _get_version():
about = {}
ver_mod = ROOT_DIR / 'csaps' / '_version.py'
exec(ver_mod.read_text(), about)
return about['__version__']
def _get_long_description():
readme = ROOT_DIR ... |
src/genie/libs/parser/iosxe/tests/ShowIpv6Interface/cli/equal/golden_output1_expected.py | balmasea/genieparser | 204 | 9596672 | <gh_stars>100-1000
expected_output = {
"GigabitEthernet2": {
"enabled": True,
"oper_status": "up",
"ipv6": {
"FE80::F816:3EFF:FE19:ABBA": {
"ip": "FE80::F816:3EFF:FE19:ABBA",
"origin": "link_layer",
"status": "valid",
},... |
timesketch/lib/analyzers/tagger.py | rushattac/timesketch | 1,810 | 9596673 | """Analyzer plugin for tagging."""
import logging
from timesketch.lib import emojis
from timesketch.lib.analyzers import interface
from timesketch.lib.analyzers import manager
from timesketch.lib.analyzers import utils
logger = logging.getLogger('timesketch.analyzers.tagger')
class TaggerSketchPlugin(interface.Bas... |
pyatv/core/facade.py | Jacobs4/pyatv | 532 | 9596674 | """Facade pattern for public interface of pyatv.
This module implements a facade-like pattern by implementing the external interface
of pyatv and relaying calls to methods to the appropriate protocol instance, based on
priority via the relayer module. The purpose is to support partial implementations of
the interface ... |
src/unittest/python/test_utils.py | Mattlk13/pybuilder | 1,419 | 9596718 | <reponame>Mattlk13/pybuilder
# -*- coding: utf-8 -*-
#
# This file is part of PyBuilder
#
# Copyright 2011-2020 PyBuilder Team
#
# 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
#
# ... |
topaz/objects/codeobject.py | ruby-compiler-survey/topaz | 241 | 9596739 | <gh_stars>100-1000
import copy
from topaz.module import ClassDef
from topaz.objects.objectobject import W_BaseObject
class W_CodeObject(W_BaseObject):
_immutable_fields_ = [
"code", "consts_w[*]", "max_stackdepth", "cellvars[*]", "freevars[*]",
"arg_pos[*]", "defaults[*]", "block_arg_pos", "splat... |
plenum/test/client/helper.py | IDunion/indy-plenum | 148 | 9596746 | import base64
import zmq
def create_zmq_connection(node, sock_type):
clientstack = node.clientstack
sock = zmq.Context().socket(sock_type)
l_pub_key, l_sec_key = zmq.curve_keypair()
sock.setsockopt(zmq.IDENTITY, base64.encodebytes(l_pub_key))
sock.setsockopt(zmq.CURVE_PUBLICKEY, l_pub_key)
so... |
Crickit_Sparky_Automaton/code.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 9596761 | <reponame>gamblor21/Adafruit_Learning_System_Guides<filename>Crickit_Sparky_Automaton/code.py
import os
import time
import random
import board
import audioio
import audiocore
from adafruit_crickit import crickit
# Sparky automaton
# Find all Wave files on the storage
wavefiles = [file for file in os.listdir("/")
... |
features/category_vector.py | flowlight0/talkingdata-adtracking-fraud-detection | 214 | 9596762 | <gh_stars>100-1000
import gc
import itertools
from abc import abstractmethod
from functools import partial
from multiprocessing.pool import Pool
from typing import List, Tuple
import numpy as np
import pandas as pd
from sklearn.base import TransformerMixin
from sklearn.decomposition import LatentDirichletAllocation, T... |
generic_tests/test_fail.py | UAEKondaya1/expressvpn_leak_testing | 219 | 9596766 | <gh_stars>100-1000
from xv_leak_tools.test_framework.test_case import TestCase
from xv_leak_tools.log import L
class TestFail(TestCase):
"""Dummy test case for testing library functionality. This test does nothing other than
deliberately fail."""
def test(self):
L.info("This test does nothing but ... |
examples/old-examples/GLUT/01_hello_world.py | 2dx/moderngl | 916 | 9596776 | <filename>examples/old-examples/GLUT/01_hello_world.py
"""
NOTE: This example is from ModernGL 4 or earlier. We simply disable and archive them for now.
"""
# import struct
# import sys
# import ModernGL
# from OpenGL.GLUT import (
# GLUT_DEPTH, GLUT_DOUBLE, GLUT_RGB, glutCreateWindow, glutDisplayFunc, glutInit, ... |
src/Python/Meshes/SolidClip.py | jhlegarreta/VTKExamples | 309 | 9596778 | <gh_stars>100-1000
# !/usr/bin/env python
# -*- coding: utf-8 -*-
import vtk
def main():
# Create a superquadric
superquadric_source = vtk.vtkSuperquadricSource()
superquadric_source.SetPhiRoundness(3.1)
superquadric_source.SetThetaRoundness(2.2)
# Define a clipping plane
clip_plane = vtk.vt... |
tests/open_test.py | sethvargo/vaex | 337 | 9596834 | <gh_stars>100-1000
from concurrent.futures import ThreadPoolExecutor
import glob
import tempfile
import os
import pytest
import sys
import vaex
path = os.path.dirname(__file__)
if sys.platform.startswith("win"):
pytest.skip("skipping windows, since it has issues re-opening files", allow_module_level=True)
csv2 ... |
tests/test_example_expand.py | kevindurston21/PyInquirer | 1,587 | 9596881 | # -*- coding: utf-8 -*-
import textwrap
from .helpers import keys
from .helpers import create_example_fixture
example_app = create_example_fixture('examples/expand.py')
def test_without_expand(example_app):
example_app.expect(textwrap.dedent("""\
? Conflict on `file.js`: (yAdxh)
>> Overwrite ... |
tests/fields/test_enum.py | blazing-gig/tortoise-orm | 2,847 | 9596971 | from enum import IntEnum
from tests import testmodels
from tortoise.contrib import test
from tortoise.exceptions import ConfigurationError, IntegrityError
from tortoise.fields import CharEnumField, IntEnumField
class BadIntEnum1(IntEnum):
python_programming = 32768
database_design = 2
system_administrati... |
download.py | joe733/CS231n-2017-Summary | 1,509 | 9597006 | <filename>download.py
################################################
# File name: download.py #
# Author: <NAME> #
# Date created: 2/11/2018 #
# Date last modified: 2/11/2018 #
# Python Version: 3 #
# Purpose: ... |
veriloggen/thread/util.py | akmaru/veriloggen | 232 | 9597060 | from __future__ import absolute_import
from __future__ import print_function
from . import stream
__intrinsics__ = ('copy', 'copy_pattern')
copy_stream_cache = {}
copy_pattern_stream_cache = {}
def copy(fsm, src_ram, dst_ram, src_addr, dst_addr, size,
src_stride=1, dst_stride=1,
src_port=0, dst_p... |
mongodb/mongodb_consistent_backup/official/mongodb_consistent_backup/Common/MongoUri.py | smthkissinger/docker-images | 282 | 9597072 | import re
from Util import validate_hostname
from mongodb_consistent_backup.Errors import OperationError
class MongoAddr:
def __init__(self, host=None, port=None, replset=None):
self.host = host
self.port = port
self.replset = replset
def str(self):
if self.host and sel... |
homeschool/users/tests/test_models.py | chriswedgwood/homeschool | 154 | 9597075 | from unittest import mock
from homeschool.accounts.models import Account
from homeschool.schools.models import School
from homeschool.schools.tests.factories import SchoolFactory
from homeschool.test import TestCase
from homeschool.users.models import notify_signup
class TestUser(TestCase):
def test_school(self)... |
owmeta/biology.py | marcodafonseca/PyOpenWorm | 118 | 9597093 | from owmeta_core.dataobject import DataObject
import rdflib as R
from . import BASE_BIO_DATA_URL, BASE_BIO_SCHEMA_URL
class BiologyType(DataObject):
class_context = BASE_BIO_SCHEMA_URL
base_namespace = R.Namespace(BASE_BIO_SCHEMA_URL + '/')
base_data_namespace = R.Namespace(BASE_BIO_DATA_URL + '/')
|
Round D/Record Breaker/Pedro_Python/Record Breaker.py | imsushant12/GoogleKickStart2020_Solutions | 130 | 9597110 | T = int(input())
for i in range(T):
N = int(input())
Vs = [int(v) for v in input().split(" ")]
max_number = -1
record_breaks = 0
for j in range(N):
first_condition = Vs[j] > max_number
if j+1 < N:
second_condition = Vs[j] > Vs[j+1]
else:
second_conditi... |
dash-table-filter.py | oriolmirosa/dash-recipes | 932 | 9597115 | <gh_stars>100-1000
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
df = pd.read_csv(
'https://gist.githubusercontent.com/chriddyp/'
'c78bf172206ce24f77d6363a2d754b59/raw/'
'c353e8ef842413cae56ae3920b8fd78468aa4cb2/'
'usa-agricultural-exports-2011.... |
handlers/PrivilegedRolesScanHandler.py | houey/SkyWrapper | 106 | 9597122 | from utilities.Boto3Utilities import client_session_creator
from handlers.RolePermissionsHandler import RolePermissionsHandler
from parsers.PoliciesPermissionsParser import PoliciesPermissionsParser
from handlers.RolePermissionsHandler import ATTACHED_POLICIES, INLINE_POLICIES
class PrivilegedRolesScanHandler(object)... |
socceraction/data/opta/parsers/base.py | pientist/socceraction | 371 | 9597133 | <reponame>pientist/socceraction<filename>socceraction/data/opta/parsers/base.py
# -*- coding: utf-8 -*-
"""Base class for all Opta(-derived) event stream parsers.
A parser reads a single data file and should extend the 'OptaParser' class to
extract data about competitions, games, players, teams and events that is
enco... |
src/compas/datastructures/network/core/operations/join.py | XingxinHE/compas | 235 | 9597140 | <filename>src/compas/datastructures/network/core/operations/join.py
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.utilities import pairwise
from compas.utilities import geometric_key
__all__ = [
'network_join_edges',
'network_polylines... |
butterfree/load/writers/historical_feature_store_writer.py | jdvala/butterfree | 208 | 9597141 | """Holds the Historical Feature Store writer class."""
import os
from typing import Any
from pyspark.sql.dataframe import DataFrame
from pyspark.sql.functions import dayofmonth, month, year
from butterfree.clients import SparkClient
from butterfree.configs import environment
from butterfree.configs.db import Abstrac... |
service/common/generate_protos_test.py | abattery/falken | 213 | 9597156 | <reponame>abattery/falken<gh_stars>100-1000
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
smt/examples/rans_crm_wing/tests/test_rans_crm_wing.py | jbussemaker/smt | 354 | 9597160 | import unittest
import matplotlib
matplotlib.use("Agg")
try:
from smt.surrogate_models import RMTB, RMTC
compiled_available = True
except:
compiled_available = False
class Test(unittest.TestCase):
@unittest.skipIf(not compiled_available, "C compilation failed")
def test_rmtb(self):
fro... |
care/facility/api/viewsets/notification.py | gigincg/care | 189 | 9597165 | from django.conf import settings
from django_filters import rest_framework as filters
from drf_yasg.utils import swagger_auto_schema
from rest_framework import status
from rest_framework.decorators import action
from rest_framework.exceptions import ValidationError
from rest_framework.generics import get_object_or_404
... |
tests/unit/tensorflow/applications/test_linear_regression.py | chiragnagpal/probflow | 134 | 9597175 | import numpy as np
from probflow.applications import LinearRegression
def test_LinearRegression():
"""Tests probflow.applications.LinearRegression"""
# Data
x = np.random.randn(100, 5).astype("float32")
w = np.random.randn(5, 1).astype("float32")
y = x @ w + 1
# Create the model
model =... |
lldb/packages/Python/lldbsuite/test/python_api/sbstructureddata/TestStructuredDataAPI.py | dan-zheng/llvm-project | 765 | 9597180 | <reponame>dan-zheng/llvm-project
"""
Test some SBStructuredData API.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestStructuredDataAPI(TestBase):
mydir = TestBase.compute_mydir(__f... |
lightbulb/modules/models_op.py | mehrdad-shokri/lightbulb-framework | 497 | 9597196 | from symautomata.dfa import DFA
from symautomata.flex2fst import Flexparser
from symautomata.alphabet import createalphabet
from lightbulb.core.utils.common import save_model, findlibrary
import json
META = {
'author': '<NAME>, <NAME>',
'description': 'Perform automata operations on learned models or flex file... |
examples/process_error.py | quarckster/pypeln | 1,281 | 9597207 | import pypeln as pl
from tqdm import tqdm
import time
total = 300_000
def f(x):
i = 0
for _ in range(500_000):
i += 1
return x * 2
stage = range(total)
stage = pl.process.map(f, stage, workers=8, maxsize=2000)
stage = tqdm(stage, total=total, desc="pipeline")
pl.process.run(stage)
|
Src/IronPython/Lib/iptest/ipunittest.py | cwensley/ironpython2 | 1,078 | 9597210 | <reponame>cwensley/ironpython2<gh_stars>1000+
import cStringIO
import os
import sys
import unittest
from .test_env import *
from .file_util import FileUtil
from .process_util import ProcessUtil
if is_cli:
import clr
class _AssertRaisesContext(object):
"""A context manager used to implement TestCase.assertRai... |
setup.py | elitonperin/algs4-py | 230 | 9597213 | <gh_stars>100-1000
"""A Python library for book algs4
See:
https://algs4.cs.princeton.edu/home/
https://github.com/shellfly/algs4-py
"""
from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f... |
boto3_type_annotations_with_docs/boto3_type_annotations/meteringmarketplace/client.py | cowboygneox/boto3_type_annotations | 119 | 9597216 | from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from datetime import datetime
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def batch_meter_usage(self, UsageRecords: L... |
tema5/function_aproximator/swallow.py | oscarramos2001/Oscar-Marino-Ramos | 112 | 9597240 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 6 10:47:19 2018
@author: juangabriel
"""
import torch
class SwallowActor(torch.nn.Module):
def __init__(self, input_shape, output_shape, device = torch.device("cpu")):
"""
Una red neorunal que producirá dos valores contin... |
src/python/grpcio_tests/tests/testing/_client_test.py | samotarnik/grpc | 2,151 | 9597246 | <filename>src/python/grpcio_tests/tests/testing/_client_test.py
# Copyright 2017 gRPC 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... |
boto/pyami/installers/ubuntu/mysql.py | Yurzs/boto | 5,079 | 9597250 | <reponame>Yurzs/boto
# Copyright (c) 2006-2009 <NAME> http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to u... |
config/custom_components/src/HomeAssistant/custom_components/magic_areas/light.py | SciFiFarms/AllThing-Home-Assistant | 183 | 9597256 | DEPENDENCIES = ["magic_areas"]
import logging
from homeassistant.components.group.light import LightGroup
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
from .const import (
CONF_AGGREGATES_MIN_ENTITIES,
CONF_FEATURE_LIGHT_GROUPS,
DATA_AREA_OBJECT,
MODULE_DATA,
)
_LOGGER = logging... |
endpoints/v2/manifest.py | ibazulic/quay | 2,027 | 9597264 | <reponame>ibazulic/quay<filename>endpoints/v2/manifest.py<gh_stars>1000+
import logging
from functools import wraps
from flask import request, url_for, Response
import features
from app import app, storage
from auth.registry_jwt_auth import process_registry_jwt_auth
from digest import digest_tools
from data.databas... |
pokedex/lookup.py | ymin1103/pokedex | 1,177 | 9597316 | # encoding: utf8
import os, os.path
import random
import re
import unicodedata
from six import text_type
import whoosh
import whoosh.index
import whoosh.query
import whoosh.sorting
from whoosh.support import levenshtein
from pokedex.compatibility import namedtuple
from pokedex.db import connect
import pokedex.db.tab... |
app/grandchallenge/challenges/migrations/0009_alter_challenge_use_evaluation.py | comic/grand-challenge.org | 101 | 9597321 | <filename>app/grandchallenge/challenges/migrations/0009_alter_challenge_use_evaluation.py
# Generated by Django 3.2.10 on 2021-12-10 12:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("challenges", "0008_challenge_contact_email"),
]
operation... |
mars/dataframe/arithmetic/__init__.py | hxri/mars | 2,413 | 9597338 | <reponame>hxri/mars
# 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/licenses/LICENSE-2.0
#
# Unless required by... |
python/version.py | tableau/rest-api-samples | 272 | 9597343 | <filename>python/version.py
VERSION = '3.13'
|
BitTornado/Client/RateMeasure.py | crossbrowsertesting/BitTornado | 116 | 9597369 | <filename>BitTornado/Client/RateMeasure.py
from BitTornado.clock import clock
FACTOR = 0.999
class RateMeasure:
def __init__(self):
self.last = None
self.time = 1.0
self.got = 0.0
self.remaining = None
self.broke = False
self.got_anything = False
self.last_... |
Calibration/HcalIsolatedTrackReco/python/HITmixedPairRegGenerator_cfi.py | ckamtsikis/cmssw | 852 | 9597418 | import FWCore.ParameterSet.Config as cms
HITmixedPairRegGenerator = cms.EDProducer("SeedGeneratorFromRegionHitsEDProducer",
OrderedHitsFactoryPSet = cms.PSet(
ComponentName = cms.string('StandardHitPairGenerator'),
SeedingLayers = cms.InputTag('MixedLayerPairs')
),
SeedComparitorPSet = cms.... |
guppy/etc/RE_Rect.py | odidev/guppy3 | 251 | 9597420 | """ Support functions for RE simplification.
This module is intended for use by the RE module.
It is in a separate module to keep RE itself cleaner
since the algorithm, 'rectangle selection', is a quite
separate part that depends on some tricky heuristics.
The primary entry function is
chooserects(lines, gauges)
It ... |
torchreid/data/datasets/image/grid.py | mansoor96g/deep-person-reid | 3,465 | 9597429 | from __future__ import division, print_function, absolute_import
import glob
import os.path as osp
from scipy.io import loadmat
from torchreid.utils import read_json, write_json
from ..dataset import ImageDataset
class GRID(ImageDataset):
"""GRID.
Reference:
Loy et al. Multi-camera activity correla... |
backends/edif/runtest.py | kallisti5/yosys | 1,718 | 9597507 | <reponame>kallisti5/yosys<gh_stars>1000+
#!/usr/bin/env python3
import os
import numpy as np
enable_upto = True
enable_offset = True
enable_hierarchy = True
enable_logic = True
def make_module(f, modname, width, subs):
print("module %s (A, B, C, X, Y, Z);" % modname, file=f)
inbits = list()
outbits = lis... |
src/triggers/tests/record_feedback_trigger/tests_record_feedback_trigger_tasks.py | iNerV/education-backend | 151 | 9597508 | <filename>src/triggers/tests/record_feedback_trigger/tests_record_feedback_trigger_tasks.py
import pytest
from triggers import tasks
from triggers.record_feedback import RecordFeedbackTrigger
pytestmark = [
pytest.mark.django_db,
pytest.mark.freeze_time('2032-12-01 15:30'),
]
@pytest.fixture
def condition(m... |
Python/416. PartitionEqualSubsetSum.py | nizD/LeetCode-Solutions | 263 | 9597518 | '''
LeetCode Link: https://leetcode.com/problems/copy-list-with-random-pointer/
Given a non-empty array nums containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets is equal.
Example:
Input: nums = [1,5,11,5]
... |
deploy/fabric/settings.py | Orad/webvirtmgr | 1,633 | 9597535 | <reponame>Orad/webvirtmgr<filename>deploy/fabric/settings.py
"""
Settings for deploying WebVirtMgr on a remote node
Used by fabfile.py
"""
DEBIAN_PKGS = [
"git", "python-pip", "python-libvirt", "python-libxml2", "novnc",
"supervisor", "nginx"
]
FEDORA_PKGS = [
"git", "python-pip", "libvirt-python", "libxm... |
custom_errors.py | clvoloshin/BanditLib | 280 | 9597582 | <reponame>clvoloshin/BanditLib
class FileExists(Exception):
def __init__(self, filename):
self.value = filename
def __str__(self):
string = """Comment Out! Exception: %s already exists, pass 'force=True' as argument to overwrite file or delete the file."""%(self.value)
return repr(string... |
recipes/Python/496787_Extract_elements_id_attributes/recipe-496787.py | tdiprima/code | 2,023 | 9597607 | <gh_stars>1000+
from HTMLParser import HTMLParser
class IdParser(HTMLParser):
''' Parses HTML and places any elements with an ID attribute in a
dictionary for later access... '''
stacks = dict()
elements = dict()
idd = dict()
def updatepos(self, i, j):
# overridden to keep track of ou... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.