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
Bionetbook/bionetbook
bnbapp/bionetbook/history/tests.py
2
24732
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. 1. catch change in protocol keys 2. catch added step 3. catch removed step 4. catch edited step 5. catch edited step children 6. catch ad...
mit
nyuszika7h/youtube-dl
youtube_dl/extractor/vimeo.py
4
46375
# coding: utf-8 from __future__ import unicode_literals import base64 import functools import json import re import itertools from .common import InfoExtractor from ..compat import ( compat_kwargs, compat_HTTPError, compat_str, compat_urlparse, ) from ..utils import ( clean_html, determine_ext...
unlicense
nugget/home-assistant
tests/components/history_graph/test_init.py
12
1308
"""The tests the Graph component.""" import unittest from homeassistant.setup import setup_component from tests.common import init_recorder_component, get_test_home_assistant class TestGraph(unittest.TestCase): """Test the Google component.""" def setUp(self): # pylint: disable=invalid-name """Set...
apache-2.0
OmeGak/indico
indico/modules/rb/models/blocked_rooms.py
2
4406
# 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 datetime import datetime, time from operator import attrgett...
mit
dajobe/SoCo
soco/ms_data_structures.py
1
21067
# -*- coding: utf-8 -*- # pylint: disable = star-args, too-many-arguments, unsupported-membership-test # pylint: disable = not-an-iterable # Disable while we have Python 2.x compatability # pylint: disable=useless-object-inheritance """This module contains all the data structures for music service plugins.""" # This...
mit
bkrukowski/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/recentstatus.py
143
3525
# Copyright (C) 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 of conditions and the...
bsd-3-clause
leorochael/odoo
addons/web/doc/_themes/flask_theme_support.py
2228
4875
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
agpl-3.0
da1z/intellij-community
python/lib/Lib/distutils/command/install_headers.py
85
1449
"""distutils.command.install_headers Implements the Distutils 'install_headers' command, to install C/C++ header files to the Python include directory.""" # This module should be kept compatible with Python 2.1. __revision__ = "$Id: install_headers.py 37828 2004-11-10 22:23:15Z loewis $" import os from distutils.co...
apache-2.0
jonathan-beard/edx-platform
openedx/core/djangoapps/user_api/legacy_urls.py
146
1461
""" Defines the URL routes for this app. """ from django.conf import settings from django.conf.urls import include, patterns, url from rest_framework import routers from . import views as user_api_views from .models import UserPreference USER_API_ROUTER = routers.DefaultRouter() USER_API_ROUTER.register(r'users', us...
agpl-3.0
kuke/models
fluid/PaddleRec/word2vec/preprocess.py
1
5840
# -*- coding: utf-8 -* import os import random import re import six import argparse import io import math prog = re.compile("[^a-z ]", flags=0) def parse_args(): parser = argparse.ArgumentParser( description="Paddle Fluid word2 vector preprocess") parser.add_argument( '--build_dict_corpus_dir'...
apache-2.0
CWVanderReyden/originalMyHomeNet
Scripts/activate_this.py
669
1129
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
gpl-3.0
cjltsod/python-social-auth
social/tests/backends/test_evernote.py
9
1655
from requests import HTTPError from social.p3 import urlencode from social.exceptions import AuthCanceled from social.tests.backends.oauth import OAuth1Test class EvernoteOAuth1Test(OAuth1Test): backend_path = 'social.backends.evernote.EvernoteOAuth' expected_username = '101010' access_token_body = urle...
bsd-3-clause
arangodb/arangodb
3rdParty/boost/1.71.0/libs/python/test/docstring.py
20
3897
# Copyright David Abrahams & Ralf W. Grosse-Kunsteve 2004-2006. # Distributed under the Boost Software License, Version 1.0. (See accompanying # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ''' >>> from docstring_ext import * >>> def selected_doc(obj, *args): ... doc = obj.__doc__.splitlines...
apache-2.0
throwable-one/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/messages/storage/__init__.py
393
1183
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module def get_storage(import_path): """ Imports the message storage class described by import_path, where import_path is the full Python path to the class. """ try: ...
gpl-3.0
sysuwuhaibin/vatus
vatus/testcases/test_bussiness/test_login_management/test_E73_modify_personal_information.py
1
5396
# -*- coding: utf-8 -*- import time import unittest from selenium import webdriver import settings class ModifyPersonalInfo(unittest.TestCase): def setUp(self): self.driver = None self.base_url = settings.test_parameters.get("bussiness_base_url") def test_E73_modify_personal_information(s...
apache-2.0
nhippenmeyer/django
django/contrib/gis/gdal/prototypes/ds.py
349
4403
""" This module houses the ctypes function prototypes for OGR DataSource related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*, OGR_Fld_* routines are relevant here. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_long, c_void_p from django.contrib.gis.gdal.envelope import OGREnvelope from djan...
bsd-3-clause
neno1978/xbmctorrent
resources/site-packages/html5lib/treebuilders/etree.py
721
12609
from __future__ import absolute_import, division, unicode_literals from six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBuilder(Elemen...
apache-2.0
mgood7123/UPM
Sources/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/proesch/simpleTexture/texturedQuad.py
2
2584
#!/usr/bin/python2.4 # # Load a texture from an image file and map it to a quad. # # Copyright (C) 2007 "Peter Roesch" <Peter.Roesch@fh-augsburg.de> # # This code is licensed under the PyOpenGL License. # Details are given in the file license.txt included in this distribution. import sys import array import Image i...
gpl-3.0
dycodedev/taiga-back
tests/integration/test_vote_issues.py
1
4147
# Copyright (C) 2015 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2015 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2015 David Barragán <bameda@dbarragan.com> # Copyright (C) 2015 Anler Hernández <hello@anler.me> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
lschule/biknstock
web/python/hello.py
1
2891
from __future__ import print_function import os from operator import itemgetter from crm114 import Classifier def index(req): data_path = '%s%s%s' % (os.path.dirname(__file__), os.sep, 'data') categories = ['good', 'bad'] print('Initializing classifier') print('- Categories: %s' % ', '.join(categori...
mit
tmalik25/Emall_PHP_MVC
apps/phpmyadmin4.1.14/doc/conf.py
10
9355
# -*- coding: utf-8 -*- # # phpMyAdmin documentation build configuration file, created by # sphinx-quickstart on Wed Sep 26 14:04:48 2012. # # 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 # autogenerated file. # # ...
gpl-2.0
cortedeltimo/SickRage
lib/chardet/mbcssm.py
289
25481
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
gpl-3.0
agry/NGECore2
scripts/mobiles/corellia/vrelt_mother.py
2
1656
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
lgpl-3.0
Sweetgrassbuffalo/ReactionSweeGrass-v2
.meteor/local/dev_bundle/python/Lib/ctypes/test/test_pickling.py
23
2219
import unittest import pickle from ctypes import * import _ctypes_test dll = CDLL(_ctypes_test.__file__) class X(Structure): _fields_ = [("a", c_int), ("b", c_double)] init_called = 0 def __init__(self, *args, **kw): X.init_called += 1 self.x = 42 class Y(X): _fields_ = [("str", c_char...
gpl-3.0
RajeevG96/Portfolio-Website
node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py
1509
17165
# Copyright (c) 2013 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. """Handle version information related to Visual Stuio.""" import errno import os import re import subprocess import sys import gyp import glob class VisualStudi...
mit
sigma-random/Triton
examples/callback_after.py
1
8375
# Output # # $ ./triton ./examples/callback_after.py ./samples/crackmes/crackme_xor a # 0x40056d: push rbp # -> #0 = (bvsub (_ bv140735022953896 64) (_ bv8 64)) ; Aligns stack # -> #1 = (_ bv140735022953936 64) # -> #2 = (_ bv4195694 64) ; RIP # # 0x40056e: mov rbp, rsp # -> #3 = (...
lgpl-3.0
eltonsantos/django
django/views/generic/edit.py
2
8429
import warnings from django.forms import models as model_forms from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponseRedirect from django.utils.encoding import force_text from django.views.generic.base import TemplateResponseMixin, ContextMixin, View from django.views.generic.deta...
bsd-3-clause
lelit/tailor
vcpx/tests/svn.py
1
13407
# -*- mode: python; coding: utf-8 -*- # :Progetto: vcpx -- svn specific tests # :Creato: gio 11 nov 2004 19:09:06 CET # :Autore: Lele Gaifax <lele@nautilus.homeip.net> # :Licenza: GNU General Public License # from unittest import TestCase from datetime import datetime from vcpx.repository.svn import changesets_fr...
gpl-3.0
tirsen/vitess
test/schema.py
7
13508
#!/usr/bin/env python # Copyright 2017 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...
apache-2.0
peterhinch/micropython-epaper
epaper.py
1
19329
# epaper.py main module for Embedded Artists' 2.7 inch E-paper Display. # Peter Hinch # version 0.9 # 17 Jun 2018 Adapted for VFS mount/unmount. # 18 Mar 2016 Adafruit module and fast (partial) updates. # 2 Mar 2016 Power control support removed. Support for fonts as persistent byte code # 29th Jan 2016 Monospaced font...
apache-2.0
cython-testbed/pandas
pandas/core/computation/pytables.py
2
19478
""" manage PyTables query interface via Expressions """ import ast from functools import partial import numpy as np import pandas as pd from pandas.core.dtypes.common import is_list_like import pandas.core.common as com from pandas.compat import u, string_types, DeepChainMap from pandas.core.base import StringMixin f...
bsd-3-clause
PyBro-JHU/Clue-Less
clueless/tests/client/game_play_functest.py
1
6596
""" This module is a functional test of the game_server and game_client interactions. a game server is spun up in a seperate process space and bound to localhost on port 5000. The game client is then used to interact with the game server. """ import unittest from multiprocessing.process import Process from clueless....
apache-2.0
Yannig/ansible
lib/ansible/modules/remote_management/oneview/oneview_san_manager.py
146
7717
#!/usr/bin/python # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP # 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
DreadPirateRobert/stock_visualiser
stock_visualiser_virtualenv/lib/python3.5/site-packages/tornado/curl_httpclient.py
19
22942
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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 a...
mit
40223137/w1717
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_result.py
788
19069
import io import sys import textwrap from test import support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestResult.shouldStop because t...
gpl-3.0
MycroftAI/mycroft-core
test/unittests/skills/test_intent_service.py
2
13918
# Copyright 2017 Mycroft AI 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 writin...
apache-2.0
EvanK/ansible
lib/ansible/modules/network/iosxr/iosxr_command.py
14
6779
#!/usr/bin/python # # Copyright: Ansible Project # 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', 'status': ['preview'],...
gpl-3.0
jakey-wan-kenobi/angular-sass-uirouter-browsersync-seed
node_modules/browser-sync/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
1788
1435
#!/usr/bin/env python import re import json # https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
tlakshman26/cinder-bug-fix-volume-conversion-full
cinder/scheduler/weights/goodness.py
25
5301
# Copyright (C) 2014 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 required by appli...
apache-2.0
yotchang4s/cafebabepy
src/main/python/test/test_userdict.py
9
7821
# Check every path through every method of UserDict from test import mapping_tests import unittest import collections d0 = {} d1 = {"one": 1} d2 = {"one": 1, "two": 2} d3 = {"one": 1, "two": 3, "three": 5} d4 = {"one": None, "two": None} d5 = {"one": 1, "two": 1} class UserDictTest(mapping_tests.TestHashMappingProto...
bsd-3-clause
ecreall/nova-ideo
novaideo/utilities/alerts_utility.py
1
9428
# -*- coding: utf8 -*- # Copyright (c) 2015 by Ecreall under licence AGPL terms # available on http://www.gnu.org/licenses/agpl.html # licence: AGPL # author: Amen Souissi import json import requests import re from persistent.list import PersistentList # from urllib.request import urlopen from pyramid.threadlocal im...
agpl-3.0
Orav/kbengine
kbe/res/scripts/common/Lib/ctypes/macholib/dyld.py
6
5065
""" dyld emulation """ import os from ctypes.macholib.framework import framework_info from ctypes.macholib.dylib import dylib_info from itertools import * __all__ = [ 'dyld_find', 'framework_find', 'framework_info', 'dylib_info', ] # These are the defaults as per man dyld(1) # DEFAULT_FRAMEWO...
lgpl-3.0
nuwainfo/treeio
infrastructure/api/tests.py
3
10441
# encoding: utf-8 # Copyright 2011 Tree.io Limited # This file is part of Treeio. # License www.tree.io/license """ Infrastructure: test api """ import json from django.test import TestCase from django.test.client import Client from django.core.urlresolvers import reverse from django.contrib.auth.models import User a...
mit
wooyek/nuntio
web/common/appenginepatch/ragendja/pyutils.py
11
2758
# -*- coding: utf-8 -*- from django.utils._threading_local import local def make_tls_property(default=None): """Creates a class-wide instance property with a thread-specific value.""" class TLSProperty(object): def __init__(self): self.local = local() def __get__(self, instance, cl...
mit
canwe/NewsBlur
apps/search/models.py
7
14978
import time import datetime import pymongo import pyes import redis import celery import mongoengine as mongo from django.conf import settings from django.contrib.auth.models import User from apps.search.tasks import IndexSubscriptionsForSearch from apps.search.tasks import IndexSubscriptionsChunkForSearch from apps.se...
mit
cwtaylor/viper
viper/modules/pst.py
6
5545
# This file is part of Viper - https://github.com/botherder/viper # See the file 'LICENSE' for copying permission. import os import datetime import tempfile import subprocess import email import hashlib import shutil from viper.common.abstracts import Module from viper.core.session import __sessions__ from viper.core...
bsd-3-clause
mrshelly/openerp71313
openerp/addons/account/project/wizard/account_analytic_inverted_balance_report.py
56
2066
# -*- 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 GNU...
agpl-3.0
Manuel1510/Manuelbot
requests/cookies.py
164
17564
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import copy import time import calendar import collections from .compat import cookielib, urlparse, urlunparse, Morsel try: import threading ...
unlicense
franosincic/edx-platform
common/djangoapps/track/views/tests/test_segmentio.py
40
21960
"""Ensure we can parse events sent to us from the Segment webhook integration""" from datetime import datetime import json from ddt import ddt, data, unpack from mock import sentinel from django.contrib.auth.models import User from django.test.client import RequestFactory from django.test.utils import override_setti...
agpl-3.0
potsmaster/cinder
cinder/tests/unit/test_tintri.py
8
10813
# Copyright (c) 2015 Tintri. 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 ap...
apache-2.0
bigswitch/nova
nova/servicegroup/drivers/mc.py
5
3461
# Service heartbeat driver using Memcached # Copyright (c) 2013 Akira Yoshiyama <akirayoshiyama at gmail dot com> # # This is derived from nova/servicegroup/drivers/db.py. # Copyright 2012 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with...
apache-2.0
zmarvel/playground
project6-hy/tests.py
1
4016
from hashtable import Hashtable import time ########################### ########## Tests ########## ########################### some_words = [u'lewes', # => 5 u'mistranscribe', # => 13 u'outbleed', # => 8 u'abstemiously', # => 12 u'antifeuda...
mit
stscieisenhamer/pyqtgraph
pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate_pyqt.py
49
11402
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './pyqtgraph/graphicsItems/PlotItem/plotConfigTemplate.ui' # # Created: Mon Dec 23 10:10:51 2013 # by: PyQt4 UI code generator 4.10 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _from...
mit
dreamsxin/kbengine
kbe/src/lib/python/Lib/test/test_stat.py
84
6997
import unittest import os from test.support import TESTFN, import_fresh_module c_stat = import_fresh_module('stat', fresh=['_stat']) py_stat = import_fresh_module('stat', blocked=['_stat']) class TestFilemode: statmod = None file_flags = {'SF_APPEND', 'SF_ARCHIVED', 'SF_IMMUTABLE', 'SF_NOUNLINK', ...
lgpl-3.0
opps/opps-polls
opps/polls/utils.py
2
1037
# coding: utf-8 import datetime from django.template.response import TemplateResponse def set_cookie(response, key, value, days_expire=90): if days_expire is None: max_age = 365 * 24 * 60 * 60 # one year else: max_age = days_expire * 24 * 60 * 60 expires = datetime.datetime.strftime(date...
mit
joshua-cogliati-inl/raven
rook/XMLDiff.py
1
19356
# 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...
apache-2.0
edensparkles/FIRSTAID
FIRST_AID/venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py
515
2165
from __future__ import absolute_import from ..packages.six.moves import http_client as httplib from ..exceptions import HeaderParsingError def is_fp_closed(obj): """ Checks whether a given file-like object is closed. :param obj: The file-like object to check. """ try: # Check vi...
mit
ROM-Jeremy/android_kernel_lge_msm8226-old
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
amyvmiwei/kbengine
kbe/res/scripts/common/Lib/encodings/iso8859_14.py
272
13652
""" Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.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_table) def decode(self,input,errors...
lgpl-3.0
eddyerburgh/free-code-camp-ziplines
advanced-front-end-development-projects/simon-game/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
1366
120842
# 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. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
mit
openatv/enigma2
lib/python/Plugins/Extensions/FileCommander/addons/dmnapi.py
3
1533
#!/usr/bin/python -u # -*- coding: UTF-8 -*- # napiprojekt.pl API is used with napiproject administration consent import re import os import os.path import sys import dmnapim def get_all(file, supplement): rex = re.compile('.*\\.%s$' % file[-3:], re.I) (dir, fname) = os.path.split(file) for f in os.listdir(dir):...
gpl-2.0
openstack/poppy
tests/functional/transport/pecan/controllers/test_set_service_status.py
2
5861
# Copyright (c) 2015 Rackspace, 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 wr...
apache-2.0
frouty/odoo_oph
addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py
52
3688
# -*- 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 GNU...
agpl-3.0
miminar/openshift-ansible
roles/lib_openshift/library/oc_secret.py
18
63114
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
apache-2.0
itsvetkov/pyqtgraph
pyqtgraph/debug.py
1
36061
# -*- coding: utf-8 -*- """ debug.py - Functions to aid in debugging Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. """ from __future__ import print_function import sys, traceback, time, gc, re, types, weakref, inspect, os, cProfile, threading from . import pt...
mit
datalogics/scons
test/Java/JAVACFLAGS.py
2
2206
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, ...
mit
cloudbase/maas
src/maasserver/migrations/0010_add_node_netboot.py
1
11133
# flake8: noqa # SKIP this file when reformatting. # The rest of this file was generated by South. # encoding: utf-8 import datetime from django.db import models from maasserver.enum import NODE_STATUS from south.db import db from south.v2 import SchemaMigration class Migration(SchemaMigration): def forwards(s...
agpl-3.0
tpsatish95/Python-Workshop
Python Environment Setup/Alternate/1. Python/1. Installer/Python-3.4.0(Linux)/Lib/test/support/__init__.py
4
75069
"""Supporting definitions for the Python regression tests.""" if __name__ != 'test.support': raise ImportError('support must be imported from the test package') import contextlib import errno import functools import gc import socket import sys import os import platform import shutil import warnings import unittes...
apache-2.0
DSLituiev/scikit-learn
sklearn/cross_decomposition/cca_.py
151
3192
from .pls_ import _PLS __all__ = ['CCA'] class CCA(_PLS): """CCA Canonical Correlation Analysis. CCA inherits from PLS with mode="B" and deflation_mode="canonical". Read more in the :ref:`User Guide <cross_decomposition>`. Parameters ---------- n_components : int, (default 2). numb...
bsd-3-clause
princeofdream/debug_src_full
network_utils/mqtt/mosquitto/test/broker/02-subpub-qos0.py
10
1380
#!/usr/bin/env python # Test whether a client subscribed to a topic receives its own message sent to that topic. import inspect, os, sys # From http://stackoverflow.com/questions/279237/python-import-a-module-from-a-folder cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( in...
gpl-2.0
wisdark/Empire
lib/common/modules.py
14
3311
""" Module handling functionality for Empire. Right now, just loads up all modules from the install path in the common config. """ import fnmatch import os import imp import messages import helpers class Modules: def __init__(self, MainMenu, args): self.mainMenu = MainMenu # pull the databa...
bsd-3-clause
gusDuarte/software-center-5.2
softwarecenter/config.py
1
2669
# Copyright (C) 20011 Canonical # # Authors: # Andrew Higginson # # 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; version 3. # # This program is distributed in the hope that it will be useful, ...
lgpl-3.0
cmlasu/smm_gem5
src/mem/slicc/symbols/Func.py
43
3474
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
marchaos/plugin.image.flickr
flickrapi/xmlnode.py
12
2860
'''FlickrAPI uses its own in-memory XML representation, to be able to easily use the info returned from Flickr. There is no need to use this module directly, you'll get XMLNode instances from the FlickrAPI method calls. ''' import xml.dom.minidom __all__ = ('XMLNode', ) class XMLNode: """XMLNode -- generic cla...
gpl-2.0
veteman/thepython2blob
logicanalyser2fss.py
1
5278
#Copyright 2015 B. Johan G. Svensson #Licensed under the terms of the MIT license (see LICENSE). from __future__ import division import struct, time, csv import fsslib class CSVWriter(): def __init__(self, fid, samplerate): pass class CSVReader(): def __init__(self, fid, samplerate): ...
mit
oxtopus/nupic
nupic/regions/ImageSensorExplorers/ManualSaliency.py
17
7091
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gpl-3.0
mbayon/TFG-MachineLearning
venv/lib/python3.6/site-packages/django/contrib/gis/gdal/envelope.py
105
7005
""" The GDAL/OGR library uses an Envelope structure to hold the bounding box information for a geometry. The envelope (bounding box) contains two pairs of coordinates, one for the lower left coordinate and one for the upper right coordinate: +----------o Upper right; (max_x, max_y) ...
mit
laurentb/weboob
modules/bouygues/module.py
1
2730
# -*- coding: utf-8 -*- # Copyright(C) 2019 Budget Insight # # This file is part of a weboob module. # # This weboob module is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the ...
lgpl-3.0
basicScandal/raft
thirdparty/pyamf/pyamf/python.py
11
1300
# Copyright (c) The PyAMF Project. # See LICENSE.txt for details. """ Python compatibility values and helpers. """ try: import builtins as builtins except ImportError: import builtins import types func_types = ( types.BuiltinFunctionType, types.BuiltinMethodType, types.CodeType, types.FunctionType,...
gpl-3.0
sysadminmatmoz/odoo-clearcorp
TODO-8.0/account_invoice_pricelist/wizard/sale_advance_payment_inv.py
4
1668
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Original Module by SIESA (<http://www.siesacr.com>) # Refactored by CLEARCORP S.A. (<http://clearcorp.co.cr>) # # This program is free software: you can redis...
agpl-3.0
shark147/k2ul-kernel
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
smartdevice475/sdl_core_346_wince
tools/InterfaceGenerator/generator/parsers/JSONRPC.py
14
2763
"""JSON RPC parser. Contains parser for JSON RPC XML format. """ from generator.parsers import RPCBase class Parser(RPCBase.Parser): """JSON RPC parser.""" def __init__(self): """Constructor.""" super(Parser, self).__init__() self._interface_name = None def _parse_root(self, ...
bsd-3-clause
abenzbiria/clients_odoo
openerp/osv/query.py
380
7513
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP S.A. http://www.openerp.com # # This program is free software: you can redistribute it and/or modify # it under the terms of the GN...
agpl-3.0
sempliva/Emotly
emotly/tests/test_model_user.py
1
6285
""" MIT License Copyright (c) 2016 Emotly Contributors 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, pu...
mit
thiagodasilva/swift
test/unit/proxy/test_sysmeta.py
9
16039
# 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 applicable law or agree...
apache-2.0
andyfaff/scipy
scipy/linalg/special_matrices.py
18
39925
import math import numpy as np from numpy.lib.stride_tricks import as_strided __all__ = ['tri', 'tril', 'triu', 'toeplitz', 'circulant', 'hankel', 'hadamard', 'leslie', 'kron', 'block_diag', 'companion', 'helmert', 'hilbert', 'invhilbert', 'pascal', 'invpascal', 'dft', 'fiedler', 'fied...
bsd-3-clause
Rayal/ROS_proov
ros_robotics_projects/chapter_7_codes/rostensorflow/image_recognition.py
1
1917
import rospy from sensor_msgs.msg import Image from std_msgs.msg import String from cv_bridge import CvBridge import cv2 import numpy as np import tensorflow as tf from tensorflow.models.image.imagenet import classify_image class RosTensorFlow(): def __init__(self): classify_image.maybe_download_and_extra...
mit
Jgarcia-IAS/SITE
openerp/addons/base/res/res_lang.py
196
12383
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
agpl-3.0
SUSE/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2015_06_15/operations/usages_operations.py
2
4170
# 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 ...
mit
rouge8/moto
tests/test_sqs/test_sqs.py
3
13819
from __future__ import unicode_literals import boto import boto3 from boto.exception import SQSError from boto.sqs.message import RawMessage, Message import requests import sure # noqa import time from moto import mock_sqs from tests.helpers import requires_boto_gte @mock_sqs def test_create_queue(): conn = bo...
apache-2.0
DailyActie/Surrogate-Model
01-codes/OpenMDAO-Framework-dev/openmdao.main/src/openmdao/main/test/test_connect_var.py
1
9889
# test_connect_var.py """ Testing connecting different variable types to each other. """ import unittest from openmdao.main.api import Assembly, Component, set_as_top from openmdao.main.datatypes.api import Array, Float, Int, Str, Bool, Enum class Oneout(Component): """ A simple output component """ ...
mit
camilonos77/bootstrap-form-python-generator
enviroment/lib/python2.7/site-packages/setuptools/command/egg_info.py
115
14336
"""setuptools.command.egg_info Create a distribution's .egg-info directory and contents""" import os import re import sys from setuptools import Command import distutils.errors from distutils import log from setuptools.command.sdist import sdist from setuptools.compat import basestring from setuptools import svn_uti...
gpl-2.0
dpetzold/django
django/contrib/gis/gdal/libgdal.py
449
3598
from __future__ import unicode_literals import logging import os import re from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int from ctypes.util import find_library from django.contrib.gis.gdal.error import GDALException from django.core.exceptions import ImproperlyConfigured logger = logging.getLogger('django.contri...
bsd-3-clause
x303597316/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/gis/forms/widgets.py
109
3775
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.gis import gdal from django.contrib.gis.geos import GEOSGeometry, GEOSException from django.forms.widgets import Widget from django.template import loader from django.utils import six from django.utils import t...
apache-2.0
jamessergeant/pylearn2
pylearn2/utils/string_utils.py
39
8590
""" Utilities for modifying strings""" import os import re from theano.compat.six import string_types from theano.compat.six.moves import xrange from pylearn2.utils.exc import EnvironmentVariableError, NoDataPathError from pylearn2.utils.exc import reraise_as from pylearn2.utils.python26 import cmp_to_key from pylea...
bsd-3-clause
aequitas/home-assistant
homeassistant/components/climate/__init__.py
6
17131
"""Provides functionality to interact with climate devices.""" from datetime import timedelta import logging import functools as ft import voluptuous as vol from homeassistant.helpers.temperature import display_temp as show_temp from homeassistant.util.temperature import convert as convert_temperature from homeassist...
apache-2.0
chb/indivo_server
indivo/urls/urls.py
3
1701
from django.conf.urls.defaults import * from indivo.views import * from indivo.lib.utils import MethodDispatcher urlpatterns = patterns('', # OAuth (r'^oauth/', include('indivo.urls.oauth')), (r'^version$', MethodDispatcher({'GET':get_version})), # account-specific URLs (r'^accounts/$', Meth...
gpl-3.0
antepsis/anteplahmacun
sympy/printing/tests/test_julia.py
23
12713
from sympy.core import (S, pi, oo, symbols, Function, Rational, Integer, Tuple, Symbol) from sympy.core import EulerGamma, GoldenRatio, Catalan, Lambda from sympy.functions import Piecewise, sqrt, ceiling, exp, sin, cos from sympy.utilities.pytest import raises from sympy.utilities.lambdify impo...
bsd-3-clause
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/models/match_spec.py
1
31362
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from abc import ABCMeta, abstractmethod, abstractproperty from collections import Mapping from functools import reduce from os.path import basename import re from .channel import Channel from .dist import Dist f...
apache-2.0
hainm/dask
dask/array/rechunk.py
2
7667
from __future__ import absolute_import, division, print_function """ The rechunk module defines: intersect_chunks: a function for converting chunks to new dimensions rechunk: a function to convert the blocks of an existing dask array to new chunks or blockshape """ from itertools import count, ...
bsd-3-clause