code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
# Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | charany1/googlecl | src/googlecl/picasa/service.py | Python | mit | 14,137 |
#!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sample_app.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that t... | bianchimro/django-search-views | sample_app/manage.py | Python | mit | 808 |
# login methods are dynamically imported if auth is enabled
import logging
from .logout import Logout
import tornado.web
import _
@_.components.Register('auth')
class Authentication(tornado.web.RequestHandler):
@classmethod
def _pyConfig(cls, config):
cls.URL = config.pop('login_page', '/login')
| moertle/_.py | _/web/auth/__init__.py | Python | mit | 318 |
#!/usr/bin/python
"""
Test experiments
"""
from expfactory.utils import copy_directory, get_installdir
from expfactory.vm import custom_battery_download
from expfactory.experiment import load_experiment
from expfactory.views import *
import tempfile
import unittest
import shutil
import json
import os
import re
class... | vsoch/expfactory-python | expfactory/testing/test_views.py | Python | mit | 2,582 |
# -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <maurizio.... | ryanss/holidays.py | test/countries/test_malawi.py | Python | mit | 1,455 |
from pamqp import specification
from amqpstorm.channel import Channel
from amqpstorm.tests.utility import FakeConnection
from amqpstorm.tests.utility import TestFramework
from amqpstorm.tx import Tx
class TxTests(TestFramework):
def test_tx_select(self):
def on_tx_select(*_):
channel.rpc.on_f... | eandersson/amqp-storm | amqpstorm/tests/unit/tx_tests.py | Python | mit | 4,443 |
"""
Additional strategies from Axelrod's second tournament.
"""
import random
from axelrod import Actions, Player, flip_action, random_choice
C, D = Actions.C, Actions.D
class Champion(Player):
"""
Strategy submitted to Axelrod's second tournament by Danny Champion.
"""
name = "Champion"
class... | marcharper/Axelrod | axelrod/strategies/axelrod_second.py | Python | mit | 3,354 |
# -*- coding: utf-8 -*-
from .lancamento import *
from .plano import *
| thiagopena/djangoSIGE | djangosige/apps/financeiro/models/__init__.py | Python | mit | 72 |
# Global modules
import os
# Local modules
from seleniumcrawler.config import sites_dict
THIS_DIR = os.path.dirname(os.path.realpath(__file__))
SITES_DIR = os.path.join(THIS_DIR, 'sites')
def locate_sites():
location_list = []
for site, regex in sites_dict.items():
this_site_dir = os.path.join(SITES_DI... | corywalker/selenium-crawler | seleniumcrawler/filesystem.py | Python | mit | 846 |
#!/usr/bin/python
"""
tsdv.py - timestamp dv
sets start/end times of dv files
Gets start from one of:
the file name (assumes yy_mm_dd/hh_mm_ss.dv format)
the file system time stamp,
the first frame of the dv
duration (in seconds) based on file size / BBF*FPS
last frame
"""
import os
import datetime
from fnmatch im... | xfxf/veyepar | dj/scripts/tsdv.py | Python | mit | 4,150 |
# encoding: utf-8
from gerencianet import Gerencianet
from credentials import CREDENTIALS
gn = Gerencianet(CREDENTIALS)
params = {
'id': 1
}
body = {
'notification_url': 'http://yourdomain.com',
'custom_id': 'my_new_id'
}
response = gn.update_subscription_metadata(params=params, body=body)
print(respo... | gerencianet/gn-api-sdk-python | examples/update_subscription_metadata.py | Python | mit | 325 |
# -*- coding utf-8 -*-
from linked_list import LinkedList
class Stack(object):
def __init__(self, input=None):
self._linked_list = LinkedList(input)
def pop(self):
"""pops the vlaue of the top of the stack"""
return self._linked_list.pop()
def push(self, val):
"""pushes ... | crashtack/code-katas | src/stack.py | Python | mit | 511 |
'''
battery.py: part of expfactory package
Functions to generate batteries
'''
from expfactory.vm import custom_battery_download, get_jspsych_init, get_stylejs
from expfactory.experiment import get_experiments, load_experiment
from expfactory.utils import copy_directory, get_template, \
sub_template, get_installd... | vsoch/expfactory-python | expfactory/battery.py | Python | mit | 18,863 |
import hashlib
from django.contrib.auth.models import Group
from django.db import models
USER_MODEL = 'auth.User'
class Organization( Group ):
'''
Umbrella object with which users are associated.
An organization can have multiple users.
'''
gravatar = models.EmailField( blank=True )
... | DHLabs/keep | keep_backend/organizations/models.py | Python | mit | 2,600 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/mission/quest_item/shared_surlin_rolei_q1_recruitment_disk.iff"
res... | anhstudios/swganh | data/scripts/templates/object/tangible/mission/quest_item/shared_surlin_rolei_q1_recruitment_disk.py | Python | mit | 511 |
#! /usr/bin/env python
import json
import sys
sys.path.append('..')
from CodewebsIndexClient import CodewebsIndexClient
def loadTextFile(fname):
with open(fname) as fid:
return fid.read()
def wrap(ast,code,map,codeblockid):
astjson = json.loads(ast)
wrappedJSON = {'ast': astjson,
... | tanonev/codewebs | src/analogyFinder/src/daemons/example/exampleclient.py | Python | mit | 1,439 |
# -*- coding: utf-8 -*-
# OBS! Dårlig kodingstil! For eksempel, kommentarer skal høre til funksjoner og være mellom '''disse'''
from sm import SM
import sys
class River(SM):
river_db = [] # En klønete måte å definere database på, bør være i egen klasse og kanskje ikke en liste?
# Blir kalt hve... | Mathih13/IS-105_2016_Gruppe-5 | Uke-15-ICA-9/ICA-8-Python/Model/river.py | Python | mit | 16,055 |
# -*- coding: utf-8 -*-
import os
import sys
import re
import shutil
#1.24.4.6387
PayloadProc = 0x0045DCC8
###############################################################
carsh_re = re.compile(r"\={78}[\s\S]*\-{78}")
war3_version_re = re.compile(r"Warcraft\ III\ \(build\ (?P<VERSION>[0-9]*)\)")
map_path_re = re.comp... | actboy168/war3-parsecarsh | parse_carsh.py | Python | mit | 16,382 |
from flask import Blueprint, request
from aleph.core import db
from aleph.model import Alert
from aleph.search import DatabaseQueryResult
from aleph.views.serializers import AlertSerializer
from aleph.views.util import require, obj_or_404
from aleph.views.util import parse_request
from aleph.views.context import tag_r... | pudo/aleph | aleph/views/alerts_api.py | Python | mit | 3,323 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/medicine/shared_stimpack_sm_s1.iff"
result.attribute_template_id = ... | obi-two/Rebelion | data/scripts/templates/object/tangible/medicine/shared_stimpack_sm_s1.py | Python | mit | 454 |
from worldengine.simulations.basic import find_threshold_f
import numpy
class HumiditySimulation(object):
@staticmethod
def is_applicable(world):
return world.has_precipitations() and world.has_irrigation() and (
not world.has_humidity())
def execute(self, world, seed):
assert... | MM1nd/worldengine | worldengine/simulations/humidity.py | Python | mit | 1,502 |
#ImportModules
import ShareYourSystem as SYS
#define
MyTeamDict=SYS.Teamer.TeamDict([('a',1),('b',2)])
#print
print('MyTeamDict is ')
SYS._print(MyTeamDict)
#get
print(MyTeamDict.getValue(0))
print(MyTeamDict.getValue(1))
| Ledoux/ShareYourSystem | Pythonlogy/build/lib/ShareYourSystem/Standards/Itemizers/Teamer/09_ExampleDoc.py | Python | mit | 228 |
from scapy.all import *
import os
import sys
import threading
interface = "en1"
target_ip = "172.16.1.71"
gateway_ip = "172.16.1.254"
packet_count = 1000
poisoning = True
def restore_target(gateway_ip,gateway_mac,target_ip,target_mac):
# slightly different method using send
print "[*] Rest... | vdrey/Toolbox | Python/BHP/BHP-Code/BHP-Code/Chapter4/arper.py | Python | mit | 2,682 |
############################################################################
# Generic script applicable on any Operating Environments (Unix, Windows)
# ScriptName : wls_reset.py
# Properties : weblogic.properties
# Author : Kevin Yuan
#############################################################... | bfg-repo-cleaner-demos/eclipselink.runtime-bfg-strip-big-blobs | jpa/eclipselink.jpa.test/resource/weblogic/wls_composite_reset.py | Python | epl-1.0 | 998 |
#!/usr/bin/env python
# B a r a K u d a
#
# L. Brodeau, 2017]
import sys
import numpy as nmp
from PIL import Image
import string
import os
from netCDF4 import Dataset
narg = len(sys.argv)
if narg != 2:
print 'Usage: '+sys.argv[0]+' <mesh_mask>'; sys.exit(0)
cf_mm = sys.argv[1]
cf_bmp = string.repl... | brodeau/barakuda | python/exec/orca_mesh_mask_to_bitmap.py | Python | gpl-2.0 | 842 |
import ast
import os
import sys
# Import a minimal set of stdlib modules needed for list_stdlib_modules()
# to work when run from a virtualenv. The modules were chosen empirically
# so that the return value matches the return value without virtualenv.
import BaseHTTPServer
import zlib
def dotted_name_of_path(path, t... | hekra01/mercurial | contrib/import-checker.py | Python | gpl-2.0 | 8,337 |
# -*- coding: utf-8 -*-
#
from jms_storage.es import ESStorage
from .base import CommandBase
from .models import AbstractSessionCommand
class CommandStore(ESStorage, CommandBase):
def __init__(self, params):
super().__init__(params)
def filter(self, date_from=None, date_to=None,
user=... | eli261/jumpserver | apps/terminal/backends/command/es.py | Python | gpl-2.0 | 734 |
#!/usr/bin/env python
#
# Read the memory pak's 32k SRAM to a binary file specified on the command line.
#
# --Micah Dowty <micah@navi.cx>
#
from bus import Bus
import sys
b = Bus()
if b.probe() != "memory":
sys.exit(1)
f = open(sys.argv[1], "wb")
addr = 0x0000
while addr < 0x8000:
sys.stdout.write("\r0x%04... | MathewWi/cube64-dx | notes/read-sram.py | Python | gpl-2.0 | 447 |
# This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | mitya57/debian-buildbot | buildbot/db/connector.py | Python | gpl-2.0 | 5,291 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import uuid
class Migration(migrations.Migration):
dependencies = [
('authors', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='profile',
n... | CMPUT410W15T02/CMPUT410W15-project | social_distribution/authors/migrations/0002_auto_20150301_2125.py | Python | gpl-2.0 | 857 |
# This file is part of Invenio.
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
# 2013, 2014, 2015 CERN.
#
# Invenio 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 versio... | nharraud/invenio | invenio/legacy/webstyle/templates.py | Python | gpl-2.0 | 27,002 |
# -*- coding: utf-8 -*-
"""
***************************************************************************
gdal2xyz.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
**************... | luca76/QGIS | python/plugins/processing/algs/gdal/gdal2xyz.py | Python | gpl-2.0 | 2,687 |
#This is a function containing an algorithmic model of the Scribner log rule,
# board-foot log volume tables. It outputs the Scribner log volume for an
# input log length and top diameter.
#
# Annotation: [v]=logvolume(L,TD)
# v = Scribner log volume
# L = log length
# ... | dhazel/buck | bucking/logvolume_2.py | Python | gpl-2.0 | 2,031 |
# Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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; eithe... | debugger06/MiroX | osx/build/bdist.macosx-10.5-fat/lib.macosx-10.5-fat-2.7/miro/importmedia.py | Python | gpl-2.0 | 4,213 |
"""
Siren protocol adapter. See `SIREN specification <https://github.com/kevinswiber/siren>`_.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from ripozo.adapters import AdapterBase
from ripozo.utilities import t... | vertical-knowledge/ripozo | ripozo/adapters/siren.py | Python | gpl-2.0 | 6,055 |
# -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | marmyshev/item_title | openlp/plugins/songs/forms/songmaintenanceform.py | Python | gpl-2.0 | 24,170 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-15 15:28
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('silo', '0029_auto_20170915_0810'),
]
operations = ... | mercycorps/TolaTables | silo/migrations/0030_auto_20170915_0828.py | Python | gpl-2.0 | 1,103 |
#! /usr/bin/env python
# _*_ coding: UTF-8 _*_
# File : 50-problem.py
# Created : Sat 11 Apr 2015 20:57:18
# Last Modified : Sat 18 Apr 2015 22:21:45
# Maintainer : sharlatan, <sharlatanus@gmail.com>
# Title : CONSECUTIVE PRIME SUM
# License : Same as Python (GPL)
# Credits :... | Hellseher/ProjectEuler | src/pe_python/pe_050_problem.py | Python | gpl-2.0 | 2,384 |
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2011 Michael Wiencek
#
# 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 Licens... | Freso/picard | picard/ui/edittagdialog.py | Python | gpl-2.0 | 7,337 |
#!/usr/bin/python
#encoding=utf-8
englisch_deutsch_dict = {"hello": "hallo", "world": "welt", "good bye": "auf wiedersehen"}
deutsch_englisch_dict = dict()
for key, value in englisch_deutsch_dict.items():
deutsch_englisch_dict[value] = key
print deutsch_englisch_dict
| gkabbe/Python-Kurs2015 | Lösungen/Woche2/deutsch_englisch_dict.py | Python | gpl-2.0 | 279 |
import cgi
from paste.urlparser import PkgResourcesParser
from pylons import request
from pylons.controllers.util import forward
from pylons.middleware import error_document_template
from webhelpers.html.builder import literal
from pyroscope.lib.base import BaseController
class ErrorController(BaseController):
... | Rudde/pyroscope | pyroscope/pyroscope/controllers/error.py | Python | gpl-2.0 | 1,655 |
#
# QAPI event generator
#
# Copyright (c) 2014 Wenchao Xia
# Copyright (c) 2015-2016 Red Hat Inc.
#
# Authors:
# Wenchao Xia <wenchaoqemu@gmail.com>
# Markus Armbruster <armbru@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2.
# See the COPYING file in the top-level directory.
from qa... | afaerber/qemu-cpu | scripts/qapi-event.py | Python | gpl-2.0 | 5,197 |
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/WebKit/Tools/Scripts/webkitpy/common/system/executive_mock.py | Python | gpl-3.0 | 7,994 |
from pathod import log
from netlib.exceptions import TcpDisconnect
import six
class DummyIO(six.StringIO):
def start_log(self, *args, **kwargs):
pass
def get_log(self, *args, **kwargs):
return ""
def test_disconnect():
outf = DummyIO()
rw = DummyIO()
l = log.... | x2Ident/x2Ident_test | mitmproxy/test/pathod/test_log.py | Python | gpl-3.0 | 507 |
# -*- coding: utf-8 -*-
#
# Copyright © 2012 The Spyder development team
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
import optparse
def get_options():
"""
Convert options into commands
return commands, message
"""
parser = optparse.OptionParser(usage="s... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/spyderlib/cli_options.py | Python | gpl-3.0 | 2,217 |
import sys
import time
import numpy as np
from sparkle.QtWrapper.QtGui import QApplication
from sparkle.gui.plotting.protocoldisplay import ProtocolDisplay
from test.sample import samplewav
PAUSE = 0
class TestProtocolDisplay():
def setUp(self):
self.t = np.arange(200)
def data_func(self, f):... | portfors-lab/sparkle | test/tests/gui/plotting/test_protocol_display.py | Python | gpl-3.0 | 3,063 |
from nose.tools import assert_equal
import test.sample as sample
from sparkle.stim.types import get_stimuli_models
class TestStimuliTypes():
def setUp(self):
stimuli_classes = get_stimuli_models()
self.stimuli = []
for stimclass in stimuli_classes:
if stimclass.protocol:
... | Joel-U/sparkle | test/tests/unit/stim/types/test_stimuli_classes.py | Python | gpl-3.0 | 1,693 |
import wx
from service.fit import Fit
import gui.mainFrame
from gui import globalEvents as GE
from .calc.fitRemoveBooster import FitRemoveBoosterCommand
class GuiRemoveBoosterCommand(wx.Command):
def __init__(self, fitID, position):
wx.Command.__init__(self, True, "")
self.mainFrame = gui.mainFra... | blitzmann/Pyfa | gui/fitCommands/guiRemoveBooster.py | Python | gpl-3.0 | 1,009 |
#
# LCRS Copyright (C) 2009-2011
# - Rene Jensen
# - Michael Wojciechowski
# - Benjamin Bach
#
# LCRS 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 ... | fairdk/lcrs2 | lcrs/master/dhcp/utils.py | Python | gpl-3.0 | 1,554 |
#!/usr/bin/env python3
import cv2 | tectronics/pipal | face.py | Python | gpl-3.0 | 34 |
# -*- test-case-name: twisted.web.test.test_xml -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
"""Some fairly inadequate testcases for Twisted XML support."""
from __future__ import nested_scopes
from twisted.trial.unittest import TestCase
from twisted.web import sux
fro... | kenorb/BitTorrent | twisted/web/test/test_xml.py | Python | gpl-3.0 | 23,878 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Tawhiri documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 10 23:05:18 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... | cuspaceflight/tawhiri | docs/conf.py | Python | gpl-3.0 | 9,512 |
#!/usr/bin/python
''' Python API for YouTube
Copyright (C) 2013 nagev
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 License, or
(at your option) any la... | sadolit/pafy | pafy.py | Python | gpl-3.0 | 8,660 |
../../../../../share/pyshared/twisted/internet/glib2reactor.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/twisted/internet/glib2reactor.py | Python | gpl-3.0 | 62 |
"""
class to test Search.py
follows the standards in https://docs.python.org/2/library/unittest.html
"""
import unittest
from LOTlib.Examples.Number.Run import *
class SearchTest(unittest.TestCase):
# initialization that happens before each test is carried out
def setUp(self):
pass
# functio... | ebigelow/LOTlib | LOTlib/Testing/old/Examples/Number/SearchTest.py | Python | gpl-3.0 | 461 |
# coding: utf-8
from rpy2.robjects import conversion
from rpy2.robjects import r
from rpy2.robjects import pandas2ri
from rpy2.robjects import default_converter
from rpy2.robjects.conversion import localconverter
from rpy2.rinterface import rternalize, StrSexpVector
from rpy2.robjects import globalenv
import pandas as... | niamoto/niamoto-core | niamoto/data_publishers/r_data_publisher.py | Python | gpl-3.0 | 4,420 |
# 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/examples/singlepop_exponential_distribution.py | Python | gpl-3.0 | 2,322 |
# ####################### BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights ... | insiderr/insiderr-app | app/modules/requests/packages/chardet/big5prober.py | Python | gpl-3.0 | 1,685 |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 13 18:27:10 2018
@author: schwarz
"""
import unittest
import numpy as np
import cmath
from blond.input_parameters.ring import Ring
from blond.input_parameters.rf_parameters import RFStation
from blond.beam.beam import Beam, Proton
from blond.beam.distributions import bi... | blond-admin/BLonD | unittests/llrf/test_beam_feedback.py | Python | gpl-3.0 | 8,713 |
from pydare import DareSolver
import numpy
import unittest
class DareTestCase(unittest.TestCase):
def testIterative(self):
a = numpy.matrix([[0.0,0.1,0.0],\
[0.0,0.0,0.1],\
[0.0,0.0,0.0]])
b = numpy.matrix([[1.0,0.0], \
[0.0,0.0], \
[0.0,1.0]])
... | cchamanEE/pydare | test/daretest.py | Python | gpl-3.0 | 2,371 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2018-10-26 01:35
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('pttrack', '0006_referral_additional_fiel... | SaturdayNeighborhoodHealthClinic/osler | referral/migrations/0001_initial.py | Python | gpl-3.0 | 5,790 |
import time
from ecl.util.util import ThreadPool
from ecl.util.util.thread_pool import Task
from tests import EclTest
class ThreadPoolTest(EclTest):
def sleepTask(self, *args, **kwargs):
time.sleep(args[0])
def numberer(self, index, result):
result[index] = True
def test_pool_creation(... | Statoil/libecl | python/tests/util_tests/test_thread_pool.py | Python | gpl-3.0 | 2,274 |
import alias as al
import copy
def labelling_semi_stable(af):
potential_semi_stables = []
def find_semi_stables(L):
for Ldash in potential_semi_stables:
if Ldash.undecargs <= L.undecargs:
return
illegal = False
for arg in L.inargs:
if L.framewor... | alias-org/alias | alias/semantics/labellings/labelling_semi_stable.py | Python | gpl-3.0 | 1,160 |
def Send_Certified_By_Automation():
import smtplib
from elan import ElanSettings
import os
from elan.ElanSettings import Script_Runner_Log
def send_email(subject,
body,
user='kennyshay123test@gmail.com',
pwd='corebrands123',
... | kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/elan/Certified_Build.py | Python | gpl-3.0 | 2,028 |
#!/usr/bin/env python3
import fileinput
import string
import sys
DELETE = ''
REPLACE = {'“': '``',
'”': '\'\'',
'’': '\'',
'\\': '\\textbackslash ',
'*': '\\textasteriskcentered ',
'_': '\\_',
'#': '\\#',
'$': '\\$',
'%': '\\%',
... | st3f4n/latex-sanitizer | sanitize.py | Python | gpl-3.0 | 1,706 |
#!/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... | dataxu/ansible-modules-core | network/eos/eos_command.py | Python | gpl-3.0 | 5,314 |
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | shtrom/gtg | GTG/core/plugins/api.py | Python | gpl-3.0 | 8,572 |
from django.conf import settings
from django.core.exceptions import ValidationError
from django.forms import ModelForm
from django.forms.widgets import HiddenInput, TextInput, Select, CheckboxInput
from alert.userHandling.models import Alert
class CreateAlertForm(ModelForm):
def __init__(self, *args, **kwargs):
... | shashi792/courtlistener | alert/alerts/forms.py | Python | agpl-3.0 | 1,815 |
# The contents of this file are subject to the Mozilla Public License
# (MPL) Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# b... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/lepl/matchers/combine.py | Python | agpl-3.0 | 16,464 |
"""
End to end test of the internal reporting user table loading task.
"""
import os
import logging
import datetime
import pandas
from luigi.date_interval import Date
from edx.analytics.tasks.tests.acceptance import AcceptanceTestCase
from edx.analytics.tasks.url import url_path_join
log = logging.getLogger(__nam... | sssllliang/edx-analytics-pipeline | edx/analytics/tasks/tests/acceptance/test_internal_reporting_user.py | Python | agpl-3.0 | 2,665 |
# -*- coding: utf-8 -*-
import re
import random
from stdPlugin import stdPlugin
# Universal quantifier on a sequence.
def forall(sequence, predicate):
return reduce(lambda x, y: x and y, map(predicate, sequence), True)
class karma(stdPlugin):
u'''Chaque terme suivi de '++' ou '--' se voit attribuer un kar... | gordonzola/naobot | plugins/karma.py | Python | agpl-3.0 | 6,939 |
# -*- coding: utf-8 -*-
import time
from openerp import api, models
import datetime
class ReportSampleReceivedvsReported(models.AbstractModel):
_name = 'report.olims.report_sample_received_vs_reported'
def _get_samples(self, samples):
datalines = {}
footlines = {}
total_received_coun... | sciCloud/OLiMS | report/olims_sample_received_vs_reported.py | Python | agpl-3.0 | 4,408 |
"""Health Check API
Use to check system status, will report "green" or "red" for each component
plus overall for "status"::
{
"status": "green",
"celery": "green",
"elastic": "green",
"mongo": "green",
"redis": "green"
}
"""
import logging
import superdesk
from typin... | petrjasek/superdesk-core | superdesk/system/health.py | Python | agpl-3.0 | 1,753 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from copy i... | amagdas/superdesk | server/apps/tasks.py | Python | agpl-3.0 | 11,278 |
# -*- coding: utf-8 -*-
import os
import urllib2
import hashlib
from urllib2 import HTTPError
class HttpFetcher(object):
cache_dir = None
def set_cache_dir(self, dir):
self.cache_dir = dir
def _create_path_for_file(self, fname):
dirname = os.path.dirname(fname)
if not os.path.exis... | kansanmuisti/datavaalit | web/utils/http.py | Python | agpl-3.0 | 1,709 |
# encoding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility ... | antoine-de/navitia | source/jormungandr/jormungandr/parking_space_availability/car/star.py | Python | agpl-3.0 | 4,893 |
"""
Clio
Mnemosyne Client Library
ThreatStream 2014
"""
import pymongo
from dateutil.parser import parse as parse_date
from collections import Counter
from bson import ObjectId, son
import json
import datetime
class Clio():
"""
Main interface for Clio - Mnemosyne Client Library -
Usage:
clio = Clio... | Antelox/mhn | server/mhn/common/clio.py | Python | lgpl-2.1 | 16,259 |
import avango
import avango.script
import avango.gua.skelanim
from examples_common.GuaVE import GuaVE
import examples_common.navigator
from avango.gua.skelanim.CharacterControl import CharacterControl
from avango.gua.skelanim.AnimationControl import AnimationConfig
### CAMERA CONTROL VIA XBOX CONTROLLER:
def camera_c... | yaroslav-tarasov/avango | avango-skelanim/examples/skeletal_character_control/main_animation_config.py | Python | lgpl-3.0 | 13,239 |
# -*- coding: UTF-8 -*-
try:
import unittest2 as unittest
except:
import unittest
from args import ARGS
import oerplib
class TestInspect(unittest.TestCase):
def setUp(self):
self.oerp = oerplib.OERP(
ARGS.server, protocol=ARGS.protocol, port=ARGS.port,
version=ARGS.vers... | etsinko/oerplib | tests/test_inspect.py | Python | lgpl-3.0 | 3,308 |
from ase.ga.startgenerator import StartGenerator
from ase.ga.utilities import closest_distances_generator, atoms_too_close
from ase.ga.cutandsplicepairing import CutAndSplicePairing
import numpy as np
from ase.lattice.surface import fcc111
from ase.constraints import FixAtoms
# first create two random starting candida... | suttond/MODOI | ase/test/ga/cutandsplicepairing.py | Python | lgpl-3.0 | 1,963 |
# ===============================================================================
# Copyright 2016 ross
#
# 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/LICE... | USGSDenverPychron/pychron | pychron/igsn/definitions.py | Python | apache-2.0 | 3,973 |
"""
Test case for iperf example.
This test case might have problem running on windows:
1. direct use of `make`
2. use `sudo killall iperf` to force kill iperf, didn't implement windows version
The test env Example_ShieldBox do need the following config::
Example_ShieldBox:
ap_list:
- ssid: "ssid"
... | mashaoze/esp-idf | examples/wifi/iperf/iperf_test.py | Python | apache-2.0 | 26,855 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | luotao1/Paddle | python/paddle/regularizer.py | Python | apache-2.0 | 5,630 |
# Copyright (c) 2015 Hewlett-Packard Co.
# 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... | mahak/neutron | neutron/ipam/subnet_alloc.py | Python | apache-2.0 | 18,935 |
# Copyright 2015, A10 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 law or agre... | hthompson6/a10-neutron-lbaas | a10_neutron_lbaas/v2/wrapper_certmgr.py | Python | apache-2.0 | 2,706 |
"""Support for Satel Integra zone states- represented as binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import (
CONF_OUTPUTS, CONF_ZONE_NAM... | nugget/home-assistant | homeassistant/components/satel_integra/binary_sensor.py | Python | apache-2.0 | 3,430 |
"""Local Media Source Implementation."""
from __future__ import annotations
import mimetypes
from pathlib import Path
from aiohttp import web
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.media_player.const import MEDIA_CLASS_DIRECTORY
from homeassistant.components.media_p... | mezz64/home-assistant | homeassistant/components/media_source/local_source.py | Python | apache-2.0 | 7,330 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 ... | dsiddharth/access-keys | keystone/contrib/kds/cli/manage.py | Python | apache-2.0 | 1,896 |
#!/usr/bin/env python3
# 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
# "... | zhreshold/mxnet | example/extensions/lib_custom_op/test_relu.py | Python | apache-2.0 | 2,798 |
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012 Cloudscaling Group, Inc.
# All Rights Reserved.
#
# Licens... | magic0704/oslo.db | oslo_db/sqlalchemy/models.py | Python | apache-2.0 | 4,841 |
# Copyright (c) 2012 OpenStack Foundation
# Copyright (c) 2012 Cloudscaling
# 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/l... | cloudbase/nova-virtualbox | nova/scheduler/filters/aggregate_instance_extra_specs.py | Python | apache-2.0 | 3,001 |
## @package cnn
# Module caffe2.python.cnn
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import brew
from caffe2.python.model_helper import ModelHelper
from caffe2.proto import caffe2_pb2
import lo... | xzturn/caffe2 | caffe2/python/cnn.py | Python | apache-2.0 | 7,639 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2021 NVIDIA Corporation. 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://ww... | luotao1/Paddle | python/paddle/jit/__init__.py | Python | apache-2.0 | 1,478 |
# # ===============================================================================
# # Copyright 2015 Jake Ross
# #
# # 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.apa... | USGSDenverPychron/pychron | pychron/updater/branch_view.py | Python | apache-2.0 | 2,723 |
# Copyright 2017 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... | apark263/tensorflow | tensorflow/compiler/tests/image_ops_test.py | Python | apache-2.0 | 38,279 |
# Copyright 2014 Open Source Robotics Foundation, 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... | iwanders/catkin_tools | catkin_tools/verbs/catkin_create/cli.py | Python | apache-2.0 | 6,417 |
# Copyright 2014: 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 b... | varunarya10/rally | rally/benchmark/processing/plot.py | Python | apache-2.0 | 11,681 |
import logging
import uuid
import pytest
import requests
import test_helpers
from dcos_test_utils import marathon
__maintainer__ = 'kensipe'
__contact__ = 'orchestration-team@mesosphere.io'
log = logging.getLogger(__name__)
def deploy_test_app_and_check(dcos_api_session, app: dict, test_uuid: str):
"""This me... | GoelDeepak/dcos | packages/dcos-integration-test/extra/test_applications.py | Python | apache-2.0 | 11,244 |
import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
import common.common_pb2 as common_dot_common__pb2
import orderer.ab_pb2 as orderer_dot_ab__pb2
import common.common_pb2 as common_dot_common__pb2
import orderer.ab_pb2 as orderer_dot_ab__pb... | rameshbabu79/fabric | bddtests/orderer/ab_pb2_grpc.py | Python | apache-2.0 | 2,507 |
# Copyright 2019 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... | mlperf/training_results_v0.7 | Google/benchmarks/resnet/implementations/resnet-cloud-TF2.0-tpu-v3-32/tf2_common/modeling/activations/swish.py | Python | apache-2.0 | 2,452 |