repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
rabc/Gitmark
werkzeug/contrib/jsrouting.py
25
8282
# -*- coding: utf-8 -*- """ werkzeug.contrib.jsrouting ~~~~~~~~~~~~~~~~~~~~~~~~~~ Addon module that allows to create a JavaScript function from a map that generates rules. :copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ ...
mit
rooshilp/CMPUT410W15-project
testenv/lib/python2.7/site-packages/django/contrib/webdesign/lorem_ipsum.py
81
4910
""" Utility functions for generating "lorem ipsum" Latin text. """ from __future__ import unicode_literals import random COMMON_P = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco ...
gpl-2.0
LettError/filibuster
Lib/filibuster/content/horoscope.py
1
7144
# -*- coding: UTF-8 -*- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------- # Contributed by Erik van Blokland and Jonathan Hoefler # # FILIBUSTERb # # MIT License # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------- """ living - - - - ...
mit
heeraj123/oh-mainline
vendor/packages/Django/django/core/management/commands/runserver.py
47
5461
from optparse import make_option from datetime import datetime import errno import os import re import sys import socket from django.core.management.base import BaseCommand, CommandError from django.core.servers.basehttp import run, get_internal_wsgi_application from django.utils import autoreload naiveip_re = re.com...
agpl-3.0
CSC301H-Fall2013/JuakStore
site-packages/tests/regressiontests/queryset_pickle/models.py
29
1436
from __future__ import absolute_import import datetime from django.db import models from django.utils.translation import ugettext_lazy as _ def standalone_number(self): return 1 class Numbers(object): @staticmethod def get_static_number(self): return 2 @classmethod def get_class_number...
mit
tethysplatform/tethys
tests/unit_tests/test_tethys_services/test_backends/test_adfs.py
2
1999
from django import test from tethys_services.backends.adfs import ADFSOpenIdConnect, ADFSOpenIdConnectMultiTenant from tethys_services.backends.multi_tenant_mixin import MultiTenantMixin @test.override_settings( SOCIAL_AUTH_ADFS_OIDC_KEY='182f8cb0-b8b2-0138-3936-0647e35409d7171986', SOCIAL_AUTH_ADFS_OIDC_SECR...
bsd-2-clause
SwagColoredKitteh/servo
tests/wpt/css-tests/tools/wptserve/tests/functional/test_pipes.py
299
3178
import os import unittest import urllib2 import json import time import wptserve from base import TestUsingServer, doc_root class TestStatus(TestUsingServer): def test_status(self): resp = self.request("/document.txt", query="pipe=status(202)") self.assertEquals(resp.getcode(), 202) class TestHea...
mpl-2.0
jmwright/cadquery-projects
generative-design/simple_beam/simple_beam_design.py
1
1744
from random import randint import cadquery as cq from Helpers import show # Generates a random solid, and keeps trying till it finds one def generate(width=10, height=10, startingPoints=6): points = [] # Make sure that we get stop points for the random points that make sense xStop = w yStop = h / 2.0...
apache-2.0
DirtyPiece/dancestudio
Build/Tools/Python27/Lib/test/pydocfodder.py
194
6329
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
mit
oshanz/Learn-Django
tests/queries/models.py
44
14339
""" Various complex queries that have been problematic in the past. """ from __future__ import unicode_literals import threading from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible class DumbCategory(models.Model): pass class ProxyCategory(Dum...
gpl-3.0
toanalien/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/extensions.py
119
31715
# Copyright 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 f...
bsd-3-clause
chand3040/cloud_that
common/lib/capa/capa/tests/test_shuffle.py
196
13736
"""Tests the capa shuffle and name-masking.""" import unittest import textwrap from . import test_capa_system, new_loncapa_problem from capa.responsetypes import LoncapaProblemError class CapaShuffleTest(unittest.TestCase): """Capa problem tests for shuffling and choice-name masking.""" def setUp(self): ...
agpl-3.0
facebookexperimental/eden
eden/hg-server/edenscm/hgext/gpg.py
2
10712
# Portions Copyright (c) Facebook, Inc. and its affiliates. # # This software may be used and distributed according to the terms of the # GNU General Public License version 2. # Copyright 2005, 2006 Benoit Boissinot <benoit.boissinot@ens-lyon.org> # # This software may be used and distributed according to the terms of...
gpl-2.0
peoplepower/composer-sdk-python
com.ppc.Lesson2-LiveUpdates/localization.py
30
1090
''' Created on October 27, 2017 This file is subject to the terms and conditions defined in the file 'LICENSE.txt', which is part of this source code package. @author: David Moss ''' # Add any code here to import and apply localization one time. import gettext import os import domain # Set some default language h...
apache-2.0
udacity/ud858
Lesson_4/Additions/TODO_5_conference.py
49
2368
OPERATORS = { 'EQ': '=', 'GT': '>', 'GTEQ': '>=', 'LT': '<', 'LTEQ': '<=', 'NE': '!=' } FIELDS = { 'CITY': 'city', 'TOPIC': 'topics', 'MONTH': 'month', 'MAX_ATTENDEES': 'maxAtt...
gpl-3.0
CVL-dev/cvl-fabric-launcher
pyinstaller-2.1/PyInstaller/loader/rthooks/pyi_rth_mplconfig.py
10
1430
#----------------------------------------------------------------------------- # Copyright (c) 2013, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this softwa...
gpl-3.0
di0spyr0s/pants
tests/python/pants_test/backend/jvm/targets/test_jar_dependency.py
10
2520
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.backend.j...
apache-2.0
mnizol/ormpy
test/TestPopulation.py
1
26387
############################################################################## # Package: ormpy # File: TestPopulation.py # Author: Matthew Nizol ############################################################################## """ This file contains unit tests for the lib.Population module. """ import os, sys, re f...
gpl-2.0
mt2d2/servo
tests/wpt/web-platform-tests/webdriver/timeouts/implicit_waits_tests.py
58
2559
import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from webdriver import exceptions class ImplicitWaitsTests(base_test.WebDriverBaseTest): def setUp(self): self.driver.get(self.webserver.where_is('timeouts/res/implicit_waits_tests.ht...
mpl-2.0
rlugojr/django
django/contrib/admin/actions.py
14
3255
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
bsd-3-clause
mcecchi/SuperOcto
roboOctoprint/src/octoprint/server/api/printer_profiles.py
3
5752
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" i...
agpl-3.0
heromod/migrid
mig/cgi-bin/showre.py
1
1100
#!/usr/bin/python # -*- coding: utf-8 -*- # # --- BEGIN_HEADER --- # # showre - [insert a few words of module description on this line] # Copyright (C) 2003-2009 The MiG Project lead by Brian Vinter # # This file is part of MiG. # # MiG is free software: you can redistribute it and/or modify # it under the terms of th...
gpl-2.0
shurihell/testasia
cms/djangoapps/contentstore/views/helpers.py
44
11531
""" Helper methods for Studio views. """ from __future__ import absolute_import from uuid import uuid4 import urllib from django.conf import settings from django.http import HttpResponse from django.shortcuts import redirect from django.utils.translation import ugettext as _ from edxmako.shortcuts import render_to_...
agpl-3.0
nicolargo/intellij-community
python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/refactor.py
199
28068
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactoring too...
apache-2.0
odoousers2014/addons-yelizariev
mail_fix_553/mail_fix_553.py
14
8736
# -*- coding: utf-8 -*- import base64 import logging from email.utils import formataddr from urlparse import urljoin from openerp import api, tools from openerp import SUPERUSER_ID from openerp.addons.base.ir.ir_mail_server import MailDeliveryException from openerp.osv import fields, osv from openerp.tools.safe_eval ...
lgpl-3.0
sandsmark/qtcreator-minimap
src/libs/3rdparty/botan/wrappers/swig/tests/block2.py
14
1036
#!/usr/bin/python import botan, base64 class MyCipher(botan.BlockCipherImpl): def __init__(self): botan.BlockCipherImpl.__init__(self, 8, 8, 16, 1) def name(self): return "MyCipher" def encrypt(self, input): return input.swapcase() def decrypt(self, input): return in...
lgpl-2.1
ecederstrand/django
tests/unmanaged_models/models.py
210
3763
""" Models can have a ``managed`` attribute, which specifies whether the SQL code is generated for the table on various manage.py operations. """ from django.db import models from django.utils.encoding import python_2_unicode_compatible # All of these models are created in the database by Django. @python_2_unicod...
bsd-3-clause
collex100/odoo
addons/project_issue/report/project_issue_report.py
303
4652
# -*- 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 GN...
agpl-3.0
Leila20/django
django/utils/log.py
85
6462
from __future__ import unicode_literals import logging import logging.config # needed when logging_config doesn't start with logging.config from copy import copy from django.conf import settings from django.core import mail from django.core.mail import get_connection from django.core.management.color import color_st...
bsd-3-clause
RCHG/blog_backup
_vendor/bundle/ruby/2.1.0/gems/pygments.rb-0.6.0/vendor/pygments-main/pygments/styles/tango.py
135
7096
# -*- coding: utf-8 -*- """ pygments.styles.tango ~~~~~~~~~~~~~~~~~~~~~ The Crunchy default Style inspired from the color palette from the Tango Icon Theme Guidelines. http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines Butter: #fce94f #edd400 #c4a000 Orange: #fcaf3e ...
mit
theo-l/django
django/utils/deprecation.py
4
5058
import asyncio import inspect import warnings from asgiref.sync import sync_to_async class RemovedInDjango40Warning(DeprecationWarning): pass class RemovedInDjango41Warning(PendingDeprecationWarning): pass RemovedInNextVersionWarning = RemovedInDjango40Warning class warn_about_renamed_method: def _...
bsd-3-clause
216software/Profiles
communityprofiles/profiles/oldmigrations/0042_auto__chg_field_datadomain_name__chg_field_datadomain_slug.py
2
15206
# 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): # Changing field 'DataDomain.name' db.alter_column('profiles_datadomain', 'name', self.gf('django.db.model...
mit
gylian/sickrage
lib/bs4/builder/_html5lib.py
423
10647
__all__ = [ 'HTML5TreeBuilder', ] import warnings from bs4.builder import ( PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) from bs4.element import NamespacedAttribute import html5lib from html5lib.constants import namespaces from bs4.element import ( Comment, Doctype, NavigableStr...
gpl-3.0
rven/odoo
addons/account_check_printing/models/account_journal.py
2
5750
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import re from odoo import models, fields, api, _ from odoo.exceptions import ValidationError class AccountJournal(models.Model): _inherit = "account.journal" check_manual_sequencing = fields.Boolean( s...
agpl-3.0
abhilashnta/edx-platform
common/djangoapps/pipeline_js/views.py
162
1215
""" Views for returning XModule JS (used by requirejs) """ import json from django.conf import settings from django.http import HttpResponse from staticfiles.storage import staticfiles_storage from edxmako.shortcuts import render_to_response def get_xmodule_urls(): """ Returns a list of the URLs to hit to gra...
agpl-3.0
fabricematrat/theblues
theblues/tests/test_support.py
2
2373
from unittest import TestCase from httmock import HTTMock from theblues.support import ( Priority, Support, ) class TestSupport(TestCase): def create_case(self, url, request): self.assertEqual('http://example.com/', url.geturl()) self.assertEqual('POST', request.method) self.as...
lgpl-3.0
isnnn/Sick-Beard-TPB
sickbeard/databases/mainDB.py
3
22207
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
Comunitea/OCB
openerp/modules/graph.py
260
7763
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
Yukarumya/Yukarum-Redfoxes
testing/mozbase/mozprocess/tests/test_mozprocess.py
1
8479
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import os import subprocess import sys import proctest import mozunit from mozprocess import pr...
mpl-2.0
cgar/servo
tests/wpt/web-platform-tests/tools/py/py/_code/_py2traceback.py
275
2765
# copied from python-2.7.3's traceback.py # CHANGES: # - some_str is replaced, trying to create unicode strings # import types def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_va...
mpl-2.0
prozum/mastermixer
web/web.py
1
3740
# -*- coding: utf-8 -*- """ :copyright: (c) 2014 by Armin Ronacher. :copyright: (c) 2014 by Niclas Moeslund Overby. :license: BSD, see LICENSE for more details. """ from sqlite3 import dbapi2 as sqlite3 from flask import Flask, request, session, g, redirect, url_for, abort, \ render_template, flash a...
mit
tianweizhang/nova
nova/hooks.py
17
4706
# 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
j-carpentier/nova
nova/api/openstack/compute/schemas/floating_ip_dns.py
84
1806
# Copyright 2014 IBM Corporation. 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
makinacorpus/linaro-django-pagination
linaro_django_pagination/test_project/tests.py
7
1764
# Copyright (c) 2010, 2011 Linaro Limited # 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 co...
bsd-3-clause
margguo/python-ivi
ivi/agilent/agilentDSO7054A.py
7
1688
""" Python Interchangeable Virtual Instrument Library Copyright (c) 2012-2014 Alex Forencich 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...
mit
citrix-openstack-build/keystone
keystone/trust/controllers.py
4
10648
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
apache-2.0
chouseknecht/ansible
lib/ansible/modules/windows/win_audit_policy_system.py
52
2252
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Noah Sparks <nsparks@outlook.com> # 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 = {'metadata_version': '1.1', 'status': ['preview'...
gpl-3.0
swannapa/erpnext
erpnext/accounts/doctype/subscription/subscription.py
1
10400
# -*- coding: utf-8 -*- # Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import calendar from frappe import _ from frappe.desk.form import assign_to from frappe.utils.jinja import validate_templa...
gpl-3.0
cmheisel/basecampreporting
bootstrap.py
27
2380
############################################################################## # # Copyright (c) 2006 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SO...
mit
mjgrav2001/scikit-learn
sklearn/datasets/species_distributions.py
198
7923
""" ============================= Species distribution dataset ============================= This dataset represents the geographic distribution of species. The dataset is provided by Phillips et. al. (2006). The two species are: - `"Bradypus variegatus" <http://www.iucnredlist.org/apps/redlist/details/3038/0>`_...
bsd-3-clause
dentaku65/pelisalacarta
python/main-classic/channels/xo.py
9
2434
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para xo # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from core import l...
gpl-3.0
ganglee/IonicClub
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSToolFile.py
2736
1804
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml class Writer(object): """Visual Studio XML tool file writer.""" ...
mit
littlstar/chromium.src
sync/tools/testserver/xmppserver_test.py
160
13183
#!/usr/bin/env python # Copyright 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. """Tests exercising the various classes in xmppserver.py.""" import unittest import base64 import xmppserver class XmlUtilsTest(unit...
bsd-3-clause
anntzer/scikit-learn
sklearn/tests/test_min_dependencies_readme.py
9
1432
"""Tests for the minimum dependencies in the README.rst file.""" import os import re from pathlib import Path import pytest import sklearn from sklearn._min_dependencies import dependent_packages from sklearn.utils.fixes import parse_version def test_min_dependencies_readme(): # Test that the minimum dependenc...
bsd-3-clause
googleapis/googleapis-gen
google/ads/googleads/v6/googleads-py/google/ads/googleads/v6/services/services/currency_constant_service/transports/grpc.py
1
10221
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
wimnat/ansible
lib/ansible/modules/meta.py
20
4662
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, Ansible, a Red Hat company # 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 DOCUMENTATION = r''' module: meta short_descr...
gpl-3.0
GREO/GNU-Radio
gnuradio-core/src/python/gnuradio/gr/scheduler.py
8
2332
# # Copyright 2004 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 option) # any later version. #...
gpl-3.0
shivam1111/odoo
openerp/addons/test_impex/models.py
392
5891
# -*- coding: utf-8 -*- from openerp.osv import orm, fields def selection_fn(obj, cr, uid, context=None): return list(enumerate(["Corge", "Grault", "Wheee", "Moog"])) def function_fn(model, cr, uid, ids, field_name, arg, context): return dict((id, 3) for id in ids) def function_fn_write(model, cr, uid, id, f...
agpl-3.0
jean/pybossa
test/test_util.py
5
16942
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa 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 License, or # (at...
agpl-3.0
Pan0ram1x/pycoin
pycoin/scripts/bitcoin_utils.py
21
4803
#!/usr/bin/env python import argparse import binascii import sys from pycoin import ecdsa, encoding from pycoin.serialize import b2h, h2b from pycoin.ecdsa import secp256k1 def parse_as_number(s): try: return int(s) except ValueError: pass try: return int(s, 16) except ValueEr...
mit
JuhaniImberg/cses.py
cses/commands/actions.py
1
6758
import click import sys import time import os from cses.cli import cli from cses.api import API from cses.db import DB from cses.commands.tasks import pass_course from cses.commands.tasks import pass_task from cses.tasks import detect_type, languages from cses.ui import clr, color_prompt @cli.command() @click.pass_c...
mit
bkirui/odoo
addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py
374
5518
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/webob-1.1.1/webob/datetime_utils.py
21
2406
import time import calendar from datetime import datetime, date, timedelta, tzinfo from email.utils import parsedate_tz, mktime_tz, formatdate __all__ = [ 'UTC', 'timedelta_to_seconds', 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'parse_date', 'serialize_date', 'parse_date_delta', 'seri...
bsd-3-clause
AgentN/namebench
libnamebench/selectors.py
176
3262
#!/usr/bin/env python # 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...
apache-2.0
y-higuchi/ramcloud
ft/client.py
20
3093
# Copyright (c) 2010 Stanford University # # Permission to use, copy, modify, and distribute this software 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 "AS IS" AND THE AUTHOR(S) DISCLAIM ...
isc
AnySDK/Sample_CPP_Cocos2dx
tools/cocos2d-console/plugins/plugin_luacompile/__init__.py
11
10258
#!/usr/bin/python # ---------------------------------------------------------------------------- # cocos "luacompile" plugin # # Copyright 2013 (C) Intel # # License: MIT # ---------------------------------------------------------------------------- ''' "luacompile" plugin for cocos command line tool ''' __docformat_...
mit
festicket/django-notification
notification/migrations/0002_version_2.py
1
9845
# -*- coding: 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): # Renaming field 'Notice.user' db.rename_column('notification_notice', 'user_id', 'recipient_id') #...
mit
sghai/automation-tools
docs/conf.py
12
9644
# -*- coding: utf-8 -*- """Configuration file for the Sphinx documentation generator. For more information, see http://sphinx-doc.org/ """ # # automation-tools documentation build configuration file, created by # sphinx-quickstart on Thu Oct 16 15:57:56 2014. # # This file is execfile()d with the current directory se...
gpl-3.0
tmshv/k2
Tools/qgis_export_street_features.py
1
1910
# -*- coding: utf-8 -*- import re import os import json out_filename = os.path.expanduser('~/osm_features.geojson') layer = iface.activeLayer() # features = layer.getFeatures() features = layer.selectedFeatures() properties = [('OSM_ID', int), 'NAME', 'REF', 'HIGHWAY', 'ONEWAY', 'BRIGDE', 'TUNNEL', 'MAXSPEED', 'LA...
mit
golismero/golismero
thirdparty_libs/django/db/backends/mysql/client.py
524
1380
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] db = settings_dict['OPTIONS'].get('db', settings_d...
gpl-2.0
proxysh/Safejumper-for-Mac
buildlinux/env64/lib/python2.7/site-packages/cryptography/hazmat/backends/commoncrypto/backend.py
17
8840
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from collections import namedtuple from cryptography import utils from c...
gpl-2.0
WALR/taiga-back
taiga/wsgi.py
24
1410
""" WSGI config for taiga project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` se...
agpl-3.0
abhikumar22/MYBLOG
blg/Lib/site-packages/django-1.11.7-py3.6.egg/django/contrib/contenttypes/views.py
112
3689
from __future__ import unicode_literals from django import http from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.contrib.sites.requests import RequestSite from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ def sh...
gpl-3.0
ingo-m/py_pRF_mapping
pyprf/analysis/testing/test_utils.py
2
5363
"""Test utility functions.""" import os from os.path import isfile, join import numpy as np from pyprf.analysis import pyprf_main from pyprf.analysis import utilities as util # Get directory of this file: strDir = os.path.dirname(os.path.abspath(__file__)) def test_main(): """Run main pyprf function and comp...
gpl-3.0
agural/AG-setup
src/.vim/bundle/vim-minimap/autoload/drawille/tests.py
5
2920
# -*- coding: utf-8 -*- from drawille import Canvas, line, Turtle from unittest import TestCase, main class CanvasTestCase(TestCase): def test_set(self): c = Canvas() c.set(0, 0) self.assertTrue(0 in c.chars and 0 in c.chars[0]) def test_unset_empty(self): c = Canvas() ...
mit
orione7/plugin.video.streamondemand-pureita
lib/elementtree/SgmlopXMLTreeBuilder.py
107
3209
# # ElementTree # $Id$ # # A simple XML tree builder, based on the sgmlop library. # # Note that this version does not support namespaces. This may be # changed in future versions. # # history: # 2004-03-28 fl created # # Copyright (c) 1999-2004 by Fredrik Lundh. All rights reserved. # # fredrik@pythonware.com # ht...
gpl-3.0
MANICX100/namebench
nb_third_party/dns/ipv4.py
250
1365
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
rghe/ansible
lib/ansible/modules/windows/win_command.py
28
3934
#!/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': 'core'} DOCUMENTATIO...
gpl-3.0
max-leuthaeuser/naoservice
modules/libs/suds/suds/wsse.py
195
5981
# 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
CloudBotIRC/mcstatus
mcstatus/tests/test_querier.py
6
3819
from unittest import TestCase from mcstatus.protocol.connection import Connection from mcstatus.querier import ServerQuerier, QueryResponse class TestQuerier(TestCase): def setUp(self): self.querier = ServerQuerier(Connection()) def test_handshake(self): self.querier.connection.receive(bytea...
apache-2.0
sysadminmatmoz/OCB
openerp/osv/query.py
32
8243
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. def _quote(to_quote): if '"' not in to_quote: return '"%s"' % to_quote return to_quote class Query(object): """ Dumb implementation of a Query object, using 3 string lists so far for bac...
agpl-3.0
xy515258/moose
framework/contrib/nsiqcppstyle/rules/RULE_3_2_H_do_not_use_uppercase_for_c_filename.py
43
1466
""" Do not use uppercase letters for the c file. This rule only applied on the only 'c' file. == Violation == /testdir/test_A1.c <== Violation. Uppercase A is used. /testdir1/_TestBeta.c <== Violation. Uppercase T and B is used == Good == testdir/Test.cpp <== Don't care. it's a cpp file. tes...
lgpl-2.1
damnfine/mezzanine
mezzanine/core/auth_backends.py
42
1836
from __future__ import unicode_literals from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from django.contrib.auth.tokens import default_token_generator from django.db.models import Q from django.utils.http import base36_to_int User = get_user_model() class Mezzan...
bsd-2-clause
vegetalte-dev/DEPRECATED_android_kernel_bq_vegetalte
scripts/gcc-wrapper.py
580
3524
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain th...
gpl-2.0
overtherain/scriptfile
software/googleAppEngine/lib/django_1_4/django/utils/formats.py
96
7195
import decimal import datetime from django.conf import settings from django.utils import dateformat, numberformat, datetime_safe from django.utils.importlib import import_module from django.utils.encoding import smart_str from django.utils.functional import lazy from django.utils.safestring import mark_safe from djang...
mit
epam/DLab
infrastructure-provisioning/src/general/scripts/azure/common_stop_notebook.py
1
3644
#!/usr/bin/python # ***************************************************************************** # # Copyright (c) 2016, EPAM SYSTEMS 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 # #...
apache-2.0
Juniper/nova
nova/api/openstack/common.py
2
19671
# 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/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
NeCTAR-RC/nova
nova/availability_zones.py
1
9190
# 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
StackStorm/st2contrib
archive/packs/st2/actions/lib/action.py
4
3340
import os from st2actions.runners.pythonrunner import Action from st2client.client import Client from st2client.models.keyvalue import KeyValuePair # pylint: disable=no-name-in-module from lib.utils import filter_none_values __all__ = [ 'St2BaseAction' ] class St2BaseAction(Action): def __init__(self, co...
apache-2.0
thoma5B/Django-Wiki
wiki/plugins/macros/mdx/wikilinks.py
5
2246
#!/usr/bin/env python """ Extend the shipped Markdown extension 'wikilinks' """ from __future__ import absolute_import from __future__ import unicode_literals from markdown.extensions import wikilinks import markdown import re from django.core.urlresolvers import reverse def build_url(label, base, end, md): """ ...
gpl-3.0
lebabouin/CouchPotatoServer-develop
couchpotato/core/providers/trailer/vftrailers/youtube_dl/extractor/muzu.py
6
2830
import re import json from .common import InfoExtractor from ..utils import ( compat_urllib_parse, determine_ext, ) class MuzuTVIE(InfoExtractor): _VALID_URL = r'https?://www.muzu.tv/(.+?)/(.+?)/(?P<id>\d+)' IE_NAME = u'muzu.tv' _TEST = { u'url': u'http://www.muzu.tv/defected/marcashken-...
gpl-3.0
rajiteh/taiga-back
tests/integration/test_models.py
25
1055
import pytest from .. import factories as f from ..utils import disconnect_signals, reconnect_signals def setup_module(): disconnect_signals() def teardown_module(): reconnect_signals() pytestmark = pytest.mark.django_db def test_project_update_role_points(): """Test that relation to project roles ...
agpl-3.0
servioticy/servioticy-demo
cellphones-wp2demo/brain/venv/lib/python2.7/site-packages/pip/vcs/__init__.py
280
11760
"""Handles all VCS (version control) support""" from __future__ import absolute_import import errno import logging import os import shutil from pip._vendor.six.moves.urllib import parse as urllib_parse from pip.exceptions import BadCommand from pip.utils import (display_path, backup_dir, call_subprocess, ...
apache-2.0
tboyce021/home-assistant
homeassistant/components/currencylayer/sensor.py
16
3507
"""Support for currencylayer.com exchange rates service.""" from datetime import timedelta import logging import requests import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( ATTR_ATTRIBUTION, CONF_API_KEY, CONF_BASE, CONF_NAME, CON...
apache-2.0
iftekeriba/softlayer-python
SoftLayer/CLI/ticket/summary.py
2
1164
"""Summary info about tickets.""" # :license: MIT, see LICENSE for more details. from SoftLayer.CLI import environment from SoftLayer.CLI import formatting import click @click.command() @environment.pass_env def cli(env): """Summary info about tickets.""" mask = ('openTicketCount, closedTicketCount, ' ...
mit
Hiyorimi/scikit-image
skimage/future/graph/rag.py
5
19594
import networkx as nx import numpy as np from numpy.lib.stride_tricks import as_strided from scipy import ndimage as ndi from scipy import sparse import math from ... import measure, segmentation, util, color from matplotlib import colors, cm from matplotlib import pyplot as plt from matplotlib.collections import LineC...
bsd-3-clause
AdaptiveApplications/carnegie
tarc_bus_locator_client/geopy/build/lib/geopy/parsers/iso8601.py
81
1971
import re from datetime import datetime, timedelta, tzinfo ISO8601_RE = re.compile(r""" (?P<YYYY>\d{2,4}) (?:-?(?P<MM>[01]\d))? (?:-?(?P<DD>[0-3]\d))? (?:T (?P<hh>[0-2]\d) (?::?(?P<mm>[0-5]\d))? (?::?(?P<ss>[0-5]\d))? (?:[,.](?P<s>\d+))? )? (?P<TZD>Z| (?...
mit
ahmadassaf/zulip
zerver/views/messages.py
1
43747
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.utils.timezone import now from django.conf import settings from django.core import validators from django.core.exceptions import ValidationError from django.db import connection from django.db.models import Q from dja...
apache-2.0
odoousers2014/odoo
addons/account/wizard/account_open_closed_fiscalyear.py
5
2296
# -*- 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
CEG-FYP-OpenStack/scheduler
nova/tests/unit/virt/xenapi/plugins/plugin_test.py
9
2398
# Copyright (c) 2016 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