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
# License: BSD 3 clause import unittest import numpy as np from numpy.linalg import norm from numpy.testing import assert_almost_equal from tick.prox import ProxL2Sq from tick.prox.tests.prox import TestProx class ProxL2SqTest(object): def test_ProxL2Sq(self): """...Test of ProxL2Sq """ ...
X-DataInitiative/tick
tick/prox/tests/prox_l2sq_test.py
Python
bsd-3-clause
2,342
import simplejson as json from django.contrib.gis.geos import GEOSGeometry, Point from django.core.urlresolvers import reverse from django.core.exceptions import ValidationError from django.conf import settings from django.contrib.auth import get_user_model User = get_user_model() from nodeshot.core.base.tests import...
sephiroth6/nodeshot
nodeshot/networking/net/tests.py
Python
gpl-3.0
33,742
#!/usr/bin/env python import os import math import thread import time import libvirt from libvirt import libvirtError from src import sharedmod from utils import utils required_params = ('guestname', 'flags',) optional_params = {} def check_guest_status(*args): """Check guest current status""" (domobj, log...
ryanmiao/libvirt-test-API
repos/managedsave/managedsave.py
Python
gpl-2.0
5,069
''' Given: A collection of up to 1000 reads of equal length (at most 50 bp) in FASTA format. Some of these reads were generated with a single-nucleotide error. For each read s in the dataset, one of the following applies: 1. s was correctly sequenced and appears in the dataset at least twice (possibly as a re...
jr55662003/My_Rosalind
CORR.py
Python
gpl-3.0
2,114
from ...api import generate_media, prepare_media from django.core.management.base import BaseCommand class Command(BaseCommand): help = 'Combines and compresses your media files and saves them in _generated_media.' requires_model_validation = False def handle(self, *args, **options): prepare_medi...
Crop-R/django-mediagenerator
mediagenerator/management/commands/generatemedia.py
Python
bsd-3-clause
349
from django.core import management from django.test import TestCase from .models import Article, Book class SampleTestCase(TestCase): fixtures = ['fixture1.json', 'fixture2.json'] def testClassFixtures(self): "Test cases can load fixture objects into models defined in packages" self.assertEq...
LethusTI/supportcenter
vendor/django/tests/modeltests/fixtures_model_package/tests.py
Python
gpl-3.0
2,352
from .singleton import Singleton def test_identity(): class Foo(metaclass=Singleton): def __init__(self, a): self.a = a pass foo1 = Foo(1) assert foo1.a == 1 foo2 = Foo() foo2.a = 2 assert foo1.a == 2 # assert foo1 is foo2
Alexoner/skynet
skynet/tests/test_singleton.py
Python
mit
283
"""Copyright 2008 Orbitz WorldWide. 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, softwar...
zwidny/graphite
src/render/urls.py
Python
bsd-3-clause
862
""" Bacula and therefore Bareos specific implementation of a base64 decoder. This class offers functions to handle this. """ class BareosBase64(object): ''' Bacula and therefore Bareos specific implementation of a base64 decoder ''' base64_digits = \ ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I...
joergsteffens/python-bareos
bareos/util/bareosbase64.py
Python
agpl-3.0
2,799
############################################################################### # # temboo.core.choreography.Choreography # temboo.core.choreography.InputSet # temboo.coreo.choreography.ResultSet # temboo.core.choreography.ChoreographyExecution # # Interface classes for calling and manipulating choreographies. # # Pyth...
jordanemedlock/psychtruths
temboo/core/choreography.py
Python
apache-2.0
11,253
#!/usr/bin/env python3 import time import datetime import signal import sys from Adafruit_LED_Backpack import SevenSegment # To run: # sudo python3 ./my_7segment_clock.py # =========================================================================== # Clock Example # ==============================================...
dpcrook/timetemp
install/my_7segment_clock.py
Python
mit
2,535
'''Defines the Optic class for theia.''' # Provides: # class Optic # __init__ # isHitDics # isHit # hit # hitHR # hitAR # hitSide # apexes # collision # geoCheck # translate import numpy as np from ..helpers import settings, geometry from ..helpers.t...
bandang0/theia
theia/optics/optic.py
Python
gpl-3.0
22,627
#!/usr/bin/python import os,sys import logging import global_data as gd logger = logging.getLogger('architectures') X86_64_LINUX = "x86-64-linux" PPC_AIX = "ppc-aix" SPARC_SOLARIS = "sparc-solaris" WIN32 = "win32" X86_LINUX = "x86-linux" HPUX_11 = "hpux-11" APPLE_OSX = "apple-osx" architectures = { ...
cc14514/hq6
dist/support/src/main/resources/scripts/architectures.py
Python
unlicense
1,738
# -*- coding: utf-8 -*- """ Author: Wang Chao <yueyoum@gmail.com> Filename: __init__.py Date Created: 2015-12-12 19:37 Description: """
yueyoum/duckadmin
duckadmin/templatetags/__init__.py
Python
bsd-3-clause
154
__all__ = [ "test_builder"]
winiciuscota/OG-Bot
tests/core/__init__.py
Python
mit
32
class Solution: # @param root, a tree node # @return root of the upside down tree def upsideAux(self, root, left, right) : if not left : return root v = self.upsideAux(left, left.left, left.right) root.left, root.right = None, None left.left, left.right = right, ...
yelu/leetcode
Tree/BinaryTreeUpsideDown.py
Python
gpl-2.0
893
# ENH quadpy-optimize import pathlib from ...helpers import article from .._helpers import _read, register _source = article( authors=["KyoungJoong Kim", "ManSuk Song"], title="Symmetric quadrature formulas over a unit disk", journal="Korean J. Comp. & Appl. Math.", year="1997", volume="4", pa...
nschloe/quadpy
src/quadpy/s2/_kim_song/__init__.py
Python
mit
1,946
from __future__ import division import sqlite3 from django.core.management.base import BaseCommand, CommandError from django.db import transaction from poscore.models import Region, Constellation, System, Planet, Moon class Command(BaseCommand): args = '<map csv>' help = 'Imports the EVE Map from a CSV dump o...
nikdoof/posmaster
posmaster/poscore/management/commands/import_map.py
Python
bsd-3-clause
1,903
''' test for changing vm password when imported image with no system tag add system tag @author: SyZhao ''' import apibinding.inventory as inventory import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import zstackwoodpec...
zstackio/zstack-woodpecker
integrationtest/vm/vm_password/test_no_tag_add_tag_chg_vm_passwd_c7.py
Python
apache-2.0
3,554
from django.conf.urls.defaults import patterns, url from django.views.generic.simple import redirect_to urlpatterns = patterns('', (r'^help/(?:sub)?state/(?:\d+/)?$', redirect_to, {'url': '/doc/help/state/draft-iesg/' }), (r'^help/evaluation/$', redirect_to, {'url':'http://www.ietf.org/iesg/voting-procedures...
mcr/ietfdb
ietf/doc/redirect_idtracker_urls.py
Python
bsd-3-clause
761
from collections import ChainMap from typing import Set, Optional, Any, Dict from pyramid.view import view_config from calaldees.string_convert import convert_str, _string_list_format_hack from calaldees.json import json_string from . import action_ok, action_error, is_admin from ..model import DBSession from ..mod...
calaldees/KaraKara
website/karakara/views/queue_settings.py
Python
gpl-3.0
7,955
import os if 'DEBUG' in os.environ and os.environ['DEBUG'] == 'True': DEBUG = True TESTING = True else: DEBUG = False TESTING = False #################### # CSRF configuration #################### SECRET_KEY = os.environ['SECRET_KEY'] # activates the cross-site request forgery prevention in Flask-WT...
CryptoExperts/wb_contest_submission_server
services/web-dev/app/config.py
Python
gpl-3.0
2,157
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from contextlib import contextmanager @contextmanager def closing(fname): f = None try: f = open(fname, 'r') yield f finally: if f: f.close() with closing('test.txt') as f: print(f.read())
whyDK37/py_bootstrap
samples/context/do_closing.py
Python
apache-2.0
293
# Debian packaging tools: Custom pretty printer. # # Author: Peter Odding <peter@peterodding.com> # Last Change: April 19, 2020 # URL: https://github.com/xolox/python-deb-pkg-tools """ Custom pretty printer for parsed control files and package relationships. The :class:`PrettyPrinter` class in the :mod:`deb_pkg_tools...
xolox/python-deb-pkg-tools
deb_pkg_tools/printer.py
Python
mit
1,461
# -*- coding: utf-8 -*- # Authors: Teon Brooks <teon.brooks@gmail.com> # Martin Billinger <martin.billinger@tugraz.at> # Alan Leggitt <alan.leggitt@ucsf.edu> # Alexandre Barachant <alexandre.barachant@gmail.com> # Stefan Appelhoff <stefan.appelhoff@mailbox.org> # Joan Massic...
olafhauk/mne-python
mne/io/edf/tests/test_edf.py
Python
bsd-3-clause
21,223
#!/usr/bin/env python """Handle serial communication with the device and do callbacks. """ import serial class Serial(object): """Serial duplex communication.""" def __init__(self, clb): self.clb = clb # callback for new available measurement self.comm = serial.Serial(port='/dev/ttyUSB0', ...
MiroslavVitkov/micli
graph_temperature/hw_comm.py
Python
mit
1,693
import numpy as np from compmech.logger import msg, warn from compmech.sparse import solve def _solver_NR(a): """Newton-Raphson solver """ msg('Initialization...', level=1) modified_NR = a.modified_NR inc = a.initialInc total = inc once_at_total = False max_total = 0. fext = a....
saullocastro/compmech
compmech/analysis/newton_raphson.py
Python
bsd-3-clause
5,817
from django.conf import settings from django.core.files.base import ContentFile from django.core.validators import MinValueValidator from django.db import models from django.utils.translation import ugettext_lazy as _ from .defaults import BadgeDefaults from copy import deepcopy import os import posixpath def _set...
helfertool/helfertool
src/badges/models/settings.py
Python
agpl-3.0
5,016
################################################################################ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY # # Read the zproject/README.md for information about making permanent changes. # #############################################################################...
evoskuil/czmq
bindings/python_cffi/czmq_cffi/Zarmour.py
Python
mpl-2.0
3,829
#!/usr/bin/env python #Flag Submission server configurations class FlagServer: port = 31337 class FDCServer: iplist = list() class DB: host = "localhost" port = 3301 username = "root" password = "MyLuv4.7GB**" db_name = "CTF"
rkrp/ctf-server
CTFConfig.py
Python
gpl-3.0
236
# Copyright (c) 2012-2013, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSHelperFn, AWSObject, AWSProperty, FindInMap, Ref from .validators import ( boolean, integer, integer_range, network_port, positive_integer ) try: from awacs.aws import Policy ...
WeAreCloudar/troposphere
troposphere/ec2.py
Python
bsd-2-clause
14,505
# # This implements a tolological sort for the dependencies # # (c) 2008 by flonatel # # For licencing details see COPYING # import copy # The graph must be a dictionary. The key is the node name where the # edge(s) start, the value a list of nodes where the edge(s) end. # Example: # {'Generic': [], 'iSCSI': ['Generi...
florath/init4boot
init4boot/lib/TopologicalSort.py
Python
gpl-3.0
1,401
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "newtest.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
chrcoe/base-django
newtest/manage.py
Python
mit
250
from flask import Flask, render_template from flask.ext.bootstrap import Bootstrap from flask.ext.moment import Moment from flask.ext.sqlalchemy import SQLAlchemy from config import config bootstrap = Bootstrap() moment = Moment() db = SQLAlchemy() def create_app(config_name): app = Flask(__name__) app.config.fro...
vahidR/restful-todo
app/__init__.py
Python
gpl-2.0
557
import setuptools version = '1.8.0' setuptools.setup( name='six', version=version, url='https://pypi.python.org/packages/source/s/six/six-%s.tar.gz' % version, license='MIT License', author='Benjamin Peterson', author_email='benjamin@python.org' )
Scalr/packages
pkgs/six/setup.py
Python
apache-2.0
274
import functools import base64 from urlparse import parse_qs as _parse_qs from twisted.internet.defer import maybeDeferred, inlineCallbacks from confmodel import Config from confmodel.fields import ConfigDict from go_api.cyclone.handlers import ApiApplication, BaseHandler from cyclone.web import HTTPAuthenticationR...
praekelt/go-metrics-api
go_metrics/server.py
Python
bsd-3-clause
3,516
import threading from datetime import datetime, timedelta from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections from django.db.models.manager import BaseManager from django.db.models.query import EmptyQuerySet, QuerySet from dj...
tysonclugg/django
tests/basic/tests.py
Python
bsd-3-clause
29,560
from __future__ import division from collections import namedtuple from math import ceil, cos, floor, pi, sin, sqrt, trunc from operator import __truediv__ from random import uniform PointTuple = namedtuple('PointTuple', ('x', 'y')) class Point(PointTuple): def __new__(cls, x, y): assert isinstance(x, ...
AlexKuhnle/ShapeWorld
shapeworld/world/point.py
Python
mit
11,546
import pytest from rswail.struct import Struct, construct from rswail.value import String def test_get_struct_member(): """Define a struct and get one of its members.""" struct = Struct(u"maybe", {u"nothing": [], u"just": [u"value"]}) assert struct.members[u"nothing"].eq(struct.get(u"nothing")) assert struct.mem...
Vierkantor/RSwail
test/test_struct.py
Python
gpl-3.0
1,884
from django.conf import settings from django.contrib.staticfiles.templatetags.staticfiles import static from . import __BOOTSTRAP as BOOTSTRAP # Local version of DEBUG DEBUG = settings.configured and settings.DEBUG def django_select2_static(file): return static('django_select2/' + file) def get_select2_js_lib...
Venturi/oldcms
env/lib/python2.7/site-packages/django_select2/media.py
Python
apache-2.0
1,610
from datetime import datetime, timedelta from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic from django.db import models import checkinatfmi.translations_bg as translate from managers import BorrowManager from managers import CheckinManager DEFAULT_BORROW_DAY...
TheCodingMonkeys/checkin-at-fmi
checkinatfmi_project/activities/models.py
Python
agpl-3.0
5,144
class DuplicateUserGroupException(Exception): def __init___(self): Exception.__init__(self,"Duplicate User group already created and active") class DuplicateUserException(Exception): def __init___(self): Exception.__init__(self,"Duplicate User already created and active") class DuplicateMessag...
rkk09c/Broadcast
app/mod_sms/custom_errors.py
Python
apache-2.0
437
#!/usr/bin/python2.7 # # Copyright 2011 Google Inc. All Rights Reserved. """HTMLStripper based on HTMLParser.""" __author__ = 'wclarkso@google.com (Will Clarkson)' import HTMLParser class HTMLStripper(HTMLParser.HTMLParser): """Simple class to strip tags from HTML.""" def __init__(self): HTMLParser.HTMLP...
rwl/google-apis-client-generator
src/googleapis/codegen/utilities/html_stripper.py
Python
apache-2.0
527
# -*- coding: utf-8 -*- from __future__ import absolute_import from kazoo.client import KazooClient, KazooState from kazoo.handlers.gevent import SequentialGeventHandler from kazoo.exceptions import NodeExistsError, NoNodeError import logging import gevent from moneta import json from moneta.scheduler import Moneta...
geneanet/moneta
moneta/cluster.py
Python
bsd-3-clause
12,143
class Cache: """ ABC of a cache. All caches should conform to this interface. """ def __init__(self): pass def add(self, key, value): """ Add a value to a cache Args: key: key for a particular cached value value: value to store under the specified key Return: Boolean(optional): if the cache ...
andrew749/andrew749.github.io
application/caches/cache.py
Python
apache-2.0
607
#! /usr/bin/env python3 import sys import timeit from pandas import DataFrame, Series import random try: import tabulate has_tabulate = True except ImportError: has_tabulate = False sys.stderr.write('Warning: could not import tabulate\n') sys.stderr.write(' see https://bitbucket.org/astanin...
Ezibenroc/PyRoaringBitMap
quick_bench.py
Python
mit
4,894
# Copyright 2013 Allen Institute # This file is part of dipde # dipde is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # dipde is dis...
AllenInstitute/dipde
dipde/__init__.py
Python
gpl-3.0
1,024
# -*- coding: utf-8 -*- ''' /*************************************************************************** DsgTools A QGIS plugin Brazilian Army Cartographic Production Tools ------------------- begin : 2015-04-02 git sha ...
lcoandrade/DsgTools
gui/ServerTools/viewServers.py
Python
gpl-2.0
16,001
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. DEPS = [ 'depot_tools/bot_update', 'file', 'depot_tools/gclient', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', '...
eunchong/build
scripts/slave/recipes/dart/dart_vm.py
Python
bsd-3-clause
4,853
from django.conf.urls import url from . import views urlpatterns = [ url(r'deploylist',views.deploylist,name='deploylist'), url(r'deployadd',views.deployadd,name='deployadd'), url(r'deployinfo', views.deployinfo, name='deployadd'), ]
damondengxin/opsmanager
deploy/urls.py
Python
lgpl-3.0
249
"""The ONVIF integration.""" import asyncio from onvif.exceptions import ONVIFAuthError, ONVIFError, ONVIFTimeoutError from homeassistant.components.ffmpeg import CONF_EXTRA_ARGUMENTS from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry from homeassistant.const import ( CONF_HOST, CONF_NAME, ...
turbokongen/home-assistant
homeassistant/components/onvif/__init__.py
Python
apache-2.0
4,477
from pyramid.view import view_config from externals.lib.misc import strip_non_base_types from externals.lib.log import log_event from . import web, action_ok, action_error from ..model import DBSession from ..model.model_feedback import Feedback import logging log = logging.getLogger(__name__) @view_config(route_n...
richlanc/KaraKara
website/karakara/views/feedback.py
Python
gpl-3.0
1,173
from django.db import models from django.contrib.auth.models import User from taggit.managers import TaggableManager from django.db.models import signals from django_notify import models as notify_models from django_notify.models import Subscription, Settings, NotificationType, Notification from django.contrib.contentt...
alpsayin/django-qanda
qanda/qanda_app/models.py
Python
mit
25,388
from share.provider import OAIProviderAppConfig class AppConfig(OAIProviderAppConfig): name = 'providers.edu.umassmed' version = '0.0.1' title = 'umassmed' long_title = 'eScholarship@UMMS' home_page = 'http://escholarship.umassmed.edu' url = 'http://escholarship.umassmed.edu/do/oai/'
zamattiac/SHARE
providers/edu/umassmed/apps.py
Python
apache-2.0
311
""" Copyright (c) 2013, Cogniteam All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following...
labust/decision_making
rqt_decision_graph/src/rqt_decision_graph/shape_factory.py
Python
mit
9,422
# -*- coding: utf-8 -*- import os import shutil import unicodedata import webbrowser import re import requests from wox import Wox,WoxAPI from bs4 import BeautifulSoup ROOT_URL = 'http://weekly.manong.io/' ISSUE_URL = 'http://weekly.manong.io/issues/' def full2half(uc): """Convert full-width characters to half-...
shuson/wox-plugin-manong-weekly
manong.py
Python
mit
2,172
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) SECRET_KEY = 'xhcg42=d%md&1jcy$c8%#p5e+59!)25v$m$%uq*^1hfx%23i+p' DEBUG = True TEMPLATE_DEBUG = True STATIC_URL = '/static/' # for deployment, collects the static files into ST...
lrqrun/lrqrun.org
src/django_blog/settings/base.py
Python
mit
3,817
import numpy import itertools import random import math def convert_spike_list_to_timed_spikes(spike_list, min_idx, max_idx, tmin, tmax, tstep): times = numpy.array(range(tmin, tmax, tstep)) spike_ids = sorted(spike_list) possible_neurons = range(min_idx, max_idx) spikeArray = dict([(neuron, times) for...
dhgarcia/babelModules
pynnModules/Network/spike_file_to_spike_array.py
Python
gpl-3.0
8,559
# Released under the MIT license. See the LICENSE file for more information. # https://github.com/ololobster/cvidone from flask import request import datetime from calendar import monthrange import json import re class ValidationError(Exception): def __init__(self, name): self.name = name def __str_...
ololobster/cvidone
cvidone/util/validator.py
Python
mit
11,249
# -*- coding: utf-8 -*- from array import * from nltk.corpus import pl196x, treebank from nltk.tag import UnigramTagger, DefaultTagger from nltk.tokenize import word_tokenize as tokenize from pytenseshift.taggers import FirstTagger from pytenseshift.rules import PlVerbAfterRule, PlVerbBeforeRule, PlPrononunBeforeRule i...
perfidia/pytenseshift
src/pytenseshift/__init__.py
Python
mit
6,644
a = input("entrez une première valeur : ") b = input("entrez une deuxième valeur : ") c = input("entrez une troisième valeur : ") print("Vous avez entré : ", a, b, c) temp = b b = a a = c c = temp print("a : ", a) print("b : ", b) print("c : ", c)
TGITS/programming-workouts
erri/python/lesson_5/permutation_circulaire.py
Python
mit
252
import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class TestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @no_debug_info_test def test_invalid_arg(self): self.expect("target select -1", error=True, ...
google/llvm-propeller
lldb/test/API/commands/target/select/TestTargetSelect.py
Python
apache-2.0
510
# Copyright 2014-2017 The Meson development team # 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...
trhd/meson
mesonbuild/mparser.py
Python
apache-2.0
23,860
from __future__ import absolute_import from future import standard_library standard_library.install_aliases() from ozelot import client from . import models def decade_query(): cl = client.get_client() session = cl.create_session() query = session.query(models.Painting.area, ...
trycs/ozelot
examples/leonardo/leonardo/standard/queries.py
Python
mit
967
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2013 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## 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 Foundati...
andrebellafronte/stoq
stoqlib/gui/test/test_calculator.py
Python
gpl-2.0
7,402
"""Module for building the autocompletion indices.""" from __future__ import print_function import os import json from six import BytesIO from docutils.core import publish_string import awscli.clidriver from awscli.argprocess import ParamShorthandDocGen try: from botocore.docs.bcdoc import textwriter except Import...
awslabs/aws-shell
awsshell/makeindex.py
Python
apache-2.0
6,173
# Copyright: (c) 2012, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: script version_added: "0.9" short_description: Runs a local script...
indrajitr/ansible
lib/ansible/modules/script.py
Python
gpl-3.0
3,241
''' Execution class ''' import datetime import time from threading import Thread from time import sleep from ExecutionTBTestSuite import ExecutionTBTestSuite class TBTAFExecutor: def validateTestBed(self, parameter): return True def checkFlagsExist(self, parameter): return True ...
S41nz/TBTAF
tbtaf/executor/Executor.py
Python
apache-2.0
3,991
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=['rosbag'], package_dir={'': 'src'}, scripts=['scripts/rosbag'], requires=['genmsg', 'genpy', 'roslib', 'rospkg'] ) setup(**d)
MangoMangoDevelopment/neptune
lib/ros_comm-1.12.0/tools/rosbag/setup.py
Python
bsd-3-clause
301
# Copyright 2014 CloudFounders NV # # 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...
mflu/openvstorage_centos
openstack/tests/ovs_common.py
Python
apache-2.0
30,905
#!/usr/bin/env python from __future__ import unicode_literals import io import optparse import os import sys # Import youtube_dl ROOT_DIR = os.path.join(os.path.dirname(__file__), '..') sys.path.insert(0, ROOT_DIR) import youtube_dl def main(): parser = optparse.OptionParser(usage='%prog OUTFILE.md') optio...
MarkTheF4rth/youtube-dl
devscripts/make_supportedsites.py
Python
unlicense
1,152
"""Default variable filters.""" from __future__ import unicode_literals import re import random as random_module import unicodedata from decimal import Decimal, InvalidOperation, Context, ROUND_HALF_UP from functools import wraps from pprint import pformat from django.template.base import Variable, Library, VariableD...
RaoUmer/django
django/template/defaultfilters.py
Python
bsd-3-clause
28,123
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
Distrotech/scons
test/CPPDEFINES/append.py
Python
mit
8,807
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ This reads a fasta file and writes it back out again with modified headers """ from __future__ import print_function from Bio import SeqIO import sys, os import numpy as np header = "" for idx, arg in enumerate(sys.argv): if arg == "-h": header += sys.arg...
karoraw1/xMetaPipeline
bin/shortReadsFromGenome.py
Python
bsd-2-clause
2,002
# Copyright 2012 OpenStack Foundation # # 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...
maheshp/novatest
nova/api/openstack/compute/contrib/extended_server_attributes.py
Python
apache-2.0
4,494
import sys board = sys.stdin.read().replace('\n', '') t = 0 for i in range(16): if board[i] == '.': continue index = ord(board[i]) - 65 gr = index // 4 gc = index % 4 cr = i // 4 cc = i % 4 t += abs(gr - cr) + abs(gc - cc) print(t)
SirDavidLudwig/KattisSolutions
problems/npuzzle/npuzzle.py
Python
gpl-3.0
243
"""Smoke tests for the ``UI`` end-to-end scenario.""" from fauxfactory import gen_string, gen_ipaddr from robottelo import manifests from robottelo.config import settings from robottelo.constants import ( ANY_CONTEXT, DEFAULT_LOC, DEFAULT_ORG, DEFAULT_SUBSCRIPTION_NAME, DOMAIN, FAKE_0_PUPPET_RE...
anarang/robottelo
tests/foreman/endtoend/test_ui_endtoend.py
Python
gpl-3.0
16,554
class Item(object): def __init__(self, path, name): self.path = path self.name = name
nickw444/MediaBrowser
Item.py
Python
mit
106
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
veger/ansible
lib/ansible/modules/network/fortimanager/fmgr_fwpol_ipv4.py
Python
gpl-3.0
53,721
from django_notify.storage.base import BaseStorage, EOFNotification from django_notify.storage.cookie import CookieStorage from django_notify.storage.session import SessionStorage def strip_eof_messages(messages): """ Return a 2 part tuple consisting of a stripped message list and EOF boolean. The s...
coassets/initial-d
sample_project/external_apps/django_notify/storage/fallback.py
Python
gpl-2.0
3,603
import logging import os import subprocess def compile_sass(ctx, output_dir): ''' Compile Sass files -> CSS in the output directory. Any .scss or .sass files found in the output directory will be compiled to CSS using Sass. The compiled version of the file will be created in the same directory as...
uberj/molly.cat
hooks/hooks.py
Python
mit
1,485
from polyphony import pure from polyphony import testbench from polyphony import module from polyphony.timing import clksleep from polyphony.typing import int8, int16 class Sub: def __init__(self, x): self.x:int16 = x def w0(p0, p1): print('w0', p0, p1) @module class ModuleCtor01: @pure de...
ktok07b6/polyphony
tests/pure/module_ctor01.py
Python
mit
992
""" """ from Products.Zuul.interfaces import IComponentInfo from Products.Zuul.form import schema from Products.Zuul.utils import ZuulMessageFactory as _t class IBigipVirtualServerInfo(IComponentInfo): """ Info adapter for BigipVirtualServer components. """ vsIP = schema.Text(title=u"IP Address", rea...
zenoss/Community-Zenpacks
ZenPacks.community.f5/ZenPacks/community/f5/interfaces.py
Python
gpl-2.0
726
from urbanjungle import app from urlparse import urlparse uri = urlparse(app.config['SQLALCHEMY_DATABASE_URI']) DATABASE_HOST = uri.hostname DATABASE_USER = uri.username DATABASE_PASSWORD = uri.password DATABASE_NAME = uri.path.lstrip('/') DATABASE_MIGRATIONS_DIR='./migrations'
thibault/UrbanJungle
site/migrations_conf.py
Python
gpl-3.0
281
""" This program is a member of the new python based DAQ system. It collects samples from the RADAC, call mode specific integration routines and write the output to hdf5 formatted data files. The interface to the program is based on the xmlrpc protocol. History: Initial implementation Date: 20070212 ...
weightedEights/runDBcheck
RADAR_DATA/20170713.001/Source/Shell/shell.py
Python
gpl-3.0
8,278
############################################################################## # # Copyright (C) 2015 Comunitea All Rights Reserved # $Omar Castiñeira Saavedra <omar@comunitea.com>$ # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public...
Comunitea/CMNT_004_15
project-addons/picking_invoice_pending/models/account_invoice.py
Python
agpl-3.0
3,618
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
V155/qutebrowser
qutebrowser/browser/webkit/webkitsettings.py
Python
gpl-3.0
7,040
# Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>) # Eric Antones <eantones@nuobit.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) { "name": "Product unique barcode", "summary": "This module ensures that you enter a Unique Barcode for your Products", "version": "14.0.1.0.0", ...
nuobit/odoo-addons
product_unique_barcode/__manifest__.py
Python
agpl-3.0
629
# Copyright 2017 Mirantis, 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 la...
openstack/manila-ui
manila_ui/dashboards/admin/share_group_types/tables.py
Python
apache-2.0
3,757
import re import sys from setuptools import setup if sys.version_info < (3,): sys.exit('pipa can only run on Python 3 or later.') readme = open('README.rst', encoding='utf-8').read() init = open('pipa/__init__.py', encoding='utf-8').read() match = re.search("^__version__ = '(?P<version>[^']*)'$", init, re.M) ve...
Ivoz/pipa
setup.py
Python
mit
1,286
# -*- coding: utf-8 -*- # Generated by Django 1.10.2 on 2017-02-20 06:05 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('execution', '0002_testsuite_project'), ] operations = [ migrations.AlterFie...
longmazhanfeng/interface_web
execution/migrations/0003_auto_20170220_1405.py
Python
mit
452
#!/usr/bin/env python3 # Copyright (c) 2015-2016 Daniel Kraft # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Test mining (generate and getauxblock) with dual-algo. from test_framework import auxpow from test_framework.test_fra...
wiggi/huntercore
qa/rpc-tests/dualalgo.py
Python
mit
5,753
from django.core.exceptions import ValidationError from django.db import models from django.db.models import Sum from django.db.models import DateField, TimeField, CharField, PositiveSmallIntegerField from django.db.models import ManyToManyField, ForeignKey, OneToOneField, DateTimeField, TextField from django.utils.tra...
SpreadBand/SpreadBand
apps/gigbargain/models.py
Python
agpl-3.0
15,985
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals from textwrap import dedent from pants.backend.docgen.targets.doc import Page, Wiki, Wik...
foursquare/pants
tests/python/pants_test/backend/docgen/targets/test_wiki_page.py
Python
apache-2.0
4,692
import numpy as np import dicom import glob from matplotlib import pyplot as plt import os import cv2 from common import plot_3d from sklearn.metrics import confusion_matrix import pandas as pd from sklearn import cross_validation, metrics import xgboost as xgb import scipy.ndimage from skimage import measure from ...
Innixma/kaggle2017
scripts/plots_preprocessing.py
Python
mit
5,417
# # Copyright (C) 2008 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
ossxp-com/repo
manifest_xml.py
Python
apache-2.0
18,015
#!/usr/bin/env python import os.path import sys sys.path.append('.') sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../hytra/.') import numpy as np import os import string import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.axes_divider import make_axe...
chaubold/hytra
cvpr15_eval/plot_fmeasuer_vs_proposal.py
Python
mit
4,207
from django.conf import settings from django.urls import include, path, re_path from django.contrib import admin from wagtail.documents import urls as wagtaildocs_urls from coderedcms import admin_urls as coderedadmin_urls from coderedcms import search_urls as coderedsearch_urls from coderedcms import urls as codered_u...
ianastewart/cwltc-admin
venv/Lib/site-packages/coderedcms/project_template/sass/project_name/urls.py
Python
mit
1,273
__version__ = (2022, 3, 4, 'df535df7') VERSION = ".".join(map(str, __version__))
moodpulse/l2
laboratory/__init__.py
Python
mit
81
#!/usr/bin/python """a simple test script""" import sys from mininet.node import Host, Switch from mininet.topo import Topo from mininet.net import Mininet from mininet.util import ensureRoot, waitListening, dumpNodeConnections from mininet.log import setLogLevel, info, warn, output # Ensure this script is being run...
kenwith/cs561
cs561-as1-kenwith/.scratch/foo/foo2.py
Python
gpl-3.0
704