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
cyanna/edx-platform
lms/djangoapps/shoppingcart/reports.py
66
10729
""" Objects and functions related to generating CSV reports """ from decimal import Decimal import unicodecsv from django.utils.translation import ugettext as _ from courseware.courses import get_course_by_id from course_modes.models import CourseMode from shoppingcart.models import CertificateItem, OrderItem from s...
agpl-3.0
pombredanne/xmltodict
setup.py
2
1616
#!/usr/bin/env python try: from setuptools import setup except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup import xmltodict with open('README.md') as f: long_description = f.read() setup(name='xmltodict', version=xmltodict.__version__, ...
mit
2013Commons/HUE-SHARK
desktop/core/ext-py/Django-1.2.3/django/db/backends/sqlite3/base.py
51
10000
""" SQLite3 backend for django. Python 2.4 requires pysqlite2 (http://pysqlite.org/). Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the standard library. """ import re import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection...
apache-2.0
Tehsmash/ironic
ironic/tests/db/sqlalchemy/test_types.py
3
3432
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
better-dem/box_classify
specify_rect.py
1
2299
#!/usr/local/bin/python3.6 import tkinter as tk from tkinter import messagebox as mb from PIL import Image, ImageTk class SelectRegionApp(tk.Tk): def __init__(self, image_filename, image_resize, result): tk.Tk.__init__(self) self.result_dict = result self.x = self.y = 0 im = Image.o...
gpl-3.0
g-k/servo
tests/wpt/update/tree.py
167
6560
# 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 re import tempfile from wptrunner import update as wptupdate from wptrunner.update.tree import Commit, CommitMe...
mpl-2.0
tarikkdiry/Flock
flask/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py
353
14161
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
bsd-3-clause
yoki/phantomjs
src/qt/qtwebkit/Tools/QueueStatusServer/handlers/statusbubble.py
125
3746
# Copyright (C) 2009 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
bsd-3-clause
Vykstorm/Othello
bots.py
1
3184
#!/usr/bin/python # -*- coding: iso8859-1 -*- # Autor: Víctor Ruiz Gómez # Descripción: Este script define distintos bots que son jugadores del # juego Othello. from game2 import Player from random import choice from minmax import MinMax, MinMaxAlphaBeta from othello import OthelloEval, OthelloEvalDiffPiezas, OthelloE...
mit
uni-peter-zheng/tp-libvirt
libvirt/tests/src/perf_kvm.py
7
12127
import os import re import shutil import time from virttest import data_dir, aexpect from autotest.client import os_dep, utils from autotest.client.shared import error, ssh_key def _perf_kvm_help(): """ Execute the perf kvm --help to verify perf kvm is available on this host. """ result = utils.r...
gpl-2.0
suhe/odoo
addons/account/wizard/account_invoice_refund.py
11
6632
# -*- coding: utf-8 -*- from openerp import models, fields, api, _ from openerp.tools.safe_eval import safe_eval as eval from openerp.exceptions import UserError class AccountInvoiceRefund(models.TransientModel): """Refunds invoice""" _name = "account.invoice.refund" _description = "Invoice Refund" ...
gpl-3.0
TAKEALOT/Diamond
src/collectors/websitemonitor/websitemonitor.py
35
2758
# coding=utf-8 """ Gather HTTP Response code and Duration of HTTP request #### Dependencies * urllib2 """ import urllib2 import time from datetime import datetime import diamond.collector class WebsiteMonitorCollector(diamond.collector.Collector): """ Gather HTTP response code and Duration of HTTP reques...
mit
cedk/odoo
addons/product/wizard/product_price.py
380
2254
# -*- 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
praveenaki/zulip
zerver/management/commands/gravatar_to_user_avatar.py
124
2043
from __future__ import absolute_import import requests from zerver.models import get_user_profile_by_email, UserProfile from zerver.lib.avatar import gravatar_hash from zerver.lib.upload import upload_avatar_image from django.core.management.base import BaseCommand, CommandError from django.core.files.uploadedfile imp...
apache-2.0
manolama/dd-agent
checks.d/openstack.py
5
36668
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib from datetime import datetime, timedelta from urlparse import urljoin # project from checks import AgentCheck # 3p import requests import simplejson as json SOURCE_TYPE = 'openstack' V21_NOVA_API_VERS...
bsd-3-clause
shingonoide/odoo
openerp/addons/base/module/__init__.py
462
1088
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
JakeBrand/CMPUT410-E6
v1/lib/python2.7/site-packages/django/conf/locale/de_CH/formats.py
82
1451
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date from __future__ import unicode_literals DATE_FORMAT = 'j. F Y' TIME_FORMAT = 'H:i:s' DA...
apache-2.0
MattsFleaMarket/python-for-android
python3-alpha/python3-src/Lib/encodings/cp1257.py
272
13374
""" Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,in...
apache-2.0
Changaco/oh-mainline
mysite/profile/view_helpers.py
11
16900
# This file is part of OpenHatch. # Copyright (C) 2010 Parker Phinney # Copyright (C) 2011 Krzysztof Tarnowski (krzysztof.tarnowski@ymail.com) # Copyright (C) 2009, 2010 OpenHatch, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License...
agpl-3.0
Dandandan/wikiprogramming
jsrepl/extern/python/unclosured/lib/python2.7/code.py
256
10189
"""Utilities needed to emulate Python's interactive interpreter. """ # Inspired by similar code by Jeff Epler and Fredrik Lundh. import sys import traceback from codeop import CommandCompiler, compile_command __all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact", "compile_command"] def ...
mit
ridfrustum/lettuce
tests/integration/lib/Django-1.2.5/django/contrib/localflavor/generic/forms.py
514
2160
from django import forms DEFAULT_DATE_INPUT_FORMATS = ( '%Y-%m-%d', '%d/%m/%Y', '%d/%m/%y', # '2006-10-25', '25/10/2006', '25/10/06' '%b %d %Y', '%b %d, %Y', # 'Oct 25 2006', 'Oct 25, 2006' '%d %b %Y', '%d %b, %Y', # '25 Oct 2006', '25 Oct, 2006' '%B %d %Y', '%B %d, %Y', ...
gpl-3.0
googlearchive/titan
titan/common/lib/google/apputils/datelib.py
2
15413
#!/usr/bin/env python # Copyright 2002 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
niuzhiheng/caffe
python/caffe/pycaffe.py
18
1275
""" Wrap the internal caffe C++ module (_caffe.so) with a clean, Pythonic interface. """ from collections import OrderedDict import numpy as np from ._caffe import Net, SGDSolver # we directly update methods from Net here (rather than using composition or # inheritance) so that nets created by caffe (e.g., by SGDSol...
bsd-2-clause
hyperized/ansible-modules-core
cloud/azure/azure_rm_virtualnetwork_facts.py
4
5758
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 Soft...
gpl-3.0
nesdis/djongo
tests/django_tests/tests/v21/tests/backends/mysql/test_creation.py
27
2680
import unittest from io import StringIO from unittest import mock from django.db import connection from django.db.backends.base.creation import BaseDatabaseCreation from django.db.backends.mysql.creation import DatabaseCreation from django.db.utils import DatabaseError from django.test import SimpleTestCase @unittes...
agpl-3.0
Tranzystorek/servo
tests/wpt/css-tests/tools/wptserve/tests/functional/test_request.py
109
2919
import unittest import wptserve from .base import TestUsingServer class TestInputFile(TestUsingServer): def test_seek(self): @wptserve.handlers.handler def handler(request, response): rv = [] f = request.raw_input f.seek(5) rv.append(f.read(2)) ...
mpl-2.0
jhgg/graphqllib
tests/core_validation/test_known_argument_names.py
4
3312
from graphql.core.language.location import SourceLocation from graphql.core.validation.rules import KnownArgumentNames from utils import expect_passes_rule, expect_fails_rule def unknown_arg(arg_name, field_name, type_name, line, column): return { 'message': KnownArgumentNames.unknown_arg_message(arg_name...
mit
neumerance/cloudloon2
.venv/lib/python2.7/site-packages/selenium/webdriver/common/action_chains.py
3
8099
# Copyright 2011 WebDriver committers # Copyright 2011 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 ap...
apache-2.0
Cisco-Talos/pyrebox
qemu/scripts/tracetool/backend/ust.py
17
1212
#!/usr/bin/env python # -*- coding: utf-8 -*- """ LTTng User Space Tracing backend. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan ...
gpl-2.0
vabs/outpost-public-api
eve/endpoints.py
1
3032
# -*- coding: utf-8 -*- """ eve.endpoints ~~~~~~~~~~~~~ This module implements the API endpoints. Each endpoint (resource, item, home) invokes the appropriate method handler, returning its response to the client, properly rendered. :copyright: (c) 2013 by Nicola Iarocci. :license: BSD, se...
gpl-2.0
SciTools/iris
lib/iris/tests/unit/fileformats/pp/test_save_pairs_from_cube.py
5
1750
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.fileformats.pp.save_pairs_from_cube` function.""" # Import iris.tests first so that some things ca...
lgpl-3.0
blueboxgroup/horizon
openstack_dashboard/test/integration_tests/tests/test_sahara_job_binaries.py
50
3397
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
colinligertwood/odoo
addons/mail/mail_vote.py
439
1647
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
NetApp/manila
manila/tests/api/views/test_share_networks.py
1
8974
# Copyright (c) 2015 Mirantis, 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 requir...
apache-2.0
ashutrix03/inteygrate_flaskapp-master
yowsup/layers/protocol_ib/protocolentities/offline_ib.py
70
1064
from yowsup.structs import ProtocolEntity, ProtocolTreeNode from .ib import IbProtocolEntity class OfflineIbProtocolEntity(IbProtocolEntity): ''' <ib from="s.whatsapp.net"> <offline count="{{X}}"></offline> </ib> ''' def __init__(self, count): super(IbProtocolEntity, self).__init__()...
gpl-3.0
johannmeyer/bepoppy8
sw/tools/sbus_fakerator/lib/channel.py
24
6589
''' Copyright (C) 2016 Kason Bennett, Michal Podhradsky <michal.podhradsky@aggiemail.usu.edu> This file is part of paparazzi. paparazzi 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, or (...
gpl-2.0
mahak/neutron
neutron/tests/unit/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_maintenance.py
2
20844
# Copyright 2019 Red Hat, 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...
apache-2.0
rdeheele/odoo
setup/win32/win32_service.py
362
1825
# -*- coding: utf-8 -*- import servicemanager import win32api import win32process import win32service import win32serviceutil import subprocess import sys from os.path import dirname, join, split execfile(join(dirname(__file__), '..', 'server', 'openerp', 'release.py')) class OdooService(win32serviceutil.ServiceF...
agpl-3.0
sanbinabu/Wox
PythonHome/Lib/site-packages/pip/_vendor/html5lib/treewalkers/pulldom.py
1729
2302
from __future__ import absolute_import, division, unicode_literals from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \ COMMENT, IGNORABLE_WHITESPACE, CHARACTERS from . import _base from ..constants import voidElements class TreeWalker(_base.TreeWalker): def __iter__(self): ignore_until = None...
mit
SerCeMan/intellij-community
python/lib/Lib/site-packages/django/contrib/admin/templatetags/admin_list.py
73
13206
import datetime from django.conf import settings from django.contrib.admin.util import lookup_field, display_for_field, label_for_field from django.contrib.admin.views.main import ALL_VAR, EMPTY_CHANGELIST_VALUE from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR from django.cor...
apache-2.0
camilonova/django
tests/forms_tests/tests/test_input_formats.py
110
38521
from datetime import date, datetime, time from django import forms from django.test import SimpleTestCase, override_settings from django.utils.translation import activate, deactivate @override_settings(TIME_INPUT_FORMATS=["%I:%M:%S %p", "%I:%M %p"], USE_L10N=True) class LocalizedTimeTests(SimpleTestCase): def se...
bsd-3-clause
jteehan/cfme_tests
scripts/fetch_jenkins_artifacts.py
3
1158
#!/usr/bin/env python2 """Collect artifacts after jenkins run """ import argparse import sys from utils.conf import credentials from utils.ssh import SSHClient def main(): parser = argparse.ArgumentParser(epilog=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument('addr...
gpl-2.0
kadhikari/navitia
source/monitor/monitor_kraken/app.py
2
3812
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
ChinaMassClouds/copenstack-server
openstack/src/horizon-2014.2/horizon/templatetags/parse_date.py
10
1735
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
gpl-2.0
lightcn/odoo
addons/sale_margin/sale_margin.py
172
4679
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
agpl-3.0
emawind84/readthedocs.org
readthedocs/search/views.py
31
3302
from pprint import pprint import collections import os import json import logging import mimetypes import md5 from django.core.urlresolvers import reverse from django.conf import settings from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcu...
mit
chepazzo/ansible-modules-extras
files/patch.py
77
6509
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Luis Alberto Perez Lazaro <luisperlazaro@gmail.com> # (c) 2015, Jakub Jirutka <jakub@jirutka.cz> # # 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...
gpl-3.0
googleapis/googleapis-gen
google/cloud/osconfig/agentendpoint/v1/osconfig-agentendpoint-v1-py/scripts/fixup_agentendpoint_v1_keywords.py
1
6593
#! /usr/bin/env python3 # -*- 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 requi...
apache-2.0
StefanRijnhart/OpenUpgrade
addons/account_bank_statement_extensions/__openerp__.py
378
2357
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
SmartDeveloperHub/sdh-curator
sdh/curator/actions/ext/enrichment.py
1
10998
""" #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=# This file is part of the Smart Developer Hub Project: http://www.smartdeveloperhub.org Center for Open Middleware http://www.centeropenmiddleware.com/ #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=...
apache-2.0
CiscoSystems/horizon
openstack_dashboard/api/rest/cinder.py
47
2447
# Copyright 2015 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 to in writing, sof...
apache-2.0
Ziqi-Li/bknqgis
bokeh/bokeh/plotting/helpers.py
1
24268
from __future__ import absolute_import from collections import Iterable, OrderedDict, Sequence import difflib import itertools import re import textwrap import warnings import numpy as np import sys from six import string_types, reraise from ..models import ( BoxSelectTool, BoxZoomTool, CategoricalAxis, TapT...
gpl-2.0
nhicher/ansible
lib/ansible/modules/network/panos/panos_pg.py
50
5869
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage PaloAltoNetworks Firewall # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish...
gpl-3.0
essamjoubori/girder
plugins/metadata_extractor/plugin_tests/server_metadata_extractor_test.py
9
1630
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware 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 ...
apache-2.0
richieledude/poopcoin
external/gtest/scripts/gen_gtest_pred_impl.py
2538
21986
#!/usr/bin/env python # # Copyright 2006, 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...
lgpl-3.0
ujenmr/ansible
lib/ansible/plugins/callback/actionable.py
2
1913
# (c) 2015, Andrew Gaffney <andrew@agaffney.org> # (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = ''' callba...
gpl-3.0
phektus/Django-Google-AppEngine-OpenId-Auth
django/contrib/localflavor/es/es_provinces.py
436
1482
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ PROVINCE_CHOICES = ( ('01', _('Arava')), ('02', _('Albacete')), ('03', _('Alacant')), ('04', _('Almeria')), ('05', _('Avila')), ('06', _('Badajoz')), ('07', _('Illes Balears')), ('08', _('Barcelona')), (...
bsd-3-clause
ogenstad/ansible-modules-extras
cloud/cloudstack/cs_network.py
33
17301
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # # 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 Lice...
gpl-3.0
asajeffrey/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py
4
24283
from __future__ import absolute_import import json import os import socket import threading import time import traceback import uuid from six.moves.urllib.parse import urljoin from .base import (CallbackHandler, CrashtestExecutor, RefTestExecutor, RefTestImpleme...
mpl-2.0
kostaspl/SpiderMonkey38
python/requests/requests/packages/urllib3/exceptions.py
214
4109
## Base Exceptions class HTTPError(Exception): "Base exception used by this module." pass class HTTPWarning(Warning): "Base warning used by this module." pass class PoolError(HTTPError): "Base exception for errors caused within a pool." def __init__(self, pool, message): self.pool ...
mpl-2.0
tzewangdorje/SIPserv
Twisted-13.1.0/twisted/python/constants.py
3
12571
# -*- test-case-name: twisted.python.test.test_constants -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Symbolic constant support, including collections and constants with text, numeric, and bit flag values. """ __all__ = [ 'NamedConstant', 'ValueConstant', 'FlagConstant', 'Na...
gpl-3.0
openpgh/askpgh
askbot/migrations/0027_populate_new_response_counts.py
20
26923
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): """transfer value of response_count to new_response_count """ for user in orm['auth.User'].objects.all(): ...
gpl-3.0
ModdedPA/android_external_chromium_org
tools/telemetry/telemetry/core/memory_cache_http_server.py
24
6515
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import BaseHTTPServer from collections import namedtuple import gzip import mimetypes import os import SimpleHTTPServer import SocketServer import StringI...
bsd-3-clause
caphrim007/ansible
lib/ansible/modules/cloud/openstack/os_listener.py
27
8358
#!/usr/bin/python # Copyright (c) 2018 Catalyst Cloud Ltd. # 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': [...
gpl-3.0
bealdav/OpenUpgrade
addons/website_forum/models/res_users.py
21
2538
# -*- coding: utf-8 -*- from openerp.osv import osv, fields class Users(osv.Model): _inherit = 'res.users' def __init__(self, pool, cr): init_res = super(Users, self).__init__(pool, cr) self.SELF_WRITEABLE_FIELDS = list(set( self.SELF_WRITEABLE_FIELDS + \ ['co...
agpl-3.0
google/makani
config/m600/control/hover_controllers.py
1
15735
# Copyright 2020 Makani Technologies LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
chudaol/edx-platform
pavelib/utils/test/bokchoy_utils.py
54
4800
""" Helper functions for bok_choy test tasks """ import sys import os import time import httplib import subprocess from paver.easy import sh from pavelib.utils.envs import Env from pavelib.utils.process import run_background_process try: from pygments.console import colorize except ImportError: colorize = lamb...
agpl-3.0
alexlo03/ansible
lib/ansible/modules/network/aci/aci_bd_to_l3out.py
15
6334
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
zaxliu/scipy
scipy/weave/examples/wx_example.py
100
7328
""" This is taken from the scrolled window example from the demo. Take a look at the DoDrawing2() method below. The first 6 lines or so have been translated into C++. """ from __future__ import absolute_import, print_function import sys sys.path.insert(0,'..') import inline_tools from wxPython.wx import * ...
bsd-3-clause
bertucho/epic-movie-quotes-quiz
dialogos/build/Twisted/twisted/words/test/test_ircsupport.py
41
2678
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.words.im.ircsupport}. """ from twisted.trial.unittest import TestCase from twisted.test.proto_helpers import StringTransport from twisted.words.im.basechat import Conversation, ChatUI from twisted.words.im.ircsupport impo...
mit
arth-co/shoop
shoop/core/api/orders.py
5
1547
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from django.utils.timezone import now from rest_framework.serializers import...
agpl-3.0
locationlabs/wolphin
wolphin/config.py
1
6869
from os.path import expanduser, abspath, exists, join import re from wolphin.exceptions import InvalidWolphinConfiguration class Configuration(object): """Configuration for any Wolphin project""" DEFAULT_REGION = 'us-west-1' DEFAULT_AMI_ID = 'ami-87712ac2' DEFAULT_INSTANCE_TYPE = 't1.micro' DEFA...
apache-2.0
codeforamerica/typeseam
typeseam/form_filler/front.py
1
3914
from datetime import datetime, timezone from pytz import timezone as ptimezone import re import json import requests class Front: def __init__(self, token): self.headers = { 'Authorization': 'Bearer {}'.format(token), 'Accept': 'application/json' } self.event_types...
bsd-3-clause
ninefold/libcloud
libcloud/compute/drivers/gridspot.py
6
4147
# 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
laborautonomo/pip
pip/_vendor/requests/compat.py
571
2556
# -*- coding: utf-8 -*- """ pythoncompat """ from .packages import chardet import sys # ------- # Pythons # ------- # Syntax sugar. _ver = sys.version_info #: Python 2.x? is_py2 = (_ver[0] == 2) #: Python 3.x? is_py3 = (_ver[0] == 3) #: Python 3.0.x is_py30 = (is_py3 and _ver[1] == 0) #: Python 3.1.x is_py31 =...
mit
pgodel/rdiff-backup
rdiff_backup/Globals.py
1
11031
# Copyright 2002 Ben Escoto # # This file is part of rdiff-backup. # # rdiff-backup is free software; you can redistribute it and/or modify # 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. # # rd...
gpl-2.0
tensorflow/examples
tensorflow_examples/lite/model_maker/third_party/recommendation/ml/model/context_encoder_test.py
1
6092
# Lint as: python3 # Copyright 2021 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...
apache-2.0
xccui/flink
flink-python/pyflink/table/data_view.py
13
5967
################################################################################ # 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...
apache-2.0
jtoppins/beaker
Client/src/bkr/client/commands/cmd_user_modify.py
1
2506
# 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. """ bkr user-modify: Modify Beaker users =============================...
gpl-2.0
lanhel/viperaccept
setup.py
1
1637
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- #---------------------------------------------------------------------------- """HTTP content negotiation application.""" __author__ = ('Lance Finn Helsten',) __version__ = '0.0' __copyright__ = """Copyright (C) 2014 Lance Finn Helsten""" __license__ = """ Licensed und...
apache-2.0
signed/intellij-community
python/lib/Lib/encodings/mac_roman.py
593
13736
""" Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,err...
apache-2.0
dudonwai/dudonsblog
Lib/site-packages/pip/_vendor/requests/packages/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # 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 # versio...
mit
addition-it-solutions/project-all
addons/account_bank_statement_import_ofx/tests/test_import_bank_statement.py
5
1468
from openerp.tests.common import TransactionCase from openerp.modules.module import get_module_resource class TestOfxFile(TransactionCase): """Tests for import bank statement ofx file format (account.bank.statement.import) """ def setUp(self): super(TestOfxFile, self).setUp() self.statemen...
agpl-3.0
normanmaurer/autobahntestsuite-maven-plugin
src/main/resources/twisted/protocols/pcp.py
71
7090
# -*- test-case-name: twisted.test.test_pcp -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Producer-Consumer Proxy. """ from zope.interface import implements from twisted.internet import interfaces class BasicProducerConsumerProxy: """ I can act as a man in the middle betwe...
apache-2.0
FlorisHoogenboom/sklearn-helpers
tests/test_preprocessing.py
1
3095
import unittest import numpy as np import pandas as pd from sklearn_helpers.preprocessing import \ EnhancedLabelEncoder, MultiColumnLabelEncoder class EnhancedLabelEncoderTest(unittest.TestCase): def test_accepts_only_1d(self): """It should only accept only a 1d array""" ehe = EnhancedLabelEnc...
mit
jkibele/benthic_photo_survey
bps_package/ui_pref_help.py
1
1950
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'pref_help.ui' # # Created: Sun Mar 8 18:17:55 2015 # by: PyQt4 UI code generator 4.10.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attr...
bsd-3-clause
boneyao/sentry
src/sentry/migrations/0014_auto__add_project__add_projectmember__add_unique_projectmember_project.py
36
12005
# 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 'Project' db.create_table('sentry_project', ( ('id', self.gf('sentry.db.models.fields.b...
bsd-3-clause
zabracks/sshuttle
src/server.py
1
10287
import re import struct import socket import traceback import time import sys import os if not globals().get('skip_imports'): import ssnet import helpers import hostwatch import compat.ssubprocess as ssubprocess from ssnet import Handler, Proxy, Mux, MuxWrapper from helpers import log, debug1, d...
lgpl-2.1
Neopallium/mailinabox
management/backup.py
1
17961
#!/usr/bin/python3 # This script performs a backup of all user data: # 1) System services are stopped. # 2) An incremental encrypted backup is made using duplicity. # 3) The stopped services are restarted. # 4) STORAGE_ROOT/backup/after-backup is executd if it exists. import os, os.path, shutil, glob, re, datetime, s...
cc0-1.0
nuncjo/odoo
addons/payment_authorize/tests/test_authorize.py
195
7565
# -*- coding: utf-8 -*- import hashlib import hmac import time import urlparse from lxml import objectify import openerp from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.addons.payment.tests.common import PaymentAcquirerCommon from openerp.addons.payment_authorize.controllers.ma...
agpl-3.0
susansls/zulip
zerver/webhooks/mention/tests.py
36
1368
# -*- coding: utf-8 -*- from typing import Text from zerver.lib.test_classes import WebhookTestCase class MentionHookTests(WebhookTestCase): STREAM_NAME = 'test' URL_TEMPLATE = "/api/v1/external/mention?api_key={api_key}&stream={stream}" FIXTURE_DIR_NAME = 'mention' def test_mention_webfeed(self): ...
apache-2.0
xen0l/ansible
lib/ansible/module_utils/facts/system/dns.py
232
2678
# 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 in the hope that ...
gpl-3.0
dikujepsen/OpenTran
v3.0/framework/processing/collect_loop.py
3
4291
import lan import collect_id as ci class LoopIndices(lan.NodeVisitor): """ Finds loop indices, the start and end values of the indices and creates a mapping from a loop index to the ForLoop AST node that is indexes. """ def __init__(self, depth_limit=2): self.index = list() ...
mit
Yury191/brownstonetutors
allauth/socialaccount/south_migrations/0011_auto__chg_field_socialtoken_token.py
77
6468
# -*- 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): # Changing field 'SocialToken.token' db.alter_column('socialaccount_socialtoken', 'token', self.gf('django....
unlicense
crazyskateface/LC
chat/admin.py
1
1664
from django.contrib import admin from chat.models import UserProfile, Comments, Roll, Emblem from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User # Register your models here. class UserProfileAdmin(admin.StackedInline): ...
mit
sanghinitin/golismero
golismero/api/data/vulnerability/suspicious/cookie.py
8
3176
#!/usr/bin/env python # -*- coding: utf-8 -*- __license__= """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: https://github.com/golismero Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of ...
gpl-2.0
hojel/youtube-dl
youtube_dl/extractor/abc7news.py
132
2364
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import parse_iso8601 class Abc7NewsIE(InfoExtractor): _VALID_URL = r'https?://abc7news\.com(?:/[^/]+/(?P<display_id>[^/]+))?/(?P<id>\d+)' _TESTS = [ { 'url': 'http://abc7news.com/entertainmen...
unlicense
abhattad4/Digi-Menu
build/lib.linux-x86_64-2.7/django/core/mail/backends/base.py
577
1573
"""Base email backend class.""" class BaseEmailBackend(object): """ Base class for email backend implementations. Subclasses must at least overwrite send_messages(). open() and close() can be called indirectly by using a backend object as a context manager: with backend as connection: ...
bsd-3-clause
sajeeshcs/nested_quota_final
nova/netconf.py
74
1665
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the ...
apache-2.0
g-goessel/mathdoku_solve
fonctions.py
1
4674
""" fonctions """ from itertools import permutations, product from functools import reduce import numpy as np def combi_possibles(val_tot,nbr_cases,nbr_max): """ retourne la liste des combinaisons possibles """ #test si la valeur est certaine if nbr_cases==1: return [(val_t...
mpl-2.0