code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
from django.contrib import admin
from accounts.models import User
# Register your models here.
admin.site.register(User)
| ViktorMarinov/get-a-room | get_a_room/accounts/admin.py | Python | mit | 122 |
# coding = utf-8
import socket
import sys
#ESTABLISH SOCKET OBJECT
client = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
#ESTABLISH FINISHED
host = socket.gethostname()
port = 5000
#THE MOST LARGE NUMBER OF CLIENTS WHITCH COULD BE LISTENED
client.connect((host,port))
while True:
#RECEIVE THE MESSAGE
message = ... | minghust/simpleSocket | pyVersion/client.py | Python | mit | 538 |
# -*- coding: utf-8 -*-
#BEGIN_HEADER
import sys
import traceback
import subprocess
import uuid
from pprint import pprint, pformat
from biokbase.workspace.client import Workspace as workspaceService
#END_HEADER
class pr_dca:
'''
Module Name:
pr_dca
Module Description:
A KBase module: pr_dca
... | pranjan77/pr_dca | lib/pr_dca/pr_dcaImpl.py | Python | mit | 7,755 |
"""Admin-level entities for the 'movies' Django app."""
from django.contrib import admin
from .models import Movie
class MovieAdmin(admin.ModelAdmin):
"""Specialized 'Movie' model data representations for the admin site."""
list_display = ["title", "year", "director"]
admin.site.register(Movie, MovieAdmin... | jlaurelli/movie_organizer | movies/admin.py | Python | mit | 322 |
import os
import io
import sympy as sym
import re
from sympy.physics.quantum import TensorProduct
from sympy.utilities.codegen import codegen
from quadrature_points_weights import \
gauss_lobatto_legendre_quadruature_points_weights
def generating_polynomial_lagrange(N, coordinate, gll_points):
"""Symbolical... | SalvusHub/salvus | src/py/pysalvus/code_generation/code_generator.py | Python | mit | 7,868 |
# Copyright 2017 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... | skim1420/spinnaker | dev/buildtool/image_commands.py | Python | apache-2.0 | 10,845 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
from collections import namedtuple
from marcxml_parser import MARCXMLRecord
from .author import Author
from .format_enum import FormatEnum
from ..aleph ... | edeposit/edeposit.amqp.aleph | src/edeposit/amqp/aleph/datastructures/epublication.py | Python | mit | 6,115 |
# Higgins - A multi-media server
# Copyright (c) 2007-2009 Michael Frank <msfrank@syntaxjockey.com>
#
# This program is free software; for license information see
# the COPYING file.
from django.shortcuts import render_to_response
def index(request):
return render_to_response('templates/front.t', {})
| msfrank/Higgins | higgins/core/front.py | Python | lgpl-2.1 | 309 |
# -*- coding: utf-8 -*-
""" processcpu2plot: a python command line utility to display CPU % output
of a single process as a graphic plot.
Synapsis:
$ processcpu2plot <process> <nr iterations> <duration of iteration>
Example:
$ processcpu2plot chrome 21 0.1
(For Mac OS/Linux)
$ processcp... | rentes/toptoplot | processcpu2plot.py | Python | mit | 5,964 |
import datetime
from sqlalchemy.sql.expression import and_
from models import BotIdentity, BotSkill, BotRank
from matchmaker import db
class Leaderboard(object):
def __init__(self, user=None):
owned_exp = and_(user is not None and hasattr(user, 'id')
and BotIdentity.user_id == u... | gnmerritt/casino | matchmaker/leaderboard.py | Python | mit | 818 |
"""Deployment Services Classes."""
import logging
from .deployabledevices import DeployableDevices
from .deploymentrequests import DeploymentRequests
logging.debug("In the deployment_services __init__.py file.")
__all__ = ["DeployableDevices", "DeploymentRequests"]
| daxm/fmcapi | fmcapi/api_objects/deployment_services/__init__.py | Python | bsd-3-clause | 269 |
#!/usr/bin/python
foo = [2, 18, 9, 22, 17, 24, 8, 12, 27]
print "foo", foo
print "Filter: (is it divisible by 3"
print filter(lambda x: x % 3 == 0, foo)
print "Map: x * 2 + 10"
print map(lambda x: x * 2 + 10, foo)
print "Reduce: sum of the foo value"
print reduce(lambda x, y: x + y, foo)
| ramesharpu/python | basic-coding/comprehensions-not-complete/lambda/standard-function.py | Python | gpl-2.0 | 294 |
# -*- coding: utf-8 -*-
from django.db import models
from django_orm.postgresql.manager import Manager
class TestModel(models.Model):
name = models.CharField(max_length=200)
objects = models.Manager()
manager = Manager()
| cr8ivecodesmith/django-orm-extensions-save22 | tests/modeltests/pg_cache/models.py | Python | bsd-3-clause | 236 |
def get_board_name():
return "Not detected"
def get_gpio_driver():
from . import gpio
return gpio.GPIODriver()
def get_i2c_driver(address, bus=0):
from . import i2c
return i2c.I2CDriver(address, bus)
def get_camera_driver(source):
from . import camera_driver
return camera_driver.CameraDri... | kervi/kervi | kervi-hal-win/kervi/platforms/windows/__init__.py | Python | mit | 1,431 |
try: paraview.simple
except: from paraview.simple import *
Glyph1 = GetActiveSource()
NeighborSmooth2 = NeighborSmooth()
NeighborSmooth2.SelectInputArray = ['POINTS', 'global id']
NeighborSmooth2.NeighborNumber = 25
NeighborSmooth2.SelectInputArray = ['POINTS', 'mass']
my_representation1 = GetDisplayProperties(Glyp... | corbett/parastro | ExamplePython/NeighborSmooth.py | Python | lgpl-3.0 | 1,101 |
#!/usr/bin/python
"""
generate_ufuncs.py
Generate Ufunc definition source files for scipy.special. Produces
files '_ufuncs.c' and '_ufuncs_cxx.c' by first producing Cython.
This will generate both calls to PyUFunc_FromFuncAndData and the
required ufunc inner loops.
The syntax in the ufunc signature list is
<li... | jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/scipy/special/generate_ufuncs.py | Python | mit | 44,249 |
# -*- coding: utf-8 -*-
'''
Production Configurations
'''
from config.settings.common import *
# SECRET CONFIGURATION
# ------------------------------------------------------------------------------
SECRET_KEY = env("SECRET_KEY")
ALLOWED_HOSTS = ['127.0.0.1', 'localhost']
| yifan-liao/studentgrading | config/settings/production.py | Python | gpl-3.0 | 275 |
# -*- coding: utf-8 -*-
"""
direct PAS
Python Application Services
----------------------------------------------------------------------------
(C) direct Netware Group - All rights reserved
https://www.direct-netware.de/redirect?pas;http;table
This Source Code Form is subject to the terms of the Mozilla Public Licen... | dNG-git/pas_http_table | src/dNG/module/controller/output/database_table.py | Python | mpl-2.0 | 1,343 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#Refrescador automatico de clines
#Creado por Dagger - https://github.com/gavazquez
import ReloadCam_Main, ReloadCam_Helper
def GetVersion():
return 2
#Filename must start with Server, classname and argument must be the same!
class ManiaForall(ReloadCam_Main.Server... | DaggerES/ReloadCam | DELETED_ReloadCam_Server_ManiaForall.py | Python | gpl-3.0 | 1,371 |
from .util import prepare_for_display, window_manager
import numpy as np
# We try to aquire the gui lock first or else the gui import might
# trample another GUI's PyOS_InputHook.
window_manager.acquire('qt')
try:
from PyQt4.QtGui import (QApplication, QImage,
QLabel, QMainWindow, QPi... | chintak/scikit-image | skimage/io/_plugins/qt_plugin.py | Python | bsd-3-clause | 5,513 |
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from tracing.mre import job as job_module
class Failure(object):
def __init__(self, job, function_handle_string, trace_canonical_url,
fai... | catapult-project/catapult | tracing/tracing/mre/failure.py | Python | bsd-3-clause | 1,876 |
def my_mongocall_perm_check(req, db, col, cmd):
if not col.startswith("user"): # limit collection to transaction_.*
return False
return True
| feifangit/dj-mongo-reader | example/sampleapp/sampleapp/security.py | Python | gpl-2.0 | 160 |
import math
from collections import deque
def run():
N, K, W = list(map(int, input().split()))
Ls = list(map(int, input().split()))
A_L, B_L, C_L, D_L = list(map(int, input().split()))
Hs = list(map(int, input().split()))
A_H, B_H, C_H, D_H = list(map(int, input().split()))
for i in range(K+1, ... | mjenrungrot/competitive_programming | Facebook Hackercup/2020/Round 1/A1.py | Python | mit | 3,016 |
"""
mbed SDK
Copyright (c) 2011-2013 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 wr... | dbestm/mbed | workspace_tools/tests.py | Python | apache-2.0 | 47,117 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 B1 Systems GmbH
#
# 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
#... | tanglei528/horizon | openstack_dashboard/dashboards/admin/hypervisors/views.py | Python | apache-2.0 | 2,516 |
#
# Copyright (c) 2013-2019 Kevin Steves <kevin.steves@pobox.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AN... | PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/lib/pan-python/lib/pan/__init__.py | Python | isc | 968 |
"""Provides network management parser."""
# Copyright (c) 2018 - I.T. Dev Ltd
#
# This file is part of MCVirt.
#
# MCVirt 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
# ... | ITDevLtd/MCVirt | source/mcvirt-daemon/usr/lib/python2.7/dist-packages/mcvirt/parser_modules/network_parser.py | Python | gpl-2.0 | 3,868 |
import json
class GeneralSerializer:
content = []
def insert(self, content, meta):
self.content.append({'content': content, 'meta': meta})
def serialize(self):
return json.dumps(self.content)
class AuthorSerializer:
fields = ['author', 'commit_number', 'all_new_lines', 'all_deleted_... | MilosLukic/promingit | serializer.py | Python | gpl-3.0 | 2,510 |
__author__ = 'SmileyBarry'
from .core import APIConnection, SteamObject
from .app import SteamApp
from .decorators import cached_property, INFINITE, MINUTE, HOUR
import datetime
class SteamUserBadge(SteamObject):
def __init__(self, badge_id, level, completion_time, xp, scarcity, appid=None):
"""
... | mpattyn/fumiste | prototypePython/steamapi/user.py | Python | mit | 12,780 |
# -*- coding: utf-8 -*-
"""
walle-web
:copyright: © 2015-2019 walle-web.io
:created time: 2018-11-24 06:30:06
:author: wushuiyong@walle-web.io
"""
from datetime import datetime
from sqlalchemy import String, Integer, DateTime
from walle.model.database import db, Model
# 上线记录表
class RecordModel(Model... | meolu/walle-web | walle/model/record.py | Python | apache-2.0 | 2,625 |
from vumi.codecs.vumi_codecs import VumiCodec
__all__ = ['VumiCodec']
| TouK/vumi | vumi/codecs/__init__.py | Python | bsd-3-clause | 71 |
#!/usr/bin/env python
import sys
print "# Creating graphs from stdin (requires matplotlib)"
result = {}
keys = []
for line in sys.stdin:
# skip blank lines and comments
if len(line.strip()) == 0 or line.strip()[0] == '#':
continue
(host,size,count,truncated,mean,std,var,max,min) = line.strip().split()
if not... | MagnusS/mirage-bench | test-remote-ping/plot.py | Python | isc | 2,128 |
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.core import debug
from fenrirscreenreader.utils import mark_utils
from fenrirscreenreader.utils import line_utils
class command():
def __init__(self):
self.ID = '6'
def... | chrys87/fenrir | src/fenrirscreenreader/commands/commands/bookmark_6.py | Python | lgpl-3.0 | 2,126 |
taxonids = ["9606", # homo sapiens
"997068", # mislabed Oenocarpus sp. Baker 998
"1480161",
"1504453", #mislabeled Osmelia
]
| FePhyFoFum/PyPHLAWD | src/bad_taxa.py | Python | gpl-2.0 | 173 |
# Werewolf Secret Video Mode
# Jim
# Nov 2013
import procgame
import locale
import logging
import random
from procgame import *
base_path = config.value_for_key_path('base_path')
game_path = base_path+"games/indyjones/"
speech_path = game_path +"speech/"
sound_path = game_path +"sound/"
music_path = game_path +"music... | mypinballs/indianajones | werewolf.py | Python | gpl-3.0 | 26,799 |
#!/usr/bin/env python
__author__ = 'Donovan Parks'
__copyright__ = 'Copyright 2013'
__credits__ = ['Donovan Parks']
__license__ = 'GPL3'
__version__ = '1.0.0'
__maintainer__ = 'Donovan Parks'
__email__ = 'donovan.parks@gmail.com'
__status__ = 'Development'
import os, argparse
from ete2 import Tree, NodeStyle, TreeSty... | dparks1134/PETs | scripts/plotTree.py | Python | gpl-3.0 | 3,547 |
# $Id: body.py 5618 2008-07-28 08:37:32Z strank $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Directives for additional body elements.
See `docutils.parsers.rst.directives` for API details.
"""
__docformat__ = 'reStructuredText'
impor... | rimbalinux/MSISDNArea | docutils/parsers/rst/directives/body.py | Python | bsd-3-clause | 5,963 |
import re
PORT_SPEC = re.compile(
"^" # Match full string
"(" # External part
r"((?P<host>[a-fA-F\d.:]+):)?" # Address
r"(?P<ext>[\d]*)(-(?P<ext_end>[\d]+))?:" # External range
")?"
r"(?P<int>[\d]+)(-(?P<int_end>[\d]+))?" # Internal range
"(?P<proto>/(udp|tcp))?" # Protocol
"$" #... | youhong316/docker-py | docker/utils/ports.py | Python | apache-2.0 | 2,799 |
"""
put in your project's management/commands/freshdb.py
"""
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Drops and re-creates the database"
def handle(self, *args, **options):
from django.db import connection
from django.conf import settings
... | intelligenia/django-cmsutils | cmsutils/management/commands/freshdb.py | Python | lgpl-3.0 | 553 |
# Copyright (c) 2016-present, Facebook, 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... | Yangqing/caffe2 | caffe2/python/gru_cell.py | Python | apache-2.0 | 5,945 |
from __future__ import print_function
from bose_einstein import bose_einstein
from constant import htr_to_K, htr_to_meV, htr_to_eV
import argparser
import norm_k
import numpy as np
import scf
import system
args = argparser.read_argument('Evaluate step-like feature in electron-phonon coupling')
thres = args.thres / htr... | mmdg-oxford/papers | Schlipf-PRL-2018/model/step.py | Python | gpl-3.0 | 830 |
"""
PySCeS - Python Simulator for Cellular Systems (http://pysces.sourceforge.net)
Copyright (C) 2004-2020 B.G. Olivier, J.M. Rohwer, J.-H.S Hofmeyr all rights reserved,
Brett G. Olivier (bgoli@users.sourceforge.net)
Triple-J Group for Molecular Cell Physiology
Stellenbosch University, South Africa.
Permission to us... | bgoli/pysces | pysces/PyscesMiniModel.py | Python | bsd-3-clause | 19,989 |
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name="django-frontflow",
version='0.0.3',
packages=find_packages(),
include_package_data=True,
author='Sebastián Acuña',
author_email='sacuna@gmail.com',
url='https://github.com/Unholster/django-frontflow',
... | Unholster/django-frontflow | setup.py | Python | mit | 530 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
Simple polygon visual based on MeshVisual and LineVisual
"""
from __future__ import division
import numpy as np
from .visual import CompoundVisual
from .mesh import Me... | ghisvail/vispy | vispy/visuals/polygon.py | Python | bsd-3-clause | 3,795 |
# Module 'packmail' -- create a self-unpacking shell archive.
# This module works on UNIX and on the Mac; the archives can unpack
# themselves only on UNIX.
import os
from stat import ST_MTIME
# Print help
def help():
print 'All fns have a file open for writing as first parameter'
print 'pack(f, fullname, na... | xbmc/atv2 | xbmc/lib/libPython/Python/Lib/lib-old/packmail.py | Python | gpl-2.0 | 2,992 |
import nose
import sys
import os
import warnings
import tempfile
from contextlib import contextmanager
import datetime
import numpy as np
import pandas
import pandas as pd
from pandas import (Series, DataFrame, Panel, MultiIndex, Categorical, bdate_range,
date_range, Index, DatetimeIndex, isnull)
... | webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/pandas/io/tests/test_pytables.py | Python | gpl-2.0 | 175,872 |
#!/usr/bin/env python
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | MTG/essentia | test/src/unittests/highlevel/test_gaiatransform.py | Python | agpl-3.0 | 2,666 |
import platform
import urllib
import subprocess
from progressbar import ProgressBar
class Downloader(object):
WINDOWS_DOWNLOAD_URL = "http://cache.lego.com/downloads/ldd2.0/installer/setupLDD-PC-4_3_8.exe"
MAC_DOWNLOAD_URL = "http://cache.lego.com/downloads/ldd2.0/installer/setupLDD-MAC-4_3_8.zip"
PB = N... | cbrentharris/bricklayer | bricklayer/utils/downloader.py | Python | mit | 951 |
import scipy as sp
import scipy.linalg
import scipy.sparse.linalg
import pdb
import traceback
if __package__ is None:
__package__ = 'modules'
from utils import *
from init import *
from reads import *
def remove_short_exons(genes, CFG):
# [genes] = remove_short_exons(genes, terminal_short_extend, terminal_sh... | warrenmcg/spladder | python/modules/editgraph.py | Python | bsd-3-clause | 90,581 |
#!/usr/bin/env python
"""Helper classes for flows-related testing."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import logging
import sys
from future.builtins import range
from future.utils import iteritems
import mock
from typing import Text
from ... | dunkhong/grr | grr/test_lib/flow_test_lib.py | Python | apache-2.0 | 16,598 |
# Copyright 2015 Conchylicultor. 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 ... | manumathewthomas/Chat-with-Joey | chatbot/textdata.py | Python | apache-2.0 | 20,107 |
from django.conf import settings
INVITE_ONLY = getattr(settings, 'INVITATION_INVITE_ONLY', False)
EXPIRE_DAYS = getattr(settings, 'INVITATION_EXPIRE_DAYS', 15)
INVITATION_MODEL = getattr(settings, 'INVITATION_MODEL', 'invitation.Invitation') | TyVik/django-invitation-backend | invitation/app_settings.py | Python | bsd-3-clause | 243 |
"""
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option... | JizhouZhang/SDR | grc/gui/BlockTreeWindow.py | Python | gpl-3.0 | 10,847 |
# -*- encoding: utf-8 -*-
from supriya.tools.ugentools.UGen import UGen
class TBall(UGen):
r'''A bouncing object physical model.
::
>>> source = ugentools.In.ar(bus=0)
>>> tball = ugentools.TBall.ar(
... damping=0,
... friction=0.01,
... gravity=10,
... | andrewyoung1991/supriya | supriya/tools/ugentools/TBall.py | Python | mit | 5,194 |
#!/usr/bin/python
#
# Copyright 2017 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 b... | googleads/googleads-shopping-samples | python/shopping/content/accounttax/workflow.py | Python | apache-2.0 | 3,656 |
import os
from death_extractor import youtube as yt
from death_extractor import set_interval
from death_extractor import extract_and_upload
def death_as_a_service(vid_path='vids', max_downloads=4,
to_imgur=False, to_tumblr=True, to_snapchat=True):
"""Run periodic search/download/extract_and... | BooDoo/death_extractor | daas.py | Python | mit | 718 |
'''
Authors: Sergio Mundo and Laura Lenkic
Date: 11/14/2017
Filename: integrators.py
Fourth-Order Runge-Kutta and Second-Order Leapfrog integrators and definition of equations to be integrated.
'''
import numpy as np
import sys
#---------------------------Velocity and Acceleration equations, separated into x, y, a... | astroumd/GradMap | notebooks/Lectures2018/Lecture4/Old_N-Body/integrators.py | Python | gpl-3.0 | 5,886 |
#! /usr/bin/python
from app import app
app.run(debug=True) | Raghavan-Lab/BioDashboard | LaunchDashboard.py | Python | gpl-2.0 | 58 |
# -*- coding: utf-8 -*-
from django.conf import settings
from django import test
from django.utils import translation
from django.utils.functional import lazy
import jinja2
from nose.tools import eq_
from test_utils import ExtraAppTestCase, trans_eq
from testapp.models import TranslatedModel, UntranslatedModel, Fancy... | jbalogh/zamboni | apps/translations/tests/test_models.py | Python | bsd-3-clause | 13,617 |
### ####################################################################### ###
### import splash_highway as splash
### splash.do_My_Splash('http://xbmchub.com/images/index-logo.png',5);
### splash.do_My_Splash('http://xbmchub.com/images/index-logo.png',2,True,100,100,600,400);
### splash.do_My_TextSplash("Hello Pla... | IptvBrasilGroup/Cleitonleonelcreton.repository | plugin.video.update/splash_highway.py | Python | gpl-2.0 | 7,242 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def VirtualCdromAtapiBackingOption(vim, *args, **kwargs):
'''The VirtualCdromOption.Atapi... | xuru/pyvisdk | pyvisdk/do/virtual_cdrom_atapi_backing_option.py | Python | mit | 1,112 |
# Name: CreateDatabaseConnection.py
# Description: Connects to a database using Easy Connect string and operating system authentication.
# Import system modules
import arcpy, sys
from arcpy import env
# Get variables
workspace = arcpy.GetParameterAsText(0) # Connection to data source
#workspace = r'C:\Data\OSM\Mxds\... | ThomasEmge/arcgis-osm-editor | src/ServicePublisher10_1/Python/CheckForData.py | Python | apache-2.0 | 3,048 |
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import errno
import json
import logging
import os
import re
import textwrap
import zipfile
from collections import defaultdict
from contextlib import closing
from xml.etree import ElementT... | tdyas/pants | src/python/pants/backend/jvm/tasks/jvm_compile/zinc/zinc_compile.py | Python | apache-2.0 | 44,141 |
###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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:/... | robtandy/AutobahnPython | examples/twisted/wamp/basic/rpc/complex/backend.py | Python | apache-2.0 | 1,506 |
"""
Note: adapted from the original debugging environment to have Box obs space
Simple environment with known optimal policy and value function.
This environment has just two actions.
Action 0 yields 0 reward and then terminates the session.
Action 1 yields 1 reward and then terminates the session.
Optimal policy: a... | dmakian/feudal_networks | feudal_networks/envs/debug_envs.py | Python | mit | 927 |
#!/usr/bin/env python
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
#
# MAUS 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 ... | mice-software/maus | src/common_py/analysis/inspectors.py | Python | gpl-3.0 | 19,249 |
#!/usr/bin/env python
# encoding: utf-8
"""
retry decorator
~~~~~~~~
retry.py
"""
import functools
from time import sleep
from logging import Logger
class NotCallable(Exception):
pass
def run_callback(cb):
func = cb.get('callback')
if not func or not callable(func):
raise No... | Zuckonit/retry | retry.py | Python | mit | 3,302 |
from maintenance_calendar import app
import maintenance_calendar.views
from maintenance_calendar import config
#inicalize the Logger of Flask
from flask_log import Logging
import logging
root_logger = logging.getLogger()
#configure rotatin handler
file_hander = logging.handlers.RotatingFileHandler(config.log_file, ma... | Atos-FiwareOps/fiware-maintenance-calendar-api | runserver.py | Python | apache-2.0 | 900 |
# Copyright (c) 2006
# Colin Dewey (University of Wisconsin-Madison)
# cdewey@biostat.wisc.edu
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your op... | hyphaltip/cndtools | lib/GLADIS.py | Python | gpl-2.0 | 2,971 |
# PageSpeedy
#
# Does the page speed stuff...
#
import os
import sys
import speedydb
import urllib
import urllib2
import json
import time
import base64
results_folder = '{0}/../data/results/{1}/{2}'
class PageSpeedy(object):
def __init__(self):
self.db = speedydb.SpeedyDb()
self.file_dir = os.path.dirname... | Jumoo/Jumoo.PageSpeedyPlus | speedy/pagespeedy.py | Python | mpl-2.0 | 4,731 |
'''
Copyright 2015
This file is part of Orbach.
Orbach 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.
Orbach is distributed in the hope t... | awood/orbach | test/test_views.py | Python | gpl-3.0 | 1,107 |
class Registry(object):
def __init__(self):
self._registry = {}
def modules(self):
return sorted([module for module in self._registry.values()],
key=lambda module: (module.order, module.label))
def installed_modules(self):
return [module for module in self.mod... | CoutinhoElias/danibraz | danibraz/static/material/frontend/registry.py | Python | mit | 883 |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and both Actors
#
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetR... | HopeFOAM/HopeFOAM | ThirdParty-0.1/ParaView-5.0.1/VTK/Filters/Core/Testing/Python/Delaunay2DAlpha.py | Python | gpl-3.0 | 1,253 |
import HaloRadio.TopWeb as TopWeb
import HaloRadio.Request as Request
class plugin(TopWeb.TopWeb):
def GetReqs(self):
return "amv"
def handler(self, context):
import HaloRadio.RequestListMaker as RequestListMaker
import HaloRadio.Util as Util
if self.form.has_key("requestids"):
list ... | ph1l/halo_radio | WebRoot/releaseRequests.py | Python | gpl-2.0 | 1,683 |
from __future__ import absolute_import
import codecs
import re
import types
import sys
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import utils
from io import StringIO
try:
from io import BytesIO
except ImportError:
Bytes... | rcarmo/soup-strainer | html5lib/inputstream.py | Python | mit | 32,655 |
import cv2
import numpy as np
import sys
from time import sleep
class Hue:
h = 0
s = 0
v = 0
class HueAverage:
def __init__(self, wname, wwidth, wheight, avgSize):
self.avgSize = avgSize
self.x = self.y = 0
self.at = Hue();
self.avg = Hue();
self.clicked = False... | philkroos/tinkervision | src/test/colormatch/pick_color.py | Python | gpl-2.0 | 2,616 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix 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/LICE... | 30loops/nova | nova/tests/xenapi/stubs.py | Python | apache-2.0 | 11,404 |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'TextVersion.category_1'
db.add_column('cm_textversion', 'category_1', self.gf('django.db.m... | co-ment/comt | src/cm/migrations/0010_auto__add_field_textversion_category_1__add_field_textversion_category.py | Python | agpl-3.0 | 18,233 |
#! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# chimera - observatory automation system
# Copyright (C) 2006-2007 P. Henrique Silva <henrique@astro.ufsc.br>
# 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 S... | tribeiro/chimera | src/chimera/instruments/camera.py | Python | gpl-2.0 | 11,780 |
import ttk
import Tkinter as tk
from rwb.widgets import BottomTabNotebook
from rwb.runner import RobotConsole, RobotLogTree, RobotLogMessages, RobotController
class Shelf(ttk.Frame):
def __init__(self, parent, controller):
ttk.Frame.__init__(self, parent)
self.controller = controller
... | boakley/robotframework-workbench | rwb/editor/shelf.py | Python | apache-2.0 | 885 |
from threading import Thread
from flask import current_app, render_template
from flask.ext.mail import Message
from . import mail
def send_email(to, subject, template, **kwargs):
app = current_app._get_current_object()
msg = Message(app.config['COOKBOOK_MAIL_SUBJECT_PREFIX'] + subject,
sende... | benosment/cookbook | app/email.py | Python | mit | 698 |
"""
A geometry module for the SymPy library. This module contains all of the
entities and functions needed to construct basic geometrical data and to
perform simple informational queries.
Usage:
======
Notes:
======
Currently the geometry module supports 2-dimensional
and 3 -dimensional Euclidean space.
Exa... | wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/sympy/geometry/__init__.py | Python | mit | 886 |
# -*- coding: utf-8 -*-
#
# Copyright 2015-2017 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of fiware-cygnus (FIWARE project).
#
# fiware-cygnus 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 ... | telefonicaid/fiware-cygnus | cygnus-ngsi/test/acceptance/integration/notifications/mysql/steps.py | Python | agpl-3.0 | 5,800 |
import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
class EcmasScriptTest(base_test.WebDriverBaseTest):
def test_that_ecmascript_returns_document_title(self):
self.driver.get(self.webserver.where_is("ecmascript/res/ecmascript_test.htm... | cr/fxos-certsuite | web-platform-tests/tests/webdriver/ecmascript/ecmascript_test.py | Python | mpl-2.0 | 499 |
from django.contrib.admin import ModelAdmin
from django.contrib.admin.options import StackedInline
from django.forms import ModelForm
from django.urls import reverse_lazy
from judge.models import TicketMessage
from judge.widgets import HeavySelect2Widget, HeavySelect2MultipleWidget, HeavyPreviewAdminPageDownWidget
c... | Minkov/site | judge/admin/ticket.py | Python | agpl-3.0 | 1,314 |
########################################################################
# File : ResourcesDefaults.py
# Author : Ricardo Graciani
########################################################################
"""
Some Helper class to access Default options for Different Resources (CEs, SEs, Catalags,...)
"""
from __futur... | petricm/DIRAC | ConfigurationSystem/Client/Helpers/ResourcesDefaults.py | Python | gpl-3.0 | 3,108 |
"""Generate a chromosome using the shuffle method instead of a Markov chain.
Written only for debugging purposes -- not well constructed."""
import argparse
import sys
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
import random
import sys
import re
import os.path
import markov_gen
... | karroje/RAIDER_eval | chromosome_simulator3.py | Python | gpl-3.0 | 10,627 |
#!/usr/bin/env python # pylint: disable=too-many-lines
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _|
# | |) | (_) ... | andrewklau/openshift-tools | ansible/roles/lib_openshift_3.2/library/oadm_project.py | Python | apache-2.0 | 38,715 |
#!/usr/bin/env python
# -*- Mode: Python; indent-tabs-mode: nil -*-
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obta... | greyhavens/thane | tamarin-central/build/dependparser.py | Python | bsd-2-clause | 2,242 |
# Create your views here.
from django.shortcuts import render_to_response, get_object_or_404
from Contacts.models import Contact
from django.http import HttpResponse
def index(request):
return render_to_response('ContactsManagement/index.html', {})
def getAllContacts(request):
# Create json from Contacs
C... | virgolus/artGallery | ContactsManagement/views.py | Python | gpl-2.0 | 623 |
# PyVision License
#
# Copyright (c) 2006-2008 David S. Bolme
# 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, thi... | hitdong/pyvision | src/pyvision/tools/sigset_remove_missing.py | Python | bsd-3-clause | 5,723 |
from flask import Flask
from flask.ext.bootstrap import Bootstrap
from flask.ext.mail import Mail
from flask.ext.moment import Moment
from flask.ext.sqlalchemy import SQLAlchemy
from config import config
bootstrap = Bootstrap()
mail = Mail()
moment = Moment()
db = SQLAlchemy()
def create_app(config_name):
app = F... | jwestgard/prange-db | app/__init__.py | Python | mit | 631 |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only
# under the conditions described in the a... | tommy-u/chaco | chaco/chaco_version.py | Python | bsd-3-clause | 812 |
from base import *
MAGIC = '<a href="http://www.alobbs.com">Alvaro</a> tests QA #297.'
DOMAIN = '297-qa.users.example.com'
CONF = """
vserver!2970!nick = test0297
vserver!2970!match = rehost
vserver!2970!match!regex!1 = ^297-qa
vserver!2970!document_root = %s
vserver!2970!evhost = evhost
vserver!2970!evhost!tpl_docu... | lmcro/webserver | qa/297-EVHost5.py | Python | gpl-2.0 | 1,134 |
# Copyright 2017 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... | jiaphuan/models | research/learning_to_remember_rare_events/data_utils.py | Python | apache-2.0 | 8,011 |
import asyncio
try:
from unittest.mock import Mock, create_autospec
except ImportError:
from mock import Mock, create_autospec
from uuid import uuid4
from functools import wraps
from copy import copy
from unittest import TestCase as unittestTestCase
from zeroservices.exceptions import ServiceUnavailable
from... | Lothiraldan/ZeroServices | tests/utils.py | Python | mit | 3,193 |
from sympy.core.add import Add
from sympy.core.function import Function
from sympy.core.numbers import Float, I, oo, pi, Rational
from sympy.core.singleton import S
from sympy.core.symbol import Symbol
from sympy.functions.elementary.miscellaneous import (sqrt, cbrt, root,
Min, Max, real_root)
from sympy.functions.... | beni55/sympy | sympy/functions/elementary/tests/test_miscellaneous.py | Python | bsd-3-clause | 7,732 |
import datetime
from django.utils.timezone import localdate
from difflib import Differ
from functools import cmp_to_key, partial, cached_property
from django.db.models import Prefetch, Q
from django.contrib.postgres.aggregates import ArrayAgg
from sql_util.utils import Exists
from .utils import format_timedelta
from .m... | jclgoodwin/bustimes.org.uk | bustimes/timetables.py | Python | mpl-2.0 | 21,902 |
# -*- coding: utf-8 -*-
###############################################################################
# Name: __init__.py #
# Purpose: Jaluino PK2cmd Plugin #
# Author: Carlo Dormeletti <carlo.dormeletti@email.it> ... | sirloon/jaluino | ide/plugins/jpk2cmd/jpk2cmd/__init__.py | Python | bsd-3-clause | 7,263 |
#!/usr/bin/env python3
# export_to_pdf.py
#
# references
# - https://onesheep.org/scripting-libreoffice-python/
# - http://christopher5106.github.io/office/2015/12/06/openoffice-lib
# reoffice-automate-your-office-tasks-with-python-macros.html
import uno
from com.sun.star.beans import PropertyValue
localCont... | pchaitat/invrcptexporter | sample-code/misc/hello_world_librecalc.py | Python | gpl-3.0 | 1,240 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.