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 |
|---|---|---|---|---|---|
kimjinyong/i2nsf-framework | Hackathon-105/jetconf/lib64/python3.5/site-packages/pip/utils/build.py | 899 | 1312 | from __future__ import absolute_import
import os.path
import tempfile
from pip.utils import rmtree
class BuildDirectory(object):
def __init__(self, name=None, delete=None):
# If we were not given an explicit directory, and we were not given an
# explicit delete option, then we'll default to del... | apache-2.0 |
ChronoMonochrome/android_external_chromium_org | PRESUBMIT.py | 23 | 44897 | # 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.
"""Top-level presubmit script for Chromium.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presu... | bsd-3-clause |
AnuchitPrasertsang/robotframework-selenium2library | demo/package.py | 64 | 1359 | #!/usr/bin/env python
import os, sys
from time import localtime
from zipfile import ZipFile, ZIP_DEFLATED
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
execfile(os.path.join(THIS_DIR, '..', 'src', 'Selenium2Library', 'version.py'))
FILES = {
'': ['rundemo.py'],
'login_tests': ['valid_login.txt', 'inv... | apache-2.0 |
vberaudi/scipy | scipy/weave/build_tools.py | 97 | 26432 | """ Tools for compiling C/C++ code to extension modules
The main function, build_extension(), takes the C/C++ file
along with some other options and builds a Python extension.
It uses distutils for most of the heavy lifting.
choose_compiler() is also useful (mainly on windows anyway)
for trying to... | bsd-3-clause |
nathanielvarona/airflow | tests/utils/test_helpers.py | 3 | 5764 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
MDPvis/rlpy | examples/tutorial/gridworld.py | 4 | 1947 | #!/usr/bin/env python
"""
Getting Started Tutorial for RLPy
=================================
This file contains a very basic example of a RL experiment:
A simple Grid-World.
"""
__author__ = "Robert H. Klein"
from rlpy.Domains import GridWorld
from rlpy.Agents import Q_Learning
from rlpy.Representations import Tabula... | bsd-3-clause |
faratro/django-oscar | tests/integration/catalogue/reviews/form_tests.py | 40 | 1806 | from django.test import TestCase
from oscar.apps.catalogue.reviews import forms
from oscar.test.factories import create_product, UserFactory
class TestReviewForm(TestCase):
def setUp(self):
self.product = create_product()
self.reviewer = UserFactory()
self.data = {
'title': '... | bsd-3-clause |
maestrano/odoo | addons/hr/__openerp__.py | 47 | 2550 | # -*- 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 |
Clinical-Genomics/scout | tests/commands/download/test_download_exac_cmd.py | 1 | 1481 | """Tests for download commands"""
import pathlib
import tempfile
from scout.commands.download.exac import exac as exac_cmd
from scout.commands.download.exac import print_exac
def test_download_exac_cmd(mocker, empty_mock_app):
"""Test download exac command"""
# GIVEN a temporary directory
mock_app = emp... | bsd-3-clause |
songyi199111/sentry | tests/sentry/web/frontend/projects/tests.py | 11 | 5036 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import logging
from django.core.urlresolvers import reverse
from exam import fixture
from sentry.models import ProjectKey, ProjectKeyStatus, TagKey
from sentry.testutils import TestCase
logger = logging.getLogger(__name__)
class Manag... | bsd-3-clause |
yongtang/tensorflow | tensorflow/python/kernel_tests/priority_queue_test.py | 14 | 12949 | # 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 |
RPGOne/Skynet | numpy-master/numpy/distutils/line_endings.py | 256 | 2053 | """ Functions for converting from DOS to UNIX line endings
"""
from __future__ import division, absolute_import, print_function
import sys, re, os
def dos2unix(file):
"Replace CRLF with LF in argument files. Print names of changed files."
if os.path.isdir(file):
print(file, "Directory!")
ret... | bsd-3-clause |
jay-tyler/http-server | server.py | 1 | 6165 | # -*- coding: utf-8 -*-
import socket
import sys
import os
import mimetypes
ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'webroot')
ROOT = ROOT.encode('utf-8')
ADDR = (b'127.0.0.1', 8001)
CRLF = (b'\r\n')
PROTOCOL = b'HTTP/1.1'
# Using this as a dummy var
foo_date = b"Sun, 21 Jul 2001 23:32:15 GTM"
... | mit |
danaukes/popupcad | popupcad/constraints/constraint_support.py | 2 | 1170 | # -*- coding: utf-8 -*-
"""
Written by Daniel M. Aukes and CONTRIBUTORS
Email: danaukes<at>asu.edu.
Please see LICENSE for full license.
"""
import sympy
class Variable(sympy.Symbol):
pass
class UnknownType(Exception):
pass
class WrongArguments(Exception):
pass
class SymbolicVertex(o... | mit |
BrainTech/openbci | obci/exps/ventures/calibration2_game/screen_text.py | 1 | 1546 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distri... | gpl-3.0 |
wijnandb/CodeCult-Scratch | common/yaml_files.py | 15 | 7852 | #!/usr/bin/python
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 |
DrMeers/django | tests/custom_methods/models.py | 32 | 1263 | """
3. Giving models custom methods
Any method you add to a model will be available to instances.
"""
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100)
... | bsd-3-clause |
lostdj/Jaklin-OpenJFX | modules/web/src/main/native/Tools/Scripts/webkitpy/layout_tests/servers/apache_http_server.py | 5 | 9462 | # Copyright (C) 2011 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 ... | gpl-2.0 |
gangadharkadam/contributionerp | erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py | 57 | 2650 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
class TestPricingRule(unittest.TestCase):
def test_pricing_rule_for_discount(self):
from erpnext.stock.get_item_detai... | agpl-3.0 |
partofthething/home-assistant | homeassistant/components/totalconnect/__init__.py | 3 | 2848 | """The totalconnect component."""
import asyncio
import logging
from total_connect_client import TotalConnectClient
import voluptuous as vol
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
imp... | mit |
prarthitm/edxplatform | openedx/core/djangoapps/programs/models.py | 8 | 4496 | """Models providing Programs support for the LMS and Studio."""
from urlparse import urljoin
from django.utils.translation import ugettext_lazy as _
from django.db import models
from config_models.models import ConfigurationModel
class ProgramsApiConfig(ConfigurationModel):
"""
DEPRECATED. To be removed as ... | agpl-3.0 |
adamwwt/chvac | venv/lib/python2.7/site-packages/selenium/webdriver/ie/service.py | 16 | 3920 | #!/usr/bin/python
#
# Copyright 2012 Webdriver_name committers
# Copyright 2012 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
... | mit |
hkaj/birdy_server | core/auth.py | 1 | 1549 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
import xml.etree.ElementTree as ET
from flask import abort, Flask, escape, request, session
from passlib.hash import sha256_crypt
from core.db import Retriever
def check_auth(session):
if 'username' in session:
xml_res = ET.fromstr... | gpl-3.0 |
Kalyzee/edx-platform | lms/djangoapps/certificates/migrations/0020_certificatehtmlviewconfiguration_data.py | 74 | 11446 | # -*- coding: utf-8 -*-
import json
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"""
Bootstraps the HTML view template with some default configura... | agpl-3.0 |
tazo90/pulsar | examples/helloworld/manage.py | 6 | 1168 | '''This example is a simple WSGI_ script which displays
the ``Hello World!`` message. To run the script type::
python manage.py
To see all options available type::
python manage.py -h
.. autofunction:: hello
.. autofunction:: server
.. _WSGI: http://www.python.org/dev/peps/pep-3333/
'''
from pulsar import... | bsd-3-clause |
CCI-MOC/nova | nova/tests/unit/api/openstack/compute/test_virtual_interfaces.py | 2 | 5979 | # Copyright (C) 2011 Midokura KK
# 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 |
bukalov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py | 118 | 37734 | # Copyright (C) 2010 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 ... | bsd-3-clause |
xbmcin/XBMCinTC | addons/metadata.generic.artists/lib/allmusic.py | 2 | 3396 | # -*- coding: utf-8 -*-
import re
def allmusic_artistdetails(data):
data = data.decode('utf-8')
artistdata = {}
artist = re.search(r'artist-name" itemprop="name">\s*(.*?)\s*<', data)
if artist:
artistdata['artist'] = artist.group(1)
else:
# no discography page available for this ar... | gpl-2.0 |
rajalokan/nova | nova/api/openstack/compute/services.py | 1 | 8914 | # Copyright 2012 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 by applicable law or agreed t... | apache-2.0 |
macs03/demo-cms | cms/lib/python2.7/site-packages/cms/forms/fields.py | 14 | 3617 | # -*- coding: utf-8 -*-
import six
from django.utils.translation import ugettext_lazy as _
from django import forms
from django.contrib.admin.widgets import RelatedFieldWidgetWrapper
from django.forms.fields import EMPTY_VALUES
from cms.models.pagemodel import Page
from cms.forms.widgets import PageSelectWidget, PageSm... | mit |
CityGenerator/Megacosm-Generator | tests/test_planet.py | 1 | 1869 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"Fully test this module's functionality through the use of fixtures."
from megacosm.generators import Planet, Continent, Moon
import unittest2 as unittest
import fixtures
import fakeredis
from config import TestConfiguration
class TestPlanet(unittest.TestCase):
def... | gpl-2.0 |
jCornDev/jcoin | contrib/bitrpc/bitrpc.py | 224 | 7838 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | mit |
jpshort/odoo | addons/mrp_repair/wizard/__init__.py | 445 | 1096 | # -*- 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 |
SamiHiltunen/invenio-collections | requirements.py | 148 | 5904 | #!/usr/bin/env python2
#
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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 (... | gpl-2.0 |
MatheusArrudaLab/flocos | concepts/models/concept.py | 1 | 2021 | from django.db import models
from blocks.models import Block
class ConceptManager(models.Manager):
def get_by_natural_key(self, name):
return self.get(name=name)
class Concept(models.Model):
""" A feature of students and tasks which influence the solving process.
Concepts of a student determ... | gpl-2.0 |
taedla01/MissionPlanner | Lib/encodings/ptcp154.py | 96 | 9125 | """ Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode... | gpl-3.0 |
olivierdalang/stdm | third_party/sqlalchemy/event/legacy.py | 1 | 5987 | # event/legacy.py
# Copyright (C) 2005-2014 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
"""Routines to handle adaption of legacy call signatures,
generation of depr... | gpl-2.0 |
windinthew/audacity | lib-src/lv2/serd/waflib/ConfigSet.py | 266 | 3763 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import copy,re,os
from waflib import Logs,Utils
re_imp=re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$',re.M)
class ConfigSet(object):
__slots__=('table','parent')
def __init__(self,... | gpl-2.0 |
ximion/dak-dep11 | daklib/packagelist.py | 6 | 5336 | """parse Package-List field
@copyright: 2014, Ansgar Burchardt <ansgar@debian.org>
@license: GPL-2+
"""
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (a... | gpl-2.0 |
Ayub-Khan/edx-platform | cms/envs/dev.py | 25 | 5958 | """
This config file runs the simplest dev environment"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from .common import *
from openedx.core.lib.logsettings import get_logger_config... | agpl-3.0 |
grimfang/panda3d | direct/src/distributed/DistributedCameraOV.py | 9 | 3727 | from panda3d.core import *
from panda3d.direct import *
from direct.distributed.DistributedObjectOV import DistributedObjectOV
class DistributedCameraOV(DistributedObjectOV):
def __init__(self, cr):
DistributedObjectOV.__init__(self, cr)
self.parent = 0
self.fixtures = []
self.accep... | bsd-3-clause |
thehyve/variant | eggs/django-1.3.1-py2.7.egg/django/core/validators.py | 51 | 8035 | import platform
import re
import urllib2
import urlparse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the self.required check.
EMPTY_VALUES = (None, '', []... | apache-2.0 |
apark263/tensorflow | tensorflow/python/layers/base_test.py | 6 | 23643 | # 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 |
rubyu/anki | aqt/models.py | 2 | 7065 | # Copyright: Damien Elmes <anki@ichi2.net>
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from aqt.qt import *
from operator import itemgetter
from aqt.utils import showInfo, askUser, getText, maybeHideClose, openHelp
import aqt.modelchooser, aqt.clayout
from anki import stdmodels
from ... | agpl-3.0 |
Qalthos/ansible | lib/ansible/modules/network/nso/nso_show.py | 69 | 3509 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 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... | gpl-3.0 |
fnouama/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/geos/prototypes/coordseq.py | 624 | 3112 | from ctypes import c_double, c_int, c_uint, POINTER
from django.contrib.gis.geos.libgeos import GEOM_PTR, CS_PTR
from django.contrib.gis.geos.prototypes.errcheck import last_arg_byref, GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
## Error-checking routines specific to coordinate seq... | apache-2.0 |
OSGeoLabBp/tutorials | hungarian/python/code/point3d.py | 1 | 1377 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
from point2d_2 import Point2D
class Point3D(Point2D):
""" háromdimenziós pontok osztálya
:param east: első koordináta
:param north: második koordináta
:param elev: magasság
"""
def __init__(self, east = 0, north = ... | cc0-1.0 |
iotile/coretools | iotilecore/test/test_hw/test_hwmanager.py | 1 | 1456 | # This file is adapted from python code released by WellDone International
# under the terms of the LGPLv3. WellDone International's contact information is
# info@welldone.org
# http://welldone.org
#
# Modifications to this file from the original created at WellDone International
# are copyright Arch Systems Inc.
fro... | gpl-3.0 |
tadebayo/myedge | myvenv/Lib/io.py | 35 | 3396 | """The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; impl... | mit |
sagost/VideoUavTracker | SkipTrackTool.py | 1 | 2240 | # -*- coding: utf-8 -*-
'''
Video Uav Tracker v 2.0
Replay a video in sync with a gps track displayed on the map.
-------------------
copyright : (C) 2017 by Salvatore Agosta
email : sagost@katamail.com
This program is free software; you can redistribute it and/or modif... | gpl-2.0 |
marcua/qurk_experiments | qurkexp/join/sort-results.py | 1 | 6399 | #!/usr/bin/env python
import sys, os
ROOT = os.path.abspath('%s/../..' % os.path.abspath(os.path.dirname(__file__)))
sys.path.append(ROOT)
os.environ['DJANGO_SETTINGS_MODULE'] = 'qurkexp.settings'
from django.core.management import setup_environ
from django.conf import settings
from qurkexp.join.models import *
from q... | bsd-3-clause |
midori1/midorinoblog | site-packages/django/template/context.py | 87 | 6758 | from copy import copy
from django.utils.module_loading import import_string
# Cache of actual callables.
_standard_context_processors = None
# We need the CSRF processor no matter what the user has in their settings,
# because otherwise it is a security vulnerability, and we can't afford to leave
# this to human error... | apache-2.0 |
home-assistant/home-assistant | tests/components/worldclock/test_sensor.py | 14 | 1356 | """The test for the World clock sensor platform."""
import pytest
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
@pytest.fixture
def time_zone():
"""Fixture for time zone."""
return dt_util.get_time_zone("America/New_York")
async def test_time(hass, time_zone)... | apache-2.0 |
Chilledheart/chromium | chrome/test/chromedriver/embed_extension_in_cpp.py | 158 | 1124 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Embeds Chrome user data files in C++ code."""
import base64
import optparse
import os
import StringIO
import sys
import zipfile
im... | bsd-3-clause |
Integral-Technology-Solutions/ConfigNOW | Lib/weakref.py | 4 | 4660 | """Weak reference support for Python.
This module is an implementation of PEP 205:
http://python.sourceforge.net/peps/pep-0205.html
"""
import UserDict
from _weakref import \
getweakrefcount, \
getweakrefs, \
ref, \
proxy, \
ReferenceError, \
CallableProxyType, \
ProxyType, \
... | mit |
rfree2/cjdns | contrib/python/cjdnsadminmaker.py | 25 | 3538 | #!/usr/bin/env python2
"""
Automagically generate a .cjdnsadmin file.
Searches around for cjdroute.conf and the cjdns executable, cleans the config
into proper JSON, and saves just the RPC admin info to a file. By default this
is ~/.cjdnsadmin, but you can specify any file you want.
"""
import json
import os
import ... | gpl-3.0 |
Cactuslegs/audacity-of-nope | lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Tools/perl.py | 330 | 3016 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Task,Options,Utils
from waflib.Configure import conf
from waflib.TaskGen import extension,feature,before_method
@before_method('apply_incpaths','a... | gpl-2.0 |
2014cdbg14/2014cdbg14 | wsgi/static/Brython2.1.0-20140419-113919/Lib/browser/markdown.py | 53 | 11306 | import browser.html
import _jsre as re
import __random as random
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'0123456789'
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[... | gpl-2.0 |
r-mart/scikit-learn | examples/cluster/plot_cluster_iris.py | 350 | 2593 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
K-means Clustering
=========================================================
The plots display firstly what a K-means algorithm would yield
using three clusters. It is then shown what the effect of a bad
initializa... | bsd-3-clause |
StefanRijnhart/bank-statement-reconcile | __unported__/account_statement_ext/report/bank_statement_report.py | 18 | 3096 | # -*- coding utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by th... | agpl-3.0 |
nfco/netforce | netforce_sale/netforce_sale/models/sale_cost.py | 4 | 2554 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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 |
yawnosnorous/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_renames.py | 203 | 2221 | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
re... | apache-2.0 |
taaviteska/django | django/contrib/auth/backends.py | 24 | 6640 | from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
UserModel = get_user_model()
class ModelBackend:
"""
Authenticates against settings.AUTH_USER_MODEL.
"""
def authenticate(self, request, username=None, password=None, **kwargs):
if username is No... | bsd-3-clause |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/pyopenssl/OpenSSL/test/test_crypto.py | 21 | 140745 | # Copyright (c) Jean-Paul Calderone
# See LICENSE file for details.
"""
Unit tests for :py:mod:`OpenSSL.crypto`.
"""
from unittest import main
from warnings import catch_warnings, simplefilter
import base64
import os
import re
from subprocess import PIPE, Popen
from datetime import datetime, timedelta
from six impo... | apache-2.0 |
ml-lab/pylearn2 | pylearn2/models/s3c.py | 4 | 80365 | """
Spike-and-slab sparse coding (S3C)
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2011, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
import logging
import time
import warnings
import numpy as np
from theano import config, functio... | bsd-3-clause |
jerrybai2009/WhereHows-1 | metadata-etl/src/main/resources/jython/requests/packages/chardet/jisfreq.py | 3131 | 47315 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | apache-2.0 |
sensisoft/insol | tests.py | 1 | 1406 | #!/usr/bin/env python
# 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 w... | apache-2.0 |
apathinwalking/tidyaddr | tidyaddr/utils/address/sfx_subs.py | 1 | 4124 | sfx_subs = {}
sfx_subs.update({r"\bal\b":r"alley"})
sfx_subs.update({r"\baly\b":r"alley"})
sfx_subs.update({r"\bst\b":r"street"})
sfx_subs.update({r"\bstr\b":r"street"})
sfx_subs.update({r"\bav\b":r"avenue"})
sfx_subs.update({r"\bave\b":r"avenue"})
sfx_subs.update({r"\baven\b":r"avenue"})
sfx_subs.update({r"\bavenu\b":... | lgpl-3.0 |
was4444/chromium.src | chrome/common/extensions/docs/server2/sidenav_data_source.py | 37 | 3622 | # 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 copy
import logging
import posixpath
from compiled_file_system import Cache, SingleFile, Unicode
from data_source import DataSource
from extensio... | bsd-3-clause |
hzruandd/AutobahnPython | autobahn/twisted/choosereactor.py | 2 | 5972 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Tavendo GmbH
#
# 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 with... | mit |
rafaelthca/OmniDB | OmniDB/OmniDB_app/include/OmniDatabase/MariaDB.py | 2 | 52824 | '''
The MIT License (MIT)
Portions Copyright (c) 2015-2019, The OmniDB Team
Portions Copyright (c) 2017-2019, 2ndQuadrant Limited
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 restricti... | mit |
rgardler/acs-cli | acs/cli.py | 1 | 2250 | """
acs
Usage:
acs [--config-file=<file>] [--version] [--help] <command> [<args>...]
Options:
-h --help Show this help.
Commands:
login Login to Azure interactively
service Create and manage Azure Container Service
app Deploy and manage applications in the cluster
... | apache-2.0 |
dmhowcroft/idd3 | idd3/rules/vp_rulesets.py | 1 | 25896 | # -*- coding: utf-8 -*-
# IDD3 - Propositional Idea Density from Dependency Trees
# Copyright (C) 2014 Andre Luiz Verucci da Cunha
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either versi... | gpl-3.0 |
CoreSecurity/pysap | pysap/SAPHDB.py | 1 | 56973 | # ===========
# pysap - Python library for crafting SAP's network protocols packets
#
# SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved.
#
# The library was designed and developed by Martin Gallo from
# the SecureAuth's Innovation Labs team.
#
# This program is free software; you can red... | gpl-2.0 |
Einsteinish/PyTune3 | utils/zgrep.py | 1 | 3665 | #!/usr/bin/env python
import os
import time
import select
import subprocess
import sys
from optparse import OptionParser
from requests.exceptions import ConnectionError
sys.path.insert(0, '/srv/pytune')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import fabfile
PYTUNE_USERNAME = 'khong'
IGNORE_HOSTS = [
'p... | mit |
bgroenks96/libgdx | extensions/gdx-freetype/jni/freetype-2.6.2/src/tools/docmaker/utils.py | 153 | 3513 | #
# utils.py
#
# Auxiliary functions for the `docmaker' tool (library file).
#
# Copyright 2002-2015 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.TXT. By continuing to use, modify,... | apache-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.0/Lib/test/test_cmd_line_script.py | 2 | 6385 | # Tests command line execution of scripts
import unittest
import os
import os.path
import sys
import test.support
import tempfile
import subprocess
import py_compile
import contextlib
import shutil
import zipfile
verbose = test.support.verbose
# XXX ncoghlan: Should we consider moving these to support?
from test.tes... | mit |
charlyoleg/Cnc25D | scr/svg2txt.py | 1 | 2567 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# svg2txt.py
# extracts text from svg files
# created by charlyoleg on 2013/07/18
#
# (C) Copyright 2013 charlyoleg
#
# This file is part of the Cnc25D Python package.
#
# Cnc25D is free software: you can redistribute it and/or modify
# it under the terms of the GNU Genera... | gpl-3.0 |
geektophe/shinken | test/test_commands_perfdata.py | 18 | 6360 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the F... | agpl-3.0 |
bollu/vispy | vispy/visuals/filters/clipper.py | 20 | 2051 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from ..shaders import Function
from ..transforms import NullTransform
from ...geometry import Rect
clip_frag = """
void clip() {
vec4 pos = $fb_to_clip(gl_FragCoord);
... | bsd-3-clause |
sqlalchemy-redshift/sqlalchemy-redshift | tests/test_copy_command.py | 2 | 10656 | import pytest
import sqlalchemy as sa
from sqlalchemy import exc as sa_exc
from sqlalchemy_redshift import dialect
from rs_sqla_test_utils.utils import clean, compile_query
access_key_id = 'IO1IWSZL5YRFM3BEW256'
secret_access_key = 'A1Crw8=nJwEq+9SCgnwpYbqVSCnfB0cakn=lx4M1'
creds = (
(
'aws_access_key_id=... | mit |
alanjw/GreenOpenERP-Win-X86 | openerp/addons/base_setup/__init__.py | 439 | 1087 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
xionzz/earthquake | venv/lib/python2.7/site-packages/numpy/ma/tests/test_extras.py | 7 | 37983 | # pylint: disable-msg=W0611, W0612, W0511
"""Tests suite for MaskedArray.
Adapted from the original test_ma by Pierre Gerard-Marchant
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
:version: $Id: test_extras.py 3473 2007-10-29 15:18:13Z jarrod.millman $
"""
from __future__ import division, absolute... | mit |
vismartltd/edx-platform | common/djangoapps/terrain/steps.py | 36 | 7478 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# Disable the "wildcard import" warning so we can bring in all methods from
# course helpers and ui helpers
# pylint: disable=wildcard-import
# Disable the "Unused import %s from wildcard import" warning
# pylint: disable=unused-wildcard-impor... | agpl-3.0 |
olexiim/edx-platform | lms/djangoapps/shoppingcart/admin.py | 12 | 2120 | """
Allows django admin site to add PaidCourseRegistrationAnnotations
"""
from ratelimitbackend import admin
from shoppingcart.models import (
PaidCourseRegistrationAnnotation, Coupon, DonationConfiguration
)
class SoftDeleteCouponAdmin(admin.ModelAdmin):
"""
Admin for the Coupon table.
soft-delete on... | agpl-3.0 |
Teagan42/home-assistant | homeassistant/components/rpi_gpio/cover.py | 5 | 3806 | """Support for controlling a Raspberry Pi cover."""
import logging
from time import sleep
import voluptuous as vol
from homeassistant.components import rpi_gpio
from homeassistant.components.cover import PLATFORM_SCHEMA, CoverDevice
from homeassistant.const import CONF_NAME
import homeassistant.helpers.config_validat... | apache-2.0 |
tbinjiayou/Odoo | addons/report_webkit/__init__.py | 382 | 1593 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who... | agpl-3.0 |
ryfx/gyp | test/ios/gyptest-per-config-settings.py | 193 | 5219 | #!/usr/bin/env python
# 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.
"""
Verifies that device and simulator bundles are built correctly.
"""
import plistlib
import TestGyp
import os
import struct
import subpr... | bsd-3-clause |
smil-in-javascript/smil-in-javascript | test/update-testcases.py | 170 | 1754 | #!/usr/bin/python
import cStringIO as StringIO
from fnmatch import fnmatch
import difflib
import os
import sys
def get_name(filename):
return os.path.splitext(filename)[0]
def list_dir(dir_path, filter_func):
return sorted(filter(filter_func, os.listdir(dir_path)), key=get_name)
def main():
test_dir ... | apache-2.0 |
andreagrandi/duplicity-sx | duplicity/backend.py | 1 | 24677 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License... | gpl-2.0 |
cselis86/edx-platform | scripts/metrics/publish.py | 69 | 1310 | """
Publish Build Stats.
"""
import os
import subprocess
from dogapi import dog_http_api
from coverage_metrics import CoverageMetrics
class PublishStats(object):
"""
Publish stats to DataDog.
"""
def __init__(self, api_key):
dog_http_api.api_key = api_key
@staticmethod
def report_met... | agpl-3.0 |
fpsluozi/youtube-dl | youtube_dl/extractor/vbox7.py | 92 | 2298 | # encoding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
compat_urlparse,
)
from ..utils import (
ExtractorError,
)
class Vbox7IE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?vbox7\.com/play:(... | unlicense |
mrGeen/eden | modules/tests/hrm/add_staff_to_warehouse.py | 1 | 2525 | """ Sahana Eden Module Automated Tests - HRM007 Add Staff To Warehouse
@copyright: 2011-2012 (c) Sahana Software Foundation
@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 deal in th... | mit |
Daniel-CA/odoo | addons/lunch/report/__init__.py | 441 | 1087 | # -*- encoding: 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 G... | agpl-3.0 |
RevelSystems/django | django/contrib/admin/options.py | 8 | 80233 | import copy
import operator
from collections import OrderedDict
from functools import partial, reduce, update_wrapper
from django import forms
from django.conf import settings
from django.contrib import messages
from django.contrib.admin import helpers, widgets
from django.contrib.admin.checks import (
BaseModelAd... | bsd-3-clause |
halberom/ansible | lib/ansible/module_utils/openstack.py | 57 | 4600 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
ChopChopKodi/pelisalacarta | python/version-mediaserver/platformcode/controllers/html.py | 2 | 20795 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta
# Controlador para HTML
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import sys, os
from core import config
from core import logger
fro... | gpl-3.0 |
manazhao/tf_recsys | tensorflow/contrib/distributions/python/kernel_tests/operator_pd_diag_test.py | 72 | 3379 | # 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 |
rospogeo/rospogeo.github.io | rospogeo-map/vendors/openlayers/tests/selenium/remotecontrol/selenium.py | 254 | 69389 |
"""
Copyright 2006 ThoughtWorks, 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, sof... | mit |
NeCTAR-RC/nova | nova/api/openstack/compute/legacy_v2/contrib/console_output.py | 9 | 3811 | # Copyright 2011 OpenStack Foundation
# Copyright 2011 Grid Dynamics
# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.