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
terrascript/resource/fastly.py
mjuenema/python-terrascript
507
11053206
# terrascript/resource/fastly.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:16:17 UTC) # # For imports without namespace, e.g. # # >>> import terrascript.resource.fastly # # instead of # # >>> import terrascript.resource.fastly.fastly # # This is only available for 'official' and 'partner' provi...
chemdataextractor_batteries/tests/test_text.py
MB9991/test_demo-
199
11053276
# -*- coding: utf-8 -*- """ test_text ~~~~~~~~~ Test the text package. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import unittest from chemdataextractor.text.latex import latex_to_unicode fro...
tensorflow_fold/blocks/metrics_test.py
shkarupa-alex/fold
2,020
11053291
# Copyright 2017 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 a...
hc/accounts/migrations/0038_profile_theme.py
karthikprabhu/healthchecks
4,813
11053317
<filename>hc/accounts/migrations/0038_profile_theme.py # Generated by Django 3.2.4 on 2021-06-18 09:44 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0037_profile_tz'), ] operations = [ migrations.AddField( mode...
megaman/embedding/tests/test_lle.py
jakevdp/Mmani
303
11053319
# LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE import sys import numpy as np import scipy as sp import scipy.sparse as sparse from scipy.spatial.distance import squareform, pdist from itertools import product from numpy.testing import assert_array_almost_equal from sklearn import manifo...
desktop/core/ext-py/cx_Oracle-6.4.1/test/TestEnv.py
yetsun/hue
5,079
11053332
<filename>desktop/core/ext-py/cx_Oracle-6.4.1/test/TestEnv.py #------------------------------------------------------------------------------ # Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved. # # Portions Copyright 2007-2015, <NAME>. All rights reserved. # # Portions Copyright 2001-2007, Comput...
skyline/functions/aws/send_sms.py
datastreaming/skyline-1
396
11053348
<reponame>datastreaming/skyline-1 import logging import traceback import boto3 # @added 20210724 - Feature #4196: functions.aws.send_sms def send_sms(current_skyline_app, number, message): function_str = 'functions.aws.send_sms' current_skyline_app_logger = current_skyline_app + 'Log' current_logger = l...
azure-iot-device/azure/iot/device/provisioning/__init__.py
olivakar/azure-iot-sdk-python
366
11053349
"""Azure Provisioning Device Library This library provides functionality that enables zero-touch, just-in-time provisioning to the right IoT hub without requiring human intervention, enabling customers to provision millions of devices in a secure and scalable manner. """ from .provisioning_device_client import Provis...
tests/test_orca_parser.py
lizhifeng1998/schnetpack
450
11053403
import os import numpy as np from schnetpack.md.parsers.orca_parser import * from schnetpack import Properties from schnetpack.data import AtomsData from tests.fixtures import * def test_main_file_parser(orca_log_path, orca_main_targets): main_parser = OrcaMainFileParser(properties=OrcaMainFileParser.properties)...
venv/lib/python3.6/site-packages/tests/test_extra/__init__.py
Guillaume-Fernandez/phishfinder
130
11053409
<reponame>Guillaume-Fernandez/phishfinder """Test extra selectors not found in the CSS specifications."""
nodevectors/__init__.py
ashuk203/nodevectors
313
11053412
from nodevectors import embedders from nodevectors import evaluation from nodevectors.embedders import SKLearnEmbedder from nodevectors.node2vec import Node2Vec from nodevectors.ggvec import GGVec from nodevectors.grarep import GraRep from nodevectors.glove import Glove from nodevectors.prone import ProNE
scripts/preprocess_hop1.py
luxuantao/golden-retriever
195
11053422
<filename>scripts/preprocess_hop1.py import json, os, sys from tqdm import tqdm from argparse import ArgumentParser def parse_data(input_path, output_path): if os.path.exists(output_path): print(f"File already exists, skipping generation: {output_path}") return with open(input_path) as inf...
anime_downloader/extractors/__init__.py
Alsira/anime-downloader
1,077
11053426
from anime_downloader.extractors.init import get_extractor
designate/network_api/neutron.py
cleosson-daitan/designate
145
11053456
# Copyright 2012 OpenStack Foundation # 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 requi...
tests/components/hardware/test_websocket_api.py
liangleslie/core
30,023
11053524
"""Test the hardware websocket API.""" from homeassistant.components.hardware.const import DOMAIN from homeassistant.core import HomeAssistant from homeassistant.setup import async_setup_component async def test_board_info(hass: HomeAssistant, hass_ws_client) -> None: """Test we can get the board info.""" ass...
acfun.py
1py/youku-lixian
445
11053549
#!/usr/bin/env python __all__ = ['acfun_download'] import re from common import * #from iask import iask_download_by_id from youku import youku_download_by_id from tudou import tudou_download_by_iid from qq import qq_download_by_id import json def get_srt_json(id): url = 'http://comment.acfun.tv/%s.json' % id retu...
sl_metric.py
YuTingLiu/ssd_detectors
316
11053552
import numpy as np import pyclipper #from shapely import geometry from sl_utils import rbox_to_polygon, polygon_to_rbox from ssd_metric import fscore def evaluate_polygonal_results(ground_truth, detection_results, iou_thresh=0.5): """Evaluate polygonal text detection results and return TP, FP, FN. # Ar...
test/units/test_oci_load_balancer_certificate_facts.py
slmjy/oci-ansible-modules
106
11053563
<filename>test/units/test_oci_load_balancer_certificate_facts.py # Copyright (c) 2018, Oracle and/or its affiliates. # This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # A...
tron/manhole.py
Yelp/Tron
190
11053574
from twisted.conch.insults import insults from twisted.conch.manhole import ColoredManhole from twisted.conch.telnet import TelnetBootstrapProtocol from twisted.conch.telnet import TelnetTransport from twisted.internet import protocol def make_manhole(namespace): f = protocol.ServerFactory() f.protocol = lamb...
Face-Detection/Deep Dense Face Detection/face/download_data.py
swapnilgarg7/Face-X
175
11053579
<gh_stars>100-1000 """ This scripts downloads and preprocesses Celeb+ data used for training and testing """ import face.datasets.celeb import face.config def main(): face.datasets.celeb.DatasetBuilder(face.config.data_directory).build_datasets() if __name__ == "__main__": main()
December-21/python_UjjwalPrahladka_Dec21.py
UjjwalPrahladka/A-December-of-Algorithms-2019
228
11053596
def marching_partners(n = 0, H = [], d = 0): H.sort() count = 0 while len(H) != 1:#checking if list is empty if H[1] - H[0] <= d: count += 1 H = H[2:] else: H.pop(0) return count
rnn/rnn.py
ivanhao/envytools
336
11053614
<gh_stars>100-1000 # Copyright (C) 2010-2011 <NAME> <<EMAIL>> # Copyright (C) 2010 <NAME> <<EMAIL>> # Copyright (C) 2010 <NAME> <<EMAIL>> # Copyright (C) 2010 <NAME> <<EMAIL>> # Copyright (C) 2010 <NAME> <<EMAIL>> # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy ...
boto3_type_annotations/boto3_type_annotations/emr/paginator.py
cowboygneox/boto3_type_annotations
119
11053620
<reponame>cowboygneox/boto3_type_annotations from typing import Dict from typing import List from datetime import datetime from botocore.paginate import Paginator class ListBootstrapActions(Paginator): def paginate(self, ClusterId: str, PaginationConfig: Dict = None) -> Dict: pass class ListClusters(Pag...
conftest.py
ascribe/transactions
124
11053640
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os from uuid import uuid1 import pytest from bitcoinrpc.authproxy import AuthServiceProxy from pycoin.key.BIP32Node import BIP32Node @pytest.fixture def alice(): return 'mp2YPeFdPufm515qWbmPXzSACxnMVdphnF' @pytest.fixture def bob(): ...
openbook_moderation/tests/views/moderated_object.py
TamaraAbells/okuna-api
164
11053643
<reponame>TamaraAbells/okuna-api<gh_stars>100-1000 import json import tempfile from PIL import Image from django.core.files import File from django.urls import reverse from django.utils import timezone from faker import Faker from rest_framework import status from openbook_common.tests.models import OpenbookAPITestCas...
tests/test_provider_NetApp_netapp_gcp.py
mjuenema/python-terrascript
507
11053648
# tests/test_provider_NetApp_netapp-gcp.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:22:18 UTC) def test_provider_import(): import terrascript.provider.NetApp.netapp_gcp def test_resource_import(): from terrascript.resource.NetApp.netapp_gcp import netapp_gcp_active_directory from ...
src/cfnlint/rules/mappings/Name.py
tomislacker/cfn-python-lint
1,134
11053658
<gh_stars>1000+ """ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. SPDX-License-Identifier: MIT-0 """ from cfnlint.rules import CloudFormationLintRule from cfnlint.rules.common import alphanumeric_name class Name(CloudFormationLintRule): """Check if Mappings are named correctly""" id = 'E7...
docqa/squad/squad_document_qa.py
Willyoung2017/doc-qa
422
11053680
<filename>docqa/squad/squad_document_qa.py from typing import List, Optional import numpy as np from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics import pairwise_distances from docqa.data_processing.multi_paragraph_qa import ParagraphWithAnswers, MultiParagraphQuestion, TokenSpanGroup f...
Python3/111.py
rakhi2001/ecom7
854
11053685
__________________________________________________________________________________________________ sample 28 ms submission # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def minDepth(s...
gateway/test/dummycm.py
lynix94/nbase-arc
176
11053701
<reponame>lynix94/nbase-arc # # Copyright 2017 <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...
src_py/rlpytorch/runner/single_process.py
r-woo/elfai
3,305
11053707
# Copyright (c) 2018-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import threading from elf.options import auto_import_options, PyOptionSpec class SingleProcessRun(object): @clas...
receipt_parser_core/config.py
Dielee/receipt-parser-legacy
611
11053722
import yaml from receipt_parser_core.objectview import ObjectView def read_config(config="config.yml"): """ :param file: str Name of file to read :return: ObjectView Parsed config file """ with open(config, 'rb') as stream: try: docs = yaml.safe_load(stream) ...
python/kwiver/vital/modules/__init__.py
mwoehlke-kitware/kwiver
176
11053756
<gh_stars>100-1000 from __future__ import absolute_import from kwiver.vital.modules.modules import *
src/simian/mac/admin/ip_blacklist.py
tristansgray/simian
326
11053764
<reponame>tristansgray/simian<gh_stars>100-1000 #!/usr/bin/env python # # Copyright 2018 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.ap...
tests/pytests/unit/runners/test_pillar.py
babs/salt
9,425
11053827
<reponame>babs/salt """ unit tests for the pillar runner """ import logging import os import shutil import pytest import salt.runners.pillar as pillar_runner import salt.utils.files import salt.utils.gitfs import salt.utils.msgpack from tests.support.mock import MagicMock, mock_open, patch log = logging.getLogger(__...
onir/interfaces/matchzoo.py
tgeral68/OpenNIR
140
11053852
# -*- coding: utf-8 -*- """MatchZoo interface This module interfaces with the MatchZoo-py library. For instance, it provides a general translation between MatchZoo models and onir.rankers. It also supports operations such as inferring the required inputs from a MatchZoo model implementation. Attributes: is_availa...
python/alphabet-rangoli.py
gajubadge11/HackerRank-1
340
11053874
<gh_stars>100-1000 import string alpha = string.ascii_lowercase def print_rangoli(size): lines = [] for row in range(size): to_print = "-".join(alpha[row:size]) lines.append(to_print[::-1] + to_print[1:]) width = len(lines[0]) for row in range(size-1, 0, -1): print(lines[ro...
tests/conftest.py
marcgarreau/eth-utils
234
11053879
import warnings import pytest @pytest.fixture(autouse=True) def print_warnings(): warnings.simplefilter("always")
lib/searchparser.py
bbhunter/ODIN
533
11053882
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ This module contains all of parsing tools used to extract email addresses and social media profile handles and URLs from search results. While much of the original code has been removed, rearranged, or modified, this code was seeded using functions pulled from <NAME>'s T...
tools/mo/openvino/tools/mo/front/tf/deconv_ext.py
kurylo/openvino
1,127
11053893
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from openvino.tools.mo.front.common.partial_infer.utils import convert_deconv_tf_padding_to_str, int64_array, \ dynamic_dimension from openvino.tools.mo.front.extractor import FrontExtractorOp from openvino.tools.mo.front.tf.extracto...
results-processor/test_server.py
lucacasonato/wpt.fyi
122
11053954
#!/usr/bin/env python3 # Copyright 2019 The WPT Dashboard Project. 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 logging import sys import time import flask # Exported credentials for authenticated APIs AUTH_CREDENTI...
netaddr/cli.py
Rockly/netaddr
416
11054048
<gh_stars>100-1000 #!/usr/bin/env python #----------------------------------------------------------------------------- # Copyright (c) 2008 by <NAME>. All rights reserved. # # Released under the BSD license. See the LICENSE file for details. #------------------------------------------------------------------------...
ultimatelabeling/views/message_progress.py
MauroPfister/UltimateLabeling
244
11054114
from PyQt5.QtWidgets import QMessageBox, QProgressBar, QApplication from PyQt5.QtCore import Qt, QThread, pyqtSignal class MessageProgressBox(QMessageBox): def __init__(self, title): super().__init__() self.messages = [title] self.setIcon(QMessageBox.Information) self.setText(tit...
alipay/aop/api/response/AnttechBlockchainFinanceAssetmanagePenetratebillQueryResponse.py
antopen/alipay-sdk-python-all
213
11054176
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AnttechBlockchainFinanceAssetmanagePenetratebillQueryResponse(AlipayResponse): def __init__(self): super(AnttechBlockchainFinanceAssetmanagePenetratebillQueryResponse, self)....
Code/utils/split_1600.py
yxn-coder/Inf-Net
273
11054274
<reponame>yxn-coder/Inf-Net # -*- coding: utf-8 -*- """Preview Code for 'Inf-Net: Automatic COVID-19 Lung Infection Segmentation from CT Scans' submit to Transactions on Medical Imaging, 2020. First Version: Created on 2020-05-13 (@author: <NAME>) """ import os import shutil import random unlabeled_imgs_dir = '../....
privy/__init__.py
rahulunair/privy
249
11054356
from privy.core import SECURITY_LEVELS, hide, peek
tools/memgrep.py
plowsof/mayhem
214
11054469
<filename>tools/memgrep.py #!/usr/bin/env python # -*- coding: utf-8 -*- # # tools/memgrep.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright #...
Conv1D_ECG.py
samir-nasibli/DeepECG
135
11054493
<filename>Conv1D_ECG.py # source:https://github.com/ismorphism/DeepECG # 2019/11/25 <NAME> 小修改 from sklearn.metrics import confusion_matrix, accuracy_score from keras.callbacks import ModelCheckpoint from sklearn.preprocessing import MinMaxScaler, RobustScaler import pandas as pd import scipy.io as sio from os im...
anticaptcha_examples/anticaptcha_customcaptcha_example.py
zanachka/python3-anticaptcha
125
11054508
import asyncio from python3_anticaptcha import CustomCaptchaTask ANTICAPTCHA_KEY = "" # Пример с созданием CustomCaptcha # подробней - https://anticaptcha.atlassian.net/wiki/spaces/API/pages/241827850/CustomCaptchaTask # ссылка на изображение imageUrl = "https://files.anti-captcha.com/26/41f/c23/7c50ff19.jpg" # ка...
cv2/tkinter-CV - minimal version/main.py
whitmans-max/python-examples
140
11054538
<reponame>whitmans-max/python-examples<gh_stars>100-1000 #!/usr/bin/env python3 # date: 2020.02.20 # https://stackoverflow.com/questions/60318726/how-can-i-integrate-opencv-into-a-tkinter-window # https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html # https://docs.opencv.org/2.4/modules/core/doc/drawing_fu...
director/_auto.py
apikay/celery-director
351
11054542
<reponame>apikay/celery-director # initialize a working context from director import create_app from director.extensions import cel app = create_app()
webapp/graphite/tags/urls.py
romanek-adam/graphite-web
4,281
11054567
"""Copyright 2008 Orbitz WorldWide 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 writing, softw...
neurokernel/mixins.py
KathyFeiyang/neurokernel
235
11054611
<reponame>KathyFeiyang/neurokernel #!/usr/bin/env python """ Object with built-in logger. """ import twiggy class LoggerMixin(object): """ Mixin that provides a per-instance logger that can be turned off. Parameters ---------- name : str Name to assign logger. log_on : bool I...
Problem045/Python/solution_1.py
drocha87/ProjectEuler
167
11054625
#!/usr/bin/env python # coding=utf-8 # # Python Script # # Copyleft © <NAME> # # from math import floor from itertools import count # triangle # -> t = n² + n: n² + n - t = 0 # pentagonal (I) # -> p = (3n² - n) / 2: 3n² - n -2p = 0 # hexagonal (II) # -> h = (2n² - n) / 1: 2n² -n -h = 0 # for t = p = h, we ha...
chitra/serve/__init__.py
aniketmaurya/Chitra
158
11054654
<filename>chitra/serve/__init__.py from chitra.serve.api import API, create_api from chitra.serve.app import GradioApp from chitra.serve.base import ModelServer from chitra.serve.cloud.aws_serverless import ChaliceServer from chitra.serve.cloud.base import CloudServer
ztag/annotations/FtpEcosense.py
justinbastress/ztag
107
11054757
import re from ztag.annotation import Annotation from ztag.annotation import OperatingSystem from ztag.annotation import Type from ztag.annotation import Manufacturer from ztag import protocols import ztag.test class FtpEcosense(Annotation): protocol = protocols.FTP subprotocol = protocols.FTP.BANNER port...
twiml/voice/pay/pay-tokenize/pay-tokenize.6.x.py
Tshisuaka/api-snippets
234
11054765
from twilio.twiml.voice_response import Pay, VoiceResponse response = VoiceResponse() response.pay(token_type='one-time', charge_amount='0') print(response)
Python3/502.py
rakhi2001/ecom7
854
11054772
<reponame>rakhi2001/ecom7 __________________________________________________________________________________________________ sample 208 ms submission from heapq import nlargest, heappop, heappush class Solution: def findMaximizedCapital(self, k: int, W: int, Profits: List[int], Capital: List[int]) -> int: i...
rootfs/usr/lib/python3/dist-packages/numpy/core/tests/test_api.py
kappaIO-Dev/kappaIO-sdk-armhf-crosscompile
343
11054780
<gh_stars>100-1000 import sys import numpy as np from numpy.testing import * from numpy.testing.utils import WarningManager import warnings def test_fastCopyAndTranspose(): # 0D array a = np.array(2) b = np.fastCopyAndTranspose(a) assert_equal(b, a.T) assert_(b.flags.owndata) # 1D array a...
addok/http/__init__.py
rhanka/addok
215
11054826
from .base import View, log_notfound, log_query __all__ = ['View', 'log_notfound', 'log_query']
lib-python/protocol/handlers/addressed.py
geoffxy/tandem
732
11054834
from tandem.shared.protocol.handlers.base import ProtocolHandlerBase class AddressedHandler(ProtocolHandlerBase): def _extra_handler_arguments(self, io_data): return [io_data.get_address()]
modules/pdfs.py
hwiorn/orger
241
11054835
#!/usr/bin/env python3 from orger import Mirror from orger.inorganic import node, link, docview_link, literal from orger.common import dt_heading, error from datetime import datetime class PdfView(Mirror): def get_items(self) -> Mirror.Results: import my.pdfs as pdfs for pdf in sorted( ...
migrations/versions/e0d427aae93e_update_user_id_to_int64.py
samuelfirst/bot
162
11054842
<gh_stars>100-1000 """Update user_id to int64 Revision ID: e0d427aae93e Revises: 57bc88e06e52 Create Date: 2021-12-05 23:11:42.879573 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "e0d427aae93e" down_revision = "57bc88e06e52" branch_labels = None depends_on = ...
awacs/apigateway.py
alanjjenkins/awacs
358
11054872
# Copyright (c) 2012-2021, <NAME> <<EMAIL>> # All rights reserved. # # See LICENSE file for full license. from .aws import Action as BaseAction from .aws import BaseARN service_name = "Amazon API Gateway Management" prefix = "apigateway" class Action(BaseAction): def __init__(self, action: str = None) -> None: ...
platypush/backend/bluetooth/fileserver.py
RichardChiang/platypush
228
11054911
<reponame>RichardChiang/platypush<filename>platypush/backend/bluetooth/fileserver.py import os import stat # noinspection PyPackageRequirements from PyOBEX import requests, responses, headers # noinspection PyPackageRequirements from PyOBEX.server import BrowserServer from platypush.backend.bluetooth import Bluetooth...
docs/manual/gears/union_fmap.py
bogdanvuk/pygears
120
11054936
<filename>docs/manual/gears/union_fmap.py from bdp import block, cap, path, text, fig, prev, p, poffx part = block(text_margin=p(0.5, 0.5), alignment="nw", dotted=True, group='tight', group_margin=[p(1, 3), p(1, 2)]) comp = block(size=p(4, 4), nodesep=(5, 2)) ps_com...
kitsune/search/urls.py
erdal-pb/kitsune
929
11054938
<filename>kitsune/search/urls.py from django.conf.urls import url from kitsune.search import views urlpatterns = [ url(r"^$", views.simple_search, name="search"), url(r"^/xml$", views.opensearch_plugin, name="search.plugin"), ]
models/Lightweight/MobileNetV3.py
Dou-Yu-xuan/deep-learning-visal
150
11054954
<reponame>Dou-Yu-xuan/deep-learning-visal import torch import torch.nn as nn import torchvision class HardSwish(nn.Module): def __init__(self, inplace=True): super(HardSwish, self).__init__() self.relu6 = nn.ReLU6(inplace) def forward(self, x): return x*self.relu6(x+3)/6 def ConvBNAct...
elliot/recommender/latent_factor_models/FunkSVD/__init__.py
gategill/elliot
175
11054957
from .funk_svd import FunkSVD
hikyuu/admin/dialog/HkuEditSessionDialog.py
kknet/hikyuu
1,283
11055027
# -*- coding: utf-8 -*- import resource import service import sqlalchemy from PyQt5 import QtWidgets, QtCore, QtGui from .Ui_HkuEditSessionDialog import Ui_HkuEditSessionDialog from data import SessionModel _translate = QtCore.QCoreApplication.translate class HkuEditSessionDialog(QtWidgets.QDialog, Ui_HkuEditSessi...
python/tensorstore/tests/bfloat16_test.py
google/tensorstore
106
11055030
<filename>python/tensorstore/tests/bfloat16_test.py # Copyright 2021 The TensorStore 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....
mindinsight/debugger/stream_cache/watchpoint.py
mindspore-ai/mindinsight
216
11055061
# Copyright 2020-2021 Huawei Technologies Co., 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 applicable law or agre...
workshop_sections/extras/cnn_text_classification/text_cnn.py
CharleyGuo/tensorflow-workshop
691
11055065
<reponame>CharleyGuo/tensorflow-workshop # Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 #...
python/lib/davis/misc/__init__.py
timmeinhardt/davis-2017
113
11055073
<filename>python/lib/davis/misc/__init__.py<gh_stars>100-1000 # ---------------------------------------------------------------------------- # The 2017 DAVIS Challenge on Video Object Segmentation #----------------------------------------------------------------------------- # Copyright (c) 2017 <NAME> # Licensed under...
app/views/error.py
cipherboy/modern-paste
271
11055103
<filename>app/views/error.py from modern_paste import app from api.decorators import render_view @app.errorhandler(404) @render_view def not_found(e): return 'error/not_found.html', {} @app.errorhandler(500) @render_view def internal_server_error(e): return 'error/internal_server_error.html', {}
opticspy/diffraction.py
Graylien/opticspy
306
11055134
<filename>opticspy/diffraction.py<gh_stars>100-1000 import numpy as __np__ from . import tools as __tools__ def fresnel(aperture,z = 2,lambda1 = 660*10**(-9)): aperturelist = ['rectangle','doublerectangle','frame','doublecircle','ring'] if aperture.__type__ == 'circle': n = aperture.__background__ d = aperture._...
tutorials/W2D4_DynamicNetworks/solutions/W2D4_Tutorial1_Solution_44a82c10.py
eduardojdiniz/CompNeuro
2,294
11055187
""" 1) Weak inputs to the neurons eventually result in the activity converging to zero. Strong inputs to the neurons eventually result in the activity converging to max value 2) The time constant tau, does not affect the final response reached but it determines the time the neurons take to reach to their fixed poin...
mopidy/internal/xdg.py
grdorin/mopidy
6,700
11055190
<filename>mopidy/internal/xdg.py import configparser import os import pathlib def get_dirs(): """Returns a dict of all the known XDG Base Directories for the current user. The keys ``XDG_CACHE_DIR``, ``XDG_CONFIG_DIR``, and ``XDG_DATA_DIR`` is always available. Additional keys, like ``XDG_MUSIC_DIR`...
core/loaders/elf.py
ParikhKadam/frankenstein
344
11055202
<gh_stars>100-1000 import sys import tempfile from elftools.elf import elffile class elfloader: """ Handles ELF file import including coredump symbol recovery """ def __init__(self, fname, offset=0x00): f = open(fname, "rb") self.elf = elffile.ELFFile(f) self.offset = offse...
labs/3.3/pixel.py
alexellis/docker-blinkt-workshop
171
11055236
<gh_stars>100-1000 #!/usr/bin/env python from blinkt import set_clear_on_exit, set_pixel, show import time set_clear_on_exit() for i in range(0, 8): set_pixel(i, 0, 255, 0) show() time.sleep(1) # 1 = 1 second
tests/environment/test_default_environment.py
02strich/aws-embedded-metrics-python
130
11055307
<filename>tests/environment/test_default_environment.py<gh_stars>100-1000 from aws_embedded_metrics.config import get_config from aws_embedded_metrics.environment.default_environment import DefaultEnvironment from aws_embedded_metrics.sinks.agent_sink import AgentSink import pytest from faker import Faker fake = Faker...
depot/io/utils.py
tcmike/depot
128
11055333
import cgi import mimetypes import os from datetime import datetime from tempfile import SpooledTemporaryFile from depot._compat import byte_string INMEMORY_FILESIZE = 1024*1024 def timestamp(): return datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S') def file_from_content(content): """Provides a real file ...
setup.py
CalebBell/ht
118
11055335
<reponame>CalebBell/ht<filename>setup.py # -*- coding: utf-8 -*- '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling. Copyright (C) 2016, <NAME> <<EMAIL>> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "So...
tracardi/process_engine/tql/transformer/common_transformer.py
bytepl/tracardi
153
11055337
<filename>tracardi/process_engine/tql/transformer/common_transformer.py import dateparser from .transformer_namespace import TransformerNamespace class CommonTransformer(TransformerNamespace): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) def ESCAPED_STRING(self, args): ...
tests/unit/operations/test_environments.py
senstb/aws-elastic-beanstalk-cli
110
11055339
# Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
payment/src/on_modified/main.py
pecigonzalo/aws-serverless-ecommerce-platform
758
11055373
<reponame>pecigonzalo/aws-serverless-ecommerce-platform """ OnModified Function """ import os import boto3 import requests from aws_lambda_powertools.tracing import Tracer # pylint: disable=import-error from aws_lambda_powertools.logging.logger import Logger # pylint: disable=import-error from aws_lambda_powertools i...
electrumpersonalserver/bitcoin/secp256k1_main.py
mflaxman/electrum-personal-server
511
11055396
#!/usr/bin/python from .py2specials import * from .py3specials import * import binascii import hashlib import re import sys import os import base64 import time import random import hmac import secp256k1 ctx = secp256k1.lib.secp256k1_context_create(secp256k1.ALL_FLAGS) def privkey_to_address(priv, from_hex=True, magic...
studio/completion_service/__init__.py
ilblackdragon/studio
397
11055410
from .completion_service import CompletionService
data/transcoder_evaluation_gfg/python/ANALYSIS_OF_ALGORITHMS_SET_2_ASYMPTOTIC_ANALYSIS.py
mxl1n/CodeGen
241
11055444
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( arr , n , x ) : i = 0 for i in range ( i , n ) : if ( arr [ i ] == x ) : return i r...
recipes/Python/577390_RSH_with_timeout/recipe-577390.py
tdiprima/code
2,023
11055450
#!/usr/bin/python import subprocess import time import sys import os from optparse import OptionParser rsh = "/usr/bin/rsh" def rshTimed(host, command, timeOut): rshD = subprocess.Popen([rsh,host,command],stdout=sys.stdout,stderr=sys.stdout) timeStart = time.time() if(timeOut != 0): while(1): # C...
Dragon/python/dragon/vm/tensorflow/contrib/layers/layers.py
neopenx/Dragon
212
11055470
<reponame>neopenx/Dragon # -------------------------------------------------------- # TensorFlow @ Dragon # Copyright(c) 2017 SeetaTech # Written by <NAME> # -------------------------------------------------------- from collections import defaultdict import dragon.ops as op_lib import dragon.vm.tensorflow.framework....
tests/func/conftest.py
missmoiselle/temboard
294
11055484
<reponame>missmoiselle/temboard<filename>tests/func/conftest.py import httplib import json import os import ssl from urlparse import urlparse import pytest from selenium.webdriver import Remote from selenium.webdriver.common.desired_capabilities import DesiredCapabilities @pytest.fixture(scope='session') def seleniu...
mann/utils/init.py
tristandeleu/ntm-one-shot
457
11055485
<filename>mann/utils/init.py import theano import numpy as np def shared_glorot_uniform(shape, dtype=theano.config.floatX, name='', n=None): if isinstance(shape, int): high = np.sqrt(6. / shape) else: high = np.sqrt(6. / (np.sum(shape[:2]) * np.prod(shape[2:]))) shape = shape if n is None e...
google/cloud/forseti/scanner/scanners/audit_logging_scanner.py
aarontp/forseti-security
921
11055526
<reponame>aarontp/forseti-security<gh_stars>100-1000 # Copyright 2018 The Forseti Security 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.apac...
contrib/python/meta-python/example.py
peoplemerge/Metamorphosis
985
11055568
<gh_stars>100-1000 from metaq.producer import Message,MessageProducer producer = MessageProducer("meta-test") message = Message("meta-test", "http://www.taobao.com") print producer.send(message) producer.close()
search/search_service/models/feature.py
defendercrypt/amundsen
2,072
11055573
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 from typing import ( List, Optional, Set, ) import attr from marshmallow3_annotations.ext.attrs import AttrsSchema from search_service.models.base import Base from search_service.models.tag import Tag @attr.s(auto_attribs=T...
namedivider/cli.py
rskmoi/namedivider-python
161
11055584
<reponame>rskmoi/namedivider-python import click from tqdm import tqdm from pathlib import Path from namedivider.name_divider import NameDivider CURRENT_DIR = Path(__file__).resolve().parent @click.group() def cmd(): pass @cmd.command() @click.argument("undivided_name") @click.option("--separator", "-s", defaul...
SimG4Core/CustomPhysics/test/dumpStopPoints.py
ckamtsikis/cmssw
852
11055603
<gh_stars>100-1000 import FWCore.ParameterSet.Config as cms process = cms.Process('SCAN') process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring('file:PYTHIA6_Exotica_HSCP_gluino300_cfg_py_GEN_SIM_DIGI_L1_DIGI2RAW_...
src/api/transaction/reply.py
piwaniuk/critic
216
11055620
# -*- mode: python; encoding: utf-8 -*- # # Copyright 2017 the Critic contributors, Opera Software ASA # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at # # http://www.apache.org/licenses/LI...
Python/Fundamentals/end-times.py
Gjacquenot/training-material
115
11055635
#!/usr/bin/env python import sys def main(): for line in sys.stdin: if line.startswith('end'): _, time_str = (x.strip() for x in line.strip().split(':', 1)) print(time_str) return 0 if __name__ == '__main__': status = main() sys.exit(status)