repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
EntilZha/ScalaFunctional | refs/heads/master | functional/lineage.py | 2 | from functional.execution import ExecutionEngine
from functional.transformations import CACHE_T
class Lineage(object):
"""
Class for tracking the lineage of transformations, and applying them to a given sequence.
"""
def __init__(self, prior_lineage=None, engine=None):
"""
Construct a... |
rananda/cfme_tests | refs/heads/master | sprout/appliances/migrations/0018_mismatchversionmailer.py | 17 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('appliances', '0017_appliancepool_finished'),
]
operations = [
migrations.CreateModel(
name='MismatchVersionMaile... |
40023256/2015cd_midterm- | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/token.py | 743 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... |
idumpling/robotx | refs/heads/master | robotx/core/generator.py | 4 | """RobotX Generator handler"""
import os
import re
import sys
import shutil
from os.path import join
from os.path import exists
from robot.libdoc import LibDoc
from robot.testdoc import TestDoc
import robotx
from robotx.utils import copy
TEMPLATES_PATH = join(robotx.__path__[0], 'template', 'project_template')
RES... |
schlueter/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/zypper_repository.py | 7 | #!/usr/bin/python
# encoding: utf-8
# (c) 2013, Matthias Vogelgesang <matthias.vogelgesang@gmail.com>
# (c) 2014, Justin Lecher <jlec@gentoo.org>
#
# 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_... |
nityas/6869-finalproject | refs/heads/master | src/lenet_old.py | 1 | """This tutorial introduces the LeNet5 neural network architecture
using Theano. LeNet5 is a convolutional neural network, good for
classifying images. This tutorial shows how to build the architecture,
and comes with all the hyper-parameters you need to reproduce the
paper's MNIST results.
This implementation simpl... |
friendzj/GoTest | refs/heads/master | src/py/SerialOpt.py | 1 | # -*- coding: UTF-8 -*-
import time
import threading
import serial
import logging
class SerOpt:
ser = 0
comInfo = ''
BandRate = 0
__LastRecv = 0
__PackDat = []
__recvStatus = 0
__status = {'SOP':0,'LEN':1,'DAT':2}
__packetLen = 0
__ParseDatFun = 0
def __init__(self,comInfo,Bandrate)... |
ryfeus/lambda-packs | refs/heads/master | Keras_tensorflow_nightly/source2.7/google/protobuf/internal/text_format_test.py | 19 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that t... |
Mirantis/openstack-dashboard | refs/heads/master | django-openstack/src/django_openstack/templatetags/templatetags/branding.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compli... |
40223209/test111 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/gc.py | 743 | """This module provides access to the garbage collector for reference cycles.
enable() -- Enable automatic garbage collection.
disable() -- Disable automatic garbage collection.
isenabled() -- Returns true if automatic collection is enabled.
collect() -- Do a full collection right now.
get_count() -- Return the curren... |
ncdesouza/bookworm | refs/heads/master | env/lib/python2.7/site-packages/sqlalchemy/ext/instrumentation.py | 56 | """Extensible class instrumentation.
The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate
systems of class instrumentation within the ORM. Class instrumentation
refers to how the ORM places attributes on the class which maintain
data and track changes to that data, as well as event hooks installed... |
vitaly4uk/django | refs/heads/master | tests/sitemaps_tests/urls/https.py | 397 | from django.conf.urls import url
from django.contrib.sitemaps import views
from .http import SimpleSitemap
class HTTPSSitemap(SimpleSitemap):
protocol = 'https'
secure_sitemaps = {
'simple': HTTPSSitemap,
}
urlpatterns = [
url(r'^secure/index\.xml$', views.index, {'sitemaps': secure_sitemaps}),
url... |
randybias/beets | refs/heads/master | beets/util/bluelet.py | 25 | """Extremely simple pure-Python implementation of coroutine-style
asynchronous socket I/O. Inspired by, but inferior to, Eventlet.
Bluelet can also be thought of as a less-terrible replacement for
asyncore.
Bluelet: easy concurrency without all the messy parallelism.
"""
from __future__ import (division, absolute_impo... |
sonuyos/couchpotato | refs/heads/master | libs/pyasn1/type/constraint.py | 382 | #
# ASN.1 subtype constraints classes.
#
# Constraints are relatively rare, but every ASN1 object
# is doing checks all the time for whether they have any
# constraints and whether they are applicable to the object.
#
# What we're going to do is define objects/functions that
# can be called unconditionally ... |
ronq/geomesa | refs/heads/master | geomesa-spark/geomesa_pyspark/src/main/python/geomesa_pyspark/__init__.py | 7 | import glob
import os.path
import pkgutil
import sys
import tempfile
import zipfile
__version__ = '${python.version}'
PACKAGE_EXTENSIONS = {'.zip', '.egg', '.jar'}
def configure(jars=[], packages=[], files=[], spark_home=None, spark_master='yarn', tmp_path=None):
os.environ['PYSPARK_PYTHON'] = sys.executable
... |
DataDog/integrations-core | refs/heads/master | nfsstat/datadog_checks/nfsstat/__init__.py | 1 | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from .__about__ import __version__
from .nfsstat import NfsStatCheck
__all__ = ['__version__', 'NfsStatCheck']
|
6809/DwLoadServer | refs/heads/master | dwload_server/constants.py | 1 | # encoding:utf-8
"""
DwLoadServer - A DWLOAD server written in Python
================================================
:created: 2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2014 by the DwLoadServer team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more detai... |
jcdubacq/pelican-plugins | refs/heads/master | thumbnailer/thumbnailer.py | 8 | import os
import os.path as path
import re
from pelican import signals
import logging
logger = logging.getLogger(__name__)
try:
from PIL import Image, ImageOps
enabled = True
except ImportError:
logging.warning("Unable to load PIL, disabling thumbnailer")
enabled = False
DEFAULT_IMAGE_DIR = "pictures... |
166MMX/openjdk.java.net-openjfx-8u40-rt | refs/heads/master | modules/web/src/main/native/Tools/Scripts/webkitpy/performance_tests/__init__.py | 6014 | # Required for Python to search this directory for module files
|
daweiwu/meta-iotqa-1 | refs/heads/master | lib/oeqa/runtime/iotivity/iotvt_integration_mnode.py | 1 | """
@file iotvt_integration_mnode.py
"""
##
# @addtogroup iotivity iotivity
# @brief This is iotivity component
# @{
# @addtogroup iotvt_integration iotvt_integration
# @brief This is iotvt_integration module
# @{
##
import os
import time
import string
import subprocess
from oeqa.oetest import oeRuntimeTest
from oeqa... |
johnnycastilho/brotli | refs/heads/master | tools/rfc-format.py | 99 | #!/usr/bin/python
#
# Takes an .nroff source file and prints a text file in RFC format.
#
# Usage: rfc-format.py <source file>
import re
import sys
from subprocess import Popen, PIPE
def Readfile(fn):
f = open(fn, "r")
return f.read()
def FixNroffOutput(buf):
p = re.compile(r'(.*)FORMFEED(\[Page\s+\d+\])$')
... |
drpeteb/scipy | refs/heads/master | scipy/weave/_dumb_shelve.py | 100 | from __future__ import division, print_function, absolute_import
from shelve import Shelf
try:
import zlib
except ImportError:
# Some python installations don't have zlib.
pass
import pickle
class DbfilenameShelf(Shelf):
"""Shelf implementation using the "anydbm" generic dbm interface.
This is ... |
nvoron23/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/build/gyp/test/mac/gyptest-app-error.py | 164 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that invalid strings files cause the build to fail.
"""
import TestCmd
import TestGyp
import sys
if sys.platform == 'darwin'... |
kashif/chainer | refs/heads/master | tests/chainer_tests/functions_tests/math_tests/test_sum.py | 1 | import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
@testing.parameterize(*testing.product({
'axis': [None, 0, 1, 2, -1, (0, 1), (1... |
hlt-mt/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/sparsemask_op_test.py | 10 | # 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... |
waytai/odoo | refs/heads/8.0 | addons/sale_order_dates/__init__.py | 441 | # -*- 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... |
deka108/meas_deka | refs/heads/release-deka | api/urls.py | 2 | """
# Name: cms/urls.py
# Description:
# Created by: Phuc Le-Sanh
# Date Created: Nov 23, 2016
# Last Modified: Nov 23, 2016
# Modified by: Phuc Le-Sanh
"""
from django.conf.urls import url, include
# from rest_framework import routers
from rest_framework.authtoken import views as rest_views
from re... |
isandlaTech/cohorte-runtime | refs/heads/master | python/src/lib/python/unidecode/x08e.py | 252 | data = (
'Chu ', # 0x00
'Jing ', # 0x01
'Nie ', # 0x02
'Xiao ', # 0x03
'Bo ', # 0x04
'Chi ', # 0x05
'Qun ', # 0x06
'Mou ', # 0x07
'Shu ', # 0x08
'Lang ', # 0x09
'Yong ', # 0x0a
'Jiao ', # 0x0b
'Chou ', # 0x0c
'Qiao ', # 0x0d
'[?] ', # 0x0e
'Ta ', # 0x0f
'Jian ', # 0x10... |
tjth/lotterycoin | refs/heads/master | qa/rpc-tests/test_framework/comptool.py | 7 | #!/usr/bin/env python2
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from mininode import *
from blockstore import BlockStore, TxStore
from util import p2p_port
'''
This is... |
pasqualguerrero/django | refs/heads/master | tests/utils_tests/test_module/another_bad_module.py | 514 | from . import site
content = 'Another Bad Module'
site._registry.update({
'foo': 'bar',
})
raise Exception('Some random exception.')
|
LukasBoersma/pyowm | refs/heads/master | sphinx/conf.py | 1 | # -*- coding: utf-8 -*-
#
# pyowm documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 23 21:47:00 2013.
#
# 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... |
simbs/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/tests/specs/test_linkedin.py | 112 | """Integration tests for LinkedIn providers."""
from third_party_auth.tests.specs import base
class LinkedInOauth2IntegrationTest(base.Oauth2IntegrationTest):
"""Integration tests for provider.LinkedInOauth2."""
def setUp(self):
super(LinkedInOauth2IntegrationTest, self).setUp()
self.provide... |
VladiMihaylenko/omim | refs/heads/master | tools/python/google_translate.py | 53 | #!/usr/bin/python
import re
import sys
import urllib
import simplejson
import time
baseUrl = "http://www.googleapis.com/language/translate/v2"
def translate(text,src='en'):
targetLangs = ["ja", "fr", "ar", "de", "ru", "sv", "zh", "fi", "ko", "ka", "be", "nl", "ga", "el", "it", "es", "th", "ca", "cy", "hu", "sr... |
pb-cdunn/FALCON-examples | refs/heads/master | run/synth0/check.py | 1 | #!/usr/bin/env python3.7
import sys
def read_dna(ifs):
"""Assume one contig.
"""
header = ifs.readline()
dna = ""
for line in ifs:
dna += line.strip()
return dna
def reverse_complement(dna):
complement = {"T": "A", "A": "T",
"G": "C", "C": "G"}
return ''.join([complem... |
fierval/retina | refs/heads/master | DiabeticRetinopathy/Features/extract_1dlbp_images_features.py | 1 | from numba import cuda
from timeit import default_timer as timer
import numpy as np
from os import path
from tr_utils import append_to_arr, prep_out_path
from train_files import TrainFiles
from skimage import io
from cv2 import imread
root_path = "/kaggle/retina/train"
inp_path = path.join(root_path, "cropped")
out_p... |
anneria/ann17 | refs/heads/master | node_modules/npm/node_modules/node-gyp/gyp/gyptest.py | 1752 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... |
orangeduck/PyAutoC | refs/heads/master | Python27/Lib/test/test_difflib.py | 87 | import difflib
from test.test_support import run_unittest, findfile
import unittest
import doctest
import sys
class TestWithAscii(unittest.TestCase):
def test_one_insert(self):
sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
self.assertAlmostEqual(sm.ratio(), 0.995, places=3)
... |
nirmeshk/oh-mainline | refs/heads/master | vendor/packages/celery/celery/task/schedules.py | 32 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import warnings
from ..schedules import schedule, crontab_parser, crontab # noqa
from ..exceptions import CDeprecationWarning
warnings.warn(CDeprecationWarning(
"celery.task.schedules is deprecated and renamed to celery.schedules"))
|
dongguangming/python-phonenumbers | refs/heads/dev | python/phonenumbers/data/alt_format_91.py | 11 | """Auto-generated file, do not edit by hand. 91 metadata"""
from ..phonemetadata import NumberFormat
PHONE_ALT_FORMAT_91 = [NumberFormat(pattern='(\\d{2})(\\d{2})(\\d{6})', format='\\1 \\2 \\3', leading_digits_pattern=['7(?:0[2-8]|2[0579]|3[057-9]|4[0-389]|6[0-35-9]|[57]|8[0-79])|8(?:0[015689]|1[0-57-9]|2[2356-9]|3[0-... |
ttouchstone/deap | refs/heads/master | doc/code/tutorials/part_2/2_1_fitness.py | 14 | ## 2.1 Fitness
from deap import base
from deap import creator
## FitnessMin
creator.create("FitnessMin", base.Fitness, weights=(-1.0,))
## FitnessMulti
creator.create("FitnessMulti", base.Fitness, weights=(-1.0, 1.0))
|
copyleftdev/gulpdemo | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py | 1869 | # Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structur... |
ybenitezf/nstock | refs/heads/master | modules/unidecode/x09e.py | 252 | data = (
'Shu ', # 0x00
'Luo ', # 0x01
'Qi ', # 0x02
'Yi ', # 0x03
'Ji ', # 0x04
'Zhe ', # 0x05
'Yu ', # 0x06
'Zhan ', # 0x07
'Ye ', # 0x08
'Yang ', # 0x09
'Pi ', # 0x0a
'Ning ', # 0x0b
'Huo ', # 0x0c
'Mi ', # 0x0d
'Ying ', # 0x0e
'Meng ', # 0x0f
'Di ', # 0x10
'Yue ', ... |
CornerstoneLabs/club-prototype | refs/heads/master | app-server/classes/models.py | 1 | """Classes."""
from django.db import models
from django.contrib.auth.models import User
import datetime
DAY_NAME = [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday'
]
DAY_PICKER = [(i, DAY_NAME[i]) for i in range(7)]
HOURS_PICKER = [(i, str(i).rjust(2, '0')) fo... |
marcuskelly/recover | refs/heads/master | Lib/site-packages/Crypto/Math/Primality.py | 4 | # ===================================================================
#
# Copyright (c) 2014, Legrandin <helderijs@gmail.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:
#
# 1. Redistributio... |
tmtowtdi/MontyLacuna | refs/heads/master | lib/lacuna/buildings/boring/corn.py | 1 |
from lacuna.building import MyBuilding
class corn(MyBuilding):
path = 'corn'
def __init__( self, client, body_id:int = 0, building_id:int = 0 ):
super().__init__( client, body_id, building_id )
|
stryder199/RyarkAssignments | refs/heads/master | Assignment2/web2py/gluon/contrib/login_methods/openid_auth.py | 2 | #!/usr/bin/env python
# coding: utf8
"""
OpenID authentication for web2py
Allowed using OpenID login together with web2py built-in login.
By default, to support OpenID login, put this in your db.py
>>> from gluon.contrib.login_methods.openid_auth import OpenIDAuth
>>> auth.settings.login_form = ... |
Mj258/weiboapi | refs/heads/master | srapyDemo/envs/Lib/site-packages/zope/interface/tests/odd.py | 79 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
Samuel789/MediPi | refs/heads/master | MedManagementWeb/env/lib/python3.5/site-packages/django/conf/locale/zh_Hans/formats.py | 1008 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y年n月j日' # 2016年9月5... |
sambayless/monosat | refs/heads/master | examples/python/nqueens.py | 1 | #!/usr/bin/env python3
# Authors Rémi Delmas & Christophe Garion
#License CC BY-NC-SA 3.0
#This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike
#3.0 Unported license (CC BY-NC-SA 3.0)
#You are free to Share (copy, distribute and transmite) and to Remix (adapt) this work under the f... |
ferranti/watchdog | refs/heads/master | import/parse/rvdb.py | 3 | # historical_voting.py - Parse and import historical voting by county
# fors years 1964 - 2004
# Copyright (C) 2008 didier deshommes <dfdeshom@gmail.com>
STATE_CODES = '../data/crawl/manual/rvdb/state_codes'
DATA_PATH = '../data/crawl/manual/rvdb/allYears/'
import glob
def read_state_codes(fname=STATE_CODES):
""... |
XiaosongWei/blink-crosswalk | refs/heads/master | PRESUBMIT.py | 16 | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for Blink.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmi... |
z0by/django | refs/heads/master | django/contrib/gis/geoip/__init__.py | 700 | """
This module houses the GeoIP object, a ctypes wrapper for the MaxMind GeoIP(R)
C API (http://www.maxmind.com/app/c). This is an alternative to the GPL
licensed Python GeoIP interface provided by MaxMind.
GeoIP(R) is a registered trademark of MaxMind, LLC of Boston, Massachusetts.
For IP-based geolocation, t... |
arulalant/mmDiagnosis | refs/heads/master | diagnosis1/gui_quickly/py_2.6.6/diagnosis/diagnosis/dialog.py | 3 | import gtk
class DialogBox():
def __init__(self, builder):
self.dialog = builder.get_object('dialogBox')
self.dialogLabel = builder.get_object('dialog_label')
#self.diagnosis = builder.get_object('diagnosis_window')
def title(self, txt):
self.dialog.set_title(txt)
... |
Jionglun/2015cd_midterm2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/__main__.py | 737 | """Main entry point"""
import sys
if sys.argv[0].endswith("__main__.py"):
import os.path
# We change sys.argv[0] to make help message more useful
# use executable without path, unquoted
# (it's just a hint anyway)
# (if you have spaces in your executable you get what you deserve!)
executable = ... |
apixandru/intellij-community | refs/heads/master | python/testData/testRunner/__init__.py | 981 | __author__ = 'traff'
|
deffi/protoplot | refs/heads/master | plotlib/pl_container.py | 1 | from plotlib import OptionsContainer
class Container(list):
'''
* A list
* Has an 'options' property, which is an OptionsContainer representing
default options for all contained items
* Has an add method whigh creates and adds an instance of a pre-defined
class (klass)
'''
def __in... |
mchaparro/intercambios | refs/heads/master | intercambios/views/evento.py | 1 | from django.http import *
from django.shortcuts import render_to_response,redirect
from django.template import RequestContext
from django.conf import settings
from intercambios.models import Evento, ParticipantesEvento, Usuario
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorat... |
osh/gr-eventsim | refs/heads/master | apps/test_data_gen.py | 1 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Test Data Gen
# Generated: Sat Dec 26 20:32:06 2015
##################################################
from gnuradio import analog
from gnuradio import blocks
from gnuradio import en... |
nhippenmeyer/django | refs/heads/master | django/db/backends/postgresql/introspection.py | 326 | from __future__ import unicode_literals
from collections import namedtuple
from django.db.backends.base.introspection import (
BaseDatabaseIntrospection, FieldInfo, TableInfo,
)
from django.utils.encoding import force_text
FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',))
class DatabaseIntr... |
misisnik/ExternalInterface | refs/heads/master | ENV/Lib/encodings/aliases.py | 726 | """ Encoding Aliases Support
This module is used by the encodings package search function to
map encodings names to module names.
Note that the search function normalizes the encoding names before
doing the lookup, so the mapping will have to map normalized
encoding names to module names.
Con... |
amaleewilson/apartment-rating | refs/heads/master | apt_rater_basic/apartment.py | 1 | # This class stores information about apartments
class Apartment:
def __init__(self, name, distances_from_work):
self.attributes = dict([("name", name), ("distances", distances_from_work)])
self.relevant_attributes = dict([("monthly_cost_of_commuting", calculateMonthlyCommute(self.attributes... |
sungkim11/mhargadh | refs/heads/master | django/views/decorators/cache.py | 229 | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.utils.decorators import decorator_from_middleware_with_args, available_attrs
from django.utils.cache import patch_cache_control, add_never_cache_headers
from django.middleware.cach... |
holmes/intellij-community | refs/heads/master | plugins/hg4idea/testData/bin/mercurial/dirstate.py | 90 | # dirstate.py - working directory tracking for mercurial
#
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import errno
from node import nullid
from i18n import _
import scmutil... |
SuperMass/distOS-lab3 | refs/heads/master | src/test/p1.py | 1 | def change_dict(test_dict):
if '1' in test_dict:
test_dict['1'] = 5
|
candsvincent/edgesense | refs/heads/master | python/run_script.py | 3 | import sys
from edgesense.build_network import main as build_network_main
from edgesense.catalyst_server import main as catalyst_server_main
from edgesense.drupal_script import main as drupal_script_main
from edgesense.parse_catalyst import main as parse_catalyst_main
from edgesense.parse_mailinglist import main as pa... |
rbuffat/pyidf | refs/heads/master | pyidf/simulation_parameters.py | 1 | """ Data objects in group "Simulation Parameters"
"""
from collections import OrderedDict
import logging
from pyidf.helper import DataObject
logger = logging.getLogger("pyidf")
logger.addHandler(logging.NullHandler())
class Version(DataObject):
"""Corresponds to IDD object `Version` Specifies the EnergyPlus v... |
MakeHer/edx-platform | refs/heads/dashboard.2 | openedx/core/djangoapps/credit/routers.py | 138 | """ DRF routers. """
from rest_framework import routers
class SimpleRouter(routers.SimpleRouter):
""" Simple DRF router. """
# Note (CCB): This is a retrofit of a DRF 2.4 feature onto DRF 2.3. This is, sadly, simpler than
# updating edx-ora2 to work with DRF 2.4. See https://github.com/tomchristie/djang... |
kcavagnolo/astroML | refs/heads/master | astroML/datasets/sdss_filters.py | 3 | from __future__ import print_function, division
import os
import numpy as np
from astroML.datasets import get_data_home
from ..py3k_compat import urlopen
# Info on vega spectrum: http://www.stsci.edu/hst/observatory/cdbs/calspec.html
VEGA_URL = 'http://www.astro.washington.edu/users/ivezic/DMbook/data/1732526_nic_0... |
thurt/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/testing/gtest/test/gtest_help_test.py | 2968 | #!/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... |
kuri65536/python-for-android | refs/heads/master | python3-alpha/python-libs/gdata/tlslite/VerifierDB.py | 48 | """Class for storing SRP password verifiers."""
from .utils.cryptomath import *
from .utils.compat import *
from . import mathtls
from .BaseDB import BaseDB
class VerifierDB(BaseDB):
"""This class represent an in-memory or on-disk database of SRP
password verifiers.
A VerifierDB can be passed to a server... |
actuaryzhang/spark | refs/heads/master | sql/hive/src/test/resources/data/scripts/newline.py | 131 | #
# 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 u... |
sdklite/gyp | refs/heads/master | test/mac/gyptest-sourceless-module.py | 200 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that bundles that have no 'sources' (pure resource containers) work.
"""
import TestGyp
import sys
if sys.platform == 'darwi... |
nhicher/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/efs_facts.py | 47 | #!/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'],
... |
baile/infojoiner | refs/heads/master | infojoiner/importers/bookmarks_tests.py | 1 | import unittest
from ConfigParser import SafeConfigParser
from bookmarks import BookmarksImporter
class BookmarksImporterTest(unittest.TestCase):
def setUp(self):
self.bi = BookmarksImporter()
self.config = self.bi.open_config()
self.path = self.bi.get_config(self.config,'user','home')
... |
Pragmatismo/Pigrow | refs/heads/master | resources/examples/RF_off.py | 1 | #!/usr/bin/python3
import datetime, sys, os
homedir = os.getenv("HOME")
sys.path.append(homedir + '/Pigrow/scripts/')
import pigrow_defs
for argu in sys.argv[1:]:
if argu == '-h' or argu == '--help':
print("Pigrow RX off switch")
print("")
sys.exit()
if argu == "-flags":
print("... |
jpulec/django-rest-framework | refs/heads/master | rest_framework/templatetags/rest_framework.py | 15 | from __future__ import absolute_import, unicode_literals
import re
from django import template
from django.core.urlresolvers import NoReverseMatch, reverse
from django.utils import six
from django.utils.encoding import force_text, iri_to_uri
from django.utils.html import escape, smart_urlquote
from django.utils.safes... |
dincamihai/django-allauth | refs/heads/master | allauth/account/app_settings.py | 34 | class AppSettings(object):
class AuthenticationMethod:
USERNAME = 'username'
EMAIL = 'email'
USERNAME_EMAIL = 'username_email'
class EmailVerificationMethod:
# After signing up, keep the user account inactive until the email
# address is verified
MANDATORY = 'ma... |
mark-ignacio/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/rules/gyptest-default.py | 137 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies simple rules when using an explicit build target of 'all'.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('actions... |
zanderle/django | refs/heads/master | tests/custom_methods/tests.py | 225 | from __future__ import unicode_literals
from datetime import date
from django.test import TestCase
from .models import Article
class MethodsTests(TestCase):
def test_custom_methods(self):
a = Article.objects.create(
headline="Parrot programs in Python", pub_date=date(2005, 7, 27)
)
... |
nakato/smashcache | refs/heads/master | smashcache/pages/errors.py | 1 | # Copyright (c) 2015 Sachi King
#
# 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... |
mjsull/Contiguity | refs/heads/master | setup.py | 1 | # cx_Freeze setup file
import sys
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need fine tuning.
build_exe_options = {"packages": ["khmer"]}
# GUI applications require a different base on Windows (the default is for a
# console application).
base = None
if sys.platf... |
dzolnierz/mysql-utilities | refs/heads/master | mysql/fabric/replication.py | 1 | #
# Copyright (c) 2013,2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the... |
gilamsalem/pynfs | refs/heads/master | nfs4.0/nfs4acl.py | 3 | #
# nfs4acl.py - some useful acl code
#
# Written by Fred Isaman <iisaman@citi.umich.edu>
# Copyright (C) 2004 University of Michigan, Center for
# Information Technology Integration
#
# Taken from mapping description at
# http://www.citi.umich.edu/projects/nfsv4/rfc/draft-ietf-nfsv4-acl-mapping-0... |
Maistho/CouchPotatoServer | refs/heads/master | couchpotato/core/media/_base/media/__init__.py | 81 | from .main import MediaPlugin
def autoload():
return MediaPlugin()
|
JonathanStein/odoo | refs/heads/8.0 | addons/report/__openerp__.py | 385 | {
'name': 'Report',
'category': 'Base',
'summary': 'Report',
'version': '1.0',
'description': """
Report
""",
'author': 'OpenERP SA',
'depends': ['base', 'web'],
'data': [
'views/layouts.xml',
'views/views.xml',
'data/report_paperformat.xml',
'secu... |
croach/p5.py | refs/heads/master | lib/p5/perlin.py | 2 | """Perlin noise
"""
import math
from random import Random
PERLIN_YWRAPB = 4
PERLIN_YWRAP = 1<<PERLIN_YWRAPB
PERLIN_ZWRAPB = 8
PERLIN_ZWRAP = 1<<PERLIN_ZWRAPB
PERLIN_SIZE = 4095
perlin_octaves = 4 # default to medium smooth
perlin_amp_falloff = 0.5 # 50% reduction/octave
# TODO: Instead of these being global to th... |
kincl/oncall | refs/heads/master | oncall_old/settings.py | 2 | # These are defaults, set yours somewhere else
class Defaults(object):
DEBUG = False
TESTING = False
SQLALCHEMY_DATABASE_URI = 'sqlite://'
ROLES = ['Primary','Secondary']
ONCALL_START = 1
LOG_FILE = False
SYSLOG = False
|
dls-controls/pymalcolm | refs/heads/master | malcolm/modules/pmac/parts/__init__.py | 1 | # Expose a nice namespace
from malcolm.core import submodule_all
from .beamselectorpart import BeamSelectorPart
from .compoundmotorsinkportspart import (
AGroup,
APartName,
ARbv,
CompoundMotorSinkPortsPart,
)
from .cspart import AMri, CSPart
from .cssourceportspart import AGroup, APartName, ARbv, CSSou... |
n3wb13/OpenNfrGui-5.0-1 | refs/heads/master | lib/python/Components/Converter/Converter.py | 166 | from Components.Element import Element
class Converter(Element):
def __init__(self, arguments):
Element.__init__(self)
self.converter_arguments = arguments
def __repr__(self):
return str(type(self)) + "(" + self.converter_arguments + ")"
def handleCommand(self, cmd):
self.source.handleCommand(cmd)
|
kartikprabhu/manifold_note | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
# use requirements.txt for dependencies
with open('requirements.txt') as f:
required = map(lambda s: s.strip(), f.readlines())
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.r... |
Cinntax/home-assistant | refs/heads/dev | tests/components/command_line/__init__.py | 36 | """Tests for command_line component."""
|
ddico/sale-workflow | refs/heads/8.0 | sale_order_revision/model/sale_order.py | 3 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
# @author Lorenzo Battistini <lorenzo.battistini@agilebg.com>
# @author Raphaël Valyi <raphael.valyi@akretion.com> (ported to sale f... |
bhcopeland/ansible-modules-extras | refs/heads/devel | windows/win_file_version.py | 65 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Get DLL or EXE build version
# Copyright © 2015 Sam Liu <sam.liu@activenetwork.com>
# 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 versi... |
doganov/edx-platform | refs/heads/master | openedx/core/djangoapps/bookmarks/tests/test_tasks.py | 11 | """
Tests for tasks.
"""
import ddt
from xmodule.modulestore import ModuleStoreEnum
from xmodule.modulestore.tests.factories import check_mongo_calls
from ..models import XBlockCache
from ..tasks import _calculate_course_xblocks_data, _update_xblocks_cache
from .test_models import BookmarksTestsBase
@ddt.ddt
class ... |
Shrhawk/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/tests/specs/test_linkedin.py | 112 | """Integration tests for LinkedIn providers."""
from third_party_auth.tests.specs import base
class LinkedInOauth2IntegrationTest(base.Oauth2IntegrationTest):
"""Integration tests for provider.LinkedInOauth2."""
def setUp(self):
super(LinkedInOauth2IntegrationTest, self).setUp()
self.provide... |
sekikn/ambari | refs/heads/trunk | ambari-agent/src/test/python/resource_management/TestXmlConfigResource.py | 2 | #!/usr/bin/env python
"""
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")... |
Gerhut/django-http-file-storage | refs/heads/master | project/app/migrations/0002_auto_20150929_1428.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import project.storages
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='media',
... |
mnaberez/py65 | refs/heads/master | py65/tests/__init__.py | 35 | # this is a package
|
brandond/ansible | refs/heads/devel | contrib/inventory/openshift.py | 42 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.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 o... |
usingnamespace/usingnamespace | refs/heads/master | usingnamespace/management/views/management.py | 1 | import logging
log = logging.getLogger(__name__)
from pyramid.view import (
view_config,
view_defaults,
notfound_view_config,
)
from pyramid.config import not_
from pyramid.httpexceptions import HTTPForbidden
from pyramid.security import unauthenticated_userid, authenticated_userid
@vi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.