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 |
|---|---|---|---|---|---|
ambientsound/cash-generator | fabfile.py | 2 | 12492 |
import os
import sys
from functools import wraps
from getpass import getpass, getuser
from glob import glob
from contextlib import contextmanager
from fabric.api import env, cd, prefix, sudo as _sudo, run as _run, hide
from fabric.contrib.files import exists, upload_template
from fabric.colors import yellow, green, b... | bsd-2-clause |
astaninger/speakout | venv/lib/python3.6/site-packages/pip/_internal/pep425tags.py | 17 | 10798 | """Generate and work with PEP 425 Compatibility Tags."""
from __future__ import absolute_import
import distutils.util
import logging
import platform
import re
import sys
import sysconfig
import warnings
from collections import OrderedDict
import pip._internal.utils.glibc
logger = logging.getLogger(__name__)
_osx_ar... | mit |
takeshineshiro/keystone | keystone/catalog/core.py | 6 | 19451 | # Copyright 2012 OpenStack Foundation
# Copyright 2012 Canonical Ltd.
#
# 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 |
shiraco/techcircle_pepper_handson_b | pepper_google_stt/pepper_google_stt/lib/requests/api.py | 435 | 5415 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | mit |
kangxu/crosswalk-test-suite | embeddingapi/embedding-build-android-tests/gradle/crosswalk_local_gradle_build_all_app.py | 18 | 2264 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... | bsd-3-clause |
thouska/spotpy | tests/test_algorithms.py | 1 | 6542 | # -*- coding: utf-8 -*-
'''
Copyright (c) 2018 by Tobias Houska
This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY).
:author: Tobias Houska
'''
import unittest
try:
import spotpy
except ImportError:
import sys
sys.path.append(".")
import spotpy
#from spotpy.examples.tutorial... | mit |
xdevelsistemas/taiga-back-community | taiga/mdrender/extensions/emojify.py | 7 | 14160 | # -*- coding: utf-8 -*-
# Tested on Markdown 2.3.1
#
# Copyright (c) 2014, Esteban Castro Borsani
# Copyright (c) 2014, Jesús Espino García
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to... | agpl-3.0 |
mratsim/Arraymancer | tools/visualize_tensor_csv.py | 1 | 2700 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import sys
try:
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
except ImportError:
print("Failed to import matplotlib. This tool requires matplotlib.")
try:
import pandas as pd
except... | apache-2.0 |
kingvuplus/nn-gui | lib/python/Components/Converter/RdsInfo.py | 163 | 1649 | from enigma import iRdsDecoder, iPlayableService
from Components.Converter.Converter import Converter
from Components.Element import cached
class RdsInfo(Converter, object):
RASS_INTERACTIVE_AVAILABLE = 0
RTP_TEXT_CHANGED = 1
RADIO_TEXT_CHANGED = 2
def __init__(self, type):
Converter.__init__(self, type)
self... | gpl-2.0 |
manassolanki/erpnext | erpnext/hr/doctype/leave_encashment/test_leave_encashment.py | 1 | 1261 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
import unittest
# class TestLeaveEncashment(unittest.TestCase):
# def test_leave_balance_value_and_amount(self):
# employee = get_employee()
# leave... | gpl-3.0 |
citrix-openstack-build/nova | nova/api/openstack/compute/plugins/v3/certificates.py | 11 | 3609 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICE... | apache-2.0 |
tectronics/namebench | nb_third_party/dns/dnssec.py | 215 | 2144 | # Copyright (C) 2003-2007, 2009 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS... | apache-2.0 |
davelab6/pyfontaine | fontaine/charsets/noto_chars/notosansgurmukhi_regular.py | 2 | 8817 | # -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansGurmukhi-Regular'
native_name = ''
def glyphs(self):
chars = []
chars.append(0x0000) #uni0000 ????
chars.append(0x0A01) #uni0A01 GURMUKHI SIGN ADAK BINDI
chars.append(0x0A02) #uni0A02 GURMUKHI SIGN BI... | gpl-3.0 |
citrix-openstack-build/oslo.reports | oslo_reports/models/conf.py | 3 | 2348 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | apache-2.0 |
timheap/django-chainable-manager | chainablemanager/manager.py | 1 | 2019 | from functools import wraps
from django.db.models import Manager
from django.db.models.query import QuerySet
from django.utils.six import with_metaclass
def _make_proxy(name, fn):
@wraps(fn)
def _proxy(self, *args, **kwargs):
qs = self.get_queryset()
return getattr(qs, name)(*args, **kwargs)
... | unlicense |
niklaskorz/pyglet | contrib/wydget/wydget/clipboard/win32.py | 29 | 2036 | '''Clipboard implementation for OS X using Win32
Based on implementation from:
http://aspn.activestate.com/ASPN/Mail/Message/ctypes-users/1771866
'''
from ctypes import *
from pyglet.window.win32.constants import CF_TEXT, GHND
OpenClipboard = windll.user32.OpenClipboard
EmptyClipboard = windll.user32.EmptyClipboard
... | bsd-3-clause |
YarivCol/mbed-os | tools/host_tests/serial_nc_tx_auto.py | 74 | 2042 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
simphony/simphony-lammps-md | simlammps/io/lammps_simple_data_handler.py | 1 | 1822 | class LammpsSimpleDataHandler(object):
""" Class to handle what is parsed by LammpsDataFileParser
Class just stores the parsed data and provides methods to
retrieve this data
"""
def __init__(self):
self.begin()
def begin(self):
""" Handle begin of file parsing
... | bsd-2-clause |
behnam/python-unidecode | unidecode/x05e.py | 250 | 4668 | data = (
'Za ', # 0x00
'Bi ', # 0x01
'Shi ', # 0x02
'Bu ', # 0x03
'Ding ', # 0x04
'Shuai ', # 0x05
'Fan ', # 0x06
'Nie ', # 0x07
'Shi ', # 0x08
'Fen ', # 0x09
'Pa ', # 0x0a
'Zhi ', # 0x0b
'Xi ', # 0x0c
'Hu ', # 0x0d
'Dan ', # 0x0e
'Wei ', # 0x0f
'Zhang ', # 0x10
'Tang ... | gpl-2.0 |
ddki/my_study_project | language/python/frameworks/flask/venv/lib/python2.7/site-packages/pip/compat/dictconfig.py | 921 | 23096 | # This is a copy of the Python logging.config.dictconfig module,
# reproduced with permission. It is provided here for backwards
# compatibility for Python versions prior to 2.7.
#
# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# docu... | mit |
ashishtanwer/NFTable-porting-on-Android-Goldfish | tools/perf/util/setup.py | 2079 | 1438 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
macs03/demo-cms | cms/lib/python2.7/site-packages/django/contrib/auth/views.py | 100 | 11010 | from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, QueryDict
from django.template.response import TemplateResponse
from django.utils.http import base36_to_int, is_safe_url, urlsafe_base64_decode, urlsafe_base64_encode
from django.utils.translation... | mit |
RandallDW/Aruba_plugin | plugins/org.python.pydev.jython/Lib/distutils/tests/test_install.py | 30 | 8409 | """Tests for distutils.command.install."""
import os
import sys
import unittest
import site
from test.test_support import captured_stdout, run_unittest
from distutils import sysconfig
from distutils.command.install import install
from distutils.command import install as install_module
from distutils.command.build_ex... | epl-1.0 |
ppanczyk/ansible | lib/ansible/modules/network/aci/aci_filter_entry.py | 22 | 9322 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... | gpl-3.0 |
hamogu/ipythontools | setup.py | 1 | 1339 | import os
from setuptools import setup, find_packages
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.... | mit |
tillahoffmann/tensorflow | tensorflow/python/grappler/model_analyzer_test.py | 38 | 1968 | # 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 |
genevolv/dbrev | py/freevolv/apps/dbrev/punch_value.py | 1 | 3400 |
# Copyright (c) 2016, Genevolv LLC. All rights reserved.
''' Parse and process punch_values.'''
import logging
LOG = logging.getLogger(__name__)
import re
def parse_punch_value(naming, punch_value):
""" Parse the punch_value and return all of its parts so that they
can be used to fetch the appropriate... | bsd-2-clause |
AnySDK/Sample_CPP_Cocos2dx | cocos2d/tools/particle/convert_YCoordFlipped.py | 124 | 2224 | #!/usr/bin/python
#ConvertYCoordFlipped.py
import plistlib
import os.path
import argparse
import glob
import shutil
#keys in dictionary
metaDataKey = 'metaData'
yCoordFlippedConvertedKey = 'yCoordFlippedConverted'
yCoordFlippedKey = 'yCoordFlipped'
#check if the particle file has been converted
def checkFlippedConve... | mit |
2014c2g14/2014c2 | exts/wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/etree/ElementPath.py | 785 | 9477 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... | gpl-2.0 |
happyleavesaoc/home-assistant | tests/components/sensor/test_moon.py | 25 | 1684 | """The test for the moon sensor platform."""
import unittest
from datetime import datetime
from unittest.mock import patch
import homeassistant.util.dt as dt_util
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
DAY1 = datetime(2017, 1, 1, 1, tzinfo=dt_util.UTC)
DAY2 =... | apache-2.0 |
glaubitz/fs-uae-debian | launcher/OpenGL/raw/GL/VERSION/GL_3_1.py | 9 | 5911 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | gpl-2.0 |
moonbeamxp/ns-3 | src/visualizer/visualizer/plugins/show_last_packets.py | 182 | 9460 | import gobject
import gtk
import ns.core
import ns.network
import ns.visualizer
from visualizer.base import InformationWindow
from visualizer.higcontainer import HIGContainer
from kiwi.ui.objectlist import ObjectList, Column
class ShowLastPackets(InformationWindow):
class PacketList(gtk.ScrolledWindow):
... | gpl-2.0 |
tariqdaouda/Mariana | Mariana/initializations.py | 1 | 7961 | import Mariana.settings as MSET
import Mariana.useful as MUSE
import Mariana.abstraction as MABS
import Mariana.activations as MA
import lasagne.init as LI
import numpy
import theano
import theano.tensor as tt
__all__= [
"Initialization_ABC",
"Identity",
"HardSet",
"SingleValue",
"Normal",
"U... | apache-2.0 |
lordmuffin/aws-cfn-plex | functions/credstash/docutils/parsers/rst/languages/zh_tw.py | 128 | 5172 | # -*- coding: utf-8 -*-
# $Id: zh_tw.py 7119 2011-09-02 13:00:23Z milde $
# 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 f... | mit |
hubsaysnuaa/odoo | addons/gamification/models/__init__.py | 389 | 1038 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
gsalgado/pyethapp | pyethapp/tests/test_pow_service.py | 3 | 2433 | import pytest
from gevent.event import Event
from devp2p.app import BaseApp
from devp2p.service import BaseService
from ethereum import slogging
from ethereum.block import Block, BlockHeader
from ethereum.db import DB
from ethereum.transaction_queue import TransactionQueue
from pyethapp.pow_service import PoWService
... | mit |
JoshuaSkelly/Toast | examples/tile_map/tile_map_test.py | 2 | 1358 | import pygame
from pygame.locals import *
from toast.image_sheet import ImageSheet
from toast.tile_map import TileMap
# Define the origin
ORIGIN = (0,0)
# Set the screen size
SCREEN_SIZE = (256, 256)
# Setup pygame display
pygame.display.set_mode(SCREEN_SIZE)
# Get a surface the size of the window
screen = pygame.di... | mit |
scottferg/Profanity-Modifier | waveapi/module_test_runner.py | 5 | 1465 | #!/usr/bin/python2.4
#
# Copyright (C) 2009 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 l... | bsd-3-clause |
steveb/tablib | tablib/packages/openpyxl3/writer/drawings.py | 116 | 8268 | # coding=UTF-8
'''
Copyright (c) 2010 openpyxl
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, publ... | mit |
osynge/ceph-deploy | ceph_deploy/tests/parser/test_gatherkeys.py | 9 | 1058 | import pytest
from ceph_deploy.cli import get_parser
class TestParserGatherKeys(object):
def setup(self):
self.parser = get_parser()
def test_gather_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_args('gatherkeys --help'.split())
out, err = capsys.... | mit |
pbrod/numpy | numpy/core/tests/test_defchararray.py | 11 | 24583 |
import numpy as np
from numpy.core.multiarray import _vec_string
from numpy.testing import (
assert_, assert_equal, assert_array_equal, assert_raises,
assert_raises_regex
)
kw_unicode_true = {'unicode': True} # make 2to3 work properly
kw_unicode_false = {'unicode': False}
class TestBasic:
def test_f... | bsd-3-clause |
sarakha63/persomov | couchpotato/core/_base/updater/main.py | 5 | 15246 | import json
import os
import shutil
import tarfile
import time
import traceback
import zipfile
from datetime import datetime
from threading import RLock
import re
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent, fireEvent, fireEventAsync
from couchpotato.core.helpers.encoding import ... | gpl-3.0 |
networks-lab/metaknowledge | metaknowledge/__init__.py | 2 | 4409 | #Written by Reid McIlroy-Young for Dr. John McLevey, University of Waterloo 2016
"""_metaknowledge_ is a Python3 package that simplifies bibliometric and computational analysis of Web of Science data.
# Example
To load the data from files and make a network:
>>> import metaknowledge as mk
>>> RC = mk.RecordC... | gpl-2.0 |
drmrd/ansible | contrib/inventory/vmware_inventory.py | 9 | 28632 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C): 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Requirements
# - pyvmomi >= 6.0.0.2016.4
# TODO:
# * more jq examples
# * optional folder heriarchy
"""
$ jq '._meta.hostvars[].c... | gpl-3.0 |
kanasite/POSTMan-Chrome-Extension | tests/selenium/pmtests/postman_tests.py | 98 | 3507 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from colorama import init
from colorama import Fore, Back, Style
im... | apache-2.0 |
Spiderlover/Toontown | toontown/effects/FireworkGlobals.py | 6 | 1581 | FW_T = 0
FW_STYLE = 1
FW_COLOR1 = 2
FW_COLOR2 = 3
FW_AMP = 4
FW_POS_X = 5
FW_POS_Y = 6
FW_POS_Z = 7
CIRCLE = 0
ROCKET = 1
RING = 2
CIRCLELARGE = 3
CIRCLESMALL = 4
POP = 5
CIRCLESPRITE = 6
styleNames = ['CIRCLE',
'ROCKET',
'RING',
'CIRCLELARGE',
'CIRCLESMALL',
'POP',
'CIRCLESPRITE']
styleNamesShort = ['CIR',
'RKT... | mit |
robin900/sqlalchemy | test/sql/test_unicode.py | 28 | 6087 | # coding: utf-8
"""verrrrry basic unicode column name testing"""
from sqlalchemy import *
from sqlalchemy.testing import fixtures, engines, eq_
from sqlalchemy import testing
from sqlalchemy.testing.schema import Table, Column
from sqlalchemy.util import u, ue
class UnicodeSchemaTest(fixtures.TestBase):
__requir... | mit |
franekp/ankidict | ankidict/thirdparty/sqlalchemy/dialects/mysql/reflection.py | 21 | 15627 | # mysql/reflection.py
# Copyright (C) 2005-2016 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
import re
from ... import log, util
from ... import types as sqltypes
from .enum... | agpl-3.0 |
mkraemer67/pylearn2 | pylearn2/scripts/diff_monitor.py | 44 | 4476 | #!/usr/bin/env python
"""
usage:
diff_monitor.py model_1.pkl model_2.pkl
Prints any difference in which set of channels were monitored,
then prints any difference in the length of the records, then
prints the first record entry at which each channel differs and
by how much.
Does not report timing differences, since ... | bsd-3-clause |
YuJianrong/shadowsocks | shadowsocks/crypto/sodium.py | 1032 | 3778 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
sontek/rethinkdb | test/rql_test/connections/http_support/jinja2/testsuite/tests.py | 497 | 2865 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.tests
~~~~~~~~~~~~~~~~~~~~~~
Who tests the tests?
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Markup, Environment
env = Environm... | agpl-3.0 |
rosswhitfield/mantid | scripts/Muon/GUI/Common/corrections_tab_widget/corrections_model.py | 3 | 2115 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2021 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
from... | gpl-3.0 |
40223101/2015cd_midterm | static/Brython3.1.0-20150301-090019/Lib/decimal.py | 623 | 230510 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... | gpl-3.0 |
jorsea/odoo-addons | account_payment_direction/account_voucher.py | 2 | 1413 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import models, api, fields
class ac... | agpl-3.0 |
rcrowder/nupic | examples/prediction/experiments/dutyCycle/problem/description.py | 50 | 1547 | # ----------------------------------------------------------------------
# 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... | agpl-3.0 |
ioannistsanaktsidis/inspire-next | inspire/modules/workflows/upgrades/inspire_2014_11_13_update_actions.py | 2 | 1820 | # -*- coding: utf-8 -*-
##
## This file is part of INSPIRE.
## Copyright (C) 2014 CERN.
##
## INSPIRE 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) a... | gpl-2.0 |
dlopes-samba/dlopes-maps-sambatech | djangoappengine/main/main.py | 46 | 2345 | # Python 2.5 CGI handler
import os
import sys
from djangoappengine.main import application
from google.appengine.ext.webapp.util import run_wsgi_app
from djangoappengine.boot import setup_logging, env_ext
from django.conf import settings
path_backup = None
def real_main():
# Reset path and environment variables... | bsd-3-clause |
pacoqueen/ginn | extra/install/ipython2/ipython-5.10.0/IPython/core/crashhandler.py | 1 | 8236 | # encoding: utf-8
"""sys.excepthook for IPython itself, leaves a detailed report on disk.
Authors:
* Fernando Perez
* Brian E. Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2001-2007 Fernando Perez. <fperez@colorado.edu>
# Copyright (C) 2008-2011 The IP... | gpl-2.0 |
picobyte/photo-gallery | gallery/gallery/urls.py | 3 | 1152 | from django.conf.urls import url
import views
urlpatterns = [
url(r'^$',
views.index,
name='gallery_index'),
url(r'^album/(?P<slug>[A-Za-z0-9\-_]+)$',
views.gallery,
name='gallery_gallery'),
url(r'^g/(?P<slug>[A-Za-z0-9\-_]+)/(?P<gallery_pk>\d+)$',
views.gallery_o... | gpl-3.0 |
crepererum/invenio-search | invenio_search/user_settings.py | 18 | 2485 |
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012, 2013, 2014, 2015 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 you... | gpl-2.0 |
kratos7/hydra | src/main/python/hydra/kafkatest/batchsize_test.py | 4 | 2022 | __author__ = 'annyz'
from pprint import pprint, pformat # NOQA
import logging
from hydra.lib import util
from hydra.kafkatest.runtest import RunTestKAFKA
import os
l = util.createlogger('batchTest', logging.INFO)
class RunBatchTest(object):
def __init__(self, argv):
l.info(" Starting Kafka Batch Size T... | apache-2.0 |
Darkmer/masterchief | CourseBuilderenv/lib/python2.7/site-packages/pip/baseparser.py | 329 | 8162 | """Base option parser setup"""
import sys
import optparse
import os
import textwrap
from distutils.util import strtobool
from pip.backwardcompat import ConfigParser, string_types
from pip.locations import default_config_file
from pip.util import get_terminal_size, get_prog
from pip._vendor import pkg_resources
clas... | mit |
helldorado/ansible | test/units/module_utils/basic/test_exit_json.py | 123 | 5336 | # -*- coding: utf-8 -*-
# Copyright (c) 2015-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)
__metaclass__ = type
import json
import pytest
EMPTY_INVOCATION = {u'modul... | gpl-3.0 |
liamgh/liamgreenhughes-sl4a-tf101 | python/src/Parser/asdl.py | 33 | 11304 | """An implementation of the Zephyr Abstract Syntax Definition Language.
See http://asdl.sourceforge.net/ and
http://www.cs.princeton.edu/~danwang/Papers/dsl97/dsl97-abstract.html.
Only supports top level module decl, not view. I'm guessing that view
is intended to support the browser and I'm not interested in the
br... | apache-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/elasticsearch/connection/esthrift/ttypes.py | 22 | 12040 | #
# Autogenerated by Thrift Compiler (0.9.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:new_style=true,utf8strings=true
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from thrift.transport import TTransport
from thrift.protocol impo... | agpl-3.0 |
nitin-cherian/Webapps | SimpleIsBetterThanComplex.com/myproject/.env/lib/python3.5/site-packages/django/contrib/gis/forms/fields.py | 504 | 4316 | from __future__ import unicode_literals
from django import forms
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.utils.translation import ugettext_lazy as _
from .widgets import OpenLayersWidget
class GeometryField(forms.Field):
"""
This is the basic form field for a Geometry. A... | mit |
samliu/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/sub/non_callable_wsh.py | 499 | 1649 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
GeosoftInc/gxpy | geosoft/gxapi/GXARCPY.py | 1 | 2903 | ### extends 'class_empty.py'
### block ClassImports
# NOTICE: Do not edit anything here, it is generated code
from . import gxapi_cy
from geosoft.gxapi import GXContext, float_ref, int_ref, str_ref
### endblock ClassImports
### block Header
# NOTICE: The code generator will not replace the code in this block
### end... | bsd-2-clause |
zyga/urwid | urwid/widget.py | 6 | 60738 | #!/usr/bin/python
#
# Urwid basic widget classes
# Copyright (C) 2004-2012 Ian Ward
#
# 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, ... | lgpl-2.1 |
postlund/home-assistant | homeassistant/components/fronius/sensor.py | 3 | 9137 | """Support for Fronius devices."""
import copy
from datetime import timedelta
import logging
from pyfronius import Fronius
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_DEVICE,
CONF_MONITORED_CONDITIONS,
CONF_RESOURCE,
CONF_... | apache-2.0 |
arahuja/scikit-learn | examples/cluster/plot_color_quantization.py | 297 | 3443 | # -*- coding: utf-8 -*-
"""
==================================
Color Quantization using K-Means
==================================
Performs a pixel-wise Vector Quantization (VQ) of an image of the summer palace
(China), reducing the number of colors required to show the image from 96,615
unique colors to 64, while pre... | bsd-3-clause |
MinoochX/codina-mxk | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
rayrrr/luigi | luigi/tools/luigi_grep.py | 7 | 2863 | #!/usr/bin/env python
import argparse
import json
from collections import defaultdict
from luigi import six
from luigi.six.moves.urllib.request import urlopen
class LuigiGrep(object):
def __init__(self, host, port):
self._host = host
self._port = port
@property
def graph_url(self):
... | apache-2.0 |
837468220/python-for-android | python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/cryptomath.py | 172 | 11559 | """cryptomath module
This module has basic math/crypto code."""
import os
import math
import base64
import binascii
import sha
from compat import *
# **************************************************************************
# Load Optional Modules
# ****************************************************************... | apache-2.0 |
mtils/ems | ems/qt4/gui/widgets/bigcombo.py | 1 | 5843 | '''
Created on 28.06.2011
@author: michi
'''
from PyQt4.QtCore import QVariant, Qt, QStringList, SIGNAL, SLOT, QAbstractItemModel, QModelIndex, QAbstractListModel, QPoint, pyqtSignal
from PyQt4.QtGui import QComboBox, QTreeWidget, QTreeWidgetItem, QCompleter,\
QStringListModel, QListView
from ems.qt4.gui.itemdelegat... | mit |
JioEducation/edx-platform | common/djangoapps/student/tests/test_login_registration_forms.py | 13 | 8788 | """Tests for the login and registration form rendering. """
import urllib
import unittest
import ddt
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from util.testing import UrlResetMixin
from xmodule.modulestore.tests.factories import CourseFactory
from third_part... | agpl-3.0 |
graphql-python/graphene | graphene/utils/tests/test_module_loading.py | 1 | 1870 | from pytest import raises
from graphene import ObjectType, String
from ..module_loading import import_string, lazy_import
def test_import_string():
MyString = import_string("graphene.String")
assert MyString == String
MyObjectTypeMeta = import_string("graphene.ObjectType", "__doc__")
assert MyObjec... | mit |
ktt-ol/ktt-inventory-system | inventory/filters.py | 1 | 4042 | # Copyright (c) 2012-2013 Sebastian Reichel <sre@ring0.de>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND TH... | isc |
Frenzie/youtube-dl | youtube_dl/extractor/yam.py | 106 | 4211 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
float_or_none,
month_by_abbreviation,
ExtractorError,
get_element_by_attribute,
)
class YamIE(InfoExtractor):
IE_DESC = '蕃薯藤yam天空部落'
... | unlicense |
cledio66/pyglet | examples/timer.py | 31 | 3247 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are ... | bsd-3-clause |
timblechmann/supercollider | editors/sced/scedwin/py/LogPanel.py | 44 | 1478 | # sced (SuperCollider mode for gedit)
#
# Copyright 2012 Jakob Leben
# Copyright 2009 Artem Popov and other contributors (see AUTHORS)
#
# sced 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, ei... | gpl-3.0 |
petrus-v/odoo | addons/knowledge/__openerp__.py | 261 | 1738 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
40223136/w17test1 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/display.py | 603 | 25179 | #!/usr/bin/env python
'''Pygame module to control the display window and screen.
This module offers control over the pygame display. Pygame has a single display
Surface that is either contained in a window or runs full screen. Once you
create the display you treat it as a regular Surface. Changes are not
immediately ... | gpl-3.0 |
theflofly/tensorflow | tensorflow/contrib/framework/python/ops/ops_test.py | 118 | 2882 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
GbalsaC/bitnamiP | pavelib/assets.py | 40 | 7451 | """
Asset compilation and collection.
"""
from __future__ import print_function
import argparse
from paver import tasks
from paver.easy import sh, path, task, cmdopts, needs, consume_args, call_task, no_help
from watchdog.observers import Observer
from watchdog.events import PatternMatchingEventHandler
import glob
impo... | agpl-3.0 |
erkrishna9/odoo | addons/account_asset/wizard/account_asset_change_duration.py | 84 | 6005 | # -*- encoding: 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 t... | agpl-3.0 |
windskyer/k_cinder | paxes_cinder/k2aclient/k2asample/k2_xa.py | 1 | 4245 | #
#
# =================================================================
# =================================================================
from __future__ import print_function
import paxes_cinder.k2aclient.k2asample as k2asample
from paxes_cinder.k2aclient import client
import logging
import time
class K2_XA(obje... | apache-2.0 |
mancoast/CPythonPyc_test | fail/322_buffer_tests.py | 59 | 10581 | # Tests that work for both bytes and buffer objects.
# See PEP 3137.
import struct
import sys
class MixinBytesBufferCommonTests(object):
"""Tests that work for both bytes and buffer objects.
See PEP 3137.
"""
def marshal(self, x):
"""Convert x into the appropriate type for these tests."""
... | gpl-3.0 |
nuagenetworks/nuage-openstack-neutron | nuage_neutron/vsdclient/resources/netpartition.py | 1 | 10105 | # Copyright 2016 NOKIA
#
# 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... | apache-2.0 |
forblindreview/projectapta | client.py | 1 | 2422 | import threading,serial
import sys, time,pyinotify
import socket
import os, os.path
from daemon import Daemon
from pyinotify import WatchManager, Notifier, ProcessEvent, EventsCodes
import select
import os
import fcntl
import struct , Queue
import exceptions
import commands
import cPickle
import json
serverIP = 'local... | lgpl-3.0 |
Southpaw-TACTIC/Team | src/python/Tools/Scripts/nm2def.py | 12 | 2547 | #! /usr/bin/env python
"""nm2def.py
Helpers to extract symbols from Unix libs and auto-generate
Windows definition files from them. Depends on nm(1). Tested
on Linux and Solaris only (-p option to nm is for Solaris only).
By Marc-Andre Lemburg, Aug 1998.
Additional notes: the output of nm is supposed to loo... | epl-1.0 |
gboone/wedding.harmsboone.org | rsvp/migrations/0029_auto__add_field_event_date.py | 1 | 5398 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Event.date'
db.add_column(u'rsvp_event', 'date',
self.gf('django.db.mo... | mit |
pmghalvorsen/gramps_branch | gramps/gen/filters/rules/citation/__init__.py | 2 | 2224 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2011 Tim G L Lyons
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | gpl-2.0 |
polyval/CNC | flask/Lib/site-packages/sqlalchemy/connectors/mxodbc.py | 29 | 5348 | # connectors/mxodbc.py
# Copyright (C) 2005-2016 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
"""
Provide an SQLALchemy connector for the eGenix mxODBC commercial
Python ada... | apache-2.0 |
jkenlooper/chill | src/chill/test_loader.py | 1 | 2919 | import unittest
import tempfile
import os
from chill.app import multiple_directory_files_loader
class LoadSelectSql(unittest.TestCase):
def setUp(self):
self.dir_a = tempfile.mkdtemp()
self.dir_b = tempfile.mkdtemp()
def tearDown(self):
for tmp_dir in (self.dir_a, self.dir_b):
... | gpl-3.0 |
Spleen64/Sick-Beard | lib/hachoir_parser/audio/xm.py | 90 | 15154 | """
Parser of FastTrackerII Extended Module (XM) version 1.4
Documents:
- Modplug source code (file modplug/soundlib/Load_xm.cpp)
http://sourceforge.net/projects/modplug
- Dumb source code (files include/dumb.h and src/it/readxm.c
http://dumb.sf.net/
- Documents of "XM" format on Wotsit
http://www.wotsit.org
Au... | gpl-3.0 |
sileht/python-gnocchiclient | gnocchiclient/gendoc.py | 1 | 1461 | # -*- encoding: 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, so... | apache-2.0 |
LordDamionDevil/Lony | lib/nacl/bindings/crypto_hash.py | 17 | 1942 | # Copyright 2013 Donald Stufft and individual contributors
#
# 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... | gpl-3.0 |
sanghinitin/golismero | thirdparty_libs/requests/api.py | 637 | 4333 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
Retur... | gpl-2.0 |
jpautom/scikit-learn | sklearn/gaussian_process/gaussian_process.py | 17 | 34896 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
from __future__ import print_function
import numpy as np
from scipy import linalg, optimize
from ..base import BaseEstimator, RegressorMixin
from ..metrics... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.