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 |
|---|---|---|---|---|
routeros_api/api_communicator/async_decorator.py | davidc/RouterOS-api | 183 | 11151867 | class AsyncApiCommunicator(object):
def __init__(self, inner):
self.inner = inner
def call(self, *args, **kwargs):
tag = self.inner.send(*args, **kwargs)
return ResponsePromise(self.inner, tag)
class ResponsePromise(object):
def __init__(self, receiver, tag):
self.receiver ... |
external/gprof2dot/hotshotmain.py | sean-v8/RMG-Py | 1,348 | 11151877 | #!/usr/bin/env python
#
# Copyright 2007 <NAME>
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the 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 progra... |
modoboa/limits/migrations/0006_auto_20170216_1112.py | HarshCasper/modoboa | 1,602 | 11151879 | # Generated by Django 1.10.5 on 2017-02-16 10:12
from django.db import migrations
def create_quota_limits(apps, schema_editor):
"""Create quota limits."""
User = apps.get_model("core", "User")
if not User.objects.exists():
return
ContentType = apps.get_model("contenttypes", "ContentType")
... |
archai/common/model_summary.py | shatadru99/archai | 344 | 11151885 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import Iterable, Mapping, Sized, Sequence
import math
import torch
import torch.nn as nn
from collections import OrderedDict
import numpy as np
from numbers import Number
def summary(model, input_size):
result... |
tests/common/test_op/ascend/lstm_rnn_grad.py | tianjiashuo/akg | 286 | 11151905 | # 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... |
angr/engines/soot/values/paramref.py | Kyle-Kyle/angr | 6,132 | 11151912 | <filename>angr/engines/soot/values/paramref.py
from .base import SimSootValue
class SimSootValue_ParamRef(SimSootValue):
__slots__ = [ 'id', 'index', 'type' ]
def __init__(self, index, type_):
self.id = "param_%d" % index
self.index = index
self.type = type_
def __repr__(self):... |
src/test/python/test_exec.py | tschoonj/jep | 698 | 11151958 | import unittest
from jep_pipe import jep_pipe
from jep_pipe import build_java_process_cmd
class TestRunScript(unittest.TestCase):
def test_compiledScript(self):
jep_pipe(build_java_process_cmd('jep.test.TestExec'))
|
tests/testnode/addons.py | BabisK/microk8s | 6,286 | 11151965 | <reponame>BabisK/microk8s
#!/bin/env python3
from pathlib import Path
import datetime
import time
from jinja2 import Template
import requests
class Addon:
"""
Base class for testing Microk8s addons.
Validation requires a Kubernetes instance on the node
"""
name = None
def __init__(self, no... |
rocketqa/predict/dual_encoder.py | procedure2012/RocketQA | 210 | 11151968 | <filename>rocketqa/predict/dual_encoder.py
# Copyright (c) 2019 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/lice... |
iotbx/regression/tst_symmetry.py | dperl-sol/cctbx_project | 155 | 11152029 | <filename>iotbx/regression/tst_symmetry.py
from __future__ import absolute_import, division, print_function
import iotbx.symmetry
from cctbx import sgtbx, uctbx
from libtbx.test_utils import Exception_expected
from libtbx.utils import Sorry
from six.moves import cStringIO as StringIO
def exercise():
m = iotbx.symme... |
test/config_test.py | tamirzb/logcat-color | 373 | 11152041 | from common import *
from logcatcolor.column import *
from logcatcolor.config import *
from logcatcolor.layout import *
from logcatcolor.profile import *
from logcatcolor.reader import *
import unittest
this_dir = os.path.abspath(os.path.dirname(__file__))
configs_dir = os.path.join(this_dir, "configs")
def config_te... |
research/src/get_family_names.py | vbarceloscs/serenata-de-amor | 3,001 | 11152043 | import os
import re
import datetime
import requests
import numpy as np
import pandas as pd
from bs4 import BeautifulSoup
DATE = datetime.date.today().strftime('%Y-%m-%d')
DATA_DIR = 'data'
PROCESSED_DATA_FILE = '{}-congressperson-relatives.xz'
PROCESSED_DATA_PATH = os.path.join(DATA_DIR, PROCESSED_DATA_FILE).format(D... |
homeassistant/components/unifi_direct/__init__.py | domwillcode/home-assistant | 30,023 | 11152072 | """The unifi_direct component."""
|
Vecihi/Backend/vecihi/users/migrations/0002_auto_20171201_2311.py | developertqw2017/migrationDjango | 220 | 11152078 | <filename>Vecihi/Backend/vecihi/users/migrations/0002_auto_20171201_2311.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-01 23:11
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.M... |
crits/signatures/signature.py | dutrow/crits | 738 | 11152086 | <reponame>dutrow/crits
import uuid
try:
from django_mongoengine import Document
except ImportError:
from mongoengine import Document
from mongoengine import EmbeddedDocument
from mongoengine import StringField, ListField
from mongoengine import UUIDField
from mongoengine import IntField, BooleanField
from django.co... |
爬虫小demo/04 fileHandler.py | lb2281075105/Python-Spider | 713 | 11152122 | # -*- coding:utf-8 -*-
import csv
# 1、txt文件
file = open('file.txt','r')
# 获取所有的信息
print file.read()
file.write("你好")
# 获取所有并且在所有行存在一个数组
print file.readlines()
# 获取第一行
print file.readline()
# 2、读取csv文件
writer = csv.writer(open('test.csv','wb'))
writer.writerow(['col1','col2','col3'])
data = [range(3) for i in range(3... |
lldb/test/API/lang/cpp/diamond/TestDiamond.py | acidburn0zzz/llvm-project | 2,338 | 11152139 | <gh_stars>1000+
"""
Tests that bool types work
"""
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
class CPPTestDiamondInheritance(TestBase):
mydir = TestBase.compute_mydir(__file__)
def test_with_run_command(self):
"""Test that virtual base classes work ... |
RecoMET/METFilters/python/hcalLaserBadEvents_2011.py | ckamtsikis/cmssw | 852 | 11152145 | # File last updated on 16:58:23 28 Nov 2011
# A total of 281 bad events
badEvents=[
160957,146483131,
160957,146483132,
160957,367078426,
163289,120704451,
163289,120704452,
163332,300924904,
163587,5705088,
163588,86700074,
163659,269761831,
163659,379050220,
165415,696548170,
165415,696548171,
165617,295894671,
1656... |
library/oci_suppression_facts.py | slmjy/oci-ansible-modules | 106 | 11152171 | <gh_stars>100-1000
#!/usr/bin/python
# Copyright (c) 2018, 2019, 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
# S... |
L1Trigger/L1TMuonBarrel/test/kalmanTools/validation.py | ckamtsikis/cmssw | 852 | 11152186 | <reponame>ckamtsikis/cmssw<filename>L1Trigger/L1TMuonBarrel/test/kalmanTools/validation.py
from __future__ import print_function
import ROOT,itertools,math #
from array import array #
from DataFormats.FWLite import Events, Handle
ROOT.FWLiteEnabler.enable()
#
tag='output'
##A class to keep BMTF data
... |
code/baseline_ptbdb_transfer_fullupdate.py | Dr-Anonymous/ECG_Heartbeat_Classification | 123 | 11152202 | <filename>code/baseline_ptbdb_transfer_fullupdate.py
import pandas as pd
import numpy as np
from keras import optimizers, losses, activations, models
from keras.callbacks import ModelCheckpoint, EarlyStopping, LearningRateScheduler, ReduceLROnPlateau
from keras.layers import Dense, Input, Dropout, Convolution1D, MaxPo... |
setup.py | songhongxiang/symoro | 109 | 11152225 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
BIN_FOLDER = 'bin'
def readme():
with open('README.md') as f:
return f.read()
def apply_folder_join(item):
return os.path.join(BIN_FOLDER, item)
if os.name is 'nt':
bin_scripts = ['symoro-bi... |
lib/django-0.96/django/middleware/gzip.py | MiCHiLU/google_appengine_sdk | 790 | 11152231 | <reponame>MiCHiLU/google_appengine_sdk<gh_stars>100-1000
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
re_accepts_gzip = re.compile(r'\bgzip\b')
class GZipMiddleware(object):
"""
This middleware compresses content if the browser allows gzip compressi... |
tests/api/test_deploy_queue.py | sobolevn/paasta | 1,711 | 11152245 | <reponame>sobolevn/paasta
# Copyright 2015-2020 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
vendor-local/lib/python/south/tests/brokenapp/models.py | glogiotatidis/affiliates | 285 | 11152253 | # -*- coding: UTF-8 -*-
from django.db import models
from django.contrib.auth.models import User as UserAlias
def default_func():
return "yays"
# An empty case.
class Other1(models.Model): pass
# Nastiness.
class HorribleModel(models.Model):
"A model to test the edge cases of model parsing"
ZERO, O... |
tests/trac/test-trac-0207.py | eLBati/pyxb | 123 | 11152257 | # -*- coding: utf-8 -*-
import logging
if __name__ == '__main__':
logging.basicConfig()
_log = logging.getLogger(__name__)
import pyxb
import pyxb.utils.utility
import pyxb.binding.datatypes as xsd
from pyxb.utils.six.moves import cPickle as pickle
import unittest
class TestTrac0207 (unittest.TestCase):
def ... |
setup.py | Hamz-a/frida-ios-hook | 354 | 11152274 | <filename>setup.py
import os
from setuptools import setup, find_packages
def _package_files(directory: str, suffix: str) -> list:
"""
Get all of the file paths in the directory specified by suffix.
:param directory:
:return:
"""
paths = []
for (path, directories, filenames) in... |
alipay/aop/api/domain/AlipayEcoPrinterStatusNotifyModel.py | antopen/alipay-sdk-python-all | 213 | 11152289 | <filename>alipay/aop/api/domain/AlipayEcoPrinterStatusNotifyModel.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayEcoPrinterStatusNotifyModel(object):
def __init__(self):
self._eprint_sign = None
self._machine_code = N... |
netpyne/network/__init__.py | adamjhn/netpyne | 120 | 11152297 | """
Package for dealing with network models
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from .network import Network
from .pop import Pop
|
samcli/lib/utils/lock_distributor.py | praneetap/aws-sam-cli | 2,285 | 11152299 | """LockDistributor for creating and managing a set of locks"""
import threading
import multiprocessing
import multiprocessing.managers
from typing import Dict, Set, Optional, cast
from enum import Enum, auto
class LockChain:
"""Wrapper class for acquiring multiple locks in the same order to prevent dead locks
... |
src/py-opentimelineio/opentimelineio/console/otiocat.py | desruie/OpenTimelineIO | 1,021 | 11152353 | #!/usr/bin/env python
#
# Copyright Contributors to the OpenTimelineIO project
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademar... |
mac/pyobjc-framework-Quartz/PyObjCTest/test_cifiltergenerator.py | albertz/music-player | 132 | 11152389 |
from PyObjCTools.TestSupport import *
from Quartz.QuartzCore import *
try:
unicode
except NameError:
unicode = str
class TestCIFilterGenerator (TestCase):
def testConstants(self):
self.assertIsInstance(kCIFilterGeneratorExportedKey, unicode)
self.assertIsInstance(kCIFilterGeneratorExporte... |
accounting/libs/templatetags/url_tags.py | Abdur-rahmaanJ/django-accounting | 127 | 11152411 | <filename>accounting/libs/templatetags/url_tags.py
# encoding: utf-8
from django import template
from django.http import QueryDict
from classytags.core import Tag, Options
from classytags.arguments import MultiKeywordArgument, MultiValueArgument
register = template.Library()
class QueryParameters(Tag):
name = ... |
helper/linear_regression.py | dahjeong/gittest_ssh | 639 | 11152457 | <filename>helper/linear_regression.py
import tensorflow as tf
import numpy as np
import scipy.io as sio
import scipy.optimize as opt
import pandas as pd
import matplotlib.pyplot as plt
from helper import general as general
# support functions ------------------------------------------------------------
def load_data(... |
release/stubs.min/Autodesk/Revit/DB/Lighting.py | htlcnn/ironpython-stubs | 182 | 11152463 | # encoding: utf-8
# module Autodesk.Revit.DB.Lighting calls itself Lighting
# from RevitAPI,Version=17.0.0.0,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class LossFactor(object,IDisposable):
""" This class is the base class for calculating lighti... |
tests/test_helm.py | onecommons/giterop | 109 | 11152467 | <gh_stars>100-1000
import os
import os.path
import sys
import threading
import unittest
from functools import partial
import shutil
import urllib.request
from click.testing import CliRunner
from unfurl.job import JobOptions, Runner
from unfurl.yamlmanifest import YamlManifest
from unfurl.localenv import LocalEnv
from ... |
HLTrigger/special/test/test_AsymFilters_cfg.py | ckamtsikis/cmssw | 852 | 11152495 | <filename>HLTrigger/special/test/test_AsymFilters_cfg.py
#
# This python script is the basis for MIB HLT path testing
#
# Only the developed path are runned on the RAW data sample
#
# We are using GRun_data version of the HLT menu
#
# SV (<EMAIL>): 18/01/2011
#
import FWCore.ParameterSet.Config as cms
process = cms.... |
tests/signal_handler.py | riddopic/opta | 595 | 11152525 | # type: ignore
import os
import signal
import sys
import time
def signal_handler(sig, frame):
print("You pressed Ctrl+C!")
time.sleep(1)
with open(
os.path.join(
os.path.dirname(os.path.dirname(__file__)),
"tests",
"signal_gracefully_terminated",
),
... |
ipytest/_impl.py | chmp/ipytest | 218 | 11152530 | <gh_stars>100-1000
from __future__ import print_function, division, absolute_import
import ast
import contextlib
import fnmatch
import importlib
import os
import pathlib
import shlex
import sys
import tempfile
import threading
import packaging.version
import pytest
from IPython import get_ipython
from ._config impo... |
armi/materials/b4c.py | keckler/armi | 162 | 11152564 | <reponame>keckler/armi<filename>armi/materials/b4c.py
# Copyright 2019 TerraPower, 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
#
# U... |
setup.py | wyddmw/ViT-pytorch-1 | 311 | 11152567 | <gh_stars>100-1000
# Copyright 2021 The ML Collections 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 appli... |
tests/test_parse.py | tgragnato/geneva | 1,182 | 11152603 | <reponame>tgragnato/geneva
import pytest
import sys
# Include the root of the project
sys.path.append("..")
import actions.strategy
import actions.utils
import library
EDGE_CASES = [
"[TCP:flags:A]-| \/",
"\/ [TCP:flags:A]-|",
"[TCP:flags:A]-duplicate(duplicate(duplicate(dup... |
python/lambda-triggered-by-existing-kinesis-stream/lambda-handler.py | marclyo/aws-cdk-examples | 2,941 | 11152615 | <reponame>marclyo/aws-cdk-examples
def main(event, context):
print("I'm running!")
|
examples/webapps/_local_path.py | timgates42/txmongo | 122 | 11152663 | # coding: utf-8
# Copyright 2009-2014 The txmongo authors. All rights reserved.
# Use of this source code is governed by the Apache License that can be
# found in the LICENSE file.
'''
Adds the local txmongo path to PYTHON_PATH
'''
import os.path
import sys
root = os.path.dirname(
os.path.dirname(
os.pat... |
rootpy/extern/byteplay3/wbyteplay.py | masonproffitt/rootpy | 146 | 11152672 | # byteplay: CPython assembler/disassembler
# Copyright (C) 2006 <NAME> | Version: http://code.google.com/p/byteplay
# Rewritten 2009 <NAME> | Version: http://github.com/serprex/byteplay
# Screwed the style over, modified stack logic to be more flexible, updated to Python 3
#
# This library is... |
test/shared/test_utils.py | roock/cloudsplaining | 1,411 | 11152673 | <reponame>roock/cloudsplaining
import unittest
from cloudsplaining.shared.utils import remove_wildcard_only_actions, remove_read_level_actions
class TestUtils(unittest.TestCase):
def test_remove_wildcard_only_actions(self):
actions = [
# 3 wildcard only actions
"secretsmanager:getr... |
electrumsv/gui/qt/table_widgets.py | electrumsv/electrumsv | 136 | 11152674 | from typing import Callable, Optional
from PyQt5.QtCore import pyqtSignal, Qt
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QHBoxLayout, QToolButton, QWidget
from electrumsv.i18n import _
from .util import KeyEventLineEdit, read_QIcon
class ButtonLayout(QHBoxLayout):
def __init__(self, parent: Op... |
exampleapp/dinosaurs/views.py | jupiterFierce31/A-simple-example-of-a-Django-REST-app-Angular2 | 163 | 11152677 | from rest_framework import viewsets
from dinosaurs.serializers import DinosaurSerializer
from dinosaurs.models import Dinosaur
class DinosaurViewSet(viewsets.ModelViewSet):
"""
API endpoint that allows users to be viewed or edited.
"""
queryset = Dinosaur.objects.all()
serializer_class = DinosaurS... |
tests/test_prefix.py | cclauss/personfinder | 561 | 11152698 | # Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
setup.py | amcgavin/react-render | 138 | 11152706 | from setuptools import setup, find_packages
VERSION = '1.3.2'
setup(
name='react-render-client',
version=VERSION,
packages=find_packages(exclude=['example', 'tests']),
install_requires=[
'django>=1.6',
'requests>=2,<3',
],
description='Render and bundle React components from a ... |
pvlib/spa_c_files/setup.py | sjanzou/pvlib-python | 695 | 11152713 | # setup.py
import os
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
DIRNAME = os.path.dirname(__file__)
# patch spa.c
with open(os.path.join(DIRNAME, 'spa.c'), 'rb') as f:
SPA_C = f.read()
# replace timezone with time_zone to avoid nameclash with the... |
pandas_ta/trend/decay.py | ryanrussell/pandas-ta | 2,298 | 11152726 | <gh_stars>1000+
# -*- coding: utf-8 -*-
from numpy import exp as npExp
from pandas import DataFrame
from pandas_ta.utils import get_offset, verify_series
def decay(close, kind=None, length=None, mode=None, offset=None, **kwargs):
"""Indicator: Decay"""
# Validate Arguments
length = int(length) if length a... |
test/test_orm_ext/apps/Test/models.py | timgates42/uliweb | 202 | 11152731 | from uliweb.orm import *
class User(Model):
username = Field(str)
def print_name(self):
return 'print_name' |
test/programytest/dialog/test_conversation.py | cdoebler1/AIML2 | 345 | 11152785 | <reponame>cdoebler1/AIML2
import unittest
from programy.bot import Bot
from programy.config.bot.bot import BotConfiguration
from programy.context import ClientContext
from programy.dialog.conversation import Conversation
from programy.dialog.question import Question
from programy.dialog.sentence import Sentence
from p... |
tests/st/func/datavisual/constants.py | fapbatista/mindinsight | 216 | 11152803 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
mul_034/script_util.py | cibu/language-resources | 177 | 11152804 | <gh_stars>100-1000
# Copyright 2017 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 ... |
tests/conftest.py | ivoupton/sheet2dict | 208 | 11152806 | import pytest
import sys
from pathlib import Path
sys.path.append(str(Path(".").absolute().parent))
from sheet2dict import Worksheet
@pytest.fixture(scope="module")
def worksheet():
return Worksheet()
|
trakt/objects/person.py | ruinernin/trakt.py | 147 | 11152821 | <gh_stars>100-1000
from __future__ import absolute_import, division, print_function
from trakt.core.helpers import from_iso8601_datetime
from trakt.objects.core.helpers import update_attributes
class Person(object):
def __init__(self, client, keys=None, index=None):
self._client = client
self.ke... |
tests/test_password_change.py | meals-app/django-graphql-auth | 290 | 11152822 | from django.contrib.auth import get_user_model
from graphql_jwt.refresh_token.models import RefreshToken
from .testCases import RelayTestCase, DefaultTestCase
from graphql_auth.utils import revoke_user_refresh_token
from graphql_auth.constants import Messages
from graphql_auth.utils import get_token, get_token_paylo... |
tests/test_nse_option_chain.py | sentashani/stolgo | 125 | 11152832 | <reponame>sentashani/stolgo
from stolgo.nse_data import NseData
def main():
nse_data = NseData()
nse_data.get_option_chain_excel('BANKNIFTY','30APR2020')
if __name__ == "__main__":
main()
|
tests/cmdline/repl_inspect.py | sebastien-riou/micropython | 4,538 | 11152862 | # cmdline: -c print("test") -i
# -c option combined with -i option results in REPL
|
utils/__init__.py | aditiapratama/blender-tools | 311 | 11152872 | <gh_stars>100-1000
"""Useful utilities and constants for the addon."""
from importlib import reload
from inspect import isclass
from os.path import basename, dirname, normpath
import sys
import bpy
# This is the addon's directory name, by default "embark_blender_tools", but anyone can change the folder name...
# We... |
docs_src/options/name/tutorial003.py | madkinsz/typer | 7,615 | 11152873 | import typer
def main(user_name: str = typer.Option(..., "-n")):
typer.echo(f"Hello {user_name}")
if __name__ == "__main__":
typer.run(main)
|
migrations/versions/2dfac13a4c78_add_logsource_unique.py | vault-the/changes | 443 | 11152886 | <gh_stars>100-1000
"""Add LogSource unique constraint on name
Revision ID: 2dfac13a4c78
Revises: <PASSWORD>
Create Date: 2013-12-06 10:56:15.727933
"""
from __future__ import absolute_import, print_function
# revision identifiers, used by Alembic.
revision = '2dfac13a4c78'
down_revision = '5896e31725d'
from alembi... |
qdtrack/models/roi_heads/track_heads/__init__.py | mageofboy/qdtrack | 271 | 11152902 | <filename>qdtrack/models/roi_heads/track_heads/__init__.py
from .quasi_dense_embed_head import QuasiDenseEmbedHead
__all__ = ['QuasiDenseEmbedHead'] |
wooey/migrations/0011_script_versioning_cleanup.py | fridmundklaus/wooey | 1,572 | 11152908 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('wooey', '0010_script_versioning_data_migration'),
]
operations = [
migrations.RemoveField(
model_name='scriptpar... |
utils/adamw.py | dingmyu/HR-NAS | 122 | 11152912 | import math
import torch
import logging
from torch.optim.optimizer import Optimizer
from utils.common import index_tensor_in
from utils.common import check_tensor_in
class AdamW(Optimizer):
r"""Implements AdamW algorithm.
The original Adam algorithm was proposed in `Adam: A Method for Stochastic Optimization... |
etl/parsers/etw/Microsoft_Windows_WMI.py | IMULMUL/etl-parser | 104 | 11152915 | # -*- coding: utf-8 -*-
"""
Microsoft-Windows-WMI
GUID : 1edeee53-0afe-4609-b846-d8c0b2075b1f
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.dtyp import Sid
from etl.parsers... |
basisnet/personalization/centralized_emnist/trainer.py | xxdreck/google-research | 23,901 | 11152932 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... |
ecosystem_tools/mindconverter/mindconverter/graph_based_converter/mapper/onnx/nn/lstm_mapper.py | mindspore-ai/mindinsight | 216 | 11152935 | <reponame>mindspore-ai/mindinsight
# Copyright 2021 Huawei Technologies Co., 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/LI... |
circuit_training/environment/coordinate_descent_placer_main.py | taylormcnally/circuit_training | 280 | 11152941 | <reponame>taylormcnally/circuit_training
# coding=utf-8
# Copyright 2021 The Circuit Training 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/licen... |
tests/cli/test_command_copy.py | EasyPost/biggraphite | 125 | 11152944 | <filename>tests/cli/test_command_copy.py<gh_stars>100-1000
#!/usr/bin/env python
# Copyright 2018 Criteo
#
# 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... |
sklearn/preprocessing/_function_transformer.py | matiasrvazquez/scikit-learn | 50,961 | 11152984 | <reponame>matiasrvazquez/scikit-learn
import warnings
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..utils.metaestimators import available_if
from ..utils.validation import (
_allclose_dense_sparse,
_check_feature_names_in,
check_array,
)
def _identity(X):
"""The identi... |
FireModules/Shenanigans/osx_chicken_loop_youtube_video.py | FullMidnight/ThirdDumpsterFire | 862 | 11152994 | <reponame>FullMidnight/ThirdDumpsterFire
#!/usr/bin/python
#
# Filename: osx_chicken_loop_youtube_video.py
#
# Version: 1.0.0
#
# Author: <NAME> (TryCatchHCF)
#
# Summary:
#
# Part of the DumpsterFire Toolset. See documentation at https://github.com/TryCatchHCF/DumpsterFire
#
#
# Description:
#
# Opens a 10-hour chic... |
pycoin/block.py | gruve-p/pycoin | 1,210 | 11153033 | <reponame>gruve-p/pycoin
import io
from .encoding.hash import double_sha256
from .encoding.hexbytes import b2h, b2h_rev
from .merkle import merkle
from .satoshi.satoshi_struct import parse_struct, stream_struct
class BadMerkleRootError(Exception):
pass
def difficulty_max_mask_for_bits(bits):
prefix = bits... |
recipes/Python/502289_Persistent_Dictionary_Text/recipe-502289.py | tdiprima/code | 2,023 | 11153035 | <filename>recipes/Python/502289_Persistent_Dictionary_Text/recipe-502289.py
"""
A persistent dict object that uses a text file for storage.
Saved values will update arguments passed to constructor with:
PersistentTextDict(<path>, dict={'a':10}, foo='baz', bla=10)
This behavior allows setting defaults that can be overr... |
2019/07/25/Deploy a Flask App to Heroku With a Postgres Database [2019]/flask_qa/wsgi.py | kenjitagawa/youtube_video_code | 492 | 11153039 | from flask_qa import create_app
app = create_app() |
src/variables.py | parthbhope/NC_Concolic_Testing | 102 | 11153105 | <reponame>parthbhope/NC_Concolic_Testing
SIG_NORMAL = 0 # normal exit signal
SIG_COV = 2 # coverage guided exit signal
SIG_ADV = 3 # adversarial exit signal
|
jupyterlab_code_formatter/tests/test_handlers.py | suevii/jupyterlab_code_formatter | 528 | 11153112 | import json
import typing as t
import pkg_resources
import pytest
import requests
from jsonschema import validate
from jupyterlab_code_formatter.formatters import SERVER_FORMATTERS
from jupyterlab_code_formatter.handlers import setup_handlers
from notebook.tests.launchnotebook import NotebookTestBase
def _generate_l... |
fiducial_slam/scripts/move_origin.py | teosnare/fiducials | 232 | 11153119 | <reponame>teosnare/fiducials
#!/usr/bin/python
"""
Move origin of fiducial co-ordinate system
"""
import numpy, sys, os
from fiducial_slam.map import Map
if __name__ == "__main__":
argc = len(sys.argv)
if argc != 4 and argc != 5:
print "Usage: %s x y z [file]" % sys.argv[0]
sys.exit(1)
of... |
jarviscli/plugins/upside-down.py | snehkhajanchi/Jarvis | 2,605 | 11153122 | <filename>jarviscli/plugins/upside-down.py<gh_stars>1000+
from plugin import plugin
from colorama import Fore
@plugin('upside down')
def generate_random_list(jarvis, str):
user_input = jarvis.input("Enter string to be converted to upside-down (only english letters will be converted): ")
result = convert_input... |
RL-Quadcopter/quad_controller_rl/src/quad_controller_rl/util.py | edwardpan/cn-deep-learning | 474 | 11153125 | <filename>RL-Quadcopter/quad_controller_rl/src/quad_controller_rl/util.py
"""Utility functions."""
import pandas as pd
import rospy
from datetime import datetime
def get_param(name):
"""Return parameter value specified in ROS launch file or via command line, e.g. agent:=DDPG."""
return rospy.get_param(name)
... |
EventFilter/SiStripRawToDigi/python/test/SiStripDigiValidator_cfi.py | ckamtsikis/cmssw | 852 | 11153154 | import FWCore.ParameterSet.Config as cms
DigiValidator = cms.EDAnalyzer(
"SiStripDigiValidator",
TagCollection1 = cms.untracked.InputTag("DigiSource"),
TagCollection2 = cms.untracked.InputTag("siStripDigis","ZeroSuppressed"),
RawCollection1 = cms.untracked.bool(False),
RawCollection2 = cms.untracke... |
graphgym/models/layer_pyg.py | SCAuFish/GraphGym | 940 | 11153160 | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch_geometric as pyg
from graphgym.config import cfg
from graphgym.models.act import act_dict
from graphgym.contrib.layer.generalconv import (GeneralConvLayer,
GeneralEdgeConvLayer)
from graphgy... |
nova/tests/functional/regressions/test_bug_1938326.py | zjzh/nova | 1,874 | 11153167 | # Copyright 2021, Red Hat, 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
#
# Unless required by applicable law ... |
Devices/GatewayConnectedDevices/BtUSB_2_BtUART_Example/TestServer.py | HydAu/AzureConnectTheDots | 235 | 11153200 | '''
Copyright (c) Microsoft Open Technologies, Inc. All rights reserved.
The MIT License (MIT)
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 limitati... |
backpack/extensions/secondorder/diag_hessian/conv3d.py | jabader97/backpack | 395 | 11153216 | <reponame>jabader97/backpack<filename>backpack/extensions/secondorder/diag_hessian/conv3d.py
"""Module extensions for diagonal Hessian properties of ``torch.nn.Conv3d``."""
from backpack.core.derivatives.conv3d import Conv3DDerivatives
from backpack.extensions.secondorder.diag_hessian.convnd import (
BatchDiagHConv... |
tests/__init__.py | adamserafini/pyxl4 | 366 | 11153230 | import pyxl.codec.register
|
third_party/chromite/cli/cros/cros_buildresult_unittest.py | zipated/src | 2,151 | 11153248 | # -*- coding: utf-8 -*-
# Copyright 2018 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Tests the `cros buildresult` command."""
from __future__ import print_function
import json
from chromite.cli import command_... |
torch_backend.py | lengstrom/cifar10-fast | 493 | 11153269 | import numpy as np
import torch
from torch import nn
from core import *
from collections import namedtuple
from itertools import count
torch.backends.cudnn.benchmark = True
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
cpu = torch.device("cpu")
@cat.register(torch.Tensor)
def _(*xs):
re... |
plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/callback/concord_out_vars.py | 700software/concord | 158 | 11153289 | <filename>plugins/tasks/ansible/src/main/resources/com/walmartlabs/concord/plugins/ansible/callback/concord_out_vars.py<gh_stars>100-1000
import os
import json
from ansible.plugins.callback import CallbackBase
from concord_ansible_stats import ConcordAnsibleStats
try:
from __main__ import cli
except ImportError:
... |
glslc/test/working_directory.py | hbirchtree/shaderc | 2,151 | 11153305 | # Copyright 2015 The Shaderc 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... |
utime/callbacks/__init__.py | learning310/U-Time | 138 | 11153318 | from .callbacks import Validation, MaxTrainingTime, MemoryConsumption, CarbonUsageTracking
|
examples/basic/lights.py | hadivafaii/vedo | 836 | 11153345 | """Set custom lights to a 3D scene"""
from vedo import *
man = Mesh(dataurl+'man.vtk').c('white').lighting('glossy')
p1 = Point([1,0,1], c='y')
p2 = Point([0,0,2], c='r')
p3 = Point([-1,-0.5,-1], c='b')
p4 = Point([0,1,0], c='k')
# Add light sources at the given positions
l1 = Light(p1, c='y') # p1 can simply be [1,... |
config/scripts/topprocess/top.py | hardyoyo/Mutate | 1,488 | 11153346 | <reponame>hardyoyo/Mutate
#!/usr/bin/python2
#!encoding = utf-8
import json
from pprint import pprint
import sys
import os
import time
def printcmd(c):
output({
'name': c[0],
'command':'kill -9 '+c[1],
'subtext':'PID: '+c[1]+', CPU: '+c[2]+'%, RAM: '+c[3]+'%, USER:'+c[4]
})
def no... |
pinax_theme_bootstrap/models.py | Harshalszz/pinax-theme-bootstrap | 113 | 11153355 | <filename>pinax_theme_bootstrap/models.py<gh_stars>100-1000
# This file is intentionally left blank to allow Django to load the app.
|
security/resteasy-crypto/src/test/resources/smime_encrypted_signed.py | gytis/Resteasy | 841 | 11153372 | from M2Crypto import BIO, SMIME, X509
s = SMIME.SMIME()
# Load private key and cert.
s.load_key('mycert-private.pem', 'mycert.pem')
# Load the signed/encrypted data.
p7, data = SMIME.smime_load_pkcs7('target/python_encrypted_signed.txt')
# After the above step, 'data' == None.
# Decrypt p7. 'out' now contains a PKC... |
backbone/activation.py | PINTO0309/micronet | 221 | 11153380 | import torch
import torch.nn as nn
import torch.nn.functional as F
def _make_divisible(v, divisor, min_value=None):
"""
This function is taken from the original tf repo.
It ensures that all layers have a channel number that is divisible by 8
It can be seen here:
https://github.com/tensorfl... |
python/clx/tests/test_asset_classification.py | shaneding/clx | 143 | 11153394 | <reponame>shaneding/clx<gh_stars>100-1000
# Copyright (c) 2020, NVIDIA 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
#
# Unle... |
test/specs/openapi/test_negative.py | vyachin/schemathesis | 659 | 11153399 | from copy import deepcopy
from test.utils import assert_requests_call
import pytest
from hypothesis import HealthCheck, given, settings
from hypothesis import strategies as st
from hypothesis_jsonschema import from_schema
from hypothesis_jsonschema._canonicalise import FALSEY, canonicalish
from jsonschema import Draft... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.