repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
tvtsoft/odoo8 | addons/mail/tests/test_invite.py | 2 | 1924 | # -*- coding: utf-8 -*-
from .common import TestMail
from openerp.tools import mute_logger
class TestInvite(TestMail):
@mute_logger('openerp.addons.mail.models.mail_mail')
def test_invite_email(self):
mail_invite = self.env['mail.wizard.invite'].with_context({
'default_res_model': 'mail.... | agpl-3.0 |
openstack/cloudbase-init | cloudbaseinit/tests/utils/test_debiface.py | 3 | 2720 | # Copyright 2014 Cloudbase Solutions Srl
#
# 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 l... | apache-2.0 |
p0psicles/SickRage | lib/github/File.py | 74 | 5212 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/pip/_vendor/chardet/utf8prober.py | 290 | 2766 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
naokimiyasaka/sublime-text | Packages/Package Control/package_control/commands/existing_packages_command.py | 11 | 2110 | import os
import re
import sublime
from ..package_manager import PackageManager
class ExistingPackagesCommand():
"""
Allows listing installed packages and their current version
"""
def __init__(self):
self.manager = PackageManager()
def make_package_list(self, action=''):
"""
... | mit |
cgstudiomap/cgstudiomap | main/eggs/Django-1.9-py2.7.egg/django/contrib/gis/gdal/libgdal.py | 449 | 3598 | from __future__ import unicode_literals
import logging
import os
import re
from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contri... | agpl-3.0 |
maartenq/ansible | lib/ansible/modules/network/f5/bigip_cli_alias.py | 6 | 12104 | #!/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 |
holiman/pyethereum | ethereum/ethash_utils.py | 6 | 3288 | import sha3
from rlp.utils import decode_hex, encode_hex
import sys
WORD_BYTES = 4 # bytes in word
DATASET_BYTES_INIT = 2**30 # bytes in dataset at genesis
DATASET_BYTES_GROWTH = 2**23 # growth per epoch (~7 GB per year)
CACHE_BYTES_INIT = 2**24 # Size of the dataset relative to... | mit |
NYU-DevOps-S17/Orders | tests/test_server.py | 1 | 6572 | # Test cases can be run with either of the following:
# python -m unittest discover
# nosetests -v --rednose --nologcapture
import unittest
import logging
import json
from app import server
# Status Codes
HTTP_200_OK = 200
HTTP_201_CREATED = 201
HTTP_204_NO_CONTENT = 204
HTTP_400_BAD_REQUEST = 400
HTTP_404_NOT_FOUND ... | apache-2.0 |
Endika/django | django/conf/locale/sk/formats.py | 504 | 1173 | # -*- 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. F Y'
TIME_FORMAT = 'G:i'
DATET... | bsd-3-clause |
jorik041/stackprinter | app/lib/deliciousapi.py | 2 | 50450 | """
Unofficial Python API for retrieving data from Delicious.com.
This module provides the following features plus some more:
* retrieving a URL's full public bookmarking history including
* users who bookmarked the URL including tags used for such bookmarks
and the creation time of the ... | bsd-3-clause |
kustodian/ansible | lib/ansible/modules/network/voss/voss_config.py | 42 | 18722 | #!/usr/bin/python
# Copyright: (c) 2018, Extreme 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',
'status':... | gpl-3.0 |
leppa/home-assistant | homeassistant/components/fibaro/cover.py | 7 | 2452 | """Support for Fibaro cover - curtains, rollershutters etc."""
import logging
from homeassistant.components.cover import (
ATTR_POSITION,
ATTR_TILT_POSITION,
ENTITY_ID_FORMAT,
CoverDevice,
)
from . import FIBARO_DEVICES, FibaroDevice
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, co... | apache-2.0 |
orkacoin/orkacoin | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
Mtax/xadmin-khb | xadmin/plugins/relate.py | 6 | 8064 | # coding=UTF-8
from django.core.urlresolvers import reverse
from django.utils.encoding import force_str
from django.utils.encoding import smart_str
from django.utils.safestring import mark_safe
from django.db.models.sql.query import LOOKUP_SEP
from django.db.models.fields.related import ForeignObjectRel
from django.uti... | bsd-3-clause |
code-sauce/tensorflow | tensorflow/contrib/learn/python/learn/estimators/dynamic_rnn_estimator_test.py | 2 | 35140 | # 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 |
imbasimba/astroquery | astroquery/exoplanet_orbit_database/exoplanet_orbit_database.py | 2 | 4218 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import json
import os
from astropy.utils.data import download_file
from astropy.io import ascii
from astropy.table import QTable
import astropy.un... | bsd-3-clause |
hugobranquinho/ines | ines/__init__.py | 1 | 1198 | # -*- coding: utf-8 -*-
import datetime
import errno
from os import getpid, linesep, uname
from os.path import join as os_join
import sys
from tempfile import gettempdir
from time import time as _now_time
APPLICATIONS = {}
CAMELCASE_UPPER_WORDS = {'CSV'}
MARKER = object()
API_CONFIGURATION_EXTENSIONS = {}
DEFAULT_R... | mit |
ikottman/alexa-skills | office_hours/dependencies/requests/packages/chardet/sjisprober.py | 1777 | 3764 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | unlicense |
Dwolla/arbalest | examples/s3_json_object_to_redshift.py | 1 | 2379 | #!/usr/bin/env python
import psycopg2
from arbalest.configuration import env
from arbalest.redshift import S3CopyPipeline
from arbalest.redshift.schema import JsonObject, Property
"""
**Example: Bulk copy JSON objects from S3 bucket to Redshift table**
Arbalest orchestrates data loading using pipelines. Each `Pipelin... | mit |
anryko/ansible | lib/ansible/module_utils/facts/hardware/hurd.py | 232 | 1753 | # 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 in the hope that ... | gpl-3.0 |
migonzalvar/rs232-obd-sim | lib/utils.py | 6 | 2017 | import random
import string
def debug(msg):
pass #print('-- ' + msg)
def sample(var):
if var == 'VSS':
self = hex (int(random.randrange(40,90)))[2:].upper()
elif var == 'RPM':
self = hex (int(random.randrange(750,4500)))[2:].upper()
else:
self = hex (int(random.ran... | gpl-3.0 |
hedaoyuan/Paddle | v1_api_demo/sequence_tagging/dataprovider.py | 13 | 7451 | # Copyright (c) 2016 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 applic... | apache-2.0 |
fighterCui/L4ReFiascoOC | l4/pkg/python/contrib/Lib/lib2to3/pgen2/tokenize.py | 52 | 16184 | # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | gpl-2.0 |
Tagar/incubator-airflow | airflow/operators/postgres_operator.py | 3 | 2439 | # -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... | apache-2.0 |
BigBrother1984/android_external_chromium_org | tools/deep_memory_profiler/subcommands/upload.py | 123 | 2545 | # 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.
import logging
import os
import subprocess
import tempfile
import zipfile
from lib.subcommand import SubCommand
from lib.symbol import SymbolDataSources
L... | bsd-3-clause |
hlmnrmr/superdesk-core | superdesk/tests/steps.py | 1 | 91099 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import os
i... | agpl-3.0 |
ESS-LLP/erpnext-healthcare | erpnext/hr/doctype/payroll_entry/payroll_entry.py | 1 | 20575 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from dateutil.relativedelta import relativedelta
from frappe.utils import cint,... | gpl-3.0 |
alvin777/excelsior | sort/benchmark.py | 1 | 2909 | #!/usr/bin/python
import time
from simple_sorts import *
from shell_sort import *
from quick_sort import *
from external_merge_sort import *
from radix_sort import *
from merge_sort import *
from heap_sort import *
from intro_sort import *
from timsort import *
from list_generators import *
result = {}
def run_un... | gpl-2.0 |
n0trax/ansible | lib/ansible/plugins/action/telnet.py | 29 | 3084 | # (c) 2017, Ansible Project
#
# 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
import telnetlib
from time import sleep
from ansible.module_utils._text import to_native
from ansible.mod... | gpl-3.0 |
chouseknecht/ansible | lib/ansible/modules/network/fortios/fortios_log_null_device_setting.py | 14 | 8723 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# 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 Lic... | gpl-3.0 |
amitdhiman000/MyOffers | myadmin/views.py | 1 | 7396 | from myadmin.backenddb import (insert_default_areas, insert_custom_areas, insert_default_categories)
from offer.models import CategoryModel
from locus.models import (CountryModel ,StateModel, CityModel, AreaModel)
from mail.models import (PublicMessageModel)
from myadmin.preload_data import (gCountries, gCategories)
f... | apache-2.0 |
uqyge/combustionML | FPV_ANN_pureResNet/data_reader_2.py | 1 | 5981 | import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler, StandardScaler
class data_scaler(object):
def __init__(self):
self.norm = None
self.norm_1 = None
self.std = None
self.case = None
self.scale = 1
self.bias = 1e-20
# ... | mit |
BaluDontu/docker-volume-vsphere | esx_service/vsan_policy_test.py | 1 | 2572 | # Copyright 2016 VMware, 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 |
jeffzheng1/tensorflow | tensorflow/python/kernel_tests/template_test.py | 6 | 9746 | # 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 |
xunmengfeng/engine | build/android/pylib/base/test_run_factory.py | 45 | 2028 | # 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.
from pylib.gtest import gtest_test_instance
from pylib.gtest import local_device_gtest_run
from pylib.instrumentation import instrumentation_test_instance
fr... | bsd-3-clause |
tsgit/invenio | modules/miscutil/lib/upgrades/invenio_2014_01_22_queue_table_virtual_index.py | 16 | 2740 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at yo... | gpl-2.0 |
informatik-mannheim/Moduro-CC3D | Simulation/Logger/ArrangementFitnessSteppable.py | 1 | 5298 | # Copyright 2016 the original author or authors.
#
# 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 |
dbussink/linux | tools/perf/util/setup.py | 766 | 1540 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
andyh616/mne-python | mne/tests/test_epochs.py | 1 | 71695 | # Author: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
from copy import deepcopy
from nose.tools import (assert_true, assert_equal, assert_raises,
assert_not_equal)
from numpy.... | bsd-3-clause |
dkrisman/Traipse | mercurial/portable_hgweb/server.py | 1 | 10801 | # hgweb/server.py - The standalone hg web server.
#
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2, incorporated herein by reference.
im... | gpl-2.0 |
yl565/statsmodels | statsmodels/examples/ex_scatter_ellipse.py | 39 | 1367 | '''example for grid of scatter plots with probability ellipses
Author: Josef Perktold
License: BSD-3
'''
from statsmodels.compat.python import lrange
import numpy as np
import matplotlib.pyplot as plt
from statsmodels.graphics.plot_grids import scatter_ellipse
nvars = 6
mmean = np.arange(1.,nvars+1)/nvars * 1.5
... | bsd-3-clause |
spbguru/repo1 | tests/integration/py2/nupic/opf/prediction_metrics_manager_test.py | 17 | 1272 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# 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 ... | gpl-3.0 |
jicruz/heroku-bot | lib/pycparser/_ast_gen.py | 22 | 8675 | #-----------------------------------------------------------------
# _ast_gen.py
#
# Generates the AST Node classes from a specification given in
# a configuration file
#
# The design of this module was inspired by astgen.py from the
# Python 2.5 code-base.
#
# Eli Bendersky [http://eli.thegreenplace.net]
# License: BS... | gpl-3.0 |
ahmedaljazzar/edx-platform | common/lib/xmodule/xmodule/modulestore/tests/test_store_utilities.py | 4 | 2056 | """
Tests for store_utilities.py
"""
import unittest
from mock import Mock
import ddt
from xmodule.modulestore.store_utilities import (
get_draft_subtree_roots, draft_node_constructor
)
@ddt.ddt
class TestUtils(unittest.TestCase):
"""
Tests for store_utilities
ASCII trees for ONLY_ROOTS and SOME_TRE... | agpl-3.0 |
tinchoss/Python_Android | python/gdata/src/gdata/tlslite/X509CertChain.py | 45 | 6681 | """Class representing an X.509 certificate chain."""
from utils import cryptomath
class X509CertChain:
"""This class represents a chain of X.509 certificates.
@type x509List: list
@ivar x509List: A list of L{tlslite.X509.X509} instances,
starting with the end-entity certificate and with every
sub... | apache-2.0 |
rsvip/Django | tests/auth_tests/test_templates.py | 328 | 2785 | from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from django.contrib.auth.views import (
password_change, password_change_done, password_reset,
password_reset_complete, password_reset_confirm, password_res... | bsd-3-clause |
python-rope/rope | rope/refactor/introduce_factory.py | 3 | 6188 | import rope.base.exceptions
import rope.base.pyobjects
from rope.base import libutils
from rope.base import taskhandle, evaluate
from rope.base.change import (ChangeSet, ChangeContents)
from rope.refactor import rename, occurrences, sourceutils, importutils
class IntroduceFactory(object):
def __init__(self, proj... | lgpl-3.0 |
benjixx/ansible | lib/ansible/utils/module_docs_fragments/backup.py | 427 | 1071 | # Copyright (c) 2015 Ansible, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansi... | gpl-3.0 |
UITools/saleor | saleor/shipping/migrations/0013_auto_20180822_0721.py | 1 | 4293 | # Generated by Django 2.0.3 on 2018-08-22 12:20
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_countries.fields
import django_measurement.models
import django_prices.models
import saleor.core.weight
class Migration(migrations.Migration):
... | bsd-3-clause |
arborh/tensorflow | tensorflow/python/kernel_tests/losses_test.py | 9 | 66662 | # 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 |
RyanSkraba/beam | sdks/python/apache_beam/io/gcp/datastore_write_it_pipeline.py | 1 | 7435 | #
# 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 us... | apache-2.0 |
ijmarshall/cochrane-nlp | quality4.py | 1 | 73371 | from tokenizer import sent_tokenizer, word_tokenizer
import biviewer
import pdb
import re
import progressbar
import collections
import string
from unidecode import unidecode
import codecs
import yaml
from pprint import pprint
import numpy as np
import math
import difflib
import sklearn
from sklearn.feature_extracti... | gpl-3.0 |
foodszhang/kbengine | kbe/src/lib/python/Lib/test/test_unpack.py | 174 | 2619 | doctests = """
Unpack tuple
>>> t = (1, 2, 3)
>>> a, b, c = t
>>> a == 1 and b == 2 and c == 3
True
Unpack list
>>> l = [4, 5, 6]
>>> a, b, c = l
>>> a == 4 and b == 5 and c == 6
True
Unpack implied tuple
>>> a, b, c = 7, 8, 9
>>> a == 7 and b == 8 and c == 9
True
Unpa... | lgpl-3.0 |
MLAB-project/weewx | examples/pmon/bin/user/pmon.py | 4 | 5857 | # Copyright 2013 Matthew Wall
"""weewx module that records process information.
Installation
Put this file in the bin/user directory.
Configuration
Add the following to weewx.conf:
[ProcessMonitor]
data_binding = pmon_binding
[DataBindings]
[[pmon_binding]]
database = pmon_sqlite
manager ... | gpl-3.0 |
darkleons/BE | openerp/report/common.py | 457 | 3337 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
jakerockland/find-s | find-s.py | 1 | 3211 | # This program is an machine learning experiment with the FindS concept learning algorithm
# Based on an excercise from Machine Learning by Thomas Mitchell (1997)
# By: Jacob Rockland
#
# The attribute EnjoySport indicates whether or not Aldo enjoys his favorite
# water sport on this day
#
# For all possible days with ... | mit |
shssoichiro/servo | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1/support/generate-text-emphasis-ruby-tests.py | 829 | 3042 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-ruby-001 ~ 004 which tests
emphasis marks with ruby in four directions. It outputs a list of all
tests it generated in the format of Mozilla reftest.list to the stdout.
"""
from __future__ import unicode_literals
TEST_FIL... | mpl-2.0 |
souzabrizolara/py-home-shell | src/dao/appliancedao.py | 1 | 1109 | __author__ = 'alisonbento'
import basedao
from src.entities.hsappliance import HomeShellAppliance
import datetime
import configs
class ApplianceDAO(basedao.BaseDAO):
def __init__(self, connection):
basedao.BaseDAO.__init__(self, connection, 'hs_appliances', 'appliance_id')
def convert_row_to_object(... | apache-2.0 |
harshaneelhg/scikit-learn | examples/linear_model/plot_lasso_lars.py | 363 | 1080 | #!/usr/bin/env python
"""
=====================
Lasso path using LARS
=====================
Computes Lasso Path along the regularization parameter using the LARS
algorithm on the diabetes dataset. Each color represents a different
feature of the coefficient vector, and this is displayed as a function
of the regulariza... | bsd-3-clause |
Flutras/techstitution | app/mod_main/views.py | 1 | 15521 | from flask import Blueprint, render_template, request, redirect, url_for, Response, jsonify, flash
from flask_wtf import FlaskForm
from wtforms import StringField, IntegerField, DateTimeField, TextField, SubmitField, TextAreaField, RadioField
from wtforms import validators, ValidationError
from wtforms.validators impor... | cc0-1.0 |
catapult-project/catapult-csm | third_party/gsutil/third_party/boto/boto/contrib/__init__.py | 147 | 1105 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | bsd-3-clause |
vsvankhede/foursquared | mock_server/playfoursquare.py | 134 | 2253 | #!/usr/bin/python2.6
#
# Simple http server to emulate api.playfoursquare.com
import logging
import shutil
import sys
import urlparse
import SimpleHTTPServer
import BaseHTTPServer
class RequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""Handle playfoursquare.com requests, for testing."""
def do_GET(self... | apache-2.0 |
Mozhuowen/brython | www/src/Lib/test/test_winsound.py | 25 | 9156 | # Ridiculously simple test of the winsound module for Windows.
import unittest
from test import support
support.requires('audio')
import time
import os
import subprocess
winsound = support.import_module('winsound')
ctypes = support.import_module('ctypes')
import winreg
def has_sound(sound):
"""Find out if a part... | bsd-3-clause |
theDarkForce/websearch | webseach_book.py | 1 | 2428 | # -*- coding: UTF-8 -*-
# webseach
# create at 2015/10/30
# autor: qianqians
import sys
reload(sys)
sys.setdefaultencoding('utf8')
sys.path.append('../')
from webget import gethtml
import pymongo
from doclex import doclex
import time
collection_key = None
def seach(urllist):
def process_keyurl(keyurl):
... | bsd-2-clause |
bestwpw/BDA_py_demos | demos_ch5/demo5_2.py | 19 | 3326 | """Bayesian Data Analysis, 3rd ed
Chapter 5, demo 2
Hierarchical model for SAT-example data (BDA3, p. 102)
"""
from __future__ import division
import numpy as np
from scipy.stats import norm
import scipy.io # For importing a matlab file
import matplotlib.pyplot as plt
# Edit default plot settings (colours from colo... | gpl-3.0 |
gsehub/edx-platform | common/djangoapps/entitlements/tasks.py | 17 | 2794 | """
This file contains celery tasks for entitlements-related functionality.
"""
from celery import task
from celery.utils.log import get_task_logger
from django.conf import settings
from entitlements.models import CourseEntitlement
LOGGER = get_task_logger(__name__)
# Under cms the following setting is not defined,... | agpl-3.0 |
mmw125/MuDimA | server/database_reader.py | 1 | 7747 | """Functions for reading from the database."""
import constants
import database_utils
import models
def get_urls():
"""Get all of the urls in articles in the database."""
with database_utils.DatabaseConnection() as (connection, cursor):
cursor.execute("SELECT link FROM article;")
urls = set(i... | gpl-3.0 |
graphite/TeX4Web-INVENIO | modules/bibsword/lib/bibsword_webinterface.py | 31 | 22937 | '''
Forward to ArXiv.org source code
'''
## This file is part of Invenio.
## Copyright (C) 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, o... | gpl-2.0 |
andrius-preimantas/odoo | openerp/addons/base/tests/test_base.py | 64 | 33559 | import unittest2
import openerp.tests.common as common
from openerp.osv.orm import except_orm
class test_base(common.TransactionCase):
def setUp(self):
super(test_base,self).setUp()
self.res_partner = self.registry('res.partner')
self.res_users = self.registry('res.users')
self.re... | agpl-3.0 |
jamiefolsom/edx-platform | common/djangoapps/xblock_django/migrations/0001_initial.py | 79 | 4946 | # -*- 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):
# Adding model 'XBlockDisableConfig'
db.create_table('xblock_django_xbloc... | agpl-3.0 |
edespino/gpdb | gpMgmt/bin/gppylib/test/unit/test_unit_gpstop.py | 4 | 22040 | import imp
import os
import sys
from gparray import GpDB, GpArray, Segment
from mock import Mock, patch
from gppylib.test.unit.gp_unittest import GpTestCase, run_tests
from gppylib.commands.gp import GpSegStopCmd
from gppylib.mainUtils import ProgramArgumentValidationException
class GpStop(GpTestCase):
def setUp... | apache-2.0 |
KeyWeeUsr/kivy | kivy/uix/dropdown.py | 16 | 12790 | '''
Drop-Down List
==============
.. image:: images/dropdown.gif
:align: right
.. versionadded:: 1.4.0
A versatile drop-down list that can be used with custom widgets. It allows you
to display a list of widgets under a displayed widget. Unlike other toolkits,
the list of widgets can contain any type of widget: s... | mit |
danilito19/django | tests/template_tests/filter_tests/test_addslashes.py | 473 | 1202 | from django.template.defaultfilters import addslashes
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class AddslashesTests(SimpleTestCase):
@setup({'addslashes01': '{% autoescape off %}{{ a|addslashes }} {{ b|addslashes }}{% endautoescape %}'})
... | bsd-3-clause |
gasman/wagtaildemo | wagtaildemo/wsgi.py | 17 | 1144 | """
WSGI config for wagtaildemo project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | bsd-3-clause |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-3.5.0/Lib/email/mime/application.py | 414 | 1256 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Keith Dart
# Contact: email-sig@python.org
"""Class representing application/* type MIME documents."""
__all__ = ["MIMEApplication"]
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
class MIMEApplication(MIMENonMultipart)... | mit |
yufish/youtube-dl | youtube_dl/extractor/fivetv.py | 139 | 2959 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class FiveTVIE(InfoExtractor):
_VALID_URL = r'''(?x)
http://
(?:www\.)?5-tv\.ru/
(?:
... | unlicense |
squirrelo/qiita | qiita_pet/handlers/study_handlers/tests/test_prep_template.py | 1 | 2221 | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
kbrebanov/ansible | lib/ansible/plugins/netconf/iosxr.py | 2 | 7442 | #
# (c) 2017 Red Hat Inc.
# (c) 2017 Kedar Kekan (kkekan@redhat.com)
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your ... | gpl-3.0 |
jagg81/translate-toolkit | build/lib.linux-x86_64-2.6/translate/storage/statistics.py | 3 | 7920 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 t... | gpl-2.0 |
gcsolaroli/password-manager | backend/flask/src/clipperz/api.py | 2 | 26054 | """Clipperz API handler."""
import json
import random
import hashlib
from flask import jsonify, session, g
from datetime import datetime
from flask.ext.login import logout_user, current_user, login_user, \
login_required
from sqlalchemy.orm.exc import NoResultFound
from clipperz import app, db
from .exceptions imp... | agpl-3.0 |
sebdelsol/pyload | module/lib/jinja2/bccache.py | 284 | 9994 | # -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations whe... | gpl-3.0 |
was4444/chromium.src | native_client_sdk/src/build_tools/sdk_tools/config.py | 131 | 2128 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import logging
import urlparse
from sdk_update_common import Error
SOURCE_WHITELIST = [
'http://localhost/', # For testing.
'https://st... | bsd-3-clause |
kechie/python_koans | python3/libs/colorama/ansi.py | 527 | 1039 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):
def __... | mit |
shootstar/novatest | nova/api/openstack/compute/plugins/v3/extended_availability_zone.py | 15 | 3834 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Netease, LLC.
# 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/licens... | apache-2.0 |
Fireblend/chromium-crosswalk | third_party/mojo/src/mojo/public/tools/bindings/pylib/mojom/parse/ast.py | 34 | 13898 | # 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.
"""Node classes for the AST for a Mojo IDL file."""
# Note: For convenience of testing, you probably want to define __eq__() methods
# for all node types; i... | bsd-3-clause |
varunarya10/boto | boto/cloudfront/__init__.py | 164 | 15176 | # Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | mit |
soycode/pattern | examples/04-search/06-optional.py | 21 | 1640 | import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
from pattern.search import search
from pattern.en import parsetree
# Constraints ending in "?" are optional, matching one or no word.
# Pattern.search() uses a "greedy" approach:
# it will attempt to include as many optional ... | bsd-3-clause |
bmotlaghFLT/FLT_PhantomJS | src/qt/qtwebkit/Source/WebCore/inspector/compile-front-end.py | 116 | 15388 | #!/usr/bin/env python
# Copyright (c) 2012 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 ... | bsd-3-clause |
idem2lyon/persomov | libs/html5lib/inputstream.py | 618 | 30855 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
from six.moves import http_client
import codecs
import re
from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
from .constants import encodings, ReparseException
from . import utils
from io import String... | gpl-3.0 |
rspavel/spack | var/spack/repos/builtin/packages/iwyu/package.py | 3 | 1350 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Iwyu(CMakePackage):
"""include-what-you-use: A tool for use with clang to analyze #include... | lgpl-2.1 |
wschwa/Mr-Orange-Sick-Beard | lib/hachoir_parser/image/psd.py | 90 | 2430 | """
Photoshop parser (.psd file).
Creation date: 8 january 2006
Author: Victor Stinner
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet,
UInt16, UInt32, String, NullBytes, Enum, RawBytes)
from lib.hachoir_core.endian import BIG_ENDIAN
from lib.hachoir_parser.image.photoshop_m... | gpl-3.0 |
marctc/django | tests/urlpatterns_reverse/namespace_urls.py | 160 | 2533 | from django.conf.urls import include, url
from . import views
from .tests import URLObject
testobj1 = URLObject('testapp', 'test-ns1')
testobj2 = URLObject('testapp', 'test-ns2')
default_testobj = URLObject('testapp', 'testapp')
otherobj1 = URLObject('nodefault', 'other-ns1')
otherobj2 = URLObject('nodefault', 'othe... | bsd-3-clause |
andrew-rogers/DSP | GPS/file_reader.py | 1 | 1929 | #!/usr/bin/env python3
"""Global Position System (GPS) file reader for captured IQ signal
The Standard Positioning Service (SPS) spec can be found at
https://www.navcen.uscg.gov/pubs/gps/sigspec/gpssps1.pdf
"""
# Copyright (c) 2021 Andrew Rogers
#
# Permission is hereby granted, free of charge, to any person obt... | gpl-3.0 |
renzon/pypratico | setup.py | 1 | 4933 | import codecs
import os
import sys
from distutils.util import convert_path
from fnmatch import fnmatchcase
from setuptools import setup, find_packages
def read(fname):
return codecs.open(os.path.join(os.path.dirname(__file__), fname)).read()
# Provided as an attribute, so you can append to these instead
# of r... | agpl-3.0 |
mambocab/python-driver | tests/unit/cython/test_bytesio.py | 3 | 1259 | # Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | apache-2.0 |
syndbg/ubuntu-make | tests/medium/test_web.py | 1 | 1847 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distributed in the hope that ... | gpl-3.0 |
gurneyalex/odoo | addons/auth_signup/models/res_partner.py | 4 | 7625 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import random
import werkzeug.urls
from collections import defaultdict
from datetime import datetime, timedelta
from odoo import api, exceptions, fields, models, _
class SignupError(Exception):
pass
def random_to... | agpl-3.0 |
MOSAIC-UA/802.11ah-ns3 | ns-3/src/visualizer/visualizer/svgitem.py | 189 | 5073 | import gobject
import rsvg
#import cairo
import goocanvas
import os.path
class SvgItem(goocanvas.ItemSimple):
# setup our custom properties
__gproperties__ = {
'x': (float, # property type
'X', # property nick name
... | gpl-2.0 |
importre/kotlin-unwrap | utils/gen.py | 1 | 1264 | #! /usr/bin/env python3
import os
impl = '''
class Unwrap(private var valid: Boolean) {
infix fun <R> nah(f: () -> R) {
if (!valid) f()
}
}
'''
template = '''
inline fun <{0}, R> unwrap(
{1},
block: ({0}) -> R): Unwrap {{
val valid = null !in arrayOf{4}({2})
if (valid) block({... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.