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 |
|---|---|---|---|---|---|---|---|---|---|---|
parsl/monitoring/message_type.py | cylondata/parsl | 323 | 3234133 | <reponame>cylondata/parsl
from enum import Enum
class MessageType(Enum):
# Reports any task related info such as launch, completion etc.
TASK_INFO = 0
# Reports of resource utilization on a per-task basis
RESOURCE_INFO = 1
# Top level workflow information
WORKFLOW_INFO = 2
# Reports of... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/elasticache/test_api_interface.py | Yurzs/boto | 5,079 | 3234152 | <gh_stars>1000+
from boto.elasticache.layer1 import ElastiCacheConnection
from tests.unit import AWSMockServiceTestCase
class TestAPIInterface(AWSMockServiceTestCase):
connection_class = ElastiCacheConnection
def test_required_launch_params(self):
""" Make sure only the AWS required params are requir... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/pytorch/eager/blendcnn/distillation/checkpoint.py | kevinintel/neural-compressor | 172 | 3234215 | # Copyright 2018 <NAME>, <NAME>.
""" Load a checkpoint file of pretrained transformer to a model in pytorch """
import numpy as np
import tensorflow as tf
import torch
def load_param(checkpoint_file, conversion_table):
"""
Load parameters in pytorch model from checkpoint file according to conversion_table
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/performance.py | yangboz/maro | 598 | 3234220 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import os
from time import time
from termgraph import termgraph as tg
from maro.backends.frame import (FrameBase, FrameNode, NodeAttribute, NodeBase,
node)
NODE1_NUMBER = 100
NODE2_NUMBER = 100
MAX_TICK = 10000... | 4 | 4 | 0 | 0 | 8 | 0 |
bin/units_from_xls.py | frankalicious/openhtf | 372 | 3234221 | # 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
# Unless required by applicable law or agre... | 0 | 1 | 0 | 0 | 1 | 0 |
tools/compare.py | fenc1022/AccDNN | 231 | 3234225 | #!/usr/bin/env python
import numpy as np
import sys
import matplotlib.pyplot as plt
import argparse
import copy
#DQ = 6
#SCALE = 2 ** DQ
bits_per_element = 16
hex_num_per_element = bits_per_element / 4
NUM_MAX = 2 ** (bits_per_element)
NUM_MAX_HALF = 2 ** (bits_per_element - 1)
def compare(sim_file, real_file, bits_p... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/apps/userreports/tests/test_data_source_providers.py | akashkj/commcare-hq | 471 | 3234254 | import datetime
from django.test import TestCase, SimpleTestCase
from corehq.apps.userreports.data_source_providers import DynamicDataSourceProvider, MockDataSourceProvider
from corehq.apps.userreports.tests.utils import (
get_sample_data_source,
)
class DataSourceProviderTest(TestCase):
def test_dynamic_mo... | 0 | 0 | 0 | 0 | 0 | 0 |
asdl/front_end.py | Schweinepriester/oil | 2,209 | 3234264 | <gh_stars>1000+
"""
front_end.py: Lexer and parser for the ASDL schema language.
"""
from __future__ import print_function
import re
from asdl import asdl_ as asdl
from asdl.asdl_ import (
Use, Module, TypeDecl, Constructor, Field, Sum, SimpleSum, Product, TypeExpr
)
from core.pyerror import log
_ = log
_KEYWOR... | 0 | 0 | 0 | 0 | 0 | 0 |
c_comp/lib/stdio.py | Commodoreprime/Command-Block-Assembly | 223 | 3234267 | from __future__ import annotations
from ..ir import IR
def printf(visitor, expr) -> object:
assert expr.args
tpl = visitor.visit_expression(expr.args[0])
assert isinstance(tpl, IR.LiteralString),\
"printf called with non-constant string"
args = string_format(visitor, tpl.val, expr.args[1:])... | 0 | 3 | 0 | 0 | 3 | 0 |
venv/Lib/site-packages/wcwidth/table_wide.py | gilbertekalea/booking.com_crawler | 6,989 | 3234284 | <reponame>gilbertekalea/booking.com_crawler
"""Wide_Eastasian table, created by bin/update-tables.py."""
# Generated: 2020-06-23T16:03:18.836005
WIDE_EASTASIAN = {
'4.1.0': (
# Source: EastAsianWidth-4.1.0.txt
# Date: 2005-03-17, 15:21:00 PST [KW]
#
(0x01100, 0x01159,), # Hangul Ch... | 0 | 0 | 0 | 0 | 0 | 0 |
evaluation/icdar2015/e2e/prepare_results.py | AdityaKane2001/MaskTextSpotter | 425 | 3234293 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import annotations
import sys
import os
sys.path.append('./')
import shapely
from shapely.geometry import Polygon,MultiPoint
import numpy as np
import editdistance
from weighted_editdistance import weighted_edit_distance
from tqdm import tqdm
try:
impor... | 13 | 7 | 0 | 0 | 20 | 0 |
chapter14/services/citibike_api/app.py | add54/Data_PipeLine_Apache_Airflow | 303 | 3234305 | import os
from datetime import date
import psycopg2
import psycopg2.extras
from flask import Flask, jsonify, Response
from flask_httpauth import HTTPBasicAuth
from werkzeug.security import generate_password_hash, check_password_hash
app = Flask(__name__)
auth = HTTPBasicAuth()
users = {"citibike": generate_password_... | 2 | 3 | 0 | 0 | 5 | 0 |
day5/Python/pattern3.py | Grace0Hud/dailycodebase | 249 | 3234338 | '''
* @author: <NAME><<EMAIL>>
* @github: https://github.com/razdeep
* @date: 26/12/2018
'''
def pattern3(num):
for i in range(1,num+1):
currentLine = ''
for j in range(1,i+1):
currentLine = currentLine + str(j) + ' '
print(currentLine)
for i in range(num-1,0,-1):
... | 0 | 0 | 0 | 0 | 0 | 0 |
cle/backends/pe/relocation/pereloc.py | Atipriya/cle | 317 | 3234351 | from __future__ import annotations
import logging
from ...relocation import Relocation
l=logging.getLogger(name=__name__)
# Reference: https://msdn.microsoft.com/en-us/library/ms809762.aspx
class PEReloc(Relocation):
AUTO_HANDLE_NONE: bool = True
def __init__(self, owner, symbol, addr, resolvewith: object | ... | 3 | 5 | 1 | 0 | 9 | 0 |
pywick/models/segmentation/testnets/difnet.py | achaiah/pywick | 408 | 3234376 | # Source: https://github.com/sdujump/DifNet
from __future__ import annotations
import math
import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
import torch.nn.functional as F
affine_par = True
__all__ = ['DifNet', 'DifNet101', 'DifNet152']
def conv3x3(in_planes, out_planes, stride: int=1, p... | 17 | 14 | 2 | 1 | 34 | 0 |
examples/pbc/46-k_point_eom_ccsd_rhf.py | QuESt-Calculator/pyscf | 501 | 3234385 | <reponame>QuESt-Calculator/pyscf<gh_stars>100-1000
#!/usr/bin/env python
#
# Author: <NAME> <<EMAIL>>
#
"""
This example first runs a closed-shell periodic EOM-EE-CCSD with K-point
sampling, a.k.a. EOM-EE-KRCCSD, for singlet excited states on one of the
three provided systems.
Then a molecular EOM-EE-RCCSD based on Ga... | 0 | 0 | 0 | 0 | 0 | 0 |
grr/server/grr_response_server/gui/selenium_tests/v2/approval_page_test.py | khanhgithead/grr | 4,238 | 3234402 | #!/usr/bin/env python
from absl import app
from grr_response_core.lib.rdfvalues import file_finder as rdf_file_finder
from grr_response_server import flow
from grr_response_server.flows import file
from grr_response_server.gui import gui_test_lib
from grr_response_server.rdfvalues import flow_runner as rdf_flow_runner... | 0 | 2 | 0 | 0 | 2 | 0 |
alipay/aop/api/domain/AlipayMerchantServiceconsultQueryModel.py | antopen/alipay-sdk-python-all | 213 | 3234418 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayMerchantServiceconsultQueryModel(object):
def __init__(self):
self._consult_event_id: None = None
@property
def consult_event_id(self) ->... | 0 | 3 | 0 | 1 | 4 | 0 |
indy_node/test/upgrade/test_node_schedules_upgrade_after_pool_ledger_update.py | Rob-S/indy-node | 627 | 3234436 | <reponame>Rob-S/indy-node
import pytest
from indy_node.test.upgrade.helper import sdk_change_bls_key
from plenum.test.bls.helper import check_bls_key
@pytest.fixture(scope="module")
def update_bls_keys(looper, tconf, nodeSet, sdk_pool_handle,
sdk_wallet_stewards):
node = nodeSet[0]
new_bl... | 0 | 0 | 0 | 0 | 0 | 0 |
robot-server/tests/robot/calibration/tip_length/test_util.py | anuwrag/opentrons | 235 | 3234452 | import pytest
from typing import List, Tuple
from robot_server.robot.calibration import util
@pytest.fixture
def machine(loop) -> object:
states = {
"imaginingTable",
"millingLumber",
"sawingToDimensions",
"assemblingTable" "gluingUp" "rethinkingDesign",
"sandingDown",
... | 0 | 1 | 2 | 0 | 3 | 0 |
mmfewshot/classification/models/backbones/conv4.py | BIGWangYuDong/mmfewshot | 376 | 3234455 | <gh_stars>100-1000
# Copyright (c) OpenMMLab. All rights reserved.
from typing import Sequence
import torch.nn as nn
from mmcls.models.builder import BACKBONES
from torch import Tensor
class ConvBlock(nn.Module):
def __init__(self,
in_channels: int,
out_channels: int,
... | 0 | 0 | 0 | 0 | 0 | 0 |
reference-architecture/vmware-ansible/playbooks/library/rpm_q.py | Elwalle/openshift-ansible-contrib-master | 324 | 3234469 | /usr/share/ansible/openshift-ansible/roles/lib_utils/library/rpm_q.py | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_vote.py | tigerdar004/RweddingPoll | 112 | 3234474 | from pollbot.models import Option, Poll, Vote
import pytest
from sqlalchemy.exc import IntegrityError
from sqlalchemy import exists
class TestVote:
def test_unique_ordering(self, session, user, poll):
option = Option(poll, "option 0")
session.add(option)
vote = Vote(user, option)
v... | 0 | 0 | 0 | 0 | 0 | 0 |
deployed-devices/quickstarts/paho-python/subscribe-and-print.py | Tshisuaka/api-snippets | 234 | 3234478 | <filename>deployed-devices/quickstarts/paho-python/subscribe-and-print.py
import paho.mqtt.client as mqtt
#
# Use the actual location of your downloaded certificate and key.
#
pem_location = './CYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem'
key_location = './<KEY>'
client = mqtt.Client(client_id="bob", clean_session=False)
... | 0 | 0 | 0 | 0 | 0 | 0 |
sciluigi/util.py | mikelynch/sciluigi | 285 | 3234480 | <gh_stars>100-1000
'''
This module contains utility methods that are used in various places across the
sciluigi library
'''
import csv
import os
import time
from luigi.six import iteritems
def timestamp(datefmt='%Y-%m-%d, %H:%M:%S'):
'''
Create timestamp as a formatted string.
'''
return time.strftime... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/core/padding-utils/test_padding.py | ggs134/py-evm | 1,641 | 3234481 | import pytest
from eth._utils.padding import (
pad32,
pad32r
)
padding_byte = b"\x00"
@pytest.mark.parametrize(
"value, expected",
(
(b"", padding_byte * 32),
(b"\x01", (padding_byte * 31) + b"\x01")
)
)
def test_pad_32(value, expected):
assert pad32(value) == expected
@pyt... | 0 | 0 | 0 | 0 | 0 | 0 |
tables/log-parsers/get-base-predicates.py | yash-srivastava19/sempre | 812 | 3234485 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Dump all possible context predicates of each example.
Output:
- Example ID
- Tokens <tab> Context <tab> Canonicalized Target
- Lines of records with the following fields (tab-separated):
- flag (see below)
- predicate
- words in the o... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/pytests/integration/pillar/cache/test_pillar_cache.py | tomdoherty/salt | 9,425 | 3234528 | """
Pillar cache tests
"""
import pytest
@pytest.fixture()
def pillar_cache_tree(pillar_state_tree, pillar_salt_minion, pillar_salt_call_cli):
top_file = """
base:
'{}':
- test
""".format(
pillar_salt_minion.id
)
test_pillar = """
test: one
test2: two
"""
top_... | 0 | 0 | 0 | 0 | 0 | 0 |
python/zed/setup.py | silveryfu/zq | 171 | 3234530 | import setuptools
setuptools.setup(
name='zed',
install_requires=[
'durationpy',
'python-dateutil',
'requests',
],
py_modules=['zed'],
python_requires='>=3.3',
)
| 0 | 0 | 0 | 0 | 0 | 0 |
the-xray-tracer/python/the_xray_tracer/the_sns_flow_stack.py | mttfarmer/serverless | 1,627 | 3234534 | <reponame>mttfarmer/serverless
from aws_cdk import (
aws_lambda as _lambda,
aws_sns as sns,
aws_sns_subscriptions as subscriptions,
core
)
class TheSnsFlowStack(core.Stack):
def __init__(self, scope: core.Construct, id: str, sns_topic_arn: str, **kwargs) -> None:
super().__init__(scope, id... | 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/GL/ARB/texture_buffer_object.py | ShujaKhalid/deep-rl | 210 | 3234543 | '''OpenGL extension ARB.texture_buffer_object
This module customises the behaviour of the
OpenGL.raw.GL.ARB.texture_buffer_object to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a new texture type, called a buffer texture.
Buffer textures are one-dimensional arrays of texe... | 0 | 1 | 0 | 0 | 1 | 0 |
bobo/Lib/site-packages/jpype/_jclass.py | nehiridil/MLDays_nlp | 531 | 3234582 | <reponame>nehiridil/MLDays_nlp<filename>bobo/Lib/site-packages/jpype/_jclass.py
# *****************************************************************************
#
# 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
podman/tests/unit/containers/test_containers.py | kevinwylder/podman-py | 106 | 3234586 | <reponame>kevinwylder/podman-py
"""podman.containers unit tests"""
import unittest
import urllib.parse
from unittest import mock
import podman.containers
import podman.errors
import podman.system
class TestContainers(unittest.TestCase):
"""Test the containers calls."""
def setUp(self):
super().setU... | 0 | 0 | 0 | 0 | 0 | 0 |
webpy/sample/googlemodules/src/app/helpers/custom_error.py | minixalpha/SourceLearning | 118 | 3234615 | # Author : <NAME>
import web
from app.helpers import render
from config import view
def notfound() -> object:
return web.notfound(
render.layout(view.not_found(), title='File not found', mode='modeShow404'))
def internalerror() -> object:
return web.internalerror(
render.layout(view.internal... | 0 | 2 | 0 | 0 | 2 | 0 |
third_party/Paste/paste/auth/__init__.py | tingshao/catapult | 5,079 | 3234641 | <reponame>tingshao/catapult<gh_stars>1000+
# (c) 2005 <NAME> and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Package for authentication/identification of requests.
The objective of this package is to provide single-fo... | 0 | 0 | 0 | 0 | 0 | 0 |
local_ads/pylocal_ads/bindings_test.py | vicpopov/omim | 4,879 | 3234646 | <reponame>vicpopov/omim<gh_stars>1000+
import unittest
from pylocal_ads import (Campaign, Version, serialize, deserialize)
class PyLocalAdsTest(unittest.TestCase):
def assert_equal_campaigns(self, lhs, rhs):
self.assertEqual(len(lhs), len(rhs))
for i in range(0, len(lhs)):
self.asse... | 0 | 0 | 0 | 0 | 0 | 0 |
python/base_agent/ttad/back_translation/transformer.py | boldsort/craftassist | 626 | 3234656 | <gh_stars>100-1000
from transformers.modeling_bert import BertModel
import torch.nn as nn
class TransformerEncoder(nn.Module):
"""Transformer Encoder class.
"""
def __init__(self, config, tokenizer):
super(TransformerEncoder, self).__init__()
# Initializes transformer architecture with BE... | 0 | 0 | 0 | 0 | 0 | 0 |
3]. Competitive Programming/03]. LeetCode/1]. Problems/Python/0029)_i_Divide_Two_Integers.py | MLinesCode/The-Complete-FAANG-Preparation | 6,969 | 3234662 | class Solution:
def divide(self, dividend: int, divisor: int) -> int:
if divisor == 0:
return None
diff_sign = (divisor < 0) ^ (dividend < 0)
dividend = abs(dividend)
divisor = abs(divisor)
result = 0
max_divisor = divisor
shift_count = 1
... | 2 | 1 | 0 | 0 | 3 | 0 |
app/config.py | jhollowe/groceri.es | 130 | 3234665 | <gh_stars>100-1000
import os
class Config:
SECRET_KEY = ''
SQLALCHEMY_DATABASE_URI = 'sqlite:///db/app.db'
SQLALCHEMY_TRACK_MODIFICATIONS = False
LANGUAGES = ['en', 'nl']
def __init__(self):
for name, var in os.environ.items():
if hasattr(Config, name):
setat... | 0 | 0 | 0 | 0 | 0 | 0 |
egs/librispeech/s5/local/lm/python/pre_filter.py | shuipi100/kaldi | 805 | 3234674 | <gh_stars>100-1000
#!/usr/bin/env python
# Copyright 2014 <NAME>
# Apache 2.0
# Removes common strings, that are not helpful for language modeling purposes,
# from the Project Gutenberg's texts
import argparse
import re
import sys
roman_number = [re.compile('^\s*[_LXVI]+(\.)?\s*$'), ]
sq_brackets = [re.compile('(.... | 0 | 0 | 0 | 0 | 0 | 0 |
bookshelf/firestore.py | vdhulappanavar/getting-started-python | 734 | 3234679 | <filename>bookshelf/firestore.py
# 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 required by applicab... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/integration-tests/tests/common/scaling_common.py | maclema/aws-parallelcluster | 415 | 3234695 | <reponame>maclema/aws-parallelcluster<gh_stars>100-1000
# Copyright 2019 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.amaz... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/apps/smsbillables/migrations/0019_deactivate_hardcoded_twilio_gateway_fees.py | dimagilg/commcare-hq | 471 | 3234700 | # Generated by Django 1.11.12 on 2018-04-17 18:51
from django.db import migrations
from corehq.messaging.smsbackends.twilio.models import SQLTwilioBackend
def deactivate_hardcoded_twilio_gateway_fees(apps, schema_editor):
SmsGatewayFeeCriteria = apps.get_model('smsbillables', 'SmsGatewayFeeCriteria')
to_de... | 0 | 0 | 2 | 0 | 2 | 0 |
PyFunceble/database/session.py | Centaurioun/PyFunceble | 213 | 3234702 | <reponame>Centaurioun/PyFunceble
"""
The tool to check the availability or syntax of domain, IP or URL.
::
██████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ██╗ ██████╗███████╗██████╗ ██╗ ███████╗
██╔══██╗╚██╗ ██╔╝██╔════╝██║ ██║████╗ ██║██╔════╝██╔════╝██╔══██╗██║ ██╔════╝
██████╔╝ ╚████╔╝ █████╗ ██║... | 0 | 0 | 0 | 0 | 0 | 0 |
fbcrawl/spiders/events.py | sunpriya/major-crawler | 625 | 3234707 | import scrapy
from scrapy.loader import ItemLoader
from scrapy.exceptions import CloseSpider
from fbcrawl.spiders.fbcrawl import FacebookSpider
from fbcrawl.items import EventsItem, parse_date, parse_date2
from datetime import datetime
class EventsSpider(FacebookSpider):
"""
Parse FB events, given a page (ne... | 0 | 0 | 2 | 0 | 2 | 0 |
tests/contrib/gp/test_conditional.py | nipunbatra/pyro | 4,959 | 3234723 | <reponame>nipunbatra/pyro<gh_stars>1000+
# Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
from collections import namedtuple
import pytest
import torch
import pyro
from pyro.contrib.gp.kernels import Matern52, WhiteNoise
from pyro.contrib.gp.util import conditional
from tests.c... | 0 | 0 | 0 | 0 | 0 | 0 |
vedastr/models/__init__.py | csmasters/vedastr | 475 | 3234734 | from .builder import build_model
from .model import GModel
from .registry import MODELS
| 0 | 0 | 0 | 0 | 0 | 0 |
scripts/generate_sketch_data.py | nonoesp/pixel2style2pixel | 2,450 | 3234744 | <filename>scripts/generate_sketch_data.py<gh_stars>1000+
from torchvision import transforms
from torchvision.utils import save_image
from torch.utils.serialization import load_lua
import os
import cv2
import numpy as np
"""
NOTE!: Must have torch==0.4.1 and torchvision==0.2.1
The sketch simplification model (sketch_ga... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/mappability.py | m5imunovic/rust-mdbg | 137 | 3234760 | import sys
import parse_sequences_file
k, l, kmer_to_seq, kmer_abundance = parse_sequences_file.parse(sys.argv[1])
#print(k,l)
nb_unique = len([kmer for kmer in kmer_abundance if kmer_abundance[kmer] == 1])
nb_distinct = len(kmer_abundance)
perc_only_once = 100.0*nb_unique / nb_distinct
print("percentage of distinc... | 0 | 0 | 0 | 0 | 0 | 0 |
testproj/todo/migrations/0003_pack.py | by-gramm/drf-yasg | 2,788 | 3234787 | <filename>testproj/todo/migrations/0003_pack.py
# Generated by Django 2.1.5 on 2019-04-01 00:28
from decimal import Decimal
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('todo', '0002_todotree'),
]
operations = [
migrations.CreateModel... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_losses.py | stjordanis/QMLT | 117 | 3234816 | <reponame>stjordanis/QMLT
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2018 Xanadu Quantum Technologies 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.apa... | 0 | 0 | 0 | 0 | 0 | 0 |
src/tests/ftest/datamover/obj_large_posix.py | fedepad/daos | 429 | 3234833 | <reponame>fedepad/daos<gh_stars>100-1000
#!/usr/bin/python
'''
(C) Copyright 2020-2021 Intel Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent
'''
from data_mover_test_base import DataMoverTestBase
# pylint: disable=too-many-ancestors
class DmvrObjLargePosix(DataMoverTestBase):
"""Test class Descript... | 0 | 0 | 0 | 0 | 0 | 0 |
exp/cips3d/scripts/train.py | zihangJiang/CIPS-3D | 308 | 3234835 | from __future__ import annotations
from PIL import Image
import collections
import shutil
import traceback
from functools import partial
import pprint
import logging
import argparse
import os
import numpy as np
import math
from tqdm import tqdm
import copy
from einops import repeat, rearrange
import torch
import torch... | 2 | 2 | 0 | 0 | 4 | 0 |
loopchain/blockchain/transactions/v3/transaction.py | windies21/loopchain | 105 | 3234847 | from dataclasses import dataclass
from typing import Union
from loopchain.blockchain.types import Address, ExternalAddress
from loopchain.blockchain.transactions import Transaction as BaseTransition
@dataclass(frozen=True)
class Transaction(BaseTransition):
from_address: ExternalAddress
to_address: Address
... | 0 | 2 | 9 | 0 | 11 | 0 |
saw-remote-api/python/tests/saw/test_llvm_pointer.py | msaaltink/saw-script | 411 | 3234848 | from pathlib import Path
import unittest
from saw_client import *
from saw_client.llvm import Contract, cryptol, void, i8, ptr_ty
class FContract(Contract):
def specification(self):
x = self.alloc(ptr_ty(i8))
self.execute_func(x)
p = self.alloc(i8)
self.points_to(x, p)
se... | 0 | 0 | 0 | 0 | 0 | 0 |
WebMirror/management/rss_parser_funcs/feed_parse_extractWateriftWordpressCom.py | fake-name/ReadableWebProxy | 193 | 3234854 | from __future__ import annotations
def extractWateriftWordpressCom(item) -> bool | object | None:
'''
Parser for 'waterift.wordpress.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('<NAME>',... | 0 | 1 | 0 | 0 | 1 | 0 |
PokerRL/game/_/rl_env/base/_PokerPlayer.py | MAWUT0R/PokerRL | 247 | 3234855 | <filename>PokerRL/game/_/rl_env/base/_PokerPlayer.py<gh_stars>100-1000
# Copyright (c) 2019 <NAME>
import numpy as np
class PokerPlayer:
"""
Holds information about the player state in a PokerEnv and gives an interface to modify player variables.
"""
def __init__(self, seat_id, poker_env, is_evalua... | 0 | 0 | 0 | 0 | 0 | 0 |
python/ql/test/query-tests/Security/lib/cherrypy/__init__.py | vadi2/codeql | 4,036 | 3234862 |
from __future__ import annotations
from ._helper import expose, popargs, url
class _ThreadLocalProxy(object):
def __getattr__(self, name):
pass
request = _ThreadLocalProxy('request')
response = _ThreadLocalProxy('response')
def quickstart(root: object | None=None, script_name: str='', config: object |... | 3 | 0 | 0 | 0 | 3 | 0 |
tests/unit/pypyr/steps/debug_test.py | mofm/pypyr | 261 | 3234900 | <reponame>mofm/pypyr
"""debug.py unit tests."""
import datetime
import logging
from collections import OrderedDict
from unittest.mock import call, patch
from pypyr.context import Context
import pypyr.steps.debug as debug
from pypyr.dsl import Jsonify, PyString, SicString
from tests.common.utils import patch_logger
de... | 0 | 0 | 0 | 0 | 0 | 0 |
egs/iemocap/emo/v1/local/python/helper.py | didichuxing/delta | 1,442 | 3234928 | #from
#https://github.com/zh794390558/IEMOCAP-Emotion-Detection
from __future__ import annotations
import os
import csv
import wave
import sys
import numpy as np
import pandas as pd
import glob
from tensorflow.keras.preprocessing.text import text_to_word_sequence
def split_wav(wav, emotions) -> object:
(nchannel... | 5 | 8 | 0 | 0 | 13 | 0 |
paas-ce/paas/esb/esb/routers.py | renmcc/bk-PaaS | 767 | 3234996 | <reponame>renmcc/bk-PaaS
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not u... | 0 | 0 | 0 | 0 | 0 | 0 |
paddleaudio/features/window.py | JiehangXie/PaddleSpeech | 1,540 | 3235011 | # Copyright (c) 2021 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 applic... | 0 | 0 | 0 | 0 | 0 | 1 |
lib/model/utils/vis_3d_utils.py | Liang-ZX/Stereo-Mask-RCNN | 681 | 3235023 |
"""Detection visualizing.
This file helps visualize 3D detection result in 2D image format
"""
import csv
import time
import argparse
import os
import sys
import numpy as np
import os.path
import cv2
import math as m
import torch
from model.utils import kitti_utils
def Space2Image(P0, pts3) -> object:
pts2_norm... | 12 | 5 | 0 | 0 | 17 | 0 |
tests/test_question_handler.py | Exaphis/HackQ-Trivia | 120 | 3235077 | import asyncio
import unittest
from hackq_trivia.question_handler import QuestionHandler
class MyTestCase(unittest.TestCase):
async def setUpAsync(self):
self.qh = QuestionHandler()
def setUp(self) -> None:
self.loop = asyncio.get_event_loop()
self.loop.run_until_complete(self.setUpA... | 0 | 2 | 0 | 0 | 2 | 0 |
paper_experiments/utils/linear_assignment.py | noskill/JRMOT_ROS | 112 | 3235093 | # vim: expandtab:ts=4:sw=4
from __future__ import annotations
from __future__ import absolute_import
import numpy as np
from sklearn.utils.linear_assignment_ import linear_assignment
import EKF
import pdb
from mbest_ilp import new_m_best_sol
from multiprocessing import Pool
from functools import partial
#from mbest_ilp... | 18 | 8 | 0 | 0 | 26 | 0 |
sklearn_porter/__init__.py | midhunexeter/sklearn-porter | 1,197 | 3235100 | # -*- coding: utf-8 -*-
from os.path import abspath
from os.path import dirname
from os.path import exists
from os.path import join
from json import load
from sklearn_porter.Porter import Porter
def _load_meta(path) -> object:
"""
Load meta data about this package from file pypi.json.
:param path: The p... | 0 | 1 | 0 | 0 | 1 | 0 |
bootstrapvz/providers/oracle/tasks/image.py | qqshfox/bootstrap-vz | 207 | 3235113 | from bootstrapvz.base import Task
from bootstrapvz.common import phases
from bootstrapvz.common.tasks import image
from bootstrapvz.common.tools import log_check_call
import os
class CreateImageTarball(Task):
description: str = 'Creating tarball with image'
phase = phases.image_registration
predecessors: ... | 0 | 0 | 8 | 0 | 8 | 0 |
mlcomp/worker/executors/click.py | megachester/mlcomp | 166 | 3235117 | import importlib
import sys
from os import getcwd
from os.path import join
from mlcomp.worker.executors import Executor
@Executor.register
class Click(Executor):
def __init__(self, module: str, command: str = None, **kwargs):
super().__init__(**kwargs)
self.module = module
self.command =... | 2 | 0 | 0 | 0 | 2 | 0 |
tools/common/match.py | dmsteck/Fusion360GalleryDataset | 193 | 3235127 | from __future__ import annotations
"""
Match Fusion 360 entities to ids
"""
import adsk.core
import adsk.fusion
import deserialize
import name
def sketch_by_name(sketch_name, sketches: object | None=None) -> object:
"""Return a sketch with a given name"""
app = adsk.core.Application.get()
design = ad... | 4 | 7 | 0 | 0 | 11 | 0 |
websploit/modules/__init__.py | albiahbi/websploit | 803 | 3235129 | <filename>websploit/modules/__init__.py
import os
import pkgutil
from websploit.core.utils import CPrint
cp = CPrint()
__all__ = list(module for _, module, _ in pkgutil.iter_modules([os.path.dirname(__file__)]))
def all_modules():
"""print available modules in nice way"""
cp.green(f"{'Modules':<20}\t{'Descri... | 0 | 0 | 0 | 0 | 0 | 0 |
src/tool/hpcrun/sample-sources/make-cuda-wrappers.py | Paul-Ferrell/hpctoolkit | 281 | 3235138 | #!/usr/local/bin/python
# -*- python -*-
#
# HPCToolkit MPI Profiler
# this script is adapted from mpiP MPI Profiler ( http://mpip.sourceforge.net/ )
#
# Please see COPYRIGHT AND LICENSE information at the end of this file.
#
#
# make-wrappers.py -- parse the mpi prototype file and generate a
# series o... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter 03/3.02.py | ACsBlack/Tkinter-GUI-Application-Development-Blueprints-Second-Edition | 120 | 3235189 | """
Code illustration: 3.02
- Defining & Initializing the Data Structure
Chapter 3 : Programmable Drum Machine
Tkinter GUI Application Development Blueprints
"""
from tkinter import Tk
PROGRAM_NAME = ' Explosion Drum Machine '
MAX_NUMBER_OF_PATTERNS = 10
MAX_NUMBER_OF_DRUM_SAMPLES = 5
INITIAL_NUMBER_OF_UNITS = 4... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_github.py | trathborne/nvchecker | 320 | 3235207 | # MIT licensed
# Copyright (c) 2013-2020 lilydjwg <<EMAIL>>, et al.
import re
import pytest
pytestmark = [pytest.mark.asyncio,
pytest.mark.needs_net,
pytest.mark.usefixtures('keyfile')]
async def test_github(get_version):
assert await get_version("example", {
"source": "githu... | 0 | 0 | 0 | 0 | 0 | 0 |
src/cactus/progressive/schedule.py | thiagogenez/cactus | 209 | 3235221 | #!/usr/bin/env python3
#Copyright (C) 2011 by <NAME>
#
#Released under the MIT license, see LICENSE.txt
from __future__ import annotations
""" Schedule jobs based on the dependencies between their associated
events. These dependencies are based 1, on the phylogeny and 2,
on outgroups. The input is a DAG, the output... | 1 | 10 | 0 | 3 | 14 | 0 |
rpython/rlib/test/test_rposix_scandir.py | nanjekyejoannah/pypy | 333 | 3235251 | <gh_stars>100-1000
import sys, os
import py
from rpython.rlib import rposix_scandir
if sys.platform == 'win32':
basedir = os.environ.get('LOCALAPPDATA', r'C:\users')
funcs = [rposix_scandir.get_name_bytes, rposix_scandir.get_name_unicode]
else:
basedir = '/'
funcs = [rposix_scandir.get_name_bytes,]
cl... | 0 | 0 | 0 | 0 | 0 | 0 |
homeassistant/components/swiss_public_transport/__init__.py | domwillcode/home-assistant | 30,023 | 3235263 | <gh_stars>1000+
"""The swiss_public_transport component."""
| 0 | 0 | 0 | 0 | 0 | 0 |
django_apscheduler/admin.py | calledbert/django-apscheduler | 331 | 3235280 | <reponame>calledbert/django-apscheduler
import time
from datetime import timedelta
from apscheduler import events
from apscheduler.schedulers.background import BackgroundScheduler
from django.conf import settings
from django.contrib import admin, messages
from django.db.models import Avg
from django.utils import timez... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/roots/test-extensions/read_serial.py | samdoran/sphinx | 4,973 | 3235288 | <filename>tests/roots/test-extensions/read_serial.py
def setup(app):
return {
'parallel_read_safe': False
}
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/helpers.py | AlessioMorale/luma.core | 114 | 3235304 | # -*- coding: utf-8 -*-
# Copyright (c) 2017-2020 <NAME> and contributors
# See LICENSE.rst for details.
"""
Test helpers.
"""
import platform
from pathlib import Path
import pytest
from PIL import ImageChops, ImageFont
from unittest.mock import mock_open
rpi_gpio_missing = f'RPi.GPIO is not supported on this plat... | 1 | 8 | 0 | 0 | 9 | 0 |
test/programytest/utils/files/test_config.py | cdoebler1/AIML2 | 345 | 3235305 | <reponame>cdoebler1/AIML2<filename>test/programytest/utils/files/test_config.py
import unittest
from programy.utils.files.filewriter import FileWriterConfiguration
class FileWriterConfigurationTests(unittest.TestCase):
def test_init_defaults(self):
config = FileWriterConfiguration("filename.txt")
... | 0 | 0 | 0 | 0 | 0 | 0 |
scanner/controller/userview.py | UgOrange/onlinetools | 1,207 | 3235326 | from ..app import Blueprint
from scanner.core.plugincall import callfunction
user = Blueprint('user', __name__)
plugin=callfunction()
@user.route("/home",methods=["get","post"])
def home() -> object:
return str(plugin.pocscan("http://cn.changhong.com/"))
| 0 | 1 | 0 | 0 | 1 | 0 |
mobile_deployment/pytorch/InvBlock/models/imagenet/mobilenetv2_high_dim_group.py | zhoudaquan/rethinking_bottleneck_structure_code_release | 153 | 3235345 | <gh_stars>100-1000
"""
Creates a MobileNetV2 Model as defined in:
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>. (2018).
MobileNetV2: Inverted Residuals and Linear Bottlenecks
arXiv preprint arXiv:1801.04381.
import from https://github.com/tonylins/pytorch-mobilenet-v2
"""
import torch.nn as nn
import math
__all__ = ['mobil... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/hyperpython/hp03.py | jviide/htm.py | 112 | 3235354 | <filename>docs/hyperpython/hp03.py
from hyperpython import h
from htm import htm
# start
@htm
def html(tag, props, children):
if callable(tag):
return tag()
return h(tag, props, children)
def Heading():
return html('<header>Hello World</header>')
result03 = str(html("""
<{Heading}><//>
"... | 0 | 0 | 0 | 0 | 0 | 0 |
BiliMerge/BiliMergeFlv.py | Vespa314/bilibili-api | 1,460 | 3235377 | #!/usr/bin/env python
import subprocess
import os
import sys
import glob
def merge(folder):
flv_list = sorted(glob.glob('{folder}/*.flv'.format(folder = folder)))
fid = open('%s/filelist.txt' % (folder), 'w')
for idx in flv_list:
fid.write("file '%s/%d.flv'\n" % (folder, idx))
fid.close()
... | 0 | 0 | 0 | 0 | 0 | 0 |
pptx/oxml/shapes/autoshape.py | kckaiwei/python-pptx | 1,429 | 3235389 | <reponame>kckaiwei/python-pptx<gh_stars>1000+
# encoding: utf-8
"""
lxml custom element classes for shape-related XML elements.
"""
from __future__ import absolute_import
from pptx.enum.shapes import MSO_AUTO_SHAPE_TYPE, PP_PLACEHOLDER
from pptx.oxml import parse_xml
from pptx.oxml.ns import nsdecls
from pptx.oxml.s... | 0 | 0 | 0 | 0 | 0 | 0 |
mssqlcli/mssqltoolsservice/externals.py | leonqli/mssql-cli | 1,237 | 3235390 | from __future__ import print_function
import os
import sys
import tarfile
import zipfile
from future.standard_library import install_aliases
import requests
import utility
install_aliases()
SQLTOOLSSERVICE_RELEASE = "v3.0.0-release.72"
SQLTOOLSSERVICE_BASE = os.path.join(utility.ROOT_DIR, 'sqltoolsservice/')
# Sup... | 0 | 0 | 0 | 0 | 0 | 0 |
barf/tools/cg/cg.py | IMULMUL/barf-project | 1,395 | 3235395 | <gh_stars>1000+
# Copyright (c) 2015, Fundacion Dr. <NAME>
# 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
# list o... | 0 | 0 | 0 | 0 | 0 | 0 |
dagda/cli/command/history_cli_parser.py | hoominkani/dagda | 947 | 3235408 | <gh_stars>100-1000
#
# Licensed to Dagda under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Dagda licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file e... | 0 | 0 | 0 | 0 | 0 | 0 |
search_engine_parser/core/__init__.py | justfly50/search-engine-parser | 276 | 3235458 | import search_engine_parser.core.engines
| 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | rozlana-g/FEDOT | 358 | 3235459 | import os
from os.path import dirname, join
from pathlib import Path
import setuptools
# The directory containing this file
HERE = os.path.abspath(os.path.dirname(__file__))
# The text of the README file
NAME = "fedot"
VERSION = "0.4.1"
AUTHOR = "NSS Lab"
SHORT_DESCRIPTION = "Evolutionary structural learning framewo... | 0 | 3 | 0 | 0 | 3 | 0 |
lib/modules/test/bad_coding3.py | JJTech0130/pypyjs-pwa | 195 | 3235475 | # coding: utf-8
print 2+2
| 0 | 0 | 0 | 0 | 0 | 0 |
lib/ops/collect_and_distribute_fpn_rpn_proposals.py | wjbKimberly/DetectAndTrack-wjb | 1,007 | 3235480 | <reponame>wjbKimberly/DetectAndTrack-wjb<filename>lib/ops/collect_and_distribute_fpn_rpn_proposals.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
from core.config import cfg
import modeling.FPN a... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/transfer.py | mrclay/fabric | 10,288 | 3235496 | <reponame>mrclay/fabric
try:
from invoke.vendor.six import StringIO
except ImportError:
from six import StringIO
from mock import Mock, call, patch
from pytest_relaxed import raises
from pytest import skip # noqa
from paramiko import SFTPAttributes
from fabric import Connection
from fabric.transfer import Tr... | 0 | 0 | 0 | 0 | 0 | 0 |
Programming Languages/Python/Theory/100_Python_Challenges/Section _1_Basic_Coding_Exercises/21. fibonacci series.py | jaswinder9051998/Resources | 101 | 3235524 | <gh_stars>100-1000
"""
Write a function that randomly chooses any number 'n' from 5 to 10 (inclusive) and then generates a Fibonacci sequence until 'n'.
The sequence should be returned in the form of a list.
Example:
for n = 5,
output_sequence = [0,1,1,2,3]
"""
import random
def Fibonacci():
n = random.randin... | 0 | 0 | 0 | 0 | 0 | 0 |
django_th/views_fbv.py | Leopere/django-th | 1,069 | 3235537 | <reponame>Leopere/django-th<filename>django_th/views_fbv.py<gh_stars>1000+
# coding: utf-8
from __future__ import unicode_literals
import arrow
# django
from django.conf import settings
from django.contrib import messages
from django.core.cache import caches
from django.core import management
from django.http import Ht... | 0 | 0 | 0 | 0 | 0 | 0 |
elastichq/api/status.py | billboggs/elasticsearch-HQ | 2,026 | 3235553 | <reponame>billboggs/elasticsearch-HQ
"""
.. module:: status
.. moduleauthor:: <NAME> <<EMAIL>>
"""
import json
from urllib.parse import unquote_plus
from flask import current_app, url_for
from flask_restful import Resource
from elastichq.service import HQService
from . import api
from ..common.api_response import AP... | 0 | 0 | 0 | 0 | 0 | 0 |
OpenAttack/data/nltk_wordnet.py | e-tornike/OpenAttack | 444 | 3235556 | <filename>OpenAttack/data/nltk_wordnet.py
"""
:type: nltk.WordNetCorpusReader
:Size: 10.283MB
Model files for wordnet in nltk.
`[page] <http://wordnet.princeton.edu/>`__
"""
from OpenAttack.utils import make_zip_downloader
NAME = "TProcess.NLTKWordNet"
URL = "/TAADToolbox/wordnet.zip"
DOWNLOAD = make_zip_downloader(... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmarks/bench_comparing.py | LuciaBaldassini/recordlinkage | 641 | 3235595 | <filename>benchmarks/bench_comparing.py
from __future__ import absolute_import, division, print_function
import recordlinkage as rl
from recordlinkage.datasets import load_febrl1, load_febrl4
class CompareRecordLinkage(object):
timeout = 30 * 60
def setup(self):
# download data
self.A, sel... | 0 | 0 | 0 | 0 | 0 | 0 |
pipeline/python/ion/utils/blockprocessing.py | konradotto/TS | 125 | 3235611 | #!/usr/bin/python
# Copyright (C) 2012 Ion Torrent Systems, Inc. All Rights Reserved
from __future__ import annotations
__version__ = filter(str.isdigit, "$Revision$")
import os
import sys
import ConfigParser
import StringIO
import datetime
import shutil
import socket
import subprocess
import time
import traceback
im... | 2 | 8 | 0 | 0 | 10 | 0 |
shop/cascade/catalog.py | 2000-ion/TIDPP-Lab3 | 2,160 | 3235639 | <gh_stars>1000+
from django.contrib.admin import StackedInline
from django.forms import fields, widgets
from django.template.loader import select_template
from django.utils.translation import gettext_lazy as _, gettext
from entangled.forms import EntangledModelFormMixin, EntangledModelForm
from cms.plugin_pool import... | 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.