repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
oasiswork/odoo
refs/heads/8.0
addons/account_analytic_analysis/res_config.py
426
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
jhoon2816/KU-PL
refs/heads/master
qna/urls.py
1
from django.conf.urls import include from django.conf.urls import url from . import views urlpatterns = [ url(r'^$', views.question_list, name='question_list'), url(r'^qna/(?P<pk>[0-9]+)/$', views.question_detail, name='question_detail'), url(r'^(?P<pk>[0-9]+)/edit/$', views.question_edit, name='question_e...
guettli/django
refs/heads/master
tests/validation/test_custom_messages.py
519
from . import ValidationTestCase from .models import CustomMessagesModel class CustomMessagesTest(ValidationTestCase): def test_custom_simple_validator_message(self): cmm = CustomMessagesModel(number=12) self.assertFieldFailsValidationWithMessage(cmm.full_clean, 'number', ['AAARGH']) def test...
ForkedReposBak/mxnet
refs/heads/master
contrib/tvmop/basic/__init__.py
13
# 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...
KaelChen/numpy
refs/heads/master
numpy/polynomial/legendre.py
75
""" Legendre Series (:mod: `numpy.polynomial.legendre`) =================================================== .. currentmodule:: numpy.polynomial.polynomial This module provides a number of objects (mostly functions) useful for dealing with Legendre series, including a `Legendre` class that encapsulates the usual arith...
ucrawler/cp-uc
refs/heads/master
libs/xmpp/protocol.py
199
## protocol.py ## ## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov ## ## 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, or (at your option) ## any later versio...
windedge/odoo
refs/heads/8.0
addons/account/account_move_line.py
23
# -*- 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...
pwmarcz/django
refs/heads/master
django/utils/regex_helper.py
94
""" Functions for reversing a regular expression (used in reverse URL resolving). Used internally by Django and not intended for external use. This is not, and is not intended to be, a complete reg-exp decompiler. It should be good enough for a large class of URLS, however. """ from __future__ import unicode_literals ...
lsqtongxin/django
refs/heads/master
django/contrib/sessions/backends/base.py
298
from __future__ import unicode_literals import base64 import logging import string from datetime import datetime, timedelta from django.conf import settings from django.contrib.sessions.exceptions import SuspiciousSession from django.core.exceptions import SuspiciousOperation from django.utils import timezone from dj...
openqt/algorithms
refs/heads/master
projecteuler/pe364-comfortable-distance.py
1
#!/usr/bin/env python # coding=utf-8 """364. Comfortable distance https://projecteuler.net/problem=364 There are N seats in a row. N people come after each other to fill the seats according to the following rules: 1. If there is any seat whose adjacent seat(s) are not occupied take such a seat. 2. If there is no...
juananpe/django
refs/heads/master
hello/wsgi.py
2
""" WSGI config for hello project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "hello.settings") from django.core.wsgi ...
ruuk/script.bluray.com
refs/heads/master
lib/unidecode/x085.py
252
data = ( 'Bu ', # 0x00 'Zhang ', # 0x01 'Luo ', # 0x02 'Jiang ', # 0x03 'Man ', # 0x04 'Yan ', # 0x05 'Ling ', # 0x06 'Ji ', # 0x07 'Piao ', # 0x08 'Gun ', # 0x09 'Han ', # 0x0a 'Di ', # 0x0b 'Su ', # 0x0c 'Lu ', # 0x0d 'She ', # 0x0e 'Shang ', # 0x0f 'Di ', # 0x10 'Mi...
markflorisson/pystaging
refs/heads/master
pystaging/tests/test_quotation.py
1
import unittest from pystaging import * @staging def make_expr(c): return quote[a + b * escape[c]] @staging(hygiene=True) def make_stmt(c): with quote as body: result = a + b * escape[c] return body @staging def square(x): return quote[escape[x] * escape[x]] @staging def splice_expr(x): ...
barma1309/Kalista
refs/heads/master
.virtualenvs/Kalista/lib/python3.4/site-packages/django/contrib/admin/options.py
26
import copy import operator from collections import OrderedDict from functools import partial, reduce, update_wrapper from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import helpers, widgets from django.contrib.admin.checks import ( BaseModelAd...
tushar7795/MicroBlog
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/lockfile/symlinklockfile.py
487
from __future__ import absolute_import import time import os from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout, AlreadyLocked) class SymlinkLockFile(LockBase): """Lock access to a file using symlink(2).""" def __init__(self, path, threaded=True, timeout=None): # s...
styxit/CouchPotatoServer
refs/heads/master
libs/html5lib/treewalkers/__init__.py
1229
"""A collection of modules for iterating through different kinds of tree, generating tokens identical to those produced by the tokenizer module. To create a tree walker for a new type of tree, you need to do implement a tree walker object (called TreeWalker by convention) that implements a 'serialize' method taking a ...
TomBaxter/waterbutler
refs/heads/develop
waterbutler/tasks/settings.py
2
import os from pkg_resources import iter_entry_points from kombu import Queue, Exchange from waterbutler import settings config = settings.child('TASKS_CONFIG') BROKER_URL = config.get( 'BROKER_URL', 'amqp://{}:{}//'.format( os.environ.get('RABBITMQ_PORT_5672_TCP_ADDR', ''), os.environ.get(...
MindCookin/python-exercises
refs/heads/master
chapter01/basicMathAlgorythms.py
1
#!/usr/bin/env python def main(): state = input(""" What would you lke todo: (1) Calculate sum, subs and mult of two numbers (2) Calculate multiplication table of a given number (3) Calculate factorial of an integer """) switcher = { 1: calcSumSubsMult, 2: calcMultTable, 3: calcFactorial } ...
caslei/TfModels
refs/heads/master
slim/nets/nets_factory_test.py
37
# Copyright 2016 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 agree...
ansible/ansible-modules-extras
refs/heads/devel
cloud/cloudstack/cs_zone_facts.py
48
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # 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 Lice...
sposs/DIRAC
refs/heads/integration
FrameworkSystem/private/monitoring/PlotCache.py
3
# $HeadURL$ __RCSID__ = "$Id$" import os import os.path try: import hashlib as md5 except: import md5 import time import threading from DIRAC import S_OK, S_ERROR, gLogger from DIRAC.Core.Utilities.ThreadSafe import Synchronizer from DIRAC.FrameworkSystem.private.monitoring.RRDManager import RRDManager from DIRAC...
mishbahr/django-connected
refs/heads/master
connected_accounts/providers/mailchimp.py
1
import json import logging from django.utils.translation import ugettext_lazy as _ from requests.exceptions import RequestException from connected_accounts.conf import settings from connected_accounts.provider_pool import providers from .base import OAuth2Provider, ProviderAccount logger = logging.getLogger('connec...
kaiserroll14/301finalproject
refs/heads/master
main/win/main/requests/packages/urllib3/util/retry.py
66
import time import logging from ..exceptions import ( ConnectTimeoutError, MaxRetryError, ProtocolError, ReadTimeoutError, ResponseError, ) from ..packages import six log = logging.getLogger(__name__) class Retry(object): """ Retry configuration. Each retry attempt will create a new Re...
kernelmode/kaggle-titanic
refs/heads/master
examples/myfirstforest.py
26
""" Writing my first randomforest code. Author : AstroDave Date : 23rd September 2012 Revised: 15 April 2014 please see packages.python.org/milk/randomforests.html for more """ import pandas as pd import numpy as np import csv as csv from sklearn.ensemble import RandomForestClassifier # Data cleanup # TRAIN DATA tra...
jounex/hue
refs/heads/master
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Random/OSRNG/test_generic.py
131
# -*- coding: utf-8 -*- # # SelfTest/Util/test_generic.py: Self-test for the OSRNG.new() 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...
cristianquaglio/odoo
refs/heads/master
addons/resource/resource.py
25
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP SA (http://www.openerp.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
silvansky/pjsip_mod
refs/heads/master
tests/pjsua/scripts-pesq/200_codec_speex_8000.py
3
# $Id: 200_codec_speex_8000.py 3286 2010-08-18 14:30:15Z bennylp $ # from inc_cfg import * ADD_PARAM = "" if (HAS_SND_DEV == 0): ADD_PARAM += "--null-audio" # Call with Speex/8000 codec test_param = TestParam( "PESQ codec Speex NB", [ InstanceParam("UA1", ADD_PARAM + " --max-calls=1 --add-codec ...
thomasgurry/amplicon_sequencing_pipeline
refs/heads/master
scripts/PipelineFilesInterface.py
1
""" Helper functions to move files around. """ import os from string import ascii_lowercase def split_file_and_return_names(raw_data_file): """ Splits an input raw data file into files of different line lengths. Returns the created files. """ rawfilesize = os.path.getsize(raw_data_file) # ...
AaronRanAn/Metrics
refs/heads/master
Python/ml_metrics/custom/kdd_average_precision.py
8
import numpy as np def kdd_apk(actual, predicted, k=10): """ Computes the average precision at k for Track 1 of the 2012 KDD Cup. This modified version uses the number of actual clicks as the denominator, regardless of k. This function computes the average prescision at k between two lists of ...
divio/django
refs/heads/master
django/template/loaders/app_directories.py
635
""" Wrapper for loading templates from "templates" directories in INSTALLED_APPS packages. """ from django.template.utils import get_app_template_dirs from .filesystem import Loader as FilesystemLoader class Loader(FilesystemLoader): def get_dirs(self): return get_app_template_dirs('templates')
kawamon/hue
refs/heads/master
apps/sqoop/src/sqoop/api/job.py
2
#!/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...
gsnedders/presto-testo
refs/heads/master
wpt/websockets/websock_handlers/timeout_wsh.py
4
#!/usr/bin/python from mod_pywebsocket import msgutil import time def web_socket_do_extra_handshake(request): time.sleep(22) def web_socket_transfer_data(request): pass
haiiiiiyun/scrapy
refs/heads/master
scrapy/stats.py
159
""" Obsolete module, kept for giving a meaningful error message when trying to import. """ raise ImportError("scrapy.stats usage has become obsolete, use " "`crawler.stats` attribute instead")
Kalyzee/edx-platform
refs/heads/master
lms/djangoapps/lms_xblock/mixin.py
37
""" Namespace that defines fields common to all blocks used in the LMS """ from lazy import lazy from xblock.fields import Boolean, Scope, String, XBlockMixin, Dict from xblock.validation import ValidationMessage from xmodule.modulestore.inheritance import UserPartitionList from xmodule.partitions.partitions import No...
ryfeus/lambda-packs
refs/heads/master
Tensorflow_LightGBM_Scipy_nightly/source/scipy/_lib/_gcutils.py
25
""" Module for testing automatic garbage collection of objects .. autosummary:: :toctree: generated/ set_gc_state - enable or disable garbage collection gc_state - context manager for given state of garbage collector assert_deallocated - context manager to check for circular references on object """ impo...
sbx320/mtasa-blue-old
refs/heads/master
vendor/google-breakpad/src/tools/gyp/test/mac/gyptest-rebuild.py
299
#!/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 app bundles are rebuilt correctly. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.TestGyp(...
sairajat/dealii
refs/heads/master
examples/step-55/reference.py
20
from sympy import * from sympy.printing import print_ccode from sympy.physics.vector import ReferenceFrame, gradient, divergence from sympy.vector import CoordSysCartesian R = ReferenceFrame('R'); x = R[0]; y = R[1]; a=-0.5; b=1.5; visc=1e-1; lambda_=(1/(2*visc)-sqrt(1/(4*visc**2)+4*pi**2)); print(" visc=%f" % visc) ...
eduNEXT/edunext-platform
refs/heads/master
cms/djangoapps/contentstore/views/session_kv_store.py
4
""" An :class:`~xblock.runtime.KeyValueStore` that stores data in the django session """ from xblock.runtime import KeyValueStore def stringify(key): return repr(tuple(key)) class SessionKeyValueStore(KeyValueStore): def __init__(self, request): self._session = request.session def get(self, k...
pavelchristof/gomoku-ai
refs/heads/master
tensorflow/python/ops/distributions/dirichlet_multinomial.py
39
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
ptitjano/bokeh
refs/heads/master
examples/models/sprint.py
4
from __future__ import print_function from bokeh.document import Document from bokeh.embed import file_html from bokeh.util.browser import view from bokeh.resources import INLINE from bokeh.models.glyphs import Circle, Text from bokeh.models import ColumnDataSource, Range1d, DataRange1d, Plot, LinearAxis, SingleInterv...
santisiri/popego
refs/heads/master
envs/ALPHA-POPEGO/lib/python2.5/site-packages/twisted/lore/slides.py
3
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # """Rudimentary slide support for Lore. TODO: - Complete mgp output target - syntax highlighting - saner font handling - probably lots more - Add HTML output targets - one slides per page (with n...
adrienbrault/home-assistant
refs/heads/dev
homeassistant/components/zha/core/channels/closures.py
5
"""Closures channels module for Zigbee Home Automation.""" import zigpy.zcl.clusters.closures as closures from homeassistant.core import callback from .. import registries from ..const import REPORT_CONFIG_IMMEDIATE, SIGNAL_ATTR_UPDATED from .base import ClientChannel, ZigbeeChannel @registries.ZIGBEE_CHANNEL_REGIS...
GenericStudent/home-assistant
refs/heads/dev
homeassistant/components/vera/__init__.py
8
"""Support for Vera devices.""" import asyncio from collections import defaultdict import logging from typing import Any, Dict, Generic, List, Optional, Type, TypeVar import pyvera as veraApi from requests.exceptions import RequestException import voluptuous as vol from homeassistant import config_entries from homeas...
srluge/SickRage
refs/heads/master
lib/sqlalchemy/dialects/mysql/oursql.py
79
# mysql/oursql.py # Copyright (C) 2005-2014 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 """ .. dialect:: mysql+oursql :name: OurSQL :dbapi: oursql :connectstring...
GunoH/intellij-community
refs/heads/master
python/testData/inspections/PyRelativeImportInspection/PlainDirectoryDottedImportFromDotTwoElementsWithAs/plainDirectory/script.py
10
<weak_warning descr="Relative import outside of a package">from . import foo, bar as b</weak_warning>
thiagopena/djangoSIGE
refs/heads/master
djangosige/apps/compras/apps.py
1
from __future__ import unicode_literals from django.apps import AppConfig class ComprasConfig(AppConfig): name = 'compras'
BruceDai/web-testing-service
refs/heads/master
tools/pywebsocket/src/mod_pywebsocket/_stream_base.py
652
# Copyright 2011, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
ninowalker/mapnik-trunk
refs/heads/master
scons/scons-local-1.2.0/SCons/Tool/PharLapCommon.py
12
"""SCons.Tool.PharLapCommon This module contains common code used by all Tools for the Phar Lap ETS tool chain. Right now, this is linkloc and 386asm. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining #...
mlperf/training_results_v0.5
refs/heads/master
v0.5.0/google/cloud_v2.8/gnmt-tpuv2-8/code/gnmt/model/t2t/tensor2tensor/data_generators/wnli.py
3
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
bansalvarun/Drome
refs/heads/master
allauth/socialaccount/providers/openid/admin.py
76
from django.contrib import admin from .models import OpenIDStore, OpenIDNonce class OpenIDStoreAdmin(admin.ModelAdmin): pass class OpenIDNonceAdmin(admin.ModelAdmin): pass admin.site.register(OpenIDStore, OpenIDStoreAdmin) admin.site.register(OpenIDNonce, OpenIDNonceAdmin)
RPGOne/Skynet
refs/heads/Miho
node-master/deps/v8/tools/gen-inlining-tests.py
7
#!/usr/bin/env python3 # Copyright 2016 the V8 project authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from collections import namedtuple import textwrap import sys SHARD_FILENAME_TEMPLATE = "test/mjsunit/compiler/inline-exception-{...
EinsteinsWorkshop/BlocksCAD
refs/heads/development
blockly/i18n/js_to_json.py
177
#!/usr/bin/python # Gives the translation status of the specified apps and languages. # # Copyright 2013 Google Inc. # https://developers.google.com/blockly/ # # 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...
SangDeukLee/futsal
refs/heads/develop
public/assets/node_js/node_modules/npm/node_modules/node-gyp/gyp/tools/pretty_sln.py
1831
#!/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. """Prints the information in a sln file in a diffable way. It first outputs each projects in alphabetical order with their dependenci...
marhar/cx_OracleTools
refs/heads/master
cx_PyOracleLib/cx_ImportData.py
1
"""Defines class for importing data from an export file.""" import cPickle import cx_Logging import cx_Oracle import os import sys class Importer: """Handles importing data from the file.""" def __init__(self, connection): self.connection = connection self.cursor = connection.cursor() ...
Onirik79/aaritmud
refs/heads/master
data/proto_mobs/accademia-drago/accademia-drago_mob_ragazza.py
1
# -*- coding: utf-8 -*- #= IMPORT ====================================================================== import random from src.log import log from src.database import database from src.enums import TO, RACE, FLAG, ENTITYPE from src.commands.command_say import command_say from src.commands.command_eat impor...
farragar/game-engine
refs/heads/master
src/engine.py
1
import copy import sys import pickle import writer from player import Player """ Simple engine for text-based adventure games laurie@farragar.com Big TODOs: Implement items, stats & transition dependencies Improve IO - print and raw_input doesn't cut it. Improve state key/transiti...
Stavitsky/nova
refs/heads/master
nova/tests/unit/fake_server_actions.py
97
# Copyright 2013 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 l...
acsone/stock-logistics-workflow
refs/heads/8.0
procurement_jit_assign_move/__init__.py
8
# -*- coding: utf-8 -*- # © 2015 Alexandre Fayolle <alexandre.fayolle@camptocamp.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from . import models
mgamer/gyp
refs/heads/master
test/generator-output/gyptest-rules.py
198
#!/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 --generator-output= behavior when using rules. """ import TestGyp # Android doesn't support --generator-output. test = TestGy...
kalahbrown/HueBigSQL
refs/heads/master
desktop/core/ext-py/Django-1.6.10/tests/string_lookup/models.py
113
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Foo(models.Model): name = models.CharField(max_length=50) friend = models.CharField(max_length=50, blank=True) def...
dennis-sheil/commandergenius
refs/heads/sdl_android
project/jni/python/src/Lib/plat-irix6/GET.py
132
# Symbols from <gl/get.h> from warnings import warnpy3k warnpy3k("the GET module has been removed in Python 3.0", stacklevel=2) del warnpy3k BCKBUFFER = 0x1 FRNTBUFFER = 0x2 DRAWZBUFFER = 0x4 DMRGB = 0 DMSINGLE = 1 DMDOUBLE = 2 DMRGBDOUBLE = 5 HZ30 = 0 HZ60 = 1 NTSC = 2 HDTV = 3 VGA = 4 IRIS3K = 5 PR60 = 6 PAL = 9 HZ3...
zombi-x/android_kernel_lge_mako
refs/heads/mm6.0
tools/perf/util/setup.py
4998
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
UCNA/main
refs/heads/master
Scripts/CombineCorrelated.py
1
#!/usr/bin/python # implementation of eLog 396 correlated error combination formalism from math import * from numpy import zeros,matrix class MeasCombiner: def __init__(self): self.mu = [] self.err = [] self.corrs = {} def new_meas_mu(self,m): self.mu.append(m) self.err.append([]) return len(self.m...
ColOfAbRiX/ansible
refs/heads/devel
test/sanity/validate-modules/test_validate_modules_regex.py
19
#!/usr/bin/env python # This is a standalone test for the regex inside validate-modules # It is not suitable to add to the make tests target because the # file under test is outside the test's sys.path AND has a hyphen # in the name making it unimportable. # # To execute this by hand: # 1) cd <checkoutdir> # 2) so...
girlygiggle/girlygiggle
refs/heads/master
contrib/wallettools/walletunlock.py
782
from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:9332") pwd = raw_input("Enter wallet passphrase: ") access.walletpassphrase(pwd, 60)
TextusData/Mover
refs/heads/master
thirdparty/protobuf-2.4.1/gtest/test/gtest_xml_test_utils.py
306
#!/usr/bin/env python # # Copyright 2006, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
projectjamjar/masonjar
refs/heads/master
jamjar/jamjar/videos/migrations/0006_video_concert.py
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('concerts', '0001_initial'), ('videos', '0005_auto_20160118_0340'), ] operations = [ migrations.AddField( ...
stacywsmith/ansible
refs/heads/devel
lib/ansible/plugins/lookup/etcd.py
36
# (c) 2013, Jan-Piet Mens <jpmens(at)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 License, or # (at your option) any later ver...
acsone/social
refs/heads/8.0
mail_follower_custom_notification/models/mail_notification.py
2
# -*- coding: utf-8 -*- # © 2015 Therp BV <http://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class MailNotification(models.Model): _inherit = 'mail.notification' @api.multi def get_partners_to_email(self, message): partner_ids = ...
thnee/ansible
refs/heads/devel
lib/ansible/modules/remote_management/manageiq/manageiq_alerts.py
11
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017 Red Hat 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', ...
tornadozou/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/argmax_op_test.py
56
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
stefanv/aandete
refs/heads/master
app/lib/pygments/scanner.py
31
# -*- coding: utf-8 -*- """ pygments.scanner ~~~~~~~~~~~~~~~~ This library implements a regex based scanner. Some languages like Pascal are easy to parse but have some keywords that depend on the context. Because of this it's impossible to lex that just by using a regular expression lexer like ...
mglukhikh/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/core/files/utils.py
901
class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(la...
ospaceteam/outerspace
refs/heads/master
server/lib/pyasn1/codec/der/decoder.py
37
# DER decoder from pyasn1.type import univ from pyasn1.codec.cer import decoder decode = decoder.Decoder(decoder.tagMap, decoder.typeMap)
rgom/Pydev
refs/heads/development
plugins/org.python.pydev.jython/Lib/xml/etree/ElementTree.py
22
# # ElementTree # $Id: ElementTree.py 3440 2008-07-18 14:45:01Z fredrik $ # # light-weight XML support for Python 2.3 and later. # # history (since 1.2.6): # 2005-11-12 fl added tostringlist/fromstringlist helpers # 2006-07-05 fl merged in selected changes from the 1.3 sandbox # 2006-07-05 fl removed support for ...
axthorpe/cs3240-labdemo
refs/heads/master
helper.py
2
def greeting (msg): print(msg)
hunch/hunch-gift-app
refs/heads/master
django/db/backends/mysql/creation.py
12
from django.db.backends.creation import BaseDatabaseCreation class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated MySQL column # types, as strings. Column-type strings can contain format strings; they'll # be interpolated against the values of Field.__...
shiquanwang/pylearn2
refs/heads/master
pylearn2/utils/mnist_ubyte.py
5
""" Low-level utilities for reading in raw MNIST files. """ __author__ = "David Warde-Farley" __copyright__ = "Copyright 2012, Universite de Montreal" __credits__ = ["David Warde-Farley"] __license__ = "3-clause BSD" __email__ = "wardefar@iro" __maintainer__ = "David Warde-Farley" import struct import numpy MNIST_I...
xkortex/SigFlux
refs/heads/master
sigflux/wave/custom_cwt.py
1
import numpy as np from scipy import signal from scipy.signal import convolve, fftconvolve def cwt(data, wavelet, widths): """ Continuous wavelet transform. Performs a continuous wavelet transform on `data`, using the `wavelet` function. A CWT performs a convolution with `data` using the `wavelet...
tmpgit/intellij-community
refs/heads/master
python/testData/MockSdk3.2/python_stubs/sys.py
100
# encoding: utf-8 # module sys # from (built-in) # by generator 1.135 """ This module provides access to some objects used or maintained by the interpreter and to functions that interact strongly with the interpreter. Dynamic objects: argv -- command line arguments; argv[0] is the script pathname if known path -- mod...
pymedusa/SickRage
refs/heads/master
ext/github/Team.py
2
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
awkspace/ansible
refs/heads/devel
lib/ansible/modules/network/system/net_system.py
26
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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', ...
QingChenmsft/azure-cli
refs/heads/master
src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/_client_factory.py
3
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
sysalexis/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/double_const.py
203
from test.support import TestFailed # A test for SF bug 422177: manifest float constants varied way too much in # precision depending on whether Python was loading a module for the first # time, or reloading it from a precompiled .pyc. The "expected" failure # mode is that when test_import imports this after all .py...
publicRoman/spark
refs/heads/branch-2.2-kubernetes
python/pyspark/sql/group.py
60
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
vasyarv/edx-ora2
refs/heads/master
openassessment/xblock/xml.py
5
""" Serialize and deserialize OpenAssessment XBlock content to/from XML. """ from uuid import uuid4 as uuid import lxml.etree as etree import pytz import dateutil.parser import defusedxml.ElementTree as safe_etree from data_conversion import update_assessments_format from defaults import DEFAULT_RUBRIC_FEEDBACK_TEXT ...
grundprinzip/Impala
refs/heads/cdh5-trunk
tests/comparison/data_generator.py
5
#!/usr/bin/env python # Copyright (c) 2014 Cloudera, 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 requi...
vidartf/hyperspy
refs/heads/master
hyperspy/io_plugins/blockfile.py
1
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
rhelmer/socorro-lib
refs/heads/master
alembic/versions/36abe253f8b3_fixes_902142_partiti.py
16
"""Fixes 902142 partition matviews Revision ID: 36abe253f8b3 Revises: 2645cb324bf4 Create Date: 2013-08-07 10:17:05.769404 """ # revision identifiers, used by Alembic. revision = '36abe253f8b3' down_revision = '2645cb324bf4' import os import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import po...
Manishearth/servo
refs/heads/master
tests/wpt/css-tests/tools/serve/serve.py
215
# -*- coding: utf-8 -*- import argparse import json import os import signal import socket import sys import threading import time import traceback import urllib2 import uuid from collections import defaultdict, OrderedDict from multiprocessing import Process, Event from .. import localpaths import sslutils from wptse...
sabi0/intellij-community
refs/heads/master
python/testData/copyPaste/Indent2.src.py
332
class C: def foo(self): <selection>x = 1 y = 2</selection>
catmium/PyLexTo
refs/heads/master
setup.py
1
from setuptools import setup setup( name='PyLexTo', version='0.1.2', description='LongLexTo with Python wrapper', url='https://github.com/catmium/PyLexTo', author='catmium', packages=['PyLexTo'], install_requires=['JPype1==0.6.2'], license='GPL-3.0', author_email='hello@jets.im', ...
perimosocordiae/scipy
refs/heads/master
scipy/linalg/tests/test_solve_toeplitz.py
21
"""Test functions for linalg._solve_toeplitz module """ import numpy as np from scipy.linalg._solve_toeplitz import levinson from scipy.linalg import solve, toeplitz, solve_toeplitz from numpy.testing import assert_equal, assert_allclose import pytest from pytest import raises as assert_raises def test_solve_equival...
njwilson23/scipy
refs/heads/master
scipy/stats/tests/test_continuous_basic.py
16
from __future__ import division, print_function, absolute_import import warnings import numpy as np import numpy.testing as npt from scipy import integrate from scipy import stats from scipy.special import betainc from common_tests import (check_normalization, check_moment, check_mean_expect, check_var_expec...
stackforge/yaql
refs/heads/master
yaql/standard_library/common.py
2
# Copyright (c) 2015 Mirantis, 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...
CHT5/program-y
refs/heads/master
src/programy/parser/template/nodes/lowercase.py
3
""" Copyright (c) 2016 Keith Sterling 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, merge, publish, distribute,...
kingctan/Misago
refs/heads/master
misago/threads/tests/test_floodprotection_middleware.py
8
from datetime import timedelta from django.utils import timezone from misago.users.testutils import AuthenticatedUserTestCase from misago.threads.posting import PostingInterrupt from misago.threads.posting.floodprotection import (MIN_POSTING_PAUSE, FloodProtectionM...
yatinkumbhare/openstack-nova
refs/heads/master
nova/virt/hyperv/networkutilsv2.py
85
# Copyright 2013 Cloudbase Solutions Srl # 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 r...
Jarn/jarn.mkrelease
refs/heads/master
jarn/mkrelease/testing.py
1
import sys import os import unittest import tempfile import shutil import zipfile import functools if sys.version_info[0] >= 3: from io import StringIO else: from StringIO import StringIO from os.path import realpath, join, dirname, isdir from lazy import lazy from jarn.mkrelease.process import Process from ...
ehashman/oh-mainline
refs/heads/master
vendor/packages/Django/django/contrib/gis/tests/geoapp/sitemaps.py
308
from __future__ import absolute_import from django.contrib.gis.sitemaps import GeoRSSSitemap, KMLSitemap, KMZSitemap from .feeds import feed_dict from .models import City, Country sitemaps = {'kml' : KMLSitemap([City, Country]), 'kmz' : KMZSitemap([City, Country]), 'georss' : GeoRSSSitemap(f...