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 |
|---|---|---|---|---|---|
"""Unit tests for the OWASP ZAP security warnings collector."""
from collector_utilities.functions import md5_hash
from .base import OWASPZAPTestCase
class OWASPZAPSecurityWarningsTest(OWASPZAPTestCase):
"""Unit tests for the OWASP ZAP security warnings collector."""
METRIC_TYPE = "security_warnings"
O... | ICTU/quality-time | components/collector/tests/source_collectors/owasp_zap/test_security_warnings.py | Python | apache-2.0 | 5,009 |
# Copyright 2012 NEC Corporation
# Copyright 2015 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | wolverineav/horizon | openstack_dashboard/dashboards/admin/networks/ports/tests.py | Python | apache-2.0 | 20,198 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import xlrd
import xlwt
import datetime
def request():
sheet = xlrd.open_workbook(os.path.join('E:/w/', '修改工单.xls')).sheet_by_index(0)
nRow = sheet.nrows
nCol = sheet.ncols
title = []
rowDatas = {}
for i in range(nRow):
# 标题
... | tiandizhiguai/test | src/main/java/com/test/python/data_test4.py | Python | apache-2.0 | 2,395 |
from toontown.coghq import DistributedLevelBattleAI
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import State
from direct.fsm import ClassicFSM, State
from toontown.battle.BattleBase import *
import CogDisguiseGlobals
from toontown.toonbase.ToonPythonUtil import addListsByValue
class DistributedB... | silly-wacky-3-town-toon/SOURCE-COD | toontown/coghq/DistributedBattleFactoryAI.py | Python | apache-2.0 | 2,839 |
#!/usr/bin/python
from light import Light
light = Light()
print light.getstate()
| bettse/hue | dump.py | Python | apache-2.0 | 82 |
"""
Copyright 2014-2016 University of Illinois
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 writ... | opena11y/fae2 | fae2/rules/tests.py | Python | apache-2.0 | 722 |
import pytest
# Test data
# Consider a bunch of Nodes, some of them are parents and some are children.
class Node(object):
NodeMap = {}
def __init__(self, name, parent=None):
self.name = name
self.children = []
self.NodeMap[self.name] = self
if parent:
self.parent =... | RKrahl/pytest-dependency | doc/examples/dyn-parametrized.py | Python | apache-2.0 | 1,397 |
# -*- coding:utf-8 -*-
from application import app
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000, debug=True)
| oceanio/flask-boot | server.py | Python | apache-2.0 | 130 |
# Copyright 2017 The Nuclio Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | nuclio/nuclio | hack/examples/python/facerecognizer/face.py | Python | apache-2.0 | 5,037 |
# Copyright 2014 F5 Networks 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 writi... | F5Networks/f5-common-python | f5/bigip/test/unit/test_mixins.py | Python | apache-2.0 | 7,579 |
# Some magic for Python3
try:
import SocketServer as socketserver
except ImportError:
import socketserver
import logging
import sys
import threading
class EchoUDPHandler(socketserver.BaseRequestHandler):
def handle(self):
data = self.request[0].strip()
socket = self.request[1]
logging.info("%s wrot... | rc500/ardrone_archive_aarons_laptop | ardrone/udpechoserver.py | Python | apache-2.0 | 746 |
"""
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
distri... | bcgov/gwells | app/backend/submissions/urls.py | Python | apache-2.0 | 2,402 |
import multiprocessing
import threading
import uuid
import random
import time
import os
import signal
import traceback
from memsql_loader.api import shared
from memsql_loader.db import connection_wrapper, pool
from memsql_loader.loader_db.tasks import Tasks
from memsql_loader.loader_db.jobs import Jobs
from memsql_loa... | memsql/memsql-loader | memsql_loader/execution/worker.py | Python | apache-2.0 | 14,261 |
# Copyright 2013-2015 DataStax, 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 writi... | sontek/python-driver | tests/integration/__init__.py | Python | apache-2.0 | 8,900 |
'''
Implements the targetcli target related UI.
This file is part of targetcli.
Copyright (c) 2011-2013 by Datera, 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/lic... | agrover/targetcli-fb | targetcli/ui_target.py | Python | apache-2.0 | 54,009 |
# Copyright 2015 IBM Corp.
#
# 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... | rajalokan/nova | nova/tests/unit/virt/libvirt/volume/test_fs.py | Python | apache-2.0 | 2,437 |
# Copyright (c) 2013 Mirantis 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 writi... | 0xf2/stackalytics | stackalytics/processor/record_processor.py | Python | apache-2.0 | 30,623 |
import ConfigParser
import os
import pwd
import shutil
import sys
import subprocess
import tempfile
sys.path.insert(0, os.path.join(os.environ['CHARM_DIR'], 'lib'))
from charmhelpers.core.hookenv import charm_dir, config, log, relation_set, open_port, close_port
from charmhelpers.core.templating import render
from ch... | cloudbase/zuul-charm | hooks/hooks.py | Python | apache-2.0 | 9,009 |
from django.conf.urls import patterns, url
from api.views import query
from api.views import search
from api.views import submit
urlpatterns = patterns('',
url(r'^food/$', query.food_handler, name='food'),
url(r'^categories/all/$', query.category_all_handler, name='category'),
url(r'^categories/all/detail... | czgu/opendataexperience | server/api/urls.py | Python | apache-2.0 | 625 |
def init_actions_(service, args):
"""
this needs to returns an array of actions representing the depencies between actions.
Looks at ACTION_DEPS in this module for an example of what is expected
"""
# some default logic for simple actions
return {
'autoscale': ['install']
}
def ins... | Jumpscale/ays_jumpscale8 | templates/fs/fs.btrfs/actions.py | Python | apache-2.0 | 4,712 |
import os
import tempfile
import unittest
import logging
from pyidf import ValidationLevel
import pyidf
from pyidf.idf import IDF
from pyidf.parametrics import ParametricRunControl
log = logging.getLogger(__name__)
class TestParametricRunControl(unittest.TestCase):
def setUp(self):
self.fd, self.path = t... | rbuffat/pyidf | tests/test_parametricruncontrol.py | Python | apache-2.0 | 1,196 |
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 re... | citrix-openstack-build/os-brick | os_brick/initiator/linuxscsi.py | Python | apache-2.0 | 8,320 |
import sys
import os.path
from logging import ERROR, WARN, INFO, DEBUG
import time
try:
import datablox_framework
except ImportError:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__),
"../../datablox_framework")))
import datablox_framework
fro... | mpi-sws-rse/datablox | blox/web_crawler_shard__1_0/b_web_crawler_shard.py | Python | apache-2.0 | 1,854 |
import responses
from zeus.constants import Permission
from zeus.models import (
Repository,
RepositoryAccess,
RepositoryBackend,
RepositoryProvider,
)
REPO_DETAILS_RESPONSE = """{
"id": 1,
"full_name": "getsentry/zeus",
"clone_url": "https://github.com/getsentry/zeus.git",
"ssh_url": ... | getsentry/zeus | tests/zeus/api/resources/test_github_repositories.py | Python | apache-2.0 | 4,294 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import talib
pd.set_option('display.max_rows', 500)
pd.set_option('display.max_columns', 30)
pd.set_option('precision', 7)
pd.options.display.float_format = '{:,... | Ernestyj/PyStudy | finance/DaysTest/DaysDataPrepareOld.py | Python | apache-2.0 | 5,771 |
#
# Copyright (C) 2014 Conjur Inc
#
# 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, merge, publish, distri... | conjurinc/api-python | conjur/role.py | Python | apache-2.0 | 6,400 |
from copy import deepcopy
from geom import geom
import numpy as np
import pandas as pd
class geom_jitter(geom):
VALID_AES = ['jitter']
def __radd__(self, gg):
gg = deepcopy(gg)
xcol = gg.aesthetics.get("x")
ycol = gg.aesthetics.get("y")
x = gg.data[xcol]
y = gg.data[yco... | hadley/ggplot | ggplot/geoms/geom_jitter.py | Python | bsd-2-clause | 542 |
class ConstraintFailureException(Exception):
pass
| tmaiwald/OSIM | OSIM/Optimizations/ConstraintFailureException.py | Python | bsd-2-clause | 55 |
#!/usr/bin/env python
# this only exists because sympy crashes IDAPython
# for general use sympy is much more complete
import traceback
import types
import copy
import operator
import random
import string
from memoize import Memoize
import numpy
import util
def collect(exp, fn):
rv = set()
def... | bniemczyk/symbolic | symath/core.py | Python | bsd-2-clause | 14,038 |
from ...utils.bitfun import encode_imm32, align, wrap_negative
from ..encoding import Relocation
from .isa import ArmToken, arm_isa
@arm_isa.register_relocation
class Rel8Relocation(Relocation):
name = "rel8"
token = ArmToken
field = "imm8"
def calc(self, sym_value, reloc_value):
assert sym_v... | windelbouwman/ppci-mirror | ppci/arch/arm/arm_relocations.py | Python | bsd-2-clause | 1,941 |
#!/usr/bin/env python
import logging
import socket
import struct
import time
import sys
import cb_bin_client
import couchbaseConstants
import pump
import cbsnappy as snappy
try:
import ctypes
except ImportError:
cb_path = '/opt/couchbase/lib/python'
while cb_path in sys.path:
sys.path.remove(cb_p... | TOTVS/mdmpublic | couchbase-cli/lib/python/pump_mc.py | Python | bsd-2-clause | 17,056 |
import argparse
import os
import json
import sys
from lxml import etree
def process_file(name):
tree = etree.parse(name)
xpath = tree.xpath("//xsl:when/@test",
namespaces={"xsl": "http://www.w3.org/1999/XSL/Transform"})
test_xml = tree.xpath("/xsl:stylesheet/xsl:template/xsl:if[@tes... | gsnedders/presto-testo-converters | convert_xpath.py | Python | bsd-2-clause | 1,711 |
""" Web runtime based on Selenium.
Selenium is a Python library to automate browsers.
"""
from .common import BaseRuntime
class SeleniumRuntime(BaseRuntime):
""" Runtime based on Selenium (http://www.seleniumhq.org/), a tool
to automate browsers, e.g. for testing. Requires the Python package
"selenium... | JohnLunzer/flexx | flexx/webruntime/selenium.py | Python | bsd-2-clause | 1,783 |
from Crypto.Cipher import AES
import struct
CHUNK_SIZE = 32768
def encrypt_chunk(f, aes):
chunk = f.read(CHUNK_SIZE)
realn = len(chunk)
if realn == 0:
return ''
if realn % 16 != 0:
padding = 16 - (realn % 16)
chunk += ' ' * padding
head = struct.pack('!H', realn)
... | zhemao/bootlegger | bootlegger/cryptfile.py | Python | bsd-2-clause | 1,195 |
import os.path
import subprocess
import sys
import prob_util
CODEBASE_DIR = subprocess.check_output(['git', 'rev-parse', '--show-toplevel']).strip('\n')
MALE_NAME_FILE = os.path.join(CODEBASE_DIR, 'data', 'male-first.txt')
FEMALE_NAME_FILE = os.path.join(CODEBASE_DIR, 'data', 'female-first.txt')
LASTNAME_FILE = os.p... | iveygman/namegen | util/names.py | Python | bsd-2-clause | 1,858 |
# pylint: disable=W0401
from .test_triggers import *
from .test_views import *
from .test_factories import *
from .test_path_filter import *
from .test_topology import *
from .test_path_split import *
from .test_filters import *
from .test_graph import *
from .test_forms import *
from .test_fields import *
from .test_... | camillemonchicourt/Geotrek | geotrek/core/tests/__init__.py | Python | bsd-2-clause | 336 |
import traceback
from collections import namedtuple, defaultdict
import itertools
import logging
import textwrap
from shutil import get_terminal_size
from .abstract import Callable, DTypeSpec, Dummy, Literal, Type, weakref
from .common import Opaque
from .misc import unliteral
from numba.core import errors, utils, typ... | stonebig/numba | numba/core/types/functions.py | Python | bsd-2-clause | 26,542 |
from django.conf.urls import patterns, url
from packages.simple.views import PackageIndex, PackageDetail
handler404 = "packages.simple.views.not_found"
urlpatterns = patterns("",
url(r"^$", PackageIndex.as_view(), name="simple_package_index"),
url(r"^(?P<slug>[^/]+)/(?:(?P<version>[^/]+)/)?$", PackageDetail.... | crate-archive/crate-site | crateweb/apps/packages/simple/urls.py | Python | bsd-2-clause | 364 |
# Copyright 2012-2017 Luc Saffre
# License: BSD (see file COPYING for details)
from __future__ import unicode_literals
from __future__ import print_function
from lino.api import dd, rt, _
# from etgen.html import E
from .mixins import VatDocument
from lino_xl.lib.ledger.ui import PartnerVouchers, ByJournal, Print... | khchine5/xl | lino_xl/lib/vat/desktop.py | Python | bsd-2-clause | 4,520 |
# Copyright 2009-2015 Eucalyptus Systems, Inc.
#
# Redistribution and use of this software in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# Redistributions of source code must retain the above copyright notice,
# this list of conditions ... | nagyistoce/euca2ools | setup.py | Python | bsd-2-clause | 6,806 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Hutte documentation build configuration file, created by
# sphinx-quickstart on Mon Jul 27 23:08:58 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# auto... | bastienleonard/hutte | doc/sphinx/conf.py | Python | bsd-2-clause | 11,279 |
from optparse import make_option
import os
import shutil
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
import MySQLdb
from blog.models import Blog, Post, Asset
class Command(BaseCommand):
help = 'Import blog posts from Movable Type'
option_list = BaseCommand... | nodebox/workshops | blog/management/commands/import_mt.py | Python | bsd-2-clause | 4,262 |
# -*- coding: utf-8 -*-
"""
Builds epub book out of Paul Graham's essays: http://paulgraham.com/articles.html
Author: Ola Sitarska <ola@sitarska.com>
Copyright: Licensed under the GPL-3 (http://www.gnu.org/licenses/gpl-3.0.html)
This script requires python-epub-library: http://code.google.com/p/python-epub-builder/
"... | norayr/pgessays | pgessays.py | Python | bsd-2-clause | 2,125 |
#from shoutrequest import ShoutRequest
from djangorequest import DjangoRequest
import json
from twisted.internet import task
from twisted.internet import reactor
mb = {"requestid":"AAAAA1", "requesttype":"get", "requesttimeout":10, "requestbody":{"selects": [{"name":"sweetspot.models.Locations", "label":"L", "cols":["... | psiCode/shoutserver | mysite/djangorequest_test.py | Python | bsd-2-clause | 1,094 |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | melinath/django-stepping-out | stepping_out/migrations/0016_scheduled_dance_to_venue.py | Python | bsd-2-clause | 17,560 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Converted from VPC_With_VPN_Connection.template located at:
# http://aws.amazon.com/cloudformation/aws-cloudformation-templates
from troposphere import Base64, FindInMap, GetAtt, Join, Output
from troposphere import Parameter, Ref, Tags, Template
from troposphere.autoscaling... | ikben/troposphere | examples/VPC_single_instance_in_subnet.py | Python | bsd-2-clause | 14,764 |
# -*- coding: utf-8 -*-
# Copyright (c) 2012-2015, Anima Istanbul
#
# This module is part of anima-tools and is released under the BSD 2
# License: http://www.opensource.org/licenses/BSD-2-Clause
import tempfile
import unittest
import pymel.core as pm
from stalker import (db, User, Repository, Status, FilenameTempla... | sergeneren/anima | tests/env/maya/test_previs.py | Python | bsd-2-clause | 6,717 |
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
def queueMain():
from Player import PlayerEventCallbacks
from Queue import queue
from ... | albertz/music-player | src/modules/mod_queue.py | Python | bsd-2-clause | 505 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import time
import getpass
import schedule
import configparser
import subprocess
import syslog
import json
import datetime
import dateutil.parser
from time import gmtime, strftime
from pytz import timezone
import pytz
from datetime import timedelta
# Configuration
... | Mebus/pyresticd | cleanup.py | Python | bsd-2-clause | 2,933 |
# -*- coding: utf-8 -*-
"""
The Logging component of the Server.
"""
import logging.handlers
################################################################################
class Logging:
"""
This class handles the console and file logging.
"""
def __init__(self, filename):
self._logger =... | andreas-kowasch/DomainSearch | DomainSearchServer/additional/Logging.py | Python | bsd-2-clause | 1,463 |
#*******************************************************************************
# U n s u p e r v i s e d D e c o m p o s i t i o n B a s e *
#*******************************************************************************
class UnsupervisedDecompositionBase(object):
#human readable information... | ilastik/ilastik-0.5 | ilastik/modules/unsupervised_decomposition/core/algorithms/unsupervisedDecompositionBase.py | Python | bsd-2-clause | 1,598 |
# proxy module
from __future__ import absolute_import
from apptools.help.help_plugin.help_doc import *
| enthought/etsproxy | enthought/help/help_plugin/help_doc.py | Python | bsd-3-clause | 103 |
# -*- coding: utf-8 -*-
# Copyright (c) 2013, Mayo Clinic
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# ... | cts2/rf2db | rf2db/parsers/RF2Iterator.py | Python | bsd-3-clause | 9,117 |
# Copyright (c) 2013 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.
"""Class for running uiautomator tests on a single device."""
from pylib.instrumentation import test_options as instr_test_options
from pylib.instrument... | mogoweb/chromium-crosswalk | build/android/pylib/uiautomator/test_runner.py | Python | bsd-3-clause | 2,258 |
import numpy as np
import h5py
from checkpoint import Writer, create_reader
class Baz:
def __init__(self):
self.z = {1:'one', 'two': 2, 'tree': [1,2,'three']}
def write(self, group):
writer = Writer(group, self)
writer.yaml('z')
@staticmethod
def read(group):
foo, re... | thni/clash | checkpoint/example/main.py | Python | bsd-3-clause | 1,870 |
# proxy module
from pyface.layered_panel import *
| enthought/etsproxy | enthought/pyface/layered_panel.py | Python | bsd-3-clause | 50 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.org/wiki/TracLicense.
#
# This software consists o... | exocad/exotrac | tracopt/ticket/commit_updater.py | Python | bsd-3-clause | 12,921 |
import shutil
import subprocess as sub
pdf = '_build/latex/gcmstools.pdf'
try:
sub.call(['make', 'latexpdf'])
except:
print("There was an error in latexpdf generation.")
else:
shutil.copy(pdf, '..')
sub.call(['make', 'clean'])
| rnelsonchem/gcmstools | docs/makepdf.py | Python | bsd-3-clause | 246 |
#!/usr/bin/env python
# Authors: Thomas Cannon <tcannon@viaforensics.com>
# Seyton Bradford <sbradford@viaforensics.com>
# Cedric Halbronn <cedric.halbronn@sogeti.com>
# TAGS: Android, Device, Decryption, Crespo, Bruteforce
#
# Parses the header for the encrypted userdata partition
# Decrypts the mas... | sogeti-esec-lab/android-fde | pydroidfde/bruteforce.py | Python | bsd-3-clause | 4,064 |
# http://matpalm.com/blog/2012/12/27/dead_simple_pymc/
from pylab import * # for close()
import spacepy.plot as spp # for the styles
import numpy as np
import pymc as pm
| balarsen/pymc_learning | Learning/simple_normal_model.py | Python | bsd-3-clause | 175 |
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | was4444/chromium.src | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py | Python | bsd-3-clause | 78,408 |
# Delegation tree
#
# Targets
# / \
# a f
# / \
# b e
# / \
# c d
#
# No terminating delegations.
#
# Roles should be evaluated in the order:
# Targets > a > b > c > d > e > f
from fixtures.builder import FixtureBuilder
def build():
... | theupdateframework/go-tuf | client/testdata/php-tuf-fixtures/TUFTestFixture3LevelDelegation/__init__.py | Python | bsd-3-clause | 1,041 |
import liblo
import time
from liblo import make_method
target = liblo.Address(12002)
class SerialOsc(liblo.Server):
def __init__(self, *args, **kwargs):
liblo.Server.__init__(self, *args, **kwargs)
self.devices = []
@make_method('/serialosc/device', 'ssi')
def list_device(self, path, args... | litghost/etherdream_toys | monome_test.py | Python | bsd-3-clause | 1,048 |
from django.db import models
from django.contrib.postgres.fields import ArrayField
from localflavor.us.us_states import US_STATES
from django.core.urlresolvers import reverse
from django.utils.text import slugify
from common.models import TimestampedModel
import uuid
STATE_NATL_CHOICES = (('US', 'National'),) + US_STA... | sunlightlabs/hall-of-justice | cjdata/models.py | Python | bsd-3-clause | 5,438 |
# -*- coding: utf-8 -*-
import sys
def main():
sys.exit(42)
def test_is_compiled():
global __cached__, __file__
try:
source = __cached__ or __file__
except NameError:
source = __file__
assert source.endswith('.pyc')
def test_extras():
from extension_dist.test_ext import get... | dairiki/humpty | tests/dist1/dist1.py | Python | bsd-3-clause | 558 |
# -*- coding: utf8 -*-
"""
This is part of shot detector.
Produced by w495 at 2017.05.04 04:18:27
"""
from __future__ import absolute_import, division, print_function
import datetime
import logging
import av
import six
# noinspection PyUnresolvedReferences
from av.container import InputContainer
from shot_d... | w495/python-video-shot-detector | shot_detector/handlers/base_handler.py | Python | bsd-3-clause | 8,236 |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Examples:
url(r'^$', 'formsfive.views.example', name='example'),
)
| iamjstates/django-formsfive | urls.py | Python | bsd-3-clause | 268 |
import os
from tempfile import NamedTemporaryFile
from numpy.testing import assert_array_equal
import pandas as pd
import oddt
import oddt.pandas as opd
test_data_dir = os.path.dirname(os.path.abspath(__file__))
input_fname = os.path.join(test_data_dir, 'data/dude/xiap/actives_docked.sdf')
def test_classes():
... | oddt/oddt | tests/test_pandas.py | Python | bsd-3-clause | 6,915 |
from django.conf import settings
from django.conf.urls import url
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.utils.html import format_html, format_html_join
from wagtail.wagtailcore import hooks
from .views import get_full_image_url
@hooks.register('register_admin_urls')
def r... | takeflight/wagtailannotatedimage | wagtailannotatedimage/wagtail_hooks.py | Python | bsd-3-clause | 923 |
from django.conf.urls.defaults import *
import price_tracker.views
from django.contrib import admin
admin.autodiscover()
handler500 = 'djangotoolbox.errorviews.server_error'
urlpatterns = patterns(
'',
(r'^admin/', include(admin.site.urls)),
(r'results', price_tracker.views.results),
(r'^$', price_tr... | vinayan3/clpricehistory | urls.py | Python | bsd-3-clause | 458 |
import os
import StringIO
import subprocess
import tempfile
from base64 import b64encode
from django.conf import settings
from django.core.files.storage import default_storage as storage
from PIL import Image
import olympia.core.logger
log = olympia.core.logger.getLogger('z.versions.utils')
def write_svg_to_png(... | atiqueahmedziad/addons-server | src/olympia/versions/utils.py | Python | bsd-3-clause | 4,124 |
import json
import re
import pytest
from django import forms
from django.core import exceptions, serializers
from django.core.management import call_command
from django.db import connection, models
from django.db.migrations.writer import MigrationWriter
from django.db.models import Q
from django.test import SimpleTest... | arnau126/django-mysql | tests/testapp/test_listcharfield.py | Python | bsd-3-clause | 21,270 |
# Copyright (c) 2011 Tencent Inc.
# All rights reserved.
#
# Author: Michaelpeng <michaelpeng@tencent.com>
# Date: October 20, 2011
"""
This is the cc_target module which is the super class
of all of the scons cc targets, like cc_library, cc_binary.
"""
import os
import subprocess
import Queue
import blade
im... | project-zerus/blade | src/blade/cc_targets.py | Python | bsd-3-clause | 39,092 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... | dag/genshi | genshi/tests/output.py | Python | bsd-3-clause | 21,084 |
from mrjob.job import MRJob
from itertools import combinations
class MRStatistics(MRJob):
def mapper(self, key, line):
account_id, user_id, purchased, session_start_time, session_end_time = line.split()
purchased = int(purchased)
session_duration = int(session_end_time) - int(session_star... | jepatti/mrjob_recipes | statistic_rollup/statistic_summarize.py | Python | bsd-3-clause | 920 |
import numpy as np
print '*******numpy array***********'
randArray = np.random.rand(4,4)
randMat = np.mat(randArray)
irandMat = randMat.I
a1=np.array(range(10,30,5))
a11=a1.reshape((2,2))
a111 = np.arange(12).reshape(3,4)
a2=np.linspace(0,2,10)
b=np.zeros((3,4))
c=np.ones((2,3,4),dtype='int16')
d=np.empty((2,3))
... | likeucode/PythonLearning | sciComputing/matrixComputing.py | Python | bsd-3-clause | 1,067 |
# coding: utf-8
"""
Utilities for dealing with text encodings
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2012 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part... | marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/IPython/utils/encoding.py | Python | bsd-3-clause | 2,724 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier. All Rights Reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
import ... | duyuan11/glumpy | examples/gloo-trace.py | Python | bsd-3-clause | 1,814 |
#!/usr/bin/env python
import os
import time
from threading import Timer
from pprint import pprint
from datetime import datetime
import gobject
import glob
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
gobject.threads_init() # Multithreaded python progr... | Benny-/android-accessory-protocol-bridge | Accessory/Payloads/testStub.py | Python | bsd-3-clause | 9,363 |
"""
Model definition for weakly supervised object localization with pytorch
=====================================================================
*Author*: Yu Zhang, Northwestern Polytechnical University
"""
import torch
import torch.nn as nn
import numpy as np
import os
# import shutil
import torchvision.models as mo... | zhangyuygss/WSL | model/model.py | Python | bsd-3-clause | 4,628 |
from django.conf import settings
from django.core.urlresolvers import get_mod_func
REGISTRY = {}
backends = getattr(settings, 'SMSGATEWAY_BACKENDS', ())
for entry in backends:
module_name, class_name = get_mod_func(entry)
backend_class = getattr(__import__(module_name, {}, {}, ['']), class_name)
instance... | peterayeni/django-smsgateway | smsgateway/backends/__init__.py | Python | bsd-3-clause | 444 |
import os, sys; sys.path.insert(0, os.path.join("..", ".."))
from pattern.web import Google, plaintext
from pattern.web import SEARCH
# The web module has a SearchEngine class with a search() method
# that yields a list of Result objects.
# Each Result has url, title, description, language, author and date and prope... | piskvorky/pattern | examples/01-web/01-google.py | Python | bsd-3-clause | 1,660 |
"""
Copyright (c) 2019 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals, absolute_import
from atomic_reactor.constants import PLUGIN_PUSH_FLOATING_TAGS_KEY, PLUGIN_GROUP_MA... | projectatomic/atomic-reactor | atomic_reactor/plugins/exit_push_floating_tags.py | Python | bsd-3-clause | 3,577 |
""" Provider that returns vector representation of features in a data source.
This is a provider that does not return an image, but rather queries
a data source for raw features and replies with a vector representation
such as GeoJSON. For example, it's possible to retrieve data for
locations of OpenStreetMap points o... | mpuig/TileStache | TileStache/Vector/__init__.py | Python | bsd-3-clause | 22,199 |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | CMUSV-VisTrails/WorkflowRecommendation | vistrails/core/vistrail/module.py | Python | bsd-3-clause | 19,617 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "ConstantTrend", cycle_length = 12, transform = "Difference", sigma = 0.0, exog_count = 20, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_Difference/trend_ConstantTrend/cycle_12/ar_/test_artificial_1024_Difference_ConstantTrend_12__20.py | Python | bsd-3-clause | 271 |
# by AnvaMiba
import sys
import cPickle
import numpy as np
def main():
if len(sys.argv) != 2:
usage()
outFs = open(sys.argv[1], 'wb')
i = 0
train_i_ce_acc = []
test_i_ce_acc = []
line = sys.stdin.readline()
while line:
tokens = line.split()
if (len(tokens)) > 0 and (tokens[0] == 'Iteration:'):
i =... | Avmb/lowrank-gru | mnist_extract_stats_from_log.py | Python | bsd-3-clause | 1,282 |
# -*- coding: utf-8 -*-
from django.contrib import admin
from article.models import Article
from article.forms import ArticleAdminForm
from feincms.admin.editor import ItemEditor, TreeEditor
class ArticleAdmin(ItemEditor, TreeEditor):
"""
Article Control Panel in Admin
"""
class Media:
css = {... | indexofire/gravoicy | gravoicy/apps/article/admin.py | Python | bsd-3-clause | 7,978 |
from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from utils import email_to_username
class RegistrationForm(forms.Form):
"""
Our form for registering a new account.
This uses the user's email as their credentials.
"""
erro... | paulcwatts/django-auth-utils | auth_utils/forms.py | Python | bsd-3-clause | 2,089 |
from holoviews.element import (
VLine, HLine, Bounds, Box, Rectangles, Segments, Tiles, Path
)
import numpy as np
from .test_plot import TestPlotlyPlot
default_shape_color = '#2a3f5f'
class TestShape(TestPlotlyPlot):
def assert_shape_element_styling(self, element):
props = dict(
fillcolor=... | ioam/holoviews | holoviews/tests/plotting/plotly/test_shapeplots.py | Python | bsd-3-clause | 15,348 |
# Virtual memory analysis scripts.
# Developed 2012-2014 by Peter Hornyack, pjh@cs.washington.edu
# Copyright (c) 2012-2014 Peter Hornyack and University of Washington
from plotting.multiapp_plot_class import *
from util.pjh_utils import *
from plotting.plots_common import *
import trace.vm_common as vm
#############... | pjh/vm-analyze | plotting/plot_vmaops.py | Python | bsd-3-clause | 11,539 |
# Copyright (c) 2011-2014 by California Institute of Technology
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice,... | necozay/tulip-control | tulip/abstract/find_controller.py | Python | bsd-3-clause | 14,468 |
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-EventVwrBypass',
'Author': ['@enigma0x3'],
'Description': ("Bypasses UAC by performing an image hijack on the .msc file extension and starting eventvwr... | pierce403/EmpirePanel | lib/modules/privesc/bypassuac_eventvwr.py | Python | bsd-3-clause | 3,893 |
if __name__ == '__main__':
from views import *
app.run(debug=True)
| fxa90id/up-flask-forum | flask-forum.py | Python | bsd-3-clause | 76 |
# Modified by CNSL
# 1) including TDNN based char embedding
# 06/02/17
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be foun... | calee88/ParlAI | parlai/agents/drqa_msmarco/rnet.py | Python | bsd-3-clause | 13,354 |
"""
Django Settings that more closely resemble SAML Metadata.
Detailed discussion is in doc/SETTINGS_AND_METADATA.txt.
"""
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
def get_metadata_config(request):
"""
Get Metada... | Awingu/django-saml2-idp | saml2idp/saml2idp_metadata.py | Python | bsd-3-clause | 1,746 |
# ----------------------------------------------------------------------------
# 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 | qiime2/sdk/tests/test_util.py | Python | bsd-3-clause | 1,934 |
default_app_config = 'userlog.apps.UserLogConfig'
__version__ = '0.2'
| aaugustin/django-userlog | userlog/__init__.py | Python | bsd-3-clause | 71 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2011, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010-2011, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modificatio... | grischa/mytardis-mrtardis | tardis/tardis_portal/admin.py | Python | bsd-3-clause | 2,634 |
from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'places.views',
url(r'^summary/(?P<place_slug>[^/]+)/$', 'summary'),
url(r'^profiles/(?P<place_slug>[^/]+)/$', 'profiles'),
url(r'^programs/(?P<place_slug>[^/]+)/$', 'programs'),
)
| MAPC/masshealth | places/urls.py | Python | bsd-3-clause | 275 |