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 |
|---|---|---|---|---|---|
massot/odoo | addons/account/wizard/account_invoice_state.py | 340 | 2875 | # -*- 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 |
feroda/odoo | addons/mail/tests/test_message_read.py | 199 | 14584 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
arongdari/python-topic-model | ptm/nltk_corpus.py | 1 | 3919 | from collections import Counter, defaultdict
import numpy as np
import nltk
from nltk import word_tokenize
from nltk.corpus import reuters, stopwords
from six.moves import xrange
def get_ids_cnt(corpus, max_voca=9999999, remove_top_n=5):
voca = set(w.lower() for w in nltk.corpus.words.words())
stop = stopwor... | apache-2.0 |
spasovski/zamboni | apps/editors/models.py | 3 | 25448 | import copy
import datetime
from django.conf import settings
from django.core.cache import cache
from django.db import models
from django.db.models import Sum
from django.template import Context, loader
from django.utils.datastructures import SortedDict
from tower import ugettext_lazy as _lazy
import amo
import amo.... | bsd-3-clause |
kaji-project/adagios | adagios/pnp/views.py | 1 | 1398 | # -*- coding: utf-8 -*-
#
# Adagios is a web based Nagios configuration interface
#
# Copyright (C) 2010, Pall Sigurdsson <palli@opensource.is>
#
# 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 Found... | agpl-3.0 |
akosyakov/intellij-community | plugins/hg4idea/testData/bin/mercurial/simplemerge.py | 93 | 15291 | # Copyright (C) 2004, 2005 Canonical Ltd
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribut... | apache-2.0 |
gaddman/ansible | lib/ansible/modules/network/cloudengine/ce_evpn_bd_vni.py | 7 | 39533 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
SKA-ScienceDataProcessor/integration-prototype | sip/execution_control/configuration_db/setup.py | 1 | 1921 | # coding: utf-8
"""Setup config file to package the configuration database."""
from os import walk, listdir
from os.path import join
from setuptools import setup
import sip_config_db
def package_files(directory):
"""Get list of data files to add to the package."""
paths = []
for (path, _, file_names) in w... | bsd-3-clause |
threatify/arango-orm | arango_orm/references.py | 2 | 2375 | from pydoc import locate
class Relationship(object):
def __init__(self, col_class, field, **kwargs):
# target_field='_key', uselist=True, order_by=None
self._col_class = col_class
self.field = field
self.target_field = kwargs.get('target_field', '_key')
self.uselist = kwa... | gpl-3.0 |
habeanf/Open-Knesset | auxiliary/tag_suggestions/tests.py | 8 | 3019 | import auxiliary.tag_suggestions
from django.test import TestCase
from auxiliary.models import TagSuggestion
from django.contrib.auth.models import User
from laws.models import Bill, Law
from tagging.models import Tag
from django.contrib.contenttypes.models import ContentType
from auxiliary.views import suggest_tag_po... | bsd-3-clause |
neavouli/yournextrepresentative | elections/uk/management/commands/uk_create_regional_assembly_posts.py | 3 | 9010 | from __future__ import print_function, unicode_literals
from datetime import date
from django.conf import settings
from django.core.management.base import BaseCommand
from django.utils.six.moves.urllib_parse import urljoin
import requests
from candidates.models import (
AreaExtra, OrganizationExtra, PartySet, P... | agpl-3.0 |
sdaftuar/bitcoin | qa/rpc-tests/mempool_limit.py | 34 | 2178 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Test mempool limiting together/eviction with the wallet
from test_framework.test_framework import Bitc... | mit |
audiokit/libsndfile | programs/test-sndfile-metadata-set.py | 44 | 6222 | #!/usr/bin/python
# Copyright (C) 2008-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
#
# 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 ... | lgpl-2.1 |
dropbox/changes | changes/jobs/sync_job.py | 1 | 8570 | from __future__ import absolute_import, print_function
from datetime import datetime
from flask import current_app
from sqlalchemy.sql import func
from changes.backends.base import UnrecoverableException
from changes.config import db, queue, statsreporter
from changes.constants import Status, Result
from changes.db.u... | apache-2.0 |
conda-forge/conda-smithy | tests/test_cli.py | 1 | 8480 | import argparse
import collections
import os
import subprocess
import yaml
import shutil
from conda_smithy import cli
_thisdir = os.path.abspath(os.path.dirname(__file__))
InitArgs = collections.namedtuple(
"ArgsObject",
("recipe_directory", "feedstock_directory", "temporary_directory"),
)
RegenerateArgs = ... | bsd-3-clause |
jsteemann/arangodb | 3rdParty/V8-4.3.61/testing/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... | apache-2.0 |
sdcooke/django | tests/model_regress/models.py | 281 | 2293 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
CHOICES = (
(1, 'first'),
(2, 'second'),
)
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100, defa... | bsd-3-clause |
michaelgallacher/intellij-community | python/helpers/py2only/docutils/utils/math/__init__.py | 160 | 1683 | # :Id: $Id: __init__.py 7218 2011-11-08 17:42:40Z milde $
# :Author: Guenter Milde.
# :License: Released under the terms of the `2-Clause BSD license`_, in short:
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# noti... | apache-2.0 |
harshilasu/LinkurApp | y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/unit/emr/test_instance_group_args.py | 16 | 2038 | #!/usr/bin/env python
# Author: Charlie Schluting <charlie@schluting.com>
#
# Test to ensure initalization of InstanceGroup object emits appropriate errors
# if bidprice is not specified, but allows float, int, Decimal.
import unittest
from decimal import Decimal
from boto.emr.instance_group import InstanceGroup
cl... | gpl-3.0 |
sebrandon1/nova | nova/tests/unit/cells/test_cells_utils.py | 3 | 10174 | # Copyright (c) 2012 Rackspace Hosting
# 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 |
chauhanhardik/populo | common/djangoapps/student/tests/test_linkedin.py | 150 | 2265 | # -*- coding: utf-8 -*-
"""Tests for LinkedIn Add to Profile configuration. """
import ddt
from urllib import urlencode
from django.test import TestCase
from opaque_keys.edx.locator import CourseLocator
from student.models import LinkedInAddToProfileConfiguration
@ddt.ddt
class LinkedInAddToProfileUrlTests(TestCase... | agpl-3.0 |
atopuzov/nitro-python | nssrc/com/citrix/netscaler/nitro/resource/config/ssl/sslocspresponder.py | 3 | 20609 | #
# Copyright (c) 2008-2015 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 l... | apache-2.0 |
pombredanne/splash | splash/har/qt.py | 2 | 5102 | # -*- coding: utf-8 -*-
"""
Module with helper utilities to serialize QWebkit objects to HAR.
See http://www.softwareishard.com/blog/har-12-spec/.
"""
from __future__ import absolute_import
import base64
from PyQt5.QtCore import Qt, QVariant, QUrlQuery
from PyQt5.QtNetwork import QNetworkRequest
import six
from splas... | bsd-3-clause |
JavaRabbit/CS496_capstone | appengine/flexible/analytics/main.py | 8 | 2254 | # 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 |
elkingtonmcb/pattern | pattern/web/json/scanner.py | 28 | 2549 | """JSON token scanner
"""
import re
def _import_c_make_scanner():
try:
from _speedups import make_scanner
return make_scanner
except ImportError:
return None
c_make_scanner = _import_c_make_scanner()
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([e... | bsd-3-clause |
olexiim/edx-platform | scripts/release.py | 23 | 18465 | #!/usr/bin/env python
"""
a release-master multitool
"""
from __future__ import print_function, unicode_literals
import sys
import argparse
from datetime import date, timedelta
import re
import collections
import functools
import textwrap
import json
import getpass
try:
from path import path
from git import Re... | agpl-3.0 |
apache/incubator-allura | ForgeDiscussion/forgediscussion/widgets/forum_widgets.py | 2 | 5993 | # 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 (t... | apache-2.0 |
Ozmodian/Wordpress_local | eb/macosx/python3/lib/aws/requests/packages/urllib3/util.py | 189 | 9801 | # urllib3/util.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from base64 import b64encode
from collections import namedtuple
from socket import error as Socke... | gpl-2.0 |
EmanueleCannizzaro/scons | test/Java/JAVACLASSPATH.py | 1 | 2668 | #!/usr/bin/env python
#
# Copyright (c) 2001 - 2016 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 limitation the rights to us... | mit |
ddrmanxbxfr/servo | tests/wpt/css-tests/tools/pytest/testing/test_runner_xunit.py | 202 | 7133 | #
# test correct setup/teardowns at
# module, class, and instance level
def test_module_and_function_setup(testdir):
reprec = testdir.inline_runsource("""
modlevel = []
def setup_module(module):
assert not modlevel
module.modlevel.append(42)
def teardown_module(modu... | mpl-2.0 |
zhoucen/gunicorn | examples/frameworks/django/djangotest/settings.py | 28 | 2045 | # Django settings for djangotest project.
import platform
PRODUCTION_MODE = platform.node().startswith('http')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('benoitc', 'bchesneau@gmail.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 't... | mit |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Scrapy-1.0.1/scrapy/mail.py | 23 | 4450 | """
Mail sending helpers
See documentation in docs/topics/email.rst
"""
import logging
from six.moves import cStringIO as StringIO
import six
from email.utils import COMMASPACE, formatdate
from six.moves.email_mime_multipart import MIMEMultipart
from six.moves.email_mime_text import MIMEText
from six.moves.email_mim... | mit |
strint/tensorflow | tensorflow/python/training/learning_rate_decay.py | 41 | 16331 | # 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 |
jturney/psi4 | tests/pytests/test_psi4.py | 9 | 7578 | import numpy as np
import pytest
import psi4
pytestmark = pytest.mark.quick
@pytest.mark.smoke
def test_psi4_basic():
"""tu1-h2o-energy"""
#! Sample HF/cc-pVDZ H2O computation
h2o = psi4.geometry("""
O
H 1 0.96
H 1 0.96 2 104.5
""")
psi4.set_options({'basis': "cc-pVDZ"})
... | lgpl-3.0 |
axbaretto/beam | sdks/python/apache_beam/io/parquetio_it_test.py | 5 | 4697 | #
# 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 |
gameduell/duell | bin/win/python2.7.9/Lib/encodings/quopri_codec.py | 419 | 2147 | """Codec for quoted-printable encoding.
Like base64 and rot13, this returns Python strings, not Unicode.
"""
import codecs, quopri
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
def quopri_encode(input, errors='strict'):
"""Encode the input, returning a tuple (outpu... | bsd-2-clause |
zkbt/exopop | exoatlas/tests/test_populations.py | 1 | 3605 | from exoatlas.imports import *
from exoatlas.populations import *
def test_population():
'''
Can we make a population from scratch from a table?
'''
fake = Table({x:[0]*3 for x in attribute_columns}, masked=True)
p = Population(standard=fake, label='fake')
p.validate_columns()
return p
de... | mit |
numerigraphe/odoomrp-wip | quality_control_tolerance/__openerp__.py | 2 | 1373 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c)
# 2014 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com)
# 2014 AvanzOsc (http://www.avanzosc.es)
#
# This program is free software: you can redistribute it and/or modi... | agpl-3.0 |
bayesimpact/bob-emploi | data_analysis/importer/fhs_category_duration.py | 1 | 6153 | """This script extracts unemployment durations of different categories from FHS.
Pôle emploi categorizes job seekers in several categories (A, B, ... F). In
this script we focus on two different category groups:
* Category A, which is the one that matches the most common idea of a unemployed
job seeker: not working p... | gpl-3.0 |
rhyolight/nupic.research | htmresearch/support/register_regions.py | 3 | 2605 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, 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 |
rnestler/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/tmpdir.py | 189 | 4123 | """ support for providing temporary directories to test functions. """
import re
import pytest
import py
from _pytest.monkeypatch import monkeypatch
class TempdirFactory:
"""Factory for temporary directories under the common base temp directory.
The base directory can be configured using the ``--basetemp``... | mpl-2.0 |
MartinThoma/hwrt | tests/serve_test.py | 1 | 1333 | #!/usr/bin/env python
"""Test the 'serve' module of the hwrt package."""
# Third party modules
import pytest
from flask import Flask
from flask_bootstrap import Bootstrap
# First party modules
import hwrt.serve as serve
import hwrt.utils as utils
# Tests
def test_execution():
"""Just test if the function is ex... | mit |
gangadhar-kadam/prjlib | core/doctype/print_format/print_format.py | 34 | 3233 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes, os
from webnotes import conf
import webnotes.utils
from webnotes.utils import get_base_path
from webnotes.modules import get_doc_path
class DocType:
def __i... | mit |
sajuptpm/contrail-controller | src/config/utils/service-policy.py | 1 | 8421 | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import os
import sys
import errno
import subprocess
import time
import argparse
sys.path.insert(0, os.path.realpath('/usr/lib/python2.7/site-packages'))
sys.path.insert(
0,
os.path.realpath('/usr/lib/python2.7/site-packages/... | apache-2.0 |
suninsky/ReceiptOCR | Python/server/lib/python2.7/site-packages/pip/_vendor/html5lib/utils.py | 436 | 3267 | from __future__ import absolute_import, division, unicode_literals
from types import ModuleType
from pip._vendor.six import text_type
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree
__all__ = ["default_etree", "MethodDispatcher", "isSurr... | mit |
rafaeltomesouza/frontend-class1 | aula2/a10/linkedin/client/.gradle/nodejs/node-v7.5.0-darwin-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py | 2354 | 10366 | # Unmodified from http://code.activestate.com/recipes/576693/
# other than to add MIT license header (as specified on page, but not in code).
# Linked from Python documentation here:
# http://docs.python.org/2/library/collections.html#collections.OrderedDict
#
# This should be deleted once Py2.7 is available on all bot... | mit |
fabioz/Pydev | builders/org.python.pydev.build/cog_src/cog.py | 7 | 28208 | #Note: this is cog just remodelled to be in a single file!
""" Cog code generation tool.
http://nedbatchelder.com/code/cog
Copyright 2004-2008, Ned Batchelder.
"""
# $Id: cogapp.py 141 2008-05-22 10:56:43Z nedbat $
import md5, os, re, string, sys, traceback, types
import imp, compiler
import copy, getop... | epl-1.0 |
chiviak/headphones | headphones/getXldProfile.py | 12 | 8022 | import os.path
import biplist
from headphones import logger
def getXldProfile(xldProfile):
xldProfileNotFound = xldProfile
expanded = os.path.expanduser('~/Library/Preferences/jp.tmkk.XLD.plist')
if not os.path.isfile(expanded):
logger.warn("Could not find xld preferences at: %s", expanded)
... | gpl-3.0 |
Yuudachimoe/HikariChun-RedBot | lib/pip/_vendor/requests/packages/chardet/chardistribution.py | 2755 | 9226 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client 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 R... | gpl-3.0 |
cbingos/hongmafund | xadmin/plugins/relfield.py | 6 | 2586 | from django.db import models
from django.utils.html import escape, format_html
from django.utils.text import Truncator
from django.utils.translation import ugettext as _
from django import forms
from xadmin.sites import site
from xadmin.views import BaseAdminPlugin, ModelFormAdminView
from xadmin.util import vendor
c... | mit |
jmchilton/lwr | test/check.py | 1 | 15187 | # -*- coding: utf-8 -*-
import shutil
import tempfile
import os
import optparse
import traceback
import re
import threading
import time
from io import open
from lwr.lwr_client import submit_job
from lwr.lwr_client import finish_job
from lwr.lwr_client import LwrOutputs
from lwr.lwr_client import ClientOutputs
from lwr... | apache-2.0 |
lochiiconnectivity/libcloud | libcloud/dns/drivers/auroradns.py | 22 | 22181 | # 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 |
codewarrior0/pytest | extra/get_issues.py | 195 | 2286 | import json
import py
import textwrap
issues_url = "http://bitbucket.org/api/1.0/repositories/pytest-dev/pytest/issues"
import requests
def get_issues():
chunksize = 50
start = 0
issues = []
while 1:
post_data = {"accountname": "pytest-dev",
"repo_slug": "pytest",
... | mit |
openatv/enigma2 | lib/python/Plugins/SystemPlugins/DefaultServicesScanner/plugin.py | 2 | 5438 | #from Components.ActionMap import ActionMap, NumberActionMap
#from Components.Input import Input
#from Components.Ipkg import IpkgComponent
#from Components.Label import Label
#from Components.MenuList import MenuList
#from Components.Slider import Slider
from Components.NimManager import nimmanager
from Plugins.Plugin... | gpl-2.0 |
TinLe/Diamond | src/collectors/ceph/test/testceph.py | 60 | 7717 | #!/usr/bin/python
# coding=utf-8
try:
import json
except ImportError:
import simplejson as json
import subprocess
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import patch, call
from diamond.collector import Collector
... | mit |
makokal/funzo | funzo/irl/birl/mcmc_birl.py | 1 | 4295 | """
BIRL algorithms with MCMC based inference
"""
from __future__ import division, absolute_import
import six
import numpy as np
from abc import abstractmethod, ABCMeta
from tqdm import tqdm
from copy import deepcopy
from six.moves import range
from .birl_base import BIRLBase
from ...base import Model
from ...util... | mit |
fibbo/DIRAC | Core/Utilities/NTP.py | 14 | 1162 | # $HeadURL$
__RCSID__ = "$Id$"
from socket import socket, AF_INET, SOCK_DGRAM
import struct
import time as time
import datetime
from DIRAC import S_OK, S_ERROR
TIME1970 = 2208988800L
gDefaultNTPServers = [ "pool.ntp.org" ]
def getNTPUTCTime( serverList = None, retries = 2 ):
data = '\x1b' + 47 * '\0'
if not serv... | gpl-3.0 |
zizhongwei/php-buildpack-master | lib/build_pack_utils/zips.py | 47 | 9325 | import os
import gzip
import bz2
import zipfile
import shutil
import logging
import tempfile
from functools import partial
from subprocess import Popen
from subprocess import PIPE
class UnzipUtil(object):
"""Extract files from compressed archives."""
def __init__(self, config):
self._ctx = config
... | apache-2.0 |
2014cdbg14/2014cdbg14 | wsgi/static/Brython2.1.0-20140419-113919/Lib/_imp.py | 115 | 2013 | """(Extremely) low-level import machinery bits as used by importlib and imp."""
class __loader__(object):pass
def _fix_co_filename(*args,**kw):
raise NotImplementedError("%s:not implemented" % ('_imp.py:_fix_co_filename'))
def acquire_lock(*args,**kw):
"""acquire_lock() -> None Acquires the interpreter's... | gpl-2.0 |
code-disaster/fips | yaml/yaml2/loader.py | 671 | 1132 |
__all__ = ['BaseLoader', 'SafeLoader', 'Loader']
from reader import *
from scanner import *
from parser import *
from composer import *
from constructor import *
from resolver import *
class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver):
def __init__(self, stream):
Reader.... | mit |
t794104/ansible | test/units/modules/system/test_iptables.py | 25 | 25518 | from units.compat.mock import patch
from ansible.module_utils import basic
from ansible.modules.system import iptables
from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args
def get_bin_path(*args, **kwargs):
return "/sbin/iptables"
class TestIptables(ModuleTestCase):
... | gpl-3.0 |
frouty/odoogoeen | addons/l10n_ar/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
xen0l/ansible | lib/ansible/modules/cloud/amazon/iam_role_facts.py | 50 | 8111 | #!/usr/bin/python
# Copyright: 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
mysociety/yournextrepresentative | elections/jamaica/views.py | 3 | 1752 | from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.cache import cache_control
from django.views.decorators.csrf import csrf_exempt
from django.views.generic import FormView
from slugify import slugi... | agpl-3.0 |
TakoArishi/edarra | edarra/main.py | 1 | 1030 | #!/usr/bin/kivy
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import ObjectProperty
from kivy.clock import Clock
from ships import Ship
class AtlantisApp (App):
def build(self):
game = AtlantisField ()
# Start game
game.push_ship ()
# Schedule g... | mit |
lsinfo/odoo | addons/auth_openid/utils.py | 428 | 1589 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-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 GNU Affero General P... | agpl-3.0 |
byterom/android_external_chromium_org | chrome/test/mini_installer/process_verifier.py | 125 | 1358 | # 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 chrome_helper
import verifier
class ProcessVerifier(verifier.Verifier):
"""Verifies that the running processes match the expectation dictionaries.... | bsd-3-clause |
birgander2/PyRAT | pyrat/viewer/tools.py | 1 | 3605 | import numpy as np
def sarscale(img, factor=2.5):
"""
Returns a SAR-bytscaled version of an array for visualisation, clipped
between zero and 2.5 * mean(array)
"""
scl = np.nanmean(img)
if scl == 0:
return np.zeros_like(img, dtype=np.uint8)
else:
return np.uint8(np.clip(255... | mpl-2.0 |
marcelocure/django | tests/admin_custom_urls/tests.py | 276 | 6381 | from __future__ import unicode_literals
import datetime
from django.contrib.admin.utils import quote
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse
from django.test import TestCase, override_settings
from .models import A... | bsd-3-clause |
firebase/grpc | tools/profiling/microbenchmarks/bm_diff/bm_build.py | 4 | 2696 | #!/usr/bin/env python2.7
#
# Copyright 2017 gRPC 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 |
chrism333/xpcc | scons/site_tools/avrdude.py | 1 | 4081 | #!/usr/bin/env python
#
# Copyright (c) 2009, Roboterclub Aachen e.V.
# 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
# ... | bsd-3-clause |
senarvi/theanolm | theanolm/network/samplingoutputlayer.py | 1 | 10521 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""A module that implements the SamplingOutputLayer class, a base class for
output layer that implements sampling.
"""
from abc import ABCMeta
import numpy
import theano.tensor as tensor
from theanolm.network.basiclayer import BasicLayer
class SamplingOutputLayer(Basi... | apache-2.0 |
hamicornfury/twistbit_django_angular_boilerplate | src/twistbit/settings.py | 1 | 3483 | """
Django settings for twistbit project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pat... | mit |
leofdecarvalho/MachineLearning | 9. Artificial_Neural_Networks/ann.py | 5 | 2306 | # Artificial Neural Network
# Installing Theano
# pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
# Installing Tensorflow
# pip install tensorflow
# Installing Keras
# pip install --upgrade keras
# Part 1 - Data Preprocessing
# Importing the libraries
import numpy as np
import matplotlib.pyp... | mit |
southpawtech/TACTIC-DEV | 3rd_party/CherryPy/cherrypy/test/modwsgi.py | 6 | 4876 | """Wrapper for mod_wsgi, for use as a CherryPy HTTP server.
To autostart modwsgi, the "apache" executable or script must be
on your system path, or you must override the global APACHE_PATH.
On some platforms, "apache" may be called "apachectl" or "apache2ctl"--
create a symlink to them if needed.
KNOWN BUGS
========... | epl-1.0 |
b08060514/gtest-1.7.0 | test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
brownan/Reed-Solomon | rstest.py | 3 | 6086 | import unittest
import itertools
import rs
class TestRSverify(unittest.TestCase):
def setUp(self):
self.coder = rs.RSCoder(255,223)
def test_one(self):
"""Tests a codeword without errors validates"""
code = self.coder.encode("Hello, world!")
self.assertTrue(self.coder.verify(... | mit |
lilferraro/android_kernel_samsung_lt02ltespr | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
sebadiaz/rethinkdb | test/rql_test/connections/http_support/jinja2/testsuite/inheritance.py | 414 | 8248 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.inheritance
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests the template inheritance feature.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Env... | agpl-3.0 |
dbckz/ansible | lib/ansible/modules/network/aos/aos_blueprint_virtnet.py | 78 | 7485 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... | gpl-3.0 |
gramps-project/gramps | gramps/plugins/textreport/recordsreport.py | 9 | 13718 | # encoding:utf-8
#
# Gramps - a GTK+/GNOME based genealogy program - Records plugin
#
# Copyright (C) 2008-2011 Reinhard Müller
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2012 Brian G. Matherly
# Copyright (C) 2013-2016 Paul Franklin
#
# This program is free software; you can redistribute it and/or mod... | gpl-2.0 |
jthornber/linux-2.6 | scripts/gdb/linux/utils.py | 367 | 4267 | #
# gdb helper commands and functions for Linux kernel debugging
#
# common utilities
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
class CachedType:
def __init__(self, name):
s... | gpl-2.0 |
shoyer/numpy | numpy/distutils/command/build_ext.py | 5 | 25966 | """ Modified version of build_ext that handles fortran source files.
"""
from __future__ import division, absolute_import, print_function
import os
import subprocess
from glob import glob
from distutils.dep_util import newer_group
from distutils.command.build_ext import build_ext as old_build_ext
from distutils.erro... | bsd-3-clause |
RebeccaWPerry/vispy | examples/basics/scene/magnify.py | 17 | 3305 | # -*- coding: utf-8 -*-
# vispy: gallery 10
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
""" Demonstrates use of special Camera subclasses to implement a (flashy)
data-exploration tool.
Here we use MagnifyCamera to allow the user to zoom in o... | bsd-3-clause |
gohin/django | django/contrib/gis/forms/widgets.py | 422 | 3659 | from __future__ import unicode_literals
import logging
from django.conf import settings
from django.contrib.gis import gdal
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from django.forms.widgets import Widget
from django.template import loader
from django.utils import six, translation
logger = log... | bsd-3-clause |
haridas/image_uploader_py | uploader/utils.py | 1 | 2478 | """
@date: 27/Nov/2014
@author: Haridas N<haridas.nss@gmail.com>
"""
import json
import functools
from django.utils import timezone
from django.http import HttpResponse
from django.utils.module_loading import import_string
from django.contrib.auth.models import User
from django.contrib.auth import SESSION_KEY
from dja... | mit |
christabor/MoAL | MOAL/type_theory/nominal_structural.py | 1 | 3392 | # -*- coding: utf-8 -*-
__author__ = """Chris Tabor (dxdstudio@gmail.com)"""
if __name__ == '__main__':
from os import getcwd
from os import sys
sys.path.append(getcwd())
from MOAL.helpers.display import Section
from inspect import getmembers
from inspect import isdatadescriptor
from inspect import ismet... | apache-2.0 |
SebasSBM/django | tests/forms_tests/widget_tests/test_radioselect.py | 161 | 3519 | from django.forms import RadioSelect
from .base import WidgetTest
class RadioSelectTest(WidgetTest):
widget = RadioSelect()
def test_render(self):
self.check_html(self.widget, 'beatle', 'J', choices=self.beatles, html=(
"""<ul>
<li><label><input checked="checked" type="radio"... | bsd-3-clause |
stoewer/nix-demo | utils/lif.py | 2 | 3433 | # -*- coding: utf-8 -*-
"""
Copyright © 2014 German Neuroinformatics Node (G-Node)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted under the terms of the BSD License. See
LICENSE file in the root of the Project.
Author: Jan Grewe <jan.grewe@g-... | bsd-3-clause |
sabi0/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/thread.py | 100 | 75483 | #!~/.wine/drive_c/Python25/python.exe
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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 ... | apache-2.0 |
nelson-liu/scikit-learn | sklearn/linear_model/coordinate_descent.py | 4 | 81531 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Olivier Grisel <olivier.grisel@ensta.org>
# Gael Varoquaux <gael.varoquaux@inria.fr>
#
# License: BSD 3 clause
import sys
import warnings
from abc import ABCMeta, abstractmethod
import n... | bsd-3-clause |
lmprice/ansible | test/units/parsing/test_mod_args.py | 73 | 4339 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright 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 pytest
from ansible.errors import Ansi... | gpl-3.0 |
AnotherIvan/calibre | src/calibre/ebooks/readability/readability.py | 14 | 20738 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
import re, sys
from collections import defaultdict
from lxml.etree import tostring
from lxml.html import (fragment_fromstring, document... | gpl-3.0 |
plilja/adventofcode | 2017/day18/day18.py | 1 | 2542 | import sys
operations = {
'add' : lambda x, y: x + y,
'mul' : lambda x, y: x * y,
'set' : lambda x, y: y,
'mod' : lambda x, y: x % y
}
def step1(inp):
reg = {}
inst_pnt = 0
while 0 <= inst_pnt < len(inp):
inst = inp[inst_pnt].split()
if inst[0] in ('set', 'a... | gpl-3.0 |
aktech/sympy | sympy/physics/quantum/tests/test_boson.py | 95 | 1523 | from sympy import sqrt, exp, S, prod
from sympy.core.compatibility import range
from sympy.physics.quantum import Dagger, Commutator, qapply
from sympy.physics.quantum.boson import BosonOp
from sympy.physics.quantum.boson import (
BosonFockKet, BosonFockBra, BosonCoherentKet, BosonCoherentBra)
def test_bosonopera... | bsd-3-clause |
fweisbec/tracing | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
kochelmonster/larch-pickle | tests/benchmark.py | 1 | 3506 | #!/usr/bin/python
from __future__ import print_function
#
# Simple serialization banchmark
#
from timeit import timeit
from tabulate import tabulate
try:
import cPickle as pickle
except ImportError:
import pickle
import msgpack
import json
# import cjson
import ujson
import marshal
import larch.pickle as spic... | lgpl-3.0 |
hchen1202/django-react | virtualenv/lib/python3.6/site-packages/psycopg2/_range.py | 16 | 17259 | """Implementation of the Range type and adaptation
"""
# psycopg/_range.py - Implementation of the Range type and adaptation
#
# Copyright (C) 2012 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public ... | mit |
Morloth1274/EVE-Online-POCO-manager | tests/test_appengine/test_eve.py | 6 | 1601 | import mock
from tests.compat import unittest
from tests.test_appengine import (
GAEAsyncTestCase, auto_test_async_method
)
try:
from evelink.appengine.eve import EVE
except ImportError:
EVE = mock.Mock()
_specs = (
'alliances',
'errors',
'faction_warfare_stats',
'faction_warfare_lea... | mit |
chongtianfeiyu/kbengine | kbe/res/scripts/common/Lib/distutils/command/install.py | 71 | 26512 | """distutils.command.install
Implements the Distutils 'install' command."""
import sys
import os
from distutils import log
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.sysconfig import get_config_vars
from distutils.errors import DistutilsPlatformError
from distutils.file_util ... | lgpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.