repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
lhellebr/spacewalk | java/scripts/api/kickstarttests.py | 8 | 5508 | #!/usr/bin/python
import unittest
import random
from config import *
KICKSTART_FILE = """
# Kickstart file automatically generated by anaconda.
install
nfs --server=shell.boston.redhat.com --dir=/mnt/redhat/iso/f7-64
lang en_US.UTF-8
keyboard us
xconfig --startxonboot
network --device eth0 --bootproto dhcp --hostna... | gpl-2.0 |
openelections/openelections-core | openelex/api/base.py | 1 | 1772 | """OpenElex Api base wrapper"""
from future import standard_library
standard_library.install_aliases()
from collections import OrderedDict
from urllib.parse import urljoin
import requests
API_BASE_URL = "http://openelections.net/api/v1/"
BASE_PARAMS = ['format=json', 'limit=0']
def get(base_url=API_BASE_URL, resource... | mit |
dpetzold/django | tests/bash_completion/tests.py | 327 | 3888 | """
A series of tests to establish that the command-line bash completion works.
"""
import os
import sys
import unittest
from django.apps import apps
from django.core.management import ManagementUtility
from django.test.utils import captured_stdout
class BashCompletionTests(unittest.TestCase):
"""
Testing th... | bsd-3-clause |
rsvip/Django | tests/gis_tests/geo3d/models.py | 302 | 1294 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... | bsd-3-clause |
Itxaka/libcloud | libcloud/compute/drivers/cloudsigma.py | 2 | 67816 | # -*- coding: 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 Apache License, Version 2.0
# (the "Lic... | apache-2.0 |
imincik/pkg-qgis-1.8 | python/plugins/fTools/tools/doRegPoints.py | 2 | 7266 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------
#
# fTools
# Copyright (C) 2008-2011 Carson Farmer
# EMAIL: carson.farmer (at) gmail.com
# WEB : http://www.ftools.ca/fTools.html
#
# A collection of data management and analysis tools for vector data
#
#-----------------------------... | gpl-2.0 |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/files/apps/headphones/headphones/config.py | 6 | 19704 | import headphones.logger
import itertools
import os
import re
from configobj import ConfigObj
def bool_int(value):
"""
Casts a config value into a 0 or 1
"""
if isinstance(value, basestring):
if value.lower() in ('', '0', 'false', 'f', 'no', 'n', 'off'):
value = 0
return int(bo... | gpl-2.0 |
will-Do/tp-libvirt_v2v | libguestfs/tests/guestfish_lvm.py | 7 | 25965 | from autotest.client.shared import error, utils
from virttest import utils_test, utils_misc, data_dir
from virttest.tests import unattended_install
import logging
import shutil
import os
import re
def prepare_image(params):
"""
(1) Create a image
(2) Create file system on the image
"""
params["ima... | gpl-2.0 |
godfather1103/WeiboRobot | python27/1.0/lib/unittest/loader.py | 61 | 13501 | """Loading unittests."""
import os
import re
import sys
import traceback
import types
from functools import cmp_to_key as _CmpToKey
from fnmatch import fnmatch
from . import case, suite
__unittest = True
# what about .pyc or .pyo (etc)
# we would need to avoid loading the same tests multiple times
# from '.py', '.... | gpl-3.0 |
aaronorosen/horizon-congress | openstack_dashboard/dashboards/project/networks/ports/tables.py | 4 | 2995 | # Copyright 2012 NEC Corporation
#
# 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 ag... | apache-2.0 |
evidation-health/bokeh | bokeh/sphinxext/collapsible_code_block.py | 43 | 3128 | """ Display code blocks in collapsible sections when outputting
to HTML.
Usage
-----
This directive takes a heading to use for the collapsible code block::
.. collapsible-code-block:: python
:heading: Some Code
from __future__ import print_function
print("Hello, Bokeh!")
Options
------... | bsd-3-clause |
rozifus/TeamStrong13_4 | por/obstacle.py | 1 | 1320 | # everything to do with the rubies
import pyglet
import settings
import entity
import utils
from utils import Vec2d, Point, Rect
class Obstacle(entity.Entity):
"""
In case we want more than one type?
"""
IMAGE = settings.ANVIL_IMAGE
def collided(self, game):
game.die()
class InfiniteHei... | mit |
djw8605/campus-factory | python-lib/GlideinWMS/condorMonitor.py | 7 | 19973 | #
# Project:
# glideinWMS
#
# File Version:
# $Id: condorMonitor.py,v 1.10.8.1.2.2.6.1 2010/09/22 03:08:53 sfiligoi Exp $
#
# Description:
# This module implements classes to query the condor daemons
# and manipulate the results
# Please notice that it also converts \" into "
#
# Author:
# Igor Sfiligoi (A... | apache-2.0 |
tjhei/burnman | burnman/perplex.py | 1 | 14384 | # This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences
# Copyright (C) 2012 - 2017 by the BurnMan team, released under the GNU
# GPL v2 or later.
from __future__ import absolute_import
from __future__ import print_function
import warnings
from subprocess impor... | gpl-2.0 |
cnsoft/kbengine-cocos2dx | kbe/src/lib/python/Lib/test/regex_tests.py | 59 | 8992 | # Regex test suite and benchmark suite v1.5a2
# The 3 possible outcomes for each pattern
[SUCCEED, FAIL, SYNTAX_ERROR] = range(3)
# Benchmark suite (needs expansion)
#
# The benchmark suite does not test correctness, just speed. The
# first element of each tuple is the regex pattern; the second is a
# string to matc... | lgpl-3.0 |
40223231/2015-cdb-g4-final-test-by-6-22 | static/Brython3.1.1-20150328-091302/Lib/contextlib.py | 737 | 8788 | """Utilities for with-statement contexts. See PEP 343."""
import sys
from collections import deque
from functools import wraps
__all__ = ["contextmanager", "closing", "ContextDecorator", "ExitStack"]
class ContextDecorator(object):
"A base class or mixin that enables context managers to work as decorators."
... | gpl-3.0 |
anuveyatsu/dpr-api | tests/logic/test_classmethods.py | 2 | 7043 | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
import unittest
from app import create_app
from app.database import db
import app.logic as logic
import app.models as models
class PackageClass... | mit |
gangadhar-kadam/sms-wnframework | webnotes/widgets/form/load.py | 6 | 3757 | # Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com)
#
# MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without lim... | mit |
11craft/immercv | immercv/users/admin.py | 183 | 1048 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChan... | bsd-3-clause |
safnuk/todone | todone/commands/tests/test_setup.py | 1 | 3764 | from contextlib import redirect_stdout
import io
from unittest import TestCase
from unittest.mock import patch
from todone.backend import DatabaseError
from todone.commands.setup import setup_db, version
from todone import config, __version__
from todone.parser import exceptions as pe
class TestVersion(TestCase):
... | apache-2.0 |
jalaziz/django-cms-grappelli-old | cms/utils/admin.py | 2 | 3998 | # -*- coding: utf-8 -*-
from django.contrib.sites.models import Site
from django.conf import settings
from cms.utils.moderator import page_moderator_state, I_APPROVE
from cms.utils import get_language_from_request
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from cm... | bsd-3-clause |
RockySteveJobs/python-for-android | python3-alpha/python3-src/Lib/optparse.py | 45 | 60573 | """A powerful, extensible, and easy-to-use option parser.
By Greg Ward <gward@python.net>
Originally distributed as Optik.
For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).
Simple usage example:
from optparse import OptionParser
pa... | apache-2.0 |
filodej/django-filer | filer/tests/tools.py | 12 | 2995 | #-*- coding: utf-8 -*-
from django.core.files import File as DjangoFile
from django.test.testcases import TestCase
from filer.models import tools
from filer.models.clipboardmodels import Clipboard
from filer.models.foldermodels import Folder
from filer.models.imagemodels import Image
from filer.tests.helpers import cre... | bsd-3-clause |
titansgroup/python-phonenumbers | python/phonenumbers/data/region_NZ.py | 10 | 2889 | """Auto-generated file, do not edit by hand. NZ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_NZ = PhoneMetadata(id='NZ', country_code=64, international_prefix='0(?:0|161)',
general_desc=PhoneNumberDesc(national_number_pattern='6[235-9]\\d{6}|[2-57-9]\\d{7,10}'... | apache-2.0 |
GhostThrone/django | tests/forms_tests/widget_tests/test_nullbooleanselect.py | 179 | 2142 | from django.forms import NullBooleanSelect
from django.test import override_settings
from django.utils import translation
from .base import WidgetTest
class NullBooleanSelectTest(WidgetTest):
widget = NullBooleanSelect()
def test_render_true(self):
self.check_html(self.widget, 'is_cool', True, html=... | bsd-3-clause |
535521469/crawler_sth | scrapy/tests/test_utils_spider.py | 44 | 1083 | import unittest
from scrapy.http import Request
from scrapy.item import BaseItem
from scrapy.utils.spider import iterate_spider_output, iter_spider_classes
from scrapy.contrib.spiders import CrawlSpider
class MyBaseSpider(CrawlSpider):
pass # abstract spider
class MySpider1(MyBaseSpider):
name = 'myspider1'... | bsd-3-clause |
Dhivyap/ansible | lib/ansible/modules/cloud/google/gcp_compute_target_http_proxy.py | 3 | 13840 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 |
keedio/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/geos/mutable_list.py | 217 | 10972 | # Copyright (c) 2008-2009 Aryeh Leib Taurog, all rights reserved.
# Released under the New BSD license.
"""
This module contains a base type which provides list-style mutations
without specific data storage methods.
See also http://www.aryehleib.com/MutableLists.html
Author: Aryeh Leib Taurog.
"""
from django.utils.f... | apache-2.0 |
caisq/tensorflow | tensorflow/python/ops/linalg_ops.py | 10 | 23635 | # 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 |
breathe/ansible-modules-extras | web_infrastructure/jira.py | 78 | 10086 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Steve Smith <ssmith@atlassian.com>
# Atlassian open-source approval reference OSR-76.
#
# 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 ... | gpl-3.0 |
enthought/shiboken | tests/samplebinding/lock_test.py | 9 | 1608 | #!/usr/bin/env python
'''Simple test with a blocking C++ method that should allow python
threads to run.'''
import unittest
import threading
from sample import Bucket
class Unlocker(threading.Thread):
def __init__(self, bucket):
threading.Thread.__init__(self)
self.bucket = bucket
def ... | gpl-2.0 |
etuna-SBF-kog/Stadsparken | env/lib/python2.7/site-packages/django/contrib/admin/helpers.py | 84 | 13636 | from django import forms
from django.contrib.admin.util import (flatten_fieldsets, lookup_field,
display_for_field, label_for_field, help_text_for_field)
from django.contrib.admin.templatetags.admin_static import static
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import Ob... | gpl-3.0 |
kmee/account-invoicing | stock_picking_invoicing/tests/test_picking_invoicing.py | 21 | 3137 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Lorenzo Battistini <lorenzo.battistini@agilebg.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licens... | agpl-3.0 |
RevelSystems/django | django/contrib/auth/models.py | 104 | 17967 | from __future__ import unicode_literals
from django.contrib import auth
from django.contrib.auth.hashers import (
check_password, is_password_usable, make_password,
)
from django.contrib.auth.signals import user_logged_in
from django.contrib.contenttypes.models import ContentType
from django.core import validators... | bsd-3-clause |
NProfileAnalysisComputationalTool/npact | pynpact/pynpact/util.py | 1 | 9619 | import errno
import os
import os.path
import logging
import time
import hashlib
import tempfile
from contextlib import contextmanager
from functools import wraps
from path import Path
def reducehashdict(dict, keys):
"""pull the given keys out of the dictionary, return the reduced
dictionary and the sha1 hash ... | bsd-3-clause |
hcjcch/blogbyflask | app/api_1_0/users.py | 104 | 1702 | from flask import jsonify, request, current_app, url_for
from . import api
from ..models import User, Post
@api.route('/users/<int:id>')
def get_user(id):
user = User.query.get_or_404(id)
return jsonify(user.to_json())
@api.route('/users/<int:id>/posts/')
def get_user_posts(id):
user = User.query.get_or... | mit |
sacsant/avocado-misc-tests | generic/ipistorm.py | 4 | 4063 | #!/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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that... | gpl-2.0 |
jjdmol/LOFAR | CEP/PyBDSM/src/python/plotresults.py | 1 | 29164 | """Plotting module
This module is used to display fits results.
"""
from image import *
from . import has_pl
if has_pl:
import matplotlib.pyplot as pl
import matplotlib.cm as cm
import matplotlib.patches as mpatches
from matplotlib.widgets import Button
from matplotlib.patches import Ellipse
fr... | gpl-3.0 |
thinkopensolutions/geraldo | site/newsite/django_1_0/django/db/backends/postgresql_psycopg2/base.py | 14 | 3076 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures
from django.db.backends.postgresql.operations import DatabaseOperations as PostgresqlDatabaseOperations
from django.utils.safestring import Sa... | lgpl-3.0 |
Anik1199/android_kernel_mediatek_sprout | 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 |
schets/scikit-learn | sklearn/utils/_scipy_sparse_lsqr_backport.py | 378 | 18021 | """Sparse Equations and Least Squares.
The original Fortran code was written by C. C. Paige and M. A. Saunders as
described in
C. C. Paige and M. A. Saunders, LSQR: An algorithm for sparse linear
equations and sparse least squares, TOMS 8(1), 43--71 (1982).
C. C. Paige and M. A. Saunders, Algorithm 583; LSQR: Sparse... | bsd-3-clause |
jteehan/cfme_tests | cfme/intelligence/reports/menus.py | 5 | 4810 | # -*- coding: utf-8 -*-
"""Module handling report menus contents"""
from contextlib import contextmanager
from . import Report
from cfme.fixtures import pytest_selenium as sel
from cfme.intelligence.reports.ui_elements import FolderManager
from cfme.web_ui import Region, BootstrapTreeview, Tree, accordion, form_button... | gpl-2.0 |
ofayans/freeipa | ipaserver/plugins/pkinit.py | 1 | 2832 | # Authors:
# Simo Sorce <ssorce@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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 |
feist/pcs | pcs/lib/env_tools.py | 1 | 1365 | from pcs.lib.cib.resource import remote_node, guest_node
from pcs.lib.xml_tools import get_root
def get_existing_nodes_names(corosync_conf=None, cib=None):
return __get_nodes_names(*__get_nodes(corosync_conf, cib))
def get_existing_nodes_names_addrs(corosync_conf=None, cib=None):
corosync_nodes, remote_and_g... | gpl-2.0 |
nanolearningllc/edx-platform-cypress | lms/djangoapps/instructor_analytics/tests/test_distributions.py | 165 | 5109 | """ Tests for analytics.distributions """
from django.test import TestCase
from nose.tools import raises
from student.models import CourseEnrollment
from student.tests.factories import UserFactory
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from instructor_analytics.distributions import profile_dist... | agpl-3.0 |
klahnakoski/TestLog-ETL | vendor/mo_hg/relay/app.py | 2 | 3084 | # encoding: utf-8
#
# 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 absolute_import, division, unicode_literals
import os
import flask
from fl... | mpl-2.0 |
heke123/chromium-crosswalk | tools/flakiness/is_flaky.py | 84 | 2006 | #!/usr/bin/env python
# Copyright 2014 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.
"""Runs a test repeatedly to measure its flakiness. The return code is non-zero
if the failure rate is higher than the specified thresh... | bsd-3-clause |
tectronics/lector | lector/editor/spellchecker.py | 6 | 1392 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Lector: spellchecker.py
Copyright (C) 2009, John Schember
Modified for Lector by Zdenko Podobný
This code is released under MIT licence
"""
import re
from PyQt4.Qt import Qt, QAction
from PyQt4.Qt import QSyntaxHighlighter, QTextCharFormat
from PyQt4... | gpl-2.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-64/15-files/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## 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 |
abtink/openthread | tools/harness-automation/cases_R140/leader_7_1_6.py | 9 | 1876 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | bsd-3-clause |
sgraham/nope | tools/prepare-bisect-perf-regression.py | 84 | 2403 | #!/usr/bin/env python
# Copyright (c) 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.
"""Prepare Performance Test Bisect Tool
This script is used by a try bot to create a working directory and sync an
initial copy of... | bsd-3-clause |
sunu/oh-missions-oppia-beta | extensions/rules/tar_file_string_test.py | 4 | 5041 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
saurabh6790/test-frappe | frappe/model/__init__.py | 28 | 2474 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# model __init__.py
from __future__ import unicode_literals
import frappe
import json
no_value_fields = ('Section Break', 'Column Break', 'HTML', 'Table', 'Button', 'Image', 'Fold', 'Heading')
display_fieldtypes = ('S... | mit |
Azulinho/ansible | test/units/modules/cloud/amazon/test_data_pipeline.py | 23 | 10635 | # (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 dis... | gpl-3.0 |
chornsby/hayes | hayes/indexing.py | 1 | 4216 | # -- encoding: UTF-8 --
from hayes.analysis import AnalysisBase, builtin_simple_analyzer
from hayes.utils import object_to_dict
class DocumentIndex(object):
name = None
fields = {}
enable_source = True
enable_size = False
enable_timestamp = False
def get_model(self): # For Django compat.
return None
def g... | mit |
jjalling/domoticz | plugins/examples/DenonMarantz.py | 15 | 23003 | #
# Denon AVR 4306 Plugin
#
# Author: Dnpwwo, 2016 - 2017
#
# Mode4 ("Sources") needs to have '|' delimited names of sources that the Denon knows about. The Selector can be changed afterwards to any text and the plugin will still map to the actual Denon name.
#
"""
<plugin key="Denon4306" version="3... | gpl-3.0 |
Hamza5/Basic-Regular-Expressions-Tester | GUI/bret_gui.py | 1 | 30151 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'GUI/bret.ui'
#
# Created: Thu Sep 18 22:16:21 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attri... | gpl-3.0 |
jessstrap/servotk | tests/wpt/run.py | 40 | 2301 | # 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/.
import multiprocessing
import os
import sys
import mozlog
import grouping_formatter
here = os.path.split(__file__)[0]
s... | mpl-2.0 |
sinkpoint/dipy | dipy/tracking/markov.py | 10 | 17454 | # -*- coding: utf-8 -*-
"""Implemention of various Tractography methods
these tools are meant to be paired with diffusion reconstruction methods from
dipy.reconst
This module uses the trackvis coordinate system, for more information about
this coordinate system please see dipy.tracking.utils
The following modules als... | bsd-3-clause |
rmboggs/django | django/contrib/admin/templatetags/admin_urls.py | 553 | 1812 | from django import template
from django.contrib.admin.utils import quote
from django.core.urlresolvers import Resolver404, get_script_prefix, resolve
from django.utils.http import urlencode
from django.utils.six.moves.urllib.parse import parse_qsl, urlparse, urlunparse
register = template.Library()
@register.filter
... | bsd-3-clause |
drammock/mne-python | tutorials/machine-learning/30_strf.py | 10 | 14437 | # -*- coding: utf-8 -*-
"""
=====================================================================
Spectro-temporal receptive field (STRF) estimation on continuous data
=====================================================================
This demonstrates how an encoding model can be fit with multiple continuous
input... | bsd-3-clause |
bakhtout/odoo-educ | addons/account/report/account_partner_balance.py | 286 | 11049 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
trondhindenes/ansible | test/integration/targets/async_fail/action_plugins/normal.py | 152 | 2566 | # (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 |
jaggu303619/asylum-v2.0 | openerp/addons/point_of_sale/report/pos_lines.py | 61 | 2251 | # -*- 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 |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/tablib/packages/yaml/scanner.py | 434 | 52630 |
# Scanner produces tokens of the following types:
# STREAM-START
# STREAM-END
# DIRECTIVE(name, value)
# DOCUMENT-START
# DOCUMENT-END
# BLOCK-SEQUENCE-START
# BLOCK-MAPPING-START
# BLOCK-END
# FLOW-SEQUENCE-START
# FLOW-MAPPING-START
# FLOW-SEQUENCE-END
# FLOW-MAPPING-END
# BLOCK-ENTRY
# FLOW-ENTRY
# KEY
# VALUE
# AL... | mit |
Fl0rianFischer/sme_odoo | addons/hr_expense/__openerp__.py | 23 | 1789 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Expense Tracker',
'version': '2.0',
'category': 'Human Resources',
'sequence': 95,
'summary': 'Expenses Validation, Invoicing',
'description': """
Manage expenses by Employees
========... | gpl-3.0 |
cdorer/crits | crits/core/management/commands/create_default_dashboard.py | 21 | 3882 | from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
"""
Script Class.
"""
option_list = BaseCommand.option_list + (
make_option('--drop',
'-d',
dest='drop',
action="store_tru... | mit |
Teagan42/home-assistant | tests/components/zwave/test_climate.py | 2 | 32574 | """Test Z-Wave climate devices."""
import pytest
from homeassistant.components.climate.const import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
CURRENT_HVAC_COOL,
CURRENT_HVAC_HEAT,
HVAC_MODE_COOL,
HVAC_MODE_HEAT,
HVAC_MODE_HEAT_COOL,
HVAC_MODE_OFF,
HVAC_MODES,
PRESET_AWAY,
... | apache-2.0 |
dbckz/ansible | lib/ansible/plugins/terminal/asa.py | 57 | 2408 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
havard024/prego | crm/lib/python2.7/site-packages/whoosh/matching/binary.py | 94 | 24452 | # Copyright 2010 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | mit |
912/M-new | virtualenvironment/experimental/lib/python2.7/site-packages/django/contrib/admin/tests.py | 19 | 6158 | import os
from unittest import SkipTest
from django.contrib.staticfiles.testing import StaticLiveServerCase
from django.utils.module_loading import import_string
from django.utils.translation import ugettext as _
class AdminSeleniumWebDriverTestCase(StaticLiveServerCase):
available_apps = [
'django.cont... | gpl-2.0 |
frobnitzem/forcesolve | cg_topol/edge.py | 1 | 3933 | # Edge creation logic
def add_edge(edge, i, j):
if i < j:
edge.add((i,j))
else:
edge.add((j,i))
def srt2(i,j):
if i > j:
return j,i
return i,j
def add_all_redge(edge, pdb, res_table, oi, ai, oj, aj):
mino = min(oi,oj)
maxo = max(oi,oj)
for i in reversed(range(len(re... | gpl-3.0 |
ryfeus/lambda-packs | Keras_tensorflow_nightly/source2.7/numpy/distutils/mingw32ccompiler.py | 4 | 25201 | """
Support code for building Python extensions on Windows.
# NT stuff
# 1. Make sure libpython<version>.a exists for gcc. If not, build it.
# 2. Force windows to use gcc (we're struggling with MSVC and g77 support)
# 3. Force windows to use g77
"""
from __future__ import division, absolute_import, p... | mit |
loopCM/chromium | third_party/tlslite/tlslite/X509CertChain.py | 76 | 9052 | """Class representing an X.509 certificate chain."""
from utils import cryptomath
from X509 import X509
class X509CertChain:
"""This class represents a chain of X.509 certificates.
@type x509List: list
@ivar x509List: A list of L{tlslite.X509.X509} instances,
starting with the end-entity certificate ... | bsd-3-clause |
anurag03/integration_tests | cfme/utils/apidoc.py | 4 | 1823 | """Sphinx plugin for automatically generating (and optionally cleaning) project api documentation
To enable the optional cleaning, set ``clean_autogenerated_docs`` to ``True`` in docs/conf.py
"""
import subprocess
from sphinx.util.console import bold, red
from cfme.utils.path import docs_path, project_path
# When ... | gpl-2.0 |
merutak/python-social-auth | social/backends/loginradius.py | 83 | 2617 | """
LoginRadius BaseOAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/loginradius.html
"""
from social.backends.oauth import BaseOAuth2
class LoginRadiusAuth(BaseOAuth2):
"""LoginRadius BaseOAuth2 authentication backend."""
name = 'loginradius'
ID_KEY = 'ID'
ACCESS_TOKEN_URL = 'h... | bsd-3-clause |
mark-me/Pi-Jukebox | venv/Lib/site-packages/pip-19.0.3-py3.7.egg/pip/_vendor/urllib3/util/__init__.py | 204 | 1044 | from __future__ import absolute_import
# For backwards compatibility, provide imports that used to be here.
from .connection import is_connection_dropped
from .request import make_headers
from .response import is_fp_closed
from .ssl_ import (
SSLContext,
HAS_SNI,
IS_PYOPENSSL,
IS_SECURETRANSPORT,
as... | agpl-3.0 |
cswiercz/sympy | sympy/physics/unitsystems/tests/test_unitsystem.py | 92 | 2822 | # -*- coding: utf-8 -*-
from sympy.physics.unitsystems.dimensions import Dimension, DimensionSystem
from sympy.physics.unitsystems.units import Unit, UnitSystem
from sympy.physics.unitsystems.quantities import Quantity
from sympy.utilities.pytest import raises
length = Dimension(name="length", symbol="L", length=1)
m... | bsd-3-clause |
spektom/incubator-airflow | tests/providers/google/cloud/operators/test_sftp_to_gcs_system.py | 4 | 1875 | #
# 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 |
Azure/azure-sdk-for-python | sdk/securityinsight/azure-mgmt-securityinsight/azure/mgmt/securityinsight/aio/operations/_alert_rule_templates_operations.py | 1 | 9059 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
osamirabo/kaggle-youtube | convert_prediction_from_json_to_csv.py | 15 | 3247 | # Copyright 2016 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 applicable law or ... | apache-2.0 |
scottlittle/nolearn | nolearn/lasagne/visualize.py | 3 | 7850 | from itertools import product
from lasagne.layers import get_output
import matplotlib.pyplot as plt
import numpy as np
import theano
import theano.tensor as T
def plot_loss(net):
train_loss = [row['train_loss'] for row in net.train_history_]
valid_loss = [row['valid_loss'] for row in net.train_history_]
... | mit |
NeCTAR-RC/horizon | openstack_dashboard/dashboards/admin/networks/forms.py | 1 | 15955 | # Copyright 2012 NEC Corporation
#
# 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 ag... | apache-2.0 |
ucldc/harvester | scripts/external-redirect-get-solr_prod-id.py | 1 | 4313 | #! /bin/env python
# -*- coding: utf-8 -*-
# Use when Calisphere Object URLs for a collection change, to generate
# a redirect file mapping 'old' (on SOLR-PROD) to 'new' (on SOLR-TEST) URLs.
#
# This script takes a Collection ID and a 'match' field in SOLR (i.e. best
# field to use for matching SOLR-PROD record to cor... | bsd-3-clause |
rodrigosurita/GDAd | sdaps/setup/pdftools/pdfpath.py | 1 | 2761 | # pdftools - A library of classes for parsing and rendering PDF documents.
# Copyright(C) 2001-2008 by David Boddie
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 ... | gpl-3.0 |
Sparkey67/android_kernel_lge_g3 | tools/perf/util/setup.py | 4998 | 1330 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
italomandara/JZ80 | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input.py | 53 | 115735 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
asadziach/tensorflow | tensorflow/contrib/bayesflow/python/ops/entropy.py | 85 | 1246 | # 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 |
ymcagodme/Norwalk-Judo | django/contrib/gis/gdal/srs.py | 291 | 11717 | """
The Spatial Reference class, represensents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print srs
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORI... | bsd-3-clause |
samuelchong/libcloud | libcloud/test/common/test_cloudstack.py | 4 | 7293 | # 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 use ... | apache-2.0 |
fldc/CouchPotatoServer | libs/tornado/auth.py | 102 | 61853 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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... | gpl-3.0 |
garvitr/sympy | sympy/stats/crv_types.py | 22 | 60361 | """
Continuous Random Variables - Prebuilt variables
Contains
========
Arcsin
Benini
Beta
BetaPrime
Cauchy
Chi
ChiNoncentral
ChiSquared
Dagum
Erlang
Exponential
FDistribution
FisherZ
Frechet
Gamma
GammaInverse
Kumaraswamy
Laplace
Logistic
LogNormal
Maxwell
Nakagami
Normal
Pareto
QuadraticU
RaisedCosine
Rayleigh
Studen... | bsd-3-clause |
dracos/django | django/contrib/contenttypes/checks.py | 107 | 1234 | from itertools import chain
from django.apps import apps
from django.core.checks import Error
def check_generic_foreign_keys(app_configs=None, **kwargs):
from .fields import GenericForeignKey
if app_configs is None:
models = apps.get_models()
else:
models = chain.from_iterable(app_config... | bsd-3-clause |
f3r/scikit-learn | examples/model_selection/grid_search_text_feature_extraction.py | 99 | 4163 |
"""
==========================================================
Sample pipeline for text feature extraction and evaluation
==========================================================
The dataset used in this example is the 20 newsgroups dataset which will be
automatically downloaded and then cached and reused for the d... | bsd-3-clause |
pnedunuri/scikit-learn | examples/decomposition/plot_image_denoising.py | 181 | 5819 | """
=========================================
Image denoising using dictionary learning
=========================================
An example comparing the effect of reconstructing noisy fragments
of the Lena image using firstly online :ref:`DictionaryLearning` and
various transform methods.
The dictionary is fitted o... | bsd-3-clause |
robinro/ansible | lib/ansible/modules/cloud/cloudstack/cs_network_acl.py | 27 | 6173 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2017, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
jaysuk/Printrun | printrun/gcodeplater.py | 2 | 10956 | #!/usr/bin/env python3
# This file is part of the Printrun suite.
#
# Printrun 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.
#
# Pri... | gpl-3.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/docutils/parsers/rst/directives/html.py | 128 | 3098 | # $Id: html.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Directives for typically HTML-specific constructs.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import nodes, utils
from docutils.parsers... | bsd-3-clause |
raviflipsyde/servo | tests/wpt/web-platform-tests/tools/py/testing/path/test_svnauth.py | 163 | 16079 | import py
import svntestbase
from py.path import SvnAuth
import time
import sys
svnbin = py.path.local.sysfind('svn')
def make_repo_auth(repo, userdata):
""" write config to repo
user information in userdata is used for auth
userdata has user names as keys, and a tuple (password, readwrite) as
... | mpl-2.0 |
capone212/crashtec | src/crashtec/cdbprocessor/resultspublisher.py | 1 | 2569 | '''
Created on 04.05.2013
@author: capone
'''
from crashtec.db.provider import routines as dbroutines
from crashtec.db.schema.fields import PRIMARY_KEY_FIELD
import dbmodel
# Utility class which used to make hack with meta-classes. See results_metaclass()
class Acceptor(object):
def __init__(self, class_name)... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.