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
Daniex/horizon
openstack_dashboard/dashboards/admin/instances/urls.py
66
1554
# 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...
apache-2.0
kevin-hannegan/vps-droplet
website/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py
3131
47315
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
randynobx/ansible
lib/ansible/modules/network/nxos/nxos_interface_ospf.py
33
19956
#!/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 distribut...
gpl-3.0
cancan101/StarCluster
starcluster/commands/removeimage.py
19
3357
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster 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 3 of the License, or (at your option) any # later ...
lgpl-3.0
knowsWhereHisTowelIs/pi-pyth-serv-socketio
lib/python3.5/site-packages/flask/sessions.py
119
14394
# -*- coding: utf-8 -*- """ flask.sessions ~~~~~~~~~~~~~~ Implements cookie based sessions based on itsdangerous. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import uuid import hashlib from base64 import b64encode, b64decode from datetime import dateti...
mit
yanirs/servo
tests/wpt/web-platform-tests/tools/six/test_six.py
418
22226
import operator import sys import types import py import six def test_add_doc(): def f(): """Icky doc""" pass six._add_doc(f, """New doc""") assert f.__doc__ == "New doc" def test_import_module(): from logging import handlers m = six._import_module("logging.handlers") asser...
mpl-2.0
thaim/ansible
lib/ansible/modules/cloud/azure/azure_rm_devtestlabcustomimage.py
27
13295
#!/usr/bin/python # # Copyright (c) 2019 Zim Kalinowski, (@zikalino) # # 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', ...
mit
usudaysingh/nereid
trytond_nereid/tests/test_static_file.py
6
5565
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_static_file Test the static file feature of nereid :copyright: (c) 2012-2015 by Openlabs Technologies & Consulting (P) LTD :license: GPLv3, see LICENSE for more details. """ import unittest import trytond.tests.test_tryton from trytond.tests.test...
bsd-3-clause
pombredanne/grr
tools/export.py
6
2188
#!/usr/bin/env python """Util for exporting data from GRR.""" import getpass # pylint: disable=unused-import,g-bad-import-order from grr.lib import server_plugins # pylint: enable=unused-import,g-bad-import-order from grr.lib import access_control from grr.lib import config_lib from grr.lib import data_store from ...
apache-2.0
tempbottle/node-gyp
gyp/pylib/gyp/common_test.py
2542
1970
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the common.py file.""" import gyp.common import unittest import sys class TestTopologicallySorted(unittest.TestCase): ...
mit
kohnle-lernmodule/KITexe201based
twisted/application/app.py
16
11089
# -*- test-case-name: twisted.test.test_application -*- # # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. import sys, os, pdb, getpass, traceback, signal from twisted.python import runtime, log, usage, reflect, failure, util, logfile from twisted.persisted import sob from twisted.app...
gpl-2.0
sumpfgottheit/arps
arps/views.py
1
3504
from flask import render_template, request import numbers from pprint import pprint from arps.restserver import app, db, ApiException, apiview from arps.globals import * from arps.validation import get_schemas_for_endpoint from arps.models import * METHODS = ['GET', 'POST', 'PUT', 'DELETE'] @app.route('/') def main(...
mit
ojengwa/odoo
addons/hr_recruitment/report/hr_recruitment_report.py
325
4836
# -*- 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
alokc83/metasyntactic
protobuf-2.2.0/python/google/protobuf/internal/test_util.py
8
25634
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions o...
apache-2.0
slevenhagen/odoo
addons/membership/__init__.py
441
1101
# -*- 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
repotvsupertuga/tvsupertuga.repository
script.module.streamtvsupertuga/lib/resources/lib/sources/pl/ekinomaniak.py
1
4540
# -*- coding: UTF-8 -*- import urlparse from resources.lib.modules import cleantitle from resources.lib.modules import client from resources.lib.modules import source_utils import urllib class source: def __init__(self): self.priority = 1 self.language = ['pl'] self.domains = ['ekinomani...
gpl-2.0
hifly/OpenUpgrade
addons/purchase/edi/purchase_order.py
439
9703
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
eRestin/Mezz
mezzanine/blog/migrations/0007_auto__add_field_blogpost_site.py
12
9450
# 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 field 'BlogPost.site' db.add_column('blog_blogpost', 'site', self.gf('django.db.models.fields...
bsd-2-clause
kyvinh/home-assistant
homeassistant/components/weblink.py
23
1741
""" Support for links to external web pages. For more details about this component, please refer to the documentation at https://home-assistant.io/components/weblink/ """ import logging import voluptuous as vol from homeassistant.const import (CONF_NAME, CONF_ICON, CONF_URL) from homeassistant.helpers.entity import ...
apache-2.0
liresearchgroup/submtr
submtr/update.py
1
7634
""" submtr.update ~~~~~~~~~~~~~ Automatic program updates for submtr. The ``AutoUpdtate()`` class contains the ``update()`` method to determine if a new version of submtr is available for the update channel specied in the ``SUBMTR_CONFIG`` file. Automatic update checks are run in ...
mit
pali/linux-n900
scripts/analyze_suspend.py
1537
120394
#!/usr/bin/python # # Tool for analyzing suspend/resume timing # Copyright (c) 2013, Intel Corporation. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU General Public License, # version 2, as published by the Free Software Foundation. # # This prog...
gpl-2.0
bgris/ODL_bgris
lib/python3.5/site-packages/IPython/utils/_process_cli.py
23
2421
"""cli-specific implementation of process utilities. cli - Common Language Infrastructure for IronPython. Code can run on any operating system. Check os.name for os- specific settings. This file is only meant to be imported by process.py, not by end-users. This file is largely untested. To become a full ...
gpl-3.0
joram/sickbeard-orange
lib/html5lib/tests/test_treewalkers.py
72
12240
import os import sys import StringIO import unittest import warnings warnings.simplefilter("error") from support import html5lib_test_files, TestData, convertExpected from html5lib import html5parser, treewalkers, treebuilders, constants from html5lib.filters.lint import Filter as LintFilter, LintError def PullDOMA...
gpl-3.0
agustinhenze/webassets.debian
src/webassets/filter/requirejs.py
16
6092
from __future__ import with_statement import shlex from os import path, getcwd from webassets.filter import ExternalTool class RequireJSFilter(ExternalTool): ''' Optimizes AMD-style modularized JavaScript into a single asset using `RequireJS <http://requirejs.org/>`_. This depends on the NodeJS exe...
bsd-2-clause
gunan/tensorflow
tensorflow/python/training/tracking/base.py
4
42156
"""An object-local variable management scheme.""" # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/l...
apache-2.0
alexston/calibre-webserver
src/calibre/ebooks/oeb/transforms/jacket.py
3
11065
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import sys, os from xml.sax.saxutils import escape from string import Formatter from...
gpl-3.0
MatthewWilkes/reportlab
demos/colors/colortest.py
1
2725
#Copyright ReportLab Europe Ltd. 2000-2012 #see license.txt for license details __version__='''$Id$''' import reportlab.pdfgen.canvas from reportlab.lib import colors from reportlab.lib.units import inch def run(): c = reportlab.pdfgen.canvas.Canvas('colortest.pdf') #do a test of CMYK interspersed with RGB ...
bsd-3-clause
SCOAP3/invenio
invenio/legacy/websubmit/web/admin/websubmitadmin.py
13
47036
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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, ...
gpl-2.0
Brazelton-Lab/bio_utils
bio_utils/__init__.py
1
1086
#! /usr/bin/env python3 """Software library containing common bioinformatic functions Copyright: __init__.py software library containing common bioinformatic functions Copyright (C) 2015 William Brazelton, Alex Hyer This program is free software: you can redistribute it and/or modify it under the t...
gpl-3.0
iamgp/pyCa
pyCa/Graph.py
1
2559
from . import * # Graphics Stuff import matplotlib.pyplot as plt class Graph(object): """docstring for Graph""" def __init__(self, Experiment): self.Experiment = Experiment self.numberOfStimulantsAdded = 0 self.nameToUse = 0 def plot(self): print '' log(self.Exp...
gpl-3.0
cul-it/Invenio
modules/bibupload/lib/batchuploader_engine.py
3
27157
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011 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 opt...
gpl-2.0
inflector/singnet
agent/sn_agent/log.py
3
1548
import logging.config def setup_logging(): _logging = { 'version': 1, 'disable_existing_loggers': False, 'root': { 'level': 'INFO', 'handlers': ['console'], }, 'formatters': { 'standard': { 'format': '[%(asctime)s][%(lev...
mit
hosseinmh/jango_learning
.venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/connection.py
365
4744
from __future__ import absolute_import import socket try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is...
mit
Ichag/odoo
addons/base_action_rule/__init__.py
438
1098
# -*- 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
neuropoly/spinalcordtoolbox
spinalcordtoolbox/scripts/sct_maths.py
1
20433
#!/usr/bin/env python ######################################################################################### # # Perform mathematical operations on images # # --------------------------------------------------------------------------------------- # Copyright (c) 2015 Polytechnique Montreal <www.neuro.polymtl.ca> # A...
mit
teamfx/openjfx-10-dev-rt
modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/common/editdistance.py
138
2351
# Copyright (c) 2011 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 ...
gpl-2.0
azunite/chrome_build
man/src/filter_demo_output.py
45
3641
#!/usr/bin/env python # Copyright 2014 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 collections import os import re import sys from xml.sax.saxutils import escape from cStringIO import StringIO if not os.path....
bsd-3-clause
Ultimaker/Cura
plugins/DigitalLibrary/src/DFFileExportAndUploadManager.py
1
19837
# Copyright (c) 2021 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import json import threading from json import JSONDecodeError from typing import List, Dict, Any, Callable, Union, Optional from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices from PyQt5.QtNetwork import ...
lgpl-3.0
utamaro/youtube-dl
youtube_dl/extractor/ministrygrid.py
154
2084
from __future__ import unicode_literals import json import re from .common import InfoExtractor from ..utils import ( ExtractorError, smuggle_url, ) class MinistryGridIE(InfoExtractor): _VALID_URL = r'https?://www\.ministrygrid.com/([^/?#]*/)*(?P<id>[^/#?]+)/?(?:$|[?#])' _TEST = { 'url': 'h...
unlicense
edevil/django
tests/admin_views/customadmin.py
12
2350
""" A second, custom AdminSite -- see tests.CustomAdminSiteTests. """ from __future__ import unicode_literals from django.conf.urls import url from django.contrib import admin from django.http import HttpResponse from django.contrib.auth.models import User from django.contrib.auth.admin import UserAdmin from . import...
bsd-3-clause
marqueedev/django
django/contrib/gis/maps/google/gmap.py
526
9223
from __future__ import unicode_literals from django.conf import settings from django.contrib.gis.maps.google.overlays import ( GMarker, GPolygon, GPolyline, ) from django.template.loader import render_to_string from django.utils.html import format_html from django.utils.safestring import mark_safe from django.util...
bsd-3-clause
papados/ordersys
Lib/site-packages/django/db/backends/postgresql_psycopg2/introspection.py
105
5005
from __future__ import unicode_literals from django.db.backends import BaseDatabaseIntrospection, FieldInfo from django.utils.encoding import force_text class DatabaseIntrospection(BaseDatabaseIntrospection): # Maps type codes to Django Field types. data_types_reverse = { 16: 'BooleanField', ...
unlicense
scotthuang1989/Python-3-Module-of-the-Week
concurrency/asyncio/asyncio_echo_server_protocol.py
1
1651
import asyncio import logging import sys SERVER_ADDRESS = ('localhost', 10000) logging.basicConfig( level=logging.DEBUG, format='%(name)s: %(message)s', stream=sys.stderr, ) log = logging.getLogger('main') event_loop = asyncio.get_event_loop() class EchoServer(asyncio.Protocol): def connection_made...
apache-2.0
pymanopt/pymanopt
pymanopt/manifolds/__init__.py
1
1111
__all__ = [ "ComplexCircle", "ComplexGrassmann", "Elliptope", "Euclidean", "FixedRankEmbedded", "Grassmann", "Oblique", "PSDFixedRank", "PSDFixedRankComplex", "Product", "SkewSymmetric", "SpecialOrthogonalGroup", "Sphere", "SphereSubspaceComplementIntersection", ...
bsd-3-clause
bongo-project/bongo
src/libs/python/bongo/external/email/errors.py
468
1628
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """email package exception classes.""" class MessageError(Exception): """Base class for errors in the email package.""" class MessageParseError(MessageError): """Base class for message parsing erro...
gpl-2.0
Lh4cKg/sl4a
python/src/Lib/distutils/cygwinccompiler.py
50
17299
"""distutils.cygwinccompiler Provides the CygwinCCompiler class, a subclass of UnixCCompiler that handles the Cygwin port of the GNU C compiler to Windows. It also contains the Mingw32CCompiler class which handles the mingw32 port of GCC (same as cygwin in no-cygwin mode). """ # problems: # # * if you use a msvc com...
apache-2.0
ZihengJiang/mxnet
example/ctc/lstm.py
21
4577
# 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 u...
apache-2.0
Tenrec-Builders/pi-scan
src/stick.py
1
3424
import dbus def search(): bus = dbus.SystemBus() udisks = dbus.Interface( bus.get_object('org.freedesktop.UDisks2', '/org/freedesktop/UDisks2'), 'org.freedesktop.DBus.ObjectManager') listDevices = udisks.get_dbus_method('GetManagedObjects') result = [] for key, value in listDevices...
bsd-2-clause
dhalleine/tensorflow
tensorflow/contrib/layers/python/layers/optimizers.py
1
9885
# 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
blazek/QGIS
python/core/auto_additions/qgsprocessingutils.py
14
1056
# The following has been generated automatically from src/core/processing/qgsprocessingutils.h # monkey patching scoped based enum QgsProcessingUtils.UnknownType = QgsProcessingUtils.LayerHint.UnknownType QgsProcessingUtils.LayerHint.UnknownType.__doc__ = "Unknown layer type" QgsProcessingUtils.Vector = QgsProcessingUt...
gpl-2.0
gurneyalex/OpenUpgrade
addons/resource/faces/utils.py
433
3231
############################################################################ # Copyright (C) 2005 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free software; you can redistribute it and/or modify # ...
agpl-3.0
dynamicapp/dynamicapp
lib/iOS/dependencies/cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/sunc++.py
34
4750
"""SCons.Tool.sunc++ Tool-specific initialization for C++ on SunOS / Solaris. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The ...
apache-2.0
lab-robotics-unipv/pyFUZZYgenerator
core/ModelType.py
1
2708
class ModelType: def __init__(self): self.type = None self.properties = {} self.models = [] self.logic_function_name = None self.init_function_name = None self.output_function_name = None def __eq__(self, other): if other.type == self.type: re...
lgpl-3.0
sambyers/o365_fmc
.venv/lib/python3.6/site-packages/pip/_vendor/distro.py
330
38349
# Copyright 2015,2016 Nir Cohen # # 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, s...
gpl-3.0
zenotech/StarCluster
starcluster/plugins/tmux.py
19
8331
# Copyright 2009-2014 Justin Riley # # This file is part of StarCluster. # # StarCluster 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 3 of the License, or (at your option) any # later ...
gpl-3.0
sippeproject/vagoth
vagoth/virt/utils/mc_json_rpc.py
1
1790
#!/usr/bin/python # # Vagoth Cluster Management Framework # Copyright (C) 2013 Robert Thomson # # 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 (a...
lgpl-2.1
ut-osa/syncchar
linux-2.6.16-unmod/arch/ia64/scripts/unwcheck.py
916
1718
#!/usr/bin/env python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthe...
bsd-3-clause
brianrodri/oppia
core/domain/platform_parameter_domain_test.py
2
71057
# coding: utf-8 # # Copyright 2020 The Oppia 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 requi...
apache-2.0
janusnic/wagtail
wagtail/wagtailcore/migrations/0015_add_more_verbose_names.py
26
4085
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.db.models.deletion from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0014_add_verbose_name'), ] operations = [ m...
bsd-3-clause
pazeshun/jsk_apc
jsk_2015_05_baxter_apc/node_scripts/record_axis_video.py
2
1525
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import print_function import os import sys import getpass import datetime import argparse import subprocess from termcolor import cprint parser = argparse.ArgumentParser(description='JSK axis video recorder.') parser.add_argument('-O', '--output-file', ...
bsd-3-clause
randynobx/ansible
lib/ansible/modules/network/junos/junos_interface.py
2
6535
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, inc # # This file is part of Ansible by Red Hat # # 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 Li...
gpl-3.0
search5/nanumlectures
lib/oauthlib/oauth1/rfc5849/parameters.py
87
4949
# -*- coding: utf-8 -*- """ oauthlib.parameters ~~~~~~~~~~~~~~~~~~~ This module contains methods related to `section 3.5`_ of the OAuth 1.0a spec. .. _`section 3.5`: http://tools.ietf.org/html/rfc5849#section-3.5 """ from __future__ import absolute_import, unicode_literals try: from urlparse import urlparse, url...
apache-2.0
presencelearning/django-guardian
guardian/decorators.py
49
6514
from __future__ import unicode_literals from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.utils.functional import wraps from django.db.models import Model, get_model from django.db.models.base import ModelBase from django.db.models.query import QuerySet from django.shortc...
bsd-2-clause
a-parhom/edx-platform
common/test/acceptance/tests/discussion/test_discussion.py
2
64162
""" Tests for discussion pages """ import datetime import time from unittest import skip from uuid import uuid4 import pytest from pytz import UTC from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acceptance.fixtures.discussion import ( Comment, Response, ...
agpl-3.0
slackeater/anal-beh
firefoxSelenium.py
1
1686
#! /usr/bin/env python import sys from classes.sitemanager import SiteManager from classes.gui.main import MainWindow from classes.printer import Printer from PyQt4 import QtGui import argparse __author__ = 'snake' def main(): if len(sys.argv) == 1: app = QtGui.QApplication(sys.argv) main = Main...
gpl-2.0
stevew817/CMSIS-DAP
tools/utils.py
15
1362
""" CMSIS-DAP Interface Firmware Copyright (c) 2009-2013 ARM Limited 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 la...
apache-2.0
Senseg/Py4A
python3-alpha/python3-src/Lib/test/test_pep3120.py
49
1280
# This file is marked as binary in the CVS, to prevent MacCVS from recoding it. import unittest from test import support class PEP3120Test(unittest.TestCase): def test_pep3120(self): self.assertEqual( "Питон".encode("utf-8"), b'\xd0\x9f\xd0\xb8\xd1\x82\xd0\xbe\xd0\xbd' ) ...
apache-2.0
globz/kitchen-cli
setup.py
1
1945
"""Packaging settings.""" from codecs import open from os.path import abspath, dirname, join from subprocess import call from setuptools import Command, find_packages, setup from kitchen import __version__ this_dir = abspath(dirname(__file__)) with open(join(this_dir, 'README.md'), encoding='utf-8') as file: ...
gpl-2.0
levilucio/SyVOLT
ECore_Copier_MM/transformation/HEPackage.py
1
2231
from core.himesis import Himesis import uuid class HEPackage(Himesis): def __init__(self): """ Creates the himesis graph representing the DSLTrans rule EPackage. """ # Flag this instance as compiled now self.is_compiled = True super(HEPackage, sel...
mit
laudaa/bitcoin
contrib/zmq/zmq_sub3.4.py
9
3277
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ ZMQ example using python3's asyncio Bitcoin should be started with the command line argument...
mit
noelevans/sandpit
wordsnake/wordsnaketest.py
1
2233
from wordsnake import flattern, getLeaves, listOfMapsToMap from wordsnake import possibleSingleShift, snake, targetFound, validWord import unittest class WordSnakeTest( unittest.TestCase ): def setup( self ): pass def test_validWord( self ): self.assertTrue( validWord( 'hello' ) ) self.assertFalse( val...
mit
javiercantero/streamlink
src/streamlink/plugins/tv5monde.py
1
2401
import re from streamlink.plugin import Plugin from streamlink.plugin.api import http, validate from streamlink.stream import HLSStream, HTTPStream, RTMPStream from streamlink.utils import parse_json from streamlink.plugins.common_jwplayer import _js_to_json class TV5Monde(Plugin): _url_re = re.compile(r'http://...
bsd-2-clause
jswiergo/atomspace
examples/python/undocumented/genetic_algorithm.py
45
1600
__author__ = 'keyvan' from utility.evolutionary import * BIT_STRING_LENGTH = 32 ALL_BITS_ONE = 2**BIT_STRING_LENGTH - 1 class BitStringIndividualBase(IndividualBase): def __init__(self, _binary_chromosome=0): self.chromosome = _binary_chromosome @staticmethod def randomly_initialised(): ...
agpl-3.0
Shinichi-Nakagawa/xp2015_baseball_tools
service/storage.py
1
1676
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Shinichi Nakagawa' from configparser import ConfigParser from boto3.session import Session import glob import os class Storage(object): def __init__(self, config_file): """ init :param config_file: Application config file ...
mit
lamby/live-studio
contrib/django/core/cache/backends/locmem.py
5
4236
"Thread-safe in-memory cache backend." import time try: import cPickle as pickle except ImportError: import pickle from django.core.cache.backends.base import BaseCache from django.utils.synch import RWLock # Global in-memory store of cache data. Keyed by name, to provide # multiple named local memory caches...
agpl-3.0
techjacker/sitemapgenerator
sitemapgenerator/crawler.py
1
3955
import re import requests from bs4 import BeautifulSoup from time import sleep from random import randint from numbers import Number import functools def handle_requests_failures(func): ''' This decorator handles request.excptions ''' @functools.wraps(func) def wrapper(self, *args, **kw): ...
mit
qunying/gps
share/support/core/vcs/mercurial.py
1
2725
""" Mercurial CVS support plugin Provides support for the Mercurial configuration management system. It integrates into GPS's VCS support, and uses the same menus as all other VCS systems supported by GPS. You can easily edit this file if you would like to customize the mercurial commands that are sent for each of th...
gpl-3.0
thnee/ansible
lib/ansible/modules/cloud/openstack/os_coe_cluster.py
15
8752
#!/usr/bin/python # Copyright (c) 2018 Catalyst IT 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': ['pr...
gpl-3.0
germanovm/sos
sos/plugins/kvm.py
12
2089
# Copyright (C) 2009 Red Hat, Inc., Joey Boggs <jboggs@redhat.com> # 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. # T...
gpl-2.0
troych/PlexKodiConnect
contextmenu.py
1
1380
# -*- coding: utf-8 -*- ############################################################################### import logging import os import sys import xbmc import xbmcaddon ############################################################################### _addon = xbmcaddon.Addon(id='plugin.video.plexkodiconnect') try: ...
gpl-2.0
ludmilamarian/invenio-collections
invenio_collections/recordext/functions/get_record_collections.py
5
2282
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 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 later...
gpl-2.0
rafaelmds/fatiando
gallery/gridder/cutting.py
6
1326
""" Cutting a section from spacial data ----------------------------------- The :func:`fatiando.gridder.cut` function extracts points from spatially distributed data that are inside a given area. It doesn't matter whether or not the points are on a regular grid. """ from fatiando import gridder import matplotlib.pypl...
bsd-3-clause
danielhkl/matplotlib2tikz
matplotlib2tikz/color.py
1
2761
# -*- coding: utf-8 -*- # import matplotlib as mpl import numpy def mpl_color2xcolor(data, matplotlib_color): '''Translates a matplotlib color specification into a proper LaTeX xcolor. ''' # Convert it to RGBA. my_col = numpy.array(mpl.colors.ColorConverter().to_rgba(matplotlib_color)) # If the a...
mit
DreamerKing/LightweightHtmlWidgets
publish-rc/v1.0/files/Ipy.Lib/encodings/cp864.py
593
33919
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.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_map) def decode(self,input,errors='strict'): ...
gpl-3.0
open2c/cooltools
cooltools/cli/dump_cworld.py
1
2380
import click from . import cli from .. import io @cli.command() @click.argument( "cool_paths", metavar="COOL_PATHS", type=str, nargs=-1 ) @click.argument( "out_path", metavar="OUT_PATH", type=click.Path(exists=False, writable=True), nargs=1, ) @click.option( "--cworld-type", he...
mit
eResearchSA/reporting-unified
unified/models/hnas.py
1
9940
from sqlalchemy.sql import func from . import db, id_column, to_dict, SnapshotMothods class Owner(db.Model): """Storage Account/Owner""" id = id_column() name = db.Column(db.String(64), unique=True, nullable=False) virtual_volume_usage = db.relationship("VirtualVolumeUsage", ...
apache-2.0
jscn/django
django/contrib/gis/geos/linestring.py
136
6019
from django.contrib.gis.geos import prototypes as capi from django.contrib.gis.geos.coordseq import GEOSCoordSeq from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin from django.contrib.gis.geos.point import Point from django.contrib.gis....
bsd-3-clause
boooka/GeoPowerOff
venv/lib/python2.7/site-packages/django/utils/datastructures.py
76
15888
import copy import warnings from collections import OrderedDict from django.utils import six from django.utils.deprecation import RemovedInDjango19Warning class MergeDict(object): """ A simple class for creating new "virtual" dictionaries that actually look up values in more than one dictionary, passed i...
apache-2.0
caveman-dick/ansible
lib/ansible/modules/cloud/amazon/cloudformation.py
7
25368
#!/usr/bin/python # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type # upcoming features: # - Ted's multifile YAML concatenation # - changesets (and bl...
gpl-3.0
pwnall/ansible-modules-core
utilities/logic/debug.py
66
2141
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2012 Dag Wieers <dag@wieers.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 Lice...
gpl-3.0
pjamesjoyce/lcopt
lcopt/interact.py
1
48802
from flask import Flask, request, render_template, redirect, send_file import webbrowser import json from ast import literal_eval from lcopt.io import exchange_factory from collections import OrderedDict from itertools import groupby import xlsxwriter from io import BytesIO import os from lcopt.bw2_export import Bw2Ex...
bsd-3-clause
phalax4/CarnotKE
jyhton/lib-python/2.7/lib-tk/tkCommonDialog.py
193
1418
# base class for tk common dialogues # # this module provides a base class for accessing the common # dialogues available in Tk 4.2 and newer. use tkFileDialog, # tkColorChooser, and tkMessageBox to access the individual # dialogs. # # written by Fredrik Lundh, May 1997 # from Tkinter import * class Dialog: com...
apache-2.0
Klaudit/wagtail
wagtail/project_template/project_name/settings/base.py
21
3597
""" Django settings for {{ project_name }} project. Generated by 'django-admin startproject' using Django {{ django_version }}. For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.c...
bsd-3-clause
ShawnMurd/MetPy
examples/calculations/Gradient.py
11
2064
# Copyright (c) 2015-2018 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """ Gradient ======== Use `metpy.calc.gradient`. This example demonstrates the various ways that MetPy's gradient function can be utilized. """ import numpy as np import met...
bsd-3-clause
IgorWang/MachineLearningPracticer
sparkgo/profiles.py
2
2210
#!/usr/bin/env python # -*- coding: utf-8 -*- # author igor # Created by iFantastic on 16-6-14 ''' Computing User Profiles with Spark data: /data/tracks.csv /data/cust.csv ''' import os import csv # os.environ["PYSPARK_PYTHON"] = "/home/igor/anaconda3/bin/ipython" # os.environ["PYSPARK_DRIVER_PYTHON"] = "pytho...
gpl-3.0
Plantain/sms-mailinglist
lib/requests/packages/urllib3/poolmanager.py
550
8977
# urllib3/poolmanager.py # Copyright 2008-2014 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import logging try: # Python 3 from urllib.parse import urljoin except ImportError: ...
apache-2.0
HybridF5/jacket
jacket/tests/compute/unit/virt/ironic/test_patcher.py
1
5947
# Copyright 2014 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
young-zhang/Lean
Algorithm.Python/CustomDataBitcoinAlgorithm.py
2
5220
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Lice...
apache-2.0
redhat-openstack/django
tests/foreign_object/models.py
49
5692
import datetime from django.db import models from django.db.models.fields.related import ReverseSingleRelatedObjectDescriptor from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import get_language @python_2_unicode_compatible class Country(models.Model): # Table Column Fie...
bsd-3-clause
hkchenhongyi/django
django/contrib/admin/models.py
184
3323
from __future__ import unicode_literals from django.conf import settings from django.contrib.admin.utils import quote from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import NoReverseMatch, reverse from django.db import models from django.utils import timezone from django.utils....
bsd-3-clause