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 |
|---|---|---|---|---|---|
tudorvio/nova | nova/api/openstack/compute/plugins/v3/admin_actions.py | 33 | 3773 | # Copyright 2011 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
mbbill/thefuck | thefuck/utils.py | 1 | 4781 | from difflib import get_close_matches
from functools import wraps
from pathlib import Path
from shlex import split
import os
import pickle
import re
import six
from .types import Command
DEVNULL = open(os.devnull, 'w')
if six.PY2:
from pipes import quote
else:
from shlex import quote
def which(program):
... | mit |
StephenWeber/ansible | lib/ansible/modules/system/facter.py | 25 | 1845 | #!/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 |
2013Commons/hue | desktop/core/ext-py/Django-1.4.5/django/core/files/temp.py | 536 | 1819 | """
The temp module provides a NamedTemporaryFile that can be re-opened on any
platform. Most platforms use the standard Python tempfile.TemporaryFile class,
but MS Windows users are given a custom class.
This is needed because in Windows NT, the default implementation of
NamedTemporaryFile uses the O_TEMPORARY flag, ... | apache-2.0 |
eblossom/gnuradio | gr-audio/examples/python/mono_tone.py | 58 | 2315 | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... | gpl-3.0 |
corvorepack/REPOIVAN | plugin.video.movie.ultra.7k/resources/lib/pafy.py | 24 | 53508 | # -*- coding: utf-8 -*-
"""
pafy.py.
Python library to download YouTube content and retrieve metadata
https://github.com/np1/pafy
Copyright (C) 2013-2014 np1
This program 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
So... | gpl-2.0 |
jr55662003/Diabetic-Retinopathy-website | website/diabetics/migrations/0001_initial.py | 1 | 1494 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-28 14:51
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | mit |
datenbetrieb/odoo | addons/product_margin/wizard/product_margin.py | 338 | 3457 | # -*- 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 |
rakeshmi/cinder | cinder/tests/unit/api/contrib/test_services.py | 4 | 23466 | # Copyright 2012 IBM Corp.
# 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 app... | apache-2.0 |
rmfitzpatrick/ansible | lib/ansible/modules/cloud/amazon/elb_target_group.py | 17 | 28642 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
trg1984/kooditunti | public/vendor/closure-library/closure/bin/labs/code/generate_jsdoc_test.py | 212 | 3494 | #!/usr/bin/env python
#
# Copyright 2013 The Closure Library 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
... | mit |
atizo/djangojames | djangojames/response.py | 2 | 1172 | # -*- coding: utf-8 -*-
#
# ITerativ GmbH
# http://www.iterativ.ch/
#
# Copyright (c) 2012 ITerativ GmbH. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 ... | gpl-2.0 |
wilebeast/FireFox-OS | B2G/gecko/testing/mozbase/mozdevice/sut_tests/test_isdir.py | 2 | 1270 | # 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/.
import os
import posixpath
from dmunit import DeviceManagerTestCase
class IsDirTestCase(DeviceManagerTestCase):
... | apache-2.0 |
nop33/indico-plugins | vc_vidyo/indico_vc_vidyo/http_api.py | 1 | 2410 | # This file is part of Indico.
# Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
silenci/neutron | neutron/tests/unit/agent/dhcp/test_agent.py | 3 | 70600 | # Copyright 2012 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 |
lordB8r/polls | ENV/lib/python2.7/site-packages/django/utils/unittest/runner.py | 571 | 6761 | """Running tests"""
import sys
import time
import unittest
from django.utils.unittest import result
try:
from django.utils.unittest.signals import registerResult
except ImportError:
def registerResult(_):
pass
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like obj... | mit |
adwiputra/LUMENS-repo | processing/gdal/proximity.py | 4 | 4336 | # -*- coding: utf-8 -*-
"""
***************************************************************************
proximity.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... | gpl-2.0 |
ToonTownInfiniteRepo/ToontownInfinite | otp/speedchat/SCEmoteTerminal.py | 6 | 3770 | from direct.gui.DirectGui import *
from SCTerminal import SCTerminal
from otp.otpbase.OTPLocalizer import EmoteList, EmoteWhispers
from otp.avatar import Emote
SCEmoteMsgEvent = 'SCEmoteMsg'
SCEmoteNoAccessEvent = 'SCEmoteNoAccess'
def decodeSCEmoteWhisperMsg(emoteId, avName):
if emoteId >= len(EmoteWhispers):
... | mit |
navierula/Research-Fall-2017 | minMaxCalc/cycleExample.py | 1 | 3773 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
bringing all parts of the code together in a small example
"""
trial_lst = [0.5, 3, 6, 40, 90, 130.8, 129, 111, 8, 9, 0.01, 9, 40, 90, 130.1, 112,
108, 90, 77, 68, 0.9, 8, 40, 90, 92, 130.4]
trial_lst.sort(key=float)
totals = []
for count, items in enum... | mit |
gram526/VTK | IO/Geometry/Testing/Python/Plot3DScalars.py | 20 | 3940 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
#
# All Plot3D scalar functions
#
# Create the RenderWindow, Renderer and both Actors
#
renWin = vtk.vtkRenderWindow()
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renW... | bsd-3-clause |
ccccccccccc/mitmproxy | examples/stub.py | 21 | 1972 | """
This is a script stub, with definitions for all events.
"""
def start(context, argv):
"""
Called once on script startup, before any other events.
"""
context.log("start")
def clientconnect(context, root_layer):
"""
Called when a client initiates a connection to the proxy. Not... | mit |
MicroTrustRepos/microkernel | src/l4/pkg/python/contrib/Modules/cgen.py | 44 | 15363 | ########################################################################
# Copyright (c) 2000, BeOpen.com.
# Copyright (c) 1995-2000, Corporation for National Research Initiatives.
# Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
# All rights reserved.
#
# See the file "Misc/COPYRIGHT" for information on usag... | gpl-2.0 |
DirtyUnicorns/android_kernel_motorola_msm8992 | scripts/build-all.py | 704 | 14699 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. 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
# ... | gpl-2.0 |
2014c2g2/2014c2 | wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/dom/pulldom.py | 850 | 11761 | import xml.sax
import xml.sax.handler
START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"
class PullDOM(... | gpl-2.0 |
demisto/content | Packs/ApiModules/Scripts/CSVFeedApiModule/CSVFeedApiModule_test.py | 1 | 12349 | import requests_mock
from CSVFeedApiModule import *
import io
import pytest
def test_get_indicators_1():
"""Test with 1 fieldname"""
feed_url_to_config = {
'https://ipstack.com': {
'fieldnames': ['value'],
'indicator_type': 'IP'
}
}
with open('test_data/ip_rang... | mit |
jimcunderwood/MissionPlanner | Lib/encodings/iso8859_1.py | 93 | 13739 | """ Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.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... | gpl-3.0 |
ptemplier/ansible | test/runner/lib/docker_util.py | 61 | 5347 | """Functions for accessing docker via the docker cli."""
from __future__ import absolute_import, print_function
import json
import os
import time
from lib.executor import (
SubprocessError,
)
from lib.util import (
ApplicationError,
run_command,
common_environment,
display,
)
from lib.config im... | gpl-3.0 |
eagleamon/home-assistant | homeassistant/components/rpi_gpio.py | 28 | 1719 | """
Support for controlling GPIO pins of a Raspberry Pi.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/rpi_gpio/
"""
# pylint: disable=import-error
import logging
from homeassistant.const import (
EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STO... | apache-2.0 |
scroggo/skia | tools/skp/page_sets/skia_booking_desktop.py | 9 | 1217 | # 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.
# pylint: disable=W0401,W0614
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SkiaBuildbotDesk... | bsd-3-clause |
utecuy/edx-platform | lms/djangoapps/instructor_analytics/distributions.py | 174 | 5760 | """
Profile Distributions
Aggregate sums for values of fields in students profiles.
For example:
The distribution in a course for gender might look like:
'gender': {
'type': 'EASY_CHOICE',
'data': {
'no_data': 1234,
'm': 5678,
'o': 2134,
'f': 5678
},
'display_names': {
... | agpl-3.0 |
octopus-platform/octopus-tools | octopus/importer/OctopusImporter.py | 4 | 1265 | import sys, os
import http.client
import urllib
from octopus.server.project_manager import ProjectManager
from octopus.server.plugin_executor import PluginExecutor
class OctopusImporter:
def __init__(self):
pass
def importFile(self, filename):
self.filename = filename
self.initProjec... | lgpl-3.0 |
Jgarcia-IAS/SITE | addons/hr_timesheet_sheet/__openerp__.py | 52 | 3055 | # -*- 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 |
marshall007/rethinkdb | test/rdb_workloads/stress_workloads/x_write.py | 50 | 3827 | #!/usr/bin/env python
import md5, sys, os, random, string, x_stress_util
import multiprocessing
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import utils
r = utils.import_python_driver()
class Workload:
def __init__(self, options):
self.db = option... | agpl-3.0 |
stevenbrichards/boto | boto/services/message.py | 170 | 2393 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
sile16/swarm | dns/opcode.py | 248 | 2615 | # Copyright (C) 2001-2007, 2009, 2010 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 ... | mit |
josjevv/django-cms | cms/test_utils/project/objectpermissionsapp/migrations/0001_initial.py | 66 | 1170 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('content... | bsd-3-clause |
Mic92/ansible | contrib/inventory/azure_rm.py | 6 | 32093 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <mdavis@ansible.com>
# Chris Houseknecht, <house@redhat.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 Soft... | gpl-3.0 |
thodoris/djangoPharma | djangoPharma/env/Lib/site-packages/django/contrib/sitemaps/__init__.py | 50 | 5638 | from django.apps import apps as django_apps
from django.conf import settings
from django.core import paginator
from django.core.exceptions import ImproperlyConfigured
from django.urls import NoReverseMatch, reverse
from django.utils import translation
from django.utils.six.moves.urllib.parse import urlencode
from djang... | apache-2.0 |
komsas/OpenUpgrade | addons/hw_posbox_upgrade/__openerp__.py | 64 | 1638 | # -*- 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 |
cgstudiomap/cgstudiomap | main/parts/odoo/addons/email_template/__init__.py | 381 | 1144 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
RiccardoPecora/MP | Lib/site-packages/scipy/stats/setup.py | 51 | 1085 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
from os.path import join
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('stats', parent_package, top_path)
config.add_data_... | gpl-3.0 |
matthewos/omaha | standalone/standalone_installer.py | 61 | 17007 | #!/usr/bin/python2.4
# Copyright 2009 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 |
anryko/ansible | test/units/modules/storage/netapp/test_na_ontap_volume.py | 21 | 38166 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... | gpl-3.0 |
zhjunlang/kbengine | kbe/res/scripts/common/Lib/idlelib/idle_test/test_searchdialogbase.py | 67 | 5860 | '''Unittests for idlelib/SearchDialogBase.py
Coverage: 99%. The only thing not covered is inconsequential --
testing skipping of suite when self.needwrapbutton is false.
'''
import unittest
from test.support import requires
from tkinter import Tk, Toplevel, Frame, Label, BooleanVar, StringVar
from idlelib import Sear... | lgpl-3.0 |
rossumai/keras-multi-gpu | keras_tf_multigpu/examples/avolkov1/cifar/tf_examples/cifar10.py | 2 | 14682 | #@PydevCodeAnalysisIgnore
# 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
#
# ... | mit |
xb446909/personalprojects | crosstool/source/linux-4.1.2/tools/perf/scripts/python/futex-contention.py | 1997 | 1508 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
pcarrier/linux | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
deepfield/ibis | ibis/expr/tests/test_format.py | 1 | 5563 | import ibis
from ibis.expr.types import Expr
from ibis.expr.format import ExprFormatter
def test_format_custom_expr():
class CustomExpr(Expr):
def _type_display(self):
return 'my-custom'
op = ibis.literal(5).op()
expr = CustomExpr(op)
result = repr(expr)
expected = 'Literal... | apache-2.0 |
Adai0808/pybrain | pybrain/tests/unittests/structure/networks/test_network_decomposition.py | 25 | 1660 | """
Build a decomposable network
>>> n = buildDecomposableNetwork()
Check if it was built correctly
>>> print(n.paramdim)
12
>>> tmp = n.getDecomposition()
>>> tmp[2]
array([ 1., 1., 1., 1.])
Let's keep the output value for later
>>> act = n.activate([-1.2,0.5])
Now, change the value... | bsd-3-clause |
vv1133/home_web | build/lib.linux-armv6l-2.7/django/conf/locale/de/formats.py | 118 | 1104 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DAT... | bsd-3-clause |
NINAnor/QGIS | tests/src/python/test_qgspoint.py | 2 | 1732 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsPoint.
.. 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 Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__author... | gpl-2.0 |
jesramirez/odoo | addons/l10n_ec/__openerp__.py | 260 | 1695 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2010-2012 Cristian Salamea Gnuthink Software Labs Cia. Ltda
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Lic... | agpl-3.0 |
Rithie/physical-web | web-service/shortener.py | 40 | 1643 | #!/usr/bin/env python
#
# 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 o... | apache-2.0 |
icemac/pytest | _pytest/tmpdir.py | 189 | 4123 | """ support for providing temporary directories to test functions. """
import re
import pytest
import py
from _pytest.monkeypatch import monkeypatch
class TempdirFactory:
"""Factory for temporary directories under the common base temp directory.
The base directory can be configured using the ``--basetemp``... | mit |
apark263/tensorflow | tensorflow/contrib/learn/python/learn/utils/gc.py | 39 | 6867 | # 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 |
hbrunn/account-invoicing | account_invoice_line_description/res_config.py | 27 | 1502 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Agile Business Group sagl
# (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public ... | agpl-3.0 |
ycl2045/nova-master | nova/tests/integrated/v3/test_flavor_access.py | 20 | 3173 | # 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 required by applicable law or agreed t... | apache-2.0 |
350dotorg/Django | tests/modeltests/custom_pk/fields.py | 39 | 1453 | import random
import string
from django.db import models
class MyWrapper(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return "<%s: %s>" % (self.__class__.__name__, self.value)
def __unicode__(self):
return self.value
def __eq__(self, other):
... | bsd-3-clause |
cuilishen/cuilishenMissionPlanner | Lib/site-packages/scipy/signal/info.py | 55 | 5542 | """
Signal Processing Tools
=======================
Convolution:
convolve:
N-dimensional convolution.
correlate:
N-dimensional correlation.
fftconvolve:
N-dimensional convolution using the FFT.
convolve2d:
2-dimensional convolution (more options).
correlate2d:
... | gpl-3.0 |
hujiajie/chromium-crosswalk | tools/perf/page_sets/tough_animation_cases.py | 7 | 15507 | # 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.
from telemetry.page import page as page_module
from telemetry import story
class ToughAnimationCasesPage(page_module.Page):
def __init__(self, url, page_... | bsd-3-clause |
berendkleinhaneveld/VTK | ThirdParty/Twisted/twisted/news/test/test_nntp.py | 39 | 5693 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.news import database
from twisted.news import nntp
from twisted.protocols import loopback
from twisted.test import proto_helpers
ALL_GROUPS = ('alt.test.nntp', 0, 1, 'y'),
GROUP = ('0', '1', '0', 'a... | bsd-3-clause |
alimony/django | tests/forms_tests/widget_tests/test_textarea.py | 331 | 1313 | from django.forms import Textarea
from django.utils.safestring import mark_safe
from .base import WidgetTest
class TextareaTest(WidgetTest):
widget = Textarea()
def test_render(self):
self.check_html(self.widget, 'msg', 'value', html=(
'<textarea rows="10" cols="40" name="msg">value</tex... | bsd-3-clause |
brettlangdon/dd-agent | tests/checks/mock/test_teamcity.py | 15 | 3693 | # stdlib
import unittest
# 3p
from mock import MagicMock, patch
# project
from tests.checks.common import load_check
CONFIG = {
'init_config': {},
'instances': [
{
'name': 'One test build',
'server': 'localhost:8111',
'build_configuration': 'TestProject_TestBuild',... | bsd-3-clause |
vladryk/horizon | openstack_dashboard/contrib/sahara/content/data_processing/cluster_templates/forms.py | 25 | 2225 | # 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 the... | apache-2.0 |
xionzz/earthquake | venv/lib/python2.7/site-packages/numpy/lib/tests/test_utils.py | 149 | 1466 | from __future__ import division, absolute_import, print_function
import sys
from numpy.core import arange
from numpy.testing import (
run_module_suite, assert_, assert_equal, dec
)
from numpy.lib import deprecate
import numpy.lib.utils as utils
if sys.version_info[0] >= 3:
from io import StringIO
else:
... | mit |
alexteodor/odoo | addons/hw_scale/__init__.py | 1894 | 1075 | # -*- 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... | agpl-3.0 |
kyuupichan/electrum | gui/kivy/uix/context_menu.py | 1 | 1297 | #!python
#!/usr/bin/env python
from kivy.app import App
from kivy.uix.bubble import Bubble
from kivy.animation import Animation
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.factory import Factory
from kivy.clock import Clock
from electrum_gui.kivy.i18n import _
Builder.load_str... | mit |
nupic-community/menorah | menorah/nupic_output.py | 1 | 6056 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
Liangjianghao/powerline | powerline/commands/daemon.py | 34 | 1203 | # vim:fileencoding=utf-8:noet
from __future__ import (division, absolute_import, print_function)
import argparse
def get_argparser(ArgumentParser=argparse.ArgumentParser):
parser = ArgumentParser(description='Daemon that improves powerline performance.')
parser.add_argument(
'--quiet', '-q', action='store_true',... | mit |
ToontownUprising/src | toontown/pets/PetshopGUI.py | 2 | 30147 | from direct.directnotify import DirectNotifyGlobal
from direct.gui.DirectGui import *
from direct.showbase.DirectObject import DirectObject
from pandac.PandaModules import *
import random
import string
from toontown.fishing import FishSellGUI
from toontown.hood import ZoneUtil
from toontown.pets import Pet, PetConstan... | mit |
afaheem88/tempest | tempest/clients.py | 6 | 21240 | # Copyright 2012 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 |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/crf/__init__.py | 64 | 1633 | # 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... | bsd-2-clause |
cesargtz/YecoraOdoo | addons/hr_holidays/__init__.py | 442 | 1094 | # -*- 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 |
mcgill-robotics/compsys | scripts/bag/bag/util/parser.py | 1 | 4584 | # -*- coding: utf-8 -*-
"""Parse command line arguments for subcommands and shortcuts."""
import sys
import argparse
from bag.cmd import record, merge
class Help(argparse.Action):
"""Display parser's help on screen and exit."""
def __call__(self, parser, namespace, values, option_string=None):
"""D... | mit |
jdhp-sap/data-pipeline-standalone-scripts | utils/plot_score_correlation.py | 2 | 3747 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make statistics on score files (stored in JSON files).
"""
import common_functions as common
import argparse
import json
import numpy as np
from matplotlib import pyplot as plt
if __name__ == '__main__':
# PARSE OPTIONS #######################################... | mit |
jhjguxin/blogserver | lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/creation.py | 308 | 2845 | from django.conf import settings
from django.db.backends.postgresql.creation import DatabaseCreation
class PostGISCreation(DatabaseCreation):
geom_index_type = 'GIST'
geom_index_opts = 'GIST_GEOMETRY_OPS'
def sql_indexes_for_field(self, model, f, style):
"Return any spatial index creation SQL for ... | mit |
0x46616c6b/ansible | lib/ansible/plugins/action/win_reboot.py | 108 | 5870 | # (c) 2016, Matt Davis <mdavis@ansible.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) any later version... | gpl-3.0 |
gdooper/scipy | scipy/_build_utils/_fortran.py | 92 | 5611 | import re
import sys
import os
import glob
from distutils.dep_util import newer
__all__ = ['needs_g77_abi_wrapper', 'split_fortran_files',
'get_g77_abi_wrappers',
'needs_sgemv_fix', 'get_sgemv_fix']
def uses_veclib(info):
if sys.platform != "darwin":
return False
r_accelerate =... | bsd-3-clause |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.4/tests/modeltests/model_formsets/tests.py | 33 | 61215 | from __future__ import absolute_import
import datetime
import re
from datetime import date
from decimal import Decimal
from django import forms
from django.db import models
from django.forms.models import (_get_foreign_key, inlineformset_factory,
modelformset_factory)
from django.test import TestCase, skipUnlessD... | apache-2.0 |
joebowman/webcode | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/_postgres_builtins.py | 269 | 9648 | # -*- coding: utf-8 -*-
"""
pygments.lexers._postgres_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Self-updating data files for PostgreSQL lexer.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import urllib
# One man's cons... | mit |
travisfcollins/gnuradio | grc/gui/DrawingArea.py | 22 | 6232 | """
Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 ... | gpl-3.0 |
google-research/federated | fedopt_guide/gld23k_mobilenet/dataset.py | 1 | 4352 | # Copyright 2020, Google LLC.
#
# 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... | apache-2.0 |
uwafsl/MissionPlanner | Lib/optparse.py | 55 | 62827 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionPa... | gpl-3.0 |
bryan5989/jhalfs | menu/menuconfig.py | 2 | 102616 | #!/usr/bin/env python3
# Copyright (c) 2018-2019, Nordic Semiconductor ASA and Ulf Magnusson
# SPDX-License-Identifier: ISC
"""
Overview
========
A curses-based menuconfig implementation. The interface should feel familiar to
people used to mconf ('make menuconfig').
Supports the same keys as mconf, and also suppor... | mit |
f-guichard/cf-sample-php-buildpack-custo | lib/yaml/dumper.py | 542 | 2719 |
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']
from emitter import *
from serializer import *
from representer import *
from resolver import *
class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):
def __init__(self, stream,
default_style=None, default_flow_style=None,
c... | apache-2.0 |
repotvsupertuga/repo | plugin.video.loganaddon/resources/lib/sources/putlocker_mv_tv.py | 6 | 7430 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
ChronoMonochrome/android_external_chromium_org | third_party/closure_linter/closure_linter/javascriptlintrules.py | 108 | 23113 | #!/usr/bin/env python
#
# Copyright 2011 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 |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/kernel_tests/sparse_reshape_op_test.py | 48 | 12887 | # 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... | mit |
Fajkowsky/pyKindle | pykindle.py | 1 | 1308 | import argparse
import os
import logging
import re
# SETTINGS
BUILD_DIR = 'build/'
# UTILS
def create_dir(dir=BUILD_DIR):
if not os.path.exists(dir):
os.makedirs(dir)
def delete_dir(dir=BUILD_DIR):
if os.path.exists(dir):
os.rmdir(dir)
def check_dir(path):
return os.path.isdir(path)
... | mit |
namanjain236/personfinder | app/simplejson/decoder.py | 317 | 12404 | """Implementation of JSONDecoder
"""
import re
import sys
import struct
from simplejson.scanner import make_scanner
try:
from simplejson._speedups import scanstring as c_scanstring
except ImportError:
c_scanstring = None
__all__ = ['JSONDecoder']
FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL
def _floatconst... | apache-2.0 |
js0701/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_parser.py | 35 | 6499 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above
# copyright n... | bsd-3-clause |
huguesv/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/multiprocessing/dummy/__init__.py | 13 | 3058 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [
'Process', 'current_process', 'active_children', 'freeze_support',
'Lock', 'RLock', 'Semaphore', 'Boun... | apache-2.0 |
valiantljk/graph-partition | generators/tests/test_ego.py | 72 | 1347 | #!/usr/bin/env python
"""
ego graph
---------
"""
from nose.tools import assert_true, assert_equal
import networkx as nx
class TestGeneratorEgo():
def test_ego(self):
G=nx.star_graph(3)
H=nx.ego_graph(G,0)
assert_true(nx.is_isomorphic(G,H))
G.add_edge(1,11)
G.add_edge(2,22)... | gpl-2.0 |
mmauroy/SickRage | lib/mako/ext/turbogears.py | 60 | 2143 | # ext/turbogears.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import inspect
from mako import compat
from mako.lookup import TemplateLookup
from mako.template... | gpl-3.0 |
Changaco/oh-mainline | vendor/packages/twisted/twisted/test/plugin_basic.py | 62 | 1029 | # Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
# Don't change the docstring, it's part of the tests
"""
I'm a test drop-in. The plugin system's unit tests use me. No one
else should.
"""
from zope.interface import classProvides
from twisted.plugin import I... | agpl-3.0 |
suyashphadtare/vestasi-erp-new-final | erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 31 | 9280 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
import copy
from frappe import throw, _
from frappe.utils import flt, cint
from frappe.model.docume... | agpl-3.0 |
lunafeng/django | django/contrib/auth/views.py | 154 | 12383 | import functools
import warnings
from django.conf import settings
# Avoid shadowing the login() and logout() views below.
from django.contrib.auth import (
REDIRECT_FIELD_NAME, get_user_model, login as auth_login,
logout as auth_logout, update_session_auth_hash,
)
from django.contrib.auth.decorators import log... | bsd-3-clause |
cinnamoncoin/eloipool_Blakecoin | bitcoin/varlen.py | 20 | 1753 | # Eloipool - Python Bitcoin pool server
# Copyright (C) 2011-2012 Luke Dashjr <luke-jr+eloipool@utopios.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# L... | mit |
newemailjdm/scipy | scipy/sparse/extract.py | 36 | 4756 | """Functions to extract parts of sparse matrices
"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['find', 'tril', 'triu']
from .coo import coo_matrix
def find(A):
"""Return the indices and values of the nonzero elements of a matrix
Par... | bsd-3-clause |
lamarmeigs/django-clean-fields | clean_fields/utils.py | 1 | 1866 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
class NoValue(object):
"""Empty class for disambiguating calls to getattr"""
pass
def get_model_field_value(instance, field_name):
"""Retrieve the value of... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.