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
baruch/libsigrokdecode
decoders/z80/tables.py
24
44963
## ## This file is part of the libsigrokdecode project. ## ## Copyright (C) 2014 Daniel Elstner <daniel.kitta@gmail.com> ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 3 of...
gpl-3.0
weidnem/IntroPython2016
students/pvosper/session04/file_lab.py
3
3886
#!/usr/bin/env python3 # === File Lab ===== ''' write a program which prints the full path to all files in the current directory, one per line ''' import os print('\nFull path to current directory:') print(os.getcwd()) # create list of all files in current directory directory_list = os.listdir() print('\nFiles i...
unlicense
mrquim/mrquimrepo
script.xbmcbackup/scheduler.py
4
6840
import xbmc import xbmcvfs import xbmcgui import datetime import time import os import resources.lib.utils as utils from resources.lib.croniter import croniter from resources.lib.backup import XbmcBackup class BackupScheduler: monitor = None enabled = "false" next_run = 0 next_run_path = None resto...
gpl-2.0
tejasnikumbh/Algorithms
ArraysAndSorting/MarkAndToys.py
1
1514
''' In place quickSort The quickSort Method Time Complexity : Best,Avg - O(NlogN) , Worst - O(N^2) Space Complexity : O(N) Auxilary Space : O(logN) for the stack frames ''' def quickSort(a,start,end): if(start >= end): return a else: pivot = a[end] swapIndex = start for i in...
bsd-2-clause
cwyark/v2ex
mapreduce/input_readers.py
20
31679
#!/usr/bin/env python # # Copyright 2010 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 o...
bsd-3-clause
psav/cfme_tests
cfme/utils/tests/test_ipappliance.py
8
1068
# -*- coding: utf-8 -*- import pytest from cfme.utils.appliance import IPAppliance def test_ipappliance_from_hostname(): hostname = '1.2.3.4' ip_a = IPAppliance(hostname=hostname) assert ip_a.hostname == hostname assert ip_a.url == 'https://{}/'.format(hostname) def test_ipappliance_from_url(): ...
gpl-2.0
markneville/nupic
tests/unit/nupic/research/temporal_memory_test.py
19
21695
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
mancoast/CPythonPyc_test
cpython/241_pickletester.py
15
29752
import unittest import pickle import cPickle import pickletools import copy_reg from test.test_support import TestFailed, have_unicode, TESTFN # Tests that try a number of pickle protocols should have a # for proto in protocols: # kind of outer loop. assert pickle.HIGHEST_PROTOCOL == cPickle.HIGHEST_PROTOCOL == 2...
gpl-3.0
openmips/stbgui
lib/python/Components/ServiceScan.py
1
9086
from enigma import eComponentScan, iDVBFrontend, eTimer from Components.NimManager import nimmanager as nimmgr from Tools.Transponder import getChannelNumber class ServiceScan: Idle = 1 Running = 2 Done = 3 Error = 4 DonePartially = 5 Errors = { 0: _("error starting scanning"), 1: _("error while scanning")...
gpl-2.0
MobinRanjbar/hue
desktop/core/ext-py/Babel-0.9.6/babel/messages/tests/mofile.py
61
2585
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software cons...
apache-2.0
suzukaze/mycli
mycli/sqlcompleter.py
6
17248
from __future__ import print_function from __future__ import unicode_literals import logging from prompt_toolkit.completion import Completer, Completion from .packages.completion_engine import suggest_type from .packages.parseutils import last_word from .packages.special.favoritequeries import favoritequeries from re i...
bsd-3-clause
hazrpg/calibre
src/calibre/utils/mem.py
12
1508
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' ''' Measure memory usage of the current process. The key function is memory() which returns the current memory usage in M...
gpl-3.0
nonhermitian/scipy
tools/win32/detect_cpu_extensions_wine.py
79
7518
#!/usr/bin/python """ Detect which x86 CPU extension instructions the given scipy install uses. This file can be used in the release process to check that the nosse installer does not contain SSE instructions. This has happened before, see for example ticket #1170. Is meant to be run on OS X with Wine. Make sure objdu...
bsd-3-clause
Forage/Gramps
po/update_po.py
1
21490
#! /usr/bin/env python # # update_po - a gramps tool to update translations # # Copyright (C) 2006-2006 Kees Bakker # Copyright (C) 2006 Brian Matherly # Copyright (C) 2008 Stephen George # Copyright (C) 2012 # # This program is free software; you can redistribute it and/or modify # it under the terms of t...
gpl-2.0
40223125/2015cd_midterm
static/Brython3.1.0-20150301-090019/Lib/unittest/signals.py
1016
2403
import signal import weakref from functools import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.original_handler = default_handler if isinstance(default_handler, int): if default_handler == signal.SIG_D...
gpl-3.0
SnowDroid/kernel_lge_hammerhead
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
mogoweb/chromium-crosswalk
native_client_sdk/src/build_tools/build_version.py
65
1797
# 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. """Small utility library of python functions used during SDK building. """ import os import sys # pylint: disable=E0602 # Reuse last change utility co...
bsd-3-clause
maelnor/nova
nova/network/security_group/openstack_driver.py
5
1605
# Copyright 2013 Nicira, 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 by a...
apache-2.0
JuliBakagianni/CEF-ELRC
lib/python2.7/site-packages/django/contrib/gis/maps/google/zoom.py
327
6628
from django.contrib.gis.geos import GEOSGeometry, LinearRing, Polygon, Point from django.contrib.gis.maps.google.gmap import GoogleMapException from math import pi, sin, cos, log, exp, atan # Constants used for degree to radian conversion, and vice-versa. DTOR = pi / 180. RTOD = 180. / pi class GoogleZoom(object): ...
bsd-3-clause
trishnaguha/ansible
lib/ansible/modules/network/vyos/vyos_config.py
4
9273
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
hhru/ansible
plugins/inventory/vagrant.py
72
3659
#!/usr/bin/env python """ Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and returns it under the host group 'vagrant' Example Vagrant configuration using this script: config.vm.provision :ansible do |ansible| ansible.playbook = "./provision/your_playbook.yml" ...
gpl-3.0
BoriBori/cassava
cassava/utils.py
2
8894
import re import collections def is_ip(indicator): ip_format = re.compile(ip_regex) return ip_format.match(indicator) def is_md5(indicator): ip_format = re.compile(md5_regex) return ip_format.match(indicator) def is_sha1(indicator): ip_format = re.compile(sha1_regex) return ip_format.match(in...
mit
mavit/ansible
lib/ansible/modules/system/hostname.py
28
25012
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Hiroaki Nakamura <hnakamur@gmail.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 ANSIBLE_METADATA = {'metadata_versi...
gpl-3.0
Livefyre/kafka-python
test/test_conn.py
4
1741
import os import random import struct import unittest2 import kafka.conn class ConnTest(unittest2.TestCase): def test_collect_hosts__happy_path(self): hosts = "localhost:1234,localhost" results = kafka.conn.collect_hosts(hosts) self.assertEqual(set(results), set([ ('localhost',...
apache-2.0
direvus/ansible
lib/ansible/modules/cloud/amazon/s3_lifecycle.py
7
20288
#!/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': ['stableinterf...
gpl-3.0
donbixler/xhtml2pdf
xhtml2pdf/parser.py
1
24988
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
apache-2.0
rixrix/servo
tests/wpt/css-tests/tools/webdriver/webdriver/webelement.py
251
1846
"""Element-level WebDriver operations.""" import searchcontext class WebElement(searchcontext.SearchContext): """Corresponds to a DOM element in the current page.""" def __init__(self, driver, id): self._driver = driver self._id = id # Set value of mode used by SearchContext s...
mpl-2.0
40223245/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_loader.py
738
49593
import sys import types import unittest class Test_TestLoader(unittest.TestCase): ### Tests for TestLoader.loadTestsFromTestCase ################################################################ # "Return a suite of all tests cases contained in the TestCase-derived # class testCaseClass" def te...
gpl-3.0
arthru/OpenUpgrade
addons/hr_applicant_document/models/hr_applicant.py
385
1210
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class hr_applicant(osv.Model): _inherit = 'hr.applicant' def _get_index_content(self, cr, uid, ids, fields, args, context=None): res = dict.fromkeys(ids, '') Attachment = self.pool.get('ir.attachment') attachment_ids = Attac...
agpl-3.0
andyclymer/ControlBoard
ControlBoard.roboFontExt/lib/modules/pyFirmata-master/pyfirmata/mockup.py
4
3946
from collections import deque import pyfirmata class MockupSerial(deque): """ A Mockup object for python's Serial. Functions as a fifo-stack. Push to it with ``write``, read from it with ``read``. """ def __init__(self, port, baudrate, timeout=0.02): self.port = port or 'somewhere' ...
mit
manipopopo/tensorflow
tensorflow/python/util/decorator_utils_test.py
139
4197
# 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
nzavagli/UnrealPy
UnrealPyEmbed/Source/Python/Lib/python27/plat-mac/applesingle.py
42
4957
r"""Routines to decode AppleSingle files """ from warnings import warnpy3k warnpy3k("In 3.x, the applesingle module is removed.", stacklevel=2) import struct import sys try: import MacOS import Carbon.File except: class MacOS: def openrf(path, mode): return open(path + '.rsrc', mode) ...
mit
Poorchop/hexchat-scripts
adfilter.py
2
4869
import re import hexchat __module_name__ = "AdFilter" __module_author__ = "Poorchop" __module_version__ = "0.4" __module_description__ = "Move fserve advertisements to a separate tab" # Add channels from which you would like to filter ads, e.g. channels = ("#channel", "#topsecret") channels = () # Customi...
mit
mcking49/apache-flask
Python/Lib/site-packages/wrapt/importer.py
8
7727
"""This module implements a post import hook mechanism styled after what is described in PEP-369. Note that it doesn't cope with modules being reloaded. """ import sys import threading PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY3: import importlib string_types = str, else: strin...
mit
robinro/ansible-modules-extras
windows/win_timezone.py
71
1421
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Phil Schwartz <schwartzmx@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 ...
gpl-3.0
theguardian/LazyLibrarian_Old
cherrypy/test/logtest.py
12
6611
"""logtest, a unittest.TestCase helper for testing log output.""" import sys import time import cherrypy try: # On Windows, msvcrt.getch reads a single char without output. import msvcrt def getchar(): return msvcrt.getch() except ImportError: # Unix getchr import tty, termios def ge...
gpl-3.0
wavicles/fossasia-pslab
PSL/digital_channel.py
2
3131
from __future__ import print_function import numpy as np digital_channel_names=['ID1','ID2','ID3','ID4','SEN','EXT','CNTR'] class digital_channel: EVERY_SIXTEENTH_RISING_EDGE = 5 EVERY_FOURTH_RISING_EDGE = 4 EVERY_RISING_EDGE = 3 EVERY_FALLING_EDGE = 2 EVERY_EDGE = 1 DISAB...
gpl-3.0
pradyu1993/scikit-learn
sklearn/datasets/tests/test_lfw.py
2
6778
"""This test for the LFW require medium-size data dowloading and processing If the data has not been already downloaded by runnning the examples, the tests won't run (skipped). If the test are run, the first execution will be long (typically a bit more than a couple of minutes) but as the dataset loader is leveraging...
bsd-3-clause
komsas/OpenUpgrade
openerp/addons/base/res/ir_property.py
33
7509
# -*- 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...
agpl-3.0
jhauswald/keras
tests/manual/check_save_weights.py
95
1367
from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation from keras.optimizers import SGD import sys sys.setrecursionlimit(10000) # to be able to pickle Theano compiled functions import pickle, numpy def create_model(): model = Sequential() model.add(Dense(256, 2048, init=...
mit
CitizenB/ansible
contrib/inventory/ssh_config.py
160
3979
#!/usr/bin/env python # (c) 2014, Tomas Karasek <tomas.karasek@digile.fi> # # 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 # (a...
gpl-3.0
Marcusz97/CILP_Facilitatore_Audacity
lib-src/lv2/sord/waflib/Tools/gcc.py
64
2730
#! /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 os,sys from waflib import Configure,Options,Utils from waflib.Tools import ccroot,ar from waflib.Configure import conf @conf def find_gcc(conf): cc=conf.find_program([...
gpl-2.0
rottenbytes/Sick-Beard
lib/subliminal/__init__.py
49
1370
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
gpl-3.0
gavinmcgimpsey/deckofcards
deck/urls.py
2
1035
from django.conf.urls import patterns, url urlpatterns = patterns('', url(r'^new/$', 'deck.views.new_deck', name='new_deck_d'), #a week in and I am already deprecating things... url(r'^shuffle/$', 'deck.views.shuffle', name='shuffle_d'), #deprecated - May 18, 2015 url(r'^shuffle/(?P<key>\w+)/$', 'deck.view...
mit
Dioptas/Dioptas
dioptas/model/util/BackgroundExtraction.py
1
2873
# -*- coding: utf-8 -*- # Dioptas - GUI program for fast processing of 2D X-ray diffraction data # Principal author: Clemens Prescher (clemens.prescher@gmail.com) # Copyright (C) 2014-2019 GSECARS, University of Chicago, USA # Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany ...
gpl-3.0
quru/wagtail
wagtail/wagtailimages/models.py
1
17958
from __future__ import absolute_import, unicode_literals import hashlib import os.path from collections import OrderedDict from contextlib import contextmanager import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.files import File from django.core.ur...
bsd-3-clause
windofthesky/ansible
v1/ansible/runner/action_plugins/assemble.py
109
6150
# (c) 2013-2014, Michael DeHaan <michael.dehaan@gmail.com> # Stephen Fromm <sfromm@gmail.com> # Brian Coca <briancoca+dev@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 publish...
gpl-3.0
rperier/linux
tools/perf/tests/attr.py
532
11651
# SPDX-License-Identifier: GPL-2.0 from __future__ import print_function import os import sys import glob import optparse import tempfile import logging import shutil try: import configparser except ImportError: import ConfigParser as configparser def data_equal(a, b): # Allow multiple values in assignm...
gpl-2.0
kragniz/searchlight
tools/colorizer.py
21
11688
#!/usr/bin/env python # Copyright (c) 2013, Nebula, Inc. # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file exc...
apache-2.0
hehongliang/tensorflow
tensorflow/python/keras/optimizer_v2/ftrl_test.py
1
17276
# 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
maxtangli/sonico
language/python/teabreak/final_hint.py
1
1056
def intelligent_data_source_factory(*data): import itertools cy = itertools.cycle(data) _int = int return lambda i: _int(i) if isinstance(i, str) else next(cy) int = intelligent_data_source_factory(1985, 33067, 84) # int = intelligent_data_source_factory(2012, 9, 30) # invalid # int = intelligent_d...
mit
khushboo9293/mailman
src/mailman/utilities/tests/test_wrap.py
7
3478
# Copyright (C) 2011-2015 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # # GNU Mailman 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 you...
gpl-3.0
wfs/MyCPPAndTDD
Line_Test/lib/gtest/googletest/test/gtest_color_test.py
3259
4911
#!/usr/bin/env python # # Copyright 2008, 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...
mit
hyperspy/hyperspyUI
hyperspyui/plugins/mva.py
2
15334
# -*- coding: utf-8 -*- # Copyright 2014-2016 The HyperSpyUI developers # # This file is part of HyperSpyUI. # # HyperSpyUI 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 #...
gpl-3.0
ltilve/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/third_party/boto/tests/unit/s3/test_uri.py
114
12504
#!/usr/bin/env python # Copyright (c) 2013 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 la...
bsd-3-clause
mory0tiki/pack-llama
views.py
1
1220
from django.core.files.base import ContentFile from django.shortcuts import render from django.http.response import HttpResponse from django.views.generic import base from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.conf import settings import ast imp...
apache-2.0
BehavioralInsightsTeam/edx-platform
lms/lib/courseware_search/test/test_lms_filter_generator.py
12
5721
""" Tests for the lms_filter_generator """ from mock import Mock, patch from lms.lib.courseware_search.lms_filter_generator import LmsSearchFilterGenerator from student.models import CourseEnrollment from student.tests.factories import UserFactory from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase ...
agpl-3.0
pigworlds/asuswrttest
release/src/router/lighttpd-1.4.29/external_file/js/davclient.js/jsbase/conftest.py
42
5960
# JS unit test support for py.test - (c) 2007 Guido Wesdorp. All rights # reserved # # This software is distributed under the terms of the JSBase # License. See LICENSE.txt for license text. import py here = py.magic.autopath().dirpath() class JSTest(py.test.collect.Item): def run(self): path = self.fspa...
gpl-2.0
ryandougherty/mwa-capstone
MWA_Tools/build/matplotlib/examples/misc/rasterization_demo.py
6
1257
import numpy as np import matplotlib.pyplot as plt d = np.arange(100).reshape(10, 10) x, y = np.meshgrid(np.arange(11), np.arange(11)) theta = 0.25*np.pi xx = x*np.cos(theta) - y*np.sin(theta) yy = x*np.sin(theta) + y*np.cos(theta) ax1 = plt.subplot(221) ax1.set_aspect(1) ax1.pcolormesh(xx, yy, d) ax1.set_title("No ...
gpl-2.0
Hubert51/AutoGrading
learning/web_Haotian/venv/Lib/shutil.py
23
40227
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat import fnmatch import collections import errno try: import zlib del zlib _ZLIB_SUPPORTED = True except ImportError:...
mit
orgito/ansible
lib/ansible/plugins/test/core.py
12
6562
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
fzalkow/scikit-learn
examples/plot_kernel_approximation.py
262
8004
""" ================================================== Explicit feature map approximation for RBF kernels ================================================== An example illustrating the approximation of the feature map of an RBF kernel. .. currentmodule:: sklearn.kernel_approximation It shows how to use :class:`RBFSa...
bsd-3-clause
cjh1/VTK
Filters/Core/Testing/Python/tubeComb.py
17
1879
#!/usr/bin/env python import vtk from vtk.util.misc import vtkGetDataRoot # create planes # Create the RenderWindow, Renderer # ren = vtk.vtkRenderer() renWin = vtk.vtkRenderWindow() renWin.AddRenderer( ren ) iren = vtk.vtkRenderWindowInteractor() iren.SetRenderWindow(renWin) # create pipeline # pl3d = vtk.vtkMulti...
bsd-3-clause
wgprojects/ardupilot
Tools/autotest/pysim/fdpexpect.py
264
2488
"""This is like pexpect, but will work on any file descriptor that you pass it. So you are reponsible for opening and close the file descriptor. $Id: fdpexpect.py 505 2007-12-26 21:33:50Z noah $ """ from pexpect import * import os __all__ = ['fdspawn'] class fdspawn (spawn): """This is like pexpect.spawn but a...
gpl-3.0
JackCloudman/Youtube-music
download.py
1
1342
#Program to download Yotube music #Author: Jack Cloudman import pafy,os,shutil from pydub import AudioSegment as convert #Create song list if os.path.exists('songs.txt'): pass else: print("Creating songs.txt....") document= open('songs.txt','w') print("Paste yours songs in songs.txt") d...
gpl-3.0
xiaoshaozi52/ansible
lib/ansible/plugins/lookup/redis_kv.py
251
2433
# (c) 2012, Jan-Piet Mens <jpmens(at)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 later ver...
gpl-3.0
jfalkner/Efficient-Django-QuerySet-Use
demo-optimized/example/utils.py
1
3812
from django.utils.timezone import utc from django_db_utils import pg_bulk_update from example.models import Sample, SampleStatus def now(): from datetime import datetime return datetime.utcnow().replace(tzinfo=utc) def make_fake_data(samples_to_make=100000, batch_threshold=100000, delete_existing=True, ma...
mit
cloudbase/coriolis
coriolis/wsman.py
1
6173
# Copyright 2016 Cloudbase Solutions Srl # All Rights Reserved. import base64 from oslo_log import log as logging import requests from winrm import protocol from winrm import exceptions as winrm_exceptions from coriolis import exception from coriolis import utils AUTH_BASIC = "basic" AUTH_KERBEROS = "kerberos" AUTH...
agpl-3.0
gmarke/erpnext
erpnext/patches/v4_0/countrywise_coa.py
119
1034
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc("setup", 'doctype', "company") frappe.reload_doc("accounts", 'doctype', "account") frappe.db.sql("""...
agpl-3.0
jmartu/testing
venv/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py
838
1384
''' Debian and other distributions "unbundle" requests' vendored dependencies, and rewrite all imports to use the global versions of ``urllib3`` and ``chardet``. The problem with this is that not only requests itself imports those dependencies, but third-party code outside of the distros' control too. In reaction to t...
mit
michael-dev2rights/ansible
lib/ansible/modules/cloud/ovirt/ovirt_quotas_facts.py
73
3955
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
jbhsieh/incubator-airflow
tests/ti_deps/deps/pool_has_space_dep.py
20
1194
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
kirienko/gourmet
src/gourmet/importers/plaintext_importer.py
1
4803
import re from gourmet import check_encodings from gourmet.gdebug import debug from gourmet.i18n import _ from gourmet.importers import importer class TextImporter (importer.Importer): ATTR_DICT = {'Recipe By':'source', 'Serving Size':'servings', 'Preparation Time':'preptime', ...
gpl-2.0
houzhenggang/hiwifi-openwrt-HC5661-HC5761
package/goagent/files/etc/goagent/dnsproxy.py
10
14082
#!/usr/bin/env python # coding:utf-8 __version__ = '1.0' import sys import os import sysconfig sys.path += [os.path.abspath(os.path.join(__file__, '../packages.egg/%s' % x)) for x in ('noarch', sysconfig.get_platform().split('-')[0])] import gevent import gevent.server import gevent.timeout import gevent.monkey gev...
gpl-2.0
rajul/tvb-framework
tvb/tests/framework/adapters/visualizers/ica_test.py
1
3631
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # documentation-folder for more details. See also http:/...
gpl-2.0
seeschloss/grammalecte
ContextMenu.py
1
6974
# -*- coding: utf8 -*- # Grammalecte - Lexicographe # by Olivier R. License: MPL 2 import uno import unohelper import traceback from com.sun.star.task import XJob from com.sun.star.ui import XContextMenuInterceptor from com.sun.star.ui.ContextMenuInterceptorAction import IGNORED from com.sun.star.ui.ContextMenuInterc...
gpl-3.0
fullscale/pypes
ui/pypesvds/tests/functional/test_filters.py
4
1351
from pypesvds.tests import * class TestFiltersController(TestController): def test_index(self): response = self.app.get(url('filters')) # Test response... def test_index_as_xml(self): response = self.app.get(url('formatted_filters', format='xml')) def test_create(self): r...
apache-2.0
JKarathiya/Lean
Algorithm.Python/IndicatorWarmupAlgorithm.py
3
6802
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation. # # 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 Lice...
apache-2.0
mark-me/Pi-Jukebox
venv/Lib/site-packages/pygame/ftfont.py
1
6239
"""pygame module for loading and rendering fonts (freetype alternative)""" __all__ = ['Font', 'init', 'quit', 'get_default_font', 'get_init', 'SysFont'] from pygame._freetype import init, Font as _Font, get_default_resolution from pygame._freetype import quit, get_default_font, get_init as _get_init from pygame._free...
agpl-3.0
Vivek-anand-jain/Implementation-of-BLUE-in-ns-3
src/traffic-control/bindings/modulegen__gcc_LP64.py
38
388133
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
MotorolaMobilityLLC/external-chromium_org
chrome/test/functional/webrtc_call.py
29
8808
#!/usr/bin/env python # 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 time # This little construct ensures we can run even if we have a bad version of # psutil installed. If so, we'll just skip...
bsd-3-clause
google/ffn
ffn/utils/vector_pb2.py
1
15524
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
apache-2.0
koppa/gr-air-modes
python/mlat_client.py
5
2900
#!/usr/bin/env python # # Copyright 2012 Nick Foster # # This file is part of gr-air-modes # # gr-air-modes 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) # any later v...
gpl-3.0
mikehulluk/ProcessManager
www/js/brython/Lib/test/test_weakset.py
23
15326
import unittest from test import support from weakref import proxy, ref, WeakSet import operator import copy import string import os from random import randrange, shuffle import sys import warnings import collections from collections import UserString as ustr import gc import contextlib class Foo: pass class Ref...
bsd-2-clause
ruziniu/v2ex
v2ex/babel/l10n/messages/en.py
16
4841
# coding=utf-8 # Messages on top bar home = 'Home' images = 'Images' mentions = 'Mentions' workspace = 'Workspace' notes = 'Notes' nearby = 'Nearby' settings = 'Settings' backstage = 'Backstage' signin = 'Sign In' signup = 'Sign Up' signout = 'Sign Out' planes = 'Planes' # Messages shared by forms chevron = '<span c...
bsd-3-clause
68foxboris/enigma2-openpli-vuplus
lib/python/Components/Converter/TemplatedMultiContent.py
80
2879
from Components.Converter.StringList import StringList class TemplatedMultiContent(StringList): """Turns a python tuple list into a multi-content list which can be used in a listbox renderer.""" def __init__(self, args): StringList.__init__(self, args) from enigma import eListboxPythonMultiContent, gFont, RT_HAL...
gpl-2.0
poppogbr/genropy
packages/hosting/webpages/client.py
1
8379
#!/usr/bin/env python # encoding: utf-8 """ Created by Softwell on 2008-07-10. Copyright (c) 2008 Softwell. All rights reserved. """ # --------------------------- GnrWebPage Standard header --------------------------- from gnr.core.gnrbag import Bag class GnrCustomWebPage(object): maintable = 'hosting.client' ...
lgpl-2.1
gkadillak/rockstor-core
src/rockstor/cli/rock_cli.py
6
8120
""" Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 of the License, or (at your option) any la...
gpl-3.0
nhomar/odoo-mirror
addons/l10n_pa/__openerp__.py
117
1817
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
ulope/django
django/contrib/admindocs/views.py
10
15517
from importlib import import_module import inspect import os import re from django import template from django.apps import apps from django.conf import settings from django.contrib import admin from django.contrib.admin.views.decorators import staff_member_required from django.db import models from django.core.excepti...
bsd-3-clause
konono/equlipse
openstack-install/charm/trusty/charm-keystone/charmhelpers/core/host_factory/centos.py
2
1924
import subprocess import yum import os from charmhelpers.core.strutils import BasicStringComparator class CompareHostReleases(BasicStringComparator): """Provide comparisons of Host releases. Use in the form of if CompareHostReleases(release) > 'trusty': # do something with mitaka """ d...
mit
jmchen-g/models
autoencoder/MaskingNoiseAutoencoderRunner.py
10
1689
import numpy as np import sklearn.preprocessing as prep import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data from autoencoder.autoencoder_models.DenoisingAutoencoder import MaskingNoiseAutoencoder mnist = input_data.read_data_sets('MNIST_data', one_hot = True) def standard_scale(X_trai...
apache-2.0
rue89-tech/edx-platform
common/djangoapps/cors_csrf/tests/test_middleware.py
153
9892
""" Tests for the CORS CSRF middleware """ from mock import patch, Mock import ddt from django.test import TestCase from django.test.utils import override_settings from django.core.exceptions import MiddlewareNotUsed, ImproperlyConfigured from django.http import HttpResponse from django.middleware.csrf import CsrfVie...
agpl-3.0
yjmade/odoo
addons/website_event/tests/__init__.py
413
1072
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 20123TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
hugohmk/Epidemic-Emulator
main.py
1
7208
from epidemic_emulator import node from datetime import datetime import platform import argparse import time import os import matplotlib.pyplot as plt import random def parse_network(f, node_id, topology = "clique"): neighbors = [] nd = None t = datetime.now() t = t-t net = [] index = -1 ...
mit
BrandonHe/sdl_core
src/components/dbus/codegen/code_formatter.py
13
2284
#!/usr/bin/env python # -*- coding: utf-8 -*- # # @file code_formatter.py # @brief Utility that helps to manage indents in generated code # # This file is a part of HMI D-Bus layer. # # Copyright (c) 2013, Ford Motor Company # All rights reserved. # # Redistribution and use in source and binary forms, with or withou...
bsd-3-clause
all-of-us/raw-data-repository
rdr_service/lib_fhir/fhirclient_3_0_0/models/appointment_tests.py
1
9471
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated from FHIR 3.0.0.11832 on 2017-03-22. # 2017, SMART Health IT. import io import json import os import unittest from . import appointment from .fhirdate import FHIRDate class AppointmentTests(unittest.TestCase): def instantiate_from(self, filename): ...
bsd-3-clause
grlee77/numpy
numpy/distutils/cpuinfo.py
17
22657
#!/usr/bin/env python3 """ cpuinfo Copyright 2002 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics. NO WARRANTY IS EX...
bsd-3-clause
fabianvf/osf.io
website/addons/citations/provider.py
27
4980
import abc import httplib as http from framework.exceptions import HTTPError from framework.exceptions import PermissionsError from website.oauth.models import ExternalAccount class CitationsProvider(object): __metaclass__ = abc.ABCMeta def __init__(self, provider_name): self.provider_name = provid...
apache-2.0
TonyThompson/fail2ban-patch
fail2ban/version.py
4
1122
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban 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;...
gpl-2.0