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
h2oai/h2o
py/jprobe.py
8
20674
#!/usr/bin/python import random, jenkinsapi, getpass, re, os, argparse, shutil, json, logging, sys import string from jenkinsapi.jenkins import Jenkins # only used when we wanted to see what objects were available (below) # from see import see DO_LAST_GOOD = True # using the env variables to force jenkinsapi to use ...
apache-2.0
naritta/numpy
numpy/distutils/tests/test_npy_pkg_config.py
70
3069
from __future__ import division, absolute_import, print_function import os from tempfile import mkstemp from numpy.testing import * from numpy.distutils.npy_pkg_config import read_config, parse_flags simple = """\ [meta] Name = foo Description = foo lib Version = 0.1 [default] cflags = -I/usr/include libs = -L/usr/...
bsd-3-clause
johnewart/django-ldap-wizard
django_ldap_wizard/views.py
1
2059
from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext, Template, Context, loader from django.utils.safestring import mark_safe from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.conf import settings from django.contrib.auth import auth...
bsd-3-clause
PauliusLabanauskis/AlgorithmsDataStructures
algo_pathfinding/main.py
1
1083
from graph_input import read_graph def choose_node(reachable, explored): for node in reachable: if node not in explored: return node def find_path(start_node, goal_node, graph): reachable = [start_node] explored = set() previous = {start_node: None} while len(reachable) > 0: ...
unlicense
sgml/popcorn_maker
vendor-local/lib/python/whoosh/lang/porter2.py
117
8314
"""An implementation of the Porter2 stemming algorithm. See http://snowball.tartarus.org/algorithms/english/stemmer.html Adapted from pyporter2 by Michael Dirolf. This algorithm is more correct but (at least in this implementation) several times slower than the original porter algorithm as implemented in stemming.por...
bsd-3-clause
lemonad/methodiki
methodiki/methods/forms.py
1
1932
# -*- coding: utf-8 -*- from django.forms import ModelForm, TextInput from django.utils.translation import ugettext_lazy as _ from markitup.widgets import MarkItUpWidget from taggit.forms import TagWidget from common.forms import ModelFormRequestUser from models import Method, MethodBonus class MethodForm(ModelFormR...
mit
tersmitten/ansible
lib/ansible/modules/cloud/azure/azure_rm_mariadbconfiguration.py
12
8115
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # Copyright (c) 2019 Matti Ranta, (@techknowlogick) # # 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_METADAT...
gpl-3.0
axilleas/ansible
lib/ansible/module_utils/cloudstack.py
118
13221
# -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the aut...
gpl-3.0
anthonyfok/frescobaldi
frescobaldi_app/gadgets/drag.py
1
4442
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2011 - 2014 by Wilbert Berendsen # # 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 ...
gpl-2.0
volkerha/DT211-3-Cloud
euler/e11.py
1
2860
grid = '08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 24 47 32 60 ...
mit
milankl/swm
calc/misc/Re_hist_calc_bs_old.py
1
4307
## HISTOGRAM COMPUTATIONS FOR REYNOLDS AND ROSSBY NUMBERS from __future__ import print_function # path import os path = '/home/mkloewer/python/swm/' #path = os.path.dirname(os.getcwd()) + '/' # on level above os.chdir(path) # change working directory import time as tictoc import numpy a...
gpl-3.0
rodrigolucianocosta/ControleEstoque
rOne/Storage101/django-localflavor/django-localflavor-1.3/tests/test_pl.py
4
22841
from __future__ import unicode_literals from django.test import SimpleTestCase from localflavor.pl.forms import (PLCountySelect, PLNationalIDCardNumberField, PLNIPField, PLPESELField, PLPostalCodeField, PLProvinceSelect, PLREGONField) class PLLocalFlavorTests(SimpleTestCase): d...
gpl-3.0
Poofjunior/dxf2gcode
postpro/tspoptimisation.py
1
16557
# -*- coding: utf-8 -*- ############################################################################ # # Copyright (C) 2008-2015 # Christian Kohlöffel # Vinzenz Schulz # Jean-Paul Schouwstra # # This file is part of DXF2GCODE. # # DXF2GCODE is free software: you can redistribute it and/or mod...
gpl-3.0
mujiansu/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Tools/versioncheck/pyversioncheck.py
98
4051
"""pyversioncheck - Module to help with checking versions""" import types import rfc822 import urllib import sys # Verbose options VERBOSE_SILENT=0 # Single-line reports per package VERBOSE_NORMAL=1 # Single-line reports per package, more info if outdated VERBOSE_EACHFILE=2 # Report on each URL chec...
apache-2.0
iHateWEBos/shooter_kernel_34
scripts/gcc-wrapper.py
501
3410
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, Code Aurora Forum. 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 a...
gpl-2.0
yigitguler/django
tests/forms_tests/tests/test_util.py
12
4366
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy from django.core.exceptions import ValidationError from django.forms.utils import flatatt, ErrorDict, ErrorList from django.test import TestCase from django.utils.safestring import mark_safe from django.utils import six from django.utils.tran...
bsd-3-clause
seibert/numba
numba/roc/stubs.py
4
2822
from numba.core import types, typing, ir _stub_error = NotImplementedError("This is a stub.") def get_global_id(*args, **kargs): """ OpenCL get_global_id() """ raise _stub_error def get_local_id(*args, **kargs): """ OpenCL get_local_id() """ raise _stub_error def get_global_size(*...
bsd-2-clause
wldcordeiro/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/runner.py
173
17105
""" basic collect and runtest protocol implementations """ import bdb import sys from time import time import py import pytest from _pytest._code.code import TerminalRepr, ExceptionInfo def pytest_namespace(): return { 'fail' : fail, 'skip' : skip, 'importorskip' : importo...
mpl-2.0
rjschwei/azure-sdk-for-python
azure-mgmt-datalake-analytics/azure/mgmt/datalake/analytics/catalog/models/usql_assembly.py
3
2832
# 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
BlueCrystalLabs/bgfx
3rdparty/scintilla/test/lexTests.py
65
3416
# -*- coding: utf-8 -*- # Requires Python 2.7 or later import io, os, sys, unittest if sys.platform == "win32": import XiteWin as Xite else: import XiteQt as Xite keywordsHTML = [ b"b body content head href html link meta " b"name rel script strong title type xmlns", b"function", b"sub" ] class TestLexers(unitte...
bsd-2-clause
lightcn/odoo
addons/resource/__init__.py
448
1086
# -*- 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
sh1nu11bi/RATDecoders
BlackShades.py
8
5801
#!/usr/bin/env python ''' BlackShades RAT Decoder Original Script by Brian Wallace (@botnet_hunter) ''' __description__ = 'DarkComet Rat Config Extractor\nOriginal Script by Brian Wallace (@botnet_hunter)' __author__ = 'Kevin Breen http://techanarchy.net' __OrigionalCode__ = 'v1.0.0 by Brian Wallace (@botnet_hunter...
gpl-3.0
tornadozou/tensorflow
tensorflow/contrib/signal/python/ops/spectral_ops.py
15
7918
# Copyright 2017 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
pism/pism
examples/inverse/test_invssa_gn.py
1
5837
#! /usr/bin/env python3 # # Copyright (C) 2012, 2014, 2015, 2016, 2017, 2018, 2019 David Maxwell # # This file is part of PISM. # # PISM 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
paramecio/pastafari
scripts/monit/debian_wheezy/alive.py
1
4720
#!/usr/bin/python3 -u # A script for install alive script import subprocess import argparse import re import os import shutil import pwd from subprocess import call parser = argparse.ArgumentParser(description='A script for install alive script and cron') parser.add_argument('--url', help='The url where notify tha...
gpl-2.0
broferek/ansible
test/units/module_utils/test_database.py
75
4393
import pytest from ansible.module_utils.database import ( pg_quote_identifier, SQLParseError, ) # These are all valid strings # The results are based on interpreting the identifier as a table name VALID = { # User quoted '"public.table"': '"public.table"', '"public"."table"': '"public"."table"', ...
gpl-3.0
macborowy/dajsiepoznac-feed
DajSiePoznacFeed-Server/tests/workers_tests/test_participant_worker.py
1
2277
import unittest import mock from crawler.src.controllers.worker import ParticipantsWorker import webapp2 import webtest from google.appengine.ext import testbed import logging logger = logging.getLogger() logger.setLevel(logging.DEBUG) class ParticipantsWorkerTests(unittest.TestCase): def setUp(self): se...
mit
NGSchool2016/ngschool2016-materials
src/snpEff/scripts/gsa/checkGeneNames.py
2
4985
#!/usr/bin/env python import sys # Debug mode? debug = False #------------------------------------------------------------------------------ # Read genes file #------------------------------------------------------------------------------ def readGenes(genesFile): print >> sys.stderr, "Reading file " + genesFile g...
gpl-3.0
slohse/ansible
lib/ansible/modules/cloud/azure/azure_rm_appgateway.py
4
35537
#!/usr/bin/python # # Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.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
Tithen-Firion/youtube-dl
youtube_dl/extractor/ondemandkorea.py
62
2036
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( ExtractorError, js_to_json, ) class OnDemandKoreaIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?ondemandkorea\.com/(?P<id>[^/]+)\.html' _GEO_COUNTRIES = ['US', 'CA'] _TEST = { ...
unlicense
t-neumann/slamdunk
bin/_preamble.py
1
1062
# Copyright (c) 2015 Tobias Neumann, Philipp Rescheneder. # # This file is part of Slamdunk. # # Slamdunk is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your ...
agpl-3.0
jmartinezchaine/OpenERP
openerp/addons/base/test/test_ir_cron.py
15
5020
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
zooba/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/pip/_vendor/html5lib/_trie/py.py
1323
1775
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError...
apache-2.0
rafaeltomesouza/frontend-class1
aula2/a11/linkedin/client/.gradle/nodejs/node-v7.5.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py
2698
3270
#!/usr/bin/env python # Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the easy_xml.py file. """ import gyp.easy_xml as easy_xml import unittest import StringIO class TestSequenceFunctions(...
mit
pongem/python-bot-project
appengine/standard/botapp/env/lib/python2.7/site-packages/django/db/utils.py
143
10368
import os import pkgutil from importlib import import_module from threading import local from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils._os import npath, upath from django.utils.functional import cached_property from django.utils....
apache-2.0
dd00/commandergenius
project/jni/python/src/Demo/scripts/lpwatch.py
32
3200
#! /usr/bin/env python # Watch line printer queue(s). # Intended for BSD 4.3 lpq. import posix import sys import time import string DEF_PRINTER = 'psc' DEF_DELAY = 10 def main(): delay = DEF_DELAY # XXX Use getopt() later try: thisuser = posix.environ['LOGNAME'] except: thisuser = posix....
lgpl-2.1
victoredwardocallaghan/xen
tools/python/xen/util/pci.py
25
50406
#!/usr/bin/env python # # PCI Device Information Class # - Helps obtain information about which I/O resources a PCI device needs # # Author: Ryan Wilson <hap9@epoch.ncsc.mil> import sys import os, os.path import errno import resource import re import types import struct import time import threading from xen.util imp...
gpl-2.0
pnecchi/Thesis
Code/Prototype/critic.py
1
2591
################################################################################ # Description: Module containing various critic implementations # Author: Pierpaolo Necchi # Email: pierpaolo.necchi@gmail.com # Date: dom 05 giu 2016 18:24:01 CEST ########################################################...
mit
ghisvail/vispy
vispy/visuals/transforms/tests/test_transforms.py
17
6541
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np import vispy.visuals.transforms as tr from vispy.geometry import Rect from vispy.testing import run_tests_if_main NT = tr.NullTransform ST = tr.STTransfor...
bsd-3-clause
insomnia-lab/calibre
src/calibre/library/server/content.py
3
10759
#!/usr/bin/env python # 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' import re, os, posixpath import cherrypy from calibre import fit_image, guess_type from calibre.utils.date import fromtim...
gpl-3.0
TomBaxter/osf.io
osf/migrations/0024_migrate_subject_parents_to_parent.py
28
3542
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.db import connection, migrations, models from osf.models.validators import validate_subject_hierarchy_length logger = logging.getLogger(__name__) def add_custom_mapping_constraint(state, schema): sql = """ ALTER T...
apache-2.0
iuliat/nova
nova/tests/unit/scheduler/filters/test_retry_filters.py
68
1929
# 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 # d...
apache-2.0
andjimrio/LTN
Application/service/item_services.py
1
5173
from collections import Counter from django.utils import timezone from django.shortcuts import get_object_or_404 from Application.models import Item, UserProfile, Section, Status from Application.utilities.python_utilities import floor_log from Application.service.profile_services import get_profile, get_keywords_by_...
mit
devlaith/DEVLAITH-HL
tg/tg-test.py
199
1450
import tgl import pprint from functools import partial our_id = 0 pp = pprint.PrettyPrinter(indent=4) binlog_done = False; def on_binlog_replay_end(): binlog_done = True; def on_get_difference_end(): pass def on_our_id(id): our_id = id return "Set ID: " + str(our_id) def msg_cb(success, msg): ...
gpl-2.0
bykof/billomapy
billomapy/resources.py
1
4081
""" KEY and DATA_KEYS FOR THE API """ PROPERTY_VALUES = '-property-values' PROPERTY_VALUE = '-property-value' TAGS = '-tags' TAG = '-tag' ITEMS = '-items' ITEM = '-item' COMMENTS = '-comments' COMMENT = '-comment' PAYMENTS = '-payments' PAYMENT = '-payment' EMAIL_RECEIVERS = '-email-receivers' EMAIL_RECEIVER = '-...
apache-2.0
BjerknesClimateDataCentre/QuinCe
external_scripts/NRT/salinity_data/prepare_salinity.py
2
2681
# Prepare a cut-down version of the World Ocean Atlas 2018 salinity # data to use with the AddSalinityPreprocessor. # Input files are 0.25° seasonal files for the years 2005-2017, # available from https://www.nodc.noaa.gov/cgi-bin/OC5/woa18/woa18.pl # Files are: # # woa18_A5B7_s13_04.nc - Winter (DJF) = Season 1 # wo...
gpl-3.0
balloob/home-assistant
homeassistant/components/venstar/climate.py
16
11240
"""Support for Venstar WiFi Thermostats.""" import logging from venstarcolortouch import VenstarColorTouch import voluptuous as vol from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity from homeassistant.components.climate.const import ( ATTR_HVAC_MODE, ATTR_TARGET_TEMP_HIGH, ATTR_T...
apache-2.0
yamila-moreno/nikola
nikola/data/themes/base/messages/messages_da.py
6
1441
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "%d min remaining to read": "%d min. tilbage at læse", "(active)": "", "Also available in:": "Fås også i:", "Archive": "Arkiv", "Categories": "Kategorier", "Comments": "Kommentarer", "LANGUAGE": "Dansk", "Lang...
mit
mhvk/numpy
numpy/core/tests/test_memmap.py
5
7469
import sys import os import mmap import pytest from pathlib import Path from tempfile import NamedTemporaryFile, TemporaryFile from numpy import ( memmap, sum, average, product, ndarray, isscalar, add, subtract, multiply) from numpy import arange, allclose, asarray from numpy.testing import ( assert_, assert_...
bsd-3-clause
ychen820/microblog
flask/lib/python2.7/site-packages/openid/server/server.py
142
65667
# -*- test-case-name: openid.test.test_server -*- """OpenID server protocol and logic. Overview ======== An OpenID server must perform three tasks: 1. Examine the incoming request to determine its nature and validity. 2. Make a decision about how to respond to this request. 3. Format th...
bsd-3-clause
anant-dev/django
tests/indexes/models.py
253
1714
from django.db import connection, models class CurrentTranslation(models.ForeignObject): """ Creates virtual relation to the translation with model cache enabled. """ # Avoid validation requires_unique_target = False def __init__(self, to, on_delete, from_fields, to_fields, **kwargs): ...
bsd-3-clause
pcrews/rannsaka
test_files/2volumes_basic.py
1
3456
import os import random import time import json from locust import HttpLocust, TaskSet, task from lib.baseTaskSet import baseTaskSet # TODO - make these config-driven from lib.openstack.keystone import get_auth_token from lib.openstack.cinder import list_volumes from lib.openstack.cinder import list_volumes_detail f...
apache-2.0
grap/OpenUpgrade
addons/membership/membership.py
9
28553
# -*- 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
2014c2g5/2014c2
exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/result.py
727
6397
"""Test result object""" import io import sys import traceback from . import util from functools import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() return method(self, *args, **kw) ...
gpl-2.0
fperez/cython
tests/run/test_call.py
17
3139
import unittest # The test cases here cover several paths through the function calling # code. They depend on the METH_XXX flag that is used to define a C # function, which can't be verified from Python. If the METH_XXX decl # for a C function changes, these tests may not cover the right paths. class CFunctionCalls...
apache-2.0
brean/arduino-kivy-bluetooth
glue/protocols/__init__.py
1
2145
# -*- coding: utf-8 -*- """ provide classes for different connection protocols (bluetooth, tcp/ip, ...) """ protocols = {} class Protocol(object): def __init__(self, name): """ basic protocol interface """ self.name = name def write(self, data): """ write data ...
mit
infoxchange/lettuce
tests/integration/lib/Django-1.3/django/template/loaders/app_directories.py
229
2764
""" Wrapper for loading templates from "templates" directories in INSTALLED_APPS packages. """ import os import sys from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template.base import TemplateDoesNotExist from django.template.loader import BaseLoader from django.u...
gpl-3.0
semgroup5-project/opendlv.scaledcars
thirdparty/cxxtest/doc/examples/test_examples.py
50
2474
#------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v3 # For more information, see the COPYING file in the top CxxTest directory. # Under the terms of ...
gpl-2.0
quantumlib/Cirq
examples/quantum_fourier_transform.py
1
2702
""" Creates and simulates a circuit for Quantum Fourier Transform(QFT) on a 4 qubit system. In this example we demonstrate Fourier Transform on (1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0) vector. To do the same, we prepare the input state of the qubits as |0000>. === EXAMPLE OUTPUT === Circuit: (0, 0): ─H───@^0.5───×───H──────...
apache-2.0
gangadharkadam/sher
erpnext/hr/report/employee_birthday/employee_birthday.py
25
1331
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import flt def execute(filters=None): if not filters: filters = {} columns = get_columns() ...
agpl-3.0
giggsey/SickRage
lib/sqlalchemy/dialects/drizzle/mysqldb.py
154
1270
""" .. dialect:: drizzle+mysqldb :name: MySQL-Python :dbapi: mysqldb :connectstring: drizzle+mysqldb://<user>:<password>@<host>[:<port>]/<dbname> :url: http://sourceforge.net/projects/mysql-python """ from sqlalchemy.dialects.drizzle.base import ( DrizzleDialect, DrizzleExecutionContext, ...
gpl-3.0
TalShafir/ansible
lib/ansible/modules/cloud/scaleway/scaleway_sshkey.py
75
4776
#!/usr/bin/python # # Scaleway SSH keys management module # # Copyright (C) 2018 Online SAS. # https://www.scaleway.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...
gpl-3.0
jrha/aquilon
tests/broker/test_update_cluster.py
2
3584
#!/usr/bin/env python2.6 # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2011,2013 Contributor # # 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...
apache-2.0
zhaochao/fuel-web
tasklib/tasklib/tests/functional/test_run_exec.py
4
2108
# Copyright 2014 Mirantis, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
hell03610/python-koans
python3/koans/about_regex.py
34
4795
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * import re class AboutRegex(Koan): """ These koans are based on the Ben's book: Regular Expressions in 10 minutes. I found this books very useful so I decided to write a koans in order to practice everything I had learned from i...
mit
ogenstad/ansible
lib/ansible/plugins/lookup/subelements.py
64
6146
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # (c) 2012-17 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 DOCUMENTATION = """ lookup: subelements ...
gpl-3.0
andybab/Impala
tests/query_test/test_hbase_queries.py
8
1079
#!/usr/bin/env python # Copyright (c) 2012 Cloudera, Inc. All rights reserved. # Targeted Impala HBase Tests # import logging import pytest from tests.common.test_vector import * from tests.common.impala_test_suite import * class TestHBaseQueries(ImpalaTestSuite): @classmethod def get_workload(self): return 'f...
apache-2.0
nozuono/calibre-webserver
src/calibre/ebooks/pdb/ereader/writer.py
24
10728
# -*- coding: utf-8 -*- ''' Write content to ereader pdb file. ''' __license__ = 'GPL v3' __copyright__ = '2009, John Schember <john@nachtimwald.com>' __docformat__ = 'restructuredtext en' import re import struct import zlib try: from PIL import Image Image except ImportError: import Image import cSt...
gpl-3.0
lsqtongxin/django
tests/template_tests/test_extends.py
154
7062
import os from django.template import Context, Engine, TemplateDoesNotExist from django.template.loader_tags import ExtendsError from django.template.loaders.base import Loader from django.test import SimpleTestCase, ignore_warnings from django.utils.deprecation import RemovedInDjango20Warning from .utils import ROOT...
bsd-3-clause
lsqtongxin/django
django/utils/log.py
116
5216
from __future__ import unicode_literals import logging import logging.config # needed when logging_config doesn't start with logging.config import sys import warnings from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.utils.depr...
bsd-3-clause
mchdks/python-social-auth
social/backends/soundcloud.py
83
2156
""" Soundcloud OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/soundcloud.html """ from social.p3 import urlencode from social.backends.oauth import BaseOAuth2 class SoundcloudOAuth2(BaseOAuth2): """Soundcloud OAuth authentication backend""" name = 'soundcloud' AUTHORIZATION_URL = ...
bsd-3-clause
mcgee/ns-3
doc/manual/source/conf.py
75
7047
# -*- coding: utf-8 -*- # # ns-3 documentation build configuration file, created by # sphinx-quickstart on Tue Dec 14 09:00:39 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All co...
gpl-2.0
ardumont/pygit2
test/test_repository.py
1
21901
# -*- coding: UTF-8 -*- # # Copyright 2010-2014 The pygit2 contributors # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2, # as published by the Free Software Foundation. # # In addition to the permissions in the GNU General Public Li...
gpl-2.0
joericearchitect/site-joe-rice-architect
devops/deployment/ansible/ec2-inventory/ec2.py
12
63782
#!/usr/bin/env python ''' EC2 external inventory script ================================= Generates inventory that Ansible can understand by making API request to AWS EC2 using the Boto library. NOTE: This script assumes Ansible is being executed where the environment variables needed for Boto have already been set:...
apache-2.0
techtonik/readthedocs.org
readthedocs/vcs_support/base.py
34
4583
import logging import os import shutil import subprocess from collections import namedtuple from os.path import basename log = logging.getLogger(__name__) class VCSVersion(object): """ Represents a Version (tag or branch) in a VCS. This class should only be instantiated in BaseVCS subclasses. It c...
mit
mybios/angle
src/tests/deqp_tests/generate_deqp_tests.py
24
1253
import os import re import sys def ReadFileAsLines(filename): """Reads a file, removing blank lines and lines that start with #""" file = open(filename, "r") raw_lines = file.readlines() file.close() lines = [] for line in raw_lines: line = line.strip() if len(line) > 0 and not ...
bsd-3-clause
pepeportela/edx-platform
lms/djangoapps/verify_student/tests/test_fake_software_secure.py
10
2751
""" Tests for the fake software secure response. """ from django.test import TestCase from mock import patch from lms.djangoapps.verify_student.models import SoftwareSecurePhotoVerification from student.tests.factories import UserFactory from util.testing import UrlResetMixin class SoftwareSecureFakeViewTest(UrlRes...
agpl-3.0
SomethingExplosive/android_external_chromium_org
third_party/tlslite/tlslite/Checker.py
359
6301
"""Class for post-handshake certificate checking.""" from utils.cryptomath import hashAndBase64 from X509 import X509 from X509CertChain import X509CertChain from errors import * class Checker: """This class is passed to a handshake function to check the other party's certificate chain. If a handshake f...
bsd-3-clause
Oweoqi/metagoofil
hachoir_parser/container/riff.py
86
16938
# -*- coding: UTF-8 -*- """ RIFF parser, able to parse: * AVI video container * WAV audio container * CDA file Documents: - libavformat source code from ffmpeg library http://ffmpeg.mplayerhq.hu/ - Video for Windows Programmer's Guide http://www.opennet.ru/docs/formats/avi.txt - What is an animated curso...
gpl-2.0
ninapavlich/lesleyloraine
lesleyloraine/apps/email/migrations/0002_auto_20160205_2337.py
3
1436
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('email', '0001_initial'), ] operations = [ migrations.AlterField( model_name='emailcategory', name='a...
mit
arifsetiawan/edx-platform
lms/djangoapps/courseware/features/conditional.py
102
4723
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from lettuce import world, steps from nose.tools import assert_in, assert_true # pylint: disable=no-name-in-module from common import i_am_registered_for_the_course, visit_scenario_item from problems_setup import add_problem_to_course, answer...
agpl-3.0
lucywyman/slides
source/source/conf.py
1
9886
# -*- coding: utf-8 -*- # # slides documentation build configuration file, created by # sphinx-quickstart on Wed Jul 1 21:05:39 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
mit
bw2/gemini
gemini/vep.py
4
11612
#!/usr/bin/env python ############# # CSQ: Consequence|Codons|Amino_acids|Gene|hgnc|Feature|EXON|polyphen|sift|Protein_position|BIOTYPE # missense_variant|gAg/gTg|E/V|ENSG00000188157||ENST00000379370|12/36|probably_damaging(0.932)|deleterious(0.02)|728/2045_protein_coding # nc_transcript_variant|||ENSG00000116254|CHD...
mit
xianggong/m2c_unit_test
test/integer/mad_hi_ushortushortushort/compile.py
1861
4430
#!/usr/bin/python import os import subprocess import re def runCommand(command): p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) p.wait() return iter(p.stdout.readline, b'') def dumpRunCommand(command,...
gpl-2.0
MartijnBraam/CouchPotatoServer
libs/rtorrent/err.py
182
1638
# Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com> # 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, ...
gpl-3.0
Panos512/invenio
modules/miscutil/lib/upgrades/invenio_2014_11_04_format_recjson.py
5
1452
## -*- mode: python; coding: utf-8; -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 CERN. ## ## Invenio 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 (a...
gpl-2.0
spthaolt/VTK
Examples/Modelling/Python/expCos.py
8
2383
#!/usr/bin/env python # This example demonstrates how to use a programmable filter and how # to use the special vtkDataSetToDataSet::GetOutputPort() methods import vtk from math import * # We create a 100 by 100 point plane to sample plane = vtk.vtkPlaneSource() plane.SetXResolution(100) plane.SetYResolution(100) #...
bsd-3-clause
Karaage-Cluster/karaage
karaage/projects/utils.py
2
1729
# Copyright 2010-2017, The University of Melbourne # Copyright 2010-2017, Brian May # # This file is part of Karaage. # # Karaage 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
Omegaphora/external_chromium_org_tools_gyp
pylib/gyp/xcode_ninja.py
22
10034
# Copyright (c) 2014 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
bsd-3-clause
samklr/spark-timeseries
python/sparkts/test/test_timeseriesrdd.py
6
5407
from test_utils import PySparkTestCase from sparkts.timeseriesrdd import * from sparkts.timeseriesrdd import _TimeSeriesSerializer from sparkts.datetimeindex import * import pandas as pd import numpy as np from unittest import TestCase from io import BytesIO from pyspark.sql import SQLContext class TimeSeriesSerialize...
apache-2.0
janslow/boto
boto/s3/key.py
22
82475
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Nexenta Systems Inc. # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the...
mit
DMCsys/smartalkaudio
oss-survey/xmms2-0.8DrO_o/doc/tutorial/python/tut2.py
1
1951
#!/usr/bin/env python # XMMS2 - X Music Multiplexer System # Copyright (C) 2003-2006 XMMS2 Team # # This library 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 2.1 of the Licens...
gpl-3.0
twilio/twilio-python
twilio/rest/preview/understand/assistant/task/sample.py
2
18621
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from twilio.base import deserialize from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base...
mit
gaddman/ansible
lib/ansible/modules/network/aci/aci_config_rollback.py
2
9612
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
tempbottle/kbengine
kbe/res/scripts/common/Lib/idlelib/ScrolledList.py
76
4159
from tkinter import * class ScrolledList: default = "(None)" def __init__(self, master, **options): # Create top frame, with scrollbar and listbox self.master = master self.frame = frame = Frame(master) self.frame.pack(fill="both", expand=1) self.vbar = vbar = Scrollba...
lgpl-3.0
cuilishen/cuilishenMissionPlanner
Lib/lib2to3/btm_utils.py
374
10011
"Utility functions used by the btm_matcher module" from . import pytree from .pgen2 import grammar, token from .pygram import pattern_symbols, python_symbols syms = pattern_symbols pysyms = python_symbols tokens = grammar.opmap token_labels = token TYPE_ANY = -1 TYPE_ALTERNATIVES = -2 TYPE_GROUP = -3 class MinNode(...
gpl-3.0
jjshoe/ansible-modules-core
network/eos/eos_command.py
5
5315
#!/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
jimi-c/ansible
lib/ansible/modules/monitoring/monit.py
102
7631
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Darryl Stoflet <stoflet@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_version': '1.1', ...
gpl-3.0
jeanlinux/calibre
src/calibre/gui2/tag_browser/model.py
11
60438
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import (unicode_literals, division, absolute_import, print_function) from future_builtins import map __license__ = 'GPL v3' __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'res...
gpl-3.0
qgis/QGIS
python/plugins/db_manager/db_plugins/oracle/plugin.py
29
22869
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS (Oracle) Date : Aug 27, 2014 copyright : (C) 2014 by Médéric RIBREUX email : meder...
gpl-2.0