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
IQSS/geoconnect
gc_apps/classification/layer_link_helper.py
1
5041
""" Used for development to create WorldMap-related links from a layer name """ from __future__ import print_function import logging import re import requests from django.conf import settings LOGGER = logging.getLogger(__name__) GEONODE_PREFIX = 'geonode:' class LayerLink(object): """Holds name, link, descriptio...
apache-2.0
louietsai/python-for-android
python3-alpha/python3-src/Lib/unittest/test/test_result.py
788
19069
import io import sys import textwrap from test import support import traceback import unittest class Test_TestResult(unittest.TestCase): # Note: there are not separate tests for TestResult.wasSuccessful(), # TestResult.errors, TestResult.failures, TestResult.testsRun or # TestResult.shouldStop because t...
apache-2.0
staceyson/qemu-bsd-user-old
tests/qemu-iotests/qcow2.py
91
7287
#!/usr/bin/env python import sys import struct import string class QcowHeaderExtension: def __init__(self, magic, length, data): self.magic = magic self.length = length self.data = data @classmethod def create(cls, magic, data): return QcowHeaderExtension(magic, len(da...
gpl-2.0
lthurlow/Boolean-Constrained-Routing
networkx-1.8.1/build/lib/networkx/algorithms/bipartite/__init__.py
29
3167
r""" This module provides functions and operations for bipartite graphs. Bipartite graphs `B = (U, V, E)` have two node sets `U,V` and edges in `E` that only connect nodes from opposite sets. It is common in the literature to use an spatial analogy referring to the two node sets as top and bottom nodes. The bipartite...
mit
MetricsGrimoire/sortinghat
tests/test_cmd_log.py
1
8958
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014-2017 Bitergia # # 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 la...
gpl-3.0
sbidoul/buildbot
master/buildbot/www/oauth2.py
1
9591
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
zrhans/pythonanywhere
.virtualenvs/django19/lib/python3.4/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py
1730
2278
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import _base from ..constants import voidElements, namespaces class ...
apache-2.0
jolyonb/edx-platform
lms/djangoapps/grades/migrations/0014_persistentsubsectiongradeoverridehistory.py
3
1405
# -*- coding: utf-8 -*- # Generated by Django 1.11.16 on 2018-11-27 20:53 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depend...
agpl-3.0
jchampion/elasticsearch
dev-tools/create_bwc_index_with_plugin_mappings.py
87
3553
import create_bwc_index import logging import os import random import shutil import subprocess import sys import tempfile def fetch_version(version): logging.info('fetching ES version %s' % version) if subprocess.call([sys.executable, os.path.join(os.path.split(sys.argv[0])[0], 'get-bwc-version.py'), version]) != ...
apache-2.0
erkanay/django
django/test/utils.py
15
19704
from contextlib import contextmanager import logging import re import sys import time from unittest import skipUnless import warnings from functools import wraps from xml.dom.minidom import parseString, Node from django.apps import apps from django.conf import settings, UserSettingsHolder from django.core import mail ...
bsd-3-clause
nijx/hypertable
src/py/ThriftClient/client_test.py
1
4079
import sys import time from hypertable.thriftclient import * from hyperthrift.gen.ttypes import * try: client = ThriftClient("localhost", 38080) print "HQL examples" try: namespace = client.namespace_open("bad") except: print "Caught exception when tyring to open 'bad' namespace" namespace = client...
gpl-3.0
lupyuen/RaspberryPiImage
home/pi/GrovePi/Software/Python/others/temboo/Library/Parse/Users/__init__.py
5
1205
from temboo.Library.Parse.Users.DeleteUser import DeleteUser, DeleteUserInputSet, DeleteUserResultSet, DeleteUserChoreographyExecution from temboo.Library.Parse.Users.LinkExistingUser import LinkExistingUser, LinkExistingUserInputSet, LinkExistingUserResultSet, LinkExistingUserChoreographyExecution from temboo.Library....
apache-2.0
earlbellinger/asteroseismology
grid/calibrate.py
1
3590
#### Calibrate a solar model #### Author: Earl Bellinger ( bellinger@mps.mpg.de ) #### Stellar Ages & Galactic Evolution Group #### Max-Planck-Institut fur Sonnensystemforschung #### Department of Astronomy, Yale University import numpy as np import pandas as pd from scipy import optimize from os import ...
gpl-2.0
gannetson/sportschooldeopenlucht
env/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/commands/search.py
63
4751
import sys import textwrap import pkg_resources import pip.download from pip.basecommand import Command, SUCCESS from pip.util import get_terminal_size from pip.log import logger from pip.backwardcompat import xmlrpclib, reduce, cmp from pip.exceptions import CommandError from pip.status_codes import NO_MATCHES_FOUND f...
bsd-3-clause
TRex22/Sick-Beard
lib/Cheetah_local/CheetahWrapper.py
12
23973
# $Id: CheetahWrapper.py,v 1.26 2007/10/02 01:22:04 tavis_rudd Exp $ """Cheetah command-line interface. 2002-09-03 MSO: Total rewrite. 2002-09-04 MSO: Bugfix, compile command was using wrong output ext. 2002-11-08 MSO: Another rewrite. Meta-Data ========================================================================...
gpl-3.0
jaimemaretoli/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/langthaimodel.py
2930
11275
######################## 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...
lgpl-2.1
sametmax/Django--an-app-at-a-time
ignore_this_directory/django/db/backends/base/validation.py
114
1040
class BaseDatabaseValidation: """Encapsulate backend-specific validation.""" def __init__(self, connection): self.connection = connection def check(self, **kwargs): return [] def check_field(self, field, **kwargs): errors = [] # Backends may implement a check_field_type...
mit
huajiahen/hotspot
backend/Busy/models.py
1
1154
# -*- coding:utf-8 -*- from django.db.models import * class Event(Model): content = CharField(u'内容',max_length = 200) starttime = IntegerField(u'开始时间') endtime = IntegerField(u'结束时间') #longitude = DecimalField(u'经度',max_digits = 18,decimal_places = 14) #latitude = DecimalField(u'纬度',max_digits...
mit
Softmotions/edx-platform
common/lib/xmodule/xmodule/contentstore/utils.py
235
1470
from xmodule.contentstore.content import StaticContent from .django import contentstore def empty_asset_trashcan(course_locs): ''' This method will hard delete all assets (optionally within a course_id) from the trashcan ''' store = contentstore('trashcan') for course_loc in course_locs: ...
agpl-3.0
Gui13/CouchPotatoServer
libs/CodernityDB/rr_cache.py
82
3673
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.com) # # 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/L...
gpl-3.0
Idilia/StarCluster
starcluster/plugins/pkginstaller.py
18
2207
# 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
DutBright/scientificResearch
command/set_experts.py
2
4059
# coding: UTF-8 ''' Created on 2013-03-27 @author: tianwei Desc: expert project relation ''' import uuid from django.db import models from django.db.models import Q from django.conf import settings from django.contrib.auth.models import User from school.models import * from users.models import * from backend.loggi...
agpl-3.0
SimenB/thefuck
tests/rules/test_gem_unknown_command.py
5
3517
import pytest from six import BytesIO from thefuck.rules.gem_unknown_command import match, get_new_command from thefuck.types import Command output = ''' ERROR: While executing gem ... (Gem::CommandLineError) Unknown command {} ''' gem_help_commands_stdout = b''' GEM commands are: build Build a ...
mit
robertwb/incubator-beam
sdks/python/apache_beam/runners/dataflow/dataflow_metrics_test.py
5
21074
# # 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
sajeeshcs/nested_quota
nova/network/ldapdns.py
18
13172
# Copyright 2012 Andrew Bogott for the Wikimedia 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 requi...
apache-2.0
cmaclell/py_plan
py_plan/problems/blocksworld.py
1
3681
from operator import ne from py_search.utils import compare_searches from py_search.uninformed import depth_first_search from py_search.uninformed import breadth_first_search from py_search.uninformed import iterative_deepening_search from py_plan.total_order import StateSpacePlanningProblem from py_plan.base import ...
mit
ntymtsiv/tempest
tempest/thirdparty/boto/test_ec2_instance_run.py
1
14269
# Copyright 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 requ...
apache-2.0
ThiagoGarciaAlves/intellij-community
python/helpers/py3only/docutils/transforms/misc.py
49
4866
# $Id: misc.py 6314 2010-04-26 10:04:17Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Miscellaneous transforms. """ __docformat__ = 'reStructuredText' from docutils import nodes from docutils.transforms import Transform class CallBack(Trans...
apache-2.0
leki75/ansible
lib/ansible/modules/cloud/amazon/ec2.py
16
64022
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
40023256/2015cdag1man
static/Brython3.1.0-20150301-090019/Lib/collections/abc.py
739
16026
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. Unit tests are in test_collections. """ from abc import ABCMeta, abstractmethod import sys __all__ = ["Hashable", "Iterable", "Iterator", ...
gpl-3.0
c-o-m-m-a-n-d-e-r/CouchPotatoServer
libs/html5lib/treewalkers/__init__.py
1229
2323
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
gpl-3.0
postlund/home-assistant
homeassistant/components/lutron/switch.py
6
1545
"""Support for Lutron switches.""" import logging from homeassistant.components.switch import SwitchDevice from . import LUTRON_CONTROLLER, LUTRON_DEVICES, LutronDevice _LOGGER = logging.getLogger(__name__) def setup_platform(hass, config, add_entities, discovery_info=None): """Set up the Lutron switches.""" ...
apache-2.0
Conflei/ATI
[ATI] Misfenterest/Frontend/env/lib/python2.6/site-packages/pip/_vendor/progress/counter.py
404
1529
# -*- coding: utf-8 -*- # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS P...
mit
mstriemer/olympia
src/olympia/versions/feeds.py
3
3975
from django.shortcuts import get_object_or_404 from django.utils.feedgenerator import DefaultFeed from django.utils.translation import ugettext as _ from jingo.helpers import datetime from olympia import amo from olympia.amo.urlresolvers import reverse from olympia.amo.helpers import absolutify, url from olympia.amo.f...
bsd-3-clause
thopiekar/Cura
plugins/3MFWriter/__init__.py
3
1584
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. import sys from UM.Logger import Logger try: from . import ThreeMFWriter except ImportError: Logger.log("w", "Could not import ThreeMFWriter; libSavitar may be missing") from . import ThreeMFWorkspaceWriter from...
lgpl-3.0
ropik/androguard
androguard/core/bytecodes/dvm_permissions.py
73
43712
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # 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...
apache-2.0
glaubitz/fs-uae-debian
launcher/fsgs/spectrum/__init__.py
2
1629
# FSGS - Common functionality for FS Game System. # Copyright (C) 2013-2019 Frode Solheim <frode@solheim.dev> # # 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, ...
gpl-2.0
nathanlnw/Tw703_gghypt_TJ_local
tools/keil.py
20
6753
import os import sys import string import xml.etree.ElementTree as etree from xml.etree.ElementTree import SubElement from utils import _make_path_relative from utils import xml_indent fs_encoding = sys.getfilesystemencoding() def _get_filetype(fn): if fn.rfind('.c') != -1 or fn.rfind('.C') != -1 or fn.rfind('.c...
gpl-2.0
t-ashula/phply
tools/phpshell.py
3
2218
#!/usr/bin/env python # phpshell.py - PHP interactive interpreter import sys sys.path.append('..') import ast import pprint import readline import traceback from phply import pythonast, phplex from phply.phpparse import parser def echo(*objs): for obj in objs: sys.stdout.write(str(obj)) def inline_htm...
bsd-3-clause
shaneknapp/spark
python/pyspark/pandas/indexes/base.py
2
84541
# # 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
kutenai/django
django/db/backends/mysql/schema.py
8
4561
from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.models import NOT_PROVIDED class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s" sql_alter_column_null = "MODIFY %(column)s %(type)s NULL" sql_alter_column_...
bsd-3-clause
eclipse-ease-addons/engines
jython/org.jython/Lib/pawt/colors.py
112
4500
from java.awt import Color aliceblue = Color(240, 248, 255) antiquewhite = Color(250, 235, 215) aqua = Color(0, 255, 255) aquamarine = Color(127, 255, 212) azure = Color(240, 255, 255) beige = Color(245, 245, 220) bisque = Color(255, 228, 196) black = Color(0, 0, 0) blanchedalmond = Color(255, 235, 205) blue = Color(0...
epl-1.0
citrix-openstack-build/horizon
horizon/tables/base.py
1
53167
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
apache-2.0
TribeMedia/sky_engine
third_party/libxml/src/check-xsddata-test-suite.py
343
10682
#!/usr/bin/python import sys import time import os import string import StringIO sys.path.insert(0, "python") import libxml2 # Memory debug specific libxml2.debugMemory(1) debug = 0 verbose = 0 quiet = 1 # # the testsuite description # CONF=os.path.join(os.path.dirname(__file__), "test/xsdtest/xsdtestsuite.xml") LOG=...
bsd-3-clause
jromang/retina-old
distinclude/spyderlib/interpreter.py
1
11927
# -*- coding: utf-8 -*- # # Copyright © 2009-2010 Pierre Raybaut # Licensed under the terms of the MIT License # (see spyderlib/__init__.py for details) """Shell Interpreter""" import sys import atexit import threading import ctypes import os import re import os.path as osp import pydoc from subproces...
gpl-3.0
mrkipling/maraschino
lib/werkzeug/test.py
77
32616
# -*- coding: utf-8 -*- """ werkzeug.test ~~~~~~~~~~~~~ This module implements a client to WSGI applications for testing. :copyright: (c) 2011 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import urlparse import mimetypes from time ...
mit
smendez/lean
paart/apps/projects/migrations/0012_auto__add_projectfile.py
2
9051
# -*- 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 'ProjectFile' db.create_table('projects_projectfile', ( ('id', self.gf('django.db...
gpl-3.0
rakeshmi/cinder
cinder/volume/drivers/hds/hds.py
4
22158
# Copyright (c) 2013 Hitachi Data Systems, Inc. # 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://ww...
apache-2.0
dennis-sheil/commandergenius
project/jni/python/src/Lib/encodings/cp500.py
593
13377
""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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...
lgpl-2.1
fitermay/intellij-community
python/helpers/python-skeletons/multiprocessing/__init__.py
28
4217
"""Skeleton for 'multiprocessing' stdlib module.""" from multiprocessing.pool import Pool class Process(object): def __init__(self, group=None, target=None, name=None, args=(), kwargs={}): self.name = '' self.daemon = False self.authkey = None self.exitcode = None self.id...
apache-2.0
fabada/pootle
pootle/apps/accounts/management/commands/find_duplicate_emails.py
4
1518
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django.contrib.au...
gpl-3.0
SivilTaram/edx-platform
lms/djangoapps/mobile_api/users/views.py
46
10046
""" Views for user API """ from django.shortcuts import redirect from django.utils import dateparse from rest_framework import generics, views from rest_framework.decorators import api_view from rest_framework.response import Response from opaque_keys.edx.keys import UsageKey from opaque_keys import InvalidKeyError ...
agpl-3.0
danforthcenter/plantcv
tests/tests.py
1
288502
#!/usr/bin/env python import pytest import os import shutil import json import numpy as np import cv2 import sys import pandas as pd from plotnine import ggplot from plantcv import plantcv as pcv import plantcv.learn import plantcv.parallel import plantcv.utils # Import matplotlib and use a null Template to block plot...
mit
CeltonMcGrath/TACTIC
src/pyasm/prod/web/artist_view_wdg.py
6
5064
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
awanke/bokeh
examples/plotting/file/boxplot.py
43
2269
import numpy as np import pandas as pd from bokeh.plotting import figure, show, output_file # Generate some synthetic time series for six different categories cats = list("abcdef") yy = np.random.randn(2000) g = np.random.choice(cats, 2000) for i, l in enumerate(cats): yy[g == l] += i // 2 df = pd.DataFrame(dict(s...
bsd-3-clause
hoho/dosido
nodejs/deps/v8/tools/testrunner/local/__init__.py
651
1571
# Copyright 2012 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditi...
mit
huongttlan/bokeh
examples/charts/file/hover_span.py
37
2749
from bokeh.models import HoverTool from bokeh.charts import Line, Scatter, vplot, hplot, show, output_file from bokeh.sampledata.degrees import xyvalues index = xyvalues.pop("Year") xyvalues = xyvalues[['Biology', 'Business', 'Computer Science']] TOOLS='box_zoom,box_select,hover,crosshair,resize,reset' output_file("...
bsd-3-clause
sbaogang/teletraan
deploy-board/deploy_board/webapp/auth.py
6
8882
# Copyright 2016 Pinterest, 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 writi...
apache-2.0
McNetic/CouchPotatoServer-de
libs/pyasn1/codec/cer/decoder.py
261
1230
# CER decoder from pyasn1.type import univ from pyasn1.codec.ber import decoder from pyasn1.compat.octets import oct2int from pyasn1 import error class BooleanDecoder(decoder.AbstractSimpleDecoder): protoComponent = univ.Boolean(0) def valueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet, length, ...
gpl-3.0
cedi4155476/QGIS
python/plugins/processing/algs/lidar/fusion/Cover.py
9
3895
# -*- coding: utf-8 -*- """ *************************************************************************** Cover.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *********************************...
gpl-2.0
samfoo/servo
python/mozlog/mozlog/structured/commandline.py
39
8909
# 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 sys import os import optparse from collections import defaultdict from structuredlog import StructuredLogger, se...
mpl-2.0
spectralpython/spectral
spectral/database/aster.py
1
15620
''' Code for reading and managing ASTER spectral library data. ''' from __future__ import absolute_import, division, print_function, unicode_literals from spectral.utilities.python23 import IS_PYTHON3, tobytes, frombytes from .spectral_database import SpectralDatabase if IS_PYTHON3: readline = lambda fin: fin.r...
gpl-2.0
Tchanders/socorro
socorro/unittest/external/filesystem/test_crashstorage.py
11
10125
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import os.path import shutil import tempfile import inspect from nose.tools import eq_, ok_, assert_raises fr...
mpl-2.0
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/contrib/seq2seq/python/ops/decoder.py
25
11345
# 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...
bsd-2-clause
zhangpf/vbox
src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/GlobalData.py
11
1803
## @file # This file is used to define common static strings and global data used by UPT # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this # dist...
gpl-2.0
APSL/libthumbor
tests/testproj/settings.py
2
3072
# Django settings for testproj project. import logging DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_SUPPORTS_TRANSACTIONS = True DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
mit
olexiim/edx-platform
common/djangoapps/external_auth/tests/test_ssl.py
12
18092
""" Provides unit tests for SSL based authentication portions of the external_auth app. """ import unittest from django.conf import settings from django.contrib.auth import SESSION_KEY from django.contrib.auth.models import AnonymousUser, User from django.contrib.sessions.middleware import SessionMiddleware from djang...
agpl-3.0
kod3r/pyh3
h3/h3math.py
4
5552
import math import numpy as np """ Scaling factor for compute_radius(), compute_hyperbolic_area(), compute_delta_theta() and compute_delta_phi(). """ K = 2.0 """ The 3D coordinate structure """ class Point4d(object): """ The constructor for Point4d :param float x: the x coordinate for a node in cart...
mit
maximermilov/cauliflowervest
cauliflowervest/server/handlers/bitlocker.py
2
1905
# Copyright 2017 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 by applicable law or a...
apache-2.0
mdietrichc2c/OCB
addons/stock_landed_costs/__init__.py
373
1087
# -*- 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
salguarnieri/intellij-community
python/helpers/pycharm/django_manage_commands_provider/_parser/_optparse.py
80
1322
# coding=utf-8 """ Fetches arguments from optparse-based Django (< 1.8) """ __author__ = 'Ilya.Kazakevich' from django_manage_commands_provider._parser import _utils # noinspection PyUnusedLocal # Parser here by contract def process_command(dumper, command, parser): """ Fetches arguments and options from comm...
apache-2.0
mttr/django
django/contrib/auth/decorators.py
356
3049
from functools import wraps from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import PermissionDenied from django.shortcuts import resolve_url from django.utils import six from django.utils.decorators import available_attrs from django.utils.six.moves.urll...
bsd-3-clause
unsiloai/syntaxnet-ops-hack
tensorflow/contrib/distributions/python/kernel_tests/transformed_distribution_test.py
74
12624
# 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
passiweinberger/nupic
src/nupic/test/test_framework_helpers.py
35
2044
#! /usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions...
agpl-3.0
pbugni/pheme.webAPIclient
pheme/webAPIclient/archive.py
1
4121
from datetime import datetime import os import requests import json from pheme.util.config import Config def url_builder(predicate=None, resource=None, view=None, query_params={}): """Build webAPI url from config and passed values :param predicate: desired action or type of document :param resource: fil...
bsd-3-clause
popazerty/e2_sh4
lib/python/Tools/Downloader.py
6
1965
from boxbranding import getMachineBrand, getMachineName from twisted.web import client from twisted.internet import reactor, defer class HTTPProgressDownloader(client.HTTPDownloader): def __init__(self, url, outfile, headers=None): client.HTTPDownloader.__init__(self, url, outfile, headers=headers, agent="%s %s H...
gpl-2.0
sestrella/ansible
test/units/modules/storage/netapp/test_na_ontap_net_subnet.py
20
10423
# (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ''' unit test template for ONTAP Ansible module ''' from __future__ import print_function import json import pytest from units.compat import unittest from units.compat.mock import patch from ansible.m...
gpl-3.0
ActiveState/code
recipes/Python/436229_RecordJar_Parser/recipe-436229.py
1
2025
#!/usr/bin/env python # recordjar.py - Parse a Record-Jar into a list of dictionaries. # Copyright 2005 Lutz Horn <lutz.horn@gmx.de> # Licensed unter the same terms as Python. def parse_jar(flo): """Parse a Record-Jar from a file like object into a list of dictionaries. This method parses a file like object ...
mit
MelanieBittl/dolfin
site-packages/dolfin/fem/adaptivesolving.py
4
7328
"""This module provides a Python layer on top of the C++ Adaptive*VariationalSolver classes""" # Copyright (C) 2011 Marie E. Rognes # # This file is part of DOLFIN. # # DOLFIN 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 Fre...
gpl-3.0
Mhynlo/SickRage
lib/sqlalchemy/testing/schema.py
76
3438
# testing/schema.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from . import exclusions from .. import schema, event from . import config __all__ ...
gpl-3.0
mathebox/PyHDB
tests/test_connection.py
7
1896
# Copyright 2014, 2015 SAP SE. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http: //www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, #...
apache-2.0
randomchars/pushbullet.py
tests/fixtures.py
1
2011
import time devices_list_response = { "devices": [ { "active": True, "iden": "1", "created": time.time(), "modified": time.time(), "icon": "system", "generated_nickname": False, "nickname": "test dev", "manufact...
mit
hxxft/lynx-native
Core/third_party/jsoncpp/devtools/batchbuild.py
33
11483
from __future__ import print_function import collections import itertools import json import os import os.path import re import shutil import string import subprocess import sys import cgi class BuildDesc: def __init__(self, prepend_envs=None, variables=None, build_type=None, generator=None): self.prepend_...
mit
hernandito/SickRage
sickbeard/notifiers/nmj.py
3
7840
# coding=utf-8 # Author: Nico Berlee http://nico.berlee.nl/ # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 ve...
gpl-3.0
aabbox/kbengine
kbe/res/scripts/common/Lib/test/test_structmembers.py
87
4889
import unittest from test import support # Skip this test if the _testcapi module isn't available. support.import_module('_testcapi') from _testcapi import _test_structmembersType, \ CHAR_MAX, CHAR_MIN, UCHAR_MAX, \ SHRT_MAX, SHRT_MIN, USHRT_MAX, \ INT_MAX, INT_MIN, UINT_MAX, \ LONG_MAX, LONG_MIN, ULON...
lgpl-3.0
ppiotr/Bibedit-some-refactoring
modules/websubmit/lib/functions/Send_Approval_Request.py
3
6394
## 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
mbourqui/django-publications-bootstrap
publications_bootstrap/admin_views/import_bibtex.py
1
7261
# -*- coding: utf-8 -*- import re from django.contrib import messages from django.contrib.admin.views.decorators import staff_member_required from django.http import HttpResponseRedirect from django.shortcuts import render from django_countries import countries from ..bibtex import parse from ..models import Publica...
mit
nitinitprof/odoo
addons/pos_restaurant/__init__.py
332
1074
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
johnnadratowski/examples
python/concurrency/process_pipes_4.py
2
1875
#!/usr/bin/python import pprint import requests import sys from multiprocessing import Process, Pipe def get_extract(conn, idx, title, id): print("RUNNING PROCESS %s" % idx) print("GETTING PAGE %s EXTRACT" % idx) content = requests.get('https://en.wikipedia.org/w/api.php?format=json&action=query&prop=extra...
mit
alhashash/yowsup
yowsup/layers/auth/test_crypt.py
67
1355
from yowsup.layers import YowLayerEvent, YowLayerTest from yowsup.structs import ProtocolTreeNode from yowsup.layers.auth import YowCryptLayer from yowsup.layers.auth.keystream import KeyStream class CryptLayerTest(YowLayerTest, YowCryptLayer): def setUp(self): YowCryptLayer.__init__(self) self.pas...
gpl-3.0
JGiola/swift
utils/gyb_syntax_support/Traits.py
39
1558
from Child import Child class Trait(object): def __init__(self, trait_name, description=None, children=None): self.trait_name = trait_name self.children = children self.description = description TRAITS = [ Trait('DeclGroup', children=[ Child('Attributes', kind...
apache-2.0
hbeatty/dell-wsman-client-api-python
setup.py
1
1520
""" Setup file for egg builds @copyright: 2010-2012 @author: Joseph Tallieu <joseph_tallieu@dell.com> @author: Vijay Halaharvi <vijay_halaharvi@dell.com> @organization: Dell Inc. - PG Validation @license: GNU LGLP v2.1 """ # This file is part of WSManAPI. # # WSManAPI is free software: you can redistribute it an...
lgpl-3.0
dchenaux/Yoda
yoda/flask_debugtoolbar_mongo/panel.py
1
2746
from flask_debugtoolbar.panels import DebugPanel import jinja2 from . import operation_tracker from . import jinja_filters class MongoDebugPanel(DebugPanel): """Panel that shows information about MongoDB operations. """ name = 'Mongo' has_content = True def __init__(self, *args, **kwargs): ...
bsd-3-clause
goniz/plexmyxbmc
plexmyxbmc/__init__.py
1
1359
#!/usr/bin/python2 __version__ = "1.0.0" import plexapi from plexmyxbmc.config import get_config from plexmyxbmc.log import get_logger plexapi.X_PLEX_PROVIDES = 'player,controller,sync-target' plexapi.X_PLEX_PRODUCT = "PlexMyXBMC" plexapi.X_PLEX_VERSION = __version__ plexapi.X_PLEX_IDENTIFIER = get_config().get('uuid'...
gpl-2.0
chrishoffman/ansible-modules-extras
windows/win_dotnet_ngen.py
138
1769
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Peter Mounce <public@neverrunwithscissors.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...
gpl-3.0
ubc/edx-platform
lms/djangoapps/courseware/features/gst.py
82
2327
from lettuce import world, steps from nose.tools import assert_equals from common import i_am_registered_for_the_course, visit_scenario_item DEFAULT_DATA = """\ <render> <p>Test of the graphical slider tool</p> <div class='gst-value'> <span id="value-display" style="width:50px; float:left; margin-le...
agpl-3.0
Tatsh/youtube-dl
youtube_dl/extractor/telequebec.py
5
9308
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_str from ..utils import ( int_or_none, smuggle_url, try_get, unified_timestamp, ) class TeleQuebecBaseIE(InfoExtractor): BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%...
unlicense
jtakayama/makahiki-draft
makahiki/apps/widgets/status/migrations/0003_auto__add_field_dailystatus_setup_users__add_field_dailystatus_short_d.py
9
1917
# 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 'DailyStatus.setup_users' db.add_column('status_dailystatus', 'setup_users', self.gf('djang...
mit
loop1024/pymo-global
android/pgs4a-0.9.6/python-install/lib/python2.7/sqlite3/test/types.py
69
14915
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/types.py: tests for type conversion and detection # # Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for...
mit
paolopaolopaolo/django-rest-framework
rest_framework/response.py
48
3607
""" The Response class in REST framework is similar to HTTPResponse, except that it is initialized with unrendered data, instead of a pre-rendered string. The appropriate renderer is called during Django's template response rendering. """ from __future__ import unicode_literals from django.template.response import Si...
bsd-2-clause