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 |
|---|---|---|---|---|---|---|---|---|---|---|
doi2bib/crossref.py | Pandinosaurus/doi2bib | 124 | 3291353 | """
crossref integration
===========================
The core module
"""
from __future__ import unicode_literals, print_function, absolute_import
from builtins import str
import requests
import bibtexparser
import re
bare_url = "http://api.crossref.org/"
def get_bib(doi) -> tuple[object, object]:
"""
Parame... | 2 | 3 | 0 | 0 | 5 | 0 |
pywren/jobrunner/jobrunner.py | JoostvDoorn/pywren | 630 | 3291405 | #
# Copyright 2018 PyWren 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | 0 | 2 | 0 | 0 | 2 | 0 |
examples/pxScene2d/external/libnode-v6.9.0/tools/comtypes/test/test_excel.py | madanagopaltcomcast/pxCore | 212 | 3291409 | <reponame>madanagopaltcomcast/pxCore
# -*- coding: latin-1 -*-
import unittest
import comtypes.test
comtypes.test.requires("ui")
import datetime
from comtypes.client import CreateObject
xlRangeValueDefault = 10
xlRangeValueXMLSpreadsheet = 11
xlRangeValueMSPersistXML = 12
class Test(unittest.TestCase):
def te... | 0 | 0 | 0 | 0 | 0 | 0 |
egg/zoo/simclr/archs.py | vengalraoguttha/EGG | 254 | 3291446 | <filename>egg/zoo/simclr/archs.py
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch.nn as nn
import torchvision
def get_vision_module(encoder_arch: str):
"""Loads ResNet enco... | 0 | 0 | 0 | 0 | 0 | 0 |
python-packages/erasure-client/tests/test_contracts.py | ndharasz/erasure-protocol | 152 | 3291458 | <filename>python-packages/erasure-client/tests/test_contracts.py
import unittest
from erasure_lib.contracts import _make_contract
from web3 import Web3, WebsocketProvider
class TestContractHelpers(unittest.TestCase):
def test_make_contract(self):
web3 = Web3(WebsocketProvider(endpoint_uri="localhost:85... | 0 | 0 | 0 | 0 | 0 | 0 |
skyperious/main.py | suurjaak/Skyperious | 209 | 3291489 | <reponame>suurjaak/Skyperious
# -*- coding: utf-8 -*-
"""
Skyperious main program entrance: launches GUI application or executes command
line interface, handles logging and status calls.
------------------------------------------------------------------------------
This file is part of Skyperious - Skype chat hi... | 0 | 0 | 0 | 0 | 0 | 0 |
panel/tasks/inmemory.py | freejooo/vigilio | 137 | 3291498 | <filename>panel/tasks/inmemory.py<gh_stars>100-1000
import logging
import os
import sys
from typing import Any, Optional
import redis
from django.conf import settings
logger = logging.getLogger(__name__)
def get_redis_url() -> Optional[str]:
if not hasattr(settings, "CELERY_RESULT_BACKEND"):
logger.err... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/sql_db/tests/test_checks.py | dimagilg/commcare-hq | 471 | 3291500 | from django.test import override_settings
from nose.tools import assert_equal, assert_in
from corehq.sql_db import check_standby_configs
def test_check_standby_configs():
databases = {
'default': {},
'other': {},
's1': {
'HQ_ACCEPTABLE_STANDBY_DELAY': 1
},
's2'... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/render_class_view.py | Gopalbhavesh/3D-IWGAN | 192 | 3291502 | <reponame>Gopalbhavesh/3D-IWGAN
#!/usr/bin/python
import os.path as osp
import sys
import argparse
import os, tempfile, glob, shutil
BASE_DIR = osp.dirname(__file__)
sys.path.append(osp.join(BASE_DIR,'../'))
from global_variables import *
parser = argparse.ArgumentParser(description='Render Model Images of a certai... | 0 | 0 | 0 | 0 | 0 | 0 |
test/unit/test_model_config.py | jankytara2/dbt | 3,156 | 3291510 | <gh_stars>1000+
from dataclasses import dataclass, field
from dbt.dataclass_schema import dbtClassMixin
from typing import List, Dict
import pytest
from dbt.contracts.graph.model_config import MergeBehavior, ShowBehavior, CompareBehavior
@dataclass
class ThingWithMergeBehavior(dbtClassMixin):
default_behavior: in... | 0 | 0 | 0 | 0 | 0 | 0 |
moe/tests/bandit/linkers_test.py | dstoeckel/MOE | 966 | 3291511 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""Tests that linkers contain all possible types defined in constants."""
from moe.bandit.constant import BANDIT_ENDPOINTS, EPSILON_SUBTYPES, UCB_SUBTYPES
from moe.bandit.linkers import BANDIT_ENDPOINTS_TO_SUBTYPES, EPSILON_SUBTYPES_TO_BANDIT_METHODS, UCB_SUBTYPES_TO_BANDIT_ME... | 0 | 0 | 0 | 0 | 0 | 0 |
pipeline/python/ion/reports/uploadMetrics.py | konradotto/TS | 125 | 3291512 | # Copyright (C) 2010 Ion Torrent Systems, Inc. All Rights Reserved
from __future__ import annotations
import sys
import os
import json
import glob
import traceback
sys.path.append("/opt/ion/")
os.environ["DJANGO_SETTINGS_MODULE"] = "iondb.settings"
from django.db import connection, transaction, IntegrityError
from dj... | 1 | 7 | 0 | 0 | 8 | 0 |
nova/conf/guestfs.py | zjzh/nova | 1,874 | 3291525 | <gh_stars>1000+
# Copyright 2015 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
#
... | 0 | 0 | 0 | 0 | 0 | 0 |
dalib/modules/entropy.py | billzhonggz/Transfer-Learning-Library | 1,474 | 3291526 | <filename>dalib/modules/entropy.py
"""
@author: <NAME>
@contact: <EMAIL>
"""
import torch
def entropy(predictions: torch.Tensor, reduction='none') -> torch.Tensor:
r"""Entropy of prediction.
The definition is:
.. math::
entropy(p) = - \sum_{c=1}^C p_c \log p_c
where C is number of classes.
... | 0 | 0 | 0 | 0 | 0 | 0 |
discovery-provider/alembic/versions/5add54e23282_add_stems_table.py | Tenderize/audius-protocol | 429 | 3291585 | """add stems support
Revision ID: 5add54e23282
Revises: b3<PASSWORD>
Create Date: 2020-05-01 16:36:34.237413
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "5add54e23282"
down_revision = "b3084b<PASSWORD>"
branch_labels = None
depends_on = None
def upgrade()... | 0 | 0 | 0 | 0 | 0 | 0 |
simplemonitor/Monitors/file.py | cgroschupp/simplemonitor | 373 | 3291598 | <gh_stars>100-1000
"""
File-based monitors for SimpleMonitor
"""
import os
import os.path
import time
from .monitor import Monitor, register
@register
class MonitorBackup(Monitor):
"""
Monitor Veritas BackupExec
May be out of date
"""
monitor_type = "backup"
filename = os.path.join(
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/autotiler_v3/DSP_Libraries/LUT_Tables/gen_scripts/GenMFCCLUT.py | GreenWaves-Technologies/gap_sdk | 118 | 3291616 | <filename>tools/autotiler_v3/DSP_Libraries/LUT_Tables/gen_scripts/GenMFCCLUT.py
import json
import numpy as np
import math
import sys
import argparse
from SetupLUT import FP2FIX, SetupTwiddlesLUT, SetupSwapTable, SetupSwapTableR4, SetupDCTTable, SetupLiftCoeff, SetupTwiddlesRFFT, DCT_TWIDDLE_DYN, GenMelFilterBanksCode
... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/core/minos-microservice-aggregate/minos/aggregate/events/repositories/database/__init__.py | minos-framework/minos-python | 247 | 3291619 | <filename>packages/core/minos-microservice-aggregate/minos/aggregate/events/repositories/database/__init__.py
from .factories import (
EventDatabaseOperationFactory,
)
from .impl import (
DatabaseEventRepository,
)
| 0 | 0 | 0 | 0 | 0 | 0 |
slack_sdk/oauth/token_rotation/rotator.py | priya1puresoftware/python-slack-sdk | 2,486 | 3291628 | <gh_stars>1000+
from time import time
from typing import Optional
from slack_sdk.errors import SlackApiError, SlackTokenRotationError
from slack_sdk.web import WebClient
from slack_sdk.oauth.installation_store import Installation, Bot
class TokenRotator:
client: WebClient
client_id: str
client_secret: st... | 0 | 0 | 0 | 0 | 0 | 0 |
certbot-compatibility-test/certbot_compatibility_test/__init__.py | tsrivishnu/certbot | 16,789 | 3291659 | <reponame>tsrivishnu/certbot
"""Certbot compatibility test"""
| 0 | 0 | 0 | 0 | 0 | 0 |
extensions/RichardHe.you-complete-me-1.0.36/ycmd/ycmd/tests/detailed_diagnostics_test.py | Sunshengjin/RoboWare-Studio | 239 | 3291663 | <gh_stars>100-1000
# Copyright (C) 2016 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | 0 | 0 | 0 | 0 | 0 | 0 |
Introducing_Gemma_M0/Gemma_DigitalIO/code.py | gamblor21/Adafruit_Learning_System_Guides | 665 | 3291677 | <filename>Introducing_Gemma_M0/Gemma_DigitalIO/code.py
# CircuitPython IO demo #1 - General Purpose I/O
import time
import board
from digitalio import DigitalInOut, Direction, Pull
led = DigitalInOut(board.D13)
led.direction = Direction.OUTPUT
button = DigitalInOut(board.D2)
button.direction = Direction.INPUT
butto... | 0 | 0 | 0 | 0 | 0 | 0 |
hc/front/forms.py | gdepeyrot/healthchecks | 4,813 | 3291706 | from __future__ import annotations
from datetime import timedelta as td
import json
import re
from urllib.parse import quote, urlencode
from django import forms
from django.forms import URLField
from django.conf import settings
from django.core.exceptions import ValidationError
from hc.front.validators import (
Cr... | 0 | 17 | 12 | 0 | 29 | 0 |
jarviscli/plugins/location.py | WWFelina/Jarvis | 2,605 | 3291709 | import json
import requests
from plugin import plugin, require
@require(network=True)
@plugin('location')
def location(jarvis, s):
"""It gives you your current location"""
send_url = "http://api.ipstack.com/check?access_key=<KEY>"
geo_req = requests.get(send_url)
geo_json = json.loads(geo_req.text)
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_frame.py | jdk5115/pygubu | 1,716 | 3291723 | <reponame>jdk5115/pygubu
# encoding: utf8
from __future__ import print_function
import os
import sys
import unittest
try:
import tkinter as tk
import tkinter.ttk as ttk
except:
import Tkinter as tk
import ttk
pygubu_basedir = os.path.abspath(os.path.dirname(
os.path.dirname(os.path... | 0 | 0 | 0 | 0 | 0 | 0 |
numba/tests/test_import.py | auderson/numba | 6,620 | 3291733 | <reponame>auderson/numba
import unittest
from numba.tests.support import TestCase, run_in_subprocess
class TestNumbaImport(TestCase):
"""
Test behaviour of importing Numba.
"""
def test_laziness(self):
"""
Importing top-level numba features should not import too many modules.
... | 0 | 0 | 0 | 0 | 0 | 0 |
model/attention.py | Chen-Wang-CUHK/fast_abs_rl | 636 | 3291739 | <reponame>Chen-Wang-CUHK/fast_abs_rl
""" attention functions """
from torch.nn import functional as F
def dot_attention_score(key, query):
"""[B, Tk, D], [(Bs), B, Tq, D] -> [(Bs), B, Tq, Tk]"""
return query.matmul(key.transpose(1, 2))
def prob_normalize(score, mask):
""" [(...), T]
user should handl... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/testprofiles/tests.py | christopherpickering/djangosaml2 | 155 | 3291762 | <reponame>christopherpickering/djangosaml2<filename>tests/testprofiles/tests.py
# Copyright (C) 2012 <NAME> (<EMAIL>)
# Copyright (C) 2011-2012 Yaco Sistemas (http://www.yaco.es)
# Copyright (C) 2010 <NAME> <<EMAIL>>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except ... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/domain/RefundRoyaltyResult.py | snowxmas/alipay-sdk-python-all | 213 | 3291767 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
import json
from alipay.aop.api.constant.ParamConstants import *
class RefundRoyaltyResult(object):
def __init__(self):
self._refund_amount: None = None
self._result_code: None = None
self._royalty_type: Non... | 0 | 9 | 0 | 7 | 16 | 0 |
redun/tests/test_scheduler_subrun.py | fl65inc/redun | 303 | 3291813 | <gh_stars>100-1000
import ast
import os
from typing import cast
from unittest.mock import patch
import pytest
import sqlalchemy
from redun.cli import get_config_dir, setup_scheduler
from redun.executors.local import LocalExecutor
from redun.scheduler import Config, DryRunResult, Scheduler, subrun
from redun.task impo... | 0 | 0 | 0 | 0 | 0 | 0 |
onnx/backend/test/case/node/clip.py | rajeevsrao/onnx | 117 | 3291817 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class Clip(Base):
@staticmethod
def export(): # type: () -> None
... | 0 | 0 | 0 | 0 | 0 | 0 |
fsspec/implementations/tests/test_hdfs.py | gadomski/filesystem_spec | 306 | 3291828 | from pathlib import Path
import pytest
import fsspec
pyarrow = pytest.importorskip("pyarrow")
basedir = "/tmp/test-fsspec"
data = b"\n".join([b"some test data"] * 1000)
@pytest.fixture
def hdfs(request):
try:
hdfs = pyarrow.hdfs.HadoopFileSystem()
except IOError:
pytest.skip("No HDFS confi... | 0 | 0 | 0 | 0 | 0 | 0 |
Python3/1296.py | rakhi2001/ecom7 | 854 | 3291863 | __________________________________________________________________________________________________
sample 376 ms submission
from collections import Counter
import heapq
class Solution:
def isPossibleDivide(self, nums: List[int], k: int) -> bool:
sm =sum(nums)
ln = len(nums)
if ln%k==0 and ((... | 0 | 0 | 0 | 0 | 0 | 0 |
plugin/CustomerSupportArchive/autoCal/tools/stats.py | iontorrent/TS | 125 | 3291864 | from __future__ import annotations
from scipy.stats import scoreatpercentile
import re
import numpy as np
import numpy.ma as ma
import matplotlib.pyplot as plt
try:
from . import plotting
except ImportError:
print( 'WARNING: unable to import "plotting" in stats. some functions may be disabled' )
from . import... | 26 | 24 | 0 | 0 | 50 | 0 |
pgoapi/protos/pogoprotos/settings/master/item/incense_attributes_pb2.py | aroo135/pgoapi | 842 | 3291865 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/settings/master/item/incense_attributes.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | 0 | 0 | 0 | 0 | 0 | 0 |
rpython/translator/simplify.py | m4sterchain/mesapy | 381 | 3291919 | from __future__ import annotations
"""Flow Graph Simplification
'Syntactic-ish' simplifications on a flow graph.
simplify_graph() applies all simplifications defined in this file.
"""
import py
from collections import defaultdict
from rpython.tool.algo.unionfind import UnionFind
from rpython.flowspace.model import (... | 6 | 28 | 0 | 1 | 35 | 0 |
zoo/resnet/resnet_cifar10_v1_c.py | Pandinosaurus/keras-idiomatic-programmer | 833 | 3291925 | <filename>zoo/resnet/resnet_cifar10_v1_c.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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | 0 | 0 | 0 | 0 | 0 | 0 |
amazon_problems/problem_11.py | loftwah/Daily-Coding-Problem | 129 | 3291930 | <filename>amazon_problems/problem_11.py
"""This problem was asked by Amazon.
Given a node in a binary tree, return the next bigger element, also known as the inorder successor.
For example, the inorder successor of 22 is 30.
10
/ \
5 30
/ \
22 35
You can assume each node has a parent pointer.
"... | 0 | 0 | 0 | 0 | 0 | 0 |
deeppavlov/models/go_bot/nlg/dto/batch_nlg_response.py | xbodx/DeepPavlov | 5,893 | 3291935 | from typing import Container
from deeppavlov.models.go_bot.nlg.dto.nlg_response_interface import NLGResponseInterface
class BatchNLGResponse:
def __init__(self, nlg_responses: Container[NLGResponseInterface]):
self.responses: Container[NLGResponseInterface] = nlg_responses
| 1 | 0 | 0 | 1 | 2 | 0 |
tests/test_config.py | jmsking/pykube | 116 | 3291951 | """
pykube.config unittests
"""
import os
from pathlib import Path
from unittest.mock import MagicMock
import pytest
from . import TestCase
from pykube import config
from pykube import exceptions
BASEDIR = Path("tests")
GOOD_CONFIG_FILE_PATH = BASEDIR / "test_config.yaml"
DEFAULTUSER_CONFIG_FILE_PATH = BASEDIR / "t... | 0 | 1 | 0 | 0 | 1 | 0 |
dynamo/simulation/Gillespie.py | xing-lab-pitt/dynamo-release | 236 | 3292001 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from __future__ import annotations
"""
Created on Wed Jan 30 11:21:25 2019
@author: xqiu
"""
from .gillespie_utils import *
from .bif_os_inclusive_sim import sim_diff, sim_osc, simulate, osc_diff_dup
import pandas as pd
import scipy.sparse
import anndata
# deterministi... | 14 | 1 | 0 | 0 | 15 | 0 |
webrecorder/webrecorder/models/base.py | ssteo/webrecorder | 1,217 | 3292010 | from __future__ import annotations
"""
:synopsis: Interface classes to Redis components, such as, e.g., ordered lists.
"""
from datetime import datetime
from webrecorder.utils import get_bool, get_new_id
# ============================================================================
class DupeNameException(Exception):... | 26 | 47 | 7 | 4 | 84 | 0 |
scripts/cython_code/state_test.py | vishalbelsare/crosscat | 207 | 3292012 | #
# Copyright (c) 2010-2016, MIT Probabilistic Computing Project
#
# Lead Developers: <NAME> and <NAME>
# Authors: <NAME>, <NAME>, <NAME>, <NAME>
# Research Leads: <NAME>, <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lic... | 0 | 0 | 0 | 0 | 0 | 0 |
v2/backend/commands/db.py | jonfairbanks/rtsp-nvr | 558 | 3292013 | <reponame>jonfairbanks/rtsp-nvr
import click
from flask import current_app
from flask.cli import with_appcontext
from flask_alembic.cli.click import cli as db_cli
from backend.utils.date import parse_datetime
# FIXME: document json file format, relationships
@db_cli.command()
@click.option('--reset/--no-reset', exp... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/core/minos-microservice-saga/minos/saga/executions/status.py | sorasful/minos-python | 247 | 3292038 | <reponame>sorasful/minos-python
from __future__ import (
annotations,
)
from enum import (
Enum,
)
from typing import (
Union,
)
class SagaStatus(Enum):
"""Saga Status class."""
Created = "created"
Running = "running"
Paused = "paused"
Finished = "finished"
Errored = "errored"
... | 0 | 0 | 0 | 0 | 0 | 0 |
rastervision_core/rastervision/core/data/vector_source/geojson_vector_source_config.py | theoway/raster-vision | 1,577 | 3292068 | from rastervision.core.data.vector_source.vector_source_config import (
VectorSourceConfig)
from rastervision.core.data.vector_source.geojson_vector_source import (
GeoJSONVectorSource)
from rastervision.pipeline.config import register_config, Field
@register_config('geojson_vector_source')
class GeoJSONVecto... | 0 | 1 | 2 | 0 | 3 | 0 |
Ryven/packages/auto_generated/binhex/nodes.py | tfroehlich82/Ryven | 2,872 | 3292078 |
from NENV import *
import binhex
class NodeBase(Node):
pass
class _Ignore_Deprecation_Warning_Node(NodeBase):
"""
"""
title: str = '_ignore_deprecation_warning'
type_: str = 'binhex'
init_inputs: list[object] = [
]
init_outputs: list[object] = [
NodeOutputBP(t... | 0 | 0 | 20 | 0 | 20 | 0 |
language-python-test/test/features/tail_call/enclosing_try.py | wbadart/language-python | 137 | 3292083 | <reponame>wbadart/language-python
def f(x):
try:
return g(x+1)
except:
print("caught exception")
print("after handler")
return x
def g(y):
return y / 0
print(f(12))
| 0 | 0 | 0 | 0 | 0 | 0 |
examples/Basic/gui_estimator.py | carez/pymeasure | 153 | 3292099 | <reponame>carez/pymeasure
"""
This example demonstrates how to make a graphical interface, and uses
a random number generator to simulate data so that it does not require
an instrument to use.
Run the program by changing to the directory containing this file and calling:
python gui.py
"""
import sys
import random
i... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/unit/sagemaker/test_serializers.py | LastRemote/sagemaker-python-sdk | 1,690 | 3292119 | # Copyright 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 accompan... | 0 | 6 | 0 | 0 | 6 | 0 |
tests/components/demo/conftest.py | MrDelik/core | 30,023 | 3292153 | """demo conftest."""
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
from tests.components.light.conftest import mock_light_profiles # noqa: F401
| 0 | 0 | 0 | 0 | 0 | 0 |
proplot/internals/texts.py | pratiman-91/proplot | 633 | 3292176 | <reponame>pratiman-91/proplot<gh_stars>100-1000
#!/usr/bin/env python3
"""
Utilities related to matplotlib text objects.
"""
import matplotlib.patheffects as mpatheffects
import matplotlib.text as mtext
from . import ic # noqa: F401
def _transfer_text(src, dest):
"""
Transfer the input text object propertie... | 0 | 0 | 0 | 0 | 0 | 0 |
common/src/stack/switch/command/list/switch/host/__init__.py | sammeidinger/stack | 123 | 3292195 | <filename>common/src/stack/switch/command/list/switch/host/__init__.py
# @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
#
# @rocks@
# Copyright (c) 2000 - 2010 The Regents of the University of C... | 0 | 0 | 0 | 0 | 0 | 0 |
env/lib/python3.8/site-packages/plotly/validators/layout/template/__init__.py | acrucetta/Chicago_COVI_WebApp | 11,750 | 3292214 | <filename>env/lib/python3.8/site-packages/plotly/validators/layout/template/__init__.py<gh_stars>1000+
import sys
if sys.version_info < (3, 7):
from ._layout import LayoutValidator
from ._data import DataValidator
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ ... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/system/base_mac_address/example_test.py | DCNick3/esp-idf | 480 | 3292258 | <gh_stars>100-1000
from __future__ import unicode_literals
from tiny_test_fw import Utility
import re
import ttfw_idf
@ttfw_idf.idf_example_test(env_tag='Example_GENERIC')
def test_examples_base_mac_address(env, extra_data):
dut = env.get_dut('base_mac_address', 'examples/system/base_mac_address')
dut.start_... | 0 | 0 | 0 | 0 | 0 | 0 |
plenum/test/pool_transactions/test_txn_pool_manager.py | andkononykhin/plenum | 148 | 3292259 | <filename>plenum/test/pool_transactions/test_txn_pool_manager.py
import pytest
from plenum.common.config_helper import PNodeConfigHelper
from plenum.test.test_node import TestNode
from stp_core.loop.eventually import eventually
from plenum.test.helper import sdk_send_random_and_check, assertExp
from plenum.common.tx... | 0 | 0 | 0 | 0 | 0 | 0 |
CI/astyle/astyle.py | Tophness/Arduino_Core_STM32 | 1,963 | 3292274 | # -*- coding: utf-8 -*-
# File name : astyle.py
# Author : <NAME> <<EMAIL>>
# Created : 11/16/2018
# Python Version :
# Requirements : Artistic Style Version 3.1
# Description : Launch astyle on found source files
import argparse
import os
import re
import ... | 0 | 0 | 0 | 0 | 0 | 0 |
tf_euler/python/dataflow/relation_dataflow.py | HuangLED/euler | 2,829 | 3292279 | # Copyright 2020 Alibaba Group Holding Limited. 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 ... | 1 | 3 | 0 | 0 | 4 | 0 |
python/pysvso/config/__init__.py | mfkiwl/SEMANTIC_VISUAL_SUPPORTED_ODEMETRY | 191 | 3292280 | <filename>python/pysvso/config/__init__.py
import sys
import os
pwd = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.abspath(pwd + ""))
print("load path %s" % sys.path[0])
from .config import *
| 0 | 0 | 0 | 0 | 0 | 0 |
torcharrow/test/transformation/test_bucketize.py | Nayef211/torcharrow | 272 | 3292285 | <gh_stars>100-1000
# Copyright (c) Meta Platforms, Inc. and affiliates.
# 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 unittest
import numpy as np
import torcharrow as ta
import torcharrow.dtypes as dt
f... | 0 | 0 | 0 | 0 | 0 | 0 |
test/mitmproxy/net/data/verificationcerts/generate.py | KarlParkinson/mitmproxy | 24,939 | 3292293 | """
Generate SSL test certificates.
"""
import os
import shlex
import shutil
import subprocess
import textwrap
ROOT_CA = "trusted-root"
SUBJECT = "example.mitmproxy.org"
def do(args) -> object:
print("> %s" % args)
args = shlex.split(args)
output = subprocess.check_output(args)
return output
def ge... | 3 | 1 | 0 | 0 | 4 | 0 |
plugins/hanlp_demo/hanlp_demo/zh/tf/train_msra_ner_albert.py | housemecn/HanLP | 27,208 | 3292299 | <gh_stars>1000+
# -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-28 23:15
from hanlp.components.ner_tf import TransformerNamedEntityRecognizerTF
from hanlp.datasets.ner.msra import MSRA_NER_CHAR_LEVEL_TRAIN, MSRA_NER_CHAR_LEVEL_DEV, MSRA_NER_CHAR_LEVEL_TEST
from tests import cdroot
cdroot()
recognizer = Transfo... | 0 | 0 | 0 | 0 | 0 | 0 |
m3tl/problem_types/cls.py | vishalbelsare/bert-multitask-learning | 456 | 3292302 | <reponame>vishalbelsare/bert-multitask-learning
# AUTOGENERATED! DO NOT EDIT! File to edit: source_nbs/12_1_problem_type_cls.ipynb (unless otherwise specified).
__all__ = ['Classification', 'cls_get_or_make_label_encoder_fn', 'cls_label_handling_fn']
# Cell
from functools import partial
from typing import List
impor... | 0 | 0 | 0 | 0 | 0 | 0 |
python_logger/log_pres_3.py | karthik/berkeley | 106 | 3292307 | <filename>python_logger/log_pres_3.py
#!/usr/bin/python
# Creator: <NAME>
# License: GPL
# import the python logging utility as log
import logging as log
# Use .basicConfig to nicely format our output for the root logger
# as well as set the log level
log.basicConfig( format = '[%(name)s - %(levelname)8s] %(message)s... | 0 | 0 | 0 | 0 | 0 | 0 |
seahub/base/migrations/0001_initial.py | weimens/seahub | 420 | 3292321 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-03-21 08:42
import datetime
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import seahub.base.fields
class Migration(migrations.Migration):
initial = True
dependencies =... | 0 | 0 | 0 | 0 | 0 | 0 |
ci/teamcity/comment_on_pr.py | Rubtsowa/modin | 7,258 | 3292332 | <reponame>Rubtsowa/modin
"""
Post the comment like the following to the PR:
```
:robot: TeamCity test results bot :robot:
<Logs from pytest>
```
"""
from github import Github
import os
import sys
# Check if this is a pull request or not based on the environment variable
try:
pr_id = int(os.environ["GITHUB_PR_NUM... | 0 | 0 | 0 | 0 | 0 | 0 |
embedders/no_pose_encoder.py | lichnost/latent-pose-reenactment | 103 | 3292355 | from __future__ import annotations
import torch
from torch import nn
from torch.nn.utils import spectral_norm
from generators.common import blocks
class Wrapper:
@staticmethod
def get_args(parser):
parser.add('--embed_padding', type=str, default='zero', help='zero|reflection')
parser.add('--emb... | 1 | 3 | 0 | 1 | 5 | 0 |
libcst/_typed_visitor.py | Instagram/LibCST | 880 | 3292356 | <reponame>Instagram/LibCST<filename>libcst/_typed_visitor.py
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# This file was generated by libcst.codegen.gen_matcher_classes
from typing im... | 0 | 0 | 0 | 0 | 0 | 0 |
illuz/0001/key_generator.py | saurabh896/python-1 | 3,976 | 3292375 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Author: illuz <<EMAIL>zen[at]gmail.com>
# File: key_generator.py
# Create Date: 2015-02-09 10:43:36
# Descripton: Use uuid module to generate 200 register keys.
# Usage: key_generator.py
"""
第 0001 题:
做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),使用 P... | 0 | 0 | 0 | 0 | 0 | 0 |
components/omnibox/PRESUBMIT.py | zealoussnow/chromium | 14,668 | 3292391 | # Copyright 2021 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.
from __future__ import annotations
"""Presubmit script for changes affecting components/omnibox/
See http://dev.chromium.org/developers/how-tos/depottools/p... | 0 | 3 | 0 | 0 | 3 | 0 |
src/main/python/household_generator/download_allocate_generate.py | cday97/beam | 123 | 3292412 | from __future__ import (
absolute_import, division, print_function, unicode_literals
)
import logging
import argparse
import csv
import os
from doppelganger import (
inputs,
Accuracy,
CleanedData,
Configuration,
HouseholdAllocator,
SegmentedData,
BayesianNetworkModel,
Population,
... | 0 | 0 | 0 | 0 | 0 | 0 |
galpy/potential/MovingObjectPotential.py | gusbeane/galpy | 147 | 3292438 | <reponame>gusbeane/galpy
###############################################################################
# MovingObjectPotential.py: class that implements the potential coming from
# a moving object
###############################################################################
import copy... | 0 | 0 | 0 | 0 | 0 | 0 |
quantities/constants/relationships.py | 502E532E/python-quantities | 105 | 3292476 | <gh_stars>100-1000
"""
"""
from ._utils import _cd
from ..unitquantity import UnitConstant
hertz_inverse_meter_relationship = UnitConstant(
'hertz_inverse_meter_relationship',
_cd('hertz-inverse meter relationship')
)
hertz_joule_relationship = UnitConstant(
'hertz_joule_relationship',
_cd('hertz-jou... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow_privacy/privacy/logistic_regression/datasets_test.py | sarvex/privacy | 1,605 | 3292481 | # Copyright 2021, The TensorFlow 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.0
#
# Unless required by applicable law or agreed t... | 0 | 0 | 0 | 0 | 0 | 0 |
anndata/_core/access.py | michalk8/anndata | 262 | 3292492 | from functools import reduce
from typing import NamedTuple, Tuple
from . import anndata
class ElementRef(NamedTuple):
parent: "anndata.AnnData"
attrname: str
keys: Tuple[str, ...] = ()
def __str__(self) -> str:
return f".{self.attrname}" + "".join(map(lambda x: f"['{x}']", self.keys))
@... | 0 | 3 | 3 | 0 | 6 | 0 |
lib/passlib/handlers/phpass.py | Rudi9719/booksearch-web | 674 | 3292503 | <gh_stars>100-1000
"""passlib.handlers.phpass - PHPass Portable Crypt
phppass located - http://www.openwall.com/phpass/
algorithm described - http://www.openwall.com/articles/PHP-Users-Passwords
phpass context - blowfish, bsdi_crypt, phpass
"""
#========================================================================... | 0 | 0 | 0 | 0 | 0 | 0 |
multipledispatch/tests/test_variadic.py | srosengren/multipledispatch | 638 | 3292506 | <reponame>srosengren/multipledispatch
from multipledispatch.variadic import isvariadic, Variadic
class A(object): pass
class B(A): pass
class C(object): pass
def test_is_variadic():
assert isvariadic(Variadic[A])
assert not isvariadic(A)
def test_equals_simple():
type_a = Variadic[A]
type_b = Vari... | 0 | 0 | 0 | 0 | 0 | 0 |
Packs/CentrifyVault/Integrations/CentrifyVault/CentrifyVault.py | diCagri/content | 799 | 3292517 | <reponame>diCagri/content
import re
import time
import demistomock as demisto # noqa: F401
# IMPORTS
from CommonServerPython import * # noqa: F401
# Disable insecure warnings
requests.packages.urllib3.disable_warnings()
"""PARAMETERS"""
class Client(BaseClient):
"""
Client will implement the service API... | 0 | 0 | 0 | 0 | 0 | 0 |
util/io.py | entn-at/vae-npvc | 146 | 3292531 | <reponame>entn-at/vae-npvc
import numpy as np
import tensorflow as tf
def int64_feature(value):
if isinstance(value, list):
value = [tf.train.Feature(
int64_list=tf.train.Int64List(value=[v])) for v in value]
return tf.train.FeatureList(feature=value)
else:
value = tf.train.... | 0 | 0 | 0 | 0 | 0 | 0 |
python_bindings/correctness/multipass_constraints.py | OAID/Halide | 4,303 | 3292550 | <gh_stars>1000+
import halide as hl
def test_multipass_constraints():
input = hl.ImageParam(hl.Float(32), 2, "input")
f = hl.Func("f")
x = hl.Var("x")
y = hl.Var("y")
f[x, y] = input[x+1, y+1] + input[x-1, y-1]
f[x, y] += 3.0
f.update().vectorize(x, 4)
o = f.output_buffer()
# N... | 0 | 0 | 0 | 0 | 0 | 0 |
python_modules/dagster/dagster/core/storage/runs/sqlite/alembic/versions/9fe9e746268c_cascade_run_deletion.py | dbatten5/dagster | 4,606 | 3292553 | <reponame>dbatten5/dagster
"""cascade run deletion
Revision ID: 9fe9e746268c
Revises: <KEY>
Create Date: 2020-02-10 18:13:58.993653
"""
from alembic import op
from sqlalchemy.engine import reflection
# pylint: disable=no-member
# revision identifiers, used by Alembic.
revision = "9fe9e746268c"
down_revision = "<KEY... | 0 | 0 | 0 | 0 | 0 | 0 |
editdistance/__init__.py | sreekanth370/editdistance | 403 | 3292562 | from .bycython import eval
def distance(*args, **kwargs) -> object:
""""An alias to eval"""
return eval(*args, **kwargs)
__all__ = ('eval', 'distance')
| 0 | 1 | 0 | 0 | 1 | 0 |
aliyun-python-sdk-trademark/aliyunsdktrademark/request/v20180724/ListNotaryInfosRequest.py | yndu13/aliyun-openapi-python-sdk | 1,001 | 3292575 | <gh_stars>1000+
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"... | 0 | 0 | 0 | 0 | 0 | 0 |
tmux2html/main.py | ccin2p3/tmux2html | 695 | 3292605 | # coding: utf8
from __future__ import annotations
from __future__ import print_function, unicode_literals, division
import os
import re
import sys
import json
import time
import argparse
import tempfile
import unicodedata
from collections import defaultdict
from . import color, utils, tpl
try:
from html import e... | 23 | 17 | 4 | 5 | 49 | 0 |
neo/Prompt/Commands/tests/test_sc_commands.py | volekerb/neo-python | 387 | 3292609 | import os
import shutil
import warnings
from neo.Utils.WalletFixtureTestCase import WalletFixtureTestCase
from neo.Wallets.utils import to_aes_key
from neo.Implementations.Wallets.peewee.UserWallet import UserWallet
from neo.Core.UInt160 import UInt160
from neo.Prompt.Commands.SC import CommandSC
from neo.Prompt.Prompt... | 2 | 2 | 4 | 0 | 8 | 0 |
dace/codegen/targets/rtl.py | benibenj/dace | 227 | 3292613 | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import itertools
from typing import List, Tuple, Dict
from dace import dtypes, config, registry, symbolic, nodes, sdfg, data
from dace.sdfg import graph, state, find_input_arraynode, find_output_arraynode
from dace.codegen import codeobject,... | 31 | 21 | 17 | 8 | 77 | 0 |
fomalhaut/runserver.py | restran/fomalhaut | 159 | 3292645 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# created by restran on 2015/12/19
from __future__ import unicode_literals, absolute_import
import logging
import sys
import signal
import tornado
import time
from tornado import httpserver, ioloop, web
from tornado.httputil import native_str
from tornado.options import de... | 0 | 0 | 0 | 0 | 0 | 0 |
src/resource-mover/azext_resource_mover/manual/custom.py | Mannan2812/azure-cli-extensions | 207 | 3292658 | <filename>src/resource-mover/azext_resource_mover/manual/custom.py<gh_stars>100-1000
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#... | 0 | 0 | 0 | 0 | 0 | 0 |
data_describe/_version.py | truongc2/data-describe | 294 | 3292671 | <gh_stars>100-1000
__version__ = "0.1.0b3"
| 0 | 0 | 0 | 0 | 0 | 0 |
dashboard/services/worker.py | robertsimmons514/isthislegit | 282 | 3292680 | from config import config
class WorkerProvider(object):
def add_task(self, func, *args, **kwargs):
''' Performs a task asynchronously.
:param func: A function to call asynchronously
:param args: Positional arguments to send to the function
:param kwargs: Keyword arguments to ... | 0 | 1 | 0 | 0 | 1 | 0 |
library/tests/test.py | devinbalkind/greppo | 221 | 3292705 | <reponame>devinbalkind/greppo<filename>library/tests/test.py
from greppo import app
app.map(max_zoom= 18, center=[25, 25], zoom=10)
app.base_layer(provider='CartoDB Positron', visible=True)
text_1 = app.text(name='Text input', value='Some text...')
app.display(name='text-1-display', value=f'Value of text input: {te... | 0 | 0 | 0 | 0 | 0 | 0 |
source/datasets/methane.py | jaesikchoi/gpss-research | 151 | 3292706 | <gh_stars>100-1000
import datetime
import numpy as np
nax = np.newaxis
"""Methane data from the NOAA. See ftp://ftp.cmdl.noaa.gov/ccg/ch4/flask/README_surface_flask_ch4.html"""
def datafile():
return '../data/ch4_brw_surface-flask_1_ccgg_event.txt'
def read_data(fname=None):
"""Returns a Tx1 array X which g... | 0 | 0 | 0 | 0 | 0 | 0 |
impyute/ops/wrapper.py | eltonlaw/impy | 316 | 3292746 | <reponame>eltonlaw/impy<filename>impyute/ops/wrapper.py<gh_stars>100-1000
""" Decorator functions to wrap around entry and exit
... to easily apply to a function, functions that check/process inputs
and outputs
"""
from functools import wraps
import numpy as np
from . import error
from . import matrix
from . import u... | 0 | 0 | 0 | 0 | 0 | 0 |
src/fet/fetchhub1/constants.py | wengzilla/staketaxcsv | 140 | 3292749 | <reponame>wengzilla/staketaxcsv<filename>src/fet/fetchhub1/constants.py
FET_FETCHUB1_NODE = "https://rpc-fetchhub1-archive.fetch.ai"
FET_FETCHUB2_NODE = "https://rest-fetchhub2-archive.fetch.ai"
FET_FETCHUB3_NODE = "https://rest-fetchhub3-archive.fetch.ai"
CUR_FET = "FET"
MILLION = 1000000.0
EXP18 = 10**18
ACTION_TYP... | 0 | 0 | 0 | 0 | 0 | 0 |
phone_db/model.py | zhengwei5981/phone_db | 105 | 3292750 | # -*- coding: utf-8 -*-
import os
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
from sqlalchemy import create_engine, Column, Integer, String, ForeignKey
db_path = os.path.join(os.path.dirname(__file__), 'phone.db')
engine = create_engine('sqlite:///' + d... | 0 | 3 | 2 | 0 | 5 | 0 |
14Django/day02/BookManager/Book/urls.py | HaoZhang95/PythonAndMachineLearning | 937 | 3292764 | <gh_stars>100-1000
from django.urls import path
from Book import views
urlpatterns = [
path('booklist/', views.book_list),
path('arealist/', views.area_list),
]
| 0 | 0 | 0 | 0 | 0 | 0 |
topaz/modules/ffi/type.py | ruby-compiler-survey/topaz | 241 | 3292779 | <gh_stars>100-1000
from topaz.objects.objectobject import W_Object
from topaz.module import ClassDef
from rpython.rlib.jit_libffi import FFI_TYPE_P
from rpython.rlib import clibffi
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib.rarithmetic import intmask
from topaz.coerce import Coerce
from to... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/jobs/business/jobs.py | rainydaygit/testtcloudserver | 349 | 3292793 | from __future__ import annotations
import json
import traceback
from datetime import datetime
from sqlalchemy import func
from apps.auth.models.users import User
from apps.jobs.models.jobs import JobsRecord
from apps.project.business.assets import PhoneBorrowBusiness, PhoneBusiness
from apps.project.business.credit i... | 0 | 5 | 0 | 0 | 5 | 0 |
hiitpi/layout.py | jingw222/hiitpi | 146 | 3292805 | import plotly.express as px
import plotly.graph_objects as go
import dash_core_components as dcc
import dash_html_components as html
from .workout import WORKOUTS
COLORS = {"graph_bg": "#1E1E1E", "text": "#696969"}
def layout_config_panel(current_user) -> object:
"""The Dash app layout for the user config pane... | 0 | 6 | 0 | 0 | 6 | 0 |
tests/integration/services/policy_engine/engine/policy/gates/test_filecontent.py | rbrady/anchore-engine | 1,484 | 3292817 | <filename>tests/integration/services/policy_engine/engine/policy/gates/test_filecontent.py
import pytest
from anchore_engine.db import Image, get_thread_scoped_session
from anchore_engine.services.policy_engine.engine.policy.gates.files import (
ContentMatchTrigger,
FileCheckGate,
FilenameMatchTrigger,
... | 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.