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
yqm/sl4a
python-build/python-libs/xmpppy/xmpp/simplexml.py
198
22791
## simplexml.py based on Mattew Allum's xmlstream.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2, or (...
apache-2.0
tuxfux-hlp-notes/python-batches
archieves/batch-56/modules/sheets/lib/python2.7/site-packages/setuptools/site-patch.py
358
2418
def __boot(): import sys, os, os.path PYTHONPATH = os.environ.get('PYTHONPATH') if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH): PYTHONPATH = [] else: PYTHONPATH = PYTHONPATH.split(os.pathsep) pic = getattr(sys,'path_importer_cache',{}) stdpath = sys.path[len...
gpl-3.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/wave.py
11
18582
"""Stuff to parse WAVE files. Usage. Reading WAVE files: f = wave.open(file, 'r') where file is either the name of a file or an open file pointer. The open file pointer must have methods read(), seek(), and close(). When the setpos() and rewind() methods are not used, the seek() method is not necessary. This ...
gpl-3.0
cuavas/bgfx
3rdparty/scintilla/test/ScintillaCallable.py
68
4970
# -*- coding: utf-8 -*- from __future__ import unicode_literals import ctypes, os, sys from ctypes import c_int, c_ulong, c_char_p, c_wchar_p, c_ushort, c_uint, c_long class TEXTRANGE(ctypes.Structure): _fields_= (\ ('cpMin', c_long), ('cpMax', c_long), ('lpstrText', ctypes.POINTER(ctypes.c_char)), ) class...
bsd-2-clause
rvykydal/blivet
tests/formats_test/device_test.py
6
3185
import unittest import blivet class DeviceFormatTestCase(unittest.TestCase): def test_formats(self): absolute_path = "/abs/path" host_path = "host:path" garbage = "abc#<def>" for fclass in blivet.formats.device_formats.values(): an_fs = fclass() # all for...
lgpl-2.1
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/PIL/ImageTk.py
46
9108
# # The Python Imaging Library. # $Id$ # # a Tk display interface # # History: # 96-04-08 fl Created # 96-09-06 fl Added getimage method # 96-11-01 fl Rewritten, removed image attribute and crop method # 97-05-09 fl Use PyImagingPaste method instead of image type # 97-05-12 fl Minor tweaks to match the IFUNC9...
bsd-3-clause
jawilson/home-assistant
homeassistant/helpers/service.py
1
3578
"""Service calling related helpers.""" import functools import logging # pylint: disable=unused-import from typing import Optional # NOQA import voluptuous as vol from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant # NOQA from homeassistant.exceptions import TemplateError fro...
mit
40023255/2015cd_0505
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...
agpl-3.0
cliqz/socorro
socorro/unittest/processor/test_legacy_new_crash_source.py
13
10751
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import mock from datetime import timedelta from nose.tools import eq_ from configman.dotdict import DotDict from soco...
mpl-2.0
openNSS/enigma2
tests/events.py
72
1648
import time import tests recorded_events = [ ] def event(self, name, args, kwargs): global recorded_events print "*EVENT*", time.time(), self, name, args, kwargs recorded_events.append((time.time(), self, name, args, kwargs)) def eventfnc(f): name = f.__name__ def wrapper(self, *args, **kwargs): event(self, n...
gpl-2.0
pavel-odintsov/unbound_systemd
libunbound/python/examples/mx-lookup.py
18
2165
#!/usr/bin/python # vim:fileencoding=utf-8 ''' mx-lookup.py: Lookup for MX records Authors: Zdenek Vasicek (vasicek AT fit.vutbr.cz) Marek Vavrusa (xvavru00 AT stud.fit.vutbr.cz) Copyright (c) 2008. All rights reserved. This software is open source. Redistribution and use in source and binary forms...
bsd-3-clause
erikedin/glowing-sceptre
googletest-release-1.8.0/googlemock/scripts/generator/cpp/utils.py
1158
1153
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 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...
apache-2.0
tmerrick1/spack
var/spack/repos/builtin/packages/nextflow/package.py
5
2177
############################################################################## # 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
jessstrap/servotk
tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/plain_wsh.py
499
1789
# 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 of conditions and the f...
mpl-2.0
JoEiner/hasheddict
hasheddict/__init__.py
1
10088
#!/usr/bin/env python2 # -*- coding: utf-8 -*- from zlib import crc32 from hashlib import sha256 from math import log, ceil import collections import threading __all__ = ['HashedDict'] __version__ = "0.1.0" __author__ = "Johannes Schreiner, johannes@schreiner.io" __credits__ = ["Johannes Schreiner"] __url...
gpl-3.0
zasdfgbnm/tensorflow
tensorflow/python/kernel_tests/tensor_priority_test.py
134
2788
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
johankaito/fufuka
microblog/old-flask/lib/python2.7/site-packages/pip/_vendor/lockfile/mkdirlockfile.py
478
3098
from __future__ import absolute_import, division import time import os import sys import errno from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class MkdirLockFile(LockBase): """Lock file by creating a directory.""" def __init__(self, path, threaded=True, ...
apache-2.0
joshloyal/scikit-learn
sklearn/cluster/tests/test_affinity_propagation.py
341
2620
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
bsd-3-clause
gaddman/ansible
lib/ansible/modules/cloud/openstack/os_object.py
87
3841
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.com> # 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 ANSI...
gpl-3.0
elit3ge/SickRage
lib/hachoir_parser/archive/ace.py
95
9944
""" ACE parser From wotsit.org and the SDK header (bitflags) Partial study of a new block type (5) I've called "new_recovery", as its syntax is very close to the former one (of type 2). Status: can only read totally file and header blocks. Author: Christophe Gisquet <christophe.gisquet@free.fr> Creation date: 19 jan...
gpl-3.0
eriksonJAguiar/TCC-UENP-Codigos
My_codes/tools-sentiment/word_freq.py
1
4759
import nltk import pandas as pd import re from googletrans import Translator from unicodedata import normalize def read_csv(file): df1 = pd.DataFrame.from_csv('files_extern/%s.csv'%(file),sep=';',index_col=0,encoding ='ISO-8859-1') df1 = df1.reset_index() return df1 def write_csv(data,file): d...
gpl-3.0
andyzsf/edx
lms/djangoapps/instructor_task/tests/test_tasks_helper.py
9
4496
""" Unit tests for LMS instructor-initiated background tasks helper functions. Tests that CSV grade report generation works with unicode emails. """ import ddt from mock import Mock, patch from django.test.testcases import TestCase from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule....
agpl-3.0
joolswills/plugin.video.youtube
resources/lib/youtube/helper/url_resolver.py
24
6617
import re __author__ = 'bromix' import urlparse from resources.lib.kodion.utils import FunctionCache import resources.lib.kodion.simple_requests as requests class AbstractResolver(object): def __init__(self): pass def supports_url(self, url, url_components): raise NotImplementedError() ...
gpl-2.0
adngdb/socorro
socorro/unittest/cron/jobs/test_bugzilla.py
3
8870
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest import requests_mock from crontabber.app import CronTabber from socorro.cron.jobs.bugzilla import find_si...
mpl-2.0
evereux/flask_template
application/models.py
1
2773
import datetime from application import db from config import admin_group_name Base = db.Model username_maxlength = 24 name_maxlength = 60 email_maxlength = 24 group_maxlength = 64 groups = db.Table('groups', db.Column('user_id', db.Integer, db.ForeignKey('users.id')), db.Colum...
mit
robertkohl125/ConferenceCentral
utils.py
384
1576
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
apache-2.0
gbwebdev/PFE-VA_Dev
components/abort.py
2
3363
""" abort.py Abort all operations """ #!/usr/bin/python3.5 #-*- coding: utf-8 -*- ###Standard imports : #import atexit from os import path ###Specific imports : ##robotBasics: #Constants: from robotBasics.constants import gpiodef as GPIODEF from robotBasics.constants.gpiodef import LEDS as LEDS_GPIO from rob...
gpl-3.0
cernops/neutron
neutron/db/migration/alembic_migrations/versions/icehouse_release.py
17
1406
# Copyright 2014 Yahoo! 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...
apache-2.0
ulope/django
tests/model_fields/models.py
21
9803
import os import tempfile import uuid import warnings try: from PIL import Image except ImportError: Image = None from django.core.files.storage import FileSystemStorage from django.db import models from django.db.models.fields.files import ImageFieldFile, ImageField from django.utils import six class Foo(m...
bsd-3-clause
xhochy/arrow
dev/archery/archery/integration/tester_java.py
6
5151
# 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 u...
apache-2.0
bringsvor/bc_website_purchase
controllers/main.py
1
11590
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
praveen-pal/edx-platform
lms/djangoapps/instructor/tests/test_api.py
5
34544
""" Unit tests for instructor.api methods. """ # pylint: disable=E1111 import unittest import json from urllib import quote from django.conf import settings from django.test import TestCase from nose.tools import raises from mock import Mock, patch from django.test.utils import override_settings from django.core.urlres...
agpl-3.0
lociii/googleads-python-lib
adspygoogle/dfp/GenericDfpService.py
2
9822
#!/usr/bin/python # # Copyright 2011 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
tcheehow/MissionPlanner
Lib/fnmatch.py
84
3355
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The ...
gpl-3.0
xiefeimcu/mcu_code
Python/pyqt/rtuUI/rtuMsg.py
1
3918
__author__ = 'xiefei' import sys import time import datetime import binascii stu = { 'IDT_TT': 'TT' , 'IDT_ST' : 'ST' , 'IDT_RGZS' : 'RGZS' , 'IDT_PIC' : 'PIC' , 'IDT_DRP' : 'DRP' , 'IDT_DRZ1' : 'DRZ1' , 'IDT_DRZ2' : 'DRZ2' , 'IDT_DRZ3' : 'DRZ3' , 'I...
gpl-3.0
tobegit3hub/cinder_docker
cinder/volume/drivers/hitachi/hbsd_snm2.py
29
43676
# Copyright (C) 2014, Hitachi, Ltd. # # 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
gitmogul/gmock
gtest/test/gtest_xml_output_unittest.py
1815
14580
#!/usr/bin/env python # # Copyright 2006, 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
philanthropy-u/edx-platform
openedx/features/partners/admin.py
1
1216
from django.contrib import admin from django.urls import reverse from .models import Partner, PartnerCommunity, PartnerUser class PartnerAdmin(admin.ModelAdmin): """ Django admin customizations for Partner model """ list_display = ('id', 'label', 'slug', 'partner_url') readonly_fields = ('partner...
agpl-3.0
pypot/scikit-learn
examples/decomposition/plot_faces_decomposition.py
204
4452
""" ============================ Faces dataset decompositions ============================ This example applies to :ref:`olivetti_faces` different unsupervised matrix decomposition (dimension reduction) methods from the module :py:mod:`sklearn.decomposition` (see the documentation chapter :ref:`decompositions`) . """...
bsd-3-clause
vialectrum/vialectrum
electrum_ltc/gui/qt/seed_dialog.py
1
9848
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2013 ecdsa@github # # 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 li...
mit
BIT-SYS/gem5-spm-module
src/mem/slicc/symbols/RequestType.py
83
1704
# Copyright (c) 2010 Advanced Micro Devices, 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...
bsd-3-clause
hahnicity/ace
chapter1/problem3.py
1
1222
""" Problem 3. calculate the time series yt = 5 + .05 * t + Et (Where E is epsilon) for years 1960, 1961, ..., 2001 assuming Et independently and identically distributed with mean 0 and sigma 0.2. """ from random import uniform from matplotlib.pyplot import plot, show from numpy import array, polyfit, poly1d def ...
unlicense
jean/sentry
src/sentry/celery.py
4
2377
from __future__ import absolute_import from django.conf import settings from celery import Celery from celery.app.task import Task from sentry.utils import metrics DB_SHARED_THREAD = """\ DatabaseWrapper objects created in a thread can only \ be used in that same thread. The object with alias '%s' \ was created in...
bsd-3-clause
raajitr/django_hangman
env/lib/python2.7/site-packages/pip/commands/list.py
339
11369
from __future__ import absolute_import import json import logging import warnings try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest from pip._vendor import six from pip.basecommand import Command from pip.exceptions import CommandError from pip.index...
mit
philanthropy-u/edx-platform
lms/djangoapps/teams/management/commands/tests/test_reindex_course_team.py
13
3583
""" Tests for course_team reindex command """ import ddt from django.core.management import CommandError, call_command from mock import patch from opaque_keys.edx.keys import CourseKey from search.search_engine_base import SearchEngine from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from...
agpl-3.0
zhaodelong/django
django/core/mail/backends/base.py
577
1573
"""Base email backend class.""" class BaseEmailBackend(object): """ Base class for email backend implementations. Subclasses must at least overwrite send_messages(). open() and close() can be called indirectly by using a backend object as a context manager: with backend as connection: ...
bsd-3-clause
dendisuhubdy/tensorflow
tensorflow/compiler/tests/bucketize_op_test.py
7
2995
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
robertsj/poropy
pyqtgraph/ThreadsafeTimer.py
1
1600
from pyqtgraph.Qt import QtCore, QtGui class ThreadsafeTimer(QtCore.QObject): """ Thread-safe replacement for QTimer. """ timeout = QtCore.Signal() sigTimerStopRequested = QtCore.Signal() sigTimerStartRequested = QtCore.Signal(object) def __init__(self): QtCore...
mit
allenlavoie/tensorflow
tensorflow/python/kernel_tests/random/random_shuffle_queue_test.py
19
50578
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
jesonyang001/qarepo
askbot/deps/django_authopenid/migrations/0002_make_multiple_openids_possible.py
17
9274
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from askbot.migrations import houston_do_we_have_a_problem class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserAssociation.provider_name' ...
gpl-3.0
liamgh/liamgreenhughes-sl4a-tf101
python/src/Lib/encodings/gb18030.py
816
1031
# # gb18030.py: Python Unicode Codec for GB18030 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb18030') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteInc...
apache-2.0
michalliu/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/distutils/msvc9compiler.py
148
31018
"""distutils.msvc9compiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for the Microsoft Visual Studio 2008. The module is compatible with VS 2005 and VS 2008. You can find legacy support for older versions of VS in distutils.msvccompiler. """ # Written by Perry Stoll # hacked by Robin B...
gpl-2.0
SteveXiSong/ECE757-SnoopingPredictions
src/arch/x86/isa/insts/simd128/floating_point/data_reordering/unpack_and_interleave.py
91
3794
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
cyanna/edx-platform
common/djangoapps/course_about/tests/test_api.py
19
1861
""" Tests the logical Python API layer of the Course About API. """ import ddt import json import unittest from django.core.urlresolvers import reverse from rest_framework.test import APITestCase from rest_framework import status from django.conf import settings from xmodule.modulestore.tests.django_utils import Modu...
agpl-3.0
geminy/aidear
oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/generate_results_dashboard.py
7
7696
# Copyright (C) 2014 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 ...
gpl-3.0
yhoshino11/pytest_example
.tox/py27/lib/python2.7/site-packages/pip/commands/install.py
31
16307
from __future__ import absolute_import import logging import operator import os import tempfile import shutil import warnings from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.locations import build_prefix, virtualenv_no_global, distutils_scheme from pip.basecommand import Command fr...
mit
glaserti/LibraryTwitter
Python/1 - CSV from HTMLsource.py
1
7213
# # Scraping website for information about libraries # # For getting information about the libraries, the database of the German Library Statistics (Deutsche Bibliotheksstatistik/DBS) which is hosted by the HBZ was used: # # http://www.bibliotheksstatistik.de/eingabe/dynrep/adrbrowser/bibs.php # # For this project, ...
mit
umeboshi2/debops-playbooks
playbooks/lookup_plugins/template_src.py
6
5609
# (c) 2015, Robert Chady <rchady@sitepen.com> # Based on `runner/lookup_plugins/file.py` for Ansible # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Debops. # This file is NOT part of Ansible yet. # # Debops is free software: you can redistribute it and/or modify # it under the terms of...
gpl-3.0
jlnaudin/x-drone
MissionPlanner-master/packages/IronPython.StdLib.2.7.4/content/Lib/ssl.py
74
15611
# Wrapper module for _ssl, providing some additional facilities # implemented in Python. Written by Bill Janssen. """\ This module provides some more Pythonic support for SSL. Object types: SSLSocket -- subtype of socket.socket which does SSL over the socket Exceptions: SSLError -- exception raised for I/O er...
gpl-3.0
ohmygodcoin/ohmygodcoin
share/qt/make_spinner.py
4415
1035
#!/usr/bin/env python # W.J. van der Laan, 2011 # Make spinning .mng animation from a .png # Requires imagemagick 6.7+ from __future__ import division from os import path from PIL import Image from subprocess import Popen SRC='img/reload_scaled.png' DST='../../src/qt/res/movies/update_spinner.mng' TMPDIR='/tmp' TMPNAM...
mit
Android-leak/MFFA
utils.py
20
1048
#!/usr/bin/python # -*- coding: utf-8 -*- """ /* * Android media framework fuzzer * Copyright (c) 2015, Intel Corporation. * Author: Alexandru Blanda (ioan-alexandru.blanda@intel.com) * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General P...
gpl-2.0
pyblish/pyblish-win
lib/Python27/Lib/encodings/undefined.py
860
1299
""" Python 'undefined' Codec This codec will always raise a ValueError exception when being used. It is intended for use by the site.py file to switch off automatic string to Unicode coercion. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ impo...
lgpl-3.0
xiaoyaozi5566/DiamondCache
src/arch/alpha/AlphaInterrupts.py
20
1710
# Copyright (c) 2008 The Regents of The University of Michigan # 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
tdicola/pi-facerec-box
train.py
2
3037
"""Raspberry Pi Face Recognition Treasure Box Face Recognition Training Script Copyright 2013 Tony DiCola Run this script to train the face recognition system with positive and negative training images. The face recognition model is based on the eigen faces algorithm implemented in OpenCV. You can find more details...
mit
barseghyanartur/python-social-auth
social/backends/dropbox.py
83
2385
""" Dropbox OAuth1 backend, docs at: http://psa.matiasaguirre.net/docs/backends/dropbox.html """ from social.backends.oauth import BaseOAuth1, BaseOAuth2 class DropboxOAuth(BaseOAuth1): """Dropbox OAuth authentication backend""" name = 'dropbox' ID_KEY = 'uid' AUTHORIZATION_URL = 'https://www.drop...
bsd-3-clause
PennartLoettring/Poettrix
rootfs/usr/lib/python3.4/test/test_doctest.py
72
94252
""" Test script for doctest. """ from test import support import doctest import os import sys # NOTE: There are some additional tests relating to interaction with # zipimport in the test_zipimport_support test module. ###################################################################### ## Sample Objects (us...
gpl-2.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/django/contrib/gis/utils/layermapping.py
61
27288
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: https://docs.djangoproject.com/en/dev/ref/contrib/gi...
mit
aish9r/AutoRCCar
computer/mlp_training.py
3
1864
__author__ = 'zhengwang' import cv2 import numpy as np import glob print 'Loading training data...' e0 = cv2.getTickCount() # load training data image_array = np.zeros((1, 38400)) label_array = np.zeros((1, 4), 'float') training_data = glob.glob('training_data/*.npz') for single_npz in training_data: with np.lo...
bsd-2-clause
tysonholub/twilio-python
tests/integration/taskrouter/v1/workspace/worker/test_worker_statistics.py
1
3649
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class WorkerStatisticsTestCase(...
mit
Incoming5643/-tg-station
tools/midi2piano/midi2piano.py
89
9532
""" This module allows user to convert MIDI melodies to SS13 sheet music ready for copy-and-paste """ from functools import reduce import midi as mi import easygui as egui import pyperclip as pclip LINE_LENGTH_LIM = 50 LINES_LIMIT = 200 TICK_LAG = 0.5 OVERALL_IMPORT_LIM = 2*LINE_LENGTH_LIM*LINES_LIMIT END_OF_LINE_CHAR...
agpl-3.0
mispencer/ycmd
ycmd/completers/typescript/typescript_completer.py
1
22168
# Copyright (C) 2015 - 2016 Google Inc. # 2016 ycmd contributors # # This file is part of ycmd. # # ycmd 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 ...
gpl-3.0
gnu-sandhi/sandhi
modules/gr36/gnuradio-core/src/examples/pfb/interpolate.py
17
8253
#!/usr/bin/env python # # Copyright 2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
MeshCollider/Omnicoin
qa/rpc-tests/invalidtxrequest.py
8
2606
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.comptool import TestManager, Te...
mit
AICIDNN/cloudbiolinux
utils/images_and_snapshots.py
10
1387
import boto import collections OWNER = '678711657553' # Brad's owner ID def images_and_snapshots(owner): """Retrieve Biolinux image and snapshot information. """ conn = boto.connect_ec2() images = conn.get_all_images(owners=[owner]) images32 = _sorted_images(images, "CloudBioLinux 32") images6...
mit
psi4/psi4
psi4/driver/procrouting/mcscf/augmented_hessian.py
7
5802
# # @BEGIN LICENSE # # Psi4: an open-source quantum chemistry software package # # Copyright (c) 2007-2021 The Psi4 Developers. # # The copyrights for code used from other parties are included in # the corresponding files. # # This file is part of Psi4. # # Psi4 is free software; you can redistribute it and/or modify #...
lgpl-3.0
raajitr/django_hangman
env/lib/python2.7/site-packages/wheel/metadata.py
230
11050
""" Tools for converting old- to new-style metadata. """ from collections import namedtuple from .pkginfo import read_pkg_info from .util import OrderedDefaultDict try: from collections import OrderedDict except ImportError: OrderedDict = dict import re import os.path import textwrap import pkg_resources impo...
mit
ykim362/mxnet
tests/nightly/mxnet_keras_integration_tests/assertion_util.py
43
4800
# 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 u...
apache-2.0
lowitty/server
libsDarwin/twisted/web/iweb.py
5
25674
# -*- test-case-name: twisted.web.test -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Interface definitions for L{twisted.web}. @var UNKNOWN_LENGTH: An opaque object which may be used as the value of L{IBodyProducer.length} to indicate that the length of the entity body is not...
mit
jacknjzhou/neutron
neutron/agent/l3/dvr_edge_router.py
7
6950
# Copyright (c) 2015 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 ...
apache-2.0
clonetwin26/buck
scripts/updatehomebrew.py
10
5458
import argparse import hashlib import os import re import requests # Install with easy_install or pip install import shutil import subprocess import sys import tempfile from contextlib import contextmanager from updatecommon import get_release from updatecommon import upload_release TARGET_MACOS_VER = 'yosemite' TAR...
apache-2.0
Veil-Framework/Veil
tools/evasion/payloads/python/shellcode_inject/letter_substitution.py
1
9106
""" Currently, this code takes normal shellcode, and replaces the a hex character with a random non hex letter. At runtime, the executables reverses the letter substitution and executes the shellcode Letter substitution code was adapted from: http://www.tutorialspoint.com/python/string_maketrans.htm Module built...
gpl-3.0
dbarsam/python-vsgen
tests/__main__.py
1
2305
# -*- coding: utf-8 -*- """ This module executes vsgen unittests (i.e. all tests in the current folder). It exists as an alernative to the command line interface:: > python -m unittest discover --start-directory . --pattern test*.py For more testing options see the unittest documentation available at https://doc...
mit
theicfire/djangofun
django/core/management/commands/shell.py
230
3263
import os from django.core.management.base import NoArgsCommand from optparse import make_option class Command(NoArgsCommand): option_list = NoArgsCommand.option_list + ( make_option('--plain', action='store_true', dest='plain', help='Tells Django to use plain Python, not IPython.'), ) ...
bsd-3-clause
pombredanne/https-gitlab.lrde.epita.fr-vcsn-vcsn
tests/python/complete.py
1
1949
#! /usr/bin/env python import vcsn from test import * # check complete algorithm # ------------------------ def check(i, o): if isinstance(i, str): i = vcsn.automaton(i) CHECK(not i.is_complete()) o = vcsn.automaton(o) CHECK(o.is_complete()) CHECK_EQ(o, i.complete()) # Idempotence. ...
gpl-3.0
cyberark-bizdev/ansible
lib/ansible/modules/windows/win_command.py
23
4430
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Ansible, inc # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
gpl-3.0
BT-ojossen/stock-logistics-workflow
__unported__/stock_location_flow_creator/product_pulled_flow_template.py
33
1731
# -*- coding: utf-8 -*- ############################################################################## # # Author: Yannick Vaucher (Camptocamp) # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Licens...
agpl-3.0
burzillibus/RobHome
venv/lib/python2.7/site-packages/django/contrib/gis/geos/collections.py
51
5160
""" This module houses the Geometry Collection objects: GeometryCollection, MultiPoint, MultiLineString, and MultiPolygon """ import json import warnings from ctypes import byref, c_int, c_uint from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.error import GEOSException from django....
mit
Shao-Feng/crosswalk-test-suite
webapi/tct-ui-css3-tests/inst.apk.py
1996
3186
#!/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
fireeye/flare-wmi
python-cim/samples/show_CCM_RecentlyUsedApps.py
1
2035
import logging from cim import CIM from cim.objects import Namespace def main(type_, path): if type_ not in ("xp", "win7"): raise RuntimeError("Invalid mapping type: {:s}".format(type_)) Values = ["FolderPath", "ExplorerFileName", "FileSize", "LastUserName", "LastUsedTime", "TimeZoneOffset", ...
apache-2.0
GeyerA/android_external_chromium_org
native_client_sdk/src/build_tools/tests/sdktools_config_test.py
160
1609
#!/usr/bin/env python # 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. import sys import os import unittest SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) BUILD_TOOLS_DIR = os.path.dirname(SCRI...
bsd-3-clause
40223125/40223125-2
static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testwith.py
739
5806
import unittest from warnings import catch_warnings from unittest.test.testmock.support import is_instance from unittest.mock import MagicMock, Mock, patch, sentinel, mock_open, call something = sentinel.Something something_else = sentinel.SomethingElse class WithTest(unittest.TestCase): def test_with_sta...
gpl-3.0
zsoltdudas/lis-tempest
tempest/lib/services/identity/v3/token_client.py
5
6905
# Copyright 2015 NEC Corporation. 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 ...
apache-2.0
tolimit/tp-qemu
qemu/tests/rv_fullscreen.py
9
3359
""" rv_fullscreen.py - remote-viewer full screen Testing the remote-viewer --full-screen option If successful, the resolution of the guest will take the resolution of the client. Requires: connected binaries remote-viewer, Xorg, gnome session """ import logging...
gpl-2.0
rosmo/ansible
test/units/modules/storage/netapp/test_na_ontap_firewall_policy.py
25
10657
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit test template for ONTAP Ansible module ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch, Mock from ans...
gpl-3.0
vito16/express2
node_modules/cordova/node_modules/plugman/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py
2637
9586
#!/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. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
mit
nickjhathaway/gtkmmExperiment
scripts/pyUtils/utils.py
8
7400
#!/usr/bin/env python3 import urllib.request, urllib.parse, urllib.error, os, shutil, tarfile, multiprocessing, subprocess, sys, socket from color_text import ColorText as CT class Utils: @staticmethod def isMac(): return sys.platform == "darwin" @staticmethod def connectedInternet():...
gpl-3.0
ljnutal6/media-recommend
app/virtualenvs/recommedia/lib/python2.7/site-packages/werkzeug/debug/console.py
314
5557
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import sys import code from types import CodeType from werkzeug.utils import escape from werkzeug.loca...
gpl-2.0
amirrpp/django-oscar
src/oscar/apps/offer/conditions.py
23
10607
from decimal import Decimal as D, ROUND_UP from django.utils import six from django.utils.translation import ungettext, ugettext_lazy as _ from oscar.apps.offer import utils from oscar.core.loading import get_model from oscar.templatetags.currency_filters import currency Condition = get_model('offer', 'Condition') ...
bsd-3-clause
Acidburn0zzz/tornado
tornado/gen.py
30
39041
"""``tornado.gen`` is a generator-based interface to make it easier to work in an asynchronous environment. Code using the ``gen`` module is technically asynchronous, but it is written as a single generator instead of a collection of separate functions. For example, the following asynchronous handler: .. testcode:: ...
apache-2.0
poldrack/openfmri
openfmri_paper/2.8_make_allmean_file.py
1
1497
""" make alist of all contrasts/tasks """ import pickle from get_contrasts_to_use import * c=get_contrasts_to_use() outdir='/corral-repl/utexas/poldracklab/openfmri/analyses/paper_analysis_Dec2012/data_prep' infodir='/corral-repl/utexas/poldracklab/openfmri/analyses/paper_analysis_Dec2012/data_prep' f=open(os.path....
bsd-2-clause