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 |
|---|---|---|---|---|---|
"""
homeassistant.components.media_player.plex
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides an interface to the Plex API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.plex/
"""
import os
import json
import logging
from datetime impo... | caiuspb/home-assistant | homeassistant/components/media_player/plex.py | Python | mit | 10,331 |
# Copyright (c) 2012 Santosh Philip
# =======================================================================
# Distributed under the MIT License.
# (See accompanying file LICENSE or copy at
# http://opensource.org/licenses/MIT)
# =======================================================================
"""pytest for... | jamiebull1/eppy | eppy/tests/test_iddgaps.py | Python | mit | 1,138 |
#### 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/shipcontrol/shared_shipcontrol_corvette.iff"
result.attribute_templ... | obi-two/Rebelion | data/scripts/templates/object/tangible/shipcontrol/shared_shipcontrol_corvette.py | Python | mit | 472 |
import os
import string
import codecs
import ast
import math
from vector3 import Vector3
filename_out = "../../Assets/cosine_table"
table_size = 512
fixed_point_precision = 512
def dumpCosine(_cosine_func, display_name, f):
f.write('const int ' + display_name + '[] =' + '\n')
f.write('{' + '\n')
... | voitureblanche/projet-secret | work/Python-toolchain/3D/build_cosine_tables.py | Python | mit | 1,178 |
def d(n):
tp = (n>>4) + (n>>3)
if tp < 64:
tp = 64
if tp > 2048:
tp = 2048
print[n,tp]
for x in range(0, 9999, 512):
d(x)
| dw/scratch | overalloc.py | Python | mit | 161 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# fig08_10.py
#
# Author: Billy Wilson Arante
# Created: 2016/10/10
from rational import Rational
def main():
"""Main"""
# Objects of class Rational
rational1 = Rational() # 1/1
rational2 = Rational(10, 30) # 10/30 reduces to 1/3
rational3 = Ration... | arantebillywilson/python-snippets | py2/htp/ch08/fig08_10.py | Python | mit | 1,448 |
import uuid
import asyncio
from appdaemon.appdaemon import AppDaemon
class Sequences:
def __init__(self, ad: AppDaemon):
self.AD = ad
self.logger = ad.logging.get_child("_sequences")
async def run_sequence_service(self, namespace, domain, service, kwargs):
if "entity_id" not in kwar... | acockburn/appdaemon | appdaemon/sequences.py | Python | mit | 4,617 |
#!/usr/bin/env python
import os
import pkgutil
import logging
import sys
import tornado.web
from pyjojo.config import config
from pyjojo.scripts import create_collection
log = logging.getLogger(__name__)
class route(object):
"""
decorates RequestHandlers and builds up a list of routables handlers
... | atarola/pyjojo | pyjojo/util.py | Python | mit | 1,563 |
'''
Created on Apr 3, 2012
@author: Dan
'''
from Common.Converter import *
from Common.Module import *
from Common.Symbol import DevicePart
from Common.Device import Deviceset
class Library(object):
__slots__ = ("name", "modules", "symbols", "converter", "deviceparts")
def __init__(self, node, name, conver... | Pecacheu/Eagle2Kicad | Library/Library.py | Python | mit | 3,113 |
import os
from dotenv import load_dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '../.env')
load_dotenv(dotenv_path)
# pylama:ignore=E402
from flask import Flask
from flask.ext.cors import CORS
from flask.ext.session import Session
from werkzeug.contrib.fixers import ProxyFix
from raven.contrib.flask i... | openspending/os-conductor | conductor/app.py | Python | mit | 1,606 |
# This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from wtforms.ext.sqlalchemy.fields import QuerySelectField
from w... | mvidalgarcia/indico | indico/modules/events/tracks/forms.py | Python | mit | 2,078 |
try:
# Python 3
from http.client import HTTPResponse, IncompleteRead
str_cls = str
except (ImportError):
# Python 2
from httplib import HTTPResponse, IncompleteRead
str_cls = unicode
from ..console_write import console_write
class DebuggableHTTPResponse(HTTPResponse):
"""
A custom HT... | herove/dotfiles | sublime/Packages/Package Control/package_control/http/debuggable_http_response.py | Python | mit | 2,329 |
from copy import deepcopy
from manager_utils import upsert
class BaseSmartManager(object):
def __init__(self, template):
self._template = deepcopy(template)
self._built_objs = set()
@property
def built_objs(self):
return self._built_objs
def build_obj(self, model_class, is_d... | ambitioninc/django-smart-manager | smart_manager/base.py | Python | mit | 1,637 |
#!/usr/bin/python3
#
# progress.py
#
# Author: Billy Wilson Arante
# Created: 2016/02/05 PHT
# Modified: 2016/08/19 PHT
#
def progress():
"""Progress icon
The Python 3 version of loading_icon.py.
"""
while True:
for i in ["/", "-", "|", "\\", "|"]:
print("%s\r" % i, end="")
def... | arantebillywilson/python-snippets | py3/abw-things/progress.py | Python | mit | 399 |
from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:5332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
| jarno83/digigems | contrib/wallettools/walletunlock.py | Python | mit | 158 |
# -*- coding: utf-8 -*-
from PIL import Image, ImageFont, ImageDraw
def drawPoint(imagedraw,x,y,width,colour):
imagedraw.ellipse((x-(width/2),y-(width/2),x+(width/2),y+(width/2)), colour)
frame = Image.new("RGBA", (300,300))
frameDraw = ImageDraw.Draw(frame)
#load font
fontpath = "/usr/share/fonts/truetype/f... | tomn46037/vidGPSOverlay | testcode/PILTest.py | Python | mit | 707 |
# Written by Nanbo Sun and CBIG under MIT license: https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md
x = { 'a':37,'b':42,
'c':927}
y = 'hello ''world'
z = 'hello '+'world'
a = 'hello {}'.format('world')
class foo ( object ):
def f (self ):
return 37*-+2
def g(self, x,y=42):
r... | ThomasYeoLab/CBIG | setup/tests/hooks_tests/pre_commit_tests/G_check_flake8_format/notfollow_flake8.py | Python | mit | 380 |
import logging
from contextlib import contextmanager
from ..errors import CompilerError
from .state import State
from .core import Context, Object, BoundObject, SoftScope, Scope, Type
from .module import Module
from .closure import Closure, ClosedLink, ClosedTarget
from .function import Function, FunctionType, Functi... | CameronLonsdale/jam | compiler/lekvar/__init__.py | Python | mit | 2,659 |
import math
from datetime import datetime
from conch import analyze_segments
from conch.analysis.segments import SegmentMapping
from .helper import generate_pitch_function
from ..segments import generate_utterance_segments
from ...exceptions import SpeakerAttributeError
from ..classes import Track, TimePoint
from ..... | PhonologicalCorpusTools/PolyglotDB | polyglotdb/acoustics/pitch/base.py | Python | mit | 10,009 |
#### 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/loot/loot_schematic/shared_chemical_recycler_schematic.iff"
result.... | anhstudios/swganh | data/scripts/templates/object/tangible/loot/loot_schematic/shared_chemical_recycler_schematic.py | Python | mit | 493 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# ---------------------------------------------------------------------... | Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/models.py | Python | mit | 360 |
#
# SFA XML-RPC and SOAP interfaces
#
import string
import xmlrpclib
# SOAP support is optional
try:
import SOAPpy
from SOAPpy.Parser import parseSOAPRPC
from SOAPpy.Types import faultType
from SOAPpy.NS import NS
from SOAPpy.SOAPBuilder import buildSOAP
except ImportError:
SOAPpy = None
####... | yippeecw/sfa | sfa/server/xmlrpcapi.py | Python | mit | 6,069 |
from .base import *
import dj_database_url
if os.environ.get('DEBUG') == 'False':
DEBUG = False
else:
DEBUG = True
try:
from .local import *
except ImportError:
pass
ALLOWED_HOSTS = ['*']
DATABASES = {'default': dj_database_url.config()}
SOCIAL_AUTH_YAMMER_KEY = os.environ.get('SOCIAL_AUTH_YAMMER... | kave/Face-Off | face-off/settings/production.py | Python | cc0-1.0 | 866 |
# -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2005-2012 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 Lesser General Public License as published by
## the Free Softw... | andrebellafronte/stoq | stoqlib/gui/wizards/purchasewizard.py | Python | gpl-2.0 | 23,998 |
from optparse import OptionParser
from uuid import uuid4
import re
def main():
parser = OptionParser()
#parser.add_option("--skip-rows", type="int", dest="skip_rows", default="0", help="Number of lines/rows to skip when using --lines or --csv. Default: %default")
(options, arguments) = parser.parse_args()
listing... | barche/k3d | share/k3d/guide/content/wiki2asciidoc.py | Python | gpl-2.0 | 1,764 |
# -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011, 2012 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 version 2 of the
## License, or (at... | cul-it/Invenio | modules/webstyle/lib/webinterface_handler_wsgi.py | Python | gpl-2.0 | 27,426 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/duration.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ref... | Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/google/protobuf/duration_pb2.py | Python | gpl-2.0 | 2,780 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2017-06-16 19:25
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('silo', '0013_deletedsilos'),
]
operations = [
... | mercycorps/TolaTables | silo/migrations/0014_formulacolumnmapping.py | Python | gpl-2.0 | 815 |
# -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Flumotion - a streaming media server
# Copyright (C) 2008 Fluendo, S.L. (www.fluendo.com).
# All rights reserved.
# This file may be distributed and/or modified under the terms of
# the GNU General Public License version 2 as published by
# the Free Software Founda... | flyapen/UgFlu | flumotion/common/vfsgnome.py | Python | gpl-2.0 | 4,077 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Integration test which checks the various parameters for makemovie.py
Copyright 2010-2013 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
import test.integration.library as lib
import os, sys
import om... | jballanc/openmicroscopy | components/tools/OmeroPy/test/integration/scriptstest/test_make_movie.py | Python | gpl-2.0 | 1,111 |
import sphivedbcli
import time
import sys
def printResultSet( rs ):
print "row.count %d" % ( rs.getRowCount() )
columnCount = rs.getColumnCount()
hdrs = ""
for i in range( columnCount ):
hdrs = hdrs + ( "\t%s(%s)" % ( rs.getName( i ), rs.getType( i ) ) )
print hdrs
for i in range( rs.getRowCount() ):
r... | codegooglecom/sphivedb | client/python/testcli.py | Python | gpl-2.0 | 1,157 |
# -*- coding: utf-8 -*-
import json
def json_pre_process_hook(action, request, *args, **kwargs):
json_data = request.body
if not json_data:
action.ret('002').msg('json_params_required')
return False
try:
param_dict = json.loads(json_data)
except ValueError:
action.ret... | Alexoner/health-care-demo | careHealth/earth/action/hooks.py | Python | gpl-2.0 | 1,374 |
##### CONTROL AND NAVIGATION ###################################################
# update the applications' title bar
def UpdateCaption(page=0, force=False):
global CurrentCaption, CurrentOSDCaption, CurrentOSDPage, CurrentOSDStatus
global CurrentOSDComment
if (page == CurrentCaption) and not(force):... | mjg/Impressive-svn | src/control.py | Python | gpl-2.0 | 19,439 |
#
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of ... | kratman/psi4public | psi4/driver/qcdb/periodictable.py | Python | gpl-2.0 | 78,237 |
#
# Copyright (C) 2004 SIPfoundry Inc.
# Licensed by SIPfoundry under the GPL license.
#
# Copyright (C) 2004 SIP Forum
# Licensed to SIPfoundry under a Contributor Agreement.
#
#
# This file is part of SIP Forum User Agent Basic Test Suite which
# belongs to the SIP Forum Test Framework.
#
# SIP Forum User Agent Basic... | ezigman/sftf | UserAgentBasicTestSuite/case207.py | Python | gpl-2.0 | 3,360 |
# Rekall Memory Forensics
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright 2013 Google Inc. All Rights Reserved.
#
# This file is part of Rekall Memory Forensics.
#
# Rekall Memory Forensics is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License Version... | dsweet04/rekall | rekall-core/rekall/plugins/linux/check_syscall.py | Python | gpl-2.0 | 6,461 |
#!/usr/bin/env python
#
# Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list... | qtproject/qtwebkit | Source/WebKit2/Scripts/generate-messages-header.py | Python | gpl-2.0 | 1,806 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('public', '0017_auto_20141218_1813'),
]
operations = [
migrations.RenameField(
model_name='commission',
... | tomcounsell/Cobra | apps/public/migrations/0018_auto_20141219_1711.py | Python | gpl-2.0 | 646 |
"""
WSGI config for ldstext 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.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ldstext.settings")
from django.core.w... | zowper/ldstext | ldstext/wsgi.py | Python | gpl-2.0 | 389 |
# ===========================================================================
# eXe config
# Copyright 2004-2006, University of Auckland
#
# 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; e... | kohnle-lernmodule/KITexe201based | exe/engine/config.py | Python | gpl-2.0 | 25,533 |
# -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2017 CERN.
#
# CERN Analysis Preservation Framework 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... | tiborsimko/analysis-preservation.cern.ch | tests/integration/test_delete_deposit.py | Python | gpl-2.0 | 7,407 |
# The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
from numpy.random import random
from bokeh.plotting import *
def mscatter(p, x, y, typestr):
p.scatter(x, y, marker=typestr,
line_color="#6666ee", fill_color="#ee6666", fill_alpha=0.5, size=12)
def mtext(p, x, y,... | zrhans/python | exemplos/Examples.lnk/bokeh/plotting/server/markers.py | Python | gpl-2.0 | 1,590 |
#########################################################################
## This program is part of 'MOOSE', the
## Messaging Object Oriented Simulation Environment.
## Copyright (C) 2013 Upinder S. Bhalla. and NCBS
## It is made available under the terms of the
## GNU Lesser General Public License version 2... | dilawar/moose-full | moose-examples/snippets/funcReacLotkaVolterra.py | Python | gpl-2.0 | 5,043 |
"""
SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP.
See the file LICENSE for copying permission.
"""
from sleekxmpp.plugins.base import PluginManager, PluginNotFound, BasePlugin
from sleekxmpp.plugins.base import register_plugin, load_plugin
__... | Haynie-Research-and-Development/jarvis | deps/lib/python3.4/site-packages/sleekxmpp/plugins/__init__.py | Python | gpl-2.0 | 3,265 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read().replace('.. :changelog:', ... | kubestack/kubestack | app/kubestack/setup.py | Python | gpl-2.0 | 1,536 |
from .transport import TransportEvents
from . import connection_info
import gui
import speech
import ui
import braille
import versionInfo
from logHandler import log
from . import configuration
from . import nvda_patcher
from . import RelayTransport
from collections import defaultdict
from . import connectio... | NVDARemote/NVDARemote | addon/globalPlugins/remoteClient/session.py | Python | gpl-2.0 | 12,126 |
#!/usr/bin/env python3
import os
import traceback
import glob
from multiprocessing import Pool, Process, Lock
import subprocess
import requests
import portage
from terminaltables import AsciiTable
DEBUG=0
if 'DEBUG' in os.environ:
DEBUG = os.environ['DEBUG']
PORTDIR_OVERLAY=os.path.realpath(os.path.dirname(os.... | rindeal/gentoo-overlay | _tools/bump-jetbrains-pkgs.py | Python | gpl-2.0 | 6,258 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('labman_setup', '0003_googlesearchscript'),
]
operations = [
migrations.AddField(
model_name='labmandeploygeneral... | morelab/labman_ud | labman_ud/labman_setup/migrations/0004_labmandeploygeneralsettings_background_color.py | Python | gpl-3.0 | 494 |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2016, Zato Source s.r.o. https://zato.io
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
| alirizakeles/zato | code/zato-server/src/zato/server/service/internal/security/vault/policy.py | Python | gpl-3.0 | 154 |
# -*- coding: utf-8 -*-
#
## This file is part of Zenodo.
## Copyright (C) 2012, 2013, 2014 CERN.
##
## Zenodo 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 ... | otron/zenodo | zenodo/demosite/receivers.py | Python | gpl-3.0 | 2,660 |
# -*- coding: utf-8 -*-
'''
Created on Oct 2, 2010
@author: dimitry (zavlab1)
'''
from gi.repository import Gtk
from gi.repository import Gdk
from foobnix.gui.service.path_service import get_foobnix_resourse_path_by_name
from foobnix.util.const import ICON_FOOBNIX
from foobnix.version import FOOBNIX_VERSION
class Ab... | kagel/foobnix | foobnix/gui/about/about.py | Python | gpl-3.0 | 1,313 |
"""
Demonstrates how to use the labjack.ljm.eAddresses (LJM_eAddresses) function.
"""
from labjack import ljm
# Open first found LabJack
handle = ljm.open(ljm.constants.dtANY, ljm.constants.ctANY, "ANY")
#handle = ljm.openS("ANY", "ANY", "ANY")
info = ljm.getHandleInfo(handle)
print("Opened a LabJack with Device t... | LaFriOC/LabJack | Python_LJM/Examples/eAddresses.py | Python | gpl-3.0 | 1,299 |
import bpy
bpy.context.object.data.sensor_width = 23.6
bpy.context.object.data.sensor_height = 15.6
bpy.context.object.data.sensor_fit = 'HORIZONTAL'
| cschenck/blender_sim | fluid_sim_deps/blender-2.69/2.69/scripts/presets/camera/Nikon_D7000.py | Python | gpl-3.0 | 150 |
# encoding: utf-8
def _unicode_truncate(ustr, length, encoding="UTF-8"):
"Truncate @ustr to specific encoded byte length"
bstr = ustr.encode(encoding)[:length]
return bstr.decode(encoding, 'ignore')
def extract_title_body(text, maxtitlelen=60):
"""Prepare @text: Return a (title, body) tuple
@text... | engla/kupfer | kupfer/textutils.py | Python | gpl-3.0 | 2,681 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Layer'
db.create_table('layers_layer', (
(u'id', self.gf('django.db.models.field... | sephiroth6/nodeshot | nodeshot/core/layers/migrations/0001_initial.py | Python | gpl-3.0 | 8,891 |
"""Handles downloading and importing OSM Data"""
import os
import subprocess
import tempfile
import requests
from celery.utils.log import get_task_logger
from django.conf import settings
from django.db import connection
from datasources.models import OSMData, OSMDataProblem
from datasources.tasks.shapefile import E... | WorldBank-Transport/open-transit-indicators | python/django/datasources/tasks/osm.py | Python | gpl-3.0 | 4,966 |
#! /usr/bin/env python
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2008, 2009, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
#####... | krull/docker-zenoss4 | init_fs/usr/local/zenoss/ZenPacks/ZenPacks.zenoss.ZenJMX-3.12.1.egg/ZenPacks/zenoss/ZenJMX/zenjmx.py | Python | gpl-3.0 | 25,284 |
import io
import json
import os
import subprocess
import sys
import unittest
from os.path import join, abspath, dirname
sys.path.append('..')
from python_driver import __version__, get_processor_instance
from python_driver.requestprocessor import (
Request, Response, RequestProcessorJSON, InBuffer, EmptyCodeExcept... | juanjux/python-driver | native/python_package/test/test_python_driver.py | Python | gpl-3.0 | 6,751 |
# coding=utf-8
"""g[ravity] class."""
from foamfile import FoamFile, foam_file_from_file
from collections import OrderedDict
class G(FoamFile):
"""G (gravity) class."""
# set default valus for this class
__default_values = OrderedDict()
__default_values['dimensions'] = '[0 1 -2 0 0 0 0]'
__defaul... | ladybug-analysis-tools/butterfly | butterfly/g.py | Python | gpl-3.0 | 1,428 |
"""
$Id: Base.py,v 1.12.2.10 2008/08/01 03:58:03 customdesigned Exp $
This file is part of the pydns project.
Homepage: http://pydns.sourceforge.net
This code is covered by the standard Python License.
Base functionality. Request and Response classes, that sort of thing.
"""
import socket, string, types, time, sel... | disabler/isida3 | lib/DNS/Base.py | Python | gpl-3.0 | 12,716 |
import IMP
import IMP.test
import IMP.atom
import IMP.core
class Tests(IMP.test.TestCase):
def _produce_point_sets(self, tr):
vs = []
vsr = []
for i in range(0, 20):
vs.append(IMP.algebra.get_random_vector_in(
IMP.algebra.get_unit_bounding_box_3d()))
... | shanot/imp | modules/atom/test/test_alignment.py | Python | gpl-3.0 | 1,846 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015-2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | josepht/snapcraft | snapcraft/tests/commands/test_clean.py | Python | gpl-3.0 | 10,914 |
# CUPS Cloudprint - Print via Google Cloud Print
# Copyright (C) 2014 Simon Cadman
#
# 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 y... | jjscarafia/CUPS-Cloud-Print | ccputils.py | Python | gpl-3.0 | 10,118 |
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 20 12:28:32 2015
@author: boland
"""
import sys
sys.path.append('/home/boland/Anaconda/lib/python2.7/site-packages')
import pickle
import numpy as np
import matplotlib.pyplot as plt
from scipy.cluster.vq import kmeans
import multiprocessing as mp
import pyproj
import os
... | boland1992/SeisSuite | seissuite/sort_later/find_holes.py | Python | gpl-3.0 | 17,030 |
# encoding: utf-8
#
# Copyright (C) 2016 YouCompleteMe contributors
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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... | snakeleon/YouCompleteMe-x86 | python/ycm/tests/omni_completer_test.py | Python | gpl-3.0 | 22,455 |
import urllib,urllib2,re,string,sys,os
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
from resources.libs import main
#Mash Up - by Mash2k3 2012.
addon_id = 'plugin.video.movie25'
selfAddon = xbmcaddon.Addon(id=addon_id)
art = main.art
prettyName = 'iWatchOnline'
def AtoZiWATCHtv():
main.addDir('0-9','http://www.iw... | marduk191/plugin.video.movie25 | resources/libs/plugins/iwatchonline.py | Python | gpl-3.0 | 22,479 |
import markdown
import re
from django.core.urlresolvers import reverse
from django.template.context import Context
from django.template.loader import render_to_string
from wiki.core.permissions import can_read
ATTACHMENT_RE = re.compile(r'(?P<before>.*)(\[attachment\:(?P<id>\d+)\])(?P<after>.*)', re.IGNORECASE)
from... | habibmasuro/django-wiki | wiki/plugins/attachments/markdown_extensions.py | Python | gpl-3.0 | 2,806 |
#!/usr/bin/python
#
# Copyright 2012 Lee Verberne <lee@blarg.org>
#
# 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 later version.
#
#... | kafana/ubik | lib/ubik/rug/cli.py | Python | gpl-3.0 | 2,912 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('settings', '0003_delete_organizationsettings'),
]
operations = [
migrations.CreateModel(
name='AccessionNumberCo... | ayys/siya | settings/migrations/0004_accessionnumbercount.py | Python | gpl-3.0 | 564 |
#!/usr/bin/env python
#
# (c) 2018, Red Hat, Inc.
#
# 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 v... | wilvk/ansible | contrib/inventory/infoblox.py | Python | gpl-3.0 | 3,883 |
# -*- coding: utf-8 -*-
# Taboot - Client utility for performing deployments with Func.
# Copyright © 2009, Red Hat, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of th... | tbielawa/Taboot | taboot/tasks/httpd.py | Python | gpl-3.0 | 805 |
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import step, world
from cms.djangoapps.contentstore.features.common import press_the_notification_button, type_in_codemirror
KEY_CSS = '.key h3.title'
ADVANCED_MODULES_KEY = "Advanced Module List"
def get_index_of(expected_key):... | ahmedaljazzar/edx-platform | cms/djangoapps/contentstore/features/advanced_settings.py | Python | agpl-3.0 | 769 |
from dependencies.dependency import getToolByName
from lims.browser import BrowserView
from dependencies.dependency import ViewPageTemplateFile
from lims import bikaMessageFactory as _
from lims.utils import t
from lims.utils import formatDateQuery, formatDateParms
from dependencies.dependency import IViewView
from dep... | yasir1brahim/OLiMS | lims/browser/reports/qualitycontrol_analysesrepeated.py | Python | agpl-3.0 | 5,554 |
from django.conf.urls import patterns, url
from quenta.storybook import views
urlpatterns = patterns('',
url(r'^(?P<story_id>\d+/)', views.story, name='story'),#+ parametar
url(r'^(?P<story_id>\d+/html/)', views.story_html, name='story_html'),#+ parametar
url(r'^$', views.stories_list, name='stories_list'... | metakermit/quenta | quenta/storybook/urls.py | Python | agpl-3.0 | 325 |
from __future__ import unicode_literals
from frappe import _
def get_data():
return [
{
"label": _("Documents"),
"icon": "icon-star",
"items": [
{
"type": "doctype",
"name": "Employee",
"description": _("Employee records."),
},
{
"type": "doctype",
"name": "Leave Applic... | indictranstech/tele-erpnext | erpnext/config/hr.py | Python | agpl-3.0 | 4,677 |
"""
LMS edxnotes page
"""
from __future__ import absolute_import
from bok_choy.page_object import PageLoadError, PageObject, unguarded
from bok_choy.promise import BrokenPromise, EmptyPromise
from selenium.webdriver.common.action_chains import ActionChains
from common.test.acceptance.pages.common.paging import Pagina... | ESOedX/edx-platform | common/test/acceptance/pages/lms/edxnotes.py | Python | agpl-3.0 | 20,755 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 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
import... | mdhaman/superdesk-core | apps/templates/content_templates_test.py | Python | agpl-3.0 | 6,949 |
# Generated by Django 3.2.6 on 2021-10-19 09:14
from django.db import migrations
from ureport.sql import InstallSQL
class Migration(migrations.Migration):
dependencies = [
("polls", "0069_pollquestion_color_choice"),
]
operations = [InstallSQL("polls_0070")]
| rapidpro/ureport | ureport/polls/migrations/0070_install_triggers.py | Python | agpl-3.0 | 285 |
"""
Test OLPC MUC properties.
"""
import dbus
from twisted.words.xish import domish, xpath
from gabbletest import exec_test, acknowledge_iq, make_muc_presence
from servicetest import call_async, EventPattern, wrap_channel
import constants as cs
import ns
from mucutil import echo_muc_presence
def test(q, bus, conn,... | Ziemin/telepathy-gabble | tests/twisted/olpc/olpc-muc-prop-change.py | Python | lgpl-2.1 | 14,987 |
import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... | agry/NGECore2 | scripts/mobiles/tatooine/razorback_felspur.py | Python | lgpl-3.0 | 1,656 |
#!/usr/bin/env python
'''
mavlink python utility functions
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import socket, math, struct, time, os, fnmatch, array, sys, errno
from math import *
from mavextra import *
if os.getenv('MAVLINK09') or 'MAVLINK09' in os.environ:
import mavlin... | x75/mavlink | pymavlink/mavutil.py | Python | lgpl-3.0 | 36,824 |
# 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 Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be usefu... | obriencj/python-javatools | tests/distinfo.py | Python | lgpl-3.0 | 1,430 |
from __future__ import unicode_literals
from .abc import ABCIE
from .abc7news import Abc7NewsIE
from .academicearth import AcademicEarthCourseIE
from .addanime import AddAnimeIE
from .adobetv import (
AdobeTVIE,
AdobeTVVideoIE,
)
from .adultswim import AdultSwimIE
from .aftenposten import AftenpostenIE
from .a... | apllicationCOM/youtube-dl-api-server | youtube_dl_server/youtube_dl/extractor/__init__.py | Python | unlicense | 20,811 |
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: miha@reciprocitylabs.com
# Maintained By: miha@reciprocitylabs.com
from datetime import date
from ggrc import db
from ggrc import builder
from ggrc... | hyperNURb/ggrc-core | src/tests/ggrc_workflows/generator.py | Python | apache-2.0 | 5,290 |
import sqlalchemy
from pypi_org.data.modelbase import SqlAlchemyBase
class Maintainer(SqlAlchemyBase):
__tablename__ = 'maintainers'
user_id: int = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)
package_id: str = sqlalchemy.Column(sqlalchemy.String, primary_key=True)
| Wintellect/WintellectWebinars | 2019-06-06-ten-tips-python-web-devs-kennedy/code/top_10_web_explore/ex05_migrations/pypi_org/data/maintainers.py | Python | apache-2.0 | 292 |
from enum import Enum
import time
from fysom import Fysom, FysomError
# WIP(joey): Fysom is not thread safe -- multiple threads could theoretically traverse
# WIP(joey): the same state transition simultaneously.
from app.util import log
class BuildState(str, Enum):
"""Posssible states for the FSM"""
QUEUED ... | josephharrington/ClusterRunner | app/master/build_fsm.py | Python | apache-2.0 | 8,309 |
# Copyright 2015 Google 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 law or a... | lukas-krecan/tensorflow | tensorflow/python/ops/control_flow_ops.py | Python | apache-2.0 | 71,570 |
#!/usr/bin/env python
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | mindprince/test-infra | experiment/generate_tests.py | Python | apache-2.0 | 11,228 |
# -*- encoding: utf-8 -*-
#
# Copyright © 2013 Intel
#
# Author: Shuangtai Tian <shuangtai.tian@intel.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://www.apache.org/licen... | tanglei528/ceilometer | ceilometer/compute/notifications/__init__.py | Python | apache-2.0 | 1,338 |
"""Support for Wireless Sensor Tags."""
import logging
from requests.exceptions import ConnectTimeout, HTTPError
import voluptuous as vol
from wirelesstagpy import NotificationConfig as NC
from homeassistant import util
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
ATTR_VOLTAGE,
CONF_PASSWORD,
... | leppa/home-assistant | homeassistant/components/wirelesstag/__init__.py | Python | apache-2.0 | 9,650 |
# -*- coding: utf-8 -*-
"""
Density Filter Tool
Created on Thu May 11 11:03:05 2017
@author: cheny
"""
from arcpy import Parameter
import arcpy
from section_cpu import dens_filter_cpu
from multiprocessing import cpu_count
class DensFilterTool(object):
def __init__(self):
"""Classify Tool"""
self... | lopp2005/spatial_cluster_fs | tool_densfilter.py | Python | apache-2.0 | 5,412 |
# Copyright 2012, Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
"""VTGateCursor, and StreamVTGateCursor."""
import itertools
import operator
import re
from vtdb import base_cursor
from vtdb import dbexceptions
write_sql_pattern... | theskyinflames/bpulse-go-client | vendor/github.com/youtube/vitess/py/vtdb/vtgate_cursor.py | Python | apache-2.0 | 9,742 |
# Copyright 2015 Google 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 law or agreed ... | jdanbrown/pydatalab | legacy_tests/kernel/sql_tests.py | Python | apache-2.0 | 7,834 |
from datetime import timedelta
from unittest import TestCase
import pandas as pd
import pandas.testing
from fireant.dataset.modifiers import Rollup
from fireant.dataset.totals import scrub_totals_from_share_results
from fireant.tests.dataset.mocks import (
dimx0_metricx2_df,
dimx1_str_df,
dimx1_str_totals... | mikeengland/fireant | fireant/tests/dataset/test_filter_totals_from_share_results.py | Python | apache-2.0 | 3,701 |
#!/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 "Li... | dbtsai/spark | dev/create-release/translate-contributors.py | Python | apache-2.0 | 12,628 |
import ceilometerclient.client as clclient
import logging
log = logging.getLogger(__name__)
class Metering:
'''Wrapper for the OpenStack MEtering service (Ceilometer)'''
def __init__(self, conf):
creds = self._get_creds(conf)
self.ceilo = clclient.get_client(2, **creds)
def _get_creds(sel... | bigfootproject/pyostack | pyostack/metering.py | Python | apache-2.0 | 712 |
#
# This file is part of pySMT.
#
# Copyright 2014 Andrea Micheli and Marco Gario
#
# 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
... | idkwim/pysmt | pysmt/solvers/pico.py | Python | apache-2.0 | 4,835 |
# coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... | brianrodri/oppia | core/domain/beam_job_domain_test.py | Python | apache-2.0 | 5,710 |
from six import string_types
from pypif.obj.common.display_item import DisplayItem
from pypif.obj.common.name import Name
from pypif.obj.common.pages import Pages
from pypif.obj.common.pio import Pio
class Reference(Pio):
"""
Information about a referenced publication.
"""
def __init__(self, doi=None... | kjaym/pypif | pypif/obj/common/reference.py | Python | apache-2.0 | 8,674 |
"""Client Utilities
Factor out code shared by both the resync and resync-explorer
clients.
Copyright 2012,2013 Simeon Warner
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:/... | dans-er/resync | resync/client_utils.py | Python | apache-2.0 | 4,699 |