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 |
|---|---|---|---|---|---|---|---|---|---|---|
gen.py | llimllib/pymag-trees | 149 | 1763348 | import os
class Tree:
def __init__(self, node: str="", *children):
self.node = node
self.width = len(node)
if children: self.children = children
else: self.children = []
def __str__(self) -> object:
return "%s" % (self.node)
def __repr__(self) -> object:... | 1 | 6 | 0 | 0 | 7 | 0 |
django/contrib/gis/tests/geoapp/sitemaps.py | webjunkie/django | 790 | 1763361 | from __future__ import absolute_import
from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap
from .feeds import feed_dict
from .models import City, Country
sitemaps = {'kml' : KMLSitemap([City, Country]),
'kmz' : KMZSitemap([City, Country]),
'georss' : GeoRSSSitemap(f... | 0 | 0 | 0 | 0 | 0 | 0 |
pymagnitude/third_party/allennlp/tests/data/dataset_readers/coreference/coref_reader_test.py | tpeng/magnitude | 1,520 | 1763370 | # pylint: disable=no-self-use,invalid-name
from __future__ import division
from __future__ import absolute_import
#typing
import pytest
from allennlp.data.dataset_readers import ConllCorefReader
from allennlp.common.util import ensure_list
from allennlp.common.testing import AllenNlpTestCase
try:
from itertools... | 0 | 1 | 1 | 0 | 2 | 0 |
couler/tests/workflow_basic_test.py | dmerrick/couler | 700 | 1763400 | # Copyright 2021 The Couler 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 applicable law or... | 0 | 5 | 0 | 0 | 5 | 0 |
up/data/metrics/base_evaluator.py | ModelTC/EOD | 196 | 1763418 | <filename>up/data/metrics/base_evaluator.py<gh_stars>100-1000
# Standard Library
from collections import OrderedDict
from numbers import Real
import abc
import math
import copy
import pandas
import json
from up.utils.general.log_helper import default_logger as logger
from up.utils.general.registry_factory import EVALU... | 0 | 0 | 0 | 0 | 0 | 0 |
mmtbx/command_line/show_r_factors_by_shell.py | dperl-sol/cctbx_project | 155 | 1763433 |
from __future__ import absolute_import, division, print_function
from libtbx.utils import Sorry, Usage
from libtbx import slots_getstate_setstate
import re
import sys
master_phil = """
mtz_file = None
.type = path
f_obs_label = F-obs-filtered
.type = str
f_calc_label = F-model
.type = str
r_free_label = R-free-... | 3 | 1 | 2 | 2 | 8 | 0 |
homeassistant/components/apcupsd/binary_sensor.py | MrDelik/core | 30,023 | 1763462 | <gh_stars>1000+
"""Support for tracking the online status of a UPS."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.binary_sensor import PLATFORM_SCHEMA, BinarySensorEntity
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
import homeas... | 0 | 0 | 0 | 0 | 0 | 0 |
api/tacticalrmm/accounts/migrations/0007_update_agent_primary_key.py | infinite8co/tacticalrmm | 903 | 1763487 | <filename>api/tacticalrmm/accounts/migrations/0007_update_agent_primary_key.py<gh_stars>100-1000
# Generated by Django 3.1.2 on 2020-11-01 22:54
from django.db import migrations
def link_agents_to_users(apps, schema_editor):
Agent = apps.get_model("agents", "Agent")
User = apps.get_model("accounts", "User")
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/st/ops/cpu/test_resize_bilinear_grad_op.py | GuoSuiming/mindspore | 3,200 | 1763519 | <reponame>GuoSuiming/mindspore
# Copyright 2019 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/licenses/LICENSE-2.0
#
# Unless required... | 0 | 0 | 0 | 0 | 0 | 0 |
GainStageTraining/genSamples.py | pingdynasty/KlonCentaur | 210 | 1763592 | <gh_stars>100-1000
import os
import numpy as np
import matplotlib.pyplot as plt
from scipy import interpolate
from scipy.io import savemat, loadmat
from PyLTSpice.LTSpiceBatch import LTCommander
from PyLTSpice.LTSpice_RawRead import LTSpiceRawRead
def clean_up_SPICE(file):
for ext in ['.asc', '.masterlog', '.net'... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_sa_result.py | arssher/aiopg | 1,307 | 1763597 | import pytest
from sqlalchemy import Column, Integer, MetaData, String, Table
meta = MetaData()
tbl = Table(
"sa_tbl",
meta,
Column("id", Integer, nullable=False, primary_key=True),
Column("name", String(255)),
)
@pytest.fixture
def connect(make_sa_connection, loop) -> object:
async def start() -... | 0 | 2 | 0 | 0 | 2 | 0 |
nni/retiarii/nn/pytorch/mutator.py | nbl97/nni | 2,305 | 1763632 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from __future__ import annotations
import inspect
from typing import Any, List, Optional, Tuple, Dict, Iterator, Iterable, cast
import torch.nn as nn
from nni.common.serializer import is_traceable, is_wrapped_with_trace
from nni.retiarii.graph ... | 29 | 18 | 6 | 0 | 53 | 0 |
mkgui/base/api/fastapi_utils.py | 10088/MockingBird | 2,642 | 1763637 | """Collection of utilities for FastAPI apps."""
import inspect
from typing import Any, Type
from fastapi import FastAPI, Form
from pydantic import BaseModel
def as_form(cls: Type[BaseModel]) -> Any:
"""Adds an as_form class method to decorated models.
The as_form class method can be used with FastAPI endpo... | 4 | 5 | 0 | 0 | 9 | 0 |
unprivileged-dmesg.py | nh2/strace-pipes-presentation | 135 | 1763667 | #!/usr/bin/env python2
from __future__ import print_function
import subprocess
from subprocess import PIPE
import sys
p = subprocess.Popen(['./command-client.py', "dmesg"], stdout=PIPE)
sys.stdout.write(p.communicate()[0])
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/plots/test_image.py | willianfco/shap | 16,097 | 1763670 | import matplotlib
import numpy as np
matplotlib.use('Agg')
import shap # pylint: disable=wrong-import-position
def test_random_single_image():
""" Just make sure the image_plot function doesn't crash.
"""
shap.image_plot(np.random.randn(3, 20, 20), np.random.randn(3, 20, 20), show=False)
def test_random_... | 0 | 0 | 0 | 0 | 0 | 0 |
pmu-query.py | CrabJounrnal/pcm | 1,759 | 1763679 | <gh_stars>1000+
#!/usr/bin/env python3
import io
import urllib.request
import urllib.parse
import json
import csv
import subprocess
import sys
import platform
import getopt
import re
import shutil
all_flag = False
download_flag = False
filename = None
offcore_events = []
core_events = []
try:
opts, args = getopt.... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/form_processor/migrations/0068_xforminstancesql_modified_on.py | dimagilg/commcare-hq | 471 | 1763696 | # Generated by Django 1.11.7 on 2017-11-17 09:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies: list[tuple[str, str]] = [
('form_processor', '0067_auto_20170915_1506'),
]
operations: list[object] = [
# done in 2 stages to avoid setting the ... | 0 | 0 | 2 | 0 | 2 | 0 |
scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_rgb565_blob_tracking.py | jiskra/openmv | 1,761 | 1763719 | # Single Color RGB565 Blob Tracking Example
#
# This example shows off single color RGB565 tracking using the OpenMV Cam.
import sensor, image, time, math
threshold_index = 0 # 0 for red, 1 for green, 2 for blue
# Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max)
# The below thresholds track in ge... | 0 | 0 | 0 | 0 | 0 | 0 |
dask/array/tests/test_cupy_overlap.py | Juanlu001/dask | 9,684 | 1763720 | <reponame>Juanlu001/dask<gh_stars>1000+
import numpy as np
import pytest
from packaging.version import parse as parse_version
pytestmark = pytest.mark.gpu
import dask.array as da
from dask.array.utils import assert_eq, same_keys
cupy = pytest.importorskip("cupy")
cupy_version = parse_version(cupy.__version__)
def ... | 0 | 0 | 0 | 0 | 0 | 0 |
commandment/vpp/app.py | pythonModule/commandment | 138 | 1763760 | <gh_stars>100-1000
from flask import Blueprint, jsonify, g, current_app, request, abort
from flask_rest_jsonapi import Api
from commandment.vpp.models import db, VPPAccount
from commandment.vpp.schema import VPPAccountSchema
vpp_app = Blueprint('vpp_app', __name__)
api = Api(blueprint=vpp_app)
@vpp_app.route('/api/v... | 0 | 0 | 0 | 0 | 0 | 0 |
LeafNATS/modules/activation/maxout.py | haophancs/TREQS | 149 | 1763767 | <reponame>haophancs/TREQS<gh_stars>100-1000
'''
@author <NAME>
Please contact <EMAIL>
'''
import math
import torch
def maxout(input_, pool_size):
'''
maxout activation
'''
input_size = list(input_.size())
assert input_.size(-1) % pool_size == 0
out_size = input_.size(-1) // pool_size
inp... | 0 | 0 | 0 | 0 | 0 | 0 |
convlab/modules/word_dst/multiwoz/sumbt/sumbt_config.py | ngduyanhece/ConvLab | 405 | 1763794 |
from dotmap import DotMap
args = DotMap()
args.max_label_length = 32
args.max_turn_length = 22
args.hidden_dim = 100
args.num_rnn_layers = 1
args.zero_init_rnn = False
args.attn_head = 4
args.do_eval = True
args.do_train = False
args.do_lower_case = False
args.distance_metric = 'cosine'
args.train_batch_size = 4
ar... | 0 | 0 | 0 | 0 | 0 | 0 |
ss_baselines/savi/models/smt_cnn.py | tynguyen/sound-spaces | 171 | 1763803 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
from ss_baselines.common.utils import ResizeCenterCropper
from s... | 1 | 5 | 0 | 2 | 8 | 0 |
koku/masu/test/processor/aws/test_aws_report_db_cleaner.py | rubik-ai/koku | 157 | 1763821 | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Test the AWSReportDBCleaner utility object."""
import datetime
import uuid
import django
import pytz
from dateutil import relativedelta
from django.db import transaction
from tenant_schemas.utils import schema_context
from api.provider.models ... | 0 | 1 | 0 | 0 | 1 | 0 |
sdk/avalon_sdk/connector/blockchains/fabric/chaincode_methods.py | ikegawa-koshi/avalon | 127 | 1763827 | # Copyright 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 0 | 1 | 0 | 1 | 2 | 0 |
docker/test/integration/minifi/core/InputPort.py | dtrodrigues/nifi-minifi-cpp | 113 | 1763882 | <filename>docker/test/integration/minifi/core/InputPort.py<gh_stars>100-1000
from .Connectable import Connectable
class InputPort(Connectable):
def __init__(self, name=None, remote_process_group=None):
super(InputPort, self).__init__(name=name)
self.remote_process_group = remote_process_group
| 0 | 0 | 0 | 0 | 0 | 0 |
neuralmonkey/tests/test_decoder.py | ufal/neuralmonkey | 446 | 1763893 | <gh_stars>100-1000
#!/usr/bin/env python3.5
# -*- coding: utf-8 -*-
""" Unit tests for the decoder. (Tests only initialization so far) """
import unittest
import tensorflow as tf
from neuralmonkey.decoders.decoder import Decoder
from neuralmonkey.vocabulary import Vocabulary
class TestDecoder(unittest.TestCase):
... | 0 | 0 | 0 | 0 | 0 | 0 |
models/backbones/__init__.py | AlexandreDh/ACAR-Net | 162 | 1763911 | import torch.nn as nn
from .slowfast import *
from utils import load_pretrain
def model_entry(config) -> object:
return globals()[config['arch']](**config['kwargs'])
class AVA_backbone(nn.Module):
def __init__(self, config):
super(AVA_backbone, self).__init__()
self.config = config... | 0 | 2 | 0 | 0 | 2 | 0 |
contents/domain_coloring/code/python/domain_coloring.py | alzawad26/algorithm-archive | 1,975 | 1763917 |
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
from matplotlib.cm import ScalarMappable
def f(z) -> object:
return z**2
def magnitude_shading(f_val) -> object:
f_val_abs = np.abs(f_val)
return 0.5 + 0.5 * (f_val_abs - np.floor(f_val_abs))
def gridlines(f_val, threshold) -... | 0 | 4 | 0 | 0 | 4 | 0 |
tests/converters/test_bytes_can_uplink_converter.py | linxingchao/tb_gateway_with_extension | 1,123 | 1763923 | # Copyright 2020. ThingsBoard
#
# 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 ... | 1 | 2 | 0 | 0 | 3 | 0 |
autobahn/wamp/gen/wamp/proto/SubscriberReceived.py | rapyuta-robotics/autobahn-python | 1,670 | 1763943 | <reponame>rapyuta-robotics/autobahn-python
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: proto
import flatbuffers
class SubscriberReceived(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsSubscriberReceived(cls, buf, offset):
n = flatbuffers.encode.Get(... | 0 | 0 | 0 | 0 | 0 | 0 |
docs/source/tutorials/scripts/fig_compose.py | emthanh/svg_utils | 195 | 1763954 | <gh_stars>100-1000
#!/usr/bin/env python3
# coding=utf-8
from svgutils.compose import *
Figure(
"16cm",
"6.5cm",
Panel(SVG("sigmoid_fit.svg"), Text("A", 25, 20, size=12, weight="bold")),
Panel(
SVG("anscombe.svg").scale(0.5), Text("B", 25, 20, size=12, weight="bold")
).move(280, 0),
).save... | 0 | 0 | 0 | 0 | 0 | 0 |
chapter07/detect_car_bow_svm.py | insoo223/openCVhowse | 286 | 1763963 | <filename>chapter07/detect_car_bow_svm.py
import cv2
import numpy as np
import os
if not os.path.isdir('CarData'):
print('CarData folder not found. Please download and unzip '
'http://l2r.cs.uiuc.edu/~cogcomp/Data/Car/CarData.tar.gz '
'or https://github.com/gcr/arc-evaluator/raw/master/CarData.... | 0 | 0 | 0 | 0 | 0 | 0 |
code/stable/pdcontroller/src/python/Calculations.py | Daisy-C/Drasil | 114 | 1763983 | ## \file Calculations.py
# \author <NAME>
# \brief Provides functions for calculating the outputs
from __future__ import annotations
import numpy
import scipy.integrate
## \brief Calculates Process Variable: The output value from the power plant
# \param K_d Derivative Gain: Gain constant of the derivative controller
... | 0 | 2 | 0 | 0 | 2 | 0 |
test/programytest/storage/stores/sql/dao/test_link.py | cdoebler1/AIML2 | 345 | 1764023 |
import unittest
from programy.storage.stores.sql.dao.link import Link
class LinkTests(unittest.TestCase):
def test_init(self):
link1 = Link(primary_user='user', generated_key='%key1', provided_key='key2', expired=True, expires='29/02/1968', retry_count=0)
self.assertIsNotNone(link1)
... | 0 | 0 | 0 | 0 | 0 | 0 |
MrLevo520-豆瓣数据爬取与分析/furtherProject/cowboy231-DouBan/work9/work9.py | ZCgithub1997/python- | 632 | 1764027 | # -*- coding: utf-8 -*-
from selenium import webdriver
import time
import selenium.webdriver.support.ui as ui
#shift-tab多行缩进(左)
print 'please wait...system loading...'
PostUrl = "https://www.douban.com/"
driver=webdriver.Chrome()#用浏览器实现访问
driver_detail=webdriver.PhantomJS()
wait = ui.WebDriverWait(driver,15)
wait1 = ui... | 0 | 0 | 0 | 0 | 0 | 0 |
speech/main.py | cruzfernando/hackathon-toolkit | 395 | 1764039 | import os
from flask import Flask, redirect, render_template, request
from google.cloud import storage
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
app = Flask(__name__)
@app.route('/')
def homepage() -> object:
# Return a Jinja2 HTML template and... | 0 | 4 | 0 | 0 | 4 | 0 |
defender/models.py | thinkt4nk/django-defender | 417 | 1764065 | <reponame>thinkt4nk/django-defender
from django.db import models
class AccessAttempt(models.Model):
""" Access Attempt log """
user_agent = models.CharField(max_length=255,)
ip_address = models.GenericIPAddressField(verbose_name="IP Address", null=True,)
username = models.CharField(max_length=255, nu... | 0 | 0 | 0 | 0 | 0 | 0 |
homeschool/accounts/tests/test_commands.py | chriswedgwood/homeschool | 154 | 1764078 | <reponame>chriswedgwood/homeschool
import datetime
from io import StringIO
from django.utils import timezone
from homeschool.accounts import constants
from homeschool.accounts.management.commands.expire_trials import Command
from homeschool.accounts.models import Account
from homeschool.accounts.tests.factories impor... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/python/treadmill/cli/admin/show.py | bretttegartms/treadmill | 133 | 1764114 | <gh_stars>100-1000
"""Trace treadmill application events.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import heapq
import logging
import json
import zlib
import click
from treadmill import... | 0 | 0 | 0 | 0 | 0 | 0 |
main.py | hungthanhpham94/GRU4REC-pytorch | 184 | 1764116 | import argparse
import torch
import lib
import numpy as np
import os
import datetime
parser = argparse.ArgumentParser()
parser.add_argument('--hidden_size', default=100, type=int) #Literature uses 100 / 1000 --> better is 100
parser.add_argument('--num_layers', default=3, type=int) #1 hidden layer
parser.add_argument(... | 0 | 0 | 0 | 0 | 0 | 0 |
100-200q/190.py | rampup01/Leetcode | 990 | 1764118 | <reponame>rampup01/Leetcode<filename>100-200q/190.py
class Solution:
# @param n, an integer
# @return an integer
def reverseBits(self, n):
res = 0
for i in range(32):
res += n & 1
n = n >> 1
if i != 31:
res = res << 1
return res
... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/functional/regressions/test_issue_89.py | stanislaw/textX | 346 | 1764121 | from __future__ import unicode_literals
import textx
def test_issue89_get_obj_pos_in_text():
mm = textx.metamodel_from_str('''
Model: objs+=Obj;
Obj: 'obj' name=ID;
''')
m = mm.model_from_str('''obj A
obj B
obj C
obj D
''')
assert (1, 1) == textx.get_model(m.objs[0])._tx_... | 0 | 0 | 0 | 0 | 0 | 0 |
src/anyconfig/api/__init__.py | ssato/python-anyconfig | 213 | 1764151 | #
# Copyright (C) 2012 <NAME> <<EMAIL>>
# SPDX-License-Identifier: MIT
#
# pylint: disable=unused-import,import-error,invalid-name
r"""Public APIs of anyconfig module.
.. versionchanged:: 0.10.2
- Re-structured APIs and split into sub modules
- Added type hints
.. versionchanged:: 0.9.9
- Removed the API '... | 0 | 1 | 0 | 0 | 1 | 0 |
workflows/pipe-templates/__SYSTEM/data_loader/src/sys-data-upload.py | msleprosy/cloud-pipeline | 126 | 1764169 | # Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.com/)
#
# 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 appli... | 0 | 1 | 0 | 0 | 1 | 0 |
lona/settings.py | korantu/lona | 230 | 1764228 | from copy import deepcopy
import logging
import types
import runpy
logger = logging.getLogger('lona.settings')
class Settings:
def __init__(self):
self._paths: list[object] = []
self._values: dict[object,object] = {}
def add(self, path) -> None:
if not path.endswith('.py'):
... | 0 | 6 | 0 | 2 | 8 | 0 |
plugin/view.py | bergercookie/vim-geeknote | 232 | 1764229 | <filename>plugin/view.py
#!/usr/bin/env python
import vim
from enml import *
from utils import *
from conn import *
# Maps buffer names to NoteTracker objects.
openNotes = {}
#
# Holds all information that needs to be tracked for any note that has been
# opened.
#
class NoteTracker(object):
def __init__(self, ... | 0 | 0 | 0 | 0 | 0 | 0 |
release/stubs.min/Autodesk/Revit/DB/__init___parts/ExternalDefinitionCreationOptions.py | htlcnn/ironpython-stubs | 182 | 1764261 | <filename>release/stubs.min/Autodesk/Revit/DB/__init___parts/ExternalDefinitionCreationOptions.py
class ExternalDefinitionCreationOptions(object,IDisposable):
"""
An option class used for creating a new shared parameter definition,including options such as name,type,visibility,
Guid description and modifiabl... | 0 | 0 | 0 | 0 | 0 | 0 |
Chapter17/mult_dim_array.py | add54/ADMIN_SYS_PYTHON | 116 | 1764272 | import numpy as np
my_list1 = [1,2,3,4]
my_list2 = [11,22,33,44]
my_lists = [my_list1,my_list2]
my_array = np.array(my_lists)
print(my_array)
| 0 | 0 | 0 | 0 | 0 | 0 |
vilya/views/uis/code_review.py | mubashshirjamal/code | 1,582 | 1764276 | <filename>vilya/views/uis/code_review.py
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from quixote.errors import TraversalError
from vilya.views.util import jsonize, http_method
from vilya.models.linecomment import PullLineComment
from vilya.models.project import CodeDoubanProject
from vilya.libs.te... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/python3_kwargs_only/kwargs_only.py | hixio-mh/plugin-python | 362 | 1764277 | <gh_stars>100-1000
def hello(a, *, delete=False):
print("hello world", delete)
| 0 | 0 | 0 | 0 | 0 | 0 |
Alignment/CommonAlignmentProducer/python/ALCARECOTkAlLAS_cff.py | ckamtsikis/cmssw | 852 | 1764279 | <gh_stars>100-1000
# AlCaReco for laser alignment system
import FWCore.ParameterSet.Config as cms
import EventFilter.SiStripRawToDigi.SiStripDigis_cfi
ALCARECOTkAlLASsiStripDigis = EventFilter.SiStripRawToDigi.SiStripDigis_cfi.siStripDigis.clone(
ProductLabel = 'hltTrackerCalibrationRaw'
)
import Alignment.LaserAli... | 0 | 0 | 0 | 0 | 0 | 0 |
cpmpy/miss_manners.py | hakank/hakank | 279 | 1764280 | """
Miss Manners seating problem in cpmpy.
From http://4c110.ucc.ie/cpstandards/index.php/en/standards/java/examples/27
'''
The 'Miss Manners' problem is a notorious benchmark for rule engines.
The problem is to find an acceptable seating arrangement for guests at
a dinner party. It should match people with the sam... | 2 | 1 | 0 | 1 | 4 | 0 |
tests/test_sample.py | JimPrudent/kneed | 479 | 1764307 | import math
import matplotlib.pyplot as plt
import numpy as np
import pytest
from kneed.data_generator import DataGenerator as dg
from kneed.knee_locator import KneeLocator
from kneed.shape_detector import find_shape
@pytest.mark.parametrize("interp_method", ["interp1d", "polynomial"])
def test_figure2(interp_method)... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/multiproc/server.py | artificial-aidan/grpclib | 754 | 1764371 | import os
import math
import asyncio
from concurrent.futures.process import ProcessPoolExecutor
from grpclib.utils import graceful_exit
from grpclib.server import Stream, Server
from google.protobuf.wrappers_pb2 import BoolValue
# generated by protoc
from .primes_pb2 import Request, Reply
from .primes_grpc import Pr... | 5 | 3 | 0 | 0 | 8 | 0 |
ML/mnist/tensorflow-example/mnist_softmax.py | saneravi/ML_Stuff | 209 | 1764374 | <reponame>saneravi/ML_Stuff
#!/usr/bin/env python
"""A very simple MNIST classifier."""
import argparse
import sys
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
ce_with_logits = tf.nn.softmax_cross_entropy_with_logits
FLAGS = None
def inference(x):
"""
Build the inferen... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/module_fake_many_methods.py | pnijhara/hug | 6,045 | 1764398 | <gh_stars>1000+
"""Fake HUG API module usable for testing importation of modules"""
import hug
@hug.get()
def made_up_hello():
"""GETting for science!"""
return "hello from GET"
@hug.post()
def made_up_hello():
"""POSTing for science!"""
return "hello from POST"
| 0 | 0 | 0 | 0 | 0 | 0 |
ansible/roles/lib_openshift_3.2/build/ansible/oadm_router.py | fahlmant/openshift-tools | 164 | 1764409 | <reponame>fahlmant/openshift-tools
# pylint: skip-file
def main():
'''
ansible oc module for router
'''
module = AnsibleModule(
argument_spec=dict(
state=dict(default='present', type='str',
choices=['present', 'absent']),
debug=dict(default=False,... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/foo/bar/baz.py | philippeitis/nimporter | 656 | 1764424 | import nimporter
from bar import bazzle
def foo_bar_baz():
print(bazzle.add(2, 100))
| 0 | 0 | 0 | 0 | 0 | 0 |
cacreader/swig-4.0.2/Examples/test-suite/python/template_classes_runme.py | kyletanyag/LL-Smartcard | 1,031 | 1764438 | <filename>cacreader/swig-4.0.2/Examples/test-suite/python/template_classes_runme.py
from template_classes import *
# This test is just testing incorrect number of arguments/parameters checking
point = PointInt()
rectangle = RectangleInt()
rectangle.setPoint(point)
rectangle.getPoint()
RectangleInt.static_noargs()
Re... | 0 | 0 | 0 | 0 | 0 | 0 |
mapproxy/service/template_helper.py | cunha17/mapproxy | 347 | 1764483 | <reponame>cunha17/mapproxy
# This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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.... | 0 | 0 | 0 | 0 | 0 | 0 |
services/dockercleaner/arvados_docker/cleaner.py | rpatil524/arvados | 222 | 1764507 | #!/usr/bin/env python3
# Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: AGPL-3.0
from __future__ import annotations
"""arvados_docker.cleaner - Remove unused Docker images from compute nodes
Usage:
python3 -m arvados_docker.cleaner --quota 50G
"""
import argparse
import collec... | 5 | 15 | 1 | 3 | 24 | 0 |
demo/examples/scheme/eqpde_d1q2_advection.py | Mopolino8/pylbm | 106 | 1764518 |
# Authors:
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD 3 clause
"""
Example of a two velocities scheme for the advection equation in 1D
"""
import sympy as sp
import pylbm
# pylint: disable=invalid-name
U, X = sp.symbols('u, X')
LA, C, SIGMA = sp.symbols('lambda, c, sigma', constants=True)
sche... | 0 | 0 | 0 | 0 | 0 | 0 |
func/__init__.py | gongda0e/AVT | 102 | 1764520 | from . import train
| 0 | 0 | 0 | 0 | 0 | 0 |
utils/logger.py | destinyls/MonoFlex | 131 | 1764563 | import functools
import logging
import os
import sys
@functools.lru_cache() # so that calling setup_logger multiple times won't add many handlers
def setup_logger(output_dir, distributed_rank=0, name="monoflex", file_name="log.txt"):
'''
Args:
output_dir (str): a directory saves output log files
... | 0 | 0 | 0 | 0 | 0 | 1 |
platypush/plugins/foursquare.py | RichardChiang/platypush | 228 | 1764597 | <filename>platypush/plugins/foursquare.py
import datetime
import requests
from typing import List, Dict, Any, Optional, Union, Tuple
from platypush.plugins import Plugin, action
class FoursquarePlugin(Plugin):
"""
Plugin to interact with the `Foursquare Places API <https://developer.foursquare.com/docs/api>`... | 0 | 0 | 0 | 0 | 0 | 0 |
logme/exceptions.py | groodt/logme | 530 | 1764599 | class LogmeError(Exception):
"""Used as a general error for the logme module"""
class MisMatchScope(Exception):
"""Used when scope and passed callable is mismatched"""
class InvalidOption(Exception):
"""Used when the an option is invalid"""
class InvalidLoggerConfig(Exception):
"""Used when invali... | 0 | 0 | 0 | 0 | 0 | 0 |
src/imreg_dft/__init__.py | GCBallesteros/imreg_dft | 167 | 1764656 | # -*- coding: utf-8 -*-
# We may import this during setup invocation
# because of the version we have to query
# However, i.e. numpy may not be installed at setup install time.
try:
from imreg_dft.imreg import (translation, similarity, transform_img,
transform_img_dict, imshow)
exc... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_usfirst_event_awards_parser.py | tervay/the-blue-alliance | 266 | 1764722 | <gh_stars>100-1000
import unittest2
import json
from consts.award_type import AwardType
from datafeeds.usfirst_event_awards_parser import UsfirstEventAwardsParser
def convert_to_comparable(data):
"""
Converts jsons to dicts so that elements can be more easily compared
"""
if type(data) == list:
... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/show-cfg.py | w-v/llvm-clang-samples | 940 | 1764742 | #-------------------------------------------------------------------------------
# Script for showing the CFG of the given LLVM IR file.
# 'dot' must be installed. If 'eog' is installed, it's popped to show the
# produced image.
#
# <NAME> (<EMAIL>)
# This code is in the public domain
#---------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/common/test_run/ascend/SecondOrder_diag_combine_matrix_run.py | tianjiashuo/akg | 286 | 1764743 | # Copyright 2019-2021 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 0 | 3 | 0 | 0 | 3 | 0 |
sentiment/python/imdb.py | kikko/tfjs-examples | 5,798 | 1764744 | # Copyright 2018 Google LLC. 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 applicable law or a... | 1 | 4 | 0 | 0 | 5 | 0 |
scriptedforms/e2e/src/variable-table.py | SimonBiggs/scripted-forms | 533 | 1764758 | from datetime import datetime
import pandas as pd
from IPython.display import display, Markdown
display(Markdown(
'Loaded variable-table.py at {}'
.format(str(datetime.now()))
))
input_types_1 = {
'1st': 'toggle',
'3rd': 'number',
'4th': 'dropdown',
'5th': 'dropdown',
'6th': 'readonly'
}... | 0 | 0 | 0 | 0 | 0 | 0 |
flags/tests/test_conditions_validators.py | cfpb/django-flags | 142 | 1764759 | from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.test import TestCase, override_settings
from flags.conditions.validators import (
validate_boolean,
validate_date,
validate_parameter,
validate_path_re,
validate_user,
)
class ValidatePar... | 0 | 0 | 0 | 0 | 0 | 0 |
sdk/python/pulumi_kubernetes/autoscaling/v1/outputs.py | polivbr/pulumi-kubernetes | 277 | 1764781 | # coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from __future__ import annotations
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... i... | 33 | 25 | 0 | 0 | 58 | 0 |
Python/sum_of_two_numbers.py | thefool76/hacktoberfest2021 | 448 | 1764788 | num1=float(input('Enter the first number:'))
num2=float(input('Enter the second number:'))
print(num1+num2)
| 0 | 0 | 0 | 0 | 0 | 0 |
shorttext/stack/stacking.py | vishalbelsare/PyShortTextCategorization | 481 | 1764807 | <filename>shorttext/stack/stacking.py
import pickle
from abc import ABC, abstractmethod
import numpy as np
from keras.layers import Dense, Reshape
from keras.models import Sequential
from keras.regularizers import l2
import shorttext.utils.classification_exceptions as e
import shorttext.utils.kerasmodel_io as kerasio... | 0 | 0 | 0 | 0 | 0 | 0 |
src/data_tool/feature.py | 151232summerday/Tencent_Ads_Algo_2018 | 293 | 1764814 | <reponame>151232summerday/Tencent_Ads_Algo_2018<filename>src/data_tool/feature.py
import numpy as np
import logging
import warnings
class FeatureInfo:
def __init__(self):
self.name = None
# include empty
self.ma = None
# note the second last is for empty, the last is for special val... | 0 | 0 | 0 | 0 | 0 | 0 |
packages/syft/tests/syft/core/adp/domain_test.py | vishalbelsare/PySyft | 8,428 | 1764823 | # third party
import pytest
# syft absolute
import syft as sy
from syft.core.adp.scalar.phi_scalar import PhiScalar
# TODO @Tudor fix
@pytest.mark.xfail
def test_autodp_phiscalar_publish_domain() -> None:
bob_domain = sy.Domain(name="Bob's Domain")
client = bob_domain.get_root_client()
x = PhiScalar(0, ... | 0 | 1 | 0 | 0 | 1 | 0 |
poco/drivers/ue4/__init__.py | kaluluosi/Poco | 1,444 | 1764830 | <reponame>kaluluosi/Poco<gh_stars>1000+
# -*- coding: utf-8 -*-
from poco.drivers.ue4.ue4_poco import UE4Poco | 0 | 0 | 0 | 0 | 0 | 0 |
vbdiar/embeddings/embedding.py | VarunSrivastava19/VBDiarization | 101 | 1764855 | <reponame>VarunSrivastava19/VBDiarization
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018 Brno University of Technology FIT
# Author: <NAME> <<EMAIL>>
# All Rights Reserved
import os
import pickle
import numpy as np
from vbdiar.features.segments import get_time_from_frames
from vbdiar.utils impor... | 0 | 0 | 0 | 0 | 0 | 0 |
arcade/experimental/shadertoy_demo.py | yegarti/arcade | 824 | 1764865 | <reponame>yegarti/arcade
from pathlib import Path
import arcade
from arcade.experimental.shadertoy import Shadertoy
class MyGame(arcade.Window):
def __init__(self, width, height, title):
super().__init__(width, height, title, resizable=True)
self.shadertoy = Shadertoy.create_from_file(
... | 0 | 0 | 0 | 0 | 0 | 0 |
code/Classifier/MulticlassSVM.py | INK-USC/DS-RelationExtraction | 156 | 1764871 | __author__ = 'wenqihe'
from SVM import SVM
class MulticlassSVM:
def __init__(self, feature_size, label_size, lambda_reg=0.1, max_iter=5000, mode='ova'):
self._feature_size = feature_size
self._label_size = label_size
self._lambda_reg = lambda_reg
self._max_iter = max_iter
... | 0 | 0 | 0 | 0 | 0 | 0 |
utils/aws.py | Bug-Reaper/snowflake | 102 | 1764876 | #!/usr/bin/python
from __future__ import annotations
import boto
from boto.sqs.message import Message
import boto.ec2
import os
import cPickle as pickle
import subprocess
import shlex
import time
import logging
import socket
HOSTNAME = str.join('_', socket.gethostname().split('.'))
FUSE_MOUNT = "/tmp/snowflake"
SERV... | 2 | 8 | 5 | 5 | 20 | 0 |
python/conv.py | ishine/RTNeural | 137 | 1764890 | import numpy as np
import warnings
warnings.filterwarnings("ignore")
import tensorflow as tf
from tensorflow import keras
tf.compat.v1.enable_eager_execution()
import matplotlib.pyplot as plt
from model_utils import save_model
# construct TensorFlow model
model = keras.Sequential()
model.add(keras.layers.InputLayer(in... | 0 | 0 | 0 | 0 | 0 | 0 |
ch04/myproject_virtualenv/src/django-myproject/myproject/apps/locations/urls.py | PacktPublishing/Django-3-Web-Development-Cookbook | 159 | 1764914 | from django.urls import path
from .views import LocationList, LocationDetail, add_or_change_location, delete_location
urlpatterns = [
path("", LocationList.as_view(), name="location_list"),
path("add/", add_or_change_location, name="add_location"),
path("<uuid:pk>/", LocationDetail.as_view(), name="locati... | 0 | 0 | 0 | 0 | 0 | 0 |
lib/itertools_test.py | wangwansan/grumpy | 11,252 | 1764930 | <reponame>wangwansan/grumpy<gh_stars>1000+
# Copyright 2016 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.org/licenses/LICENSE-2.0... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/asr/didispeech-2/local/prepare_data.py | wgfi110/athena | 791 | 1764937 | # Copyright (C) ATHENA 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 applicable law ... | 0 | 4 | 0 | 0 | 4 | 0 |
DaPy/methods/statistic/compare_scaler.py | huihui7987/DaPy | 552 | 1764979 | <reponame>huihui7987/DaPy<gh_stars>100-1000
from collections import namedtuple
from DaPy.core import is_math, is_seq, is_str
from DaPy.core import SeriesSet
from DaPy.operation import get_ranks
from .distribution import Fcdf, Ncdf
from math import sqrt
__all__ = ['ANOVA']
ANOVA_result = namedtuple('one_way_ANOVA_Resu... | 0 | 0 | 0 | 0 | 0 | 0 |
svgwrite__examples/from_examples/solidcolor.py | DazEB2/SimplePyScripts | 117 | 1765033 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
# SOURCE: https://github.com/mozman/svgwrite/blob/master/examples/solidcolor.py
# pip install svgwrite
import svgwrite
def solid_color(name):
dwg = svgwrite.Drawing(name, size=('20cm', '15cm'), profile='tiny', debug=True)
# set user ... | 0 | 0 | 0 | 0 | 0 | 0 |
forge/tests/test_match.py | danhodos/forge | 438 | 1765043 | # Copyright 2015 datawire. 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 applicable law or agr... | 0 | 0 | 0 | 0 | 0 | 0 |
panel/io/model.py | sthagen/holoviz-panel | 601 | 1765045 | <gh_stars>100-1000
"""
Utilities for manipulating bokeh models.
"""
from __future__ import annotations
import textwrap
from contextlib import contextmanager
from typing import (
TYPE_CHECKING, Any, Iterable, List, Optional,
)
import numpy as np
from bokeh.document import Document
from bokeh.document.events impo... | 0 | 0 | 0 | 0 | 0 | 0 |
test/functional/wallet_create_tx.py | runcitadel/bitcoin | 159 | 1765059 | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import annotations
from decimal import Decimal
from test_framework.test_framework import... | 3 | 0 | 0 | 0 | 3 | 0 |
maggot/utils.py | ex4sperans/mag | 107 | 1765066 | <filename>maggot/utils.py
from maggot.containers import NestedContainer
styles = NestedContainer.from_dict(
dict(
reset="\033[0m",
bold="\033[01m",
disable="\033[02m",
underline="\033[04m",
reverse="\033[07m",
strikethrough="\033[09m",
invisible="\033[08m",
... | 0 | 0 | 0 | 0 | 0 | 0 |
rcc_dp/sqkr.py | garyxcheng/federated | 330 | 1765090 | # Copyright 2021, 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... | 2 | 7 | 0 | 0 | 9 | 0 |
test/programytest/services/library/test_base.py | RonKhondji/program-y | 345 | 1765138 | import unittest
from datetime import datetime
from datetime import timedelta
from programy.services.library.base import PythonAPIService
from programy.services.library.base import PythonAPIServiceException
from programy.services.config import ServiceConfiguration
class PythonAPIServiceExceptionTests(unittest.TestCase... | 0 | 2 | 0 | 0 | 2 | 0 |
migrations/versions/21b7c3b2ce88_index_build_project_.py | vault-the/changes | 443 | 1765146 | <reponame>vault-the/changes
"""Index Build.project_id,patch_id,date_created
Revision ID: 21b7c3b2ce88
Revises: 4134b481<PASSWORD>
Create Date: 2013-12-03 16:19:11.794912
"""
# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '4134b4818694'
from alembic import op
def upgrade():
op.crea... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/generate_cpm2.py | AdamBear/BMInf | 206 | 1765157 | <filename>examples/generate_cpm2.py
import bminf
import sys
input_text = """天空是蔚蓝色,窗外有"""
def generate(model : bminf.models.CPM2, text):
print("Input: ", text)
sys.stdout.write("Output: %s" % text)
stoped = False
while not stoped:
value, stoped = model.generate(
input_sentence = te... | 0 | 0 | 0 | 0 | 0 | 0 |
optbinning/binning/multidimensional/binning_statistics_2d.py | jensgk/optbinning | 207 | 1765170 | <reponame>jensgk/optbinning
"""
Optimal binning algorithm 2D.
"""
# <NAME> <<EMAIL>>
# Copyright (C) 2021
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from mpl_toolkits.axes_grid1 import make_axes_locatable
from ...formatting import dataframe_to_string
from ..binning_statistics import _che... | 0 | 0 | 0 | 0 | 0 | 0 |
summarus/settings.py | crazydigger/ru_summarization_mbart | 139 | 1765208 | <filename>summarus/settings.py
import os
from pkg_resources import resource_filename
TESTS_DIR = resource_filename(__name__, "tests")
DATA_DIR = os.path.join(TESTS_DIR, "data")
TEST_URLS_FILE = os.path.join(DATA_DIR, "urls.txt")
TEST_CONFIG_DIR = os.path.join(TESTS_DIR, "configs")
TEST_STORIES_DIR = os.path.join(DATA_... | 0 | 0 | 0 | 0 | 0 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.