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
ebber/noteCreationServer
flask/lib/python3.5/site-packages/setuptools/command/rotate.py
461
2038
from distutils.util import convert_path from distutils import log from distutils.errors import DistutilsOptionError import os from setuptools import Command from setuptools.compat import basestring class rotate(Command): """Delete older distributions""" description = "delete older distributions, keeping N n...
gpl-2.0
bjzhang/xen
tools/python/genwrap.py
49
11753
#!/usr/bin/python import sys,os import idl (TYPE_DEFBOOL, TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_ARRAY, TYPE_AGGREGATE) = range(7) def py_type(ty): if ty == idl.bool: return TYPE_BOOL if ty.typename == "libxl_defbool": return TYPE_DEFBOOL if isinstance(ty, idl.Enumeration): ...
gpl-2.0
DougFirErickson/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/drawing/nx_agraph.py
40
13359
""" *************** Graphviz AGraph *************** Interface to pygraphviz AGraph class. Examples -------- >>> G=nx.complete_graph(5) >>> A=nx.to_agraph(G) >>> H=nx.from_agraph(A) See Also -------- Pygraphviz: http://networkx.lanl.gov/pygraphviz """ # Copyright (C) 2004-2012 by # Aric Hagberg <hagberg@lanl.go...
gpl-3.0
dmonakhov/googletest
scripts/pump.py
603
23316
#!/usr/bin/env python # # Copyright 2008, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
bsd-3-clause
maverickhuenlam/blog
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/emacs.py
364
2486
# -*- coding: utf-8 -*- """ pygments.styles.emacs ~~~~~~~~~~~~~~~~~~~~~ A highlighting style for Pygments, inspired by Emacs. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import ...
mit
total-impact/total-impact-core
test/unit_tests/providers/test_webpage.py
4
3437
# -*- coding: utf-8 -*- # need this line because test utf-8 strings later import os import collections from test.unit_tests.providers import common from test.unit_tests.providers.common import ProviderTestCase from totalimpact.providers.provider import Provider, ProviderContentMalformedError from test.utils import ...
mit
Jollytown/Garuda
server/garuda/lib/python2.7/site-packages/django/contrib/gis/shortcuts.py
197
1129
import zipfile from io import BytesIO from django.conf import settings from django.http import HttpResponse from django.template import loader def compress_kml(kml): "Returns compressed KMZ from the given KML string." kmz = BytesIO() zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED) zf.writestr('d...
mit
buaabyl/lime_dict
ngram-chs/test_model.py
1
2375
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # # GNU GENERAL PUBLIC LICENSE # Version 2, June 1991 # # 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; eit...
gpl-2.0
ostroproject/meta-iotqa
lib/oeqa/runtime/nodejs/bleno.py
1
3666
#!/usr/bin/env python3 import os import sys import time import json import shutil import subprocess from oeqa.oetest import oeRuntimeTest from oeqa.utils.decorators import tag class BlenoTest(oeRuntimeTest): cleanup = False bleno_prefix_dir = '/home/root' def setUp(self): ''' Insta...
mit
snailbob/namebench
nb_third_party/dns/edns.py
248
4312
# Copyright (C) 2009 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND NOMIN...
apache-2.0
jiachenning/odoo
addons/account_followup/__openerp__.py
261
2938
# -*- 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
kongseokhwan/kulcloud-iitp-neutron
neutron/tests/functional/api/test_policies.py
6
3938
# Copyright (c) 2014 Red Hat, 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 require...
apache-2.0
mspark93/VTK
ThirdParty/AutobahnPython/autobahn/wamp/role.py
17
6212
############################################################################### ## ## Copyright (C) 2014 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http:/...
bsd-3-clause
mboersma/docker-registry
scripts/create_ancestry.py
38
4259
#!/usr/bin/env python from __future__ import print_function import hashlib import sys import simplejson as json from docker_registry.core import exceptions import docker_registry.storage as storage store = storage.load() images_cache = {} ancestry_cache = {} dry_run = True def warning(msg): print('# Warning...
apache-2.0
upgrades-migrations/preupgrade-assistant
tests/test_generation.py
2
2933
from __future__ import unicode_literals import unittest import tempfile import shutil import os from glob import glob from preupg.xmlgen.compose import XCCDFCompose, ComposeXML from preupg.utils import FileHelper from preupg import settings try: import base except ImportError: import tests.base as base FOO_D...
gpl-3.0
drawks/ansible
lib/ansible/modules/cloud/smartos/smartos_image_facts.py
58
2857
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Adam Števko <adam.stevko@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
AlexanderKaluzhny/instanotifier
instanotifier/feedsource/tasks.py
1
1090
import logging from celery import chain, shared_task from instanotifier.fetcher.main import fetch from instanotifier.parser.main import parse_and_save from instanotifier.publisher.tasks import publish from instanotifier.feedsource.models import FeedSource @shared_task def consume_feed(feedsource_pk): feed_sourc...
mit
an7oine/WinVHS
Cygwin/lib/python2.7/threading.py
15
47210
"""Thread module emulating a subset of Java's threading model.""" import sys as _sys try: import thread except ImportError: del _sys.modules[__name__] raise import warnings from collections import deque as _deque from time import time as _time, sleep as _sleep from traceback import format_exc as _format...
gpl-3.0
thomasboyt/zulip
bots/jabber_mirror.py
17
2060
#!/usr/bin/env python # Copyright (C) 2014 Zulip, Inc. # # 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, m...
apache-2.0
embray/astropy_helpers
astropy_helpers/sphinx/ext/phantom_import.py
63
5854
""" ============== phantom_import ============== Sphinx extension to make directives from ``sphinx.ext.autodoc`` and similar extensions to use docstrings loaded from an XML file. This extension loads an XML file in the Pydocweb format [1] and creates a dummy module that contains the specified docstrings. This can be ...
bsd-3-clause
kowito/django-autocomplete-light
autocomplete_light/tests/generic.py
3
2146
import unittest from django.test import TransactionTestCase from django.contrib.contenttypes.models import ContentType from cities_light.models import Country, City from gfk_autocomplete.forms import TaggedItemForm from optionnal_gfk_autocomplete.forms import OptionnalTaggedItemForm import autocomplete_light clas...
mit
rogerthat-platform/rogerthat-ios-client
3rdParty/Code/3rdParty/zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/__init__.py
34
1629
"""SCons The main package for the SCons software construction utility. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "S...
apache-2.0
vm03/android_kernel_asus_P024
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os, sys sys.path.append(os.env...
gpl-2.0
Bysmyyr/chromium-crosswalk
tools/telemetry/third_party/gsutilz/third_party/boto/tests/integration/opsworks/test_layer1.py
114
2121
# Copyright (c) 2013 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 # "Software"), to deal in the Software without restriction, including # without limitation the rights ...
bsd-3-clause
gerryhd/diabot-assistant
lib/python2.7/site-packages/pip/_vendor/requests/__init__.py
327
2326
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ Requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
gpl-3.0
artful-addict/rwd-starter-kit
node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py
1355
44604
# Copyright (c) 2013 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. """cmake output module This module is under development and should be considered experimental. This module produces cmake (2.8.8+) input as its output. One CMake...
mit
flit/pyOCD
pyocd/rtos/freertos.py
2
20706
# pyOCD debugger # Copyright (c) 2016-2020 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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...
apache-2.0
spaceone/mils-secure
app/console/app/pygments/styles/manni.py
24
2379
# -*- coding: utf-8 -*- """ pygments.styles.manni ~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. This is a port of the style used in the `php port`_ of pygments by Manni. The style is called 'default' there. :copyright: 2006-2007 by Armin Ronacher, Manni ...
mit
elmer/smart-gitosis
gitosis/gitdaemon.py
24
2451
import errno import logging import os from ConfigParser import NoSectionError, NoOptionError log = logging.getLogger('gitosis.gitdaemon') from gitosis import util def export_ok_path(repopath): p = os.path.join(repopath, 'git-daemon-export-ok') return p def allow_export(repopath): p = export_ok_path(rep...
gpl-2.0
RuralHunter/showtime
ext/libyuv/tools/valgrind-libyuv/libyuv_tests.py
13
5222
#!/usr/bin/env python # Copyright (c) 2012 The LibYuv Project Authors. All rights reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
gpl-3.0
wimnat/ansible
.azure-pipelines/scripts/combine-coverage.py
25
2174
#!/usr/bin/env python """ Combine coverage data from multiple jobs, keeping the data only from the most recent attempt from each job. Coverage artifacts must be named using the format: "Coverage $(System.JobAttempt) {StableUniqueNameForEachJob}" The recommended coverage artifact name format is: Coverage $(System.JobAtt...
gpl-3.0
hill-a/stable-baselines
stable_baselines/acer/acer_simple.py
1
39128
import time import warnings import numpy as np import tensorflow as tf from gym.spaces import Discrete, Box from collections import deque from stable_baselines import logger from stable_baselines.common.schedules import Scheduler from stable_baselines.common.tf_util import batch_to_seq, seq_to_batch, \ check_shap...
mit
team-vigir/vigir_pluginlib
vigir_pluginlib_manager/src/vigir_pluginlib_manager/plugin_tree_model.py
1
9877
#!/usr/bin/env python import bisect import QtCore import rospy import rospkg from python_qt_binding.QtCore import Qt, QObject, QAbstractItemModel from vigir_pluginlib_msgs.msg import PluginState, PluginDescription # Tree Model for Plugins class PluginTreeModel(QtCore.QAbstractItemModel): def __init__(self, ...
bsd-3-clause
pombredanne/pyjs
pyjswidgets/pyjamas/Canvas2D.py
7
3794
# Canvas wrapper component for Pyjamas # Ported by Willie Gollino from Canvas component for GWT - Originally by Alexei Sokolov http://gwt.components.googlepages.com/ # # Canvas API reference: # http://developer.apple.com/documentation/AppleApplications/Reference/SafariJSRef/Classes/Canvas.html#//apple_ref/js/Canvas.cle...
apache-2.0
tavaresdong/cs61a-projects
projects/ants/tests/09.py
4
10915
test = { 'name': 'Problem 9', 'points': 4, 'suites': [ { 'cases': [ { 'code': r""" >>> # QueenAnt Placement >>> queen = ants.QueenAnt() >>> impostor = ants.QueenAnt() >>> front_ant, back_ant = ants.ThrowerAnt(), ants.ThrowerAnt() >>> tu...
mit
qwertyjune/BethSaidaBible
venv/lib/python2.7/site-packages/django/contrib/contenttypes/migrations/0001_initial.py
83
1061
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='ContentType', fields=[ ('id', models.AutoField(...
gpl-3.0
applitools/eyes.selenium.python
applitools/selenium/capture/eyes_webdriver_screenshot.py
1
9401
from __future__ import absolute_import import base64 import typing as tp from selenium.common.exceptions import WebDriverException from applitools.core import EyesScreenshot, EyesError, Point, Region, OutOfBoundsError from applitools.utils import image_utils from applitools.selenium import eyes_selenium_utils from a...
apache-2.0
spMohanty/TranslatorsDesk
translatorsdesk/public/views.py
2
8582
# -*- coding: utf-8 -*- '''Public section, including homepage and signup.''' from flask import (Blueprint, request, render_template, flash, url_for, redirect, session, jsonify, redirect, request, current_app, abort) from flask.ext.login import login_user, login_required, logout_u...
bsd-3-clause
raschuetz/foundations-homework
07/data-analysis/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py
2994
1676
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
ewels/genomics-status
status/production.py
2
10980
""" Handlers related to data production. """ from collections import OrderedDict import cStringIO from datetime import datetime import json from dateutil import parser import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg import tornado.web from status.util import dthandler, Saf...
mit
wastholm/bitcoin
qa/rpc-tests/test_framework/blockstore.py
95
4447
# BlockStore: a helper class that keeps a map of blocks and implements # helper functions for responding to getheaders and getdata, # and for constructing a getheaders message # from mininode import * import dbm class BlockStore(object): def __init__(self, datadir): self.blockDB = ...
mit
zoyahav/incubator-airflow
airflow/utils/dag_processing.py
20
23293
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
jamesdavidson/corpkit
orientation/corpus_building.py
3
6471
# <headingcell level=1> # *corpkit*: a Python-based toolkit for working with parsed linguistic corpora # <headingcell level=2> # <markdowncell> # [Daniel McDonald](mailto:mcdonaldd@unimelb.edu.au?Subject=corpkit)** #--------------------------- # <markdowncell> # <br> # > **SUMMARY:** This *IPython Notebook* shows you...
mit
sorenk/ansible
lib/ansible/modules/network/vyos/vyos_user.py
38
10849
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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
SimonGriffioen/pascal
PASCAL/external/networkx/algorithms/operators/tests/test_all.py
40
5320
from nose.tools import * import networkx as nx from networkx.testing import * def test_union_all_attributes(): g = nx.Graph() g.add_node(0, x=4) g.add_node(1, x=5) g.add_edge(0, 1, size=5) g.graph['name'] = 'g' h = g.copy() h.graph['name'] = 'h' h.graph['attr'] = 'attr' h.node[0]['...
gpl-2.0
jbzdak/edx-platform
lms/djangoapps/teams/tests/test_views.py
3
59381
# -*- coding: utf-8 -*- """Tests for the teams API at the HTTP request level.""" import json from datetime import datetime import pytz from dateutil import parser import ddt from elasticsearch.exceptions import ConnectionError from mock import patch from search.search_engine_base import SearchEngine from django.core.u...
agpl-3.0
xyguo/scikit-learn
sklearn/ensemble/bagging.py
22
36582
"""Bagging meta-estimator.""" # Author: Gilles Louppe <g.louppe@gmail.com> # License: BSD 3 clause from __future__ import division import itertools import numbers import numpy as np from warnings import warn from abc import ABCMeta, abstractmethod from ..base import ClassifierMixin, RegressorMixin from ..externals....
bsd-3-clause
albmarvil/The-Eternal-Sorrow
dependencies/luabind/boost-build/test/core_dependencies.py
4
3503
#!/usr/bin/python # Copyright 2003 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # This tests correct handling of dependencies, specifically, on # generated sources, and from generated sources. import Bo...
apache-2.0
undoware/neutron-drive
neutron-drive/chardet/big5freq.py
323
82588
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
bsd-3-clause
kobiso/ControlledDropout
deepnet/mc_avg.py
13
2226
"""Monte Carlo model averaging for dropout networks.""" from neuralnet import * from trainer import * import glob import sys import random def ExtractRepresentations(model_file, train_op_file, layernames, base_output_dir, memory = '100M', k=10): LockGPU() model = util.ReadModel(model_fil...
bsd-3-clause
gnulinooks/sympy
sympy/mpmath/tests/test_ode_mpmath.py
6
1825
from sympy.mpmath.calculus import ODE_step_euler, ODE_step_rk4, odeint, arange from sympy.mpmath import odefun, cos, sin, mpf, sinc, mp solvers = [ODE_step_euler, ODE_step_rk4] def test_ode1(): """ Let's solve: x'' + w**2 * x = 0 i.e. x1 = x, x2 = x1': x1' = x2 x2' = -x1 """ def de...
bsd-3-clause
orgito/ansible
test/units/mock/loader.py
127
3861
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
fjbatresv/odoo
addons/report_intrastat/report_intrastat.py
201
5606
# -*- 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
15Dkatz/pants
contrib/python/tests/python/pants_test/contrib/python/checks/tasks/checkstyle/test_future_compatibility.py
18
2005
# 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_test.cont...
apache-2.0
pheanex/ansible-modules-extras
system/ohai.py
86
1695
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of...
gpl-3.0
jegger/kivy
examples/canvas/canvas_stress.py
21
2146
''' Canvas stress ============= This example tests the performance of our Graphics engine by drawing large numbers of small squares. You should see a black canvas with buttons and a label at the bottom. Pressing the buttons adds small colored squares to the canvas. ''' from kivy.uix.button import Button from kivy.ui...
mit
seecr/weightless-core
test/udp/acceptortest.py
1
3124
## begin license ## # # "Weightless" is a High Performance Asynchronous Networking Library. See http://weightless.io # # Copyright (C) 2006-2011 Seek You Too (CQ2) http://www.cq2.nl # Copyright (C) 2011-2013, 2015, 2020-2021 Seecr (Seek You Too B.V.) https://seecr.nl # Copyright (C) 2015 Koninklijke Bibliotheek (KB) ht...
gpl-2.0
nwjs/blink
Tools/Scripts/webkitpy/style/patchreader.py
188
3699
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 Chris Jerdonek (chris.jerdonek@gmail.com) # Copyright (C) 2010 ProFUSION embedded systems # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
nextgis-extra/tests
lib_gdal/gdrivers/nitf.py
1
101882
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # $Id: nitf.py 33793 2016-03-26 13:02:07Z goatbar $ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for NITF driver. # Author: Frank Warmerdam <warmerdam@pobox.com>...
gpl-2.0
klahnakoski/TestFailures
pyLibrary/queries/query.py
1
25581
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Author: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import absolute_import from __f...
mpl-2.0
rekbun/browserscope
test/test_decorators.py
9
1678
#!/usr/bin/python2.5 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the 'License') # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
30loops/libthirty
libthirty/state.py
1
4469
# Copyright (c) 2011-2012, 30loops.net # 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 condition...
bsd-3-clause
clems/openfisca
src/views/ui_page02.py
1
22628
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ui/page02.ui' # # Created: Tue May 29 19:14:52 2012 # by: PyQt4 UI code generator 4.8.5 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attri...
gpl-3.0
kivatu/kivy_old
kivy/uix/checkbox.py
5
3103
''' CheckBox ======== .. versionadded:: 1.4.0 .. image:: images/checkbox.png :align: right :class:`CheckBox` is a specific two-state button that can be either checked or unchecked. If the CheckBox is in a Group, it becomes a Radio button. As with the :class:`~kivy.uix.togglebutton.ToggleButton`, only one Radio b...
mit
pfnet/chainer
chainer/training/extensions/polynomial_shift.py
10
3354
from __future__ import division import numpy from chainer.training import extension class PolynomialShift(extension.Extension): """Trainer extension to polynomially shift an optimizer attribute. This extension polynomially decreases the specified attribute of the optimizer. The typical use case is a p...
mit
fbsder/zephyr
doc/conf.py
1
12262
# -*- coding: utf-8 -*- # # Zephyr documentation build configuration file, created by # sphinx-quickstart on Fri May 8 11:43:01 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...
apache-2.0
melodous/designate
designate/api/v2/controllers/extensions/tenants.py
1
1568
# COPYRIGHT 2014 Rackspace # # Author: Betsy Luzader <betsy.luzader@rackspace.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 # # Unle...
apache-2.0
anilmuthineni/tensorflow
tensorflow/contrib/layers/python/layers/optimizers.py
20
18031
# 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
tedi3231/openerp
openerp/addons/l10n_be_coda/l10n_be_coda.py
63
3843
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
bvcms/bvcms
CmsWeb/Lib/logging/__init__.py
2
61272
# Copyright 2001-2014 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-2.0
RafaelCosman/pybrain
pybrain/tools/customxml/networkreader.py
25
3676
from __future__ import print_function __author__ = 'Tom Schaul, tom@idsia.ch' from .handling import XMLHandling # those imports are necessary for the eval() commands to find the right classes import pybrain #@UnusedImport from scipy import array #@UnusedImport try: import arac.pybrainbridge #@UnusedImport exc...
bsd-3-clause
evernote/zing
pootle/apps/pootle_app/management/commands/refresh_scores.py
1
2645
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. import datetime import os os.environ["DJAN...
gpl-3.0
aidanhs/servo
tests/wpt/web-platform-tests/tools/six/documentation/conf.py
420
7015
# -*- coding: utf-8 -*- # # six documentation build configuration file import os import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like ...
mpl-2.0
salopensource/sal
server/plugins/munkiinfo/scripts/munkiinfo.py
2
1614
#!/usr/local/sal/Python.framework/Versions/3.8/bin/python3 import sys import sal sys.path.append('/usr/local/munki') from munkilib import munkicommon PREFS_TO_GET = ( 'ManagedInstallDir', 'SoftwareRepoURL', 'ClientIdentifier', 'LogFile', 'LoggingLevel', 'LogToSyslog', 'InstallAppleSoftw...
apache-2.0
JshWright/home-assistant
homeassistant/components/notify/ciscospark.py
19
1851
""" Cisco Spark platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.ciscospark/ """ import logging import voluptuous as vol from homeassistant.components.notify import ( PLATFORM_SCHEMA, BaseNotificationService, ATT...
apache-2.0
guojianli/code-for-blog
2008/libcollect.py
14
14080
""" libcollect.py Provides the LibCollect class, used for collecting the various libraries your script uses for delivery as a self-contained distribution package. Author: Eli Bendersky (http://eli.thegreenplace.net) License: Same as Python Motivation: Imagine that you've written a script that uses several librarie...
unlicense
hunter007/django
tests/check_framework/test_templates.py
288
1403
from copy import deepcopy from django.core.checks.templates import E001 from django.test import SimpleTestCase from django.test.utils import override_settings class CheckTemplateSettingsAppDirsTest(SimpleTestCase): TEMPLATES_APP_DIRS_AND_LOADERS = [ { 'BACKEND': 'django.template.backends.djan...
bsd-3-clause
saraivaufc/askMathPlus
askmath/models/history/answered_questions_historic.py
1
1398
from django.db import models from django.utils import timezone from django.utils.translation import ugettext as _ #historico das respostas das questoes class AnsweredQuestionsHistoric(models.Model): discipline = models.ForeignKey('Discipline', related_name=_('Discipline'), verbose_name=_(u"Discipline")) lesso...
gpl-2.0
adhoc-dev/sale-workflow
sale_order_type/__openerp__.py
13
2363
# -*- encoding: utf-8 -*- ############################################################################## # # # OpenERP, Open Source Management Solution. # # ...
agpl-3.0
keenlabs/KeenClient-Python
keen/tests/scoped_key_tests.py
1
1665
from keen import scoped_keys from keen.tests.base_test_case import BaseTestCase class ScopedKeyTests(BaseTestCase): api_key = "24077ACBCB198BAAA2110EDDB673282F8E34909FD823A15C55A6253A664BE368" bad_api_key = "24077ACBCB198BAAA2110EDDB673282F8E34909FD823A15C55A6253A664BE369" old_api_key = "ab428324dbdbcfe74...
mit
dlodato/AliPhysics
PWGMM/MC/aligenqa/aligenqa/utils.py
37
7697
import os import random import string import subprocess import re from rootpy import asrootpy from rootpy.plotting import Graph def gen_random_name(): """Generate a random name for temp hists""" return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(25)) def get_est_dirs(sums, co...
bsd-3-clause
danakj/chromium
chrome/common/extensions/docs/server2/branch_utility_test.py
77
7693
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import unittest from branch_utility import BranchUtility, ChannelInfo from fake_url_fetcher import FakeUrlFet...
bsd-3-clause
jonathanwcrane/boto
boto/ec2/blockdevicemapping.py
149
6372
# Copyright (c) 2009-2012 Mitch Garnaat http://garnaat.org/ # 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 # "Software"), to deal in the Software wit...
mit
YongseopKim/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_font-src_cross-origin_allowed-manual.py
30
2615
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) _CSP = "font-src " + url1 response.headers.set("Content-Security-Policy", _CSP) response....
bsd-3-clause
palerdot/calibre
src/calibre/ebooks/oeb/polish/cover.py
2
15201
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' __docformat__ = 'restructuredtext en' ...
gpl-3.0
reinhrst/ycmd
cpp/ycm/tests/gmock/scripts/generator/cpp/keywords.py
1157
2004
#!/usr/bin/env python # # Copyright 2007 Neal Norwitz # Portions Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
gpl-3.0
caisq/tensorflow
tensorflow/contrib/lookup/lookup_ops_test.py
6
91453
# 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
matthaywardwebdesign/rethinkdb
external/gtest_1.6.0/test/gtest_throw_on_failure_test.py
2917
5766
#!/usr/bin/env python # # Copyright 2009, 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...
agpl-3.0
jbuchbinder/youtube-dl
youtube_dl/extractor/democracynow.py
22
3016
# coding: utf-8 from __future__ import unicode_literals import re import os.path from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( url_basename, remove_start, ) class DemocracynowIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?democracynow\.org/(?P<id>[^\?...
unlicense
dscotese/bitcoin
test/functional/test_framework/segwit_addr.py
18
4177
#!/usr/bin/env python3 # Copyright (c) 2017 Pieter Wuille # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Reference implementation for Bech32 and segwit addresses.""" import unittest CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"...
mit
rew4332/tensorflow
tensorflow/python/kernel_tests/summary_tensor_op_test.py
9
3807
# 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
kiniou/qtile
libqtile/widget/textbox.py
2
2262
# Copyright (c) 2008, 2010 Aldo Cortesi # Copyright (c) 2011 Mounier Florian # Copyright (c) 2012, 2015 Tycho Andersen # Copyright (c) 2013 Tao Sauvage # Copyright (c) 2013 Craig Barnes # Copyright (c) 2014 Sean Vig # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and ...
mit
wxgeo/geophar
wxgeometrie/pylib/fonctions.py
1
29422
# -*- coding: utf-8 -*- ########################################################################## # # Fonctions couramment utilisees, et non implementees en Python # (...du moins, à ma connaissance !) # ########################################################################## # WxGeometr...
gpl-2.0
dlazz/ansible
test/units/modules/network/edgeswitch/test_edgeswitch_vlan.py
29
5640
# (c) 2018 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
surdy/dcos
pkgpanda/test_util.py
2
14309
import os import tempfile from subprocess import CalledProcessError import pytest import pkgpanda.util from pkgpanda import UserManagement from pkgpanda.exceptions import ValidationError PathSeparator = '/' # Currently same for both windows and linux. Constant may vary in near future by platform def test_remove_f...
apache-2.0
wsmith323/django
django/db/backends/base/schema.py
339
43421
import hashlib import logging from django.db.backends.utils import truncate_name from django.db.transaction import atomic from django.utils import six from django.utils.encoding import force_bytes logger = logging.getLogger('django.db.backends.schema') def _related_non_m2m_objects(old_field, new_field): # Filte...
bsd-3-clause
CottageLabs/OpenArticleGauge
openarticlegauge/tests/test_provider_skeleton.py
1
11803
from unittest import TestCase import requests, os from openarticlegauge import config, models ###################################################################################### # Set these variables/imports and the test case will use them to perform some general # tests on your provider code # import your plugin...
bsd-3-clause
tpetmanson/pfe
pypfe/corpedit.py
2
2341
# -*- coding: utf-8 -*- # Python 2.7 # Pattern based fact extraction library. # Copyright (C) 2013 University of Tartu # # 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 versi...
gpl-3.0
openstack/nova
nova/virt/arch.py
7
1548
# Copyright 2018 VEXXHOST, 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 b...
apache-2.0
batxes/4Cin
Six_mouse_models/Six_mouse_models_final_output_0.2_-0.1_11000/Six_mouse_models47608.py
2
18219
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0