repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
lukechurch/coda | csv_conversion/internal2csv.py | 1 | 5252 | '''
Copyright (c) 2017 Coda authors
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, distribute, s... | mit |
askeing/fxos-certsuite | docs/conf.py | 7 | 8156 | # -*- coding: utf-8 -*-
#
# FirefoxOS Certification Testsuite documentation build configuration file, created by
# sphinx-quickstart on Fri Apr 25 14:32:32 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
# a... | mpl-2.0 |
xaviercobain88/framework-python | openerp/addons/product/report/pricelist.py | 58 | 4846 | # -*- 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... | agpl-3.0 |
lexus42/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/browser/indexed_db.py | 632 | 3008 | class EventListener:
def __init__(self, events=[]):
self._events=events
def append(self, event):
self._events.append(event)
def fire(self, e):
for _event in self._events:
_event(e)
class IndexedDB:
def __init__(self):
if not __BRYTHON__.has_indexedDB:
raise NotImple... | agpl-3.0 |
hammerlab/isovar | isovar/variant_orf_helpers.py | 1 | 5017 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | apache-2.0 |
vfine/webplatform | pmModules/users.py | 1 | 4422 | # users.py
# Display user info
# $Id: users.py 13454 2012-11-08 17:54:19Z fine $
#
import re, os
from datetime import datetime, timedelta
import pmConfig.pmConfig as config
import pmUtils.pmUtils as utils
from pmCore.pmModule import pmModule
from pmTaskBuffer.pmTaskBuffer import pmtaskbuffer as pmt
from operator im... | lgpl-3.0 |
BaySchoolCS2/ProjectRepo | application/collections.py | 2 | 3672 | ## Collections.py
## This file holds all the definitions for the mongodb collections
##
## User holds the users information
##
## Comment holds the comment document. comment is a embedded document
##
## Post holds all the data from posts
##
## Subscriptions people that you follow
##
## Kicked stores people who are kick... | mit |
jd/hyde | hyde/ext/publishers/pyfs.py | 6 | 4077 | """
Contains classes and utilities that help publishing a hyde website to
a filesystem using PyFilesystem FS objects.
This publisher provides an easy way to publish to FTP, SFTP, WebDAV or other
servers by specifying a PyFS filesystem URL. For example, the following
are valid URLs that can be used with this publisher... | mit |
Infinitive-OS/platform_external_skia | tools/embed_resources.py | 57 | 2573 | #!/usr/bin/python
'''
Copyright 2015 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
'''
import argparse
def bytes_from_file(f, chunksize=8192):
while True:
chunk = f.read(chunksize)
if chunk:
for b in chunk:
yield ord(b)
els... | bsd-3-clause |
lin-credible/scikit-learn | examples/tree/plot_iris.py | 271 | 2186 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
sdgdsffdsfff/monitor-core | gmond/python_modules/network/multi_interface.py | 3 | 8656 | import re
import time
import sys
import os
import copy
PARAMS = {}
METRICS = {
'time' : 0,
'data' : {}
}
LAST_METRICS = copy.deepcopy(METRICS)
METRICS_CACHE_MAX = 5
INTERFACES = []
descriptors = []
stats_tab = {
"rx_bytes" : 0,
"rx_pkts" : 1,
"rx_errs" : 2,
"rx_drops" : 3,
"tx_byte... | bsd-3-clause |
indictranstech/phr-frappe | frappe/widgets/search.py | 9 | 3829 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Search
from __future__ import unicode_literals
import frappe
import frappe.widgets.reportview
from frappe.utils import cstr, unique
# this is called by the Link Field
@frappe.whitelist()
def search_link(doctype, t... | mit |
shujaatak/UAV_MissionPlanner | Lib/os2emxpath.py | 192 | 4603 | # Module 'os2emxpath' -- common operations on OS/2 pathnames
"""Common pathname manipulations, OS/2 EMX version.
Instead of importing this module directly, import os and refer to this
module as os.path.
"""
import os
import stat
from genericpath import *
from ntpath import (expanduser, expandvars, isabs, islink, spli... | gpl-2.0 |
touchpro/android_kernel_lge_x5_old | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
daeseokyoun/youtube-dl | youtube_dl/extractor/lnkgo.py | 151 | 3777 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
)
class LnkGoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?lnkgo\.alfa\.lt/visi-video/(?P<show>[^/]+)/ziurek-(?P<id>[A-Za-z0-9-]+)'
_TESTS = ... | unlicense |
mdanielwork/intellij-community | python/helpers/pydev/_pydev_runfiles/pydev_runfiles_pytest2.py | 10 | 10624 | from _pydev_runfiles import pydev_runfiles_xml_rpc
import pickle
import zlib
import base64
import os
import py
from pydevd_file_utils import _NormFile
import pytest
import sys
import time
#=========================================================================
# Load filters with tests we should skip
#=============... | apache-2.0 |
MSusik/invenio | invenio/modules/search/user_settings.py | 2 | 2485 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your opt... | gpl-2.0 |
nkhuyu/blaze | blaze/_version.py | 15 | 15761 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | bsd-3-clause |
yjmade/odoo | openerp/report/misc.py | 458 | 1425 | # -*- 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 |
benchisell/photostream-bc | flask/lib/python2.7/site-packages/migrate/tests/versioning/test_repository.py | 30 | 8285 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
from migrate import exceptions
from migrate.versioning.repository import *
from migrate.versioning.script import *
from nose.tools import raises
from migrate.tests import fixture
from datetime import datetime
class TestRepository(fixture.Pathed)... | bsd-3-clause |
PopCap/GameIdea | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/win32comext/ifilter/ifiltercon.py | 29 | 3260 | # manual stuff
from pywintypes import IID
PSGUID_STORAGE = IID('{B725F130-47EF-101A-A5F1-02608C9EEBAC}')
PSGUID_SUMMARYINFORMATION = IID('{F29F85E0-4FF9-1068-AB91-08002B27B3D9}')
PSGUID_HTMLINFORMATION = IID('{D1B5D3F0-C0B3-11CF-9A92-00A0C908DBF1}')
PSGUID_HTML2_INFORMATION = IID('{C82BF597-B831-11D0... | bsd-2-clause |
bearstech/ansible | lib/ansible/modules/windows/win_msi.py | 22 | 2878 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Matt Martz <matt@sivel.net>, and others
#
# 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 t... | gpl-3.0 |
mapr/hue | desktop/core/ext-py/Django-1.6.10/tests/extra_regress/tests.py | 59 | 14222 | from __future__ import absolute_import, unicode_literals
import datetime
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils.datastructures import SortedDict
from .models import TestObject, Order, RevisionableModel
class ExtraRegressTests(TestCase):
def setUp(self):
... | apache-2.0 |
vulogov/zap_proxy | etc/python/CacheDriver.py | 1 | 1608 | __version__ = 'v0.1.0'
import time
class CacheDriver:
def __init__(self, creator):
self.creator = creator
self.ready = False
self.name = ""
def set_cache_args(self, args):
self.args = args
def set(self, name, key, value):
if not self.ready or self.name != name:
... | gpl-3.0 |
georgestarcher/TA-SyncKVStore | bin/ta_synckvstore/solnlib/packages/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
PeterTheOne/weblate | weblate/trans/management/commands/import_project.py | 7 | 10132 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
DNFcode/edx-platform | lms/djangoapps/django_comment_client/utils.py | 10 | 19385 | import json
import pytz
from collections import defaultdict
import logging
from datetime import datetime
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.db import connection
from django.http import HttpResponse
from django.utils import simplejson
from django.utils.t... | agpl-3.0 |
stefanix/artifactofcode | externals/pygments/util.py | 7 | 5847 | # -*- coding: utf-8 -*-
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: 2006-2008 by Georg Brandl.
:license: BSD, see LICENSE for more details.
"""
import re
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''(?smx)
(<\?.*?\?>)?\s*
<!DOCTYPE\s+(
... | mit |
gnu-sandhi/gnuradio | gnuradio-core/src/python/gnuradio/gr/qa_interleave.py | 18 | 2846 | #!/usr/bin/env python
#
# Copyright 2004,2007,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your ... | gpl-3.0 |
sajeeshcs/nested_quota_latest | nova/tests/unit/volume/encryptors/test_luks.py | 4 | 3854 | # Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory
# 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/... | apache-2.0 |
lazybios/statsite | sinks/librato.py | 12 | 8601 | """
Supports flushing statsite metrics to Librato
"""
import sys
import socket
import logging
import ConfigParser
import re
import base64
import urllib2
import json
import os
##
# Librato sink for statsite
# =========================
#
# Use with the following stream command:
#
# stream_cmd = python sinks/librato.py ... | bsd-3-clause |
abhishekjairath/codeyard | commit/lib/python2.7/site-packages/pymongo/ssl_match_hostname.py | 74 | 3599 | # Backport of the match_hostname logic introduced in python 3.2
# http://hg.python.org/releasing/3.3.5/file/993955b807b3/Lib/ssl.py
import re
class CertificateError(ValueError):
pass
def _dnsname_match(dn, hostname, max_wildcards=1):
"""Matching according to RFC 6125, section 6.4.3
http://tools.ietf.o... | mit |
blueshed/blueshed-micro | blueshed/micro/web/rpc_handler.py | 1 | 4761 | from pkg_resources import resource_filename # @UnresolvedImport
from tornado import web
from tornado.escape import json_decode
from tornado.web import asynchronous, RequestHandler
import tornado.concurrent
from blueshed.micro.utils.json_utils import dumps
from blueshed.micro.web.context_mixin import ContextMixin
from ... | mit |
christophelec/nbviewer | nbviewer/providers/github/tests/test_github.py | 9 | 5587 | # coding: utf-8
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#-------------------------------------... | bsd-3-clause |
bigplus/thefuck | thefuck/corrector.py | 10 | 3200 | import sys
from imp import load_source
from pathlib import Path
from . import conf, types, logs
from .utils import eager
def load_rule(rule, settings):
"""Imports rule module and returns it."""
name = rule.name[:-3]
rule_module = load_source(name, str(rule))
priority = getattr(rule_module, 'priority',... | mit |
gh4w/some | web/diego/pronostix/views.py | 1 | 2629 | from datetime import datetime
from django.utils import timezone
from django.views import generic
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, get_object_or_404, HttpResponseRedirect
from django.urls import reverse
import pronostix.models as models
import pronostix.forms... | mit |
minesense/VisTrails | vistrails/packages/tensorflow/base.py | 2 | 9926 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/IPython/external/decorators/_numpy_testing_utils.py | 26 | 4157 | # IPython: modified copy of numpy.testing.utils, so
# IPython.external._decorators works without numpy being installed.
"""
Utility function to facilitate testing.
"""
import sys
import warnings
# The following two classes are copied from python 2.6 warnings module (context
# manager)
class WarningMessage(object):
... | bsd-3-clause |
chenwenbin928/iBarn | lib/view/assets/jquery-file-upload/server/gae-python/main.py | 223 | 5173 | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appeng... | apache-2.0 |
fu3kingt3pe/spiderfoot | ext/pyPdf/pdf.py | 15 | 78986 | # -*- coding: utf-8 -*-
#
# vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# Copyright (c) 2007, Ashish Kulkarni <kulkarni.ashish@gmail.com>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the foll... | gpl-2.0 |
mycFelix/heron | heron/tools/explorer/src/python/main.py | 5 | 6793 | #!/usr/bin/env python2.7
# -*- encoding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apa... | apache-2.0 |
XiaosongWei/chromium-crosswalk | tools/telemetry/third_party/typ/typ/tests/json_results_test.py | 74 | 4342 | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
nesdis/djongo | tests/django_tests/tests/v21/tests/auth_tests/test_auth_backends.py | 15 | 28343 | from datetime import date
from unittest import mock
from django.contrib.auth import (
BACKEND_SESSION_KEY, SESSION_KEY, authenticate, get_user, signals,
)
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.hashers import MD5PasswordHasher
from django.contrib.auth.models import Anonymous... | agpl-3.0 |
ita1024/samba | third_party/dnspython/dns/rdtypes/IN/NAPTR.py | 100 | 4873 | # Copyright (C) 2003-2007, 2009-2011 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 "... | gpl-3.0 |
joone/chromium-crosswalk | third_party/cython/src/Cython/Compiler/UtilityCode.py | 98 | 6918 | from TreeFragment import parse_from_strings, StringParseContext
import Symtab
import Naming
import Code
class NonManglingModuleScope(Symtab.ModuleScope):
def __init__(self, prefix, *args, **kw):
self.prefix = prefix
self.cython_scope = None
Symtab.ModuleScope.__init__(self, *args, **kw)
... | bsd-3-clause |
mrumsky/congress-legislators | scripts/house_websites.py | 9 | 3090 | #!/usr/bin/env python
# Uses http://house.gov/representatives/ to scrape official member websites.
# Only known source.
# Assumptions:
# member's state and district fields are present and accurate.
# member's most recent term in the terms field is their current one.
import lxml.html, io, urllib.request, urllib.err... | cc0-1.0 |
Bishwajet/foursquared | util/common.py | 262 | 2820 | #!/usr/bin/python
import logging
from xml.dom import minidom
from xml.dom import pulldom
BOOLEAN = "boolean"
STRING = "String"
GROUP = "Group"
# Interfaces that all FoursquareTypes implement.
DEFAULT_INTERFACES = ['FoursquareType']
# Interfaces that specific FoursqureTypes implement.
INTERFACES = {
}
DEFAULT_CLA... | apache-2.0 |
s0enke/boto | boto/kinesis/layer1.py | 102 | 40879 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
bradowen2011/lightshowpi | py/commands.py | 2 | 8711 | #!/usr/bin/env python
#
# Licensed under the BSD license. See full license in LICENSE file.
# http://www.lightshowpi.com/
#
# Author: Todd Giles (todd@lightshowpi.com)
#
# Initial commands implemented by Chris Usey (chris.usey@gmail.com)
"""Commmand definition file.
Enabled commands must be defined in the configurati... | bsd-2-clause |
BuildingLink/sentry | src/sentry/south_migrations/0244_auto__add_groupredirect.py | 7 | 48139 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'GroupRedirect'
db.create_table('sentry_groupredirect', (
... | bsd-3-clause |
fnordahl/nova | nova/tests/unit/compute/fake_resource_tracker.py | 23 | 1029 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
technosophos/kubernetes | cluster/juju/charms/trusty/kubernetes/hooks/lib/registrator.py | 160 | 3478 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
yuewko/neutron | neutron/plugins/ml2/drivers/arista/mechanism_arista.py | 15 | 17226 | # 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 |
emonty/deb-vhd-util | tools/python/xen/xend/server/SrvVnetDir.py | 52 | 4339 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
titiushko/readthedocs.org | readthedocs/gold/migrations/0001_initial.py | 36 | 1500 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('projects', '__first__'),
]
opera... | mit |
iambocai/ansible | lib/ansible/utils/__init__.py | 4 | 56744 | # (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 |
OpringaoDoTurno/airflow | tests/contrib/sensors/test_jira_sensor_test.py | 5 | 2881 | # -*- 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 |
JoeyCodinja/INFO3180LAB4 | lib/werkzeug/routing.py | 313 | 62520 | # -*- coding: utf-8 -*-
"""
werkzeug.routing
~~~~~~~~~~~~~~~~
When it comes to combining multiple controller or view functions (however
you want to call them) you need a dispatcher. A simple way would be
applying regular expression tests on the ``PATH_INFO`` and calling
registered callback fun... | apache-2.0 |
izapolsk/integration_tests | cfme/fixtures/generic_object.py | 4 | 2324 | import fauxfactory
import pytest
from cfme.services.myservice import MyService
from cfme.utils.appliance import ViaREST
from cfme.utils.rest import assert_response
@pytest.fixture(scope="module")
def gen_rest_service(appliance):
"""Simple service create with rest for generic object association"""
rest_servi... | gpl-2.0 |
schnitzlein/weatherstation | obsolete/Display.py | 1 | 1636 | import os, syslog
import pygame
import logging
class PyLcd :
screen = None;
colourBlack = (0, 0, 0)
def __init__(self):
"Ininitializes a new pygame screen using the framebuffer"
# Based on "Python GUI in Linux frame buffer"
# http://www.karoltomala.com/blog/?p=679
disp_no =... | mit |
plumgrid/plumgrid-nova | nova/tests/api/openstack/compute/plugins/v3/test_attach_interfaces.py | 3 | 12705 | # Copyright 2012 SINA Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | apache-2.0 |
PHOTOX/fuase | ase/ase/gui/gtkexcepthook.py | 2 | 9685 | # vim: sw=4 ts=4:
#
# (c) 2003 Gustavo J A M Carneiro gjc at inescporto.pt
# 2004-2005 Filip Van Raemdonck
#
# http://www.daa.com.au/pipermail/pygtk/2003-August/005775.html
# Message-ID: <1062087716.1196.5.camel@emperor.homelinux.net>
# "The license is whatever you want."
#
# This file was downloaded from http:... | gpl-2.0 |
brokenjacobs/ansible | lib/ansible/modules/network/f5/bigip_hostname.py | 26 | 5767 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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
# ... | gpl-3.0 |
lmazuel/ansible | lib/ansible/plugins/action/iosxr_config.py | 79 | 4164 | #
# (c) 2017, 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... | gpl-3.0 |
ruuk/script.module.youtube.dl | lib/youtube_dl/extractor/rutv.py | 50 | 8064 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none
)
class RUTVIE(InfoExtractor):
IE_DESC = 'RUTV.RU'
_VALID_URL = r'''(?x)
https?://
(?:test)?player\.(?:rut... | gpl-2.0 |
mapsme/omim | tools/python/ResponseProvider.py | 4 | 8714 | from __future__ import print_function
import jsons
import logging
import os
BIG_FILE_SIZE = 47684
class Payload:
def __init__(self, message, response_code=200, headers={}):
self.__response_code = response_code
self.__message = message
self.__headers = headers
def respo... | apache-2.0 |
rhyolight/nupic.research | projects/sequence_prediction/continuous_sequence/run_elm.py | 10 | 8061 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013-2015, 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 p... | gpl-3.0 |
brchiu/tensorflow | tensorflow/python/training/training_util_test.py | 9 | 5110 | # Copyright 2015 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 |
rectangle-dbmi/Realtime-Port-Authority | scripts/reverseStrings.py | 1 | 1080 | """
Jeremy Jao
2/24/2015
This was introduced because BitmapDescriptorFactory.fromAsset() no longer works...
Must use a hack to use the resource enumeration...
String Reversing....
"""
import os
def renameFile(filename):
"""
renames the file....
"""
routename = filename[:-4]
os.rename(filename, '... | gpl-3.0 |
entomb/CouchPotatoServer | libs/chardet/utf8prober.py | 216 | 2663 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
jnerin/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_vgw_facts.py | 17 | 5014 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
moijes12/oh-mainline | vendor/packages/html5lib/html5lib/treebuilders/__init__.py | 102 | 4478 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... | agpl-3.0 |
robinro/ansible | lib/ansible/module_utils/facts/system/ssh_pub_keys.py | 177 | 2119 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... | gpl-3.0 |
RO-ny9/python-for-android | python-modules/twisted/twisted/web/test/test_httpauth.py | 49 | 21718 | # Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.web._auth}.
"""
from zope.interface import implements
from zope.interface.verify import verifyObject
from twisted.trial import unittest
from twisted.python.failure import Failure
from twisted.internet.error im... | apache-2.0 |
ojengwa/oh-mainline | vendor/packages/scrapy/scrapy/xlib/pydispatch/saferef.py | 25 | 6036 | """Refactored "safe reference" from dispatcher.py"""
import weakref, traceback
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target -- the object to be weakly referenced, if it's a
bound method reference, will create a BoundMethodWeakref,
otherwise creates a simple... | agpl-3.0 |
daniel-j-born/grpc | src/python/grpcio/grpc/_credential_composition.py | 12 | 1219 | # Copyright 2016 gRPC authors.
#
# 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... | apache-2.0 |
darkleons/odoo | addons/account_budget/report/crossovered_budget_report.py | 315 | 8657 | # -*- 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 |
Lektorium-LLC/edx-platform | common/djangoapps/student/tests/test_views.py | 2 | 13684 | """
Test the student dashboard view.
"""
import datetime
import itertools
import json
import unittest
import ddt
import pytz
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import RequestFactory, TestCase
from edx_oauth2_provider.constants import AUTHORIZED_CLIENTS_SESSIO... | agpl-3.0 |
mancoast/CPythonPyc_test | fail/310_test_telnetlib.py | 2 | 12447 | import socket
import threading
import telnetlib
import time
import queue
from unittest import TestCase
from test import support
HOST = support.HOST
EOF_sigil = object()
def server(evt, serv, dataq=None):
""" Open a tcp server in three steps
1) set evt to true to let the parent know we are ready
2... | gpl-3.0 |
dgilland/alchy | alchy/_compat.py | 1 | 3201 | # -*- coding: utf-8 -*-
# flake8: noqa
# pylint: skip-file
"""Python 2/3 compatibility
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
Borrowed from
https://github.com/mitsuhiko/flask/blob/master/flask/_compat.py
""... | mit |
scw/ansible | lib/ansible/plugins/connections/ssh.py | 12 | 20798 | # (c) 2012, 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) any lat... | gpl-3.0 |
joshloyal/scikit-learn | sklearn/utils/tests/test_linear_assignment.py | 421 | 1349 | # Author: Brian M. Clapper, G Varoquaux
# License: BSD
import numpy as np
# XXX we should be testing the public API here
from sklearn.utils.linear_assignment_ import _hungarian
def test_hungarian():
matrices = [
# Square
([[400, 150, 400],
[400, 450, 600],
[300, 225, 300]],
... | bsd-3-clause |
Mangopay/mangopay2-python-sdk | tests/test_payins.py | 1 | 37933 | # -*- coding: utf-8 -*-
import time
import unittest
from cmath import rect
from datetime import date
import responses
from mangopay.resources import DirectDebitDirectPayIn, Mandate, ApplepayPayIn, GooglepayPayIn, \
RecurringPayInRegistration, RecurringPayInCIT, RecurringPayIn
from mangopay.utils import (Money, Sh... | mit |
stephantul/somber | somber/plsom.py | 1 | 5148 | """The PLSOM."""
import logging
from typing import Callable, Dict, Optional, Tuple
import numpy as np
from tqdm import tqdm
from somber.som import BaseSom
from somber.components.initializers import range_initialization
from somber.components.utilities import Scaler
logger = logging.getLogger(__name__)
class PLSom... | mit |
edulramirez/nova | nova/tests/functional/api_sample_tests/test_flavor_manage.py | 17 | 2649 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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 |
bdrillard/spark | dev/create-release/translate-contributors.py | 104 | 12627 | #!/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 "Lic... | apache-2.0 |
japaniel/CloudFerry | cloudferrylib/os/actions/get_info_objects.py | 11 | 1086 | # Copyright (c) 2014 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 required by applicable law or agreed to in writing, so... | apache-2.0 |
flh/odoo | addons/website_mail_group/controllers/main.py | 38 | 7878 | # -*- coding: utf-8 -*-
import datetime
from dateutil import relativedelta
from openerp import tools, SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.website.models.website import slug
from openerp.addons.web.http import request
class MailGroup(http.Controller):
_thread_per_page = 20
_r... | agpl-3.0 |
sudheesh001/oh-mainline | vendor/packages/twisted/twisted/mail/test/test_options.py | 17 | 7839 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.mail.tap}.
"""
from twisted.trial.unittest import TestCase
from twisted.python.usage import UsageError
from twisted.mail import protocols
from twisted.mail.tap import Options, makeService
from twisted.python import deprec... | agpl-3.0 |
ghisvail/vispy | vispy/visuals/surface_plot.py | 20 | 5503 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import numpy as np
from .mesh import MeshVisual
from ..geometry import MeshData
class SurfacePlotVisual(MeshVisual):
"""Displays a surf... | bsd-3-clause |
daeseokyoun/youtube-dl | youtube_dl/extractor/roxwel.py | 180 | 1965 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import unified_strdate, determine_ext
class RoxwelIE(InfoExtractor):
_VALID_URL = r'https?://www\.roxwel\.com/player/(?P<filename>.+?)(\.|\?|$)'
_TEST = {
'url': 'http://www.roxwel.com/player/passionpit... | unlicense |
duncanwp/iris | lib/iris/tests/unit/experimental/regrid/test_regrid_weighted_curvilinear_to_rectilinear.py | 5 | 14572 | # (C) British Crown Copyright 2013 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris 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 3 of the License, or
# (at your option) any l... | lgpl-3.0 |
valkyriesavage/invenio | modules/websubmit/lib/functions/Move_Uploaded_Files_to_Storage.py | 8 | 3024 | ## $Id: Move_Revised_Files_to_Storage.py,v 1.20 2009/03/26 13:48:42 jerome Exp $
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Fo... | gpl-2.0 |
gcrisis/ardupilot | mk/VRBRAIN/Tools/genmsg/src/genmsg/command_line.py | 51 | 1928 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 t... | gpl-3.0 |
ahmadRagheb/goldenHR | erpnext/schools/api.py | 8 | 10291 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
from frappe import _
from frappe.model.mapper import get_mapped_doc
from frappe.utils import flt, cstr
from frappe.email... | gpl-3.0 |
1yvT0s/scrapy | scrapy/spidermiddlewares/httperror.py | 128 | 1706 | """
HttpError Spider Middleware
See documentation in docs/topics/spider-middleware.rst
"""
import logging
from scrapy.exceptions import IgnoreRequest
logger = logging.getLogger(__name__)
class HttpError(IgnoreRequest):
"""A non-200 response was filtered"""
def __init__(self, response, *args, **kwargs):
... | bsd-3-clause |
skggm/skggm | examples/trace_plot_example.py | 1 | 3138 | """
Visualize Regularization Path
=============================
Plot the edge level coefficients (inverse covariance entries)
as a function of the regularization parameter.
"""
import sys
import numpy as np
from sklearn.datasets import make_sparse_spd_matrix
sys.path.append("..")
from inverse_covariance import Quic... | mit |
quxiaolong1504/django | tests/m2m_multiple/tests.py | 228 | 2386 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, Category
class M2MMultipleTests(TestCase):
def test_multiple(self):
c1, c2, c3, c4 = [
Category.objects.create(name=name)
for name in ["Sports", "N... | bsd-3-clause |
lvdongr/spark | dev/create-release/translate-contributors.py | 104 | 12627 | #!/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 "Lic... | apache-2.0 |
takaakiaoki/PyFoam | unittests/Basics/TemplateFile.py | 1 | 6744 |
import unittest
from PyFoam.Basics.TemplateFile import TemplateFile,TemplateFileOldFormat,PyratempPreprocessor
from PyFoam.Error import FatalErrorPyFoamException
from tempfile import mktemp
from PyFoam.ThirdParty.six import PY3
import sys
theSuite=unittest.TestSuite()
template1="""$$ y = 3+x
This should be $x+y$... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.