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
schlueter/ansible
lib/ansible/modules/monitoring/airbrake_deployment.py
56
3599
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2013 Bruce Pennypacker <bruce@pennypacker.org> # 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_versio...
gpl-3.0
bobwalker99/Pydev
plugins/org.python.pydev.jython/Lib/_weakrefset.py
33
6305
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref __all__ = ['WeakSet'] class _IterationGuard(object): # This context manager registers itself in the current iterators of the # weak containe...
epl-1.0
sean797/Flexget
flexget/plugins/filter/exists_movie.py
8
7530
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import logging import re from path import Path from flexget import plugin from flexget.config_schema import one_or_more from flexget....
mit
zsjohny/jumpserver
apps/terminal/api/storage.py
1
2385
# coding: utf-8 # from rest_framework import viewsets, generics, status from rest_framework.response import Response from django.utils.translation import ugettext_lazy as _ from common.permissions import IsSuperUser from ..models import CommandStorage, ReplayStorage from ..serializers import CommandStorageSerializer,...
gpl-2.0
damiansoriano/odoo
addons/event/__openerp__.py
20
2407
# -*- 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
xq262144/hue
desktop/core/ext-py/Mako-0.8.1/test/test_filters.py
36
9579
# -*- coding: utf-8 -*- from mako.template import Template import unittest from test import TemplateTest, eq_, requires_python_2 from test.util import result_lines, flatten_result from mako.compat import u class FilterTest(TemplateTest): def test_basic(self): t = Template(""" ${x | myfilter} """) ...
apache-2.0
tjsavage/sfcsdatabase
sfcs/django/db/utils.py
78
6129
import inspect import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module DEFAULT_DB_ALIAS = 'default' # Define some exceptions that mirror the PEP249 interface. # We will rethrow any backend-specific errors using these # commo...
bsd-3-clause
squirrelo/qiime
tests/test_pick_rep_set.py
15
20044
#!/usr/bin/env python """Tests of code for representative set picking""" __author__ = "Rob Knight" __copyright__ = "Copyright 2011, The QIIME Project" # remember to add yourself if you make changes __credits__ = ["Rob Knight", "Kyle Bittinger", "Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintain...
gpl-2.0
cnsoft/kbengine-cocos2dx
kbe/src/lib/python/Lib/test/test_metaclass.py
59
6062
doctests = """ Basic class construction. >>> class C: ... def meth(self): print("Hello") ... >>> C.__class__ is type True >>> a = C() >>> a.__class__ is C True >>> a.meth() Hello >>> Use *args notation for the bases. >>> class A: pass >>> class B: pass >>>...
lgpl-3.0
rombie/contrail-controller
src/container/kube-cni/kube_cni/params/params.py
3
10883
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. # """ CNI plugin parameters processing module Parameters are defined in 3 different classes - ContrailParams : Contains contrain specific parameters - K8SParams : Contains kubernetes specific parameters - Cni...
apache-2.0
benjaminjack/pinetree
lib/pybind11/setup.py
17
4485
#!/usr/bin/env python # Setup script for PyPI; use CMakeFile.txt to build extension modules from setuptools import setup from distutils.command.install_headers import install_headers from pybind11 import __version__ import os # Prevent installation of pybind11 headers by setting # PYBIND11_USE_CMAKE. if os.environ.g...
mit
anandpdoshi/frappe
frappe/email/doctype/email_alert/test_email_alert.py
8
3857
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe, frappe.utils, frappe.utils.scheduler import unittest test_records = frappe.get_test_records('Email Alert') class TestEmailAlert(unittest.TestCase): def setUp(self): frappe....
mit
google-research/google-research
better_storylines/src/evaluate_story_cloze_test.py
1
4258
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
andreparrish/python-for-android
python-modules/twisted/twisted/python/win32.py
56
5492
# -*- test-case-name: twisted.python.test.test_win32 -*- # Copyright (c) 2001-2010 Twisted Matrix Laboratories. # See LICENSE for details. """ Win32 utilities. See also twisted.python.shortcut. @var O_BINARY: the 'binary' mode flag on Windows, or 0 on other platforms, so it may safely be OR'ed into a mask for os...
apache-2.0
jazkarta/edx-platform
openedx/core/djangoapps/credit/migrations/0007_auto__add_field_creditprovider_enable_integration__chg_field_creditpro.py
84
11967
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Removing unique constraint on 'CreditProvider', fields ['provider_url'] ...
agpl-3.0
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/host/lib/python2.7/test/test_getargs2.py
35
12391
import unittest from test import test_support # Skip this test if the _testcapi module isn't available. test_support.import_module('_testcapi') from _testcapi import getargs_keywords import warnings """ > How about the following counterproposal. This also changes some of > the other format codes to be a little more re...
gpl-2.0
ORNL-CEES/Cap
python/example/helpers.py
3
2254
from pycap import Observer, ECLabAsciiFile from IPython import display from numpy import real, imag, absolute, angle from matplotlib import pyplot from sys import stdout, exit from os import remove class PrintColumns(Observer): def __new__(cls, *args, **kwargs): return object.__new__(PrintColumns) d...
bsd-3-clause
dkodnik/Ant
addons/auth_oauth_signup/res_users.py
39
2471
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-2012 OpenERP SA (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
Lyrositor/CoilSnake
coilsnake/model/eb/map_music.py
5
1493
from coilsnake.model.common.table import TableEntry, LittleEndianIntegerTableEntry, RowTableEntry from coilsnake.model.eb.table import EbEventFlagTableEntry MapMusicSubTableEntry = RowTableEntry.from_schema( name="Map Music Sub Table Entry", schema=[EbEventFlagTableEntry, type("Music", (LittleEndi...
gpl-3.0
wxkdesky/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/preparechangelogforrevert_unittest.py
122
5545
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
vovojh/gem5
src/arch/x86/isa/insts/general_purpose/compare_and_test/bit_test.py
89
10961
# Copyright (c) 2007-2008 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware imp...
bsd-3-clause
mjg2203/edx-platform-seas
common/djangoapps/django_comment_common/migrations/0001_initial.py
188
6980
# -*- coding: utf-8 -*- from south.v2 import SchemaMigration class Migration(SchemaMigration): # # cdodge: This is basically an empty migration since everything has - up to now - managed in the django_comment_client app # But going forward we should be using this migration # def forwards(self, orm): pass ...
agpl-3.0
dgarros/ansible
test/units/modules/network/nxos/test_nxos_bgp_neighbor.py
23
1955
# (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is dis...
gpl-3.0
rafaelang/django-rest-framework
rest_framework/utils/formatting.py
72
2012
""" Utility functions to return a formatted name and description for a given view. """ from __future__ import unicode_literals import re from django.utils.encoding import force_text from django.utils.html import escape from django.utils.safestring import mark_safe from rest_framework.compat import apply_markdown d...
bsd-2-clause
jymannob/Sick-Beard
lib/socks/__init__.py
138
16505
"""SocksiPy - Python SOCKS module. Version 1.00 Copyright 2006 Dan-Haim. 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 notice, this ...
gpl-3.0
jbq/uwsgi
t/pypy/t_continulet1.py
11
1191
""" simplified test for continulet without checking for partial writes to enable continulets you only need to call uwsgi_pypy_setup_continulets() soon after startup: uwsgi --pypy-wsgi-file t/pypy/t_continulet1.py --http-socket :9090 --pypy-home /opt/pypy --pypy-eval "uwsgi_pypy_setup_continulets()" --async 8 """ imp...
gpl-2.0
xrmx/django
django/contrib/sessions/backends/cache.py
25
2491
from django.conf import settings from django.contrib.sessions.backends.base import CreateError, SessionBase from django.core.cache import caches from django.utils.six.moves import range KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
bsd-3-clause
MMOwning/MMOCore
dep/libmpq/bindings/python/mpq.py
107
10430
"""wrapper for libmpq""" # 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 is distributed in the hope th...
gpl-2.0
edxzw/edx-platform
openedx/core/djangoapps/user_api/models.py
55
4107
""" Django ORM model specifications for the User API application """ from django.contrib.auth.models import User from django.core.validators import RegexValidator from django.db import models from django.db.models.signals import post_delete, pre_save, post_save from django.dispatch import receiver from model_utils.mode...
agpl-3.0
dhomeier/astropy
astropy/time/core.py
3
109168
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ The astropy.time package provides functionality for manipulating times and dates. Specific emphasis is placed on supporting time scales (e.g. UTC, TAI, UT1) and time representations (e.g. JD, MJD, ISO 8601) that are used in astr...
bsd-3-clause
DataDog/integrations-core
gitlab_runner/tests/common.py
1
1976
# (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os from datadog_checks.base.utils.common import get_docker_hostname HERE = os.path.dirname(os.path.abspath(__file__)) # Networking HOST = get_docker_hostname() GITLAB_TEST_TOKEN = "ddtesttoken"...
bsd-3-clause
x111ong/django
tests/generic_views/models.py
382
1631
from django.core.urlresolvers import reverse from django.db import models from django.db.models import QuerySet from django.db.models.manager import BaseManager from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Artist(models.Model): name = models.CharField(max_length...
bsd-3-clause
claudio-bonati/sun-topo-c
tools/analisi_top.py
1
2132
#!/usr/bin/env python3 import os, glob, sys import numpy as np from scipy.optimize import fmin out_form="The output is #latox, latoy, latoz, latot, beta and then\n" out_form+="i, <Q^2>/vol, b_2, b_4, k_1/vol, k_2/vol, k_3/vol, k_4/vol, <Q Q_{noncool}>/<Q^2> \n" out_form+="where Q=top. charge after i*cooling and k_n a...
gpl-3.0
JioEducation/edx-platform
common/test/acceptance/tests/lms/test_library.py
20
13509
# -*- coding: utf-8 -*- """ End-to-end tests for LibraryContent block in LMS """ import ddt import textwrap from nose.plugins.attrib import attr from ..helpers import UniqueCourseTest, TestWithSearchIndexMixin from ...pages.studio.auto_auth import AutoAuthPage from ...pages.studio.overview import CourseOutlinePage fro...
agpl-3.0
c2g14/cda_0628
static/Brython3.1.1-20150328-091302/Lib/ui/dialog.py
607
4994
from . import widget from browser import html, document class Dialog(widget.DraggableWidget): def __init__(self, id=None): self._div_shell=html.DIV( Class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-draggable ui-resizable", style={'position': 'absolute', 'height': 'auto',...
agpl-3.0
hacksterio/pygments.rb
vendor/pygments-main/pygments/lexers/trafficscript.py
23
1546
# -*- coding: utf-8 -*- """ pygments.lexers.trafficscript ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for RiverBed's TrafficScript (RTS) language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexe...
mit
vrooje/pulsar-hunters-analysis
aggregate_pulsarclass.py
1
33505
#Python 2.7.9 (default, Apr 5 2015, 22:21:35) import sys, os # file with raw classifications (csv) # put this way up here so if there are no inputs we exit quickly before even trying to load everything else try: classfile_in = sys.argv[1] except: #classfile_in = 'data/2e3d12a2-56ca-4d1f-930a-9ecc7fd39885.csv'...
mit
DirtyUnicorns/android_external_chromium_org
third_party/jstemplate/compile.py
184
1402
#!/usr/bin/env python # Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Combines the javascript files needed by jstemplate into a single file.""" import httplib import urllib def main(): srcs = [...
bsd-3-clause
40223137/cdag7test37
static/Brython3.1.3-20150514-095342/Lib/pydoc.py
637
102017
#!/usr/bin/env python3 """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydoc <name>" to show documentation ...
gpl-3.0
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/tarfile.py
26
88986
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- #------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustäbel <lars@gustaebel.de> # All rights reserved. # # Permission is hereby granted, fre...
gpl-2.0
dhermes/gcloud-python
bigtable/tests/unit/test_app_profile.py
4
26669
# Copyright 2018 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
kenshay/ImageScripter
ProgramData/Android/ADB/platform-tools/systrace/catapult/telemetry/telemetry/value/trace.py
5
5019
# 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 logging import os import random import shutil import sys import tempfile from py_utils import cloud_storage # pylint: disable=import...
gpl-3.0
simbs/edx-platform
common/test/acceptance/tests/studio/test_studio_asset.py
37
1708
""" Acceptance tests for Studio related to the asset index page. """ from ...pages.studio.asset_index import AssetIndexPage from .base_studio_test import StudioCourseTest from ...fixtures.base import StudioApiLoginError class AssetIndexTest(StudioCourseTest): """ Tests for the Asset index page. """ ...
agpl-3.0
LeShadow/MTGProject
data_process/set.py
1
1308
class Set: def __init__(self): self.name = "" self.code = "" self.code_magiccards = "" self.is_promo = False self.date = "" def setName(self, name): self.name = name def getName(self, name): return self.name def setCode(self, code): sel...
gpl-3.0
mozilla-b2g/external_skia
gm/rebaseline_server/imagediffdb.py
65
16019
#!/usr/bin/python """ Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Calulate differences between image pairs, and store them in a database. """ import contextlib import csv import logging import os import re import shutil import sys impo...
bsd-3-clause
blueboxgroup/nova
nova/objects/migration.py
7
4655
# 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 agree...
apache-2.0
TangHao1987/intellij-community
python/lib/Lib/email/quopriMIME.py
93
10839
# Copyright (C) 2001-2006 Python Software Foundation # Author: Ben Gertzfield # Contact: email-sig@python.org """Quoted-printable content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode US ASCII-like 8-bit data called `quoted-printable'. It...
apache-2.0
hkchenhongyi/django
django/core/management/utils.py
405
2590
from __future__ import unicode_literals import os import sys from subprocess import PIPE, Popen from django.utils import six from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text from .base import CommandError def popen_wrapper(args, os_err_exc_type=CommandError, universal_newlines=True): """ ...
bsd-3-clause
Genomon-Project/paplot
scripts/paplot/convert.py
1
5764
# -*- coding: utf-8 -*- """ Created on Thu May 12 12:34:57 2016 @author: okada $Id: convert.py 208 2017-08-16 06:16:25Z aokada $ """ import paplot.subcode.tools as tools def prohibition(text): import re new_text = re.sub(r'[\'"/;:\[\] ]', "_", text) if re.match(r'^[0-9]', new_text): new_text = "_...
mit
iulian787/spack
var/spack/repos/builtin/packages/candle-benchmarks/package.py
2
1543
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class CandleBenchmarks(Package): """ECP-CANDLE Benchmarks""" homepage = "https://github.com...
lgpl-2.1
wfxiang08/ansible
test/integration/setup_gce.py
131
1388
''' Create GCE resources for use in integration tests. Takes a prefix as a command-line argument and creates two persistent disks named ${prefix}-base and ${prefix}-extra and a snapshot of the base disk named ${prefix}-snapshot. prefix will be forced to lowercase, to ensure the names are legal GCE resource names. ''' ...
gpl-3.0
nestle1998/srs
trunk/3rdparty/gprof/gprof2dot.py
46
72884
#!/usr/bin/env python # # Copyright 2008-2009 Jose Fonseca # # 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 Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ...
mit
uw-it-aca/spotseeker_server
spotseeker_server/test/search/uw_noise_level.py
1
4334
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from django.test import TestCase from django.test.client import Client from django.test.utils import override_settings import simplejson as json from spotseeker_server.models import Spot, SpotExtendedInfo from spotseeker_server.org_...
apache-2.0
wanghaven/readthedocs.org
readthedocs/restapi/views/core_views.py
25
3594
from rest_framework import decorators, permissions, status from rest_framework.renderers import JSONPRenderer, JSONRenderer, BrowsableAPIRenderer from rest_framework.response import Response import json import requests from django.conf import settings from django.core.cache import cache from django.shortcuts import g...
mit
SivilTaram/edx-platform
cms/djangoapps/contentstore/push_notification.py
154
2772
""" Helper methods for push notifications from Studio. """ from uuid import uuid4 from django.conf import settings from logging import exception as log_exception from contentstore.tasks import push_course_update_task from contentstore.models import PushNotificationConfig from xmodule.modulestore.django import modules...
agpl-3.0
rmsr/misc
coursera/algorithmic-toolbox/week5/primitive_calculator.py
1
2044
#!/bin/python3 """ Primitive calculator Given ops *3, *2, +1, what is the fewest ops to reach n from 1? """ import os import sys def main(): sequence = optimal_sequence_linear(int(input())) print(len(sequence) - 1) print(*sequence) def optimal_sequence_linear(n): """ Solve by calculating min-st...
isc
zhimin711/nova
nova/cells/manager.py
9
26574
# Copyright (c) 2012 Rackspace Hosting # 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 req...
apache-2.0
zahodi/ansible
lib/ansible/modules/web_infrastructure/htpasswd.py
47
9177
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Nimbis Services, 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 # (...
gpl-3.0
argentumproject/electrum-arg
lib/plugins.py
1
18775
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
mit
ajhager/copycat
lib/pyglet/extlibs/future/py2_3/future/builtins/newnext.py
70
2014
''' This module provides a newnext() function in Python 2 that mimics the behaviour of ``next()`` in Python 3, falling back to Python 2's behaviour for compatibility if this fails. ``newnext(iterator)`` calls the iterator's ``__next__()`` method if it exists. If this doesn't exist, it falls back to calling a ``next()`...
gpl-2.0
miguelparaiso/OdooAccessible
addons/base_iban/__init__.py
447
1073
# -*- 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
jk1/intellij-community
python/helpers/pydev/_pydevd_bundle/pydevd_xml.py
2
12915
from _pydev_bundle import pydev_log import traceback from _pydevd_bundle import pydevd_extension_utils from _pydevd_bundle import pydevd_resolver import sys from _pydevd_bundle.pydevd_constants import dict_iter_items, dict_keys, IS_PY3K, \ BUILTINS_MODULE_NAME, MAXIMUM_VARIABLE_REPRESENTATION_SIZE, RETURN_VALUES_DI...
apache-2.0
dubourg/openturns
python/test/t_MonteCarlo_draw.py
2
1515
#! /usr/bin/env python from __future__ import print_function from openturns import * TESTPREAMBLE() RandomGenerator.SetSeed(0) try: # We create a numerical math function myFunction = NumericalMathFunction( ('E', 'F', 'L', 'I'), ('y',), ('-F*L^3/(3.*E*I)',)) dim = myFunction.getInputDimension() ...
gpl-3.0
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/campaign_bid_modifier_service/client.py
1
23610
# -*- coding: utf-8 -*- # 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...
apache-2.0
linuxdeepin/deepin-media-player
src/format_conv/new_progressbar.py
2
1350
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2011 ~ 2012 Deepin, Inc. # 2011 ~ 2012 Hai longqiu. # # Author: Hai longqiu <qiuhailong@linuxdeepin.com> # Maintainer: Hai longqiu <qiuhailong@linuxdeepin.com> # # This program is free software: you can redistribute it and/or modify # i...
gpl-3.0
dllsf/odootest
addons/account/wizard/account_open_closed_fiscalyear.py
104
2341
# -*- 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
seanwestfall/django
setup.py
123
3257
import os import sys from distutils.sysconfig import get_python_lib from setuptools import find_packages, setup # Warn if we are installing over top of an existing installation. This can # cause issues where files that were deleted from a more recent Django are # still present in site-packages. See #18115. overlay_wa...
bsd-3-clause
Tejal011089/digitales_frappe
frappe/core/report/permitted_documents_for_user/permitted_documents_for_user.py
32
1678
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _, throw import frappe.utils.user from frappe.permissions import check_admin_or_system_manager from frappe.model.db_schema import type_map def...
mit
Bysmyyr/chromium-crosswalk
third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/mock_drt_unittest.py
26
7929
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
open-craft/opencraft
instance/migrations/0079_openstack_settings_per_appserver.py
1
2903
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-09 16:05 from __future__ import unicode_literals from django.db import migrations, models import django_extensions.db.fields.json import functools import instance.models.utils class Migration(migrations.Migration): dependencies = [ ('instan...
agpl-3.0
b0ttl3z/SickRage
SickBeard.py
5
21755
#!/usr/bin/env python2.7 # -*- coding: utf-8 -* # Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # Rewrite Author: miigotu <miigotu@gmail.com> # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it ...
gpl-3.0
hynnet/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib64/scons-2.1.0/SCons/Tool/suncc.py
21
1986
"""SCons.Tool.suncc Tool-specific initialization for Sun Solaris (Forte) CC and cc. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010...
gpl-2.0
bjzhang/xen
tools/xm-test/tests/sched-credit/01_sched_credit_weight_cap_pos.py
42
1858
#!/usr/bin/python # # Sched-credit tests modified from SEDF tests # import re from XmTestLib import * paramsRE = re.compile(r'^[^ ]* *[^ ]* *([^ ]*) *([^ ]*)$') def get_sched_credit_params(domain): status, output = traceCommand("xm sched-credit -d %s | tail -1" % domain.getName...
gpl-2.0
AEHO/collect
collect/src/endpoints_proto_datastore/utils_test.py
26
2058
# Copyright 2013 Google Inc. All Rights Reserved. """Tests for utils.py.""" import unittest from protorpc import messages from . import utils class UtilsTests(unittest.TestCase): """Comprehensive test for the endpoints_proto_datastore.utils module.""" def testIsSubclass(self): """Tests the utils.IsSubcl...
mit
TheProjecter/kassie
src/primaires/log/message.py
1
2331
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # 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 # l...
bsd-3-clause
ntt-sic/python-cinderclient
cinderclient/exceptions.py
1
4571
# Copyright 2010 Jacob Kaplan-Moss # # 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 writ...
apache-2.0
rahulunair/nova
nova/virt/powervm/media.py
4
9988
# Copyright 2015, 2017 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 require...
apache-2.0
consulo/consulo-python
plugin/src/main/dist/helpers/coveragepy/coverage/backunittest.py
95
1515
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Implementations of unittest features from the future.""" # Use unittest2 if it's available, otherwise unittest. This gives us # back-ported features for 2.6. t...
apache-2.0
FCP-INDI/nipype
nipype/interfaces/semtools/diffusion/gtract.py
10
68939
# -*- coding: utf8 -*- """Autogenerated file - DO NOT EDIT If you spot a bug, please report it on the mailing list and/or change the generator.""" import os from ...base import (CommandLine, CommandLineInputSpec, SEMLikeCommandLine, TraitedSpec, File, Directory, traits, isdefined, ...
bsd-3-clause
kanaka/spacewar
python/txt.py
1
4781
"""text and font classes, helps everyone to text""" import pygame, pygame.font, gfx #old versions of SysFont were buggy if pygame.ver <= '1.6.1': from mysysfont import SysFont else: SysFont = pygame.font.SysFont FontPool = {} def initialize(): pygame.font.init() return 1 class Font: def __i...
lgpl-2.1
florian-dacosta/OpenUpgrade
addons/website_customer/__openerp__.py
52
1511
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the term...
agpl-3.0
alextremblay/snmp-cmds
tests/conftest.py
1
1071
""" We're using snmpsim to simulate various target devices for our tests. Before we do anything, we should probably make sure it's actually running """ import pytest from subprocess import run, PIPE SNMP_TEST_SRV_HOST = '127.0.0.1:10000' SYSDESCR_OID = '.1.3.6.1.2.1.1.1.0' @pytest.fixture(scope="session", autouse=...
mit
kwailamchan/programming-languages
javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/sessions/backends/file.py
79
5340
import errno import os import tempfile from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured class SessionStore(SessionBase): """ Implements a file based session store. """ ...
mit
spitfire88/upm
examples/python/grovewater.py
7
2028
#!/usr/bin/python # Author: Zion Orent <zorent@ics.com> # Copyright (c) 2015 Intel Corporation. # # 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 limi...
mit
Distrotech/antlr4
runtime/Python3/src/antlr4/atn/ATNDeserializer.py
17
22901
# [The "BSD license"] # Copyright (c) 2013 Terence Parr # Copyright (c) 2013 Sam Harwell # Copyright (c) 2014 Eric Vergnaud # 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. Redistr...
bsd-3-clause
evernote/evernote-sdk-python3
lib/evernote/edam/notestore/NoteStore.py
11
791799
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py:new_style,utf8strings # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from .ttypes import * from thrift.Thrift import TProcessor from thrift.trans...
bsd-2-clause
jhawkesworth/ansible
lib/ansible/modules/network/aci/aci_firmware_policy.py
16
6423
#!/usr/bin/python # 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'], 'supported_by': 'community' } DOCU...
gpl-3.0
pyIMS/pyimzML
pyimzml/metadata.py
2
11625
from warnings import warn from pyimzml.ontology.ontology import lookup_and_convert_cv_param, convert_xml_value, convert_term_name XMLNS_PREFIX = "{http://psi.hupo.org/ms/mzml}" def _deep_pretty(obj): if isinstance(obj, list): return [_deep_pretty(item) for item in obj] if isinstance(obj, dict): ...
apache-2.0
caesar2164/edx-platform
common/djangoapps/student/management/commands/manage_group.py
52
4853
""" Management command `manage_group` is used to idempotently create Django groups and set their permissions by name. """ from django.apps import apps from django.contrib.auth.models import Group, Permission from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ValidationError f...
agpl-3.0
nagaozen/my-os-customizations
home/nagaozen/gedit-2.30.4/plugins/externaltools/tools/linkparsing.py
6
7117
# -*- coding: utf-8 -*- # # Copyright (C) 2009-2010 Per Arneng <per.arneng@anyplanet.com> # # 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 # ...
gpl-3.0
DCGenomics/multiple_myeloma_rnaseq_drug_response_hackathon_v002
src/reader.py
4
2559
import os import csv class Reader(object): """ This is an abstract class and not to be used as is. Expects the text files start with a header """ INPUT_DELIMITER='\t' OUTPUT_DELIMITER='\t' def __init__(self, filename=None): self._filename=filename self._filehandle=None...
cc0-1.0
richjoyce/pandas_vectors
test_pv.py
1
1154
import pandas_vectors as pv import pandas as pd import numpy as np import unittest class PvTest(unittest.TestCase): def test_indexer(self): self.assertListEqual(pv.indexer('a'), ['a_x', 'a_y', 'a_z']) self.assertListEqual(pv.indexer(['a']), ['a_x', 'a_y', 'a_z']) self.assertListEqual(pv.in...
mit
bruce2728/android_kernel_htc_pyramid
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
eviljeff/olympia
src/olympia/scanners/migrations/0021_auto_20200122_1347.py
6
1152
# Generated by Django 2.2.9 on 2020-01-22 13:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('scanners', '0020_auto_20200116_1250'), ] operations = [ migrations.AlterField( model_name='scannerqueryresult', name...
bsd-3-clause
whip112/Whip112
kuma/wiki/forms.py
7
20369
import re from tower import ugettext_lazy as _lazy from tower import ugettext as _ from django import forms from django.conf import settings from django.forms.widgets import CheckboxSelectMultiple from kuma.contentflagging.forms import ContentFlagForm import kuma.wiki.content from kuma.core.form_fields import Strip...
mpl-2.0
thalamus/Flexget
flexget/utils/search.py
18
1283
""" Common tools used by plugins implementing search plugin api """ from __future__ import unicode_literals, division, absolute_import import re from unicodedata import normalize from flexget.utils.titles.parser import TitleParser def clean_symbols(text): """Replaces common symbols with spaces. Also normalize un...
mit
mjuric/duplicity
duplicity/globals.py
1
9094
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright 2002 Ben Escoto <ben@emerose.org> # Copyright 2007 Kenneth Loafman <kenneth@loafman.com> # # This file is part of duplicity. # # Duplicity is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License...
gpl-2.0
efiring/scipy
scipy/io/matlab/tests/test_mio5_utils.py
106
5604
""" Testing mio5_utils Cython module """ from __future__ import division, print_function, absolute_import import sys from io import BytesIO cStringIO = BytesIO import numpy as np from nose.tools import (assert_true, assert_equal, assert_raises) from numpy.testing import (assert_array_equal, run_module_suite) fro...
bsd-3-clause
applicationdevm/XlsxWriter
xlsxwriter/test/workbook/test_workbook02.py
8
1742
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ..helperfunctions import _xml_to_list from ...workbook import Workbook class TestAssem...
bsd-2-clause
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/test/test_binhex.py
96
1508
"""Test script for the binhex C module Uses the mechanism of the python binhex module Based on an original test by Roger E. Masse. """ import binhex import os import unittest from test import support class BinHexTestCase(unittest.TestCase): def setUp(self): self.fname1 = support.TESTFN + "1" ...
gpl-2.0