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 |
|---|---|---|---|---|---|
jdinuncio/ansible-modules-extras | network/f5/bigip_sys_global.py | 32 | 13671 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# ... | gpl-3.0 |
ratoaq2/Flexget | flexget/plugins/cli/explain_sql.py | 18 | 1684 | from __future__ import unicode_literals, division, absolute_import
import logging
from time import time
from argparse import SUPPRESS
from sqlalchemy.orm.query import Query
from sqlalchemy.ext.compiler import compiles
from sqlalchemy.sql.expression import Executable, ClauseElement, _literal_as_text
from flexget impor... | mit |
izonder/intellij-community | python/lib/Lib/site-packages/django/views/csrf.py | 289 | 3834 | from django.http import HttpResponseForbidden
from django.template import Context, Template
from django.conf import settings
# We include the template inline since we need to be able to reliably display
# this error message, especially for the sake of developers, and there isn't any
# other way of making it available ... | apache-2.0 |
hkariti/ansible | lib/ansible/modules/windows/win_mapped_drive.py | 24 | 2799 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub, actual code lives in the .ps1
# file of the same name
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
webOS-ports/qtwebkit | Tools/QueueStatusServer/handlers/statusbubble.py | 125 | 3746 | # Copyright (C) 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... | gpl-2.0 |
samepage-labs/luigi | test/db_task_history_test.py | 16 | 5064 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | apache-2.0 |
jeetsukumaran/YonderGit | ez_setup.py | 7 | 9646 | #!python
"""Bootstrap setuptools installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from ez_setup import use_setuptools
use_setuptools()
If you want to require a specific version of setuptools... | gpl-3.0 |
espadrine/opera | chromium/src/net/tools/testserver/echo_message.py | 187 | 13195 | # 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.
"""Provides utility functions for TCP/UDP echo servers and clients.
This program has classes and functions to encode, decode, calculate checksum
and ver... | bsd-3-clause |
elibixby/gcloud-python | gcloud/bigtable/column_family.py | 1 | 11447 | # Copyright 2015 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 a... | apache-2.0 |
mozilla/stoneridge | python/src/Demo/pdist/FSProxy.py | 10 | 7828 | """File System Proxy.
Provide an OS-neutral view on a file system, locally or remotely.
The functionality is geared towards implementing some sort of
rdist-like utility between a Mac and a UNIX system.
The module defines three classes:
FSProxyLocal -- used for local access
FSProxyServer -- used on the server side o... | mpl-2.0 |
ms5/mongoengine | tests/fields/fields.py | 2 | 120968 | # -*- coding: utf-8 -*-
import sys
from nose.plugins.skip import SkipTest
sys.path[0:0] = [""]
import datetime
import unittest
import uuid
import math
import itertools
import re
try:
import dateutil
except ImportError:
dateutil = None
from decimal import Decimal
from bson import Binary, DBRef, ObjectId
fr... | mit |
meredith-digops/ansible | test/units/modules/cloud/amazon/test_kinesis_stream.py | 91 | 9066 | import pytest
import unittest
boto3 = pytest.importorskip("boto3")
botocore = pytest.importorskip("botocore")
import ansible.modules.cloud.amazon.kinesis_stream as kinesis_stream
aws_region = 'us-west-2'
class AnsibleKinesisStreamFunctions(unittest.TestCase):
def test_convert_to_lower(self):
example =... | gpl-3.0 |
crosswalk-project/blink-crosswalk-efl | Source/build/scripts/audit_runtime_enabled_features.py | 35 | 5912 | #!/usr/bin/env python
import requests
import re
from in_file import InFile
BRANCH_FORMAT = "https://src.chromium.org/blink/branches/chromium/%s/%s"
TRUNK_PATH = "Source/platform/RuntimeEnabledFeatures.in"
TRUNK_URL = "https://src.chromium.org/blink/trunk/%s" % TRUNK_PATH
def features_path(branch):
# RuntimeEnab... | bsd-3-clause |
openfisca/openfisca-qt | openfisca_qt/openFisca.py | 1 | 63097 | # -*- coding:utf-8 -*-
#
# This file is part of OpenFisca.
# OpenFisca is a socio-fiscal microsimulation software
# Copyright © 2011 Clément Schaff, Mahdi Ben Jelloul
# Licensed under the terms of the GVPLv3 or later license
# (see openfisca/__init__.py for details)
# This file is inspired by Spyder, see openfisca/spy... | agpl-3.0 |
doduytrung/odoo-8.0 | addons/crm_helpdesk/crm_helpdesk.py | 147 | 7481 | # -*- 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 |
minhphung171093/GreenERP_V8 | openerp/addons/crm_partner_assign/crm_lead.py | 221 | 3039 | # -*- 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 |
MarcoBuster/GoogleBot | plugins/trends.py | 1 | 3458 | # Copyright (c) 2017 The TelegramGoogleBot Authors (see AUTHORS)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy,... | mit |
jiegzhan/multi-class-text-classification-cnn-rnn | text_cnn_rnn.py | 1 | 4675 | import numpy as np
import tensorflow as tf
class TextCNNRNN(object):
def __init__(self, embedding_mat, non_static, hidden_unit, sequence_length, max_pool_size,
num_classes, embedding_size, filter_sizes, num_filters, l2_reg_lambda=0.0):
self.input_x = tf.placeholder(tf.int32, [None, sequence_length], name='input_... | apache-2.0 |
petemoore/git-repo | subcmds/cherry_pick.py | 40 | 3432 | #
# Copyright (C) 2010 The Android Open Source Project
#
# 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 la... | apache-2.0 |
cstavr/synnefo | snf-cyclades-app/synnefo/logic/tests/reconciliation.py | 8 | 13938 | # vim: set fileencoding=utf-8 :
# Copyright (C) 2010-2014 GRNET S.A.
#
# 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.
#... | gpl-3.0 |
pauloschilling/sentry | src/sentry/migrations/0100_auto__add_field_tagkey_label.py | 36 | 26651 | # -*- 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 'TagKey.label'
db.add_column('sentry_filterkey', 'label',
self.gf('djan... | bsd-3-clause |
mcking49/apache-flask | Python/Lib/test/test_select.py | 84 | 2163 | from test import test_support
import unittest
import select
import os
import sys
@unittest.skipIf(sys.platform[:3] in ('win', 'os2', 'riscos'),
"can't easily test on this system")
class SelectTestCase(unittest.TestCase):
class Nope:
pass
class Almost:
def fileno(self):
... | mit |
jcollfont/SCIRun | src/Externals/gmock/gtest/test/gtest_xml_test_utils.py | 1815 | 8876 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
titusjan/objbrowser | examples/unicode_browser.py | 1 | 4283 | #!/usr/bin/env python
"""
Shows all unicode characters and properties.
The glyphs for some characters may not be available if the font is not installed.
Note that the object browser replaces the carriage-return (#13) and line-feed (#10)
characters in the unicode column with an arrow (#8629) t... | mit |
elimence/edx-platform | lms/envs/acceptance.py | 3 | 2337 | """
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=W0401, W0614
from .test import *
# You need to start the ser... | agpl-3.0 |
andyzsf/django | tests/template_tests/syntax_tests/test_autoescape.py | 1 | 5213 | from django.template.base import TemplateSyntaxError
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from .utils import render, setup, SafeClass, UnsafeClass
class AutoescapeTagTests(SimpleTestCase):
@setup({'autoescape-tag01': '{% autoescape off %}hello{% endautoescape %}'}... | bsd-3-clause |
puneetgkaur/sugar | src/jarabe/journal/journaltoolbox.py | 2 | 39292 | # Copyright (C) 2007, One Laptop Per Child
# Copyright (C) 2009,14 Walter Bender
#
# 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 late... | gpl-2.0 |
gabrielfalcao/m3u8 | tests/test_strict_validations.py | 7 | 1080 | # coding: utf-8
# Copyright 2014 Globo.com Player authors. All rights reserved.
# Use of this source code is governed by a MIT License
# license that can be found in the LICENSE file.
import pytest
@pytest.mark.xfail
def test_should_fail_if_first_line_not_EXTM3U():
assert 0
@pytest.mark.xfail
def test_should_fai... | mit |
KaranToor/MA450 | google-cloud-sdk/.install/.backup/platform/gsutil/gslib/tests/test_ui.py | 7 | 66964 | # -*- coding: utf-8 -*-
# Copyright 2016 Google Inc. 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 to u... | apache-2.0 |
aquilesC/evernote-python-access | evernote_login.py | 1 | 1685 | """ EVERNOTE LOGIN
~~~~~~~~~~~~~~
Python script that allows to log in into Evernote by opening a simple Qt browser window.
Before launching the program, check that you have edited the config.example file with your
default parameters.
"""
# Evernote Imports
from evernote.api.client import Evernote... | gpl-2.0 |
xaviercobain88/framework-python | build/lib.linux-i686-2.7/openerp/addons/mrp/report/workcenter_load.py | 437 | 9126 | # -*- 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 |
OpenDaisy/daisy-api | daisy/api/common.py | 1 | 7740 | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
ryfeus/lambda-packs | Selenium_PhantomJS/source/botocore/vendored/requests/api.py | 435 | 5415 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | mit |
gquirozbogner/contentbox-master | third_party/oauthlib/oauth1/rfc5849/signature.py | 6 | 22766 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.signature
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module represents a direct implementation of `section 3.4`_ of the spec.
Terminology:
* Client: software interfacing with an OAuth API
* Server: the API provider
* Resource Owner: the user who is granting authoriza... | apache-2.0 |
tovrstra/pytis | pytis/ensembles.py | 1 | 2984 | # PyTIS is a Python implementation of transition interface sampling.
# Copyright (C) 2010 Titus Van Erp <Titus.VanErp@biw.kuleuven.be>,
# Toon Verstraelen <Toon.Verstraelen@UGent.be>
#
# This file is part of PyTIS.
#
# PyTIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General... | gpl-3.0 |
dushu1203/chromium.src | tools/telemetry/telemetry/results/chart_json_output_formatter_unittest.py | 12 | 5864 | # 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.
import json
import os
import StringIO
import unittest
from telemetry import benchmark
from telemetry import page as page_module
from telemetry.results impor... | bsd-3-clause |
AlanZatarain/pysal | pysal/spreg/diagnostics.py | 5 | 35125 | """
Diagnostics for regression estimations.
"""
__author__ = "Luc Anselin luc.anselin@asu.edu, Nicholas Malizia nicholas.malizia@asu.edu "
import pysal
from pysal.common import *
import scipy.sparse as SP
from math import sqrt
from utils import spmultiply, sphstack, spmin, spmax
__all__ = [ "f_stat", "t_st... | bsd-3-clause |
danellecline/mbari-aesa | test/test_extract.py | 2 | 3747 | #!/usr/bin/python
__author__ = 'dcline'
import os
import glob
import shutil
import subprocess
import tarfile
from shutil import copyfile
from collections import namedtuple
import math
import os
import sys
import glob
from shutil import copyfile
def get_dims(image):
# get the height and width of a tile
cmd = '... | gpl-3.0 |
proxysh/Safejumper-for-Desktop | buildmac/Resources/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | gpl-2.0 |
factorlibre/OCB | addons/mail/mail_alias.py | 220 | 15533 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
crast/grpc | src/python/grpcio/grpc/framework/core/_emission.py | 2 | 4249 | # Copyright 2015, 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... | bsd-3-clause |
slevenhagen/odoo | addons/website_blog/wizard/document_page_show_diff.py | 372 | 2184 | # -*- 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 |
mgagne/nova | plugins/xenserver/xenapi/etc/xapi.d/plugins/pluginlib_nova.py | 70 | 4923 | # Copyright (c) 2010 Citrix Systems, 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 ... | apache-2.0 |
bmanojlovic/ansible | lib/ansible/modules/database/mssql/mssql_db.py | 5 | 7526 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Ansible module to manage mssql databases
# (c) 2014, Vedit Firat Arig <firatarig@gmail.com>
# Outline and parts are reused from Mark Theunissen's mysql_db module
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under t... | gpl-3.0 |
machinewu/pyspider | pyspider/database/local/projectdb.py | 63 | 2377 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<roy@binux.me>
# http://binux.me
# Created on 2015-01-17 12:32:17
import os
import re
import six
import logging
from pyspider.database.base.projectdb import ProjectDB as BaseProjectDB
class Projec... | apache-2.0 |
ofcourseican/django-openid-auth | django_openid_auth/tests/test_store.py | 21 | 8151 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2009-2010 Canonical Ltd.
#
# 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 ... | bsd-2-clause |
RaumZeit/gdesklets-core | display/TargetEntry.py | 2 | 2623 | from DisplayTarget import DisplayTarget
from utils.datatypes import *
from layout import Unit
from utils.Struct import Struct
import gobject
import gtk
import pango
import re
class TargetEntry(DisplayTarget):
__ACTION_CHANGE = "change"
# regular expression for parsing font description strings
__RE_FONT... | gpl-2.0 |
justinpotts/mozillians | mozillians/groups/migrations/0013_migrate_group_changes.py | 3 | 13386 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
# If system group, then members can't leave or join,
# and the group defaults to not being visible.
orm.G... | bsd-3-clause |
googlei18n/fontuley | src/third_party/fontTools/Lib/fontTools/ttLib/macUtils.py | 11 | 5807 | """ttLib.macUtils.py -- Various Mac-specific stuff."""
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
import sys
import os
if sys.platform not in ("mac", "darwin"):
raise ImportError("This module is Mac-only!")
try:
from Carbon import Res
except ImportError:
impor... | apache-2.0 |
calancha/COMDIRAC | Interfaces/scripts/dkill.py | 2 | 2337 | #!/usr/bin/env python
"""
Kill or delete DIRAC job
"""
__RCSID__ = "$Id$"
import DIRAC
from DIRAC.Core.Base import Script
from COMDIRAC.Interfaces import DSession
class Params:
def __init__ ( self ):
self.delete = False
self.selectAll = False
self.verbose = False
def setDelete( self, arg = None ):
... | gpl-3.0 |
zhulin2609/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/obsoletepatches.py | 125 | 2318 | # 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 th... | bsd-3-clause |
phaller0513/aima-python | grading/util.py | 13 | 1977 | # common utilities for grading
from utils import isnumber
roster = [
'Anderson','Ban','Becker',
'Blue','Capps','Conklin',
'Dickenson','Fritz','Haller',
'Hawley','Hess','Johnson',
'Karman','Kinley','LaMartina',
'McLean','Miles','Ottenlips',
'Porter','Sery','VanderKallen',
'aardvark',
... | mit |
sve-odoo/odoo | addons/gamification/models/__init__.py | 389 | 1038 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
alfredgamulo/cloud-custodian | tests/test_firewall.py | 2 | 1026 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from .common import BaseTest
class NetworkFirewallTest(BaseTest):
def test_firewall(self):
factory = self.replay_flight_data("test_network_firewall")
p = self.load_policy({
'name': 'firewall-get',
... | apache-2.0 |
tabo/feedjack | feedjack/models.py | 4 | 6748 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0232, R0903, W0131
"""
feedjack
Gustavo Picón
models.py
"""
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
from feedjack import fjcache
SITE_ORDERBY_CHOICES = (
(1, _('Date publi... | bsd-3-clause |
gdgellatly/OCB1 | addons/procurement/wizard/schedulers_all.py | 23 | 3612 | # -*- 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 |
mts90/ardupilot | Tools/LogAnalyzer/tests/TestDupeLogData.py | 273 | 2651 | from LogAnalyzer import Test,TestResult
import DataflashLog
class TestDupeLogData(Test):
'''test for duplicated data in log, which has been happening on PX4/Pixhawk'''
def __init__(self):
Test.__init__(self)
self.name = "Dupe Log Data"
def __matchSample(self, sample, sampleStartIndex, logdata):
'''return... | gpl-3.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/scipy/_lib/_threadsafety.py | 71 | 1530 | from __future__ import division, print_function, absolute_import
import threading
import scipy._lib.decorator
__all__ = ['ReentrancyError', 'ReentrancyLock', 'non_reentrant']
class ReentrancyError(RuntimeError):
pass
class ReentrancyLock(object):
"""
Threading lock that raises an exception for reent... | mit |
layar/zinnia-wysiwyg-wymeditor | zinnia_wymeditor/tests.py | 2 | 2276 | """Test cases for zinnia-wymeditor"""
from django.test import TestCase
from django.test import RequestFactory
from django.contrib.admin.sites import AdminSite
from django.test.utils import restore_template_loaders
from django.test.utils import setup_test_template_loader
from zinnia.models.entry import Entry
from zinni... | bsd-3-clause |
Danisan/odoo-1 | addons/account_chart/__init__.py | 526 | 1055 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
colin-scott/web-page-replay | third_party/nbhttp/client.py | 9 | 15527 | #!/usr/bin/env python
__copyright__ = """\
Copyright (c) 2008-2009 Mark Nottingham
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 ... | apache-2.0 |
dart-archive/dart-sdk | tools/dom/scripts/dartgenerator_test.py | 2 | 8133 | #!/usr/bin/python
# Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
# for details. 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 dartgenerator."""
import logging.config
import os.path
import re
import shu... | bsd-3-clause |
perkinslr/pypyjs | addedLibraries/encodings/iso8859_13.py | 593 | 13527 | """ Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... | mit |
d4nielcosta/djangoembed | oembed/parsers/html.py | 4 | 2313 | import re
from BeautifulSoup import BeautifulSoup # use BS to parse HTML (it's easy!)
import oembed
from oembed.constants import OEMBED_BLOCK_ELEMENTS, URL_RE, STANDALONE_URL_RE
from oembed.exceptions import OEmbedException
from oembed.parsers.base import BaseParser
from oembed.parsers.text import TextParser, TextBlo... | mit |
giorgiop/scipy | scipy/linalg/tests/test_solvers.py | 95 | 9591 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.linalg import inv
from numpy.testing import TestCase, rand, run_module_suite, assert_raises, \
assert_equal, assert_almost_equal, assert_array_almost_equal, assert_, \
assert_allclose
from scipy.linalg import solve... | bsd-3-clause |
vnsofthe/odoo-dev | addons/portal_gamification/__openerp__.py | 381 | 1571 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
jgowans/directionFinder_backend | bin/calibrate_time_domain.py | 1 | 7095 | #!/usr/bin/env python
from directionFinder_backend.correlator import Correlator
import scipy.signal as signal
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
import logging
import time
im... | mit |
drgarcia1986/le_python | logentries/utils.py | 1 | 6315 | # coding: utf-8
# vim: set ts=4 sw=4 et:
""" This file contains some utils for connecting to Logentries
as well as storing logs in a queue and sending them."""
VERSION = '2.0.7'
from logentries import helpers as le_helpers
import logging
import threading
import socket
import random
import time
import sys
import... | mit |
arokem/nipy | nipy/algorithms/statistics/models/tests/test_olsR.py | 3 | 56771 |
import numpy as np
from ..regression import OLSModel
import nipy.testing as niptest
import scipy.stats
from .exampledata import x, y
Rscript = '''
d = read.table('data.csv', header=T, sep=' ')
y.lm = lm(Y ~ X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9 + X10 + X11 + X12 + X13 + X14, data=d)
print(summary(y.lm))
y.lm2... | bsd-3-clause |
meisterkleister/erpnext | erpnext/accounts/doctype/fiscal_year/fiscal_year.py | 51 | 2804 | # 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 msgprint, _
from frappe.utils import getdate, add_days, add_years, cstr
from dateutil.relativedelta import relativedelt... | agpl-3.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/pygments/lexers/iolang.py | 77 | 1904 | # -*- coding: utf-8 -*-
"""
pygments.lexers.iolang
~~~~~~~~~~~~~~~~~~~~~~
Lexers for the Io language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer
from pygments.token import Text, Comment, Oper... | bsd-3-clause |
futurulus/scipy | scipy/optimize/tests/test_optimize.py | 21 | 39326 | """
Unit tests for optimization routines from optimize.py
Authors:
Ed Schofield, Nov 2005
Andrew Straw, April 2008
To run it in its simplest form::
nosetests test_optimize.py
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import (a... | bsd-3-clause |
utkbansal/kuma | vendor/packages/logilab/common/textutils.py | 90 | 17277 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... | mpl-2.0 |
wrobell/smemlcd | smemlcd/glue.py | 1 | 3428 | #
# smemlcd - Sharp Memory LCDs library
#
# Copyright (C) 2014-2017 by Artur Wroblewski <wrobell@riseup.net>
#
# 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... | gpl-3.0 |
PhilWhitehurst/long-distance | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/dalvik.py | 364 | 3442 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dalvik
~~~~~~~~~~~~~~~~~~~~~~
Pygments lexers for Dalvik VM-related languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, bygroups
from p... | mit |
dustinvtran/bayesrl | bayesrl/environments/pomdpgw.py | 1 | 11259 | import numpy as np
from ..utils import check_random_state
# Maze state is represented as a 2-element NumPy array: (Y, X). Increasing Y is South.
# Possible actions, expressed as (delta-y, delta-x).
maze_actions = {
'N': np.array([-1, 0]),
'S': np.array([1, 0]),
'E': np.array([0, 1]),
'W': np.array([0... | mit |
837468220/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 |
wuhengzhi/chromium-crosswalk | third_party/closure_linter/closure_linter/statetracker.py | 74 | 37897 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | bsd-3-clause |
takeshineshiro/nova | nova/tests/functional/v3/test_flavors.py | 3 | 2406 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
martiinsiimon/dogtail | dogtail/rawinput.py | 1 | 8141 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from dogtail.config import config
from dogtail.utils import doDelay
from dogtail.logging import debugLogger as logger
from pyatspi import Registry as registry
from pyatspi import (KEY_SYM, KEY_PRESS, KEY_PRESSRELE... | gpl-2.0 |
npoznans/python_etl | etl_base.py | 1 | 1501 | #!/usr/bin/env python
import csv
import psycopg2
triggers = []
try:
conn = psycopg2.connect("dbname='well_info_development' host='localhost' user='postgres' password='postgres'")
except:
print "I am unable to connect to the database."
if 'test_recommendations.csv' is '':
print "\n\n\tYou need to pull dow... | mit |
jbtule/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/compat/_scons_hashlib.py | 19 | 2950 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | apache-2.0 |
hoihu/micropython | tests/basics/string_format2.py | 45 | 2025 | # comprehensive functionality test for {} format string
int_tests = False # these take a while
char_tests = True
str_tests = True
def test(fmt, *args):
print('{:8s}'.format(fmt) + '>' + fmt.format(*args) + '<')
def test_fmt(conv, fill, alignment, sign, prefix, width, precision, type, arg):
fmt = '{'
if ... | mit |
ArcherSys/ArcherSys | eclipse/plugins/org.python.pydev.jython_4.5.5.201603221110/Lib/json/tests/test_encode_basestring_ascii.py | 143 | 2004 | from collections import OrderedDict
from json.tests import PyTest, CTest
CASES = [
(u'/\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\x08\x0c\n\r\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?', '"/\\\\\\"\\ucafe\\ubabe\\uab98\\ufcde\\ubcda\\uef4a\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:\',./<>?"'),
(u'\u0123\u4567\u89ab\ucdef\uab... | mit |
bizzarri/aws-sdk-cpp | android-build/build_and_test_android.py | 6 | 13012 | #
# Copyright 2010-2015 Amazon.com, Inc. or its affiliates. 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" fi... | apache-2.0 |
chengduoZH/Paddle | python/paddle/fluid/tests/unittests/test_group_norm_op.py | 2 | 8243 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
subutai/nupic | tests/integration/nupic/opf/opf_checkpoint_test/experiments/temporal_anomaly/b/description.py | 20 | 2102 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2011-2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This p... | agpl-3.0 |
abbacode/acixl | aci.py | 1 | 6156 | import requests
import json
import excel
import jinja2
from collections import OrderedDict
from requests.packages.urllib3.exceptions import InsecureRequestWarning
JSON_ROOT_FOLDER = 'C:\\acixl\\jsondata\\'
LAUNCHER_FILE = 'C:\\acixl\\launcher.json'
APIC_URI = 'https://{apic}/api/node/{payload_uri}.json'
# Disable url... | apache-2.0 |
pagesjaunes/pydeepdiff | test/test_get_true_diff.py | 1 | 5950 | """
Test of get_diff function
"""
from pydeepdiff.diff import get_diff
def test_empty_diff():
a = {
"api_response": {
"status_code": 200
},
"ambiguite": True,
"creation_date": "2015-12-15T10:31:41.074353+00:00",
"blocs_reponses": [{
... | gpl-2.0 |
dstrockis/outlook-autocategories | lib/cryptography/hazmat/bindings/openssl/_conditional.py | 13 | 9173 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
# This is a temporary copy of all the CONDITIONAL_NAMES from _cffi_src so... | apache-2.0 |
mistercrunch/airflow | tests/ti_deps/deps/test_not_previously_skipped_dep.py | 5 | 5265 | #
# 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 |
snazy/cassandra | pylib/cqlshlib/formatting.py | 20 | 23714 | # 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 u... | apache-2.0 |
campbe13/openhatch | mysite/profile/migrations/0098_auto__del_dataimportattempt__del_field_citation_data_import_attempt__d.py | 15 | 17539 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'RepositoryCommitter', fields ['project', 'data_i... | agpl-3.0 |
OnizukaLab/SimpleSeq2Seq | seq2seq.py | 1 | 6470 | # -*- coding:utf-8 -*-
"""
Sample script of Sequence to Sequence model.
You can also use Batch and GPU.
This model is based on below paper.
Ilya Sutskever, Oriol Vinyals, and Quoc V. Le.
Sequence to sequence learning with neural networks.
In Advances in Neural Information Processing Systems (NIPS 2014).
"""
import os
... | mit |
mfjb/scikit-learn | examples/svm/plot_svm_scale_c.py | 223 | 5375 | """
==============================================
Scaling the regularization parameter for SVCs
==============================================
The following example illustrates the effect of scaling the
regularization parameter when using :ref:`svm` for
:ref:`classification <svm_classification>`.
For SVC classificati... | bsd-3-clause |
maurofaccenda/ansible | lib/ansible/plugins/connection/local.py | 35 | 6812 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015, 2017 Toshio Kuratomi <tkuratomi@ansible.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, eithe... | gpl-3.0 |
odootr/odoo | addons/email_template/tests/test_ir_actions.py | 382 | 2587 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
ksmaheshkumar/weevely3 | modules/file/bzip2.py | 15 | 1351 | from core.vectors import PhpFile, ModuleExec
from core.module import Module
from core import messages
from core import modules
from core.loggers import log
import os
class Bzip2(Module):
"""Compress or expand bzip2 files."""
aliases = [ 'bzip2', 'bunzip2' ]
def init(self):
self.register_info(
... | gpl-3.0 |
dagdaggo/coala | coalib/output/JSONEncoder.py | 13 | 1251 | import collections
import json
from datetime import datetime
from coalib.misc.Decorators import get_public_members
from coalib.settings.FunctionMetadata import FunctionMetadata
def create_json_encoder(**kwargs):
class JSONEncoder(json.JSONEncoder):
@classmethod
def _filter_params(cls, op, nop):
... | agpl-3.0 |
nielsvanoch/django | django/forms/utils.py | 14 | 5914 | from __future__ import unicode_literals
import json
import sys
try:
from collections import UserList
except ImportError: # Python 2
from UserList import UserList
from django.conf import settings
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import format_ht... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.