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 |
|---|---|---|---|---|---|
################################
# These variables are overwritten by Zenoss when the ZenPack is exported
# or saved. Do not modify them directly here.
# NB: PACKAGES is deprecated
NAME = "ZenPacks.Opengear.ConsoleServer"
VERSION = "1.0"
AUTHOR = "Peter Hunt <support@opengear.com>"
LICENSE = "GPLv2"
NAMESPACE_PACKAGES... | zenoss/ZenPacks.Opengear.ConsoleServer | setup.py | Python | gpl-2.0 | 2,682 |
"""Functions for workloads."""
from utils.conf import cfme_performance
def get_capacity_and_utilization_replication_scenarios():
if 'test_cap_and_util_rep' in cfme_performance.get('tests', {}).get('workloads', []):
if (cfme_performance['tests']['workloads']['test_cap_and_util_rep']['scenarios'] and
... | dajohnso/cfme_tests | utils/workloads.py | Python | gpl-2.0 | 3,720 |
# -*- coding: utf-8 -*-
'''
Much Movies HD XBMC Addon
Copyright (C) 2014 lambda
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
(... | SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/plugin.video.muchmovies.hd/default.py | Python | gpl-2.0 | 51,620 |
#coding: cp936
#³£Î¢·Ö·½³Ì(ordinary differential equation)Çó½âÖ®¸Ä½øµÄÅ·À·¨dy=f*dx
import numpy as np
def odeiem(f, y0, x): #for: f(x, y)
'''fÊÇ΢·Ö·½³Ì£¬y0ÊdzõÖµ£¬xÊǸø¶¨µÄÐòÁУ¬×¢Òâf(x,y)º¯ÊýµÄ²ÎÊý˳ÐòÊÇxÓëy'''
y = np.array([y0])
for i in xrange(len(x)-1):
h = x[i+1]-x[i]
yp = y[i,:]+h*f... | bravesnow/nurbspy | assistlib/ode.py | Python | gpl-2.0 | 937 |
'''
Created on Dec 11, 2015
@author: cmelton
'''
from DDServerApp.ORM import orm,Column,relationship,String,Integer, PickleType, Float,ForeignKey,backref,TextReader, joinedload_all
from DDServerApp.ORM import BASE_DIR, Boolean
from User import User
import os, copy
class Credentials(orm.Base):
'''
classdocs
... | collinmelton/DDCloudServer | DDServerApp/ORM/Mappers/WorkflowTemplates.py | Python | gpl-2.0 | 22,461 |
# Generated by Django 2.2 on 2020-11-08 11:00
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('styles', '0004_auto_20201108_0742'),
]
operations = [
migrations.AddField(
model_name='style',
name='m... | qgis/QGIS-Django | qgis-app/styles/migrations/0005_style_modified_date.py | Python | gpl-2.0 | 597 |
import sys
import unittest
sys.path.append('../yeast')
import tpl
class TestParser(unittest.TestCase):
def setup(self, data=None):
self.mp = tpl.MyHtmlParser()
if data:
self.mp.feed(data)
def test_data1(self):
self.setup()
self.mp.feed("abc")
self.assertTr... | pastebt/yeast | testcase/test_tpl.py | Python | gpl-2.0 | 16,760 |
# Copyright (c) 2018, Xilinx Inc.
#
# Siva Durga Prasad Paladugu
#
# SPDX-License-Identifier: GPL-2.0
import pytest
import re
import random
import u_boot_utils
"""
Note: This test relies on boardenv_* containing configuration values to define
the network available and files to be used for testing. Without this, this ... | Digilent/u-boot-digilent | test/py/tests/test_zynqmp_secure.py | Python | gpl-2.0 | 3,375 |
# encoding: utf-8
# module PyQt4.QtGui
# from /usr/lib/python3/dist-packages/PyQt4/QtGui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
from .QPaintDevice import QPaintDevice
class QPicture(QPaintDevice):
"""
QPicture(int formatVersion=-1)
Q... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyQt4/QtGui/QPicture.py | Python | gpl-2.0 | 3,567 |
# -*- coding: utf-8 -*-
from datetime import timedelta
from itertools import product
import nose
import re
import warnings
from pandas import (date_range, MultiIndex, Index, CategoricalIndex,
compat)
from pandas.core.common import PerformanceWarning
from pandas.indexes.base import InvalidIndexErro... | pjryan126/solid-start-careers | store/api/zillow/venv/lib/python2.7/site-packages/pandas/tests/indexes/test_multi.py | Python | gpl-2.0 | 78,143 |
#!/usr/bin/python2.4
import numpy
from math import *
import pymbar
import timeseries
import commands
import os
import pdb
#import matplotlib.pyplot as plt
import optparse
import wham
import cPickle
import MBAR_pmfQz
import MBAR_4_state_pmf
def parse_args():
parser = optparse.OptionParser(description='Calculates t... | shirtsgroup/pygo | analysis/MBAR_all_umbrella.py | Python | gpl-2.0 | 4,994 |
# -*- coding: utf-8 -*-
# HDTV - A ROOT-based spectrum analysis software
# Copyright (C) 2006-2009 The HDTV development team (see file AUTHORS)
#
# This file is part of HDTV.
#
# HDTV is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# ... | op3/hdtv | hdtv/cut.py | Python | gpl-2.0 | 4,179 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Primary OmeroPy types
Classes:
- omero.client -- Main OmeroPy connector object
Copyright 2007, 2008 Glencoe Software, Inc. All rights reserved.
Use is subject to license terms supplied in LICENSE.txt
"""
from omero_version import omero_version
... | emilroz/openmicroscopy | components/tools/OmeroPy/src/omero/__init__.py | Python | gpl-2.0 | 3,189 |
try: paraview.simple
except: from paraview.simple import *
import numpy as np
from mpi4py import MPI
import os
import csv
from scipy import interpolate
import gc
import sys
gc.enable()
comm = MPI.COMM_WORLD
label = 'm_25_3b'
labelo = 'm_25_3b'
basename = 'mli'
## READ archive (too many points... somehow)
# args: n... | jungla/ICOM-fluidity-toolbox | 2D/RST/extract_Scalar_temp.py | Python | gpl-2.0 | 3,216 |
__version__ = version = '1.2.3'
| editeodoro/Bbarolo | pyBBarolo/_version.py | Python | gpl-2.0 | 32 |
# vim: set fileencoding=utf-8 :
# Copyright (C) 2008 Joao Paulo de Souza Medeiros
#
# Author(s): Joao Paulo de Souza Medeiros <ignotus21@gmail.com>
#
# 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 Foundat... | jpzm/bw | __init__.py | Python | gpl-2.0 | 1,267 |
#!/usr/bin/env python
####################################################
# Author: Arjun Sreedharan
# Email: arjun024@gmail.com
# Original Repo: github.com/arjun024/meg
# License: GPL v2
# IF YOU RELEASE ANY MODIFIED VERSION OF THIS CODE,
# YOU ARE REQUIRED TO MAKE THE MODIFIED SOURCE CODE
# AVAILABLE AS FR... | arjun024/extract-mp3-from-playlist | src/extract.py | Python | gpl-2.0 | 1,660 |
# -*- coding: utf-8 -*-
##
## presence.py
## Login : David Rousselie <dax@happycoders.org>
## Started on Wed Jun 27 22:05:08 2007 David Rousselie
## $Id$
##
## Copyright (C) 2007 David Rousselie
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public Lice... | dax/jmc | src/jmc/jabber/presence.py | Python | gpl-2.0 | 3,827 |
"""
.. module:: recording_rating_raw
The **Recording Rating Raw** Model.
PostgreSQL Definition
---------------------
The :code:`recording_rating_raw` table is defined in the MusicBrainz Server as:
.. code-block:: sql
CREATE TABLE recording_rating_raw
(
recording INTEGER NOT NULL, -- PK, r... | marios-zindilis/musicbrainz-django-models | musicbrainz_django_models/models/recording_rating_raw.py | Python | gpl-2.0 | 1,133 |
"""
:synopsis: Setup
:copyright: 2014 Nathan Lewis, See LICENSE.txt
.. moduleauthor:: Nathan Lewis <natewlew@gmail.com>
"""
__version__ = '0.1'
__author__ = 'Nathan Lewis'
__email__ = 'natewlew@gmail.com'
__license__ = 'GPL Version 2'
try:
import twisted
except ImportError:
raise SystemExit("twisted n... | natewlew/mythtvarchiveserver | setup.py | Python | gpl-2.0 | 1,038 |
#!flask/bin/python
from __future__ import with_statement
from contextlib import closing
# all the imports
import os
from werkzeug import *
import sqlite3
import json
from werkzeug.utils import secure_filename
from js import *
from flask import Flask, request, session, g, redirect, url_for, \
abort, render_templ... | djeshkov/guap | run.py | Python | gpl-2.0 | 5,584 |
#!/usr/bin/python
import sys
sys.path.append("/Users/niels/git/nanokong/tools/python")
import wkpf
from wkpf import WuObject
numericInputWuObject = WuObject(nodeId=1, portNumber=1, wuclassId=3)
lightSensorWuObject = WuObject(nodeId=1, portNumber=2, wuclassId=5)
thresholdWuObjectScenario1 = WuObject(nodeId=1, portNumb... | wukong-m2m/NanoKong | tools/demo20120423/showNodeStatus.py | Python | gpl-2.0 | 3,336 |
from flask import abort, jsonify, request, send_file, json, Response
from flask_login import login_required, current_user
from app import app, db, admin_only, auto
from app.models import errors
@app.route('/ThreatKB/errors', methods=['GET'])
@auto.doc()
@login_required
@admin_only()
def get_all_errors():
"""Retur... | InQuest/ThreatKB | app/routes/errors.py | Python | gpl-2.0 | 952 |
# last modified 20151215 changed sequencing selection to use sampling with
# replacement for all populations sizes
import numpy as np
import random as rnd
from itertools import groupby
import os
import random
#mySeed=2015
#random.seed(mySeed)
def encode(input_nparray):
'''
converts a numpy boolean array to... | jsemple19/BSA_simulation | recombSim2.py | Python | gpl-2.0 | 10,746 |
from reader import *
from dist import *
from sys import *
from table import *
def project(z,data):
d = anyi(data[z])
if d == len(data[z]):
d-=1
x = [0]*len(data[z])
y = [0]*len(data[z])
east = furthest(d,data,z)
west = furthest(data[z].index(east),data,z)
inde = data[z].index(east)
... | nave91/teak-nbtree | src/project.py | Python | gpl-2.0 | 1,490 |
#This script is made by cotax
#cotax is blenderartists.org user's nickname.
#1. Place a lamp in the scene and put its energy to 0.0
#2. Connect this script to the lamp, always(true)- python
#- Add a property: energy(float) to the lamp
#- Add a property: distance(integer) to the lamp
#Set the energy and dist... | adriansnetlis/bgmc16minosaur | bgmc16minosaur/Assets/Scripts/LightLOD.py | Python | gpl-2.0 | 659 |
import unittest
import settings
class TestSettings(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.enable_subtitles = settings.enable_subtitles
self.xbmc_language = settings.xbmc_language
self.subtitle_language = settings.subtitle_language
def tearDown(... | andresmargalef/xbmc-plugin.video.ted.talks | resources/lib/settings_test.py | Python | gpl-2.0 | 1,603 |
import os
import pathlib
import locale
import time
from . import xn_logger
logger = xn_logger.get(__name__, debug=False)
# Incapsulates downloaded pages storage
# keeps all downloaded files in ./cache
# the file first requested from this cache,
# and only if get() returns None, it will be
# downloaded over network
... | minlexx/xnovacmd | ui/xnova/xn_page_cache.py | Python | gpl-2.0 | 4,643 |
#!/usr/bin/env python
from pygale import pygale, prettypuff, gale_env, version
import sys, getopt, string, os, time
try:
import readline
except:
print 'No readline module found; line-editing capabilities unavailable'
# Default behavior
RETURN_RECEIPT = 0
def usage(arg):
print 'gsend.py version %s' % version.VERSI... | nandub/yammer | bin/gsend.py | Python | gpl-2.0 | 3,966 |
class Person:
def __init__(self, name):
self._name = name
@property
def name(self): # name = property(name)
"name property docs"
print('fetch...')
return self._name
@name.setter
def name(self, value): # name = name.setter(name)
... | simontakite/sysadmin | pythonscripts/learningPython/prop-person-deco.py | Python | gpl-2.0 | 954 |
# This handles all interactions needed for interpreting and controlling the charger
import time
import api_adc, config
import apigpio.api_gpio as api_gpio
# Charger Control
def init_control():
api_gpio.init_pin(27)
api_gpio.off_pin(27) # Set line to low
def deinit_control():
api_gpio.deinit_pin(27)
d... | lumened/battmonitor | api_charger.py | Python | gpl-2.0 | 2,610 |
# Copyright (C) 2006, Thomas Hamelryck (thamelry@binf.ku.dk)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Wrappers for PSEA, a program for secondary structure assignment.
See this citation for... | BlogomaticProject/Blogomatic | opt/blog-o-matic/usr/lib/python/Bio/PDB/PSEA.py | Python | gpl-2.0 | 2,747 |
#!/usr/bin/env python
# Copyright 2014 Rafael Dantas Justo. All rights reserved.
# Use of this source code is governed by a GPL
# license that can be found in the LICENSE file.
import getopt
import sys
import subprocess
import urllib.request
class NS:
def __init__(self):
self.name = ""
self.type = "NS"
... | rafaeljusto/shelter | testing/scan_querier/scan_querier.input.py | Python | gpl-2.0 | 3,451 |
# encoding: utf-8
# module samba.dcerpc.dnsserver
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/dnsserver.so
# by generator 1.135
""" dnsserver DCE/RPC """
# imports
import dcerpc as __dcerpc
import talloc as __talloc
# Variables with simple values
DNSSRV_TYPEID_ADDRARRAY = 34
DNSSRV_TYPEID_AUTOCONFIGURE = 4... | ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/dnsserver/__init__.py | Python | gpl-2.0 | 7,216 |
"""grace
Revision ID: 3d30c324ed4
Revises: 8c78a916f1
Create Date: 2015-09-07 08:51:46.375707
"""
# revision identifiers, used by Alembic.
revision = '3d30c324ed4'
down_revision = '8c78a916f1'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands aut... | huangtao-sh/grace | grace/alembic/versions/3d30c324ed4_grace.py | Python | gpl-2.0 | 531 |
# -*- coding: utf-8 -*-
from enigma import eEnv
from Components.SystemInfo import SystemInfo
from Components.config import config
from os import path, listdir
import xml.etree.cElementTree
from Plugins.Extensions.OpenWebif.__init__ import _
def addCollapsedMenu(name):
tags = config.OpenWebif.webcache.collapsedmenus... | MOA-2011/enigma2-plugin-extensions-openwebif | plugin/controllers/models/config.py | Python | gpl-2.0 | 7,243 |
import fauxfactory
import pytest
from widgetastic.utils import partial_match
from wrapanapi.exceptions import ImageNotFoundError
from cfme import test_requirements
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.exceptions import ItemNotFound
from cfme.mark... | izapolsk/integration_tests | cfme/tests/cloud/test_tag_mapping.py | Python | gpl-2.0 | 9,719 |
# this is based on jsarray.py
from ..base import *
try:
import numpy
except:
pass
@Js
def Uint16Array():
TypedArray = (PyJsInt8Array,PyJsUint8Array,PyJsUint8ClampedArray,PyJsInt16Array,PyJsUint16Array,PyJsInt32Array,PyJsUint32Array,PyJsFloat32Array,PyJsFloat64Array)
a = arguments[0]
if isinstance(... | caasiu/xbmc-addons-chinese | plugin.video.dnvodPlayer/js2py/constructors/jsuint16array.py | Python | gpl-2.0 | 3,043 |
# -*- coding: utf-8 -*-
#
# This file is part of HEPData.
# Copyright (C) 2016 CERN.
#
# HEPData 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) any later... | eamonnmag/hepdata3 | hepdata/modules/records/api.py | Python | gpl-2.0 | 24,761 |
__all__ = ["particle_tracing"]
import particle_tracing
| hpfem/agros2d | resources/test/test_suite/particle_tracing/__init__.py | Python | gpl-2.0 | 56 |
import os
import csv
import sys
import numpy as np
print sys.maxsize
csv.field_size_limit(922337203)
dataFile=open('TMCsCenterLatLon.txt','r')
edgeFile=open("edgeList.txt","w")
tmcID={}
for i,line in enumerate(dataFile.readlines()):
line=line.strip().split()
tmcID[line[0]]=i
print tmcID
edgeList=[]
for i in... | newera912/WeatherTransportationProject | data/trafficData/I90_TravelTime/readData.py | Python | gpl-2.0 | 2,329 |
import string
from vrtManager import util
from vrtManager.connection import wvmConnect
from webvirtcloud.settings import QEMU_CONSOLE_DEFAULT_TYPE
def get_rbd_storage_data(stg):
xml = stg.XMLDesc(0)
ceph_user = util.get_xml_path(xml, "/pool/source/auth/@username")
ceph_host = util.get_xml_path(xml, "/pool... | harry-ops/opencloud | webvirtcloud/vrtManager/create.py | Python | gpl-2.0 | 7,955 |
#
# Copyright (c) 2012 Citrix Systems, 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 2 of the License, or
# (at your option) any later version.
#
# This program is dist... | OpenXT/sync-database | sync_db/run_script.py | Python | gpl-2.0 | 2,130 |
from functools import wraps
import logging
import traceback
from django.conf import settings
from django.core import management
from django.contrib import messages
from django.contrib.auth import authenticate
from django.http import Http404
from django.shortcuts import redirect
from django.shortcuts import render
from ... | Kegbot/kegbot-server | pykeg/web/setup_wizard/views.py | Python | gpl-2.0 | 6,069 |
import logging
from gettext import gettext as _
from .l_connector import ConnectorBase
from .l_net import ModuleStrategyBase
from .main import OptionsWIFI
logger = logging.getLogger(__name__)
# noinspection PyAbstractClass
class Connector(ConnectorBase):
opti_: OptionsWIFI
class Module(ModuleStrategyBase):
... | AnTAVR/aai2 | src/modules/net/m_wifi.py | Python | gpl-2.0 | 517 |
# -*- coding: utf-8 -*-
import attr
from navmazing import NavigateToAttribute
from widgetastic.widget import NoSuchElementException
from widgetastic.widget import Text
from widgetastic.widget import View
from widgetastic_patternfly import BootstrapNav
from widgetastic_patternfly import BreadCrumb
from widgetastic_patte... | RedHatQE/cfme_tests | cfme/storage/object_store_object.py | Python | gpl-2.0 | 6,631 |
# coding=utf-8
import os, sys, shutil, unicodedata, re, types
from htmlentitydefs import name2codepoint
import xbmc, xbmcaddon, xbmcplugin, xbmcgui, xbmcvfs
import xml.etree.ElementTree as xmltree
import urllib
from unidecode import unidecode
from urlparse import parse_qs
from traceback import print_exc
if sys.versio... | zag2me/plugin.program.video.node.editor | addon.py | Python | gpl-2.0 | 42,963 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Jakob Luettgau
#
# 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 l... | jakobluettgau/feo | tapesim/components/FileManager.py | Python | gpl-3.0 | 2,010 |
from collections import OrderedDict
import os
from os.path import abspath, dirname
from django.core.exceptions import ImproperlyConfigured
ENV_VARIABLE_PREFIX = 'LL'
def get_env_variable(var_name):
"""Get the environment variable or return exception"""
if not ENV_VARIABLE_PREFIX:
raise ImproperlyCon... | 596acres/django-livinglots-template | project_name/project_name/settings/base.py | Python | gpl-3.0 | 8,268 |
#
# x86header.py
#
# Copyright (C) 2009 Gil Dabah, http://ragestorm.net/disops/
#
class OperandType:
""" Types of possible operands in an opcode.
Refer to the diStorm's documentation or diStorm's instructions.h
for more explanation about every one of them. """
(NONE,
IMM8,
IMM16,
... | abahdanovich/distorm | disOps/x86header.py | Python | gpl-3.0 | 6,156 |
#
#
#
import requests
from bs4 import BeautifulSoup
import re
import os
def all_links(URL,abs=False,session=None):
'''Generator function for all links in a page.
ARGS:
URL -> url of the page
abs -> (True) returns actual 'href's of each <a> tag (False) process each 'href' to generate the full li... | RRostami/Spiderpy | spiderpy/core.py | Python | gpl-3.0 | 2,986 |
#
# GeoCoon - GIS data analysis library based on Pandas and Shapely
#
# Copyright (C) 2014 by Artur Wroblewski <wrobell@pld-linux.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 ve... | wrobell/geocoon | geocoon/tests/test_core.py | Python | gpl-3.0 | 9,461 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask_hypertable.testsuite import main
main() | coderfi/Flask-Hypertable | run-tests.py | Python | gpl-3.0 | 97 |
#!python3
import argparse
import scmFile
if __name__ == "__main__":
parser = argparse.ArgumentParser()
g = parser.add_mutually_exclusive_group(required=True)
g.add_argument('-r', '--read', action="store_const", dest="mode", const="read",
help="Convert SCM to one or more CSV")
g.add_... | iarspider/pyscm | main.py | Python | gpl-3.0 | 834 |
#!/usr/bin/env python3
# Copyright (C) 2013-2016 Florian Festi
#
# 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.... | florianfesti/boxes | boxes/generators/dispenser.py | Python | gpl-3.0 | 4,538 |
#!/usr/bin/env python
import unittest, os, shutil
from planet import config, opml
from os.path import split
from glob import glob
from ConfigParser import ConfigParser
workdir = os.path.join('tests', 'work', 'config', 'cache')
class ReadingListTest(unittest.TestCase):
def setUp(self):
config.load('tests/... | arpan-chavda/rh_app | libs/venus/tests/test_rlists.py | Python | gpl-3.0 | 1,477 |
import re
import sys
import xbmc
import xbmcaddon
import xbmcplugin
import xbmcgui
import http
try:
import StorageServer
except:
import storageserverdummy as StorageServer
HANDLE=int(sys.argv[1])
ADDON_NAME = re.findall('plugin:\/\/([\w\d\.]+)\/', sys.argv[0])[0]
__settings__ = xbmcaddon.Addon(ADDON_NAME)
__l... | LordCorellon/plugin.video.9anime | resources/lib/ui/control.py | Python | gpl-3.0 | 3,032 |
from django.conf.urls import url
from profiles import views
urlpatterns = [
url(r"users$", views.UserList.as_view(),
name="api-user-list"),
url(r"user/(?P<pk>[0-9]+)$", views.UserSingle.as_view(),
name="api-review-list"),
url(r"userlogin$", views.UserLogin.as_view(),
name="api-lo... | oktayuyar/Velespi | profiles/urls.py | Python | gpl-3.0 | 328 |
# -*- coding: utf-8 -*-
from django.urls import re_path
from django.contrib.auth import views as auth_views
from django.utils.translation import gettext_lazy as _
from django.urls import reverse_lazy
from . import forms
from . import views
app_name = "auth"
urlpatterns = [
# Sign in / sign out
re_path(
... | erudit/eruditorg | eruditorg/apps/public/auth/urls.py | Python | gpl-3.0 | 2,483 |
"""
Copyright 2014
This file is part of Phase.
Phase 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.
Phase is distributed in the hope that... | phase-dev/phase | libphase/tabs/vulnerabilities.py | Python | gpl-3.0 | 6,578 |
#!/usr/bin/env python
"""
This example shows how to catch more than one exception type in python.
The syntax is:
except <tuple of exception types> as e:
"""
def raise_it(a_type):
raise a_type('hello')
for x in ValueError, RuntimeError:
try:
raise_it(x)
except (ValueError, RuntimeError) as e:... | veltzer/demos-python | src/examples/short/exception_handling/catch_more_than_one_exception_type.py | Python | gpl-3.0 | 344 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('DrydenMusicApp', '0004_auto_20160824_2150'),
]
operations = [
migrations.CreateModel(
name='teaching_link',
... | jdovi/drydenmusic | DrydenMusicApp/migrations/0005_teaching_link.py | Python | gpl-3.0 | 1,017 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-10 00:42
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('videoclases', '0059_scala_custom_cal'),
]
operations = [
migrations.AlterFi... | Videoclases/videoclases | videoclases/migrations/0060_auto_20170909_2142.py | Python | gpl-3.0 | 495 |
# Copyright 2011 Marek Schmidt
#
# This file is part of ManaClash
#
# ManaClash 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.
#
# Ma... | fregaham/manaclash | cost.py | Python | gpl-3.0 | 8,669 |
from ranges import range_overlap
def test_no_overlap():
assert range_overlap([ (0.0, 1.0), (5.0, 6.0) ]) == None
def test_length_zero_overlap():
assert range_overlap([ (0.0, 1.0), (1.0, 2.0) ]) == None
def test_single_range():
assert range_overlap([ (0.0, 1.0) ]) == (0.0, 1.0)
def test_negative_rang... | apollo-ng/governess | server/tests/test_range_overlap.py | Python | gpl-3.0 | 432 |
# -*- coding: utf-8 -*-
"""
General description
-------------------
This example shows how to perform a capacity optimization for
an energy system with storage. The following energy system is modeled:
input/output bgas bel
| | | |
| ... | oemof/oemof_examples | oemof_examples/oemof.solph/v0.4.x/storage_investment/v1_invest_optimize_all_technologies.py | Python | gpl-3.0 | 6,671 |
# coding: utf-8
from __future__ import unicode_literals
import re
from .adobepass import AdobePassIE
from ..utils import (
int_or_none,
determine_ext,
parse_age_limit,
urlencode_postdata,
ExtractorError,
)
class GoIE(AdobePassIE):
_SITE_INFO = {
'abc': {
'brand': '001',
... | israeltobias/DownMedia | youtube-dl/youtube_dl/extractor/go.py | Python | gpl-3.0 | 6,104 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 The Ontario Institute for Cancer Research. All rights reserved.
#
# This program and the accompanying materials are made available under the terms of the GNU Public License v3.0.
# You should have received a copy of the GNU General Public License along wi... | icgc/icgc-get | icgcget/clients/errors.py | Python | gpl-3.0 | 1,717 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-08-08 09:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ProfileMaker', '0009_auto_20161020_0959'),
]
operations = [
migrations.AddField(
model_name='extensionpack... | ESSolutions/ESSArch_Core | ESSArch_Core/essxml/ProfileMaker/migrations/0010_auto_20170808_1114.py | Python | gpl-3.0 | 573 |
from django.conf.urls import url
from core.views import add_feedback
urlpatterns = [
url('^add/core/feedback', name='add_feedback', view=add_feedback),
] | bonnieblueag/farm_log | core/urls.py | Python | gpl-3.0 | 158 |
"""Methods to set media related (resolution, length) scene properties"""
import bpy
def setup(animated, width, height, length):
"""
Sets up the type, resolution and length of the currently open scene
The render resolution of the scene is set, and additionally ...
... for stills, sets the length of... | apertus-open-source-cinema/elmyra | src/python/lib/media.py | Python | gpl-3.0 | 974 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | mementum/backtrader | backtrader/feeds/csvgeneric.py | Python | gpl-3.0 | 5,624 |
""" KeystoneClient class encapsulates the work with the keystone service interface
"""
import requests
from DIRAC import S_OK, S_ERROR, gLogger
from DIRAC.Core.Utilities.Time import fromString, dateTime
class KeystoneClient(object):
def __init__(self, url, parameters):
self.log = gLogger.getSubLogger("Ke... | DIRACGrid/DIRAC | src/DIRAC/Resources/Cloud/KeystoneClient.py | Python | gpl-3.0 | 10,059 |
import gentestcases, cmdline, util, setup, report, convert, resfile
import os, re, locale
true, false = 1,0
#--------------------------------------------------------------------------------
# Execute type checker test environment.
# lang - language to use (SL, PP, RT)
# type - type of test (either spec or impl)
# retu... | vdmtools/vdmtools | test/powertest/tcrun.py | Python | gpl-3.0 | 14,259 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-28 04:43
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('atlas_doc', '0007_page_version'),
]
operations = [
migrations.AlterField(
... | robertdown/atlas_docs | atlas_doc/migrations/0008_auto_20170828_0043.py | Python | gpl-3.0 | 461 |
################################################################
# ##
# Example 1: Converting ArcGIS solar radiation graphics to ##
# horizon coordinate points ##
############################################################... | geocryology/HorizonPy | Examples/Example_1/Example_1_v2.py | Python | gpl-3.0 | 948 |
from django.shortcuts import render
from core.views import get_add_model_form
from livestock.models import EggCollection, AnimalReport
from livestock.forms import EggCollectionForm, AnimalReportForm
ADD_LIVESTOCK_TEMPLATE = 'livestock/add_livestock_model.html'
def add_egg_collection(request):
return get_add_mode... | bonnieblueag/farm_log | livestock/views.py | Python | gpl-3.0 | 571 |
"""
Plugin Name : EiMM
Plugin Version : 0.1
Description:
Utilities for the Mafia-spinoff free-for-all game,
Everyone is Mafia Mafia.
Contributors:
- Euklyd / Popguin
License:
Arcbot is free software: you can redistribute it and/or modify it
under the terms ... | euklyd/PenguinBot3K | plugins/EiMM.py | Python | gpl-3.0 | 35,247 |
#!/bin/bash
# -*- codign:utf-8 -*-
# pyface.menuWidget.Menu_Widget
# Coded by Richard Polk
#----------------------------------------------------
from Tkinter import *
class Menu_Widget:
def __init__(self):
# Menu metrics
frame_height = self.sub_frame_height = self.guiDct['sub_frame_height']
fra... | geosdude/pyFace | menuWidget.py | Python | gpl-3.0 | 8,829 |
from . import util_CMB
import healpy as hp
import numpy as np
import os
import glob
def generate_covariances(m1, inst):
"""
Create a weight map using the smaller eigenvalue of the polarization matrix
The resulting covariances are saved on the disk.
Parameters
----------
* m1: object, conta... | JulienPeloton/LaFabrique | LaFabrique/covariance.py | Python | gpl-3.0 | 3,857 |
# 22. Generate Parentheses My Submissions QuestionEditorial Solution
# Total Accepted: 90088 Total Submissions: 240551 Difficulty: Medium
# Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
#
# For example, given n = 3, a solution set is:
#
# "((()))", "(()())", "... | shawncaojob/LC | PY/22_generate_parentheses.py | Python | gpl-3.0 | 3,269 |
import random
from unittest import TestCase
from hamcrest import *
from array_util import get_random_array
from chapter16.textbook16_2 import fractional_knapsack
from datastructures.array import Array
from util import between
def part_item_value(item_partial_weight, item_total_weight, item_value):
return item_p... | wojtask/CormenPy | test/test_chapter16/test_textbook16_2.py | Python | gpl-3.0 | 1,705 |
def init():
global ARGS
global CONFIG_FILE_CONTENT
global CONFIG_FILE_NAME
global CONFIG_FILE_PATH
global GIT_OBJECTS
ARGS = []
CONFIG_FILE_CONTENT = []
CONFIG_FILE_NAME = ".giwyn"
CONFIG_FILE_PATH = ""
GIT_OBJECTS = []
| k0pernicus/giwyn | giwyn/lib/settings/settings.py | Python | gpl-3.0 | 261 |
import unittest
import testing_helper
from datetime import datetime, timedelta
from softsailor.utils import *
from softsailor.vr.vr_wind import *
from softsailor.vr.vr_weather import *
from softsailor.vr.vr_settings import *
class FakeWeather:
lat_min = 0
lat_max = 0.75
lat_n = 4
lon_min = -0.1
l... | jrversteegh/softsailor | softsailor/vr/tst/test_vr_wind.py | Python | gpl-3.0 | 2,867 |
# -*- coding: utf-8 -*-
# (c) Nelen & Schuurmans. GPL licensed, see LICENSE.rst.
"""
Period looper for atomic scripts.
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
from __future__ import division
import datetime
import math
import re
from r... | tomvansteijn/openradar | openradar/periods.py | Python | gpl-3.0 | 1,780 |
from pycraft_minetest import *
pos = where()
chat(pos)
maze("maze1.csv")
t = turtle(obsidian)
t.forward(10)
move(3, 10, 5)
chat(where())
sphere(ice, y=-20)
circle([wool, 5], direction="horizontal")
line(gold, 0, 0, 0, 0, 50, 0)
block(iron, y=3)
blocks(wood, x=5, y=6, z=10)
size = readnumber("tell the size...... | gmenegoz/pycraft | projects/test.py | Python | gpl-3.0 | 1,511 |
import os.path
import zipfile
import tempfile
import logging
import json
from gi.repository import Gtk
from gi.repository import GLib
from gi.repository import Pango
from operator import itemgetter
from gtweak.utils import extract_zip_file, execute_subprocess
from gtweak.gshellwrapper import GnomeShell, GnomeShellFac... | bendavis78/gnome-tweak-tool | gtweak/tweaks/tweak_group_shell_extensions.py | Python | gpl-3.0 | 13,162 |
import numpy as np
import matplotlib.pyplot as plt
from IPython import get_ipython
ipy = get_ipython()
ipy.magic("matplotlib qt")
plt.style.use('ggplot')
from sklearn.ensemble import IsolationForest
from sklearn.svm import OneClassSVM
#KNN
l = 5000 #total groups
d = 2 #dimension of data
n = 100 ... | gregstarr/anomaly-detection | iforest.py | Python | gpl-3.0 | 4,450 |
class Solution(object):
def asteroidCollision(self, asteroids):
"""
:type asteroids: List[int]
:rtype: List[int]
"""
ret = []
for elem in asteroids:
if elem > 0:
ret.append(elem)
else:
while ret:
... | wufangjie/leetcode | 735. Asteroid Collision.py | Python | gpl-3.0 | 882 |
# pylint: disable=line-too-long
import datetime
import psycopg2
import pytz
CREATE_PROBE_TABLE_SQL = 'CREATE TABLE builtin_lightprobe(id SERIAL PRIMARY KEY, user_id TEXT, guid TEXT, timestamp DOUBLE PRECISION, utc_logged TIMESTAMP, sensor_vendor TEXT, sensor_name TEXT, sensor_power DOUBLE PRECISION, sensor_type BIGIN... | cbitstech/Purple-Robot-Django | management/commands/extractors/builtin_lightprobe.py | Python | gpl-3.0 | 7,242 |
import requests
from django.shortcuts import render
# Create your views here.
from django.template.response import TemplateResponse
from account.models import OAuthToken
def list_azure_groups(request):
token = OAuthToken.objects.filter(user=request.user, service__name='microsoft').last()
if token is None:
... | BdEINSALyon/resa | permissions/views.py | Python | gpl-3.0 | 589 |
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 11 17:55:48 2016
用欧拉法计算自行车从静止起步后的速度
@author: nightwing
"""
import matplotlib.pyplot as plt
DENSITY = 1.29 #空气密度(kg/m3)
C = 1.0 #阻力系数
A = 0.33 #截面积(m2)
M = 70.0 #人车质量(kg)
v = 7.0 #转折速度(m/s)
v1 = 0.0 #(无阻力)速度(m/s)
v2 = 0.0 #(有阻力)速度(m/s... | WuShichao/computational-physics | 2/2_5/2_5.py | Python | gpl-3.0 | 1,353 |
#!/usr/bin/env python
# -*- mode: python; coding: utf-8; -*-
# ---------------------------------------------------------------------------#
#
# Copyright (C) 1998-2003 Markus Franz Xaver Johannes Oberhumer
# Copyright (C) 2003 Mt. Hood Playing Card Co.
# Copyright (C) 2005-2009 Skomoroh
#
# This program is free softwar... | shlomif/PySolFC | pysollib/kivy/selecttree.py | Python | gpl-3.0 | 3,420 |
from django.shortcuts import render
from django.http import HttpResponse
from django.db.models import Q, F
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from posts.models import Posts
from uploadfiles.models import UploadFile
from edu_warning.tools import user_setting
# Create your views he... | ran777/edu_intell | edu_creative/views.py | Python | gpl-3.0 | 3,325 |
# -*- coding: utf-8 -*-
"""
jinja2.loaders
~~~~~~~~~~~~~~
Jinja loader classes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import weakref
from types import ModuleType
from os import path
from hashlib import sha1
from jinja2.excepti... | ncdesouza/bookworm | env/lib/python2.7/site-packages/jinja2/loaders.py | Python | gpl-3.0 | 17,038 |
#!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from os import curdir, sep
import os
PORT_NUMBER = 8082
class myHandler(BaseHTTPRequestHandler):
def do_GET(self):
mimetype='text/html'
if self.path.endswith(".gif"):
mimetype='image/gif'
elif se... | AABoyles/SlideGallery | index.py | Python | gpl-3.0 | 1,372 |
import sys
import urwid
class DialogExit(Exception):
pass
class DialogDisplay:
palette = [
('body','black','light gray', 'standout'),
('border','black','dark blue'),
('shadow','white','black'),
('selectable','black', 'dark cyan'),
('focus','white','dark blue','bold')... | Lamisator/notology | src/dialogs.py | Python | gpl-3.0 | 3,312 |
#
# Copyright © 2012 - 2021 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.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 Lice... | phw/weblate | weblate/formats/tests/test_external.py | Python | gpl-3.0 | 1,836 |
## numpy-oldnumeric calls replaced by custom script; 09/06/2016
## Automatically adapted for numpy-oldnumeric Mar 26, 2007 by alter_code1.py
##
## Biskit, a toolkit for the manipulation of macromolecular structures
## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner
##
## This program is free software; you can r... | graik/biskit | archive_biskit2/Biskit/AmberEntropyMaster.py | Python | gpl-3.0 | 25,638 |
"""
WSGI config for setup 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.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTIN... | borringrafael/fichas-equipes-ab | setup/wsgi.py | Python | gpl-3.0 | 399 |