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 |
|---|---|---|---|---|---|---|---|---|---|---|
calc/urls.py | 18F/calc | 126 | 147174 | <gh_stars>100-1000
from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView
from uaa_client.decorators import staff_login_required
import data_explorer.views
import contracts.views
from .sample_users import login_sample_us... | 0 | 0 | 0 | 0 | 0 | 0 |
SimTracker/TrackerMaterialAnalysis/python/trackingMaterialAnalyser_cff.py | ckamtsikis/cmssw | 852 | 147182 | import FWCore.ParameterSet.Config as cms
# Define arbitrary tracker material groups
from RecoTracker.GeometryESProducer.TrackerRecoGeometryESProducer_cfi import *
from SimTracker.TrackerMaterialAnalysis.trackingMaterialGroups_cff import *
# Analyze and plot the tracking material
from SimTracker.TrackerMaterialAnalysi... | 0 | 0 | 0 | 0 | 0 | 0 |
dart_fss/api/shareholder/__init__.py | dveamer/dart-fss | 243 | 147215 | <reponame>dveamer/dart-fss<filename>dart_fss/api/shareholder/__init__.py
from .executive import get_executive_shareholder
from .major_shareholder import get_major_shareholder
__all__ = ['get_executive_shareholder', 'get_major_shareholder'] | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_ec2.py | compose-x/troposphere | 4,573 | 147223 | <gh_stars>1000+
import unittest
import troposphere.ec2 as ec2
class TestEC2(unittest.TestCase):
def test_securitygroupegress(self):
egress = ec2.SecurityGroupEgress(
"egress",
ToPort="80",
FromPort="80",
IpProtocol="tcp",
GroupId="id",
... | 0 | 0 | 0 | 0 | 0 | 0 |
src/spring-cloud/azext_spring_cloud/__init__.py | Mannan2812/azure-cli-extensions | 207 | 147247 | <gh_stars>100-1000
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# ----------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/torch/quantization/test_quantization_helpers.py | MaximProshin/nncf | 136 | 147256 | <reponame>MaximProshin/nncf
"""
Copyright (c) 2022 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 applicabl... | 0 | 0 | 0 | 0 | 0 | 0 |
plugins/solve_fsm/test_plugin.py | emsec/HAL | 407 | 147269 | <gh_stars>100-1000
#!/usr/bin/env python3
import sys, os
#some necessary configuration:
sys.path.append("/home/simon/projects/hal/build/lib/") #this is where your hal python lib is located
os.environ["HAL_BASE_PATH"] = "/home/simon/projects/hal/build" # hal base path
import hal_py
netlist_to_read = "netlist.v"
gate_l... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/1d/plot_classif_torch.py | GReguig/kymatio | 516 | 147282 | <gh_stars>100-1000
"""
Classification of spoken digit recordings
=========================================
In this example we use the 1D scattering transform to represent spoken digits,
which we then classify using a simple classifier. This shows that 1D scattering
representations are useful for this type of problem.
... | 0 | 0 | 0 | 0 | 0 | 0 |
muddery/worldeditor/services/data_edit.py | dongwudanci/muddery | 127 | 147283 | <reponame>dongwudanci/muddery
"""
Battle commands. They only can be used when a character is in a combat.
"""
from django.db import transaction
from django.core.exceptions import ObjectDoesNotExist
from muddery.server.utils.exception import MudderyError, ERR
from muddery.worldeditor.dao import general_query_mapper
fro... | 0 | 0 | 0 | 0 | 0 | 0 |
libutils/primes.py | nicknaym530/android_system_core | 8,865 | 147297 | #!/usr/bin/env python2.6
#
# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 0 | 0 | 0 | 0 | 0 | 0 |
kik_unofficial/datatypes/exceptions.py | aspwil/kik-bot-api-unofficial | 120 | 147369 | from __future__ import annotations
class KikErrorException(Exception):
def __init__(self, xml_error, message: object | None=None):
self.message = message
self.xml_error = xml_error
def __str__(self) -> object:
return self.__repr__()
def __repr__(self) -> object:
if self.mes... | 2 | 4 | 0 | 0 | 6 | 0 |
office365/planner/planner_user.py | theodoriss/Office365-REST-Python-Client | 544 | 147376 | from office365.entity import Entity
from office365.entity_collection import EntityCollection
from office365.planner.plans.plan import PlannerPlan
from office365.planner.tasks.task import PlannerTask
from office365.runtime.paths.resource_path import ResourcePath
class PlannerUser(Entity):
"""The plannerUser resour... | 0 | 2 | 0 | 0 | 2 | 0 |
python/GafferSceneUI/InstancerUI.py | ddesmond/gaffer | 561 | 147379 | ##########################################################################
#
# Copyright (c) 2015, Image Engine Design 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:
#
# * Redistrib... | 2 | 10 | 0 | 2 | 14 | 0 |
saleor/webhook/migrations/0001_initial.py | fairhopeweb/saleor | 15,337 | 147415 | # Generated by Django 2.2.4 on 2019-09-26 05:47
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
initial: bool = True
dependencies: list[tuple[str, str]] = [("account", "0033_serviceaccount")]
operations: list[object] = [
migratio... | 0 | 0 | 3 | 0 | 3 | 0 |
python/lbann/core/optimizer.py | jonesholger/lbann | 194 | 147441 | import abc
from lbann import optimizers_pb2
import lbann.core.util
class Optimizer(abc.ABC):
"""Optimization algorithm for a neural network's parameters."""
def export_proto(self) -> object:
"""Construct and return a protobuf message."""
return optimizers_pb2.Optimizer()
# Generate Optimizer s... | 0 | 1 | 0 | 0 | 1 | 0 |
convlab/modules/nlu/multiwoz/onenet/dataset_reader.py | ngduyanhece/ConvLab | 405 | 147449 | <filename>convlab/modules/nlu/multiwoz/onenet/dataset_reader.py
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import logging
import os
import zipfile
from typing import Dict, List, Any
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fiel... | 0 | 0 | 0 | 0 | 0 | 0 |
tools/bootloader/can/host/bootloader.py | roboterclubaachen/xpcc | 161 | 147469 | #!/usr/bin/env python3
from __future__ import annotations
""" Bootloader for AVR-Boards connected via CAN bus
Format:
11-Bit Identifier
1. Board Identifier
2. Message Type
3. Message Number
4. Message Data Counter
5.-8. Data
"""
import time
import math
import Queue
import threading
import can
import message_fil... | 13 | 9 | 17 | 6 | 45 | 0 |
chapter5_operations/prediction_monitoring_pattern/src/db/cruds.py | sudabon/ml-system-in-actions | 133 | 147549 | from typing import Dict, List
from sqlalchemy.orm import Session
from src.db import models, schemas
def select_prediction_log_all(db: Session) -> List[schemas.PredictionLog]:
return db.query(models.PredictionLog).all()
def select_prediction_log_between(
db: Session,
time_before: str,
time_later: st... | 16 | 6 | 0 | 0 | 22 | 0 |
yotta/lib/component.py | microbit-foundation/yotta | 176 | 147573 | # Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
from __future__ import annotations
import os
import logging
from collections import OrderedDict
# access, , get components, internal
from yotta.lib import access
from yotta.l... | 48 | 31 | 0 | 3 | 82 | 0 |
qubiter/adv_applications/MeanHamil_rigetti.py | artiste-qb-net/qubiter | 129 | 147607 | import copy as cp
from qubiter.adv_applications.MeanHamil import *
from qubiter.device_specific.Qubiter_to_RigettiPyQuil import *
from qubiter.device_specific.RigettiTools import *
import qubiter.utilities_gen as utg
from openfermion.ops import QubitOperator
from pyquil.quil import Program, Pragma
from pyquil.gates ... | 1 | 1 | 0 | 1 | 3 | 0 |
torchbenchmark/score/generate_score_config.py | xuzhao9/benchmark | 384 | 147632 | """
Generate a fully specified benchmark configuration file, given a lightweight
specification and a complete source of benchmark data.
Specification File
------------------
Score hierarchy input intended to be as easy to construct as possible,
relying on automatic inference of unspecified weights, benchmark configs,
... | 0 | 2 | 0 | 0 | 2 | 0 |
fastNLP/modules/encoder/bert.py | ouyhlan/fastNLP | 2,693 | 147636 | from __future__ import annotations
r"""undocumented
这个页面的代码很大程度上参考(复制粘贴)了https://github.com/huggingface/pytorch-pretrained-BERT的代码, 如果你发现该代码对你
有用,也请引用一下他们。
"""
__all__ = [
"BertModel",
]
import copy
import json
import math
import os
import torch
from torch import nn
import numpy as np
from ...io.file_utils ... | 23 | 22 | 0 | 2 | 47 | 0 |
mlcomp/contrib/criterion/triplet.py | megachester/mlcomp | 166 | 147639 | <filename>mlcomp/contrib/criterion/triplet.py<gh_stars>100-1000
import torch
import torch.nn.functional as F
from catalyst.contrib.nn.criterion.functional import cosine_distance, \
batch_all, _EPS
def triplet_loss(
embeddings: torch.Tensor, labels: torch.Tensor, margin: float = 0.3,
reduction='mea... | 0 | 0 | 0 | 0 | 0 | 0 |
snakeeyes/blueprints/page/__init__.py | cprey/boundtofail | 881 | 147646 | from snakeeyes.blueprints.page.views import page
| 0 | 0 | 0 | 0 | 0 | 0 |
djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/facebook/locale.py | DemarcusL/django_wiki_lab | 6,342 | 147650 | # Default locale mapping for the Facebook JS SDK
# The list of supported locales is at
# https://www.facebook.com/translations/FacebookLocales.xml
import os
from django.utils.translation import get_language, to_locale
def _build_locale_table(filename_or_file) -> object:
"""
Parses the FacebookLocales.xml fil... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/python/ViewTransformTest.py | mjtitchener-fn/OpenColorIO | 628 | 147713 | <reponame>mjtitchener-fn/OpenColorIO
# SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
import unittest, os, sys
import PyOpenColorIO as OCIO
class ViewTransformTest(unittest.TestCase):
def test_default_contructor(self):
"""
Test the constructor.
... | 0 | 0 | 0 | 0 | 0 | 0 |
corehq/messaging/smsbackends/trumpia/tests/test_outgoing.py | akashkj/commcare-hq | 471 | 147719 | <gh_stars>100-1000
from urllib.parse import urlencode
from django.test import SimpleTestCase
import requests_mock
from corehq.apps.reports.standard.message_event_display import (
get_sms_status_display,
)
from corehq.apps.sms.models import QueuedSMS
from corehq.messaging.smsbackends.trumpia.models import (
T... | 0 | 0 | 0 | 0 | 0 | 0 |
dm_env/_environment_test.py | kngwyu/dm_env | 235 | 147722 | <filename>dm_env/_environment_test.py
# pylint: disable=g-bad-file-header
# Copyright 2019 The dm_env 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... | 0 | 0 | 0 | 0 | 0 | 0 |
pykinect_azure/k4arecord/_k4arecord.py | necoxt/pyKinectAzure | 170 | 147733 | import ctypes
import sys
import traceback
from ._k4arecordTypes import *
from ..k4a._k4atypes import *
record_dll = None
def setup_library(module_k4arecord_path):
global record_dll
try:
record_dll = ctypes.CDLL(module_k4arecord_path)
except Exception as e:
print("Failed to load library", e)
sys.exit(1)
d... | 0 | 31 | 0 | 0 | 31 | 0 |
ChasingTrainFramework_GeneralOneClassDetection/loss_layer_farm/mean_squared_error_with_ohem_for_one_class_detection.py | dvt0101/A-Light-and-Fast-Face-Detector-for-Edge-Devices | 1,172 | 147760 | <reponame>dvt0101/A-Light-and-Fast-Face-Detector-for-Edge-Devices<filename>ChasingTrainFramework_GeneralOneClassDetection/loss_layer_farm/mean_squared_error_with_ohem_for_one_class_detection.py<gh_stars>1000+
# -*- coding: utf-8 -*-
'''
squared error with online hard example mining
'''
import mxnet as mx
class mean_s... | 0 | 0 | 0 | 0 | 0 | 0 |
proteinbert/conv_and_global_attention_model.py | akriot/protein_bert | 124 | 147773 | <filename>proteinbert/conv_and_global_attention_model.py
import numpy as np
import tensorflow as tf
from tensorflow import keras
import tensorflow.keras.backend as K
class GlobalAttention(keras.layers.Layer):
'''
Recevies two inputs:
1. A global representation (of some fixed dimension)
2. A seque... | 0 | 0 | 0 | 0 | 0 | 0 |
TileStache/Geography.py | shoeberto/TileStache | 414 | 147792 | """ The geography bits of TileStache.
A Projection defines the relationship between the rendered tiles and the
underlying geographic data. Generally, just one popular projection is used
for most web maps, "spherical mercator".
Built-in projections:
- spherical mercator
- WGS84
Example use projection in a layer defin... | 0 | 9 | 2 | 0 | 11 | 0 |
src/utils/version.py | mazurwiktor/albion-online-stats | 156 | 147863 | from __future__ import annotations
import os
import requests
from ..version import version
latest_url = "https://github.com/mazurwiktor/albion-online-stats/releases/latest"
def get_version() -> object:
return version
def latest_version() -> object | None:
req = requests.get(latest_url)
if req.status_c... | 0 | 3 | 0 | 0 | 3 | 0 |
py_stringmatching/tokenizer/tokenizer.py | kvpradap/conda-pysm-appveyor | 115 | 147865 | <reponame>kvpradap/conda-pysm-appveyor<filename>py_stringmatching/tokenizer/tokenizer.py
class Tokenizer(object):
"""The root class for tokenizers.
Args:
return_set (boolean): A flag to indicate whether to return a set of
tokens instead of a bag of tokens (defaults to Fals... | 0 | 0 | 0 | 0 | 0 | 0 |
petridish/analysis/model.py | Bhaskers-Blu-Org2/petridishnn | 121 | 147877 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
"""
This script is gathers information about a model training run using
the log file of the run (or the saved stdout of the run).
The information are gathered with `grep` commands on key strings.
We assume that the log file contains one single r... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/extras/logging/test_color_logger.py | daniel-falk/kedro | 2,047 | 147885 | import logging
from kedro.extras.logging import ColorHandler
def test_color_logger(caplog):
log = logging.getLogger(__name__)
for handler in log.handlers:
log.removeHandler(handler) # pragma: no cover
log.addHandler(ColorHandler())
log.info("Test")
for record in caplog.records:
... | 0 | 0 | 0 | 0 | 0 | 0 |
dfm/net.py | 127t6937/chainer-gan-lib | 449 | 147917 | <filename>dfm/net.py
import chainer.functions as F
import chainer.links as L
import numpy as np
import chainer
class Discriminator(chainer.Chain):
def __init__(self, bottom_width=2, ch=512, wscale=0.02):
w = chainer.initializers.Normal(wscale)
super(Discriminator, self).__init__()
with sel... | 0 | 0 | 0 | 0 | 0 | 0 |
app/api/__init__.py | cmyui/gulag | 187 | 147927 | # type: ignore
from . import ava
from . import cho
from . import map
from . import osu
| 0 | 0 | 0 | 0 | 0 | 0 |
resnet/nsfw_scratch.py | reckonsys/rsnsfw | 515 | 147968 | #-*-coding:utf-8-*-
from __future__ import annotations
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import re
from absl import app as absl_app
from absl import flags
import tensorflow as tf # pylint: disable=g-bad-import-order
from resnet im... | 6 | 7 | 0 | 0 | 13 | 0 |
ppci/arch/mcs6500/registers.py | rakati/ppci-mirror | 161 | 147969 | from ..registers import Register, RegisterClass
from ... import ir
class Accumulator(Register):
bitsize: int = 8
# TODO: hack, this is no register but a stack position!
class Temporary(Register):
""" On stack temporary """
bitsize: int = 8
A = Accumulator("A", num=0)
r0 = Temporary("r0", 0)
r1 = Tem... | 0 | 0 | 2 | 0 | 2 | 0 |
eliot/testing.py | tp-la/eliot | 598 | 147975 | from __future__ import annotations
"""
Utilities to aid unit testing L{eliot} and code that uses it.
"""
from __future__ import unicode_literals
from unittest import SkipTest
from functools import wraps
from pyrsistent import PClass, field
from six import text_type
from ._action import (
ACTION_STATUS_FIELD,
... | 3 | 19 | 0 | 0 | 22 | 0 |
fhirclient/models/medicinalproductindication_tests.py | carolinarsm/client-py | 418 | 147976 | <filename>fhirclient/models/medicinalproductindication_tests.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 4.0.0-a53ec6ee1b on 2019-05-07.
# 2019, SMART Health IT.
import os
import io
import unittest
import json
from . import medicinalproductindication
from .fhirdate import FHIRDate
cla... | 0 | 0 | 0 | 0 | 0 | 0 |
backend/db/test/friend_test.py | sleepingAnt/viewfinder | 645 | 147994 | # Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Tests for Friend data object.
"""
__author__ = '<EMAIL> (<NAME>)'
import logging
import unittest
from functools import partial
from viewfinder.backend.base import util
from viewfinder.backend.base.testing import async_test
from viewfinder.backend.db.friend im... | 0 | 0 | 0 | 0 | 0 | 0 |
rpmvenv/extensions/files/__init__.py | oleynikandrey/rpmvenv | 150 | 147999 | <reponame>oleynikandrey/rpmvenv
"""Extensions which provide a files block segment."""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
| 0 | 0 | 0 | 0 | 0 | 0 |
plugins/modules/oci_database_management_execution_plan_stats_comparision_facts.py | slmjy/oci-ansible-collection | 108 | 148005 | #!/usr/bin/python
# Copyright (c) 2020, 2021 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 0 | 2 | 0 | 0 | 2 | 0 |
update_readme.py | kasetty/til | 450 | 148017 | <gh_stars>100-1000
"Run this after build_database.py - it needs tils.db"
import pathlib
import sqlite_utils
import sys
import re
root = pathlib.Path(__file__).parent.resolve()
index_re = re.compile(r"<!\-\- index starts \-\->.*<!\-\- index ends \-\->", re.DOTALL)
count_re = re.compile(r"<!\-\- count starts \-\->.*<!\... | 0 | 0 | 0 | 0 | 0 | 0 |
proxy/quickstart/send-message/send-message.6.x.py | Tshisuaka/api-snippets | 234 | 148020 | # Get the Python helper library from https://twilio.com/docs/libraries/python
import os
from twilio.rest import Client
# Get your Account SID and Auth Token from https://twilio.com/console
# To set up environmental variables, see http://twil.io/secure
account = os.environ['TWILIO_ACCOUNT_SID']
token = os.environ['TWIL... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_star_wars_connections.py | artofhuman/graphql-relay-py | 124 | 148091 | <reponame>artofhuman/graphql-relay-py
from graphql import graphql_sync
from .star_wars_schema import StarWarsSchema as schema
def describe_star_wars_connections():
def fetches_the_first_ship_of_the_rebels():
source = """
{
rebels {
name,
ships(fir... | 0 | 0 | 0 | 0 | 0 | 0 |
setup.py | xeddmc/transformationInvariantImageSearch | 285 | 148110 | <reponame>xeddmc/transformationInvariantImageSearch<gh_stars>100-1000
#!/usr/bin/env python
from setuptools import setup, find_packages
"""
TODO
- copy or link `python` folder to `transformation_invariant_image_search`
"""
def readme():
with open('README.md') as f:
return f.read()
setup(
name='transf... | 0 | 0 | 0 | 0 | 0 | 0 |
release/stubs.min/Autodesk/Revit/DB/Analysis_parts/EnergyAnalysisDetailModelOptions.py | htlcnn/ironpython-stubs | 182 | 148112 | class EnergyAnalysisDetailModelOptions(object,IDisposable):
"""
Options that govern the calculations for the generation of the energy analysis detail model.
EnergyAnalysisDetailModelOptions()
"""
def Dispose(self):
""" Dispose(self: EnergyAnalysisDetailModelOptions) """
pass
def ReleaseUnmanage... | 0 | 0 | 0 | 0 | 0 | 0 |
controle_estoque/Crud/CrudCatAReceber.py | jucimar1/controleEstoque | 134 | 148115 | # -*- coding: utf-8 -*-
from sqlalchemy.exc import IntegrityError
from sqlalchemy import desc
from Crud.core import Conexao
from Crud.Models import CatAReceber
class CrudCatAReceber(object):
def __init__(self, id: str="", categoriaReceber: str="", query: str=""):
self.id = id
self.categoriaReceb... | 3 | 1 | 0 | 0 | 4 | 0 |
Chapter02/Python 2.7/single_neuron_model_1.py | littlealexchen/Deep-Learning-with-TensorFlow-master | 194 | 148123 | import tensorflow as tf
weight = tf.Variable(1.0,name="weight")
input_value = tf.constant(0.5,name="input_value")
expected_output = tf.constant(0.0,name="expected_output")
model = tf.multiply(input_value,weight,"model")
loss_function = tf.pow(expected_output - model,2,name="loss_function")
optimizer = tf.train.Gradie... | 0 | 0 | 0 | 0 | 0 | 0 |
load.py | pjialin/pyproxy-async | 133 | 148140 | <filename>load.py<gh_stars>100-1000
"""
从文件中加载 IP 列表
"""
import asyncio
import os
import sys
import aiohttp
from src.app.ip_get import IPGet
from src.app.main import Logger
async def main():
argv = None
if len(sys.argv) > 1:
argv = sys.argv[1]
if argv and argv.find('://') > 0:
return awa... | 0 | 0 | 0 | 0 | 0 | 0 |
EC2 Auto Clean Room Forensics/Lambda-Functions/sendIsolationNotification.py | ir4n6/aws-security-automation | 535 | 148155 | <reponame>ir4n6/aws-security-automation
# MIT No Attribution
# 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... | 0 | 0 | 0 | 0 | 0 | 0 |
Tensile/ReplacementKernels.py | cgmb/Tensile | 116 | 148166 | <filename>Tensile/ReplacementKernels.py<gh_stars>100-1000
################################################################################
# Copyright 2020 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated... | 0 | 0 | 0 | 0 | 0 | 0 |
malwareconfig/decoders/blackshades.py | BA7JCM/RATDecoders | 905 | 148172 | <filename>malwareconfig/decoders/blackshades.py
import re
import binascii
from malwareconfig import crypto
from malwareconfig.common import Decoder
from malwareconfig.common import string_printable
prng_seed = 0
class BlackShades(Decoder):
decoder_name = "BlackShades"
decoder__version = 1
decoder_author ... | 0 | 0 | 0 | 0 | 0 | 0 |
source-of-truth/get_from_netbox.py | fallenfuzz/netdevops_demos | 104 | 148174 | import pynetbox
import os
import ipaddress
netbox_token = os.getenv("NETBOX_TOKEN")
netbox_url = os.getenv("NETBOX_URL")
site_name = os.getenv("NETBOX_SITE")
tenant_name = os.getenv("NETBOX_TENANT")
netbox = pynetbox.api(netbox_url, token=netbox_token)
tenant = netbox.tenancy.tenants.get(name=tenant_name)
mgmt_tena... | 0 | 0 | 0 | 0 | 0 | 0 |
tests/r/test_animals.py | hajime9652/observations | 199 | 148175 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import shutil
import sys
import tempfile
from observations.r.animals import animals
def test_animals():
"""Test module animals.py by downloading
animals.csv and testing shape of
extracted data has 20... | 0 | 0 | 0 | 0 | 0 | 0 |
conanfile.py | MasterMann/argparse | 1,101 | 148256 | <reponame>MasterMann/argparse
from conans import ConanFile
class ArgparseConan(ConanFile):
name = "argparse"
version = "1.0"
exports_sources = "include/argparse.hpp"
no_copy_source = True
def package(self):
self.copy("argparse.hpp") | 0 | 0 | 0 | 0 | 0 | 0 |
pydis_site/apps/resources/utils.py | ethansocal/site | 700 | 148264 | import typing as t
from pathlib import Path
import yaml
def get_resources(path: Path) -> t.List[t.Dict]:
"""Loads resource YAMLs from provided path."""
resources = []
for item in path.iterdir():
if item.is_file() and item.suffix == ".yaml" and item.name != "_category_info.yaml":
reso... | 2 | 2 | 0 | 0 | 4 | 0 |
ibis/backends/pandas/__init__.py | rohankumardubey/ibis | 986 | 148270 | from __future__ import annotations
import pandas as pd
import toolz
import ibis.common.exceptions as com
import ibis.config
import ibis.expr.schema as sch
import ibis.expr.types as ir
from ibis.backends.base import BaseBackend
from .client import PandasDatabase, PandasTable, ibis_schema_to_pandas
class BasePandasBa... | 13 | 8 | 1 | 0 | 22 | 0 |
tests/test-cases/basic/mnode_case.py | SMAT-Lab/Scalpel | 102 | 148323 | <reponame>SMAT-Lab/Scalpel<gh_stars>100-1000
from X import A
from X import B
from X.C import C2
from Y import D as d
from .. import Test
def main(a, b):
#def main(a, b, x=10, y=10, z = 10):
AA(a,b)
return 0
def AA(a,b):
BB()
CC()
x = d.xx()
return 0
def BB(a,b):
CC()
y = 10
return... | 0 | 0 | 0 | 0 | 0 | 0 |
RecoVertex/BeamSpotProducer/test/BeamFit_LumiBased_NewAlignWorkflow.py | ckamtsikis/cmssw | 852 | 148337 | import FWCore.ParameterSet.Config as cms
process = cms.Process("BSworkflow")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
"/store/express/Run2015A/StreamExpress/ALCARECO/TkAlMinBias-Express-v1/000/246/959/00000/14174DF2-490A-E511-9862-02163E0143E9.root",
)
)
process.load... | 0 | 0 | 0 | 0 | 0 | 0 |
rig/utils.py | fsanges/glTools | 165 | 148340 | <reponame>fsanges/glTools
import maya.cmds as mc
import glTools.utils.channelState
import glTools.utils.defaultAttrState
import glTools.utils.attribute
import glTools.utils.base
import glTools.utils.cleanup
import glTools.utils.colorize
import glTools.utils.component
import glTools.utils.connection
import glTools.uti... | 0 | 0 | 0 | 0 | 0 | 0 |
zhaquirks/yale/realliving.py | WolfRevo/zha-device-handlers | 213 | 148347 | """Device handler for Yale Real Living."""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.closures import DoorLock
from zigpy.zcl.clusters.general import Alarms, Basic, Identify, Ota, PollControl, Time
from zhaquirks import DoublingPowerConfigurationCluster
from zhaquirks.... | 0 | 0 | 4 | 0 | 4 | 0 |
Scripts/CI/README_Metadata_StyleCheck/metadata_style_checker.py | pgruenler/arcgis-runtime-samples-ios | 292 | 148351 | #!/usr/bin/env python3
import os
import re
import json
import typing
import argparse
# region Global sets
# A set of category folder names in current sample viewer.
categories = {
'Maps',
'Layers',
'Features',
'Display information',
'Search',
'Edit data',
'Geometry',
'Route and direct... | 9 | 10 | 0 | 9 | 28 | 0 |
common/py_utils/py_utils/retry_util.py | tingshao/catapult | 1,894 | 148366 | <filename>common/py_utils/py_utils/retry_util.py<gh_stars>1000+
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
from __future__ import division
from __future__ import ... | 0 | 0 | 0 | 0 | 0 | 0 |
util/minorview/model.py | qianlong4526888/haha | 135 | 148368 | # Copyright (c) 2013 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality o... | 0 | 0 | 0 | 0 | 0 | 0 |
social_auth/backends/contrib/yammer_staging.py | merutak/django-social-auth | 863 | 148373 | <reponame>merutak/django-social-auth
from social.backends.yammer import YammerStagingOAuth2 as YammerStagingBackend
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/stl_corruption.py | Gjacquenot/numpy-stl | 464 | 148381 | from __future__ import print_function
import sys
import numpy
import pytest
import struct
from stl import mesh
_STL_FILE = '''
solid test.stl
facet normal -0.014565 0.073223 -0.002897
outer loop
vertex 0.399344 0.461940 1.044090
vertex 0.500000 0.500000 1.500000
vertex 0.576120 0.500000 1.117320
endlo... | 0 | 0 | 0 | 0 | 0 | 0 |
Python/tdw/collisions.py | felixbinder/tdw | 307 | 148423 | <filename>Python/tdw/collisions.py
from typing import List, Dict
import numpy as np
from tdw.output_data import OutputData, Collision, EnvironmentCollision
from tdw.int_pair import IntPair
class CollisionObjObj:
"""
A collision between two objects.
"""
def __init__(self, collision: Collision):
... | 0 | 0 | 0 | 0 | 0 | 0 |
nzbhydra/searchmodules/jackett.py | Sparklingx/nzbhydra | 674 | 148450 | from __future__ import annotations
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import xml.etree.ElementTree as ET
import arrow
from builtins import *
from nzbhydra.categories import getByNewznabCat... | 3 | 8 | 0 | 4 | 15 | 0 |
src/projects/tags/tests/test_models.py | augustuswm/flagsmith-api | 1,259 | 148469 | <filename>src/projects/tags/tests/test_models.py
import pytest
from django.test import TestCase
from organisations.models import Organisation
from projects.models import Project
from projects.tags.models import Tag
@pytest.mark.django_db
class TagsTestCase(TestCase):
def setUp(self) -> None:
self.organis... | 0 | 0 | 0 | 0 | 0 | 0 |
src/elastic/azext_elastic/tests/latest/test_elastic_scenario.py | haroonf/azure-cli-extensions | 207 | 148485 | <filename>src/elastic/azext_elastic/tests/latest/test_elastic_scenario.py
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code gen... | 0 | 0 | 0 | 0 | 0 | 0 |
lektor/types/base.py | yagebu/lektor | 4,104 | 148513 | from jinja2 import Undefined
from lektor.constants import PRIMARY_ALT
class BadValue(Undefined):
__slots__ = ()
def get_undefined_info(undefined):
if isinstance(undefined, Undefined):
try:
undefined._fail_with_undefined_error()
except Exception as e:
return str(e)
... | 0 | 0 | 0 | 0 | 0 | 1 |
tools/build/bazel/angular_workspace.bzl | MohiK98/onos | 1,091 | 148536 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@npm//@bazel/protractor:package.bzl", "npm_bazel_protractor_dependencies")
load("@npm//@bazel/karma:package.bzl", "npm_bazel_karma_dependencies")
load("@io_bazel_rules_webtesting//web:repositories.bzl", "web_test_repositories")
load("@io_bazel_r... | 0 | 0 | 0 | 0 | 0 | 0 |
seahub/repo_api_tokens/utils.py | weimens/seahub | 101 | 148538 | from __future__ import annotations
import os
import logging
import posixpath
import stat
from django.utils.http import urlquote
from seaserv import seafile_api
from seahub.base.models import UserStarredFiles
from seahub.base.templatetags.seahub_tags import email2nickname, email2contact_email
from seahub.settings impo... | 0 | 3 | 0 | 0 | 3 | 0 |
src/tensorflow2.x-python-tutorial/keras-lambda.py | pepure/SciSharp-Stack-Examples | 197 | 148546 | import tensorflow as tf
from tensorflow.keras.layers import Input, Dense, Add, Subtract, Lambda
from tensorflow.keras.models import Model
from tensorflow.keras.optimizers import RMSprop
import tensorflow.keras.backend as K
c = tf.constant(['a', 'b'])
e = tf.math.erf([1.0, -0.5, 3.4, -2.1, 0.0, -6.5])
input = tf.keras... | 0 | 0 | 0 | 0 | 0 | 0 |
distributed/__init__.py | merlinarer/scrl | 102 | 148556 | <reponame>merlinarer/scrl
from .launch import launch
from .getters import get_dist_url, scatter_values
| 0 | 0 | 0 | 0 | 0 | 0 |
hyppo/time_series/tests/test_mgcx.py | zdbzdb1212/hyppo | 116 | 148560 | <gh_stars>100-1000
import numpy as np
from numpy.testing import assert_almost_equal, assert_array_less
from ...tools import nonlinear_process
from .. import MGCX
class TestMGCXStat:
def test_multiple_lags(self):
n = 10
x = np.arange(1, n + 1).reshape(n, 1)
y = np.arange(1, n + 1).reshape(... | 0 | 0 | 0 | 0 | 0 | 0 |
packstack/installer/core/arch.py | lkpdn/packstack | 190 | 148598 | <gh_stars>100-1000
# -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 0 | 0 | 0 | 0 | 0 | 0 |
examples/bench/cgt_gru.py | rohanraja/cgt_distributed | 698 | 148603 | <reponame>rohanraja/cgt_distributed<gh_stars>100-1000
import cgt
from gru import GRUCell
import time
from cgt.utils import Message
import numpy as np
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--horizon",type=int)
args = parser.parse_args()
ho... | 0 | 0 | 0 | 0 | 0 | 0 |
language/question_answering/decatt_docreader/datasets/nq_short_pipeline_dataset.py | naveenjafer/language | 1,199 | 148609 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 0 | 4 | 0 | 0 | 4 | 0 |
google/datalab/notebook/__init__.py | freyrsae/pydatalab | 198 | 148621 | <reponame>freyrsae/pydatalab<gh_stars>100-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 |
vcr/modules/resnet_vlbert_for_vcr.py | xiling42/VL-BERT | 671 | 148625 | <gh_stars>100-1000
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
from external.pytorch_pretrained_bert import BertTokenizer
from common.module import Module
from common.fast_rcnn import FastRCNN
from common.nlp.time_distributed import TimeDistributed
from common.visual_linguistic_bert imp... | 0 | 0 | 0 | 0 | 0 | 0 |
src/research/PTDF/ACPTDF_research2.py | mzy2240/GridCal | 284 | 148665 | # This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... | 5 | 8 | 0 | 0 | 13 | 0 |
panda/tests/location_listener.py | BoneE562/openpilot | 114 | 148666 | <gh_stars>100-1000
#!/usr/bin/env python3
import os
import time
import sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), ".."))
from panda import Panda, PandaSerial
def add_nmea_checksum(msg):
d = msg[1:]
cs = 0
for i in d:
cs ^= ord(i)
return msg + "*%02X" % cs
if __name__ ==... | 0 | 0 | 0 | 0 | 0 | 0 |
src/ralph/virtual/tests/test_api.py | elubik/ralph | 1,668 | 148684 | <filename>src/ralph/virtual/tests/test_api.py
from ddt import data, ddt, unpack
from django.core.urlresolvers import reverse
from rest_framework import status
from ralph.api.tests._base import RalphAPITestCase
from ralph.assets.models.assets import ServiceEnvironment
from ralph.assets.models.choices import ComponentTy... | 0 | 0 | 0 | 0 | 0 | 0 |
web/server/codechecker_server/permissions.py | ryankurte/codechecker | 1,601 | 148689 | <reponame>ryankurte/codechecker
# -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# -------------------... | 0 | 0 | 0 | 0 | 0 | 0 |
holoviews/tests/plotting/matplotlib/test_plot.py | TheoMathurin/holoviews | 864 | 148725 | <reponame>TheoMathurin/holoviews<gh_stars>100-1000
from unittest import SkipTest
from param import concrete_descendents
from holoviews.core.options import Store
from holoviews.element.comparison import ComparisonTestCase
import pyviz_comms as comms
try:
from holoviews.plotting.mpl.element import ElementPlot
... | 0 | 0 | 0 | 0 | 0 | 0 |
pytradfri/command.py | ggravlingen/ikeatradfri | 726 | 148738 | <gh_stars>100-1000
"""Command implementation."""
from __future__ import annotations
from collections.abc import Callable
from typing import Any, Generic, TypeVar
T = TypeVar("T")
class Command(Generic[T]):
"""The object for coap commands."""
def __init__(
self,
method: str,
path: li... | 0 | 0 | 0 | 0 | 0 | 0 |
bagnets/keras.py | tanimutomo/bag-of-local-features-models | 320 | 148744 | <reponame>tanimutomo/bag-of-local-features-models
import keras
from keras.models import load_model
__all__ = ['bagnet9', 'bagnet17', 'bagnet33']
model_urls = {
'bagnet9': 'https://bitbucket.org/wielandbrendel/bag-of-feature-pretrained-models/raw/d413271344758455ac086992beb579e256447839/bagnet8.h5',
... | 0 | 0 | 0 | 0 | 0 | 0 |
apps/user/templatetags/oauth_tags.py | aosky/blog | 335 | 148757 | # 创建了新的tags标签文件后必须重启服务器
from __future__ import annotations
from django import template
from ..models import Ouser
from comment.models import CommentUser
register = template.Library()
@register.simple_tag()
def get_user_data(uid) -> object | str:
"""返回用户的信息"""
user = Ouser.objects.filter(id=uid)
if user:... | 0 | 2 | 0 | 0 | 2 | 0 |
seahub/share/views.py | samuelduann/seahub | 420 | 148758 | # Copyright (c) 2012-2016 Seafile Ltd.
# encoding: utf-8
import os
import logging
import json
from django.core.cache import cache
from django.http import HttpResponse, HttpResponseRedirect, Http404, \
HttpResponseBadRequest
from django.utils.translation import ugettext as _, activate
from django.contrib import mes... | 0 | 10 | 0 | 0 | 10 | 0 |
cvxpy/reductions/flip_objective.py | hashstat/cvxpy | 3,285 | 148764 | """
Copyright 2017 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distrib... | 0 | 3 | 0 | 0 | 3 | 0 |
tests/unit_tests.py | VamshiKrishnaUM/flask-social | 173 | 148781 | <gh_stars>100-1000
from unittest import TestCase
from flask_social.core import _SocialState
class FlaskSocialUnitTests(TestCase):
def test_social_state_raises_attribute_error(self):
state = _SocialState(providers={})
self.assertRaises(AttributeError, lambda: state.something)
| 0 | 0 | 0 | 0 | 0 | 0 |
tests/test_sparse_unet.py | BB88Lee/mmdetection3d | 217 | 148796 | import torch
from mmdet3d.ops import SparseBasicBlock
from mmdet3d.ops import spconv as spconv
def test_SparseUNet():
from mmdet3d.models.middle_encoders.sparse_unet import SparseUNet
self = SparseUNet(in_channels=4, sparse_shape=[41, 1600, 1408])
# test encoder layers
assert len(self.encoder_layers... | 0 | 0 | 0 | 0 | 0 | 0 |
src/cowrie/output/greynoise.py | uwacyber/cowrie | 2,316 | 148822 | """
Send attackers IP to GreyNoise
"""
from __future__ import annotations
import treq
from twisted.internet import defer, error
from twisted.python import log
import cowrie.core.output
from cowrie.core.config import CowrieConfig
COWRIE_USER_AGENT = "Cowrie Honeypot"
GNAPI_URL = "https://api.greynoise.io/v3/communit... | 0 | 1 | 0 | 0 | 1 | 0 |
basic_code/load.py | Soapy-Salted-Fish-King/Emotion-FAN | 275 | 148838 | <filename>basic_code/load.py
from __future__ import print_function
import torch
print(torch.__version__)
import torch.utils.data
import torchvision.transforms as transforms
from basic_code import data_generator
cate2label = {'CK+':{0: 'Happy', 1: 'Angry', 2: 'Disgust', 3: 'Fear', 4: 'Sad', 5: 'Contempt', 6: 'Surprise'... | 0 | 0 | 0 | 0 | 0 | 0 |
Face-Detection/Deep Dense Face Detection/face/datasets/celeb.py | swapnilgarg7/Face-X | 175 | 148859 | """
Code for working with Celeb+ dataset
"""
import os
import shutil
import subprocess
import glob
import face.download
import face.utilities
import face.geometry
class DatasetBuilder:
"""
Class for downloading Celeb+ data and preparing datasets from it.
"""
def __init__(self, data_directory):
... | 0 | 2 | 0 | 0 | 2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.