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 |
|---|---|---|---|---|---|
tensorflow/tfx | tfx/components/example_gen/utils_test.py | 1 | 29481 | # Lint as: python2, python3
# Copyright 2019 Google 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/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
bovulpes/AliceO2 | Detectors/FIT/benchmark/process.py | 6 | 12238 | # load modules
import re
import sys
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import AutoMinorLocator
# use classic plot style
plt.style.use('classic')
# read and save user input filenames
mem_filename = sys.argv[1]
cpu_filename = sys.argv[2]
# save the process id ... | gpl-3.0 |
jburel/openmicroscopy | components/tools/OmeroPy/src/omero/plugins/prefs.py | 1 | 21186 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
prefs plugin
Plugin read by omero.cli.Cli during initialization. The method(s)
defined here will be added to the Cli class for later use.
The pref plugin makes use of prefs.class from the common component.
Copyright 2007-2013 Glencoe Software, Inc. All... | gpl-2.0 |
jordanemedlock/psychtruths | temboo/Library/Google/Contacts/GetContactById.py | 5 | 5109 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetContactById
# Retrieves a specific contact with a given id.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not ... | apache-2.0 |
utke1/numpy | numpy/testing/print_coercion_tables.py | 189 | 2705 | #!/usr/bin/env python
"""Prints type-coercion tables for the built-in NumPy types
"""
from __future__ import division, absolute_import, print_function
import numpy as np
# Generic object that can be added, but doesn't do anything else
class GenericObject(object):
def __init__(self, v):
self.v = v
de... | bsd-3-clause |
jardiacaj/finem_imperii | turn/test/test_turn.py | 1 | 7924 | from django.test import TestCase
from django.urls.base import reverse
from battle.models import Battle
from organization.models.organization import Organization
from turn.barbarians import do_settlement_barbarian_generation
from turn.battle import organizations_with_battle_ready_units, \
battle_ready_units_in_tile... | agpl-3.0 |
manishpatell/erpcustomizationssaiimpex123qwe | addons/website/tests/test_converter.py | 280 | 8947 | # -*- coding: utf-8 -*-
import textwrap
import unittest2
from lxml import etree, html
from lxml.builder import E
from openerp.tests import common
from openerp.addons.base.ir import ir_qweb
from openerp.addons.website.models.ir_qweb import html_to_text
from openerp.addons.website.models.website import slugify, unslug
... | agpl-3.0 |
andnovar/networkx | networkx/algorithms/connectivity/utils.py | 24 | 3304 | # -*- coding: utf-8 -*-
"""
Utilities for connectivity package
"""
import networkx as nx
__author__ = '\n'.join(['Jordi Torrents <jtorrents@milnou.net>'])
__all__ = ['build_auxiliary_node_connectivity',
'build_auxiliary_edge_connectivity']
def build_auxiliary_node_connectivity(G):
r"""Creates a direc... | bsd-3-clause |
mjgrav2001/scikit-learn | sklearn/linear_model/tests/test_bayes.py | 299 | 1770 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.linear_model.bayes import BayesianRidge, ARDRegres... | bsd-3-clause |
pranner/CMPUT410-Lab6-Django | v1/lib/python2.7/site-packages/django/contrib/gis/gdal/libgdal.py | 48 | 3621 | from __future__ import unicode_literals
import logging
import os
import re
from ctypes import c_char_p, c_int, CDLL, CFUNCTYPE
from ctypes.util import find_library
from django.contrib.gis.gdal.error import OGRException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contrib... | apache-2.0 |
apanju/odoo | openerp/report/render/rml2pdf/__init__.py | 381 | 1101 | # -*- 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 |
bigswitch/neutron | neutron/tests/unit/api/rpc/handlers/test_dvr_rpc.py | 34 | 2111 | # Copyright (c) 2015 OpenStack Foundation.
#
# 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... | apache-2.0 |
aakashrana1995/svnit-tnp | tnp/consent/migrations/0003_consentdeadline_userconsent_userdatafields.py | 1 | 1971 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-07 08:16
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_depende... | mit |
WarrenWeckesser/scikits-image | skimage/measure/tests/test_structural_similarity.py | 21 | 6439 | import os
import numpy as np
import scipy.io
from numpy.testing import (assert_equal, assert_raises, assert_almost_equal,
assert_array_almost_equal)
from skimage.measure import structural_similarity as ssim
import skimage.data
from skimage.io import imread
from skimage import data_dir
np.ra... | bsd-3-clause |
rickerc/horizon_audit | openstack_dashboard/dashboards/admin/defaults/tables.py | 2 | 2437 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Kylin, 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
#
# ... | apache-2.0 |
owaiskhan/Retransmission-Combining | gr-wxgui/src/python/waterfallsink2.py | 92 | 1483 | #
# Copyright 2008,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
40223249-1/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/__init__.py | 693 | 4380 | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... | agpl-3.0 |
PeterDSteinberg/webapp-public | webapp/apps/taxbrain/migrations/0016_auto_20141021_1952.py | 3 | 1564 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('taxbrain', '0015_auto_20141021_1952'),
]
operations = [
migrations.AddField(
model_name='creditsinputs',
... | mit |
OmeGak/indico-plugins | vc_vidyo/indico_vc_vidyo/zodbimport.py | 1 | 8102 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
dcorio/l10n-italy | account_central_journal/wizard/central_journal_report.py | 13 | 6038 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012 ISA s.r.l. (<http://www.isa.it>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
Ninjakow/TrueSkill | lib/numpy/dual.py | 71 | 1864 | """
Aliases for functions which may be accelerated by Scipy.
Scipy_ can be built to use accelerated or otherwise improved libraries
for FFTs, linear algebra, and special functions. This module allows
developers to transparently support these accelerated functions when
scipy is available but still support users who hav... | gpl-3.0 |
phraust1612/cifar100challenge | cnn_renet/init_param.py | 1 | 1166 | import numpy as np
import caffe
import os
def extract_caffe_model(model, weights, output_path):
"""extract caffe model's parameters to numpy array, and write them to files
Args:
model: path of '.prototxt'
weights: path of '.caffemodel'
output_path: output path of numpy params
Returns:
None
"""... | mit |
holyangel/M8-GPE_L | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
pignacio/python-nvd3 | examples/MultiBarChart.py | 1 | 1100 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Examples for Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
"""
from nvd3.mul... | mit |
Jionglun/2015 | static/Brython3.1.1-20150328-091302/Lib/browser/markdown.py | 623 | 13060 | # -*- coding: utf-8 -*-
try:
import _jsre as re
except:
import re
import random
import time
letters = 'abcdefghijklmnopqrstuvwxyz'
letters += letters.upper()+'0123456789'
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if ... | gpl-3.0 |
rrampage/rethinkdb | test/scenarios/static_cluster.py | 15 | 2652 | #!/usr/bin/env python
# Copyright 2010-2014 RethinkDB, all rights reserved.
from __future__ import print_function
import sys, os, time
startTime = time.time()
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common')))
import driver, scenario_common, utils, vcoptparse, worklo... | agpl-3.0 |
nickpack/django-oscar | tests/unit/core/customisation_tests.py | 26 | 2882 | import os
import tempfile
from django.test import TestCase
from django.conf import settings
from oscar.core import customisation
VALID_FOLDER_PATH = 'tests/_site/apps'
class TestUtilities(TestCase):
def test_subfolder_extraction(self):
folders = list(customisation.subfolders('/var/www/eggs'))
... | bsd-3-clause |
wkeeling/ansible | test/units/parsing/test_unquote.py | 80 | 2072 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
chatelak/RMG-Py | rmgpy/kinetics/modelTest.py | 11 | 4769 | #!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of cha... | mit |
mgit-at/ansible | lib/ansible/modules/network/meraki/meraki_snmp.py | 28 | 10148 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net>
# 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 = {
... | gpl-3.0 |
zhensydow/cgf_2015_cocos2d-x | proj.android/build_native.py | 124 | 1365 | #!/usr/bin/python
# build_native.py
# Build native codes
#
# Please use cocos console instead
import sys
import os, os.path
import shutil
from optparse import OptionParser
def build(build_mode):
current_dir = os.path.dirname(os.path.realpath(__file__))
cocos_root = os.path.join(current_dir, "../cocos2d")
... | bsd-3-clause |
bigswitch/nova | nova/tests/unit/objects/test_instance_pci_requests.py | 1 | 7650 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
dotpmrcunha/gnuradio | gr-blocks/python/blocks/qa_threshold.py | 57 | 1537 | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
shaanlan/youtube-dl | youtube_dl/extractor/appleconnect.py | 139 | 1848 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
str_to_int,
ExtractorError
)
class AppleConnectIE(InfoExtractor):
_VALID_URL = r'https?://itunes\.apple\.com/\w{0,2}/?post/idsa\.(?P<id>[\w-]+)'
_TEST = {
'url': 'https://itunes.app... | unlicense |
wagnerand/olympia | src/olympia/addons/tests/test_decorators.py | 2 | 5258 | from django import http
import mock
from six.moves.urllib_parse import quote
from olympia.addons import decorators as dec
from olympia.addons.models import Addon
from olympia.amo.tests import TestCase, addon_factory
class TestAddonView(TestCase):
def setUp(self):
super(TestAddonView, self).setUp()
... | bsd-3-clause |
kalahbrown/HueBigSQL | desktop/core/ext-py/MySQL-python-1.2.5/doc/conf.py | 41 | 7746 | # -*- coding: utf-8 -*-
#
# MySQLdb documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 07 19:36:17 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... | apache-2.0 |
funson/rt-xen | tools/python/xen/xend/XendPIFMetrics.py | 48 | 2046 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
skosukhin/spack | var/spack/repos/builtin/packages/atompaw/package.py | 1 | 2376 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
s40223237/2016fallcp_hw | plugin/summary/test_summary.py | 339 | 2634 | # -*- coding: utf-8 -*-
import unittest
from jinja2.utils import generate_lorem_ipsum
# generate one paragraph, enclosed with <p>
TEST_CONTENT = str(generate_lorem_ipsum(n=1))
TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False)
from pelican.contents import Page
import summary
class TestSummary(unittest.TestCase... | agpl-3.0 |
nimeshkumar11/Implementation-of-Adaptive-CoDel-in-ns-3 | src/csma-layout/bindings/modulegen__gcc_ILP32.py | 33 | 509159 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
todaychi/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/office.py | 94 | 3343 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | apache-2.0 |
vivisect/synapse | synapse/lib/crypto/ecc.py | 1 | 6535 | import hashlib
import logging
import cryptography.hazmat.primitives.hashes as c_hashes
import cryptography.hazmat.primitives.kdf.hkdf as c_hkdf
import cryptography.hazmat.primitives.asymmetric.ec as c_ec
import cryptography.hazmat.primitives.serialization as c_ser
import cryptography.hazmat.primitives.asymmetric.utils... | apache-2.0 |
djsegal/ahab_legacy_ | pequod/readInput.py | 1 | 4463 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 4 17:53:55 2013
@author: dan
"""
from parseLine import parseLine
from findAndChar import findAndChar
from addScalarInput import addScalarInput
from addVectorInput import addVectorInput
def readInput( fileName ):
redInput =... | apache-2.0 |
DavidWittman/ansible-modules-extras | cloud/virt.py | 57 | 13870 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Virt management features
Copyright 2007, 2012 Red Hat, Inc
Michael DeHaan <michael.dehaan@gmail.com>
Seth Vidal <skvidal@fedoraproject.org>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of th... | gpl-3.0 |
michelts/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/m2m_intermediary/tests.py | 92 | 1251 | from datetime import datetime
from django.test import TestCase
from models import Reporter, Article, Writer
class M2MIntermediaryTests(TestCase):
def test_intermeiary(self):
r1 = Reporter.objects.create(first_name="John", last_name="Smith")
r2 = Reporter.objects.create(first_name="Jane", last_na... | gpl-3.0 |
etherkit/OpenBeacon2 | client/macos/venv/lib/python3.8/site-packages/colorama/ansi.py | 640 | 2524 | # 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['
OSC = '\033]'
BEL = '\007'
def code_to_chars(code):
return CSI + str(code) + 'm'
def set... | gpl-3.0 |
sgallagher/reviewboard | reviewboard/webapi/resources/base_review_general_comment.py | 5 | 2259 | from __future__ import unicode_literals
from django.db.models import Q
from django.template.defaultfilters import timesince
from djblets.util.decorators import augment_method_from
from reviewboard.reviews.features import general_comments_feature
from reviewboard.reviews.models import GeneralComment
from reviewboard.w... | mit |
Senseg/Py4A | python3-alpha/python3-src/Lib/multiprocessing/pool.py | 45 | 23519 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# 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. Redist... | apache-2.0 |
abalkin/numpy | numpy/polynomial/_polybase.py | 6 | 32655 | """
Abstract base class for the various polynomial Classes.
The ABCPolyBase class provides the methods needed to implement the common API
for the various polynomial classes. It operates as a mixin, but uses the
abc module from the stdlib, hence it is only available for Python >= 2.6.
"""
import abc
import numbers
im... | bsd-3-clause |
Virako/Rocamgo-ng | rocamgo/detection/perspective.py | 1 | 2062 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Rocamgo is recogniter of the go games by processing digital images with opencv.
# Copyright (C) 2012 Víctor Ramirez de la Corte <virako.9 at gmail dot com>
# Copyright (C) 2012 David Medina Velasco <cuidadoconeltecho at gmail dot com>
#
# This program is free software: you ... | gpl-3.0 |
LinusU/ansible-modules-extras | windows/win_scheduled_task.py | 31 | 2343 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... | gpl-3.0 |
mancoast/CPythonPyc_test | fail/342_test_zipfile64.py | 72 | 4274 | # Tests of the full ZIP64 functionality of zipfile
# The support.requires call is the only reason for keeping this separate
# from test_zipfile
from test import support
# XXX(nnorwitz): disable this test by looking for extra largfile resource
# which doesn't exist. This test takes over 30 minutes to run in general
# ... | gpl-3.0 |
Zac-HD/home-assistant | homeassistant/components/sensor/pilight.py | 17 | 3002 | """
Support for Pilight sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.pilight/
"""
import logging
import voluptuous as vol
from homeassistant.const import (
CONF_NAME, STATE_UNKNOWN, CONF_UNIT_OF_MEASUREMENT, CONF_PAYLOAD)
from hom... | apache-2.0 |
andfoy/margffoy-tuay-server | env/lib/python2.7/site-packages/Cartridge-0.9.5-py2.7.egg/cartridge/shop/translation.py | 5 | 1120 | from modeltranslation.translator import translator, TranslationOptions
from mezzanine.conf import settings
from mezzanine.core.translation import (TranslatedDisplayable,
TranslatedRichText)
from cartridge.shop.models import (Category, Product, ProductOption,
... | gpl-2.0 |
drabastomek/practicalDataAnalysisCookbook | Codes/Chapter07/ts_detrendAndRemoveSeasonality.py | 1 | 2625 | import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
# change the font size
matplotlib.rc('xtick', labelsize=9)
matplotlib.rc('ytick', labelsize=9)
matplotlib.rc('font', size=14)
# time series tools
import statsmodels.api as sm
def period_mean(data, freq):
'''
Method t... | gpl-2.0 |
kennedyshead/home-assistant | homeassistant/components/mqtt_statestream/__init__.py | 21 | 2598 | """Publish simple item state changes via MQTT."""
import json
import voluptuous as vol
from homeassistant.components.mqtt import valid_publish_topic
from homeassistant.const import MATCH_ALL
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entityf... | apache-2.0 |
p0psicles/SickGear | lib/unidecode/x0c2.py | 253 | 4710 | data = (
'syon', # 0x00
'syonj', # 0x01
'syonh', # 0x02
'syod', # 0x03
'syol', # 0x04
'syolg', # 0x05
'syolm', # 0x06
'syolb', # 0x07
'syols', # 0x08
'syolt', # 0x09
'syolp', # 0x0a
'syolh', # 0x0b
'syom', # 0x0c
'syob', # 0x0d
'syobs', # 0x0e
'syos', # 0x0f
'syoss', #... | gpl-3.0 |
KitKatXperience/platform_external_chromium_org | build/android/pylib/base/base_test_runner.py | 23 | 7920 | # 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.
"""Base class for running tests on a single device."""
import contextlib
import httplib
import logging
import os
import tempfile
import time
from pylib... | bsd-3-clause |
jejimenez/django | django/core/management/commands/dbshell.py | 467 | 1192 | from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
class Command(BaseCommand):
help = ("Runs the command-line client for specified database, or the "
"default database if none is provided.")
requires_system_checks = False
def add... | bsd-3-clause |
doomsterinc/odoo | addons/web/doc/_themes/flask_theme_support.py | 2228 | 4875 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... | agpl-3.0 |
h3rald/mal | python/step4_if_fn_do.py | 60 | 2554 | import sys, traceback
import mal_readline
import mal_types as types
import reader, printer
from env import Env
import core
# read
def READ(str):
return reader.read_str(str)
# eval
def eval_ast(ast, env):
if types._symbol_Q(ast):
return env.get(ast)
elif types._list_Q(ast):
return types._li... | mpl-2.0 |
yarikoptic/NiPy-OLD | nipy/neurospin/datasets/volumes/tests/test_volume_field.py | 1 | 1076 | """
Testing data image interface.
"""
import numpy as np
# Local imports
from ..volume_field import VolumeField
from ...transforms.transform import Transform, CompositionError
################################################################################
# Tests
def test_interface():
img = VolumeField()
im... | bsd-3-clause |
mthh/geopy | test/geocoders/photon.py | 1 | 2704 | # -*- coding: UTF-8 -*-
import unittest
from geopy.compat import u
from geopy.point import Point
from geopy.geocoders import Photon
from test.geocoders.util import GeocoderTestBase
class PhotonTestCase(GeocoderTestBase): # pylint: disable=R0904,C0111
@classmethod
def setUpClass(cls):
cls.geocoder =... | mit |
stackforge/tacker | tacker/db/migration/alembic_migrations/versions/0ae5b1ce3024_unique_constraint_name.py | 2 | 1946 | # Copyright 2016 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
GGoussar/scikit-image | skimage/color/tests/test_adapt_rgb.py | 19 | 2591 | from functools import partial
import numpy as np
from skimage import img_as_float, img_as_uint
from skimage import color, data, filters
from skimage.color.adapt_rgb import adapt_rgb, each_channel, hsv_value
from skimage._shared._warnings import expected_warnings
# Down-sample image for quicker testing.
COLOR_IMAGE =... | bsd-3-clause |
18padx08/PPTex | PPTexEnv_x86_64/lib/python2.7/site-packages/numpy/doc/glossary.py | 54 | 12042 | """
========
Glossary
========
.. glossary::
along an axis
Axes are defined for arrays with more than one dimension. A
2-dimensional array has two corresponding axes: the first running
vertically downwards across rows (axis 0), and the second running
horizontally across columns (axis 1... | mit |
drakuna/odoo | addons/hr_recruitment/models/hr_job.py | 37 | 5037 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import _, api, fields, models
class Job(models.Model):
_inherit = "hr.job"
_name = "hr.job"
_inherits = {'mail.alias': 'alias_id'}
@api.model
def _default_address_id(self):
return self.env.user.compan... | gpl-3.0 |
2013Commons/HUE-SHARK | build/env/lib/python2.7/site-packages/lxml-2.2.2-py2.7-linux-i686.egg/lxml/cssselect.py | 35 | 28750 | """CSS Selectors based on XPath.
This module supports selecting XML/HTML tags based on CSS selectors.
See the `CSSSelector` class for details.
"""
import re
from lxml import etree
__all__ = ['SelectorSyntaxError', 'ExpressionError',
'CSSSelector']
try:
_basestring = basestring
except NameError:
_... | apache-2.0 |
ghtmtt/QGIS | tests/src/python/test_qgsfontutils.py | 45 | 4611 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for core QgsFontUtils class
From build dir: ctest -R PyQgsFontUtils -V
.. 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 Li... | gpl-2.0 |
scue/vim-ycm_win7 | third_party/ycmd/third_party/jedi/docs/_themes/flask_theme_support.py | 38 | 6672 | """
Copyright (c) 2010 by Armin Ronacher.
Some rights reserved.
Redistribution and use in source and binary forms of the theme, 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 condition... | gpl-3.0 |
bithinalangot/ecidadania-dev | src/apps/ecidadania/accounts/admin.py | 1 | 2246 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2010-2012 Cidadania S. Coop. Galega
#
# This file is part of e-cidadania.
#
# e-cidadania 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 Licen... | gpl-3.0 |
kanagasabapathi/python-for-android | python-build/python-libs/gdata/build/lib/gdata/Crypto/Cipher/__init__.py | 271 | 1145 | """Secret-key encryption algorithms.
Secret-key encryption algorithms transform plaintext in some way that
is dependent on a key, producing ciphertext. This transformation can
easily be reversed, if (and, hopefully, only if) one knows the key.
The encryption modules here all support the interface described in PEP
272... | apache-2.0 |
Fusion-Rom/android_external_chromium_org | build/android/pylib/base/base_test_result_unittest.py | 134 | 2817 | # 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.
"""Unittests for TestRunResults."""
import unittest
from pylib.base.base_test_result import BaseTestResult
from pylib.base.base_test_result import Test... | bsd-3-clause |
edxzw/edx-platform | cms/djangoapps/contentstore/courseware_index.py | 52 | 27599 | """ Code to allow module store to interface with courseware index """
from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
from datetime import timedelta
import logging
import re
from six import add_metaclass
from django.conf import settings
from django.utils.translation import ugettext_lazy,... | agpl-3.0 |
abloomston/sympy | sympy/polys/densearith.py | 78 | 33278 | """Arithmetics for dense recursive polynomials in ``K[x]`` or ``K[X]``. """
from __future__ import print_function, division
from sympy.polys.densebasic import (
dup_slice,
dup_LC, dmp_LC,
dup_degree, dmp_degree,
dup_strip, dmp_strip,
dmp_zero_p, dmp_zero,
dmp_one_p, dmp_one,
dmp_ground, dm... | bsd-3-clause |
15Dkatz/pants | contrib/go/src/python/pants/contrib/go/register.py | 5 | 2389 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.build_gra... | apache-2.0 |
Kitware/ParaViewCatalystExampleCode | PythonFullExample/fedatastructures.py | 4 | 1484 | import numpy
class GridClass:
"""
We are working with a uniform grid which will be
represented as a vtkImageData in Catalyst. It is partitioned
in the x-direction only.
"""
def __init__(self, pointDimensions, spacing):
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = ... | bsd-3-clause |
PJUllrich/Complete-Bunq-API-Python-Wrapper | tests/endpoints/test_installation.py | 1 | 1623 | from apiwrapper.endpoints.installation import Installation
from tests.endpoints.test_endpoint import EndpointTest
class InstallationTest(EndpointTest):
__base_endpoint_url = "/installation"
@property
def _base_endpoint(self):
return self.__base_endpoint_url
def setUp(self):
super().s... | mit |
ouh-churchill/quod | quodsite/website/templatetags/quodsite_tags.py | 1 | 2483 | #!/usr/bin/python
# coding: utf-8
from __future__ import absolute_import, unicode_literals
from django import template
register = template.Library()
@register.simple_tag
def get_model_fields(object_to_query):
return dict(
(field.name, field.value_to_string(object_to_query)) for field in object_to_query._... | mit |
jeasoft/odoo | addons/portal_project/tests/test_access_rights.py | 197 | 15444 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-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 |
fkorotkov/pants | src/python/pants/engine/objects.py | 8 | 5353 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import inspect
from ... | apache-2.0 |
abhishekmurthy/Calligra | devtools/scripts/profileOfficeFileLoading.py | 7 | 13373 | #! /usr/bin/python -Qwarnall
# This script profiles loading of documents in Calligra.
# It is called like this:
# profileOfficeFileLoading.py $dir $outputfile
# The script outputs an csv file that contains the times various functions took
# for each file in directory $dir. The directory $dir is scanned recursively.
#... | gpl-2.0 |
davebaol/libgdx | extensions/gdx-freetype/jni/freetype-2.4.10/src/tools/docmaker/docmaker.py | 463 | 2766 | #!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | apache-2.0 |
axelspringer/ansible-modules-core | cloud/amazon/ec2_key.py | 53 | 7843 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#
... | gpl-3.0 |
sfluo/Mr.Bot | crypto/pycrypto-2.6/build/lib.macosx-10.7-intel-2.7/Crypto/SelfTest/Hash/test_MD2.py | 116 | 2368 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/MD2.py: Self-test for the MD2 hash function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication ... | bsd-3-clause |
go-bears/nupic | tests/swarming/nupic/swarming/experiments/delta/description.py | 32 | 14629 | # ----------------------------------------------------------------------
# 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 apply:
#
# This progra... | agpl-3.0 |
googleapis/python-api-core | google/api_core/future/_helpers.py | 7 | 1248 | # Copyright 2017, Google LLC
#
# 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, ... | apache-2.0 |
stackArmor/security_monkey | security_monkey/auditors/elbv2.py | 3 | 5314 | # Copyright 2014 Netflix, 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... | apache-2.0 |
gauribhoite/personfinder | env/google_appengine/lib/django-1.2/django/core/paginator.py | 356 | 4021 | from math import ceil
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True):
self.object_list = object_list
self.per_pa... | apache-2.0 |
ken-muturi/pombola | pombola/kenya/urls.py | 1 | 4552 | from django.conf.urls import patterns, url
from django.views.generic.base import TemplateView
from pombola.kenya.views import KEPersonDetail, KEPersonDetailAppearances
from pombola.experiments.views import ExperimentShare, ExperimentSurvey
from .views import (CountyPerformanceView, CountyPerformanceSenateSubmission,
... | agpl-3.0 |
bright-sparks/chromium-spacewalk | media/tools/layout_tests/trend_graph_unittest.py | 175 | 1288 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import shutil
import unittest
from trend_graph import TrendGraph
class TestTrendGraph(unittest.TestCase):
def testU... | bsd-3-clause |
lxn2/mxnet | example/fcn-xs/solver.py | 14 | 6530 | # pylint: skip-file
import numpy as np
import mxnet as mx
import time
import logging
from collections import namedtuple
from mxnet import optimizer as opt
from mxnet.optimizer import get_updater
from mxnet import metric
# Parameter to pass to batch_end_callback
BatchEndParam = namedtuple('BatchEndParams', [... | apache-2.0 |
joestump/lightblue-0.4 | src/linux/__init__.py | 180 | 6362 | # Copyright (c) 2009 Bea Lam. All rights reserved.
#
# This file is part of LightBlue.
#
# LightBlue 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 l... | gpl-3.0 |
linkhub-sdk/popbill.taxinvoice.example.py | getSendToNTSConfig.py | 1 | 1031 | # -*- coding: utf-8 -*-
# code for console Encoding difference. Dont' mind on it
import sys
import imp
imp.reload(sys)
try:
sys.setdefaultencoding('UTF8')
except Exception as E:
pass
import testValue
from popbill import TaxinvoiceService, PopbillException
taxinvoiceService = TaxinvoiceService(testValue.Link... | mit |
drankye/kerb-token | krb5/src/tests/t_skew.py | 1 | 2477 | #!/usr/bin/python
from k5test import *
# Create a realm with the KDC one hour in the past.
realm = K5Realm(start_kdc=False)
realm.start_kdc(['-T', '-3600'])
# kinit (no preauth) should work, and should set a clock skew allowing
# kvno to work, with or without FAST.
realm.kinit(realm.user_princ, password('user'))
real... | apache-2.0 |
takeshineshiro/heat | heat_integrationtests/functional/test_preview.py | 6 | 6862 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
superdump/cerbero | cerbero/packages/osx/distribution.py | 22 | 4783 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
shaform/scrapy | scrapy/downloadermiddlewares/robotstxt.py | 15 | 3931 | """
This is a middleware to respect robots.txt policies. To activate it you must
enable this middleware and enable the ROBOTSTXT_OBEY setting.
"""
import logging
from six.moves.urllib import robotparser
from twisted.internet.defer import Deferred, maybeDeferred
from scrapy.exceptions import NotConfigured, IgnoreReq... | bsd-3-clause |
holtgrewe/seqan | misc/seqan_instrumentation/py2exe/dist/classes/requests/models.py | 14 | 26267 | # -*- coding: utf-8 -*-
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import os
from datetime import datetime
from .hooks import dispatch_hook, HOOKS
from .structures import CaseInsensitiveDict
from .status_codes import codes
from .auth import HTTPBasicAuth, ... | bsd-3-clause |
ayseyo/oclapi | django-nonrel/ocl/collection/urls.py | 1 | 2899 | from django.conf.urls import patterns, url, include
from collection.feeds import CollectionFeed
from collection.views import CollectionListView, CollectionRetrieveUpdateDestroyView, CollectionVersionListView, CollectionVersionRetrieveUpdateView, CollectionVersionRetrieveUpdateDestroyView, CollectionVersionChildListView... | mpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.