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.auth.decorators import login_required, permission_required,\
user_passes_test
from django.shortcuts import render_to_response, get_object_or_404
from django.template.context import RequestContext
from project.tramitacao.forms import FormTipoProcesso
from project.tramitacao.models import Tbtipopr... | waldenilson/TerraLegal | project/tramitacao/restrito/tipo_processo.py | Python | gpl-2.0 | 6,716 |
# -*- coding: utf-8 -*-
"""Tests for mac notes plugin."""
from __future__ import unicode_literals
import unittest
from plaso.lib import definitions
from plaso.parsers.sqlite_plugins import mac_notes
from tests.parsers.sqlite_plugins import test_lib
class MacNotesTest(test_lib.SQLitePluginTestCase):
"""Tests for ... | rgayon/plaso | tests/parsers/sqlite_plugins/mac_notes.py | Python | apache-2.0 | 1,683 |
from PyQt5 import QtCore, QtWidgets
import chigger
import peacock
from peacock.ExodusViewer.plugins.ExodusPlugin import ExodusPlugin
from MeshBlockSelectorWidget import MeshBlockSelectorWidget
class BlockHighlighterPlugin(peacock.base.PeacockCollapsibleWidget, ExodusPlugin):
"""
Widget for controlling the visi... | yipenggao/moose | python/peacock/Input/BlockHighlighterPlugin.py | Python | lgpl-2.1 | 3,928 |
# 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 writing, software
# distributed under t... | mahak/keystone | keystone/assignment/role_backends/resource_options.py | Python | apache-2.0 | 990 |
""" Peripheral On Demand global define
"""
import periphondemand
#global
POD_CONFIG="~/.podrc"
POD_PATH = periphondemand.__path__[0]
PLATFORMPATH = "/platforms"
BUSPATH = "/busses/"
TEMPLATESPATH = "/templates"
TOOLCHAINPATH = "/toolchains"
SIMULATIONPATH = "/simulation"
SYNTHESISPATH = "/synthesis"
DRIVERSPATH = "/... | magyarm/periphondemand-code | src/bin/define.py | Python | lgpl-2.1 | 1,265 |
from django.shortcuts import render_to_response
from django.template import RequestContext
def index(request):
return render_to_response('index.html', {}, context_instance=RequestContext(request)) | fabioz/django-tornado-websockets-openshift | mysite/views.py | Python | mit | 202 |
import os
import time
from collections import Counter
from re import findall
from unittest import skip
from cassandra import ConsistencyLevel
from ccmlib.common import is_win
from ccmlib.node import Node
from nose.plugins.attrib import attr
from assertions import assert_almost_equal, assert_one
from dtest import Test... | thobbs/cassandra-dtest | repair_tests/incremental_repair_test.py | Python | apache-2.0 | 14,693 |
#!/usr/bin/env python3
import sys
import math
import json
import gps_to_mileage
from PIL import Image, ImageDraw, ImageOps
import plate_c as aar_plate
import class_i as fra_class
WIDTH=500
HEIGHT=700
LIDAR_X = WIDTH / 2
LIDAR_Y = .8 * HEIGHT
LIDAR_RADIUS = .4 * WIDTH
SCALE=10
DIRECTION=-1 # -1=backwards, 1=... | cpn18/track-chart | desktop/archive/plot_lidar.py | Python | gpl-3.0 | 13,916 |
# repowidget.py - TortoiseHg repository widget
#
# Copyright (C) 2007-2010 Logilab. All rights reserved.
# Copyright (C) 2010 Adrian Buehlmann <adrian@cadifra.com>
#
# This software may be used and distributed according to the terms
# of the GNU General Public License, incorporated herein by reference.
import binascii... | seewindcn/tortoisehg | src/tortoisehg/hgqt/repowidget.py | Python | gpl-2.0 | 84,333 |
#
# Python bindings for libparted (built on top of the _ped Python module).
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) a... | hpfn/pyparted_debian_dir | src/parted/cachedlist.py | Python | gpl-2.0 | 3,527 |
# Dialog for creating new encryption passphrase
#
# Copyright (C) 2012 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This pr... | gautamMalu/XenInBox | pyanaconda/ui/gui/spokes/lib/passphrase.py | Python | gpl-2.0 | 6,169 |
from tkinter import *
from tksimpledialog import Dialog
from amcquestion import AMCQuestion
class EditQuestionDialog(Dialog):
def __init__(self, current_question, parent, title = None):
self.updated_question = None
self.question = current_question
Dialog.__init__(self, parent, title)
def body(self, m... | jarthurgross/amc_question_creator | amc_question_dialogs.py | Python | mit | 4,693 |
#!/usr/bin/env python
# Copyright (c) 2012 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.
"""Wrapper around
third_party/WebKit/Tools/Scripts/new-run-webkit-httpd"""
import os
import subprocess
import sys
def main():
... | aYukiSekiguchi/ACCESS-Chromium | webkit/tools/layout_tests/run_http_server.py | Python | bsd-3-clause | 800 |
import json
import requests
__author__ = 'tony petrov'
import datetime
import twython
from twython import TwythonStreamer, TwythonError
import random
import string
import constants
import constants as c
from utils import user_filter
import storage as st
import test_struct as test
import pytumblr
import threading
imp... | 2087829p/smores | smores/handlers.py | Python | mit | 26,442 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
("""
Usage:
img2txt.py <imgfile> [--maxLen=<n>] [--fontSize=<n>] [--color] [--ansi]"""
"""[--bgcolor=<#RRGGBB>] [--targetAspect=<n>] [--antialias] [--dither]
img2txt.py (-h | --help)
Options:
-h --help show this screen.
--ansi out... | mackay/ble_detector | img2txt/_img2txt.py | Python | mit | 13,718 |
# ======================================================================
import numpy
vb = False
# Age of the Universe:
t0 = 13.73 # Gyr, XXX et al XXXX
t0err = 0.15
# Units etc:
Gyr2sec = 1e9*365.25*24*3600
Mpc2km = 1e6*3.0856e16/1e3
kms2MpcperGyr = Gyr2sec/Mpc2km
# print "To convert km/s to Mpc/Gyr, multiply by",... | drphilmarshall/LocalGroupHaloProps | localgroup/timingargument.py | Python | gpl-2.0 | 5,676 |
#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
Create a CSV with each race since 1990, with the rid and the Wikidata qid.
"""
import os
import requests
from bs4 import BeautifulSoup
import re
import csv
race_qids= {}
root_dir = os.environ['HOME'] + "/Dropbox/finnmarkslopet/"
with open(root_dir + 'finnmarkslopet... | Ash-Crow/mush-bot | finnmarkslopet-scraper.py | Python | bsd-3-clause | 1,539 |
"""
pyphoto.flickr_uploader
~~~~~~~~~~~~~~~~
Uploads photos to flickr.
:copyright: (c) 2013 by Michael Luckeneder.
"""
from __future__ import absolute_import
import flickrapi
import logging
from urllib2 import HTTPError
from flickrapi.exceptions import FlickrError
from .retrier import retrier
from fun... | optiminimalist/pyphoto | pyphoto/flickr_uploader.py | Python | mit | 8,573 |
#!usr/bin/python
'''
Overlay classes and satellite data
'''
import os,csv,json
import utils.gdal_rasterize as gdal_rasterize
from PIL import Image
from functools import partial
from multiprocessing import Pool
from utils.coordinate_converter import CoordConvert
from utils.getImageCoordinates import imageCoordinates
fro... | worldbank/cv4ag | modules/overlay.py | Python | mit | 12,673 |
__all__ = ["GentooServiceProvider"]
from kokki.providers.service import ServiceProvider
class GentooServiceProvider(ServiceProvider):
def enable_runlevel(self, runlevel):
pass
| samuel/kokki | kokki/providers/service/gentoo.py | Python | bsd-3-clause | 191 |
import requests
try:
from json.decoder import JSONDecodeError
except ImportError:
class JSONDecodeError(ValueError):
pass
from ..constants import OK, WARNING, ERROR
from ..decorators import timed
from . import Resource
class Service(Resource):
"""
Checks the status of a service with an HTTP G... | TabbedOut/django_canary_endpoint | canary_endpoint/resources/services.py | Python | mit | 2,339 |
# Yahoo! OAuth Credentials - http://developer.yahoo.com/dashboard/
# Credentials for an App hunter registered to be used only for test
CONSUMER_KEY = 'dj0yJmk9clJFN2N6bTRSM3E4JmQ9WVdrOWJHSkdhamRFTm1VbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD0zZQ--'
CONSUMER_SECRET = 'f9545904f2cc39f67104031c32ef83dfe37c6570'
APPLI... | nsmader/fantasy-manager-bot | make_connection.py | Python | gpl-3.0 | 1,281 |
from HTMLComponent import HTMLComponent
from GUIComponent import GUIComponent
from skin import parseColor, parseFont
from enigma import eListboxServiceContent, eListbox, eServiceCenter, eServiceReference, gFont, eRect
from Tools.LoadPixmap import LoadPixmap
from Tools.TextBoundary import getTextBoundarySize
from Tool... | openmips/stbgui | lib/python/Components/ServiceList.py | Python | gpl-2.0 | 15,015 |
# -*- coding: utf-8 -*-
#
# Copyright 2016 edX PDR Lab, National Central University, Taiwan.
#
# http://edxpdrlab.ncu.cc/
#
# 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://w... | yrchen/CommonRepo | commonrepo/groups/views.py | Python | apache-2.0 | 9,831 |
import xml.etree.cElementTree as ET
from time import sleep
from django.utils import timezone
from datetime import timedelta
from random import shuffle
from django.contrib.gis.geos import Point, Polygon
from django.contrib.gis.db.models import Extent
from bustimes.models import Trip
from ..import_live_vehicles import I... | jclgoodwin/bustimes.org.uk | vehicles/management/commands/import_live_acis.py | Python | mpl-2.0 | 5,585 |
# encoding: utf-8
import datetime
__all__ = [
'info',
]
def info():
return {
'birthday': datetime.date(1990, 12, 10),
'class': 7,
'family_name_en': u'matsui',
'family_name_kana': u'まつい',
'first_name_en': u'sakiko',
'first_name_kana': ... | moriyoshi/pyakb48 | akb48/member/matsui_sakiko.py | Python | mit | 646 |
# -*- coding: utf-8 -*-
"""
===============================================
.. module::
:platform: Unix, Windows
:synopsis:
:deprecated:
.. moduleauthor:: (C) 2014 Oliver Gutiérrez
"""
from pyevo.http import nvp_request
def translate(apikey,text,from_lang,to_lang):
"""
Translation to english fu... | olivergs/pyevo | pyevo/api/googletranslate.py | Python | mit | 730 |
# -*- coding: utf-8 -*-
# $Id: search_engine_query_parser.py,v 1.12 2008/06/13 15:35:13 rivanov Exp $
# This file is part of Invenio.
# Copyright (C) 2009, 2010, 2011 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 F... | CERNDocumentServer/invenio | modules/bibexport/lib/bibexport_method_fieldexporter.py | Python | gpl-2.0 | 21,705 |
from collections import OrderedDict as dict
from ...core import Component
class CameraComponent(Component):
""" Camera Component class
"""
# Defaut type/name the component will have
DEFAULT_TYPE = "camera"
defaults = dict( {"camera": None} )
def __init__(self, *args, **kwargs):
""" C... | jsa4000/OpenGL-Python | zero/components/geometry/camera.py | Python | apache-2.0 | 427 |
# coding: utf-8
from __future__ import unicode_literals
from collections import defaultdict
from datetime import datetime
from debug_toolbar.panels import Panel
from django.conf import settings
from django.core.cache import cache
from django.db.models.loading import get_models
from django.utils.translation import uge... | GetAmbassador/django-cachalot | cachalot/panels.py | Python | bsd-3-clause | 2,344 |
import datetime, os
from sqlalchemy import *
from sqlalchemy import event
from sqlalchemy import sql
from sqlalchemy.orm import *
from sqlalchemy.ext.horizontal_shard import ShardedSession
from sqlalchemy.sql import operators
from test.lib import *
from test.lib.engines import testing_engine
from test.lib.testing impor... | ioram7/keystone-federado-pgid2013 | build/sqlalchemy/test/ext/test_horizontal_shard.py | Python | apache-2.0 | 7,477 |
# -*- coding: utf-8 -*-
"""
blohg.vcs_backends.git.filectx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Model with classes to represent Git file context.
:copyright: (c) 2010-2013 by Rafael Goncalves Martins
:license: GPL-2, see LICENSE for more details.
"""
import os
import time
from flask.helpers import lock... | liuyxpp/blohg | blohg/vcs_backends/git/filectx.py | Python | gpl-2.0 | 4,508 |
#!/usr/bin/env python
"""
i3t.py -- list i3wm windows, get next window id, wrap/loop around
Configuration (``.i3/config``)::
set $i3t_alt_tab ~/-dotfiles/src/i3t/i3t.py n
set $i3t_alt_shift_tab ~/-dotfiles/src/i3t/i3t.py p
bindsym Mod1+Tab exec exec $i3t_alt_tab
bindsym Mod1+Shift+Tab exec ... | westurner/dotfiles | scripts/i3t.py | Python | bsd-3-clause | 4,459 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | keras-team/keras | keras/utils/vis_utils_test.py | Python | apache-2.0 | 8,431 |
import re
from ztag.annotation import Annotation
from ztag.annotation import OperatingSystem
from ztag import protocols
import ztag.test
class FtpKebi(Annotation):
protocol = protocols.FTP
subprotocol = protocols.FTP.BANNER
port = None
impl_re = re.compile("^220- Kebi FTP Server", re.IGNORECASE)
... | zmap/ztag | ztag/annotations/FtpKebi.py | Python | apache-2.0 | 3,682 |
# -*- coding: utf-8 -*-
'''
XBMC ESO video add-on.
Copyright (C) 2013 José Antonio Montes (jamontes)
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, o... | jamontes/plugin.video.eso | default.py | Python | gpl-3.0 | 10,225 |
import os
import logging
import json
from wpamod.plugins.base.analysis_plugin import AnalysisPlugin, SPEED_VERY_FAST
REQUESTS_PER_MINUTE = 'Requests per minute'
class CoreStatus(AnalysisPlugin):
SPEED = SPEED_VERY_FAST
DATA_KEYS = {REQUESTS_PER_MINUTE, 'Crawl queue input speed',
'Crawl qu... | andresriancho/w3af-performance-analysis | wpamod/plugins/core_status.py | Python | gpl-2.0 | 2,487 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-04-10 20:15
from __future__ import unicode_literals
from django.db import migrations, models
def move_catalog_number_to_work(apps, schema_editor):
Album = apps.get_model("mangaki", "Album")
# The catalog_number field is now in the Work base class, w... | mangaki/mangaki | mangaki/mangaki/migrations/0045_migrate_catalog_number.py | Python | agpl-3.0 | 1,358 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_lazyconn
----------------------------------
Tests for `lazyconn` module.
"""
import unittest
from lazyconn import LazyConnection
from lazyconn import thread_safe
from lazyconn.globals import lg
class TService(object):
def hello(self, name):
retur... | youngking/lazyconn | tests/test_lazyconn.py | Python | bsd-3-clause | 914 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the pruning code.
WARNING:
This test uses 4GB of disk space.
This test takes 30 mins or more (up ... | aspaas/ion | test/functional/pruning.py | Python | mit | 21,401 |
# coding=utf-8
import datetime
import logging
import os
import tempfile
import requests
from dogpile.cache.backends.file import AbstractFileLock
from dogpile.cache.region import make_region
from dogpile.util.readwrite_lock import ReadWriteMutex
import autosubliminal
log = logging.getLogger(__name__)
# Expiration t... | h3llrais3r/Auto-Subliminal | autosubliminal/core/cache.py | Python | gpl-3.0 | 3,378 |
# -*- encoding: utf-8 -*-
from psycopg2 import IntegrityError
from openerp.tests.common import TransactionCase
from openerp.exceptions import ValidationError
# from openerp.tools import mute_logger
class GlobalTestOpenAcademySession(TransactionCase):
'''
Global test to openacademy session model.
Test cr... | keylor2906/openacademy-project | openacademy/tests/test_openacademy_session.py | Python | apache-2.0 | 2,851 |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2020, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | thermokarst/qiime2 | setup.py | Python | bsd-3-clause | 958 |
#!/usr/bin/env python
import numpy as np
import os
# on Windows, we need the original PATH without Anaconda's compiler in it:
PATH = os.environ.get('PATH') + ';C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\bin'
from distutils.spawn import spawn, find_executable
from setuptools import setup, find_packages,... | msracver/Deformable-ConvNets | lib/nms/setup_windows_cuda.py | Python | mit | 6,031 |
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache/incubator-airflow | airflow/executors/dask_executor.py | Python | apache-2.0 | 5,095 |
def median(lst):
lst = sorted(lst)
if len(lst) < 1:
return None
if len(lst) %2 == 1:
return lst[((len(lst)+1)/2)-1]
else:
return float(sum(lst[(len(lst)/2)-1:(len(lst)/2)+1]))/2.0
infile = open('jellyhash_bucket_histo')
i=0;
bucket_sizes = []
zeros = 0
for line in... | jgao/dreamchallenge | jellyhash_stats.py | Python | gpl-3.0 | 794 |
# -*- coding: utf-8 -*-
from contextlib import contextmanager
import os
import rtree
import numpy as np
import netCDF4 as nc4
from django.conf import settings
from pyaxiom.netcdf import EnhancedDataset, EnhancedMFDataset
from wms.utils import find_appropriate_time
from wms.models import VirtualLayer, Layer, Style
f... | sci-wms/sci-wms | wms/models/datasets/netcdf.py | Python | gpl-3.0 | 10,531 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gettext as gettext_module
import os
import shutil
import stat
import unittest
from subprocess import Popen
from django.core.management import (
CommandError, call_command, execute_from_command_line,
)
from django.core.management.commands.makem... | filias/django | tests/i18n/test_compilation.py | Python | bsd-3-clause | 9,555 |
#
# 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 writing, software
# ... | openstack/neutron | neutron/scheduler/l3_ovn_scheduler.py | Python | apache-2.0 | 5,991 |
# Sebastian Raschka, 2015 (http://sebastianraschka.com)
# Python Machine Learning - Code Examples
#
# Chapter 12 - Training Artificial Neural Networks for Image Recognition
#
# S. Raschka. Python Machine Learning. Packt Publishing Ltd., 2015.
# GitHub Repo: https://github.com/rasbt/python-machine-learning-book
#
# Lice... | 1iyiwei/pyml | code/optional-py-scripts/ch12.py | Python | mit | 33,098 |
# 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 writing, software
# distributed unde... | tengqm/senlin-container | senlin/tests/unit/test_hacking.py | Python | apache-2.0 | 3,738 |
import time
import unittest
# this import must be done *BEFORE* Gtk/Glib/etc *AND* pytestshot !
from . import paperwork
import pyinsane2
import pytestshot
import gi
gi.require_version('Pango', '1.0')
gi.require_version('PangoCairo', '1.0')
gi.require_version('Poppler', '0.18')
gi.require_version('Gdk', '3.0')
gi.req... | jflesch/paperwork-tests | tests/tests_settings.py | Python | gpl-3.0 | 2,532 |
#
# Paasmaker - Platform as a Service
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
import uuid
import os
import re
import paasmaker
import tornado
import torna... | kaze/paasmaker | paasmaker/pacemaker/scm/base.py | Python | mpl-2.0 | 4,827 |
##
# .api - ABCs for database interface elements
##
"""
Application Programmer Interfaces for PostgreSQL.
``postgresql.api`` is a collection of Python APIs for the PostgreSQL DBMS. It
is designed to take full advantage of PostgreSQL's features to provide the
Python programmer with substantial convenience.
This module... | zappyk-github/zappyk-python | lib/lib_external/postgresql/api.py | Python | gpl-2.0 | 36,526 |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test spending coinbase transactions.
The coinbase transaction in block N can appear in block
N+100... ... | cryptoprojects/ultimateonlinecash | test/functional/mempool_spendcoinbase.py | Python | mit | 2,228 |
from xbmcswift2 import Plugin, xbmcgui
from resources.lib.api import SiteApi
plugin = Plugin()
api = SiteApi()
@plugin.cached_route('/')
def index():
'''
Get movie categories
'''
plugin.log.debug('Get category menu')
c = api.get_menu_category()
items = [{
'label': item['label'],
... | dknlght/dkodi | src/download/plugin.video.india4movie/addon.py | Python | gpl-2.0 | 3,212 |
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd.
#
# 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 Licen... | buraglio-esnet/faucet | dp.py | Python | apache-2.0 | 6,669 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-03-29 22:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('organizer', '0001_initial'),
]
operations = [
migrations.AddField(
... | sSwiergosz/FinancialOrganiser | organizer_project/organizer/migrations/0002_auto_20170330_0041.py | Python | apache-2.0 | 781 |
# Copyright 2014
# The Cloudscaling Group, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | stackforge/ec2-api | ec2api/cmd/api_metadata.py | Python | apache-2.0 | 1,007 |
from setuptools import setup, find_packages
setup(
name='keymaker',
version='0.1',
description='A management tool for SSL certificates and keys',
url='https://github.com/fooker/keymaker/',
author='Dustin Frisch',
author_email='fooker@lab.sh',
license='GPLv3',
packages=find_packages... | fooker/keymaker | setup.py | Python | gpl-3.0 | 662 |
import os
import gtk
from EPLaunchLite.EPLaunchLiteWindow import Window
from EPLaunchLite.Settings import load_settings, save_settings
# once done doing any preliminary processing, actually run the application
this_settings_file_name = os.path.join(os.path.expanduser("~"), ".eplaunchlite.json")
# we will keep the f... | Myoldmopar/EPLaunchLight | EP-Launch-Lite.py | Python | bsd-3-clause | 662 |
import itertools
class BST:
def __init__(self):
self.root = None
self.set_mode(BST.NODUP)
def push(self, value):
node = BST.__Node(value)
if self.root is None:
self.root = node
else:
self.__insert(self,self.root,node)
def set_mode(self,mode):
... | Ercadio/generativeEssays | Containers.py | Python | unlicense | 3,788 |
#importing the data from the correct file
from active_site_kop import*
from confluence_cut_from_develop_and_release import *
from confluence_merge_queue import *
from jenkins_built_count import*
from jenkins_building_count import*
from jenkins_failed_count import*
from jenkins_failed_other_priority_list import *
from j... | edhiley/pydashie | pydashie/example_app.py | Python | mit | 1,239 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" The flask application """
import argparse
import sys
import os
parser = argparse.ArgumentParser(
description='Run the anitya app')
parser.add_argument(
'--config', '-c', dest='config',
help='Configuration file to use for anitya.')
parser.add_argument(
... | pombredanne/anitya | runserver.py | Python | gpl-2.0 | 1,330 |
import os
import shutil
import yaml
from time import ctime
import cv2
print ctime()
datasetPath = '/home/huligang/data/myVoc/'
dataset_new = 'dataset/'
if os.path.exists(dataset_new):
shutil.rmtree(dataset_new)
os.system('mkdir ' + dataset_new)
Annotations = datasetPath + 'Annotations/'
JPEGImages = datasetPath + '... | huligagn/hello | generate_dataset.py | Python | apache-2.0 | 1,785 |
import os
count = 0
for dirname, dirs, files in os.walk('.'):
for filename in files:
if filename.endswith('.txt') :
count = count + 1
print('Files:', count)
| mkhuthir/learnPython | Book_pythonlearn_com/28_os/txtcount.py | Python | mit | 182 |
#!/usr/bin/env python
'''
Copyright (C) 2007 Terry Brown, terry_n_brown@yahoo.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 Foundation; either version 2 of the License, or
(at your option) any later versi... | piksels-and-lines-orchestra/inkscape | share/extensions/layout_nup.py | Python | gpl-2.0 | 4,056 |
import unittest
from circular_buffer import (
CircularBuffer,
BufferFullException,
BufferEmptyException
)
class CircularBufferTest(unittest.TestCase):
def test_read_empty_buffer(self):
buf = CircularBuffer(1)
with self.assertRaises(BufferEmptyException):
buf.read()
de... | mweb/python | exercises/circular-buffer/circular_buffer_test.py | Python | mit | 3,083 |
# .caffemodel file path:
MODEL_FILE = '/home/user/Desktop/cifar10/cifar10_quick_iter_5000.caffemodel'
# .prototxt file path:
MODEL_NET = '/home/user/Desktop/cifar10/cifar10_quick.prototxt'
# Saving path:
SAVE_TO = '/home/user/Desktop/cifar10/'
# Set True if you want to get parameters:
GET_PARAMS = True
# Set True if y... | ShMCG/CNNdroid | Parameter Generation Scripts/SavePycaffeModelInMessagePack.py | Python | mit | 2,993 |
'''
ExperimentClient tests.
'''
import os
import unittest
import pandas as pd
import time
from mljar.client.project import ProjectClient
from mljar.client.dataset import DatasetClient
from mljar.client.experiment import ExperimentClient
from .project_based_test import ProjectBasedTest, get_postfix
class ExperimentCl... | mljar/mljar-api-python | tests/experiment_client_test.py | Python | apache-2.0 | 7,937 |
import unittest
from locust.util.timespan import parse_timespan
from locust.util.rounding import proper_round
class TestParseTimespan(unittest.TestCase):
def test_parse_timespan_invalid_values(self):
self.assertRaises(ValueError, parse_timespan, None)
self.assertRaises(ValueError, parse_timespan, ... | heyman/locust | locust/test/test_util.py | Python | mit | 1,232 |
# -*- coding: utf-8 -*-
# © 2014 Elico Corp (https://www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
{
'name': 'MRP Wave Scheduler',
'version': '7.0.1.0.0',
'category': 'Stock',
'sequence': 19,
'summary': 'MRP Wave Scheduler',
'description': """
S... | Elico-Corp/openerp-7.0 | mrp_wave/__openerp__.py | Python | agpl-3.0 | 1,104 |
#!/usr/bin/env python
# encoding: utf-8
from cmath import exp, pi, sqrt
from random import random
class Psi:
def __init__(self, n_qubits):
"""
set up a quantum system with the given number of qubits
initialized to the "zero" qubit.
"""
self.n_qubits = n_qubits
# in... | jtauber/quantumpy | quantum.py | Python | mit | 3,516 |
from PyQt5.QtCore import QAbstractListModel, QModelIndex, Qt
class QtListModel(QAbstractListModel):
def __init__(self, item_builder):
QAbstractListModel.__init__(self)
self._items = {}
self._itemlist = [] # For queries
self._item_builder = item_builder
def rowCount(self, pare... | FAForever/client | src/util/qt_list_model.py | Python | gpl-3.0 | 1,886 |
""" Convenience script to run all python test cases in one go.
"""
import sys
import unittest
try:
import DNS
except ImportError:
print("TESTS SKIPPED: the python3-dns library is not installed")
sys.exit(0)
from test_btrie import *
from test_ip6trie import *
from test_ip4trie import *
from test_acl import... | spamhaus/rbldnsd | tests.py | Python | gpl-2.0 | 371 |
from rest_framework import viewsets
from limbo import serializers
from rest_framework.decorators import detail_route, list_route
from rest_framework.response import Response
from limbo.serializers import LimboSerializer
from limbo.lib import Dictionary
class LimboViewSet(viewsets.ViewSet):
def list(self, req... | fantastic001/liberator-api | limbo/views/limbo.py | Python | gpl-2.0 | 3,380 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function
# if we want to give our script parameters, we need a special library
import sys, os, re, requests, json
from elasticsearch import Elasticsearch
reload(sys)
sys.setdefaultencoding("utf-8")
# FUNCTIONS
def add_data_to_index(es, index_na... | jarleEbe/elasticsearch-on-corpora | iceuntagged/iceSimpleIndex.py | Python | mit | 3,789 |
#-*- encoding: utf-8 -*-
class ParserHandler:
KEYWORDS = ['up','down','right','left',
'a','b','start','select']
def __init__(self):
pass
def parser(self, message):
ret = []
while len(message) > 0:
found = False
for key in self.KEY... | tnlin/nctuNASA | NA-HW1-Twitch_Play_Pokemon/msgParser.py | Python | mit | 577 |
#!/usr/bin/env python
""" Test unicode support in tvnamer
"""
from functional_runner import run_tvnamer, verify_out_data
from nose.plugins.attrib import attr
import unicodedata
@attr("functional")
def test_unicode_in_inputname():
"""Tests parsing a file with unicode in the input filename
"""
input_file... | lahwaacz/tvnamer | tests/test_unicode.py | Python | unlicense | 1,655 |
from django.db import models
from django.contrib.auth.models import User
# x und y-values in metern
# allgemiene Daten (ueber tankstellen-api zu holen)
class Tankstellen(models.Model):
bezeichnung = models.CharField(max_length=256)
position_x = models.DecimalField(max_digits = 8, decimal_places = 6)
position_y = mod... | AlexImmer/VolkSwaggen | richtigTanken/models.py | Python | mit | 1,542 |
from tago import Tago
import os
TOKEN = os.environ.get('TAGO_TOKEN_DEVICE') or 'TOKEN'
def test_insert():
result = Tago(TOKEN).device.find({'query': 'last_value'})
print result
if result['status']:
assert True
else:
assert False
| madhavbhatt/tago-sdk-python | tests/device/test_get.py | Python | apache-2.0 | 263 |
import abc
import math
import cmath
import numpy as np
from ..base import Base
class Coupling(Base):
"""
Abstract base class for couplings.
"""
__metaclass__ = abc.ABCMeta
connection = None
"""
Connection this coupling is part of.
"""
component_from = None
... | FRidh/Sea | Sea/model/couplings/Coupling.py | Python | bsd-3-clause | 2,622 |
"""
Kolibri Hooks API
-----------------
What are hooks
~~~~~~~~~~~~~~
Hooks are classes that define *something* that happens at one or more places
where the hook is looked for and applied. It means that you can
"hook into a component" in Kolibri and have it do a predefined and
parameterized *thing*. For instance, Kol... | ralphiee22/kolibri | kolibri/plugins/hooks.py | Python | mit | 10,971 |
from __future__ import absolute_import
from django import forms
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.models import F
from django.http import HttpResponse, HttpResponseRedirect
from django.utils.translation import ugettext_lazy... | looker/sentry | src/sentry/web/frontend/organization_auth_settings.py | Python | bsd-3-clause | 7,726 |
"""
This file is part of DeepConvSep.
Copyright (c) 2014-2017 Marius Miron <miron.marius at gmail.com>
DeepConvSep 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 Lic... | gerruz/DeepConvSep | examples/ikala/trainCNN.py | Python | agpl-3.0 | 16,813 |
import numpy as np
import matplotlib.pyplot as plt
from analytical_solutions import *
z_surf = 0.0 # location of upper surface
z_bott = 150e3 # location of bottom boundary
nz = 11 # number of grid points
nt = 8 # number of timesteps to calculate
dt = 0.5*112500000000000.0 # timestep to use, in seconds
... | HUGG/NGWM2016-modelling-course | Lessons/05-Finite-differences/scripts/heat_transient.py | Python | mit | 2,662 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from . import NeuralLayer
from deepy.utils import build_activation, FLOATX
import numpy as np
import theano
import theano.tensor as T
from collections import OrderedDict
OUTPUT_TYPES = ["sequence", "one"]
INPUT_TYPES = ["sequence", "one"]
class RNN(NeuralLayer):
"""
... | rldotai/deepy | deepy/layers/recurrent.py | Python | mit | 6,446 |
import pickle
from pymech.units.SI import *
from pymech.fluid.Core import fluidspeed, flowrate
class Component:
ID: int = 0 # ID number
_Q = 0. * ureg['m**3/s'] # Volumetric flow
_v = 0. * ureg['m/s'] # Speed of fluid
_A = 0. * ureg['m**2'] # Cross section of fluid plane
_P = [0. * ureg['Pa']... | peer23peer/pymech | pymech/fluid/Component.py | Python | mit | 2,609 |
#!/usr/bin/python
"""LDAP Directory Management, wrapper for python-ldap (http://www.python-ldap.org).
This module provides high level control over an LDAP Directory.
Some code was originally built on examples available here:
http://www.grotan.com/ldap/python-ldap-samples.html
Copyright (c) 2014 Derak Berreyesa
Perm... | derak/directory.py | directory.py | Python | mit | 5,070 |
# Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
class DatabaseError(Exception):
pass
class DatabaseROError(DatabaseError):
"""cannot write to read-only database"""
pas... | np/alot | alot/db/errors.py | Python | gpl-3.0 | 536 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
def read(fname):
buf = open(os.path.join(os.path.dirname(__file__), fname), 'rb').read()
return buf.decode('utf8')
setup(name='mtgjson',
version='0.4.1.dev1',
description='A python library for w... | mbr/pymtgjson | setup.py | Python | mit | 772 |
from psrd.sections import cap_words
from psrd.stat_block.utils import colon_filter, default_closure, noop
from psrd.stat_block.utils import parse_stat_block, collapse_text, has_heading
from psrd.stat_block.utils import sections_pass
from psrd.universal import StatBlockSection, Heading, filter_name
from psrd.universal ... | devonjones/PSRD-Parser | src/psrd/stat_block/creature.py | Python | gpl-3.0 | 14,691 |
#!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# ***** END LICENSE BLOCK *****
'''Python usage, esp. virtualenv.... | cstipkovic/spidermonkey-research | testing/mozharness/mozharness/base/python.py | Python | mpl-2.0 | 36,576 |
#!/usr/bin/env python
import itertools
import logging
import os
import random
import stat
import subprocess
import sys
import tempfile
import unittest
from unittest import TestCase
import lief
from utils import get_sample
lief.logging.set_level(lief.logging.LOGGING_LEVEL.INFO)
class TestCore(TestCase):
LOGGER = ... | lief-project/LIEF | tests/elf/test_core.py | Python | apache-2.0 | 16,506 |
#!/usr/local/bin/python
from ouimeaux.environment import Environment
import pdb
def on_switch(switch):
print "Switch found!", switch.name
def on_motion(motion):
print "Motion found!", motion.name
def list_switches():
env = Environment(on_switch, on_motion)
env.start()
env.discover(seconds=1)
return env.l... | ramrom/haus | wemo.py | Python | mit | 1,079 |
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | wunderlins/learning | python/zodb/lib/osx/zdaemon/tests/testzdoptions.py | Python | gpl-2.0 | 17,993 |
# -*- python -*-
# -*- coding: utf-8 -*-
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2011 Serge Noiraud
#
# 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 ... | pmghalvorsen/gramps_branch | gramps/plugins/view/geofamily.py | Python | gpl-2.0 | 19,626 |
"""
.. module: drivers/picam
:platform: Windows
.. moduleauthor:: Daniel R. Dietze <daniel.dietze@berkeley.edu>
Basic interface to PrincetonInstrument's PICam library. It supports most of the standard features
that are provided by PICam. I have decided not to implement a non-blocking version of the image
acq... | ddietze/pyFSRS | drivers/picam/__init__.py | Python | gpl-3.0 | 29,058 |
import unittest
import Tkinter as tkinter
from Tkinter import TclError
import os
import sys
from test.test_support import requires, run_unittest
from test_ttk.support import (tcl_version, requires_tcl, get_tk_patchlevel,
widget_eq)
from widget_tests import (
add_standard_options, noco... | sdlBasic/sdlbrt | win32/mingw/opt/lib/python2.7/lib-tk/test/test_tkinter/test_widgets.py | Python | lgpl-2.1 | 45,690 |
from django.conf.urls import patterns, include, url
from django.views.generic import TemplateView
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^$', TemplateView.as_view(template_name='base.html')),
url(r'^api/'... | danjac/django-angular-tasks | todolists/todolists/urls.py | Python | mit | 719 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.