max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 7 115 | max_stars_count int64 101 368k | id stringlengths 2 8 | content stringlengths 6 1.03M |
|---|---|---|---|---|
setup.py | zrthstr/uncurl | 460 | 12613921 | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(
name='uncurl',
version='0.0.11',
description='A library to convert curl requests to python-requests.',
author='<NAME>',
author_email='<EMAIL>',
url='https://github.com/spulec/uncurl',
entry_points={
'console_sc... |
Dynamic Programming/Matrix Chain Multiplication/Python/MatrixChainMult.py | iabhimanyu/Algorithms | 715 | 12613922 | <reponame>iabhimanyu/Algorithms
import sys
def MatrixChainOrder(p, n):
m = [[0 for x in range(n)] for x in range(n)]
for i in range(1, n):
m[i][i] = 0
for L in range(2, n):
for i in range(1, n-L+1):
j = i+L-1
m[i][j] = sys.maxint
for k in ... |
wordpress_xmlrpc/methods/__init__.py | hishamnajam/python-wordpress-xmlrpc | 218 | 12613956 | <gh_stars>100-1000
"""
Implementations of standard WordPress XML-RPC APIs.
"""
from wordpress_xmlrpc.methods import posts
from wordpress_xmlrpc.methods import pages
from wordpress_xmlrpc.methods import demo
from wordpress_xmlrpc.methods import users
from wordpress_xmlrpc.methods import options
from wordpress_xm... |
bcs-ui/backend/templatesets/legacy_apps/configuration/fixture/template_k8s.py | laodiu/bk-bcs | 599 | 12613970 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use thi... |
src/textacy/viz/network.py | austinjp/textacy | 1,929 | 12613996 | <reponame>austinjp/textacy<filename>src/textacy/viz/network.py
import math
import networkx as nx
try:
import matplotlib.pyplot as plt
except ImportError:
pass
RC_PARAMS = {
"axes.axisbelow": True,
"axes.edgecolor": ".8",
"axes.facecolor": "white",
"axes.grid": False,
"axes.labelcolor": "... |
api/src/opentrons/util/helpers.py | knownmed/opentrons | 235 | 12614015 | import typing
from datetime import datetime, timezone
def deep_get(
obj: typing.Union[typing.Mapping, typing.Sequence],
key: typing.Sequence[typing.Union[str, int]],
default=None,
):
"""
Utility to get deeply nested element in a list, tuple or dict without
resorting to some_dict.get('k1', {})... |
dali/test/python/test_operator_water.py | cyyever/DALI | 3,967 | 12614021 | # Copyright (c) 2019-2021, NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
alipay/aop/api/domain/AlipayOpenMiniResourceRecordNotifyModel.py | antopen/alipay-sdk-python-all | 213 | 12614030 | <filename>alipay/aop/api/domain/AlipayOpenMiniResourceRecordNotifyModel.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenMiniResourceRecordNotifyModel(object):
def __init__(self):
self._author_id = None
self._mini_a... |
pythran/tests/openmp.legacy/omp_task_imp_firstprivate.py | davidbrochart/pythran | 1,647 | 12614035 | import omp
def omp_task_imp_firstprivate():
i = 5
k = 0
result = False
NUM_TASKS = 25
task_result = True
if 'omp parallel firstprivate(i)':
in_parallel = omp.in_parallel()
if 'omp single':
for k in range(NUM_TASKS):
if 'omp task shared(result, task_r... |
clr.py | SunYanCN/keras-one-cycle | 282 | 12614045 | import os
import numpy as np
import warnings
from keras.callbacks import Callback
from keras import backend as K
# Code is ported from https://github.com/fastai/fastai
class OneCycleLR(Callback):
def __init__(self,
num_samples,
batch_size,
max_lr,
... |
drain/test_drain.py | bit0fun/plugins | 173 | 12614047 | <filename>drain/test_drain.py
from flaky import flaky
from pyln.testing.fixtures import * # noqa: F401,F403
from pyln.testing.utils import DEVELOPER
from pyln.client import RpcError
from .utils import get_ours, get_theirs, wait_ours, wait_for_all_htlcs
import os
import unittest
import pytest
plugin_path = os.path.jo... |
Bot/Target.py | mtranhoangson/bot | 199 | 12614052 | <reponame>mtranhoangson/bot<gh_stars>100-1000
from collections import OrderedDict
from datetime import datetime
from Bot.CustomSerializable import CustomSerializable
from Bot.TradeEnums import OrderStatus
from Bot.Value import Value
from Utils import Utils
class Target(CustomSerializable):
def __init__(self, pri... |
investpy/etfs.py | julianogv/investpy2 | 985 | 12614071 | <filename>investpy/etfs.py<gh_stars>100-1000
# Copyright 2018-2021 <NAME>, alvarobartt @ GitHub
# See LICENSE for details.
from datetime import datetime, date, timedelta
import pytz
import json
from random import randint
import warnings
import pandas as pd
import pkg_resources
import requests
from unidecode import ... |
tock/employees/migrations/0007_auto_20160428_0105.py | mikiec84/tock | 134 | 12614126 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('employees', '0006_userdata_current_employee'),
]
operations = [
migratio... |
snmp/datadog_checks/snmp/parsing/metric_tags.py | mchelen-gov/integrations-core | 663 | 12614145 | <filename>snmp/datadog_checks/snmp/parsing/metric_tags.py
# (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
"""
Helpers to parse the `metric_tags` section of a config file.
"""
import re
from typing import Dict, List, NamedTuple, TypedDict
from datadog_checks.... |
codigo/Live90/temperaturas.py | cassiasamp/live-de-python | 572 | 12614176 | from csv import reader
from matplotlib import pyplot as plt
with open('temperaturas.csv') as file:
parsed = reader(file)
data_1999 = filter(lambda v: v[0] == '1999.0', parsed)
max_temp = [float(v[3]) for v in data_1999 if v[3]]
min_temp = [float(v[4]) for v in data_1999 if v[4]]
med_temp = [float... |
astropy/units/__init__.py | jayvdb/astropy | 445 | 12614178 | <filename>astropy/units/__init__.py<gh_stars>100-1000
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains classes and functions for defining and converting
between different physical units.
This code is adapted from the `pynbody
<https://github.com/pynbody/pynbody>`_ units mod... |
demo/pcd_demo.py | BB88Lee/mmdetection3d | 136 | 12614180 | <filename>demo/pcd_demo.py
from argparse import ArgumentParser
from mmdet3d.apis import inference_detector, init_detector, show_result_meshlab
def main():
parser = ArgumentParser()
parser.add_argument('pcd', help='Point cloud file')
parser.add_argument('config', help='Config file')
parser.add_argumen... |
Stephanie/Modules/gmail_module.py | JeremyARussell/stephanie-va | 866 | 12614188 | <gh_stars>100-1000
import imaplib
import email
import re
from dateutil import parser
from Stephanie.Modules.base_module import BaseModule
class GmailModule(BaseModule):
def __init__(self, *args):
super(GmailModule, self).__init__(*args)
self.gmail_address = self.get_configuration('gmail_address')
... |
examples/advanced/autowrap_ufuncify.py | utkarshdeorah/sympy | 8,323 | 12614191 | #!/usr/bin/env python
"""
Setup ufuncs for the legendre polynomials
-----------------------------------------
This example demonstrates how you can use the ufuncify utility in SymPy
to create fast, customized universal functions for use with numpy
arrays. An autowrapped sympy expression can be significantly faster tha... |
tensorflow2/tf2cv/models/resnet_cub.py | naviocean/imgclsmob | 2,649 | 12614212 | <reponame>naviocean/imgclsmob
"""
ResNet for CUB-200-2011, implemented in TensorFlow.
Original paper: 'Deep Residual Learning for Image Recognition,' https://arxiv.org/abs/1512.03385.
"""
__all__ = ['resnet10_cub', 'resnet12_cub', 'resnet14_cub', 'resnetbc14b_cub', 'resnet16_cub', 'resnet18_cub',
'r... |
tests/conditional_processing/tests.py | ni-ning/django | 61,676 | 12614225 | <reponame>ni-ning/django
from datetime import datetime
from django.test import SimpleTestCase, override_settings
FULL_RESPONSE = 'Test conditional get response'
LAST_MODIFIED = datetime(2007, 10, 21, 23, 21, 47)
LAST_MODIFIED_STR = 'Sun, 21 Oct 2007 23:21:47 GMT'
LAST_MODIFIED_NEWER_STR = 'Mon, 18 Oct 2010 16:56:23 G... |
kafka/__init__.py | timgates42/kafka-python | 4,389 | 12614287 | from __future__ import absolute_import
__title__ = 'kafka'
from kafka.version import __version__
__author__ = '<NAME>'
__license__ = 'Apache License 2.0'
__copyright__ = 'Copyright 2016 <NAME>, <NAME>, and Contributors'
# Set default logging handler to avoid "No handler found" warnings.
import logging
try: # Python ... |
contrib/AutoNUE/core/infer_ensemble.py | JamesLim-sy/PaddleSeg | 4,708 | 12614290 | <reponame>JamesLim-sy/PaddleSeg<gh_stars>1000+
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... |
layers/cider_scorer.py | quangvy2703/Up-Down-Captioner | 232 | 12614300 | <gh_stars>100-1000
#!/usr/bin/env python
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# Modified to be more amenable to efficiently scoring minibatches during RNN training.
from collections import defaultdict
import numpy as np
import math
from scripts.preprocess_coco import *
def precook(words, n=4, out=False):
"""... |
train.py | uoguelph-mlrg/theano_alexnet | 248 | 12614302 | import sys
import time
from multiprocessing import Process, Queue
import yaml
import numpy as np
import zmq
import pycuda.driver as drv
sys.path.append('./lib')
from tools import (save_weights, load_weights,
save_momentums, load_momentums)
from train_funcs import (unpack_configs, adjust_learning_ra... |
dbReports/iondb/product_integration/urls.py | konradotto/TS | 125 | 12614308 | <filename>dbReports/iondb/product_integration/urls.py
# Copyright (C) 2017 Ion Torrent Systems, Inc. All Rights Reserved
from django.conf.urls import patterns, url, include
from tastypie.api import Api
from iondb.product_integration import api
v1_api = Api(api_name="v1")
v1_api.register(api.DeepLaserResponseResource(... |
_solved/solutions/04-spatial-joins7.py | lleondia/geopandas-tutorial | 341 | 12614309 | # Convert the series to a DataFrame and specify column name
trees_by_district = trees_by_district.to_frame(name='n_trees') |
python-midonetclient/src/midonetclient/mirror.py | yantarou/midonet | 221 | 12614311 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2015 Midokura PTE LTD.
# 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/LICENS... |
homeassistant/components/zha/number.py | mib1185/core | 30,023 | 12614336 | <reponame>mib1185/core
"""Support for ZHA AnalogOutput cluster."""
from __future__ import annotations
import functools
import logging
from typing import TYPE_CHECKING
import zigpy.exceptions
from zigpy.zcl.foundation import Status
from homeassistant.components.number import NumberEntity
from homeassistant.config_ent... |
pytorch_toolbelt/losses/wing_loss.py | mohitktanwr/toolkits | 1,281 | 12614349 | <reponame>mohitktanwr/toolkits
from torch.nn.modules.loss import _Loss
from . import functional as F
__all__ = ["WingLoss"]
class WingLoss(_Loss):
def __init__(self, width=5, curvature=0.5, reduction="mean"):
super(WingLoss, self).__init__(reduction=reduction)
self.width = width
self.cur... |
tests/unittests/dataframe/test_dataframe_v2.py | L-Net-1992/towhee | 365 | 12614356 | <reponame>L-Net-1992/towhee
# Copyright 2021 Zilliz. 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 require... |
egg/modules/random/hatch.py | ustcsq/nsimd | 247 | 12614361 | # Copyright (c) 2020 Agenium Scale
#
# 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, copy, modify, merge, publish, distr... |
setup.py | BlackLight/platypush | 228 | 12614365 | <gh_stars>100-1000
#!/usr/bin/env python
import os
from setuptools import setup, find_packages
def path(fname=''):
return os.path.abspath(os.path.join(os.path.dirname(__file__), fname))
def readfile(fname):
with open(path(fname)) as f:
return f.read()
# noinspection PyShadowingBuiltins
def pkg_fi... |
recommenders/datasets/amazon_reviews.py | aeroabir/recommenders | 10,147 | 12614373 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
import re
import shutil
import warnings
import pandas as pd
import gzip
import random
import logging
import _pickle as cPickle
from recommenders.utils.constants import SEED
from recommenders.datasets.download_utils... |
salt/states/netusers.py | tomdoherty/salt | 9,425 | 12614383 | <filename>salt/states/netusers.py
"""
Network Users
=============
Manage the users configuration on network devices via the NAPALM proxy.
:codeauthor: <NAME> <<EMAIL>>
:maturity: new
:depends: napalm
:platform: unix
Dependencies
------------
- :mod:`NAPALM proxy minion <salt.proxy.napalm>`
- :mod:`Users confi... |
python/solver.py | motus/neurosat | 226 | 12614387 | <reponame>motus/neurosat<filename>python/solver.py
# Copyright 2018 <NAME>. 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... |
locations/spiders/walmart.py | davidchiles/alltheplaces | 297 | 12614413 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
import scrapy
import json
import re
from collections import defaultdict
from locations.items import GeojsonPointItem
class WalmartSpider(scrapy.Spider):
name = "walmart"
item_attributes = {'brand': "Walmart", 'brand_wikidata': "Q483551"}
allowed_domains = ["walm... |
src/openfermion/circuits/vpe_circuits.py | bene1337/OpenFermion | 1,291 | 12614475 | # 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
# distribu... |
falcon_kit/mains/tasks.py | peterjc/FALCON | 216 | 12614477 | <reponame>peterjc/FALCON
"""Executable tasks.
To be called by pbsmrtpipe.
pypeFLOW uses its own adaptors instead.
"""
from __future__ import absolute_import
from __future__ import print_function
from .. import run_support as support
import sys
def help():
print("""
Usage:
falcon-task [task] <[task-args]>
... |
python/190 Reverse Bits.py | allandproust/leetcode-share | 156 | 12614498 | <reponame>allandproust/leetcode-share
'''
Reverse bits of a given 32 bits unsigned integer.
For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 00111001011110000010100101000000).
Follow up:
If this function is called many time... |
openrec/tf1/legacy/recommenders/cdl.py | pbaiz/openrec | 399 | 12614509 | <reponame>pbaiz/openrec
from openrec.tf1.legacy.recommenders import PMF
from openrec.tf1.legacy.modules.extractions import SDAE
from openrec.tf1.legacy.modules.fusions import Average
class CDL(PMF):
def __init__(self, batch_size, max_user, max_item, dim_embed, item_f, dims, dropout=None, test_batch_size=None,
... |
notifications/rest/users/remove-user-from-segment/remove-user-from-segment.6.x.py | Tshisuaka/api-snippets | 234 | 12614535 | #!/usr/bin/env python
# Install the Python helper library from twilio.com/docs/python/install
import os
from twilio.rest import Client
# To set up environmental variables, see http://twil.io/secure
ACCOUNT_SID = os.environ['TWILIO_ACCOUNT_SID']
AUTH_TOKEN = os.environ['TWILIO_AUTH_TOKEN']
client = Client(ACCOUNT_SID... |
alembic/versions/2020-04-27_8b536bc5d716_add_skipped_enum_value.py | fake-name/ReadableWebProxy | 193 | 12614536 | <gh_stars>100-1000
"""Add Skipped enum value
Revision ID: 8b536bc5d716
Revises: <KEY>
Create Date: 2020-04-27 12:12:47.075110
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
from sqlalchemy... |
tools/android/loading/sandwich_swr.py | google-ar/chromium | 2,151 | 12614561 | <reponame>google-ar/chromium
# Copyright 2016 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.
""" This module implements the Stale-While-Revalidate performance improvement
experiment on third parties' resources.
The top l... |
third_party/cython/src/Cython/Compiler/Tests/TestMemView.py | domenic/mojo | 652 | 12614595 | from Cython.TestUtils import CythonTest
import Cython.Compiler.Errors as Errors
from Cython.Compiler.Nodes import *
from Cython.Compiler.ParseTreeTransforms import *
from Cython.Compiler.Buffer import *
class TestMemviewParsing(CythonTest):
def parse(self, s):
return self.should_not_fail(lambda: self.fra... |
openid/extensions/ax.py | cjwatson/python-openid | 176 | 12614599 | """Implements the OpenID Attribute Exchange specification, version 1.0.
@since: 2.1.0
"""
from __future__ import unicode_literals
import six
from openid import extension
from openid.message import OPENID_NS, NamespaceMap
from openid.oidutil import force_text, string_to_text
from openid.server.trustroot import TrustR... |
tests/ted.py | VickyZengg/MediaSDK | 782 | 12614612 | <filename>tests/ted.py
# -*- coding: utf-8 -*-
# Copyright (c) 2017-2020 Intel Corporation
#
# 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... |
malib/algorithm/ddpg/__init__.py | ReinholdM/play_football_with_human | 258 | 12614618 | from .policy import DDPG
from .trainer import DDPGTrainer
from .loss import DDPGLoss
NAME = "DDPG"
LOSS = DDPGLoss
TRAINER = DDPGTrainer
POLICY = DDPG
TRAINING_CONFIG = {
"update_interval": 1,
"batch_size": 1024,
"tau": 0.01,
"optimizer": "Adam",
"actor_lr": 1e-2,
"critic_lr": 1e-2,
"gra... |
recipes/Python/578159_State_tree_/recipe-578159.py | tdiprima/code | 2,023 | 12614636 | """
A 'state tree' is (as its name implies) an object that represents a tree of
states. The tree is built by having an initial state (the 'root') and a
rule whereby child states can be reached from a parent state.
State trees are useful, for example, in solving puzzles where there are a
fixed set of moves from any gi... |
test/test_hex_binary.py | ROZBEH/rdflib | 1,424 | 12614696 | # -*- coding: utf-8 -*-
import unittest
import binascii
from rdflib import Literal, XSD
class HexBinaryTestCase(unittest.TestCase):
def test_int(self):
self._test_integer(5)
self._test_integer(3452)
self._test_integer(4886)
def _test_integer(self, i):
hex_i = format(i, "x")
... |
goodsspecs/urls.py | wh8983298/GreaterWMS | 1,063 | 12614701 | from django.urls import path, re_path
from . import views
urlpatterns = [
path(r'', views.APIViewSet.as_view({"get": "list", "post": "create"}), name="goodsspecs"),
re_path(r'^(?P<pk>\d+)/$', views.APIViewSet.as_view({
'get': 'retrieve',
'put': 'update',
'patch': 'partial_update',
'delete': 'destroy'
}... |
calico/tests/test_e2e.py | davidlrosenblum/integrations-extras | 158 | 12614727 | <gh_stars>100-1000
# (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import pytest
from datadog_checks.dev.utils import get_metadata_metrics
from . import common
@pytest.mark.e2e
def test_check_ok(dd_agent_check):
aggregator = dd_agent_check(rate... |
front-end/qemu-2.3/scripts/tracetool/transform.py | zheli-1/crete-dev | 473 | 12614797 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Type-transformation rules.
"""
__author__ = "<NAME> <<EMAIL>>"
__copyright__ = "Copyright 2012-2014, <NAME> <<EMAIL>>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
def _transform_ty... |
tests/conftest.py | den4uk/pipenv | 18,636 | 12614823 | import pytest
@pytest.fixture()
def project():
from pipenv.project import Project
return Project()
|
1000-1100q/1041.py | rampup01/Leetcode | 990 | 12614857 | <reponame>rampup01/Leetcode<gh_stars>100-1000
'''
On an infinite plane, a robot initially stands at (0, 0) and faces north. The robot can receive one of three instructions:
"G": go straight 1 unit;
"L": turn 90 degrees to the left;
"R": turn 90 degress to the right.
The robot performs the instructions given in order,... |
torch/utils/data/datapipes/map/__init__.py | vuanvin/pytorch | 183 | 12614858 | # Functional DataPipe
from torch.utils.data.datapipes.map.callable import MapperMapDataPipe as Mapper
from torch.utils.data.datapipes.map.combinatorics import ShufflerMapDataPipe as Shuffler
from torch.utils.data.datapipes.map.combining import (
ConcaterMapDataPipe as Concater,
ZipperMapDataPipe as Zipper
)
fro... |
view_model.py | rehohoho/coiltraine | 204 | 12614884 | import argparse
import sys
import os
import glob
import torch
# First thing we should try is to import two CARLAS depending on the version
from drive import CoILAgent
from configs import g_conf, merge_with_yaml, set_type_of_process
# Control for CARLA 9
if __name__ == '__main__':
argparser = argparse.Argumen... |
Tests/t_edit.py | reqa/python-ldap | 299 | 12614920 | <reponame>reqa/python-ldap
import os
import unittest
# Switch off processing .ldaprc or ldap.conf before importing _ldap
os.environ['LDAPNOINIT'] = '1'
import ldap
from ldap.ldapobject import LDAPObject
from slapdtest import SlapdTestCase
class EditionTests(SlapdTestCase):
@classmethod
def setUpClass(cls):... |
capstone/capdb/migrations/0099_auto_20200327_1936.py | rachelaus/capstone | 134 | 12614931 | <gh_stars>100-1000
# Generated by Django 2.2.11 on 2020-03-27 19:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('capdb', '0098_auto_20200325_1547'),
]
operations = [
migrations.AlterField(
model_name='extractedcitation',
... |
tests/test_image_prompts.py | ProjectsStartUp/ru-dalle | 1,134 | 12614944 | # -*- coding: utf-8 -*-
import pytest
from rudalle.image_prompts import ImagePrompts
@pytest.mark.parametrize('borders, crop_first', [
({'up': 4, 'right': 0, 'left': 0, 'down': 0}, False),
({'up': 4, 'right': 0, 'left': 0, 'down': 0}, True),
({'up': 4, 'right': 3, 'left': 3, 'down': 3}, False)
])
def tes... |
tensorflow/python/data/experimental/kernel_tests/checkpoint_input_pipeline_hook_test.py | EricRemmerswaal/tensorflow | 190,993 | 12614949 | # Copyright 2018 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... |
GeneratorInterface/Herwig7Interface/test/Herwig7_Standalone_DYLO_cfg.py | ckamtsikis/cmssw | 852 | 12614966 | # Auto generated configuration file
# using:
# Revision: 1.19
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
# with command line options: GeneratorInterface/Herwig7Interface/python/Herwig7_Standalone_DYLO_cff.py --eventcontent RAWSIM --datatier GEN --conditions auto:run2_mc --... |
examples/20_basic/example_multioutput_regression.py | psaks/auto-sklearn | 6,390 | 12614971 | <reponame>psaks/auto-sklearn
# -*- encoding: utf-8 -*-
"""
=======================
Multi-output Regression
=======================
The following example shows how to fit a multioutput regression model with
*auto-sklearn*.
"""
import numpy as numpy
from sklearn.datasets import make_regression
from sklearn.metrics impo... |
flexget/plugins/output/mock_output.py | Jeremiad/Flexget | 1,322 | 12614997 | <filename>flexget/plugins/output/mock_output.py
from loguru import logger
from flexget import plugin
from flexget.event import event
logger = logger.bind(name='mock_output')
class MockOutput:
"""
Debugging plugin which records a copy of all accepted entries into a list stored in `mock_output` attribute
... |
what_is_the_property/demo2.py | NightmareQAQ/python-notes | 106 | 12615004 | <reponame>NightmareQAQ/python-notes<filename>what_is_the_property/demo2.py<gh_stars>100-1000
class A:
def __init__(self, content):
self._content = content
@property
def content(self):
if not hasattr(self, '_content'):
return "content not exists"
return self._content
... |
bench/compress_normal.py | jmswaney/zarr | 131 | 12615014 | <gh_stars>100-1000
import numpy as np
import sys
sys.path.insert(0, '..')
import zarr
import line_profiler
import timeit
from zarr import blosc
# setup
a = np.random.normal(2000, 1000, size=200000000).astype('u2')
z = zarr.empty_like(a, chunks=1000000, compression='blosc', compression_opts=dict(cname='lz4', clevel=5, ... |
modules/pymol/experimenting.py | dualword/pymol-open-source | 636 | 12615018 | <reponame>dualword/pymol-open-source
#A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remov... |
edward/criticisms/ppc.py | zhangyewu/edward | 5,200 | 12615026 | <filename>edward/criticisms/ppc.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import six
import tensorflow as tf
from edward.models import RandomVariable
from edward.util import check_data, check_latent_vars, get_session
def ppc(T,... |
neutron/tests/unit/extensions/test_security_groups_normalized_cidr.py | congnt95/neutron | 1,080 | 12615040 | <gh_stars>1000+
# 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,... |
rosplan_rqt/src/rosplan_rqt/action_config.py | kvnptl/ROSPlan | 278 | 12615069 | <gh_stars>100-1000
from qt_gui.plugin import Plugin
from .action_config_widget import ActionConfigWidget # class to be created in my_module_widget.py!
class ActionConfig(Plugin):
def __init__(self, context):
super(ActionConfig, self).__init__(context)
# Give QObjects reasonable names
self.... |
runtime/musl-lkl/lkl/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py | dme26/intravisor | 1,144 | 12615079 | <filename>runtime/musl-lkl/lkl/scripts/kconfig/tests/choice_value_with_m_dep/__init__.py<gh_stars>1000+
"""
Hide tristate choice values with mod dependency in y choice.
If tristate choice values depend on symbols set to 'm', they should be
hidden when the choice containing them is changed from 'm' to 'y'
(i.e. exclusi... |
tests/test_chi_ssa_32.py | MAYANK25402/city-scrapers | 255 | 12615088 | from os.path import dirname, join
from city_scrapers_core.constants import COMMISSION, TENTATIVE
from city_scrapers_core.utils import file_response
from freezegun import freeze_time
from city_scrapers.spiders.chi_ssa_32 import ChiSsa32Spider
test_response = file_response(
join(dirname(__file__), "files", "chi_ss... |
airflow/deploy/gcp_util.py | ajtrexler/tensorflow-recommendation-wals | 166 | 12615099 | <reponame>ajtrexler/tensorflow-recommendation-wals<gh_stars>100-1000
# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache... |
imaging/ml/toolkit/hcls_imaging_ml_toolkit/dicom_builder.py | rczhang/healthcare | 310 | 12615121 | <filename>imaging/ml/toolkit/hcls_imaging_ml_toolkit/dicom_builder.py
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICEN... |
go/private/actions/archive.bzl | aignas/rules_go | 1,099 | 12615127 | <filename>go/private/actions/archive.bzl
# Copyright 2014 The Bazel 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... |
tests/clpy_tests/linalg_tests/test_eigenvalue.py | fixstars/clpy | 142 | 12615148 | <reponame>fixstars/clpy
import unittest
import numpy
import clpy
from clpy import backend
from clpy import testing
@testing.parameterize(*testing.product({
'UPLO': ['U', 'L'],
}))
@unittest.skipUnless(
backend.cusolver_enabled, 'Only cusolver in CUDA 8.0 is supported')
@testing.gpu
class TestEigenvalue(unit... |
example_configs/text2text/en-de/en-de-convs2s-8-gpu.py | gioannides/OpenSeq2Seq | 1,459 | 12615172 | <filename>example_configs/text2text/en-de/en-de-convs2s-8-gpu.py
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
import tensorflow as tf
from open_seq2seq.models import Text2Text
from open_seq2seq.data.text2text.text2text import ParallelTextDataLayer
from open_... |
TradzQAI/API/cbpro/websocket_client.py | kkuette/AI_project | 164 | 12615173 | <reponame>kkuette/AI_project
# cbpro/WebsocketClient.py
# original author: <NAME>
# mongo "support" added by <NAME>
#
#
# Template object to receive messages from the Coinbase Websocket Feed
from __future__ import print_function
import json
import base64
import hmac
import hashlib
import time
from threading import Thr... |
fireant/tests/test_fireant.py | mikeengland/fireant | 122 | 12615181 | <gh_stars>100-1000
from unittest import TestCase
import fireant
class APITests(TestCase):
def test_package_exports_databases(self):
with self.subTest("base class"):
self.assertIn("Database", vars(fireant))
for db in ("MySQL", "Vertica", "Redshift", "PostgreSQL", "MSSQL", "Snowflake")... |
seg_models/image_reader.py | zhusiling/AAF-TF | 261 | 12615182 | # Copyright 2016 <NAME>
import numpy as np
import tensorflow as tf
def image_scaling(img, label):
"""Randomly scales the images between 0.5 to 1.5 times the original size.
Args:
img: A tensor of size [batch_size, height_in, width_in, channels]
label: A tensor of size [batch_size, height_in, width_in]
... |
tests/modules/imported/alias_classes.py | MoonStarCZW/py2rb | 124 | 12615222 | <reponame>MoonStarCZW/py2rb
class spam:
def __init__(self):
self.msgtxt = "this is spam"
def msg(self):
print(self.msgtxt)
if __name__ == '__main__':
s = spam()
s.msg()
|
pyopencl/_mymako.py | kanderso-nrel/pyopencl | 569 | 12615259 | try:
import mako.template # noqa
except ImportError:
raise ImportError(
"Some of PyOpenCL's facilities require the Mako templating engine.\n"
"You or a piece of software you have used has tried to call such a\n"
"part of PyOpenCL, but there was a problem importing Mako.\n\n"... |
tests/licensedcode/test_match.py | jimjag/scancode-toolkit | 1,511 | 12615286 | # -*- coding: utf-8 -*-
#
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://a... |
recirq/hfvqe/analysis_test.py | Coiner1909/ReCirq | 195 | 12615315 | <gh_stars>100-1000
# Copyright 2020 Google
#
# 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 ... |
tools/graphviz.py | chlorm-forks/gyp | 1,666 | 12615323 | #!/usr/bin/env python
# Copyright (c) 2011 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... |
mmdet/core/optimizer/builder.py | deepakksingh/mmdetection | 232 | 12615339 | <reponame>deepakksingh/mmdetection<filename>mmdet/core/optimizer/builder.py
import copy
import inspect
import torch
from mmcv.utils import Registry, build_from_cfg
OPTIMIZERS = Registry('optimizer')
OPTIMIZER_BUILDERS = Registry('optimizer builder')
def register_torch_optimizers():
torch_optimizers = []
for... |
nemo_text_processing/inverse_text_normalization/ru/taggers/decimals.py | hamjam/NeMo | 4,145 | 12615347 | # Copyright (c) 2021, NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
data/grocery/prep_grocery.py | marcegeek/audio-super-res | 712 | 12615361 | """
Create an HDF5 file of patches for training super-resolution model.
"""
import os, argparse
import numpy as np
import h5py
import cPickle
import csv
from tqdm import tqdm
import pprint
import librosa
from scipy import interpolate
from scipy.signal import decimate
from scipy.signal import butter, lfilter
import re... |
suds/cache.py | slushie0/interactive-tutorials | 2,750 | 12615363 | <gh_stars>1000+
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hop... |
app/lib/cli/env.py | grepleria/SnitchDNS | 152 | 12615368 | import click
from flask.cli import with_appcontext
@click.command('env', help='SnitchDNS helper to identify the running environment')
@with_appcontext
def main():
print('OK')
return True
|
handlers/monitor_report.py | ishine/loggrove | 220 | 12615391 | <filename>handlers/monitor_report.py<gh_stars>100-1000
# Created by zhouwang on 2019/7/28.
from .base import BaseRequestHandler
import json
import logging
logger = logging.getLogger()
def report_valid(func):
def _wrapper(self):
error = {}
host = self.get_argument('host', '')
counts = sel... |
mayan/apps/storage/classes.py | nattangwiwat/Mayan-EDMS-recitation | 343 | 12615397 | import logging
from io import BytesIO, StringIO
from django.core.files.base import File
from django.core.files.storage import Storage
from django.utils.deconstruct import deconstructible
from django.utils.module_loading import import_string
from django.utils.translation import ugettext_lazy as _
from mayan.apps.commo... |
site/flask/lib/python2.7/site-packages/whoosh/fields.py | theholyhades1/tartanHacks2015 | 319 | 12615407 | <reponame>theholyhades1/tartanHacks2015<gh_stars>100-1000
# Copyright 2007 <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copy... |
tests/helpers/test_storage.py | MrDelik/core | 30,023 | 12615411 | <reponame>MrDelik/core
"""Tests for the storage helper."""
import asyncio
from datetime import timedelta
import json
from unittest.mock import Mock, patch
import pytest
from homeassistant.const import (
EVENT_HOMEASSISTANT_FINAL_WRITE,
EVENT_HOMEASSISTANT_STOP,
)
from homeassistant.core import CoreState
from ... |
scripts/extensions/imgliveuploader/app.py | AIllIll/hyperface-new | 184 | 12615428 | # -*- coding: utf-8 -*-
import base64
import cv2
from flask import Flask, render_template
from flask_socketio import SocketIO, emit
import multiprocessing
import numpy as np
import os
# logging
from logging import getLogger, NullHandler, CRITICAL
logger = getLogger(__name__)
logger.addHandler(NullHandler())
# disabl... |
MS14-068/pykek/kek/krb5.py | shellfarmer/windows-kernel-exploits | 6,550 | 12615446 | <reponame>shellfarmer/windows-kernel-exploits
#!/usr/bin/python
# Author
# ------
# <NAME>
# Contact : sylvain dot monne at solucom dot fr
# http://twitter.com/bidord
from socket import socket
from pyasn1.type.univ import Integer, Sequence, SequenceOf, OctetString, BitString, Boolean
from pyasn1.type.char import Gen... |
sp_api/api/upload/upload.py | Priyankk18k/python-amazon-sp-api | 213 | 12615472 | <filename>sp_api/api/upload/upload.py<gh_stars>100-1000
from sp_api.base import Client, sp_endpoint
from sp_api.base.helpers import create_md5, fill_query_params
class Upload(Client):
@sp_endpoint('/uploads/v1/uploadDestinations/{}', method='POST')
def upload_document(self, resource, file, content_type='appli... |
extras/sample_armory_code.py | Manny27nyc/BitcoinArmory | 505 | 12615493 | import sys
from armoryengine.BDM import BDM_BLOCKCHAIN_READY, TheBDM
from armoryengine.ArmoryUtils import RightNow
sys.path.append('..')
sys.path.append('.')
from armoryengine import *
from math import sqrt
from time import sleep
# Run at least one of the LoadBlockchain's if running anything after it
run_WalletCreate... |
plugin.video.mrknow/lib/utils/javascriptUtils.py | mrknow/filmkodi | 105 | 12615497 | <filename>plugin.video.mrknow/lib/utils/javascriptUtils.py
# -*- coding: utf-8 -*-
import re
import urllib
import base64
import unpackstd
import unpack95High
from string import join
import traceback, sys
class JsFunctions:
def hp_d01(self, s):
ar=[]
os=""
for i in range(0,len(s)-1):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.