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
jusdng/odoo
addons/contacts/__openerp__.py
260
1594
# -*- 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
tomlof/scikit-learn
sklearn/decomposition/dict_learning.py
19
46220
""" Dictionary learning """ from __future__ import print_function # Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort # License: BSD 3 clause import time import sys import itertools from math import sqrt, ceil import numpy as np from scipy import linalg from numpy.lib.stride_tricks import as_strided from ..b...
bsd-3-clause
CybOXProject/python-cybox
cybox/objects/win_prefetch_object.py
1
2182
# Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. from mixbox import entities from mixbox import fields import cybox.bindings.win_prefetch_object as win_prefetch_binding from cybox.objects.device_object import Device from cybox.objects.win_volume_object import Win...
bsd-3-clause
yuewko/neutron
neutron/tests/functional/agent/linux/test_keepalived.py
13
2352
# 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
rduivenvoorde/QGIS
python/plugins/db_manager/db_manager_plugin.py
31
5107
# -*- coding: utf-8 -*- """ /*************************************************************************** Name : DB Manager Description : Database manager plugin for QGIS Date : May 23, 2011 copyright : (C) 2011 by Giuseppe Sucameli email : brush.tyler@...
gpl-2.0
jhseu/tensorflow
tensorflow/python/kernel_tests/trace_op_test.py
27
1548
# 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
srimai/odoo
addons/gamification/wizard/update_goal.py
386
1848
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
foodszhang/kbengine
kbe/src/lib/python/Tools/pybench/Tuples.py
92
8034
from pybench import Test class TupleSlicing(Test): version = 2.0 operations = 3 * 25 * 10 * 7 rounds = 500 def test(self): r = range(25) t = tuple(range(100)) for i in range(self.rounds): for j in r: m = t[50:] m = t[:25] ...
lgpl-3.0
microcom/odoo
addons/stock/tests/test_resupply.py
214
2457
# -*- coding: utf-8 -*- from openerp.addons.stock.tests.common import TestStockCommon from openerp.tools import mute_logger, float_round class TestResupply(TestStockCommon): def setUp(self): super(TestResupply, self).setUp() self.Warehouse = self.env['stock.warehouse'] # create 2 WH, BIG ...
agpl-3.0
llvm-mirror/lldb
packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
13
1509
""" Tests ThreadSanitizer's support to detect a leaked thread. """ import lldb from lldbsuite.test.lldbtest import * from lldbsuite.test.decorators import * import lldbsuite.test.lldbutil as lldbutil class TsanThreadLeakTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureAll( ...
apache-2.0
gunmetalbackupgooglecode/pyew
vstruct/defs/windows/win_6_1_amd64/win32k.py
18
216937
# Version: 6.1 # Architecture: amd64 import vstruct from vstruct.primitives import * ETW_THREAD_FLAG = v_enum() ETW_THREAD_FLAG.ETW_THREAD_FLAG_HAD_INPUT = 0 ETW_THREAD_FLAG.ETW_THREAD_FLAG_HAD_VISIBLE_WINDOWS = 1 ETW_THREAD_FLAG.ETW_THREAD_FLAG_HAS_NEW_INPUT = 2 ETW_THREAD_FLAG.ETW_THREAD_FLAG_MAX = 3 T...
gpl-2.0
dbbhattacharya/kitsune
vendor/packages/nose/nose/plugins/allmodules.py
107
1720
"""Use the AllModules plugin by passing ``--all-modules`` or setting the NOSE_ALL_MODULES environment variable to enable collection and execution of tests in all python modules. Normal nose behavior is to look for tests only in modules that match testMatch. More information: :doc:`../doc_tests/test_allmodules/test_all...
bsd-3-clause
thnee/ansible
lib/ansible/modules/network/fortios/fortios_wireless_controller_wtp_profile.py
13
95079
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
gpl-3.0
django-erp/django-erp
djangoerp/core/tests/test_views.py
1
25937
#!/usr/bin/env python """This file is part of the django ERP project. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLD...
mit
glasslion/djflow
leavedemo/modelviz.py
3
5844
#!/usr/bin/env python """Django model to DOT (Graphviz) converter by Antonio Cavedoni <antonio@cavedoni.org> Make sure your DJANGO_SETTINGS_MODULE is set to your project or place this script in the same directory of the project and call the script like this: $ python modelviz.py [-h] [-d] <app_label> ... <app_label> ...
bsd-3-clause
bdoner/SickRage
lib/guessit/__init__.py
29
12914
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
Nu3001/external_chromium_org
tools/code_coverage/coverage.py
31
13721
#!/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. """Module to setup and generate code coverage data This module first sets up the environment for code coverage, instruments the binar...
bsd-3-clause
marcomaccio/python-docs-samples
blog/introduction_to_data_models_in_cloud_datastore/blog.py
4
3748
# Copyright 2015, 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 agreed to in writing, s...
apache-2.0
sbellem/django
django/db/backends/oracle/utils.py
539
1252
import datetime from django.utils.encoding import force_bytes, force_text from .base import Database # Check whether cx_Oracle was compiled with the WITH_UNICODE option if cx_Oracle is pre-5.1. This will # also be True for cx_Oracle 5.1 and in Python 3.0. See #19606 if int(Database.version.split('.', 1)[0]) >= 5 and...
bsd-3-clause
tanglei528/nova
nova/api/openstack/compute/plugins/v3/migrate_server.py
13
5223
# Copyright 2011 OpenStack Foundation # Copyright 2013 IBM Corp. # # 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 requir...
apache-2.0
hoelsner/product-database
app/config/tests/test_config_views.py
1
21046
""" Test suite for the config.views module """ import pytest from html import escape from django.contrib.auth.models import AnonymousUser, User from django.contrib.messages.storage.fallback import FallbackStorage from django.core.cache import cache from django.core.exceptions import PermissionDenied from django.urls im...
mit
joisig/grit-i18n
grit/format/policy_templates/writers/adml_writer.py
41
7710
#!/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. from xml.dom import minidom from grit.format.policy_templates.writers import xml_formatted_writer def GetWriter(config): '''Fac...
bsd-2-clause
arcz/ansible-modules-core
cloud/openstack/os_security_group_rule.py
48
10595
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # Copyright (c) 2013, Benno Joy <benno@ansible.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 vers...
gpl-3.0
jneves/OctoPrint
versioneer.py
31
42531
# Version: 0.10 """ The Versioneer ============== * like a rocketeer, but for versions! * https://github.com/warner/python-versioneer * Brian Warner * License: Public Domain * Compatible With: python2.6, 2.7, and 3.2, 3.3 [![Build Status](https://travis-ci.org/warner/python-versioneer.png?branch=master)](https://tr...
agpl-3.0
max-ilse/csound
examples/python/StrangeAtrractor.py
5
4017
# Copyright (c) 2002, 2003 by Michael Gogins. All rights reserved. # Tutorial demonstrating a MusicModel composition # based on translating the orbit of a chaotic attractor to a score. import CsoundAC import time CsoundAC.Random_seed(int(time.time())) model = CsoundAC.MusicModel() model.setCppSound(csound) csound.se...
lgpl-2.1
kohoumas/ns-3-click-mac-dev
src/stats/bindings/modulegen__gcc_ILP32.py
2
236462
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
SciTools/iris
lib/iris/tests/unit/coord_systems/test_GeogCS.py
3
1892
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :class:`iris.coord_systems.GeogCS` class.""" # Import iris.tests first so that some things can be initia...
lgpl-3.0
felixfontein/ansible
test/integration/targets/module_utils/library/test_cwd_missing.py
35
1303
#!/usr/bin/python from __future__ import absolute_import, division, print_function __metaclass__ = type import os from ansible.module_utils.basic import AnsibleModule def main(): # This module verifies that AnsibleModule works when cwd does not exist. # This situation can occur as a race condition when the ...
gpl-3.0
anaran/kuma
vendor/packages/translate/misc/wsgiserver/wsgiserver2.py
26
87991
"""A high-speed, production ready, thread pooled, generic HTTP server. Simplest example on how to use this module directly (without using CherryPy's application machinery):: from cherrypy import wsgiserver def my_crazy_app(environ, start_response): status = '200 OK' response_headers = [('Cont...
mpl-2.0
Darkdadaah/pywikibot-core
tests/redirect_bot_tests.py
5
2284
# -*- coding: utf-8 -*- """Tests for the redirect.py script.""" # # (C) Pywikibot team, 2017 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals try: from unittest.mock import Mock, patch except ImportError: from mock import Mock, patch import pywikib...
mit
jack198345/volatility
volatility/plugins/envars.py
44
1477
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (c) 2012 Michael Ligh <michael.ligh@mnin.org> # # This file is part of Volatility. # # Volatility 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
mlperf/training_results_v0.5
v0.5.0/google/research_v3.32/gnmt-tpuv3-32/code/gnmt/model/t2t/tensor2tensor/data_generators/style_transfer.py
3
5027
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # 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...
apache-2.0
Hannimal/raspicar
ps3Controller/ps3joy.py
1
1520
#!/usr/bin/env python # coding: Latin-1 import sys import smbus import time bus = smbus.SMBus(1) address = 0x2a try: pipe = open('/dev/input/js0', 'r') print('/dev/input/js0 Available') except: print('/dev/input/js0 not Available') sys.exit(0) msg = [] position = [0,0,0,0] def StringToBytes(val): ...
unlicense
jamesyli/solum
solum/api/controllers/v1/service.py
3
3237
# 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 # distributed under t...
apache-2.0
linked67/p2pool-vc
nattraverso/portmapper.py
288
4157
""" Generic NAT Port mapping interface. TODO: Example @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" from twisted.internet.base import BasePort # Public API def get_port_mapper(proto="TCP"): ...
gpl-3.0
maniteja123/sympy
sympy/plotting/intervalmath/tests/test_intervalmath.py
92
8865
from __future__ import division from sympy.plotting.intervalmath import interval from sympy.utilities.pytest import raises def test_interval(): assert (interval(1, 1) == interval(1, 1, is_valid=True)) == (True, True) assert (interval(1, 1) == interval(1, 1, is_valid=False)) == (True, False) assert (interv...
bsd-3-clause
shouldmakemusic/yaas
controller/RedFrameController.py
1
3038
# Copyright (C) 2015 Manuel Hirschauer (manuel@hirschauer.net) # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version...
gpl-2.0
dcroc16/skunk_works
google_appengine/lib/distutils/distutils/ccompiler.py
80
46633
"""distutils.ccompiler Contains CCompiler, an abstract base class that defines the interface for the Distutils compiler abstraction model.""" __revision__ = "$Id$" import sys import os import re from distutils.errors import (CompileError, LinkError, UnknownFileError, DistutilsPlatformE...
mit
fernandezcuesta/ansible
lib/ansible/plugins/connection/libvirt_lxc.py
44
7335
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute i...
gpl-3.0
Lightmatter/django-inlineformfield
.tox/py27/lib/python2.7/site-packages/IPython/nbconvert/preprocessors/coalescestreams.py
5
2377
"""Preprocessor for merging consecutive stream outputs for easier handling.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import re def cell_preprocessor(function): """ Wrap a function to be executed on all cells of a notebook The wrapped fun...
mit
JoeMartini/firefly-proxy
component/brz.py
5
8237
import sys import os import threading import subprocess import codecs import urllib import urlparse from lib.ipc import ActorObject from lib.utils import open_url # proxy type SOCKS5 = 1 HTTP = 2 def launch_chrome(executable, url, rootdir, proxy_type, proxy_ip, proxy_port): if proxy_type == SOCKS5: proxy...
bsd-2-clause
3dfxsoftware/cbss-addons
report_profit/wizard/wiz_trial_cost.py
1
3732
#!/usr/bin/python # -*- encoding: utf-8 -*- ########################################################################### # Module Writen to OpenERP, Open Source Management Solution # Copyright (C) OpenERP Venezuela (<http://openerp.com.ve>). # All Rights Reserved # Credits#######################################...
gpl-2.0
kennyledet/Algorithm-Implementations
Rabin_Karp/Python/shivam5992/rabin_karp.py
27
1502
''' Rabin Karp Algorithm for pattern matching.It is a string searching algorithm that uses hashing to find any one of a set of pattern strings in a text. ''' def rabin_karp(pat,txt): q = 19 # a random prime number to calcualte hash values d = 256 # number of input characters h = 1 # hash function ini...
mit
tinutomson/wikicoding
wikicoding/settings.py
2
2982
""" Django settings for wikicoding project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...)...
gpl-3.0
lakshayg/tensorflow
tensorflow/python/keras/_impl/keras/datasets/cifar.py
86
1542
# 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
cswiercz/sympy
sympy/combinatorics/perm_groups.py
40
119820
from __future__ import print_function, division from random import randrange, choice from math import log from sympy.core import Basic from sympy.core.compatibility import range from sympy.combinatorics import Permutation from sympy.combinatorics.permutations import (_af_commutes_with, _af_invert, _af_rmul, _af_r...
bsd-3-clause
xiaoxiamii/scikit-learn
examples/applications/plot_model_complexity_influence.py
323
6372
""" ========================== Model Complexity Influence ========================== Demonstrate how model complexity influences both prediction accuracy and computational performance. The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for regression (resp. classification). For each class of models we m...
bsd-3-clause
dalegregory/odoo
addons/mail/mail_vote.py
439
1647
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
camilonova/django
tests/postgres_tests/test_indexes.py
5
4868
from django.contrib.postgres.indexes import BrinIndex, GinIndex from django.db import connection from django.test import skipUnlessDBFeature from . import PostgreSQLTestCase from .models import CharFieldModel, IntegerArrayModel @skipUnlessDBFeature('has_brin_index_support') class BrinIndexTests(PostgreSQLTestCase): ...
bsd-3-clause
visvirial/electrum-server
src/test/test_utils.py
49
1107
__author__ = 'erasmospunk' import unittest from utils import hash_160_to_address, bc_address_to_hash_160 class UtilTest(unittest.TestCase): def test_hash_160_to_address(self): self.assertEqual(hash_160_to_address(None), None) self.assertEqual(hash_160_to_address('04e9fca1'.decode('hex')), None) ...
agpl-3.0
PeterPetrik/QGIS
tests/src/python/test_qgsserver_wms_getfeatureinfo_postgres.py
12
17171
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsServer GetFeatureInfo WMS with PG. From build dir, run: ctest -R PyQgsServerWMSGetFeatureInfoPG -V .. note:: 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 Fo...
gpl-2.0
ryfeus/lambda-packs
Tensorflow/source/tensorflow/python/grappler/tf_optimizer.py
63
1549
# 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...
mit
willworth/thermos
thermos/Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # versio...
mit
ncliam/serverpos
openerp/addons/hr_contract/hr_contract.py
302
5377
# -*- 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
slevenhagen/odoo-npg
addons/account/installer.py
381
8404
# -*- 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
gannetson/sportschooldeopenlucht
apps/fund/migrations/0002_add_recurring_direct_debit_payment.py
1
17485
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'RecurringDirectDebitPayment' db.create_table(u'fund_recurringdirectdebitpayment', ( ...
bsd-3-clause
happy56/kivy
examples/widgets/codeinput.py
4
5272
from kivy.app import App from kivy.extras.highlight import KivyLexer from kivy.uix.spinner import Spinner, SpinnerOption from kivy.uix.boxlayout import BoxLayout from kivy.uix.codeinput import CodeInput from kivy.uix.popup import Popup from kivy.properties import ListProperty from kivy.core.window import Window from py...
lgpl-3.0
credativUK/OCB
addons/web_linkedin/web_linkedin.py
25
2603
# -*- 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
khosrow/metpx
sundew/lib/MasterConfigurator.py
1
10676
""" MetPX Copyright (C) 2004-2007 Environment Canada MetPX comes with ABSOLUTELY NO WARRANTY; For details type see the file named COPYING in the root of the source directory tree. """ """ ############################################################################################# # Name: MasterConfigurator.py # # Au...
gpl-2.0
whot/systemd
tools/gdb-sd_dump_hashmaps.py
2
4490
#!/usr/bin/env python3 # -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # SPDX-License-Identifier: LGPL-2.1+ import gdb class sd_dump_hashmaps(gdb.Command): "dump systemd's hashmaps" def __init__(self): super(sd_dump_hashmaps, self).__init__("sd_dump_hashmaps", gdb.COM...
gpl-2.0
saicoco/mxnet_image_caption
old/main.py
1
6142
# -*- conding=utf-8 -*- """ train module """ import mxnet as mx import numpy as np import json import config import logging import time import collections from sym import vgg16_fc7, caption_module from data_provider import caption_dataIter, init_cnn from mxnet.model import save_checkpoint import argparse logging.basic...
mit
gghezzo/prettypython
PythonEveryDay2015/bigballs.py
1
1044
# Teaching Python Classes by Peter Farrell # From http://hackingmathclass.blogspot.com/2015/08/finally-some-class.html # Typer: Ginny C Ghezzo # What I learned: # why doesn't the first import bring in locals ?? import pygame from pygame.locals import * black = (0,0,0) white = (255,255,255) green = (0,255, 0) ...
mit
nafex/pyload
module/gui/Overview.py
41
7578
# -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in ...
gpl-3.0
fgesora/odoo
addons/sale_stock/company.py
384
1524
# -*- 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
smmribeiro/intellij-community
python/testData/inspections/PyUnusedLocalInspection/py2.py
13
6473
def foo1(): <weak_warning descr="Local variable 'aaa' value is not used">aaa</weak_warning> = 1 #fail <weak_warning descr="Local variable 'aaa' value is not used">aaa</weak_warning> = 2 #fail bbb = 1 #pass return bbb def bar(<weak_warning descr="Parameter 'self' value is not used">self</weak_warning>): #fail ...
apache-2.0
panholt/sparkpy
sparkpy/models/webhook.py
1
2523
# -*- coding: utf-8 -*- from .base import SparkBase, SparkProperty from .time import SparkTime class SparkWebhook(SparkBase): ''' Cisco Spark Webhook Model :param session: SparkSession object :type session: `SparkSession` :param \**kwargs: All standard Spark API properties for a Webhook...
mit
eduble/pyc2py
inspection/classes.py
2
1904
# pyc2py - The smart python decompiler. # Copyright (C) 2012 Centre National de la Recherche Scientifique # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License,...
gpl-3.0
jtyr/ansible
test/units/parsing/yaml/test_constructor.py
33
2449
# -*- coding: utf-8 -*- # (c) 2020 Matt Martz <matt@sivel.net> # 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 import pytest from yaml import MappingNode, Mark, ScalarNode from yaml.const...
gpl-3.0
bgxavier/neutron
neutron/agent/l3/link_local_allocator.py
22
4201
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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 requir...
apache-2.0
beblount/Steer-Clear-Backend-Web
env/Lib/site-packages/jinja2/testsuite/utils.py
415
2235
# -*- coding: utf-8 -*- """ jinja2.testsuite.utils ~~~~~~~~~~~~~~~~~~~~~~ Tests utilities jinja uses. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import gc import unittest import pickle from jinja2.testsuite import JinjaTestCase from jinja2.utils imp...
mit
m3wolf/xanespy
xanespy/txmstore.py
1
21308
# -*- coding: utf-8 -*- # # Copyright © 2016 Mark Wolf # # This file is part of Xanespy. # # Xanespy 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...
gpl-3.0
chris48s/UK-Polling-Stations
polling_stations/apps/feedback/migrations/0001_initial.py
1
1210
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import django_extensions.db.fields class Migration(migrations.Migration): dependencies = [ ] operations = [ migrations.CreateModel( name='Feedback', fields=[ ...
bsd-3-clause
TeslaProject/external_chromium_org
tools/telemetry/telemetry/results/html_output_formatter.py
33
4806
# 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 datetime import json import logging import os import re from telemetry.core import util from telemetry.results import buildbot_output_formatter from ...
bsd-3-clause
nicholasserra/sentry
tests/sentry/tasks/test_beacon.py
2
2835
from __future__ import absolute_import, print_function import json import sentry from mock import patch from uuid import uuid4 from sentry import options from sentry.models import Broadcast from sentry.testutils import TestCase from sentry.tasks.beacon import BEACON_URL, send_beacon class SendBeaconTest(TestCase):...
bsd-3-clause
weidnem/IntroPython2016
students/jbearer/session02/lpthw_ex31-2.py
3
1117
print("You climb into a car. What do you do next?") print("1. Put the seat belt on.") print("2. Adjust the rearview mirror.") action1 = input("> ") if action1 == "1": print("The seat belt clicks into place. What do you do next?") print("1. Start the car.") print("2. Open the window.") action2 = input...
unlicense
LindaTNguyen/RAPID
RAPID/settings/production.py
2
1564
import os from .base import * #Added comment by LNguyen - Set service name to BASE_SITE_URL ie., https://fullservername BASE_SITE_URL = 'https://rapidpivot.com' AMQP_URL = 'amqp://guest:guest@localhost:5672//' #Added comment by LNguyen - Update with server name and IP addresse ie., [<servername', '127.0.0.1] ALLOWED_...
mit
shsingh/ansible
lib/ansible/plugins/action/async_status.py
54
1903
# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from ansible.errors import AnsibleError from ansible.plugins.action import ActionBase from ansible...
gpl-3.0
shenzebang/scikit-learn
sklearn/cluster/hierarchical.py
128
34831
"""Hierarchical Agglomerative Clustering These routines perform some hierarchical agglomerative clustering of some input data. Authors : Vincent Michel, Bertrand Thirion, Alexandre Gramfort, Gael Varoquaux License: BSD 3 clause """ from heapq import heapify, heappop, heappush, heappushpop import warnings im...
bsd-3-clause
lakshayg/tensorflow
tensorflow/contrib/data/python/ops/readers.py
13
10741
# 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
Abjad/abjad
abjad/obgc.py
1
30314
import typing from . import _iterate, mutate, typings from .attach import attach, detach from .bundle import LilyPondFormatBundle from .duration import Duration from .overrides import LilyPondLiteral, tweak from .parentage import Parentage from .pitch.sets import PitchSet from .score import Chord, Container, Note, Voi...
gpl-3.0
b-kolodziej/django-twoscoops-project
project_name/project_name/wsgi.py
23
1584
""" WSGI config for {{ project_name }} project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APP...
mit
UB-info/estructura-datos
RafaelArqueroGimeno_S6/ABB_Rafael_Arquero_Gimeno.py
1
8132
import copy __author__ = "Rafael Arquero Gimeno" class Node(object): def __init__(self): self.data = [] self.left = None self.right = None def clear(self): """Empty Node""" self.data = [] self.left = None self.right = None def clearData(self): ...
mit
ppiotr/Invenio
modules/bibrank/lib/bibrank_selfcites_unit_tests.py
6
5360
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2011, 2012 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 opt...
gpl-2.0
msaadat/paper
password_dlg.py
1
2143
from PyQt5.QtWidgets import (QApplication, QMessageBox, QDialog, QGridLayout, QHBoxLayout, QLabel, QPushButton, QLineEdit) class PasswordDialog(QDialog): def __init__(self, parent=None): super(PasswordDialog, self).__init__(parent) self.password = None ...
gpl-3.0
spcui/virt-test
qemu/tests/virtual_nic_send_buffer.py
2
6023
import logging from autotest.client import utils from autotest.client.shared import error from virttest import remote, utils_misc, utils_test @error.context_aware def run_virtual_nic_send_buffer(test, params, env): """ Test Steps: 1. boot up guest with this option sndbuf=1048576,... 2. Transfer file ...
gpl-2.0
SnappleCap/oh-mainline
vendor/packages/django-tastypie/tastypie/models.py
24
1991
from __future__ import unicode_literals import hmac import time from django.conf import settings from django.db import models from tastypie.utils import now try: from hashlib import sha1 except ImportError: import sha sha1 = sha.sha class ApiAccess(models.Model): """A simple model for use with the ``...
agpl-3.0
blueskycoco/rtt
bsp/mb9bf500r/rtconfig.py
36
3282
import os # toolchains options ARCH='arm' CPU='cortex-m3' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH = '...
gpl-2.0
Nu3001/external_chromium_org
third_party/closure_linter/closure_linter/checker.py
135
4808
#!/usr/bin/env python # # Copyright 2007 The Closure Linter 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 #...
bsd-3-clause
mikemow/youtube-dl
setup.py
107
3233
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import os.path import warnings import sys try: from setuptools import setup setuptools_available = True except ImportError: from distutils.core import setup setuptools_available = False try: # This will create an...
unlicense
naslanidis/ansible
lib/ansible/modules/cloud/atomic/atomic_image.py
25
4160
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
ZhangXinNan/tensorflow
tensorflow/contrib/opt/python/training/variable_clipping_optimizer_test.py
102
7911
# 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
MattClarke131/league
app/league/utils.py
4
1088
# -*- coding: utf-8 -*- """Helper utilities and decorators.""" from functools import wraps from flask import flash, request from flask_login import current_user from flask_login.config import EXEMPT_METHODS from league.extensions import login_manager def flash_errors(form, category='warning'): """Flash all erro...
mit
konstruktoid/ansible-upstream
lib/ansible/modules/network/avi/avi_backupconfiguration.py
26
4820
#!/usr/bin/python # # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ANSIB...
gpl-3.0
azunite/chrome_build
third_party/pylint/config.py
67
5782
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program...
bsd-3-clause
airqj/ardupilot-raspilot
Tools/autotest/apm_unit_tests/dev/arducopter_AP_Limits.py
227
2098
import arducopter import util, pexpect, sys, time, math, shutil, os from common import * import mavutil, mavwp, random def unit_test(mavproxy, mav): '''A scripted flight plan for testing AP_Limits''' time.sleep(5) print "# Setting AP_Limits parameters" mavproxy.send('param set LIM_ENABLED 1\n') ...
gpl-3.0
emersonsoftware/ansiblefork
contrib/inventory/linode.py
41
11853
#!/usr/bin/env python ''' Linode external inventory script ================================= Generates inventory that Ansible can understand by making API request to Linode using the Chube library. NOTE: This script assumes Ansible is being executed where Chube is already installed and has a valid config at ~/.chube...
gpl-3.0
costypetrisor/scikit-learn
examples/tree/plot_tree_regression_multioutput.py
43
1791
""" =================================================================== Multi-output Decision Tree Regression =================================================================== An example to illustrate multi-output regression with decision tree. The :ref:`decision trees <tree>` is used to predict simultaneously the ...
bsd-3-clause
q2apro/graph-padowan
Install/MakeBuild.py
1
2210
# -*- coding: latin-1 -*- from ftplib import FTP from getpass import getpass from VersionInfo import CalcVersionInfo import os import sys import traceback import datetime import subprocess try: # Test that Graph can be started without some obscure dll files os.system("Graph.exe /regserver") # Sign Graph.exe ...
gpl-2.0
ircah/cah-js
util/convert-csv.py
1
1612
#!/usr/bin/env python3 import re import json # turns out the dump function of the json5 module just calls the normal json module (╯°□°)╯︵ ┻━┻ INPUT = "cards-DevOpsAgainstHumanity.csv" META_NAME = "DevOps Against Humanity" DELIM = "," QUOTE = "\"" SKIPLINES = 2 def parse_csv(line): a = [] tmp = "" at_elem_start =...
mit
appliedx/edx-platform
common/lib/xmodule/xmodule/tests/test_library_root.py
145
3256
# -*- coding: utf-8 -*- """ Basic unit tests for LibraryRoot """ from mock import patch from xblock.fragment import Fragment from xblock.runtime import Runtime as VanillaRuntime from xmodule.x_module import AUTHOR_VIEW from xmodule.modulestore.tests.factories import LibraryFactory, ItemFactory from xmodule.modulestor...
agpl-3.0