repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
da2ce7/cjdns
node_build/dependencies/libuv/build/gyp/test/win/gyptest-cl-buffer-security-check.py
344
1612
#!/usr/bin/env python # Copyright (c) 2012 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. """ Make sure buffer security check setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = Tes...
gpl-3.0
gusDuarte/sugar-toolkit-gtk3
tests/lib/test_mime.py
4
3376
#!/usr/bin/env python # Copyright (C) 2006, Red Hat, Inc. # Copyright (C) 2007, One Laptop Per Child # # 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 ...
lgpl-2.1
rwl/PyCIM
CIM14/CDPSM/Balanced/IEC61968/Common/PositionPoint.py
1
3116
# Copyright (C) 2010-2011 Richard Lincoln # # 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...
mit
longmen21/edx-platform
openedx/core/djangoapps/credit/signature.py
60
1975
""" Calculate digital signatures for messages sent to/from credit providers, using a shared secret key. The signature is calculated as follows: 1) Encode all parameters of the request (except the signature) in a string. 2) Encode each key/value pair as a string of the form "{key}:{value}". 3) Concatenate ...
agpl-3.0
madformuse/client
src/notificatation_system/ns_hook.py
3
1590
from PyQt4 import QtGui import util """ Setting Model class. All Event Types (Notifications) are customizable. Required are "popup, sound, enabled" settings. You can add custom settings over the "settings" button. connect on clicked event some actions, e.g. self.button.clicked.connect(self.dialog.show) """ class NsHo...
gpl-3.0
llhe/tensorflow
tensorflow/contrib/learn/python/learn/learn_io/pandas_io.py
92
4535
# 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
sysalexis/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/urllib3/response.py
328
10347
# urllib3/response.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging import zlib import io from ._collections import HTTPHeaderDict from .exceptio...
lgpl-3.0
bjornlevi/5thpower
afmaeli/env/lib/python3.6/site-packages/chardet/jpcntx.py
289
19643
######################## 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 R...
mit
polojacky/ehfpi
ehf/filebrowser/templatetags/fb_pagination.py
15
1837
# coding: utf-8 # DJANGO IMPORTS from django.utils.html import escape from django.utils.safestring import mark_safe from django.template import Library register = Library() DOT = '.' @register.inclusion_tag('filebrowser/include/paginator.html', takes_context=True) def pagination(context): page_num = context['pa...
apache-2.0
sauloal/cnidaria
scripts/venv/lib/python2.7/site-packages/matplotlib/backends/backend_gtk3cairo.py
21
2321
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from . import backend_gtk3 from . import backend_cairo from .backend_cairo import cairo, HAS_CAIRO_CFFI from matplotlib.figure import Figure class RendererGTK3Cairo(backend_cairo.RendererCairo): ...
mit
mixturemodel-flow/tensorflow
tensorflow/contrib/stateless/python/kernel_tests/stateless_random_ops_test.py
54
3287
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
thaumos/ansible
lib/ansible/modules/cloud/amazon/ec2_scaling_policy.py
46
6822
#!/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': ['stableinterf...
gpl-3.0
nimia/public_drown_scanner
pyx509/pkcs7/debug.py
2
1176
#* pyx509 - Python library for parsing X.509 #* Copyright (C) 2009-2010 CZ.NIC, z.s.p.o. (http://www.nic.cz) #* #* This library is free software; you can redistribute it and/or #* modify it under the terms of the GNU Library General Public #* License as published by the Free Software Foundation; either...
gpl-2.0
ericawright/bedrock
tests/pages/firefox/whatsnew/whatsnew_beta_74.py
1
1190
# 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/. from selenium.webdriver.common.by import By from pages.base import BasePage class FirefoxWhatsNew74betaPage(BasePage)...
mpl-2.0
v-legoff/accertin
lyntin/engine.py
1
32032
####################################################################### # This file is part of Lyntin. # copyright (c) Free Software Foundation 2001, 2002 # # Lyntin is distributed under the GNU General Public License license. See the # file LICENSE for distribution details. # $Id: engine.py,v 1.32 2004/05/10 13:59:02...
gpl-3.0
Jyrno42/EstLan-Web
EstLan/accounts/migrations/0001_initial.py
1
7021
# -*- 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): # Adding model 'EstLanUser' db.create_table(u'accounts_estlanuser', ( ...
gpl-3.0
tragiclifestories/django
tests/model_options/models/tablespaces.py
342
1853
from django.db import models # Since the test database doesn't have tablespaces, it's impossible for Django # to create the tables for models where db_tablespace is set. To avoid this # problem, we mark the models as unmanaged, and temporarily revert them to # managed during each test. We also set them to use the sam...
bsd-3-clause
PLyczkowski/Sticky-Keymap
2.74/scripts/addons_contrib/object_physics_meadow/__init__.py
1
1301
### BEGIN GPL LICENSE BLOCK ##### # # 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...
gpl-2.0
bretttegart/treadmill
tests/vipfile_test.py
1
2068
"""Unit test for vipfile. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import io import os import shutil import tempfile import threading import unittest # Disable W0611: Unused import import tests.treadmill_t...
apache-2.0
Sorsly/subtle
google-cloud-sdk/platform/gsutil/gslib/ls_helper.py
5
11067
# -*- coding: utf-8 -*- # Copyright 2014 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
mit
ic-hep/DIRAC
ResourceStatusSystem/scripts/dirac-rss-sync.py
1
8568
#!/usr/bin/env python """ dirac-rss-sync Script that synchronizes the resources described on the CS with the RSS. By default, it sets their Status to `Unknown`, StatusType to `all` and reason to `Synchronized`. However, it can copy over the status on the CS to the RSS. Important: If the StatusType is...
gpl-3.0
favll/pogom
pogom/pgoapi/protos/POGOProtos/Networking/Responses/ReleasePokemonResponse_pb2.py
6
4314
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: POGOProtos/Networking/Responses/ReleasePokemonResponse.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message f...
mit
sjlehtin/django
django/contrib/auth/migrations/0001_initial.py
74
4960
import django.contrib.auth.models from django.contrib.auth import validators from django.db import migrations, models from django.utils import timezone class Migration(migrations.Migration): dependencies = [ ('contenttypes', '__first__'), ] operations = [ migrations.CreateModel( ...
bsd-3-clause
michaelaye/vispy
vispy/scene/widgets/widget.py
7
13305
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. from __future__ import division import numpy as np from ..visuals import Compound from ...visuals.mesh import MeshVisual from ...visuals.transforms import STTransform from ....
bsd-3-clause
cchurch/ansible
lib/ansible/modules/cloud/vultr/vultr_server.py
4
31945
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
winpython/winpython_afterdoc
docs/WASM_almar_klein_demo/rocket.py
2
2777
""" Run rocket.wasm in Python! * Load the wasm module, compile to PPCI IR and then to native. * Load the native object in memory, feed it the API it needs (wasm imports). * Implement a Python app that uses the exposed API (wasm exports). At the moment, the game is text based. But we can use Qt or SDL2 (or tk?) to run...
mit
Sodki/ansible
lib/ansible/plugins/cache/jsonfile.py
36
1681
# (c) 2014, Brian Coca, Josh Drake, et al # # 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
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/third_party/oauth2client/setup.py
9
2555
# Copyright 2014 Google 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 by applicable law or ...
bsd-3-clause
mustafat/odoo-1
addons/google_calendar/__openerp__.py
299
1671
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
mrquim/repository.mrquim
script.module.pycryptodome/lib/Crypto/SelfTest/Hash/__init__.py
12
3352
# -*- coding: utf-8 -*- # # SelfTest/Hash/__init__.py: Self-test for hash modules # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to t...
gpl-2.0
KaranToor/MA450
google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/route53/domains/__init__.py
113
1122
# Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights t...
apache-2.0
travs/PyOpenWorm
examples/add_reference.py
3
1042
""" How to reference supporting evidence for some object in the database. See: "Metadata in PyOpenWorm" for discussion on semantics of what giving evidence for an object means. """ import sys import PyOpenWorm as P #Create dummy database configuration. d = P.Data({}) #Connect to database with dummy configuration P....
mit
kbs5280/game-time
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py
1382
30567
# Copyright (c) 2014 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. """ This script is intended for use as a GYP_GENERATOR. It takes as input (by way of the generator flag config_path) the path of a json file that dictates the file...
mit
neharejanjeva/techstitution
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
713
5879
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value f...
cc0-1.0
cmelange/ansible
lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey.py
32
5074
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
bhupennewalkar1337/erpnext
erpnext/buying/doctype/request_for_quotation/test_request_for_quotation.py
17
2749
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest from frappe.utils import nowdate class TestRequestforQuotation(unittest.TestCase): def test_make_supplier_quotation(self): from erpnex...
gpl-3.0
Piasy/proxy-searcher
site-packages/django/core/paginator.py
94
5058
from math import ceil class InvalidPage(Exception): pass class PageNotAnInteger(InvalidPage): pass class EmptyPage(InvalidPage): pass class Paginator(object): def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True): self.object_list = object_list self.per_pa...
mit
yqm/sl4a
python-build/python-libs/gdata/src/atom/auth.py
297
1199
#!/usr/bin/env python # # Copyright (C) 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...
apache-2.0
defionscode/ansible
lib/ansible/modules/cloud/vultr/vultr_firewall_group.py
27
5529
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
SimplyKnownAsG/yamlize
setup.py
1
2647
from setuptools import setup, find_packages setup( name='yamlize', # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html version='0.7.0', descriptio...
apache-2.0
liangjiaxing/sympy
sympy/plotting/pygletplot/plot_axes.py
95
8666
from __future__ import print_function, division from pyglet.gl import * from pyglet import font from plot_object import PlotObject from util import strided_range, billboard_matrix from util import get_direction_vectors from util import dot_product, vec_sub, vec_mag from sympy.core import S from sympy.core.compatibili...
bsd-3-clause
shinsterneck/pdns
regression-tests.api/runtests.py
6
7928
#!/usr/bin/env python # # Shell-script style. from __future__ import print_function import os import requests import shutil import subprocess import sys import tempfile import time try: raw_input except NameError: raw_input = input MYSQL_DB='pdnsapi' MYSQL_USER='root' MYSQL_HOST=os.environ.get('MYSQL_HOST', 'loc...
gpl-2.0
Nitaco/ansible
lib/ansible/modules/windows/win_region.py
52
3103
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ansible, inc # 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'} DOCUMEN...
gpl-3.0
nkatre/php-buildpack
extensions/sessions/extension.py
9
4668
# 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 use ...
apache-2.0
arifsetiawan/edx-platform
lms/djangoapps/staticbook/views.py
91
6351
""" Views for serving static textbooks. """ from django.contrib.auth.decorators import login_required from django.http import Http404 from edxmako.shortcuts import render_to_response from opaque_keys.edx.locations import SlashSeparatedCourseKey from xmodule.annotator_token import retrieve_token from courseware.acces...
agpl-3.0
seshin/namebench
libnamebench/reporter.py
173
16737
# Copyright 2009 Google 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 by applicable law or ...
apache-2.0
karanisverma/flasktest
lib/werkzeug/http.py
317
33404
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
apache-2.0
dongjoon-hyun/spark
examples/src/main/python/mllib/gradient_boosting_regression_example.py
27
2404
# # 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 us...
apache-2.0
shl198/Projects
Modules/f07_picard.py
2
5095
import subprocess,os def chunk(l,n): n = max(n,1) res = [l[i:i+n] for i in range(0,len(l),n)] return res def read_group(ID,sample,platform,library,platunit): return ('@RG\\tID:'+ID+'\\tSM:'+sample+'\\tPL:'+platform+'\\tLB:'+library +'\\tPU:'+platunit) #@RG\\tID:chosgroup1\\tSM:sample1...
mit
vmanoria/bluemix-hue-filebrowser
hue-3.8.1-bluemix/desktop/core/ext-py/cx_Oracle-5.1.2/test/LongVar.py
34
4064
"""Module for testing long and long raw variables.""" import sys class TestLongVar(BaseTestCase): def __PerformTest(self, a_Type, a_InputType): self.cursor.execute("truncate table Test%ss" % a_Type) longString = "" for i in range(1, 11): char = chr(ord('A') + i - 1) ...
gpl-2.0
chennan47/osf.io
api_tests/nodes/views/test_node_links_list.py
10
49231
import pytest from api.base.settings.defaults import API_BASE from framework.auth.core import Auth from osf.models import NodeLog from osf_tests.factories import ( ProjectFactory, RegistrationFactory, AuthUserFactory ) from rest_framework import exceptions from tests.utils import assert_latest_log def no...
apache-2.0
jwlawson/tensorflow
tensorflow/python/kernel_tests/split_op_test.py
19
12874
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
k3nnyfr/s2a_fr-nsis
s2a/Python/Lib/lib-tk/FileDialog.py
133
8831
"""File selection dialog classes. Classes: - FileDialog - LoadFileDialog - SaveFileDialog """ from Tkinter import * from Dialog import Dialog import os import fnmatch dialogstates = {} class FileDialog: """Standard file selection dialog -- no checks on selected file. Usage: d = FileDialog(ma...
gpl-3.0
darkleons/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/LoginTest.py
384
1320
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
zfergus2/Seam-Minimization
src/null_space_method.py
2
2891
# -*- coding: utf-8 -*- """ Use Affine null space to preform A Priori Lexicographical Multi-Objective Optimization. Written by Zachary Ferguson and Alec Jacobson. """ import pdb import numpy import scipy.sparse from affine_null_space import affine_null_space def NullSpaceMethod(H, f, method="qr", bounds=None): ...
mit
matt-kwong/grpc
tools/run_tests/python_utils/report_utils.py
11
5434
# Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
jonyroda97/redbot-amigosprovaveis
lib/numpy/ma/tests/test_subclassing.py
14
13959
# pylint: disable-msg=W0611, W0612, W0511,R0201 """Tests suite for MaskedArray & subclassing. :author: Pierre Gerard-Marchant :contact: pierregm_at_uga_dot_edu :version: $Id: test_subclassing.py 3473 2007-10-29 15:18:13Z jarrod.millman $ """ from __future__ import division, absolute_import, print_function import num...
gpl-3.0
hynekcer/django
tests/template_tests/syntax_tests/test_width_ratio.py
342
6095
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from django.utils import six from ..utils import setup class WidthRatioTagTests(SimpleTestCase): libraries = {'custom': 'template_tests.templatetags.custom'} @setup({'widthratio01': '{% widthratio a b 0 %}'}) def test...
bsd-3-clause
opentrials/processors
tests/processors/base/writers/test_source.py
2
1581
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import processors.base.writers as writers class TestSourceWriter(object): def test_skips_source_with_invalid_url(self, conn): source...
mit
kawamon/hue
desktop/core/ext-py/boto-2.46.1/boto/mturk/layoutparam.py
170
2045
# Copyright (c) 2008 Chris Moyer http://coredumped.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, modify, ...
apache-2.0
umuzungu/zipline
zipline/finance/cancel_policy.py
3
2063
# # Copyright 2016 Quantopian, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
apache-2.0
wolfv/AutobahnPython
examples/twisted/wamp/work/pubsub/client.py
14
4915
############################################################################### ## ## Copyright (C) 2013 Tavendo GmbH ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http:/...
apache-2.0
klen/python-mode
pymode/libs/logilab-common-1.4.1/logilab/common/textutils.py
3
17345
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of logilab-common. # # logilab-common is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
lgpl-3.0
2014c2g5/cd0505
static/Brython3.1.1-20150328-091302/Lib/calendar.py
828
22940
"""Calendar printing functions Note when comparing these calendars to the ones printed by cal(1): By default, these calendars have Monday as the first day of the week, and Sunday as the last (the European convention). Use setfirstweekday() to set the first day of the week (0=Monday, 6=Sunday).""" import sys import da...
agpl-3.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/dnspython-1.12.0/dns/rdtypes/nsbase.py
100
2994
# Copyright (C) 2003-2007, 2009-2011 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
Maikflow/django_test
lib/python2.7/site-packages/Django-1.7.1-py2.7.egg/django/contrib/gis/tests/gis_migrations/test_operations.py
9
4776
from __future__ import unicode_literals from unittest import skipUnless from django.contrib.gis.tests.utils import HAS_SPATIAL_DB, mysql from django.db import connection, migrations, models from django.db.migrations.migration import Migration from django.db.migrations.state import ProjectState from django.test import...
gpl-2.0
zsoltdudas/lis-tempest
tempest/api/compute/servers/test_create_server.py
3
15240
# 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
hellodata/hellodate
2/site-packages/django/contrib/formtools/tests/wizard/wizardtests/forms.py
103
2165
import os import tempfile from django import forms from django.contrib.auth.models import User from django.core.files.storage import FileSystemStorage from django.forms.formsets import formset_factory from django.forms.models import modelformset_factory from django.http import HttpResponse from django.template import ...
lgpl-3.0
cboling/xos
xos/core/models/instance.py
2
9964
import os from django.db import models from django.db.models import Q from django.core import exceptions from core.models import PlCoreBase,PlCoreBaseManager,PlCoreBaseDeletionManager from core.models.plcorebase import StrippedCharField from core.models import Image from core.models import Slice, SlicePrivilege from co...
apache-2.0
kronoscode/Booktype
lib/booki/editor/management/commands/bookexport.py
3
2740
# This file is part of Booktype. # Copyright (c) 2012 Aleksandar Erkalovic <aleksandar.erkalovic@sourcefabric.org> # # Booktype 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 Li...
agpl-3.0
endlessm/chromium-browser
third_party/Python-Markdown/markdown/__init__.py
63
20784
""" Python Markdown =============== Python Markdown converts Markdown to HTML and can be used as a library or called from the command line. ## Basic usage as a module: import markdown html = markdown.markdown(your_text_string) See <https://pythonhosted.org/Markdown/> for more information and instructions on...
bsd-3-clause
ged-lab/khmer
sandbox/count-kmers-single.py
2
4762
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
rht/zulip
zerver/lib/response.py
2
2481
from django.http import HttpResponse, HttpResponseNotAllowed import ujson from typing import Optional, Any, Dict, List from zerver.lib.exceptions import JsonableError class HttpResponseUnauthorized(HttpResponse): status_code = 401 def __init__(self, realm: str, www_authenticate: Optional[str]=None) -> None: ...
apache-2.0
kislyuk/domovoi
domovoi/app.py
1
11227
from __future__ import absolute_import, division, print_function, unicode_literals import json, gzip, base64, logging from chalice.app import Chalice, LambdaFunction, DecoratorAPI as ChaliceDecoratorAPI class DomovoiException(Exception): pass class ARN: fields = "arn partition service region account_id re...
apache-2.0
TRUFIL/erpnext
erpnext/config/crm.py
24
3497
from frappe import _ def get_data(): return [ { "label": _("Sales Pipeline"), "icon": "fa fa-star", "items": [ { "type": "doctype", "name": "Lead", "description": _("Database of potential customers."), }, { "type": "doctype", "name": "Opportunity", "description": _...
gpl-3.0
gitchs/tornado
demos/benchmark/stack_context_benchmark.py
99
2265
#!/usr/bin/env python """Benchmark for stack_context functionality.""" import collections import contextlib import functools import subprocess import sys from tornado import stack_context class Benchmark(object): def enter_exit(self, count): """Measures the overhead of the nested "with" statements ...
apache-2.0
cgar/servo
tests/wpt/css-tests/tools/wptserve/tests/functional/test_cookies.py
109
1946
import unittest import wptserve from .base import TestUsingServer class TestResponseSetCookie(TestUsingServer): def test_name_value(self): @wptserve.handlers.handler def handler(request, response): response.set_cookie("name", "value") return "Test" route = ("GET", ...
mpl-2.0
pombredanne/flask-babel
tests/tests.py
12
6247
# -*- coding: utf-8 -*- from __future__ import with_statement import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import unittest from decimal import Decimal import flask from datetime import datetime from flaskext import babel from flaskext.babel import gettext, ngettext, lazy_gett...
bsd-3-clause
lukesanantonio/inpassing-backend
inpassing/tests/data.py
1
1799
# Copyright (c) 2016 Luke San Antonio Bialecki # All rights reserved. import datetime from fixture import DataSet class Org(DataSet): class locust_valley: name = 'Locust Valley High School' class Daystate(DataSet): class a_day: org_id = Org.locust_valley.ref('id') identifier = 'A' ...
mit
NinjaMSP/crossbar
crossbar/worker/worker.py
1
14051
##################################################################################### # # Copyright (c) Crossbar.io Technologies GmbH # # Unless a separate license agreement exists between you and Crossbar.io GmbH (e.g. # you have purchased a commercial license), the license terms below apply. # # Should you enter ...
agpl-3.0
agallo/pyNetStuff
net1.py
1
1393
#!/usr/bin/python import networkx as nx # create Directed Graph called DG DG = nx.DiGraph() # create a list of ASNs ASpath1=[11039, 174, 14743, 13546] # add edges to directed graph from a list # new nodes will be created as needed (ie, if they don't exist in DG, they'll be created, existing nodes # will not be dupl...
unlicense
shlomimatichin/inaugurator
inaugurator/udev.py
3
2282
from inaugurator import pyudev from inaugurator import sh import os import fnmatch _ALSO = { 'mlx4_core': ['mlx4_en'] } def loadAllDrivers(): context = pyudev.Context() aliasTable = _loadAliasTable() deviceList = list(context.list_devices()) for device in deviceList: if u'MODALIAS' not i...
apache-2.0
jeromecc/doctoctocbot
src/tagging/tasks.py
1
13790
import os import unidecode from typing import Optional, List import ast from django.utils.translation import gettext as _ from django.db import transaction, DatabaseError from django.urls import reverse from celery.utils.log import get_task_logger from versions.exceptions import DeletionOfNonCurrentVersionError from...
mpl-2.0
greencoder/hopefullysunny-django
vendor/noaa/stations.py
1
2310
import os import shutil import noaa.models import noaa.utils def nearest_stations_with_distance(lat, lon, stations, radius=10.0, units="miles"): """Find all stations within radius of target. :param lat: :param lon: :param stations: list of stations objects to scan ...
mit
a-tal/pyweet
pyweet/colors.py
1
2316
"""Adds some color to the tweets.""" import re from blessings import Terminal class Term(object): """Static class to store terminal color info.""" @staticmethod def colors(): """Returns the colors in use for this terminal.""" if not hasattr(Term, "_colors"): Term._colors = ...
bsd-3-clause
b3niup/fackup
fackup/log.py
1
1387
import logging import sys from fackup.config import config def setup_logging(verbose, quiet, logger=None): if not logger: logger = logging.getLogger() logger.setLevel(logging.DEBUG) fmt = logging.Formatter('[%(asctime)s] [%(process)d] ' \ '%(levelname)-5s (%(name)s) %...
mit
tkurnosova/selenium
py/selenium/webdriver/chrome/webdriver.py
30
3633
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
jamesbeebop/CouchPotatoServer
libs/suds/sax/attribute.py
203
5788
# 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
CloudCoreo/cloudcoreo-client
tests/script-run-test.py
1
3025
import subprocess import os import time def print_output(rc, stdo, stde): print "proc_ret_code: %s" % rc if stdo: print " --- begin stdout ---" print stdo print " --- end stdout ---" if stde: print " --- begin stderr ---" print stde print " --- end stder...
apache-2.0
BeDjango/intef-openedx
cms/djangoapps/course_creators/migrations/0003_auto_20161215_0843.py
1
1361
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('course_creators', '0002_auto_20161213_1029'), ] operations = [ migrations.AlterField( ...
agpl-3.0
jballanc/openmicroscopy
components/tools/OmeroPy/test/unit/test_model.py
3
7699
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Simple unit test which makes various calls on the code generated model. Copyright 2007 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import pytest import omero import omero.clients from omero_mode...
gpl-2.0
vertcoin/electrum-vtc
gui/kivy/nfc_scanner/scanner_android.py
2
8458
'''This is the Android implementatoin of NFC Scanning using the built in NFC adapter of some android phones. ''' from kivy.app import App from kivy.clock import Clock #Detect which platform we are on from kivy.utils import platform if platform != 'android': raise ImportError import threading from electrum_vtc_gui...
mit
ASCrookes/django
django/db/backends/mysql/features.py
274
2651
from django.db.backends.base.features import BaseDatabaseFeatures from django.utils.functional import cached_property from .base import Database try: import pytz except ImportError: pytz = None class DatabaseFeatures(BaseDatabaseFeatures): empty_fetchmany_value = () update_can_self_select = False ...
bsd-3-clause
tryggvib/datapackage
datapackage/data/update_licenses.py
3
1651
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals import os import io import json import codecs try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen OPENDEFINITION_LICENSES_URL = \ 'http://licen...
gpl-3.0
mikeyarce/subscriptions-checkout-for-woocommerce
node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py
1569
23354
#!/usr/bin/env python # Copyright (c) 2012 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. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
gpl-2.0
skycucumber/Messaging-Gateway
webapp/venv/lib/python2.7/site-packages/twisted/internet/iocpreactor/reactor.py
42
9180
# -*- test-case-name: twisted.internet.test.test_iocp -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Reactor that uses IO completion ports """ import warnings, socket, sys from zope.interface import implements from twisted.internet import base, interfaces, main, error from twisted.p...
gpl-2.0
tumbl3w33d/ansible
test/units/modules/network/opx/test_opx_cps.py
23
8692
# # (c) 2018 Red Hat Inc. # # (c) 2018 Dell Inc. or its subsidiaries. All Rights Reserved. # # 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 L...
gpl-3.0
jmartinm/invenio
modules/bibformat/lib/elements/bfe_meta_opengraph_video.py
17
5340
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2013 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version ...
gpl-2.0
jinie/sublime-wakatime
packages/wakatime/packages/pytz3/tzinfo.py
11
19217
'''Base classes and helpers for building zone specific tzinfo classes''' from datetime import datetime, timedelta, tzinfo from bisect import bisect_right try: set except NameError: from sets import Set as set import pytz from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError __all__ = [] _time...
bsd-3-clause
broferek/ansible
test/units/modules/network/f5/test_bigip_profile_dns.py
22
4652
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import pytest import sys if sys.version_info < (2...
gpl-3.0