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 |
|---|---|---|---|---|---|---|---|---|---|---|
starry/_core/ops/rotation.py | shashankdholakia/starry | 116 | 1638282 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from ...compat import Apply, Op, tt
import numpy as np
__all__ = ["dotROp", "tensordotRzOp"]
class dotROp(Op):
def __init__(self, func):
self.func = func
self._grad_op = dotRGradientOp(self)
def make_node(self, *inputs):
inputs = [tt.as_tens... | 0 | 0 | 0 | 0 | 0 | 0 |
objmodel/countlines.py | SunGuo/500lines | 134 | 1638334 | <filename>objmodel/countlines.py
import os
import difflib
currdir = os.path.dirname(os.path.abspath(__file__))
dirs = [p for p in os.listdir(currdir) if os.path.isdir(p)]
dirs.sort()
total = 0
print dirs[0]
prev = {}
for fn in sorted(os.listdir(dirs[0])):
fulln = os.path.join(dirs[0], fn)
if not fn.endswith... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/suite/test_v_s_route_api.py | snebel29/kubernetes-ingress | 3,803 | 1638337 | import pytest
import requests
import json
from settings import NGINX_API_VERSION
from suite.nginx_api_utils import wait_for_empty_array, wait_for_non_empty_array, get_nginx_generation_value
from suite.resources_utils import scale_deployment
@pytest.mark.vsr
@pytest.mark.skip_for_nginx_oss
@pytest.mark.parametrize('... | 0 | 0 | 0 | 0 | 0 | 0 |
bot/exts/recruitment/talentpool/__init__.py | hugovk/bot | 1,003 | 1638380 | <filename>bot/exts/recruitment/talentpool/__init__.py<gh_stars>1000+
from bot.bot import Bot
def setup(bot: Bot) -> None:
"""Load the TalentPool cog."""
from bot.exts.recruitment.talentpool._cog import TalentPool
bot.add_cog(TalentPool(bot))
| 0 | 0 | 0 | 0 | 0 | 0 |
api/test/integration/api/test/account/testCreateAccount.py | ycyun/ablestack-cloud | 1,131 | 1638412 | <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 |
calico/datadog_checks/calico/__init__.py | davidlrosenblum/integrations-extras | 158 | 1638415 | from .__about__ import __version__
from .check import CalicoCheck
__all__ = ['__version__', 'CalicoCheck']
| 0 | 0 | 0 | 0 | 0 | 0 |
magpie/handler/login.py | tony-o/magpie | 291 | 1638417 | from urllib2 import quote, unquote
import bcrypt
from base import BaseHandler
class LoginHandler(BaseHandler):
def get(self):
error = self.get_argument('error', None)
self.render('login.html', error=error, hide_notebooks=True)
def post(self):
username = self.get_argument('username', ... | 0 | 0 | 0 | 0 | 0 | 0 |
python/tests/check.py | AdelekeBankole/libCEED | 123 | 1638422 | <filename>python/tests/check.py
import inspect
import os
def output(capsys):
stdout, stderr = capsys.readouterr()
caller = inspect.stack()[1]
caller_dirname = os.path.dirname(caller.filename)
output_file = os.path.join(
caller_dirname,
'output',
caller.function +
'.out... | 0 | 0 | 0 | 0 | 0 | 0 |
space4hgnn/figure/distribution.py | jingmouren/OpenHGNN | 235 | 1638435 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import random
import os
import json
import scipy
import scipy.stats
jian_file = 'result2'
grid_file = 'result2'
datasets = ['HGBn-ACM', 'HGBn-DBLP', 'HGBn-IMDB', 'HNE-PubMed', 'HGBn-Freebase', 'HGBn-ACM']
xL = [[[0, 1... | 2 | 1 | 0 | 0 | 3 | 0 |
boto3_type_annotations_with_docs/boto3_type_annotations/kafka/client.py | cowboygneox/boto3_type_annotations | 119 | 1638437 | from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def can_paginate(self, operation_name: str = None):
"""
C... | 28 | 9 | 0 | 0 | 37 | 0 |
src/pretalx/submission/migrations/0027_auto_20180812_1647.py | hrchu/pretalx | 418 | 1638442 | # Generated by Django 2.0.8 on 2018-08-12 21:47
from django.db import migrations
import i18nfield.fields
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
("submission", "0026_auto_20180811_1827"),
]
operations: list[object] = [
migrations.AlterField(
... | 0 | 0 | 2 | 0 | 2 | 0 |
tests/test_eval_model_video.py | Conzel/CompressAI | 515 | 1638458 | # Copyright (c) 2021-2022, InterDigital Communications, Inc
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted (subject to the limitations in the disclaimer
# below) provided that the following conditions are met:
# * Redistributions of source cod... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_ingredient_parser.py | whitew1994WW/PyIng | 121 | 1638482 | <filename>tests/test_ingredient_parser.py
import unittest
import PyIng
import numpy as np
import unittest.mock as mock
class TestIngredientParser(unittest.TestCase):
def test_parse_ingredients(self):
self.assertEqual(True, True)
def test_build_tf_interreter(self):
interpreter = PyIng.ingredie... | 0 | 0 | 0 | 0 | 0 | 0 |
Basic/Reverse A String/SolutionByVaishnavi.py | rajethanm4/Programmers-Community | 261 | 1638494 | #for reverse string
str = input('String= ')
#reverse string using slice operator
print(str[::-1])
| 0 | 0 | 0 | 0 | 0 | 0 |
calamari_ocr/scripts/split_to_folds.py | jacektl/calamari | 922 | 1638541 | import argparse
import os
import shutil
import tfaip.util.logging as logging
from tfaip.data.pipeline.definitions import PipelineMode
from tqdm import tqdm
from calamari_ocr.ocr import CrossFold
from calamari_ocr.ocr.dataset.datareader.file import FileDataParams
from calamari_ocr.utils import split_all_ext, glob_all
... | 0 | 0 | 0 | 0 | 0 | 0 |
spacy/lang/lt/examples.py | snosrap/spaCy | 22,040 | 1638557 | """
Example sentences to test spaCy and its language models.
>>> from spacy.lang.lt.examples import sentences
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"Jaunikis pirmąją vestuvinę naktį iškeitė į areštinės gultą",
"Bepiločiai automobiliai išnaikins vairavimo mokyklas, autoservisus ir eismo nelaimes",
... | 0 | 0 | 0 | 0 | 0 | 0 |
source/models/utils.py | SizheWei/OpenCompoundDomainAdaptation-OCDA | 136 | 1638596 | <filename>source/models/utils.py
import torch.nn as nn
from torch.nn import init
import torch
models = {}
def register_model(name):
def decorator(cls):
models[name] = cls
return cls
return decorator
def get_model(name, **args):
net = models[name](**args)
if torch.cuda.is_available():... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/segmenter.py | caiyunapp/webvtt-py | 110 | 1638612 | import os
import unittest
from shutil import rmtree
from webvtt import WebVTTSegmenter, Caption
from webvtt.errors import InvalidCaptionsError
from webvtt import WebVTT
BASE_DIR = os.path.dirname(__file__)
SUBTITLES_DIR = os.path.join(BASE_DIR, 'subtitles')
OUTPUT_DIR = os.path.join(BASE_DIR, 'output')
class WebVTT... | 0 | 0 | 0 | 0 | 0 | 0 |
challenges/electronictrading/poller/for-release/machine.py | pingjuiliao/cb-multios | 473 | 1638619 | #!/usr/bin/env python
#
# Copyright (C) 2014 Narf Industries <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use,... | 0 | 5 | 0 | 0 | 5 | 0 |
tests/test_lfucache.py | rallytime/fast-autocomplete | 106 | 1638629 | import random
import pytest
import concurrent.futures
from deepdiff import DeepDiff
from fast_autocomplete.lfucache import LFUCache
class TestLFUcache:
@pytest.mark.parametrize("items, size, expected_results", [
(['a', 'a', 'b', 'a', 'c', 'b', 'd'], 3, [('a', 2), ('b', 1), ('d', 0)]),
(['a', 'a',... | 0 | 3 | 0 | 0 | 3 | 0 |
parl/utils/tests/scheduler_test.py | jkren6/PARL | 3,172 | 1638640 | <reponame>jkren6/PARL
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | 0 | 0 | 0 | 0 | 0 | 0 |
python2.7/site-packages/twisted/mail/protocols.py | 84KaliPleXon3/sslstrip-hsts-openwrt | 267 | 1638670 | <reponame>84KaliPleXon3/sslstrip-hsts-openwrt
# -*- test-case-name: twisted.mail.test.test_mail -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Protocol support for twisted.mail."""
# twisted imports
from twisted.mail import pop3
from twisted.mail import smtp
from twisted.int... | 0 | 0 | 0 | 0 | 0 | 0 |
odk_viewer/management/commands/reparse.py | Ecotrust/formhub | 123 | 1638673 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4 coding=utf-8
from django.core.management.base import BaseCommand
from django.utils.translation import ugettext_lazy
from odk_viewer.reparse import *
class Command(BaseCommand):
help = ugettext_lazy("Delete and recreate parsed instances.")
def handle(self, *a... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/extensions/cc_attention/__init__.py | shampooma/openseg.pytorch | 1,069 | 1638687 | from .functions import PAM_Module, CrissCrossAttention, CrossAttention, ca_weight, ca_map | 0 | 0 | 0 | 0 | 0 | 0 |
etna/analysis/feature_selection/__init__.py | martins0n/etna | 326 | 1638706 | from etna.analysis.feature_selection.mrmr_selection import AGGREGATION_FN
from etna.analysis.feature_selection.mrmr_selection import AggregationMode
from etna.analysis.feature_selection.mrmr_selection import mrmr
| 0 | 0 | 0 | 0 | 0 | 0 |
mods/common/module.py | LeRoi46/opennero | 215 | 1638708 | <filename>mods/common/module.py
import subprocess
import sys
import OpenNero
def getGuiManager():
return OpenNero.getSimContext().getGuiManager()
def addObject(templateFile, position, rotation=OpenNero.Vector3f(0, 0, 0), scale=OpenNero.Vector3f(1, 1, 1), label="", type=0, collision=0):
return OpenNero.getSim... | 0 | 0 | 0 | 0 | 0 | 0 |
verify/verifications/approve-verification/approve-verification.6.x.py | Tshisuaka/api-snippets | 234 | 1638711 | # Download the helper library from https://www.twilio.com/docs/python/install
import os
from twilio.rest import Client
# Your Account Sid and Auth Token from twilio.com/console
# DANGER! This is insecure. See http://twil.io/secure
# To set up environmental variables, see http://twil.io/secure
account_sid = os.environ... | 0 | 0 | 0 | 0 | 0 | 0 |
data/setData.py | fsanges/glTools | 165 | 1638728 | from __future__ import annotations
import maya.cmds as mc
import data
class SetData( data.Data ):
'''
SetData class object.
Contains functions to save, load and rebuild maya sets.
'''
def __init__(self,setNode: object | None=None):
'''
SetData class initializer.
'''
# Execute Super Class Initilizer
... | 3 | 2 | 0 | 1 | 6 | 0 |
api/licenses/urls.py | gaybro8777/osf.io | 628 | 1638745 | from django.conf.urls import url
from api.licenses import views
app_name = 'osf'
urlpatterns = [
url(r'^$', views.LicenseList.as_view(), name=views.LicenseList.view_name),
url(r'^(?P<license_id>\w+)/$', views.LicenseDetail.as_view(), name=views.LicenseDetail.view_name),
]
| 0 | 0 | 0 | 0 | 0 | 0 |
GeeksForGeeks/Pallindrome String/solution3.py | gbrls/CompetitiveCode | 165 | 1638746 | <reponame>gbrls/CompetitiveCode
# one-line solution for palindrome string
# check if a string is the same as its reverse
palindrome_check = lambda s: s[::-1] == s
#tests
print(palindrome_check("racecar"))
print(palindrome_check("abba"))
print(palindrome_check("palindrome"))
| 0 | 0 | 0 | 0 | 0 | 0 |
example/speech-demo/io_func/feat_readers/reader_htk.py | IIMarch/mxnet | 399 | 1638775 | # 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... | 1 | 1 | 0 | 0 | 2 | 0 |
examples/hmm_em.py | kewlcoder/autograd | 6,119 | 1638798 | <filename>examples/hmm_em.py<gh_stars>1000+
from __future__ import division, print_function
import autograd.numpy as np
import autograd.numpy.random as npr
from autograd.scipy.special import logsumexp
from autograd import value_and_grad as vgrad
from functools import partial
from os.path import join, dirname
import str... | 0 | 0 | 0 | 0 | 0 | 0 |
fastflix/encoders/nvencc_avc/settings_panel.py | ObviousInRetrospect/FastFlix | 388 | 1638804 | <reponame>ObviousInRetrospect/FastFlix<gh_stars>100-1000
# -*- coding: utf-8 -*-
import logging
from typing import List, Optional
from box import Box
from PySide6 import QtCore, QtWidgets, QtGui
from fastflix.encoders.common.setting_panel import SettingPanel
from fastflix.language import t
from fastflix.models.encode... | 0 | 0 | 0 | 0 | 0 | 0 |
IronManFly/storage/db/table.py | leepand/IronManFly | 599 | 1638809 | from __future__ import annotations
from prettytable import PrettyTable
import pandas as pd
from .column import Column, ColumnSet
from .query_templates import query_templates
class Table(object):
"""
A Table is an in-memory reference to a table in a database. You can use it to get more info
about the column... | 4 | 18 | 0 | 5 | 27 | 0 |
aat/core/position/cpp.py | mthomascarcamo/aat | 305 | 1638837 | <reponame>mthomascarcamo/aat
from typing import Any
from ...common import _in_cpp
try:
from aat.binding import AccountCpp, CashPositionCpp, PositionCpp # type: ignore
_CPP = _in_cpp()
except ImportError:
PositionCpp, CashPositionCpp, AccountCpp = object, object, object
_CPP = False
def _make_cpp_... | 0 | 0 | 0 | 0 | 0 | 0 |
python/fate_client/pipeline/param/statistics_param.py | hubert-he/FATE | 3,787 | 1638838 | <filename>python/fate_client/pipeline/param/statistics_param.py<gh_stars>1000+
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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... | 0 | 0 | 0 | 0 | 0 | 0 |
exercises/practice/meetup/.meta/example.py | highb/python | 1,177 | 1638851 | <reponame>highb/python
from calendar import Calendar
def meetup(year, month, week, day_of_week):
candidates = [date
for date in Calendar().itermonthdates(year, month)
if date.month == month
if date.strftime('%A') == day_of_week]
return _choice(week)(candid... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | TimothyDJones/pyhn | 127 | 1638852 | <gh_stars>100-1000
#!/usr/bin/env python
# coding: utf-8
import os
import re
import sys
from codecs import open
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
requires = [
'... | 0 | 0 | 0 | 0 | 0 | 0 |
video/rest/rooms/participants/list-subscribed-tracks/list-subscribed-tracks.6.x.py | Tshisuaka/api-snippets | 234 | 1638855 | # Download the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client
import json
# Find your credentials at twilio.com/console
# To set up environmental variables, see http://twil.io/secure
api_key_sid = os.environ['TWILIO_API_KEY']
api_key_secret = os.environ['TWILIO_API_K... | 0 | 0 | 0 | 0 | 0 | 0 |
stellargraph/losses.py | DataLab-CQU/stellargraph | 2,428 | 1638870 | # -*- coding: utf-8 -*-
#
# Copyright 2020 Data61, CSIRO
#
# 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... | 2 | 2 | 0 | 0 | 4 | 0 |
data/test_classes/graph_component_interface.py | fintzd/rasa | 9,701 | 1638876 | <gh_stars>1000+
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import List, Type, Dict, Text, Any, Optional
from rasa.engine.graph import ExecutionContext
from rasa.engine.storage.resource import Resource
from rasa.engine.storage.storage import ModelStorage
class GraphComponent(AB... | 0 | 0 | 0 | 0 | 0 | 0 |
test_suite/suite/test07/test.py | joncatanio/cannoli | 755 | 1638877 | <reponame>joncatanio/cannoli
class Node:
def __init__(self, val, next):
self.val = val
self.next = next
lst = Node(1, Node(5, Node(8, Node(-1, None))))
temp = lst
while temp:
print(temp.val)
temp = temp.next
| 0 | 0 | 0 | 0 | 0 | 0 |
bcs-ui/backend/bcs_web/legacy_verify/serializers.py | laodiu/bk-bcs | 599 | 1638884 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 TH<NAME>, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in complianc... | 0 | 2 | 0 | 0 | 2 | 0 |
buildroot/support/testing/tests/package/test_python_pynacl.py | bramkragten/operating-system | 349 | 1638892 | <gh_stars>100-1000
from tests.package.test_python import TestPythonPackageBase
class TestPythonPy2Pynacl(TestPythonPackageBase):
__test__ = True
config = TestPythonPackageBase.config + \
"""
BR2_PACKAGE_PYTHON=y
BR2_PACKAGE_PYTHON_PYNACL=y
"""
sample_scripts = ["tests/packa... | 0 | 0 | 0 | 0 | 0 | 0 |
biostar/accounts/migrations/0005_message_prefs.py | Oribyne/biostar-central-fork | 477 | 1638918 | <gh_stars>100-1000
# Generated by Django 2.2 on 2019-05-28 13:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_mailing_list'),
]
operations = [
migrations.AlterField(
model_name='profile',
name... | 0 | 0 | 0 | 0 | 0 | 0 |
smda/intel/FunctionAnalysisState.py | williballenthin/smda | 142 | 1638925 | <filename>smda/intel/FunctionAnalysisState.py
import logging
from .definitions import END_INS, CALL_INS
LOGGER = logging.getLogger(__name__)
class FunctionAnalysisState(object):
def __init__(self, start_addr, disassembly):
self.start_addr = start_addr
self.disassembly = disassembly
self... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/gflags/tests/flags_modules_for_testing/module_foo.py | saan5/chromium-dashboard | 2,151 | 1638935 | #!/usr/bin/env python
#
# Copyright (c) 2009, 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:
#
# * Redistributions of source code must retain the above copyright
# notice, this ... | 1 | 5 | 0 | 0 | 6 | 0 |
test/cluster/kmeans.py | Edelweiss35/deep-machine-learning | 708 | 1638947 | <filename>test/cluster/kmeans.py
from numpy import array
from scipy.cluster.vq import vq, kmeans, whiten
from dml.CLUSTER.kmeans_iter import KMEANSC
import matplotlib.pyplot as plt
features=array([
[13.45,11.95],
[14.15,11.75],
[14.8,11.25],
[15.35,10.35],
[15,9.55],
[14.05,9.3],
[13.05,10.2],
[13.5,11.3],
[14.4,10.95]... | 0 | 0 | 0 | 0 | 0 | 0 |
OpenAttack/exceptions/data.py | e-tornike/OpenAttack | 444 | 1638981 | <filename>OpenAttack/exceptions/data.py
from ..exception import AttackException
class DataConfigErrorException(AttackException):
pass
| 0 | 0 | 0 | 0 | 0 | 0 |
verbs/cache.py | mattiasljungstrom/fips | 429 | 1639027 | <filename>verbs/cache.py
"""implements the cache verb
Opens the CMakeCache.txt in a text editor for a given config
cache
cache [config-name]
"""
import os, sys, subprocess
from mod import log, util, project, settings
#-------------------------------------------------------------------------------
def run(fips_dir, ... | 0 | 0 | 0 | 0 | 0 | 0 |
contrib/actorize.py | dendron2000/Thespian | 210 | 1639034 | <reponame>dendron2000/Thespian<filename>contrib/actorize.py
"""
Define handlers using decorators.
Unhandled messages get passed up the inheritance hierarchy.
Usage:
@Actorize
class Hello(Actor):
@handle(SomeMessageClass)
def somemethod(self, msg, sender):
pass
"""
import inspect
from thespian.act... | 0 | 0 | 0 | 0 | 0 | 0 |
testapp/tests/test_constraints.py | aceofwings/django-mssql-backend | 155 | 1639048 | from django.db.utils import IntegrityError
from django.test import TestCase, skipUnlessDBFeature
from ..models import (
Author, Editor, Post,
TestUniqueNullableModel, TestNullableUniqueTogetherModel,
)
@skipUnlessDBFeature('supports_nullable_unique_constraints')
class TestNullableUniqueColumn(TestCase):
... | 0 | 0 | 0 | 0 | 0 | 0 |
clusterman/reports/constants.py | akshaysharma096/clusterman | 281 | 1639077 | # 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 | 0 | 0 | 0 | 0 | 0 |
.github/gha_monitor/gha_monitor/__main__.py | hongxu-jia/s2n-tls | 4,256 | 1639088 | # 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 accompanying... | 0 | 1 | 2 | 0 | 3 | 0 |
build/sublime/make.py | dlmarquis/dfhack | 926 | 1639104 | <reponame>dlmarquis/dfhack
from __future__ import print_function
import argparse
import os
import re
import sys
import subprocess
class BuildError(Exception): pass
parser = argparse.ArgumentParser()
parser.add_argument('file', nargs='?', default='', help='current filename')
parser.add_argument('-a', '--all', action='... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_dataset.py | nameless-writer/become-yukarin | 562 | 1639128 | import unittest
import numpy
from become_yukarin.dataset import dataset
class TestDataset(unittest.TestCase):
def setUp(self):
self.sample_rate = 24000
self.len_time = len_time = 100
self.fft_size = fft_size = 1024
self.order = order = 59
self.dummy_feature = dataset.Acous... | 0 | 0 | 0 | 0 | 0 | 0 |
Code/tests/test_unarchiver.py | macmule/autopkg | 855 | 1639142 | #!/usr/local/autopkg/python
#
# 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, s... | 0 | 0 | 3 | 1 | 4 | 0 |
tickets/urls.py | sanjay051099/try2- | 199 | 1639186 | from django.conf.urls import url
from tickets.views import (
edit_ticket,
index,
view_ticket,
delete_attachment,
delete_comment,
delete_ticket,
ticket_status,
edit_comment,
ticket_comment,
admin_tickets_list,
admin_ticket_view,
new_ticket,
)
app_name = "tickets"
urlpatt... | 0 | 0 | 0 | 0 | 0 | 0 |
exxo/frozen/_exxo_importer.py | mbachry/exxo | 513 | 1639210 | from __future__ import annotations
import sys
import os
import zipfile
import sysconfig
import shutil
import tempfile
import imp
import warnings
class ModuleImporter(object):
def __init__(self) -> None:
if not zipfile.is_zipfile(sys.executable):
self.exe_zip: None = None
return
... | 3 | 6 | 0 | 1 | 10 | 0 |
toio_lecture/script/toio_kicker.py | yasutomo57jp/ros_lecture | 110 | 1639219 | <reponame>yasutomo57jp/ros_lecture
#!/usr/bin/python
# -*- coding: utf-8 -*-
import rospy
import rosparam
from std_msgs.msg import Int32, Float32, ColorRGBA
from geometry_msgs.msg import Twist, PoseStamped
from toio_lecture.msg import *
from bluepy import btle
import math
class ToioKicker:
def __init__(self):
... | 0 | 0 | 0 | 0 | 0 | 0 |
sdc/ysdc_dataset_api/evaluation/utils.py | lkra/shifts | 156 | 1639238 | from collections import defaultdict
from typing import Dict, Sequence, Tuple
import numpy as np
from ..dataset import MotionPredictionDataset
from ..proto import (ObjectPrediction, Submission, Trajectory, Vector3,
WeightedTrajectory)
from ..utils.map import repeated_points_to_array
from .metrics ... | 15 | 9 | 0 | 0 | 24 | 0 |
src/visualize.py | NikoSahradyan/kaggle_dstl_submission | 178 | 1639261 | from __future__ import annotations
"""
Merge predictions
"""
from __future__ import division
from shapely.geometry import MultiPolygon
from pylab import *
import pandas as pd
rcParams['figure.figsize'] = 20, 20
def stretch_8bit(bands, lower_percent: int=2, higher_percent: int=98) -> object:
out = np.zeros_lik... | 7 | 8 | 0 | 0 | 15 | 0 |
DQMOffline/L1Trigger/python/L1TMuonDQMEfficiency_cff.py | ckamtsikis/cmssw | 852 | 1639283 | <gh_stars>100-1000
import FWCore.ParameterSet.Config as cms
# generate the efficiency strings for the DQMGenericClient from the pt and quality cuts
def generateEfficiencyStrings(ptQualCuts):
numDenDir = "numerators_and_denominators/"
varStrings = ['pt', 'eta', 'phi', 'vtx']
etaStrings = ['etaMin0_etaMax0p8... | 0 | 0 | 0 | 0 | 0 | 0 |
evaluation/eval.py | CryhanFang/CLIP2Video | 113 | 1639286 | # Adapted from https://github.com/ArrowLuo/CLIP4Clip/blob/668334707c493a4eaee7b4a03b2dae04915ce170/main_task_retrieval.py#L457
import os
import sys
sys.path.append(os.path.dirname(__file__) + os.sep + '../')
import numpy as np
from evaluation.metrics import compute_metrics
from evaluation.metrics import tensor_text_to... | 0 | 3 | 0 | 0 | 3 | 0 |
OnePy/event_engine.py | Chandlercjy/OnePyfx | 321 | 1639307 |
import queue
from OnePy.constants import EVENT
class EventEngine(object):
def __init__(self):
self._core = queue.Queue() # type:queue.Queue
def put(self, event: EVENT):
self._core.put(event)
def get(self) -> EVENT:
return self._core.get(block=False)
def is_empty(self) -> ... | 1 | 2 | 0 | 0 | 3 | 0 |
lte/gateway/python/magma/subscriberdb/crypto/gsm.py | Aitend/magma | 849 | 1639315 | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 0 | 1 | 0 | 0 | 1 | 0 |
software/glasgow/__init__.py | electroniceel/Glasgow | 1,014 | 1639333 | import pkg_resources
try:
__version__ = pkg_resources.get_distribution(__name__).version
except pkg_resources.DistributionNotFound:
__version__ = 'unknown'
import logging
logging.addLevelName(5, "TRACE")
logging.TRACE = 5
logging.Logger.trace = lambda self, msg, *args, **kwargs: \
self.log(logging.TRACE,... | 0 | 0 | 0 | 0 | 0 | 0 |
python-build/python-scripts/test.py | visdom2000/python-for-android | 267 | 1639347 | <reponame>visdom2000/python-for-android<gh_stars>100-1000
from __future__ import print_function, unicode_literals
import sys
import types
import traceback
# Test imports.
import time
droid = None
skip_gui = False
fOutName = True
# tests for python modification for android {{{1
def test_029_isfile(): ... | 0 | 0 | 0 | 0 | 0 | 0 |
files/multiplying.py | williamgrimes/python_in_a_notebook | 263 | 1639354 | <filename>files/multiplying.py
# Save as multiplying.py
def double(x):
return 2*x
def triple(x):
return 3*x
def quadruple(x):
return 4*x
| 0 | 0 | 0 | 0 | 0 | 0 |
src/encoded/tests/test_audit_annotation.py | procha2/encoded | 102 | 1639399 | <reponame>procha2/encoded
from .test_audit_experiment import (
collect_audit_errors
)
def test_audit_annotation_missing_organism(
testapp, annotation_dataset
):
res = testapp.get(annotation_dataset['@id'] + '@@index-data')
errors = res.json['audit']
errors_list = []
for error_type in errors:
... | 0 | 0 | 0 | 0 | 0 | 0 |
scripts/e_to_e_helpers/merge_with_es.py | luxuantao/golden-retriever | 195 | 1639407 | <reponame>luxuantao/golden-retriever
"""
Query ES and merge results with original hotpot data.
Input:
- query file
- hotpotqa data
- output filename
- whether this is for hop1 or hop2
Outputs:
- json file containing a list of:
{'context', 'question', '_id', 'query', 'json_context'}
... | 0 | 0 | 0 | 0 | 0 | 0 |
config/cfg_folder.py | Jenaer/FeatDepth | 179 | 1639416 | <filename>config/cfg_folder.py
split = 'exp'
dataset = 'folder'
height = 320
width = 640
disparity_smoothness = 1e-3
scales = [0, 1, 2, 3, 4]
min_depth = 0.1
max_depth = 100.0
frame_ids = [0, -1, 1]
learning_rate = 1e-4
depth_num_layers = 50
pose_num_layers = 50
total_epochs = 45
device_ids = range(8)
depth_pretrained... | 0 | 0 | 0 | 0 | 0 | 0 |
python/federatedml/feature/feature_selection/model_adapter/adapter_factory.py | hubert-he/FATE | 3,787 | 1639442 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... | 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_csw_pycsw_skip_caps.py | eran-pinhas/OWSLib | 218 | 1639451 | <reponame>eran-pinhas/OWSLib
from tests.utils import service_ok
import pytest
from owslib.csw import CatalogueServiceWeb as cs
SERVICE_URL = 'http://demo.pycsw.org/cite/csw'
@pytest.mark.online
@pytest.mark.skipif(not service_ok(SERVICE_URL),
reason='service is unreachable')
def test_csw_pycsw_... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/scripts/busyloop.py | andyfcx/py-spy | 8,112 | 1639474 | def busy_loop():
while True:
pass
if __name__ == "__main__":
busy_loop()
| 0 | 0 | 0 | 0 | 0 | 0 |
two1/bitcoin/__init__.py | febuiles/two1-python | 415 | 1639517 | # flake8: noqa
"""The bitcoin module within the 21 Bitcoin Library (``two1.bitcoin``) provides
the following functionality:
1. Serialization/deserialization of all Bitcoin data structures:
blocks and block headers, transactions, scripts, public/private
keys, and digital signatures. Serialization is achieved via ... | 0 | 0 | 0 | 0 | 0 | 0 |
accounts/urls.py | zuoakang/DjangoBlog | 5,052 | 1639530 | from django.conf.urls import url
from django.urls import path
from . import views
from .forms import LoginForm
app_name = "accounts"
urlpatterns = [url(r'^login/$',
views.LoginView.as_view(success_url='/'),
name='login',
kwargs={'authentication_form': LoginFor... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ostorlab/agent/message/proto/v2/report/event/agent_exception_pb2.py | bbhunter/ostorlab | 113 | 1639541 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: agent_exception.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 google.protobuf import refle... | 0 | 0 | 0 | 0 | 0 | 0 |
reddit_crypto_trader.py | theLAZYrabbit/Reddit-Crypto-Trading-Bot | 151 | 1639588 | from auth.reddit_auth import *
from trade_client import *
from store_order import *
from datetime import datetime, time
import time
import json
import os.path
import nltk
nltk.download()
from nltk.sentiment import SentimentIntensityAnalyzer
reddit = load_creds('auth/auth.yml')
config = load_config('config.yml')
key... | 0 | 7 | 0 | 0 | 7 | 0 |
python/tests/test_extractor.py | fzyzcjy/ncnn | 14,886 | 1639626 | <gh_stars>1000+
# Tencent is pleased to support the open source community by making ncnn available.
#
# Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
# in compliance with the License. You may obta... | 0 | 0 | 0 | 0 | 0 | 0 |
homeassistant/components/geonetnz_volcano/config_flow.py | MrDelik/core | 30,023 | 1639668 | from __future__ import annotations
"""Config flow to configure the GeoNet NZ Volcano integration."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_RADIUS,
CONF_SCAN_INTERVAL,
CONF_UNIT_SYSTEM,
CONF_UNIT_SY... | 2 | 4 | 0 | 0 | 6 | 0 |
src/service/version.py | tabris17/doufen | 152 | 1639676 | <filename>src/service/version.py
# encoding: utf-8
__version__ = '0.2.0'
__prog_name__ = 'gravekeeper'
__description__ = 'Backend process for doufen platform'
__author__ = '四不象(tabris17)'
| 0 | 0 | 0 | 0 | 0 | 0 |
benchmark/seq2seq/myCoTK/metric/__init__.py | BorisPolonsky/KdConv | 294 | 1639704 | from .bleu import BleuCorpusMetric
from .distinct import SingleTurnDistinct, MultiTurnDistinct
from .recorder import SingleTurnResponseRecorder
__all__ = [
'BleuCorpusMetric',
'SingleTurnDistinct', 'MultiTurnDistinct',
'SingleTurnResponseRecorder',
] | 0 | 0 | 0 | 0 | 0 | 0 |
data_collection/gazette/spiders/sc_rio_dos_cedros.py | kaiocp/querido-diario | 454 | 1639719 | <filename>data_collection/gazette/spiders/sc_rio_dos_cedros.py<gh_stars>100-1000
from gazette.spiders.base.fecam import FecamGazetteSpider
class ScRioDosCedrosSpider(FecamGazetteSpider):
name = "sc_rio_dos_cedros"
FECAM_QUERY = "cod_entidade:220"
TERRITORY_ID = "4214706"
| 0 | 0 | 0 | 0 | 0 | 0 |
textaugment/translate.py | AchatY/textaugment | 228 | 1639726 | #!/usr/bin/env python
# WordNet-based data augmentation
#
# Copyright (C) 2020
# Author: <NAME>
# URL: <https://github.com/dsfsi/textaugment/>
# For license information, see LICENSE
from .constants import LANGUAGES
from textblob import TextBlob
from textblob.translate import NotTranslated
from googletrans import Tran... | 0 | 1 | 0 | 0 | 1 | 0 |
test/test_direction.py | jdkloe/python-metar | 136 | 1639744 | """Test direction."""
import pytest
from metar.Datatypes import direction
def test_usage():
"""Test basic usage."""
assert direction("90").value() == 90.0
assert direction(90).value() == 90.0
assert direction(90.0).value() == 90.0
assert direction("90").string() == "90 degrees"
assert directio... | 0 | 0 | 0 | 0 | 0 | 0 |
test/new_tests/test_new_list_operations.py | indigo-tribe/aerospike-client-python | 105 | 1639762 | # -*- coding: utf-8 -*-
import pytest
import sys
from aerospike import exception as e
aerospike = pytest.importorskip("aerospike")
try:
import aerospike
except:
print("Please install aerospike python client.")
sys.exit(1)
def get_list_result_from_operation(client, key, operation, bin) -> object:
_, _... | 0 | 1 | 0 | 0 | 1 | 0 |
src/orders/urls.py | shyam999/hot-food | 111 | 1639816 | <filename>src/orders/urls.py
from django.urls import path
from . import views
app_name = 'orders'
urlpatterns = [
path('admin/order/<int:order_id>/pdf/',views.admin_order_pdf,name='admin_order_pdf'),
path('create/', views.order_create, name='order_create'),
]
| 0 | 0 | 0 | 0 | 0 | 0 |
docarray/array/sqlite.py | fastflair/docarray | 591 | 1639817 | from .document import DocumentArray
from .storage.sqlite import StorageMixins, SqliteConfig
__all__ = ['SqliteConfig', 'DocumentArraySqlite']
class DocumentArraySqlite(StorageMixins, DocumentArray):
def __new__(cls, *args, **kwargs) -> object:
return super().__new__(cls)
| 0 | 1 | 0 | 0 | 1 | 0 |
tests/test_visitors/test_ast/test_redundancy/test_redundant_enumerate.py | notpushkin/wemake-python-styleguide | 1,931 | 1639833 | <filename>tests/test_visitors/test_ast/test_redundancy/test_redundant_enumerate.py
import pytest
from wemake_python_styleguide.violations.best_practices import (
RedundantEnumerateViolation,
)
from wemake_python_styleguide.visitors.ast.redundancy import (
RedundantEnumerateVisitor,
)
# Correct:
correct_itera... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/ut/cpp/python_input/gtest_input/optimizer/cconv_test.py | GuoSuiming/mindspore | 3,200 | 1639834 | <filename>tests/ut/cpp/python_input/gtest_input/optimizer/cconv_test.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.apache.org... | 0 | 0 | 0 | 0 | 0 | 0 |
pypykatz/commons/winapi/local/function_defs/fileinfo.py | wisdark/pypykatz | 1,861 | 1639848 | from .version import *
import ctypes
def get_file_version_info(filename) -> object:
# Get the file version info structure.
pBlock = GetFileVersionInfoW(filename)
pBuffer, dwLen = VerQueryValueW(pBlock.raw, "\\")
if dwLen != ctypes.sizeof(VS_FIXEDFILEINFO):
raise ctypes.WinError(ERROR_BAD_LENGTH)
pVersionInfo =... | 0 | 1 | 0 | 0 | 1 | 0 |
src/genie/libs/parser/iosxe/tests/ShowTenantSummary/cli/equal/golden_output_expected.py | balmasea/genieparser | 204 | 1639859 | <reponame>balmasea/genieparser
expected_output={'active_tenants_num': 20,
'max_tenants': 24,
'tenant_name': {'Tenanttest12': {'tenant_id': 20, 'tenant_vpnid': 1037},
'Tenanttest13': {'tenant_id': 20, 'tenant_vpnid': 1037},
'apple': {'tenant_id': 20, 'tenant_vpnid': 1037},
... | 0 | 0 | 0 | 0 | 0 | 0 |
benchmarks/unet-memory/main.py | junjunjunk/torchgpipe | 532 | 1639860 | """U-Net Memory Benchmark"""
import platform
from typing import Any, Callable, Dict, List, Optional, Tuple, cast
import click
import torch
from torch import Tensor, nn
import torch.nn.functional as F
from torch.optim import SGD
import torchgpipe
from torchgpipe import GPipe
from unet import unet
Stuffs = Tuple[nn.Mo... | 11 | 8 | 5 | 0 | 24 | 0 |
astroNN/shared/dict_tools.py | igomezv/astroNN | 156 | 1639885 | # ---------------------------------------------------------#
# Utilities to handle dictionary
# ---------------------------------------------------------#
from __future__ import annotations
import copy
import numpy as np
def dict_np_to_dict_list(input_dict) -> object:
"""
Convert a dict of numpy array to a di... | 0 | 4 | 0 | 0 | 4 | 0 |
a_nice_mc/objectives/bayes_logistic_regression/heart.py | alifaraz14/a-nice-mc | 118 | 1639891 | import numpy as np
from a_nice_mc.objectives.bayes_logistic_regression import BayesianLogisticRegression
class Heart(BayesianLogisticRegression):
def __init__(self, name: str='heart', batch_size: int=32):
data = np.load('data/heart/data.npy')
labels = np.load('data/heart/labels.npy')
# No... | 2 | 2 | 0 | 0 | 4 | 0 |
tests/unit_tests/transform/lsa_test.py | thecapacity/semanticpy | 116 | 1639898 | <filename>tests/unit_tests/transform/lsa_test.py<gh_stars>100-1000
from unittest import TestCase
from semanticpy.transform.lsa import LSA
from nose.tools import *
import numpy
class LSATest(TestCase):
""" """
EPSILON = 4.90815310617e-09
@classmethod
def same(self, matrix1, matrix2):
difference = matri... | 0 | 0 | 0 | 0 | 0 | 0 |
amazon_dash/_compat.py | luke255/amazon-dash | 765 | 1639946 | <reponame>luke255/amazon-dash
import sys
try:
from json import JSONDecodeError
except ImportError:
JSONDecodeError = ValueError
try:
from urllib.parse import urlparse
except ImportError:
from urlparse import urlparse
if sys.version_info > (3,2):
import subprocess
else:
import subprocess32 a... | 0 | 0 | 0 | 0 | 0 | 0 |
src/scripts/genEventingTests.py | HarrievG/coreclr | 159 | 1639984 | <reponame>HarrievG/coreclr
# Python 2 compatibility
from __future__ import print_function
import os
import xml.dom.minidom as DOM
from genEventing import parseTemplateNodes
from utilities import open_for_update
stdprolog="""
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licen... | 0 | 0 | 0 | 0 | 0 | 0 |
espnet2/samplers/unsorted_batch_sampler.py | texpomru13/espnet | 5,053 | 1640057 | import logging
from typing import Iterator
from typing import Tuple
from typeguard import check_argument_types
from espnet2.fileio.read_text import read_2column_text
from espnet2.samplers.abs_sampler import AbsSampler
class UnsortedBatchSampler(AbsSampler):
"""BatchSampler with constant batch-size.
Any sor... | 4 | 3 | 0 | 1 | 8 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.