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 |
|---|---|---|---|---|---|
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | djkonro/client-python | kubernetes/client/models/v1_container_state_waiting.py | Python | apache-2.0 | 3,830 |
"""Support for RainMachine devices."""
import asyncio
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT
from homeassistant.const import (
ATTR_ATTRIBUTION, CONF_BINARY_SENSORS, CONF_IP_ADDRESS, CONF_PASSWORD,
CONF_PORT, CONF_SCAN_INTE... | DavidLP/home-assistant | homeassistant/components/rainmachine/__init__.py | Python | apache-2.0 | 14,628 |
# (c) Copyright [2015] Hewlett Packard Enterprise Development LP
#
# 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... | hpe-storage/horizon-hpe-storage-ui | horizon_hpe_storage/storage_panel/overview/tables.py | Python | apache-2.0 | 850 |
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
import unittest
import itertools
from streamsx.topology.topology import *
def f42():
pass
class cool_source(object):
def __init__(self):
pass
def __call__(self):
return []
class cool_class(object):
def __init__(self):
... | IBMStreams/streamsx.topology | test/python/topology/test_names.py | Python | apache-2.0 | 4,606 |
from a10sdk.common.A10BaseClass import A10BaseClass
class Wsdl(A10BaseClass):
""" :param action: {"optional": true, "enum": ["create", "import", "export", "copy", "rename", "check", "replace", "delete"], "type": "string", "description": "'create': create; 'import': import; 'export': export; 'copy': copy; ... | amwelch/a10sdk-python | a10sdk/core/A10_file/file_wsdl.py | Python | apache-2.0 | 1,901 |
from requests.auth import AuthBase
import hmac
import base64
import hashlib
import urlparse
import urllib
#add your custom auth handler class to this module
class MyCustomAuth(AuthBase):
def __init__(self,**args):
# setup any auth-related data here
#self.username = args['username']
#self.p... | d4rt/SplunkModularInputsPythonFramework | implementations/rest/bin/authhandlers.py | Python | apache-2.0 | 1,678 |
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
# Python
import logging
# Django
from django.db import transaction
from django.utils.dateparse import parse_datetime
def cleanup_deleted(apps, schema_editor):
logger = logging.getLogger('awx.main.migrations.cleanup_deleted')
def cleanup_model(model):... | wwitzel3/awx | awx/main/migrations/_cleanup_deleted.py | Python | apache-2.0 | 3,184 |
#!/usr/bin/python
import requests
import time, Cookie
# Instantiate a SimpleCookie object
cookie = Cookie.SimpleCookie()
# The SimpleCookie instance is a mapping
cookie['lastvisit'] = str(time.time())
s = requests.session()
s.cookies.clear()
# Output the HTTP message containing the cookie
print cookie
print 'C... | 5610110083/Safety-in-residential-project | cgi-bin/any/setCookies.py | Python | apache-2.0 | 447 |
from xml.sax import ContentHandler, parse
class XmlHandler(ContentHandler):
def __init__(self):
self.chars = [ ]
self.cells = [ ]
self.rows = [ ]
self.tables = [ ]
def characters(self, content):
self.chars.append(content)
def startElement(self, name, atts):
if name=="Cell":
self.chars = [ ]
el... | frederick623/HTI | cash_pb_report/bin/XmlHandler.py | Python | apache-2.0 | 798 |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems 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
#... | Jokeren/neon | examples/conv_autoencoder.py | Python | apache-2.0 | 3,219 |
import tensorflow as tf
import time
FLAGS = tf.app.flags.FLAGS
def add_train_var():
""" add all trainable variable to summary"""
for var in tf.trainable_variables():
tf.histogram_summary(var.op.name, var)
def add_loss(loss_scope = 'losses'):
""" add all losses to summary """
for l in tf.... | polltooh/traffic_video_analysis | nn_script/save_func.py | Python | apache-2.0 | 2,186 |
from a10sdk.common.A10BaseClass import A10BaseClass
class AddressList(A10BaseClass):
"""This class does not support CRUD Operations please use parent.
:param ipv4_address: {"type": "string", "description": "IP address", "format": "ipv4-address"}
:param ipv4_netmask: {"type": "string", "description":... | amwelch/a10sdk-python | a10sdk/core/interface/interface_loopback_ip.py | Python | apache-2.0 | 2,191 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
from pants.base.exceptions import TaskError
from pants.reporting.reporting_server import ReportingServerManager
from pants.task.task import QuietTaskMixin, Task
from pants.... | tdyas/pants | src/python/pants/core_tasks/reporting_server_run.py | Python | apache-2.0 | 2,593 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | stdweird/aquilon | lib/python2.6/aquilon/worker/anonwrappers.py | Python | apache-2.0 | 2,216 |
from a10sdk.common.A10BaseClass import A10BaseClass
class VlanGlobal(A10BaseClass):
"""Class Description::
Configure global options for vlan.
Class vlan-global supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param l3_vl... | amwelch/a10sdk-python | a10sdk/core/vlan/vlan_global.py | Python | apache-2.0 | 1,226 |
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2012,2013 Contributor
#
# 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 t... | stdweird/aquilon | lib/python2.6/aquilon/worker/formats/network_environment.py | Python | apache-2.0 | 1,413 |
"""
Device for Zigbee Home Automation.
For more details about this component, please refer to the documentation at
https://home-assistant.io/integrations/zha/
"""
import asyncio
from datetime import timedelta
from enum import Enum
import logging
import time
from zigpy import types
import zigpy.exceptions
from zigpy.p... | Teagan42/home-assistant | homeassistant/components/zha/core/device.py | Python | apache-2.0 | 22,089 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Cisco Systems, 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-... | Brocade-OpenSource/OpenStack-DNRM-Neutron | neutron/plugins/cisco/db/nexus_models_v2.py | Python | apache-2.0 | 1,756 |
#!/usr/bin/env python
# -*- Mode: Python; tab-width: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# vim:set ft=python ts=4 sw=4 sts=4 autoindent:
'''
Functionality for invoking tagging services.
Author: Pontus Stenetorp
Version: 2011-04-22
'''
from __future__ import with_statement
from httplib import HTTPCon... | wolfe-pack/moro | public/javascripts/brat/server/src/tag.py | Python | bsd-2-clause | 6,002 |
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
@pluginmatcher(re.compile(
r"https?://www\.cbsnews\.com/live/"
))
class CBSNews(Plugin):
_re_default_payload = re.compile(r"CBSNEWS.defaultPayload = (\{.*)")
... | amurzeau/streamlink-debian | src/streamlink/plugins/cbsnews.py | Python | bsd-2-clause | 1,008 |
from django.conf import settings
from django.db import migrations, models
import mapentity.models
import django.contrib.gis.db.models.fields
import django.db.models.deletion
import geotrek.common.mixins
import geotrek.authent.models
class Migration(migrations.Migration):
dependencies = [
('authent', '000... | GeotrekCE/Geotrek-admin | geotrek/core/migrations/0001_initial.py | Python | bsd-2-clause | 14,022 |
import rospy
rospy.init_node('hello_world')
rospy.loginfo('Hello World')
rospy.spin()
| ega1979/ros_book_programs | hello_world.py | Python | bsd-2-clause | 86 |
import logging
from tkp.accessors import CasaImage
logger = logging.getLogger(__name__)
class AartfaacCasaImage(CasaImage):
def __init__(self, url, plane=0, beam=None):
super(AartfaacCasaImage, self).__init__(url, plane=0, beam=None)
self.taustart_ts = self.parse_taustartts()
self.teles... | bartscheers/tkp | tkp/accessors/aartfaaccasaimage.py | Python | bsd-2-clause | 1,347 |
# Generated by Django 2.2.2 on 2019-06-07 06:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("example", "0006_auto_20181228_0752"),
]
operations = [
migrations.AddField(
model_name="artproject",
name="descripti... | django-json-api/rest_framework_ember | example/migrations/0007_artproject_description.py | Python | bsd-2-clause | 405 |
import os.path
import sys
# This is copied from mytardis.py in the project's root directory.
custom_settings = 'tardis.settings'
custom_settings_file = custom_settings.replace('.', '/') + '.py'
demo_settings = 'tardis.settings_changeme'
if os.path.isfile(custom_settings_file):
os.environ.setdefault("DJANGO_SETTI... | carlohamalainen/imagetrove | develop/djangosettings.py | Python | bsd-2-clause | 573 |
import simuvex
######################################
# __stack_chk_fail
######################################
class __stack_chk_fail(simuvex.SimProcedure):
NO_RET = True
def run(self, exit_code): #pylint:disable=unused-argument
return
| chubbymaggie/simuvex | simuvex/procedures/libc___so___6/__stack_chk_fail.py | Python | bsd-2-clause | 258 |
""" Various kinds of dialog and message box widgets. """
from __future__ import absolute_import
from ...properties import Bool, String, List, Instance, Either
from .widget import Widget
from .layouts import BaseBox, HBox
from .buttons import Button
class Dialog(Widget):
""" Simple dialog box with string message.... | htygithub/bokeh | bokeh/models/widgets/dialogs.py | Python | bsd-3-clause | 1,502 |
# Copyright (c) 2013-2014, Cornell University
# 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 ... | pombredanne/HyperDex | bindings/__init__.py | Python | bsd-3-clause | 22,251 |
import numpy as np
class BrooksCorey(object):
def __init__( self, lambd=0., alpha=0., sr=0.0, smoothing_interval=0. ):
self._lambda = lambd
self._alpha = alpha
self._sr = sr
self._pc0 = smoothing_interval
self._factor = -2.0 - (0.5 + 2.0) * self._lambda;
self._pc_bu... | amanzi/ats-dev | tools/python_models/wrm_brookscorey.py | Python | bsd-3-clause | 2,012 |
#!/usr/bin/python2.6
# -*- coding: utf8 -*-
"""
settings.py: Config des utilitaires pul_* permettant la consultation et l'edition des jobs en batch
"""
__author__ = "Jerome Samson"
__copyright__ = "Copyright 2013, Mikros Image"
class Settings(object):
# Global tools attributes
verbose = False
# Initial ... | mikrosimage/OpenRenderManagement | src/pulitools/puliquery/settings.py | Python | bsd-3-clause | 556 |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import *
import unittest
import datetime as pydt
import logging
imp... | shankari/e-mission-server | emission/tests/analysisTests/configTests/TestSaveAllConfigs.py | Python | bsd-3-clause | 4,255 |
# -*- test-case-name: twisted.names.test.test_dns -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
DNS protocol implementation.
Future Plans:
- Get rid of some toplevels, maybe.
"""
from __future__ import division, absolute_import
__all__ = [
'IEncodable', 'IRecord',
'A',... | biddisco/VTK | ThirdParty/Twisted/twisted/names/dns.py | Python | bsd-3-clause | 58,390 |
from __future__ import absolute_import
from django.conf.urls import url
from .endpoints.webhook import BitbucketWebhookEndpoint
urlpatterns = [
url(r"^organizations/(?P<organization_id>[^\/]+)/webhook/$", BitbucketWebhookEndpoint.as_view())
]
| beeftornado/sentry | src/sentry_plugins/bitbucket/urls.py | Python | bsd-3-clause | 250 |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/lib/textsplit.py
"""Helpers for text wrapping, hyphenation, Asian text splitting and kinsoku shori.
How to split a 'big word' depends on the la... | nickpack/reportlab | src/reportlab/lib/textsplit.py | Python | bsd-3-clause | 10,087 |
# -*- coding: utf-8 -*-
import urlparse
from selenium import webdriver
from django.test import TestCase
from django.conf import settings
class BackendsTest(TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
def tearDown(self):
self.driver.quit()
def url(self, path):
... | brianmckinneyrocks/django-social-auth | contrib/tests/test_core.py | Python | bsd-3-clause | 5,521 |
#!/usr/bin/env python
#
# ESP8266 ROM Bootloader Utility
# https://github.com/themadinventor/esptool
#
# Copyright (C) 2014 Fredrik Ahlberg
#
# 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; eith... | RGD2/swapforth | esp8266/esptool2.py | Python | bsd-3-clause | 30,932 |
"""Test functions for parsers.tm_parser"""
import os
import unittest
from ample import constants
from ample.parsers import tm_parser
class TestTMscore(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.thisd = os.path.abspath(os.path.dirname(__file__))
cls.ample_share = constants.SHARE_... | linucks/ample | ample/parsers/tests/test_tm_parser.py | Python | bsd-3-clause | 1,471 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Image processing tools.
"""
from unidecode import unidecode
from django.conf import settings
import StringIO
try:
from PIL import Image, ImageOps, ImageFilter
except ImportError:
import Image
import ImageOps
import os.path
import shutil
from PIL import Image... | BogusCurry/picup-it | picupwebapp/picupwebapp/picture/tools.py | Python | bsd-3-clause | 3,826 |
"""
JP-specific Form helpers
"""
from django.core import validators
from django.newforms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.newforms.fields import RegexField, Select
class JPPostalCodeField(RegexField):
"""
A form field that validates its input is a Japa... | paulsmith/geodjango | django/contrib/localflavor/jp/forms.py | Python | bsd-3-clause | 1,252 |
from datetime import timedelta as td
from django.utils import timezone
from hc.api.models import Check
from hc.test import BaseTestCase
class UpdateTimeoutTestCase(BaseTestCase):
def setUp(self):
super().setUp()
self.check = Check(project=self.project, status="up")
self.check.last_ping = ... | healthchecks/healthchecks | hc/front/tests/test_update_timeout.py | Python | bsd-3-clause | 7,228 |
##########################################################################
#
# Copyright (c) 2007-2011, Image Engine Design 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:
#
# * Redis... | appleseedhq/cortex | test/IECore/Object.py | Python | bsd-3-clause | 6,383 |
import contextlib
import os
import shutil
import sys
import rostest
@contextlib.contextmanager
def ros_coverage():
"""
https://github.com/ros/ros_comm/issues/558
"""
coverage_mode = '--cov' in sys.argv
if coverage_mode:
sys.argv.remove('--cov')
src = os.path.join(os.path.dirname(o... | mayfieldrobotics/ros-webrtc | test/integration/ros_coverage.py | Python | bsd-3-clause | 652 |
from django.conf import settings
from django.test import TestCase, override_settings
from freezegun import freeze_time
from adyen.gateway import MissingFieldException
from adyen.scaffold import Scaffold
TEST_RETURN_URL = 'https://www.example.com/checkout/return/adyen/'
EXPECTED_FIELDS_LIST = [
{'type': 'hidden',... | oscaro/django-oscar-adyen | tests/test_requests.py | Python | bsd-3-clause | 3,128 |
import pytest
import sqlalchemy as sa
from sqlalchemy_utils import get_columns
@pytest.fixture
def Building(Base):
class Building(Base):
__tablename__ = 'building'
id = sa.Column('_id', sa.Integer, primary_key=True)
name = sa.Column('_name', sa.Unicode(255))
return Building
class Te... | konstantinoskostis/sqlalchemy-utils | tests/functions/test_get_columns.py | Python | bsd-3-clause | 1,840 |
from __future__ import absolute_import, unicode_literals
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.auth.models import User, Permission
from django.contrib.contenttypes.models import ContentType
from django.test imp... | mammique/django | tests/regressiontests/admin_inlines/tests.py | Python | bsd-3-clause | 32,499 |
#!/usr/bin/env python3
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
"""This module provides shared functionality for systems to generate
Dart APIs from ... | dart-lang/sdk | tools/dom/scripts/generator.py | Python | bsd-3-clause | 84,809 |
from django.db import models
import phpserialize as php
import json
class StatsDictField(models.TextField):
description = 'A dictionary of counts stored as serialized php.'
__metaclass__ = models.SubfieldBase
def db_type(self, connection):
return 'text'
def to_python(self, value):
... | anaran/olympia | apps/stats/db.py | Python | bsd-3-clause | 1,314 |
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.distributed.DistributedObject import DistributedObject
class DistributedDistrict(DistributedObject):
notify = directNotify.newCategory('DistributedDistrict')
neverDisable = 1
def __init__(self, cr):
DistributedObject.__ini... | ToonTownInfiniteRepo/ToontownInfinite | otp/distributed/DistributedDistrict.py | Python | mit | 1,171 |
"""
Extension to ``htmlfill`` that can parse out schema-defining
statements.
You can either pass ``SchemaBuilder`` to ``htmlfill.render`` (the
``listen`` argument), or call ``parse_schema`` to just parse out a
``Schema`` object.
"""
from __future__ import absolute_import
from . import validators
from . import schema
... | formencode/formencode | src/formencode/htmlfill_schemabuilder.py | Python | mit | 3,632 |
# coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import os
import json
import collections
import warnings
from pymatgen.core.periodic_table import get_el_sp
"""
This class implements definitions for various ... | czhengsci/pymatgen | pymatgen/core/bonds.py | Python | mit | 4,331 |
from c_module.c_file import c_func
def b_func():
pass | bndr/pycycle | tests/_projects/large_without_circle/a_module/b_module/b_file.py | Python | mit | 58 |
import os
import sys
from string import *
import math
import string
import re
import commands
import operator
if len(sys.argv) < 2:
print "USAGE: python quantify_rRNA.py <gff file>"
sys.exit(0)
gffFile=sys.argv[1]
#rRNAgeneList=commands.getoutput("grep 'rRNA' "+gffFile+" |awk '{print $10}'").replace('"',''... | senthil10/scilifelab | scripts/RNA_analysis/quantify_rRNA.py | Python | mit | 1,425 |
import unittest
import time
from pyrox.http import RequestParser, ParserDelegate
NORMAL_REQUEST = """GET /test/12345?field=f1&field2=f2#fragment HTTP/1.1\r
Connection: keep-alive\r
Content-Length: 12\r\n
\r
This is test"""
def performance(duration=10, print_output=True):
parser = RequestParser(ParserDelegate()... | zinic/pyrox | tests/http/request_performance_test.py | Python | mit | 856 |
from __future__ import absolute_import
import sys
import unittest
import re
import os.path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..', '..'))
from .VirtualDeviceTest import VirtualDeviceTest
from Exscript.emulators import IOSEmulator
from Exscript.emulators.iosemu import iosbanner
class IO... | maximumG/exscript | tests/Exscript/emulators/IOSEmulatorTest.py | Python | mit | 1,094 |
# -*- coding: utf-8 -*-
'''
rauth.test_session
------------------
Test suite for rauth.session.
'''
from base import RauthTestCase
from rauth.session import OAuth1Session, OAuth2Session, OflySession
from mock import patch
import requests
import json
class RequestMixin(object):
def assert_ok(self,... | arifgursel/rauth | tests/test_session.py | Python | mit | 5,224 |
import pytest
from mitmproxy.test import tflow
from mitmproxy.test import taddons
from mitmproxy.addons import stickycookie
from mitmproxy.test import tutils as ntutils
def test_domain_match():
assert stickycookie.domain_match("www.google.com", ".google.com")
assert stickycookie.domain_match("google.com", "... | mosajjal/mitmproxy | test/mitmproxy/addons/test_stickycookie.py | Python | mit | 4,831 |
import string
from buffer import Buffer
from expr import *
SYMBOL_STARTS = set(string.ascii_lowercase + string.ascii_uppercase + '_')
SYMBOL_INNERS = SYMBOL_STARTS | set(string.digits)
NUMERAL = set(string.digits + '-.')
WHITESPACE = set(' \t\n\r')
DELIMITERS = set('(),:')
def tokenize(s):
"""Splits the string s... | tavaresdong/courses | ucb_cs61A/lab/lab10/reader.py | Python | mit | 3,571 |
## www.pubnub.com - PubNub Real-time push service in the cloud.
# coding=utf8
## PubNub Real-time Push APIs and Notifications Framework
## Copyright (c) 2010 Stephen Blum
## http://www.pubnub.com/
import sys
from pubnub import Pubnub
publish_key = len(sys.argv) > 1 and sys.argv[1] or 'pam'
subscribe_key = len(sys.a... | teddywing/pubnub-python | python/examples/cr.py | Python | mit | 2,698 |
'''
chop.py
Takes a list of input ingredient names. Chops each ingredient, and adds the
resulting model to the current blend or a new blend
Thomas Storey
2016
'''
import sys
import argparse
import bpy
import numpy as np
import os
import bmesh
from math import *
from mathutils import *
import random
def createMesh(... | thomasrstorey/recipesfordisaster | actions/dice.py | Python | mit | 9,680 |
"""
WSGI config for HealthNet project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | moiseslorap/RIT | Intro to Software Engineering/Release 2/HealthNet/HealthNet/wsgi.py | Python | mit | 395 |
# The MIT License (MIT)
# Copyright (c) 2015 kupiakos
# 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, me... | Shugabuga/LapisMirror | plugins/gifscom.py | Python | mit | 3,379 |
# encoding: utf-8
"""
Creates geometry objects from facets.
"""
from yade.wrapper import *
import utils,math,numpy
from minieigen import *
#facetBox===============================================================
def facetBox(center,extents,orientation=Quaternion((0,1,0),0.0),wallMask=63,**kw):
"""
Create arbitrari... | bcharlas/mytrunk | py/geom.py | Python | gpl-2.0 | 24,154 |
# #
# Copyright 2012-2015 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://vscentrum.be/nl/en),
# the Hercules foundation (ht... | pneerincx/easybuild-framework | easybuild/tools/parallelbuild.py | Python | gpl-2.0 | 8,870 |
# 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... | wainersm/buildbot | master/buildbot/data/builders.py | Python | gpl-2.0 | 4,882 |
import random
def markov_analysis( fname, n ):
"""Reads a text file and perfom Markov analysis.
Return a dictionary that maps from prefixes to a collection of suffixes.
fname: a text file
n: n order
"""
d = {}
prefix = tuple()
fin = open( fname )
for line in fin:
words = ... | JohnHwee/show-me-the-code | Python/0052/main.py | Python | gpl-2.0 | 1,327 |
import unittest
from test import test_support
# Skip this test if the _testcapi module isn't available.
test_support.import_module('_testcapi')
from _testcapi import _test_structmembersType, \
CHAR_MAX, CHAR_MIN, UCHAR_MAX, \
SHRT_MAX, SHRT_MIN, USHRT_MAX, \
INT_MAX, INT_MIN, UINT_MAX, \
LONG_... | j5shi/Thruster | pylibs/test/test_structmembers.py | Python | gpl-2.0 | 3,646 |
# coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Volcano Polygon on Population
Metadata Definitions.
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 ... | cchristelis/inasafe | safe/impact_functions/volcanic/volcano_polygon_population/metadata_definitions.py | Python | gpl-3.0 | 4,986 |
#!/usr/bin/env python3
# This file is part of the Minecraft Overviewer.
#
# Minecraft Overviewer 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 o... | enaut/Minecraft-Overviewer | overviewer.py | Python | gpl-3.0 | 29,543 |
# -*- coding: utf-8 -*-
# Copyright 2007-2021 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | erh3cq/hyperspy | hyperspy/tests/axes/test_conversion_units.py | Python | gpl-3.0 | 19,120 |
#!/usr/bin/python
import os
path = os.path.join(os.path.dirname(__file__), "../")
path = os.path.abspath(path)
regex = '-regex ".*\.[cChH]\(pp\)?"'
exclude = '-not -path "*/external/*" -not -name "*#*"'
cmd = 'find {p} {r} {e} -print | xargs etags '.format(p=path, e=exclude, r=regex)
print cmd
os.system(cmd)
| bailey-lab/graphSourceCode | scripts/etags.py | Python | gpl-3.0 | 316 |
#!/usr/bin/env python
from __future__ import print_function
import glob
import os
import re
import sys
from optparse import OptionParser
from param import (Library, Parameter, Vehicle, known_group_fields,
known_param_fields, required_param_fields, known_units)
from htmlemit import HtmlEmit
from rste... | gmorph/ardupilot | Tools/autotest/param_metadata/param_parse.py | Python | gpl-3.0 | 7,860 |
from __future__ import unicode_literals
import os
bind = "127.0.0.1:%(gunicorn_port)s"
workers = (os.sysconf("SC_NPROCESSORS_ONLN") * 2) + 1
loglevel = "error"
proc_name = "%(proj_name)s"
| motorialab/sicurskiweb | deploy/gunicorn.conf.py | Python | gpl-3.0 | 189 |
# -----------------
# lambdas
# -----------------
a = lambda: 3
#? int()
a()
x = []
a = lambda x: x
#? int()
a(0)
#? float()
(lambda x: x)(3.0)
arg_l = lambda x, y: y, x
#? float()
arg_l[0]('', 1.0)
#? list()
arg_l[1]
arg_l = lambda x, y: (y, x)
args = 1,""
result = arg_l(*args)
#? tuple()
result
#? str()
result[0]... | snakeleon/YouCompleteMe-x64 | third_party/ycmd/third_party/jedi_deps/jedi/test/completion/lambdas.py | Python | gpl-3.0 | 1,833 |
# byteplay - Python bytecode assembler/disassembler.
# Copyright (C) 2006-2010 Noam Yorav-Raphael
# Homepage: http://code.google.com/p/byteplay
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Found... | qbuat/rootpy | rootpy/extern/byteplay.py | Python | gpl-3.0 | 33,903 |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENSE:BSD$
## You may use this file ... | DevinDewitt/pyqt5 | examples/quick/models/objectlistmodel/objectlistmodel.py | Python | gpl-3.0 | 3,424 |
"""Adding a migration for the exploitability report.
Revision ID: 3a5471a358bf
Revises: 191d0453cc07
Create Date: 2013-10-25 07:07:33.968691
"""
# revision identifiers, used by Alembic.
revision = '3a5471a358bf'
down_revision = '4aacaea3eb48'
from alembic import op
from socorro.lib import citexttype, jsontype
from ... | adngdb/socorro | alembic/versions/3a5471a358bf_adding_a_migration_f.py | Python | mpl-2.0 | 1,624 |
# -*- coding: utf-8 -*-
""" License
Copyright (C) 2013 YunoHost
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | JocelynDelalande/moulinette-yunohost | lib/yunohost/hook.py | Python | agpl-3.0 | 10,947 |
"""
Email-marketing-related models.
"""
from config_models.models import ConfigurationModel
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@python_2_unicode_compatible
class EmailMarketingConfiguration(ConfigurationM... | eduNEXT/edunext-platform | lms/djangoapps/email_marketing/models.py | Python | agpl-3.0 | 5,191 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | wscullin/spack | var/spack/repos/builtin/packages/r-iterators/package.py | Python | lgpl-2.1 | 1,647 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 24 11:30:24 2013
@author: Sat Kumar Tomer
@email: satkumartomer@gmail.com
@website: www.ambhas.com
"""
import numpy as np
import h5py
import os
import datetime as dt
def extract_smc(h5_file, lat, lon):
"""
Extract Soil Moisture Content fro... | andreas-koukorinis/ambhas | ambhas/amsr2.py | Python | lgpl-2.1 | 3,408 |
#!/usr/bin/env python
'''
useful extra functions for use by mavlink clients
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
from math import *
def norm_heading(RAW_IMU, ATTITUDE, declination):
'''calculate heading from RAW_IMU and ATTITUDE'''
xmag = RAW_IMU.xmag
ymag = RAW_I... | meee1/pymavlink | mavextra.py | Python | lgpl-3.0 | 1,082 |
import clr
clr.AddReference("mscorlib")
clr.AddReference("PresentationFramework")
from System.Windows import Application
from System.IO import StreamReader
from System.Threading import Thread
from System.Windows.Markup import XamlReader
from System.Reflection import Assembly
from System import Action
class ViewModel:... | mrrodd/Samples | DLR-IronPython/IronPython.UI/Scripts/SampleScript02.py | Python | lgpl-3.0 | 1,026 |
import glob
import os
myPath = os.path.dirname(os.path.realpath(__file__))
for file in os.listdir(myPath):
tmp = file
if '.svg' in tmp:
tmp = tmp.replace('.',"")
tmp = tmp.replace('(',"")
tmp = tmp.replace(')',"")
tmp = tmp.replace("svg","")
tmp = tmp + '.svg'
os.rename(file,tmp)
| istvanszoke/softlab4 | docs/chapters/chapter04/removeSpecCharacters.py | Python | lgpl-3.0 | 300 |
#!/usr/bin/env python
#
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Author: Matthieu Huin <mhu@enovance.com>
#
# 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:/... | redhat-cip/edeploy | tools/grapher/models/basegraph.py | Python | apache-2.0 | 2,819 |
# Copyright (c) 2012-2016 Seafile Ltd.
import seahub.settings as settings
# OfficeOnlineServer, OnlyOffice, CollaboraOffice
OFFICE_SERVER_TYPE = getattr(settings, 'OFFICE_SERVER_TYPE', '')
OFFICE_WEB_APP_BASE_URL = getattr(settings, 'OFFICE_WEB_APP_BASE_URL', '')
WOPI_ACCESS_TOKEN_EXPIRATION = getattr(settings, 'WOPI... | miurahr/seahub | seahub/wopi/settings.py | Python | apache-2.0 | 1,424 |
import Tkinter
import Test
import Pmw
Test.initialise()
c = Pmw.CounterDialog
kw_1 = {
'counter_labelpos': 'n',
'counter_buttonaspect': 2.0,
'counter_autorepeat': 0,
'counter_initwait': 1000,
'counter_padx': 5,
'counter_pady': 5,
'counter_repeatrate': 20,
'label_text' : 'Counter:',
... | mhcrnl/PmwTkEx | src/Pmw/Pmw_1_3/tests/CounterDialog_test.py | Python | apache-2.0 | 2,577 |
#!/usr/bin/env python
# Copyright (c) 2016 Tigera, Inc. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | bcreane/calico | release-scripts/do_release.py | Python | apache-2.0 | 1,870 |
# 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
# "License"); you may not u... | Laurawly/tvm-1 | vta/python/vta/top/bitpack.py | Python | apache-2.0 | 2,886 |
# 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... | mixturemodel-flow/tensorflow | tensorflow/contrib/boosted_trees/python/utils/losses_test.py | Python | apache-2.0 | 3,957 |
from __future__ import print_function
import logging
import mock
import pytest
from faker import Factory
from website import settings as website_settings
from framework.celery_tasks import app as celery_app
logger = logging.getLogger(__name__)
# Silence some 3rd-party logging and some "loud" internal loggers
SILEN... | mattclark/osf.io | conftest.py | Python | apache-2.0 | 3,405 |
"""
Entrypoint for the buildroot update server
"""
import argparse
import asyncio
import logging
import logging.config
from . import (get_app, BR_BUILTIN_VERSION_FILE,
config, constants, name_management)
from aiohttp import web
LOG = logging.getLogger(__name__)
try:
# systemd journal is available,... | OpenTrons/opentrons-api | update-server/otupdate/buildroot/__main__.py | Python | apache-2.0 | 4,273 |
# Copyright 2016-2018 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | ARM-software/lisa | external/devlib/devlib/platform/gem5.py | Python | apache-2.0 | 12,624 |
# Copyright 2013 Yajie Miao Carnegie Mellon University
# 2015 Yun Wang Carnegie Mellon University
# 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... | jinserk/PyASR | pyasr/io_func/pickle_io.py | Python | apache-2.0 | 2,944 |
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | yanchen036/tensorflow | tensorflow/contrib/cudnn_rnn/python/kernel_tests/cudnn_rnn_test.py | Python | apache-2.0 | 57,239 |
# 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... | rabipanda/tensorflow | tensorflow/python/tools/saved_model_cli.py | Python | apache-2.0 | 29,293 |
# Copyright (c) 2015-2016 Tigera, 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 applicabl... | caseydavenport/calico-docker | tests/st/utils/network.py | Python | apache-2.0 | 3,537 |
# 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
# "License"); you may not u... | apache/arrow | dev/archery/archery/integration/tester_go.py | Python | apache-2.0 | 3,999 |
import re
import requests
from livestreamer.compat import urlparse
from livestreamer.exceptions import PluginError, NoStreamsError
from livestreamer.plugin import Plugin
from livestreamer.stream import RTMPStream, HTTPStream
from livestreamer.utils import urlget, urlresolve, prepend_www
RTMP_URL = "rtmp://204.107.26.... | breunigs/livestreamer | src/livestreamer/plugins/filmon_us.py | Python | bsd-2-clause | 3,678 |
from blinker import Namespace
import logging
import json
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class MySignal:
def __init__(self):
self.signals = {}
self.signal = Namespace()
def init_app(self, app):
pass
def addSignal(self, classname, option):
... | digifant/eMonitor | emonitor/signals.py | Python | bsd-3-clause | 1,692 |
# Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | hoangt/gem5v | src/mem/AddrMapper.py | Python | bsd-3-clause | 3,454 |