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 |
|---|---|---|---|---|---|
agutieda/QuantEcon.py | quantecon/tests/test_matrix_eqn.py | 7 | 1050 | """
tests for quantecon.util
"""
from __future__ import division
from collections import Counter
import unittest
import numpy as np
from numpy.testing import assert_allclose
from nose.plugins.attrib import attr
import pandas as pd
from quantecon import matrix_eqn as qme
def test_solve_discrete_lyapunov_zero():
'... | bsd-3-clause |
vv1133/home_web | django/db/backends/postgresql_psycopg2/creation.py | 60 | 3814 | from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.util import truncate_name
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their associated PostgreSQL column
# types, as strings. Column-type strings can contain format strings; they'll
... | bsd-3-clause |
christoph-buente/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py | 119 | 29255 | # 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 |
tyagiarpit/servo | python/mach/mach/test/providers/conditions.py | 128 | 1324 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import unicode_literals
from mach.decorators import (
CommandProvider,
Command,
)
def is_foo(c... | mpl-2.0 |
WimPessemier/uaf | unittests/pyuaftests/client/client_discovery.py | 3 | 2861 | import pyuaf
import unittest
from pyuaf.util.unittesting import parseArgs, TestResults
import thread, time
ARGS = parseArgs()
def suite(args=None):
if args is not None:
global ARGS
ARGS = args
return unittest.TestLoader().loadTestsFromTestCase(ClientDiscoveryTest)
def testParalle... | lgpl-3.0 |
Endika/django | tests/update/models.py | 282 | 1196 | """
Tests for the update() queryset method that allows in-place, multi-object
updates.
"""
from django.db import models
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class DataPoint(models.Model):
name = models.CharField(max_length=20)
... | bsd-3-clause |
ixs/func | func/yaml/load.py | 12 | 10649 | """
pyyaml legacy
Copyright (c) 2001 Steve Howell and Friends; All Rights Reserved
(see open source license information in docs/ directory)
"""
import re, string
from implicit import convertImplicit
from inline import InlineTokenizer
from klass import DefaultResolver
from stream import YamlLoaderException, F... | gpl-2.0 |
Itxaka/st2 | st2actions/st2actions/runners/python_action_wrapper.py | 6 | 4417 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... | apache-2.0 |
lupyuen/RaspberryPiImage | home/pi/GrovePi/Software/Python/others/temboo/Library/Amazon/IAM/ListVirtualMFADevices.py | 5 | 4701 | # -*- coding: utf-8 -*-
###############################################################################
#
# ListVirtualMFADevices
# Lists the virtual MFA devices under the AWS account.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
... | apache-2.0 |
wbond/subversion | contrib/hook-scripts/case-insensitive.py | 3 | 4628 | #!/usr/bin/env python
# Licensed under the same terms as Subversion.
# A pre-commit hook to detect case-insensitive filename clashes.
#
# What this script does:
# - Detects new paths that 'clash' with existing, or other new, paths.
# - Ignores existings paths that already 'clash'
# - Exits with an error code, and ... | apache-2.0 |
tlakshman26/cinder-bug-fix-volume-conversion-full | cinder/objects/volume.py | 2 | 13218 | # Copyright 2015 SimpliVity 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 o... | apache-2.0 |
leighpauls/k2cro4 | third_party/python_26/Lib/site-packages/win32/scripts/regsetup.py | 21 | 19756 | # A tool to setup the Python registry.
class error(Exception):
pass
import sys # at least we can count on this!
def FileExists(fname):
"""Check if a file exists. Returns true or false.
"""
import os
try:
os.stat(fname)
return 1
except os.error, details:
return 0
def ... | bsd-3-clause |
leki75/ansible | lib/ansible/modules/monitoring/nagios.py | 71 | 36457 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This file is largely copied from the Nagios module included in the
# Func project. Original copyright follows:
#
# func-nagios - Schedule downtime and enables/disable notifications
# Copyright 2011, Red Hat, Inc.
# Tim Bielawa <tbielawa@redhat.com>
#
# This software may be ... | gpl-3.0 |
yinwenpeng/rescale | en/parser/nltk_lite/stem/regexp.py | 9 | 1677 | # Natural Language Toolkit: Stemmers
#
# Copyright (C) 2001-2006 University of Melbourne
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# Edward Loper <edloper@gradient.cis.upenn.edu>
# Steven Bird <sb@csse.unimelb.edu.au>
# URL: <http://nltk.sf.net>
# For license information, see LICENSE.TXT
from en.parse... | gpl-3.0 |
ajnirp/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/testdata/handlers/sub/plain_wsh.py | 499 | 1789 | # Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
waveform80/ctutils | ctutils/ctinfo.py | 1 | 2101 | # vim: set et sw=4 sts=4 fileencoding=utf-8:
# Copyright 2014 Dave Jones <dave@waveform.org.uk>.
#
# This file is part of ctutils.
#
# ctutils 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 ... | gpl-3.0 |
mohamed--abdel-maksoud/chromium.src | tools/real_world_impact/nsfw_urls.py | 113 | 2143 | # 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.
"""NSFW urls in the Alexa top 2000 sites."""
nsfw_urls = set([
"http://xhamster.com/",
"http://xvideos.com/",
"http://livejasmin.com/",
"http://pornh... | bsd-3-clause |
manterd/myPhyloDB | functions/analysis/spls_graphs.py | 1 | 32640 | import datetime
from django.http import HttpResponse
import logging
import pandas as pd
from pyper import *
from scipy import stats
import json
from database.models import Kingdom, Phyla, Class, Order, Family, Genus, Species, OTU_99, \
ko_lvl1, ko_lvl2, ko_lvl3, \
nz_lvl1, nz_lvl2, nz_lvl3, nz_lvl4
import fun... | gpl-3.0 |
KodiColdkeys/coldkeys-addons | repository/plugin.video.white.devil/resources/lib/sources/afdah_wp.py | 6 | 3239 | # -*- coding: utf-8 -*-
'''
Exodus Add-on
Copyright (C) 2016 Exodus
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 l... | gpl-2.0 |
conejoninja/xbmc-seriesly | servers/zippyshare.py | 1 | 2002 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# seriesly - XBMC Plugin
# Conector para zippyshare
# http://blog.tvalacarta.info/plugin-xbmc/seriesly/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core import scrap... | gpl-3.0 |
kaldaris/WIDzard-A850K | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
harayz/raspberry_pwn | src/pentest/sqlmap/plugins/dbms/oracle/fingerprint.py | 7 | 3732 | #!/usr/bin/env python
"""
Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import re
from lib.core.common import Backend
from lib.core.common import Format
from lib.core.data import conf
from lib.core.data import kb
from lib.core.data import logger
... | gpl-3.0 |
nischalshrestha/recognize | lib/simplejson/tests/test_item_sort_key.py | 140 | 1127 | from unittest import TestCase
import simplejson as json
from operator import itemgetter
class TestItemSortKey(TestCase):
def test_simple_first(self):
a = {'a': 1, 'c': 5, 'jack': 'jill', 'pick': 'axe', 'array': [1, 5, 6, 9], 'tuple': (83, 12, 3), 'crate': 'dog', 'zeak': 'oh'}
self.assertEqual(
... | mit |
salaria/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/NewReport.py | 384 | 3903 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... | agpl-3.0 |
istehem/laundry_booking_bot | classes.py | 1 | 1814 | class calendar:
def __repr__(self):
def color(text):
colors = {
'BLUE' : '\033[94m',
'GREEN' : '\033[92m',
'YELLOW' : '\033[93m',
'RED' : '\033[91m',
'ENDC' : '\033[0m'
... | bsd-3-clause |
J-Liu/qemu | scripts/tracetool/format/tcg_helper_wrapper_h.py | 24 | 2167 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generate trace/generated-helpers-wrappers.h.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2016, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__... | gpl-2.0 |
shakamunyi/tensorflow | tensorflow/__init__.py | 81 | 1481 | # 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 |
Jorge-Rodriguez/ansible | lib/ansible/modules/cloud/azure/azure_rm_sqlfirewallrule.py | 22 | 9610 | #!/usr/bin/python
#
# Copyright (c) 2017 Zim Kalinowski, <zikalino@microsoft.com>
#
# 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',
... | gpl-3.0 |
shubhdev/edx-platform | cms/djangoapps/contentstore/views/tests/test_entrance_exam.py | 83 | 12383 | """
Test module for Entrance Exams AJAX callback handler workflows
"""
import json
from mock import patch
from django.conf import settings
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from contentstore.tests.utils import AjaxEnabledTestClient, CourseTestCase
from contentst... | agpl-3.0 |
jtauber/dcpu16py | terminals/curses_terminal.py | 3 | 2833 | import curses
class Terminal:
style_bold = False
keymap = {'A': 0x3, 'C': 0x2, 'D': 0x1}
def setup_colors(self):
curses.start_color()
curses.use_default_colors()
self.colors = {}
self.colors[(0, 0)] = 0
self.colors[(7, 0)] = 0
self.color_index = 1
s... | mit |
laslabs/odoo-connector-carepoint | connector_carepoint/unit/mapper.py | 1 | 4874 | # -*- coding: utf-8 -*-
# Copyright 2015-2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.addons.connector.unit.mapper import (mapping,
changed_by,
ImportMapper,
... | agpl-3.0 |
kurli/crosswalk | app/tools/android/gyp/jar.py | 4 | 1783 | #!/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.
# pylint: disable=F0401
import fnmatch
import optparse
import os
import sys
from util import build_utils
from util import md5_check
... | bsd-3-clause |
HumanExposure/factotum | dashboard/tests/unit/test_product_to_puc.py | 1 | 8439 | from django.db.utils import IntegrityError
from django.test import TestCase, tag
from dashboard.models import Product, PUC, ProductToPUC, ProductUberPuc, PUCKind
from dashboard.tests.loader import load_model_objects, fixtures_standard
from dashboard.views.product_curation import ProductForm
import time
@tag("puc")
... | gpl-3.0 |
cmeeren/apexpy | setup.py | 1 | 3229 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
import io
import re
from glob import glob
from os import path, environ
from setuptools import find_packages
# Include extensions only when not on readthedocs.org
if environ.get('READTHEDOCS', None) == 'True':
from setuptools i... | mit |
chengjf/database-interface-doc-management | flask-demo/flask/Lib/site-packages/pip/_vendor/progress/helpers.py | 404 | 2894 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | apache-2.0 |
letmaik/lensfunpy | test/tests.py | 2 | 5821 | import numpy as np
import lensfunpy as lensfun
import gc
from numpy.testing.utils import assert_equal
# the following strings were taken from the lensfun xml files
cam_maker = 'NIKON CORPORATION'
cam_model = 'NIKON D3S'
lens_maker = 'Nikon'
lens_model = 'Nikon AI-S Nikkor 28mm f/2.8'
def testDatabaseLoading():
db... | mit |
tjsavage/tmrwmedia | djangotoolbox/fields.py | 7 | 10758 | # All fields except for BlobField written by Jonas Haag <jonas@lophus.org>
from django.db import models
from django.core.exceptions import ValidationError
from django.utils.importlib import import_module
__all__ = ('RawField', 'ListField', 'DictField', 'SetField',
'BlobField', 'EmbeddedModelField')
class ... | bsd-3-clause |
OndroNR/ga-bitbot | gts.py | 16 | 20392 |
"""
gts v0.01
genetic test sequencer
Copyright 2011 Brian Monkaba
This file is part of ga-bitbot.
ga-bitbot 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 |
SUSE/azure-sdk-for-python | azure-mgmt-resource/azure/mgmt/resource/policy/v2016_04_01/operations/policy_assignments_operations.py | 2 | 30831 | # 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 ... | mit |
ipashchenko/uvmod | uvmod/utils.py | 1 | 8522 | import math
import psycopg2
import numpy as np
mas_to_rad = 4.8481368 * 1E-09
n_q = 0.637
vfloat = np.vectorize(float)
band_cm_dict = {'c': 6., 'l': 18., 'p': 94., 'k': 1.35}
SEFD_dict = {'RADIO-AS': {'K': {'L': 46700., 'R': 36800},
'C': {'L': 11600., 'R': None},
'L... | mit |
hslee16/ansible-modules-extras | monitoring/rollbar_deployment.py | 138 | 3898 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014, Max Riveiro, <kavu13@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... | gpl-3.0 |
bartvm/pylearn2 | pylearn2/scripts/papers/jia_huang_wkshp_11/fit_final_model.py | 44 | 3913 | from __future__ import print_function
import numpy as np
from optparse import OptionParser
from pylearn2.models.independent_multiclass_logistic import IndependentMulticlassLogistic
from galatea.s3c.feature_loading import get_features
from pylearn2.utils import serial
from pylearn2.datasets.cifar10 import CIFAR10
from ... | bsd-3-clause |
4eek/edx-platform | common/djangoapps/enrollment/tests/fake_data_api.py | 104 | 3705 | """
A Fake Data API for testing purposes.
"""
import copy
import datetime
_DEFAULT_FAKE_MODE = {
"slug": "honor",
"name": "Honor Code Certificate",
"min_price": 0,
"suggested_prices": "",
"currency": "usd",
"expiration_datetime": None,
"description": None
}
_ENROLLMENTS = []
_COURSES = [... | agpl-3.0 |
russellgeoff/blog | Control/Controllers/gc.py | 4 | 2183 | '''
Copyright (C) 2013 Travis DeWolf
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 distributed in the hope t... | gpl-3.0 |
willingc/oh-mainline | vendor/packages/django-extensions/django_extensions/management/commands/passwd.py | 41 | 1180 | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
import getpass
class Command(BaseCommand):
help = "Clone of the UNIX program ``passwd'', for django.contrib.auth."
requires_model_validation = False
def handle(self, *args, **options):
i... | agpl-3.0 |
dorianpula/paramiko | demos/demo.py | 36 | 5396 | #!/usr/bin/env python
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.... | lgpl-2.1 |
hyqneuron/pylearn2-maxsom | pylearn2/training_algorithms/tests/test_learning_rule.py | 12 | 9942 | import numpy as np
from theano.compat.six.moves import zip as izip
from pylearn2.costs.cost import SumOfCosts
from pylearn2.testing.cost import SumOfOneHalfParamsSquared
from pylearn2.testing.cost import SumOfParams
from pylearn2.testing.datasets import ArangeDataset
from pylearn2.training_algorithms.sgd import SGD
f... | bsd-3-clause |
cuongnv23/ansible | lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py | 22 | 12128 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
nushio3/ghc | .arc-linters/check-cpp.py | 6 | 1090 | #!/usr/bin/env python
# A linter to warn for ASSERT macros which are separated from their argument
# list by a space, which Clang's CPP barfs on
import sys
import logging
import os
import json
import re
def setup_logging(logger):
"""
``arc lint`` makes it quite tricky to catch debug output from linters.
... | bsd-3-clause |
cldmnky/salt-vault | _states/vault.py | 2 | 2512 | # -*- coding: utf-8 -*-
'''
:maintainer: Calle Pettersson <cpettsson@gmail.com>
:maturity: new
:depends: python-requests
:platform: all
Interact with Hashicorp Vault
'''
import logging
import difflib
import salt.exceptions
log = logging.getLogger(__name__)
def policy_present(name, rules):
url ... | apache-2.0 |
johren/RackHD | test/util/display_node_firmware_versions.py | 12 | 10942 | '''
Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
Purpose:
This is a utility to display variuos node firmware and manufacturer info.
'''
import fit_path # NOQA: unused import
import json
import pprint
import fit_common
import test_api_utils
# Globals
NODELIST = fit_common.node_select()
if ... | apache-2.0 |
probablytom/tomwallis.net | venv/lib/python2.7/site-packages/django/db/models/fields/related.py | 21 | 105184 | from __future__ import unicode_literals
from operator import attrgetter
from django.apps import apps
from django.core import checks
from django.db import connection, connections, router, transaction
from django.db.backends import utils
from django.db.models import signals, Q
from django.db.models.deletion import SET_... | artistic-2.0 |
1st/django | django/contrib/auth/tests/custom_user.py | 463 | 3662 | from django.contrib.auth.models import (
AbstractBaseUser, AbstractUser, BaseUserManager, Group, Permission,
PermissionsMixin, UserManager,
)
from django.db import models
# The custom User uses email as the unique identifier, and requires
# that every user provide a date of birth. This lets us test
# changes ... | bsd-3-clause |
gohin/django | tests/admin_views/models.py | 87 | 24003 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import tempfile
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.e... | bsd-3-clause |
mikeyarce/subscriptions-checkout-for-woocommerce | node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | 5099 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | gpl-2.0 |
shubhamgupta123/erpnext | erpnext/hr/report/employee_birthday/employee_birthday.py | 120 | 1328 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import flt
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
dat... | gpl-3.0 |
yoki/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/handlers/queuecharts.py | 122 | 6724 | # Copyright (C) 2013 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 |
Cinntax/home-assistant | homeassistant/components/magicseaweed/sensor.py | 1 | 6433 | """Support for magicseaweed data from magicseaweed.com."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_API_KEY,
CONF_NAME,
CONF_MONITORED_CONDITIONS,
ATTR_ATTRIBUTION,
)
import ... | apache-2.0 |
SingTel-DataCo/incubator-superset | superset/views/base.py | 2 | 10977 | import functools
import json
import logging
import traceback
from flask import g, redirect, Response, flash, abort
from flask_babel import gettext as __
from flask_appbuilder import BaseView
from flask_appbuilder import ModelView
from flask_appbuilder.widgets import ListWidget
from flask_appbuilder.actions import act... | apache-2.0 |
msebire/intellij-community | python/lib/Lib/encodings/mbcs.py | 860 | 1211 | """ Python 'mbcs' Codec for Windows
Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs... | apache-2.0 |
zycdragonball/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/dataframe_test.py | 62 | 3753 | # 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 |
distributed-system-analysis/sarjitsu | lib/backend/src/data_processor.py | 1 | 1591 | import os
import subprocess
import extract_sa
from app import app
from scripts.satools import oscode
def prepare(sessionID, target, sa_filename, q):
file_metadata = "file_metadata:%s:%s" % (sessionID, sa_filename)
SA_FILEPATH = os.path.join(target, sa_filename)
res = oscode.determine_version(file_path=SA_... | gpl-3.0 |
MilchReis/PicSort | src/core/input.py | 1 | 1653 | # -*- coding: utf-8 -*-
'''
@author: nick
'''
import pygame
class InputProcessor():
def __init__(self, appModel):
self.model = appModel
def process(self, event):
if event.type == pygame.QUIT:
self.model.closeWindow()
if event.type == pygame.KEYDOWN and even... | gpl-2.0 |
luzpaz/QGIS | tests/src/python/test_qgsmessagelog.py | 15 | 3441 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMessageLog.
.. note:: 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.
"""
__a... | gpl-2.0 |
playm2mboy/edx-platform | lms/djangoapps/class_dashboard/tests/test_views.py | 133 | 4061 | """
Tests for class dashboard (Metrics tab in instructor dashboard)
"""
import json
from django.test.client import RequestFactory
from mock import patch
from nose.plugins.attrib import attr
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestC... | agpl-3.0 |
JioCloud/nova | nova/api/openstack/compute/contrib/extended_virtual_interfaces_net.py | 40 | 2107 | # 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 by applicable law or agreed t... | apache-2.0 |
farazaftab/sjhschool | node_modules/node-gyp/gyp/pylib/gyp/input.py | 578 | 116086 | # 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 |
khchine5/xl | lino_xl/lib/ledger/fixtures/minimal_ledger.py | 1 | 8612 | # -*- coding: UTF-8 -*-
# Copyright 2012-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""
Creates minimal accounting demo data:
- a minimal accounts chart
- some journals
"""
from __future__ import unicode_literals
import logging
logger = logging.getLogger(__name__)
from django.conf import... | bsd-2-clause |
aksareen/balrog | auslib/web/public/base.py | 1 | 4237 | import cgi
import connexion
import logging
import re
import auslib.web
from os import path
from connexion import request
from flask import make_response, send_from_directory, Response
from raven.contrib.flask import Sentry
from auslib.AUS import AUS
from auslib.web.api_validator import BalrogParameterValidator
fro... | mpl-2.0 |
dstiert/Wox | PythonHome/Lib/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | 1730 | 3405 | """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... | mit |
ales-erjavec/orange-bio | orangecontrib/bio/kegg/tests/test_api.py | 2 | 3591 | import unittest
import tempfile
import shutil
try:
from unittest import mock
except ImportError:
import backports.unittest_mock
backports.unittest_mock.install()
from unittest import mock
try:
from types import SimpleNamespace as namespace
except ImportError:
class namespace(object):
d... | gpl-3.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env32/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py | 490 | 4141 | import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(c... | gpl-2.0 |
ssteo/moviepy | moviepy/video/fx/freeze_region.py | 13 | 1920 | from moviepy.decorators import apply_to_mask
from .crop import crop
from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip
#@apply_to_mask
def freeze_region(clip, t=0, region=None, outside_region=None, mask=None):
""" Freezes one region of the clip while the rest remains animated.
Yo... | mit |
hamzehd/edx-platform | common/djangoapps/student/tests/test_certificates.py | 8 | 7756 | """Tests for display of certificates on the student dashboard. """
import unittest
import ddt
import mock
from django.conf import settings
from django.core.urlresolvers import reverse
from mock import patch
from django.test.utils import override_settings
from xmodule.modulestore.tests.django_utils import ModuleStore... | agpl-3.0 |
zkidkid/ssdb | deps/cpy/engine.py | 8 | 13607 | # encoding=utf-8
#################################
# Author: ideawu
# Link: http://www.ideawu.net/
#################################
import sys, os, shutil, datetime
import antlr3
import antlr3.tree
from ExprLexer import ExprLexer
from ExprParser import ExprParser
class CpyEngine:
found_files = set()
def find_impo... | bsd-3-clause |
ktosiek/spacewalk | client/tools/rhncfg/actions/ModeControllerCreator.py | 2 | 2565 | #
# Copyright (c) 2008--2011 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
WatanabeYasumasa/edx-platform | cms/urls.py | 6 | 6663 | from django.conf import settings
from django.conf.urls import patterns, include, url
from xmodule.modulestore import parsers
# There is a course creators admin table.
from ratelimitbackend import admin
admin.autodiscover()
urlpatterns = patterns('', # nopep8
url(r'^transcripts/upload$', 'contentstore.views.uplo... | agpl-3.0 |
Lilykos/inspire-next | inspire/modules/classifier/config.py | 1 | 1143 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2015 CERN.
#
# INSPIRE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-2.0 |
scramblingbalam/Alta_Real | twit_token.py | 1 | 1193 | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 02 17:07:02 2017
@author: Colin Drayton
"""
import sys
import nltk
import unicodedata as uniD
import re
# This modul uses python 3.5
# a function that turns tweets into one line tokenized strings
# I wrote this for Doc2vec training but could be useful besides
# the goal ... | mit |
levibostian/myBlanky | googleAppEngine/google/appengine/tools/devappserver2/admin/datastore_viewer_test.py | 2 | 32568 | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | mit |
jnewland/home-assistant | homeassistant/components/cmus/media_player.py | 7 | 6748 | """Support for interacting with and controlling the cmus music player."""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MediaPlayerDevice, PLATFORM_SCHEMA)
from homeassistant.components.media_player.const import (
MEDIA_TYPE_MUSIC, MEDIA_TYPE_PLAYLIST, SUPPORT_NEX... | apache-2.0 |
czgu/metaHack | env/lib/python2.7/site-packages/PIL/ImageTransform.py | 71 | 2876 | #
# The Python Imaging Library.
# $Id$
#
# transform wrappers
#
# History:
# 2002-04-08 fl Created
#
# Copyright (c) 2002 by Secret Labs AB
# Copyright (c) 2002 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
from PIL import Image
class Transform(Image.ImageTransformHandler)... | apache-2.0 |
171121130/SWI | venv/Lib/site-packages/sqlalchemy/ext/declarative/base.py | 5 | 25290 | # ext/declarative/base.py
# Copyright (C) 2005-2017 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
"""Internal implementation for declarative."""
from ...schema import Table, ... | mit |
koomik/CouchPotatoServer | libs/tornado/auth.py | 16 | 59831 | #!/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 |
cloudera/hue | desktop/core/ext-py/Django-1.11.29/django/conf/locale/az/formats.py | 58 | 1256 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y'
TIME_FORMAT = 'G:i'
DATETI... | apache-2.0 |
sankha93/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/ranges.py | 329 | 3003 | from utils import HTTPException
class RangeParser(object):
def __call__(self, header, file_size):
prefix = "bytes="
if not header.startswith(prefix):
raise HTTPException(416, message="Unrecognised range type %s" % (header,))
parts = header[len(prefix):].split(",")
rang... | mpl-2.0 |
sgzsh269/django | django/contrib/auth/__init__.py | 46 | 7785 | import inspect
import re
from django.apps import apps as django_apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.middleware.csrf import rotate_token
from django.utils.crypto import constant_time_compare
from django.utils.module_loading import i... | bsd-3-clause |
joelsmith/openshift-tools | openshift/installer/vendored/openshift-ansible-3.4.40/roles/openshift_certificate_expiry/library/openshift_cert_expiry.py | 18 | 25244 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# pylint: disable=line-too-long,invalid-name
"""For details on this module see DOCUMENTATION (below)"""
# router/registry cert grabbing
import subprocess
# etcd config file
import ConfigParser
# Expiration parsing
import datetime
# File path stuff
import os
# Config file pars... | apache-2.0 |
nugget/home-assistant | homeassistant/components/light/demo.py | 7 | 4375 | """
Demo light platform that implements lights.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
import random
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_HS_COLOR,
ATTR_WHITE_VALUE, SUPP... | apache-2.0 |
skevy/django | django/db/models/sql/constants.py | 394 | 1043 | import re
# Valid query types (a dictionary is used for speedy lookups).
QUERY_TERMS = dict([(x, None) for x in (
'exact', 'iexact', 'contains', 'icontains', 'gt', 'gte', 'lt', 'lte', 'in',
'startswith', 'istartswith', 'endswith', 'iendswith', 'range', 'year',
'month', 'day', 'week_day', 'isnull', 'search'... | bsd-3-clause |
Alwnikrotikz/smap-data | python/smap/drivers/obvius/bmo.py | 4 | 7648 | """
Copyright (c) 2011, 2012, Regents of the University of California
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 l... | bsd-2-clause |
linuxmcu/ardupilot | Tools/autotest/quadplane.py | 29 | 4362 | # fly ArduPlane QuadPlane in SITL
from __future__ import print_function
import os
import pexpect
import shutil
from pymavlink import mavutil
from common import *
from pysim import util
# get location of scripts
testdir = os.path.dirname(os.path.realpath(__file__))
HOME_LOCATION = '-27.274439,151.290064,343,8.7'
MIS... | gpl-3.0 |
willm/DDEXUI | ddex/party.py | 1 | 1146 | import xml.etree.cElementTree as ET
from DDEXUI.ddex.enum import enum
PartyType = enum(MessageSender=1, MessageRecipient=2)
class Party:
def __init__(self, party_id, name, party_type=PartyType.MessageSender):
self.party_id = party_id
self.name = name
self.party_type = party_type
def w... | gpl-2.0 |
chenrenyi/flask | tests/test_regression.py | 144 | 2467 | # -*- coding: utf-8 -*-
"""
tests.regression
~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests regressions.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import pytest
import os
import gc
import sys
import flask
import threading
from werkzeug.exceptions import NotFound
... | bsd-3-clause |
mariansoban/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_parse.py | 44 | 2704 | #!/usr/bin/env python
'''
extra DMA mapping tables from a stm32 datasheet
This assumes a csv file extracted from the datasheet using tablula:
https://github.com/tabulapdf/tabula
'''
import sys, csv, os
def parse_dma_table(fname, table):
dma_num = 1
csvt = csv.reader(open(fname,'rb'))
i = 0
last_cha... | gpl-3.0 |
idlead/scikit-learn | sklearn/neighbors/tests/test_approximate.py | 26 | 19053 | """
Testing for the approximate neighbor search using
Locality Sensitive Hashing Forest module
(sklearn.neighbors.LSHForest).
"""
# Author: Maheshakya Wijewardena, Joel Nothman
import numpy as np
import scipy.sparse as sp
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_a... | bsd-3-clause |
jotes/boto | tests/integration/cloudsearch/test_cert_verification.py | 126 | 1577 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 withou... | mit |
listamilton/supermilton.repository | plugin.audio.soundcloud/resources/lib/nightcrawler/utils/nightcrawler_datetime.py | 6 | 3497 | __author__ = 'bromix'
import datetime
import re
__RE_MATCH_TIME_ONLY__ = re.compile(r'^(?P<hour>[0-9]{2})([:]?(?P<minute>[0-9]{2})([:]?(?P<second>[0-9]{2}))?)?$')
__RE_MATCH_DATE_ONLY__ = re.compile(r'^(?P<year>[0-9]{4})[-]?(?P<month>[0-9]{2})[-]?(?P<day>[0-9]{2})$')
__RE_MATCH_DATETIME__ = re.compile(
r'^(?P<yea... | gpl-2.0 |
cngo-github/nupic | nupic/regions/PictureSensorExplorers/random.py | 17 | 5518 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
AutorestCI/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/application_upgrade_update_description.py | 1 | 1962 | # 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 ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.