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
pbaesse/Sissens
lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/array.py
32
10320
# postgresql/array.py # Copyright (C) 2005-2017 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 from .base import ischema_names from ...sql import expression, operators from .....
gpl-3.0
youdonghai/intellij-community
python/lib/Lib/site-packages/django/contrib/syndication/feeds.py
245
1367
from django.contrib.syndication import views from django.core.exceptions import ObjectDoesNotExist import warnings # This is part of the deprecated API from django.contrib.syndication.views import FeedDoesNotExist, add_domain class Feed(views.Feed): """Provided for backwards compatibility.""" def __init__(sel...
apache-2.0
ravindrapanda/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/independent_test.py
20
6751
# 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
zerobatu/edx-platform
common/test/acceptance/tests/studio/test_studio_library.py
19
27414
""" Acceptance tests for Content Libraries in Studio """ from ddt import ddt, data from nose.plugins.attrib import attr from flaky import flaky from .base_studio_test import StudioLibraryTest from ...fixtures.course import XBlockFixtureDesc from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.utils ...
agpl-3.0
pombredanne/pyjs
examples/clickablerootpanel/ClickableRootPanel.py
11
4034
import pyjd # this is dummy in pyjs. from pyjamas.ui.RootPanel import RootPanelCls, RootPanel, manageRootPanel from pyjamas.ui.Button import Button from pyjamas.ui.FocusPanel import FocusPanel from pyjamas.ui.KeyboardListener import KeyboardHandler from pyjamas.ui.ClickListener import ClickHandler from pyjamas.ui.HTML...
apache-2.0
Edu-Glez/Bank_sentiment_analysis
env/lib/python3.6/site-packages/jupyter_client/ioloop/restarter.py
12
1684
"""A basic in process kernel monitor with autorestarting. This watches a kernel's state using KernelManager.is_alive and auto restarts the kernel if it dies. """ #----------------------------------------------------------------------------- # Copyright (c) The Jupyter Development Team # # Distributed under the term...
apache-2.0
dot-bob/Marlin
buildroot/share/atom/create_custom_upload_command_DFU.py
45
1370
# # Builds custom upload command # 1) Run platformio as a subprocess to find a COM port # 2) Build the upload command # 3) Exit and let upload tool do the work # # This script runs between completion of the library/dependencies installation and compilation. # # Will continue on if a COM port isn't found so ...
gpl-3.0
algiopensource/l10n-spain
l10n_es_aeat_mod115/__openerp__.py
7
1562
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution. # # 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 Sof...
agpl-3.0
Meriipu/quodlibet
quodlibet/commands.py
2
14557
# Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna, # 2011-2020 Nick Boultbee # 2014 Christoph Reiter # # 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 ve...
gpl-2.0
ariegg/webiopi-drivers
chips/sensor/ina219/ina219.py
1
22877
# Copyright 2017 Andreas Riegg - t-h-i-n-x.net # # 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...
apache-2.0
mhorn71/StarbaseMini
instument_builder/builder.py
1
1671
__author__ = 'mark' # StarbaseMini Staribus/Starinet Client for the British Astronomical Association Staribus Protocol # Copyright (C) 2015 Mark Horn # # This file is part of StarbaseMini. # # StarbaseMini is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-2.0
ga4gh/server
tests/end_to_end/server.py
4
7044
""" Servers to assist in testing """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import tempfile import shlex import subprocess import socket import requests import ga4gh.common.utils as utils ga4ghPort = 8001 remotePort = 8002 oidcOp...
apache-2.0
assumptionsoup/pymel
tests/test_trees.py
8
11955
from pymel.util.testing import TestCase, setupUnittestModule import pymel.util.trees as trees class testCase_typeTrees(TestCase): def setUp(self): self.types = ('dependNode', ('FurAttractors', ('FurCurveAttractors', 'FurDescription', 'FurGlobals'), 'abstractBaseCreate')) self.tree = trees.Tree( *(s...
bsd-3-clause
mganeva/mantid
Framework/PythonInterface/test/python/plugins/algorithms/WorkflowAlgorithms/SANSILLReductionTest.py
1
6050
# 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 # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
gpl-3.0
darkleons/lama
openerp/modules/registry.py
24
18403
# -*- 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 GNU...
agpl-3.0
vadimtk/chrome4sdp
third_party/markdown/extensions/meta.py
109
4514
# markdown is released under the BSD license # Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later) # Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b) # Copyright 2004 Manfred Stienstra (the original version) # # All rights reserved. # # Redistribution and use in source and binary forms, with or...
bsd-3-clause
CyanogenMod/android_external_chromium_org
tools/android/adb_profile_chrome/trace_packager.py
9
2760
# Copyright 2014 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 gzip import json import os import shutil import sys import zipfile from adb_profile_chrome import util from pylib import constants sys.path.append(...
bsd-3-clause
laanwj/bitcoin
test/functional/feature_filelock.py
22
2522
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Check that it's not possible to start a second bitcoind instance using the same datadir or wallet.""" i...
mit
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/networkx/utils/tests/test_decorators.py
10
4337
import tempfile import os from nose.tools import * import networkx as nx from networkx.utils.decorators import open_file,require,not_implemented_for def test_not_implemented_decorator(): @not_implemented_for('directed') def test1(G): pass test1(nx.Graph()) @raises(KeyError) def test_not_implemen...
agpl-3.0
crosswalk-project/chromium-crosswalk-efl
tools/metrics/actions/print_style.py
72
1380
# Copyright 2014 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. """Holds the constants for pretty printing actions.xml.""" import os import sys # Import the metrics/common module for pretty print xml. sys.path.append(os...
bsd-3-clause
openstack/tempest
tempest/cmd/cleanup_service.py
1
39207
# Copyright 2015 Dell 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...
apache-2.0
Smarsh/django
django/contrib/admin/models.py
106
2135
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.auth.models import User from django.contrib.admin.util import quote from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode from django.utils.safestring import mark...
bsd-3-clause
Orav/kbengine
kbe/src/lib/python/Lib/test/test_pep3120.py
2
1318
# This file is marked as binary in the CVS, to prevent MacCVS from recoding it. import unittest from test import support class PEP3120Test(unittest.TestCase): def test_pep3120(self): self.assertEqual( "Питон".encode("utf-8"), b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd' ...
lgpl-3.0
navodissa/python-flask
flask/lib/python2.7/site-packages/sqlalchemy/orm/strategies.py
32
54293
# orm/strategies.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 """sqlalchemy.orm.interfaces.LoaderStrategy implementations, and related Mapper...
bsd-3-clause
aoom/pattern
docs/update.py
21
5101
#### DOCUMENTATION GENERATOR ########################################################################## # Keeps the offline documention in synch with the online documentation. # Simply run "python update.py" to generate the latest version. import os, sys; sys.path.insert(0, os.path.join("..")) import codecs import re ...
bsd-3-clause
SVoxel/R7800
git_home/samba.git/third_party/pep8/testsuite/W19.py
34
2637
#: W191 if False: print # indented with 1 tab #: #: W191 y = x == 2 \ or x == 3 #: E101 W191 if ( x == ( 3 ) or y == 4): pass #: E101 W191 if x == 2 \ or y > 1 \ or x == 3: pass #: E101 W191 if x == 2 \ or y > 1 \ or x == 3: pass #: #: E101 W191 i...
gpl-2.0
haihala/modman
cli.py
1
12445
#!/usr/bin/env python3 try: import requests except ImportError: print("It looks like requests is not installed.") print("Try: pip3 install requests") exit(1) import os import sys import subprocess from getpass import getpass import mod_manager from mod_manager import server from mod_manager.exception...
mit
Intel-Corporation/tensorflow
tensorflow/python/ops/ragged/ragged_eager_test.py
13
1953
# Copyright 2018 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
pybel/pybel
tests/test_struct/test_node_utils.py
1
4775
# -*- coding: utf-8 -*- """Tests for node utilities.""" import unittest from pybel import BELGraph from pybel.constants import INCREASES from pybel.dsl import ComplexAbundance as g, CompositeAbundance as c, Protein, Reaction from pybel.examples.various_example import adp, atp, glucose, glucose_6_phosphate, hk1, phos...
mit
awesto/django-shop
shop/transition.py
1
3695
from urllib.parse import urlparse from django.contrib.auth.models import AnonymousUser from django.db import models from django.http.request import HttpRequest from post_office import mail from post_office.models import EmailTemplate from shop.conf import app_settings from shop.models.order import BaseOrder from shop....
bsd-3-clause
chanceraine/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/legend.py
69
30705
""" Place a legend on the axes at location loc. Labels are a sequence of strings and loc can be a string or an integer specifying the legend location The location codes are 'best' : 0, (only implemented for axis legends) 'upper right' : 1, 'upper left' : 2, 'lower left' : 3, 'lower right' : 4...
agpl-3.0
naokimiyasaka/sublime-text
Backup/20140106101518/BracketHighlighter/bh_swapping.py
15
1471
import sublime import sublime_plugin import bh_wrapping class SwapBrackets(bh_wrapping.WrapBrackets): def wrap(self, wrap_entry): if wrap_entry < 0: return self._style = ["inline"] self.brackets = self._brackets[wrap_entry] self.wrap_brackets(0) class SwapBracketsCo...
mit
stevewardle/rose
metomi/rosie/db_create.py
4
8364
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (C) 2012-2019 British Crown (Met Office) & Contributors. # # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under t...
gpl-3.0
jiobert/python
Gildner_Tyler/Assignments/registration copy/server.py
2
1324
from flask import Flask, render_template, request, redirect, session, flash import re EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$') app = Flask(__name__) app.secret_key = '123456' @app.route('/', methods=['GET']) def index(): return render_template('index.html') @app.route('/process...
mit
vhanla/CudaText
app/py/sys/chardet/sbcharsetprober.py
269
5657
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
mpl-2.0
dongjoon-hyun/spark
python/pyspark/mllib/tests/test_feature.py
23
7216
# # 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
nuncjo/odoo
addons/project_issue_sheet/__init__.py
442
1105
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
BengtOFFIS/simpy
docs/examples/code/carwash.py
2
2869
""" Carwash example. Covers: - Waiting for other processes - Resources: Resource Scenario: A carwash has a limited number of washing machines and defines a washing processes that takes some (random) time. Car processes arrive at the carwash at a random time. If one washing machine is available, they start t...
mit
FreeScienceCommunity/or-tools
examples/python/data/nonogram_regular/nonogram_t2.py
74
1134
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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
UKPLab/semeval2017-scienceie
code/convNet.py
1
7292
#!/usr/bin/python # -*- coding: UTF-8 -*- from extras import VSM, read_and_map from representation import VeryStupidCBOWMapper, CharMapper import sys, numpy as np,os from sklearn.linear_model import LogisticRegression from sklearn.metrics import confusion_matrix from sklearn.metrics import precision_recall_fscore_sup...
apache-2.0
fernandezcuesta/ansible
test/units/modules/network/vyos/vyos_module.py
56
3257
# (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 # (at your option) any later version. # # Ansible is dis...
gpl-3.0
massmutual/pystruct
examples/plot_exact_learning.py
5
1333
""" ========================================= Efficient exact learning of 1-slack SSVMs ========================================= This example illustrates the role of approximate inference and caching in exact learning of a 1-slack SSVM. Please see plot_objetive_curve.py for an interpretation of the curves. We start...
bsd-2-clause
Coolexe/shooter-ics-crc-3.0.16-294f767
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
JaneliaSciComp/Neuroptikon
Source/library/library.py
1
1804
# Copyright (c) 2010 Howard Hughes Medical Institute. # All rights reserved. # Use is subject to Janelia Farm Research Campus Software Copyright 1.1 license terms. # http://license.janelia.org/license/jfrc_copyright_1_1.html from library_item import LibraryItem from library_frame import LibraryFrame from pydispatc...
bsd-3-clause
3bot/3bot-hook
threebot_hook/models.py
1
1773
# -*- coding: utf-8 -*- from django import dispatch from django.contrib.sites.models import Site from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from rest_framework.authtoken.models import Token from threebot.models imp...
bsd-3-clause
borg-project/borg
borg/tools/get_features.py
1
2297
"""@author: Bryan Silverthorn <bcs@cargo-cult.org>""" import os.path import csv import borg import borg.distributors logger = borg.get_logger(__name__, default_level = "INFO") def features_for_path(domain, task_path): # bring back relevant globals import os.path import borg logger = borg.get_logger(...
mit
mzizzi/ansible
lib/ansible/module_utils/facts/system/python.py
232
1999
# 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 in the hope that ...
gpl-3.0
Mirantis/openstack-dashboard
django-openstack/src/django_openstack/syspanel/views/services.py
3
2699
# vim: tabstop=4 shiftwidth=4 softtabstop=4 from django import template from django import http from django.conf import settings from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.shortcuts import redirect from django.utils.translation import ugettext ...
apache-2.0
jythontools/pip
tests/unit/test_appdirs.py
10
10052
import ntpath import os import posixpath import sys import pretend from pip.utils import appdirs class TestUserCacheDir: def test_user_cache_dir_win(self, monkeypatch): @pretend.call_recorder def _get_win_folder(base): return "C:\\Users\\test\\AppData\\Local" monkeypatch.se...
mit
egraba/vbox_openbsd
VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/batch/regen_sched_queues.py
3
4295
#!/usr/bin/env python # -*- coding: utf-8 -*- # $Id: regen_sched_queues.py $ # pylint: disable=C0301 """ Interface used by the admin to regenerate scheduling queues. """ __copyright__ = \ """ Copyright (C) 2012-2015 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http:...
mit
girving/tensorflow
tensorflow/contrib/distribute/python/input_ops_test.py
7
9593
# Copyright 2018 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
ArthurGarnier/SickRage
lib/sqlalchemy/dialects/mysql/mysqldb.py
75
3479
# mysql/mysqldb.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 """ .. dialect:: mysql+mysqldb :name: MySQL-Python :dbapi: mysqldb :conn...
gpl-3.0
nanolearning/edx-platform
common/djangoapps/course_modes/models.py
10
4686
""" Add and create new modes for running courses on this particular LMS """ import pytz from datetime import datetime from django.db import models from collections import namedtuple from django.utils.translation import ugettext as _ from django.db.models import Q from xmodule_django.models import CourseKeyField Mode...
agpl-3.0
isrohutamahopetechnik/MissionPlanner
Lib/site-packages/numpy/ma/tests/test_extras.py
76
33410
# pylint: disable-msg=W0611, W0612, W0511 """Tests suite for MaskedArray. Adapted from the original test_ma by Pierre Gerard-Marchant :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ __author__ = "Pierre GF Gerard-Marchant ($...
gpl-3.0
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/terminal/nxos.py
7
1916
# # (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 # (at your option) any later version. # # Ansible is d...
bsd-3-clause
djbaldey/django
tests/template_tests/filter_tests/test_make_list.py
345
1611
from django.template.defaultfilters import make_list from django.test import SimpleTestCase from django.test.utils import str_prefix from django.utils.safestring import mark_safe from ..utils import setup class MakeListTests(SimpleTestCase): """ The make_list filter can destroy existing escaping, so the resu...
bsd-3-clause
caisq/tensorflow
tensorflow/tools/common/public_api.py
71
4753
# 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
a-parhom/edx-platform
openedx/core/lib/api/serializers.py
24
2557
""" Serializers to be used in APIs. """ from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import CourseKey, UsageKey from rest_framework import serializers class CollapsedReferenceSerializer(serializers.HyperlinkedModelSerializer): """Serializes arbitrary models in a collapsed format, with just a...
agpl-3.0
ThirdProject/android_external_chromium_org
build/linux/rewrite_dirs.py
259
2013
#!/usr/bin/env python # Copyright (c) 2011 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. """Rewrites paths in -I, -L and other option to be relative to a sysroot.""" import sys import os import optparse REWRITE_PREFIX ...
bsd-3-clause
iptvgratis/iptv.stalker.latino
resources/regex/dinozap.py
2
4482
# -*- coding: utf-8 -*- #------------------------------------------------------------ # beta.1 Regex de Dinozap # Version 0.1 (17.10.2014) #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Gracias a la librería plugintools de Jesús (www.mimediacent...
gpl-3.0
Southpaw-TACTIC/TACTIC
src/context/client/tactic-api-python-4.0.api04/Lib/encodings/cp424.py
93
12618
""" Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,i...
epl-1.0
thiblahute/pygobject
gi/_glib/option.py
3
13195
# -*- Mode: Python -*- # pygobject - Python bindings for the GObject library # Copyright (C) 2006 Johannes Hoelzl # # glib/option.py: GOption command line parser # # 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 th...
lgpl-2.1
martinbuc/missionplanner
Lib/encodings/punycode.py
93
7051
# -*- coding: iso-8859-1 -*- """ Codec for the Punicode encoding, as specified in RFC 3492 Written by Martin v. Löwis. """ import codecs ##################### Encoding ##################################### def segregate(str): """3.1 Basic code point segregation""" base = [] extended = {} ...
gpl-3.0
fnkhan/second
utils/ovxctl.py
4
38336
#!/usr/bin/env python # OpenVirteX control script # Heavily based on FlowVisor's fvctl #import python utilities to parse arguments import sys from optparse import OptionParser import urllib2 import json import getpass VERSION = '0.1' SUPPORTED_PROTO = ['tcp'] def getUrl(opts, path): return URL % (opts.host, o...
apache-2.0
40023154/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/jqueryui/__init__.py
603
3671
"""Wrapper around the jQuery UI library Exposes a single object, jq, to manipulate the widgets designed in the library This object supports : - subscription : js[elt_id] returns an object matching the element with the specified id - a method get(**kw). The only keyword currently supported is "selector". The metho...
gpl-2.0
Darkmer/masterchief
CourseBuilderenv/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/_base.py
310
6919
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type, string_types import gettext _ = gettext.gettext from xml.dom import Node DOCUMENT = Node.DOCUMENT_NODE DOCTYPE = Node.DOCUMENT_TYPE_NODE TEXT = Node.TEXT_NODE ELEMENT = Node.ELEMENT_NODE COMMENT = Node.COMMENT_N...
mit
zubron/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/__init__.py
552
8263
# 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...
mpl-2.0
mrquim/mrquimrepo
repo/plugin.video.live.streamspro/pyaes.py
189
16661
"""Simple AES cipher implementation in pure Python following PEP-272 API Homepage: https://bitbucket.org/intgr/pyaes/ The goal of this module is to be as fast as reasonable in Python while still being Pythonic and readable/understandable. It is licensed under the permissive MIT license. Hopefully the code is readabl...
gpl-2.0
samkariu/nairobi-routes
boilerplate/external/babel/messages/tests/catalog.py
61
10694
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software cons...
mit
ivyl/patchwork
patchwork/migrations/0016_add_delegation_rule_model.py
2
1136
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('patchwork', '0015_remove_version_n_patche...
gpl-2.0
dgjustice/ansible
lib/ansible/modules/network/openswitch/_ops_template.py
16
7218
#!/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
DazWorrall/ansible
test/units/module_utils/test_database.py
178
4377
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
mglukhikh/intellij-community
python/lib/Lib/encodings/cp852.py
593
35258
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,errors='strict'): ...
apache-2.0
DirkHoffmann/indico
indico/modules/events/logs/util.py
4
6839
# This file is part of Indico. # Copyright (C) 2002 - 2021 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. import re from datetime import datetime from difflib import SequenceMatcher from enum import Enum from ma...
gpl-3.0
SamHames/scikit-image
skimage/restoration/tests/test_denoise.py
1
5281
import numpy as np from numpy.testing import run_module_suite, assert_raises, assert_equal from skimage import restoration, data, color, img_as_float np.random.seed(1234) lena = img_as_float(data.lena()[:128, :128]) lena_gray = color.rgb2gray(lena) checkerboard_gray = img_as_float(data.checkerboard()) checkerboard...
bsd-3-clause
uTest/Androguard
elsim/tests/example_text_sim.py
9
3007
#!/usr/bin/env python # This file is part of Elsim. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # All rights reserved. # # Elsim 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 ve...
apache-2.0
p4datasystems/CarnotKE
jyhton/lib-python/2.7/lib2to3/pgen2/literals.py
399
1614
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Safely evaluate Python string literals without using eval().""" import re simple_escapes = {"a": "\a", "b": "\b", "f": "\f", "n": "\n", ...
apache-2.0
epssy/hue
desktop/core/ext-py/Django-1.6.10/tests/admin_filters/tests.py
49
35499
from __future__ import absolute_import, unicode_literals import datetime from django.contrib.admin import (site, ModelAdmin, SimpleListFilter, BooleanFieldListFilter) from django.contrib.admin.views.main import ChangeList from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User ...
apache-2.0
person142/scipy
scipy/optimize/tests/test_linprog.py
4
70340
""" Unit test for Linear Programming """ import sys import numpy as np from numpy.testing import (assert_, assert_allclose, assert_equal, assert_array_less, assert_warns, suppress_warnings) from pytest import raises as assert_raises from scipy.optimize import linprog, OptimizeWarning from sc...
bsd-3-clause
jirikuncar/invenio
invenio/modules/tags/restful.py
12
12420
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 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...
gpl-2.0
ChristianF88/CD3Waterbalance
Supplyvecs.py
3
84594
# -*- coding: utf-8 -*- """ Created on Thu Jan 22 11:25:43 2015 @author: Acer """ #10 Buildings 2 Cluster supplyvec=[[[[[[1,1,0,1,0],[1,1,1],1],[[1,1,0,1,0],[1,1,1],1],1],1]]] Catchattrvec=[[1,1.9,800,0.4,0.2,0.4,0.6,0.21,1.5,0.4,0.5,400,500,700,0.04,0.05,0.06,'without'],[1,1.9,800,0.4,0.2,0.4,0.6,0.21,1.5,0.4,0.5,40...
gpl-2.0
mbernasocchi/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
underbluewaters/marinemap
lingcod/common/s3.py
3
1613
""" Lingcod's custom S3 wrapper Provides some useful shortcuts to working with commom AWS S3 tasks """ from mimetypes import guess_type from boto.s3.connection import S3Connection from boto.s3.key import Key from django.conf import settings import os def s3_bucket(bucket=None): """ Shortcut to a boto s3 bucket...
bsd-3-clause
utilite2/linux-kernel
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
sv-dev1/odoo
addons/website/models/ir_ui_view.py
161
10904
# -*- coding: utf-8 -*- import copy from lxml import etree, html from openerp import SUPERUSER_ID, api from openerp.addons.website.models import website from openerp.http import request from openerp.osv import osv, fields class view(osv.osv): _inherit = "ir.ui.view" _columns = { 'page': fields.boolea...
agpl-3.0
resmo/ansible
contrib/inventory/spacewalk.py
28
8792
#!/usr/bin/env python """ Spacewalk external inventory script ================================= Ansible has a feature where instead of reading from /etc/ansible/hosts as a text file, it can query external programs to obtain the list of hosts, groups the hosts are in, and even variables to assign to each host. To use...
gpl-3.0
eeshangarg/zulip
zerver/lib/types.py
3
1896
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, Union from django.http import HttpResponse from django.utils.functional import Promise from typing_extensions import TypedDict ViewFuncT = TypeVar("ViewFuncT", bound=Callable[..., HttpResponse]) # See zerver/lib/validator.py for more details of ...
apache-2.0
windedge/odoo
addons/event/__openerp__.py
261
2296
# -*- 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
xbezdick/tempest
tempest/api/network/admin/test_external_networks_negative.py
31
2155
# Copyright 2014 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
Eaglemania/TOL
pyglet/canvas/win32.py
4
3324
#!/usr/bin/python # $Id:$ from base import Display, Screen, ScreenMode, Canvas from pyglet.libs.win32 import _kernel32, _user32, types, constants from pyglet.libs.win32.constants import * from pyglet.libs.win32.types import * class Win32Display(Display): def get_screens(self): screens = [] def en...
gpl-2.0
qsnake/gpaw
config.py
1
17421
# Copyright (C) 2006 CSC-Scientific Computing Ltd. # Please see the accompanying LICENSE file for further information. import os import sys import re import distutils.util from distutils.sysconfig import get_config_var, get_config_vars from distutils.command.config import config from glob import glob from os.path imp...
gpl-3.0
rue89-tech/edx-analytics-pipeline
edx/analytics/tasks/s3_util.py
3
8993
""" Utility methods for interacting with S3 via boto. """ import os import math import logging from fnmatch import fnmatch from urlparse import urlparse from boto.s3.key import Key from filechunkio import FileChunkIO from luigi.s3 import S3Client, AtomicS3File from luigi.hdfs import HdfsTarget, Plain log = logging....
agpl-3.0
vicnet/weboob
modules/becm/test.py
2
1064
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Julien Veyssier # # This file is part of a weboob module. # # This weboob module is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the...
lgpl-3.0
sotdjin/glibglab
venv/lib/python2.7/site-packages/sqlalchemy/orm/loading.py
14
24424
# orm/loading.py # Copyright (C) 2005-2016 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 """private module containing functions used to convert database rows into object inst...
mit
jamesabel/osnap
osnap/osnapy.py
1
2772
import argparse from osnap import default_python_version, get_logger, init_logger_from_args, __application_name__ import osnap.osnapy_win import osnap.osnapy_mac import osnap.util LOGGER = get_logger(__application_name__) def make_osnapy( python_version, application_name = None, clea...
mit
ChihChengLiang/python-rtmbot
tests/test_rtmbot_core.py
11
2363
# -*- coding: utf-8 -*- try: from unittest.mock import Mock, create_autospec except ImportError: from mock import Mock, create_autospec from testfixtures import LogCapture from slackclient import SlackClient, _channel, _server, _util from rtmbot.core import RtmBot, Plugin def init_rtmbot(): ''' Initialize...
mit
paulmathews/nova
nova/virt/disk/nbd.py
8
3960
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 Red Hat, 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 ...
apache-2.0
KyleJamesWalker/ansible
lib/ansible/plugins/cache/redis.py
36
3530
# (c) 2014, Brian Coca, Josh Drake, et al # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
oblank/pydjango-froum
xp/settings.py
1
7211
# coding: utf-8 # Django settings for xp project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME'...
mit
drufat/sympy
sympy/physics/mechanics/tests/test_particle.py
77
1388
from sympy import symbols from sympy.physics.mechanics import Point, Particle, ReferenceFrame def test_particle(): m, m2, v1, v2, v3, r, g, h = symbols('m m2 v1 v2 v3 r g h') P = Point('P') P2 = Point('P2') p = Particle('pa', P, m) assert p.mass == m assert p.point == P # Test the mass set...
bsd-3-clause