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 |
|---|---|---|---|---|---|
JackKelly/neuralnilm_prototype | scripts/e127.py | 2 | 4534 | from __future__ import print_function, division
import matplotlib
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer
from lasagne.nonlinearities import sigmoid, rectify
from lasagne.objectives import c... | mit |
devaha/archagent | node_modules/grunt-plugin/node_modules/npm/node_modules/node-gyp/gyp/test/library/gyptest-static.py | 430 | 2241 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies simple build of a "Hello, world!" program with static libraries,
including verifying that libraries are rebuilt correctly when ... | gpl-2.0 |
badock/nova | nova/tests/api/ec2/test_apirequest.py | 11 | 3502 | # Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Unl... | apache-2.0 |
kingsfordgroup/armatus | scripts/HiCvis.py | 1 | 7843 | #!/usr/env python
import numpy as np
import seaborn as sb
import matplotlib.pyplot as plt
import argparse
import math
from scipy.sparse import coo_matrix
def plotall(datamat,domains1,domains2,bounds,legendname1,legendname2,outputname):
""" Show heatmap of Hi-C data along with any domain sets given
:param da... | bsd-2-clause |
xpansa/server-tools | users_ldap_populate/model/users_ldap.py | 25 | 3768 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2012 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 |
alexzoo/python | selenium_tests/env/lib/python3.6/site-packages/pip/_vendor/requests/compat.py | 327 | 1687 | # -*- coding: utf-8 -*-
"""
requests.compat
~~~~~~~~~~~~~~~
This module handles import compatibility issues between Python 2 and
Python 3.
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_p... | apache-2.0 |
xiangel/hue | apps/metastore/src/metastore/settings.py | 29 | 1051 | #!/usr/bin/env python
# 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 ma... | apache-2.0 |
dnozay/lettuce | tests/integration/lib/Django-1.3/django/contrib/messages/storage/session.py | 456 | 1213 | from django.contrib.messages.storage.base import BaseStorage
class SessionStorage(BaseStorage):
"""
Stores messages in the session (that is, django.contrib.sessions).
"""
session_key = '_messages'
def __init__(self, request, *args, **kwargs):
assert hasattr(request, 'session'), "The sessi... | gpl-3.0 |
sunyi00/jenkins-job-builder | jenkins_jobs/sphinx/yaml.py | 42 | 4925 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
#
# 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... | apache-2.0 |
teltek/edx-platform | common/test/acceptance/tests/studio/test_studio_course_team.py | 4 | 15689 | """
Acceptance tests for course in studio
"""
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage
from common.test.acceptance.pages.studio.index import DashboardPage
from common.test.acceptance.pages.studio.users import CourseTeamPage
from common.test.acceptance.tests.studio.base_studio_test import S... | agpl-3.0 |
Dhivyap/ansible | lib/ansible/plugins/httpapi/restconf.py | 17 | 2852 | # Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... | gpl-3.0 |
salaria/odoo | addons/hr_payroll/res_config.py | 441 | 1294 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
uclouvain/osis | education_group/tests/ddd/factories/domain/co_graduation.py | 1 | 1610 | ##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | agpl-3.0 |
notmyname/swift | swift/proxy/controllers/account.py | 4 | 8385 | # Copyright (c) 2010-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/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
noelevans/sandpit | interview_challenges/koans/answer_template.py | 1 | 4601 | '''
Python questions to work on. To invoke with pytest use
$ python3 answer_template.py
or
$ python3 -m pytest answer_template.py
'''
import pytest
def inclusive_range(n):
# For n = 5, return [1, 2, 3, 4, 5]
return [1, 2, 3, 4, 5]
def test_inclusive_range():
assert list(inclusive_range(5)) ==... | mit |
tmpgit/intellij-community | python/helpers/coverage/summary.py | 215 | 2972 | """Summary reporting"""
import sys
from coverage.report import Reporter
from coverage.results import Numbers
from coverage.misc import NotPython
class SummaryReporter(Reporter):
"""A reporter for writing the summary report."""
def __init__(self, coverage, config):
super(SummaryReporter, self).__ini... | apache-2.0 |
lemarcudal/sha_thedivision | test/Lib/encodings/uu_codec.py | 383 | 3738 | """ Python 'uu_codec' Codec - UU content transfer encoding
Unlike most of the other codecs which target Unicode, this codec
will return Python string objects for both encode and decode.
Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ell... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/252_test_profile.py | 19 | 3289 | """Test suite for the profile module."""
import profile, pstats, sys
# In order to have reproducible time, we simulate a timer in the global
# variable 'ticks', which represents simulated time in milliseconds.
# (We can't use a helper function increment the timer since it would be
# included in the profile and would ... | gpl-3.0 |
mahak/ansible | test/units/parsing/test_dataloader.py | 57 | 9955 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) an... | gpl-3.0 |
caveman-dick/ansible | lib/ansible/modules/network/f5/bigip_irule.py | 10 | 11191 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUM... | gpl-3.0 |
georgemarshall/django | tests/gis_tests/geogapp/tests.py | 42 | 6977 | """
Tests for geography support in PostGIS
"""
import os
from unittest import skipIf, skipUnless
from django.contrib.gis.db import models
from django.contrib.gis.db.models.functions import Area, Distance
from django.contrib.gis.measure import D
from django.db import NotSupportedError, connection
from django.db.models.... | bsd-3-clause |
LaMi-/pmatic | examples/lowlevel_api/print_available_api_methods.py | 2 | 1086 | #!/usr/bin/env python
# encoding: utf-8
#
# pmatic - Python API for Homematic. Easy to use.
# Copyright (C) 2016 Lars Michelsen <lm@larsmichelsen.com>
#
# 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 Found... | gpl-2.0 |
dkarakats/edx-platform | common/lib/xmodule/xmodule/crowdsource_hinter.py | 177 | 17456 | """
Adds crowdsourced hinting functionality to lon-capa numerical response problems.
Currently experimental - not for instructor use, yet.
"""
import logging
import json
import random
import copy
from pkg_resources import resource_string
from lxml import etree
from xmodule.x_module import XModule, STUDENT_VIEW
fro... | agpl-3.0 |
gromez/Sick-Beard | sickbeard/clients/generic.py | 30 | 7839 | import re
import time
from hashlib import sha1
import sickbeard
from sickbeard import logger
from sickbeard.exceptions import ex
from sickbeard.clients import http_error_code
from lib.bencode import bencode, bdecode
from lib import requests
class GenericClient(object):
def __init__(self, name, host=None, use... | gpl-3.0 |
mlavin/django-lastfm-auth | setup.py | 1 | 1157 | import os
from setuptools import setup, find_packages
def read_file(filename):
"""Read a file into a string"""
path = os.path.abspath(os.path.dirname(__file__))
filepath = os.path.join(path, filename)
try:
return open(filepath).read()
except IOError:
return ''
setup(
name='dj... | bsd-2-clause |
sinhrks/scikit-learn | sklearn/utils/tests/test_shortest_path.py | 303 | 2841 | from collections import defaultdict
import numpy as np
from numpy.testing import assert_array_almost_equal
from sklearn.utils.graph import (graph_shortest_path,
single_source_shortest_path_length)
def floyd_warshall_slow(graph, directed=False):
N = graph.shape[0]
#set nonzer... | bsd-3-clause |
varunarya10/nova_test_latest | nova/api/openstack/compute/contrib/server_start_stop.py | 51 | 3355 | # Copyright 2012 Midokura Japan K.K.
#
# 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... | apache-2.0 |
rshipp/python-appassure | appassure/core/IExchangeManagement.py | 1 | 2434 | """AppAssure 5 Core API"""
from appassure.api import AppAssureAPI
class IExchangeManagement(AppAssureAPI):
"""Full documentation online at
http://docs.appassure.com/display/AA50D/IExchangeManagement
"""
def verifyCredentials(self, data, agentId):
"""Verifies credentials to Exchange instance. ... | bsd-3-clause |
jonasjberg/autonameow | autonameow/vendor/unidecode/x0c1.py | 253 | 4765 | data = (
'syae', # 0x00
'syaeg', # 0x01
'syaegg', # 0x02
'syaegs', # 0x03
'syaen', # 0x04
'syaenj', # 0x05
'syaenh', # 0x06
'syaed', # 0x07
'syael', # 0x08
'syaelg', # 0x09
'syaelm', # 0x0a
'syaelb', # 0x0b
'syaels', # 0x0c
'syaelt', # 0x0d
'syaelp', # 0x0e
'syaelh', # 0x... | gpl-2.0 |
40223145c2g18/c2g18 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/xml/dom/expatbuilder.py | 733 | 35733 | """Facility to use the Expat parser to load a minidom instance
from a string or file.
This avoids all the overhead of SAX and pulldom to gain performance.
"""
# Warning!
#
# This module is tightly bound to the implementation details of the
# minidom DOM and can't be used with other DOM implementations. This
# is due... | gpl-2.0 |
ryandub/skew | skew/resources/aws/elasticache.py | 3 | 1868 | # Copyright (c) 2014 Scopely, Inc.
# Copyright (c) 2015 Mitch Garnaat
#
# 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://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanyin... | apache-2.0 |
waytai/odoo | addons/sale_analytic_plans/__openerp__.py | 262 | 1634 | # -*- 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 |
Juniper/contrail-dev-neutron | neutron/tests/unit/mlnx/test_defaults.py | 25 | 1508 | # Copyright (c) 2013 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/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | apache-2.0 |
underyx/ansible-modules-core | cloud/amazon/ec2_facts.py | 46 | 6431 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... | gpl-3.0 |
madratman/nuklei-code | contrib/scons/scons-local-2.0.1/SCons/compat/_scons_subprocess.py | 183 | 44500 | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# This module should remain compatible with Python 2.2, see PEP 291.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://ww... | gpl-3.0 |
syphar/django | tests/template_tests/filter_tests/test_date.py | 94 | 3011 | from datetime import datetime, time
from django.template.defaultfilters import date
from django.test import SimpleTestCase, override_settings
from django.utils import timezone, translation
from ..utils import setup
from .timezone_utils import TimezoneTestCase
class DateTests(TimezoneTestCase):
@setup({'date01'... | bsd-3-clause |
laperry1/android_external_chromium_org | build/android/pylib/flag_changer.py | 46 | 5712 | # Copyright (c) 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.
import logging
import pylib.android_commands
import pylib.device.device_utils
class FlagChanger(object):
"""Changes the flags Chrome runs with.
T... | bsd-3-clause |
traveloka/ansible | contrib/inventory/consul_io.py | 7 | 17349 | #!/usr/bin/env python
#
# (c) 2015, Steve Gargan <steve.gargan@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 License, or
# (a... | gpl-3.0 |
acsone/knowledge | document_reindex/models/__init__.py | 12 | 1051 | # -*- 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 th... | agpl-3.0 |
slisson/intellij-community | python/helpers/pydev/_pydev_getopt.py | 108 | 4458 |
#=======================================================================================================================
# getopt code copied since gnu_getopt is not available on jython 2.1
#=======================================================================================================================
class Ge... | apache-2.0 |
uiri/pxqz | venv/lib/python2.7/site-packages/django/utils/http.py | 26 | 7878 | import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.utils import formatdate
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\... | gpl-3.0 |
Jidgdoi/PacmanPy | src/Main.py | 1 | 4832 | # -*- coding:utf-8 -*-
# Cyril Fournier
# 20/01/2016
import os,sys
import wx
import threading
import Queue
import time
import UtilsAndGlobal as UAG
from Cell import Cell
from Map import Map
from UI import UI, UICatcher
from GhostAI import GhostAI
from Graphical import Graphical
from Pacman import Pacman, PacmanGame
... | gpl-2.0 |
hivam/doctor_multiroom | models/doctor_room.py | 1 | 2194 | # -*- 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 Affero Gene... | agpl-3.0 |
xyuanmu/XX-Net | python3.8.2/Lib/symtable.py | 10 | 7568 | """Interface to the compiler's internal symbol tables"""
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_NONLOCAL, DEF_LOCAL, DEF_PARAM,
DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE,
LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
import weakref
__all__ = ["symtable", "SymbolTa... | bsd-2-clause |
Cyberbio-Lab/bcbio-nextgen | bcbio/variation/gatk.py | 2 | 5183 | """GATK variant calling -- HaplotypeCaller and UnifiedGenotyper.
"""
from distutils.version import LooseVersion
import toolz as tz
from bcbio import bam, broad, utils
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import config_utils
from bcbio.pipeline.shared import subset_variant_reg... | mit |
lugia/Python-MyWalk | base/utils.py | 1 | 1085 | from django.http import HttpResponse
import simplejson as json
def idx(a, id, default = None):
if a.has_key(id):
return a[id]
return default
def printItems(dictObj, indent):
ret = ""
ret = ret + ' '*indent + '<ul>\n'
for k,v in dictObj.iteritems():
if isinstance(v, dict):
... | apache-2.0 |
fbradyirl/home-assistant | tests/components/history_graph/test_init.py | 4 | 1171 | """The tests the Graph component."""
import unittest
from homeassistant.setup import setup_component
from tests.common import init_recorder_component, get_test_home_assistant
class TestGraph(unittest.TestCase):
"""Test the Google component."""
def setUp(self): # pylint: disable=invalid-name
"""Set... | apache-2.0 |
jordanemedlock/psychtruths | temboo/core/Library/Facebook/Actions/Fitness/Bikes/ReadBikes.py | 5 | 5217 | # -*- coding: utf-8 -*-
###############################################################################
#
# ReadBikes
# Retrieves one or more bike actions.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file e... | apache-2.0 |
JConwayAWT/PGSS14CC | lib/python/multimetallics/ase/gui/ag.py | 2 | 5192 | #!/usr/bin/env python
# Copyright 2008, 2009
# CAMd (see accompanying license files for details).
import os
from optparse import OptionParser, SUPPRESS_HELP
import ase.gui.i18n
from gettext import gettext as _
# Grrr, older versions (pre-python2.7) of optparse have a bug
# which prevents non-ascii descriptions. Ho... | gpl-2.0 |
deployed/django | tests/dates/tests.py | 32 | 2509 | from __future__ import unicode_literals
import datetime
from django.test import TestCase
from .models import Article, Comment, Category
class DatesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.objects.create(
title="First one",
pub_date=datetime.date(2005,... | bsd-3-clause |
sdague/home-assistant | tests/components/homekit_controller/test_sensor.py | 14 | 6430 | """Basic checks for HomeKit sensor."""
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
from homeassistant.const import (
DEVICE_CLASS_BATTERY,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_TEMPERATURE,
)
from tests.c... | apache-2.0 |
Glottotopia/aagd | moin/local/moin/MoinMoin/support/pygments/styles/vs.py | 3 | 1111 | # -*- coding: utf-8 -*-
"""
pygments.styles.vs
~~~~~~~~~~~~~~~~~~
Simple style with MS Visual Studio colors.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywo... | mit |
huntxu/fuel-web | nailgun/nailgun/rpc/threaded.py | 9 | 2323 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requi... | apache-2.0 |
sociateru/fabtools | fabtools/tests/functional_tests/test_nodejs.py | 4 | 3575 | import functools
try:
import json
except ImportError:
import simplejson as json
import pytest
from fabric.api import cd, run
from fabtools.files import is_file
from fabtools.require import directory as require_directory
from fabtools.require import file as require_file
pytestmark = pytest.mark.network
@p... | bsd-2-clause |
vFense/vFenseAgent-nix | agent/deps/rpm6/Python-2.7.5/lib/python2.7/ctypes/test/test_bitfields.py | 44 | 9293 | from ctypes import *
import unittest
import os
import ctypes
import _ctypes_test
class BITS(Structure):
_fields_ = [("A", c_int, 1),
("B", c_int, 2),
("C", c_int, 3),
("D", c_int, 4),
("E", c_int, 5),
("F", c_int, 6),
... | lgpl-3.0 |
RaumZeit/gdesklets-core | utils/dialog.py | 2 | 6662 | import gtk
import gobject
import sys
import traceback
from cStringIO import StringIO
from HIGDialog import HIGDialog
from LogView import LogView
# define some Dialog icons
_ERROR = gtk.STOCK_DIALOG_ERROR
_INFO = gtk.STOCK_DIALOG_INFO
_QUESTION = gtk.STOCK_DIALOG_QUESTION
_WARNING = gtk.STOCK_DIALOG_WARNING
# we onl... | gpl-2.0 |
leorochael/odoo | openerp/addons/base/__init__.py | 379 | 1134 | # -*- 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... | agpl-3.0 |
dungtn/babi_dialog_system | data/data_utils.py | 1 | 8344 | DATA_SOURCE = 'data/dialog-bAbI-tasks/dialog-babi-candidates.txt'
DATA_SOURCE_TASK6 = 'data/dialog-bAbI-tasks/dialog-babi-task6-dstc2-candidates.txt'
DATA_DIR = 'dialog-bAbI-tasks/dialog-babi-candidates.txt'
STOP_WORDS=set(["a","an","the"])
import re
import os
from itertools import chain
from six.moves import range,... | gpl-3.0 |
PeRDy/django-audit-tools | docs/source/conf.py | 1 | 9176 | # -*- coding: utf-8 -*-
#
# EbAudit documentation build configuration file, created by
# sphinx-quickstart on Thu Aug 7 13:00:34 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | gpl-2.0 |
eBay/restcommander | play-1.2.4/python/Lib/socket.py | 9 | 17974 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | apache-2.0 |
doduytrung/odoo-8.0 | addons/l10n_es/__openerp__.py | 314 | 2772 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# Copy... | agpl-3.0 |
sparkslabs/kamaelia_ | Code/Python/Kamaelia/Kamaelia/Device/DVB/EIT.py | 3 | 14456 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License,... | apache-2.0 |
cysuncn/python | spark/crm/PROC_F_CI_CUST_SIGN.py | 1 | 49022 | #coding=UTF-8
from pyspark import SparkContext, SparkConf, SQLContext, Row, HiveContext
from pyspark.sql.types import *
from datetime import date, datetime, timedelta
import sys, re, os
st = datetime.now()
conf = SparkConf().setAppName('PROC_F_CI_CUST_SIGN').setMaster(sys.argv[2])
sc = SparkContext(conf = conf)
sc.set... | gpl-3.0 |
GeoscienceAustralia/geodesy-domain-model | aws/amazonia/test/sys_tests/test_sys_elb.py | 2 | 2306 | #!/usr/bin/python3
from amazonia.classes.elb import Elb
from amazonia.classes.elb_config import ElbConfig, ElbListenersConfig
from network_setup import get_network_config
def main():
network_config, template = get_network_config()
elb_listeners_config = [
ElbListenersConfig(
instance_por... | bsd-3-clause |
mushtaqak/edx-platform | openedx/core/djangoapps/profile_images/tests/test_images.py | 111 | 7026 | """
Test cases for image processing functions in the profile image package.
"""
from contextlib import closing
from itertools import product
import os
from tempfile import NamedTemporaryFile
import unittest
from django.conf import settings
from django.core.files.uploadedfile import UploadedFile
from django.test import... | agpl-3.0 |
evilpie/servo | python/mach/mach/test/test_entry_point.py | 121 | 1886 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals
import imp
import os
import sys
from mach.base import MachError
from mach.test.... | mpl-2.0 |
alphapapa/youtube-dl | youtube_dl/extractor/yourupload.py | 142 | 1537 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class YourUploadIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?
(?:yourupload\.com/watch|
embed\.yourupload\.com|
embed\.yucache\.net
)/(?P<id>[A-Za-z0-9]+)
'''
... | unlicense |
andreadelprete/pinocchio_inv_dyn | python/pinocchio_inv_dyn/multi_contact/bezier/bezier_0_step_capturability.py | 1 | 21165 | # -*- coding: utf-8 -*-
"""
Created on Thu Sep 1 16:54:39 2016
@author: stonneau
"""
from pinocchio_inv_dyn.optimization.solver_LP_abstract import LP_status, LP_status_string
from pinocchio_inv_dyn.multi_contact.stability_criterion import Bunch
from pinocchio_inv_dyn.optimization.solver_LP_abstract import ... | gpl-2.0 |
Diti24/python-ivi | ivi/chroma/chroma62012p8060.py | 1 | 1825 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-2016 Alex Forencich
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... | mit |
iamthebest77/openx | enabler_connection.py | 4 | 2500 | import socket
import threading
import json
class EnablerConnection():
def __init__(self):
self.connections = []
self.stopped = False
self.enabler_listening_port = 50001
self.local_ip = socket.gethostbyname(socket.gethostname())
t = threading.Thread(target=self.listen_loop,... | bsd-3-clause |
dimagi/rapidsms-core | lib/rapidsms/parsers/keyworder.py | 2 | 3099 | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import re
class Keyworder(object):
TOKEN_MAP = [
("slug", "([a-z0-9\-]+)"),
("letters", "([a-z]+)"),
("numbers", "(\d+)"),
("whatever", "(.+)")]
def __init__(self):
self.regexen = []
self.prefix = ""
... | lgpl-3.0 |
zmeda/web-summit-2015-recap-zalando | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 388 | 47235 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | mit |
OaklandPeters/recursor | recursor/devspace/predicate_idea.py | 1 | 2552 | """
Desired syntax:
gaurdian = MaxDepth(10) & HasAttr('__dict__')
if gaurdian(current, path):
# ....
walker(obj, gaurd=MaxDepth(10) & HasAttr('__dict__'))
@note: I put example wrapper decorators at the bottom.
@todo: Come up with simple-ish logical structure alternative to the wrapper decora... | mit |
kcompher/topik | topik/models.py | 1 | 2641 | from __future__ import absolute_import
import logging
import gensim
import pandas as pd
# imports used only for doctests
from topik.readers import read_input
from topik.tests import test_data_path
from topik.preprocessing import preprocess
class LDA(object):
"""A high interface for an LDA (Latent Dirichlet All... | bsd-3-clause |
B-MOOC/edx-platform | lms/djangoapps/bulk_email/migrations/0001_initial.py | 182 | 6854 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CourseEmail'
db.create_table('bulk_email_courseemail', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True... | agpl-3.0 |
eepalms/gem5-newcache | tests/configs/tgen-simple-mem.py | 4 | 3305 | # Copyright (c) 2012 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality ... | bsd-3-clause |
yqm/sl4a | python/src/Lib/idlelib/StackViewer.py | 69 | 3841 | import os
import sys
import linecache
from TreeWidget import TreeNode, TreeItem, ScrolledCanvas
from ObjectBrowser import ObjectTreeItem, make_objecttreeitem
def StackBrowser(root, flist=None, tb=None, top=None):
if top is None:
from Tkinter import Toplevel
top = Toplevel(root)
sc = ScrolledCa... | apache-2.0 |
candrews/portage | pym/portage/sync/old_tree_timestamp.py | 9 | 2161 | # Copyright 2010-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from __future__ import division
import locale
import logging
import time
from portage import os, _unicode_decode
from portage.exception import PortageException
from portage.localization import _
from portage.ou... | gpl-2.0 |
HLFH/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/canal13cl.py | 154 | 1912 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class Canal13clIE(InfoExtractor):
_VALID_URL = r'^http://(?:www\.)?13\.cl/(?:[^/?#]+/)*(?P<id>[^/?#]+)'
_TEST = {
'url': 'http://www.13.cl/t13/nacional/el-circulo-de-hierro-de-michelle-bachelet-en-su-... | gpl-3.0 |
Jeff-Tian/mybnb | Python27/Lib/ctypes/test/test_structures.py | 1 | 16610 | import unittest
from ctypes import *
from ctypes.test import need_symbol
from struct import calcsize
import _testcapi
class SubclassesTest(unittest.TestCase):
def test_subclass(self):
class X(Structure):
_fields_ = [("a", c_int)]
class Y(X):
_fields_ = [("b", c_... | apache-2.0 |
saurabh6790/OFF-RISAPP | stock/doctype/stock_reconciliation/test_stock_reconciliation.py | 30 | 9757 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
# ERPNext - web based ERP (http://erpnext.com)
# For license information, please see license.txt
from __future__ import unicode_literals
import webnotes, unittest
from webnotes.utils impor... | agpl-3.0 |
huashiyiqike/NETLAB | layernet/io/iamdb/convert_iamdb.py | 2 | 2361 | import os
from sets import Set
from get_lineStroke import getLineStroke
from get_targetStrings import getTargetString
from get_xmlFileName import getXmlNames
import netcdf_helpers
import numpy as np
targetStrings = []
wordTargetStrings = []
charSet = Set()
inputs = []
labels = []
seqDims = []
seqLengths = []
seqTag... | apache-2.0 |
neilLasrado/erpnext | erpnext/patches/v5_4/notify_system_managers_regarding_wrong_tax_calculation.py | 29 | 1452 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import print_function, unicode_literals
import frappe
from frappe.email import sendmail_to_system_managers
from frappe.utils import get_link_to_form
def execute():
wrong_r... | gpl-3.0 |
sangwook236/general-development-and-testing | sw_dev/python/rnd/test/image_processing/skimage/skimage_transform.py | 2 | 1365 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import numpy as np
import matplotlib.pyplot as plt
from skimage.transform import PiecewiseAffineTransform, warp
from skimage import data
#---------------------------------------------------------------------
# REF [site] >> http://scikit-image.org/docs/stable/auto_exampl... | gpl-2.0 |
fritsvanveen/QGIS | python/pyplugin_installer/qgsplugininstallerinstallingdialog.py | 5 | 6317 | # -*- coding:utf-8 -*-
"""
/***************************************************************************
qgsplugininstallerinstallingdialog.py
Plugin Installer module
-------------------
Date : June 2013
Copyright ... | gpl-2.0 |
carvalhodj/qunews | raspberry/slideshow.py | 1 | 1193 | from itertools import cycle
from PIL import Image
from PIL import ImageTk
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
class App(tk.Tk):
def __init__(self, image_files, x, y, delay):
tk.Tk.__init__(self)
self.geometry('+{}+{}'.format(x, y))... | apache-2.0 |
garhivelg/execom | migrations/versions/9474324542c6_cases.py | 2 | 1689 | """cases
Revision ID: 9474324542c6
Revises:
Create Date: 2017-06-08 09:02:37.384472
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9474324542c6'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by... | gpl-3.0 |
40223240/cadb_g3_0420 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_setups.py | 791 | 16440 | import io
import sys
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=io.StringIO())
def runTests(self, *cases... | gpl-3.0 |
brunogamacatao/portalsaladeaula | simplejson/ordered_dict.py | 1039 | 3370 | """Drop-in replacement for collections.OrderedDict by Raymond Hettinger
http://code.activestate.com/recipes/576693/
"""
from UserDict import DictMixin
# Modified from original to support Python 2.4, see
# http://code.google.com/p/simplejson/issues/detail?id=53
try:
all
except NameError:
def all(seq):
... | bsd-3-clause |
asimshankar/tensorflow | tensorflow/python/eager/execution_callbacks.py | 3 | 12617 | # 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 |
BeenzSyed/tempest | tempest/services/compute/v3/xml/tenant_usages_client.py | 1 | 1926 | # Copyright 2013 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 |
TheTimmy/spack | var/spack/repos/builtin/packages/font-bitstream-type1/package.py | 3 | 2117 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
mcgachey/edx-platform | lms/djangoapps/course_blocks/transformers/tests/test_split_test.py | 8 | 8262 | """
Tests for SplitTestTransformer.
"""
import ddt
import openedx.core.djangoapps.user_api.course_tag.api as course_tag_api
from openedx.core.djangoapps.user_api.partition_schemes import RandomUserPartitionScheme
from student.tests.factories import CourseEnrollmentFactory
from xmodule.partitions.partitions import Grou... | agpl-3.0 |
ardi69/pyload-0.4.10 | lib/Python/Lib/PIL/ImageQt.py | 20 | 2888 | #
# The Python Imaging Library.
# $Id$
#
# a simple Qt image interface.
#
# history:
# 2006-06-03 fl: created
# 2006-06-04 fl: inherit from QImage instead of wrapping it
# 2006-06-05 fl: removed toimage helper; move string support to ImageQt
# 2013-11-13 fl: add support for Qt5 (aurelien.ballier@cyclonit.com)
#
# Copyr... | gpl-3.0 |
ImaginaryLandscape/django-filer | filer/admin/clipboardadmin.py | 8 | 4529 | #-*- coding: utf-8 -*-
from django.forms.models import modelform_factory
from django.contrib import admin
from django.http import HttpResponse
from django.utils import simplejson
from django.views.decorators.csrf import csrf_exempt
from filer import settings as filer_settings
from filer.models import Clipboard, Clipboa... | bsd-3-clause |
Mj258/weiboapi | srapyDemo/envs/Lib/site-packages/win32/Demos/RegRestoreKey.py | 34 | 1832 | import win32api, win32security
import win32con, ntsecuritycon, winnt
import os
temp_dir=win32api.GetTempPath()
fname=win32api.GetTempFileName(temp_dir,'rsk')[0]
print fname
## file can't exist
os.remove(fname)
## enable backup and restore privs
required_privs = ((win32security.LookupPrivilegeValue('',ntsecuritycon.SE... | mit |
gx1997/chrome-loongson | tools/json_schema_compiler/h_generator.py | 5 | 10705 | # Copyright (c) 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 code import Code
from model import PropertyType
import cpp_util
import model
import os
class HGenerator(object):
"""A .h generator for a namespac... | bsd-3-clause |
ohsu-computational-biology/server | tests/unit/test_imports.py | 1 | 21810 | """
Tests that the project's module import graph conforms to certain policies
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import copy
import fnmatch
import itertools
import logging
import operator
import os
import pprint
import unittest
import sys
... | apache-2.0 |
binhqnguyen/ln | nsc/scons-local-1.2.0.d20090223/SCons/Tool/RCS.py | 19 | 2190 | """SCons.Tool.RCS.py
Tool-specific initialization for RCS.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Perm... | gpl-2.0 |
fast01/zerorpc-python | tests/test_client_async.py | 73 | 2652 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2013 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.