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 |
|---|---|---|---|---|---|
FrankBian/kuma | vendor/packages/sqlalchemy/lib/sqlalchemy/test/schema.py | 8 | 2739 | """Enhanced versions of schema.Table and schema.Column which establish
desired state for different backends.
"""
from sqlalchemy.test import testing
from sqlalchemy import schema
__all__ = 'Table', 'Column',
table_options = {}
def Table(*args, **kw):
"""A schema.Table wrapper/hook for dialect-specific tweaks.""... | mpl-2.0 |
batra-mlp-lab/DIGITS | digits/model/forms.py | 1 | 11983 | # Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
import os
import flask
from flask.ext.wtf import Form
import wtforms
from wtforms import validators
from digits.config import config_value
from digits.device_query import get_device, get_nvml_info
from digits import utils
from digits.utils import s... | bsd-3-clause |
xavfernandez/pip | src/pip/_vendor/html5lib/_trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | mit |
Cloudino/Cloudino-Arduino-IDE | arduino-core/src/processing/app/i18n/python/requests/packages/charade/sjisprober.py | 1182 | 3734 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | lgpl-2.1 |
vivekanand1101/statscache | fedmsg.d/endpoints.py | 6 | 1857 | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg 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 (at your option) any later version.
#... | gpl-2.0 |
jotes/boto | tests/unit/beanstalk/test_exception.py | 114 | 2085 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights... | mit |
ulule/django-linguist | linguist/tests/test_signals.py | 1 | 3254 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from exam import around, fixture
from django.db.models.signals import pre_save, post_save
from ..models import Translation
from .base import BaseTestCase
from .models import BarModel
class PostDeleteSignalTest(BaseTestCase):
"""
Tests Linguis... | mit |
schleichdi2/OPENNFR-6.1-CORE | opennfr-openembedded-core/meta/lib/oeqa/core/runner.py | 1 | 2466 | # Copyright (C) 2016 Intel Corporation
# Released under the MIT license (see COPYING.MIT)
import os
import time
import unittest
import logging
xmlEnabled = False
try:
import xmlrunner
from xmlrunner.result import _XMLTestResult as _TestResult
from xmlrunner.runner import XMLTestRunner as _TestRunner
x... | gpl-2.0 |
jiangzhuo/kbengine | kbe/res/scripts/common/Lib/test/test_binop.py | 139 | 12658 | """Tests for binary operators on subtypes of built-in types."""
import unittest
from test import support
from operator import eq, ne, lt, gt, le, ge
def gcd(a, b):
"""Greatest common divisor using Euclid's algorithm."""
while a:
a, b = b%a, a
return b
def isint(x):
"""Test whether an object i... | lgpl-3.0 |
trishnaguha/pywikibot-core | pywikibot/tools/djvu.py | 6 | 3504 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Wrapper around djvulibre to access djvu files properties and content."""
#
# (C) Pywikibot team, 2015
#
# Distributed under the terms of the MIT license.
#
from __future__ import unicode_literals
__version__ = '$Id$'
import os.path
import subprocess
import pywikibot
cla... | mit |
Lunatixz/script.skin.helper.service | resources/lib/musicbrainzngs/caa.py | 1 | 6079 | # This file is part of the musicbrainzngs library
# Copyright (C) Alastair Porter, Wieland Hoffmann, and others
# This file is distributed under a BSD-2-Clause type license.
# See the COPYING file for more information.
__all__ = [
'set_caa_hostname', 'get_image_list', 'get_release_group_image_list',
'get_relea... | gpl-2.0 |
rdkls/django-audit-mongodb | tests/fixtures/sampledjango/manage.py | 1 | 1321 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010, 2degrees Limited <egoddard@tech.2degreesnetwork.com>.
# All Rights Reserved.
#
# This file is part of djangoaudit <https://launchpad.net/django-audit/>,
# which is subject... | bsd-3-clause |
vipul-sharma20/oh-mainline | vendor/packages/whoosh/src/whoosh/support/testing.py | 17 | 4771 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | agpl-3.0 |
Panos-Bletsos/spark-cost-model-optimizer | python/pyspark/sql/session.py | 11 | 24874 | #
# 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 |
willthames/ansible | lib/ansible/modules/cloud/rackspace/rax_clb_nodes.py | 4 | 8779 | #!/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 |
vhosouza/invesalius3 | invesalius/data/viewer_volume.py | 5 | 69761 | # -*- coding: utf-8 -*-
#--------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.go... | gpl-2.0 |
alrusdi/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/tests/models.py | 39 | 9207 | # -*- coding: utf-8 -*-
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.conf import settings
from django.db import connection
from django.forms import Form, ModelForm, FileField, ModelChoiceField
from django.test import TestCase
from regressiontests.forms.models import ChoiceMo... | gpl-3.0 |
szilveszter/django | django/contrib/redirects/middleware.py | 109 | 1861 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.contrib.redirects.models import Redirect
from django.contrib.sites.shortcuts import get_current_site
from django.core.exceptions import ImproperlyConfigured
from django import http
class RedirectFallback... | bsd-3-clause |
ryandougherty/mwa-capstone | MWA_Tools/build/matplotlib/doc/mpl_examples/widgets/menu.py | 3 | 4882 | import numpy as np
import matplotlib
import matplotlib.colors as colors
import matplotlib.patches as patches
import matplotlib.mathtext as mathtext
import matplotlib.pyplot as plt
import matplotlib.artist as artist
import matplotlib.image as image
class ItemProperties:
def __init__(self, fontsize=14, labelcolor='... | gpl-2.0 |
mglukhikh/intellij-community | plugins/hg4idea/testData/bin/mercurial/mdiff.py | 92 | 11609 | # mdiff.py - diff and patch routines for mercurial
#
# Copyright 2005, 2006 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
from i18n import _
import bdiff, mpatch, util
import re, struct, base85, zl... | apache-2.0 |
pvagner/orca | src/orca/scripts/apps/soffice/spellcheck.py | 1 | 3428 | # Orca
#
# Copyright 2015 Igalia, S.L.
#
# Author: Joanmarie Diggs <jdiggs@igalia.com>
#
# 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 (at your o... | lgpl-2.1 |
3dfxsoftware/cbss-addons | openerp_print/pyPdf/utils.py | 1 | 3722 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# 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 abov... | gpl-2.0 |
ionrock/designate | designate/i18n.py | 7 | 1131 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Author: Kiall Mac Innes <kiall@hp.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... | apache-2.0 |
haveal/googleads-python-lib | examples/dfp/v201508/suggested_ad_unit_service/get_all_suggested_ad_units.py | 4 | 1809 | #!/usr/bin/python
#
# Copyright 2015 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 b... | apache-2.0 |
anandology/pyjamas | examples/funnysortedgridthing/SortedGridThing.py | 9 | 2659 | import pyjd # this is dummy in pyjs.
from pyjamas.ui.RootPanel import RootPanel
from pyjamas.ui.Button import Button
from pyjamas.ui.HTML import HTML
from pyjamas.ui.HorizontalPanel import HorizontalPanel
from pyjamas.ui.VerticalPanel import VerticalPanel
from pyjamas.ui.DockPanel import DockPanel
from pyjamas.ui.Scrol... | apache-2.0 |
prospwro/odoo | addons/project/__openerp__.py | 259 | 2562 | # -*- 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 |
rahul67/hue | desktop/core/ext-py/Django-1.6.10/tests/dispatch/tests/test_saferef.py | 108 | 1898 | from django.dispatch.saferef import safeRef
from django.utils.six.moves import xrange
from django.utils import unittest
class Test1(object):
def x(self):
pass
def test2(obj):
pass
class Test2(object):
def __call__(self, obj):
pass
class SaferefTests(unittest.TestCase):
def setUp(self... | apache-2.0 |
scality/manila | manila/tests/network/test_standalone_network_plugin.py | 1 | 18570 | # Copyright 2015 Mirantis, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
foarsitter/decide-exchange-model | decide/model/observers/sqliteobserver.py | 1 | 8383 | import datetime
from collections import defaultdict
from typing import List
from decide import results
from decide.data import database as db
from decide.data.database import connection
from decide.model import calculations
from decide.model.base import AbstractExchange, Actor, Issue, AbstractExchangeActor
from decide... | gpl-3.0 |
lilmuck/lilmuck | plugin.video.streamoase_ll/mechanize/_form.py | 131 | 120863 | """HTML form handling for web clients.
HTML form handling for web clients: useful for parsing HTML forms, filling them
in and returning the completed forms to the server. This code developed from a
port of Gisle Aas' Perl module HTML::Form, from the libwww-perl library, but
the interface is not the same.
The most us... | gpl-2.0 |
jaskaye17/nomadpad | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/manni.py | 364 | 2374 | # -*- coding: utf-8 -*-
"""
pygments.styles.manni
~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by the terminal highlighting style.
This is a port of the style used in the `php port`_ of pygments
by Manni. The style is called 'default' there.
:copyright: Copyright 2006-2013 by the Pygments... | mit |
odpi/bigtop | bigtop-packages/src/common/ambari/ODPi/1.0/services/HIVE/package/alerts/alert_hive_metastore.py | 6 | 9637 | #!/usr/bin/env python
"""
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")... | apache-2.0 |
weiawe/django | django/db/backends/postgresql_psycopg2/features.py | 11 | 1062 | from django.db.backends.base.features import BaseDatabaseFeatures
from django.db.utils import InterfaceError
class DatabaseFeatures(BaseDatabaseFeatures):
allows_group_by_selected_pks = True
needs_datetime_string_cast = False
can_return_id_from_insert = True
has_real_datatype = True
has_native_uui... | bsd-3-clause |
umars/npyscreen | build/lib/npyscreen/fmEditFormNew.py | 6 | 2599 | from . import fmForm
# TOTALLY BROKEN AND UNFINISHED
# DON'T USE
class ActionFormNew(fmForm.FormBaseNew):
CANCEL_BUTTON_BR_OFFSET = (2, 12)
OK_BUTTON_TEXT = "OK"
CANCEL_BUTTON_TEXT = "Cancel"
def __init__(self, *args, **keywords):
super(ActionFormNew, self).__init__(*arg... | bsd-2-clause |
ofer43211/unisubs | apps/teams/migrations/0098_add_priority_indexes.py | 5 | 28968 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
db.create_index('teams_task', ['team_id', 'priority', 'created'])
db.create_index('teams_task', ['team_id', 'priority',... | agpl-3.0 |
hackerbot/DjangoDev | django/contrib/auth/handlers/modwsgi.py | 537 | 1344 | from django import db
from django.contrib import auth
from django.utils.encoding import force_bytes
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on whether the user exists and authen... | bsd-3-clause |
blademainer/intellij-community | python/helpers/docutils/parsers/rst/__init__.py | 42 | 14143 | # $Id: __init__.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.
"""
This is ``docutils.parsers.rst`` package. It exports a single class, `Parser`,
the reStructuredText parser.
Usage
=====
1. Create a parser::
pa... | apache-2.0 |
sserrot/champion_relationships | venv/Lib/site-packages/ipykernel/parentpoller.py | 4 | 4175 | # Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
try:
import ctypes
except:
ctypes = None
import os
import platform
import signal
import time
try:
from _thread import interrupt_main # Py 3
except ImportError:
from thread import interrupt_main # Py 2... | mit |
rodrigob/fuel | fuel/datasets/mnist.py | 10 | 1401 | # -*- coding: utf-8 -*-
from fuel.datasets import H5PYDataset
from fuel.transformers.defaults import uint8_pixels_to_floatX
from fuel.utils import find_in_data_path
class MNIST(H5PYDataset):
u"""MNIST dataset.
MNIST (Mixed National Institute of Standards and Technology) [LBBH] is
a database of handwritte... | mit |
akarol/cfme_tests | sprout/appliances/migrations/0042_openshift_appliances_support.py | 6 | 1175 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-02-19 12:23
from __future__ import unicode_literals
from django.db import migrations, models
import json_field.fields
class Migration(migrations.Migration):
dependencies = [
('appliances', '0041_auto_20180216_1634'),
]
operations = [
... | gpl-2.0 |
ulkaio/ulka | docs/conf.py | 1 | 8316 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# ulka documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autoge... | mit |
ZhangXinNan/tensorflow | tensorflow/contrib/factorization/python/kernel_tests/wals_solver_ops_test.py | 8 | 4705 | # 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 applic... | apache-2.0 |
ntt-sic/cinder | cinder/tests/test_storwize_svc.py | 2 | 95411 | # Copyright 2013 IBM Corp.
# 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/LIC... | apache-2.0 |
comepradz/pybrain | pybrain/datasets/dataset.py | 25 | 13323 |
__author__ = 'Thomas Rueckstiess, ruecksti@in.tum.de'
import random
import pickle
from itertools import chain
from scipy import zeros, resize, ravel, asarray
import scipy
from pybrain.utilities import Serializable
class OutOfSyncError(Exception): pass
class VectorFormatError(Exception): pass
class NoLinkedFieldsE... | bsd-3-clause |
djeo94/CouchPotatoServer | couchpotato/core/media/movie/providers/automation/imdb.py | 15 | 11228 | import traceback
import re
from bs4 import BeautifulSoup
from couchpotato import fireEvent
from couchpotato.core.helpers.encoding import ss
from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import getImdb, splitString, tryInt
from couchpotato.core.logger import CPLog
from couchpotato.... | gpl-3.0 |
krtkmj/zulip | zerver/views/webhooks/pivotal.py | 9 | 8028 | """Webhooks for external integrations."""
from __future__ import absolute_import
from django.http import HttpRequest, HttpResponse
from django.utils.translation import ugettext as _
from zerver.lib.actions import check_send_message
from zerver.lib.response import json_success, json_error
from zerver.decorator import ... | apache-2.0 |
GyrosOfWar/servo | components/script/dom/bindings/codegen/parser/WebIDL.py | 28 | 249009 | # 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/.
""" A WebIDL parser. """
from ply import lex, yacc
import re
import os
import traceback
import math
from collections im... | mpl-2.0 |
p0psicles/SickRage | lib/unidecode/x05f.py | 252 | 4660 | data = (
'Kai ', # 0x00
'Bian ', # 0x01
'Yi ', # 0x02
'Qi ', # 0x03
'Nong ', # 0x04
'Fen ', # 0x05
'Ju ', # 0x06
'Yan ', # 0x07
'Yi ', # 0x08
'Zang ', # 0x09
'Bi ', # 0x0a
'Yi ', # 0x0b
'Yi ', # 0x0c
'Er ', # 0x0d
'San ', # 0x0e
'Shi ', # 0x0f
'Er ', # 0x10
'Shi ', ... | gpl-3.0 |
othercriteria/StochasticBlockmodel | test_block.py | 1 | 7829 | #!/usr/bin/env python
# Test of "new style" network inference, finally with blockmodel
# Daniel Klein, 7/8/2012
import numpy as np
from Network import Network
from Models import StationaryLogistic, NonstationaryLogistic, Blockmodel
from Models import alpha_zero, alpha_norm, alpha_unif, alpha_gamma
from Experiment im... | mit |
frogbywyplay/genbox_xov | xov/config.py | 1 | 2984 | #
# Copyright (C) 2006-2014 Wyplay, All Rights Reserved.
# This file is part of xov.
#
# xov 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 ve... | gpl-2.0 |
tsgit/invenio | modules/bibformat/lib/elements/bfe_external_publications.py | 35 | 1342 | ## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 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 option) any ... | gpl-2.0 |
v-iam/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/subnets_operations.py | 2 | 16210 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
hrishioa/Aviato | app/kartograph/layersource/special/graticule.py | 4 | 2307 |
from kartograph.geometry import MultiLineFeature
from kartograph.layersource.layersource import LayerSource
from shapely.geometry import LineString
class GraticuleLayer(LayerSource):
"""
special layer source for grid of longitudes and latitudes (graticule)
"""
def get_features(self, latitudes, longit... | gpl-2.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pandas/tests/test_nanops.py | 7 | 44169 | # -*- coding: utf-8 -*-
from __future__ import division, print_function
from functools import partial
import warnings
import numpy as np
from pandas import Series, isnull
from pandas.types.common import is_integer_dtype
import pandas.core.nanops as nanops
import pandas.util.testing as tm
use_bn = nanops._USE_BOTTLEN... | gpl-3.0 |
olivierdalang/QGIS | python/plugins/processing/algs/gdal/warp.py | 29 | 11677 | # -*- coding: utf-8 -*-
"""
***************************************************************************
self.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
**********************************... | gpl-2.0 |
kmonsoor/python-for-android | python3-alpha/python3-src/Tools/scripts/reindent.py | 48 | 11022 | #! /usr/bin/env python3
# Released to the public domain, by Tim Peters, 03 October 2000.
"""reindent [-d][-r][-v] [ path ... ]
-d (--dryrun) Dry run. Analyze, but don't make any changes to, files.
-r (--recurse) Recurse. Search for all .py files in subdirectories too.
-n (--nobackup) No backup. Does not make ... | apache-2.0 |
aidiary/keras_examples | imagenet/image_crawler.py | 1 | 2572 | import os
import time
import json
import random
import imghdr
import requests
IMAGE_URL_API = 'http://www.image-net.org/api/text/imagenet.synset.geturls?wnid='
OUTPUT_DIR = "images"
MAX_NUM_IMAGES_PER_CATEGORY = 100
def download_image(url, filename):
try:
r = requests.get(url)
except Exception:
... | mit |
hnoerdli/hussa | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py | 1569 | 23354 | #!/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.
"""Utility functions to perform Xcode-style build steps.
These functions are executed via gyp-mac-tool when using the Makefile generator.
""... | mit |
moijes12/oh-mainline | vendor/packages/twisted/twisted/python/roots.py | 68 | 7311 | # -*- test-case-name: twisted.test.test_roots -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted Python Roots: an abstract hierarchy representation for Twisted.
Maintainer: Glyph Lefkowitz
"""
# System imports
import types
from twisted.python import reflect
class NotSupportedErr... | agpl-3.0 |
cloudbase/nova | nova/scheduler/driver.py | 3 | 2145 | # Copyright (c) 2010 OpenStack Foundation
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complianc... | apache-2.0 |
basvandenberg/spiceweb | spiceweb/project.py | 1 | 14038 | import os
import re
import zipfile
import traceback
#import urllib2
import simplejson
import cherrypy
from cherrypy.lib.static import serve_file
import spiceweb
from biopy import file_io
class Project:
SESSION_PROJECT_KEY = 'project_id'
EXAMPLE_DIR = 'example_projects'
EXAMPLES = [
('aniger-se... | gpl-3.0 |
sam-m888/gprime | gprime/plug/menu/_enumeratedlist.py | 1 | 5086 | #
# gPrime - A web-based genealogy program
#
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Gary Burton
#
# 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-2.0 |
tragiclifestories/django | tests/auth_tests/test_management.py | 65 | 23053 | from __future__ import unicode_literals
import locale
import sys
from datetime import date
from django.apps import apps
from django.contrib.auth import management, models
from django.contrib.auth.checks import check_user_model
from django.contrib.auth.management import create_permissions
from django.contrib.auth.mana... | bsd-3-clause |
javierTerry/odoo | addons/l10n_be_intrastat/l10n_be_intrastat.py | 258 | 7828 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Business Applications
# Copyright (C) 2014-2015 Odoo S.A. <http://www.odoo.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
erickuofucker/nw.js | tools/package_binaries.py | 64 | 14511 | #!/usr/bin/env python
import argparse
import getnwisrelease
import getnwversion
import gzip
import os
import platform
import shutil
import sys
import tarfile
import zipfile
from subprocess import call
steps = ['nw', 'chromedriver', 'symbol', 'headers', 'others']
################################
# Parse command line a... | mit |
luotao1/Paddle | python/paddle/fluid/tests/unittests/dygraph_to_static/test_basic_api_transformation.py | 1 | 14296 | # Copyright (c) 2020 PaddlePaddle 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 app... | apache-2.0 |
levelrf/level_basestation | grc/gui/Bars.py | 17 | 4092 | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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... | gpl-3.0 |
pepitogithub/PythonScripts | varios/finalrl.py | 1 | 2373 | #-------------------------------------------------
#------------------- Imports -------------------
#-------------------------------------------------
import os
#-------------------------------------------------
# --------- Sacar el enter de un STR -----------
#-------------------------------------------------
# c... | gpl-2.0 |
akubera/AliPhysics | PWGJE/EMCALJetTasks/Tracks/analysis/util/SpectrumTools.py | 41 | 27252 | #**************************************************************************
#* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
#* *
#* Author: The ALICE Off-line Project. *
#* Contributors ... | bsd-3-clause |
musically-ut/statsmodels | statsmodels/tsa/vector_ar/dynamic.py | 27 | 9932 | # pylint: disable=W0201
from statsmodels.compat.python import iteritems, string_types, range
import numpy as np
from statsmodels.tools.decorators import cache_readonly
import pandas as pd
from . import var_model as _model
from . import util
from . import plotting
FULL_SAMPLE = 0
ROLLING = 1
EXPANDING = 2
def _get... | bsd-3-clause |
bakerlover/project2 | lib/flask/sessions.py | 348 | 12882 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2012 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from datetime import datetime
from werkzeug.http import http_date, ... | apache-2.0 |
easmetz/inasafe | docs/conf.py | 17 | 8532 | # -*- coding: utf-8 -*-
#
# InaSAFE documentation build configuration file, created by
# sphinx-quickstart on Wed Sep 16 11:54:36 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | gpl-3.0 |
egenerat/flight-manager | django/template/loaders/filesystem.py | 9 | 2414 | """
Wrapper for loading templates from the filesystem.
"""
from django.conf import settings
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils._os import safe_join
class Loader(BaseLoader):
is_usable = True
def get_template_sources(sel... | mit |
jeremykid/FunAlgorithm | python_practice/sort/sort.py | 1 | 2772 | def bubble_sort(input_list):
input_list_length = len(input_list)
for passed in range(input_list_length-1):
for index in range(input_list_length-1):
if (input_list[index] > input_list[index+1]):
input_list[index], input_list[index+1] = input_list[index+1], input_list[index]
# print input_lis... | mit |
0x0all/carcade | tests/environments_tests.py | 2 | 2016 | # coding: utf-8
import os
import shutil
import tempfile
import unittest
from jinja2 import TemplateSyntaxError
from webassets import Bundle
from carcade.core import get_translations
from carcade.environments import create_assets_env, create_jinja2_env
class WebassetsEnvironmentTest(unittest.TestCase):
def setUp... | bsd-3-clause |
gerryhd/diabot-assistant | lib/python2.7/site-packages/werkzeug/contrib/jsrouting.py | 513 | 8564 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.jsrouting
~~~~~~~~~~~~~~~~~~~~~~~~~~
Addon module that allows to create a JavaScript function from a map
that generates rules.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
... | gpl-3.0 |
thatchristoph/namebench | libnamebench/selectors_test.py | 175 | 3406 | #!/usr/bin/env python
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
khalim19/gimp-plugin-export-layers | git_hooks/commit_msg.py | 1 | 4246 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Export Layers.
#
# Copyright (C) 2013-2019 khalim19 <khalim19@gmail.com>
#
# Export Layers 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... | gpl-3.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.2/tests/regressiontests/expressions_regress/tests.py | 39 | 8118 | """
Spanning tests for all the operations that F() expressions can perform.
"""
from django.test import TestCase, Approximate
from django.conf import settings
from django.db import models, DEFAULT_DB_ALIAS
from django.db.models import F
from regressiontests.expressions_regress.models import Number
class ExpressionsR... | apache-2.0 |
hynnet/openwrt-mt7620 | staging_dir/host/lib/python2.7/ctypes/macholib/dylib.py | 268 | 2041 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
Generic dylib path manipulation
"""
import re
__all__ = ['dylib_info']
DYLIB_RE = re.compile(r"""(?x... | gpl-2.0 |
adrpar/incubator-airflow | airflow/migrations/versions/4addfa1236f1_add_fractional_seconds_to_mysql_tables.py | 48 | 6399 | #
# 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 the ... | apache-2.0 |
jbzdak/edx-platform | lms/envs/static.py | 30 | 2282 | """
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We intentionally define lot... | agpl-3.0 |
teeple/pns_server | work/install/Python-2.7.4/Lib/plat-mac/aetools.py | 40 | 11515 | """Tools for use in AppleEvent clients and servers.
pack(x) converts a Python object to an AEDesc object
unpack(desc) does the reverse
packevent(event, parameters, attributes) sets params and attrs in an AEAppleEvent record
unpackevent(event) returns the parameters and attributes from an AEAppleEvent record
Plus... ... | gpl-2.0 |
pychess/pychess | lib/pychess/ic/__init__.py | 1 | 25090 | from gi.repository import Gtk
from pychess import Variants
from pychess.Utils.const import NORMALCHESS, ATOMICCHESS, BUGHOUSECHESS, CRAZYHOUSECHESS, \
LOSERSCHESS, SUICIDECHESS, FISCHERRANDOMCHESS, WILDCASTLESHUFFLECHESS, \
SHUFFLECHESS, RANDOMCHESS, ASYMMETRICRANDOMCHESS, WILDCASTLECHESS, UPSIDEDOWNCHESS, \
... | gpl-3.0 |
VipSaran/Py_Led_Clock | Adafruit_7Segment.py | 1 | 2204 | #!/usr/bin/python
import time
import datetime
from Adafruit_LEDBackpack import LEDBackpack
# ===========================================================================
# 7-Segment Display
# ===========================================================================
# This class is meant to be used with the four-cha... | apache-2.0 |
HelloLily/hellolily | lily/messaging/email/templatetags/email.py | 1 | 8094 | from __future__ import absolute_import
from bs4 import BeautifulSoup
from collections import OrderedDict
import urllib
from datetime import datetime
from dateutil.tz import gettz, tzutc
from dateutil.parser import parse
from django import template
from django.conf import settings
from django.urls import reverse
from d... | agpl-3.0 |
tucbill/manila | manila/openstack/common/network_utils.py | 13 | 2157 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apac... | apache-2.0 |
diagramsoftware/account-financial-reporting | account_chart_report/wizard/__init__.py | 34 | 1040 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Savoir-faire Linux (<www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the t... | agpl-3.0 |
benvermaercke/pyqtgraph | pyqtgraph/graphicsItems/PlotCurveItem.py | 28 | 22481 | from ..Qt import QtGui, QtCore
try:
from ..Qt import QtOpenGL
HAVE_OPENGL = True
except:
HAVE_OPENGL = False
import numpy as np
from .GraphicsObject import GraphicsObject
from .. import functions as fn
from ..Point import Point
import struct, sys
from .. import getConfigOption
from .. import debug
__a... | mit |
phoebusliang/parallel-lettuce | tests/integration/lib/Django-1.3/django/contrib/localflavor/fi/fi_municipalities.py | 394 | 10822 | # -*- coding: utf-8 -*-
"""
An alphabetical list of Finnish municipalities for use as `choices` in a
formfield.
This exists in this standalone file so that it's only imported into memory
when explicitly needed.
"""
MUNICIPALITY_CHOICES = (
('akaa', u"Akaa"),
('alajarvi', u"Alajärvi"),
('alavieska', u"Alav... | gpl-3.0 |
Kami/libcloud | libcloud/test/__init__.py | 6 | 8581 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
DazWorrall/ansible | lib/ansible/utils/module_docs_fragments/sros.py | 224 | 2754 | #
# (c) 2015, Peter Sprygada <psprygada@ansible.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 License, or
# (at your option) any late... | gpl-3.0 |
EDUlib/edx-platform | common/djangoapps/third_party_auth/saml.py | 1 | 23124 | """
Slightly customized python-social-auth backend for SAML 2.0 support
"""
import logging
from copy import deepcopy
import requests
from django.contrib.sites.models import Site
from django.http import Http404
from django.utils.functional import cached_property
from django_countries import countries
from onelogin.sa... | agpl-3.0 |
moollaza/zeroclickinfo-goodies | share/goodie/currency_in/parse.py | 87 | 2347 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Released under the GPL v2 license
# https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
import lxml.html
import sys
#url = "http://en.wikipedia.org/wiki/List_of_circulating_currencies"
url = "https://secure.wikimedia.org/wikipedia/en/wiki/List_of_circulating_currencies"... | apache-2.0 |
digris/openbroadcast.org | website/apps/abcast/signals.py | 2 | 1470 | from __future__ import unicode_literals
import logging
from django.apps import apps
from django.db.models.signals import post_save
from django.dispatch import receiver, Signal
from django_elasticsearch_dsl.registries import registry
from .utils import notify
from .models import Emission, Channel
log = logging.getLog... | gpl-3.0 |
jumpstarter-io/nova | nova/tests/fake_network.py | 10 | 18653 | # Copyright 2011 Rackspace
# 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 ... | apache-2.0 |
jorge-marques/shoop | shoop/notify/enums.py | 6 | 1163 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.utils.translation import ugettext_lazy as _
from enumfields.enu... | agpl-3.0 |
mmoya/ansible | v2/ansible/plugins/cache/base.py | 8 | 1316 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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.
... | gpl-3.0 |
techtonik/pip | src/pip/_vendor/cachecontrol/adapter.py | 42 | 4863 | import types
import functools
import zlib
from pip._vendor.requests.adapters import HTTPAdapter
from .controller import CacheController
from .cache import DictCache
from .filewrapper import CallbackFileWrapper
class CacheControlAdapter(HTTPAdapter):
invalidating_methods = {"PUT", "DELETE"}
def __init__(
... | mit |
resmo/cloudstack | test/integration/component/test_network_offering.py | 6 | 67587 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.