repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
xorpd/idsearch | idsearch/tests/test_func_iter.py | 1 | 2143 | import unittest
from idsearch.func_iter import FuncIter
class TestSearchDB(unittest.TestCase):
def test_basic(self):
my_iter = (i for i in range(5))
fiter = FuncIter(my_iter)
self.assertEqual(list(fiter), [0,1,2,3,4])
def test_map(self):
my_iter = (i for i in range(5))
... | gpl-3.0 |
martinhoefling/fretutils | lib/FRETUtils/Ensemble.py | 1 | 2936 | '''
Created on 24.06.2010
@author: mhoefli
'''
import random
import re
def readProbabilities(pbfile):
"""Reads in probabilities from a specific probability file, 1st colum is the regexp to match, 2nd the name and 3rd the probability in the ensemble"""
with open(pbfile) as pfh:
probabilities = []
... | bsd-3-clause |
thomasgilgenast/gilgistatus-nonrel | django/contrib/gis/db/backends/oracle/models.py | 310 | 2184 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... | bsd-3-clause |
kingvuplus/ops | tools/host_tools/FormatConverter/lamedb.py | 44 | 2381 | from datasource import datasource
class lamedb(datasource):
def __init__(self, filename = "lamedb"):
datasource.__init__(self)
self.setFilename(filename)
def setFilename(self, filename):
self.filename = filename
def getName(self):
return "lamedb"
def getCapabilities(self):
return [("read file", s... | gpl-2.0 |
Alwnikrotikz/autokey | src/test/interfacetest.py | 49 | 3165 | import unittest, time
from lib import interface, iomediator
class XLibInterfaceTest(unittest.TestCase):
def setUp(self):
self.service = MockService()
self.mediator = iomediator.IoMediator(self.service, iomediator.XLIB_INTERFACE)
self.mediator.start()
self.interface = self.medi... | gpl-3.0 |
mbareta/edx-platform-ft | common/lib/symmath/symmath/test_symmath_check.py | 166 | 2648 | from unittest import TestCase
from .symmath_check import symmath_check
class SymmathCheckTest(TestCase):
def test_symmath_check_integers(self):
number_list = [i for i in range(-100, 100)]
self._symmath_check_numbers(number_list)
def test_symmath_check_floats(self):
number_list = [i + ... | agpl-3.0 |
jzmnd/fet-py-scripts | agilent4155_matlab_output_param.py | 1 | 3478 | #! /usr/bin/env python
"""
agilent4155_matlab_output_param.py
Prarmeter extractor for matlab generated .xlsx idvd files
Created by Jeremy Smith on 2015-10-29
University of California, Berkeley
j-smith@eecs.berkeley.edu
"""
import os
import sys
import xlrd
import numpy as np
import myfunctions as mf
from scipy import ... | mit |
Paczesiowa/youtube-dl | youtube_dl/extractor/internetvideoarchive.py | 146 | 3475 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_urllib_parse,
)
from ..utils import (
xpath_with_ns,
)
class InternetVideoArchiveIE(InfoExtractor):
_VALID_URL = r'https?://video\.internetvideoarchive\.net/flash/player... | unlicense |
PaloAltoNetworks-BD/SplunkforPaloAltoNetworks | Splunk_TA_paloalto/bin/splunk_ta_paloalto/aob_py2/lib2to3/fixes/fix_raise.py | 327 | 2934 | """Fixer for 'raise E, V, T'
raise -> raise
raise E -> raise E
raise E, V -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)
raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T -> warns about string exceptions
CAVEATS:... | isc |
embray/numpy | numpy/core/tests/test_indexing.py | 1 | 35320 | from __future__ import division, absolute_import, print_function
import sys
import warnings
import functools
import numpy as np
from numpy.core.multiarray_tests import array_indexing
from itertools import product
from numpy.testing import *
try:
cdll = np.ctypeslib.load_library('multiarray', np.core.multiarray.... | bsd-3-clause |
MaplePlan/djwp | django/conf/locale/ru/formats.py | 118 | 1250 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i:s'
D... | lgpl-3.0 |
iulian787/spack | var/spack/repos/builtin/packages/valgrind/package.py | 3 | 3379 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import sys
class Valgrind(AutotoolsPackage, SourcewarePackage):
"""An instrumentatio... | lgpl-2.1 |
fcelda/cds-monitor | monitor.py | 1 | 2054 | #!/usr/bin/env python3
import logging
import sched
import time
import cdsmon.source
import cdsmon.fetch
import cdsmon.update
class Monitor:
def __init__(self, source, fetch, update):
self._source = source
self._fetch = fetch
self._update = update
self._next = 0
def exec(self)... | gpl-3.0 |
swamireddy/python-cinderclient | cinderclient/tests/v2/test_limits.py | 3 | 6096 | # Copyright 2014 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 or agreed to in w... | apache-2.0 |
guijomatos/SickRage | lib/hachoir_parser/video/asf.py | 86 | 12869 | """
Advanced Streaming Format (ASF) parser, format used by Windows Media Video
(WMF) and Windows Media Audio (WMA).
Informations:
- http://www.microsoft.com/windows/windowsmedia/forpros/format/asfspec.aspx
- http://swpat.ffii.org/pikta/xrani/asf/index.fr.html
Author: Victor Stinner
Creation: 5 august 2006
"""
from h... | gpl-3.0 |
hzruandd/AutobahnPython | examples/asyncio/websocket/echo/client_coroutines.py | 9 | 2587 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
irvingprog/python-pilas-experimental | pilasengine/actores/bomba.py | 1 | 1122 | # -*- encoding: utf-8 -*-
# pilas engine: un motor para hacer videojuegos
#
# Copyright 2010-2014 - Hugo Ruscitti
# License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html)
#
# Website - http://www.pilas-engine.com.ar
from pilasengine.actores.animacion import Animacion
class Bomba(Animacion):
"""Representa un... | lgpl-3.0 |
Som-Energia/switching | switching/input/messages/B1.py | 1 | 3359 | # -*- coding: utf-8 -*-
from message import Message, except_f1
import C1, C2
class B1(Message):
"""Classe que implementa B1."""
@property
def sollicitud(self):
"""Retorna l'objecte Sollicitud"""
return C1.Sollicitud(self.obj.BajaEnergia.DatosSolicitud)
@property
def client(se... | gpl-3.0 |
msduketown/xbmc | lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsole.py | 265 | 2923 | #!/usr/bin/env python
from socket import *
from optparse import OptionParser
UDP_ADDR = "0.0.0.0"
UDP_PORT = 7724
BUFFER_SIZE = 65536
#HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp']
HEADER_KEYS = {
'mini': ('Level'),
'standard': ('Logger', 'Level', 'Source-Func... | gpl-2.0 |
t794104/ansible | lib/ansible/modules/network/nso/nso_action.py | 38 | 5770 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Cisco and/or its affiliates.
#
# 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... | gpl-3.0 |
smandy/locke | scons-local-2.3.4/SCons/Tool/MSCommon/common.py | 9 | 9169 | #
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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... | apache-2.0 |
Gabriel-p/photpy | tasks/match_auto.py | 2 | 1326 |
import numpy as np
from match_funcs import triangleMatch, reCenter, autoSrcDetect
def main(pars, xy_ref, hdulist):
"""
"""
hdu_data = hdulist[0].data
# Scale and rotation ranges, and match tolerance.
scale_range = (float(pars['scale_min']), float(pars['scale_max']))
rot_range = (float(pars['... | gpl-3.0 |
dati91/servo | tests/wpt/web-platform-tests/tools/webdriver/webdriver/protocol.py | 23 | 1672 | import json
import webdriver
"""WebDriver wire protocol codecs."""
class Encoder(json.JSONEncoder):
def __init__(self, *args, **kwargs):
kwargs.pop("session")
super(Encoder, self).__init__(*args, **kwargs)
def default(self, obj):
if isinstance(obj, (list, tuple)):
retur... | mpl-2.0 |
kaarl/pyload | module/plugins/accounts/SmoozedCom.py | 5 | 2968 | # -*- coding: utf-8 -*-
import hashlib
import time
try:
from beaker.crypto.pbkdf2 import PBKDF2
except ImportError:
from beaker.crypto.pbkdf2 import pbkdf2
from binascii import b2a_hex
class PBKDF2(object):
def __init__(self, passphrase, salt, iterations=1000):
self.passphrase = ... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_05_01/operations/_virtual_network_gateways_operations.py | 1 | 131134 | # 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 may ... | mit |
Centreon-Community/centreon-discovery | modPython/pycrypto-2.5/lib/Crypto/SelfTest/st_common.py | 118 | 2142 | # -*- coding: utf-8 -*-
#
# SelfTest/st_common.py: Common functions for SelfTest modules
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicati... | gpl-2.0 |
jmehnle/ansible | lib/ansible/modules/cloud/cloudstack/cs_host.py | 45 | 15623 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
souley221/projet | myapp/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | 1446 | 65937 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | mit |
hynnet/hiwifi-openwrt-HC5661-HC5761 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/idlelib/OutputWindow.py | 38 | 4392 | from Tkinter import *
from idlelib.EditorWindow import EditorWindow
import re
import tkMessageBox
from idlelib import IOBinding
class OutputWindow(EditorWindow):
"""An editor window that can serve as an output file.
Also the future base class for the Python shell window.
This class has no input facilitie... | gpl-2.0 |
jlegendary/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/widgets.py | 69 | 40833 | """
GUI Neutral widgets
All of these widgets require you to predefine an Axes instance and
pass that as the first arg. matplotlib doesn't try to be too smart in
layout -- you have to figure out how wide and tall you want your Axes
to be to accommodate your widget.
"""
import numpy as np
from mlab import dist
from p... | gpl-3.0 |
whereismyjetpack/ansible | lib/ansible/modules/network/basics/uri.py | 10 | 17972 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Romeo Theriault <romeot () hawaii.edu>
#
# 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 th... | gpl-3.0 |
xiaojunwu/crosswalk-test-suite | webapi/tct-notification-w3c-tests/inst.apk.py | 903 | 3180 | #!/usr/bin/env python
import os
import shutil
import glob
import time
import sys
import subprocess
from optparse import OptionParser, make_option
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
PARAMETERS = None
ADB_CMD = "adb"
def doCMD(cmd):
# Do not need handle timeout in this short script, let tool... | bsd-3-clause |
Senseg/Py4A | python-build/python-libs/gdata/build/lib/gdata/analytics/service.py | 213 | 13293 | #!/usr/bin/python
#
# Copyright (C) 2006 Google Inc.
# Refactored in 2009 to work for Google Analytics by Sal Uryasev at Juice 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
#
# ht... | apache-2.0 |
mvidalgarcia/indico | indico/modules/events/papers/models/competences.py | 2 | 2068 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from sqlalchemy import ARRAY
from indico.core.db import db
from ... | mit |
nwautomator/ncclient | examples/juniper/edit-config-jnpr.py | 6 | 1661 | #!/usr/bin/env python
import logging
import time
from ncclient import manager
from ncclient.xml_ import *
def connect(host, port, user, password, source):
conn = manager.connect(host=host,
port=port,
username=user,
password=password... | apache-2.0 |
ayepezv/GAD_ERP | addons/sale_timesheet/models/product.py | 22 | 1089 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
class ProductTemplate(models.Model):
_inherit = 'product.template'
track_service = fields.Selection(selection_add=[
('timesheet', 'Timesheets on project'),
... | gpl-3.0 |
sunils34/buffer-django-nonrel | tests/regressiontests/introspection/tests.py | 47 | 4699 | from django.conf import settings
from django.db import connection, DEFAULT_DB_ALIAS
from django.test import TestCase, skipUnlessDBFeature
from django.utils import functional
from models import Reporter, Article
#
# The introspection module is optional, so methods tested here might raise
# NotImplementedError. This is... | bsd-3-clause |
robmagee/django-cms | cms/cms_menus.py | 22 | 16139 | # -*- coding: utf-8 -*-
from django.utils.translation import get_language
from cms import constants
from cms.apphook_pool import apphook_pool
from cms.utils.permissions import load_view_restrictions, has_global_page_permission
from cms.utils import get_language_from_request
from cms.utils.conf import get_cms_setting
f... | bsd-3-clause |
sss/calibre-at-bzr | src/calibre/gui2/preferences/history.py | 9 | 1374 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import textwrap
from PyQt4.Qt import QComboBox, QStringList, Qt
from calibre.gui2 i... | gpl-3.0 |
miniconfig/home-assistant | homeassistant/components/media_player/squeezebox.py | 4 | 13243 | """
Support for interfacing to the Logitech SqueezeBox API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.squeezebox/
"""
import logging
import asyncio
import urllib.parse
import json
import aiohttp
import async_timeout
import voluptuous a... | mit |
edx/edx-platform | openedx/core/djangoapps/dark_lang/middleware.py | 4 | 5880 | """
Middleware for dark-launching languages. These languages won't be used
when determining which translation to give a user based on their browser
header, but can be selected by setting the Preview Languages on the Dark
Language setting page.
This middleware must be placed before the LocaleMiddleware, but after
the S... | agpl-3.0 |
krafczyk/spack | var/spack/repos/builtin/packages/ruby-narray/package.py | 2 | 1820 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
kevintaw/django | django/utils/translation/trans_real.py | 96 | 27887 | """Translation helper functions."""
from __future__ import unicode_literals
import gettext as gettext_module
import os
import re
import sys
import warnings
from collections import OrderedDict
from threading import local
from django.apps import apps
from django.conf import settings
from django.conf.locale import LANG_... | bsd-3-clause |
ww9rivers/pysnmp | examples/v3arch/agent/ntforg/trap-v2c-with-objects.py | 1 | 3234 | #
# Notification Originator
#
# Send SNMP TRAP notification using the following options:
#
# * SNMPv2c
# * with community name 'public'
# * over IPv4/UDP
# * send TRAP notification
# * to a Manager at 127.0.0.1:162
# * with TRAP ID IF-MIB::ifLink as MIB symbol
#
# The IF-MIB::ifLink NOTIFICATION-TYPE implies including ... | bsd-2-clause |
pminervini/ebemkg | energy/layer.py | 3 | 15946 | # -*- coding: utf-8 -*-
import numpy
import theano
import theano.tensor as T
import energy.activation as activation
# x, y: B x E
# Layers
class Layer(object):
"""Class for a layer with one input vector w/o biases."""
def __init__(self, rng, act, n_inp, n_out, tag=''):
"""
Constructor.
... | gpl-2.0 |
babycaseny/audacity | lib-src/lv2/lv2/plugins/eg-amp.lv2/waflib/Tools/fc_config.py | 266 | 9275 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re,shutil,os,sys,string,shlex
from waflib.Configure import conf
from waflib.TaskGen import feature,after_method,before_method
from waflib import Build,Utils
FC_FRAGMENT... | gpl-2.0 |
huertatipografica/huertatipografica-fl-scripts | AT_Effects/AT-patternMaker.py | 1 | 3589 | #FLM: AT PatternMaker
###########################
#INSTRUCTIONS
# Create glyphs with patterns to apply to the font. Be sure the glyphs have the same
# sufix, point and consecutive 3 digit numbers starting from 001.
# Example: sufix.001, sufix.002, sufix.003, etc.
# Execute the script and enter the sufix for the gly... | apache-2.0 |
tedlaz/pyted | pymiles/pymiles.old/u_txt_num.py | 1 | 4761 | # -*- coding: utf-8 -*-
import decimal
from collections import OrderedDict
def isNum(value): # Einai to value arithmos, i den einai ?
""" use: Returns False if value is not a number , True otherwise
input parameters :
1.value : the value to check against.
output: True or ... | gpl-3.0 |
clearlinux/autospec | autospec/build.py | 1 | 13247 | #!/bin/true
#
# build.py - part of autospec
# Copyright (C) 2015 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 3 of the License, or
# (at your option) any la... | gpl-3.0 |
Gravecorp/Gap | packages/IronPython.StdLib.2.7.3/content/Lib/popen2.py | 304 | 8416 | """Spawn a command with pipes to its stdin, stdout, and optionally stderr.
The normal os.popen(cmd, mode) call spawns a shell command and provides a
file interface to just the input or output of the process depending on
whether mode is 'r' or 'w'. This module provides the functions popen2(cmd)
and popen3(cmd) which r... | mpl-2.0 |
lygstate/repo | subcmds/status.py | 12 | 4477 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | apache-2.0 |
IanLewis/kay | kay/ext/gaema/__init__.py | 10 | 4654 | # -*- coding: utf-8 -*-
"""
kay.ext.gaema is a bit modified version of gaema.
Original gaema is hosted at http://code.google.com/p/gaema/
"""
import functools
import logging
import base64
from werkzeug.routing import RequestRedirect
from werkzeug.exceptions import (
HTTPException, InternalServerError
)
from kay.e... | bsd-3-clause |
danielfoord/google-diff-match-patch | python3/diff_match_patch.py | 297 | 67320 | #!/usr/bin/python3
"""Diff Match and Patch
Copyright 2006 Google Inc.
http://code.google.com/p/google-diff-match-patch/
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... | apache-2.0 |
romain-dartigues/ansible | lib/ansible/modules/cloud/vultr/vultr_account_facts.py | 27 | 3344 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
chenc10/Spark-PAF | ec2/lib/boto-2.34.0/boto/contrib/ymlmessage.py | 70 | 1880 | # Copyright (c) 2006,2007 Chris Moyer
#
# 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, di... | apache-2.0 |
mikhtonyuk/rxpython | asyncio/windows_utils.py | 7 | 5498 | """
Various Windows specific bits and pieces
"""
import sys
if sys.platform != 'win32': # pragma: no cover
raise ImportError('win32 only')
import socket
import itertools
import msvcrt
import os
import subprocess
import tempfile
import _winapi
__all__ = ['socketpair', 'pipe', 'Popen', 'PIPE', 'PipeHandle']
#... | mit |
connorbrinton/lcat | lcat/loading/annotations.py | 1 | 5671 | #!/usr/bin/env python
"""
BMI 260: Final Project
Load chest CT scan annotations from radiologist xml files.
"""
from collections import namedtuple
import os
import re
import xml.etree.ElementTree as ET
import numpy as np
import skimage
import skimage.measure
import skimage.segmentation
import lcat
# Nodule datatype... | gpl-3.0 |
moniqx4/bite-project | deps/gdata-python-client/samples/apps/marketplace_sample/appengine_utilities/cache.py | 26 | 12235 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2008, appengine-utilities project
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
... | apache-2.0 |
Beeblio/django | tests/httpwrappers/tests.py | 7 | 24602 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import copy
import os
import pickle
import unittest
import warnings
from django.core.exceptions import SuspiciousOperation
from django.core.signals import request_finished
from django.db import close_old_connections
from django.http import (QueryDict, ... | bsd-3-clause |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/IPython/core/magics/script.py | 5 | 9147 | """Magic functions for running cells in various scripts."""
from __future__ import print_function
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in t... | bsd-3-clause |
jsteemann/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_exception_variations.py | 213 | 4041 |
from test.test_support import run_unittest
import unittest
class ExceptionTestCase(unittest.TestCase):
def test_try_except_else_finally(self):
hit_except = False
hit_else = False
hit_finally = False
try:
raise Exception, 'nyaa!'
except:
hit_except =... | apache-2.0 |
scality/manila | manila/api/openstack/versioned_method.py | 7 | 1717 | # Copyright 2014 IBM Corp.
# Copyright 2015 Clinton Knight
# 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... | apache-2.0 |
codenote/chromium-test | third_party/mesa/MesaLib/src/mapi/glapi/gen/extension_helper.py | 46 | 8261 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2005
# All Rights Reserved.
#
# 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
# on the... | bsd-3-clause |
google-research/graph-attribution | tests/test_training.py | 1 | 3709 | # Copyright 2020 Google 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 to in writing, ... | apache-2.0 |
jbpoline/nidm-results_fsl | nidmfsl/fsl_exporter/fsl_exporter.py | 1 | 44126 | """
Export neuroimaging results created with feat in FSL following NIDM-Results
specification.
@author: Camille Maumet <c.m.j.maumet@warwick.ac.uk>
@copyright: University of Warwick 2013-2014
"""
import re
import os
import sys
import glob
import json
import numpy as np
import subprocess
import warnings
# If "nidmres... | mit |
SIFTeam/enigma2 | lib/python/Plugins/Extensions/DVDBurn/ProjectSettings.py | 15 | 11224 | from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Components.ActionMap import HelpableActionMap, ActionMap
from Components.Sources.List import List
from Components.Sou... | gpl-2.0 |
jasonbot/django | tests/m2m_multiple/tests.py | 227 | 2370 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, Category
class M2MMultipleTests(TestCase):
def test_multiple(self):
c1, c2, c3, c4 = [
Category.objects.create(name=name)
for name in ["Sports", "N... | bsd-3-clause |
tjanez/ansible | lib/ansible/plugins/lookup/fileglob.py | 131 | 1519 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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 lat... | gpl-3.0 |
h4ck3rm1k3/pip | tests/lib/test_lib.py | 48 | 1899 | """Test the test support."""
from __future__ import absolute_import
import filecmp
import re
from os.path import join, isdir
from tests.lib import SRC_DIR
def test_tmp_dir_exists_in_env(script):
"""
Test that $TMPDIR == env.temp_path and path exists and env.assert_no_temp()
passes (in fast env)
"""
... | mit |
watonyweng/nova | nova/tests/unit/api/openstack/compute/contrib/test_instance_usage_audit_log.py | 26 | 9875 | # Copyright (c) 2012 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 ... | apache-2.0 |
gxx/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/contenttypes/tests.py | 50 | 2788 | from django import db
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.contenttypes.views import shortcut
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpRequest
from django.test... | gpl-3.0 |
vinhlh/bite-project | deps/gdata-python-client/samples/apps/list_group_members.py | 23 | 4061 | #!/usr/bin/python
#
# Copyright 2012 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... | apache-2.0 |
duvholt/memorizer | memorizer/views/api.py | 2 | 8252 | import json
from flask import Blueprint, Response, request
from flask.views import MethodView
from memorizer import forms, models, utils
from memorizer.cache import cache
from memorizer.config import CACHE_TIME
from memorizer.user import get_user
api = Blueprint('api', __name__)
def error(message):
return {'me... | gpl-3.0 |
Antrek/NDNProject | docs/redmine_issue.py | 1 | 2560 | # -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# Based on http://doughellmann.com/2010/05/09/defining-custom-roles-in-sphinx.html
"""Integration of Sphinx with Redmine.
"""
from docutils import nodes, utils
from docutils.parsers.rst.roles import set_classes
def redmine_role(name, ... | gpl-3.0 |
cvegaj/ElectriCERT | venv3/lib/python3.6/site-packages/setuptools/py31compat.py | 320 | 1645 | import sys
import unittest
__all__ = ['get_config_vars', 'get_path']
try:
# Python 2.7 or >=3.2
from sysconfig import get_config_vars, get_path
except ImportError:
from distutils.sysconfig import get_config_vars, get_python_lib
def get_path(name):
if name not in ('platlib', 'purelib'):
... | gpl-3.0 |
billygoo/dev-365 | python/flask/minitwit/venv/Lib/encodings/cp862.py | 593 | 33626 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | gpl-2.0 |
murrayrm/python-control | examples/pvtol-nested.py | 2 | 4551 | # pvtol-nested.py - inner/outer design for vectored thrust aircraft
# RMM, 5 Sep 09
#
# This file works through a fairly complicated control design and
# analysis, corresponding to the planar vertical takeoff and landing
# (PVTOL) aircraft in Astrom and Murray, Chapter 11. It is intended
# to demonstrate the basic fun... | bsd-3-clause |
aospx-kitkat/platform_external_chromium_org | tools/telemetry/telemetry/core/chrome/tracing_backend.py | 23 | 5318 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cStringIO
import json
import logging
import socket
import threading
from telemetry.core import util
from telemetry.core.chrome import trace_resu... | bsd-3-clause |
simongoffin/my_odoo_tutorial | addons/product/wizard/__init__.py | 452 | 1076 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
IOArmory/quarterbackpython | lib/python3.5/site-packages/pip/commands/wheel.py | 170 | 7528 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import os
import warnings
from pip.basecommand import RequirementCommand
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import RequirementSet
from pip.utils import import_or_raise
from pip.utils.build import Bui... | mit |
nadavge/notejam | flask/notejam/views.py | 6 | 8667 | from datetime import date
import md5
from flask import render_template, flash, request, redirect, url_for, abort
from flask.ext.login import (login_user, login_required, logout_user,
current_user)
from flask.ext.mail import Message
from notejam import app, db, login_manager, mail
from notejam.models import User, Note... | mit |
p-morais/rl | rl/algos/dagger.py | 1 | 2489 | """CURRENTLY OUTDATED. WILL UPDATE IN FUTURE"""
"""
import torch
from torch import Tensor
from torch.autograd import Variable as Var
from torch.utils.data import DataLoader
from rl.utils import ProgBar, RealtimePlot
from rl.envs import controller
class DAgger():
def __init__(self, env, learner, expert):
... | mit |
PRJosh/kernel_samsung_manta | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
kch8qx/osf.io | tests/test_institution_model.py | 13 | 2887 | from nose.tools import * # flake8: noqa
from tests.base import OsfTestCase
from tests.factories import InstitutionFactory
from website.models import Institution, Node
class TestInstitution(OsfTestCase):
def setUp(self):
super(TestInstitution, self).setUp()
self.institution = InstitutionFactory()
... | apache-2.0 |
slayerjain/servo | tests/wpt/css-tests/css-text-decor-3_dev/html/reference/support/generate-text-emphasis-style-property-tests.py | 841 | 3434 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-style-property-011 ~ 020 which
cover all possible values of text-emphasis-style property, except none
and <string>, with horizontal writing mode. It outputs a list of all
tests it generated in the format of Mozilla reftest.... | mpl-2.0 |
nanolearning/edx-platform | cms/djangoapps/contentstore/views/tabs.py | 3 | 7875 | """
Views related to course tabs
"""
from access import has_course_access
from util.json_request import expect_json, JsonResponse
from django.http import HttpResponseNotFound
from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
f... | agpl-3.0 |
uwcirg/true_nth_usa_portal | portal/migrations/versions/7ad0da0d1b72_.py | 1 | 1909 | """empty message
Revision ID: 7ad0da0d1b72
Revises: af193c376724
Create Date: 2017-07-06 17:42:35.513647
"""
# revision identifiers, used by Alembic.
revision = '7ad0da0d1b72'
down_revision = 'af193c376724'
from alembic import op
import sqlalchemy as sa
def upgrade():
# ### commands auto generated by Alembic ... | bsd-3-clause |
mbox/django | django/http/__init__.py | 10 | 1231 | from django.http.cookie import SimpleCookie, parse_cookie
from django.http.request import (HttpRequest, QueryDict,
RawPostDataException, UnreadablePostError, build_request_repr)
from django.http.response import (HttpResponse, StreamingHttpResponse,
HttpResponseRedirect, HttpResponsePermanentRedirect,
HttpRe... | bsd-3-clause |
kisoku/ansible | lib/ansible/plugins/action/fetch.py | 9 | 8296 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# 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) an... | gpl-3.0 |
sergiohs84/googletest | test/gtest_help_test.py | 2968 | 5856 | #!/usr/bin/env python
#
# Copyright 2009, 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... | bsd-3-clause |
aopp/android_kernel_asus_grouper | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
cin/spark | examples/src/main/python/ml/elementwise_product_example.py | 128 | 1632 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
nimbis/django-cms | cms/models/permissionmodels.py | 3 | 9908 | # -*- coding: utf-8 -*-
from django.apps import apps
from django.db import models
from django.conf import settings
from django.contrib.auth.models import Group, UserManager
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.utils.encoding im... | bsd-3-clause |
RogerTangos/datahub-stub | src/account/urls.py | 3 | 2327 | from django.conf.urls import patterns, url
from account import forms as account_forms
urlpatterns = patterns(
'',
url(r'^login/?$', 'account.views.login', name='login'),
url(r'^register/?$', 'account.views.register', name='register'),
url(r'^logout/?$', 'account.views.logout', name='logout'),
url(... | mit |
javachengwc/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/attributemaps/adfs_v20.py | 40 | 2210 | CLAIMS = 'http://schemas.xmlsoap.org/claims/'
COM_WS_CLAIMS = 'http://schemas.xmlsoap.com/ws/2005/05/identity/claims/'
MS_CLAIMS = 'http://schemas.microsoft.com/ws/2008/06/identity/claims/'
ORG_WS_CLAIMS = 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/'
MAP = {
"identifier": "urn:oasis:names:tc:SAML:2.0:... | apache-2.0 |
RafaelCosman/pybrain | pybrain/optimization/distributionbased/nes.py | 25 | 5171 | __author__ = 'Daan Wierstra, Tom Schaul and Sun Yi'
from .ves import VanillaGradientEvolutionStrategies
from pybrain.utilities import triu2flat, blockCombine
from scipy.linalg import inv, pinv2
from scipy import outer, dot, multiply, zeros, diag, mat, sum
class ExactNES(VanillaGradientEvolutionStrategies):
""" ... | bsd-3-clause |
kelcecil/linux | tools/perf/scripts/python/check-perf-trace.py | 1997 | 2539 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
auslandei/CTP- | test/xspeedtdtest.py | 9 | 9516 | # encoding: UTF-8
import sys
from time import sleep
from PyQt4 import QtGui
from vnxspeedtd import *
#----------------------------------------------------------------------
def print_dict(d):
"""按照键值打印一个字典"""
for key,value in d.items():
print key + ':' + str(value)
#-------------... | apache-2.0 |
nhicher/ansible | lib/ansible/plugins/inventory/vultr.py | 39 | 5042 | # (c) 2018, Yanis Guenane <yanis+ansible@guenane.org>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
name: vultr
plugin_type: inventory
author:
... | gpl-3.0 |
rc/sfepy | script/plot_mesh.py | 4 | 4164 | #!/usr/bin/env python
"""
Plot mesh connectivities, facet orientations, global and local DOF ids etc.
To switch off plotting some mesh entities, set the corresponding color to
`None`.
"""
from __future__ import absolute_import
import sys
sys.path.append('.')
from argparse import ArgumentParser
import matplotlib.pyplo... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.