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
amith01994/intellij-community
plugins/hg4idea/testData/bin/mercurial/setdiscovery.py
92
6894
# setdiscovery.py - improved discovery of common nodeset for mercurial # # Copyright 2010 Benoit Boissinot <bboissin@gmail.com> # and Peter Arrenbrecht <peter@arrenbrecht.ch> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from no...
apache-2.0
Saferman/cupper
structure/structure.py
1
1133
# -*- coding: utf-8 -*- from lib.color import * from lib.common import isLinuxSystem class meaningColor: def __init__(self): if isLinuxSystem(): self.getInput_Color = O #'\033[33m' self.normal_Color = W #'\033[0m' self.title_Color = P #'\033[31m' self.e...
lgpl-3.0
py-geek/sankalp-backend
venv/bin/activate_this.py
1076
1137
"""By using execfile(this_file, dict(__file__=this_file)) you will activate this virtualenv environment. This can be used when you must use an existing Python interpreter, not the virtualenv bin/python """ try: __file__ except NameError: raise AssertionError( "You must run this like execfile('path/to/...
gpl-2.0
buildbot/buildbot
master/buildbot/util/lineboundaries.py
5
3125
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
bbc/kamaelia
Code/Python/Kamaelia/Kamaelia/Apps/Grey/MailHandler.py
6
9204
# -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, Version 2.0 (the "Lic...
apache-2.0
jendap/tensorflow
tensorflow/python/ops/distributions/gamma.py
13
12177
# 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
jcollado/rabbithole
travis_pypi_setup.py
1
3757
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update encrypted deploy password in Travis config file """ from __future__ import print_function import base64 import json import os from getpass import getpass import yaml from cryptography.hazmat.primitives.serialization import load_pem_public_key from cryptography.h...
mit
xxsergzzxx/python-for-android
python3-alpha/python3-src/Lib/test/list_tests.py
53
16636
""" Tests common to list and UserList.UserList """ import sys import os from functools import cmp_to_key from test import support, seq_tests class CommonTest(seq_tests.CommonTest): def test_init(self): # Iterable arg is optional self.assertEqual(self.type2test([]), self.type2test()) # ...
apache-2.0
CTSRD-SOAAP/chromium-42.0.2311.135
tools/deps2git/git_tools.py
6
10469
#!/usr/bin/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 cStringIO import os import re import subprocess import sys import threading try: import git_cache except ImportError: for p...
bsd-3-clause
oliverlee/sympy
sympy/polys/domains/complexfield.py
93
3492
"""Implementation of :class:`ComplexField` class. """ from __future__ import print_function, division from sympy.core.numbers import Float, I from sympy.utilities import public from sympy.polys.domains.field import Field from sympy.polys.domains.simpledomain import SimpleDomain from sympy.polys.domains.characteristi...
bsd-3-clause
lunafeng/django
django/forms/models.py
72
54654
""" Helper functions for creating Form classes from Django models and database field objects. """ from __future__ import unicode_literals from collections import OrderedDict from itertools import chain from django.core.exceptions import ( NON_FIELD_ERRORS, FieldError, ImproperlyConfigured, ValidationError, ) fro...
bsd-3-clause
ContinuumIO/blaze
blaze/tests/test_interactive.py
3
11788
import textwrap import datetime import pickle import sys from types import MethodType from datashape import dshape from datashape.util.testing import assert_dshape_equal import pandas as pd import pandas.util.testing as tm import pytest import numpy as np from odo import into, append from odo.backends.csv import CSV ...
bsd-3-clause
baylee/django
tests/forms_tests/widget_tests/test_clearablefileinput.py
8
5038
from django.core.files.uploadedfile import SimpleUploadedFile from django.forms import ClearableFileInput from django.utils.encoding import python_2_unicode_compatible from .base import WidgetTest @python_2_unicode_compatible class FakeFieldFile(object): """ Quacks like a FieldFile (has a .url and unicode re...
bsd-3-clause
asridharan/dcos
packages/adminrouter/extra/src/test-harness/modules/mocker/jwt.py
13
4195
# Copyright (C) Mesosphere, Inc. See LICENSE file for details. """This module provides a set tools for generating JSON Web Tokens Attributes: AUTHTOKEN_LIFETIME_SECONDS (int): default token validity period, measured from time.time(), expressed in seconds """ import logging import time import...
apache-2.0
quinot/ansible
test/runner/lib/core_ci.py
12
17839
"""Access Ansible Core CI remote services.""" from __future__ import absolute_import, print_function import json import os import traceback import uuid import errno import time import shutil from lib.http import ( HttpClient, HttpResponse, HttpError, ) from lib.util import ( ApplicationError, ru...
gpl-3.0
kushalbhola/MyStuff
venv/Lib/site-packages/setuptools/command/install_lib.py
431
3840
import os import imp from itertools import product, starmap import distutils.command.install_lib as orig class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" def run(self): self.build() outfiles = self.install() if outfiles is not None: ...
apache-2.0
gbalme/OnlineGamingCoin
contrib/bitrpc/bitrpc.py
2348
7835
from jsonrpc import ServiceProxy import sys import string # ===== BEGIN USER SETTINGS ===== # if you do not set these you will be prompted for a password for every command rpcuser = "" rpcpass = "" # ====== END USER SETTINGS ====== if rpcpass == "": access = ServiceProxy("http://127.0.0.1:8332") else: access = Ser...
mit
rosswhitfield/mantid
Testing/SystemTests/tests/framework/ILLPowderD2BEfficiencyTest.py
3
2016
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
smallredbean/pgctl
tests/spec/fuser.py
1
1055
# pylint:disable=no-self-use from __future__ import absolute_import from __future__ import unicode_literals from testfixtures import ShouldRaise from testing.subprocess import assert_command def assert_does_not_find(path): assert_command( ('pgctl-fuser', path), '', '', 0, ) ...
mit
xuru/pyvisdk
pyvisdk/do/vm_suspending_event.py
1
1152
import logging from pyvisdk.exceptions import InvalidArgumentError ######################################## # Automatically generated, do not edit. ######################################## log = logging.getLogger(__name__) def VmSuspendingEvent(vim, *args, **kwargs): '''This event records a virtual machine susp...
mit
cakesultancm11/android_kernel_samsung_msm8660-common
tools/perf/python/twatch.py
3213
1338
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
divya-csekar/flask-microblog-server
flask/Lib/site-packages/sqlalchemy/ext/orderinglist.py
22
13816
# ext/orderinglist.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """A custom list that manages index/position information for contained elements....
bsd-3-clause
kubeflow/xgboost-operator
config/samples/smoke-dist/tracker.py
2
16512
""" Tracker script for DMLC Implements the tracker control protocol - start dmlc jobs - start ps scheduler and rabit tracker - help nodes to establish links with each other Tianqi Chen -------------------------- This was taken from https://github.com/dmlc/dmlc-core/blob/master/tracker/dmlc_tracker/tracker.py See LIC...
apache-2.0
m-kuhn/QGIS
python/plugins/processing/algs/qgis/SelectByExpression.py
12
3871
# -*- coding: utf-8 -*- """ *************************************************************************** SelectByExpression.py --------------------- Date : July 2014 Copyright : (C) 2014 by Michael Douchin ***********************************************************************...
gpl-2.0
Walt280/cosmos
code/graph-algorithms/breadth_first_search/breadth_first_search.py
5
1799
""" Part of Cosmos by OpenGenus Foundation""" import collections """ Wrapper function for the print function. Used as the default visitFunc for bfs """ def visitPrint(i): print(i) """ A class representing a undirected graph of nodes. An edge can be added between two nodes by calling addEdge ...
gpl-3.0
evanma92/routeh
flask/lib/python2.7/site-packages/sqlalchemy/sql/compiler.py
21
109634
# sql/compiler.py # Copyright (C) 2005-2015 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Base SQL and DDL compiler implementations. Classes provided include: :class:`.c...
bsd-3-clause
archesproject/arches
arches/app/utils/data_management/sparql_providers/aat_provider.py
1
5763
""" ARCHES - a program developed to inventory and manage immovable cultural heritage. Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund This program 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 Founda...
agpl-3.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/urllib3/util/url.py
203
6487
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] # We only want to normalize urls with an HTTP(S) scheme. # urllib3 infers URLs without a scheme (None) to be http. NORMALI...
gpl-3.0
LittleBun/ardupilot
mk/PX4/Tools/genmsg/scripts/genmsg_check_deps.py
216
2999
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2014, Open Source Robotics Foundation, 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: # # * Redistribut...
gpl-3.0
ananswam/bioscrape
tests/test_randomized_delay.py
1
3441
import warnings # We don't want warnings in dependencies to show up in bioscrape's tests. with warnings.catch_warnings(): warnings.simplefilter("ignore") import numpy as np import pylab as plt import random import pytest import test_utils from bioscrape.simulator import * from bioscrape.types impo...
mit
Gaia3D/QGIS
python/plugins/processing/algs/lidar/lastools/blast2demPro.py
9
3836
# -*- coding: utf-8 -*- """ *************************************************************************** blast2demPro.py --------------------- Date : October 2014 Copyright : (C) 2014 by Martin Isenburg Email : martin near rapidlasso point com **************...
gpl-2.0
JetChars/vim
vim/bundle/python-mode/pymode/libs3/rope/refactor/suites.py
75
4376
from rope.base import ast def find_visible(node, lines): """Return the line which is visible from all `lines`""" root = ast_suite_tree(node) return find_visible_for_suite(root, lines) def find_visible_for_suite(root, lines): if len(lines) == 1: return lines[0] line1 = lines[0] line2 ...
apache-2.0
dagss/numpy_svn
numpy/oldnumeric/matrix.py
88
1604
# This module is for compatibility only. __all__ = ['UserArray', 'squeeze', 'Matrix', 'asarray', 'dot', 'k', 'Numeric', 'LinearAlgebra', 'identity', 'multiply', 'types', 'string'] import types from user_array import UserArray, asarray import numpy.oldnumeric as Numeric from numpy.oldnumeric import dot, identity, mult...
bsd-3-clause
bdastur/pyvim
.vim/bundle/python-mode/pymode/libs3/rope/base/resourceobserver.py
91
10266
import os class ResourceObserver(object): """Provides the interface for observing resources `ResourceObserver`\s can be registered using `Project. add_observer()`. But most of the time `FilteredResourceObserver` should be used. `ResourceObserver`\s report all changes passed to them and they don...
apache-2.0
shreyasva/tensorflow
tensorflow/python/ops/linalg_ops.py
4
11307
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
jmartinm/InvenioAuthorLists
modules/websubmit/lib/functions/Move_Uploaded_Files_to_Storage.py
8
3024
## $Id: Move_Revised_Files_to_Storage.py,v 1.20 2009/03/26 13:48:42 jerome Exp $ ## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 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 Fo...
gpl-2.0
diego-plan9/beets
test/test_importfeeds.py
16
2214
# -*- coding: utf-8 -*- from __future__ import division, absolute_import, print_function import os import os.path import tempfile import shutil import unittest from beets import config from beets.library import Item, Album, Library from beetsplug.importfeeds import ImportFeedsPlugin class ImportfeedsTestTest(unitt...
mit
gnu3ra/SCC15HPCRepast
INSTALLATION/boost_1_54_0/tools/build/v2/test/test_rc.py
38
3914
#!/usr/bin/python # Copyright 2012 Jurko Gospodnetic # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # Tests rc toolset behaviour. import BoostBuild def included_resource_newer_than_rc_script(): """ W...
bsd-3-clause
smarthomeNG/smarthome
lib/scheduler.py
2
38055
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2011-2014 Marcus Popp marcus@popp.mx # Copyright 2016- Christian Straßburg # Copyright 2017 Bernd Meiners ...
gpl-3.0
jdreaver/vispy
examples/demo/gloo/imshow.py
18
3866
# -*- coding: utf-8 -*- # vispy: gallery 10 # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -----------------------------------------------------...
bsd-3-clause
chme/plugin.audio.mpdclient2
mpdclient/Env.py
1
1666
# # Copyright (c) chme # # This file is part of the mpdclient kodi plugin # # This plugin 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
svenstaro/ansible
contrib/inventory/vmware_inventory.py
7
25984
#!/usr/bin/env python # Requirements # - pyvmomi >= 6.0.0.2016.4 # TODO: # * more jq examples # * optional folder heriarchy """ $ jq '._meta.hostvars[].config' data.json | head { "alternateguestname": "", "instanceuuid": "5035a5cd-b8e8-d717-e133-2d383eb0d675", "memoryhotaddenabled": false, "guestfullna...
gpl-3.0
rwl/muntjac
muntjac/ui/drag_and_drop_wrapper.py
1
9479
# @MUNTJAC_COPYRIGHT@ # @MUNTJAC_LICENSE@ from muntjac.event.transferable_impl import TransferableImpl from muntjac.event.dd.drag_source import IDragSource from muntjac.event.dd.drop_target import IDropTarget from muntjac.event.dd.target_details_impl import TargetDetailsImpl from muntjac.ui.html5_file import Html5File...
apache-2.0
axbaretto/beam
sdks/python/.tox/lint/lib/python2.7/site-packages/google/protobuf/internal/message_set_extensions_pb2.py
42
8373
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/protobuf/internal/message_set_extensions.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from goo...
apache-2.0
nanolearning/edx-platform
lms/envs/cms/microsite_test.py
51
1387
""" This is a localdev test for the Microsite processing pipeline """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=W0401, W0614 from .dev import * from ..dev import ENV_ROOT, FEATURES MICROSITE_CONFIGURATION = { "opene...
agpl-3.0
marcelocure/django
tests/test_runner/test_discover_runner.py
210
6196
import os from contextlib import contextmanager from unittest import TestSuite, TextTestRunner, defaultTestLoader from django.test import TestCase from django.test.runner import DiscoverRunner @contextmanager def change_cwd(directory): current_dir = os.path.abspath(os.path.dirname(__file__)) new_dir = os.pat...
bsd-3-clause
sdgdsffdsfff/task-worker
src/python/Sailing/libs/selenium/webdriver/support/event_firing_webdriver.py
2
12560
#!/usr/bin/python # # Copyright 2011 Software Freedom Conservancy. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
bsd-2-clause
QLGu/django-oscar
src/oscar/apps/basket/forms.py
26
10178
from django import forms from django.conf import settings from django.forms.models import modelformset_factory, BaseModelFormSet from django.db.models import Sum from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_model from oscar.forms import widgets Line = get_model('basket', ...
bsd-3-clause
LeoZ123/Machine-Learning-Practice
Support_Vector_Machine(SVM)/SVM_Example.py
1
1872
''' Created on Mar 16, 2017 @author: Leo Zhong ''' print(__doc__) import numpy as np #for calculation import pylab as pl #for plot from sklearn import svm # create 40 separable points np.random.seed(0) #generate the same random num X = np.r_[np.random.randn(20, 2) - [2, 2], np.random.randn(20, 2) + [2, 2]] Y = [0] *...
mit
yanheven/nova
nova/tests/unit/virt/vmwareapi/test_imagecache.py
43
12269
# Copyright (c) 2014 VMware, 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 a...
apache-2.0
kalxas/QGIS
tests/src/python/test_qgssymbollayer_createsld.py
30
61494
""" *************************************************************************** test_qgssymbollayer_createsld.py --------------------- Date : July 2016 Copyright : (C) 2016 by Andrea Aime Email : andrea dot aime at geosolutions dot it ***********************...
gpl-2.0
yoer/hue
desktop/core/ext-py/pysaml2-2.4.0/example/idp2_repoze/modules/root.mako.py
31
4279
# -*- encoding:utf-8 -*- from mako import runtime, filters, cache UNDEFINED = runtime.UNDEFINED __M_dict_builtin = dict __M_locals_builtin = locals _magic_number = 6 _modified_time = 1357242050.211483 _template_filename=u'templates/root.mako' _template_uri=u'root.mako' _template_cache=cache.Cache(__name__, _modified_ti...
apache-2.0
knighton/mapreduce
mrdomino/map_one_shard.py
1
4762
import json import math import itertools from os.path import join as path_join from subprocess import Popen, PIPE from mrdomino import logger, get_instance, protocol from mrdomino.util import create_cmd, open_input def each_input_line(input_files, shard, n_shards): # assign slices of each file to shards. slic...
mit
jhawkesworth/ansible-modules-core
files/xattr.py
39
6290
#!/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 distributed...
gpl-3.0
tic-ull/defensatfc-proto
tfc_webapps/packages/suds-timestamp/suds/bindings/__init__.py
1
1399
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
agpl-3.0
mkret2/root
tutorials/pyroot/hsum.py
7
2238
## \file ## \ingroup tutorial_pyroot ## Simple example illustrating how to use the C++ interpreter ## ## \macro_image ## \macro_code ## ## \author Wim Lavrijsen from ROOT import TCanvas, TH1F, TSlider from ROOT import gROOT, gBenchmark, gRandom # Create a new canvas, and customize it. c1 = TCanvas( 'c1', 'The HSUM ex...
lgpl-2.1
ar45/mysql-connector-python
tests/test_network.py
7
17515
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptio...
gpl-2.0
karllessard/tensorflow
tensorflow/lite/micro/examples/magic_wand/train/train.py
12
7021
# Lint as: python3 # Copyright 2019 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 ...
apache-2.0
O4siang/SDN_GUI
main.py
1
1380
# -*- coding: utf-8 -*- from flask import Flask from flask import render_template, jsonify, request, g, abort, redirect, url_for from rest import Rest import json app = Flask(__name__) global_flow_table = {} # mainpage @app.route("/") def main(): print "test" sw_desc = Rest.get_switch_desc() print sw_de...
mit
moijes12/oh-mainline
vendor/packages/oauthlib/oauthlib/oauth2/rfc6749/endpoints/base.py
87
1729
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals import functools import logging from ..errors import TemporarilyUnavailableE...
agpl-3.0
tetravision/Test
stem/interpreter/__init__.py
1
3979
# Copyright 2015, Damian Johnson and The Tor Project # See LICENSE for licensing information """ Interactive interpreter for interacting with Tor directly. This adds usability features such as tab completion, history, and IRC-style functions (like /help). """ __all__ = [ 'arguments', 'autocomplete', 'commands',...
lgpl-3.0
dc3-plaso/dfvfs
tests/vfs/fvde_file_entry.py
1
4808
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the file entry implementation using pyfvde.""" import unittest from dfvfs.path import fvde_path_spec from dfvfs.path import os_path_spec from dfvfs.path import qcow_path_spec from dfvfs.path import tsk_partition_path_spec from dfvfs.resolver import context from d...
apache-2.0
MenZil/kuma
vendor/packages/pygments/lexers/ruby.py
72
22142
# -*- coding: utf-8 -*- """ pygments.lexers.ruby ~~~~~~~~~~~~~~~~~~~~ Lexers for Ruby and related languages. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import Lexer, RegexLexer, ExtendedRegexLexer, ...
mpl-2.0
mohierf/mod-webui
module/plugins/minemap/minemap.py
1
2420
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Mohier Frederic frederic.mohier@gmail.com # Karfusehr Andreas, frescha@unitedseed.de # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
Root-Box/external_chromium
testing/gmock/test/gmock_test_utils.py
222
3579
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
f123h456/gumbo-parser
python/gumbo/html5lib_adapter.py
12
5095
# Copyright 2012 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
liqin75/vse-vpnaas-plugin
vpn-resttest/vpn.py
1
10329
#!/usr/bin/python import json import sys import os import lib vpnService = lib.qService + '/vpn' tenantId="202e69af6fc14e449744140034f977e5" edgeUri = "10.117.35.38" edgeId = 'edge-1' edgeUser = 'admin' edgePasswd = 'default' def createSite(tenant_id, subnet_id, name, description, local_endpoint, local_id, p...
apache-2.0
davidcusatis/ursula
library/neutron_router_interface.py
6
8536
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansibleworks.com> # # This module 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 l...
mit
ageron/tensorflow
tensorflow/python/profiler/pprof_profiler.py
109
15280
# 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
maciek263/django2
myvenv/Lib/site-packages/gunicorn/sock.py
26
6999
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import errno import os import socket import stat import sys import time from gunicorn import util from gunicorn.six import string_types SD_LISTEN_FDS_START = 3 class BaseSocket(object): ...
mit
kalrey/swift
swift/common/middleware/tempauth.py
3
29561
# Copyright (c) 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
bdh1011/cupeye
venv/lib/python2.7/site-packages/setuptools/command/bdist_rpm.py
1049
1508
import distutils.command.bdist_rpm as orig class bdist_rpm(orig.bdist_rpm): """ Override the default bdist_rpm behavior to do the following: 1. Run egg_info to ensure the name and version are properly calculated. 2. Always run 'install' using --single-version-externally-managed to disable eggs...
bsd-3-clause
dturner-tw/pants
tests/python/pants_test/backend/python/test_pants_requirement.py
17
1738
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.p...
apache-2.0
windskyer/mvpn
mvpn/db/sqlalchemy/migrate_repo/versions/002_add_cui_table.py
1
1480
from sqlalchemy import * from migrate import * def _create_cui_table(migrate_engine, drop=False): meta = MetaData() meta.bind = migrate_engine cui = Table('cui', meta, Column('clientipaddress', VARCHAR(15), primary_key=True, nullable=False, server_default=''), Column('callin...
gpl-2.0
FRidh/Sea
Sea/adapter/components/Component1DBeam.py
2
2237
""" Adapter class for :class:`Sea.model.components.Component1DBeam` """ import Sea from ComponentStructural import ComponentStructural from ..subsystems import SubsystemStructuralLong, SubsystemStructuralBend, SubsystemStructuralShear class SubsystemLong(SubsystemStructuralLong, Sea.model.components.Component1DBeam.S...
bsd-3-clause
dmsurti/mayavi
mayavi/modules/labels.py
3
7916
# Author: Prabhu Ramachandran <prabhu [at] aero . iitb . ac . in> # Copyright (c) 2008, Enthought, Inc. # License: BSD Style. # Standard library imports. # Enthought library imports. from traits.api import Int, Instance, Str, TraitError from traitsui.api import View, Group, Item from tvtk.api import tvtk from apptool...
bsd-3-clause
AnhellO/DAS_Sistemas
Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/django/contrib/redirects/middleware.py
109
1926
from django.apps import apps from django.conf import settings from django.contrib.redirects.models import Redirect from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponseGone, HttpResponsePermanentRedirect from django.utils...
mit
wdsgyj/google-breakpad-mirror
src/tools/gyp/test/lib/TestGyp.py
112
39996
# 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. """ TestGyp.py: a testing framework for GYP integration tests. """ import collections import itertools import os import re import shutil import stat import subpr...
bsd-3-clause
smok-serwis/bunia
bunia/output/base.py
1
1698
import base64 def transcode_output(data, form, dtype='binary'): """ Transcode data (bytes) to target form :param data: binary data :param form: one of 'text', 'html', 'raw', 'base64', 'ascii' :param dtype: one of 'binary' or 'text' """ if form not in ('text', 'html', 'raw', 'base64', 'asc...
mit
nervenXC/topical_word_embeddings
TWE-2/last_last_step.py
3
1257
#!/usr/bin/env python2 #-*- coding: UTF-8 -*- #File: #Date: #Author: Yang Liu <largelymfs@gmail.com> #Description: if __name__=="__main__": with open("test.log","w") as logout, open("result.out") as f, open("result.out.out","w") as fout, open("log.txt") as log: #log loading content2id = {} ...
mit
bhargav2408/python-for-android
python-build/python-libs/gdata/src/gdata/books/service.py
136
11339
#!/usr/bin/python """ Extend gdata.service.GDataService to support authenticated CRUD ops on Books API http://code.google.com/apis/books/docs/getting-started.html http://code.google.com/apis/books/docs/gdata/developers_guide_protocol.html TODO: (here and __init__) * search based on label...
apache-2.0
sekikn/incubator-airflow
airflow/providers/amazon/aws/example_dags/example_datasync_2.py
10
3774
# 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
yyt030/pyzmq
zmq/tests/test_ioloop.py
27
3521
# Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import time import os import threading import zmq from zmq.tests import BaseZMQTestCase from zmq.eventloop import ioloop from zmq.eventloop.minitornado.ioloop import _Timeout try: from tornado.ioloop import PollIOLoop, IOL...
bsd-3-clause
lepture/pythondotorg
jobs/urls.py
8
1590
from django.conf.urls import url from django.views.generic import TemplateView from . import views from . import feeds urlpatterns = [ url(r'^$', views.JobList.as_view(), name='job_list'), url(r'^feed/rss/$', feeds.JobFeed(), name='job_rss'), url(r'^create/$', views.JobCreate.as_view(), name='job_create')...
apache-2.0
meteorfox/PerfKitBenchmarker
tests/integration/gcp_disk_integration_test.py
5
3009
# Copyright 2015 PerfKitBenchmarker 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 appli...
apache-2.0
neogeographica/quakesounds
bundled_modules/pkg_resources.py
15
101430
"""Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipula...
gpl-3.0
mafiya69/sympy
sympy/combinatorics/subsets.py
86
15802
from __future__ import print_function, division from itertools import combinations from sympy.core import Basic from sympy.combinatorics.graycode import GrayCode from sympy.core.compatibility import range class Subset(Basic): """ Represents a basic subset object. We generate subsets using essentially t...
bsd-3-clause
Lilykos/invenio
invenio/celery/testsuite/helpers.py
19
1769
# -*- 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 (at your option) any later...
gpl-2.0
agry/NGECore2
scripts/mobiles/dathomir/shear_mite_broodling.py
2
1557
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate() mobi...
lgpl-3.0
li-xinyang/FSND_P2_TournamentResults
tournament/tournament.py
1
2214
#!/usr/bin/env python # # tournament.py -- implementation of a Swiss-system tournament # import psycopg2 def connect(): """Connect to the PostgreSQL database. Returns a database connection.""" return psycopg2.connect("dbname=tournament") def deleteMatches(): """Remove all the match records from the da...
mit
avanov/django
tests/extra_regress/models.py
166
1368
from __future__ import unicode_literals import copy import datetime from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class RevisionableModel(models.Model): base = models.ForeignKey('self', null=Tru...
bsd-3-clause
big-pegasus/spark
examples/src/main/python/mllib/logistic_regression.py
85
1826
# # 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
ksmaheshkumar/pysecdump
wpc/users.py
6
1807
from wpc.user import user import win32net import wpc.conf class users(): def __init__(self): self.users = [] def get_filtered(self, ): if self.users == []: #try: level = 1 resume = 0 while True: userlist, total, r...
gpl-3.0
liu602348184/django
tests/model_inheritance/models.py
99
4729
""" XX. Model inheritance Model inheritance exists in two varieties: - abstract base classes which are a way of specifying common information inherited by the subclasses. They don't exist as a separate model. - non-abstract base classes (the default), which are models in their own right with ...
bsd-3-clause
muffinresearch/olympia
apps/addons/helpers.py
17
10485
import jinja2 from jingo import register from tower import ugettext as _ from . import buttons from amo.utils import chunked register.function(buttons.install_button) register.function(buttons.big_install_button) register.function(buttons.mobile_install_button) @register.filter @jinja2.contextfilter def statusfla...
bsd-3-clause
kawamon/hue
desktop/core/ext-py/thrift-0.13.0/src/transport/TTransport.py
13
13205
# # 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
Elbagoury/odoo
addons/account_payment/report/payment_order.py
378
2974
# -*- 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
uranusjr/django
django/urls/conf.py
90
2946
"""Functions for use in URLsconfs.""" from functools import partial from importlib import import_module from django.core.exceptions import ImproperlyConfigured from .resolvers import ( LocalePrefixPattern, RegexPattern, RoutePattern, URLPattern, URLResolver, ) def include(arg, namespace=None): app_name = No...
bsd-3-clause
kennethgillen/ansible
lib/ansible/modules/cloud/vmware/vmware_datacenter.py
70
5245
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
QianBIG/odoo
addons/auth_ldap/__init__.py
442
1049
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Publ...
agpl-3.0