repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
galenhz/micropython | refs/heads/master | tests/micropython/viper_args.py | 49 | # test calling viper functions with different number of args
@micropython.viper
def f0():
print(0)
f0()
@micropython.viper
def f1(x1:int):
print(x1)
f1(1)
@micropython.viper
def f2(x1:int, x2:int):
print(x1, x2)
f2(1, 2)
@micropython.viper
def f3(x1:int, x2:int, x3:int):
print(x1, x2, x3)
f3(1, 2, 3... |
gpfei/python-dns-cache | refs/heads/master | setup.py | 1 | from setuptools import setup
from setuptools import find_packages
from pip.req import parse_requirements
from pip.download import PipSession
requires = [str(i.req) for i in parse_requirements('requirements.txt',
session=PipSession())
if i.req is not None]... |
xq262144/hue | refs/heads/master | desktop/core/src/desktop/lib/tasks/__init__.py | 35 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
MicroTrustRepos/microkernel | refs/heads/master | src/l4/pkg/python/contrib/Lib/test/test_difflib.py | 74 | import difflib
from test.test_support import run_unittest, findfile
import unittest
import doctest
import sys
class TestSFbugs(unittest.TestCase):
def test_ratio_for_null_seqn(self):
# Check clearing of SF bug 763023
s = difflib.SequenceMatcher(None, [], [])
self.assertEqual(s.ratio(), 1)
... |
hnakamur/django | refs/heads/master | django/contrib/gis/gdal/datasource.py | 357 | """
DataSource is a wrapper for the OGR Data Source object, which provides
an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
GDAL-supported data source. For example, a SHP file or a
TIGER/Line... |
jm-begon/scikit-learn | refs/heads/master | sklearn/externals/joblib/logger.py | 359 | """
Helpers for logging.
This module needs much love to become useful.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2008 Gael Varoquaux
# License: BSD Style, 3 clauses.
from __future__ import print_function
import time
import sys
import os
import shutil
import logging
impo... |
benschmaus/catapult | refs/heads/master | third_party/gsutil/third_party/boto/tests/unit/cloudfront/test_distribution.py | 130 | import unittest
from boto.cloudfront.distribution import DistributionConfig
from boto.cloudfront.logging import LoggingInfo
class CloudfrontDistributionTest(unittest.TestCase):
cloudfront = True
def setUp(self):
self.dist = DistributionConfig()
def test_logging(self):
# Default.
... |
adamjmcgrath/glancydesign | refs/heads/master | src/django-nonrel/django/conf/urls/defaults.py | 320 | from django.core.urlresolvers import RegexURLPattern, RegexURLResolver
from django.core.exceptions import ImproperlyConfigured
__all__ = ['handler404', 'handler500', 'include', 'patterns', 'url']
handler404 = 'django.views.defaults.page_not_found'
handler500 = 'django.views.defaults.server_error'
def include(arg, na... |
carlgao/lenga | refs/heads/master | images/lenny64-peon/usr/share/python-support/python-django/django/conf/project_template/settings.py | 14 | # Django settings for {{ project_name }} project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
... |
dgriffis/PyGithub | refs/heads/master | github/tests/GitTree.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2012 Vincent Jacques
# vincent@vincent-jacques.net
# This file is part of PyGithub. http://vincent-jacques.net/PyGithub
# PyGithub 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 Softwar... |
simbs/edx-platform | refs/heads/master | lms/djangoapps/bulk_email/models.py | 31 | """
Models for bulk email
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py lms schemamigration bulk_email --auto description_of_your_change
3. Add... |
py4n6/aff4 | refs/heads/master | applications/pyflag/pyflag/lexer.py | 8 | #!/usr/bin/env python
# ******************************************************
# Michael Cohen <scudette@users.sourceforge.net>
#
# ******************************************************
# Version: FLAG $Version: 0.87-pre1 Date: Thu Jun 12 00:48:38 EST 2008$
# ******************************************************
#
#... |
offby1/icalendar | refs/heads/master | src/icalendar/tests/test_icalendar.py | 4 | import unittest, doctest, os
from icalendar import cal, caselessdict, parser, prop
class FuckYouTests(unittest.TestCase):
def XtestBla(self):
from icalendar import Calendar
c = Calendar()
c['description']=u'Paragraph one\n\nParagraph two'
output = c.as_string()
self.assertEq... |
hhoubo/static-website-generator-with-jinja2-example | refs/heads/master | build.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from jinja2 import Environment, PackageLoader
env = Environment(loader=PackageLoader('static-website-generator-with-jinja2-example', 'templates'))
index_template = env.get_template('index.html')
# video_list_template = env.get_template('video_list.html')
|
JamesShaeffer/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/v_net_alloc.py | 45 | # -*- coding: utf-8 -*-
"""
***************************************************************************
v_net_alloc.py
---------------------
Date : December 2015
Copyright : (C) 2015 by Médéric Ribreux
Email : medspx at medspx dot fr
***********************... |
rgeleta/odoo | refs/heads/8.0 | addons/hw_scale/__openerp__.py | 220 | # -*- 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... |
jazztpt/edx-platform | refs/heads/master | lms/djangoapps/edxnotes/tests.py | 72 | """
Tests for the EdxNotes app.
"""
from contextlib import contextmanager
import ddt
import json
import jwt
from mock import patch, MagicMock
from unittest import skipUnless
from datetime import datetime
from edxmako.shortcuts import render_to_string
from edxnotes import helpers
from edxnotes.decorators import edxnote... |
machristie/airavata | refs/heads/develop | airavata-api/airavata-client-sdks/airavata-python-sdk/src/main/resources/lib/apache/airavata/model/scheduling/ttypes.py | 4 | #
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
tr... |
luiseduardohdbackup/odoo | refs/heads/8.0 | addons/website_forum/controllers/__init__.py | 4497 | # -*- coding: utf-8 -*-
import main
|
JonasWallin/BayesFlow | refs/heads/master | src/utils/load_and_save.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 7 21:23:52 2015
@author: johnsson
"""
import pickle
import os
import numpy as np
import json
import yaml
import re
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
def save_object_to_file(obj, filename):
if rank == 0:
with open(filename, ... |
lyonbros/faxrobot | refs/heads/master | models/__init__.py | 1 | from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
def initialize_database(app):
from models.account import Account
from models.job import Job
from models.transaction import Transaction
from models.failed_payment import FailedPayment
from models.password_reset import PasswordReset
... |
TomGiordano/kernel_huawei | refs/heads/2.6.35 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 802 | # Core.py - Python extension for perf trace, 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 auto... |
robbymeals/scikit-learn | refs/heads/master | sklearn/tree/tree.py | 113 | """
This module gathers tree-based methods, including decision, regression and
randomized trees. Single and multi-output problems are both handled.
"""
# Authors: Gilles Louppe <g.louppe@gmail.com>
# Peter Prettenhofer <peter.prettenhofer@gmail.com>
# Brian Holt <bdholt1@gmail.com>
# Noel Da... |
tomography/tomobank | refs/heads/master | docs/demo/tomopy_rec.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
TomoPy example script to reconstruct a single data set.
"""
from __future__ import print_function
import os
import sys
import json
import argparse
import numpy as np
import collections
import h5py
import tomopy
import dxchange
def get_dx_dims(fname, dataset):
... |
vitaly-krugl/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/lines.py | 69 | """
This module contains all the 2D line class which can draw with a
variety of line styles, markers and colors.
"""
# TODO: expose cap and join style attrs
from __future__ import division
import numpy as np
from numpy import ma
from matplotlib import verbose
import artist
from artist import Artist
from cbook import ... |
fenginx/django | refs/heads/master | django/core/checks/model_checks.py | 5 | import inspect
import types
from collections import defaultdict
from itertools import chain
from django.apps import apps
from django.core.checks import Error, Tags, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
db_table_models = defaultdict(list)
indexes = defaultdict(list... |
nowls/gnuradio | refs/heads/master | gr-filter/python/filter/qa_fir_filter.py | 47 | #!/usr/bin/env python
#
# Copyright 2008,2010,2012,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 ... |
emonty/vhd-util | refs/heads/master | tools/python/xen/xm/tests/__init__.py | 45382 | |
kingvuplus/ops | refs/heads/master | lib/python/Plugins/SystemPlugins/VideoEnhancement/VideoEnhancement.py | 2 | from Components.config import config, ConfigSubsection, ConfigSlider, ConfigSelection, ConfigNothing, NoSave
from Tools.CList import CList
from boxbranding import getBoxType
import os
# The "VideoEnhancement" is the interface to /proc/stb/vmpeg/0.
class VideoEnhancement:
firstRun = True
def __init__(self):
self.l... |
aliceriot/zulip | refs/heads/master | zerver/lib/actions.py | 114 | from __future__ import absolute_import
from django.conf import settings
from django.core import validators
from django.contrib.sessions.models import Session
from zerver.lib.cache import flush_user_profile
from zerver.lib.context_managers import lockfile
from zerver.models import Realm, RealmEmoji, Stream, UserProfile... |
bud4/samba | refs/heads/master | python/samba/samba3/__init__.py | 31 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
#
# 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) a... |
HeatherHillers/RoamMac | refs/heads/master | scripts/watchui.py | 4 | """
Watches the src folder for changes to .ui, .qrc files and rebuilds the resources.
"""
import os
import hashlib
import time
def checkfiles():
hash1 = None
def getfiles():
for root, _, files in os.walk("src"):
for file in files:
if file.endswith(".ui") or file.endswith('... |
vindimy/altcointip | refs/heads/master | src/ctb/ctb_stats.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
This file is part of ALTcointip.
ALTcointip 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) ... |
pratapvardhan/scikit-image | refs/heads/master | skimage/novice/_novice.py | 13 | import os
import imghdr
from collections import namedtuple
import numpy as np
from .. import io, img_as_ubyte
from ..transform import resize
from ..color import color_dict
from ..io.util import file_or_url_context, is_url
from ..io.collection import ImageCollection
import six
from six.moves.urllib import request
urlo... |
maartenq/ansible | refs/heads/devel | lib/ansible/modules/cloud/vmware/vmware_vswitch_facts.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com>
# 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_... |
schlueter/ansible | refs/heads/devel | test/sanity/code-smell/no-assert.py | 18 | #!/usr/bin/env python
from __future__ import print_function
import os
import re
import sys
from collections import defaultdict
PATH = 'lib/ansible'
ASSERT_RE = re.compile(r'.*(?<![-:a-zA-Z#][ -])\bassert\b(?!:).*')
all_matches = defaultdict(list)
for dirpath, dirnames, filenames in os.walk(PATH):
for filename ... |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_cfgparser.py | 72 | import ConfigParser
import StringIO
import os
import unittest
import UserDict
from test import test_support
class SortedDict(UserDict.UserDict):
def items(self):
result = self.data.items()
result.sort()
return result
def keys(self):
result = self.data.keys()
result.so... |
mchdks/python-social-auth | refs/heads/master | social/backends/docker.py | 78 | """
Docker Hub OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/docker.html
"""
from social.backends.oauth import BaseOAuth2
class DockerOAuth2(BaseOAuth2):
name = 'docker'
ID_KEY = 'user_id'
AUTHORIZATION_URL = 'https://hub.docker.com/api/v1.1/o/authorize/'
ACCESS_TOKEN_URL = '... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.7.2/Lib/ctypes/test/test_memfunctions.py | 80 | import sys
import unittest
from ctypes import *
class MemFunctionsTest(unittest.TestCase):
## def test_overflow(self):
## # string_at and wstring_at must use the Python calling
## # convention (which acquires the GIL and checks the Python
## # error flag). Provoke an error and catch it; see al... |
totolef/Sick-beard | refs/heads/master | lib/hachoir_parser/file_system/__init__.py | 90 | from lib.hachoir_parser.file_system.ext2 import EXT2_FS
from lib.hachoir_parser.file_system.fat import FAT12, FAT16, FAT32
from lib.hachoir_parser.file_system.mbr import MSDos_HardDrive
from lib.hachoir_parser.file_system.ntfs import NTFS
from lib.hachoir_parser.file_system.iso9660 import ISO9660
from lib.hachoir_parse... |
tmpgit/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/db/backends/postgis/base.py | 623 | from django.db.backends.postgresql_psycopg2.base import *
from django.db.backends.postgresql_psycopg2.base import DatabaseWrapper as Psycopg2DatabaseWrapper
from django.contrib.gis.db.backends.postgis.creation import PostGISCreation
from django.contrib.gis.db.backends.postgis.introspection import PostGISIntrospection
f... |
40023255/w16b_test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/linecache.py | 785 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
import tokenize
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globa... |
agry/NGECore2 | refs/heads/master | scripts/roadmap/ithorian.py | 2 | import sys
def getLuck():
return 30
def getPrecision():
return 40
def getStrength():
return 60
def getConstitution():
return 0
def getStamina():
return 70
def getAgility():
return 0
def getHealth():
return 100
def getAction():
return 75
|
Noneus/slojsonrpc | refs/heads/master | tests/api.py | 1 | '''
The MIT License (MIT)
Copyright (c) 2014 Stefan Lohmaier
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, mer... |
SpaceKatt/CSPLN | refs/heads/master | apps/scaffolding/win/web2py/gluon/contrib/rss2.py | 44 | """
PyRSS2Gen - A Python library for generating RSS 2.0 feeds.
(This is the BSD license, based on the template at
http://www.opensource.org/licenses/bsd-license.php )
Copyright (c) 2003, Dalke Scientific Software, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modific... |
indictranstech/buyback-erp | refs/heads/master | erpnext/controllers/trends.py | 20 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import getdate
from frappe import _
def get_columns(filters, trans):
validate_filters(filters)
# get conditions f... |
zchking/bill-data-collector | refs/heads/master | lib/getWeb/packages/urllib3/packages/ssl_match_hostname/__init__.py | 315 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from _implementatio... |
xupit3r/askpgh | refs/heads/master | askbot/migrations/0146_auto__add_field_threadtogroup_visibility.py | 15 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ThreadToGroup.visibility'
db.add_column('askbot_thread_groups', 'visibility',
... |
will-Do/avocado | refs/heads/master | selftests/functional/test_standalone.py | 1 | import os
import sys
if sys.version_info[:2] == (2, 6):
import unittest2 as unittest
else:
import unittest
from avocado.utils import process
basedir = os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')
basedir = os.path.abspath(basedir)
class StandaloneTests(unittest.TestCase):
def ... |
serialdoom/ansible | refs/heads/devel | lib/ansible/plugins/callback/actionable.py | 105 | # (c) 2015, Andrew Gaffney <andrew@agaffney.org>
#
# 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 ve... |
BrotherPhil/django | refs/heads/master | django/contrib/messages/storage/__init__.py | 827 | from django.conf import settings
from django.utils.module_loading import import_string
def default_storage(request):
"""
Callable with the same interface as the storage classes.
This isn't just default_storage = import_string(settings.MESSAGE_STORAGE)
to avoid accessing the settings at the module lev... |
jeremiahyan/odoo | refs/heads/master | addons/project/wizard/project_delete_wizard.py | 4 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ProjectDelete(models.TransientModel):
_name = 'project.delete.wizard'
_description = 'Project Delete Wizard'
project_ids = fields.Many2many('project.project', string='... |
nicobustillos/odoo | refs/heads/8.0 | addons/l10n_de/__openerp__.py | 170 | # -*- encoding: 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 G... |
gorjuce/odoo | refs/heads/8.0 | addons/sale_journal/sale_journal.py | 276 | # -*- 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... |
ryokochang/Slab-GCS | refs/heads/master | packages/IronPython.StdLib.2.7.5-beta1/content/Lib/email/mime/nonmultipart.py | 335 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME type messages that are not multipart."""
__all__ = ['MIMENonMultipart']
from email import errors
from email.mime.base import MIMEBase
class MIMENonMultipart(MIMEBase):
"""Base cl... |
RPGOne/Skynet | refs/heads/Miho | scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/sklearn/cluster/tests/test_mean_shift.py | 19 | """
Testing for mean shift clustering methods
"""
import numpy as np
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
from sklearn.cluster import MeanShift
from sklearn.clu... |
Drooids/odoo | refs/heads/8.0 | openerp/tools/config.py | 178 | #openerp.loggers.handlers. -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program... |
AnotherIvan/calibre | refs/heads/master | src/calibre/gui2/store/web_control.py | 14 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import os
from urlparse import urlparse
from PyQt5.Qt import QNetworkCookieJar, QNetwo... |
maftieu/CouchPotatoServer | refs/heads/master | libs/sqlalchemy/dialects/sqlite/pysqlite.py | 18 | # sqlite/pysqlite.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Support for the SQLite database via pysqlite.
Note that pysqlite is the same dr... |
h3biomed/ansible | refs/heads/h3 | lib/ansible/modules/network/f5/bigip_vlan.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
CoRfr/testman4trac | refs/heads/master | tracgenericclass/trunk/tracgenericclass/__init__.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2010-2012 Roberto Longobardi
#
# This file is part of the Test Manager plugin for Trac.
#
# The Test Manager plugin for Trac 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 Fo... |
lmprice/ansible | refs/heads/devel | test/units/module_utils/facts/hardware/linux_data.py | 68 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... |
fo2adzz/Salatuk | refs/heads/master | geocodeapi.py | 1 | #! /usr/bin/python
# -*- coding: iso-8859-1 -*-
#
__author__='atareao'
__date__ ='$07/02/2011'
#
# A library for access to geocode for address
#
# Copyright (C) 2011 Lorenzo Carbonell
# lorenzo.carbonell.cerezo@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
pritamghanghas/ardupilot | refs/heads/master | mk/PX4/Tools/genmsg/scripts/genmsg_check_deps.py | 216 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2014, Open Source Robotics Foundation, 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:
#
# * Redistribut... |
zahodi/ansible | refs/heads/devel | lib/ansible/modules/system/hostname.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Hiroaki Nakamura <hnakamur@gmail.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... |
Pluto-tv/chromium-crosswalk | refs/heads/master | chrome/tools/build/win/create_installer_archive.py | 21 | #!/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.
"""Script to create Chrome Installer archive.
This script is used to create an archive of all the files required for a
Chrome ... |
3L3N4/metagoofil | refs/heads/master | pdfminer/encodingdb.py | 56 | #!/usr/bin/env python2
import re
from psparser import PSLiteral
from glyphlist import glyphname2unicode
from latin_enc import ENCODING
## name2unicode
##
STRIP_NAME = re.compile(r'[0-9]+')
def name2unicode(name):
"""Converts Adobe glyph names to Unicode numbers."""
if name in glyphname2unicode:
retu... |
CforED/Machine-Learning | refs/heads/master | sklearn/feature_selection/from_model.py | 14 | # Authors: Gilles Louppe, Mathieu Blondel, Maheshakya Wijewardena
# License: BSD 3 clause
import numpy as np
from .base import SelectorMixin
from ..base import TransformerMixin, BaseEstimator, clone
from ..externals import six
from ..utils import safe_mask, check_array, deprecated
from ..utils.validation import chec... |
won0089/oppia | refs/heads/develop | core/domain/exp_jobs_one_off_test.py | 1 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
damiansoriano/odoo | refs/heads/master | addons/payment_paypal/__init__.py | 1574 | # -*- 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 ... |
zhimin711/nova | refs/heads/master | nova/tests/unit/test_flavors.py | 2 | # Copyright 2011 Ken Pepple
# 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... |
huguesv/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/idlelib/autoexpand.py | 11 | '''Complete the current word before the cursor with words in the editor.
Each menu selection or shortcut key selection replaces the word with a
different word with the same prefix. The search for matches begins
before the target and moves toward the top of the editor. It then starts
after the cursor and moves down. It... |
woozzu/pylearn2 | refs/heads/master | pylearn2/costs/tests/test_sparse_activation.py | 49 | """
Test autoencoder sparse activation cost.
"""
from pylearn2.config import yaml_parse
def test_sparse_activation():
"""Test autoencoder sparse activation cost."""
trainer = yaml_parse.load(test_yaml)
trainer.main_loop()
test_yaml = """
!obj:pylearn2.train.Train {
dataset: &train
!obj:pylear... |
kimjaejoong/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/contrib/test_floating_ip_pools.py | 33 | # Copyright (c) 2011 X.commerce, a business unit of eBay 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/LICENS... |
jphilipsen05/zulip | refs/heads/master | bots/zephyr_mirror.py | 4 | #!/usr/bin/env python
# Copyright (C) 2012 Zulip, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, m... |
theo-l/django | refs/heads/master | tests/null_fk/tests.py | 133 | from django.db.models import Q
from django.test import TestCase
from .models import (
Comment, Forum, Item, Post, PropertyValue, SystemDetails, SystemInfo,
)
class NullFkTests(TestCase):
def test_null_fk(self):
d = SystemDetails.objects.create(details='First details')
s = SystemInfo.objects.... |
Acehaidrey/incubator-airflow | refs/heads/master | tests/providers/google/cloud/hooks/test_vision.py | 7 | #
# 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... |
SauloAislan/ironic | refs/heads/SauloAislan-WIP | ironic_tempest_plugin/services/baremetal/base.py | 2 | # 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... |
SBT-community/Starbound_RU | refs/heads/web-interface | tools/utils.py | 10 | from sys import stdin
def get_answer(criteria):
## Gets an user input matching the "criteria"
answer = ""
if type(criteria) is int: # if criteria is an int, it's treated as a minimal length
while len(answer) < criteria:
answer = stdin.readline().strip()
elif type(criteria) is list or type(criteria) ... |
adambrenecki/django | refs/heads/master | django/contrib/gis/db/models/sql/compiler.py | 17 | import datetime
from django.conf import settings
from django.db.backends.util import truncate_name, typecast_date, typecast_timestamp
from django.db.models.sql import compiler
from django.db.models.sql.constants import MULTI
from django.utils import six
from django.utils.six.moves import zip, zip_longest
from django.u... |
edensparkles/FIRSTAID | refs/heads/master | FIRST_AID/venv/Lib/site-packages/pip/_vendor/distlib/metadata.py | 132 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Implementation of the Metadata for Python packages PEPs.
Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental).
"""
from __future__ import unicode_literals
import codecs
from email... |
igleyy/Python-Projects | refs/heads/master | Text/text_editor.py | 1 | #!/usr/bin/python
from Tkinter import Tk, Frame, Menu, Text, BOTH, END
import tkFileDialog
class TextEditor(Frame):
def __init__(self, parent):
Frame.__init__(self, parent, background='white')
self.ftypes = [('All files', '*')]
self.parent = parent
self.init_ui()
def init_ui(... |
40123248/w16b_test | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/unittest/runner.py | 637 | """Running tests"""
import sys
import time
import warnings
from . import result
from .signals import registerResult
__unittest = True
class _WritelnDecorator(object):
"""Used to decorate file-like objects with a handy 'writeln' method"""
def __init__(self,stream):
self.stream = stream
def __ge... |
omakk/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/test_argcomplete.py | 179 | from __future__ import with_statement
import py, pytest
# test for _argcomplete but not specific for any application
def equal_with_bash(prefix, ffc, fc, out=None):
res = ffc(prefix)
res_bash = set(fc(prefix))
retval = set(res) == res_bash
if out:
out.write('equal_with_bash %s %s\n' % (retval,... |
JosephKJ/SDD-RFCN-python | refs/heads/master | lib/utils/blob.py | 63 | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Blob helper functions."""
import numpy as np
import cv2
def im_lis... |
qguv/config | refs/heads/master | weechat/community/wee-slack/generate_docs.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from textwrap import dedent
import wee_slack
cmds = wee_slack.EventRouter().cmds
options = wee_slack.PluginConfig.default_settings
with open('docs/Commands.md', 'w') as file_cmds:
file_cmds.write(dedent("""
... |
hyperized/ansible | refs/heads/devel | lib/ansible/module_utils/network/junos/facts/l3_interfaces/l3_interfaces.py | 20 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The junos l3_interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based o... |
andrew168/cocos2d-js | refs/heads/develop | setup.py | 19 | #!/usr/bin/python
#coding=utf-8
"""****************************************************************************
Copyright (c) 2014 cocos2d-x.org
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), t... |
titilambert/alignak | refs/heads/develop | test/test_acknowledge_with_expire.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2015: Alignak team, see AUTHORS.txt file for contributors
#
# This file is part of Alignak.
#
# Alignak 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 So... |
pombredanne/pants | refs/heads/master | src/python/pants/backend/jvm/scala_artifact.py | 16 | # coding=utf-8
# Copyright 2014 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.backend.j... |
onitake/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/elb_application_lb.py | 25 | #!/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... |
nmayorov/scikit-learn | refs/heads/master | examples/neighbors/plot_digits_kde_sampling.py | 108 | """
=========================
Kernel Density Estimation
=========================
This example shows how kernel density estimation (KDE), a powerful
non-parametric density estimation technique, can be used to learn
a generative model for a dataset. With this generative model in place,
new samples can be drawn. These... |
Smarsh/django | refs/heads/master | tests/regressiontests/special_headers/urls.py | 50 | # coding: utf-8
from django.conf.urls.defaults import *
from django.views.generic.list_detail import object_detail
from models import Article
import views
urlpatterns = patterns('',
(r'^article/(?P<object_id>\d+)/$', object_detail, {'queryset': Article.objects.all()}),
(r'^xview/$', views.xview),
)
|
libris/librisxl | refs/heads/develop | librisxl-tools/scripts/get_marc_usage_stats.py | 1 | from __future__ import unicode_literals, print_function
__metaclass__ = type
import json
import sys
from collections import defaultdict, OrderedDict#, deque
COMBO_FLOOR = 400
REPORT_SIZE = 10000
DUMP_SIZE = 1000000
COLSPECS = {}
COLSPECS['bib'] = {
'000': [
[5], # marc:status
[6], # @type
... |
sahat/bokeh | refs/heads/master | sphinx/source/tutorial/solutions/style.py | 1 |
import numpy as np
import pandas as pd
from bokeh.plotting import *
from bokeh.objects import Range1d
# Define some categories
categories = [
'ousia', 'poson', 'poion', 'pros ti', 'pou',
'pote', 'keisthai', 'echein', 'poiein', 'paschein',
]
# Create data
N = 10
data = { cat : np.random.randint(10, 100, size=... |
kleins11/intdatasci-byte2 | refs/heads/master | jmankoff-mobile/lib/werkzeug/__init__.py | 55 | # -*- coding: utf-8 -*-
"""
werkzeug
~~~~~~~~
Werkzeug is the Swiss Army knife of Python web development.
It provides useful classes and functions for any WSGI application to make
the life of a python web developer much easier. All of the provided
classes are independent from each other so yo... |
xuyuhan/depot_tools | refs/heads/master | third_party/boto/s3/multidelete.py | 244 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... |
belmiromoreira/nova | refs/heads/master | nova/tests/unit/test_hooks.py | 73 | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... |
40223211/w16b_test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/sprite.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2003, 2007 Pete Shinners
## (C) 2004 Joe Wreschnig
## 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; e... |
rtucker-mozilla/mozpackager | refs/heads/master | vendor-local/lib/python/kombu/tests/test_simple.py | 3 | from __future__ import absolute_import
from __future__ import with_statement
from Queue import Empty
from kombu import Connection, Exchange, Queue
from .utils import TestCase
from .utils import Mock
class SimpleBase(TestCase):
abstract = True
def Queue(self, name, *args, **kwargs):
q = name
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.