repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
erjohnso/libcloud | libcloud/test/dns/test_zonomi.py | 11 | 16370 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
chienlieu2017/it_management | odoo/addons/website_crm_partner_assign/report/crm_partner_report.py | 20 | 2663 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models
from odoo import tools
class CrmPartnerReportAssign(models.Model):
""" CRM Lead Report """
_name = "crm.partner.report.assign"
_auto = False
_description = "CRM Part... | gpl-3.0 |
EvenStrangest/tensorflow | tensorflow/python/ops/histogram_ops_test.py | 19 | 5807 | # 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 |
adamjmcgrath/glancydesign | src/django-nonrel/django/db/backends/mysql/introspection.py | 313 | 4329 | from django.db.backends import BaseDatabaseIntrospection
from MySQLdb import ProgrammingError, OperationalError
from MySQLdb.constants import FIELD_TYPE
import re
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
class DatabaseIntrospection(BaseDatabaseI... | bsd-3-clause |
dc3-plaso/plaso | tests/parsers/docker.py | 1 | 4827 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Tests for the Docker JSON parser."""
import unittest
from plaso.lib import timelib
from plaso.parsers import docker
from tests import test_lib as shared_test_lib
from tests.parsers import test_lib
class DockerJSONUnitTest(test_lib.ParserTestCase):
"""Tests for the Doc... | apache-2.0 |
tmc83/tumul-project-test | templates/main.py | 1 | 16970 | import os
import webapp2
import hmac
import jinja2
from google.appengine.ext import db
from google.appengine.api import memcache
import re
import json
import logging
import datetime
import time
import urllib2
USER_RE = re.compile("^[a-zA-Z0-9_-]{3,20}$")
PASSWORD_RE = re.compile("^.{3,20}$")
EMAIL_RE = re.compile("^[\... | apache-2.0 |
Afrostream/shaka-player | third_party/gjslint/closure_linter-2.3.13/closure_linter/checker.py | 109 | 3892 | #!/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
#... | apache-2.0 |
openstack/cinder | cinder/interface/fczm_driver.py | 13 | 2536 | # Copyright 2016 Dell 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 app... | apache-2.0 |
pearsonlab/nipype | nipype/interfaces/fsl/tests/test_auto_DistanceMap.py | 12 | 1282 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..dti import DistanceMap
def test_DistanceMap_inputs():
input_map = dict(args=dict(argstr='%s',
),
distance_map=dict(argstr='--out=%s',
genfile=True,
hash_files=False,
),
environ=dict(nohash=Tru... | bsd-3-clause |
MuhammadAlkarouri/hug | hug/_version.py | 1 | 1183 | """hug/_version.py
Defines hug version information
Copyright (C) 2016 Timothy Edmund Crosley
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
th... | mit |
lzppp/mylearning | ryu/contrib/ncclient/operations/rpc.py | 31 | 13557 | # Copyright 2009 Shikhar Bhushan
#
# 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 writin... | apache-2.0 |
timonwong/OmniMarkupPreviewer | OmniMarkupLib/Renderers/libs/pygments/lexers/fantom.py | 72 | 9982 | # -*- coding: utf-8 -*-
"""
pygments.lexers.fantom
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the Fantom language.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from string import Template
from pygments.lexer import RegexLexer, include, bygr... | mit |
jessstrap/servotk | tests/wpt/web-platform-tests/tools/py/py/_code/source.py | 174 | 14565 | from __future__ import generators
from bisect import bisect_right
import sys
import inspect, tokenize
import py
from types import ModuleType
cpy_compile = compile
try:
import _ast
from _ast import PyCF_ONLY_AST as _AST_FLAG
except ImportError:
_AST_FLAG = 0
_ast = None
class Source(object):
""" ... | mpl-2.0 |
jeffsf/bml_kernel_samsung_galaxys4g | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | 1744 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(... | gpl-2.0 |
QuantConnect/Lean | Algorithm.Python/MovingAverageCrossAlgorithm.py | 3 | 3441 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen... | apache-2.0 |
xlab-si/fcoclient | fcoclient/resources/server.py | 1 | 3930 | # Copyright (c) 2017 XLAB d.o.o.
#
# 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 writin... | apache-2.0 |
china-quant/backtrader | tests/test_data_replay.py | 2 | 1904 | #!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gpl-3.0 |
SAM-IT-SA/odoo | addons/stock_picking_wave/__openerp__.py | 312 | 1744 | # -*- 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 |
vsajip/django | django/conf/locale/sk/formats.py | 13 | 1352 | # -*- 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:s'
DAT... | bsd-3-clause |
lukw00/shogun | examples/undocumented/python_modular/graphical/interactive_gp_demo.py | 16 | 14207 | #
# 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.
#
# Written (C) 2012 Heiko Strathmann, based on interactive_svm_demo by ... | gpl-3.0 |
buguelos/odoo | addons/l10n_lu/__init__.py | 376 | 1054 | # -*- 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 |
subutai/nupic | tests/integration/nupic/engine/network_checkpoint_test.py | 10 | 3497 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
Yukarumya/Yukarum-Redfoxes | testing/web-platform/tests/tools/pywebsocket/src/mod_pywebsocket/util.py | 497 | 13858 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
mnahm5/django-estore | Lib/site-packages/django/contrib/contenttypes/migrations/0001_initial.py | 585 | 1227 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.contenttypes.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ContentType',
fields=... | mit |
unikmhz/npui | netprofile_xop/netprofile_xop/auth.py | 1 | 7529 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NetProfile: XOP module - Authentication
# Copyright © 2014-2017 Alex Unigovsky
#
# This file is part of NetProfile.
# NetProfile 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 F... | agpl-3.0 |
ahmedbodi/SHA-Eloipool-MMCFE- | jsonrpc_setworkaux.py | 21 | 1103 | # Eloipool - Python Bitcoin pool server
# Copyright (C) 2011-2012 Luke Dashjr <luke-jr+eloipool@utopios.org>
#
# 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, either version 3 of the
# L... | agpl-3.0 |
noroutine/ansible | contrib/inventory/vagrant.py | 22 | 3973 | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... | gpl-3.0 |
huit/packstack | packstack/plugins/glance_200.py | 5 | 4254 | """
Installs and configures Glance
"""
import uuid
import logging
from packstack.installer import validators
from packstack.installer import basedefs
from packstack.installer import utils
from packstack.modules.ospluginutils import getManifestTemplate, appendManifestFile
# Controller object will be initialized from... | apache-2.0 |
benthomasson/behave | behave/reporter/junit.py | 1 | 13183 | # -*- coding: UTF-8 -*-
from __future__ import absolute_import
import os.path
import codecs
import sys
from xml.etree import ElementTree
from behave.reporter.base import Reporter
from behave.model import Scenario, ScenarioOutline, Step
from behave.formatter import ansi_escapes
from behave.model_describe import ModelDe... | bsd-2-clause |
Mitchkoens/sympy | sympy/functions/elementary/tests/test_trigonometric.py | 1 | 49712 | from sympy import (symbols, Symbol, nan, oo, zoo, I, sinh, sin, pi, atan,
acos, Rational, sqrt, asin, acot, coth, E, S, tan, tanh, cos,
cosh, atan2, exp, log, asinh, acoth, atanh, O, cancel, Matrix, re, im,
Float, Pow, gcd, sec, csc, cot, diff, simplify, Heaviside, arg,
conjugate, series... | bsd-3-clause |
RedHatQE/cfme_tests | cfme/fixtures/tag.py | 1 | 4316 | import fauxfactory
import pytest
from cfme.base.credential import Credential
from cfme.cloud.tenant import Tenant
from cfme.infrastructure.host import Host
from cfme.utils.appliance.implementations.ui import navigate_to
from cfme.utils.log import logger
@pytest.fixture(scope="session")
def category(appliance):
"... | gpl-2.0 |
QANSEE/partner-contact | partner_contact_in_several_companies/models.py | 22 | 9635 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-TODAY OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
detiber/ansible | lib/ansible/modules/cloud/amazon/iam_cert.py | 43 | 12011 | #!/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 |
reyrodrigues/EU-SMS | temba/channels/migrations/0019_update_channellog_triggers.py | 3 | 3282 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations, connection
class Migration(migrations.Migration):
dependencies = [
('channels', '0018_auto_20150710_2047'),
]
def clear_channel_logs(apps, schema_editor):
"""
Clear out all o... | agpl-3.0 |
mgaio/parameter-framework | tools/clientSimulator/pfClientSimulator.py | 11 | 8211 | #!/usr/bin/python3
# Copyright (c) 2014-2015, Intel Corporation
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
#... | bsd-3-clause |
tkerola/chainer | tests/chainer_tests/datasets_tests/test_sub_dataset.py | 8 | 9204 | import unittest
from chainer import datasets
from chainer import testing
class TestSubDataset(unittest.TestCase):
def test_sub_dataset(self):
original = [1, 2, 3, 4, 5]
subset = datasets.SubDataset(original, 1, 4)
self.assertEqual(len(subset), 3)
self.assertEqual(subset[0], 2)
... | mit |
samastur/Impostor | tests/conftest.py | 1 | 1505 | import os
import django
import pytest
from django.contrib.auth import get_user_model
def pytest_configure():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
django.setup()
admin_username = 'real_test_admin'
admin_pass = 'admin_pass'
user_username = 'real_test_user'
user_email = 'real@mail.com'... | mit |
eltonkevani/tempest_el_env | tempest/api/volume/test_volumes_get.py | 3 | 6609 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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.apach... | apache-2.0 |
openpolis/open_municipio | open_municipio/acts/migrations/0004_auto__add_field_speech_slug__add_unique_speech_slug__add_unique_speech.py | 1 | 38597 | # -*- 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 field 'Speech.slug'
db.add_column('acts_speech', 'slug',
... | agpl-3.0 |
sametmax/Django--an-app-at-a-time | ignore_this_directory/django/conf/locale/en_GB/formats.py | 35 | 2052 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j M Y' # '25 Oct 2006'
TIME_FORMAT = 'P' # '2:30 p.m.'
DATE... | mit |
geoio/python-geoio | geoio/geoio.py | 1 | 3978 | #
# Created by Felix Wittmann on 2014-03-26
# Copyright (c) 2014 happy bits GmbH. All rights reserved.
#
import json
import logging
import requests
logger = logging.getLogger(__name__)
class GeoioException(Exception):
"""Class for all exceptions thrown by the geoio API."""
def __init__(self, error_messa... | bsd-2-clause |
dga4654dan/UTM-Demo | V_1_0_1/UtmDemo_Sfs_2.9.0/UtmDemo_Sfs_2.9.0_Server/lib/Lib/encodings/__init__.py | 7 | 2822 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to standard lower-case
encoding names with hyphens mapped to underscores, e.g. 'utf-8' is
implemented by the module 'utf_8.py'.
Each codec module... | gpl-2.0 |
prculley/gramps | gramps/plugins/drawreport/drawplugins.gpr.py | 4 | 7435 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
#
#
# 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... | gpl-2.0 |
aabbox/kbengine | kbe/src/lib/python/Tools/clinic/clinic.py | 30 | 146358 | #!/usr/bin/env python3
#
# Argument Clinic
# Copyright 2012-2013 by Larry Hastings.
# Licensed to the PSF under a contributor agreement.
#
import abc
import ast
import atexit
import collections
import contextlib
import copy
import cpp
import functools
import hashlib
import inspect
import io
import itertools
import os
... | lgpl-3.0 |
jlegendary/nupic | tests/unit/nupic/support/consoleprinter_test/consoleprinter_test.py | 8 | 2890 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, 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 |
jasonwzhy/django | django/conf/locale/nn/formats.py | 504 | 1810 | # -*- 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 = 'H:i'
DATET... | bsd-3-clause |
samhoo/askbot-realworld | askbot/conf/sidebar_profile.py | 6 | 1644 | """
Sidebar settings
"""
from askbot.conf.settings_wrapper import settings
from askbot.deps.livesettings import ConfigurationGroup
from askbot.deps.livesettings import values
from django.utils.translation import ugettext as _
from askbot.conf.super_groups import CONTENT_AND_UI
SIDEBAR_PROFILE = ConfigurationGroup(
... | gpl-3.0 |
swdream/neutron | neutron/tests/tempest/common/isolated_creds.py | 27 | 16492 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
tchernomax/ansible | lib/ansible/modules/cloud/azure/azure_rm_managed_disk_facts.py | 10 | 4512 | #!/usr/bin/python
#
# Copyright (c) 2016 Bruno Medina Bolanos Cacho, <bruno.medina@microsoft.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 o... | gpl-3.0 |
dimonaks/siman | tutorials/geo_point_surf/rec10.py | 1 | 4657 | import sys
import numpy as np
sys.path.append('/home/aksenov/Simulation_wrapper/siman') #provide your path to siman package
import header
from header import db # database dictionary
from calc_manage import smart_structure_read, add_loop, res_loop
from geo import supercell
from database import read_database, writ... | gpl-2.0 |
zhimin711/nova | nova/tests/functional/api_sample_tests/test_services.py | 8 | 5156 | # 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 |
botstory/botstory | botstory/ast/story_context/reducers_test.py | 2 | 5572 | from botstory import Story
from botstory.ast import callable, forking, story_context
from botstory.middlewares import location, text
import pytest
@pytest.fixture
def build_mock_context():
def factory(msg):
story = Story()
@story.on('Hi there!')
def one_story():
@story.part()
... | mit |
jalalomary/landsat-util | landsat/mixins.py | 6 | 2902 | # Pansharpened Image Process using Rasterio
# Landsat Util
# License: CC0 1.0 Universal
import sys
import subprocess
from termcolor import colored
class VerbosityMixin(object):
"""
Verbosity Mixin that generates beautiful stdout outputs.
"""
verbose = False
def output(self, value, normal=False,... | cc0-1.0 |
Elandril/Sick-Beard | lib/configobj.py | 145 | 86447 | # configobj.py
# A config file reader/writer that supports nested sections in config files.
# Copyright (C) 2005-2009 Michael Foord, Nicola Larosa
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# nico AT tekNico DOT net
# ConfigObj 4
# http://www.voidspace.org.uk/python/configobj.html
# Released subject to th... | gpl-3.0 |
erikr/django | tests/forms_tests/field_tests/test_imagefield.py | 37 | 1942 | from __future__ import unicode_literals
import os
import unittest
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import ImageField
from django.test import SimpleTestCase
from django.utils._os import upath
try:
from PIL import Image
except ImportError:
Image = None
def get_i... | bsd-3-clause |
alexkolar/home-assistant | homeassistant/components/sensor/systemmonitor.py | 7 | 6265 | """
homeassistant.components.sensor.systemmonitor
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Shows system monitor values such as: disk, memory, and processor use.
Configuration:
To use the System monitor sensor you will need to add something like the
following to your configuration.yaml file.
sensor:
platform: ... | mit |
carthach/essentia | test/src/unittests/highlevel/test_sbic.py | 1 | 8697 | #!/usr/bin/env python
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia 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 (FSF), e... | agpl-3.0 |
salbertperso/ansible-modules-core | cloud/google/gc_storage.py | 41 | 16706 | #!/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 |
konieboy/Seng_403 | Gender Computer/unidecode/x073.py | 252 | 4646 | data = (
'Sha ', # 0x00
'Li ', # 0x01
'Han ', # 0x02
'Xian ', # 0x03
'Jing ', # 0x04
'Pai ', # 0x05
'Fei ', # 0x06
'Yao ', # 0x07
'Ba ', # 0x08
'Qi ', # 0x09
'Ni ', # 0x0a
'Biao ', # 0x0b
'Yin ', # 0x0c
'Lai ', # 0x0d
'Xi ', # 0x0e
'Jian ', # 0x0f
'Qiang ', # 0x10
'Kun... | gpl-3.0 |
tbinjiayou/Odoo | openerp/addons/base/tests/test_basecase.py | 379 | 3895 | # -*- coding: utf-8 -*-
import unittest2
from openerp.tests import common
class test_single_transaction_case(common.SingleTransactionCase):
"""
Check the whole-class transaction behavior of SingleTransactionCase.
"""
def test_00(self):
"""Create a partner."""
cr, uid = self.cr, self.u... | agpl-3.0 |
sputnick-dev/weboob | weboob/applications/galleroob/galleroob.py | 2 | 4793 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Noé Rubinstein
#
# 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 yo... | agpl-3.0 |
minorua/QGIS | tests/src/python/test_qgsmetadatabase.py | 33 | 18665 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsMetadataBase.
Run with: ctest -V -R QgsMetadataBase
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(a... | gpl-2.0 |
crazygold/shadowsocks-rm | tests/test_udp_src.py | 39 | 2498 | #!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... | apache-2.0 |
SasView/sasmodels | sasmodels/models/two_lorentzian.py | 1 | 5653 | r"""
Definition
----------
The scattering intensity $I(q)$ is calculated as
.. math::
I(q) = \frac{A}{1 +(Q\xi_1)^n} + \frac{C}{1 +(Q\xi_2)^m} + \text{B}
where $A$ = Lorentzian scale factor #1, $C$ = Lorentzian scale #2,
$\xi_1$ and $\xi_2$ are the corresponding correlation lengths, and $n$ and
$m$ are the resp... | bsd-3-clause |
mglukhikh/intellij-community | python/lib/Lib/site-packages/django/db/models/loading.py | 308 | 8745 | "Utilities for loading models and the modules that contain them."
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.datastructures import SortedDict
from django.utils.importlib import import_module
from django.utils.module_loading import module_has_submodule
im... | apache-2.0 |
wzyuliyang/scrapy | scrapy/commands/runspider.py | 109 | 3523 | import sys
import os
from importlib import import_module
from scrapy.utils.spider import iter_spider_classes
from scrapy.commands import ScrapyCommand
from scrapy.exceptions import UsageError
from scrapy.utils.conf import arglist_to_dict
def _import_file(filepath):
abspath = os.path.abspath(filepath)
dirname... | bsd-3-clause |
pbrady/sympy | sympy/printing/repr.py | 6 | 6782 | """
A Printer for generating executable code.
The most important function here is srepr that returns a string so that the
relation eval(srepr(expr))=expr holds in an appropriate environment.
"""
from __future__ import print_function, division
from sympy.core.function import AppliedUndef
from .printer import Printer
... | bsd-3-clause |
deandunbar/bitwave | hackathon_version/venv/lib/python2.7/site-packages/django/conf/locale/nn/formats.py | 197 | 1810 | # -*- 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 = 'H:i'
DATET... | mit |
Manojkumar91/odoo_inresto | addons/base_gengo/wizard/base_gengo_translations.py | 7 | 13040 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
woshilapin/cjdns | node_build/dependencies/libuv/build/gyp/test/builddir/gyptest-all.py | 185 | 2706 | #!/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.
"""
Verify the settings that cause a set of programs to be created in
a specific build directory, and that no intermediate built files
get c... | gpl-3.0 |
pycollada/meshtool | meshtool/filters/simplify_filters/graph_utils.py | 1 | 5844 | from heapq import heappush, heappop
from networkx import NetworkXError
import networkx as nx
import __builtin__
def astar_path(G, source, target, heuristic=None, weight='weight', exclude=None, subset=None):
"""Return a list of nodes in a shortest path between source and target
using the A* ("A-star") algorith... | bsd-3-clause |
azureplus/hue | desktop/core/ext-py/Pygments-1.3.1/pygments/formatters/other.py | 75 | 3857 | # -*- coding: utf-8 -*-
"""
pygments.formatters.other
~~~~~~~~~~~~~~~~~~~~~~~~~
Other formatters: NullFormatter, RawTokenFormatter.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments... | apache-2.0 |
brianlorenz/COSMOS_IMACS_Redshifts | PlotCodes/Plot_AvStruct1prop.py | 1 | 5909 | #Creates a BPT diagram for all objects, and a second figure that shows objects for which single lines are low
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import ascii
import sys, os, string
import pandas as pd
from astropy.io import fits
import collections
from astropy.cosmology import WMAP9 as c... | mit |
duncanwp/cis_plugins | caliop_v4.py | 1 | 17132 | from cis.data_io.products.caliop import Caliop_L2, Caliop_L2_NO_PRESSURE, Caliop_L1
import logging
from cis.data_io import hdf as hdf
from cis.data_io.Coord import Coord
from cis.data_io.ungridded_data import UngriddedData
MIXED_RESOLUTION_VARIABLES = ['Atmospheric_Volume_Description', 'CAD_Score',
... | lgpl-3.0 |
andela-ifageyinbo/django | tests/dbshell/test_postgresql_psycopg2.py | 225 | 3961 | # -*- coding: utf8 -*-
from __future__ import unicode_literals
import locale
import os
from django.db.backends.postgresql.client import DatabaseClient
from django.test import SimpleTestCase, mock
from django.utils import six
from django.utils.encoding import force_bytes, force_str
class PostgreSqlDbshellCommandTest... | bsd-3-clause |
hojel/calibre | setup/gui.py | 14 | 2494 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os
from setup import Command, __appname__
class GUI(Command):
descripti... | gpl-3.0 |
Suwmlee/XX-Net | Python3/lib/ctypes/test/test_internals.py | 3 | 2731 | # This tests the internal _objects attribute
import unittest
from ctypes import *
from sys import getrefcount as grc
# XXX This test must be reviewed for correctness!!!
# ctypes' types are container types.
#
# They have an internal memory block, which only consists of some bytes,
# but it has to keep refere... | bsd-2-clause |
Fusion-Rom/android_external_chromium_org | tools/auto_bisect/PRESUBMIT.py | 25 | 3243 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for auto-bisect.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details on the presubmit ... | bsd-3-clause |
petobens/dotfiles | python/ipython_config.py | 1 | 4940 | """My ipython config."""
# pylint:disable=W0212
import sys
import IPython
import IPython.terminal.prompts as prompts
import prompt_toolkit
from prompt_toolkit.application import get_app
from prompt_toolkit.application.current import get_app as get_current_app
from prompt_toolkit.key_binding.vi_state import InputMode,... | mit |
vinipachecov/django-ecommerce | checkout/migrations/0003_auto_20171007_1507.py | 1 | 2446 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2017-10-07 18:07
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependen... | cc0-1.0 |
girving/tensorflow | tensorflow/contrib/eager/python/examples/linear_regression/linear_regression_graph_test.py | 32 | 2657 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
cgstudiomap/cgstudiomap | main/eggs/reportlab-3.2.0-py2.7-linux-x86_64.egg/reportlab/rl_config.py | 31 | 4186 | '''module that aggregates config information'''
__all__=('_reset','register_reset')
def _defaults_init():
'''
create & return defaults for all reportlab settings from
reportlab.rl_settings.py
reportlab.local_rl_settings.py
reportlab_settings.py or ~/.reportlab_settings
latter values override e... | agpl-3.0 |
cytec/SickRage | lib/js2py/translators/std_nodes.py | 27 | 15451 | from .pyjsparserdata import *
import six
class BaseNode:
def finish(self):
pass
def finishArrayExpression(self, elements):
self.type = Syntax.ArrayExpression
self.elements = elements
self.finish()
return self
def finishArray... | gpl-3.0 |
tomkun/empireofcode | laboratory/super_root.py | 1 | 1146 | # from __future__ import print_function
def super_root(number):
hi = get_sane_high(number)
low = number**(1/number)
c = (hi+low)/2.0
while abs((c**c)-number)>0.001:
if c**c > number:
hi = c
c = (c+low)/2.0
else:
low = c
c = (c+hi)/2.0... | mit |
phenoxim/cinder | cinder/tests/unit/volume/drivers/datacore/test_datacore_api.py | 3 | 29946 | # Copyright (c) 2017 DataCore Software Corp. 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... | apache-2.0 |
MoneyBack/MoneyBack | web/browser.py | 103 | 7679 | """Browser to test web applications.
(from web.py)
"""
from utils import re_compile
from net import htmlunquote
import httplib, urllib, urllib2
import copy
from StringIO import StringIO
DEBUG = False
__all__ = [
"BrowserError",
"Browser", "AppBrowser",
"AppHandler"
]
class BrowserError(Exception):
p... | gpl-2.0 |
chrisdickinson/nojs | build/fuchsia/exe_runner.py | 1 | 1802 | #!/usr/bin/env python
#
# Copyright 2017 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.
"""Packages a user.bootfs for a Fuchsia boot image, pulling in the runtime
dependencies of a binary, and then uses either QEMU from t... | bsd-3-clause |
pombredanne/annoy | examples/precision_test.py | 2 | 1063 | from __future__ import print_function
import random, time
from annoy import AnnoyIndex
try:
xrange
except NameError:
# Python 3 compat
xrange = range
n, f = 100000, 40
t = AnnoyIndex(f)
for i in xrange(n):
v = []
for z in xrange(f):
v.append(random.gauss(0, 1))
t.add_item(i, v)
t.bui... | apache-2.0 |
ahu-odoo/odoo | addons/hw_posbox_homepage/controllers/main.py | 72 | 2015 | # -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
import openerp
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
index_template = """
<!DOCTYPE HTML>
<html>
<head>
<title>Odoo's PosBox<... | agpl-3.0 |
projectshift/shift-schema | tests/validators_tests/url_test.py | 1 | 3622 | from unittest import TestCase, mock
from nose.plugins.attrib import attr
from shiftschema.validators import Url
import re
# these are valid urls
valid = [
"http://foo.com/blah_blah",
"//foo.com/blah_blah",
"http://foo.com/blah_blah/",
"http://foo.com/blah_blah_(wikipedia)",
"http://foo.com/blah_bl... | mit |
40223226/2015cdbg8_6-22 | static/Brython3.1.1-20150328-091302/Lib/warnings.py | 752 | 13825 | """Python part of the warnings subsystem."""
# Note: function level imports should *not* be used
# in this module as it may cause import lock deadlock.
# See bug 683658.
import linecache
import sys
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings", "catch_warnings"]
def... | gpl-3.0 |
emilio/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_response.py | 6 | 14460 | import sys
import os
import unittest
import json
from io import BytesIO
import pytest
from six import create_bound_method
wptserve = pytest.importorskip("wptserve")
from .base import TestUsingServer, TestUsingH2Server, doc_root
from h2.exceptions import ProtocolError
def send_body_as_header(self):
if self._respo... | mpl-2.0 |
willhardy/django | tests/check_framework/test_templates.py | 49 | 3703 | from copy import copy, deepcopy
from django.core.checks.templates import E001, E002
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckTemplateSettingsAppDirsTest(SimpleTestCase):
TEMPLATES_APP_DIRS_AND_LOADERS = [
{
'BACKEND': 'django.template.b... | bsd-3-clause |
snowballhg/node-gyp | gyp/test/home_dot_gyp/gyptest-home-includes-regyp.py | 74 | 1306 | #!/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.
"""
Verifies inclusion of $HOME/.gyp/include.gypi works properly with relocation
and with regeneration.
"""
import os
import TestGyp
# Reg... | mit |
mancoast/CPythonPyc_test | cpython/234_test_threaded_import.py | 9 | 1983 | # This is a variant of the very old (early 90's) file
# Demo/threads/bug.py. It simply provokes a number of threads into
# trying to import the same module "at the same time".
# There are no pleasant failure modes -- most likely is that Python
# complains several times about module random having no attribute
# randran... | gpl-3.0 |
Comunitea/OCB | addons/contacts/__openerp__.py | 260 | 1594 | # -*- 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 |
jseabold/statsmodels | statsmodels/genmod/tests/test_bayes_mixed_glm.py | 5 | 18166 | import numpy as np
from statsmodels.genmod.bayes_mixed_glm import (BinomialBayesMixedGLM,
PoissonBayesMixedGLM)
import pandas as pd
from scipy import sparse
from numpy.testing import assert_allclose, assert_equal
from scipy.optimize import approx_fprime
def gen_simple_l... | bsd-3-clause |
mkonline/django-json-queries | tests/test_fields.py | 1 | 2739 | import pytest
from django.db.models import lookups
from django_json_queries.fields import (
IntegerField, FloatField, StringField, BooleanField
)
def run_test(field, value, lookup, should_succeed):
try:
field.validate(value, lookup)
if not should_succeed:
assert False, \
... | mit |
yongshengwang/hue | desktop/core/ext-py/Pygments-1.3.1/pygments/lexers/web.py | 55 | 65704 | # -*- coding: utf-8 -*-
"""
pygments.lexers.web
~~~~~~~~~~~~~~~~~~~
Lexers for web-related languages and markup.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, byg... | apache-2.0 |
kaizentech/djcms-skeleton | config/settings/configurations/DJANGO.py | 1 | 4347 | from .ENV import BASE_DIR, ENV_VAR
# SECURITY WARNING: don't run with debug turned on in production!
# False if not in os.environ
DEBUG = ENV_VAR('DEBUG', default=False)
# SECURITY WARNING: keep the secret key used in production secret!
# If not found in os.environ will raise ImproperlyConfigured error
SECRET_KEY = E... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.