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 |
|---|---|---|---|---|---|
andreparrish/python-for-android | python-build/python-libs/gdata/tests/coverage.py | 128 | 21809 | #!/usr/bin/env python
#
# Perforce Defect Tracking Integration Project
# <http://www.ravenbrook.com/project/p4dti/>
#
# COVERAGE.PY -- COVERAGE TESTING
#
# Gareth Rees, Ravenbrook Limited, 2001-12-04
#
#
# 1. INTRODUCTION
#
# This module provides coverage testing f... | apache-2.0 |
aptivate/ckanext-mapactiontheme | setup.py | 1 | 3764 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.rst... | agpl-3.0 |
ar4s/django | django/contrib/gis/geos/prototypes/misc.py | 225 | 1480 | """
This module is for the miscellaneous GEOS routines, particularly the
ones that return the area, distance, and length.
"""
from ctypes import c_int, c_double, POINTER
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOS_PREPARE
from django.contrib.gis.geos.prototypes.errcheck import check_dbl, check_string
f... | bsd-3-clause |
pwoodworth/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/db/models/sql/query.py | 379 | 5314 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contri... | apache-2.0 |
bmoar/ansible-modules-extras | windows/win_iis_website.py | 84 | 3462 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of t... | gpl-3.0 |
arifsetiawan/edx-platform | common/test/acceptance/tests/studio/test_studio_outline.py | 45 | 79189 | """
Acceptance tests for studio related to the outline page.
"""
import json
from datetime import datetime, timedelta
import itertools
from pytz import UTC
from bok_choy.promise import EmptyPromise
from nose.plugins.attrib import attr
from ...pages.studio.settings_advanced import AdvancedSettingsPage
from ...pages.stu... | agpl-3.0 |
gabelula/b-counted | django/views/decorators/http.py | 63 | 5999 | """
Decorators for views based on HTTP headers.
"""
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from calendar import timegm
from datetime import timedelta
from email.Utils import formatdate
from django.utils.decorators import decorato... | apache-2.0 |
asm0dey/Flexget | flexget/plugins/cli/performance.py | 6 | 2631 | from __future__ import unicode_literals, division, absolute_import
import logging
from argparse import SUPPRESS
from flexget import options
from flexget.event import event
log = logging.getLogger('performance')
performance = {}
_start = {}
query_count = 0
def log_query_count(name_point):
"""Debugging purpos... | mit |
andrewleech/SickRage | lib/github/StatsCommitActivity.py | 74 | 2899 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
# ... | gpl-3.0 |
mjs/juju | acceptancetests/tests/test_assess_juju_sync_tools.py | 1 | 4727 | """Tests for assess_juju_sync_tools module."""
import os
from mock import (
call,
patch,
)
from assess_juju_sync_tools import (
assert_file_version_matches_agent_version,
verify_agent_tools,
get_agent_version,
parse_args,
)
from tests import (
TestCase,
)
from utility import (
... | agpl-3.0 |
mollstam/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/plat-irix5/readcd.py | 132 | 8576 | # Class interface to the CD module.
from warnings import warnpy3k
warnpy3k("the readcd module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
import cd, CD
class Error(Exception):
pass
class _Stop(Exception):
pass
def _doatime(self, cb_type, data):
if ((data[0] * 60) + data[1]) * 75 + data[2]... | mit |
jeremiahmarks/sl4a | python-build/python-libs/gdata/src/atom/core.py | 137 | 20292 | #!/usr/bin/env python
#
# Copyright (C) 2008 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... | apache-2.0 |
ppwwyyxx/tensorflow | tensorflow/python/keras/layers/preprocessing/normalization.py | 3 | 9839 | # Copyright 2019 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 |
nuuuboo/odoo | addons/mass_mailing/models/mass_mailing_report.py | 364 | 2244 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from openerp import tools
class MassMailingReport(osv.Model):
_name = 'mail.statistics.report'
_auto = False
_description = 'Mass Mailing Statistics'
_columns = {
'scheduled_date': fields.datetime('Scheduled Date', readonly=True),
... | agpl-3.0 |
hitszxp/scikit-learn | examples/applications/wikipedia_principal_eigenvector.py | 41 | 7742 | """
===============================
Wikipedia principal eigenvector
===============================
A classical way to assert the relative importance of vertices in a
graph is to compute the principal eigenvector of the adjacency matrix
so as to assign to each vertex the values of the components of the first
eigenvect... | bsd-3-clause |
vipul-sharma20/oh-mainline | mysite/search/migrations/0073_auto__del_buildhelper__del_buildhelperstep.py | 15 | 19259 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'Buildhelper'
db.delete_table('search_buildhelper')
# Deleting model 'Buildhelpe... | agpl-3.0 |
lsst-ts/ts_wep | python/lsst/ts/wep/WfEstimator.py | 1 | 7441 | # This file is part of ts_wep.
#
# Developed for the LSST Telescope and Site Systems.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# This program is free software: you ... | gpl-3.0 |
sjlehtin/django | django/db/migrations/questioner.py | 14 | 9833 | import importlib
import os
import sys
from django.apps import apps
from django.db.models.fields import NOT_PROVIDED
from django.utils import datetime_safe, timezone
from .loader import MigrationLoader
class MigrationQuestioner:
"""
Give the autodetector responses to questions it might have.
This base cl... | bsd-3-clause |
jimi-c/ansible | lib/ansible/modules/network/f5/bigip_profile_persistence_src_addr.py | 3 | 18384 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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 |
jonathanverner/brython | www/src/Lib/test/test_charmapcodec.py | 175 | 1794 | """ Python character mapping codec test
This uses the test codec in testcodec.py and thus also tests the
encodings package lookup scheme.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright 2000 Guido van Rossum.
"""#"
import test.support, unittest
import codecs
# Register a search function which know... | bsd-3-clause |
jalaziz/validictory | validictory/tests/test_items.py | 34 | 4555 | from unittest import TestCase
import validictory
class TestItems(TestCase):
schema1 = {
"type": "array",
"items": {"type": "string"}
}
schema2 = {
"type": "array",
"items": [{"type": "integer"}, {"type": "string"}, {"type": "boolean"}]
}
schema3 = {
"type... | mit |
ionelmc/python-cogen | cogen/core/pipe.py | 4 | 3383 | """An unidirectional pipe.
Your average example::
@coro
def iterator():
iterator = yield Iterate(producer)
while 1:
val = yield iterator
if val is sentinel:
break
# do something with val
@coro
def producer():
f... | mit |
gopchandani/ryu | ryu/services/protocols/bgp/rtconf/base.py | 20 | 25268 | # Copyright (C) 2014 Nippon Telegraph and Telephone 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 appli... | apache-2.0 |
ParsonsAMT/Myne | datamining/apps/profiles/migrations/0050_auto__add_field_areaofstudy_aos_url__add_field_areaofstudy_description.py | 1 | 56178 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'AreaOfStudy.aos_url'
db.add_column('profiles_areaofstudy', 'aos_url', self.... | agpl-3.0 |
hujiajie/chromium-crosswalk | tools/grit/grit/format/data_pack_unittest.py | 49 | 2626 | #!/usr/bin/env python
# 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.
'''Unit tests for grit.format.data_pack'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path... | bsd-3-clause |
StevenLOL/aicyber_semeval_2016_ivector | System_2/steps/conf/prepare_calibration_data.py | 1 | 4668 | #!/bin/env python
# Copyright 2015 Brno University of Technology (author: Karel Vesely)
# Apache 2.0
import sys, math
from optparse import OptionParser
desc = """
Prepare input features and training targets for logistic regression,
which calibrates the Minimum Bayes Risk posterior confidences.
The logisitc-regress... | gpl-3.0 |
MSOpenTech/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_asides.py | 92 | 2109 | """
Tests for Asides
"""
from xblock.core import XBlockAside
from xblock.fields import Scope, String
from xblock.fragment import Fragment
from unittest import TestCase
from xmodule.modulestore.tests.test_cross_modulestore_import_export import XmlModulestoreBuilder
from mock import patch
class AsideTestType(XBlockAsid... | agpl-3.0 |
bootswithdefer/ansible | lib/ansible/utils/module_docs_fragments/cloudstack.py | 7 | 2060 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 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 License, or
# (... | gpl-3.0 |
ujjwalwahi/cookiecutter-django | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/contrib/sites/migrations/0001_initial.py | 348 | 1025 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.contrib.sites.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Site',
fields=[
... | bsd-3-clause |
klunwebale/odoo | addons/base_gengo/controller/gengo_callback.py | 362 | 2326 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from werkzeug.wrappers import BaseResponse as Response
import json
class website_gengo(http.Controller):
def get_gengo_key(self, cr):
icp = request.re... | agpl-3.0 |
hachard/Cra-Magnet | flask/lib/python3.5/site-packages/sqlalchemy/sql/compiler.py | 17 | 107328 | # sql/compiler.py
# Copyright (C) 2005-2016 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
"""Base SQL and DDL compiler implementations.
Classes provided include:
:class:`.c... | gpl-3.0 |
WhireCrow/openwrt-mt7620 | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/htmllib.py | 312 | 12869 | """HTML 2.0 parser.
See the HTML 2.0 specification:
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
"""
from warnings import warnpy3k
warnpy3k("the htmllib module has been removed in Python 3.0",
stacklevel=2)
del warnpy3k
import sgmllib
from formatter import AS_IS
__all__ = ["HTMLPars... | gpl-2.0 |
curran/google-diff-match-patch | python3/diff_match_patch_test.py | 284 | 41615 | #!/usr/bin/python3
"""Test harness for diff_match_patch.py
Copyright 2006 Google Inc.
http://code.google.com/p/google-diff-match-patch/
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://ww... | apache-2.0 |
spiermar/message-service | lib/werkzeug/serving.py | 309 | 27668 | # -*- coding: utf-8 -*-
"""
werkzeug.serving
~~~~~~~~~~~~~~~~
There are many ways to serve a WSGI application. While you're developing
it you usually don't want a full blown webserver like Apache but a simple
standalone one. From Python 2.5 onwards there is the `wsgiref`_ server in
the standa... | apache-2.0 |
sdiazb/airflow | airflow/contrib/operators/vertica_operator.py | 45 | 1690 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
Philippe12/external_chromium_org | tools/perf/metrics/cpu.py | 24 | 2717 | # 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.
from metrics import Metric
class CpuMetric(Metric):
"""Calulates CPU load over a span of time."""
def __init__(self, browser):
super(CpuMetric, sel... | bsd-3-clause |
ucrawler/cp-uc | libs/tornado/wsgi.py | 73 | 13387 | #!/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 |
bwrsandman/openerp-hr | hr_wage_increment/wage_increment.py | 3 | 16799 | #-*- coding:utf-8 -*-
#
#
# Copyright (C) 2011 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# 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
# the Free Software Foundation, eith... | agpl-3.0 |
ahmadiga/min_edx | lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py | 114 | 6231 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GeneratedCertificate.mode'
db.add_column('certificates_generatedcertificate', 'mode',
... | agpl-3.0 |
redPanther/hyperion.ng | effects/running_dots.py | 5 | 1097 | import hyperion, time, colorsys, random
# get options from args
sleepTime = float(hyperion.args.get('speed', 1.5)) * 0.005
whiteLevel = int(hyperion.args.get('whiteLevel', 0))
lvl = int(hyperion.args.get('colorLevel', 220))
# check value
whiteLevel = min( whiteLevel, 254 )
lvl = min( lvl, 255 )
if whi... | mit |
leppa/home-assistant | homeassistant/components/iglo/light.py | 3 | 3843 | """Support for lights under the iGlo brand."""
import logging
import math
from iglo import Lamp
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_HS_COLOR,
PLATFORM_SCHEMA,
SUPPORT_BRIGHTNESS,
SUPPORT_COLOR,
SUPPOR... | apache-2.0 |
wilvk/ansible | lib/ansible/modules/cloud/openstack/os_keystone_service.py | 25 | 6130 | #!/usr/bin/python
# Copyright 2016 Sam Yaple
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
timkrentz/SunTracker | IMU/VTK-6.2.0/Utilities/vtk2xml.py | 2 | 5409 | #!/usr/bin/env python
"""Utility script to convert an old VTK file format to the new VTK XML
file format (serial format). The output XML file will contain *all*
the existing scalars, vectors and tensors in the input file.
This requires VTK 4.x or above.
Created May 2003, Prabhu Ramachandran <prabhu@aero.iit... | mit |
axinging/chromium-crosswalk | mojo/public/tools/bindings/generators/mojom_js_generator.py | 16 | 15123 | # 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.
"""Generates JavaScript source files from a mojom.Module."""
import mojom.generate.generator as generator
import mojom.generate.module as mojom
import mojom... | bsd-3-clause |
nirmeshk/oh-mainline | vendor/packages/celery/celery/tests/test_app/test_app_amqp.py | 32 | 3364 | from __future__ import absolute_import
from __future__ import with_statement
from mock import Mock
from celery.app.amqp import MSG_OPTIONS, extract_msg_options
from celery.tests.utils import AppCase
class TestMsgOptions(AppCase):
def test_MSG_OPTIONS(self):
self.assertTrue(MSG_OPTIONS)
def test_ex... | agpl-3.0 |
debugtalk/ApiTestEngine | httprunner/utils.py | 1 | 6985 | import collections
import copy
import json
import os.path
import platform
import uuid
from multiprocessing import Queue
import itertools
from typing import Dict, List, Any, Union, Text
import sentry_sdk
from loguru import logger
from httprunner import __version__
from httprunner import exceptions
from httprunner.mode... | mit |
listingmirror/boto | tests/unit/kms/__init__.py | 473 | 1123 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
jakubfindura/vnos-nfc | nfc-server/RPLCD/gpio.py | 2 | 7754 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2013-2016 Danilo Bargen
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,... | mit |
mcanthony/node-gyp | gyp/pylib/gyp/win_tool.py | 395 | 12634 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | mit |
atlassian/boto | boto/rds/vpcsecuritygroupmembership.py | 177 | 3131 | # Copyright (c) 2013 Anthony Tonns http://www.corsis.com/
#
# 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... | mit |
hortonworks/hortonworks-sandbox | desktop/core/ext-py/PyYAML-3.09/lib/yaml/nodes.py | 985 | 1440 |
class Node(object):
def __init__(self, tag, value, start_mark, end_mark):
self.tag = tag
self.value = value
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
value = self.value
#if isinstance(value, list):
# if len(value) == 0:
... | apache-2.0 |
SomethingExplosive/android_external_chromium_org | chrome/test/pyautolib/pyauto_utils_test.py | 80 | 2722 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Tests for pyauto_utils."""
import glob
import os
import shutil
import tempfile
import unittest
import pyauto_utils
class Exi... | bsd-3-clause |
wshallum/ansible | lib/ansible/modules/cloud/rackspace/rax_cbs_attachments.py | 13 | 6789 | #!/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 distributed... | gpl-3.0 |
hulifox008/bitbake | lib/bb/fetch/svn.py | 1 | 6700 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Fetch' implementation for svn.
"""
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2004 Marcin Juszkiewicz
#
# This program is free software; you can redistribute it and/or modify
# it under the terms... | gpl-2.0 |
yannrouillard/weboob | weboob/applications/qvideoob/main_window.py | 3 | 5439 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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 Free Software Foundation, either version 3 of the License, or
# (at your... | agpl-3.0 |
cristianomatos/android_kernel_motorola_msm8226 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
thaim/ansible | test/units/modules/network/fortios/test_fortios_webfilter_ips_urlfilter_cache_setting.py | 20 | 6022 | # Copyright 2019 Fortinet, Inc.
#
# 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... | mit |
AZCompTox/AZOrange | azorange/trainingMethods/AZorngCvBayes.py | 2 | 12157 | import pickle
import orange
import AZBaseClasses
from AZutilities import dataUtilities
import AZOrangeConfig as AZOC
import os
from opencv import ml,cv
class CvBayesLearner(AZBaseClasses.AZLearner):
"""
Creates an opencv Normal Bayes learner derivated from AZBaseClasses.AZLearner.
It only support Classific... | lgpl-3.0 |
google-code-export/exposong | lib/exposong/_hook.py | 3 | 2470 | #
# vim: ts=4 sw=4 expandtab ai:
#
# Copyright (C) 2008-2011 Exposong.org
#
# ExpoSong is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# at your option) any later version.
#... | gpl-3.0 |
psawaya/Mental-Ginger | django/contrib/gis/management/commands/inspectdb.py | 311 | 1553 | from optparse import make_option
from django.core.management.base import CommandError
from django.core.management.commands.inspectdb import Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row... | bsd-3-clause |
wangregoon/pydec | pydec/math/tests/test_parity.py | 7 | 1160 | from pydec.testing import *
from pydec.math.parity import permutation_parity, relative_parity
cases = []
cases.append(([],0)) #for consistency
cases.append(([0],0))
cases.append(([0,1],0))
cases.append(([1,0],1))
cases.append(([0,1,2],0))
cases.append(([0,2,1],1))
cases.append(([2,0,1],0))
cases.append(([2,1... | bsd-3-clause |
kashif/chainer | tests/chainer_tests/functions_tests/array_tests/test_rollaxis.py | 1 | 2656 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check
@testing.parameterize(
{'axis': 0, 'start': 2, 'out_shape': (3, 2, 4)},
{'ax... | mit |
CEG-FYP-OpenStack/scheduler | nova/tests/unit/api/openstack/compute/test_floating_ip_dns.py | 35 | 19001 | # Copyright 2011 Andrew Bogott for the Wikimedia Foundation
# All Rights Reserved.
# Copyright 2013 Red Hat, 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://w... | apache-2.0 |
yeyanchao/calibre | src/calibre/library/server/opds.py | 1 | 23561 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import hashlib, binascii
from functools import partial
from itertools import repeat
from collections import OrderedDict
fr... | gpl-3.0 |
jillesme/phantomjs | src/qt/qtwebkit/Tools/TestResultServer/model/datastorefile.py | 144 | 5172 | # 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 |
cloudera/hue | desktop/core/ext-py/dnspython-1.15.0/dns/reversename.py | 8 | 3311 | # Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
josuemontano/API-platform | src/canopus/views/auth.py | 3 | 2417 | import json
from datetime import timedelta
import pendulum
import requests
from pyramid.request import Request
from pyramid.view import view_config, view_defaults
from pyramid.httpexceptions import HTTPNotFound, HTTPUnprocessableEntity
from ..models import User
from ..schema import UserSchema
@view_defaults(rendere... | mit |
thurday/mtcp | dpdk-2.0.0/app/test/autotest.py | 23 | 2663 | #!/usr/bin/python
# BSD LICENSE
#
# Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
# 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 sourc... | bsd-3-clause |
grap/OpenUpgrade | addons/stock_landed_costs/__init__.py | 373 | 1087 | # -*- 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 |
c0defreak/python-for-android | python3-alpha/python3-src/Lib/unittest/test/test_case.py | 50 | 50475 | import difflib
import pprint
import pickle
import re
import sys
import warnings
import inspect
from copy import deepcopy
from test import support
import unittest
from .support import (
TestEquality, TestHashing, LoggingResult,
ResultWithNoStartTestRunStopTestRun
)
class Test(object):
"Keep these TestCa... | apache-2.0 |
pgmillon/ansible | lib/ansible/modules/cloud/google/gcp_compute_target_pool.py | 3 | 17848 | #!/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 |
CasparLi/calibre | src/calibre/customize/conversion.py | 13 | 13697 | # -*- coding: utf-8 -*-
'''
Defines the plugin system for conversions.
'''
import re, os, shutil
from calibre import CurrentDir
from calibre.customize import Plugin
class ConversionOption(object):
'''
Class representing conversion options
'''
def __init__(self, name=None, help=None, long_switch=None... | gpl-3.0 |
synergeticsedx/deployment-wipro | 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 |
icejoywoo/tornado | tornado/ioloop.py | 44 | 40479 | #!/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... | apache-2.0 |
aasoliz/Bitcoin-Statistics | app/bitcoin.py | 1 | 3535 | from app import db
from config import bitcoin_key
from models import Aggregate, Day, Hours, Predictions
from time import strptime, strftime, localtime
import os
import os.path
import unirest
import json
def creation(date, buy, sell):
date = strptime(date, '%m/%d/%y %H:%M')
time_h = date.tm_hour
time_d... | bsd-3-clause |
381426068/MissionPlanner | Lib/site-packages/numpy/distutils/fcompiler/pg.py | 71 | 1791 |
# http://www.pgroup.com
from numpy.distutils.fcompiler import FCompiler
from sys import platform
compilers = ['PGroupFCompiler']
class PGroupFCompiler(FCompiler):
compiler_type = 'pg'
description = 'Portland Group Fortran Compiler'
version_pattern = r'\s*pg(f77|f90|hpf) (?P<version>[\d.-]+).*'
if... | gpl-3.0 |
castaway2000/EthOS-Dashboard | main/migrations/0004_auto_20170523_1612.py | 1 | 10961 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-23 16:12
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0003_auto_20170520_2333'),
]
operations = [
migrations.RemoveField(
... | mpl-2.0 |
yast/yast-python-bindings | examples/RichText4.py | 1 | 1509 | # encoding: utf-8
# Example for a RichText widget
from yast import import_module
import_module('UI')
from yast import *
class RichText4Client:
def main(self):
UI.OpenDialog(
Opt("defaultsize"),
VBox(
RichText(
"<h3>RichText example</h3>" +
"<p>This is a <i>... | gpl-2.0 |
eunchong/build | third_party/buildbot_8_4p1/buildbot/test/unit/test_status_builder_cache.py | 3 | 2684 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | bsd-3-clause |
StevenVanAcker/mitmproxy | mitmproxy/addons/streambodies.py | 3 | 1707 | from mitmproxy.net.http import http1
from mitmproxy import exceptions
from mitmproxy import ctx
from mitmproxy.utils import human
class StreamBodies:
def __init__(self):
self.max_size = None
def configure(self, updated):
if "stream_large_bodies" in updated and ctx.options.stream_large_bodies:... | mit |
ambrice/ffdraft | ffdraft/models.py | 1 | 17163 | import json
import re
from xml.etree import ElementTree
from PyQt4 import QtCore, QtGui
from sqlalchemy import func, create_engine, Column, Integer, String, Boolean, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship, backref
Base = declarative_ba... | gpl-2.0 |
atreyv/sympy | sympy/integrals/tests/test_deltafunctions.py | 58 | 3297 | from sympy.core.compatibility import range
from sympy import cos, DiracDelta, Heaviside, Function, pi, S, sin, symbols
from sympy.integrals.deltafunctions import change_mul, deltaintegrate
f = Function("f")
x_1, x_2, x, y, z = symbols("x_1 x_2 x y z")
def test_change_mul():
assert change_mul(x, x) == x
asser... | bsd-3-clause |
sunny94/temp | sympy/functions/special/tests/test_elliptic_integrals.py | 13 | 5599 | from sympy import (S, Symbol, pi, I, oo, zoo, sin, sqrt, tan, atan, gamma,
atanh, hyper, meijerg, O)
from sympy.functions.special.elliptic_integrals import (elliptic_k as K,
elliptic_f as F, elliptic_e as E, elliptic_pi as P)
from sympy.utilities.randtest import (test_derivative_numerically as td,
... | bsd-3-clause |
hammerhorn/hammerhorn-jive | dice/cjh/tk_template.py | 6 | 8983 | #!/usr/bin/env python
"""
The Tk plugin for my shell model, along with classes for the necessary
types of dialog boxes.
"""
import sys
try:
import tkMessageBox
import Tkinter as tkinter
except ImportError:
try:
from tkinter import messagebox as tkMessageBox
import tkinter
except ImportE... | gpl-2.0 |
mvs-org/metaverse | test/test-rpc/TestCase/Asset/test_asset_after_did_modified.py | 3 | 4053 | import time
from utils import common
import MOCs
from TestCase.MVSTestCase import *
class TestAssetAfterDidModified(MVSTestCaseBase):
def test_0_scenario_did_modified(self):
# prepare address
#
Zac.mining()
Zac.mining()
Zac.mining()
result, addresslist = mvs_rpc.li... | agpl-3.0 |
adngdb/socorro | socorro/cron/mixins.py | 4 | 1891 | from functools import partial
from crontabber.mixins import (
with_transactional_resource,
with_resource_connection_as_argument,
with_single_transaction
)
# dedicated rabbitmq mixins
#
# this class decorator adds attributes to the class in the form:
# self.queuing_connection
# self.queuing_transac... | mpl-2.0 |
Eric89GXL/numpy | numpy/core/tests/test_ufunc.py | 4 | 69658 | from __future__ import division, absolute_import, print_function
import warnings
import itertools
import numpy as np
import numpy.core._umath_tests as umt
import numpy.linalg._umath_linalg as uml
import numpy.core._operand_flag_tests as opflag_tests
import numpy.core._rational_tests as _rational_tests
from numpy.test... | bsd-3-clause |
fdvarela/odoo8 | addons/hr_timesheet/report/hr_timesheet_report.py | 12 | 2665 |
from openerp import tools
from openerp.osv import fields,osv
from openerp.addons.decimal_precision import decimal_precision as dp
class hr_timesheet_report(osv.osv):
_name = "hr.timesheet.report"
_description = "Timesheet"
_auto = False
_columns = {
'date': fields.date('Date', readonly=True),
... | agpl-3.0 |
pdellaert/ansible | lib/ansible/modules/crypto/acme/_letsencrypt.py | 12 | 1033 | #!/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 |
tarkatronic/opbeat_python | opbeat/utils/wsgi.py | 4 | 3335 | """
This module implements WSGI related helpers adapted from ``werkzeug.wsgi``
:copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from opbeat.utils import six
try:
from urllib import quote
except ImportError:
from urllib.parse import quote
... | bsd-3-clause |
adrelanos/qubes-core-admin | tests/__init__.py | 1 | 15953 | #!/usr/bin/python2 -O
# vim: fileencoding=utf-8
#
# The Qubes OS Project, https://www.qubes-os.org/
#
# Copyright (C) 2014-2015
# Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
# Copyright (C) 2015 Wojtek Porczyk <woju@invisiblethingslab.com>
#
# This program is free software; you can ... | gpl-2.0 |
skalk/linux | Documentation/sphinx/kernel_include.py | 949 | 8570 | #!/usr/bin/env python3
# -*- coding: utf-8; mode: python -*-
# pylint: disable=R0903, C0330, R0914, R0912, E0401
u"""
kernel-include
~~~~~~~~~~~~~~
Implementation of the ``kernel-include`` reST-directive.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1991 see lin... | gpl-2.0 |
psung/google-gtags | etags_to_tags_unittest.py | 7 | 3097 | #!/usr/bin/python2.4
#
# Copyright 2006 Google Inc. All Rights Reserved.
#
# 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 versio... | gpl-2.0 |
jasonyaw/SFrame | oss_src/unity/python/sframe/toolkits/image_analysis/image_analysis.py | 9 | 5275 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
from ... import connect as _mt
from ...data_structures.image import Image as _Image
def load_images(url, format='auto', with_path=True, recurs... | bsd-3-clause |
brittanystoroz/kitsune | kitsune/users/migrations/0010_auto_20151110_1307.py | 6 | 26827 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import timezones.fields
import kitsune.sumo.models
class Migration(migrations.Migration):
dependencies = [
('users', '0009_change_locale_sr_Cyrl_to_sr'),
]
operations = [
migrations.... | bsd-3-clause |
gwulfs/zipline | zipline/finance/commission.py | 33 | 5126 | #
# Copyright 2014 Quantopian, 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 wr... | apache-2.0 |
GuillaumeSeren/alot | alot/commands/globals.py | 1 | 42906 | # Copyright (C) 2011-2012 Patrick Totzke <patricktotzke@gmail.com>
# Copyright © 2018 Dylan Baker
# This file is released under the GNU GPL, version 3 or a later revision.
# For further details see the COPYING file
import argparse
import code
import email
import email.utils
import glob
import logging
import os
import ... | gpl-3.0 |
JWarmenhoven/seaborn | seaborn/tests/test_palettes.py | 2 | 9884 | import warnings
import colorsys
import numpy as np
import matplotlib as mpl
import nose.tools as nt
import numpy.testing as npt
from .. import palettes, utils, rcmod
from ..external import husl
from ..xkcd_rgb import xkcd_rgb
from ..crayons import crayons
class TestColorPalettes(object):
def test_current_palet... | bsd-3-clause |
cdht/androguard | tests/test_types.py | 23 | 3678 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2010, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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,... | apache-2.0 |
andante20/volatility | volatility/plugins/common.py | 44 | 3871 | # Volatility
#
# Authors:
# Michael Cohen <scudette@users.sourceforge.net>
#
# This file is part of Volatility.
#
# Volatility 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, o... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.