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 |
|---|---|---|---|---|---|
prymitive/upaas-admin | upaas_admin/apps/applications/models.py | 1 | 31729 | # -*- coding: utf-8 -*-
"""
:copyright: Copyright 2013-2014 by Łukasz Mierzwa
:contact: l.mierzwa@gmail.com
"""
from __future__ import unicode_literals
import os
import datetime
import logging
import tempfile
import shutil
import time
import re
from copy import deepcopy
from mongoengine import (Document, Dat... | gpl-3.0 |
blackPantherOS/packagemanagement | smartpm/smart/channels/rpm_dir_info.py | 4 | 1215 | #
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | apache-2.0 |
ian-garrett/meetMe | env/lib/python3.4/site-packages/werkzeug/contrib/cache.py | 147 | 24912 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.cache
~~~~~~~~~~~~~~~~~~~~~~
The main problem with dynamic Web sites is, well, they're dynamic. Each
time a user requests a page, the webserver executes a lot of code, queries
the database, renders templates until the visitor gets the page he sees.
... | artistic-2.0 |
Zord13appdesa/python-for-android | python-modules/twisted/twisted/runner/procmon.py | 49 | 10916 | # -*- test-case-name: twisted.runner.test.test_procmon -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support for starting, monitoring, and restarting child process.
"""
import warnings
from twisted.python import log
from twisted.internet import error, protocol, reactor as _... | apache-2.0 |
googleapis/googleapis-gen | google/cloud/billing/budgets/v1/billing-budgets-v1-py/google/cloud/billing/budgets/__init__.py | 1 | 2304 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
jviada/QuantEcon.py | quantecon/models/solow/impulse_response.py | 7 | 10840 | """
Classes for generating and plotting impulse response functions.
@author : David R. Pugh
@date : 2014-10-06
"""
from __future__ import division
from textwrap import dedent
import matplotlib.pyplot as plt
import numpy as np
class ImpulseResponse(object):
"""Base class representing an impulse response functio... | bsd-3-clause |
originell/jpype | test/jpypetest/test_proxy.py | 2 | 16734 | # *****************************************************************************
#
# 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 |
jaakkos/ev3-controller | docs/conf.py | 75 | 7722 | # -*- coding: utf-8 -*-
#
# sample documentation build configuration file, created by
# sphinx-quickstart on Mon Apr 16 21:22:43 2012.
#
# 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.
#
# All ... | bsd-2-clause |
TeamExodus/external_chromium_org | chrome/test/chromedriver/archive.py | 25 | 2935 | # Copyright (c) 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.
"""Downloads items from the Chromium continuous archive."""
import os
import platform
import urllib
import util
CHROME_35_REVISION = '260135'
CHROME_3... | bsd-3-clause |
waprin/google-cloud-python | gcloud/pubsub/_gax.py | 4 | 19334 | # Copyright 2016 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 |
etzhou/edx-platform | common/djangoapps/terrain/stubs/tests/test_lti_stub.py | 172 | 4269 | """
Unit tests for stub LTI implementation.
"""
from mock import Mock, patch
import unittest
import urllib2
import requests
from terrain.stubs.lti import StubLtiService
class StubLtiServiceTest(unittest.TestCase):
"""
A stub of the LTI provider that listens on a local
port and responds with pre-defined gr... | agpl-3.0 |
yousafsyed/casperjs | bin/Lib/tkinter/test/test_tkinter/test_text.py | 12 | 1479 | import unittest
import tkinter
from test.support import requires, run_unittest
from tkinter.ttk import setup_master
requires('gui')
class TextTest(unittest.TestCase):
def setUp(self):
self.root = setup_master()
self.text = tkinter.Text(self.root)
def tearDown(self):
self.text.destroy... | mit |
mavit/ansible | lib/ansible/modules/cloud/azure/azure_rm_sqlserver.py | 11 | 10759 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
jaredweiss/nupic | nupic/regions/SPRegion.py | 8 | 32109 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | gpl-3.0 |
Fokko/incubator-airflow | airflow/hooks/hive_hooks.py | 1 | 39213 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
aplicatii-romanesti/allinclusive-kodi-pi | .kodi/addons/plugin.video.hubwizard/t0mm0_common_net.py | 81 | 10355 | '''
common XBMC Module
Copyright (C) 2011 t0mm0
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 version.
Th... | apache-2.0 |
dvitme/odoomrp-wip | sale_documents_comments/models/stock.py | 2 | 2266 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import api, models, fields
class StockPic... | agpl-3.0 |
stencila/hub | clients/python/test/test_token.py | 1 | 3457 | # coding: utf-8
"""
Stencila Hub API
# Authentication Many endpoints in the Stencila Hub API require an authentication token. These tokens carry many privileges, so be sure to keep them secure. Do not place your tokens in publicly accessible areas such as client-side code. The API is only served over HTTPS t... | apache-2.0 |
ychfan/tensorflow | tensorflow/python/ops/summary_op_util.py | 40 | 4203 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
facom/GeoTrans | system.py | 1 | 1241 | from geotrans import *
System=dict2obj(dict(\
#########################################
#SYSTEM PRIMARY PARAMETERS
#########################################
#//////////////////////////////
#DETECTOR
#//////////////////////////////
Ddet=0.5,#Aperture, m
qeff=1.0,#Quantum efficiency
#//////////////////////////////
#STAR... | gpl-2.0 |
elego/tkobr-addons | tko_project_task_status/models/project_task.py | 1 | 5572 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# ThinkOpen Solutions Brasil
# Copyright (C) Thinkopen Solutions <http://www.tkobr.com>.
#
# This... | agpl-3.0 |
mrquim/repository.mrquim | repo/script.module.unidecode/lib/unidecode/x017.py | 252 | 4190 | data = (
'[?]', # 0x00
'[?]', # 0x01
'[?]', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'[?]', # 0x05
'[?]', # 0x06
'[?]', # 0x07
'[?]', # 0x08
'[?]', # 0x09
'[?]', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'[?]', # 0x0f
'[?]', # 0x10
'[?]', # 0x11
'[?]'... | gpl-2.0 |
lbjay/cds-invenio | modules/websubmit/lib/functions/Convert_RecXML_to_RecALEPH_DELETE.py | 4 | 4574 | ## 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 |
Juniper/tempest | tempest/tests/lib/services/base.py | 5 | 3438 | # Copyright 2015 Deutsche Telekom AG. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
ingadhoc/odoo | addons/account/edi/invoice.py | 342 | 13984 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
kustodian/ansible | lib/ansible/modules/crypto/openssl_certificate.py | 2 | 123262 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016-2017, Yanis Guenane <yanis+ansible@guenane.org>
# Copyright: (c) 2017, Markus Teufelberger <mteufelberger+ansible@mgit.at>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import... | gpl-3.0 |
v-legoff/accertin | lyntin/ui/message.py | 1 | 1613 | #######################################################################
# This file is part of Lyntin.
# copyright (c) Free Software Foundation 2001, 2002
#
# Lyntin is distributed under the GNU General Public License license. See the
# file LICENSE for distribution details.
# $Id: message.py,v 1.1 2003/08/01 00:14:52... | gpl-3.0 |
ingokegel/intellij-community | python/helpers/third_party/thriftpy/_shaded_thriftpy/transport/sslsocket.py | 32 | 4905 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import socket
import ssl
import struct
from ._ssl import (
create_thriftpy_context,
RESTRICTED_SERVER_CIPHERS,
DEFAULT_CIPHERS
)
from .socket import TSocket, TServerSocket
class TSSLSocket(TSocket):
"""SSL socket implementatio... | apache-2.0 |
aronsky/home-assistant | tests/components/media_player/test_universal.py | 3 | 28452 | """The tests for the Universal Media player platform."""
from copy import copy
import unittest
from voluptuous.error import MultipleInvalid
from homeassistant.const import (
STATE_OFF, STATE_ON, STATE_UNKNOWN, STATE_PLAYING, STATE_PAUSED)
import homeassistant.components.switch as switch
import homeassistant.compo... | apache-2.0 |
cytec/SickRage | lib/unidecode/x09e.py | 252 | 4615 | data = (
'Shu ', # 0x00
'Luo ', # 0x01
'Qi ', # 0x02
'Yi ', # 0x03
'Ji ', # 0x04
'Zhe ', # 0x05
'Yu ', # 0x06
'Zhan ', # 0x07
'Ye ', # 0x08
'Yang ', # 0x09
'Pi ', # 0x0a
'Ning ', # 0x0b
'Huo ', # 0x0c
'Mi ', # 0x0d
'Ying ', # 0x0e
'Meng ', # 0x0f
'Di ', # 0x10
'Yue ', ... | gpl-3.0 |
loads/molotov | molotov/tests/test_sharedconsole.py | 1 | 2723 | import unittest
import asyncio
import sys
import os
import re
import io
from molotov.util import multiprocessing
from molotov.sharedconsole import SharedConsole
from molotov.tests.support import dedicatedloop, catch_output
OUTPUT = """\
one
two
3
TypeError\\("unsupported operand type(.*)?
TypeError\\("unsupported op... | apache-2.0 |
rbooth200/DiscEvolution | DiscEvolution/driver.py | 1 | 12630 | # driver.py
#
# Author: R. Booth
# Date: 17 - Nov - 2016
#
# Combined model for dust, gas and chemical evolution
################################################################################
from __future__ import print_function
import numpy as np
import os
from .photoevaporation import FixedExternalEvaporation
from... | gpl-3.0 |
orekyuu/intellij-community | python/lib/Lib/site-packages/django/conf/locale/ml/formats.py | 341 | 1635 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'N j, Y'
TIME_FORMAT = 'P'
DATETIME_FORMAT = 'N j, Y, P'
YEAR_MONTH_FORMAT... | apache-2.0 |
bcoca/ansible | lib/ansible/modules/dnf.py | 1 | 53556 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015 Cristian van Ee <cristian at cvee.org>
# Copyright 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com>
# Copyright 2018 Adam Miller <admiller@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future_... | gpl-3.0 |
ppietrasa/grpc | tools/distrib/check_copyright.py | 1 | 5538 | #!/usr/bin/env python2.7
# Copyright 2015, 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 li... | bsd-3-clause |
albertjan/pypyjs-presentation | assets/js/pypy.js-0.3.1/lib/modules/test/test_stat.py | 54 | 5696 | import unittest
import os
from test.test_support import TESTFN, run_unittest
import stat
class TestFilemode(unittest.TestCase):
file_flags = {'SF_APPEND', 'SF_ARCHIVED', 'SF_IMMUTABLE', 'SF_NOUNLINK',
'SF_SNAPSHOT', 'UF_APPEND', 'UF_COMPRESSED', 'UF_HIDDEN',
'UF_IMMUTABLE', 'UF_... | unlicense |
luistorresm/odoo | addons/account_voucher/__init__.py | 358 | 1098 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
le9i0nx/ansible | lib/ansible/playbook/base.py | 3 | 24147 | # Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import itertools
import oper... | gpl-3.0 |
ak2703/edx-platform | lms/djangoapps/survey/views.py | 53 | 3973 | """
View endpoints for Survey
"""
import logging
import json
from django.contrib.auth.decorators import login_required
from django.http import (
HttpResponse, HttpResponseRedirect, HttpResponseNotFound
)
from django.core.urlresolvers import reverse
from django.views.decorators.http import require_POST
from django... | agpl-3.0 |
bzennn/blog_flask | python/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/gb2312freq.py | 3132 | 36011 | ######################## 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... | gpl-3.0 |
fredkingham/blog-of-fred | django/contrib/admindocs/urls.py | 317 | 1092 | from django.conf.urls import patterns, url
from django.contrib.admindocs import views
urlpatterns = patterns('',
url('^$',
views.doc_index,
name='django-admindocs-docroot'
),
url('^bookmarklets/$',
views.bookmarklets,
name='django-admindocs-bookmarklets'
),
url('^tag... | bsd-3-clause |
bowlofstew/client | migrations/migrations.py | 5 | 1535 | from biicode.common.migrations.migration import Migration
import os
from biicode.common.model.symbolic.block_version import BlockVersion
from biicode.common.utils.file_utils import save
from biicode.client.workspace.bii_paths import BII_DIR
######### DO NOT DELETE *NEVER* A CLASS FROM THIS MODULE ##########
### MIGRA... | mit |
foosel/OctoPrint | src/octoprint/access/users.py | 1 | 40260 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
from flask_login im... | agpl-3.0 |
shawntan/opencog | opencog/embodiment/Monitor/nlp_browser.py | 17 | 3535 | #
# Monitor of Natural Language Processing (RelexServer and NLGen)
#
# @author Zhenhua Cai <czhedu@gmail.com>
#
# @date 2011-04-23
#
import sys
import time
import zmq
import json
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from common import *
###############################################################... | agpl-3.0 |
nitinitprof/odoo | addons/account/wizard/account_report_general_journal.py | 378 | 1697 | # -*- 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 |
mikewesner-wf/glasshouse | appengine/lib/requests/packages/charade/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versio... | apache-2.0 |
CasparLi/calibre | src/calibre/ebooks/metadata/extz.py | 10 | 3173 | # -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
'''
Read meta information from extZ (TXTZ, HTMLZ...) files.
'''
import os
from cStringIO import StringIO
from calibre.ebooks.metadata import MetaInformation
from calibre.ebooks.metadata.opf2 import OPF
fro... | gpl-3.0 |
18F/regulations-parser | tests/layer_def_finders_tests.py | 3 | 9464 | # vim: set fileencoding=utf-8
import re
from unittest import TestCase
from regparser.layer import def_finders
from regparser.layer.scope_finder import ScopeFinder
from regparser.layer.terms import ParentStack
from regparser.tree.struct import Node
class SmartQuotesTest(TestCase):
def setUp(self):
self.st... | cc0-1.0 |
sanjuro/RCJK | vendor/django/middleware/http.py | 73 | 2189 | from django.core.exceptions import MiddlewareNotUsed
from django.utils.http import http_date
class ConditionalGetMiddleware(object):
"""
Handles conditional GET operations. If the response has a ETag or
Last-Modified header, and the request has If-None-Match or
If-Modified-Since, the response is replac... | apache-2.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/google/appengine/ext/bulkload/transform.py | 8 | 15916 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | bsd-3-clause |
BMJHayward/django | tests/admin_views/models.py | 87 | 24003 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import tempfile
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.e... | bsd-3-clause |
DonLakeFlyer/ardupilot | Tools/autotest/quadplane.py | 3 | 6289 | #!/usr/bin/env python
# Fly ArduPlane QuadPlane in SITL
from __future__ import print_function
import os
import pexpect
from pymavlink import mavutil
from common import AutoTest
from common import AutoTestTimeoutException
from pysim import util
from pysim import vehicleinfo
import operator
# get location of scripts... | gpl-3.0 |
Reflexe/doc_to_pdf | Windows/program/python-core-3.5.0/lib/distutils/msvc9compiler.py | 4 | 30611 | """distutils.msvc9compiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.
The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
"""
# Written by Perry Stoll
# hacked by Robin B... | mpl-2.0 |
uranusjr/django | django/db/migrations/loader.py | 4 | 14780 | import os
import sys
from importlib import import_module, reload
from django.apps import apps
from django.conf import settings
from django.db.migrations.graph import MigrationGraph
from django.db.migrations.recorder import MigrationRecorder
from .exceptions import (
AmbiguityError, BadMigrationError, Inconsistent... | bsd-3-clause |
QuantEcon/QuantEcon.py | quantecon/quad.py | 1 | 31180 | """
Defining various quadrature routines.
Based on the quadrature routines found in the CompEcon toolbox by
Miranda and Fackler.
References
----------
Miranda, Mario J, and Paul L Fackler. Applied Computational Economics
and Finance, MIT Press, 2002.
"""
import math
import numpy as np
import scipy.linalg as la
from ... | bsd-3-clause |
andykimpe/chromium-test-npapi | build/linux/unbundle/remove_bundled_libraries.py | 43 | 2549 | #!/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.
"""
Removes bundled libraries to make sure they are not used.
See README for more details.
"""
import optparse
import os.path
import... | bsd-3-clause |
mosbys/Clone | Cloning_v1/drive.py | 1 | 3838 | import argparse
import base64
import json
import numpy as np
import socketio
import eventlet
import eventlet.wsgi
import time
from PIL import Image
from PIL import ImageOps
from flask import Flask, render_template
from io import BytesIO
from random import randint
from keras.models import model_from_json
... | gpl-2.0 |
ifduyue/django | tests/generic_views/urls.py | 12 | 14868 | from django.conf.urls import url
from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView
from . import views
from .models import Book
urlpatterns = [
# TemplateV... | bsd-3-clause |
jaehong/Xmegaduino | arduino-core/src/processing/app/i18n/python/requests/packages/charade/euctwfreq.py | 3133 | 34872 | ######################## 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 |
carolineLe/miasm | miasm/core/locationdb.py | 3 | 18855 | import warnings
from builtins import int as int_types
from functools import reduce
from future.utils import viewitems, viewvalues
from miasm.core.utils import printable, force_bytes
from miasm.expression.expression import LocKey, ExprLoc
from miasm.expression.modint import moduint, modint
def is_int(a):
return ... | gpl-2.0 |
EarthLifeConsortium/elc_api | swagger_server/elc/geog.py | 1 | 2706 | """Functions related to geographic coordinates and paleo conversions."""
def get_geog(coords, age, options):
"""Parse paleo geography parameters."""
from ..elc import ages
modern = [x.strip() for x in coords.split(',')]
if '' in modern or len(modern) != 2:
msg = 'Second parameter not found in... | apache-2.0 |
codelion/pathgrind | fuzz/session.py | 4 | 1196 | # This file is part of Fuzzgrind.
# Copyright (C) 2009 Gabriel Campana
#
# This work is licensed under the terms of the GNU GPL, version 3.
# See the LICENSE file in the top-level directory.
import cPickle
import os
import zlib
def load(target):
'''
Restore a session given it's filename
@pa... | gpl-3.0 |
StKotok/Anki-Android | tools/lib/googlecode_upload.py | 304 | 8912 | #!/usr/bin/env python
#
# Copyright 2006, 2007 Google Inc. All Rights Reserved.
# Author: danderson@google.com (David Anderson)
#
# Script for uploading files to a Google Code project.
#
# This is intended to be both a useful script for people who want to
# streamline project uploads and a reference implementation for
... | gpl-3.0 |
hyqneuron/pylearn2-maxsom | pylearn2/sandbox/cuda_convnet/tests/test_response_norm.py | 44 | 2518 | import numpy
import theano
from nose.plugins.skip import SkipTest
from theano.tests.unittest_tools import verify_grad
try:
from pylearn2.sandbox.cuda_convnet.response_norm import (
CrossMapNorm,
CrossMapNormUndo
)
from theano.sandbox.cuda import CudaNdarrayType, CudaNdarray
from theano.... | bsd-3-clause |
Accelerite/cinder | cinder/scheduler/filters/capacity_filter.py | 3 | 2733 | # Copyright (c) 2012 Intel
# 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/licens... | apache-2.0 |
bisguzar/lolasistan | src/lang.py | 1 | 1635 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import config
connectFailed = {
'en': 'connect failed',
'tr': 'bağlantı başarısız'
}
connected = {
'en': '[System] Connected',
'tr': '[Sistem] Bağlanıldı'
}
authFailed = {
'en': 'auth failed',
'tr': 'giriş başarısız'
}
authSucces = {
'en': '[System] auth succesf... | gpl-3.0 |
UnderGreen/ansible-modules-extras | cloud/xenserver_facts.py | 63 | 4993 | #!/usr/bin/python -tt
# 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 distrib... | gpl-3.0 |
jmartinm/invenio | modules/bibformat/lib/elements/bfe_date.py | 25 | 1733 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## ... | gpl-2.0 |
zeeman/cyder | vendor-local/src/django-tastypie/tests/core/tests/api.py | 18 | 6366 | from django.contrib.auth.models import User
from django.http import HttpRequest
from django.test import TestCase
from tastypie.api import Api
from tastypie.exceptions import NotRegistered, BadRequest
from tastypie.resources import Resource, ModelResource
from core.models import Note
class NoteResource(ModelResource):... | bsd-3-clause |
aplicatii-romanesti/allinclusive-kodi-pi | .kodi/addons/plugin.video.salts/scrapers/watch8now_scraper.py | 1 | 3879 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
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 version.
T... | apache-2.0 |
Lessig2016/teams | markdown/extensions/def_list.py | 19 | 3713 | """
Definition List Extension for Python-Markdown
=============================================
Added parsing of Definition Lists to Python-Markdown.
A simple example:
Apple
: Pomaceous fruit of plants of the genus Malus in
the family Rosaceae.
: An american computer company.
Orange
... | agpl-3.0 |
DirectXMan12/nova-hacking | nova/api/openstack/compute/views/limits.py | 9 | 3501 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010-2011 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-2.0 |
jstasiak/travis-solo | setup.py | 1 | 2016 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
from setuptools import setup
from os.path import abspath, dirname, join
PROJECT_ROOT = abspath(dirname(__file__))
with open(join(PROJECT_ROOT, 'README.rst')) as f:
readme = f.read()
with open(join(PROJECT_ROOT, 'travis_solo.p... | mit |
aliyun/oss-ftp | python27/win32/Lib/site-packages/requests/packages/chardet/escsm.py | 2930 | 7839 | ######################## 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... | mit |
ubirch/aws-tools | virtual-env/lib/python2.7/site-packages/boto/ses/connection.py | 136 | 23685 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Harry Marr http://hmarr.com/
#
# 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
# wit... | apache-2.0 |
craigbruce/troposphere | tests/test_asg.py | 20 | 1318 | import unittest
from troposphere.autoscaling import AutoScalingGroup
class TestAutoScalingGroup(unittest.TestCase):
def test_exclusive(self):
group = AutoScalingGroup(
'mygroup',
InstanceId="i-1234",
LaunchConfigurationName="I'm a test",
MaxSize="1",
... | bsd-2-clause |
modulexcite/catapult | tracing/third_party/tvcm/third_party/rcssmin/_setup/py2/data.py | 42 | 5080 | # -*- coding: ascii -*-
#
# Copyright 2007, 2008, 2009, 2010, 2011
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.or... | bsd-3-clause |
SymbiFlow/edalize | edalize/yosys.py | 1 | 4456 | # Copyright edalize contributors
# Licensed under the 2-Clause BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-2-Clause
import logging
import os.path
from edalize.edatool import Edatool
logger = logging.getLogger(__name__)
class Yosys(Edatool):
argtypes = ['vlogdefine', 'vlogparam']
@... | bsd-2-clause |
panpap/LoadBalanced_zk | build/zookeeper-3.4.5/src/contrib/zkpython/src/test/connection_test.py | 30 | 4965 | #!/usr/bin/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
# "Lic... | apache-2.0 |
emedvedev/st2 | st2client/st2client/commands/trigger.py | 6 | 3575 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
kawamon/hue | desktop/libs/hadoop/setup.py | 31 | 1375 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
msduketown/SublimeKodi | libs-winlin/PIL/GifImagePlugin.py | 7 | 17025 | #
# The Python Imaging Library.
# $Id$
#
# GIF file handling
#
# History:
# 1995-09-01 fl Created
# 1996-12-14 fl Added interlace support
# 1996-12-30 fl Added animation support
# 1997-01-05 fl Added write support, fixed local colour map bug
# 1997-02-23 fl Make sure to load raster data in getdata()
# 1997-07... | gpl-3.0 |
Hpower96/Power | backend/thread.py | 1 | 1338 | #!/usr/bin/env python
from multiprocessing import Process,Lock
import sys,os,time
script = sys.argv[0]
list = [1000,1200,1400,1600,1800,10000]
Proce_num_list = []
def worker(num):
try:
#print p.name, p.pid, os.getppid()
if int(num) == int(list[-1]):
print 'Check out automatically exit... | gpl-3.0 |
jokey2k/sentry | src/sentry/lang/javascript/sourcemaps.py | 3 | 4341 | """
sentry.utils.sourcemaps
~~~~~~~~~~~~~~~~~~~~~~~
Originally based on https://github.com/martine/python-sourcemap
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import bisect
from collections impor... | bsd-3-clause |
yakky/django | tests/template_tests/filter_tests/test_ljust.py | 521 | 1081 | from django.template.defaultfilters import ljust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LjustTests(SimpleTestCase):
@setup({'ljust01': '{% autoescape off %}.{{ a|ljust:"5" }}. .{{ b|ljust:"5" }}.{% endautoescape %}'})
def test_lju... | bsd-3-clause |
johanvdw/niche_vlaanderen | niche_vlaanderen/spatial_context.py | 1 | 7681 | from affine import Affine
from textwrap import dedent
import warnings
class SpatialContextError(Exception):
"""
"""
class SpatialContext(object):
"""Stores the spatial context of the grids in niche
This class is based on the rasterio model of a grid.
Attributes
----------
transform: A... | mit |
upliftaero/mavlink | pymavlink/generator/lib/genxmlif/xmlifMinidom.py | 79 | 8493 | #
# genxmlif, Release 0.9.0
# file: xmlifMinidom.py
#
# XML interface class to Python standard minidom
#
# history:
# 2005-04-25 rl created
# 2007-07-02 rl complete re-design, internal wrapper
# for DOM trees and elements introduced
# 2008-07-01 rl Limited support of XInclude added
#
... | lgpl-3.0 |
n0trax/ansible | lib/ansible/utils/module_docs_fragments/netapp.py | 63 | 3287 | #
# (c) 2016, Sumit Kumar <sumit4@netapp.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 later versi... | gpl-3.0 |
pdf/beets | setup.py | 1 | 2918 | #!/usr/bin/env python
# This file is part of beets.
# Copyright 2013, Adrian Sampson.
#
# 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 th... | mit |
gymnasium/edx-platform | common/test/acceptance/pages/lms/login.py | 24 | 1476 | """
Login page for the LMS.
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from common.test.acceptance.pages.lms import BASE_URL
from common.test.acceptance.pages.lms.dashboard import DashboardPage
class LoginPage(PageObject):
"""
Login page for the LMS.
"""
... | agpl-3.0 |
Shanec132006/Lab4 | lib/markupsafe/__init__.py | 371 | 8205 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
from markupsafe._compat import text_type, string_types, int_types, \
unichr, PY2
__all__ = ['Markup', 'soft_unicod... | apache-2.0 |
fpy171/django | tests/runtests.py | 35 | 17165 | #!/usr/bin/env python
import atexit
import logging
import os
import shutil
import subprocess
import sys
import tempfile
import warnings
from argparse import ArgumentParser
import django
from django.apps import apps
from django.conf import settings
from django.db import connection, connections
from django.test import T... | bsd-3-clause |
uni-peter-zheng/virt-test | virttest/staging/utils_koji.py | 14 | 31220 | import HTMLParser
import ConfigParser
import os
import time
import logging
import urllib
from autotest.client import os_dep, utils
try:
import koji
KOJI_INSTALLED = True
except ImportError:
KOJI_INSTALLED = False
DEFAULT_KOJI_TAG = None
class KojiDownloadError(IOError):
def __init__(self, url, time... | gpl-2.0 |
dokterbob/django-shopkit | shopkit/core/utils/fields.py | 1 | 2814 | # Copyright (C) 2010-2011 Mathijs de Bruin <mathijs@mathijsfietst.nl>
#
# This file is part of django-shopkit.
#
# django-shopkit is free software; you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation; either version 2, or (at... | agpl-3.0 |
DataDog/integrations-core | nfsstat/datadog_checks/nfsstat/config_models/shared.py | 1 | 1331 | # (C) Datadog, Inc. 2021-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from __future__ import annotations
from typing import Optional
from pydantic import BaseModel, root_validator, validator
from datadog_checks.base.utils.functions import identity
from datadog_checks.base... | bsd-3-clause |
clchiou/garage | py/nanomsg/tests/test_errors.py | 1 | 1124 | import unittest
from nanomsg import errors
from nanomsg.constants import Error
class ErrorsTest(unittest.TestCase):
def test_errors(self):
varz = vars(errors)
lookup_table = varz['_ERRORS']
for error in Error:
self.assertIn(error.name, errors.__all__)
self.asse... | mit |
labordoc/labordoc-next | modules/bibworkflow/etc/workflows/test_workflow_2.py | 2 | 1339 | ## This file is part of Invenio.
## Copyright (C) 2012 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## Inv... | gpl-2.0 |
studio666/cjdns | node_build/dependencies/libuv/build/gyp/test/win/generator-output-different-drive/gyptest-generator-output-different-drive.py | 242 | 1463 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Test that the generator output can be written to a different drive on Windows.
"""
import os
import TestGyp
import string
import subpro... | gpl-3.0 |
martydill/url_shortener | code/venv/lib/python2.7/site-packages/sqlalchemy/__init__.py | 21 | 2111 | # sqlalchemy/__init__.py
# Copyright (C) 2005-2015 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 .sql import (
alias,
and_,
asc,
between,
bindparam,... | mit |
aspanta/bitcoin | contrib/linearize/linearize-data.py | 105 | 10081 | #!/usr/bin/env python3
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.