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 |
|---|---|---|---|---|---|
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/naboo/shared_elevated_walkway_s02.iff"
result.attribute_templ... | anhstudios/swganh | data/scripts/templates/object/static/structure/naboo/shared_elevated_walkway_s02.py | Python | mit | 456 |
""" Read in and access data from external resources such as gender lists."""
import os
import pickle
import cort
from cort.core import singletons
from cort.core import util
__author__ = 'smartschat'
@singletons.Singleton
class GenderData:
""" Read in and access data from lists with gender information.
A... | Yegor-Budnikov/cort | cort/core/external_data.py | Python | mit | 4,384 |
STRICT = False
try:
from django.conf import settings
STRICT = getattr(settings, 'PDF_MINER_IS_STRICT', STRICT)
except Exception:
# in case it's not a django project
pass
| tiffanyjaya/kai | vendors/pdfminer.six/pdfminer/settings.py | Python | mit | 187 |
# -*- coding: utf-8 -*-
import os
import collections
from six.moves import cPickle
import numpy as np
import re
import itertools
class TextLoader():
def __init__(self, data_dir, batch_size, seq_length):
self.data_dir = data_dir
self.batch_size = batch_size
self.seq_length = seq_length
... | bahmanh/word-rnn-tensorflow | utils.py | Python | mit | 4,469 |
""" heritago URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-... | TalatCikikci/heritago | heritago/heritago/urls.py | Python | mit | 1,796 |
from cms.exceptions import SubClassNeededError
from .models import PageExtension, TitleExtension
class ExtensionPool(object):
def __init__(self):
self.page_extensions = set()
self.title_extensions = set()
self.signaling_activated = False
def register(self, extension):
"""
... | macs03/demo-cms | cms/lib/python2.7/site-packages/cms/extensions/extension_pool.py | Python | mit | 4,797 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
# This progra... | 0vercl0k/rp | src/third_party/beaengine/tests/0fc2.py | Python | mit | 11,629 |
# -*- coding: utf-8 -*-
#
# Copyright © 2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should h... | beav/katello | cli/src/katello/client/api/errata.py | Python | gpl-2.0 | 1,793 |
# -*- coding: utf-8 -*-
from __future__ import division
from nltk.corpus import wordnet as wn #Importamos el lector del corpus de wordnet
import random
import operator
#########################################################################
## La función inicio crea la vista inicial que tendrá el usuario si no tiene... | iarroyof/define-semantic-annotation | define/controllers/particular.py | Python | gpl-2.0 | 21,463 |
#/*
# *
# * TuneIn Radio for XBMC.
# *
# * Copyright (C) 2013 Brian Hornsby
# *
# * 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... | sshnaidm/ru | plugin.audio.tuneinradio/resources/lib/tunein.py | Python | gpl-2.0 | 40,322 |
import psycopg
db = psycopg.connect("host=localhost dbname=fahstats")
cursor = db.cursor()
cursor.execute("select * from select_donors_data(0);")
donors_d0 = [linha[0] for linha in cursor.fetchall()]
cursor.execute("select * from select_donors_data(100);")
raw_list = [linha[0] for linha in cursor.fetchall()]
donors_d1 ... | ClodoaldoPinto/kakaostats | fahstats/scripts/python/nm.py | Python | gpl-2.0 | 865 |
from django.contrib import admin
from .models import (
Group,
GroupMembership,
)
class GroupAdmin(admin.ModelAdmin):
list_display = ('name', 'group_type', 'active', 'sequence')
list_filter = ('active',)
search_fields = ('name',)
class GroupMembershipAdmin(admin.ModelAdmin):
list_display =... | ubiquitypress/rua | src/manager/admin.py | Python | gpl-2.0 | 496 |
# Included modules
import os
import time
import json
import itertools
# Third party modules
import gevent
from Debug import Debug
from Config import config
from util import RateLimit
from util import StreamingMsgpack
from util import helper
from Plugin import PluginManager
FILE_BUFF = 1024 * 512
# Incoming request... | frerepoulet/ZeroNet | src/File/FileRequest.py | Python | gpl-2.0 | 19,416 |
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... | d0u9/examples | .ycm_extra_conf.py | Python | gpl-2.0 | 6,088 |
"""
Polygon path.
"""
from __future__ import absolute_import
#Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module.
import __init__
from fabmetheus_utilities.geometry.creation import lineation
from fabmetheus_utili... | natetrue/ReplicatorG | skein_engines/skeinforge-31/fabmetheus_utilities/geometry/creation/circle.py | Python | gpl-2.0 | 2,658 |
#!/usr/bin/python
import glob, os
from cjh.cli import Cli, ListPrompt
from cjh.lists import ItemList
class Fileman(object):
@classmethod
def pwd(cls, getstr=False):
"""
Emulate 'pwd' command
"""
string = os.getcwd()
if getstr:
return string
else: pr... | hammerhorn/hammerhorn-jive | igo/cjh/files.py | Python | gpl-2.0 | 2,267 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.1
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
# This file is compatible with both classic and new-style classes.
from sys import version_info
if version_info >= (2... | cathywu/Sentiment-Analysis | PyML-0.7.9/PyML/classifiers/ext/csvmodel.py | Python | gpl-2.0 | 14,618 |
from django.db import models
class RatingSubject(models.Model):
#we may be able to move this to a list of choices for the Rating model
name = models.CharField(max_length=20)
# MODEL PROPERTIES
# MODEL FUNCTIONS
def __unicode__(self):
return self.name
| tomcounsell/Cobra | apps/admin/models/rating_subject.py | Python | gpl-2.0 | 277 |
##
# Copyright 2009-2021 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | hpcuantwerpen/easybuild-easyblocks | easybuild/easyblocks/t/tbb.py | Python | gpl-2.0 | 11,850 |
import fauxfactory
import pytest
from wait_for import wait_for
from cfme import test_requirements
from cfme.cloud.provider import CloudProvider
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.cloud.provider.openstack import OpenStackProvider
from cfme.marke... | apagac/cfme_tests | cfme/tests/services/test_provision_stack.py | Python | gpl-2.0 | 11,067 |
from __future__ import print_function
import errno
import os
import click
from pathlib2 import Path
def _is_yaml_file(path):
return path.suffix in ('.yaml', '.eyaml')
def _warn_on_unknown_encryption(path):
if path.suffix == '.eyaml' and not Path('.yaml_key').is_file():
print(
"... | akarol/cfme_tests | cfme/scripting/link_config.py | Python | gpl-2.0 | 2,905 |
#
# Copyright (C) 2014 Aaron Cohen
#
# This file is part of SpaghettiPy. ... | TTSpaxxy/SpaghettiPy | src/mangle.py | Python | gpl-2.0 | 7,428 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import struct
from layer1 import VarLenMessage, VarLenSocket
class TagMessage:
"""
TagMessage contains a string tag and string data.
Paramters
---------
tag: string
The type of the message. Currently supported tags are "json" and
"asyn... | pfederl/CARTAvis | carta/scriptedClient/layer2.py | Python | gpl-2.0 | 2,551 |
# Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.opus_package import OpusPackage
class package(OpusPackage):
name = 'psrc'
required_opus_packages = ["opus_core", "opus_emme2", "urbansim"]
| christianurich/VIBe2UrbanSim | 3rdparty/opus/src/psrc/opus_package_info.py | Python | gpl-2.0 | 292 |
"""
Kodi resolveurl plugin
Copyright (C) 2014 smokdpi
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.
... | repotvsupertuga/tvsupertuga.repository | script.module.resolveurl/lib/resolveurl/plugins/videozoo.py | Python | gpl-2.0 | 3,993 |
# Copyright (C) 2015 Siavoosh Payandeh Azad
import matplotlib.pyplot as plt
import networkx
from ConfigAndPackages import Config
from ArchGraphUtilities.AG_Functions import return_node_location, return_node_number
import math
def draw_ag(ag, file_name):
"""
Generates Visualizations of the Architecture Graph ... | siavooshpayandehazad/SoCDep2 | src/main/python/ArchGraphUtilities/Arch_Graph_Reports.py | Python | gpl-2.0 | 11,459 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 Ole André Vadla Ravnås <oleavr@gmail.com>
# Copyright (C) 2006 Ali Sabil <ali.sabil@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 Foundation; ... | billiob/papyon | papyon/gnet/parser.py | Python | gpl-2.0 | 7,287 |
import random
while True:
x = random.randint(1, 20)
print (x)
| mohsraspi/mhscs14 | sabryna/weird.py | Python | gpl-2.0 | 71 |
class RecordingException(Exception):
pass
class Recording(object):
def __init__(self, stream, lenght):
import command
self.name = None
self.time = None
self.lenght = lenght
self.path = None
self._temp_path = None
self._processing_list = []
if i... | rizen1892/SmartHomeSolutions-Web | app/recording.py | Python | gpl-2.0 | 3,094 |
import traceback
import sys
import random
from gribapi import *
INPUT='../../data/constant_field.grib1'
OUTPUT='out.grib'
VERBOSE=1 # verbose error reporting
def example():
fin = open(INPUT)
fout = open(OUTPUT,'w')
gid = grib_new_from_file(fin)
nx = grib_get(gid,'Ni')
ny = grib_get(gid,'Nj')
... | MengbinZhu/pfldp | ropp-7.0/grib_api-1.9.9/examples/python/clone.py | Python | gpl-3.0 | 910 |
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... | cylc/cylc | tests/integration/utils/test_utils.py | Python | gpl-3.0 | 1,647 |
# systemOverloadHardening
#
# Used by:
# Celestials named like: Red Giant Beacon Class (6 of 6)
runTime = "early"
type = ("projected", "passive")
def handler(fit, module, context):
fit.modules.filteredItemMultiply(lambda mod: "overloadHardeningBonus" in mod.itemModifiedAttributes,
... | Ebag333/Pyfa | eos/effects/systemoverloadhardening.py | Python | gpl-3.0 | 406 |
#!/usr/bin/env python
#encoding: utf8
import rospy, actionlib
from std_msgs.msg import UInt16
from pimouse_ros.msg import MusicAction, MusicResult, MusicFeedback
def write_freq(hz=0):
bfile = "/dev/rtbuzzer0"
try:
with open(bfile,"w") as f:
f.write(str(hz) + "\n")
except IOError:
... | e1211205/pimouse_ros | scripts/buzzer4.py | Python | gpl-3.0 | 701 |
'''
SASSIE: Copyright (C) 2011-2016 Joseph E. Curtis, Ph.D.
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.... | madscatt/zazzie | src_2.7/sassie/analyze/altens/altens.py | Python | gpl-3.0 | 4,413 |
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | erjohnso/ansible | lib/ansible/plugins/action/ironware.py | Python | gpl-3.0 | 3,479 |
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
import re
from datetime import date
from pychess.compat import basestring, StringIO
from pychess.System import conf
from pychess.System.Log import log
from pychess.Utils.Board i... | metiscus/pychess | lib/pychess/Savers/pgn.py | Python | gpl-3.0 | 17,853 |
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
import unittest
import frappe
from frappe.utils import add_days, flt, get_datetime, getdate
from erpnext.hr.doctype.employee.test_employee import make_employee
from erpnext.hr.doctype.expense_claim.test_expense_claim import get_pa... | frappe/erpnext | erpnext/payroll/doctype/gratuity/test_gratuity.py | Python | gpl-3.0 | 7,019 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from memopol.votes import models
admin.site.register(models.Proposal)
admin.site.register(models.Recommendation)
admin.site.register(models.RecommendationData)
admin.site.register(models.Vote)
admin.site.register(models.Score)
| alirizakeles/memopol-core | memopol/votes/admin.py | Python | gpl-3.0 | 286 |
#
import io
import json
import sys
from django.core.management import call_command
from leaves.models import (
Harvester,
Panda,
)
from aloe import after, step
from aloe.tools import guess_types
from aloe_django.steps.models import (
test_existence,
tests_existence,
write_models,
writes_mode... | michelts/aloe_django | tests/integration/django/dill/leaves/features/steps.py | Python | gpl-3.0 | 1,684 |
# encoding: utf-8
import datetime
from django.db import models
from south.db import db
from south.v2 import DataMigration
class Migration(DataMigration):
def copy_revision(self, orm, source_revision):
question = getattr(source_revision, 'question', None)
answer = getattr(source_revision, 'answer... | samhoo/askbot-realworld | askbot/migrations/0050_move_qa_revisions_to_postrevision.py | Python | gpl-3.0 | 30,419 |
# encoding=utf-8
import os
import sys
import tempfile
import unittest
from dns.resolver import NoNameservers
from wpull.util import (datetime_str, python_version, filter_pem,
parse_iso8601_str, is_ascii, close_on_error,
get_exception_message, GzipPickleStream)
DEFAULT_... | chfoo/wpull | wpull/util_test.py | Python | gpl-3.0 | 4,235 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Tiger Soldier
#
# This file is part of OSD Lyrics.
#
# OSD Lyrics 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 ... | osdlyrics/osdlyrics | python/dbusext/property.py | Python | gpl-3.0 | 8,082 |
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Vv016 256Qam34
# Generated: Wed Feb 11 04:36:51 2015
##################################################
# Call XInitThreads as the _very_ first thing.
# After some Qt import, it's too late
import ctypes
impor... | drmpeg/gr-dvbt2 | apps/vv016_256qam34.py | Python | gpl-3.0 | 6,112 |
#This is the models.py file for the ACTIVITIES app
#These classes constitute the Organizations and Assignments modules in the database
#Will eventually be expanded to include events.
#Essentially -- anything where a person came to a location for a reason.
from django.db import models
from people.models import Individu... | jabauer/ProjectQuincy | activities/models.py | Python | gpl-3.0 | 6,624 |
# Copyright (C) 2012,2013
# Max Planck Institute for Polymer Research
# Copyright (C) 2008,2009,2010,2011
# Max-Planck-Institute for Polymer Research & Fraunhofer SCAI
#
# This file is part of ESPResSo++.
#
# ESPResSo++ is free software: you can redistribute it and/or modify
# it under the terms of t... | capoe/espressopp.soap | src/Int3D.py | Python | gpl-3.0 | 3,721 |
# Copyright (C) 2105 wysiwyng
#
# 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.
#
# This program is d... | wysiwyng/sr13 | voltaged.py | Python | gpl-3.0 | 1,416 |
#!/usr/bin/env python
import ROOT as r
def setTextBoxAttributes(text, color, font):
text.SetTextColor(color)
text.SetTextAlign(13)
text.SetTextSize(0.04)
text.SetTextFont(font)
def dress(canv, colors):
# need this to keep the objects alive
objs = []
vub_inc = r.TLatex(0.16,0.655,"V_{ub} inclusive")
... | matthewkenzie/gammacombo | scripts/plotModuleExample.py | Python | gpl-3.0 | 1,823 |
from baseclasses import SimpleTestCase
from unittest import skipIf
from test import conf
class AuditEtcPwd(SimpleTestCase):
def test_etcpwd(self):
self.assertRegexpMatches(self._outp(":audit.etcpasswd"), 'mail:x:8:8:mail:/var/mail:/bin/sh')
self.assertRegexpMatches(self._outp(":a... | jorik041/Weevely | testsuite/test_etcpwd.py | Python | gpl-3.0 | 1,005 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014-2015 Bitergia
#
# 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.
#
# This ... | pombredanne/Octopus | octopus/backends/docker.py | Python | gpl-3.0 | 4,587 |
target = "microsemi"
action = "synthesis"
syn_device = "a3p250"
syn_grade = "-2"
syn_package = "208 pqfp"
syn_top = "proasic3_top"
syn_project = "demo"
syn_tool = "libero"
modules = {
"local" : [ "../../../top/proasic3_sk/verilog" ],
}
| keyru/hdl-make | tests/counter/syn/proasic3_sk_libero/verilog/Manifest.py | Python | gpl-3.0 | 242 |
from codeschool.tests import *
from cs_auth.factories import *
# Fixtures
register(FriendshipStatusFactory)
class TestURLs(URLBaseTester):
public_urls = [
'/',
'/accounts/login',
'/accounts/signout',
]
login_urls = [
'/accounts/{user.username}/edit',
'/accounts/{us... | jonnatas/codeschool | old/cs_auth/test_app.py | Python | gpl-3.0 | 740 |
########################################################################
# File : Optimizer.py
# Author : Stuart Paterson
########################################################################
"""
The Optimizer base class is an agent that polls for jobs with a specific
status and minor status pair. The checkJo... | petricm/DIRAC | WorkloadManagementSystem/Agent/OptimizerModule.py | Python | gpl-3.0 | 11,859 |
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfgen/pdfimages.py
__version__=''' $Id$ '''
__doc__="""
Image functionality sliced out of canvas.py for generalization
"""
import os
import string
fr... | TaskEvolution/Task-Coach-Evolution | taskcoach/taskcoachlib/thirdparty/src/reportlab/pdfgen/pdfimages.py | Python | gpl-3.0 | 8,517 |
import json
import os
import socket
import sys
import threading
import time
import traceback
import urlparse
import uuid
from .base import (CallbackHandler,
RefTestExecutor,
RefTestImplementation,
TestharnessExecutor,
extra_timeout,
... | larsbergstrom/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py | Python | mpl-2.0 | 18,381 |
from __future__ import print_function
import binascii
def file_byte_generator(filename, block_size = 512):
with open(filename, "rb") as f:
while True:
block = f.read(block_size)
if block:
for byte in block:
yield byte
else:
break
def create_header(out_fh, in_filename... | Yukarumya/Yukarum-Redfoxes | toolkit/mozapps/update/updater/gen_cert_header.py | Python | mpl-2.0 | 633 |
# -*- coding: utf-8 -*-
import pytest
from unittest.mock import patch
import os
import json
from shipit_taskcluster.taskcluster_utils import get_queue_group_state
def mocked_listtaskgroup(task_group_id):
filename = os.path.join(os.path.dirname(__file__), 'testdata', task_group_id)
with open(filename, 'r') as... | garbas/mozilla-releng-services | src/shipit_taskcluster/tests/test_tc_utils.py | Python | mpl-2.0 | 912 |
from django.core.management.base import BaseCommand
from django.db.utils import IntegrityError
from apps.referencepool.models import *
import requests
import json
import os
__author__ = 'fki'
class Command(BaseCommand):
help = 'Harvest external resources to fill the Reference Pool'
def handle(self, *args, *... | policycompass/policycompass-services | apps/referencepool/management/commands/harvest.py | Python | agpl-3.0 | 2,610 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2012:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redis... | xorpaul/shinken | shinken/objects/checkmodulation.py | Python | agpl-3.0 | 4,462 |
"""
View for Courseware Index
"""
import logging
import urllib
# pylint: disable=attribute-defined-outside-init
from datetime import datetime
import waffle
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.core.context_pro... | miptliot/edx-platform | lms/djangoapps/courseware/views/index.py | Python | agpl-3.0 | 21,801 |
import logging
from raven.contrib.flask import Sentry
from raven.contrib.celery import register_signal, register_logger_signal
class SuperdeskSentry():
"""Sentry proxy that will do nothing in case sentry is not configured."""
def __init__(self, app):
if app.config.get('SENTRY_DSN'):
app.... | marwoodandrew/superdesk-core | superdesk/factory/sentry.py | Python | agpl-3.0 | 924 |
from django.contrib import admin
from parliament.committees.models import *
class CommitteeAdmin(admin.ModelAdmin):
list_display = ('short_name', 'slug', 'latest_session', 'display')
list_filter = ('sessions', 'display')
class CommitteeInSessionAdmin(admin.ModelAdmin):
list_display = ('committee', 'acron... | litui/openparliament | parliament/committees/admin.py | Python | agpl-3.0 | 1,334 |
# -*- coding: utf-8 -*-
u"""
Copyright 2013-2014 Olivier Cortès <oc@1flow.io>.
This file is part of the 1flow project.
1flow 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... | 1flow/1flow | oneflow/core/admin/__init__.py | Python | agpl-3.0 | 2,818 |
from django.conf.urls import include, url
urlpatterns = (
url(r'pre_login/$', 'apimanager.views.pre_login_view', name='pre_login'),
url(r'add/$', 'apimanager.views.add_application', name='add_application'),
url(r'update/(.*)/$', 'apimanager.views.update_application', name='update_application'),
url(r'... | City-of-Helsinki/devheldev | apimanager/urls.py | Python | agpl-3.0 | 396 |
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
import frappe.defaults
from frappe.utils import cint
class TestPurchaseReceipt(unittest.TestCase):
def test_make_pur... | gangadhar-kadam/hrerp | erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py | Python | agpl-3.0 | 4,417 |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
## Contact: Nokia Corporation (qt-info@nokia.com)
##
## This file is part of the documentation of the Qt Toolkit.
##
## $QT_... | igor-sfdc/qt-wk | doc/src/diagrams/contentspropagation/customwidget.py | Python | lgpl-2.1 | 6,222 |
import sys
from resources.datatables import WeaponType
def setup(core, object):
object.setStfFilename('static_item_n')
object.setStfName('weapon_pistol_trader_roadmap_01_02')
object.setDetailFilename('static_item_d')
object.setDetailName('weapon_pistol_trader_roadmap_01_02')
object.setStringAttribute('class_requi... | ProjectSWGCore/NGECore2 | scripts/object/weapon/ranged/pistol/weapon_pistol_trader_roadmap_01_02.py | Python | lgpl-3.0 | 580 |
import unittest
from parameterized import parameterized
from mock import patch, Mock
from dbus import DBusException
from omxplayer.dbus_connection import DBusConnection, DBusConnectionError
@patch('dbus.bus.BusConnection')
class DBusConnectionTests(unittest.TestCase):
def setUp(self):
self.proxy = Mock(... | willprice/python-omxplayer-wrapper | tests/unit/test_dbus_connection.py | Python | lgpl-3.0 | 3,009 |
import os
from OpenSSL.crypto import TYPE_RSA, TYPE_DSA, FILETYPE_PEM
from vFense import VFENSE_SSL_PATH
class SSLConstants():
RSA = TYPE_RSA
DSA = TYPE_DSA
PEM = FILETYPE_PEM
SSL_DIR = VFENSE_SSL_PATH
SERVER = 'server'
PRIV_NAME = 'server.key'
CERT_NAME = 'server.crt'
CSR_NAME = 's... | dtklein/vFense | tp/src/utils/_constants.py | Python | lgpl-3.0 | 765 |
#!/usr/bin/python
#-*- coding: utf-8 -*-
import cPickle as pickle, time, string
from SPARQLWrapper import SPARQLWrapper, JSON
import rdflib as r, pygraphviz as gv
import pylab as pl
# variaveis principais:
# classes (kk), props,
# vizinhanca_ (de classes)
T=time.time()
U=r.URIRef
def fazQuery(query):
NOW=time.tim... | OpenLinkedSocialData/ocd | OCD.py | Python | unlicense | 24,833 |
#!/usr/bin/env python
print("Hello world!")
| geography-munich/sciprog | material/sub/jrjohansson/scripts/hello-world.py | Python | apache-2.0 | 45 |
# Copyright 2015, eBay 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 agre... | doug-fish/neutron-lbaas-dashboard | neutron_lbaas_dashboard/dashboards/project/loadbalancersv2/workflows/__init__.py | Python | apache-2.0 | 672 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the Extended File System (HFS) file-like object."""
import unittest
from dfvfs.file_io import hfs_file_io
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.path import factory as path_spec_factory
from dfvfs.resolver import context
fr... | joachimmetz/dfvfs | tests/file_io/hfs_file_io.py | Python | apache-2.0 | 3,508 |
# Copyright 2015-2017 Capital One Services, LLC
#
# 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 ... | scotwk/cloud-custodian | c7n/resources/elb.py | Python | apache-2.0 | 29,736 |
# Copyright 2016 OpenStack Foundation
#
# 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 ... | noironetworks/neutron | neutron/db/migration/alembic_migrations/versions/newton/contract/3b935b28e7a0_migrate_to_pluggable_ipam.py | Python | apache-2.0 | 6,099 |
#!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | googleads/googleads-dfa-reporting-samples | python/v3_5/get_user_role_permissions.py | Python | apache-2.0 | 2,245 |
#! /usr/bin/env python
import sys
import yaml
import subprocess
USAGE = """USAGE:
{command} NAME NAMESPACE IMAGE [KEY=VALUE]* [@FILE]*
NAME: the name of the secret to create/replace
NAMESPACE: the target namespace of the secret. It should be the namespace of the broker for most usecases
IMAGE: the do... | jmontleon/ansible-service-broker | scripts/create_broker_secret.py | Python | apache-2.0 | 4,268 |
# Copyright 2016 Google 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, ... | calpeyser/google-cloud-python | vision/tests/unit/test_client.py | Python | apache-2.0 | 26,626 |
# Copyright 2017 Battelle Energy Alliance, LLC
#
# 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 t... | idaholab/raven | doc/workshop/ExternalModels/Bateman/AnalyticalDplMain.py | Python | apache-2.0 | 4,415 |
#!/usr/bin/env python
__author__ = 'greghines'
import numpy as np
import os
import pymongo
import urllib
import matplotlib.pyplot as plt
import cv2
# the directory to store the movie preview clips in
image_directory = "/home/greg/Databases/chimp/images/"
# connect to the mongodb server
client = pymongo.MongoClient()
... | zooniverse/aggregation | experimental/algorithms/chimp.py | Python | apache-2.0 | 2,689 |
#!/usr/bin/env python
import numpy
import unittest
from lib.abstract_recommender import AbstractRecommender
from lib.collaborative_filtering import CollaborativeFiltering
from lib.evaluator import Evaluator
from util.data_parser import DataParser
from util.model_initializer import ModelInitializer
class TestcaseBase(... | mostafa-mahmoud/sahwaka | tests/collaborative_tests.py | Python | apache-2.0 | 2,676 |
"""Flo device object."""
from __future__ import annotations
import asyncio
from datetime import datetime, timedelta
from typing import Any
from aioflo.api import API
from aioflo.errors import RequestError
from async_timeout import timeout
from homeassistant.helpers.typing import HomeAssistantType
from homeassistant.... | w1ll1am23/home-assistant | homeassistant/components/flo/device.py | Python | apache-2.0 | 7,961 |
# Lint as: python2, python3
# Copyright 2021 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
#
... | frreiss/tensorflow-fred | tensorflow/lite/python/metrics_nonportable_test.py | Python | apache-2.0 | 24,385 |
# SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
from __future__ import print_function
import sys
import os
import os.path
from fnmatch import fnmatch
from rez import __version__
from rez.utils.data_utils import cached_property
from rez.resolved_context import ResolvedContext
from re... | nerdvegas/rez | src/rez/status.py | Python | apache-2.0 | 12,472 |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | djkonro/client-python | kubernetes/client/models/v1_binding.py | Python | apache-2.0 | 6,246 |
#==========================================================================
#
# Copyright NumFOCUS
#
# 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/l... | malaterre/ITK | Wrapping/Generators/Python/Tests/lazy.py | Python | apache-2.0 | 1,068 |
import json
import urllib2
from isodate.isodatetime import parse_datetime
from isodate.isoerror import ISO8601Error
from django.conf import settings
from util import validate_uuid, convert_to_dict, get_agent_ifp
from Authorization import auth
from StatementValidator import StatementValidator
from ..models import Sta... | diagonalwalnut/Experience | lrs/util/req_validate.py | Python | apache-2.0 | 32,206 |
# Copyright 2014 Google 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, ... | calpeyser/google-cloud-python | storage/tests/unit/test_batch.py | Python | apache-2.0 | 22,603 |
#!/usr/bin/env python3
import argparse
import os
import pwd
import signal
import subprocess
import sys
from typing import Any, Callable, Generator, List, Sequence
from urllib.parse import urlunparse
TOOLS_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(TOOLS_DIR))
# check for the v... | punchagan/zulip | tools/run-dev.py | Python | apache-2.0 | 12,929 |
#!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import threading
import concurrent.fu... | nashif/zephyr | scripts/pylib/twister/twisterlib.py | Python | apache-2.0 | 157,854 |
"""Component to allow users to login and get tokens.
# POST /auth/token
This is an OAuth2 endpoint for granting tokens. We currently support the grant
types "authorization_code" and "refresh_token". Because we follow the OAuth2
spec, data should be send in formatted as x-www-form-urlencoded. Examples will
be in JSON ... | partofthething/home-assistant | homeassistant/components/auth/__init__.py | Python | apache-2.0 | 18,097 |
# Copyright 2011 OpenStack Foundation
# aLL Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | redhat-openstack/manila | manila/tests/api/v1/test_share_types.py | Python | apache-2.0 | 8,424 |
# -------------------------------------------------------------
#
# 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 unde... | apache/incubator-systemml | src/main/python/tests/matrix/test_transpose.py | Python | apache-2.0 | 2,059 |
"""Support for Automation Device Specification (ADS)."""
import threading
import struct
import logging
import ctypes
from collections import namedtuple
import asyncio
import async_timeout
import voluptuous as vol
from homeassistant.const import (
CONF_DEVICE, CONF_IP_ADDRESS, CONF_PORT, EVENT_HOMEASSISTANT_STOP)
... | jabesq/home-assistant | homeassistant/components/ads/__init__.py | Python | apache-2.0 | 9,717 |
# -*- coding: utf-8 -*-
# Copyright 2017, Digital Reasoning
#
# 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... | clarkperkins/stackdio | stackdio/api/formulas/exceptions.py | Python | apache-2.0 | 753 |
#!/usr/bin/python
# Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 appl... | Khushbu27/Tutorial | test/functional/test_container.py | Python | apache-2.0 | 57,149 |
from nose.plugins.attrib import attr
from unittest import TestCase
@attr("b")
def test_b():
assert 1 == 1
class TestBase(TestCase):
def test_a(self):
assert 1 == 1
class TestDerived(TestBase):
@attr("a")
def test_a(self):
assert 1 == 1
| kawamon/hue | desktop/core/ext-py/nose-1.3.7/functional_tests/support/issue771/test.py | Python | apache-2.0 | 272 |
# Copyright 2011 OpenStack Foundation # 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 req... | devoid/nova | nova/tests/scheduler/test_host_filters.py | Python | apache-2.0 | 80,600 |
from pattern.en import parse, Text
class TextParser(object):
def __init__(self):
self.proper_sentences = []
self.MIN_WORD_COUNT = 10
@staticmethod
def get_count_tag(sentence, tag):
count = 0
for word in sentence:
if word.type == tag:
count += 1
... | mrzl/ECO | src/experiments/textparser.py | Python | apache-2.0 | 1,618 |
# 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... | seanli9jan/tensorflow | tensorflow/python/data/experimental/ops/map_defun.py | Python | apache-2.0 | 2,667 |
# file findingaids/utils.py
#
# Copyright 2015 Emory University Library
#
# 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
#
# Unle... | emory-libraries/findingaids | findingaids/utils.py | Python | apache-2.0 | 862 |