repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
tectronics/rebuildingtogethercaptain | appengine_django/serializer/python.py | 20 | 4799 | #!/usr/bin/python2.4
#
# Copyright 2008 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 or... | apache-2.0 |
dlacombejr/deepy | deepy/trainers/delayed_trainers.py | 5 | 2224 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging as loggers
import numpy as np
import theano
import theano.tensor as T
from theano.ifelse import ifelse
from deepy.utils import FLOATX
from trainers import NeuralTrainer
logging = loggers.getLogger(__name__)
THEANO_LINKER = 'cvm'
class DelayedBatchSGDTra... | mit |
tqchen/tvm | python/tvm/topi/testing/pool3d_python.py | 1 | 4672 | # 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 |
Daniel-CA/odoo | addons/l10n_ve/__openerp__.py | 260 | 2960 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
##############################################################################
# Modu... | agpl-3.0 |
deanhiller/databus | webapp/play1.3.x/python/Lib/codecs.py | 4 | 35789 | """ codecs -- Python Codec Registry, API and helpers.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import __builtin__, sys
### Registry and builtin stateless codec functions
try:
from _codecs import *
except ImportError, why:
... | mpl-2.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/tests/regressiontests/admin_views/tests.py | 10 | 165935 | # coding: utf-8
from __future__ import with_statement, absolute_import
import os
import re
import datetime
import urlparse
from django.conf import settings
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.files import temp as tempfile
from django.core.urlresolvers i... | mit |
anudeepsharma/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Url/setup.py | 28 | 1094 | # 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 |
praneethkumarpidugu/matchmaking | lib/python2.7/site-packages/cryptography/hazmat/bindings/openssl/evp.py | 7 | 10453 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
INCLUDES = """
#include <openssl/evp.h>
"""
TYPES = """
typedef ... EVP_... | mit |
bollu/sagenb | sagenb/testing/tests/test_worksheet_list.py | 10 | 4597 | # -*- coding: utf-8 -*-
"""
Tests to be run on the worksheet list.
AUTHORS:
- Tim Dumol (Oct. 28, 2009) -- inital version.
"""
import unittest
from sagenb.testing.notebook_test_case import NotebookTestCase
class TestWorksheetList(NotebookTestCase):
def setUp(self):
super(TestWorksheetList, self).setUp(... | gpl-3.0 |
Tejas-Subramanya/RYU_MEC | ryu/ofproto/ofproto_v1_0_parser.py | 1 | 129470 | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | apache-2.0 |
IronLanguages/ironpython3 | Src/StdLib/Lib/mimetypes.py | 1 | 20934 | """Guess the MIME type of a file.
This module defines two useful functions:
guess_type(url, strict=True) -- guess the MIME type and encoding of a URL.
guess_extension(type, strict=True) -- guess the extension for a given MIME type.
It also contains the following, for tuning the behavior:
Data:
knownfiles -- list ... | apache-2.0 |
Udala/docforever | pycoin/scripts/genwallet.py | 15 | 5914 | #!/usr/bin/env python
import argparse
import binascii
import json
import subprocess
import sys
from pycoin.key.BIP32Node import BIP32Node, PublicPrivateMismatchError
from pycoin.networks import full_network_name_for_netcode
def gpg_entropy():
output = subprocess.Popen(["gpg", "--gen-random", "2", "64"], stdout=s... | mit |
frappe/erpnext | erpnext/accounts/report/pos_register/pos_register.py | 2 | 6358 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, _dict
from erpnext import get_company_currency, get_default_company
from erpnext.accounts.report.sales_register.sales_regist... | gpl-3.0 |
waidyanatha/sambro-eden | static/scripts/tools/run_scheduler_tasks.py | 28 | 4978 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Call Web2py scheduler in app models context and run a specified task using
# its scheduled arguments. Two options for running this script:
#
# cd web2py
# python applications/<app>/static/scripts/tools/run_scheduler_tasks.py --app=<app> --task=<task>
# -- or --
# export... | mit |
chyeh727/django | django/template/loader.py | 196 | 6232 | import warnings
from django.utils.deprecation import RemovedInDjango110Warning
from . import engines
from .backends.django import DjangoTemplates
from .engine import (
_context_instance_undefined, _dictionary_undefined, _dirs_undefined,
)
from .exceptions import TemplateDoesNotExist
from .loaders import base
de... | bsd-3-clause |
jamesblunt/edx-platform | common/lib/xmodule/xmodule/capa_module.py | 37 | 9775 | """Implements basics of Capa, including class CapaModule."""
import json
import logging
import sys
import re
from lxml import etree
from pkg_resources import resource_string
import dogstats_wrapper as dog_stats_api
from .capa_base import CapaMixin, CapaFields, ComplexEncoder
from capa import responsetypes
from .progr... | agpl-3.0 |
infowantstobeseen/pyglet-darwincore | tools/license.py | 29 | 3729 | #!/usr/bin/python
# $Id:$
'''Rewrite the license header of source files.
Usage:
license.py file.py file.py dir/ dir/ ...
'''
import optparse
import os
import sys
license = '''# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary ... | bsd-3-clause |
codervince/flashingredlight | env/lib/python2.7/site-packages/setuptools/command/install_egg_info.py | 423 | 4001 | from distutils import log, dir_util
import os
from setuptools import Command
from setuptools.archive_util import unpack_archive
import pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_... | mit |
piffey/ansible | lib/ansible/modules/cloud/openstack/os_security_group.py | 15 | 3907 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.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
ANSI... | gpl-3.0 |
guewen/OpenUpgrade | addons/l10n_cl/__openerp__.py | 170 | 1759 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | agpl-3.0 |
coxm/djangocms-cascade | cmsplugin_cascade/bootstrap3/panel.py | 3 | 3709 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from html.parser import HTMLParser # py3
except ImportError:
from HTMLParser import HTMLParser # py2
from django.forms import widgets
from django.forms.widgets import RadioFieldRenderer
from django.utils.html import format_html, format_html_... | mit |
Kiiv/CouchPotatoServer | libs/requests/packages/urllib3/util.py | 108 | 21252 | # urllib3/util.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from base64 import b64encode
from binascii import hexlify, unhexlify
from collections import name... | gpl-3.0 |
tudorvio/nova | nova/network/model.py | 9 | 17215 | # Copyright 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.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
utn-frm-si/reservas | app_reservas/migrations/0012_clase_bedelia.py | 2 | 1319 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
"""
Creación de modelo Bedelia.
"""
dependencies = [
('app_reservas', '0011_redefinicion_archivo_ubicacion'),
]
operations = [
migr... | mit |
5nizza/party-elli | automata/automata_normalizer.py | 1 | 5663 | from itertools import combinations
from typing import Dict, Set, Tuple, Iterable
from typing import List
from helpers.label_helper import common_label, negate_label
from helpers.python_ext import lfilter
from interfaces.AHT_automaton import Transition as AHTTransition
from interfaces.automaton import Automaton as NBWA... | mit |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/lib2to3/tests/support.py | 120 | 1714 | """Support code for test_*.py files"""
# Author: Collin Winter
# Python imports
import unittest
import sys
import os
import os.path
import re
from textwrap import dedent
# Local imports
from lib2to3 import pytree, refactor
from lib2to3.pgen2 import driver
test_dir = os.path.dirname(__file__)
proj_dir = os.path.normp... | gpl-2.0 |
snahelou/awx | awx/main/scheduler/__init__.py | 1 | 25674 | # Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved
# Python
from datetime import datetime, timedelta
import logging
import uuid
from sets import Set
# Django
from django.conf import settings
from django.core.cache import cache
from django.db import transaction, connection, DatabaseError
from django.utils.transl... | apache-2.0 |
el-ethan/kivy | examples/tutorials/pong/steps/step5/main.py | 61 | 2055 | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ReferenceListProperty,\
ObjectProperty
from kivy.vector import Vector
from kivy.clock import Clock
class PongPaddle(Widget):
score = NumericProperty(0)
def bounce_ball(self, ball):
if self.col... | mit |
QianBIG/odoo | addons/account/report/account_partner_balance.py | 286 | 11049 | # -*- 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 |
Glorf/servo | tests/wpt/web-platform-tests/tools/html5lib/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 ... | mpl-2.0 |
illing2005/django-rest-auth | demo/demo/settings.py | 22 | 2913 | """
Django settings for demo project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impor... | mit |
bombilee/pywinauto | sandbox/WindowInformation.py | 16 | 1361 | import time
from pywinauto.controls import HwndWrapper
#from pywinauto.application import PrintControlIdentifiers
from pywinauto import win32functions, win32structures
import ctypes
#option to use WX if it is available
#option to output window declarations
# output escaping options
lastwindow = 0
while... | lgpl-2.1 |
devoid/nova | nova/crypto.py | 14 | 16165 | # 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 compliance with the License. You may obtain
# a ... | apache-2.0 |
Wingless-Archangel/bokken | lib/web/httpserver.py | 4 | 10262 | __all__ = ["runsimple"]
import sys, os
from SimpleHTTPServer import SimpleHTTPRequestHandler
import urllib
import posixpath
import webapi as web
import net
import utils
def runbasic(func, server_address=("0.0.0.0", 8080)):
"""
Runs a simple HTTP server hosting WSGI app `func`. The directory `static/`
is... | gpl-2.0 |
googleapis/python-aiplatform | google/cloud/aiplatform_v1/services/job_service/transports/base.py | 1 | 17587 | # -*- 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 |
jeasoft/odoo | comunity_modules/auditlog/migrations/8.0.1.0/pre-migration.py | 43 | 1185 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
LukeMurphey/splunk-google-drive | src/bin/google_drive_app/rest_handler.py | 1 | 10093 | """
This class makes creating a REST handler for Splunk easier.
The class will automatically call a function within the class based on the path and the method.
For example, if a GET call is made to the path "ping", then this class will call the function
get_ping().
Below is an example.
1) Create your REST handler c... | apache-2.0 |
mou4e/zirconium | third_party/jinja2/tests.py | 638 | 3444 | # -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from jinja2.runtime import Undefined
from jinja2._compat import text_type, string_types, mappi... | bsd-3-clause |
Frankenberrypi/Plotter | charts.py | 1 | 2282 | #!/usr/bin/python
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import pandas
# Start some empty lists
#timeBase = []
#timeL = []
#tempL = []
#humiL = []
# import the csv file
df = pandas.read_csv('data.csv')
print df.ix[:,1]
# Temperature plot
plt.plot(df.ix[:,0],df.ix[:,1])
#plt.plot(tim... | gpl-2.0 |
shssoichiro/servo | tests/wpt/web-platform-tests/tools/py/py/_io/saferepr.py | 273 | 2483 | import py
import sys
builtin_repr = repr
reprlib = py.builtin._tryimport('repr', 'reprlib')
class SafeRepr(reprlib.Repr):
""" subclass of repr.Repr that limits the resulting size of repr()
and includes information on exceptions raised during the call.
"""
def repr(self, x):
return self._c... | mpl-2.0 |
tiagochiavericosta/edx-platform | common/lib/capa/capa/tests/test_html_render.py | 92 | 9855 | import unittest
from lxml import etree
import os
import textwrap
import mock
from .response_xml_factory import StringResponseXMLFactory, CustomResponseXMLFactory
from . import test_capa_system, new_loncapa_problem
class CapaHtmlRenderTest(unittest.TestCase):
def setUp(self):
super(CapaHtmlRenderTest, s... | agpl-3.0 |
ar7z1/ansible | lib/ansible/modules/network/iosxr/iosxr_user.py | 29 | 28558 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# 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 |
lmprice/ansible | test/units/modules/network/nxos/test_nxos_ip_interface.py | 35 | 3374 | # (c) 2016 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
deyton/swift | docs/conf.py | 33 | 9543 | # -*- coding: utf-8 -*-
#
# Swift documentation build configuration file.
#
# 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 configuration values have a default; values that are commen... | apache-2.0 |
bigswitch/neutron | neutron/tests/functional/tests/common/exclusive_resources/test_port.py | 5 | 1101 | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
deandunbar/html2bwml | venv/lib/python2.7/site-packages/PIL/TarIO.py | 77 | 1223 | #
# The Python Imaging Library.
# $Id$
#
# read files from within a tar file
#
# History:
# 95-06-18 fl Created
# 96-05-28 fl Open files in binary mode
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1995-96.
#
# See the README file for information on usage and redistribution.
#
from PIL impor... | mit |
gtara/or-tools | examples/python/data/nonogram_regular/nonogram_soccer_player.py | 74 | 1556 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.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/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
suqinhuang/avocado-vt | scripts/parallel.py | 30 | 3396 | import os
import sys
class ParallelError(Exception):
def __init__(self, out, errors):
self.out = out
self.errors = errors
Exception.__init__(self, out)
class ParallelExecute(object):
def __init__(self, functions, max_simultaneous_procs=20):
"""
This takes in a dicti... | gpl-2.0 |
morissette/devopsdays-hackathon-2016 | venv/lib/python2.7/site-packages/botocore/exceptions.py | 1 | 11762 | # Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http... | gpl-3.0 |
wehkamp/ansible-modules-extras | messaging/rabbitmq_queue.py | 8 | 9531 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Manuel Sousa <manuel.sousa@gmail.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... | gpl-3.0 |
ychen820/microblog | y/google-cloud-sdk/.install/.backup/platform/gsutil/gslib/gcs_json_media.py | 2 | 20806 | # -*- coding: utf-8 -*-
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | bsd-3-clause |
benoit-pierre/python-xlib | Xlib/keysymdef/greek.py | 14 | 1840 | XK_Greek_ALPHAaccent = 0x7a1
XK_Greek_EPSILONaccent = 0x7a2
XK_Greek_ETAaccent = 0x7a3
XK_Greek_IOTAaccent = 0x7a4
XK_Greek_IOTAdiaeresis = 0x7a5
XK_Greek_OMICRONaccent = 0x7a7
XK_Greek_UPSILONaccent = 0x7a8
XK_Greek_UPSILONdieresis = 0x7a9
XK_Greek_OMEGAaccent = 0x7ab
XK_Greek_accentdieresis = 0x7ae
XK_Greek_horizbar ... | lgpl-2.1 |
mahabs/nitro | nssrc/com/citrix/netscaler/nitro/resource/config/appfw/appfwpolicy_lbvserver_binding.py | 1 | 6017 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
Rapier-Foundation/rapier-script | src/rapierlang/bindings/python/tests/cindex/util.py | 88 | 2293 | # This file provides common utility functions for the test suite.
from clang.cindex import Cursor
from clang.cindex import TranslationUnit
def get_tu(source, lang='c', all_warnings=False, flags=[]):
"""Obtain a translation unit from source and language.
By default, the translation unit is created from source... | mit |
uber/fbthrift | thrift/test/py/TestClient.py | 14 | 9061 | #!/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
# "L... | apache-2.0 |
nilbody/h2o-3 | h2o-py/tests/testdir_jira/pyunit_pubdev_2223.py | 1 | 1188 | from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
from tests import pyunit_utils
def pubdev_2223():
covtype = h2o.import_file(pyunit_utils.locate("smalldata/covtype/covtype.20k.data"))
covtype[54] = covtype[54].asfactor()
dlmodel = h2o.deeplearning(x=covtype[0:54],... | apache-2.0 |
jhawkesworth/ansible | lib/ansible/modules/network/fortios/fortios_vpn_ssl_web_portal.py | 22 | 48657 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
TheTypoMaster/chromium-crosswalk | tools/perf/measurements/image_decoding.py | 4 | 4010 | # Copyright 2012 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.
from telemetry.page import page_test
from telemetry.timeline import model
from telemetry.timeline import tracing_category_filter
from telemetry.timeline impo... | bsd-3-clause |
M-R-Houghton/euroscipy_2015 | bokeh/bokeh/server/websocket.py | 29 | 3271 | from __future__ import absolute_import
import logging
log = logging.getLogger(__name__)
import threading
import uuid
from tornado import websocket, ioloop
from tornado.web import Application
from tornado.httpserver import HTTPServer
from bokeh import protocol
from .wsmanager import WebSocketManager
from .zmqsub im... | mit |
shepdelacreme/ansible | lib/ansible/modules/cloud/vmware/vmware_host_ssl_facts.py | 56 | 4683 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.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 = {
'metadat... | gpl-3.0 |
cg31/glmark2 | waflib/Tools/d.py | 12 | 2140 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib import Utils,Task,Errors
from waflib.TaskGen import taskgen_method,feature,extension
from waflib.Tools import d_scan,d_config
from waflib.Tools.ccroot import link_... | gpl-3.0 |
CityPulse/CP_Resourcemanagement | virtualisation/misc/stats.py | 1 | 11883 | '''
Created on 19 Oct 2015
@author: thiggena
'''
from collections import OrderedDict
import csv
import datetime
from matplotlib import pyplot
from virtualisation.misc.buffer import NumericRingBuffer
from virtualisation.misc.jsonobject import JSONObject
PATH = "./"
BUFFER_SIZE = 1000
class Element(object):
def ... | mit |
arrabito/DIRAC | Core/DISET/MessageClient.py | 6 | 5147 | __RCSID__ = "$Id$"
import types
import random
from hashlib import md5
from DIRAC.Core.Utilities.ThreadSafe import Synchronizer
from DIRAC.Core.DISET.private.BaseClient import BaseClient
from DIRAC.Core.DISET.private.MessageBroker import getGlobalMessageBroker
from DIRAC.Core.Utilities.ReturnValues import S_OK, S_ERRO... | gpl-3.0 |
zakki/lsd_slam_windows | thirdparty/eigen-3.2.5/scripts/relicense.py | 315 | 2368 | # This file is part of Eigen, a lightweight C++ template library
# for linear algebra.
#
# Copyright (C) 2012 Keir Mierle <mierle@gmail.com>
#
# 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://m... | gpl-3.0 |
drusk/pml | test/test_pml/test_utils/test_distanceutils.py | 1 | 4213 | # Copyright (C) 2012 David Rusk
#
# 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 to use, copy, modify, merge, publish, distr... | mit |
dashmug/django-payments | payments/braintree/forms.py | 2 | 2401 | from __future__ import unicode_literals
import braintree
from ..forms import CreditCardPaymentFormWithName
class BraintreePaymentForm(CreditCardPaymentFormWithName):
transaction_id = None
def clean(self):
data = self.cleaned_data
if not self.errors and not self.payment.transaction_id:
... | bsd-3-clause |
ronfung/incubator-airflow | tests/contrib/operators/test_dataproc_operator.py | 2 | 3215 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
Ryati/satchmo | satchmo/apps/satchmo_ext/tieredpricing/models.py | 4 | 6825 | from decimal import Decimal
from django.contrib.auth.models import Group
from django.db import models
from django.utils.translation import ugettext_lazy as _
from product import signals
from product.models import Product
from product.prices import PriceAdjustment, PriceAdjustmentCalc
from satchmo_utils.fields import Cu... | bsd-3-clause |
openfun/edx-platform | lms/djangoapps/courseware/tests/factories.py | 91 | 4785 | # Factories are self documenting
# pylint: disable=missing-docstring
import json
from functools import partial
import factory
from factory.django import DjangoModelFactory
# Imported to re-export
# pylint: disable=unused-import
from student.tests.factories import UserFactory # Imported to re-export
# pylint: enable=u... | agpl-3.0 |
rhots/automation | bin/get_latest_rotation.py | 1 | 1911 | import os.path
from bs4 import BeautifulSoup
import requests
# Location of file to store latest known page number
LAST_KNOWN_PAGE_FILE = "/tmp/rotation_checker_latest"
# URL of forum thread where latest rotations are posted
ROTATION_FORUM_THREAD = "https://us.battle.net/forums/en/heroes/topic/17936383460"
def write_... | isc |
yawnosnorous/python-for-android | python-modules/twisted/twisted/python/lockfile.py | 61 | 6409 | # -*- test-case-name: twisted.test.test_lockfile -*-
# Copyright (c) 2005 Divmod, Inc.
# Copyright (c) 2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Filesystem-based interprocess mutex.
"""
__metaclass__ = type
import errno, os
from time import time as _uniquefloat
def unique():
return str(l... | apache-2.0 |
hackoon/cinnamon-screensaver-mplayer-fs | src/dbusdepot/uPowerClient.py | 2 | 6213 | #! /usr/bin/python3
from gi.repository import Gio, GObject, CScreensaver, GLib
from enum import IntEnum
from dbusdepot.baseClient import BaseClient
class DeviceType(IntEnum):
Unknown = 0
LinePower = 1
Battery = 2
Ups = 3
Monitor = 4
Mouse = 5
Keyboard = 6
Pda = 7
Phone = 8
class ... | gpl-2.0 |
yew1eb/flink | flink-libraries/flink-streaming-python/src/test/python/org/apache/flink/streaming/python/api/test_write_as_text.py | 4 | 2146 | ################################################################################
# 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... | apache-2.0 |
liuliwork/django | django/core/management/commands/squashmigrations.py | 132 | 7265 | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections, migrations
from django.db.migrations.loader import AmbiguityError, MigrationLoader
from django.db.migrations.migration import SwappableTuple
from django.db.migrations.o... | bsd-3-clause |
zhouzhenghui/python-for-android | python-build/python-libs/gdata/tests/atom_tests/core_test.py | 87 | 16382 | #!/usr/bin/env python
#
# Copyright (C) 2008 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 ... | apache-2.0 |
tiwillia/openshift-tools | ansible/roles/lib_gcloud/build/lib/forwarding_rule.py | 13 | 2158 | # pylint: skip-file
# pylint: disable=too-many-instance-attributes
class ForwardingRule(GCPResource):
'''Object to represent a gcp forwarding rule'''
resource_type = "compute.v1.forwardingRule"
# pylint: disable=too-many-arguments
def __init__(self,
rname,
project,
... | apache-2.0 |
imsparsh/python-for-android | python3-alpha/python3-src/Lib/idlelib/AutoCompleteWindow.py | 49 | 17201 | """
An auto-completion window for IDLE, used by the AutoComplete extension
"""
from tkinter import *
from idlelib.MultiCall import MC_SHIFT
from idlelib.AutoComplete import COMPLETE_FILES, COMPLETE_ATTRIBUTES
HIDE_VIRTUAL_EVENT_NAME = "<<autocompletewindow-hide>>"
HIDE_SEQUENCES = ("<FocusOut>", "<ButtonPress>")
KEYPR... | apache-2.0 |
puramshetty/sakai | reference/library/src/webapp/editor/FCKeditor/editor/filemanager/connectors/py/fckoutput.py | 131 | 4042 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | apache-2.0 |
mozilla/verbatim | local_apps/pootle_terminology/views.py | 5 | 7948 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Zuza Software Foundation
#
# This file is part of Pootle.
#
# 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 t... | gpl-2.0 |
simonwydooghe/ansible | lib/ansible/modules/network/ios/ios_facts.py | 6 | 7493 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
Bismarrck/tensorflow | tensorflow/contrib/opt/python/training/lazy_adam_optimizer_test.py | 20 | 15461 | # 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 |
openstack/tempest-lib | tempest_lib/api_schema/response/compute/v2_1/flavors_extra_specs.py | 35 | 1269 | # Copyright 2014 NEC Corporation. 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 |
coberger/DIRAC | WorkloadManagementSystem/Service/WMSUtilities.py | 1 | 6407 | ########################################################################
# $HeadURL$
########################################################################
""" A set of utilities used in the WMS services
"""
__RCSID__ = "$Id$"
from tempfile import mkdtemp
import shutil, os
from DIRAC.Core.Utilities.Grid import exe... | gpl-3.0 |
IONISx/edx-platform | lms/djangoapps/certificates/management/commands/ungenerated_certs.py | 73 | 7484 | """
Management command to find all students that need certificates for
courses that have finished, and put their cert requests on the queue.
"""
import logging
import datetime
from pytz import UTC
from django.core.management.base import BaseCommand, CommandError
from certificates.models import certificate_status_for_st... | agpl-3.0 |
devendermishrajio/nova | nova/tests/unit/image/test_s3.py | 69 | 11230 | # Copyright 2011 Isaku Yamahata
# 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 |
hassanabidpk/django | tests/gis_tests/test_geoip2.py | 73 | 5116 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import unittest
from unittest import skipUnless
from django.conf import settings
from django.contrib.gis.geoip2 import HAS_GEOIP2
from django.contrib.gis.geos import HAS_GEOS, GEOSGeometry
from django.utils import six
if HAS_GEOIP2:
from d... | bsd-3-clause |
EdDev/vdsm | lib/vdsm/network/netinfo/dhcp.py | 1 | 1308 | #
# Copyright 2015 Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the ho... | gpl-2.0 |
mirrorcoloured/slcypi | MA/Robot_V002l.py | 1 | 11863 | # Import statements
import sys
sys.path.append("/home/pi/Documents/Robots/slcypi/MA") ### ADD PATH
sys.path.append("/home/pi/Documents/Robots/slcypi/HAT_Python3") ### ADD PATH
import cv2
import numpy as np
import matplotlib.pyplot as plt
from Tank import Tank
from ImageAnalysis import ImageAnalysis
import picamera
impo... | mit |
2014c2g3/0623exam | static/Brython3.1.1-20150328-091302/Lib/getopt.py | 845 | 7488 | """Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by GNU software
may be used as ... | gpl-3.0 |
pchauncey/ansible | lib/ansible/modules/network/cumulus/_cl_license.py | 29 | 4409 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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_versio... | gpl-3.0 |
olivierverdier/sfepy | tests/test_elasticity_small_strain.py | 1 | 5441 | # 10.07.2007, c
# last revision: 25.03.2008
from sfepy import data_dir
filename_meshes = ['/meshes/3d/cube_medium_tetra.mesh',
'/meshes/3d/cube_medium_tetra.mesh',
'/meshes/3d/cube_medium_hexa.mesh']
filename_meshes = [data_dir + name for name in filename_meshes]
all_your_bases =... | bsd-3-clause |
byuphamerator/phamerator-dev | phamerator/pham.py | 1 | 19035 | #!/usr/bin/env python
import time, sys, random, colorsys, string, db_conf, logger
from phamerator_manage_db import *
#from db import *
class DuplicatePhamError(Exception):
def __init__(self,value):
self.parameter=value
def __str__(self):
print 'Duplicate Pham Error!'
return repr(self.parameter)
class... | gpl-2.0 |
ogenstad/ansible | lib/ansible/plugins/callback/actionable.py | 17 | 2579 | # (c) 2015, Andrew Gaffney <andrew@agaffney.org>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callba... | gpl-3.0 |
tedlaz/pyted | pyQtAccounting/qtreedata.py | 1 | 106364 | # -*- coding: utf-8 -*-
arr = []
def ins(l,per,xr=0,pi=0,yp=0,siz=6):
if len(l) > siz:
pass
else:
arr.append([l,per,xr,pi,yp])
ins("1",u"Πάγιο ενεργητικό" )
ins("10",u"Εδαφικές εκτάσεις" )
ins("10.00",u"Γήπεδα - Οικόπεδα" )
ins("10.01",u"Ορυχεία" )
ins("10.02",u"Μεταλλεία" )
ins("10.03",u"Λ... | gpl-3.0 |
fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractSystemtranslationHomeBlog.py | 1 | 3042 | def extractSystemtranslationHomeBlog(item):
'''
Parser for 'systemtranslation.home.blog'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
tagmap = [
('Summoner of Miracles', 'Summoner of Miracl... | bsd-3-clause |
ferabra/edx-platform | lms/djangoapps/teams/tests/factories.py | 8 | 1064 | """Factories for testing the Teams API."""
import pytz
from datetime import datetime
from uuid import uuid4
import factory
from factory.django import DjangoModelFactory
from ..models import CourseTeam, CourseTeamMembership
LAST_ACTIVITY_AT = datetime(2015, 8, 15, 0, 0, 0, tzinfo=pytz.utc)
class CourseTeamFactory... | agpl-3.0 |
KasperPRasmussen/bokeh | examples/models/population_server.py | 6 | 4313 | from __future__ import print_function
from math import pi
from bokeh.client import push_session
from bokeh.document import Document
from bokeh.models.glyphs import Line, Quad
from bokeh.models import (
Plot, ColumnDataSource, DataRange1d, FactorRange,
LinearAxis, CategoricalAxis, Grid, Legend,
SingleInter... | bsd-3-clause |
jayme-github/headphones | lib/cherrypy/lib/__init__.py | 67 | 2520 | """CherryPy Library"""
# Deprecated in CherryPy 3.2 -- remove in CherryPy 3.3
from cherrypy.lib.reprconf import unrepr, modules, attributes
def is_iterator(obj):
'''Returns a boolean indicating if the object provided implements
the iterator protocol (i.e. like a generator). This will return
false for ob... | gpl-3.0 |
jabdoa2/FreeCAD | src/Mod/Path/PathScripts/PathSelection.py | 15 | 8856 | # -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> *
#* ... | lgpl-2.1 |
Lyleo/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/python2/docutils/languages/en.py | 4 | 1806 | # $Id$
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated for each language: one in docutils/langua... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.