repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
stefanw/froide | froide/publicbody/migrations/0002_auto_20151127_1754.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('publicbody', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='jurisdiction',
op... |
tndatacommons/tndata_backend | tndata_backend/survey/managers.py | from django.db import models
from django.core.exceptions import ObjectDoesNotExist
class QuestionManager(models.Manager):
def available(self, *args, **kwargs):
qs = self.get_queryset()
return qs.filter(available=True)
class SurveyResultManager(models.Manager):
def create_objects(self, user... |
RedisLabs/redis-completion | examples/stocks.py | import urllib2
from redis_completion import RedisEngine
engine = RedisEngine(prefix='stocks')
def load_data():
url = 'http://media.charlesleifer.com/downloads/misc/NYSE.txt'
contents = urllib2.urlopen(url).read()
for row in contents.splitlines()[1:]:
ticker, company = row.split('\t')
engin... |
madhurauti/Map-Polygon | modules/tests/asset/asset.py | # -*- coding: utf-8 -*-
""" Sahana Eden Asset Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the... |
ndoit/awsdit | aws_audit/sec_sgrules_all_regions.py | #!/usr/bin/env python
"""
This program is to collect some AWS stuff
"""
import boto3
import threading
from local_helpers.config import accounts_db
from local_helpers import assume_role, get_session, misc
from local_helpers import ec2_helper
if __name__ == "__main__":
"""main"""
"""bucket to hold results"""... |
ckan/ckanext-issues | ckanext/issues/lib/util.py | import ckanext.issues.model as issue_model
import ckan.model as model
def issue_count(package):
return issue_model.Issue.get_issue_count_for_package(package['id'])
def issue_comment_count(issue):
return issue_model.IssueComment.get_comment_count_for_issue(issue['id'])
def issue_comments(issue):
return i... |
TweakMunich/metricsinyourface | client/sevenseg_i2c.py | #! /usr/bin/python
#
# sudo python sevenseg_i2c.py <number> -- display number
# sudo python sevenseg_i2c.py <text> -- display text(very limited)
# sudo python sevenseg_i2c.py -- count to 200
#
# Outputs decimal numbers to AdaFruit LED Backback 7 Segment display
#
# i2c must be enabled on the raspberry pi. If... |
jthurst3/MemeCaptcha | models_cnn_lstm/im2txt/im2txt/configuration.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
mmottahedi/neuralnilm_prototype | scripts/e419.py | from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... |
hivelocity/python-ubersmith | ubersmith/calls/client.py | """Client call classes.
These classes implement any response cleaning and validation needed. If a
call class isn't defined for a given method then one is created using
ubersmith.calls.BaseCall.
"""
from collections import namedtuple
from ubersmith.calls import BaseCall
from ubersmith.clean import clean
from ubersm... |
opennode/nodeconductor-assembly-waldur | src/waldur_openstack/openstack_tenant/migrations/0011_securitygrouprule_ethertype.py | # Generated by Django 2.2.13 on 2020-11-13 11:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('openstack_tenant', '0010_securitygrouprule_direction'),
]
operations = [
migrations.AddField(
model_name='securitygrouprule',
... |
davidjb/sqlalchemy | lib/sqlalchemy/orm/state.py | # orm/state.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Defines instrumentation of instances.
This module is usually not directly visible t... |
mozillazg/redis-py-doc | redis/commands/graph/__init__.py | from ..helpers import quote_string, random_string, stringify_param_value
from .commands import GraphCommands
from .edge import Edge # noqa
from .node import Node # noqa
from .path import Path # noqa
class Graph(GraphCommands):
"""
Graph, collection of nodes and edges.
"""
def __init__(self, client... |
hanzhanggit/StackGAN | stageI/model.py | from __future__ import division
from __future__ import print_function
import prettytensor as pt
import tensorflow as tf
import misc.custom_ops
from misc.custom_ops import leaky_rectify
from misc.config import cfg
class CondGAN(object):
def __init__(self, image_shape):
self.batch_size = cfg.TRAIN.BATCH_SI... |
betterlife/psi | psi/cli.py | import functools
import itertools
import logging
import math
import os
import random
import sys
import click
import flask_migrate
import psycopg2
from psi.app import create_app, init_all
from psi.app.utils import retry
from psi import MIGRATION_DIR
# Using flask's default `click` command line environment
applicatio... |
noisemaster/AdamTestBot | future/backports/email/generator.py | # Copyright (C) 2001-2010 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Classes to generate plain text from a message object tree."""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absol... |
alpsayin/django-qanda | qanda/django_notify/migrations/0002_auto__add_field_notification_occurrences.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Notification.occurrences'
db.add_column('notify_notification', 'occurrences',
... |
alexforencich/verilog-wishbone | tb/test_axis_wb_master_8_32_16.py | #!/usr/bin/env python
"""
Copyright (c) 2016 Alex Forencich
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merg... |
sinnwerkstatt/ecg-balancing | ecg_balancing/migrations/0003_auto__add_field_companybalance_year.py | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'CompanyBalance.year'
db.add_column(u'ecg_balancing_companybalance', 'year',
... |
Dioptas/pymatgen | pymatgen/io/abinitio/scheduler_error_parsers.py | # coding: utf-8
from __future__ import unicode_literals, division, print_function
"""
Error handlers for errors originating from the Submission systems.
"""
__author__ = "Michiel van Setten"
__copyright__ = " "
__version__ = "0.9"
__maintainer__ = "Michiel van Setten"
__email__ = "mjvansetten@gmail.com"
__date__ = "... |
briancline/softlayer-python | SoftLayer/CLI/loadbal/service_toggle.py | """Toggle the status of an existing load balancer service."""
# :license: MIT, see LICENSE for more details.
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
from SoftLayer.CLI import formatting
from SoftLayer.CLI import loadbal
import click
@click.command()
@click.argumen... |
mbkumar/pymatgen | pymatgen/io/lammps/outputs.py | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module implements classes and methods for processing LAMMPS output
files (log and dump).
"""
import re
import glob
from io import StringIO
import numpy as np
import pandas as pd
from monty.json imp... |
DaleSong89/adience_align | adiencealign/tests/test_cascade_detection.py | '''
Created on May 7, 2014
@author: eran
'''
import unittest
from adiencealign.cascade_detection.cascade_face_finder import CascadeFaceFinder
import cv2
from adiencealign.common.drawing import draw_rect
from adiencealign.common.images import extract_box
import os
from adiencealign.cascade_detection.cascade_detector im... |
DiamondOhana/jphacks | rpi_main/sonilab/t_deg_inv.py | # Invert degree 180.
# Ex. 270 -> 90
import deg_inv
print deg_inv.get(359)
assert deg_inv.get(0)==180 , "deg 0 ERR"
assert deg_inv.get(90)==270 , "deg 90 ERR"
assert deg_inv.get(180)==0 , "deg 180 ERR"
assert deg_inv.get(270)==90 , "deg 270 ERR"
assert deg_inv.get(45)==225 , "deg 45 ERR"
assert deg_inv.get(360)==18... |
davidt/reviewboard | reviewboard/search/search_backends/elasticsearch.py | """A backend for the Elasticsearch search engine."""
from __future__ import unicode_literals
from django import forms
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext, ugettext_lazy as _
from reviewboard.search.search_backends.base import (SearchBackend,
... |
gitlabhq/pygments.rb | vendor/pygments-main/pygments/formatters/gitlab.py | # -*- coding: utf-8 -*-
"""
pygments.formatters.gitlab
~~~~~~~~~~~~~~~~~~~~~~~~~~
GitLab specific formatter for HTML output.
Based on the standard HTML formatter.
:copyright: Copyright 2012 by the GitLab team (http://www.gitlab.org).
:license: BSD, see LICENSE for details.
"""
import os
impor... |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/OpenGL/GL/ARB/transpose_matrix.py | '''OpenGL extension ARB.transpose_matrix
This module customises the behaviour of the
OpenGL.raw.GL.ARB.transpose_matrix to provide a more
Python-friendly API
Overview (from the spec)
New functions and tokens are added allowing application matrices
stored in row major order rather than column major order to be
... |
alanwells/donkey | donkeycar/templates/donkey2.py | #!/usr/bin/env python3
"""
Scripts to drive a donkey 2 car and train a model for it.
Usage:
manage.py (drive) [--model=<model>] [--js]
manage.py (train) [--tub=<tub1,tub2,..tubn>] (--model=<model>)
manage.py (calibrate)
manage.py (check) [--tub=<tub1,tub2,..tubn>] [--fix]
manage.py (analyze) [--tu... |
dictoon/blenderseed | operators/__init__.py | #
# This source file is part of appleseed.
# Visit https://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2014-2019 The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this s... |
henryyang42/NTHU_Course | crawler/prerequisite.py | # -*- encoding: utf-8 -*-
from collections import defaultdict
import requests
import lxml.html
listing_url = (
'https://www.ccxp.nthu.edu.tw/ccxp/INQUIRE/JH/6/6.2/6.2.6/JH626001.php'
)
class Container(list):
iscontainer = True
class Any(Container):
iscontainerany = True
def __repr__(self):
... |
agileronin/skills-api | api/router/__init__.py | # -*- coding: utf-8 -*-
"""API Router Package.
The router package provides a simple façade for handing versions of the API.
When a version is not specified via the endpoint (e.g. /v1/foo/bar) the router
is responsible for determining what version of the API should be used.
"""
from flask import Blueprint
from fl... |
Kixunil/keynescoin | qa/rpc-tests/util.py | # Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Helpful routines for regression testing
#
# Add python-bitcoinrpc to module search path:
import os
import sys
sys.path.append... |
janusnic/21v-python | unit_18/socket/ls2.py | import socket
import sys
from thread import *
HOST = '' # Symbolic name meaning all available interfaces
PORT = 8888 # Arbitrary non-privileged port
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print 'Socket created'
#Bind socket to local host and port
try:
s.bind((HOST, PORT))
except socket.error ... |
thiagopa/django-mumblr | example/settings.py | DEBUG = True
TEMPLATE_DEBUG = True
ADMINS = (
('Harry Marr', 'harry.marr@gmail.com'),
)
MANAGERS = ADMINS
import os
from local_settings import *
TIME_ZONE = 'Europe/London'
LANGUAGE_CODE = 'en-gb'
USE_I18N = False
MEDIA_ROOT = os.path.join(PROJECT_PATH, 'static')
MEDIA_URL = '/static/'
# List of callables tha... |
soybean217/lora-python | UServer/http_api_no_auth/api/api_trans_status.py | import json
from flask import request
from userver.object.trans_status import TransStatus
from .decorators import trans_status_filter
from ..http_auth import auth
from . import api, root
@api.route(root+'trans-status', methods=['GET'])
@auth.auth_required
@trans_status_filter
def trans_status(user, device=None, gatew... |
Jian-Zhan/customarrayformatter | openpyxl/cell.py | # file openpyxl/cell.py
# Copyright (c) 2010-2011 openpyxl
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modi... |
SUSE/azure-sdk-for-python | azure-mgmt-compute/azure/mgmt/compute/compute/v2017_03_30/models/virtual_machine_scale_set_public_ip_address_configuration.py | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
Williams224/davinci-scripts | ksteta3pi/Consideredbkg/MC_12_11164012_MagUp.py | #-- GAUDI jobOptions generated on Mon Jul 20 10:24:27 2015
#-- Contains event types :
#-- 11164012 - 18 files - 254325 events - 55.42 GBytes
#-- Extra information about the data processing phases:
#-- Processing Pass Step-124834
#-- StepId : 124834
#-- StepName : Reco14a for MC
#-- ApplicationName : Bru... |
stuart-knock/tvb-framework | tvb_test/adapters/storeadapter.py | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... |
andrebellafronte/stoq | stoqlib/gui/editors/invoiceitemeditor.py | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
##
## Copyright (C) 2015 Async Open Source <http://www.async.com.br>
## All rights reserved
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU Lesser General Public License as published by
## the Free Software F... |
testkit/testkit-lite | testkitlite/engines/webdriver.py |
#!/usr/bin/python
#
# Copyright (C) 2012 Intel Corporation
#
# 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 p... |
Dennisparchkov/rumal | interface/api.py | #!/usr/bin/env python
#
# api.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; witho... |
Hao-Liu/avocado | avocado/core/output.py | # 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 distributed in the hope that it will be useful,
# bu... |
mohseniaref/adore-doris | gui/snaphuConfigEditor.py | #!/usr/bin/env python
# example basictreeview.py
import pygtk
pygtk.require('2.0')
import gtk
import os
import dialogs
class SnaphuConfigEditor:
def snaphuParser(self, set=None, setFile=None):
if setFile is None:
setFile=self.setFile;
if set is None:
set=self.set;
... |
pamfilos/data.cern.ch | cap/modules/deposit/api.py | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2016 CERN.
#
# CERN Analysis Preservation Framework is free software; you can redistribute
# it and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either... |
ListFranz/PyDNSServer | RunMain.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2015-03-24
# @Author : Robin (sintrb@gmail.com)
# @Version : 1.0
from PyDNSServer import DNSQueryHandler, DNSServer
import re
filters = [
('baidu.com', 'allow'),
('360.com', 'deny'),
('qq.com', '192.168.0.100'),
('.*', 'deny'),
]
class FilterHandler(DN... |
joshumax/CoLinux64 | src/colinux/user/configurator/configurator.py | import os
import wx
from wxPython import wizard as wxWizard
from xmlwrapper import XMLWrapper
from common import *
from blockdevice import BlockDevicesOptionArray
from networkdevice import NetworkDevicesOptionArray
class MainEditor(wx.SplitterWindow):
def __init__(self, mainframe, *arg, **kw):
wx.SplitterW... |
will-moore/openmicroscopy | components/tools/OmeroWeb/omeroweb/webclient/tree.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008-2015 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software F... |
ceph/autotest | client/common_lib/profiler_manager.py | import os, sys
import common
from autotest_lib.client.common_lib import error, utils, packages
class ProfilerNotPresentError(error.JobError):
def __init__(self, name, *args, **dargs):
msg = "%s not present" % name
error.JobError.__init__(self, msg, *args, **dargs)
class profiler_manager(object)... |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/urbansim_parcel/models/work_at_home_choice_model.py | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.datasets.dataset import Dataset
from opus_core.resources import Resources
from opus_core.choice_model import ChoiceModel
from opus_core.model import prepare_specification_and_coe... |
NorfairKing/sus-depot | shared/shared/vim/dotvim/bundle/YouCompleteMe/third_party/ycmd/third_party/JediHTTP/jedihttp/tests/handlers_test.py | # Copyright 2015 Cedraro Andrea <a.cedraro@gmail.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
mweisman/QGIS | python/plugins/processing/r/RUtils.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
RUtils.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************************... |
asterisk/testsuite | tests/channels/pjsip/configuration/test_harness.py | #!/usr/bin/env python
"""
Copyright (C) 2015, Digium, Inc.
Ashley Sanders <asanders@digium.com>
This program is free software, distributed under the terms of
the GNU General Public License Version 2.
"""
import sys
import logging
sys.path.append("lib/python")
sys.path.append("tests/channels/pjsip/configuration")
fr... |
Tojaj/createrepo_c | tests/python/tests/test_sqlite.py | import unittest
import shutil
import tempfile
import os.path
import sqlite3
import createrepo_c as cr
from .fixtures import *
class TestCaseSqlite(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdtemp(prefix="createrepo_ctest-")
def tearDown(self):
shutil.rmtree(self.tmpdir)
... |
jukart/XCSoar | build/python/build/libs.py | from os.path import abspath
from build.zlib import ZlibProject
from build.autotools import AutotoolsProject
from build.openssl import OpenSSLProject
from build.freetype import FreeTypeProject
from build.sdl2 import SDL2Project
from build.lua import LuaProject
glibc = AutotoolsProject(
'http://mirror.netcologne.de... |
lkhomenk/integration_tests | cfme/cloud/provider/gce.py | import attr
from widgetastic.widget import View
from widgetastic_patternfly import Button, Input
from wrapanapi.google import GoogleCloudSystem
from cfme.base.credential import ServiceAccountCredential
from cfme.common.provider import DefaultEndpoint
from cfme.services.catalogs.catalog_items import GoogleCatalogItem
... |
kaos-addict/weborf | examples/index.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
This is an example of index file.
It adds a "." to a session variable on every refresh, shows the informations and sets a cookie.
'''
import os
import sys
from cgi_weborf import * #imports module cgi
cgi.session_start()
cgi.setcookie("id","33")
cgi.finalize_headers() #... |
draekko/ADEL | _analyzeDB.py | #!/usr/bin/python
#
# Copyright (C) 2012 Michael Spreitzenbarth, Sven Schmitt
#
# 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 ... |
satishgoda/rbhus | rbhusUI/lib/rbhusPipeAdminPanelMod.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'rbhusPipeAdminPanelMod.ui'
#
# Created: Fri Oct 18 23:12:58 2013
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
e... |
Jannes123/inasafe | safe/postprocessors/postprocessor_factory.py | # -*- coding: utf-8 -*-
"""**Postprocessors package.**
.. tip::
import like this from safe.postprocessors import get_post_processors and
then call get_post_processors(requested_postprocessors)
"""
__author__ = 'Marco Bernasocchi <marco@opengis.ch>'
__revision__ = '$Format:%H$'
__date__ = '10/10/2012'
__license... |
hzlf/openbroadcast.org | website/tools/l10n/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name="AdminArea",
fields=[
(
"id",
... |
atosorigin/ansible | lib/ansible/modules/package_facts.py | #!/usr/bin/python
# (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# most of it copied from AWX's scan_packages module
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
module: package_fac... |
qiqi/numpad | admpisolve.py | # solve parallel nonlinear systems, and differentiate through implicit relations
# that are established through nonlinear solvers
# Copyright (C) 2014
# Qiqi Wang qiqi.wang@gmail.com
# engineer-chaos.blogspot.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... |
wangjun/pythoner.net | pythoner/accounts/models.py | #encoding:utf-8
"""
pythoner.net
Copyright (C) 2013 PYTHONER.ORG
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... |
eriklotin/bytestat | gui/gui_alert.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './qt_designer/gui_alert.ui'
#
# Created: Thu Oct 17 00:55:04 2013
# by: PyQt4 UI code generator 4.9.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf... |
pgiraud/thinkhazard | alembic/versions/d47e9112f635_add_translations.py | """Add translations
Revision ID: d47e9112f635
Revises: 9596ec0e704b
Create Date: 2017-01-27 12:10:08.522696
"""
# revision identifiers, used by Alembic.
revision = 'd47e9112f635'
down_revision = '9596ec0e704b'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engine... |
Lyrositor/Plasma | Sources/Plasma/Apps/plClient/external/makeres.py | #!/usr/bin/env python
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 o... |
roadmapper/ansible | lib/ansible/module_utils/network/ios/config/lacp_interfaces/lacp_interfaces.py | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The ios_lacp_interfaces class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessa... |
SickGear/SickGear | lib/hachoir_py3/field/fragment.py | from hachoir_py3.field import FieldSet, RawBytes
from hachoir_py3.stream import StringInputStream
class FragmentGroup:
def __init__(self, parser):
self.items = []
self.parser = parser
self.args = {}
def add(self, item):
self.items.append(item)
def createInputStream(self)... |
fredericmohr/mitro | mitro-mail/build/python-statsd/statsd/timer.py | import contextlib
import time
import statsd
class Timer(statsd.Client):
'''
Statsd Timer Object
Additional documentation is available at the parent class
:class:`~statsd.client.Client`
:keyword name: The name for this timer
:type name: str
:keyword connection: The connection to use, will... |
Kmayankkr/robocomp | libs/innermodel-python3/innermodel_python3/innermodelmesh.py | from innermodelnode import InnerModelNode
class InnerModelMesh (InnerModelNode):
def __init__ (self, id, meshPath, scalex, scaley, scalez,
render, tx, ty, tz, rx, ry, rz, collidable, parent):
super (InnerModelMesh, self).__init__ (id, parent)
self.meshPath = meshPath
self.sc... |
rgaiacs/perprof-py | perprof/bokeh.py | """
This handle the plot using bokeh.
"""
import os.path
import gettext
import bokeh.models.formatters
import bokeh.plotting as plt
from . import prof
THIS_DIR, THIS_FILENAME = os.path.split(__file__)
THIS_TRANSLATION = gettext.translation('perprof',
os.path.join(THIS_DIR, 'locale'))
_ = THIS_TRANSLATION.gett... |
kbrebanov/ansible-modules-extras | network/a10/a10_virtual_server.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage A10 Networks slb virtual server objects
(c) 2014, Mischa Peters <mpeters@a10networks.com>,
Eric Chou <ericc@a10networks.com>
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GN... |
pwollstadt/trentoolxl | test/test_estimators_pid.py | """Provide unit tests for PID estimators."""
import time as tm
import numpy as np
import pytest
from idtxl.estimators_pid import SydneyPID, TartuPID
package_missing = False
try:
import ecos
except ImportError:
package_missing = True
optimiser_missing = pytest.mark.skipif(
package_missing,
reason='ECOS ... |
mscuthbert/abjad | abjad/tools/selectiontools/Lineage.py | # -*- encoding: utf-8 -*-
from abjad.tools.selectiontools.SimultaneousSelection \
import SimultaneousSelection
class Lineage(SimultaneousSelection):
r'''Abjad model of Component lineage:
::
>>> score = Score()
>>> score.append(Staff(r"""\new Voice = "Treble Voice" { c'4 }""",
...... |
SuperDARNCanada/placeholderOS | experiments/twofsound.py | #!/usr/bin/python
# write an experiment that creates a new control program.
import os
import sys
import copy
BOREALISPATH = os.environ['BOREALISPATH']
sys.path.append(BOREALISPATH)
from experiment_prototype.experiment_prototype import ExperimentPrototype
import experiments.superdarn_common_fields as scf
class Twof... |
trgill/stratisd | tests/client-dbus/src/stratisd_client_dbus/_stratisd_constants.py | # Copyright 2016 Red Hat, 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 in writing... |
levkar/odoo-addons | portal_account_distributor/__openerp__.py | # -*- coding: utf-8 -*-
{
'name': 'Portal Distributor Account',
'version': '0.1',
'category': 'Tools',
'complexity': 'easy',
'description': """
Portal Distributor Account
==========================
""",
'author': 'Ingenieria ADHOC',
'depends': ['portal'],
'demo': [
'portal_de... |
jobiols/odoo-web | website_doc/__openerp__.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar)
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Pu... |
GbalsaC/bitnamiP | venv/src/event-tracking/eventtracking/backends/tests/__init__.py | """
Helper classes for backend tests
"""
from __future__ import absolute_import
from unittest import TestCase
from contextlib import contextmanager
import time
import os
import random
import string # pylint: disable=deprecated-module
class InMemoryBackend(object):
"""A backend that simply stores all events in m... |
etalab/udata | udata/core/badges/tests/test_model.py | from udata.auth import login_user
from udata.models import db
from udata.tests import TestCase, DBTestMixin
from udata.core.user.factories import UserFactory
from ..models import Badge, BadgeMixin
TEST = 'test'
OTHER = 'other'
class Fake(db.Document, BadgeMixin):
__badges__ = {
TEST: 'Test',
OT... |
xs2maverick/adhocracy3.mercator | src/adhocracy_mercator/adhocracy_mercator/scripts/export_users.py | """Export users and their proposal rates.
This is registered as console script 'export_mercator_users' in setup.py.
"""
import argparse
import csv
import inspect
from pyramid.paster import bootstrap
from substanced.util import find_service
from adhocracy_core.interfaces import IResource
from adhocracy_core.resource... |
antoniov/tools | pytok/tests/test_pytok.py | #!/home/odoo/devel/venv/bin/python2
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) SHS-AV s.r.l. (<http://www.zeroincombenze.it>)
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it unde... |
thinkopensolutions/server-tools | base_external_dbsource_odbc/__manifest__.py | # -*- coding: utf-8 -*-
# Copyright <2011> <Daniel Reis, Maxime Chambreuil, Savoir-faire Linux>
# Copyright 2016 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
{
'name': 'External Database Source - ODBC',
'version': '10.0.1.0.0',
'category': 'Tools',
'author': "Daniel Reis,... |
openaid-IATI/OIPA | OIPA/api/sector/tests/test_sector_endpoints.py | from django.urls import reverse
from rest_framework.test import APITestCase
from iati_codelists.factory import codelist_factory
class TestSectorEndpoints(APITestCase):
def test_sectors_endpoint(self):
url = reverse('sectors:sector-list')
msg = 'sectors endpoint should be localed at {0}'
... |
nbr23/nemubot | nemubot/server/abstract.py | # Nemubot is a smart and modulable IM bot.
# Copyright (C) 2012-2016 Mercier Pierre-Olivier
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... |
superdesk/superdesk-core | superdesk/io/feeding_services/twitter.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import re
im... |
nirbheek/cerbero | cerbero/tools/strip.py | #!/usr/bin/env python3
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free S... |
cfelton/myhdl | myhdl/test/conversion/general/test_ram.py | from __future__ import absolute_import
import os
path = os.path
import unittest
import myhdl
from myhdl import *
@block
def ram1(dout, din, addr, we, clk, depth=128):
""" Simple ram model """
@instance
def logic():
mem = [intbv(0)[8:] for i in range(depth)]
a = intbv(0)[8:]
while ... |
malikcjm/qtcreator | tests/system/suite_HELP/tst_HELP02/test.py | #############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... |
annacarol/Recursos-NFE-em-Python | nfe/pysped/nfe/manual_401/carta_correcao.py | # -*- coding: utf-8 -*-
from nfe.pysped.xml_sped import *
from nfe.pysped.nfe.manual_401 import ESQUEMA_ATUAL
import os
DIRNAME = os.path.dirname(__file__)
CONDICAO_USO = u'A Carta de Correcao e disciplinada pelo paragrafo 1o-A do art. 7o do Convenio S/N, de 15 de dezembro de 1970 e pode ser utilizada para regulari... |
myd7349/Ongoing-Study | python/dat2dcm.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# 2015-03-23T14:34+08:00
__author__ = 'myd7349 <myd7349@gmail.com>'
__version__ = '0.0.1'
import logging
import os
import struct
import sys
import dicom # [pydicom](http://www.pydicom.org/)
import fileutil
import unpacker
_frozen = hasattr(sys, 'frozen') or hasattr... |
vicnet/weboob | modules/funmooc/test.py | # -*- coding: utf-8 -*-
# Copyright(C) 2016 Vincent A
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... |
MarcusJones/py_ExergyUtilities | ExergyUtilities/util_jinja2.py | # TEST MODULE
#===============================================================================
#--- SETUP Config
#===============================================================================
from config.config import *
import unittest
#===============================================================================
... |
RedhawkSDR/rest-python | model/_utils/test_concurrent.py | #!/usr/bin/env python
#
# This file is protected by Copyright. Please refer to the COPYRIGHT file
# distributed with this source distribution.
#
# This file is part of REDHAWK rtl-demo-app.
#
# REDHAWK rtl-demo-app is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Pu... |
lvitol/MultiNEAT | MultiNEAT.py | import time
from _MultiNEAT import *
from concurrent.futures import ProcessPoolExecutor, as_completed
import matplotlib.pyplot as plt
from numpy import array, clip
try:
import cv2
import numpy as np
cvnumpy_installed = True
except:
print ('Tip: install the OpenCV computer vision library (2.0+) with '
... |
YannChemin/MWS | DATA/BauddalokaMw/plot_mws.py | #!/usr/bin/env python
#Data file name
f="MetDept1.csv"
#Read CSV files
import csv
# open csv file
csvfile = open( f, "rb" )
# sniff into 10KB of the file to check its dialect
dialect = csv.Sniffer().sniff( csvfile.read( 10*1024 ) )
csvfile.seek(0)
# read csv file according to dialect
reader = csv.reader( csvfile, ... |
fatihzkaratana/intranet | backend/cmsutils/adminfilters.py | from django.contrib.admin import SimpleListFilter, RelatedFieldListFilter
from django.core.exceptions import FieldError
from django.http import Http404
from django.utils.datastructures import MultiValueDict
from django.utils.safestring import mark_safe
from django.utils.encoding import smart_unicode
from django.utils.t... |
freedomtan/workload-automation | wlauto/instrumentation/daq/__init__.py | # Copyright 2013-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
czhu95/ternarynet | tensorpack/__init__.py | # -*- coding: utf-8 -*-
# File: __init__.py
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import numpy # avoid https://github.com/tensorflow/tensorflow/issues/2034
import cv2 # avoid https://github.com/tensorflow/tensorflow/issues/1924
from . import models
from . import train
from . import utils
from . import tfutils
from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.