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
agualis/test-django-nonrel
django/core/management/commands/startproject.py
322
1680
from django.core.management.base import copy_helper, CommandError, LabelCommand from django.utils.importlib import import_module import os import re from random import choice class Command(LabelCommand): help = "Creates a Django project directory structure for the given project name in the current directory." ...
bsd-3-clause
WalkingMachine/sara_behaviors
sara_flexbe_behaviors/src/sara_flexbe_behaviors/action_receive_bag_sm.py
1
3679
#!/usr/bin/env python # -*- coding: utf-8 -*- ########################################################### # WARNING: Generated code! # # ************************** # # Manual changes may get lost if file is generated again. # # Only code inside the [MANUAL] ta...
bsd-3-clause
hwu25/AppPkg
Applications/Python/Python-2.7.2/Lib/test/test_bsddb.py
10
12031
#! /usr/bin/env python """Test script for the bsddb C module by Roger E. Masse Adapted to unittest format and expanded scope by Raymond Hettinger """ import os, sys import unittest from test import test_support # Skip test if _bsddb wasn't built. test_support.import_module('_bsddb') bsddb = test_support...
bsd-2-clause
evax/ansible-modules-core
system/authorized_key.py
55
15877
#!/usr/bin/python # -*- coding: utf-8 -*- """ Ansible module to add authorized_keys for ssh logins. (c) 2012, Brad Olson <brado@movedbylight.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 ...
gpl-3.0
fparrel/regepe
vps/gpxparser.py
1
8080
# For xml parsing try: from etree.ElementTree import ElementTree except ImportError: from xml.etree.ElementTree import ElementTree # For date parsing from datetime import datetime import time # Model classes from model import Bounds,Point,Track #i18n from flask_babel import gettext # gpx creator="KeyMaze 5...
gpl-3.0
ar7z1/ansible
lib/ansible/modules/packaging/os/pacman.py
36
14590
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Afterburn <https://github.com/afterburn> # Copyright: (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com> # Copyright: (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/license...
gpl-3.0
Ronak6892/servo
python/mach/mach/terminal.py
100
2061
# 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/. """This file contains code for interacting with terminals. All the terminal interaction code is consolidated so the com...
mpl-2.0
gnmiller/craig-bot
craig-bot/lib/python3.6/site-packages/pip/_internal/utils/temp_dir.py
21
5339
from __future__ import absolute_import import errno import itertools import logging import os.path import tempfile from pip._internal.utils.misc import rmtree logger = logging.getLogger(__name__) class TempDirectory(object): """Helper class that owns and cleans up a temporary directory. This class can be ...
mit
oubiwann-unsupported/pyrrd
pyrrd/backend/tests/test_external.py
3
3082
from cStringIO import StringIO import os import sys import tempfile from unittest import TestCase from pyrrd.exceptions import ExternalCommandError from pyrrd.rrd import DataSource, RRA, RRD class ExternalBackendTestCase(TestCase): def setUp(self): ds = [ DataSource(dsName="speed", dsType="C...
bsd-3-clause
kvar/ansible
lib/ansible/module_utils/heroku.py
47
1223
# Copyright: (c) 2018, Ansible Project # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function __metaclass__ = type import traceback from ansible.module_utils.basic import env_fallback, missing_require...
gpl-3.0
Outernet-Project/outernet-broadman
broadman/db.py
1
1973
""" Functions for working with broadcast database Copyright 2015, Outernet Inc. Some rights reserved. This software is free software licensed under the terms of GPLv3. See COPYING file that comes with the source code, or http://www.gnu.org/licenses/gpl.txt. """ import sqlite3 import datetime import sqlize as sql f...
gpl-3.0
vstinner/pyperf
pyperf/_timeit.py
2
6742
import itertools import sys import time import traceback import pyperf PYPY = (pyperf.python_implementation() == 'pypy') DUMMY_SRC_NAME = "<timeit-src>" # Don't change the indentation of the template; the reindent() calls # in Timer.__init__() depend on setup being indented 4 spaces and stmt # being indented 8 spac...
mit
joshblum/django-with-audit
tests/regressiontests/httpwrappers/tests.py
24
14176
import copy import pickle from django.core.exceptions import SuspiciousOperation from django.http import (QueryDict, HttpResponse, HttpResponseRedirect, HttpResponsePermanentRedirect, SimpleCookie, BadHeaderError, parse_cookie) from django.util...
bsd-3-clause
crafty78/ansible
lib/ansible/modules/network/cumulus/cl_interface_policy.py
34
5248
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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...
gpl-3.0
shakamunyi/neutron
neutron/tests/unit/db/test_db_base_plugin_v2.py
3
280256
# 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
eltonsantos/django
tests/utils_tests/test_decorators.py
115
3920
from django.http import HttpResponse from django.template import Template, Context from django.template.response import TemplateResponse from django.test import TestCase, RequestFactory from django.utils.decorators import decorator_from_middleware class ProcessViewMiddleware(object): def process_view(self, reques...
bsd-3-clause
mgeorgehansen/FIFE_Technomage
tests/analyzers/dep_analyzer.py
1
7256
#!/usr/bin/env python # -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2009 by the FIFE team # http://www.fifengine.de # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Le...
lgpl-2.1
shickey/BearStatus
dateutil/tz.py
270
32741
""" Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import datetime import struct import time import sys import os relativedelta = None pa...
mit
zhoulingjun/django
tests/custom_pk/models.py
282
1272
# -*- coding: utf-8 -*- """ Using a custom primary key By default, Django adds an ``"id"`` field to each model. But you can override this behavior by explicitly adding ``primary_key=True`` to a field. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_...
bsd-3-clause
h4ck3rm1k3/ansible
docsite/conf.py
119
6348
# -*- coding: utf-8 -*- # # documentation build configuration file, created by # sphinx-quickstart on Sat Sep 27 13:23:22 2008-2009. # # This file is execfile()d with the current directory set to its # containing dir. # # The contents of this file are pickled, so don't put values in the namespace # that aren't pickleab...
gpl-3.0
Changaco/oh-mainline
vendor/packages/Django/django/contrib/localflavor/pe/forms.py
109
2399
# -*- coding: utf-8 -*- """ PE-specific Form helpers. """ from __future__ import absolute_import, unicode_literals from django.contrib.localflavor.pe.pe_region import REGION_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Cha...
agpl-3.0
cosmiclattes/TPBviz
torrent/lib/python2.7/site-packages/django/contrib/gis/geos/prototypes/coordseq.py
624
3112
from ctypes import c_double, c_int, c_uint, POINTER from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc ## Error-checking routines specific to coordinate seq...
gpl-3.0
genevolv/dbrev
py/freevolv/models/dbrev/table.py
1
8372
''' dbrev.table can be thought of as a bean or a template. It has only attributes with getters and setters. ''' import logging LOG = logging.getLogger(__name__) # LOG.setLevel(logging.INFO) # Long lines expected. # pylint: disable=C0301 # Cyclic imports protected by functions # pylint: disable=R0401 class Table...
bsd-2-clause
dcamposliz/youtube-dl
youtube_dl/extractor/myvi.py
132
2245
# coding: utf-8 from __future__ import unicode_literals import re from .vimple import SprutoBaseIE class MyviIE(SprutoBaseIE): _VALID_URL = r'''(?x) https?:// myvi\.(?:ru/player|tv)/ (?: (?: ...
unlicense
openstack/ironic
ironic/drivers/modules/agent_power.py
1
8765
# 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 # distributed under t...
apache-2.0
rrrrrr8/vnpy
vnpy/api/ctp/py3/pyscript/generate_struct.py
40
1412
# encoding: UTF-8 __author__ = 'CHENXY' from ctp_data_type import * def main(): """主函数""" fcpp = open('ThostFtdcUserApiStruct.h', 'r') fpy = open('ctp_struct.py', 'w') fpy.write('# encoding: UTF-8\n') fpy.write('\n') fpy.write('structDict = {}\n') fpy.write('\n') for no, line in enu...
mit
mhbu50/erpnext
erpnext/hr/doctype/shift_assignment/shift_assignment.py
3
11412
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from frappe.utils import cint, cstr, date_diff, flt, forma...
gpl-3.0
guewen/OpenUpgrade
addons/delivery/delivery.py
22
12548
# -*- 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
rkhleics/wagtailmenus
wagtailmenus/utils/tests/test_misc.py
2
10973
from django.test import RequestFactory, TestCase, modify_settings from distutils.version import LooseVersion from wagtail.core import __version__ as wagtail_version from wagtail.core.models import Page, Site from wagtailmenus.conf import defaults from wagtailmenus.utils.misc import derive_page, derive_section_root, ge...
mit
Jionglun/2015cd_midterm2
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_case.py
738
51689
import difflib import pprint import pickle import re import sys import warnings import weakref import inspect from copy import deepcopy from test import support import unittest from .support import ( TestEquality, TestHashing, LoggingResult, ResultWithNoStartTestRunStopTestRun ) class Test(object): "Ke...
agpl-3.0
luca76/QGIS
python/pyplugin_installer/qgsplugininstallerpluginerrordialog.py
9
1761
# -*- coding:utf-8 -*- """ /*************************************************************************** qgsplugininstallerpluginerrordialog.py Plugin Installer module ------------------- Date : June 2013 Copyright...
gpl-2.0
shtouff/django
django/contrib/auth/views.py
75
12175
import warnings from django.conf import settings # Avoid shadowing the login() and logout() views below. from django.contrib.auth import ( REDIRECT_FIELD_NAME, get_user_model, login as auth_login, logout as auth_logout, update_session_auth_hash, ) from django.contrib.auth.decorators import login_required from ...
bsd-3-clause
tangyibin/goblin-core
riscv/llvm/3.5/llvm-3.5.0.src/test/CodeGen/SystemZ/Large/branch-range-04.py
13
3672
# Test 64-bit COMPARE AND BRANCH in cases where the sheer number of # instructions causes some branches to be out of range. # RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s # Construct: # # before0: # conditional branch to after0 # ... # beforeN: # conditional branch to after0 # main: # 0xffcc by...
bsd-3-clause
christophreimer/pytesmo
tests/test_sat/test_ers.py
1
4902
# Copyright (c) 2013,Vienna University of Technology, # Department of Geodesy and Geoinformation # 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...
bsd-3-clause
holmes/intellij-community
python/lib/Lib/site-packages/django/contrib/admin/views/decorators.py
78
1458
try: from functools import wraps except ImportError: from django.utils.functional import wraps # Python 2.4 fallback. from django import template from django.shortcuts import render_to_response from django.utils.translation import ugettext as _ from django.contrib.admin.forms import AdminAuthenticationForm f...
apache-2.0
sonuyos/couchpotato
couchpotato/core/notifications/plex/client.py
81
2238
import json from couchpotato import CPLog from couchpotato.core.event import addEvent from couchpotato.core.helpers.encoding import tryUrlencode import requests log = CPLog(__name__) class PlexClientProtocol(object): def __init__(self, plex): self.plex = plex addEvent('notify.plex.notifyClient...
gpl-3.0
jimmystar/pyymal
build/lib.macosx-10.8-intel-2.7/yaml/parser.py
409
25542
# The following YAML grammar is LL(1) and is parsed by a recursive descent # parser. # # stream ::= STREAM-START implicit_document? explicit_document* STREAM-END # implicit_document ::= block_node DOCUMENT-END* # explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* # block_node_or_inden...
mit
LokiCoder/Sick-Beard
lib/cherrypy/lib/auth.py
68
3224
import cherrypy from cherrypy.lib import httpauth def check_auth(users, encrypt=None, realm=None): """If an authorization header contains credentials, return True or False. """ request = cherrypy.serving.request if 'authorization' in request.headers: # make sure the provided credentials are co...
gpl-3.0
neumerance/deploy
.venv/lib/python2.7/site-packages/django/contrib/auth/tests/custom_user.py
100
4528
from django.db import models from django.contrib.auth.models import ( BaseUserManager, AbstractBaseUser, AbstractUser, UserManager, PermissionsMixin ) # The custom User uses email as the unique identifier, and requires # that every user provide a date of birth. This lets us test # changes in usern...
apache-2.0
Alwnikrotikz/pyglet
contrib/wydget/wydget/widgets/music.py
29
4961
import os from pyglet.gl import * from pyglet.window import mouse from pyglet import media, clock from wydget import element, event, util, data, layouts from wydget.widgets.frame import Frame from wydget.widgets.label import Image, Label from wydget.widgets.button import Button class Music(Frame): name='music' ...
bsd-3-clause
andrewromanenco/pyjvm
pyjvm/platform/java/lang/object.py
1
3672
# PyJVM (pyjvm.org) Java Virtual Machine implemented in pure Python # Copyright (C) 2014 Andrew Romanenco (andrew@romanenco.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 ...
gpl-3.0
karih/Flask-HTTPAuth
tests/test_basic_get_password.py
2
2280
import unittest import base64 from flask import Flask from flask_httpauth import HTTPBasicAuth class HTTPAuthTestCase(unittest.TestCase): def setUp(self): app = Flask(__name__) app.config['SECRET_KEY'] = 'my secret' basic_auth = HTTPBasicAuth() @basic_auth.get_password de...
mit
credativUK/vdirsyncer
tests/cli/test_config.py
1
4939
import io from textwrap import dedent import pytest from vdirsyncer import cli @pytest.fixture def read_config(tmpdir): def inner(cfg): f = io.StringIO(dedent(cfg.format(base=str(tmpdir)))) return cli.utils.read_config(f) return inner def test_read_config(read_config, monkeypatch): err...
mit
tpoy0099/pyctp
example/pyctp2/test/test_position.py
7
28891
#-*- coding:utf-8 -*- import logging import time import unittest import unittest.mock as mock from ..common.base import ( XOPEN,XCLOSE,XCLOSE_TODAY, LONG,SHORT, BaseObject, TEST_PATH, MAX_VALUE, ) from ..common.contract_type i...
mit
ltilve/ChromiumGStreamerBackend
tools/telemetry/third_party/gsutilz/gslib/command_runner.py
12
15982
# -*- coding: utf-8 -*- # Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
bsd-3-clause
Jeff-Tian/mybnb
Python27/Lib/compiler/visitor.py
20
4009
from compiler import ast # XXX should probably rename ASTVisitor to ASTWalker # XXX can it be made even more generic? class ASTVisitor: """Performs a depth-first walk of the AST The ASTVisitor will walk the AST, performing either a preorder or postorder traversal depending on which method is cal...
apache-2.0
zcmarkyoung/node-gyp
gyp/pylib/gyp/generator/gypd.py
912
3325
# Copyright (c) 2011 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. """gypd output module This module produces gyp input as its output. Output files are given the .gypd extension to avoid overwriting the .gyp files that they are ...
mit
mosaic-cloud/mosaic-distribution-dependencies
dependencies/nodejs/0.8.22/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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 #-------------------------------------------------------------------...
apache-2.0
NL66278/OCB
openerp/tools/lru.py
204
2946
# -*- coding: utf-8 -*- # taken from http://code.activestate.com/recipes/252524-length-limited-o1-lru-cache-implementation/ import threading from func import synchronized __all__ = ['LRU'] class LRUNode(object): __slots__ = ['prev', 'next', 'me'] def __init__(self, prev, me): self.prev = prev ...
agpl-3.0
magvugr/AT
EntVirtual/lib/python2.7/site-packages/pip/_vendor/distlib/compat.py
357
38875
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys if sys.version_info[0] < 3: from StringIO import StringIO stri...
gpl-3.0
flavour/cedarbluff
tests/selenium/scripts/warehouseTest.py
6
7344
from sahanaTest import SahanaTest import unittest, re, time class WarehouseTest(SahanaTest): """ Test the Warehouse component of the Inventory Management System """ _sortList = ("addWarehouses", "stockWarehouse", #"removeWarehouses", ) def firstRun(sel...
mit
DOAJ/doaj
portality/formcontext/render.py
1
23506
# DEPRECATED - this file is dead, and should be removed by the end of the redesign project from portality.formcontext.formhelper import FormHelperBS3 from portality.formcontext.choices import Choices from copy import deepcopy class Renderer(object): def __init__(self): self.FIELD_GROUPS = {} self....
apache-2.0
XuanyuZhao1984/MeanJS_train1
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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 #-------------------------------------------------------------------...
mit
georgestarcher/TA-SyncKVStore
bin/ta_synckvstore/solnlib/acl.py
6
6169
# Copyright 2016 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the 'License'): you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
mit
tomchristie/django
tests/template_tests/syntax_tests/test_for.py
25
10025
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class ForTagTests(SimpleTestCase): libraries = {'custom': 'template_tests.templatetags.custom'} @setup({'for-tag01': '{% for val in values %}{{ val }}{% endfor %}'}) def test_for_tag01(self):...
bsd-3-clause
doganov/edx-platform
common/djangoapps/third_party_auth/middleware.py
169
1053
"""Middleware classes for third_party_auth.""" from social.apps.django_app.middleware import SocialAuthExceptionMiddleware from . import pipeline class ExceptionMiddleware(SocialAuthExceptionMiddleware): """Custom middleware that handles conditional redirection.""" def get_redirect_uri(self, request, excep...
agpl-3.0
Ernesto99/odoo
openerp/modules/module.py
199
16207
# -*- 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
ashleyjune/SM-G360T1_kernel
tools/perf/scripts/python/failed-syscalls-by-pid.py
11180
2058
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
babble/babble
include/jython/Lib/test/test_jser2.py
1
2399
from test import test_support import unittest import java from org.python.util import PythonObjectInputStream def serialize(o, special=0): b = java.io.ByteArrayOutputStream() objs = java.io.ObjectOutputStream(b) objs.writeObject(o) if not special: OIS = java.io.ObjectInputStream else: ...
apache-2.0
facebookPagesSearch/sample-code
sample-code/examples/python/android_simple.py
36
1787
import os from time import sleep import unittest from appium import webdriver # Returns abs path relative to this file and not cwd PATH = lambda p: os.path.abspath( os.path.join(os.path.dirname(__file__), p) ) class SimpleAndroidTests(unittest.TestCase): def setUp(self): desired_caps = {} de...
apache-2.0
Pluto-tv/chromium-crosswalk
tools/telemetry/third_party/gsutilz/gslib/__main__.py
12
26565
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013 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-...
bsd-3-clause
chenjun0210/tensorflow
tensorflow/contrib/layers/python/ops/sparse_ops_test.py
18
6055
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
fracturica/shardlib
shardlib/comp_analysis/SIMCompAnalysis.py
1
23592
import dataProcessing as dp import plotFuncs as pf import numpy as np from matplotlib.ticker import MultipleLocator, FormatStrFormatter from mpl_toolkits.axes_grid1 import host_subplot import mpl_toolkits.axisartist as AA from matplotlib.path import Path from mpl_toolkits.mplot3d import Axes3D import matplotlib as mp...
mit
DTOcean/dtocean-core
dtocean_core/tools/external.py
1
3947
# -*- coding: utf-8 -*- # Copyright (C) 2016-2018 Mathew Topper # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later...
gpl-3.0
amenonsen/ansible
lib/ansible/modules/network/nxos/nxos_overlay_global.py
84
5899
#!/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
awalls-cx18/gnuradio
gr-blocks/python/blocks/qa_vector_sink_source.py
6
5178
#!/usr/bin/env python # # Copyright 2008,2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your ...
gpl-3.0
kmonsoor/python-for-android
python3-alpha/python3-src/Lib/json/decoder.py
46
13087
"""Implementation of JSONDecoder """ import binascii import re import sys import struct from json import scanner try: from _json import scanstring as c_scanstring except ImportError: c_scanstring = None __all__ = ['JSONDecoder'] FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): _BYTES...
apache-2.0
l0b0/cds-invenio-vengmark
modules/websubmit/lib/websubmit_engine.py
3
75493
## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 (...
gpl-2.0
dimaspivak/docker-py
docker/models/images.py
3
9972
import re import six from ..api import APIClient from ..errors import BuildError from ..utils.json_stream import json_stream from .resource import Collection, Model class Image(Model): """ An image on the server. """ def __repr__(self): return "<%s: '%s'>" % (self.__class__.__name__, "', '"....
apache-2.0
ntt-sic/neutron
neutron/plugins/ml2/drivers/l2pop/mech_driver.py
6
8782
# Copyright (c) 2013 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
bowen0701/algorithms_data_structures
lc0314_binary_tree_vertical_order_traversal.py
1
3585
"""Leetcode 314. Binary Tree Vertical Order Traversal Medium URL: https://leetcode.com/problems/binary-tree-vertical-order-traversal/ Given a binary tree, return the vertical order traversal of its nodes' values. (ie, from top to bottom, column by column). If two nodes are in the same row and column, the order shoul...
bsd-2-clause
DirectXMan12/nova-hacking
nova/tests/db/test_migration_utils.py
1
21712
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 Boris Pavlovic (boris@pavlovic.me). # 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 # # ...
apache-2.0
twm/django-yarr
yarr/migrations/0001_initial.py
2
8454
# -*- 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): # Adding model 'Feed' db.create_table('yarr_feed', ( ('id', self.gf('django.db.models.fields.Aut...
bsd-3-clause
Aristocles/CouchPotatoServer
libs/oauthlib/oauth1/rfc5849/parameters.py
186
4817
# -*- coding: utf-8 -*- from __future__ import absolute_import """ 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 urlparse import urlparse, urlunparse from . import util...
gpl-3.0
JoshuaSBrown/langmuir
LangmuirPython/misc/create_rst.py
2
1726
# -*- coding: utf-8 -*- """ create_rst.py ============= .. argparse:: :module: create_rst :func: create_parser :prog: create_rst.py .. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com> """ import argparse import os desc = """ Create rst files from all .py files found in path. """ def create_parser():...
gpl-2.0
techsd/namebench
nb_third_party/simplejson/scanner.py
674
2560
"""JSON token scanner """ import re def _import_c_make_scanner(): try: from simplejson._speedups import make_scanner return make_scanner except ImportError: return None c_make_scanner = _import_c_make_scanner() __all__ = ['make_scanner'] NUMBER_RE = re.compile( r'(-?(?:0|[1-9]\d*))...
apache-2.0
mariopro/youtube-dl
youtube_dl/extractor/appletrailers.py
101
5336
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, ) class AppleTrailersIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?trailers\.apple\.com/(?:trailers|ca)/(?P<company>[^/]+)/(?P<movie>...
unlicense
zhangjunlei26/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_mock.py
496
5168
#!/usr/bin/env python # # Copyright 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...
mpl-2.0
JerryLead/spark
examples/src/main/python/ml/lda_example.py
54
1900
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
all-of-us/raw-data-repository
rdr_service/alembic/versions/cd009f1475ff_deceased_report_cause_of_death.py
1
1935
"""deceased report cause of death Revision ID: cd009f1475ff Revises: a4ab3afcb460 Create Date: 2020-09-08 11:48:27.208496 """ from alembic import op import sqlalchemy as sa import rdr_service.model.utils from rdr_service.participant_enums import PhysicalMeasurementsStatus, QuestionnaireStatus, OrderStatus from rdr_...
bsd-3-clause
malcolmr/vroom
vroom/runner.py
3
5918
"""The Vroom test runner. Does the heavy lifting.""" import sys import vroom import vroom.actions import vroom.args import vroom.buffer import vroom.command import vroom.environment import vroom.output import vroom.shell import vroom.test import vroom.vim from vroom.result import Result # Pylint is not smart enough ...
apache-2.0
ubic135/odoo-design
addons/website_event/models/event.py
6
3773
# -*- coding: utf-8 -*- from openerp import models, fields, api, _ # from openerp.osv import osv, fields from openerp import SUPERUSER_ID from openerp.models import NewId # from openerp.tools.translate import _ import re from openerp.addons.website.models.website import slug class event(models.Model): _name =...
agpl-3.0
tboyce021/home-assistant
homeassistant/components/apple_tv/__init__.py
2
12223
"""The Apple TV integration.""" import asyncio import logging from random import randrange from pyatv import connect, exceptions, scan from pyatv.const import Protocol from homeassistant.components.media_player import DOMAIN as MP_DOMAIN from homeassistant.components.remote import DOMAIN as REMOTE_DOMAIN from homeass...
apache-2.0
kleins11/intdatasci-byte2
lib/jinja2/bccache.py
346
12793
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
apache-2.0
flibbertigibbet/DRIVER
app/data/tasks/export_csv.py
2
17878
import csv import os import zipfile import tempfile import time import StringIO import pytz from django.conf import settings from django.contrib.auth.models import User from celery import shared_task from celery.utils.log import get_task_logger from django_redis import get_redis_connection from data.models import D...
gpl-3.0
marshall007/rethinkdb
packaging/osx/create_dmg.py
8
7673
#!/usr/bin/python # -*- coding: utf-8 -*- '''Create the dmg for MacOS deployment''' import atexit, copy, os, re, shutil, subprocess, sys, tempfile thisFolder = os.path.dirname(os.path.realpath(__file__)) sys.path.append(thisFolder) import dmgbuild # == defaults scratchFolder = tempfile.mkdtemp() packagePosition =...
agpl-3.0
Sjc1000/PyRC
UI/NickName.py
1
1047
#!/usr/bin/env python3 from gi.repository import Gtk, Pango class NickName(): servers = {} active_server = None active_channel = None def __init__(self, MainWindow): self.MainWindow = MainWindow self.position = [0, 9, 1, 1] def prebuild(self): self.MainWindow.ui_plugin...
gpl-2.0
igel-kun/pyload
module/lib/thrift/transport/TTransport.py
74
8384
# # 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...
gpl-3.0
assad2012/shadowsocks
shadowsocks/daemon.py
694
5602
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2014-2015 clowwindy # # 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
oscaro/django
django/core/management/commands/compilemessages.py
53
4119
from __future__ import unicode_literals import codecs import os from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.core.management.utils import find_command, popen_wrapper from django.utils._os import npath, upath def has_bom(fn): with open(fn, 'rb') a...
bsd-3-clause
shadowmint/nwidget
lib/pyglet-1.4.4/pyglet/window/mouse.py
43
2458
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
apache-2.0
bpsinc-native/src_third_party_pywebsocket_src
example/abort_handshake_wsh.py
465
1781
# 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
redhat-openstack/nova
nova/tests/test_test_utils.py
30
2511
# Copyright 2010 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-2.0 # # Unless required by applicable l...
apache-2.0
mysociety/barnetplanning
applications/migrations/0002_auto__add_field_application_ward_mapit_id.py
1
1626
# 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 'Application.ward_mapit_id' db.add_column('applications_application', 'ward_mapit_id', ...
agpl-3.0
brightinteractive/cmsplugin-filer
cmsplugin_filer_link/migrations_django/0001_initial.py
13
1682
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import filer.fields.file import cms.models.fields from cmsplugin_filer_link.models import LINK_STYLES class Migration(migrations.Migration): dependencies = [ ('cms', '0003_auto_20140926_2347'), ...
bsd-3-clause
DanielFSFE/test1
adventure.py
1
13152
import random class Game(object): """ holds all information for a game. Later it may be possible to run several game instances at once """ number = 0 def __init__(self): self.number = Game.number Game.number += 1 self.rooms = {} # dictionary of rooms, key is room number...
gpl-2.0
citrix-openstack-build/ceilometer
ceilometer/openstack/common/rpc/securemessage.py
3
18050
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Red Hat, 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 # #...
apache-2.0
MIPS/external-chromium_org
net/tools/testserver/testserver.py
23
73598
#!/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. """This is a simple HTTP/FTP/TCP/UDP/BASIC_AUTH_PROXY/WEBSOCKET server used for testing Chrome. It supports several test URLs, as spec...
bsd-3-clause
fbossy/SickRage
lib/guessit/textutils.py
33
11207
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
peiyuwang/pants
tests/python/pants_test/jvm/test_safeargs.py
11
1132
# coding=utf-8 # Copyright 2014 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) import os import uni...
apache-2.0