code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'interactive.ui'
#
# Created: Sun Aug 18 11:55:59 2013
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from commons.i18n import *
try:
_fromUtf8 = QtCore.... | mateoqac/unqTip | gui/views/qDesigner/interactive.py | Python | gpl-3.0 | 5,495 |
from __future__ import print_function
import inspect
import numpy as np
import theano
from ..layers.advanced_activations import LeakyReLU, PReLU
from ..layers.core import Dense, Merge, Dropout, Activation, Reshape, Flatten, RepeatVector, Layer
from ..layers.core import ActivityRegularization, TimeDistributedDense, Aut... | Cadene/keras | keras/utils/layer_utils.py | Python | mit | 4,856 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today Serpent Consulting Services Pvt. Ltd. (<http://www.serpentcs.com>)
# Copyright (C) 2004 OpenERP SA (<http://www.openerp.com>)
#
# Thi... | vnsofthe/odoo-dev | addons/hotel_reservation/__openerp__.py | Python | agpl-3.0 | 2,414 |
# ############################################################################
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core business i... | uclouvain/OSIS-Louvain | education_group/tests/ddd/service/write/test_update_group_service.py | Python | agpl-3.0 | 5,182 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file."""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | ak64th/thug | travis_pypi_setup.py | Python | mit | 4,070 |
# Read file in abc music notation.
'''
X:101
T:Killavil Fancy, The
T:Eilish Brogan
T:Ten Pound Float, The
R:reel
D:Music at Matt Molloy's
D:Frankie Gavin & Alec Finn
Z:Sometimes played doubled.
Z:id:hn-reel-101
M:C|
K:G
~B3G A2BA|GE~E2 cEGE|DGBG A2BA|GEED EFGA|
~B3d A2BA|GE~E2 cEGE|DGBG A2BA|GEED ~E3D||
GABd edge|dB~B... | mcgettin/ditOldProgramming | yr2/sem1/sample-programs/abcFileReader3.py | Python | mit | 1,355 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Checker for common errors in Lore documents.
"""
from xml.dom import minidom as dom
import parser
import urlparse
import os.path
from twisted.lore import tree, process
from twisted.web import domhelpers
from twisted.python import reflect
fro... | skycucumber/Messaging-Gateway | webapp/venv/lib/python2.7/site-packages/twisted/lore/lint.py | Python | gpl-2.0 | 8,849 |
from hpp.corbaserver.rbprm.rbprmbuilder import Builder
from hpp.corbaserver.rbprm.rbprmfullbody import FullBody
from hpp.gepetto import Viewer
import downSlope_easy20_hrp2_pathKino as tp
import time
packageName = "hrp2_14_description"
meshPackageName = "hrp2_14_description"
rootJointType = "freeflyer"
##
# Informa... | rlefevre1/hpp-rbprm-corba | profile/scenarios/downSlope_easy20_hrp2_interp.py | Python | lgpl-3.0 | 4,225 |
from pyang import plugin, statements
import json
import optparse
import re
_yang_catalog_index_fd = None
def pyang_plugin_init():
plugin.register_plugin(IndexerPlugin())
class IndexerPlugin(plugin.PyangPlugin):
def add_output_format(self, fmts):
self.multiple_modules = True
fmts['yang-cat... | cmoberg/pyang-indexer-plugin | yang-catalog-index.py | Python | apache-2.0 | 4,934 |
# -*- coding: utf-8 -*-
from gi.repository import GObject, Gedit, Gtk, GdkPixbuf, Gio, Pango
from checkpython import checkers
class CheckpythonAppActivatable(GObject.Object, Gedit.AppActivatable):
app = GObject.property(type=Gedit.App)
def do_activate(self):
self.app.add_accelerator("<Primary><Shi... | jmanoel7/my_dot_files | .local/share/gedit/plugins/checkpython/checkpython.py | Python | gpl-3.0 | 5,551 |
#!/usr/bin/python
import sys
import json
import argparse
import requests
def upload(archive, metadata, catalogURI):
'''
Upload an archived bundle on the shuttleOFX DB.
'''
headerGzip = {'Content-type': 'application/gzip'}
headerJson= {'Content-type': 'application/json'}
resp = requests.post... | ArmandBiteau/shuttleofx | tools/shuttleOFX_upload.py | Python | lgpl-3.0 | 1,667 |
from direct.directnotify import DirectNotifyGlobal
from toontown.battle import BattlePlace
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.toonbase import ToontownGlobals
from toontown.building import Elevator
from pandac.PandaModules import *
from toontown.coghq import CogHQExterior... | ToonTownInfiniteRepo/ToontownInfinite | toontown/coghq/BossbotHQExterior.py | Python | mit | 2,417 |
#!/usr/bin/env python
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------... | Azure/azure-storage-python | azure-storage-queue/setup.py | Python | mit | 2,381 |
from collections import defaultdict
from decimal import Decimal
import itertools
from pprint import pprint
import gzip
import sys
import unittest
import logging
from lxml import etree
# noinspection PyProtectedMember
from lxml.etree import _Element as Element
IGNORED_TAGS = {'AnchorTime', 'GroupedTracksRevealed', '... | valsteen/ableton_log | ableton_log/ableton_diff.py | Python | bsd-2-clause | 39,242 |
import numpy as np
from numpy.random import randint
from numpy.testing import assert_array_equal as AAE
from ..indexset import IndexSet
from ..flags import *
rand_bool = lambda: bool(randint(0, 2))
lo, hi = -10, 10
n_tests = 10000
def gen_int(lo, hi):
return randint(lo, hi)
def gen_int_none(lo, hi):
ret... | mvsaha/blahb | blahb/test/test_sel.py | Python | mit | 2,910 |
import os
import unittest
from queue import Queue
from bears.tests.BearTestHelper import generate_skip_decorator
from bears.c_languages.codeclone_detection.ClangFunctionDifferenceBear import (
ClangFunctionDifferenceBear)
from bears.c_languages.codeclone_detection.ClangCloneDetectionBear import (
ClangCloneDet... | scriptnull/coala | bears/tests/c_languages/codeclone_detection/ClangCloneDetectionBearTest.py | Python | agpl-3.0 | 3,681 |
##bu python kodu, selenium ve chromedriver ile çalışmakta, siteyi normal kullanıcı gibi ziyaret edip, gerekli verileri parse ediyor
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os
from bs4 import BeautifulSoup
import time, datetime
import json
import requests
import sys
... | raydingoz/cerrahapp | yemek.py | Python | mit | 10,825 |
from sklearn_explain.tests.skl_datasets_reg import skl_datasets_test as skltest
skltest.test_reg_dataset_and_model("RandomReg_100" , "SVR_rbf_9")
| antoinecarme/sklearn_explain | tests/skl_datasets_reg/RandomReg_100/skl_dataset_RandomReg_100_SVR_rbf_9_code_gen.py | Python | bsd-3-clause | 148 |
#
# Copyright (C) 2013,2014 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 ... | jdegraaf/espresso | testsuite/python/cellsystem.py | Python | gpl-3.0 | 1,527 |
# Copyright 2021 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.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | matrix-org/sydent | sydent/config/sms.py | Python | apache-2.0 | 2,871 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/kusto/azure-mgmt-kusto/azure/mgmt/kusto/aio/operations/_managed_private_endpoints_operations.py | Python | mit | 28,456 |
# SPDX-License-Identifier: LGPL-3.0-only
"""Base classes and decorators for the doorstop.core package."""
import abc
import functools
import os
from typing import Dict
import yaml
from doorstop import common, settings
from doorstop.common import DoorstopError, DoorstopInfo, DoorstopWarning
log = common.logger(__na... | jacebrowning/doorstop | doorstop/core/base.py | Python | lgpl-3.0 | 11,112 |
import logging
logging.basicConfig(filename="/var/www/venefyxatu.be/phenny/phennyfyxata.log", level=logging.INFO)
| Venefyxatu/phennyfyxata | phennyfyxata/scores/__init__.py | Python | bsd-2-clause | 115 |
# Copyright 2019 The TensorNetwork 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 applicable law or agreed ... | google/TensorNetwork | tensornetwork/block_sparse/index.py | Python | apache-2.0 | 4,574 |
"""empty message
Revision ID: 34223fdff008
Revises: b4bcea5528b6
Create Date: 2017-08-22 10:19:27.959749
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '34223fdff008'
down_revision = 'b4bcea5528b6'
branch_labels = None
depends_on = None
def upgrade():
# ... | CapitalD/taplist | migrations/versions/34223fdff008_.py | Python | mit | 807 |
import fiona
meta = fiona.open(r'U:\egoldman\hs_2015_update\footprint.shp').meta
with fiona.open(r'U:\egoldman\hs_2015_update\merge.shp', 'w', **meta) as output:
for features in fiona.open(r'U:\egoldman\hs_2015_update\footprint.shp'):
output.write(features)
output.close() | elizabethgoldman/emerging_hotspots | test.py | Python | apache-2.0 | 277 |
#STANDARD LIB
from datetime import datetime
from decimal import Decimal
from itertools import chain
import warnings
#LIBRARIES
import django
from django.conf import settings
from django.db import models
from django.db.backends.util import format_number
from django.db import IntegrityError
from django.utils import tim... | pablorecio/djangae | djangae/db/utils.py | Python | bsd-3-clause | 11,539 |
from __future__ import unicode_literals
from django.apps import AppConfig
class IntegrationAppConfig(AppConfig):
name = 'integration_app'
| 1024inc/django-rq | integration_test/integration_app/apps.py | Python | mit | 145 |
import factory
from django.utils import timezone
from edc_constants.constants import YES
from microbiome.apps.mb_infant.models import InfantFu
class InfantFuFactory(factory.DjangoModelFactory):
class Meta:
model = InfantFu
report_datetime = timezone.now()
physical_assessment = YES
diarrhe... | botswana-harvard/microbiome | microbiome/apps/mb_infant/tests/factories/infant_fu_factory.py | Python | gpl-2.0 | 406 |
#!/usr/bin/python
"""
Copyright (c) 2009 Barry Schwartz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, p... | chemoelectric/glyph_name | make_trie.py | Python | mit | 6,904 |
# Copyright 2015 Mirantis, 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, s... | eayunstack/fuel-ostf | fuel_health/ha_base.py | Python | apache-2.0 | 23,819 |
"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from django.contrib.auth.models import User, Group
from django.test.client import Client
from django.co... | geonition/softgis-api | softgis_open_social/tests.py | Python | mit | 3,444 |
import random
from subprocess import call
import yaml
with open('./venues.yml') as f:
venues = yaml.load(f)
venue = random.choice(venues)
print(venue['name'])
print(venue['url'])
call(['open', venue['url']])
| miiila/hungry-in-karlin | decide.py | Python | mit | 218 |
# Copyright © 2019 Red Hat, Inc.
#
# This file is part of Bodhi.
#
# This program 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 2
# of the License, or (at your option) any later version.
#
# T... | fedora-infra/bodhi | devel/ci/integration/tests/fixtures/rabbitmq.py | Python | gpl-2.0 | 2,627 |
import datetime
import json
from flask import jsonify, make_response
from server import db
def cached_route(redis_key, td, func):
data = cache_get(redis_key, td, func)
secs = int(db.ttl(redis_key))
return make_response(jsonify(data), 200, {"Cache-Control": "max-age=%d" % secs})
def cache_get(redis_key... | pennlabs/penn-mobile-server | server/base.py | Python | mit | 580 |
import picamera
import time
camera = picamera.PiCamera()
def proc(command, message):
if command[0] == "photo":
return take_photo()
else:
return {
"data": {
"status": "error",
"text": "Camera command was not recognised."
},
"r... | alwye/spark-pi | app/commands/camera.py | Python | mit | 781 |
# --------------------------------------------------------------------------------- #
# ROUNDBUTTON wxPython IMPLEMENTATION
#
# Edward Sitarski, @ 27 November 2011
#
#
# TODO List
#
# 1) Anything to do?
#
#
# For all kind of problems, requests of enhancements and bug reports, please
# write to me at:
#
# edward.sitarsk... | ActiveState/code | recipes/Python/577951_wxPythDramatic_shaded_3D_buttons_that_look_like_/recipe-577951.py | Python | mit | 18,554 |
'''
Created on Dec 19, 2014
@author: Benjamin Patterson
'''
class functions(): | hyperfitz/GenoquantR | functions/FunctionsClass.py | Python | gpl-3.0 | 79 |
import logging
from utils import config as c
import logging
import logging.config
logging.config.dictConfig(c.logging)
# create logger
logger = logging.getLogger('simpleExample')
# 'application' code
for i in xrange(100):
logger.debug('debug message')
logger.info('info message')
logger.warn('warn messa... | mitchgu/TAMProxy-pyHost | tamproxy/logger_test.py | Python | mit | 398 |
#!/usr/bin/python
import argparse, os, json
from flask import Flask, request
from galintools import infra_common, monitoring
from galintools.settings import *
# Command line parsing
parser = argparse.ArgumentParser(description='Zabbix Slack Outgoing WebHook Parser')
parser.add_argument('-c','--config',
... | galindro/galintools | src/scripts/bin/zabbix_slack.py | Python | gpl-2.0 | 1,868 |
from distutils.core import setup
import py2exe
setup(console=['interpreterfle.py']) | DatOneLefty/Cyclone | setup.py | Python | gpl-3.0 | 84 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | mrcslws/nupic.research | src/nupic/research/frameworks/vernon/mixins/log_every_learning_rate.py | Python | agpl-3.0 | 3,199 |
# Copyright (C) 2014 Statoil ASA, Norway.
#
# The file 'fault.py' is part of ERT - Ensemble based Reservoir Tool.
#
# ERT 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... | Ensembles/ert | python/python/ert/ecl/faults/fault.py | Python | gpl-3.0 | 19,060 |
import pandas as pd
import piquant.classifiers as classifiers
def _get_test_classifier(
column_name="dummy", value_extractor=lambda x: x,
grouped_stats=True, distribution_plot_range=None):
return classifiers._Classifier(
column_name, value_extractor, grouped_stats, distribution_plot_range)... | lweasel/piquant | test/test_classifiers.py | Python | mit | 4,224 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'Issue', fields ['category']
db.create_index('bugtracker_issue', ['category'])
... | fgaudin/aemanager | bugtracker/migrations/0002_auto.py | Python | agpl-3.0 | 5,515 |
# -*- coding: utf-8 -*-
# Copyright 2014, 2015 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 applica... | illicitonion/synapse | synapse/crypto/keyring.py | Python | apache-2.0 | 16,682 |
# Trixy: Create network listeners, tunnels, and outbound connections in a
# modular way allowing interception and modification of the traffic.
#
# Copyright (C) 2014 Austin Hartzheim
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... | austinhartzheim/Trixy | trixy/__init__.py | Python | gpl-3.0 | 8,243 |
from example_util import get_filename
from glc import Gif
from glc.color import split_complementaries, Color
with Gif(get_filename(__file__), color_count=8) as a:
col, col2, col3 = split_complementaries(Color("mustard"), 140)
l = a.set_bg_color(col).set_size(400, 400).set_fps(24).set_duration(4).set_loop().s... | leovoel/glc.py | examples/flowing_leaves.py | Python | mit | 892 |
import os
import re
from subprocess import Popen, PIPE
from . import repos
class ErrorCannotLocate(Exception):
"""Signal that we cannot successfully run the locate(1) binary."""
globchar = re.compile(r'([][*?])')
def escape(s):
"""Escape the characters special to locate(1) globbing."""
return globcha... | nailgun/unpushed | src/unpushed/scanner.py | Python | mit | 2,095 |
"""Deprecated; import from IPython.lib.lexers instead."""
from IPython.lib.lexers import *
| wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/IPython/nbconvert/utils/lexers.py | Python | mit | 92 |
# mysql/pyodbc.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstr... | Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/sqlalchemy/dialects/mysql/pyodbc.py | Python | gpl-2.0 | 2,657 |
from setuptools import setup, find_packages
with open('requirements.txt', 'r') as infile:
install_requires = infile.read().split('\n')
with open('README.rst', 'r') as infile:
long_description = infile.read()
with open("ocdev/version.txt", 'r') as infile:
version = ''.join(infile.read().split())
setup (
... | mmattel/ocdev | setup.py | Python | gpl-3.0 | 937 |
VBA = \
r"""
'Create A Text and fill it
' Will overwrite existing file
Sub CreateBinFile(FilePath As String, bytes)
Dim binaryStream
Set binaryStream = CreateObject("ADODB.Stream")
binaryStream.Type = 1 ' 1 = TypeBinary
'Open the stream and write binary data
binaryStream.Open
binaryStream.Wri... | sevagas/macro_pack | src/vbLib/CreateBinFile.py | Python | apache-2.0 | 428 |
# Copyright (C) 2019 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, ... | google/cyanobyte | test/sampleData/circuitpython/MCP9808.py | Python | apache-2.0 | 4,600 |
# -*- coding: utf-8 -*-
#from levitas.middleware.jsonMiddleware import JSONMiddleware
#from levitas.middleware.appMiddleware import AppMiddleware
#from levitas.middleware.redirectMiddleware import RedirectMiddleware
#from levitas.middleware.fileMiddleware import FileMiddleware
"""
A url definition is a tuple with th... | tobi-weber/levitas | src/settings_example.py | Python | apache-2.0 | 2,017 |
import time
import cPickle as pickle
import sys
import numpy
from etl import ETLUtils
from topicmodeling.context import context_utils
from topicmodeling.context import reviews_clusterer
from utils.constants import Constants
__author__ = 'fpena'
class WordBasedContext:
def __init__(self, reviews):
# s... | melqkiades/yelp | source/python/topicmodeling/context/word_based_context.py | Python | lgpl-2.1 | 8,408 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | lmazuel/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/v2018_04_01/models/operation_status_response_py3.py | Python | mit | 1,836 |
"""
Apache
======
This module provides high-level tools for installing and configuring
the `Apache HTTP Server <http://httpd.apache.org/>`_.
"""
from fabric.api import (
abort,
hide,
settings,
)
from fabric.colors import red
from fabtools.apache import (
disable_module,
enable_module,
disabl... | bitmonk/fabtools | fabtools/require/apache.py | Python | bsd-2-clause | 4,280 |
import os
import sys
PACKAGE_PARENT = '..'
SCRIPT_DIR = os.path.dirname(os.path.realpath(os.path.join(os.getcwd(), os.path.expanduser(__file__))))
sys.path.append(os.path.normpath(os.path.join(SCRIPT_DIR, PACKAGE_PARENT)))
from Gui.GuiMain import *
if __name__ == '__main__':
run()
| SanPen/CopperPlate | RunCopperPlate.py | Python | gpl-3.0 | 289 |
# -*- coding: utf-8 -*-
import sys
import math
def convert(value, power, si=False, toint=True):
multiple = 1000 if not si else 1024
value = (float(value) / multiple**-power
if power < 0
else float(value) * multiple**power)
return int(math.ceil(value)) if toint else value
FUNCTIO... | fmenabe/python-unix | unix/sizes.py | Python | mit | 1,690 |
import pytest
import six
from configmanager import NotFound, Item, PlainConfig
@pytest.fixture
def schema():
return {
'uploads': {
'enabled': True,
'threads': 1,
'tmp_dir': None,
'db': {
'user': 'root',
'password': 'secret',
... | jbasko/configmanager | tests/test_plain_config.py | Python | mit | 2,524 |
import collections
class Solution:
def numOfMinutes(self, n: int, headID: int, manager: List[int], informTime: List[int]) -> int:
table = collections.defaultdict(list)
for i, m in enumerate(manager):
table[m].append(i)
Q = collections.deque([(headID, 0)])
min... | jiadaizhao/LeetCode | 1301-1400/1376-Time Needed to Inform All Employees/1376-Time Needed to Inform All Employees.py | Python | mit | 524 |
#!/usr/bin/env python
#
# Copyright 2010 The Closure Library 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
... | SOCR/HTML5_WebSite | HTML5/BrainPainter/X/lib/closure-library/closure/bin/build/treescan.py | Python | lgpl-3.0 | 2,158 |
'''
Created on Mar 26, 2012
@author: alushin
'''
import sys
import os
sys.path.insert(0, os.path.join(sys.path[0], '..'))
import GenApiConnectors
import GenIpMgrSubscribe
#===== SmartMesh IP
GenApiConnectors.genFile ("IpMgrDefinition",
"IpMgrConnectorMux/IpMgrConnectorMux... | twatteyne/dustlink_academy | SmartMeshSDK/GenAllApiConnectors.py | Python | bsd-3-clause | 1,445 |
import numpy as np
from data import *
from construct import *
from train import *
from hippocampi_to_patches import *
class DigitsPipeline(object):
def __init__(self):
self.D = Data()
self.D.load_digits_data()
self.D.reshape([16,16],[1])
self.N = FeedForwardNetwork()
... | yohanyee/simple-neural-net | classes/example_pipelines.py | Python | mit | 1,478 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | thresholdsoftware/asylum-v2.0 | openerp/addons/mail/mail_thread.py | Python | agpl-3.0 | 79,884 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fieldsight', '0003_site_logo'),
]
operations = [
migrations.AddField(
model_name='organization',
nam... | awemulya/fieldsight-kobocat | onadata/apps/fieldsight/migrations/0004_auto_20161212_0352.py | Python | bsd-2-clause | 652 |
import luigi
import sciluigi
import pyannote_workflows.tasks.speech
import pyannote_workflows.tasks.face
import pyannote_workflows.tasks.evaluation
import pyannote_workflows.tasks.tvd_dataset
import pyannote_workflows.tasks.propagation
import pyannote_workflows.utils
from pyannote.core import Segment, Annotation
impor... | pyannote/pyannote-workflows | pyannote_workflows/workflows/acmmm2016/one_face.py | Python | mit | 6,163 |
""" Module to call metaquast in pipeline"""
import argparse
import logging
import subprocess
__author__ = "YiDing Fang"
__maintainer__ = "YiDing Fang"
__email__ = "yif017@eng.ucsd.edu"
__status__ = "prototype"
R1_MARKER = '_R1'
R2_MARKER = '_R2'
def form_metaquast_cmd_list(metaquast_fp, outdir, input_fasta):
"... | ucsd-ccbb/jupyter-genomics | src/microbiome/exec_metaquast.py | Python | mit | 3,854 |
#
# Stuff for dealing with the git log output.
#
# Someday this will be the only version of grabpatch, honest.
#
import re, rfc822, datetime
from patterns import patterns
import database
#
# Input file handling. Someday it would be good to make this smarter
# so that it handles running git with the right options and... | cbrune/onie | contrib/git-stats/gitdm/gitlog.py | Python | gpl-2.0 | 4,981 |
#
#
# Copyright (C) 2006, 2007, 2011, 2012, 2014 Google Inc.
#
# This program 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 2 of the License, or
# (at your option) any later version.
#
# This... | vladimir-ipatov/ganeti | lib/luxi.py | Python | gpl-2.0 | 17,598 |
import numpy
import ardustat_library_simple as ard
import time
import atexit
#set parameters
cycles = 4
min_potential = -.5 #V
max_potential = .5 #V
rate = 5 #mV/s
read_delay = .2 #second
ardustat_id = 16
file_name = "two_coin_test"
ardustat_socket = 7777
debug = False
#Below here no touchy
#connect to to ardustat an... | kjiang8/Ardustat | Deprecated_Unsupported/Python_Client/cyclic_voltammagram.py | Python | bsd-2-clause | 1,783 |
"""Single-subject data (two sessions) in native space
==================================================
The example shows the analysis of an SPM dataset studying face perception.
The anaylsis is performed in native spave. Realignment parameters are provided
with the input images, but those have not been resampled to ... | nistats/nistats | examples/02_first_level_models/plot_spm_multimodal_faces.py | Python | bsd-3-clause | 6,029 |
#!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
title = "Master Index"
tab_link = "/masterindex"
| fredwilliam/PMO | apps/masterindex/config.py | Python | bsd-3-clause | 101 |
import asyncio
import collections
from functools import partial
from . import mixin
from . import packet
PACKET_TYPES = packet.Type
class CallbackClient(mixin.GearmanProtocolMixin, asyncio.Protocol):
"""
Simple class for submitting a group of foreground jobs and handing updates via
callbacks rather than... | sardok/aiogear | aiogear/callback_client.py | Python | mit | 7,265 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from grequests import get, map, imap
from nose.tools import ok_
########### Constants ############
urls = [
'http://github.com',
'http://www.google.com',
'http://www.psf.org'
]
############# tests ##############
def test_get():
global ... | kennethreitz/grequests | tests.py | Python | bsd-2-clause | 7,265 |
import asyncio
import warnings
import psycopg2
from .log import logger
class Cursor:
def __init__(self, conn, impl, timeout, echo):
self._conn = conn
self._impl = impl
self._timeout = timeout
self._echo = echo
@property
def echo(self):
"""Return echo mode status... | nerandell/aiopg | aiopg/cursor.py | Python | bsd-2-clause | 11,747 |
import logging
import time
from timeit import default_timer as t
class Benchmark():
"""Calculates number of loops in a second. Useful for testing communication speed"""
def __init__(self, logging_level):
self.logger = logging.getLogger('BENCHMARK')
self.logger.disabled = False
self.log... | dzon4xx/system | backend/misc/benchmark.py | Python | mit | 1,673 |
# Copyright 2020 Department of Computational Biology for Infection Research - Helmholtz Centre for Infection Research
#
# This program 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 Li... | CAMI-challenge/AMBER | src/plots.py | Python | apache-2.0 | 26,475 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
A set of tests for myGengo. They all require internet connections.
In fact, this entire library and API requires an internet connection.
Don't complain.
Also keep in mind that all the test cases test against the Sandbox API,
since... well, it makes more sense to do t... | lloydmeta/mygengo-python | mygengo/tests.py | Python | bsd-3-clause | 10,005 |
# -*- coding: utf-8 -*-
from .baseline import Baseline
default_baseline = Baseline
| yedivanseven/bestPy | algorithms/baselines/__init__.py | Python | gpl-3.0 | 85 |
# Copyright (c) 2014 Mirantis 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 writ... | noironetworks/heat | heat/tests/openstack/sahara/test_cluster.py | Python | apache-2.0 | 9,642 |
# -*- coding: utf-8 -*-
import psutil
import jacoren.disks
from collections import OrderedDict
def test_disks_bytes():
disks = jacoren.disks.disks()
assert isinstance(disks, list)
for disk in disks:
assert 'device' in disk
assert isinstance(disk['device'], str)
assert 'mountpoin... | kuszaj/jacoren | tests/test_disks.py | Python | mit | 1,850 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Institution.country'
db.alter_column('neuroelectro_institution', 'country', self.gf('djan... | neuroelectro/neuroelectro_org | neuroelectro/south_migrations/0037_auto__chg_field_institution_country__chg_field_institution_state__chg_.py | Python | gpl-2.0 | 26,415 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Gtkmm(AutotoolsPackage):
"""Gtkmm is the official C++ interface for the popular GUI librar... | rspavel/spack | var/spack/repos/builtin/packages/gtkmm/package.py | Python | lgpl-2.1 | 1,669 |
#
# [The "BSD license"]
# Copyright (c) 2012 Terence Parr
# Copyright (c) 2012 Sam Harwell
# Copyright (c) 2014 Eric Vergnaud
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redis... | hce/antlr4 | runtime/Python3/src/antlr4/atn/ATNConfigSet.py | Python | bsd-3-clause | 9,485 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (C) 2009-2010 Nicolas P. Rougier
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
# -------------... | davidcox/glumpy | glumpy/shader/bilinear.py | Python | bsd-3-clause | 2,394 |
import purchase_requisition
| 3dfxsoftware/cbss-addons | purchase_requisition_make_po/__init__.py | Python | gpl-2.0 | 28 |
#!/usr/bin/env python
# -*- coding: utf8 -*-
# Hard codes
tomerge = {"Pescia di calamecca ":"Pescia",
"Pescia di pescia":"Pescia",
"Adda sup.":"Adda",
"Adda inferiore":"Adda",
}
# end of hard codes
import json
rivers = {}
for route in json.load(open('ckfiumi.json','r')):
... | fparrel/wwsupdb | ckfiumi_import.py | Python | gpl-3.0 | 964 |
##
# Copyright 2012-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | Caylo/easybuild-framework | easybuild/tools/github.py | Python | gpl-2.0 | 42,865 |
# -*- coding: utf-8 -*-
# Copyright 2013-2019 Tom Eulenfeld, MIT license
"""
Classes and functions for receiver function calculation.
"""
import json
from operator import itemgetter
from pkg_resources import resource_filename
import warnings
import numpy as np
from obspy import read, Stream, Trace
from obspy.core impo... | trichter/rf | rf/rfstream.py | Python | mit | 28,049 |
"""
Commands
Commands describe the input the player can do to the game.
"""
from evennia import Command as BaseCommand
from evennia import default_cmds
from muddery.commands.general import CmdAttack as CmdAttackDefault
from muddery.utils.localized_strings_handler import _
#-----------------------------------------... | MarsZone/DreamLand | templates/battle_field/commands/command.py | Python | bsd-3-clause | 1,341 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 函数的参数章节练习题
# 定义一个可接收一个或多个数并计算乘积的函数
def product(x, *nums):
sums = x
for n in nums:
sums *= n
return sums
if __name__ == '__main__':
print('product(5) =', product(5))
print('product(5, 6) =', product(5, 6))
print('product(5, 6, 7) =', p... | felix9064/python | Demo/liaoxf/args_test.py | Python | mit | 847 |
import os.path
from . import file_writer as fw
from . import flux_simulator as fs
from . import quantifiers as qs
from . import piquant_options as po
from . import resource_usage as ru
RUN_SCRIPT = "run_quantification.sh"
TRANSCRIPT_COUNTS_SCRIPT = "count_transcripts_for_genes"
UNIQUE_SEQUENCE_SCRIPT = "calculate_un... | lweasel/piquant | piquant/prepare_quantification_run.py | Python | mit | 10,315 |
import pickle as cpk
from skimage.draw import line_aa, line, polygon
from skbeam.core.utils import radial_grid, angle_grid
from chxanalys.chx_libs import (np, roi, time, datetime, os, get_events,
getpass, db, get_images,LogNorm, plt,tqdm, utils, Model,
multi_tau... | yugangzhang/chxanalys | chxanalys/chx_packages.py | Python | bsd-3-clause | 5,285 |
"""
Core visualization operations based on PyVista.
Actual implementation of _Renderer and _Projection classes.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Eric Larson <larson.eric.d@gmail.com>
# Guillaume Favelier <guillaume.favelier@gmail.com>
# Joan Massich <mailsik... | wmvanvliet/mne-python | mne/viz/backends/_pyvista.py | Python | bsd-3-clause | 43,129 |
import os
import sublime
from PHPUnitKit.plugin import _get_php_executable
from PHPUnitKit.tests import unittest
class TestGetPHPExecutable(unittest.TestCase):
def setUp(self):
super().setUp()
self.versions_path = unittest.fixtures_path(os.path.join('get_php_executable', 'versions'))
def t... | gerardroche/sublime-phpunit | tests/test_get_php_executable.py | Python | bsd-3-clause | 3,565 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_07_01/operations/_gallery_applications_operations.py | Python | mit | 33,162 |
#!/usr/bin/env python
"""
Copyright 2012 GroupDocs.
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... | liosha2007/temporary-groupdocs-python-sdk | groupdocs/models/SignatureTemplateFieldResponse.py | Python | apache-2.0 | 1,184 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('workflow', '0013_auto_20151110_1650'),
]
operations = [
migrations.AddField(
model_name='item',
name... | Findspire/workflow | workflow/apps/workflow/migrations/0014_item_name.py | Python | mit | 421 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.