code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
#!/usr/bin/env python
"""
pymonitoringapi example script to find the server type
and version of our monitoring server.
"""
import optparse
import sys
import os
import pprint
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../")))
from pymonitoringapi import MonitoringAPI
V... | jantman/pymonitoringapi | examples/get_service_status.py | Python | lgpl-3.0 | 2,213 |
"""
Please forgive any typos or errors in the comments, I'll be cleaning them up as frequently as I can.
Pygcurse v0.1 alpha
Pygcurse (pronounced "pig curse") is a curses library emulator that runs on top of the Pygame framework. It provides an easy way to create text adventures, roguelikes, and console-style applic... | drestuart/delvelib | lib/pygcurse/pygcurse_old.py | Python | lgpl-3.0 | 110,209 |
#!/usr/bin/python
import gtk
import gtk.glade
import os
import glob
import os.path
import re
# not needed if you have codebuffer installed:
import sys
sys.path.insert(0, "..")
from gtkcodebuffer import CodeBuffer, SyntaxLoader, add_syntax_path
# also not needed if installed:
add_syntax_path("../syntax/")
class ... | Quantika14/pygtkcodebuffer | examples/simple-edit.py | Python | lgpl-3.0 | 2,136 |
#
# Copyright (c) 2015 Will Bond, Mjumbe Wawatu Ukweli, 2012 Canonical Ltd
#
# 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, version 3 only.
#
# This program is distributed in the hope th... | ticklemepierce/ghostpy | ghostpy/_compiler.py | Python | lgpl-3.0 | 45,996 |
from distutils.core import setup
setup(
name='browser-cookie3',
version='0.13.0',
packages=['browser_cookie3'],
# look for package contents in current directory
package_dir={'browser_cookie3': '.'},
author='Boris Babic',
author_email='boris.ivan.babic@gmail.com',
description='Loads cook... | borisbabic/browser_cookie3 | setup.py | Python | lgpl-3.0 | 632 |
# Copyright (C) 2015-2022 by the RBniCS authors
#
# This file is part of RBniCS.
#
# SPDX-License-Identifier: LGPL-3.0-or-later
from rbnics.reduction_methods.base.nonlinear_rb_reduction import NonlinearRBReduction
from rbnics.reduction_methods.base.time_dependent_rb_reduction import TimeDependentRBReduction
from rbnic... | mathLab/RBniCS | rbnics/reduction_methods/base/nonlinear_time_dependent_rb_reduction.py | Python | lgpl-3.0 | 786 |
# Copyright (C) 2017 chainside srl
#
# This file is part of the btcpy package.
#
# It is subject to the license terms in the LICENSE.md file found in the top-level
# directory of this distribution.
#
# No part of btcpy, including this file, may be copied, modified,
# propagated, or distributed except according to the t... | chainside/btcpy | btcpy/structs/hd.py | Python | lgpl-3.0 | 10,848 |
from setuptools import setup
from setuptools import find_packages
setup(name='boobank_indicator',
version='2.1',
description='show your bank accounts in your System Tray',
long_description='boobank_indicator will show you bank accounts and associated transactions in your system tray. Your bank accoun... | laurentb/weboob | contrib/boobank_indicator/setup.py | Python | lgpl-3.0 | 856 |
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
#
# Glances 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 Lic... | subodhchhabra/glances | glances/plugins/glances_fs.py | Python | lgpl-3.0 | 10,262 |
###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Backend Theme Mail
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | muk-it/muk_web | muk_web_theme_mail/__manifest__.py | Python | lgpl-3.0 | 1,774 |
from itertools import count
from .utils.decorators import gitlog
from scipy.misc import imresize
import datajoint as dj
from datajoint.jobs import key_hash
from tqdm import tqdm
import cv2
import numpy as np
import json
import os
from commons import lab
from datajoint.autopopulate import AutoPopulate
from .utils.eye_... | fabiansinz/pipeline | python/pipeline/pupil.py | Python | lgpl-3.0 | 21,850 |
import os
import re
from signal import *
from _ptrace import *
__all__ = ['ProcessDebugger', 'syscall', 'unsafe_syscall']
class ProcessDebugger(object):
def __init__(self):
def undefined_method():
raise NotImplementedError("you can only access arguments once a process has been attached")
... | IvyBits/ptbox | ptbox/__init__.py | Python | lgpl-3.0 | 1,992 |
# coding: utf-8
from ckeditor_uploader.fields import RichTextUploadingField
from django.contrib.auth.models import User
from django.db import models
class Column(models.Model):
name = models.CharField(max_length=64, unique=True, verbose_name=u'栏目名称')
ename = models.CharField(max_length=64, unique=True, verbo... | chiaki-yu/PyYu | videos/models.py | Python | lgpl-3.0 | 3,730 |
# Generated by Django 2.0 on 2018-03-23 11:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('backend', '0054_auto_20180322_1027'),
]
operations = [
migrations.CreateModel(
name='WeizhanItemV... | ourbest/sns_app | backend/migrations/0055_articledailyinfo_runtimedata_weizhanitemview.py | Python | lgpl-3.0 | 2,389 |
# zetup.py
#
# Zimmermann's Python package setup.
#
# Copyright (C) 2014-2015 Stefan Zimmermann <zimmermann.code@gmail.com>
#
# zetup.py 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 ve... | userzimmermann/zetup.py | zetup/commands/test.py | Python | lgpl-3.0 | 1,403 |
#!/usr/bin/env python
#
# Python-bindings file type test script
#
# Copyright (C) 2009-2021, Joachim Metz <joachim.metz@gmail.com>
#
# Refer to AUTHORS for acknowledgements.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publishe... | libyal/libesedb | tests/pyesedb_test_file.py | Python | lgpl-3.0 | 5,223 |
# -*- coding: utf-8 -*-
# Copyright(C) 2012 Romain Bignon
#
# This file is part of a weboob module.
#
# This weboob module 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 Licens... | laurentb/weboob | modules/caissedepargne/cenet/browser.py | Python | lgpl-3.0 | 12,250 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
confstr = '''[DEFAULT]
nas_id=txovpn
nas_coa_port=3799
nas_addr=127.0.0.1
radius_addr=127.0.0.1
radius_auth_port=18121
radius_acct_port=18131
radius_secret=secret
radius_timeout=3
acct_interval=60
session_timeout=864000
logfile=/var/log/txovpn.log
statusfile=/etc/openvpn/o... | talkincode/txradius | txradius/openvpn/setup_config.py | Python | lgpl-3.0 | 520 |
from bs4 import BeautifulSoup
import requests as r
def run(projects, language):
base_url = "https://hosted.weblate.org/projects/{0}/{1}/#overview"
results = []
for project in projects:
url = base_url.format(project, language)
html_doc = r.get(url).text
soup = BeautifulSoup(html_do... | osm-pl/osm-translation-scrapper | sites/weblate.py | Python | unlicense | 648 |
#!/usr/bin/env python3
# bank_account.py
#
# Simple Bank Account class example.
#
# AMJ
# 2017-04-01
from random import randint
class BankAccount:
def __init__ (self, account_holder, has_overdraft):
self.account_number = self.generate_account_number ()
self.account_holder = account_holder
... | TonyJenkins/cfs2160-python | 04classes/Bank/bank_account.py | Python | unlicense | 1,282 |
# uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: errors.py
import mcl.status
ERR_SUCCESS = mcl.status.MCL_SUCCESS
ERR_INVALID_PARAM = mcl.status.framework.ERR_START
ERR_INVALID_HIVE = mcl.status.fra... | DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Dsz/PyScripts/Lib/dsz/mca/survey/cmd/registryhive/errors.py | Python | unlicense | 1,689 |
import tensorflow as tf
from . import test
from . import config
def test_def_config():
test.append_argv()
assert isinstance(config.def_config()(), tf.contrib.learn.RunConfig)
| raviqqe/tensorflow-qnd | qnd/config_test.py | Python | unlicense | 186 |
import os
from itertools import imap
from multiprocessing import Pool
from config import config
from document_topic import Document, Topic
class Collection(object):
def __init__(self, list_file, prefix=''):
self.names_list = [os.path.join(prefix, file_name.strip()) for file_name in list_file]
def __i... | machacek/information-retrieval-project | lucene-experiment/collection.py | Python | unlicense | 618 |
from .ingest_input_stream import IngestInputStream
from .concatenation_input_stream_configuration import ConcatenationInputStreamConfiguration
from .concatenation_input_stream import ConcatenationInputStream
from .time_based_trimming_input_stream import TimeBasedTrimmingInputStream
from .time_code_track_trimming_input_... | bitmovin/bitmovin-python | bitmovin/resources/models/encodings/inputstreams/__init__.py | Python | unlicense | 459 |
# coding=utf-8
# Copyright 2022 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... | google-research/google-research | mico/dm_control/metric_sac_agent.py | Python | apache-2.0 | 11,284 |
import django_filters
from django.contrib.auth import get_user_model
from .models import Sprint, Task
User = get_user_model()
class NullFilter(django_filters.BooleanFilter):
"""Filter on a field set as null or not."""
def filter(self, qs, value):
if value is not None:
return qs.filte... | guiandmag/scrum-django | board/forms.py | Python | apache-2.0 | 1,021 |
# Copyright 2013 Cloudbase Solutions Srl
# 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 r... | openstack/compute-hyperv | compute_hyperv/nova/imagecache.py | Python | apache-2.0 | 11,925 |
# Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | synsun/robotframework | src/robot/utils/normalizing.py | Python | apache-2.0 | 3,790 |
from invoke import task
@task
def runserver(c):
c.run("PYTHONHTTPSVERIFY=0; ./manage.py runserver --settings=mykonosbiennale.offline_settings")
def export_artists(c):
c.run("PYTHONHTTPSVERIFY=0; ./manage.py export_artists - -settings = mykonosbiennale.offline_settings")
def export_filmfestival(c):
c.run... | mykonosbiennale/mykonosbiennale.github.io | tasks.py | Python | apache-2.0 | 552 |
#!/usr/bin/env python
#
# Appcelerator Titanium Plugin Packager
#
#
import os, sys, glob, string
import zipfile
cwd = os.path.dirname(__file__)
required_plugin_keys = ['version','pluginid','description','copyright','license','minsdk']
plugin_defaults = {
'description':'My plugin',
'author': 'Your Name',
'license' :... | appcelerator/titanium_mobile_tooling | templates/plugin/build.py | Python | apache-2.0 | 2,990 |
# Copyright 2014-2016 OpenMarket 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 in w... | matrix-org/synapse | contrib/experiments/cursesio.py | Python | apache-2.0 | 4,229 |
# Copyright 2016 Massachusetts Open Cloud
#
# 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... | CCI-MOC/moc-openstack-tools | setpass.py | Python | apache-2.0 | 1,945 |
# -*- coding: utf-8 -*-
# Copyright 2020 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... | googleads/google-ads-python | google/ads/googleads/v10/errors/types/time_zone_error.py | Python | apache-2.0 | 1,124 |
# -*- coding: utf-8 -*-
"""
Runs functions in pipeline to get query reuslts and does some caching.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import utool as ut
import six # NOQA
from os.path import exists
#from ibeis.algo.hots import query_request
#from ibeis.algo.hots impo... | SU-ECE-17-7/ibeis | ibeis/algo/hots/match_chips4.py | Python | apache-2.0 | 15,985 |
import os
import sys
from console_basic.server import run
# If ../../wsgi-basic/__init__.py exists, add ../../ to Python search path, so
# that it will override what happens to be installed in
# /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__),
... | QthCN/console-basic | console_basic/cmd/all.py | Python | apache-2.0 | 663 |
#-*-coding:utf-8-*-
from flask_bcrypt import Bcrypt
bcrypt = Bcrypt()
from flask_bootstrap import Bootstrap
bootstrap = Bootstrap()
from flask_mail import Mail
mail=Mail()
from flask_login import LoginManager
login_manager = LoginManager()
login_manager.login_view="auth.login_index"
login_manager.session_protection=... | PythonScientists/Shape | main/ext/__init__.py | Python | apache-2.0 | 431 |
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice... | AnshulYADAV007/Lean | Algorithm.Python/FractionalQuantityRegressionAlgorithm.py | Python | apache-2.0 | 3,139 |
"""Support to control ecoal/esterownik.pl coal/wood boiler controller."""
import logging
from ecoaliface.simple import ECoalController
import voluptuous as vol
from homeassistant.const import (
CONF_HOST,
CONF_MONITORED_CONDITIONS,
CONF_PASSWORD,
CONF_SENSORS,
CONF_SWITCHES,
CONF_USERNAME,
)
f... | mezz64/home-assistant | homeassistant/components/ecoal_boiler/__init__.py | Python | apache-2.0 | 3,573 |
# Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | HybridF5/jacket | jacket/tests/compute/functional/api_sample_tests/test_consoles.py | Python | apache-2.0 | 2,234 |
""" Run target checks using snactor """
from generic_runner import run, pprint, get_actor
def check_target():
""" Run multiple checks at target machine """
targetinfo = {}
get_actor('check_target_group').execute(targetinfo)
get_actor('check_target').execute(targetinfo)
pprint(targetinfo['targetin... | leapp-to/snactor | examples/scripts/checktarget.py | Python | apache-2.0 | 400 |
# ----------------------------------------------------------------------------------------------------------------------
# Introdução a Programação de Computadores - IPC
# Universidade do Estado do Amazonas - UEA
# Prof. Jucimar Jr
# Edson de Lima Barros 1715310043
# Tiago Ferreira Aranha 1715310047
# Vitor Simôes A... | jucimarjr/IPC_2017-1 | lista08/lista08_lista02_questao16.py | Python | apache-2.0 | 799 |
#"10 Minutes to pandas" tutorial
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
class ObjectCreator:
"""Object creation demo"""
def __init__(self):
self.data = []
def createSeries(self):
s = pd.Series( [1,3,5,np.nan,6,8] );
return s
def createDataFram... | mattmcd/PyAnalysis | mda/tutorial/pandastut.py | Python | apache-2.0 | 1,920 |
"""
A collection of log handlers that allow file permissions to be specified.
"""
import logging
import logging.handlers as handlers
import os
import datetime
class FileHandler(logging.FileHandler):
"""
A subclass of logging.FileHandler that accepts a permissions argument.
The file used for logging will h... | vegitron/permissions_logging | permissions_logging/__init__.py | Python | apache-2.0 | 3,690 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from PyQt4 import QtGui
# from pyduel_engine.content.engine_states import BoardType
class BoardSelectWidget(QtGui.QComboBox):
def __init__(self, board_types, parent=None):
super(BoardSelectWidget, self).__init__(parent)
self.board_types = board_types
... | aelkikhia/pyduel_engine | pyduel_gui/widgets/board_select_widget.py | Python | apache-2.0 | 957 |
#!/usr/bin/env python
__author__ = 'Tomasz Turowski'
## script uses pyCRAC GTF Parser to get from GTF file gene name
from pyCRAC.Parsers import GTF2
import sys, os, yaml
from signal import signal, SIGPIPE, SIG_DFL
from optparse import OptionParser
def get_file(path_from_options, type='gtf'):
types = {'gtf' : 'GTF_... | tturowski/parserTools | getNameFromId.py | Python | apache-2.0 | 1,580 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Big Switch Networks, 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... | kaiweifan/horizon | openstack_dashboard/dashboards/project/loadbalancers/workflows.py | Python | apache-2.0 | 29,119 |
# Snafu: Snake Functions - OpenShift Executor
import requests
import os
import configparser
import subprocess
container = "jszhaw/snafu"
endpoints = {}
def executecontrol(flaskrequest, tenant):
if not tenant in endpoints:
username = os.getenv("OPENSHIFT_USERNAME")
password = os.getenv("OPENSHIFT_PASSWORD")
p... | serviceprototypinglab/snafu | snafulib/executors/openshift.py | Python | apache-2.0 | 1,255 |
#!/usr/bin/env python
# Blink the LED on and off every second.
# Based on GrovePi LED blink Example for the Grove LED Socket (http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit)
import time
import RPi.GPIO as GPIO
# Set the pin numbering to the BCM (same as GPIO) numbering format.
GPIO.setmode(GPIO.BCM)
# Assum... | lupyuen/RaspberryPiImage | home/pi/Simple/simple_led_blink.py | Python | apache-2.0 | 1,012 |
import tensorflow as tf
from tensorflow.python.ops.rnn_cell import DropoutWrapper, RNNCell, LSTMStateTuple
from my.tensorflow import exp_mask, flatten
from my.tensorflow.nn import linear, softsel, double_linear_logits
class SwitchableDropoutWrapper(DropoutWrapper):
def __init__(self, cell, is_train, inpu... | Incogniiito/Chrononaut | my/tensorflow/rnn_cell.py | Python | apache-2.0 | 9,075 |
# Copyright 2017 Capital One Services, 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... | jimmyraywv/cloud-custodian | tests/test_sqs.py | Python | apache-2.0 | 10,409 |
# Copyright 2015 Cisco Systems, 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 requi... | smartbgp/yarib | yarib/db/mongodb.py | Python | apache-2.0 | 4,903 |
import dask
import dask.dataframe as dd
import json
import pandas as pd
import numpy as np
import os.path
import csv
import boto3
from dask.distributed import Client
import time
def load_dataset(client, data_dir, s3_bucket, nbytes, npartitions):
num_bytes_per_partition = nbytes // npartitions
filenames = []... | ray-project/ray | release/nightly_tests/dask_on_ray/dask_on_ray_sort.py | Python | apache-2.0 | 8,363 |
# Copyright 2014 Copyright (c) 2013-2015, OneSource, Portugal.
# 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/license... | MobileCloudNetworking/epcaas | bundle/wsgi/DNSaaSClient.py | Python | apache-2.0 | 13,958 |
# Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | keras-team/keras | keras/integration_test/gradient_checkpoint_test.py | Python | apache-2.0 | 6,728 |
import numpy as np
class NeuralNet:
def __init__(self, layers, epsilon=0.154, learningRate = 0.1):
'''
Constructor
Arguments:
layers - a numpy array of L integers (L is # layers in the network)
epsilon - one half the interval around zero for setting the initial weights
... | dkotfis/NeuRL | src/nn.py | Python | apache-2.0 | 5,301 |
# Copyright (c) 2014 Dark Secret Software 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 agree... | openstack/stacktach-shoebox | shoebox/disk_storage.py | Python | apache-2.0 | 6,327 |
import asyncio
import uvloop
from aioactor.transports import NatsTransport
from aioactor.service import Service
from aioactor.broker import ServiceBroker
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
# TODO ADD possible actions list!
# TODO ADD abstractions to Message Handler!
# MessageHandler must be able t... | iZonex/aioactor | examples/accounts/app.py | Python | apache-2.0 | 1,531 |
"""
This module implements an inversion of control framework. It allows
dependencies among functions and classes to be declared with decorators and the
resulting dependency graphs to be executed.
A decorator used to declare dependencies is called a :class:`ComponentType`, a
decorated function or class is called a comp... | RedHatInsights/insights-core | insights/core/dr.py | Python | apache-2.0 | 32,029 |
# Copyright 2016 OpenMarket 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 in writin... | matrix-org/synapse | synapse/replication/slave/storage/_slaved_id_tracker.py | Python | apache-2.0 | 1,833 |
# Client view on data model
import urllib2
import json
import pprint
import re
import os
import sys
import xml.etree.ElementTree as ET
class Experiment() :
def __init__(self) :
self.name = None
self.version = None
self.codes = []
self.files = []
self.workflow = [] # list ... | MICCoM/CLI | lib/MICCOM/model.py | Python | apache-2.0 | 3,922 |
# Lint as: python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | google/tf-quant-finance | tf_quant_finance/experimental/instruments/__init__.py | Python | apache-2.0 | 3,206 |
def kab(n):
if n in (0, 1):
return [1]
for i in range(n):
b yield i * 2
| TakesxiSximada/TIL | python/python3.6/err2.py | Python | apache-2.0 | 95 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | gunan/tensorflow | tensorflow/python/keras/tests/integration_test.py | Python | apache-2.0 | 13,054 |
#!/usr/bin/python
from espeak import espeak
import MySQLdb
import serial
import time
import os.path
import math
from espeak import core as espeak_core
timerSeconds = 2 #Time between command repeats itself in seconds
timerProximity = 1
wallElapsed = 0 #starting value for elapsed
objectElapsed = 0
openingBothElapsed = ... | TheBatUNT/thebat | tts1.py | Python | apache-2.0 | 9,411 |
#
# Cython -- Things that don't belong
# anywhere else in particular
#
import os, sys, re, codecs
modification_time = os.path.getmtime
def replace_suffix(path, newsuf):
base, _ = os.path.splitext(path)
return base + newsuf
def open_new_file(path):
if os.path.exists(path):
# Make sur... | rguillebert/CythonCTypesBackend | Cython/Utils.py | Python | apache-2.0 | 7,177 |
# Copyright 2011 VMware, 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 ... | CingHu/neutron-ustack | neutron/common/config.py | Python | apache-2.0 | 8,651 |
# Copyright 2016-2017 Capital One Services, 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 ... | jdubs/cloud-custodian | tests/test_asg.py | Python | apache-2.0 | 14,780 |
from __future__ import absolute_import
from __future__ import print_function
import filecmp
import os
import ujson
from django.core import mail
from django.http import HttpResponse
from django.test import override_settings
from mock import patch
from typing import Any, Dict, List
from zerver.lib.actions import do_ch... | j831/zulip | zerver/tests/test_bots.py | Python | apache-2.0 | 34,708 |
#!/usr/bin/env python3
__author__ = 'DSOWASP'
import logging
"""
#logging 默认输出级别为WARNING,默认格式是日志级别:Logger名称:用户输出消息
logging.debug("debug message")
logging.info("info message")
logging.warning("warning message")
logging.error("error message")
logging.critical("critical message")
"""
"""
输出:
WARNING:root:warning message
... | dianshen/python_day | day5/Log.py | Python | apache-2.0 | 7,102 |
from MiniBotFramework.Actuation.Actuator import Actuator
class GpioMotor(Actuator):
PWM_FREQUENCY=100
def __init__(self, bot, name, pin_pwm, pin_hl, reversed, GPIO):
Actuator.__init__(self, bot, name)
self.reversed = reversed
self.pin_pwm = pin_pwm
self.pin_hl = pin_hl
... | cornell-cup/cs-minibot-platform | python-interface/src/MiniBotFramework/Actuation/GpioMotor.py | Python | apache-2.0 | 1,820 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from io import StringIO
from io import BytesIO
# 内存中读写字符
f = StringIO()
f.write('Hello')
f.write(' ')
f.write('World!')
print(f.getvalue())
f = StringIO('Hello!\nHi!\nGoodBye!')
while True:
s = f.readline()
if s == '':
break
print(s.strip())
# 内存中读写二进... | henryneu/Python | sample/string_io.py | Python | apache-2.0 | 480 |
#!/usr/bin/env python
"""
m2g.utils.qa_utils
~~~~~~~~~~~~~~~~~~~~
Contains small-scale qa utilities
"""
import numpy as np
def get_min_max(data, minthr=2, maxthr=95):
"""
A function to find min,max values at designated percentile thresholds
Parameters
-----------
data: np array
3-d regmri... | neurodata/ndmg | m2g/utils/qa_utils.py | Python | apache-2.0 | 2,414 |
# Copyright 2015-2016 OpenMarket Ltd
# Copyright 2017-2018 New Vector Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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.... | matrix-org/synapse | synapse/config/emailconfig.py | Python | apache-2.0 | 22,741 |
import SimpleHTTPServer
import sqlite3 as lite
import sys
import urlparse
import datetime
import json
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
class TrackListHandler(BaseHTTPRequestHandler):
def do_OPTIONS(self):
self.send_response(200)
self.send_header('application/json; charset=utf... | paulburkinshaw/mopidy-radio-pi | mopidy_radio_pi/static/MyHandler.py | Python | apache-2.0 | 11,919 |
from ConfigParser import SafeConfigParser, NoSectionError
import json
import logging
import os
import sys
import deimos.argv
import deimos.docker
from deimos.logger import log
import deimos.logger
from deimos._struct import _Struct
def load_configuration(f=None, interactive=sys.stdout.isatty()):
error = None
... | midonet/mcp | deimos/config.py | Python | apache-2.0 | 5,937 |
"""
URL patterns for Operational Intelligence related views
"""
from django.urls import re_path
from core.oi import jbviews
urlpatterns = [
re_path(r'^oi/jobsbuster/$', jbviews.jbhome, name='jobsBuster'),
]
| PanDAWMS/panda-bigmon-core | core/oi/urls.py | Python | apache-2.0 | 213 |
from unittest import TestCase
from cloudshell.cp.vcenter.network.vlan.factory import VlanSpecFactory
class TestVlanSpecFactory(TestCase):
def test_get_vlan_spec(self):
vlan_spec_factory = VlanSpecFactory()
vlan_spec = vlan_spec_factory.get_vlan_spec('Access')
self.assertIsNotNone(vlan_sp... | QualiSystems/vCenterShell | package/cloudshell/tests/test_network/vlan/test_factory.py | Python | apache-2.0 | 324 |
# -*- coding: utf-8 -*-
'''
Returners Directory
'''
| victorywang80/Maintenance | saltstack/src/salt/returners/__init__.py | Python | apache-2.0 | 52 |
# Generated by Django 1.11.11 on 2018-03-20 18:38
from django.db import migrations, models
import grandchallenge.jqfileupload.models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="StagedFile",
fields... | comic/comic-django | app/grandchallenge/jqfileupload/migrations/0001_initial.py | Python | apache-2.0 | 1,357 |
import olymap.skill
def test_learn_time():
tests = (
({}, None),
({'SK': {'tl': ['14']}}, '14'),
({'SK': {'an': ['0']}}, None),
({'IT': {'tl': ['1']}}, None),
({'SK': {'an': ['1']}}, None),
)
for box, answer in tests:
assert olymap.skill.get_learn_time(box) =... | olympiag3/olypy | tests/unit/test_olymap_skill.py | Python | apache-2.0 | 1,098 |
# Copyright 2017-2018 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import itertools
import jmespath
from c7n.exceptions import PolicyExecutionError, PolicyValidationError
from c7n import utils
from .core import Action
class ModifyVpcSecurityGroupsAction(Ac... | capitalone/cloud-custodian | c7n/actions/network.py | Python | apache-2.0 | 8,960 |
#!/usr/bin/python3
# Copyright 2020 Timothy Trippel
#
# 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 o... | googleinterns/hw-fuzzing | hw/other/lock/hdl_generator/generate_lock_tb.py | Python | apache-2.0 | 956 |
# -*- coding: UTF-8 -*-
# Created by mcxiaoke on 2015/7/6 22:20.
__author__ = 'mcxiaoke'
import sys, os
from os import path
from datetime import datetime
print 'curren dir is', os.getcwd()
print 'command line args is', sys.argv
if len(sys.argv) < 2:
sys.exit(1)
# 批量重命名照片文件
# 根据文件修改日期重命名文件,然后移动到目标文件夹
FILE_NAME_... | mcxiaoke/python-labs | labs/photos_walker_00.py | Python | apache-2.0 | 1,959 |
#Embedded file name: ACEStream\Core\Statistics\VideoPlaybackCrawler.pyo
from time import strftime
import cPickle
import sys
import threading
import zlib
from ACEStream.Core.BitTornado.BT1.MessageID import CRAWLER_VIDEOPLAYBACK_INFO_QUERY, CRAWLER_VIDEOPLAYBACK_EVENT_QUERY
from ACEStream.Core.CacheDB.SqliteVideoPlayback... | aplicatii-romanesti/allinclusive-kodi-pi | .kodi/userdata/addon_data/plugin.video.p2p-streams/acestream/ace/ACEStream/Core/Statistics/VideoPlaybackCrawler.py | Python | apache-2.0 | 7,854 |
"""
Cinder configuration - file ``/etc/cinder/cinder.conf``
=======================================================
The Cinder configuration file is a standard '.ini' file and this parser uses
the ``IniConfigFile`` class to read it.
Sample configuration::
[DEFAULT]
rpc_backend=cinder.openstack.common.rpc.imp... | PaulWay/insights-core | insights/parsers/cinder_conf.py | Python | apache-2.0 | 1,823 |
"""
Base class for all nodes created and used by the binary expression
BooleanExpressionTree defines an interface used for evaluating the tree.
"""
class Node(object):
def evaluate(self, evaluation_param):
raise NotImplementedError("evaluate not implemented")
def add_child(self, node):
raise ... | bheni/sql4json | sql4json/boolean_expressions/tree_nodes.py | Python | apache-2.0 | 3,354 |
import copy
import six
from eclcli.common import command
from eclcli.common import utils
class ListUsage(command.Lister):
def get_parser(self, prog_name):
parser = super(ListUsage, self).get_parser(prog_name)
parser.add_argument(
"--From",
help="Date to list usage fr... | anythingrandom/eclcli | eclcli/dh/v2/usage.py | Python | apache-2.0 | 2,651 |
# coding=utf-8
# Copyright 2022 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... | google-research/google-research | correct_batch_effects_wdn/forgetting_nuisance.py | Python | apache-2.0 | 55,433 |
from pyxb.bundles.opengis.iso19139.20070417.raw.gmx import *
| jonfoster/pyxb1 | pyxb/bundles/opengis/iso19139/20070417/gmx.py | Python | apache-2.0 | 61 |
"""
Support for the Lovelace UI.
For more details about this component, please refer to the documentation
at https://www.home-assistant.io/lovelace/
"""
from functools import wraps
import logging
import os
import time
import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.exce... | tinloaf/home-assistant | homeassistant/components/lovelace/__init__.py | Python | apache-2.0 | 5,109 |
#! /usr/bin/env python
from __future__ import print_function
import cv2
import numpy as np
import keras
from keras.utils import plot_model
from keras.models import Sequential, load_model
from keras.layers import Dense
from os.path import abspath
from golfr.definitions import DFLT_MODEL_PATH
def classify_digit(digit_f... | joshshep/golfr | golfr/classify_cells/classify_sample.py | Python | apache-2.0 | 3,882 |
#coding: utf-8
import csv
import threading
import lucene
from lucene import getVMEnv
print "预处理"
INDEX_DIR = '../index/'
nt = 100000
WRITE_DIR = "../data/mult/"
lucene.initVM()
directory = lucene.SimpleFSDirectory(lucene.File(INDEX_DIR))
analyzer = lucene.StandardAnalyzer(lucene.Version.LUCENE_CURRENT)
class sub... | lavizhao/keyword | lucene/mult_search.py | Python | apache-2.0 | 2,456 |
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import matplotlib
from matplotlib import pyplot as plt
import numpy as np
from numpy import linalg as LA
import cv2
import math
import os
import plotly
from plotly.graph_objs import *
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot
from plotly import... | NeuroDataDesign/seelviz | jon/algorithms/analysis2.py | Python | apache-2.0 | 30,374 |
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | owlabs/incubator-airflow | tests/www/test_utils.py | Python | apache-2.0 | 14,133 |
from setuptools import setup
exec(open('mirror_seq/version.py').read())
LONG_DESCRIPTION = '''
Please visit the GitHub repo (https://github.com/Zymo-Research/mirror-seq) for detail information.
'''
INSTALL_REQUIRES = [
'pandas>=0.18.0',
'pysam>=0.9.0',
'cutadapt==1.9.1',
]
setup(name='mirror_seq',
v... | Zymo-Research/mirror-seq | setup.py | Python | apache-2.0 | 939 |
# Copyright (C) 2013 eBay Inc.
# Copyright (C) 2013 OpenStack Foundation
# 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... | HybridF5/jacket | jacket/tests/storage/unit/db/test_qos_specs.py | Python | apache-2.0 | 9,362 |
# Copyright 2015-2016 F5 Networks 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 ... | F5Networks/f5-openstack-heat-plugins | test/functional/f5_sys_iappservice/test_sys_iappservice.py | Python | apache-2.0 | 3,853 |
#!/usr/bin/env python
# Copyright 2015, Rackspace US, 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... | nrb/rpc-openstack | maas/testing/fake_hp_monitoring.py | Python | apache-2.0 | 940 |
"""
:codeauthor: :email:`Bo Maryniuk <bo@suse.de>`
"""
import datetime
import salt.utils.ssdp as ssdp
import salt.utils.stringutils
from tests.support.mock import MagicMock, patch
from tests.support.unit import TestCase, skipIf
try:
import pytest
except ImportError:
pytest = None
class Mocks:
def g... | saltstack/salt | tests/unit/utils/test_ssdp.py | Python | apache-2.0 | 23,442 |
# -*- coding: utf-8 -*-
import mock
from nose.tools import * # noqa (PEP8 asserts)
import hmac
import hashlib
from StringIO import StringIO
from django.db import IntegrityError
import furl
from modularodm import Q
from modularodm.exceptions import ValidationError
from framework.auth import get_or_create_user
from ... | cwisecarver/osf.io | tests/test_conferences.py | Python | apache-2.0 | 25,084 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.