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
a-doumoulakis/tensorflow
tensorflow/contrib/slim/python/slim/data/dataset.py
163
2444
# 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
jianglu/mojo
tools/clang/scripts/run_tool.py
34
11858
#!/usr/bin/env python # Copyright (c) 2013 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. """Wrapper script to help run clang tools across Chromium code. How to use this tool: If you want to run the tool across all Chrom...
bsd-3-clause
DVegaCapital/zipline
zipline/utils/control_flow.py
25
1295
""" Control flow utilities. """ from warnings import ( catch_warnings, filterwarnings, ) class nullctx(object): """ Null context manager. Useful for conditionally adding a contextmanager in a single line, e.g.: with SomeContextManager() if some_expr else nullctx(): do_stuff() """...
apache-2.0
pdellaert/ansible
lib/ansible/modules/cloud/amazon/aws_batch_compute_environment.py
9
16634
#!/usr/bin/python # Copyright (c) 2017 Jon Meran <jonathan.meran@sonos.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMENTAT...
gpl-3.0
vsajip/django
tests/regressiontests/localflavor/generic/tests.py
57
4361
from __future__ import unicode_literals import datetime from django.contrib.localflavor.generic.forms import DateField, DateTimeField from django.test import SimpleTestCase class GenericLocalFlavorTests(SimpleTestCase): def test_GenericDateField(self): error_invalid = ['Enter a valid date.'] va...
bsd-3-clause
Andreasdahlberg/sillycat
scripts/check_style.py
1
1234
#!/usr/bin/env python3 # -*- 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 dist...
gpl-3.0
ukgovdatascience/classifyintentsapp
app/auth/forms.py
1
5291
from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import DataRequired, Length, Email, Regexp, EqualTo from wtforms.widgets import PasswordInput from wtforms import ValidationError import safe from ..models import User class PasswordWidget...
mit
mrnamingo/vix4-34-enigma2-bcm
lib/python/Plugins/SystemPlugins/CommonInterfaceAssignment/plugin.py
20
26382
from xml.etree.cElementTree import parse as ci_parse from boxbranding import getMachineBrand, getMachineName from os import path as os_path from enigma import eDVBCI_UI, eDVBCIInterfaces from Screens.ChannelSelection import * from Components.ActionMap import ActionMap from Components.Sources.StaticText import StaticT...
gpl-2.0
YanyangChen/OpenNI2
Wrappers/java/OpenNI.jni/CreateMethods.py
32
2398
#/**************************************************************************** #* * #* OpenNI 1.x Alpha * #* Copyright (C) 2012 PrimeSense Ltd. * #* ...
apache-2.0
chitr/neutron
neutron/db/quota/models.py
22
2526
# Copyright (c) 2015 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 ...
apache-2.0
richardcs/ansible
lib/ansible/modules/cloud/amazon/aws_ssm_parameter_store.py
6
7683
#!/usr/bin/python # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', 'metadata_version': '1.1'} DOCUMENTATION = ''' --- modul...
gpl-3.0
bswartz/cinder
cinder/volume/drivers/solidfire.py
1
86895
# All Rights Reserved. # Copyright 2013 SolidFire 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...
apache-2.0
josschne/BabyWomp
cocos2d/tools/cocos2d-console/console/cocos2d_jscompile.py
17
11265
#!/usr/bin/python # ---------------------------------------------------------------------------- # cocos2d "jscompile" plugin # # Copyright 2013 (C) Intel # # License: MIT # ---------------------------------------------------------------------------- ''' "jscompile" plugin for cocos2d command line tool ''' __docformat...
mit
Manexware/medical
oemedical_data/__openerp__.py
1
1120
{ 'name': 'OeMedical : Module Data', 'version': '1.0', 'author': "OeMEdical Team", 'category': 'Generic Modules/Others', 'depends': ['oemedical'], 'application': True, 'description': """ About OeMedical Data --------------------- Core Data for oemedical, is kept as a separate module to ov...
gpl-2.0
CiscoSystems/tempest
tempest/stress/driver.py
3
8594
# Copyright 2013 Quanta Research Cambridge, 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 appli...
apache-2.0
vipulroxx/sympy
sympy/plotting/experimental_lambdify.py
22
25077
""" rewrite of lambdify - This stuff is not stable at all. It is for internal use in the new plotting module. It may (will! see the Q'n'A in the source) be rewritten. It's completely self contained. Especially it does not use lambdarepr. It does not aim to replace the current lambdify. Most importantly it will never...
bsd-3-clause
glwu/python-for-android
python3-alpha/extra_modules/pyxmpp2/utils.py
46
3459
# # (C) Copyright 2003-2011 Jacek Konieczny <jajcus@jajcus.net> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License Version # 2.1 as published by the Free Software Foundation. # # This program is distributed in the hope that it will be u...
apache-2.0
Lambdanaut/crits
crits/raw_data/api.py
21
4479
from django.core.urlresolvers import reverse from tastypie import authorization from tastypie.authentication import MultiAuthentication from crits.raw_data.raw_data import RawData from crits.raw_data.handlers import handle_raw_data_file from crits.core.api import CRITsApiKeyAuthentication, CRITsSessionAuthentication f...
mit
jmhsi/justin_tinker
data_science/courses/learning_dl_packages/models/research/attention_ocr/python/utils.py
16
2879
# 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 applicab...
apache-2.0
madphysicist/numpy
numpy/core/_add_newdocs.py
2
184288
""" This is only meant to add docs to objects defined in C-extension modules. The purpose is to allow easier editing of the docstrings without requiring a re-compile. NOTE: Many of the methods of ndarray have corresponding functions. If you update these docstrings, please keep also the ones in core/fromnum...
bsd-3-clause
agry/NGECore2
scripts/mobiles/corellia/corsec_special_ops_inspector.py
2
2171
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate...
lgpl-3.0
darren-wang/gl
glance/tests/unit/test_cached_images.py
20
4719
# Copyright (C) 2013 Yahoo! Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
apache-2.0
azunite/gyp_20150930
test/actions-multiple-outputs-with-dependencies/gyptest-action.py
34
1172
#!/usr/bin/env python # Copyright (c) 2015 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies actions with multiple outputs & dependncies will correctly rebuild. This is a regression test for crrev.com/1177163002. """ i...
bsd-3-clause
vikatory/kbengine
kbe/res/scripts/common/Lib/test/test_codecencodings_jp.py
88
4981
# # test_codecencodings_jp.py # Codec encoding tests for Japanese encodings. # from test import support from test import multibytecodec_support import unittest class Test_CP932(multibytecodec_support.TestBase, unittest.TestCase): encoding = 'cp932' tstring = multibytecodec_support.load_teststring('shift_jis...
lgpl-3.0
flavoi/diventi
diventi/ebooks/views.py
1
3556
from django.shortcuts import get_object_or_404 from django.views.generic.detail import DetailView from django.views import View from django.utils.translation import ( get_language, gettext_lazy as _ ) from django.contrib.auth.mixins import ( LoginRequiredMixin, UserPassesTestMixin ) from django.http im...
apache-2.0
GitHublong/hue
desktop/core/ext-py/django-extensions-1.5.0/django_extensions/tests/uuid_field.py
42
2384
import re import uuid import six from django_extensions.db.fields import PostgreSQLUUIDField from django_extensions.tests.fields import FieldTestCase from django_extensions.tests.testapp.models import UUIDTestModel_field, UUIDTestModel_pk, UUIDTestAgregateModel, UUIDTestManyToManyModel class UUIDFieldTest(FieldTest...
apache-2.0
40023256/2015cdag1man
static/Brython3.1.0-20150301-090019/Lib/unittest/test/support.py
770
3379
import unittest class TestEquality(object): """Used as a mixin for TestCase""" # Check for a valid __eq__ implementation def test_eq(self): for obj_1, obj_2 in self.eq_pairs: self.assertEqual(obj_1, obj_2) self.assertEqual(obj_2, obj_1) # Check for a valid __ne__ impl...
gpl-3.0
mahak/cinder
cinder/volume/drivers/datera/datera_common.py
2
11881
# Copyright 2020 Datera # 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 applic...
apache-2.0
mgax/aleph
aleph/model/selector.py
3
1189
import logging from datetime import datetime from sqlalchemy.ext.hybrid import hybrid_property from normality import normalize from aleph.core import db log = logging.getLogger(__name__) class Selector(db.Model): id = db.Column(db.Integer, primary_key=True) _text = db.Column('text', db.Unicode, index=True)...
mit
edc-ecuador/edc
qa/rpc-tests/test_framework/netutil.py
328
4562
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os import bi...
mit
LinuxEmbed/LinuxEmbed-RPI-Linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
AthinaB/synnefo
snf-admin-app/synnefo_admin/admin/resources/networks/actions.py
7
3433
# Copyright (C) 2010-2014 GRNET S.A. # # 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 i...
gpl-3.0
Altaf-Mahdi/android_kernel_oneplus_msm8974
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
xapi-project/sm
drivers/LVHDoISCSISR.py
1
28450
#!/usr/bin/python # # Copyright (C) Citrix Systems Inc. # # 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; version 2.1 only. # # This program is distributed in the hope that it will be use...
lgpl-2.1
adaxi/couchpotato
libs/requests/packages/chardet/charsetgroupprober.py
2929
3791
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights ...
gpl-3.0
porduna/weblabdeusto
server/src/test/unit/weblab/core/test_data_retriever.py
3
14161
#!/usr/bin/env python #-*-*- encoding: utf-8 -*-*- # # Copyright (C) 2005 onwards University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individual...
bsd-2-clause
switchboardOp/ansible
lib/ansible/modules/network/avi/avi_cloud.py
46
9205
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
aliyun/aliyun-oss-python-sdk
tests/test_bucket_worm.py
1
2199
from .common import * class TestBucketWorm(OssTestCase): def test_bucke_worm_normal(self): init_result = self.bucket.init_bucket_worm(1) worm_id = init_result.worm_id self.assertIsNotNone(init_result.request_id) get_result = self.bucket.get_bucket_worm() self.assertIsNotNon...
mit
9seconds/streams
streams/executors/executors.py
1
1711
# -*- coding: utf-8 -*- """ This module has implementation of executors wrapped by :py:class:`streams.executors.mixins.PoolOfPoolsMixin` and applicable to work with :py:class:`streams.poolofpools.PoolOfPools`. Basically all of them are thin extensions of classes from :py:mod:`concurrent.futures`. """ ###############...
mit
docmeth02/CouchPotatoServer
libs/rtorrent/lib/xmlrpc/basic_auth.py
83
3291
# # Copyright (c) 2013 Dean Gardiner, <gardiner91@gmail.com> # # 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, mod...
gpl-3.0
mhugent/Quantum-GIS
python/plugins/processing/algs/qgis/Polygonize.py
2
4932
# -*- coding: utf-8 -*- """ *************************************************************************** Polygonize.py --------------------- Date : March 2013 Copyright : (C) 2013 by Piotr Pociask Email : ppociask at o2 dot pl *******************************...
gpl-2.0
ramanajee/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/profiler_unittest.py
124
5111
# Copyright (C) 2012 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
wiltonlazary/arangodb
3rdParty/V8/V8-5.0.71.39/tools/swarming_client/swarming.py
4
49821
#!/usr/bin/env python # Copyright 2013 The Swarming Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 that # can be found in the LICENSE file. """Client tool to trigger tasks or retrieve results from a Swarming server.""" __version__ = '0.8.4' import collection...
apache-2.0
MattCrystal/glowing-happiness
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
Ali-aqrabawi/ezclinic
lib/django/middleware/common.py
39
7843
import logging import re from django import http from django.conf import settings from django.core.exceptions import PermissionDenied from django.core.mail import mail_managers from django.urls import is_valid_path from django.utils.cache import get_conditional_response, set_response_etag from django.utils.deprecation...
mit
Eric-Zhong/odoo
addons/l10n_bo/__openerp__.py
259
1698
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 Cubic ERP - Teradata SAC (<http://cubicerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the...
agpl-3.0
btallman/incubator-airflow
tests/ti_deps/deps/dag_ti_slots_available_dep.py
20
1458
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
apache-2.0
bank-netforce/netforce
netforce_hr/netforce_hr/models/hr_department.py
4
1500
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
mit
RaghavPro/Runescape-Hiscores
hiscores/templatetags/hiscores_tags.py
1
1077
from django import template register = template.Library() @register.filter def get_rank(page, loop_counter): """ Calculates the player rank from current page and loop index. :param page: Current page number :param loop_counter: Loop index :return: rank """ rank = page.start_index() + loop...
gpl-2.0
lukaspetr/FEniCSopt
fenicsopt/exports/gnuplot.py
1
1501
from __future__ import division from dolfin import * import numpy import pprint # Gnuplot related functions ################################################################################ # discontinuous piecewise linear output def gnuplot_dg1(file, mesh, fun): file = open(file, 'w+') i = 0 for myCell in cells(m...
mit
macobo/python-grader
tasks/MTAT.03.100/2013/Midterm_1/KT2_R8_mood_tester.py
1
1312
""" Task description (in Estonian): 3. Arvude mood (5p) Kirjuta funktsioon mood, mis võtab argumendiks täisarvujärjendi ja tagastab arvu, mida leidub järjendis kõige rohkem (ehk moodi). Kui selliseid arve on mitu, siis tuleb tagastada neist vähim. Näide: mood([-10, 17, 13, 17, -10, 21]) peab tagastama -10. """ fr...
mit
makermade/arm_android-19_arm-linux-androideabi-4.8
lib/python2.7/lib-tk/Tkinter.py
43
157840
"""Wrapper functions for Tcl/Tk. Tkinter provides classes which allow the display, positioning and control of widgets. Toplevel widgets are Tk and Toplevel. Other widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton, Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox LabelFrame and PanedWindow. ...
gpl-2.0
donkirkby/django
tests/select_related/models.py
276
3480
""" Tests for select_related() ``select_related()`` follows all relationships and pre-caches any foreign key values so that complex trees can be fetched in a single query. However, this isn't always a good idea, so the ``depth`` argument control how many "levels" the select-related behavior will traverse. """ from dj...
bsd-3-clause
PaulKinlan/cli-caniuse
site/app/scripts/bower_components/jsrepl-build/extern/python/reloop-closured/lib/python2.7/distutils/cygwinccompiler.py
132
17270
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
apache-2.0
lseyesl/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/model/queues.py
120
3658
# Copyright (C) 2010 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
dezynetechnologies/odoo
addons/website_blog/wizard/document_page_show_diff.py
372
2184
# -*- 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
gtlzxt/synergy
ext/toolchain/generators.py
33
2582
# synergy -- mouse and keyboard sharing utility # Copyright (C) 2012 Synergy Si Ltd. # Copyright (C) 2009 Nick Bolton # # This package is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # found in the file LICENSE that should have accompanied this file. # # ...
gpl-2.0
pombredanne/logbook
tests/test_logging_api.py
6
2823
import pickle import sys import logbook from logbook.helpers import iteritems, xrange, u import pytest def test_basic_logging(active_handler, logger): logger.warn('This is a warning. Nice hah?') assert active_handler.has_warning('This is a warning. Nice hah?') assert active_handler.formatted_records ...
bsd-3-clause
google-code-export/django-hotclub
libs/external_libs/dateutil/dateutil/parser.py
13
32492
# -*- coding:iso-8859-1 -*- """ Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import os.path import string import sys import time import...
mit
F483/ngcccbase
ngcccbase/tests/test_wallet_model.py
5
4256
#!/usr/bin/env python import unittest from coloredcoinlib import (ColorSet, ColorDataBuilderManager, AidedColorDataBuilder, ThinColorData) from ngcccbase.deterministic import DWalletAddressManager from ngcccbase.pwallet import PersistentWallet from ngcccbase.txcons import BasicTxSpec, Inv...
mit
marketdial/helloworld
accounts/forms.py
2
5965
# -*- coding: utf-8 -*- from flask import render_template, current_app from wtforms import * from flask.ext.wtf import Form from flask_mail import Message from application import mail from common.utils import get_signer from accounts.models import User class LoginForm(Form): user = None username = TextFiel...
mit
daniaki/Enrich2
enrich2/gui/seqlib_apply_dialog.py
1
3571
# Copyright 2016 Alan F Rubin # # This file is part of Enrich2. # # Enrich2 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
shinexwang/Classy
Testing/TestMain/profParser.py
1
4044
""" Copyright 2013 Shine Wang 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 distrib...
apache-2.0
luhanhan/horizon
openstack_dashboard/test/test_data/heat_data.py
50
11072
# 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 # d...
apache-2.0
ketjow4/NOV
Lib/fpformat.py
322
4699
"""General floating point formatting functions. Functions: fix(x, digits_behind) sci(x, digits_behind) Each takes a number or a string and a number of digits as arguments. Parameters: x: number to be formatted; or a string resembling a number digits_behind: number of digits behind the decimal point """ f...
gpl-3.0
detiber/lib_openshift
test/test_wrapper.py
2
3097
# coding: utf-8 """ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, so...
apache-2.0
cybertk/depot_tools
third_party/pylint/checkers/classes.py
19
23939
# Copyright (c) 2003-2011 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:contact@logilab.fr # # 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, o...
bsd-3-clause
Lukc/ospace-lukc
client-pygame/lib/osci/dialog/NewMessageDlg.py
1
7294
# # Copyright 2001 - 2006 Ludek Smid [http://www.ospace.net/] # # This file is part of IGE - Outer Space. # # IGE - Outer Space 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 Lice...
gpl-2.0
thinkopensolutions/server-tools
module_prototyper/tests/test_prototype_module_export.py
2
3093
# -*- coding: utf-8 -*- # ############################################################################# # # OpenERP, Open Source Management Solution # This module copyright (C) 2010 - 2014 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modify ...
agpl-3.0
datapythonista/pandas
pandas/tests/io/test_compression.py
3
8199
import io import os from pathlib import Path import subprocess import sys import textwrap import time import pytest import pandas as pd import pandas._testing as tm import pandas.io.common as icom @pytest.mark.parametrize( "obj", [ pd.DataFrame( 100 * [[0.123456, 0.234567, 0.567567], [1...
bsd-3-clause
veblush/PyPhabricatorDb
sample/create-task-summary.py
1
1927
import sys import codecs import datetime from pyphabricatordb import * from sqlalchemy.orm import sessionmaker def create_session(): DBSession = sessionmaker() return DBSession() def get_user(session, phid): return session.query(user.User).filter(user.User.phid == phid).first() def create_task_range_summ...
mit
wecatch/app-turbo
turbo/mongo_model.py
1
10225
# -*- coding:utf-8 -*- from __future__ import ( absolute_import, division, print_function, with_statement, ) from collections import defaultdict from datetime import datetime import functools import time from bson.objectid import ObjectId from turbo.log import model_log from turbo.util import escape a...
apache-2.0
jeremiahyan/odoo
odoo/addons/base/models/ir_qweb.py
1
19636
# -*- coding: utf-8 -*- from __future__ import print_function import ast import copy import logging from collections import OrderedDict from time import time from lxml import html from lxml import etree from odoo import api, models, tools from odoo.tools.safe_eval import assert_valid_codeobj, _BUILTINS, _SAFE_OPCODES...
gpl-3.0
Thraxis/pymedusa
lib/sqlalchemy/orm/persistence.py
34
51028
# orm/persistence.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """private module containing functions used to emit INSERT, UPDATE and DELETE sta...
gpl-3.0
ahmetcemturan/SFACT
fabmetheus_utilities/geometry/creation/linear_bearing_cage.py
12
12862
""" Linear bearing cage. """ from __future__ import absolute_import #Init has to be imported first because it has code to workaround the python bug where relative imports don't work if the module is imported as a main module. import __init__ from fabmetheus_utilities.geometry.creation import extrude from fabmetheus_...
agpl-3.0
apache/airflow
tests/providers/amazon/aws/hooks/test_kinesis.py
3
2515
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
sbalde/edx-platform
common/lib/xmodule/xmodule/tests/test_stringify.py
187
1256
""" Tests stringify functions used in xmodule html """ from nose.tools import assert_equals # pylint: disable=no-name-in-module from lxml import etree from xmodule.stringify import stringify_children def test_stringify(): text = 'Hi <div x="foo">there <span>Bruce</span><b>!</b></div>' html = '''<html a="b" f...
agpl-3.0
interedition/collatex
collatex-pythonport/docs/conf.py
4
8473
#!/usr/bin/env python # -*- coding: utf-8 -*- # # complexity documentation build configuration file, created by # sphinx-quickstart on Tue Jul 9 22:26:36 2013. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # ...
gpl-3.0
Learning-from-our-past/Kaira
books/karelians/extraction/extractors/weddingextractor.py
2
1845
# -*- coding: utf-8 -*- import re from books.karelians.extraction.extractors.baseExtractor import BaseExtractor from books.karelians.extraction.extractionExceptions import * from books.karelians.extraction.extractors.dateExtractor import DateExtractor from shared import textUtils from books.karelians.extractionkeys im...
gpl-2.0
psiorx/drake
drake/thirdParty/xacro.py
19
18904
#! /usr/bin/env python # Copyright (c) 2008, Willow Garage, 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 # no...
bsd-3-clause
toshywoshy/ansible
lib/ansible/modules/network/fortios/fortios_firewall_ldb_monitor.py
7
12613
#!/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
wfxiang08/django190
django/contrib/gis/gdal/__init__.py
130
2610
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-su...
bsd-3-clause
double-y/django
django/conf/locale/mk/formats.py
504
1742
# -*- 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 = 'd F Y' TIME_FORMAT = 'H:i' DATETI...
bsd-3-clause
pombredanne/python-ptrace
examples/itrace.py
1
1770
#!/usr/bin/env python """ Here is a tool which I have been using to debug libc startup code where I didn't find gdb very helpful. It single steps the process and prints each instruction pointer address. To go faster, it allows a number of syscalls to run before starting single-stepping. It's possible to pipe the addre...
gpl-2.0
maaaks/andreas
andreas/commands/dbcommands.py
1
1291
from typing import List, Type from andreas.db.database import db from andreas.db.model import Model from andreas.models.event import Event from andreas.models.keypair import KeyPair from andreas.models.post import Post from andreas.models.relations import PostPostRelation, UserPostRelation from andreas.models.server i...
mit
aliyun/oss-ftp
python27/win32/Lib/distutils/tests/test_register.py
39
8839
# -*- encoding: utf8 -*- """Tests for distutils.command.register.""" import os import unittest import getpass import urllib2 import warnings from test.test_support import check_warnings, run_unittest from distutils.command import register as register_module from distutils.command.register import register from distuti...
mit
Adriwr/Clinica
vendor/doctrine/orm/docs/en/_exts/configurationblock.py
2577
3506
#Copyright (c) 2010 Fabien Potencier # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify, merge, publish, distrib...
mit
laborautonomo/opps
opps/views/generic/json_views.py
1
2941
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from django.http import HttpResponse from django.views.generic import TemplateView from django.views.generic.detail import BaseDetailView from django.views.generic.detail import SingleObjectTemplateResponseMixin def response_mimetype(request): if "applicat...
mit
AntonioJBT/CGATPipeline_core
CGATPipelines/Pipeline/Utils.py
2
2223
"""Utils.py - Utilities for ruffus pipelines ============================================ Reference --------- """ import inspect import sys def isTest(): """return True if the pipeline is run in a "testing" mode. This method checks if ``-is-test`` has been given as a command line option. """ re...
mit
joshmoore/zeroc-ice
java/test/Ice/operations/run.py
1
1403
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
gpl-2.0
EliteTK/qutebrowser
qutebrowser/browser/webelem.py
2
12858
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
mdavid/horizon
openstack_dashboard/dashboards/project/stacks/api.py
95
2863
# 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
huziyizero/godot
platform/osx/detect.py
12
3271
import os import sys def is_active(): return True def get_name(): return "OSX" def can_build(): if (sys.platform == "darwin" or os.environ.has_key("OSXCROSS_ROOT")): return True return False def get_opts(): return [ ('force_64_bits','Force 64 bits binary','no'), ('osxcross_sdk','OSXCross SDK ...
mit
dmoliveira/networkx
networkx/algorithms/tree/tests/test_recognition.py
54
4061
from nose.tools import * import networkx as nx class TestTreeRecognition(object): graph = nx.Graph multigraph = nx.MultiGraph def setUp(self): self.T1 = self.graph() self.T2 = self.graph() self.T2.add_node(1) self.T3 = self.graph() self.T3.add_nodes_from(range...
bsd-3-clause
vivekanand1101/neutron
neutron/agent/rpc.py
22
8851
# Copyright (c) 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...
apache-2.0
gbosh/mezzanine
mezzanine/urls.py
1
3462
""" This is the main ``urlconf`` for Mezzanine - it sets up patterns for all the various Mezzanine apps, third-party apps like Grappelli and filebrowser. """ from django.conf.urls.defaults import patterns, include from django.contrib import admin from django.contrib.admin.sites import NotRegistered from django.http im...
bsd-2-clause
bgxavier/nova
nova/virt/ironic/ironic_states.py
36
4259
# Copyright (c) 2012 NTT DOCOMO, INC. # Copyright 2010 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/l...
apache-2.0
un33k/CouchPotatoServer
libs/suds/builder.py
197
4220
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) 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. # # This program is distributed in the hope that it will ...
gpl-3.0
great-expectations/great_expectations
tests/test_ge_utils.py
1
11911
import copy import os import pytest import great_expectations as ge from great_expectations.core.util import nested_update from great_expectations.dataset.util import check_sql_engine_dialect from great_expectations.util import ( filter_properties_dict, get_currently_executing_function_call_arguments, lin...
apache-2.0
lgeiger/ide-python
dist/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydev_ipython/inputhookqt5.py
7
7286
# -*- coding: utf-8 -*- """ Qt5's inputhook support function Author: Christian Boos """ #----------------------------------------------------------------------------- # Copyright (C) 2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, d...
mit