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 |
|---|---|---|---|---|---|---|---|---|---|---|
Wide&Deep/wide_component.py | suhuating/ML_CIA | 572 | 1772375 | import tensorflow as tf
_CSV_COLUMNS = [
'age', 'workclass', 'fnlwgt', 'education', 'education_num',
'marital_status', 'occupation', 'relationship', 'race', 'gender',
'capital_gain', 'capital_loss', 'hours_per_week', 'native_country',
'income_bracket'
]
_CSV_COLUMN_DEFAULTS = [[0], [''], [0], [''], [0... | 0 | 2 | 0 | 0 | 2 | 0 |
froide/foirequest/views/request.py | xenein/froide | 198 | 1772378 | <gh_stars>100-1000
from django.shortcuts import render, get_object_or_404, redirect
from django.views.generic import DetailView
from django.utils.translation import gettext as _
from froide.account.preferences import get_preferences_for_user
from froide.helper.utils import render_403
from ..models import FoiRequest, ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_agent_client.py | Teino1978-Corp/cloudtools-ssh-ca | 199 | 1772421 | <reponame>Teino1978-Corp/cloudtools-ssh-ca<filename>tests/test_agent_client.py
import base64
import os
import struct
import unittest
from ssh_ca import agent_client
class TestAgentSocketValidation(unittest.TestCase):
def test_nonexistent_explicit_path(self):
self.assertRaises(
agent_client.Ss... | 0 | 0 | 0 | 0 | 0 | 0 |
continuous_integration/check_no_test_skipped.py | wasserth/threadpoolctl | 214 | 1772443 | """Check tests are not skipped in every ci job"""
from __future__ import print_function
import os
import sys
import xml.etree.ElementTree as ET
base_dir = sys.argv[1]
# dict {test: result} where result is False if the test was skipped in every
# job and True otherwise.
always_skipped = {}
for name in os.listdir(b... | 0 | 0 | 0 | 0 | 0 | 0 |
download.py | cld378632668/ucas_course_tool | 289 | 1772450 | <filename>download.py
# -*- coding:utf8 -*-
# @file download.py
# @brief download
# @author libowei,<EMAIL>
# @version 0.2.00
# @date 2016-9-3
# 下载插件
import requests
import re
from bs4 import BeautifulSoup
import os
def download(url, fileName, className, session):
dir = os.getcwd() + "/" + className
file = o... | 0 | 0 | 0 | 0 | 0 | 0 |
drake/src/drake/cxx/bison.py | wk8/elle | 124 | 1772497 | <reponame>wk8/elle
# Copyright (C) 2009-2016, Quentin "mefyl" Hocquet
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more information.
from .. impo... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/exabgp/bgp/message/update/nlri/bgpls/tlvs/__init__.py | cloudscale-ch/exabgp | 1,560 | 1772520 | """
bgpls/tlvs/__init__.py
Created by <NAME> on 2016-11-26. <EMAIL>
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
License: 3-clause BSD. (See the COPYRIGHT file)
"""
from exabgp.bgp.message.update.nlri.bgpls.tlvs.node import NodeDescriptor
from exabgp.bgp.message.update.nlri.bgpls.tlvs.neighaddr import N... | 0 | 0 | 0 | 0 | 0 | 0 |
AutotestWebD/apps/webportal/scripts/web_portal_openApi_interface_test.py | yangjourney/sosotest | 422 | 1772525 | from __future__ import annotations
import django
import sys,os
rootpath = os.path.dirname(os.path.realpath(__file__)).replace("\\","/")
rootpath = rootpath.split("/apps")[0]
# print(rootpath)
syspath=sys.path
sys.path=[]
sys.path.append(rootpath) #指定搜索路径绝对目录
sys.path.extend([rootpath+i for i in os.listdir(rootpath) if ... | 0 | 1 | 0 | 0 | 1 | 0 |
src/olympia/shelves/migrations/0012_auto_20210218_1517.py | covariant/addons-server | 843 | 1772549 | # Generated by Django 2.2.18 on 2021-02-18 15:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('shelves', '0011_auto_20210215_1216'),
]
operations: list[object] = [
migrations.AlterField(
model_name='... | 0 | 0 | 2 | 0 | 2 | 0 |
pygimli/utils/postinversion.py | baender/gimli | 224 | 1772554 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import annotations
"""DOCUMENTME.
@author: Guenther.T
"""
import numpy as np
import pygimli as pg
from pygimli.utils import gmat2numpy
def iterateBounds(inv, dchi2: float=0.5, maxiter: int=100, change: float=1.02) -> tuple[object, object]:
"""Find p... | 3 | 2 | 0 | 0 | 5 | 0 |
src/dummy/toga_dummy/command.py | luizoti/toga | 1,261 | 1772606 | <filename>src/dummy/toga_dummy/command.py<gh_stars>1000+
from toga_dummy.utils import LoggedObject
class Command(LoggedObject):
def __init__(self, interface):
super().__init__()
self.interface = interface
def set_enabled(self, value):
self._action('set enabled', value=value)
| 0 | 0 | 0 | 0 | 0 | 0 |
RawToXML.py | ahaque/twitch-troll-detection | 107 | 1772621 | <filename>RawToXML.py
# <NAME>
# This converts the TwitchPlaysPokemon logs downloaded
# from online into an xml-like format
# April 2014
input_file = open("tpp_logs/tpp_2.log","r")
output_file = open("tpp-web-2.xml","w")
# Loads the entire file into memory, careful
lines = input_file.readlines()
currentLine = 0
for ... | 0 | 0 | 0 | 0 | 0 | 0 |
schools/academic/apps.py | joanayala/iem | 149 | 1772624 | <filename>schools/academic/apps.py
from django.apps import AppConfig
class AcademicConfig(AppConfig):
name = 'academic'
| 0 | 0 | 0 | 0 | 0 | 0 |
nonebot/exceptions.py | EVAyo/nonebot | 676 | 1772644 | from aiocqhttp import Error as CQHttpError
__all__ = [
'CQHttpError',
]
__autodoc__ = {
"CQHttpError": "等价于 `aiocqhttp.Error`。"
}
| 0 | 0 | 0 | 0 | 0 | 0 |
platypush/common/spotify/__init__.py | BlackLight/platypush | 228 | 1772655 | <reponame>BlackLight/platypush<filename>platypush/common/spotify/__init__.py
import json
import logging
import os
import pathlib
import re
from base64 import b64encode
from datetime import datetime, timedelta
from random import randint
from typing import Optional, Iterable
from urllib import parse
import requests
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
web3/providers/__init__.py | voBits/web3 | 326 | 1772681 | from .base import ( # noqa: F401
BaseProvider,
)
| 0 | 0 | 0 | 0 | 0 | 0 |
muddery/server/commands/combat.py | dongwudanci/muddery | 127 | 1772683 | <gh_stars>100-1000
"""
Battle commands. They only can be used when a character is in a combat.
"""
from evennia.utils import logger
from muddery.server.commands.base_command import BaseCommand
from muddery.server.utils.localized_strings_handler import _
class CmdCombatInfo(BaseCommand):
"""
Get combat info.
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/backend/integration/models/postgis/test_user.py | KathmanduLivingLabs/tasking-manager | 421 | 1772695 | <reponame>KathmanduLivingLabs/tasking-manager
from backend.models.postgis.user import User, UserRole, MappingLevel
from tests.backend.base import BaseTestCase
class TestUser(BaseTestCase):
def setUp(self):
super().setUp()
self.test_user = User()
self.test_user.role = UserRole.MAPPER.value
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/forker.py | notreal1995/pyflame | 2,705 | 1772709 | <filename>tests/forker.py
# Copyright 2017 <NAME> <<EMAIL>>
#
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/management/list_queues.py | ZygusPatryk/amqpstorm | 140 | 1772728 | <reponame>ZygusPatryk/amqpstorm
from amqpstorm import management
if __name__ == '__main__':
# If using a self-signed certificate, change verify=True to point at your CA bundle.
# You can disable certificate verification for testing by passing in verify=False.
API = management.ManagementApi('https://rmq.amq... | 0 | 0 | 0 | 0 | 0 | 0 |
rabbitmq-lambda/src/app.py | enochtsai/serverless-patterns | 883 | 1772746 | from __future__ import annotations
import json
import logging as log
import base64
def lambda_handler(event, context) -> dict[str,int | object] | dict[str,int]:
print("Target Lambda function invoked")
print(event)
if 'rmqMessagesByQueue' not in event:
print("Invalid event data")
return {
... | 0 | 1 | 0 | 0 | 1 | 0 |
tf_agents/train/ppo_learner_test_utils.py | Francis777/agents | 3,175 | 1772766 | # coding=utf-8
# Copyright 2020 The TF-Agents 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 1 | 2 | 0 | 1 | 4 | 0 |
tests/device/cli/piv/test_management_key.py | pavel-petrenko/yubikey-manager | 513 | 1772768 | from .util import (
old_new_new,
DEFAULT_PIN,
DEFAULT_MANAGEMENT_KEY,
NON_DEFAULT_MANAGEMENT_KEY,
)
import re
import pytest
class TestManagementKey:
def test_change_management_key_force_fails_without_generate(self, ykman_cli):
with pytest.raises(SystemExit):
ykman_cli(
... | 0 | 0 | 0 | 0 | 0 | 0 |
100-200q/129.py | rampup01/Leetcode | 990 | 1772798 | <filename>100-200q/129.py
'''
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents the number 123.
Find the total sum of all root-to-leaf numbers.
Note: A leaf is a node with no children.
Example:
Input: [... | 0 | 0 | 0 | 0 | 0 | 0 |
sample/views.py | personalcomputer/drf-schema-adapter | 140 | 1772828 | from django.views.generic import RedirectView
from rest_framework import viewsets
from sample.models import Product
from sample.serializers import ProductSerializer
class HomepageView(RedirectView):
url: str = '/api/'
class AbstractHowItWorksViewSet(viewsets.ModelViewSet):
called_counter: int = 0
d... | 0 | 1 | 2 | 0 | 3 | 0 |
detr_tf/logger/wandb_logging.py | nisarahamedk/detr-tensorflow | 112 | 1772855 | from __future__ import annotations
"""
This scripts is used to send training logs to Wandb.
"""
from typing import Union,Dict,Tuple
import tensorflow as tf
import numpy as np
try:
# Should be optional
import wandb
except:
wandb = None
import cv2
from ..loss.compute_map import cal_map, calc_map, APDat... | 42 | 7 | 2 | 0 | 51 | 0 |
k3d/test/test_visual_volume.py | mjpolak/K3D-jupyter | 704 | 1772867 | import k3d
import numpy as np
import pytest
from .plot_compare import *
import vtk
from vtk.util import numpy_support
def test_volume():
prepare()
reader = vtk.vtkXMLImageDataReader()
reader.SetFileName('./test/assets/volume.vti')
reader.Update()
vti = reader.GetOutput()
x, y, z = vti.GetDim... | 0 | 0 | 0 | 0 | 0 | 0 |
test/test_testing_utils.py | mpasternak/hendrix | 309 | 1772874 | <gh_stars>100-1000
import pytest
from hendrix.experience import crosstown_traffic
from hendrix.utils.test_utils import AsyncTestMixin, crosstownTaskListDecoratorFactory
def test_assert_num_tasks():
a_mixin = AsyncTestMixin()
a_mixin.sub_setUp()
a_mixin.assertNumCrosstownTasks(0)
def some_task():
... | 0 | 0 | 0 | 0 | 0 | 0 |
algorithms/Python/BorweinsAlgorithm/Borwein_algorithm.py | herrphon/Algorithms_Example | 315 | 1772886 | <gh_stars>100-1000
# Calculates an estimation for 1/pi
# with various convergences
import numpy as np
def Borwein_2(k): # Quadratic convergence
a = np.sqrt(2)
b = 0
p = 2 + np.sqrt(2)
for i in range(k):
b = (1+b)*np.sqrt(a)/(a+b)
a = (np.sqrt(a)+1/np.sqrt(a))/2
p = ((1+a)*p*b)/(1+b)
return p
def Borw... | 0 | 0 | 0 | 0 | 0 | 0 |
neuralmonkey/train.py | maxblunck/neuralmonkey | 446 | 1772887 | <reponame>maxblunck/neuralmonkey
"""Training script for sequence to sequence learning."""
# pylint: disable=unused-import, wrong-import-order
import neuralmonkey.checkpython
# pylint: enable=unused-import, wrong-import-order
import argparse
import os
import shlex
from shutil import copyfile
import sys
import tracebac... | 0 | 0 | 0 | 0 | 0 | 0 |
openfermioncirq/variational/variational_black_box_test.py | viathor/OpenFermion-Cirq | 278 | 1772928 | <reponame>viathor/OpenFermion-Cirq
# 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 |
mediasoup-client/deps/webrtc/src/build/download_translation_unit_tool.py | skgwazap/mediasoup-client-android | 2,151 | 1772941 | #!/usr/bin/env python
# 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.
"""Script to download Clang translation_unit tool from google storage."""
import find_depot_tools
import json
import os
import shutil
... | 0 | 1 | 0 | 0 | 1 | 0 |
notifications/tests/sample_notifications/__init__.py | cron-ooo/django-notifications | 1,354 | 1772966 | <reponame>cron-ooo/django-notifications
default_app_config = 'notifications.tests.sample_notifications.apps.SampleNotificationsConfig'
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/testing_config/custom_components/test/select.py | MrDelik/core | 30,023 | 1772976 | from __future__ import annotations
"""
Provide a mock select platform.
Call init before using it in your tests to ensure clean test data.
"""
from homeassistant.components.select import SelectEntity
from tests.common import MockEntity
UNIQUE_SELECT_1 = "unique_select_1"
UNIQUE_SELECT_2 = "unique_select_2"
ENTITIES ... | 3 | 3 | 1 | 0 | 7 | 0 |
2014/CVE-2014-3206/poc/pocsploit/CVE-2014-3206.py | hjyuan/reapoc | 421 | 1772981 | from __future__ import annotations
import requests
from plugins.oob import verify_request, gen_oob_domain
# Vuln Base Info
def info() -> dict[str,dict[str,str] | list[str] | str]:
return {
"author": "cckuailong",
"name": '''Seagate BlackArmor NAS - Command Injection''',
"description": '''... | 0 | 5 | 0 | 0 | 5 | 0 |
libcity/model/traffic_speed_prediction/DCRNN.py | moghadas76/test_bigcity | 221 | 1773026 | from __future__ import annotations
import scipy.sparse as sp
from scipy.sparse import linalg
import numpy as np
import torch
import torch.nn as nn
from logging import getLogger
from libcity.model.abstract_traffic_state_model import AbstractTrafficStateModel
from libcity.model import loss
def calculate_normalized_lapl... | 14 | 18 | 0 | 1 | 33 | 0 |
tests/components/stookalert/__init__.py | MrDelik/core | 30,023 | 1773040 | """Tests for the Stookalert integration."""
| 0 | 0 | 0 | 0 | 0 | 0 |
jsonview/views.py | Nefonfo/django-jsonview | 165 | 1773066 | from django.utils.decorators import method_decorator
from django.views.generic import View
from django.views.generic.base import ContextMixin
from jsonview.decorators import json_view
class JsonView(ContextMixin, View):
def get_context_data(self, **kwargs) -> dict[object,object]:
return {}
def get(... | 0 | 3 | 0 | 0 | 3 | 0 |
172 Factorial Trailing Zeroes.py | ChiFire/legend_LeetCode | 872 | 1773080 | """
Given an integer n, return the number of trailing zeroes in n!.
Note: Your solution should be in logarithmic time complexity.
"""
__author__ = 'Daniel'
class Solution:
def trailingZeroes(self, n) -> object:
"""
10 = 5*2
Number of 2's > number of 5's, thus count the number of 5 in the ... | 0 | 1 | 0 | 0 | 1 | 0 |
descarteslabs/catalog/attributes.py | descarteslabs/descarteslabs-python | 167 | 1773082 | <gh_stars>100-1000
import numbers
import re
from collections.abc import Iterable, Mapping, MutableMapping, MutableSequence
from datetime import datetime
from enum import Enum
from pytz import utc
from descarteslabs.common.shapely_support import (
geometry_like_to_shapely,
shapely_to_geojson,
)
def parse_iso... | 0 | 0 | 0 | 0 | 0 | 0 |
common/const.py | CptnDuras/saltshaker_api | 115 | 1773122 | <reponame>CptnDuras/saltshaker_api<filename>common/const.py
# -*- coding:utf-8 -*-
role_dict = {
"superuser": 0,
"common_user": 1,
"product": 2,
"user": 3,
"acl": 4
}
period_status = {
0: "创建中",
1: "等待运行",
2: "运行中",
3: "完成",
4: "失败",
5: "被暂停",
6: "等待周期",
7: "第%s组运行中"... | 0 | 0 | 0 | 0 | 0 | 0 |
python/group_spitter.py | Pandinosaurus/caffe-1 | 414 | 1773132 | <reponame>Pandinosaurus/caffe-1
import caffe
import re
from pittnuts import *
import os
import matplotlib.pyplot as plt
import argparse
import caffeparser
import caffe_apps
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--original_alexnet', type=str, required=True,help="The ... | 0 | 0 | 0 | 0 | 0 | 0 |
config/train/cifar100/densenet_small_kd.py | HwangJohn/model_compression | 216 | 1773151 | <reponame>HwangJohn/model_compression
# -*- coding: utf-8 -*-
"""Configurations for knowledge distillation with densenet.
- Author: <NAME>
- Email: <EMAIL>
"""
from config.train.cifar100 import densenet_small
config = densenet_small.config
config_override = {
"CRITERION": "HintonKLD",
"CRITERION_PARAMS": dic... | 0 | 0 | 0 | 0 | 0 | 0 |
python/appdash/__init__.py | gururajrkatti/appdash | 1,794 | 1773192 | <filename>python/appdash/__init__.py
from spanid import *
from event import *
from recorder import *
| 0 | 0 | 0 | 0 | 0 | 0 |
corehq/messaging/scheduling/migrations/0008_timedschedule_event_type.py | dimagilg/commcare-hq | 471 | 1773200 | # Generated by Django 1.11.7 on 2017-12-12 13:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('scheduling', '0007_add_schedule_ui_type'),
]
operations: list[object] = [
migrations.AddField(
model_nam... | 0 | 0 | 2 | 0 | 2 | 0 |
cacreader/swig-4.0.2/Examples/test-suite/python/doxygen_parsing_runme.py | kyletanyag/LL-Smartcard | 1,031 | 1773226 | import doxygen_parsing
import inspect
import string
import os
import sys
import comment_verifier
comment_verifier.check(inspect.getdoc(doxygen_parsing.someFunction),
"The function comment")
comment_verifier.check(inspect.getdoc(doxygen_parsing.SomeClass),
"The class comment")
comment_verifier.check(inspect.get... | 0 | 0 | 0 | 0 | 0 | 0 |
example/cifar10/deepdefense.py | KuanKuanQAQ/ares | 206 | 1773233 | <reponame>KuanKuanQAQ/ares<filename>example/cifar10/deepdefense.py<gh_stars>100-1000
'''
This file provides a wrapper class for deep defense (https://github.com/ZiangYan/deepdefense.pytorch) model for CIFAR-10
dataset.
'''
import sys
import os
THIRD_PARTY_PATH = os.path.abspath(os.path.join(os.path.dirname(os.path.ab... | 0 | 0 | 0 | 0 | 0 | 0 |
advtest_iterative_blackbox.py | yyht/Max-Mahalanobis-Training | 107 | 1773242 | from __future__ import annotations
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten, Lambda
from keras.optimizers import Adam, SGD
from keras.callbacks import ModelCheckpoint, LearningRateS... | 0 | 3 | 0 | 0 | 3 | 0 |
pytorch_networks/surface_normals/utils/depth_numpy_to_exr.py | AriaPs/cleargrasp | 191 | 1773251 | <reponame>AriaPs/cleargrasp
#!/usr/bin/env python3
import os
from termcolor import colored
import fnmatch
import argparse
import json
import shutil
import glob
import concurrent.futures
import time
import tqdm
import OpenEXR
import Imath
import numpy as np
from PIL import Image
from pathlib import Path
import imageio... | 0 | 0 | 0 | 0 | 0 | 0 |
poshc2/client/reporting/ReportKeys.py | nettitude/PoshC2_Python | 237 | 1773253 | from enum import Enum
class ReportKeys(Enum):
Tasks: list[str] = ['TaskID', 'Context', 'Command', 'Output', 'User', 'SentTime', 'CompletedTime', 'ImplantID']
C2Server: list[str] = ['ID', 'PayloadCommsHost', 'EncKey', 'DomainFrontHeader', 'DefaultSleep', 'KillDate', 'GET_404_Response', 'PoshProjectDirectory', '... | 0 | 0 | 6 | 0 | 6 | 0 |
src/research/three_phase/Engine/Numerical/numerical_power_flow.py | mzy2240/GridCal | 284 | 1773261 | """
N phase calculation engine
(c) <NAME>, 2018
"""
import numpy as np
from scipy.sparse.linalg import spsolve
from scipy.sparse import csc_matrix, hstack, vstack
from scipy.sparse.linalg import factorized
from scipy.sparse.linalg import splu
def gauss_seidel_power_flow(Vbus, Sbus, Ibus, Ybus,
... | 8 | 9 | 0 | 0 | 17 | 0 |
platypush/plugins/google/youtube/__init__.py | BlackLight/platypush | 228 | 1773310 | from __future__ import annotations
"""
.. moduleauthor:: <NAME> <<EMAIL>>
"""
from platypush.plugins import action
from platypush.plugins.google import GooglePlugin
class GoogleYoutubePlugin(GooglePlugin):
"""
YouTube plugin.
Requires:
* **google-api-python-client** (``pip install google-api-py... | 4 | 1 | 3 | 0 | 8 | 0 |
build/docs/extract.py | brezillon/opensplice | 133 | 1773361 | #!/usr/bin/python
import sys
import re
all_features = ['OSPL']
ignore_regex = ['<\?xml .*\?>',
'<splice_meta_config version=.*>',
'<!--xmlns:xsi=.*-->',
'<serviceMapping>',
'<element name=.* command=.*>',
'</serviceMapping>',
... | 0 | 1 | 0 | 1 | 2 | 0 |
qa/rpc-tests/excessive.py | gandrewstone/bitcoin | 535 | 1773386 | <reponame>gandrewstone/bitcoin<filename>qa/rpc-tests/excessive.py
#!/usr/bin/env python3
# Copyright (c) 2015-2017 The Bitcoin Unlimited developers
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/license... | 0 | 0 | 0 | 0 | 0 | 0 |
lantern/plotting/plot_bokeh.py | timkpaine/lantern | 306 | 1773415 | from __future__ import annotations
import copy
import pandas as pd
from bokeh.plotting import figure, show, output_notebook
from bokeh.models import Legend, Span
# from bokeh.models import HoverTool
from ..utils import in_ipynb
from .plotobj import BasePlot
from .plotutils import get_color
_INITED = False
class Boke... | 32 | 2 | 0 | 1 | 35 | 0 |
test/py/ganeti.jstore_unittest.py | modulus-sa/ganeti | 396 | 1773449 | <reponame>modulus-sa/ganeti<gh_stars>100-1000
#!/usr/bin/python3
#
# Copyright (C) 2012 Google Inc.
# 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 re... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/create_jit_models.py | rozgo/tch-rs | 1,600 | 1773450 | <reponame>rozgo/tch-rs<filename>tests/create_jit_models.py<gh_stars>1000+
import torch
class Foo(torch.jit.ScriptModule):
def __init__(self, v):
super(Foo, self).__init__()
self.register_buffer('value', v)
@torch.jit.script_method
def forward(self, x, y):
return 2 * x + y + self.va... | 0 | 0 | 0 | 0 | 0 | 0 |
homeassistant/components/aprs/__init__.py | domwillcode/home-assistant | 30,023 | 1773466 | <filename>homeassistant/components/aprs/__init__.py
"""The APRS component."""
| 0 | 0 | 0 | 0 | 0 | 0 |
src/sage/tests/books/judson-abstract-algebra/integers-sage.py | bopopescu/sage | 1,742 | 1773471 | <gh_stars>1000+
## -*- coding: utf-8 -*- ##
## Sage Doctest File ##
#**************************************#
#* Generated from PreTeXt source *#
#* on 2017-08-24T11:43:34-07:00 *#
#* *#
#* http://mathbook.pugetsound.edu *#
#* ... | 0 | 0 | 0 | 0 | 0 | 0 |
src/arch/x86/isa/insts/general_purpose/rotate_and_shift/rotate.py | qianlong4526888/haha | 135 | 1773475 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_ui_implementations/test_text_block_imp.py | VivumLab/py_cui | 654 | 1773481 | import pytest # noqa
import py_cui
def test_move_right(SCROLLTEXTBLOCK):
text_box = SCROLLTEXTBLOCK('Hello World')
text_box._move_right()
cursor_x, _ = text_box.get_abs_cursor_position()
text_x, _ = text_box.get_cursor_text_pos()
assert text_x == 1
assert cursor_x == 43
def test_move_left_s... | 0 | 0 | 0 | 0 | 0 | 0 |
nvchecker_source/none.py | trathborne/nvchecker | 320 | 1773487 | <filename>nvchecker_source/none.py
# MIT licensed
# Copyright (c) 2020 lilydjwg <<EMAIL>>, et al.
from __future__ import annotations
from nvchecker.api import (
BaseWorker, GetVersionError, RawResult,
)
class Worker(BaseWorker):
async def run(self) -> None:
exc = GetVersionError('no source specified')
as... | 0 | 0 | 0 | 0 | 0 | 0 |
rlcycle/build.py | cyoon1729/Rlcycle | 128 | 1773496 | import gym
import hydra
from omegaconf import DictConfig
from rlcycle.common.abstract.action_selector import ActionSelector
from rlcycle.common.abstract.learner import LearnerBase
from rlcycle.common.abstract.loss import Loss
from rlcycle.common.models.base import BaseModel
from rlcycle.common.utils.env_generator impo... | 15 | 7 | 0 | 0 | 22 | 0 |
oss_src/unity/python/sframe/meta/asttools/visitors/copy_tree.py | venkattgg/venkey | 493 | 1773540 | '''
Created on Dec 12, 2011
@author: sean
'''
from ..asttools import Visitor
import ast
#FIXME: add tests
class CopyVisitor(Visitor):
'''
Copy only ast nodes and lists
'''
def visitDefault(self, node) -> object:
Node = type(node)
new_node = Node()
for _field in Node._f... | 0 | 2 | 0 | 0 | 2 | 0 |
libraries/botframework-streaming/tests/test_payload_processor.py | andreikop/botbuilder-python | 388 | 1773559 | from typing import List
from uuid import UUID, uuid4
import aiounittest
from botframework.streaming import ReceiveRequest
from botframework.streaming.payloads import StreamManager
from botframework.streaming.payloads.assemblers import (
ReceiveRequestAssembler,
PayloadStreamAssembler,
)
from botframework.strea... | 3 | 1 | 4 | 0 | 8 | 0 |
samples/queue/encryption_usage.py | amerkel2/azure-storage-python | 348 | 1773593 | <filename>samples/queue/encryption_usage.py
# -------------------------------------------------------------------------
# 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 |
neuralcompression/models/scale_hyperprior.py | tallamjr/NeuralCompression | 233 | 1773607 | # 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.
# Copyright 2020 InterDigital Communications, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 41 | 15 | 0 | 0 | 56 | 0 |
tools/legacy/gplib.py | YangHao666666/hawq | 450 | 1773611 | # 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 |
applications/cableplan/cableplan.py | richardstrnad/acitoolkit | 351 | 1773634 | ################################################################################
# _ ____ ___ #
# / \ / ___|_ _| #
# / _ \| | | | ... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/pytorch-quantization/pytorch_quantization/nn/_functions/quant_rnn.py | martellz/TensorRT | 5,249 | 1773837 | #
# Copyright (c) 2021, NVIDIA CORPORATION. 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 appl... | 25 | 17 | 0 | 0 | 42 | 0 |
tests/test_memory.py | EdwardWooCN/bplustree | 760 | 1773868 | from __future__ import annotations
import io
import os
import platform
from unittest import mock
import pytest
from bplustree.node import LeafNode, FreelistNode
from bplustree.memory import (
FileMemory, open_file_in_dir, WAL, ReachedEndOfFile, write_to_file
)
from bplustree.const import TreeConf
from .conftest i... | 0 | 2 | 0 | 0 | 2 | 0 |
src/python/grapl-common/tests/metrics/test_metric_reporter.py | msilvey/grapl | 313 | 1773874 | from datetime import datetime
from typing import List
from grapl_common.metrics.metric_reporter import MetricReporter, TagPair
from grapl_common.time_utils import MillisDuration
class TestMetricReporter:
def test__smoke_test(self) -> None:
f = Fixture()
tags = (TagPair("k1", "v1"), TagPair("k2", ... | 1 | 6 | 0 | 2 | 9 | 0 |
tests/openbb_terminal/cryptocurrency/nft/test_opensea_view.py | tehcoderer/GamestonkTerminal | 255 | 1773880 | <gh_stars>100-1000
import pytest
from openbb_terminal.cryptocurrency.nft import opensea_view
@pytest.mark.vcr
@pytest.mark.record_stdout
def test_display_collection_stats():
opensea_view.get_collection_stats("mutant-ape-yacht-club")
| 0 | 0 | 0 | 0 | 0 | 0 |
flow/multiagent_envs/loop/loop_accel.py | SHITIANYU-hue/flow | 805 | 1773906 | """Pending deprecation file.
To view the actual content, go to: flow/envs/multiagent/ring/accel.py
"""
from flow.utils.flow_warnings import deprecated
from flow.envs.multiagent.ring.accel import AdversarialAccelEnv as MAAEnv
@deprecated('flow.multiagent_envs.loop.loop_accel',
'flow.envs.multiagent.ring.a... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/PySys/tedge/tedge_agent_user_sudo_access/run.py | itsyitsy/thin-edge.io | 102 | 1773907 | <filename>tests/PySys/tedge/tedge_agent_user_sudo_access/run.py
import time
from pysys.basetest import BaseTest
import subprocess
from threading import Timer
"""
Validate tedge-agent user has a limited sudo right
Given tedge_apt_plugin and tedge_agent are installed
When we run plugin located in plugin directory as te... | 0 | 0 | 0 | 0 | 0 | 0 |
src/flupy/cli/cli.py | magnus-lycka/flupy | 170 | 1773909 | <reponame>magnus-lycka/flupy<filename>src/flupy/cli/cli.py
import argparse
import importlib
import sys
from signal import SIG_DFL, SIGPIPE, signal
from typing import Any, Dict, Generator, List, Optional
from flupy import __version__, flu, walk_dirs, walk_files
def read_file(path: str) -> Generator[str, None, None]:
... | 0 | 0 | 0 | 0 | 0 | 0 |
grove/led/__init__.py | Hansen0314/grove.py | 122 | 1773921 | <gh_stars>100-1000
from .one_led import OneLed,OneLedTypedGpio
__all__ = ["OneLed", "OneLedTypedGpio" ]
| 0 | 0 | 0 | 0 | 0 | 0 |
vlcp/utils/exceptions.py | hubo1016/vlcp | 252 | 1773980 | <reponame>hubo1016/vlcp
'''
Created on 2018/7/2
:author: hubo
'''
class ModuleAPICallTimeoutException(Exception):
pass
class APIRejectedException(Exception):
pass
class StaleResultException(Exception):
def __init__(self, result, desc = "Result is stale"):
Exception.__init__(self, desc)
... | 0 | 0 | 0 | 0 | 0 | 0 |
dali/test/python/test_operator_pad.py | cyyever/DALI | 3,967 | 1773996 | <reponame>cyyever/DALI<gh_stars>1000+
# Copyright (c) 2019, NVIDIA CORPORATION. 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/LIC... | 0 | 0 | 0 | 0 | 0 | 0 |
SearchService2/appscale/search/constants.py | loftwah/appscale | 790 | 1774007 | <reponame>loftwah/appscale
from appscale.search.protocols import search_pb2
# Max amount of time to wait for response from Solr (in seconds).
SOLR_TIMEOUT = 60
# Max amount of time to wait before commit updates (in milliseconds).
SOLR_COMMIT_WITHIN = 0
# Name of Solr configs set for appscale collections.
APPSCALE_CO... | 0 | 0 | 0 | 0 | 0 | 0 |
mctorch/nn/modules/__init__.py | SatyadevNtv/mctorch | 188 | 1774009 | from .linear import rLinear
from .conv import rConv1d, rConv2d, rConv3d | 0 | 0 | 0 | 0 | 0 | 0 |
slides/snippets/slides_create_bulleted_text.py | himanshupr2627/python-samples | 479 | 1774015 | """
Copyright 2022 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 to in writing, software
dis... | 0 | 1 | 0 | 0 | 1 | 0 |
habitat/tasks/rearrange/sub_tasks/place_task.py | jturner65/habitat-api | 489 | 1774044 | #!/usr/bin/env python3
# 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.
from habitat.core.dataset import Episode
from habitat.core.registry import registry
from habitat.tasks.rearrange.sub_ta... | 1 | 4 | 0 | 0 | 5 | 0 |
modules/video/multiple_object_tracking/jde_darknet53/dataset.py | AK391/PaddleHub | 8,360 | 1774055 | <filename>modules/video/multiple_object_tracking/jde_darknet53/dataset.py
# 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
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/fpga/veclen_conversion_connector_test.py | jnice-81/dace | 227 | 1774058 | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import argparse
import numpy as np
from veclen_conversion_test import SIZE, VECTOR_LENGTH, make_sdfg
from dace.fpga_testing import fpga_test
@fpga_test()
def test_veclen_conversion_connector() -> object:
size = 128
vector_length = 4
... | 0 | 1 | 0 | 0 | 1 | 0 |
InvenTree/stock/migrations/0049_auto_20200820_0454.py | ArakniD/InvenTree | 656 | 1774077 | <reponame>ArakniD/InvenTree
# Generated by Django 3.0.7 on 2020-08-20 04:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('company', '0023_auto_20200808_0715'),
('stock', '0048_auto_20200807_2344'),
]
o... | 0 | 0 | 0 | 0 | 0 | 0 |
calliope/core/util/dataset.py | FraSanvit/calliope | 180 | 1774082 | """
Copyright (C) since 2013 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
"""
from calliope import exceptions
import xarray as xr
import pandas as pd
def reorganise_xarray_dimensions(data) -> object:
"""
Reorganise Dataset or DataArray dimensions to be a... | 0 | 1 | 0 | 0 | 1 | 0 |
capstone/scripts/tests/test_snippet_updaters.py | rachelaus/capstone | 134 | 1774090 | <reponame>rachelaus/capstone
import pytest
import json
from scripts import update_snippets
from capdb.models import Snippet
@pytest.mark.django_db(databases=['capdb'])
def test_map_numbers(case_factory, jurisdiction):
[case_factory(jurisdiction=jurisdiction) for i in range(3)]
update_snippets.update_map_number... | 0 | 0 | 0 | 0 | 0 | 0 |
components/mpas-seaice/testing_and_setup/testcases/spherical_operators/strain/average_variational_strains.py | Fa-Li/E3SM | 235 | 1774115 | <filename>components/mpas-seaice/testing_and_setup/testcases/spherical_operators/strain/average_variational_strains.py
from netCDF4 import Dataset
import numpy as np
#-------------------------------------------------------------------------------
def average_variational_strains():
gridSizes = [2562, 10242, 40962... | 0 | 0 | 0 | 0 | 0 | 0 |
python/ql/test/2/query-tests/Exceptions/raising/test.py | vadi2/codeql | 4,036 | 1774124 |
def ok():
raise Exception, "message"
def bad1():
ex = Exception, "message"
raise ex
def bad2():
raise (Exception, "message")
def bad3():
ex = Exception,
raise ex, "message"
| 0 | 0 | 0 | 0 | 0 | 0 |
homophonous_logography/lexical/wikipron_lscores_main.py | DionysisChristopoulos/google-research | 23,901 | 1774168 | <gh_stars>1000+
# coding=utf-8
# Copyright 2021 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/LICENSE-2.0
#
# Unless requ... | 0 | 0 | 0 | 0 | 0 | 0 |
espnet/bin/asr_recog.py | MarkWuNLP/StreamingTransformer | 252 | 1774179 | #!/usr/bin/env python3
# encoding: utf-8
# Copyright 2017 Johns Hopkins University (<NAME>)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""End-to-end speech recognition model decoding script."""
import configargparse
import logging
import os
import random
import sys
import numpy as np
from espnet.u... | 0 | 1 | 0 | 0 | 1 | 0 |
questions/46721954/main.py | sesu089/stackoverflow | 302 | 1774207 | import sys
from PyQt5.QtCore import QUrl, QMetaObject, Q_ARG, QVariant, QTimer, \
QDate
from PyQt5.QtQuickWidgets import QQuickWidget
from PyQt5.QtWidgets import QApplication
counter = 0
def onTimeout(obj):
global counter
value = {"lesson": str(counter), "subject": "PE", "day": QDate.longDayName(1 + cou... | 0 | 0 | 0 | 0 | 0 | 0 |
ranking/migrations/0035_auto_20200429_1941.py | horacexd/clist | 166 | 1774220 | # Generated by Django 2.2.10 on 2020-04-29 21:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('ranking', '0034_auto_20200429_1924'),
]
operations: list[object] = [
migrations.AlterField(
model_name='... | 0 | 0 | 2 | 0 | 2 | 0 |
env/Lib/site-packages/OpenGL/GLES2/NV/viewport_array2.py | 5gconnectedbike/Navio2 | 210 | 1774255 | <reponame>5gconnectedbike/Navio2
'''OpenGL extension NV.viewport_array2
This module customises the behaviour of the
OpenGL.raw.GLES2.NV.viewport_array2 to provide a more
Python-friendly API
Overview (from the spec)
This extension provides new support allowing a single primitive to be
broadcast to multiple viewp... | 0 | 0 | 0 | 0 | 0 | 0 |
mt3/event_codec.py | zhiiker/mt3 | 584 | 1774266 | # Copyright 2022 The MT3 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 to in writ... | 7 | 6 | 5 | 0 | 18 | 0 |
marketplaces/apps/support/models.py | diassor/CollectorCity-Market-Place | 135 | 1774270 | from django.db import models
class FeaturesHelpText(models.Model):
auctions = models.TextField(default="Help text description here!")
wishlist = models.TextField(default="Help text description here!")
mailinglist = models.TextField(default="Help text description here!")
google_analytics = models.TextFi... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/install/sqlserver_example/scripts/python3.6/index.py | npmmirror/funcraft | 724 | 1774272 | import pymssql
def handler(event, context) -> object:
conn = pymssql.connect(
host=r'docker.for.mac.host.internal',
user=r'SA',
password=r'<PASSWORD>',
database='TestDB'
)
cursor = conn.cursor()
cursor.execute('SELECT * FROM inventory WHERE quantity > 152')
... | 0 | 1 | 0 | 0 | 1 | 0 |
gengine/app/tests_old/test_goal.py | greck2908/gamification-engine | 347 | 1774281 | from gengine.app.tests.base import BaseDBTest
from gengine.app.tests.helpers import create_user, create_achievement, create_variable, create_goals, create_goal_properties, create_goal_evaluation_cache
from gengine.app.model import Achievement, User, Goal, Value
class TestEvaluateGoal(BaseDBTest):
def test_comput... | 0 | 0 | 0 | 0 | 0 | 0 |
src/connection-monitor-preview/azext_connection_monitor_preview/_client_factory.py | Mannan2812/azure-cli-extensions | 207 | 1774297 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 0 | 3 | 0 | 0 | 3 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.