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 |
|---|---|---|---|---|---|---|---|---|---|---|
common/db_types.py | fake-name/ReadableWebProxy | 193 | 1741060 | <filename>common/db_types.py
from sqlalchemy.dialects.postgresql import ENUM
dlstate_enum = ENUM('new', 'fetching', 'processing', 'complete', 'error', 'skipped', 'removed', 'disabled', 'specialty_blocked', 'specialty_deferred', 'single_step_deferred', 'manually_deferred', 'specialty_ready', name='dlstate_enum')
it... | 0 | 0 | 0 | 0 | 0 | 0 |
adversarialRobustness_Component/code/common/graph_embedding.py | Shen-Lab/GraphCL | 275 | 1741066 | <reponame>Shen-Lab/GraphCL
from __future__ import print_function
import os
import sys
import numpy as np
import torch
import random
from torch.autograd import Variable
from torch.nn.parameter import Parameter
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from tqdm import tqdm
import... | 0 | 0 | 0 | 0 | 0 | 0 |
Examples/7.1.2 Confirm MQTT Publish.py | wangyonghong/RabbitMQ-in-Depth | 111 | 1741070 | import rabbitpy
message = rabbitpy.get(queue_name='mqtt-messages')
if message:
message.pprint(True)
message.ack()
else:
print('No message in queue')
| 0 | 0 | 0 | 0 | 0 | 0 |
src/mcedit2/panels/map.py | elcarrion06/mcedit2 | 673 | 1741074 | from __future__ import annotations
"""
map
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from PySide import QtGui, QtCore
from PySide.QtCore import Qt
import numpy
from mcedit2.command import SimpleRevisionCommand
from mcedit2.ui.import_map import Ui_importMap... | 0 | 7 | 0 | 5 | 12 | 0 |
qutip/control/optimconfig.py | camponogaraviera/qutip | 1,205 | 1741075 | <filename>qutip/control/optimconfig.py<gh_stars>1000+
# -*- coding: utf-8 -*-
# @author: <NAME>
# @email1: <EMAIL>
# @email2: <EMAIL>
# @organization: Aberystwyth University
# @supervisor: <NAME>
"""
Configuration parameters for control pulse optimisation
"""
import numpy as np
# QuTiP logging
import qutip.logging_ut... | 0 | 0 | 0 | 0 | 0 | 0 |
cellrank/tl/kernels/_exp_time_kernel.py | WeilerP/cellrank | 172 | 1741076 | <gh_stars>100-1000
"""Experimental time kernel module."""
from typing import Any, Dict, Tuple, Mapping, Optional
from abc import ABC
from copy import copy
from types import MappingProxyType
import scanpy as sc
from cellrank.tl._enum import ModeEnum
from cellrank.ul._docs import d
from cellrank.tl._utils import _norma... | 0 | 0 | 0 | 0 | 0 | 0 |
test/tests/api-cit/v2_0/lookups_tests.py | arunrordell/RackHD | 451 | 1741093 | <filename>test/tests/api-cit/v2_0/lookups_tests.py
'''
Copyright (c) 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved.
'''
import fit_path # NOQA: unused import
import fit_common
import flogging
from config.api2_0_config import config
from on_http_api2_0 import ApiApi as Api
from on_http_api2_0.rest impor... | 0 | 0 | 0 | 0 | 0 | 0 |
hexbot.py | wurgo/HexBot | 123 | 1741123 | <filename>hexbot.py
import os
import io
import datetime
from aiohttp import ClientSession
import ksoftapi
import discord
from discord.ext import commands
from utils import canvas
bot = commands.Bot(command_prefix=commands.when_mentioned_or("~"),
description='Relatively simply awesome bot.',
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_super_norm.py | Joey61Liuyi/AutoDL-Projects | 817 | 1741136 | #####################################################
# Copyright (c) <NAME> [GitHub D-X-Y], 2021.03 #
#####################################################
# pytest ./tests/test_super_norm.py -s #
#####################################################
import unittest
import torch
from xautodl.xlayers impo... | 0 | 0 | 0 | 0 | 0 | 0 |
src/genie/libs/parser/iosxe/tests/ShowIsisFlexAlgo/cli/equal/golden_output4_expected.py | jacobgarder/genieparser | 204 | 1741144 | <gh_stars>100-1000
expected_output = {
"tag": {
"1": {
"flex_algo": {
"128": {
"level": {
"2": {
"def_priority": 131,
"def_source": "asr1k-25.00",
"def_... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_cmd_inspect_app.py | RioAtHome/falcon | 8,217 | 1741158 | <filename>tests/test_cmd_inspect_app.py
from argparse import Namespace
import io
import sys
import pytest
from falcon import App, inspect
from falcon.cmd import inspect_app
from falcon.testing import redirected
from _util import create_app # NOQA
_WIN32 = sys.platform.startswith('win')
_MODULE = 'tests.test_cmd_in... | 0 | 0 | 0 | 0 | 0 | 0 |
clone_graph/solution.py | mahimadubey/leetcode-python | 528 | 1741175 | from __future__ import annotations
"""
Clone an undirected graph. Each node in the graph contains a label and a list
of its neighbors.
"""
# Definition for a undirected graph node
# class UndirectedGraphNode(object):
# def __init__(self, x):
# self.label = x
# self.neighbors = []
class Solution(ob... | 0 | 1 | 0 | 0 | 1 | 0 |
jarbas/core/urls.py | vbarceloscs/serenata-de-amor | 3,001 | 1741197 | from django.urls import re_path
from jarbas.core.views import CompanyDetailView
app_name = 'core'
urlpatterns = [
re_path(
r'^company/(?P<cnpj>\d{14})/$',
CompanyDetailView.as_view(),
name='company-detail'
),
]
| 0 | 0 | 0 | 0 | 0 | 0 |
open/core/betterself/views/daily_view.py | lawrendran/open | 105 | 1741205 | <gh_stars>100-1000
from datetime import datetime
from rest_framework.response import Response
from rest_framework.views import APIView
from open.core.betterself.utilities.user_date_utilities import (
serialize_date_to_user_localized_datetime,
)
from open.core.betterself.utilities.history_overview_utilities import... | 0 | 0 | 0 | 0 | 0 | 0 |
custom_components/hacs/tasks/base.py | Swampen/home-assistant-config | 1,383 | 1741222 | """"Hacs base setup task."""
# pylint: disable=abstract-method
from __future__ import annotations
from datetime import timedelta
from timeit import default_timer as timer
from homeassistant.core import HomeAssistant
from ..base import HacsBase
from ..enums import HacsStage
from ..mixin import LogMixin
class HacsTa... | 2 | 3 | 4 | 0 | 9 | 0 |
lib/modules/passivetotal.py | nkrios/omnibus | 251 | 1741227 | <gh_stars>100-1000
#!/usr/bin/env python
##
# omnibus - deadbits.
# passivetotal.com module
##
from requests.auth import HTTPBasicAuth
from http import get
from common import warning
from common import get_apikey
class Plugin(object):
def __init__(self, artifact):
self.artifact = artifact
self.a... | 0 | 0 | 0 | 0 | 0 | 0 |
exercises/de/exc_03_16_01.py | Jette16/spacy-course | 2,085 | 1741229 | <gh_stars>1000+
import spacy
nlp = spacy.load("de_core_news_sm")
text = (
"Chick-fil-A, ein Wortspiel mit der amerikanischen Aussprache von „Filet“, "
"ist der Name einer 1946 gegründeten amerikanischen Schnellrestaurantkette, "
"die sich auf den Verkauf von Hühnerfleischprodukten spezialisiert hat."
)
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
venv/Lib/site-packages/altair/examples/us_population_over_time_facet.py | ajayiagbebaku/NFL-Model | 6,831 | 1741230 | """
US Population: Wrapped Facet
============================
This chart visualizes the age distribution of the US population over time,
using a wrapped faceting of the data by decade.
"""
# category: case studies
import altair as alt
from vega_datasets import data
source = data.population.url
alt.Chart(source).mark_... | 0 | 0 | 0 | 0 | 0 | 0 |
pylearn2/scripts/tests/test_train.py | BouchardLab/pylearn2 | 2,045 | 1741257 | """
A unit test for the train.py script
"""
import os
import pylearn2
from pylearn2.scripts.train import train
def test_train_cmd():
"""
Calls the train.py script with a short YAML file
to see if it trains without error
"""
train(os.path.join(pylearn2.__path__[0],
"scripts/... | 0 | 0 | 0 | 0 | 0 | 0 |
demos/deblurring_demo/python/deblurring_demo.py | APrigarina/open_model_zoo | 1,031 | 1741274 | """
Copyright (C) 2018-2021 Intel Corporation
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 i... | 0 | 1 | 0 | 0 | 1 | 0 |
src/clusterfuzz/_internal/tests/appengine/handlers/issue_redirector_test.py | mspectorgoogle/clusterfuzz | 5,023 | 1741312 | <gh_stars>1000+
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/lan_chat.py | eric-downes/mesh-networking | 368 | 1741315 | <reponame>eric-downes/mesh-networking
#!/usr/bin/env python3
import time
from mesh.links import UDPLink
from mesh.programs import BaseProgram
from mesh.filters import UniqueFilter
from mesh.node import Node
class ChatProgram(BaseProgram):
def recv(self, packet, interface):
print('\n>> {}'.format(packet.... | 0 | 0 | 0 | 0 | 0 | 0 |
inceptor/engine/component/TemplateModuleComponent.py | whitefi/inceptor | 743 | 1741320 | from __future__ import annotations
from abc import ABC
from enums.Language import Language
class TemplateModuleComponent(ABC):
def __init__(self, code: object | None=None, placeholder: object | None=None, trail: bool=False):
self.placeholder = placeholder
self.__code = code
self.trail = t... | 5 | 2 | 0 | 0 | 7 | 0 |
vsphere/tests/common.py | mchelen-gov/integrations-core | 663 | 1741321 | # (C) Datadog, Inc. 2019-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
from datadog_checks.vsphere.api_rest import VSphereRestAPI
HERE = os.path.abspath(os.path.dirname(__file__))
VSPHERE_VERSION = os.environ.get('VSPHERE_VERSION')
LAB_USERNAME = os.environ.get('TEST_... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_permute.py | akhti/torch-blocksparse | 110 | 1741363 | <reponame>akhti/torch-blocksparse
import torch
import torch_blocksparse
from time import time
from collections import OrderedDict
from utils import *
from nose.tools import nottest
from parameterized import parameterized
@nottest
def init_inputs(N, C, H, W, in_order, out_order, dtype):
shape = (N, C, H, W)
stride... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/tools/compatibility/tf_upgrade.py | abhaikollara/tensorflow | 848 | 1741390 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 6 | 6 | 0 |
utils/optimization.py | SurgicalAI/Docs-Class | 512 | 1741392 | <filename>utils/optimization.py
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. 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... | 0 | 0 | 0 | 0 | 0 | 0 |
CondCore/DBOutputService/test/python/writeBlob_cfg.py | ckamtsikis/cmssw | 852 | 1741409 | import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.load("CondCore.CondDB.CondDB_cfi")
process.CondDB.connect = 'sqlite_file:blob.db'
process.source = cms.Source("EmptyIOVSource",
lastValue = cms.uint64(1),
timetype = cms.string('Run'),
firstValue = cms.uint64(1),
interval =... | 0 | 0 | 0 | 0 | 0 | 0 |
configs/_base_/datasets/nus-mono3d.py | Guangyun-Xu/mmdetection3d | 2,216 | 1741419 | dataset_type = 'NuScenesMonoDataset'
data_root = 'data/nuscenes/'
class_names = [
'car', 'truck', 'trailer', 'bus', 'construction_vehicle', 'bicycle',
'motorcycle', 'pedestrian', 'traffic_cone', 'barrier'
]
# Input modality for nuScenes dataset, this is consistent with the submission
# format which requires the... | 0 | 0 | 0 | 0 | 0 | 0 |
m_add_global_config.py | zhangineer/securecrt-tools | 168 | 1741433 | <filename>m_add_global_config.py
# $language = "python"
# $interface = "1.0"
import os
import sys
import logging
# Add script directory to the PYTHONPATH so we can import our modules (only if run from SecureCRT)
if 'crt' in globals():
script_dir, script_name = os.path.split(crt.ScriptFullName)
if script_dir n... | 0 | 0 | 0 | 0 | 0 | 0 |
example/reinforcement-learning/parallel_actor_critic/model.py | IIMarch/mxnet | 399 | 1741456 | <gh_stars>100-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
# "Licen... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/utils/configure.py | krishnancr/arnold-usd | 171 | 1741457 | <gh_stars>100-1000
# Copyright 2019 Autodesk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/python/debug/examples/debug_errors.py | MathMachado/tensorflow | 848 | 1741468 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 0 | 0 | 0 |
pybrain/rl/environments/functions/multimodal.py | sveilleux1/pybrain | 2,208 | 1741470 | from __future__ import annotations
from __future__ import print_function
""" The functions implemented here are standard benchmarks from literature. """
__author__ = '<NAME>, <EMAIL>'
from scipy import power, exp, cos, sqrt, rand, sin, floor, dot, ones, sign, randn, prod
from scipy.linalg import orth
from math impor... | 3 | 14 | 16 | 2 | 35 | 0 |
src/api/python/tests/data_test.py | hangqiu/pixie | 1,821 | 1741479 | <filename>src/api/python/tests/data_test.py
# Copyright 2018- The Pixie 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 ... | 0 | 0 | 0 | 0 | 0 | 0 |
misc/help_as_html.py | wanghuan578/chrome-gn | 2,151 | 1741500 | <filename>misc/help_as_html.py<gh_stars>1000+
#!/usr/bin/env python
# Copyright 2014 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.
# Runs 'gn help' and various subhelps, and spits out html.
# TODO:
# - Handle numbered an... | 0 | 0 | 0 | 0 | 0 | 0 |
test/integration/test_vault_file_source.py | gulsumgudukbay/galaxy | 1,085 | 1741507 | <reponame>gulsumgudukbay/galaxy<filename>test/integration/test_vault_file_source.py<gh_stars>1000+
import json
import os
import tempfile
from galaxy.security.vault import UserVaultWrapper
from galaxy_test.base import api_asserts
from galaxy_test.base.populators import DatasetPopulator
from galaxy_test.driver import in... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter01/Theano_Addition.py | Tanishadel/Mastering-Machine-Learning-for-Penetration-Testing | 241 | 1741530 | from theano import *
import theano.tensor as T
from theano import function
a = T.dscalar('a')
b = T.dscalar('b')
c = a + b
f = function([a, b], c)
print (f)
| 0 | 0 | 0 | 0 | 0 | 0 |
testing/tools/integration/cluster.py | vishalbelsare/wallaroo | 1,459 | 1741538 | # Copyright 2017 The Wallaroo 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 ... | 44 | 24 | 1 | 18 | 87 | 0 |
api/environments/dynamodb/__init__.py | mevinbabuc/flagsmith | 1,259 | 1741539 | <filename>api/environments/dynamodb/__init__.py<gh_stars>1000+
from .dynamodb_wrapper import DynamoIdentityWrapper # noqa
| 0 | 0 | 0 | 0 | 0 | 0 |
mindspore/python/mindspore/train/callback/_lr_scheduler_callback.py | PowerOlive/mindspore | 3,200 | 1741541 | <filename>mindspore/python/mindspore/train/callback/_lr_scheduler_callback.py
# Copyright 2020 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.apac... | 0 | 0 | 0 | 0 | 0 | 0 |
rl_algorithms/fd/ddpg_learner.py | krishanrana/rl_algorithms | 466 | 1741542 | from typing import Tuple, Union
import torch
from torch.nn.utils import clip_grad_norm_
from rl_algorithms.common.abstract.learner import TensorTuple
import rl_algorithms.common.helper_functions as common_utils
from rl_algorithms.ddpg.learner import DDPGLearner
from rl_algorithms.registry import LEARNERS
@LEARNERS.... | 3 | 2 | 0 | 0 | 5 | 0 |
venv/Lib/site-packages/prompt_toolkit/selection.py | ajayiagbebaku/NFL-Model | 6,989 | 1741566 | <gh_stars>1000+
"""
Data structures for the selection.
"""
from enum import Enum
__all__ = [
"SelectionType",
"PasteMode",
"SelectionState",
]
class SelectionType(Enum):
"""
Type of selection.
"""
#: Characters. (Visual in Vi.)
CHARACTERS = "CHARACTERS"
#: Whole lines. (Visual-L... | 0 | 0 | 0 | 0 | 0 | 0 |
courses/backend/django-for-everybody/Web Application Technologies and Django/resources/dj4e-samples/forums/urls.py | Nahid-Hassan/fullstack-software-development | 297 | 1741584 | from django.urls import path, reverse_lazy
from . import views
from django.views.generic import TemplateView
# namespace:route_name
app_name='forums'
urlpatterns = [
path('', views.ForumListView.as_view(), name='all'),
path('forum/<int:pk>', views.ForumDetailView.as_view(), name='forum_detail'),
path('for... | 0 | 0 | 0 | 0 | 0 | 0 |
env/lib/python3.8/site-packages/faker/providers/job/pl_PL/__init__.py | avdhari/enigma | 258 | 1741591 | <reponame>avdhari/enigma<filename>env/lib/python3.8/site-packages/faker/providers/job/pl_PL/__init__.py
# coding=utf-8
from __future__ import unicode_literals
from .. import Provider as BaseProvider
class Provider(BaseProvider):
jobs = [
"Agent celny",
"Agent firmy inwestycyjnej",
"Agent l... | 0 | 0 | 0 | 0 | 0 | 0 |
OmniMarkupLib/Renderers/libs/pygments/lexers/nit.py | henumohe/OmniMarkupPreviewer | 652 | 1741600 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
pygments.lexers.nit
~~~~~~~~~~~~~~~~~~~
Lexer for the Nit language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, words
from pygments.token import... | 0 | 0 | 0 | 0 | 0 | 0 |
exps/NATS-Bench/tss-collect-patcher.py | Joey61Liuyi/AutoDL-Projects | 817 | 1741603 | ##############################################################################
# NATS-Bench: Benchmarking NAS Algorithms for Architecture Topology and Size #
##############################################################################
# Copyright (c) <NAME> [GitHub D-X-Y], 2020.08 #
#########... | 0 | 1 | 0 | 0 | 1 | 0 |
clusterman/cli/generate_data.py | akshaysharma096/clusterman | 281 | 1741625 | # Copyright 2019 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 0 | 6 | 0 | 0 | 6 | 0 |
apps/birds/tiny_yolo_processor.py | neuralbotnetworks/ncappzoo | 968 | 1741628 | #! /usr/bin/env python3
# Copyright(c) 2017 Intel Corporation.
# License: MIT See LICENSE file in root directory.
from openvino.inference_engine import IENetwork, IECore
import numpy as np
import cv2
class tiny_yolo_processor:
# Set up parameters that will be needed for tiny yolo
EXAMPLES_BASE_DIR = '../../'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/modules/__init__.py | MrFishFinger/powerline | 11,435 | 1741644 | <reponame>MrFishFinger/powerline<filename>tests/modules/__init__.py
# vim:fileencoding=utf-8:noet
from __future__ import (unicode_literals, division, absolute_import, print_function)
import sys
import os
if sys.version_info < (2, 7):
from unittest2 import TestCase as _TestCase # NOQA
from unittest2 import main as ... | 0 | 0 | 0 | 0 | 0 | 0 |
pegasus/data/all_datasets.py | akhilbobby/pegasus | 1,270 | 1741658 | <filename>pegasus/data/all_datasets.py
# Copyright 2020 The PEGASUS 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 req... | 0 | 0 | 0 | 0 | 0 | 0 |
Find Peak Element II.py | RijuDasgupta9116/LintCode | 321 | 1741681 | <reponame>RijuDasgupta9116/LintCode<filename>Find Peak Element II.py
"""
There is an integer matrix which has the following features:
The numbers in adjacent positions are different.
The matrix has n rows and m columns.
For all i < m, A[0][i] < A[1][i] && A[n - 2][i] > A[n - 1][i].
For all j < n, A[j][0] < A[j][1] && ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/r/test_coal_miners.py | hajime9652/observations | 199 | 1741684 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.coal_miners import coal_miners
def test_coal_miners():
"""Test module coal_miners.py by downloading
coal_miners.csv and testing shape of
e... | 0 | 0 | 0 | 0 | 0 | 0 |
peering/migrations/0002_auto_20170820_1809.py | maznu/peering-manager | 173 | 1741692 | <reponame>maznu/peering-manager<filename>peering/migrations/0002_auto_20170820_1809.py<gh_stars>100-1000
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-20 16:09
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("pe... | 0 | 0 | 0 | 0 | 0 | 0 |
alipay/aop/api/response/KoubeiCateringOrderInfoQueryResponse.py | antopen/alipay-sdk-python-all | 213 | 1741707 | <reponame>antopen/alipay-sdk-python-all<filename>alipay/aop/api/response/KoubeiCateringOrderInfoQueryResponse.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.KbPosOrderDishDetail import KbPosOrderDishDetail
from a... | 0 | 0 | 0 | 0 | 0 | 0 |
AppServer/google/appengine/api/files/testutil.py | loftwah/appscale | 790 | 1741714 | <filename>AppServer/google/appengine/api/files/testutil.py
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/l... | 0 | 0 | 0 | 0 | 0 | 0 |
gamebot/settings.py | aprilsanchez/ictf-framework | 110 | 1741728 | import os
# Logstash settings
LOGSTASH_PORT = 1717
LOGSTASH_IP = "localhost"
# DB settings
DB_HOST = 'THE_API_ADDRESS_GOES_HERE'
DB_SECRET = 'THESECRETPASSPHRASEGOESHERE'
# RabbitMQ settings
RABBIT_USERNAME = os.environ['RABBIT_USERNAME']
RABBIT_PASSWORD = os.environ['RABBIT_PASSWORD']
RABBIT_ENDPOINT = os.environ['... | 0 | 0 | 0 | 0 | 0 | 0 |
tensorflow/contrib/crf/python/kernel_tests/crf_test.py | connectthefuture/tensorflow | 101 | 1741735 | <reponame>connectthefuture/tensorflow
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICE... | 0 | 0 | 0 | 0 | 0 | 0 |
verde/base/__init__.py | fatiando/verde | 415 | 1741750 | <gh_stars>100-1000
# Copyright (c) 2017 The Verde Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
#
# This code is part of the Fatiando a Terra project (https://www.fatiando.org)
#
from .base_classes import BaseBlockCrossValidator, BaseGridder
from .least_s... | 0 | 0 | 0 | 0 | 0 | 0 |
build_tools/compile_static.py | aericson/rest_framework_ccbv | 119 | 1741758 | #!/usr/bin/env python
import os
import errno
from rest_framework_ccbv.config import VERSION, REST_FRAMEWORK_VERSIONS
from rest_framework_ccbv.inspector import drfklasses
from rest_framework_ccbv.renderers import (DetailPageRenderer,
IndexPageRenderer,
... | 1 | 0 | 0 | 0 | 1 | 0 |
demos/moderator/moderator/routes.py | hzlmn/aiohttp-demos | 649 | 1741768 | def setup_routes(app, handler, project_root):
router = app.router
h = handler
router.add_get('/', h.index, name='index')
router.add_post('/moderate', h.moderate, name='moderate')
router.add_static(
'/static/', path=str(project_root / 'static'),
name='static')
| 0 | 0 | 0 | 0 | 0 | 0 |
deep-rl/lib/python2.7/site-packages/OpenGL/GLX/VERSION/GLX_1_3.py | ShujaKhalid/deep-rl | 210 | 1741799 | '''OpenGL extension VERSION.GLX_1_3
This module customises the behaviour of the
OpenGL.raw.GLX.VERSION.GLX_1_3 to provide a more
Python-friendly API
The official definition of this extension is available here:
http://www.opengl.org/registry/specs/VERSION/GLX_1_3.txt
'''
from OpenGL import platform, constant, arrays... | 0 | 1 | 0 | 0 | 1 | 0 |
leo/plugins/obsolete/gtkGui.py | ATikhonov2/leo-editor | 1,550 | 1741834 | <filename>leo/plugins/obsolete/gtkGui.py
#@+leo-ver=4-thin
#@+node:ekr.20080112150934:@thin gtkGui.py
'''The plugin part of the gtk gui code.'''
import leoGlobals as g
import leoGtkGui
try:
import gtk
except ImportError:
gtk = None
g.es_print('can not import gtk')
#@+others
#@+node:ekr.20080112150934.1:i... | 0 | 0 | 0 | 0 | 0 | 0 |
pulsar/utils/system/windowssystem.py | PyCN/pulsar | 1,410 | 1741843 | <filename>pulsar/utils/system/windowssystem.py
import os
import signal
import ctypes
import ctypes.wintypes
import getpass
from multiprocessing import current_process
from .base import * # noqa
__all__ = ['daemonize',
'EXIT_SIGNALS',
'SIGNALS',
'kill',
'get_uid',
... | 0 | 0 | 0 | 0 | 0 | 0 |
mylis/mylis_2/exercises/ackermann.py | thepabloaguilar/lispy | 118 | 1741868 | <filename>mylis/mylis_2/exercises/ackermann.py
"""This module contains a code example related to
Think Python, 2nd Edition
by <NAME>
http://thinkpython2.com
Copyright 2015 <NAME>
License: http://creativecommons.org/licenses/by/4.0/
"""
def ackermann(m, n):
"""Computes the Ackermann function A(m, n)
See htt... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_util.py | Reallywish/deepl-python-main2 | 217 | 1741872 | <reponame>Reallywish/deepl-python-main2<filename>tests/test_util.py
# Copyright 2022 DeepL SE (https://www.deepl.com)
# Use of this source code is governed by an MIT
# license that can be found in the LICENSE file.
import deepl
import pytest
def test_convert_tsv_to_dict():
result = deepl.convert_tsv_to_dict("App... | 0 | 0 | 0 | 0 | 0 | 0 |
exercises/de/exc_01_12_03.py | Jette16/spacy-course | 2,085 | 1741885 | import spacy
from spacy.matcher import Matcher
nlp = spacy.load("de_core_news_sm")
matcher = Matcher(nlp.vocab)
doc = nlp(
"Zu den Features der App gehören ein wunderschönes farbenfrohes Design, "
"intelligente Suche, automatisierte Labels und Sprachsteuerung."
)
# Schreibe ein Pattern für ein Adjektiv, ein ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/providers/google/cloud/transfers/test_calendar_to_gcs.py | npodewitz/airflow | 8,092 | 1741895 | # 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"); you may not u... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/models/spectral/plot_gauss_spectral.py | Rishank2610/gammapy | 155 | 1741909 | <gh_stars>100-1000
r"""
.. _gaussian-spectral-model:
Gaussian spectral model
=======================
This model parametrises a gaussian spectrum.
It is defined by the following equation:
.. math::
\phi(E) = \frac{N_0}{\sigma \sqrt{2\pi}} \exp{ \frac{- \left( E-\bar{E} \right)^2 }{2 \sigma^2} }
"""
# %%
# Exa... | 0 | 0 | 0 | 0 | 0 | 0 |
eth/_utils/address.py | ggs134/py-evm | 1,641 | 1741924 | <reponame>ggs134/py-evm
import rlp
from eth_hash.auto import keccak
from eth_typing import Address
from eth._utils.numeric import (
int_to_bytes32,
)
def force_bytes_to_address(value: bytes) -> Address:
trimmed_value = value[-20:]
padded_value = trimmed_value.rjust(20, b'\x00')
return Address(padded... | 0 | 0 | 0 | 0 | 0 | 0 |
cnvlib/_version.py | tetedange13/cnvkit | 342 | 1741927 | __version__ = "0.9.10.dev0"
| 0 | 0 | 0 | 0 | 0 | 0 |
specialTests/insertedInMidleCode/exploit.py | IMULMUL/websitesVulnerableToSSTI | 288 | 1741949 | <gh_stars>100-1000
import requests
def sendPayload(payload_arg="me"):
url = "http://127.0.0.1:5001/"
result1 = requests.post(url,data={"name":payload_arg}).text
return result1
payload ='}}${__import__("subprocess").check_output("ls")}'
print sendPayload(payload)
| 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | ashbyca/machinae | 493 | 1741954 | from os import path
from setuptools import setup, find_packages
#this should hopefully allow us to have a more pypi friendly, always up to date readme
readMeDir = path.abspath(path.dirname(__file__))
with open(path.join(readMeDir, 'README.md'), encoding='utf-8') as readFile:
long_desc = readFile.read()
VERSION ... | 0 | 0 | 0 | 0 | 0 | 0 |
brac/scripts/train_brac.py | Thibaud-Ardoin/d4rl_evaluations | 123 | 1741969 | <reponame>Thibaud-Ardoin/d4rl_evaluations
# coding=utf-8
# Copyright 2020 The Google Research 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/L... | 0 | 0 | 0 | 0 | 0 | 0 |
crabageprediction/venv/Lib/site-packages/pandas/tests/indexes/multi/test_conversion.py | 13rianlucero/CrabAgePrediction | 28,899 | 1741981 | import numpy as np
import pytest
import pandas as pd
from pandas import (
DataFrame,
MultiIndex,
)
import pandas._testing as tm
def test_to_numpy(idx):
result = idx.to_numpy()
exp = idx.values
tm.assert_numpy_array_equal(result, exp)
def test_to_frame():
tuples = [(1, "one"), (1, "two"), (2... | 0 | 0 | 0 | 0 | 0 | 0 |
lldb/test/API/lang/swift/imported_types/cgtypes/TestCGImportedTypes.py | LaudateCorpus1/llvm-project | 605 | 1741991 | # TestCGImportedTypes.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONT... | 0 | 0 | 0 | 0 | 0 | 0 |
pygame_gui/core/utility.py | glipR/pygame_gui | 339 | 1742031 | from __future__ import annotations
"""
This code owes a lot to pyperclip by <NAME> <EMAIL>.
"""
import platform
import subprocess
import time
import contextlib
import os
import sys
import io
import re
import base64
from pathlib import Path
from typing import Union, Dict, Tuple
from threading import Thread
from queue... | 31 | 16 | 0 | 5 | 52 | 0 |
redbot/message/headers/x_meta_mssmarttagspreventparsing.py | Malvoz/redbot | 167 | 1742061 | <reponame>Malvoz/redbot
#!/usr/bin/env python
from redbot.message import headers
from redbot.speak import Note, categories, levels
from redbot.type import AddNoteMethodType
class x_meta_mssmarttagspreventparsing(headers.HttpHeader):
canonical_name = "X-Meta-MSSmartTagsPreventParsing"
list_header = False
... | 0 | 0 | 0 | 0 | 0 | 0 |
doc/examples/plot.py | Tada-Project/pyperf | 225 | 1742086 | #!/usr/bin/env python3
import argparse
import matplotlib.pyplot as plt
import pyperf
import statistics
def plot_bench(args, bench):
if not args.split_runs:
runs = bench.get_runs()
if args.run:
run = runs[args.run - 1]
runs = [run]
values = []
for run in runs... | 0 | 1 | 0 | 0 | 1 | 0 |
ydkgen/printer/python/class_inits_printer.py | YDK-Solutions/ydk | 125 | 1742090 | <filename>ydkgen/printer/python/class_inits_printer.py<gh_stars>100-1000
# ----------------------------------------------------------------
# Copyright 2016 Cisco Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 0 | 0 | 0 | 0 | 0 | 0 |
sparse_operation_kit/sparse_operation_kit/core/inplace_initializer.py | x-y-z/HugeCTR | 130 | 1742094 | """
Copyright (c) 2021, <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 or agreed to in writing, sof... | 0 | 2 | 0 | 0 | 2 | 0 |
core/native/vendor/cx_Freeze-5.0.1/cx_Freeze/main.py | tensorlang/nao | 332 | 1742112 | import optparse
import os
import shutil
import stat
import sys
import cx_Freeze
__all__ = ["main"]
USAGE = \
"""
%prog [options] [SCRIPT]
Freeze a Python script and all of its referenced modules to a base
executable which can then be distributed without requiring a Python
installation."""
VERSION = \
"""
%%prog %s... | 0 | 1 | 0 | 0 | 1 | 0 |
runtime/bindings/python/src/openvino/opset5/__init__.py | chccc1994/openvino | 2,406 | 1742115 | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino.opset1.ops import absolute
from openvino.opset1.ops import absolute as abs
from openvino.opset1.ops import acos
from openvino.opset4.ops import acosh
from openvino.opset1.ops import add
from openvino.opset1.ops import asin
... | 0 | 0 | 0 | 0 | 0 | 0 |
nintendo/switch.py | azillion/DodoTrafficControl | 209 | 1742116 |
from __future__ import annotations
from Crypto.Cipher import AES
from Crypto.PublicKey import RSA
from anynet import tls
import hashlib
import struct
import base64
import logging
logger = logging.getLogger(__name__)
def b64encode(data) -> object:
return base64.b64encode(data, b"-_").decode().rstrip("... | 1 | 8 | 0 | 1 | 10 | 0 |
cloudsplaining/bin/cli.py | mrpool404/cloudsplaining | 1,411 | 1742131 | #! /usr/bin/env python
# Copyright (c) 2020, salesforce.com, inc.
# All rights reserved.
# Licensed under the BSD 3-Clause license.
# For full license text, see the LICENSE file in the repo root
# or https://opensource.org/licenses/BSD-3-Clause
"""
Cloudsplaining is an AWS IAM Assessment tool that identifies violat... | 0 | 2 | 0 | 0 | 2 | 0 |
tests/test_preprocessing.py | abodacs/Megatron-DeepSpeed | 106 | 1742140 | # Copyright 2020 The HuggingFace Team. 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 applicabl... | 2 | 4 | 0 | 0 | 6 | 0 |
examples/hlapi/v1arch/asyncore/manager/cmdgen/pull-whole-mib.py | RKinsey/pysnmp | 492 | 1742141 | <gh_stars>100-1000
"""
Walk whole MIB
++++++++++++++
Send a series of SNMP GETBULK requests using the following options:
* with SNMPv2c, community 'public'
* over IPv4/UDP
* to an Agent at demo.snmplabs.com:161
* for all OIDs past 1.3.6.1.4.1
Functionally similar to:
| $ snmpwalk -v2c -c public demo.snmplabs.com 1.... | 0 | 0 | 0 | 0 | 0 | 0 |
var/spack/repos/builtin/packages/hsa-rocr-dev/package.py | pbrady/spack | 348 | 1742175 | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class HsaRocrDev(CMakePackage):
"""This repository includes the user mode API nterfaces and lib... | 0 | 1 | 5 | 0 | 6 | 0 |
modules/dbnd-airflow/src/dbnd_airflow/airflow_override/dbnd_airflow_windows/getuser.py | ipattarapong/dbnd | 224 | 1742180 | <reponame>ipattarapong/dbnd
import os
def _default_getuser():
return "unknown"
def find_runnable_getuser_function():
try:
if hasattr(os, "getlogin"):
os.getlogin()
return os.getlogin # check before we return it
import getpass
if not hasattr(getpass, "getus... | 0 | 0 | 0 | 0 | 0 | 0 |
pomegranate/distributions/NeuralNetworkWrapper.py | manishgit138/pomegranate | 3,019 | 1742187 | # NeuralNetworkWrapper.py
# Contact: <NAME> <<EMAIL>>
import numpy
class NeuralNetworkWrapper():
'''A wrapper for a neural network model for use in pomegranate.
This wrapper will store a pointer to the model, as well as an indicator
of what class it represents. It needs information about the number o... | 1 | 2 | 0 | 0 | 3 | 0 |
scripts/knowledge_distillation/main_teacher.py | johnson7788/EasyTransfer | 806 | 1742189 | <gh_stars>100-1000
# coding=utf-8
# Copyright (c) 2019 Alibaba PAI 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... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_json_encoding.py | Varriount/sanic | 4,959 | 1742190 | import sys
from dataclasses import asdict, dataclass
from functools import partial
from json import dumps as sdumps
import pytest
try:
from ujson import dumps as udumps
NO_UJSON = False
DEFAULT_DUMPS = udumps
except ModuleNotFoundError:
NO_UJSON = True
DEFAULT_DUMPS = partial(sdumps, separators... | 0 | 5 | 1 | 0 | 6 | 0 |
tests/distributions/test_relaxed_straight_through.py | tianjuchen/pyro | 4,959 | 1742192 | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from torch.autograd import grad
from torch.distributions import constraints
import pyro
import pyro.optim as optim
from pyro.distributions import (
OneHotCategorical,
RelaxedBernoulli,
Relaxe... | 0 | 0 | 0 | 0 | 0 | 0 |
prml/sampling/__init__.py | dinhtuyen/PRML01 | 11,017 | 1742202 | <reponame>dinhtuyen/PRML01<filename>prml/sampling/__init__.py
from prml.sampling.metropolis import metropolis
from prml.sampling.metropolis_hastings import metropolis_hastings
from prml.sampling.rejection_sampling import rejection_sampling
from prml.sampling.sir import sir
__all__ = [
"metropolis",
"metropoli... | 0 | 0 | 0 | 0 | 0 | 0 |
CalibCalorimetry/EcalTrivialCondModules/python/EcalTrivialCondRetriever_cfi.py | ckamtsikis/cmssw | 852 | 1742212 | import FWCore.ParameterSet.Config as cms
EcalTrivialConditionRetriever = cms.ESSource("EcalTrivialConditionRetriever",
TotLumi = cms.untracked.double(0.0),
InstLumi = cms.untracked.double(0.0),
producedEcalChannelStatus = cms.untracked.bool(True),
producedEcalDQMTowerStatus = cms.untracked.bool(True),
... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | Unite-Genomics/django-cognito-jwt | 139 | 1742224 | from setuptools import find_packages, setup
install_requires = [
"Django>=1.11",
"cryptography",
"djangorestframework",
"pyjwt",
"requests",
]
docs_require = [
"sphinx>=1.4.0",
]
tests_require = [
"coverage[toml]==5.0.3",
"pytest==5.3.5",
"pytest-django==3.8.0",
"pytest-cov==2... | 0 | 0 | 0 | 0 | 0 | 0 |
devil/devil/utils/logging_common.py | tingshao/catapult | 138 | 1742229 | # Copyright 2017 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
import logging
import sys
import time
def AddLoggingArguments(parser):
"""Adds standard logging flags to the parser.
... | 2 | 1 | 0 | 0 | 3 | 0 |
pde_superresolution/weno_test.py | gnicks007/data-driven-discretization-1d | 108 | 1742268 | # Copyright 2018 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 by applicable law or agreed to in writing, ... | 0 | 3 | 0 | 0 | 3 | 0 |
packages/pegasus-common/src/Pegasus/braindump.py | ahnitz/pegasus | 127 | 1742296 | """
:mod:`braindump` exposes an API to serialize and deserialize Pegasus's braindump file.
Basic Usage::
>>> from Pegasus import braindump
>>> braindump.loads("user: mayani\ngrid_dn: null\n")
{'grid_dn': None, 'user': 'mayani'}
>>> print(braindump.dumps({"grid_dn": None, "user": "mayani"}))
'{"gr... | 5 | 4 | 0 | 0 | 9 | 0 |
tools/fuchsia/comparative_tester/generate_perf_report.py | zealoussnow/chromium | 14,668 | 1742320 | <filename>tools/fuchsia/comparative_tester/generate_perf_report.py
#!/usr/bin/env python3
# Copyright 2018 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.
"""generate_perf_report.py is to be used after comparative_tester.py... | 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.