repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
sammerry/ansible
v1/ansible/runner/lookup_plugins/template.py
176
1158
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
gpl-3.0
astroswego/plotypus
src/plotypus/plotypus.py
1
17301
import numpy from numpy import std from sys import exit, stdin, stdout, stderr from os import path, listdir from argparse import ArgumentError, ArgumentParser, SUPPRESS from pandas import read_table from sklearn.linear_model import (LassoCV, LassoLarsCV, LassoLarsIC, LinearRegression, ...
gpl-3.0
opensourceBrown/DR
DR/external/emscripten/tools/exec_llvm.py
11
1537
#!/usr/bin/python2 ''' Small utility to execute some llvm bitcode. The use case is a Makefile that builds some executable and runs it as part of the build process. With emmaken, the Makefile will generate llvm bitcode, so we can't just execute it directly. This script will get that code into a runnable form, and run ...
mit
iamutkarshtiwari/sympy
sympy/diffgeom/tests/test_hyperbolic_space.py
74
2447
''' unit test describing the hyperbolic half-plane with the Poincare metric. This is a basic model of hyperbolic geometry on the (positive) half-space {(x,y) \in R^2 | y > 0} with the Riemannian metric ds^2 = (dx^2 + dy^2)/y^2 It has constant negative scalar curvature = -2 https://en.wikipedia.org/wiki/Poincare_ha...
bsd-3-clause
laijingtao/landlab
landlab/components/landslides/landslide.py
4
16619
# %% Import Libraries from landlab import Component from ...utils.decorators import use_file_name_or_kwds import numpy as np # %% Instantiate Object class LandslideProbability(Component): """ Landlab component designed to calculate a probability of failure at each grid node based on the in...
mit
Belxjander/Kirito
Python-3.5.0-main/Lib/tkinter/test/test_tkinter/test_loadtk.py
162
1503
import os import sys import unittest import test.support as test_support from tkinter import Tcl, TclError test_support.requires('gui') class TkLoadTest(unittest.TestCase): @unittest.skipIf('DISPLAY' not in os.environ, 'No $DISPLAY set.') def testLoadTk(self): tcl = Tcl() self.assertRaises(Tc...
gpl-3.0
JingZhou0404/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/_stream_hixie75.py
681
8842
# Copyright 2011, 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...
bsd-3-clause
AppVentus/AvTime-client
packages/wakatime/wakatime/packages/pygments3/pygments/lexers/__init__.py
94
7684
# -*- coding: utf-8 -*- """ pygments.lexers ~~~~~~~~~~~~~~~ Pygments lexers. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys import types import fnmatch from os.path import basename from pygments.lexers._mapping import LEX...
bsd-3-clause
Anonymouslemming/ansible
test/runner/lib/metadata.py
22
2631
"""Test metadata for passing data to delegated tests.""" from __future__ import absolute_import, print_function import json from lib.util import ( display, is_shippable, ) from lib.diff import ( parse_diff, ) class Metadata(object): """Metadata object for passing data to delegated tests.""" def...
gpl-3.0
dariomangoni/chrono
src/demos/python/vehicle/demo_VEH_HMMWV_circle.py
1
5026
# ============================================================================= # PROJECT CHRONO - http:#projectchrono.org # # Copyright (c) 2014 projectchrono.org # All rights reserved. # # Use of this source code is governed by a BSD-style license that can be found # in the LICENSE file at the top level of the distri...
bsd-3-clause
tahmid-tanzim/youtube-dl
youtube_dl/extractor/allocine.py
144
3137
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_str from ..utils import ( qualities, ) class AllocineIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?allocine\.fr/(?P<typ>article|video|film)/(fichearticle...
unlicense
florian-dacosta/OpenUpgrade
addons/purchase/stock.py
33
8790
# -*- 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
aselle/tensorflow
tensorflow/python/util/compat.py
35
4224
# 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
tallakahath/pymatgen
pymatgen/electronic_structure/tests/test_plotter.py
2
4571
# coding: utf-8 # Copyright (c) Pymatgen Development Team. # Distributed under the terms of the MIT License. from __future__ import division, unicode_literals """ Created on May 1, 2012 """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Sh...
mit
ekwoodrich/nirha
nirhalib/venv/lib/python2.7/site-packages/limitlessled/group/white.py
1
7192
""" White LimitlessLED group. """ import time from limitlessled import util from limitlessled.group import Group, rate from limitlessled.util import steps WHITE = 'white' STEPS = 10 ON_BYTES = [0x38, 0x3D, 0x37, 0x32] OFF_BYTES = [0x3B, 0x33, 0x3A, 0x36] class WhiteGroup(Group): """ White LimitlessLED group. "...
apache-2.0
hvekriya/mojwmt
node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
mit
awiddersheim/flask-restplus
tests/test_inputs.py
2
22282
# -*- coding: utf-8 -*- from __future__ import unicode_literals import re from datetime import date, datetime import pytz from six import text_type from flask_restplus import inputs from . import assert_equal, assert_raises class InputTest(object): def assert_values(self, input, values): for value, ...
mit
jadnohra/connect
main_term.py
1
1417
import os import argparse import yaml from tabulate import tabulate from core.core import ( load_db, pattern_to_keys, recurse_gather, consolidate_gathered) parser = argparse.ArgumentParser(description='Query the connect .yaml file') parser.add_argument("query", help="The search query [key]:[value]", nargs='?', de...
unlicense
namccart/gnuradio
gr-digital/examples/narrowband/benchmark_rx.py
52
4793
#!/usr/bin/env python # # Copyright 2010,2011,2013 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 you...
gpl-3.0
bluesabre/gtk-symbol-check
GtkSymbolCheck.py
1
14433
# C GTK/GDK Symbol Versions Check import os import urllib.request import argparse MIN_GTK_VERSION = "3.14.0" gtk_major_version = 3 gtk_minor_version = 14 hide_not_found = False class GtkSymbol(): """GtkSymbol class that stores name, min, and max versions.""" def __init__(self, name, min_version=(3, 0), ...
gpl-3.0
igoralmeida/tahoe-lafs
src/allmydata/_auto_deps.py
5
10388
# Note: please minimize imports in this file. In particular, do not import # any module from Tahoe-LAFS or its dependencies, and do not import any # modules at all at global level. That includes setuptools and pkg_resources. # It is ok to import modules from the Python Standard Library if they are # always available, o...
gpl-2.0
bw4sz/DeepMeerkat
training/Classification/CreateDocs.py
1
6128
from __future__ import absolute_import ''' Create documents for training a tensorflow model training dataset on google cloud machine learning engine. This script is built for a two class training dataset, images with desired objects (positives) and images with ignored objects (negatives) see: http://cloud.google.com/b...
gpl-3.0
antin/Open-Knesset
simple/management/commands/gov_bills.py
9
1278
from optparse import make_option from django.core.management.base import NoArgsCommand from django.db.models import Max from simple.management.commands import parse_laws from laws.models import GovProposal def parse_gov_laws(use_last_booklet): booklet = 0 if use_last_booklet: booklet = GovProposal.ob...
bsd-3-clause
pleaseproject/python-for-android
python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/keyfactory.py
361
8791
"""Factory functions for asymmetric cryptography. @sort: generateRSAKey, parseXMLKey, parsePEMKey, parseAsPublicKey, parseAsPrivateKey """ from compat import * from RSAKey import RSAKey from Python_RSAKey import Python_RSAKey import cryptomath if cryptomath.m2cryptoLoaded: from OpenSSL_RSAKey import OpenSSL_RSAK...
apache-2.0
foliverkodi/repository.foliver
plugin.video.adultsonly/resources/lib/chardet/euckrfreq.py
3121
45978
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client 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 R...
gpl-2.0
titasakgm/brc-stock
openerp/addons/report_geraldo/lib/geraldo/site/newsite/site-geraldo/django/core/management/__init__.py
12
13040
import os import sys from optparse import OptionParser import imp import django from django.core.management.base import BaseCommand, CommandError, handle_default_options # For backwards compatibility: get_version() used to be in this module. get_version = django.get_version # A cache of loaded commands, so that call...
agpl-3.0
CJ8664/servo
tests/wpt/web-platform-tests/tools/pytest/testing/test_monkeypatch.py
171
8404
import os import sys import textwrap import pytest from _pytest.monkeypatch import monkeypatch as MonkeyPatch def pytest_funcarg__mp(request): cwd = os.getcwd() sys_path = list(sys.path) def cleanup(): sys.path[:] = sys_path os.chdir(cwd) request.addfinalizer(cleanup) return Mon...
mpl-2.0
fpy171/scrapy
scrapy/commands/version.py
60
1652
from __future__ import print_function import sys import platform import twisted import OpenSSL import scrapy from scrapy.commands import ScrapyCommand class Command(ScrapyCommand): def syntax(self): return "[-v]" def short_desc(self): return "Print Scrapy version" def add_options(self...
bsd-3-clause
redkyn/grader
redkyn-grader/grader/test/test_build.py
2
2559
import os import pytest import shutil from grader.models import Grader from grader.models.assignment import AssignmentBuildError hasdocker = pytest.mark.skipif(shutil.which("docker") is None, reason="Docker must be installed.") """A decorator to skip a test if docker is not installed."...
mit
IBM/differential-privacy-library
tests/models/test_incremental_mean_and_var.py
1
3983
from unittest.case import TestCase import numpy as np from sklearn.utils.extmath import _incremental_mean_and_var as sk_incremental_mean_and_var from diffprivlib.models.standard_scaler import _incremental_mean_and_var from diffprivlib.utils import PrivacyLeakWarning class TestIncrementalMeanAndVar(TestCase): de...
mit
sassoftware/mint
mint/django_rest/rbuilder/manager/rbuildermanager.py
1
4766
# # Copyright (c) SAS Institute 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 w...
apache-2.0
darionyaphet/spark
python/pyspark/ml/regression.py
1
87373
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
i-am-dev/DojoManager
app/test/test_user_model.py
1
1661
import unittest import datetime from app.main import db from app.main.model.user import User from app.test.base import BaseTestCase class TestUserModel(BaseTestCase): def test_encode_auth_token(self): user = User( email='test@test.com', password='test', registered_on...
mit
Team02-TeamGuinness/BIOE421_RoboHand
Printrun/printrun/stlview.py
21
18068
#!/usr/bin/env python # This file is part of the Printrun suite. # # Printrun 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. # # Prin...
gpl-2.0
pexip/os-django-celery
setup.py
1
5754
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import sys import codecs try: from setuptools import setup, Command except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, Command # noqa from distutils.command.install import INSTALL_SCHE...
bsd-3-clause
barnsnake351/nova
nova/tests/unit/api/openstack/compute/test_server_password.py
26
3831
# Copyright 2012 Nebula, 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 ...
apache-2.0
gregswift/ansible
lib/ansible/playbook/block.py
13
14599
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
polimediaupv/edx-platform
common/djangoapps/student/tests/test_auto_auth.py
88
8781
from django.test import TestCase from django.test.client import Client from django.contrib.auth.models import User from django_comment_common.models import ( Role, FORUM_ROLE_ADMINISTRATOR, FORUM_ROLE_MODERATOR, FORUM_ROLE_STUDENT) from django_comment_common.utils import seed_permissions_roles from student.models i...
agpl-3.0
santod/NuK3rn3l_htc_m7_GPE-5.1
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
JioCloud/glance
glance/db/sqlalchemy/migrate_repo/versions/011_make_mindisk_and_minram_notnull.py
19
1105
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
ArcherSys/ArcherSys
Lib/site-packages/nbconvert/filters/citation.py
12
3582
"""Citation handling for LaTeX output.""" #----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #---...
mit
scality/manila
manila/tests/scheduler/test_host_manager.py
1
31923
# Copyright (c) 2011 OpenStack, LLC # Copyright (c) 2015 Rushil Chugh # Copyright (c) 2015 Clinton Knight # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # ...
apache-2.0
yury-s/v8-inspector
Source/chrome/v8/tools/release/search_related_commits.py
9
6494
#!/usr/bin/env python # Copyright 2015 the V8 project 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 argparse import operator import os import re from sets import Set from subprocess import Popen, PIPE import sys def search_al...
bsd-3-clause
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-2.1/Lib/lib-tk/SimpleDialog.py
8
3652
"""A simple but flexible modal dialog box.""" from Tkinter import * class SimpleDialog: def __init__(self, master, text='', buttons=[], default=None, cancel=None, title=None, class_=None): if class_: self.root = Toplevel(master, class_=class_) else:...
mit
fosfataza/protwis
construct/urls.py
1
2773
from django.conf.urls import url from django.views.decorators.cache import cache_page from construct import views urlpatterns = [ url(r'^$', views.ConstructBrowser.as_view(), name='browse'), #no cache, for dev # url(r'^$', cache_page(3600*24)(views.ConstructBrowser.as_view()), name='browse'), url(r'^expe...
apache-2.0
gclenaghan/scikit-learn
examples/ensemble/plot_forest_importances.py
168
1793
""" ========================================= Feature importances with forests of trees ========================================= This examples shows the use of forests of trees to evaluate the importance of features on an artificial classification task. The red bars are the feature importances of the forest, along wi...
bsd-3-clause
crossbario/autobahn-testsuite
autobahntestsuite/autobahntestsuite/interfaces.py
2
5759
############################################################################### ## ## Copyright (c) Crossbar.io Technologies GmbH ## ## 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 ## ##...
apache-2.0
arokem/scipy
scipy/linalg/tests/test_lapack.py
1
65773
# # Created by: Pearu Peterson, September 2002 # from __future__ import division, print_function, absolute_import import sys import subprocess import time from functools import reduce from numpy.testing import (assert_equal, assert_array_almost_equal, assert_, assert_allclose, assert_almos...
bsd-3-clause
shoopio/shoop
shuup/core/management/commands/makemessages.py
2
5377
# This file is part of Shuup. # # Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. """ Patched version of Django's Makemessages that works with Jinja2. Works by monkey patc...
agpl-3.0
alazaro/tennis_tournament
django/contrib/localflavor/jp/forms.py
333
1211
""" JP-specific Form helpers """ from django.forms import ValidationError from django.utils.translation import ugettext_lazy as _ from django.forms.fields import RegexField, Select class JPPostalCodeField(RegexField): """ A form field that validates its input is a Japanese postcode. Accepts 7 digits, wit...
gpl-3.0
artzers/NGImageProcessor
AStarFilter.py
1
3556
import os, numpy as np, cv2 class PathNode: def __init__(self, x,y,g,h,pnode=(0,0)): self.x = x self.y = y self.g = g self.h = h self.val = self.h + self.g self.pnode = pnode class AStarFilter: def __init__(self): pass def AStarDemo(self): i...
mit
Ziqi-Li/bknqgis
numpy/numpy/distutils/tests/test_exec_command.py
8
7216
from __future__ import division, absolute_import, print_function import os import sys from tempfile import TemporaryFile from numpy.distutils import exec_command from numpy.distutils.exec_command import get_pythonexe from numpy.testing import run_module_suite, tempdir, assert_ # In python 3 stdout, stderr are text (...
gpl-2.0
wujuguang/sqlalchemy
examples/dogpile_caching/advanced.py
4
3021
"""Illustrate usage of Query combined with the FromCache option, including front-end loading, cache invalidation and collection caching. """ from .caching_query import FromCache from .caching_query import RelationshipCache from .environment import Session from .model import cache_address_bits from .model import Perso...
mit
kustodian/ansible
lib/ansible/modules/network/netvisor/_pn_vrouterlbif.py
47
10338
#!/usr/bin/python """ PN CLI vrouter-loopback-interface-add/remove """ # # 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 yo...
gpl-3.0
Aloomaio/graphite-web
contrib/demo-collector.py
67
6819
#!/usr/bin/env python from commands import getstatusoutput from platform import node from socket import socket, AF_INET, SOCK_STREAM from sys import argv, exit from time import sleep, time DELAY = 60 CARBON_SERVER = 'localhost' CARBON_PORT = 2003 class Carbon: def __init__(self, hostname, port): self.s = ...
apache-2.0
brightchen/Impala
thirdparty/thrift-0.9.0/lib/py/src/transport/TZlibTransport.py
210
8090
# # 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
hugobowne/scikit-learn
sklearn/metrics/base.py
46
4627
""" Common code for all metrics """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Mathieu Blondel <mathieu@mblondel.org> # Olivier Grisel <olivier.grisel@ensta.org> # Arnaud Joly <a.joly@ulg.ac.be> # Jochen Wersdorfer <jochen@wersdoerfer.de> # Lars Buitinck ...
bsd-3-clause
amyliu345/zulip
scripts/lib/hash_reqs.py
37
2164
#!/usr/bin/env python from __future__ import print_function import os import sys import argparse import hashlib if False: from typing import Iterable, List, MutableSet def expand_reqs_helper(fpath, visited): # type: (str, MutableSet[str]) -> List[str] if fpath in visited: return [] else: ...
apache-2.0
resmo/ansible
lib/ansible/plugins/vars/__init__.py
46
1263
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.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 Foundat...
gpl-3.0
flybird119/voltdb
tools/cluster.py
20
2969
#!/usr/bin/env python # reservation system for lab machines for use in manual or automated testing # # this script indicates the reservedness of a machine by the ownership of # an empty lockfile. # # users invoking this script must have set up passwordless ssh access to the # machines to be managed. # # this script is...
agpl-3.0
garimakhulbe/autorest
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyDateTimeRfc1123/autorestrfc1123datetimetestservice/auto_rest_rfc1123_date_time_test_service.py
8
2309
# 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
Alwnikrotikz/dpkt
dpkt/h225.py
17
10003
# $Id$ """ITU-T H.225.0 Call Signaling.""" import dpkt, tpkt import struct # H225 Call Signaling # # Call messages and information elements (IEs) are defined by Q.931: # http://cvsup.de.openbsd.org/historic/comp/doc/standards/itu/Q/Q.931.ps.gz # # The User-to-User IEs of H225 are encoded by PER of ASN.1. # Call Es...
bsd-3-clause
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/cogent/format/fasta.py
1
3033
#!/usr/bin/env python """Writer for FASTA sequence format """ __author__ = "Jeremy Widmann" __copyright__ = "Copyright 2007-2012, The Cogent Project" __credits__ = ["Jeremy Widmann", "Rob Knight", "Gavin Huttley"] __license__ = "GPL" __version__ = "1.5.3" __maintainer__ = "Jeremy Widmann" __email__ = "jeremy.widmann@c...
mit
avadhoot-agasti/sp17-i524
paper1/proceedings.py
36
6255
from __future__ import print_function import glob from ruamel import yaml from pprint import pprint import sys import re readmes = glob.glob("*/README.rst") def readfile(filename): with open(filename, 'r') as content_file: content = content_file.read() return content def read_readme(filename): # ...
apache-2.0
wiliamsouza/gunclub
gunclub/invoice/urls.py
1
1491
from django.conf.urls import patterns, url from django.views.generic import DetailView from django.views.generic.dates import (DayArchiveView, MonthArchiveView, YearArchiveView) from invoice.models import Invoice from invoice.views import (member_invoice, edit_invoice, print_inv...
apache-2.0
normtown/SickRage
sickbeard/notifiers/pytivo.py
12
3574
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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,...
gpl-3.0
brianonn/Cinnamon
files/usr/lib/cinnamon-slideshow/cinnamon-slideshow.py
14
13348
#! /usr/bin/python2 from gi.repository import Gio, GLib import dbus, dbus.service, dbus.glib from dbus.mainloop.glib import DBusGMainLoop import random import os, locale from xml.etree import ElementTree SLIDESHOW_DBUS_NAME = "org.Cinnamon.Slideshow" SLIDESHOW_DBUS_PATH = "/org/Cinnamon/Slideshow" BACKGROUND_COLLECT...
gpl-2.0
vanita5/thefuck
tests/rules/test_history.py
13
1315
import pytest from thefuck.rules.history import match, get_new_command from tests.utils import Command @pytest.fixture def history(mocker): return mocker.patch('thefuck.rules.history.get_history', return_value=['le cat', 'fuck', 'ls cat', 'diff x', 'no...
mit
EvanK/ansible
test/units/modules/network/nso/test_nso_verify.py
28
5415
# # Copyright (c) 2017 Cisco and/or its affiliates. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
kawamon/hue
desktop/core/ext-py/six-1.11.0/six.py
172
30888
# Copyright (c) 2010-2017 Benjamin Peterson # # 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, publi...
apache-2.0
chrisjones-brack3t/python-oauth2
example/server.py
375
7669
""" The MIT License Copyright (c) 2007 Leah Culver 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, publis...
mit
grongor/school_rfid
lib/nmap-6.40/zenmap/radialnet/core/Coordinate.py
1
12741
# vim: set fileencoding=utf-8 : # ***********************IMPORTANT NMAP LICENSE TERMS************************ # * * # * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is * # * also a registered trademark of Insecure.Com LLC. ...
gpl-2.0
aurelijusb/arangodb
3rdParty/V8-4.3.61/tools/release/create_release.py
24
9913
#!/usr/bin/env python # Copyright 2015 the V8 project 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 argparse import os import sys import tempfile import urllib2 from common_includes import * class Preparation(Step): MESSA...
apache-2.0
cancan101/tensorflow
tensorflow/python/debug/examples/debug_fibonacci.py
58
2737
# 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
ktbyers/pynet_ons
threads_proc/proc_w_queue.py
5
2048
#!/usr/bin/env python ''' Use processes and Netmiko to connect to each of the devices in the database. Execute 'show version' on each device. Use a queue to pass the output back to the parent process. Record the amount of time required to do this. ''' from netmiko import ConnectHandler from datetime import datetime f...
apache-2.0
shifter/grr
parsers/osx_launchd_test.py
6
1732
#!/usr/bin/env python """Tests for grr.parsers.osx_launchd.""" from grr.lib import flags from grr.lib import test_lib from grr.lib.rdfvalues import client as rdf_client from grr.lib.rdfvalues import paths as rdf_paths from grr.parsers import osx_launchd from grr.test_data import osx_launchd as testdata class OSXLa...
apache-2.0
zippynk/quotebot
sendquote.py
1
1113
#!/usr/bin/env python # A python module for submitting Quotes to the Backtick Quote DB. Distributed as part of quotebot by Nathan Krantz-Fire (a.k.a zippynk). https://github.com/zippynk/quotebot # Based on Hardmath123's jokebot. https://github.com/hardmath123/jokebot # Many thanks to Hardmath123 and Nickolas360 for ...
mpl-2.0
amenonsen/ansible-modules-core
commands/raw.py
5
1817
# this is a virtual module that is entirely implemented server side DOCUMENTATION = ''' --- module: raw short_description: Executes a low-down and dirty SSH command options: free_form: description: - the raw module takes a free form command to run required: true executable: description: - c...
gpl-3.0
bravominski/PennApps2015-HeartMates
venv/lib/python2.7/site-packages/pip/_vendor/requests/compat.py
571
2556
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 =...
apache-2.0
google/contentbox
third_party/requests/structures.py
279
3541
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import os import collections from itertools import islice class IteratorProxy(object): """docstring for IteratorProxy""" def __init__(self, i): self.i = i # self.i = chain.from_iter...
apache-2.0
brockwhittaker/zulip
zerver/migrations/0064_sync_uploads_filesize_with_db.py
2
2195
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-18 12:38 from django.db import migrations from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps from django.conf import settings from boto.s3.bucket import Bucket from boto.s3.key i...
apache-2.0
soumyajitpaul/soumyajit-github-byte2
lib/httplib2/test/functional/test_proxies.py
305
2965
import unittest import errno import os import signal import subprocess import tempfile import nose import httplib2 from httplib2 import socks from httplib2.test import miniserver tinyproxy_cfg = """ User "%(user)s" Port %(port)s Listen 127.0.0.1 PidFile "%(pidfile)s" LogFile "%(logfile)s" MaxClients 2 StartServers 1...
apache-2.0
robinvandernoord/electron
script/cpplint.py
153
1850
#!/usr/bin/env python import fnmatch import os import sys from lib.util import execute IGNORE_FILES = [ os.path.join('atom', 'app', 'atom_main.cc'), os.path.join('atom', 'browser', 'mac', 'atom_application.h'), os.path.join('atom', 'browser', 'mac', 'atom_application_delegate.h'), os.path.join('atom', 'brows...
mit
kdwink/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_print.py
326
2865
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Fixer for print. Change: 'print' into 'print()' 'print ...' into 'print(...)' 'print ... ,' into 'print(..., end=" ")' 'print >>x, ...' into 'print(..., file=x)' No changes are appl...
apache-2.0
farazrehman/aws-resources
CloudFormation/nash/lib/python2.7/site-packages/pip/_vendor/cachecontrol/serialize.py
317
6189
import base64 import io import json import zlib from pip._vendor.requests.structures import CaseInsensitiveDict from .compat import HTTPResponse, pickle def _b64_encode_bytes(b): return base64.b64encode(b).decode("ascii") def _b64_encode_str(s): return _b64_encode_bytes(s.encode("utf8")) def _b64_decode...
gpl-2.0
tjsavage/full_nonrel_starter
django/contrib/messages/tests/session.py
413
1230
from django.contrib.messages.tests.base import BaseTest from django.contrib.messages.storage.session import SessionStorage def set_session_data(storage, messages): """ Sets the messages into the backend request's session and remove the backend's loaded data cache. """ storage.request.session[stora...
bsd-3-clause
cloud-fan/spark
examples/src/main/python/mllib/summary_statistics_example.py
27
1511
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
kursitet/edx-platform
common/lib/xmodule/xmodule/video_module/bumper_utils.py
67
4226
""" Utils for video bumper """ import copy import json import pytz import logging from collections import OrderedDict from datetime import datetime, timedelta from django.conf import settings from .video_utils import set_query_parameter try: import edxval.api as edxval_api except ImportError: edxval_api = No...
agpl-3.0
michaelgugino/turbo-lister
werkzeug/testsuite/urls.py
2
14874
# -*- coding: utf-8 -*- """ werkzeug.testsuite.urls ~~~~~~~~~~~~~~~~~~~~~~~ URL helper tests. :copyright: (c) 2013 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.datastructures import OrderedMultiD...
gpl-3.0
the-nick-of-time/DnD
DnD/modules/lib/conditionLib.py
1
2024
from typing import List, Union from . import characterLib as char from . import exceptionsLib as ex from . import helpers as h from . import interface as iface class Conditions: def __init__(self, jf: iface.JsonInterface, character: 'char.Character'): self.record = jf self.owner = character ...
gpl-2.0
why11002526/keras
tests/manual/check_callbacks.py
82
7540
import numpy as np import random import theano from keras.models import Sequential from keras.callbacks import Callback from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.regularizers import l2 from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.utils import np_utils...
mit
tsdmgz/ansible
lib/ansible/modules/cloud/ovirt/ovirt_templates_facts.py
73
3558
#!/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
damocles972/Sick-Beard
cherrypy/wsgiserver/ssl_builtin.py
74
2542
"""A library for integrating pyOpenSSL with CherryPy. The ssl module must be importable for SSL functionality. To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of BuiltinSSLAdapter. ssl_adapter.certificate: the filename of the server SSL certificate. ssl_adapter.private_key: the filename...
gpl-3.0
onceuponatimeforever/oh-mainline
vendor/packages/docutils/test/test_parsers/test_rst/test_directives/test_raw.py
18
4985
#! /usr/bin/env python # $Id: test_raw.py 7384 2012-03-19 22:59:09Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for misc.py "raw" directive. """ import os.path import sys from __init__ import DocutilsTestSupport from docutils._compat i...
agpl-3.0
SBRG/ssbio
ssbio/protein/structure/utils/tleap.py
2
6481
#!/usr/bin/env python import os import os.path as op from pkg_resources import resource_filename def prep_leap_folders(wd): if not op.exists(op.join(wd, 'xleap_modified')): os.mkdir(op.join(wd, 'xleap_modified')) if not op.exists(op.join(wd, 'amber_minimized')): os.mkdir(op.join(wd, 'amber_mi...
mit
skylifewww/pharmacognosy
content/templatetags/content_tags.py
1
4209
from django import template # from django.contrib.admin.util import lookup_field # from django.core.exceptions import ObjectDoesNotExist # from django.core.urlresolvers import NoReverseMatch, reverse # from django.db.models import ForeignKey # from django.template.defaulttags import NowNode # from django.utils.safestri...
mit
za-creature/gulpless
gulpless/handlers.py
1
10606
# coding=utf-8 from __future__ import absolute_import, unicode_literals, division import pathtools.patterns import termcolor import logging import shutil import time import re import os class TimedSet(set): __slots__ = ["updated"] def __init__(self, updated): self.updated = updated super(Tim...
mit
cderici/question-analyzer
src/data/maltImporter.py
1
1766
import codecs from question import Question class MaltImporter: questions = []; def getRawQuestionTexts(self, qFilePath): qFile = codecs.open(qFilePath, 'r', 'utf-8');##utf-8 file qTexts = qFile.readlines(); qTexts = [text.strip().split('|') for text in qTexts]; return q...
gpl-2.0
slohse/ansible
lib/ansible/modules/remote_management/wakeonlan.py
99
3629
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Dag Wieers <dag@wieers.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_version': '1.1', ...
gpl-3.0
wensheng/JuicyRaspberryPie
bukkit/src/main/resources/mcpi/event.py
1
2019
from .vec3 import Vec3 class BlockEvent: """An Event related to blocks (e.g. placed, removed, hit)""" HIT = 0 def __init__(self, type, x, y, z, face, entityId): self.type = type self.pos = Vec3(int(x), int(y), int(z)) self.face = face self.entityId = entityId def __rep...
bsd-2-clause