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
andim27/magiccamp
tests/regressiontests/forms/localflavor/ro.py
30
5828
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ RO form fields. tests = r""" >>> from django.contrib.localflavor.ro.forms import * ##ROCIFField ################################################################ f = ROCIFField() f.clean('21694681') u'21694681' f.clean('RO21694681') u'21694681' f.clean('216...
bsd-3-clause
ClimbsRocks/scikit-learn
examples/cluster/plot_color_quantization.py
61
3444
# -*- coding: utf-8 -*- """ ================================== Color Quantization using K-Means ================================== Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace (China), reducing the number of colors required to show the image from 96,615 unique colors to 64, while pre...
bsd-3-clause
GinnyN/towerofdimensions-django
build/lib/django/contrib/flatpages/models.py
410
1134
from django.db import models from django.contrib.sites.models import Site from django.utils.translation import ugettext_lazy as _ class FlatPage(models.Model): url = models.CharField(_('URL'), max_length=100, db_index=True) title = models.CharField(_('title'), max_length=200) content = models.TextField(_(...
bsd-3-clause
shogun-toolbox/shogun
examples/undocumented/python/distance_manhattanword.py
2
1105
#!/usr/bin/env python import shogun as sg traindna = '../data/fm_train_dna.dat' testdna = '../data/fm_test_dna.dat' parameter_list = [[traindna,testdna,3,0,False],[traindna,testdna,4,0,False]] def distance_manhattenword (train_fname=traindna,test_fname=testdna,order=3,gap=0,reverse=False): charfeat=sg.create_string...
bsd-3-clause
cbertinato/pandas
pandas/_config/localization.py
1
4655
""" Helpers for configuring locale settings. Name `localization` is chosen to avoid overlap with builtin `locale` module. """ from contextlib import contextmanager import locale import re import subprocess from pandas._config.config import options @contextmanager def set_locale(new_locale, lc_var=locale.LC_ALL): ...
bsd-3-clause
Microsoft/hummingbird
tests/test_sklearn_decomposition.py
1
5758
""" Tests sklearn matrix decomposition converters """ import unittest import warnings import sys from distutils.version import LooseVersion import numpy as np import torch import sklearn from sklearn.decomposition import FastICA, KernelPCA, PCA, TruncatedSVD from sklearn.model_selection import train_test_split from sk...
mit
mkrupcale/ansible
lib/ansible/modules/cloud/amazon/ec2_asg.py
13
38185
#!/usr/bin/python # 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 distributed...
gpl-3.0
bogdanvuk/sydpy
sydpy/types/__init__.py
1
1304
# This file is part of sydpy. # # Copyright (C) 2014-2015 Bogdan Vukobratovic # # sydpy is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 2.1 # of the License, or (at your option)...
lgpl-2.1
kubeflow/kfserving
python/kfserving/test/test_v1beta1_transformer_config.py
1
2113
# Copyright 2020 kubeflow.org. # # 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
zenodo/invenio
invenio/legacy/registry.py
18
2353
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any...
gpl-2.0
openmb/openblackhole-enigma2
lib/python/Plugins/SystemPlugins/SoftwareManager/SoftwareTools.py
47
9344
# -*- coding: iso-8859-1 -*- from enigma import eConsoleAppContainer from Components.Console import Console from Components.About import about from Components.PackageInfo import PackageInfoHandler from Components.Language import language from Components.Sources.List import List from Components.Ipkg import IpkgComponent...
gpl-2.0
sassman/ansible-modules-core
cloud/amazon/ec2_snapshot.py
6
5398
#!/usr/bin/python # 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 distributed...
gpl-3.0
dcolligan/server
setup.py
4
2617
# Don't import __future__ packages here; they make setup fail # First, we try to use setuptools. If it's not available locally, # we fall back on ez_setup. try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup with open(...
apache-2.0
saullocastro/compmech
doc/pyplots/theory/fem/fsdt_donnell_kquad4.py
3
1473
from matplotlib.pyplot import * from math import sqrt m = 1/3. xs = [+1, +1, -1, -1] ys = [-1, +1, -1, +1] figure(figsize=(4, 4)) ax = gca() ax.spines['right'].set_visible(False) ax.spines['top'].set_visible(False) ax.spines['left'].set_position(('data', 0)) ax.spines['bottom'].set_position(('data', 0)) ax.xaxis.set_t...
bsd-3-clause
timduru/platform-external-chromium_org
tools/site_compare/site_compare.py
179
6504
#!/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. """SiteCompare component to handle bulk scrapes. Invokes a list of browsers and sends them to a list of URLs, saving the rendered ...
bsd-3-clause
SummerLW/Perf-Insight-Report
third_party/gsutil/third_party/apitools/apitools/base/py/batch_test.py
11
19527
"""Tests for google3.cloud.bigscience.apitools.base.py.batch.""" import textwrap import mock from six.moves import http_client from six.moves.urllib import parse import unittest2 from apitools.base.py import batch from apitools.base.py import exceptions from apitools.base.py import http_wrapper class FakeCredentia...
bsd-3-clause
Cian47/anti_bicycle_theft
python-api/env/lib/python3.5/site-packages/pip/_vendor/html5lib/treebuilders/dom.py
920
8469
from __future__ import absolute_import, division, unicode_literals from xml.dom import minidom, Node import weakref from . import _base from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory def getDomBuilder(DomImplementation): Dom = DomImplementation class A...
mit
mensler/ansible
hacking/cherrypick.py
62
1474
#!/usr/bin/env python3 import os import sys import tempfile import sh REPO_PATH = {'extras': '/srv/ansible/stable-2.2/lib/ansible/modules/extras', 'core': '/srv/ansible/stable-2.2/lib/ansible/modules/core'} if __name__ == '__main__': commit_hash = sys.argv[1] which_modules = sys.argv[2] git = sh...
gpl-3.0
erikmcc/kubernetes
cluster/juju/layers/kubernetes-worker/lib/charms/kubernetes/flagmanager.py
290
4961
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 appli...
apache-2.0
JackWoot/E2E-Messenger
Server/server/lib/werkzeug/contrib/wrappers.py
318
10331
# -*- coding: utf-8 -*- """ werkzeug.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~ Extra wrappers or mixins contributed by the community. These wrappers can be mixed in into request objects to add extra functionality. Example:: from werkzeug.wrappers import Request as RequestBase fr...
gpl-2.0
karthikvadla16/spark-tk
regression-tests/sparktkregtests/testcases/frames/column_method_drop_test.py
14
3803
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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
mikeckennedy/cookiecutter-pyramid-talk-python-starter
{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/services/cms_service.py
1
1465
from {{cookiecutter.project_slug}}.data.cms_page import CmsPage from {{cookiecutter.project_slug}}.data.dbsession import DbSessionFactory class CmsService: @classmethod def get_page_by_url(cls, url): if not url: return None url = url.lower().strip() session = DbSessionFact...
mit
jamesblunt/sympy
sympy/physics/sho.py
71
2482
from __future__ import print_function, division from sympy.core import S, pi, Rational from sympy.functions import assoc_laguerre, sqrt, exp, factorial, factorial2 def R_nl(n, l, nu, r): """ Returns the radial wavefunction R_{nl} for a 3d isotropic harmonic oscillator. ``n`` the "nodal" quan...
bsd-3-clause
iceihehe/pipeg
python3/genome2.py
4
5090
#!/usr/bin/env python3 # Copyright © 2012-13 Qtrac Ltd. All rights reserved. # This program or module is free software: you can redistribute it # and/or modify it under the terms of the GNU General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any ...
mit
cedk/odoo
addons/mrp_operations/report/mrp_code_barcode.py
381
1511
# -*- 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
sjdines/mezzanine-fluent-pages
mezzanine_fluent_pages/mezzanine_layout_page/admin.py
1
6680
from django.conf.urls import url from django.contrib import admin from fluent_contents.admin import PlaceholderEditorAdmin from fluent_contents.analyzer import get_template_placeholder_data from fluent_utils.ajax import JsonResponse from mezzanine.pages.admin import PageAdmin from . import models, widgets class Flue...
bsd-2-clause
ibmsoe/tensorflow
tensorflow/python/framework/meta_graph.py
34
26049
# 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
fuzzysteve/yamlloader
tableloader/tableFunctions/groups.py
1
1801
# -*- coding: utf-8 -*- from yaml import load, dump try: from yaml import CSafeLoader as SafeLoader print "Using CSafeLoader" except ImportError: from yaml import SafeLoader print "Using Python SafeLoader" import os import sys reload(sys) sys.setdefaultencoding("utf-8") from sqlalchemy import Table def importyaml...
mit
gonzolino/heat
heat/db/sqlalchemy/migrate_repo/versions/047_stack_nested_depth.py
13
1602
# # 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
realsystem/CloudFerry
cloudferrylib/base/action/action.py
11
1065
# Copyright (c) 2014 Mirantis Inc. # # Licensed under the Apache License, Version 2.0 (the License); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
apache-2.0
oberstet/crossbarexamples
rest/needs_cleanup/python/lib/crossbarconnect/client.py
9
8266
############################################################################### ## ## Copyright (C) 2012-2014 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 ## ## h...
apache-2.0
CiscoSystems/nova
nova/tests/api/openstack/compute/contrib/test_snapshots.py
30
8037
# Copyright 2011 Denali Systems, 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 requ...
apache-2.0
diagramsoftware/odoomrp-utils
product_uom_change_fix/models/product.py
13
1920
# -*- encoding: utf-8 -*- ############################################################################## # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of th...
agpl-3.0
noba3/KoTos
addons/script.module.urlresolver/lib/urlresolver/plugins/watchfreeinhd.py
4
2097
''' watchfreeinhd urlresolver plugin Copyright (C) 2013 voinage 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 i...
gpl-2.0
OldHuntsman/DefilerWings
game/pythoncode/girls.py
1
16984
# coding=utf-8 import random import data import renpy.exports as renpy import renpy.store as store import girls_data from treasures import gen_treas from utils import call from characters import Girl from data import achieve_target class GirlsList(object): def __init__(self, game_ref, base_character): se...
bsd-3-clause
Reddine/dzlibs
tweeza/users/views.py
9
2145
from flask import (Blueprint, render_template, flash, request, redirect, url_for) from flask.ext.login import login_required, current_user from users.models import User from items.models import Item from users.forms import EditProfileForm from flask.ext.babel import gettext as _ users = Blueprint('u...
mpl-2.0
hujiajie/pa-chromium
tools/git/for-all-touched-files.py
130
3879
#!/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. """ Invokes the specified (quoted) command for all files modified between the current git branch and the specified branch or co...
bsd-3-clause
asampat3090/readthedocs.org
readthedocs/restapi/urls.py
4
1407
from django.conf.urls import url, patterns, include from rest_framework import routers from .views.model_views import BuildViewSet, ProjectViewSet, NotificationViewSet, VersionViewSet from readthedocs.comments.views import CommentViewSet router = routers.DefaultRouter() router.register(r'build', BuildViewSet) router...
mit
kustodian/ansible
test/units/module_utils/network/ftd/test_fdm_swagger_parser.py
37
17322
# Copyright (c) 2018 Cisco and/or its affiliates. # # 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 v...
gpl-3.0
ebukoz/thrive
erpnext/maintenance/doctype/maintenance_visit/maintenance_visit.py
11
3120
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from erpnext.utilities.transaction_base import TransactionBase class MaintenanceVisit(TransactionBase): def get_fe...
gpl-3.0
joker946/nova
nova/tests/functional/v3/test_multiple_create.py
30
2240
# Copyright 2012 Nebula, Inc. # Copyright 2014 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...
apache-2.0
owattenmaker/PythonFighter
fighterV02.py
1
14644
''' Worst fighting game ever By: Owen Wattenmaker, Max Lambek ''' #TODO ############################################################################################ ### -add in frames for attacking, looks too choppy, need more pictures ### ### -fix yellow hit marker ### ### -f...
mit
FluidityProject/fluidity
python/elementtree/SimpleXMLWriter.py
103
8616
# # SimpleXMLWriter # $Id: SimpleXMLWriter.py 2312 2005-03-02 18:13:39Z fredrik $ # # a simple XML writer # # history: # 2001-12-28 fl created # 2002-11-25 fl fixed attribute encoding # 2002-12-02 fl minor fixes for 1.5.2 # 2004-06-17 fl added pythondoc markup # 2004-07-23 fl added flush method (from Jay Grav...
lgpl-2.1
alivecor/tensorflow
tensorflow/contrib/learn/python/learn/datasets/base_test.py
136
3072
# 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
greguu/linux-4.2.3-c3x00
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
MER-GROUP/intellij-community
python/helpers/py3only/docutils/languages/de.py
200
1722
# $Id: de.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: Gunnar Schwant <g.schwant@gmx.de> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated ...
apache-2.0
caphrim007/ansible
lib/ansible/module_utils/facts/system/apparmor.py
232
1311
# Collect facts related to apparmor # # 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. # # An...
gpl-3.0
KanoComputing/kano-toolset
tests/fixtures/keyboard.py
1
1887
# # keyboard.py # # Copyright (C) 2018 Kano Computing Ltd. # License: http://www.gnu.org/licenses/gpl-2.0.txt GNU GPL v2 # # Fixtures for fake keyboards # import imp import os import pytest KEYBOARD_LSUSB_DIR = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'keyboard' ) KEYBOARD_LSUSB_OUTPUTS = [ ...
gpl-2.0
SaintEmbers/muse-hack
node_modules/socket.io/node_modules/engine.io/node_modules/engine.io-parser/node_modules/utf8/tests/generate-test-data.py
2214
1347
#!/usr/bin/env python import re import json # http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae # http://stackoverflow.com/a/13436167/96656 def unisymbol(codePoint): if codePoint >= 0x0000 and codePoint <= 0xFFFF: return unichr(codePoint) elif codePoint >= 0x010000 and codePoint <= 0x10FFFF: ...
mit
samthor/intellij-community
python/lib/Lib/site-packages/django/contrib/auth/management/__init__.py
126
2854
""" Creates permissions for all installed apps that need permissions. """ from django.contrib.auth import models as auth_app from django.db.models import get_models, signals def _get_permission_codename(action, opts): return u'%s_%s' % (action, opts.object_name.lower()) def _get_all_permissions(opts): "Retu...
apache-2.0
sudheesh001/oh-mainline
vendor/packages/PyYaml/lib/yaml/composer.py
534
4921
__all__ = ['Composer', 'ComposerError'] from error import MarkedYAMLError from events import * from nodes import * class ComposerError(MarkedYAMLError): pass class Composer(object): def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if se...
agpl-3.0
NeCTAR-RC/horizon
openstack_dashboard/templatetags/context_selection.py
1
4352
# Copyright 2014 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
bj7/pwndbg
ida_script.py
2
1687
import idaapi import idautils import idc import functools import datetime import threading import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer import idaapi import idautils import idc # Save the database so nothing gets lost. idc.SaveBase(idc.GetIdbPath() + '.' + datetime.datetime.now().isoformat()) x...
mit
7digital/troposphere
examples/ApiGateway.py
4
4609
from troposphere import Ref, Template, Output from troposphere.apigateway import RestApi, Method from troposphere.apigateway import Resource, MethodResponse from troposphere.apigateway import Integration, IntegrationResponse from troposphere.apigateway import Deployment, Stage, ApiStage from troposphere.apigateway impo...
bsd-2-clause
andreparrish/python-for-android
python-build/python-libs/gdata/build/lib/gdata/blogger/__init__.py
140
6426
#!/usr/bin/python # # Copyright (C) 2007, 2008 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 applicabl...
apache-2.0
kobotoolbox/kobocat
onadata/libs/constants.py
1
1349
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import # Userprofile Permissions CAN_ADD_USERPROFILE = 'add_userprofile' CAN_CHANGE_USERPROFILE = 'change_userprofile' CAN_DELETE_USERPROFILE = 'delete_userprofile' CAN_ADD_XFORM_TO_PROFILE = 'can_add_xform' CAN_VIEW_PROFILE = 'view_profile' # ...
bsd-2-clause
ChanduERP/odoo
addons/purchase/company.py
383
1576
# -*- 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
alexteodor/odoo
addons/pos_restaurant/__init__.py
332
1074
# -*- 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
GeoNode/geonode
geonode/geoserver/tests/test_helpers.py
2
7983
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2019 OSGeo # # 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 ...
gpl-3.0
sajuptpm/neutron-ipam
neutron/plugins/ml2/drivers/mech_linuxbridge.py
26
2340
# Copyright (c) 2013 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
nerdvegas/rez
src/rez/data/tests/builds/packages/foo/1.1.0/build.py
1
1617
from __future__ import print_function from build_util import build_directory_recurse, check_visible import os.path def build(source_path, build_path, install_path, targets): # build requirement 'floob' should be visible check_visible("foo", "floob") import floob print(floob.hello()) # do the bu...
lgpl-3.0
cfg2015/EPT-2015-2
addons/marketing_campaign/report/__init__.py
441
1071
# -*- 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
SheepDogInc/ssheepdog
ssheepdog/migrations/0007_auto__add_loginlog__chg_field_applicationkey_public_key__chg_field_use.py
1
8799
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'LoginLog' db.create_table('ssheepdog_loginlog', ( ('stdout', self.gf('djan...
bsd-3-clause
flyher/pymo
symbian/PythonForS60_1.9.6/module-repo/standard-modules/encodings/gb2312.py
816
1027
# # gb2312.py: Python Unicode Codec for GB2312 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gb2312') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrem...
mit
Edraak/edx-platform
lms/djangoapps/shoppingcart/context_processor.py
173
1679
""" This is the shoppingcart context_processor module. Currently the only context_processor detects whether request.user has a cart that should be displayed in the navigation. We want to do this in the context_processor to 1) keep database accesses out of templates (this led to a transaction bug with user email change...
agpl-3.0
AdaptiveApplications/carnegie
tarc_bus_locator_client/quantities-0.10.1/build/lib/quantities/units/radiation.py
4
1072
""" """ from __future__ import absolute_import from ..unitquantity import UnitQuantity from .time import s from .mass import kg from .energy import J from .electromagnetism import coulomb Bq = becquerel = UnitQuantity( 'becquerel', 1/s, symbol='Bq', aliases=['becquerels'] ) Ci = curie = UnitQuantity(...
mit
rossburton/yocto-autobuilder
lib/python2.7/site-packages/SQLAlchemy-0.7.0-py2.7-linux-x86_64.egg/sqlalchemy/pool.py
8
33408
# sqlalchemy/pool.py # Copyright (C) 2005-2011 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 """Connection pooling for DB-API connections. Provides a number of connection poo...
gpl-2.0
GoogleCloudPlatform/python-compat-runtime
appengine-compat/exported_appengine_sdk/google/appengine/ext/vmruntime/initialize.py
1
3059
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
mogotest/selenium
selenium/src/py/lib/docutils/readers/pep.py
5
1666
# Author: David Goodger # Contact: goodger@users.sourceforge.net # Revision: $Revision: 3892 $ # Date: $Date: 2005-09-20 22:04:53 +0200 (Tue, 20 Sep 2005) $ # Copyright: This module has been placed in the public domain. """ Python Enhancement Proposal (PEP) Reader. """ __docformat__ = 'reStructuredText' ...
apache-2.0
Timurdov/bionic
bionic/Lib/site-packages/django/contrib/sessions/backends/cache.py
102
2499
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.cache import caches from django.utils.six.moves import xrange KEY_PREFIX = "django.contrib.sessions.cache" class SessionStore(SessionBase): """ A cache-based session store. """ ...
apache-2.0
mushtaqak/edx-platform
cms/djangoapps/contentstore/features/transcripts.py
46
8895
# disable missing docstring # pylint: disable=missing-docstring import os from lettuce import world, step from django.conf import settings from xmodule.contentstore.content import StaticContent from xmodule.contentstore.django import contentstore from xmodule.exceptions import NotFoundError from splinter.request_han...
agpl-3.0
ioanpocol/superdesk-core
tests/publish/ninjs_formatter_test.py
1
44687
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import...
agpl-3.0
zengenti/ansible
lib/ansible/utils/module_docs_fragments/dellos9.py
42
3407
# # (c) 2015, Peter Sprygada <psprygada@ansible.com> # # Copyright (c) 2016 Dell 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 Licens...
gpl-3.0
dag/genshi
genshi/filters/transform.py
23
48218
# -*- coding: utf-8 -*- # # Copyright (C) 2007-2009 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://genshi.edgewall.org/wiki/License. # # This software consist...
bsd-3-clause
silentfuzzle/calibre
src/chardet/sjisprober.py
190
3549
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
gpl-3.0
sunzuolei/youtube-dl
youtube_dl/extractor/blinkx.py
199
3217
from __future__ import unicode_literals import json from .common import InfoExtractor from ..utils import ( remove_start, int_or_none, ) class BlinkxIE(InfoExtractor): _VALID_URL = r'(?:https?://(?:www\.)blinkx\.com/#?ce/|blinkx:)(?P<id>[^?]+)' IE_NAME = 'blinkx' _TEST = { 'url': 'http:...
unlicense
AOSC-Dev/aosc-os-abbs
extra-libs/nss/autobuild/certdata2pem.py
6
7075
#!/usr/bin/python # vim:set et sw=4: # # certdata2pem.py - splits certdata.txt into multiple files # # Copyright (C) 2009 Philipp Kern <pkern@debian.org> # Copyright (C) 2013 Kai Engert <kaie@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Pub...
gpl-2.0
frohoff/Empire
lib/listeners/template.py
2
9688
import base64 import random # Empire imports from lib.common import helpers from lib.common import agents from lib.common import encryption from lib.common import packets from lib.common import messages class Listener: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Template...
bsd-3-clause
YAOSP/kernel_huawei_angler
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
gpl-2.0
lamastex/scalable-data-science
db/xtraResources/edXBigDataSeries2015/CS100-1x/Module 4: Text Analysis and Entity Resolution Lab Solutions.py
2
73278
# Databricks notebook source exported at Mon, 14 Mar 2016 03:33:29 UTC # MAGIC %md # MAGIC **SOURCE:** This is from the Community Edition of databricks and has been added to this databricks shard at [/#workspace/scalable-data-science/xtraResources/edXBigDataSeries2015/CS100-1x](/#workspace/scalable-data-science/xtraRes...
unlicense
wilvk/ansible
lib/ansible/modules/cloud/amazon/ecs_service_facts.py
14
8170
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
Muxi-X/muxi_site
muxiwebsite/api/signup.py
2
1117
# -*- coding: utf-8 -*- """ signup.py ~~~~~~~~~ 木犀官网注册API """ from flask import jsonify, g, request from . import api from muxiwebsite.models import User from .authentication import auth from muxiwebsite import db from werkzeug.security import generate_password_hash import base64 @api.route('/signup/', m...
mit
mlucchini/electricitymap
parsers/CA_YT.py
1
4487
import arrow from bs4 import BeautifulSoup import requests timezone = 'Canada/Pacific' def fetch_production(country_code='CA-YT', session=None): """Requests the last known production mix (in MW) of a given region Arguments: country_code -- ignored here, only information for CA-YT is returned ...
gpl-3.0
stamhe/zulip
zproject/test_settings.py
115
1817
from settings import * import os DATABASES["default"] = {"NAME": "zulip_test", "USER": "zulip_test", "PASSWORD": LOCAL_DATABASE_PASSWORD, "HOST": "localhost", "SCHEMA": "zulip", "ENGINE": "django.db....
apache-2.0
fusionpig/ansible
lib/ansible/plugins/action/win_template.py
117
1168
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
elkingtonmcb/rethinkdb
external/v8_3.30.33.16/tools/testrunner/local/progress.py
41
10716
# Copyright 2012 the V8 project authors. 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 conditi...
agpl-3.0
ScienceStacks/SciSheets
mysite/scisheets/core/helpers/block_execution_controller.py
2
7374
""" This class interacts with the code generated for evaluating a scisheet to control the execution of blocks of code. A block of code (hereafter, just block) can be a formulas, prologue, or epilogue. """ from Files.logger import Logger from mysite import settings import inspect import os import sys class BlockExecut...
apache-2.0
yukim/cassandra-dtest
udtencoding_test.py
2
2105
from dtest import Tester from assertions import assert_invalid from tools import since import os, sys, time from ccmlib.cluster import Cluster @since('2.1') class TestUDTEncoding(Tester): def udt_test(self): """ Test (somewhat indirectly) that user queries involving UDT's are properly encoded (due to dri...
apache-2.0
lyarwood/bugwarrior
tests/test_config.py
2
3581
# coding: utf-8 from __future__ import unicode_literals import os import configparser from unittest import TestCase import bugwarrior.config as config from .base import ConfigTest class TestGetConfigPath(ConfigTest): def create(self, path): """ Create an empty file in the temporary directory, ...
gpl-3.0
TangXT/GreatCatMOOC
lms/djangoapps/courseware/tests/test_model_data.py
3
14099
""" Test for lms courseware app, module data (runtime data storage for XBlocks) """ import json from mock import Mock, patch from functools import partial from courseware.model_data import DjangoKeyValueStore from courseware.model_data import InvalidScopeError, FieldDataCache from courseware.models import StudentModul...
agpl-3.0
zero323/spark
python/pyspark/mllib/random.py
22
19517
# # 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
toolforger/sympy
sympy/plotting/pygletplot/tests/test_plotting.py
109
2653
from sympy.external.importtools import import_module disabled = False # if pyglet.gl fails to import, e.g. opengl is missing, we disable the tests pyglet_gl = import_module("pyglet.gl", catch=(OSError,)) pyglet_window = import_module("pyglet.window", catch=(OSError,)) if not pyglet_gl or not pyglet_window: disabl...
bsd-3-clause
dvliman/jaikuengine
.google_appengine/lib/django-1.5/tests/regressiontests/syndication/tests.py
47
13086
from __future__ import absolute_import, unicode_literals from xml.dom import minidom from django.contrib.syndication import views from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.utils import tzinfo from django.utils.feedgenerator import rfc2822_date, rfc3339_date ...
apache-2.0
AntonKhorev/BudgetSpb
main.py
1
1072
#!/usr/bin/env python3 from linker import Linker import htmlPage import content.index,content.db,content.fincom # TODO put into config spbBudgetXlsPath='../spb-budget-xls' if __name__=='__main__': linker=Linker('filelists',{ 'csv':['csv'], 'xls':['xls'], 'db':['zip','sql','xlsx'], }) htmlPage.HtmlPage('inde...
bsd-2-clause
postla/e2-gui
lib/python/Plugins/SystemPlugins/WirelessAccessPoint/plugin.py
6
26631
from Screens.Screen import Screen from Components.ConfigList import ConfigListScreen, ConfigList from Components.config import config, ConfigSubsection, getConfigListEntry, ConfigSelection, ConfigIP, ConfigInteger from Components.config import ConfigText, ConfigYesNo, NoSave, ConfigPassword, ConfigNothing, ConfigSequen...
gpl-2.0
Remper/learningbyreading
src/mappings.py
2
1612
import logging as log import os import re # builds a dictionary of frame names indexed by wordnet synset id offset2bn = dict() bn2offset = dict() offset2wn = dict() wn2offset = dict() wn2bn = dict() bn2wn = dict() wn30wn31 = dict() wn31wn30 = dict() bn2dbpedia = dict() dbpedia2bn = dict() # the mapping is in a tabula...
gpl-2.0
hofschroeer/gnuradio
gr-filter/examples/resampler.py
7
4489
#!/usr/bin/env python # # Copyright 2009,2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your ...
gpl-3.0
fusionapp/entropy
entropy/ientropy.py
1
3968
""" @copyright: 2007-2014 Quotemaster cc. See LICENSE for details. Interface definitions for Entropy. """ from zope.interface import Interface, Attribute class IContentObject(Interface): """ Immutable content object. """ hash = Attribute("""The hash function used to calculate the content digest.""")...
mit
ruibarreira/linuxtrail
usr/lib/python3/dist-packages/orca/scripts/apps/gcalctool/script.py
5
3292
# Orca # # Copyright 2004-2008 Sun Microsystems Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This...
gpl-3.0
vponomaryov/manila
manila/tests/share/drivers/netapp/dataontap/client/test_client_base.py
1
6337
# Copyright (c) 2014 Alex Meade. All rights reserved. # Copyright (c) 2014 Clinton Knight. 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://w...
apache-2.0