repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
neutrons/FastGR
refs/heads/master
addie/processing/mantid/master_table/utilities.py
1
from __future__ import (absolute_import, division, print_function) from xml.dom import minidom import numpy as np class Utilities: """ Utilities related to work in master table """ def __init__(self, parent=None): self.parent = parent self.table_ui = parent.processing_ui.h3_table def get...
StefanRijnhart/OpenUpgrade
refs/heads/master
addons/web_kanban_gauge/__openerp__.py
428
{ 'name': 'Gauge Widget for Kanban', 'category': 'Hidden', 'description': """ This widget allows to display gauges using justgage library. """, 'version': '1.0', 'depends': ['web_kanban'], 'data' : [ 'views/web_kanban_gauge.xml', ], 'qweb': [ ], 'auto_install': True, }
yuanagain/seniorthesis
refs/heads/master
src/experiment_intervalsim.py
1
""" experiment_intervalsim.py Interval simulation, as in first part of Zgliczynski paper Author: Yuan Wang """ from thesis_utils import * from thesis_defaults import * from thesis_poincare_utils import * from thesis_plot_utils import * import scipy.integrate as integrate import scipy.special as special from scipy.int...
ssteo/scrapy
refs/heads/master
scrapy/core/__init__.py
216
""" Scrapy core library classes and functions. """
Vulcanior/GSB_Symfony
refs/heads/master
vendor/doctrine/orm/docs/en/conf.py
2448
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # 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. ...
jmartinezchaine/OpenERP
refs/heads/master
openerp/addons/crm_profiling/__openerp__.py
9
# -*- 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...
espadrine/opera
refs/heads/master
chromium/src/chrome/test/functional/infobars.py
60
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import re import pyauto_functional # Must be imported before pyauto import pyauto import test_utils class ...
mesosphere-mergebot/mergebot-test-dcos
refs/heads/master
gen/template.py
16
# Simple python templating system. Works on yaml files which are also jinja-style templates. # Scans the jinja for the structure, and outputs an AST of the possible option combinations. # That graph could be fed into something like an argument prompter to get # out all the arguments. # Simple state machine parser, har...
jlazic/GlogSMS
refs/heads/master
sms/management/__init__.py
1
__author__ = 'josip@lazic.info'
Bushstar/UFO-Project
refs/heads/master-0.17
test/functional/wallet_keypool.py
2
#!/usr/bin/env python3 # Copyright (c) 2014-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet keypool and interaction with wallet encryption/locking.""" import time from test_fram...
toshywoshy/ansible
refs/heads/devel
lib/ansible/modules/packaging/os/openbsd_pkg.py
79
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Patrik Lundin <patrik@sigterm.se> # # 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', ...
supertask/UnitX
refs/heads/master
src/scope.py
4
#!/usr/bin/env python # -*- coding:utf-8 -*- import sys from collegue import Collegue from constants import Constants class Scope(dict, Collegue): """A class saving instances of a UnitXObject class. This class is created by a ScopeList class, when a block statement appeared in a running point. And, ...
EmmanuelJohnson/ssquiz
refs/heads/master
flask/lib/python2.7/site-packages/werkzeug/testapp.py
294
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
linjoahow/w17g
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/xml/etree/cElementTree.py
876
# Deprecated alias for xml.etree.ElementTree from xml.etree.ElementTree import *
Plain-Andy-legacy/android_external_chromium_org
refs/heads/lp-5.1r1
tools/generate_shim_headers/generate_shim_headers.py
150
#!/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. """ Generates shim headers that mirror the directory structure of bundled headers, but just forward to the system ones. This allow...
wb14123/kubernetes
refs/heads/master
cluster/juju/charms/trusty/kubernetes-master/hooks/kubernetes_installer.py
213
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
KodingKlub/gHashCode
refs/heads/master
wojtek.py
1
import numpy as np import philipp as p import kordian as k import anna as a import parser import sys import itertools def print_combination(combination): used_caches = sorted([k for k,v in combination.items() if v[0]!=0]) print(len(used_caches)) for used_cache in used_caches: videos_str = " ".join(...
qPCR4vir/orange3
refs/heads/master
Orange/tests/test_clustering_hierarchical.py
1
# Test methods with long descriptive names can omit docstrings # pylint: disable=missing-docstring import unittest from itertools import chain, tee import numpy from Orange.clustering import hierarchical import Orange.misc def flatten(seq): return chain(*seq) class TestHierarchical(unittest.TestCase): @c...
credp/lisa
refs/heads/master
external/workload-automation/wa/workloads/templerun2/__init__.py
5
# Copyright 2013-2018 ARM Limited # # 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 w...
GoogleCloudPlatform/training-data-analyst
refs/heads/master
courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/azure-samples/kfp-azure-databricks/tests/test_workspaceitem_op.py
3
import unittest from pathlib import Path import kfp from kfp.dsl import PipelineParam from databricks import ImportWorkspaceItemOp, DeleteWorkspaceItemOp class TestImportWorkspaceItemOp(unittest.TestCase): def test_databricks_import_workspaceitem_without_k8s_or_item_name(self): def my_pipeline(): ...
xfstudio/electron
refs/heads/master
script/lib/util.py
149
#!/usr/bin/env python import atexit import contextlib import errno import platform import re import shutil import ssl import subprocess import sys import tarfile import tempfile import urllib2 import os import zipfile from config import is_verbose_mode def get_host_arch(): """Returns the host architecture with a ...
cfournie/segmentation.evaluation
refs/heads/master
segeval/util/lang.py
2
''' Python-language utils. .. moduleauthor:: Chris Fournier <chris.m.fournier@gmail.com> ''' def enum(*sequential, **named): ''' http://stackoverflow.com/a/1695250/2134 ''' enums = dict(zip(sequential, range(len(sequential))), **named) return type('Enum', (), enums)
drrk/micropython
refs/heads/master
tests/misc/recursive_iternext.py
3
# This tests that recursion with iternext doesn't lead to segfault. try: [0] * 10000 N = 1000 except: N = 100 try: x = (1, 2) for i in range(N): x = enumerate(x) tuple(x) except RuntimeError: print("RuntimeError") try: x = (1, 2) for i in range(N): x = filter(None,...
n0n0x/fabtools-python
refs/heads/master
fabtools/python_setuptools.py
2
""" Python packages =============== This module provides tools for installing Python packages using the ``easy_install`` command provided by `setuptools`_. .. _setuptools: http://pythonhosted.org/setuptools/ """ from fabric.api import cd, run from fabtools.utils import download, run_as_root # Python2 and 3 compat...
happy5214/pywikibot-core
refs/heads/master
tests/namespace_tests.py
5
# -*- coding: utf-8 -*- """Tests for the Namespace class.""" # # (C) Pywikibot team, 2014 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals from collections import Iterable from pywikibot.site import Namespace, NamespacesDict from pywikibot.tools import ( ...
1844144/django-blog-zinnia
refs/heads/deep
zinnia/tests/implementations/__init__.py
17
""" Implementation components at the project level needed for testing Zinnia. """
skg-net/ansible
refs/heads/devel
test/units/modules/network/netscaler/test_netscaler_module_utils.py
56
# Copyright (c) 2017 Citrix Systems # # 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. # # ...
abought/osf.io
refs/heads/develop
api/registrations/serializers.py
2
import json from modularodm.exceptions import ValidationValueError from rest_framework import serializers as ser from rest_framework import exceptions from api.base.utils import absolute_reverse, get_user_auth from website.project.metadata.utils import is_prereg_admin_not_project_admin from website.exceptions import...
eda-globetrotter/Calabria-Digital-Bio
refs/heads/master
reads-dna-seq/try_concepts.py
1
#!/usr/bin/python """ This Python script is written by Zhiyang Ong to try different concepts in Python. Synopsis: Try different concepts in Python. This script can be executed as follows: ./try_concepts.py [input arguments as necessary] Parameters: [input arguments]: ??? """ # The MIT License (MIT) # ...
jazkarta/edx-platform
refs/heads/master
lms/djangoapps/commerce/urls.py
57
""" Defines the URL routes for this app. """ from django.conf.urls import patterns, url from commerce import views urlpatterns = patterns( '', url(r'^checkout/cancel/$', views.checkout_cancel, name='checkout_cancel'), url(r'^checkout/receipt/$', views.checkout_receipt, name='checkout_receipt'), )
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/mobile/shared_dressed_binayre_goon_bith_female_01.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Creature() result.template = "object/mobile/shared_dressed_binayre_goon_bith_female_01.iff" result.attribute_temp...
pigshell/nhnick
refs/heads/vnc-websocket
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/upload.py
121
# Copyright (c) 2009, 2010 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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 th...
antcheck/antcoin
refs/heads/master
share/seeds/generate-seeds.py
1
#!/usr/bin/python # Copyright (c) 2014 Wladmir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory that...
mouadino/scrapy
refs/heads/master
docs/_ext/scrapydocs.py
2
from docutils.parsers.rst.roles import set_classes from docutils import nodes def setup(app): app.add_crossref_type( directivename = "setting", rolename = "setting", indextemplate = "pair: %s; setting", ) app.add_crossref_type( directivename = "signal", rolename...
mixman/djangodev
refs/heads/master
tests/regressiontests/decorators/tests.py
1
import warnings from functools import wraps from django.contrib.admin.views.decorators import staff_member_required from django.contrib.auth.decorators import login_required, permission_required, user_passes_test from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed from django.middleware.clickjack...
idem2lyon/persomov
refs/heads/master
libs/rsa/__init__.py
111
# -*- coding: utf-8 -*- # # Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu> # # 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 # # Unl...
loco-odoo/localizacion_co
refs/heads/master
openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/stock_account_track/__openerp__.py
3
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014 Interconsulting S.A e Innovatecsa SAS. # (<http://www.interconsulting.com.co). # # This program is free software: you can redistribute it...
davidharvey1986/pyRRG
refs/heads/master
src/calc_shear.py
1
import numpy as np from astropy.io import fits import ipdb as pdb def calc_shear( corrected_moments, outfile, min_rad=6, mult=2, size_cut=[0., 100.], mag_cut=[22.5, 30], signal_noise_cut=3., rhodes_factor=0.86, dataDir='./...
AlexanderVangelov/pjsip
refs/heads/master
tests/pjsua/scripts-sipp/uas-auth.py
2
# $Id: uas-auth.py 4188 2012-06-29 09:01:17Z nanang $ # import inc_const as const PJSUA = ["--null-audio --max-calls=1 --id=sip:a@localhost --username=a --realm=* --registrar=$SIPP_URI"] PJSUA_EXPECTS = []
shaggythesheep/OctoPrint
refs/heads/master
src/octoprint/plugins/discovery/__init__.py
37
# coding=utf-8 from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" """ The SSDP/UPNP implementa...
crazcalm/chat-server
refs/heads/master
features/steps/server_commands.py
1
import socket import time from subprocess import Popen, PIPE @given(u'I came connected to the chat server as person1') def step_impl(context): context.chat_server = Popen(["python", "server.py"], stdout=PIPE) # Give the server time to start time.sleep(3) context.person1 = socket.create_connection(('lo...
huanchenz/STX-h-store
refs/heads/master
third_party/python/boto/s3/connection.py
11
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # 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 res...
billyhunt/osf.io
refs/heads/develop
website/addons/s3/views/config.py
13
import httplib from flask import request from framework.exceptions import HTTPError from framework.auth.decorators import must_be_logged_in from website.addons.s3 import utils from website.project.decorators import must_have_addon from website.project.decorators import must_have_permission from website.project.decor...
cosenal/waterbutler
refs/heads/develop
waterbutler/providers/box/settings.py
7
try: from waterbutler import settings except ImportError: settings = {} config = settings.get('BOX_PROVIDER_CONFIG', {}) BASE_URL = config.get('BASE_URL', 'https://api.box.com/2.0') BASE_UPLOAD_URL = config.get('BASE_CONTENT_URL', 'https://upload.box.com/api/2.0')
mikeseven/pyvision
refs/heads/master
src/pyvision/face/PCA.py
3
# PyVision License # # Copyright (c) 2006-2008 David S. Bolme # 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. Redistributions of source code must retain the above copyright # notice, thi...
Livit/Livit.Learn.EdX
refs/heads/labster/develop
common/test/acceptance/pages/lms/login.py
205
""" Login page for the LMS. """ from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from . import BASE_URL from .dashboard import DashboardPage class LoginPage(PageObject): """ Login page for the LMS. """ url = BASE_URL + "/login" def is_browser_on_page(self): ...
campbe13/openhatch
refs/heads/master
vendor/packages/Django/tests/regressiontests/generic_views/models.py
111
from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Artist(models.Model): name = models.CharField(max_length=100) class Meta: ordering = ['name'] verbose_name = 'professional...
flyfei/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/fileinput.py
46
"""Helper class to quickly write a loop over all standard input files. Typical use is: import fileinput for line in fileinput.input(): process(line) This iterates over the lines of all files listed in sys.argv[1:], defaulting to sys.stdin if the list is empty. If a filename is '-' it is also replace...
dav1x/ansible
refs/heads/devel
test/units/modules/network/iosxr/iosxr_module.py
58
# (c) 2016 Red Hat Inc. # # 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 dis...
berendkleinhaneveld/VTK
refs/heads/master
Imaging/Core/Testing/Python/TestSimpleImageExample.py
20
#!/usr/bin/env python import vtk from vtk.test import Testing from vtk.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkGetDataRoot() # Image pipeline reader = vtk.vtkPNGReader() reader.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/fullhead15.png") gradient = vtk.vtkSimpleImageFilterExample() gradient.SetInputConnect...
mitchrule/Miscellaneous
refs/heads/master
Django_Project/django/Lib/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py
1730
from __future__ import absolute_import, division, unicode_literals from genshi.core import QName from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT from . import _base from ..constants import voidElements, namespaces class ...
sparkslabs/kamaelia_
refs/heads/master
Code/Python/Kamaelia/Kamaelia/Util/Tokenisation/Simple.py
3
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License...
n0trax/ansible
refs/heads/devel
lib/ansible/modules/web_infrastructure/jboss.py
72
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Jeroen Hoekx <jeroen.hoekx@dsquare.be> # 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...
yagoocarvalho/ProjetoX9
refs/heads/master
projetox9/api.py
1
from .models import Models from projetox9 import Config from urllib.request import urlopen from urllib.error import HTTPError, URLError import json class Api: models = Models() def get_occurrences(self): pass def get_occurrence(self, CPF, protocol): return Models.Occurrence(Models.User(CP...
valexandersaulys/prudential_insurance_kaggle
refs/heads/master
venv/lib/python2.7/site-packages/sklearn/preprocessing/imputation.py
208
# Authors: Nicolas Tresegnie <nicolas.tresegnie@gmail.com> # License: BSD 3 clause import warnings import numpy as np import numpy.ma as ma from scipy import sparse from scipy import stats from ..base import BaseEstimator, TransformerMixin from ..utils import check_array from ..utils import as_float_array from ..uti...
mirzawaqasahmed/avocado-virt-tests
refs/heads/master
qemu/migration/migration.py
1
#!/usr/bin/python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it w...
odin-detector/odin-data
refs/heads/master
tools/python/odin_data/testing/test_shared_buffer_manager.py
2
from odin_data.shared_buffer_manager import SharedBufferManager, SharedBufferManagerException from nose.tools import assert_equal, assert_raises, assert_regexp_matches from struct import Struct shared_mem_name = "TestSharedBuffer" buffer_size = 1000 num_buffers = 10 shared_mem_size = buffer_size * num_buffers ...
weinitom/robot
refs/heads/master
attention_tracker/dlib-18.16/python_examples/correlation_tracker.py
1
#!/usr/bin/python # The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt # # This example shows how to use the correlation_tracker from the dlib Python # library. This object lets you track the position of an object as it moves # from frame to frame in a video sequence. To use it, ...
excelsimon/AI
refs/heads/master
NLP/5-DL-NLP/Char_RNN.py
1
# coding: utf-8 # # LSTM 文本生成 字符级别 import numpy from keras.models import Sequential from keras.layers import Dense from keras.layers import Dropout from keras.layers import LSTM from keras.callbacks import ModelCheckpoint from keras.utils import np_utils import codecs raw_text = codecs.open('Winston_Churchil.txt','r',...
aclindsa/asink-python
refs/heads/master
src/server/handlers.py
1
# Copyright (C) 2011 Aaron Lindsay <aaron@aclindsay.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 version 2 of the License, or # (at your option) any later version...
leoliujie/odoo
refs/heads/8.0
addons/website_crm/__openerp__.py
321
{ 'name': 'Contact Form', 'category': 'Website', 'website': 'https://www.odoo.com/page/website-builder', 'summary': 'Create Leads From Contact Form', 'version': '1.0', 'description': """ OpenERP Contact Form ==================== """, 'author': 'OpenERP SA', 'depends': ['website_...
nthien/docker-registry
refs/heads/master
tests/lib/index/test_db.py
35
import unittest import mock from docker_registry.lib.index import db class TestVersion(unittest.TestCase): def setUp(self): self.version = db.Version() def test_repr(self): self.assertEqual(type(repr(self.version)), str) class TestRepository(unittest.TestCase): def setUp(self): ...
bstell/TachyFont
refs/heads/master
run_time/src/gae_server/third_party/fonttools/Lib/fontTools/pens/cocoaPen.py
14
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * from fontTools.pens.basePen import BasePen __all__ = ["CocoaPen"] class CocoaPen(BasePen): def __init__(self, glyphSet, path=None): BasePen.__init__(self, glyphSet) if path is None: from AppKit import NSBezie...
mudithkr/zamboni
refs/heads/master
mkt/feed/models.py
7
""" The feed is an assembly of items of different content types. For ease of querying, each different content type is housed in the FeedItem model, which also houses metadata indicating the conditions under which it should be included. So a feed is actually just a listing of FeedItem instances that match the user's reg...
Outernet-Project/librarian
refs/heads/master
librarian/core/contrib/sessions/migrations/sessions/01_01_add_sessions_table.py
2
SQL = """ create table sessions ( session_id varchar primary key, -- session id data varchar, -- arbitary session data expires timestamptz not null -- timestamp when session expires ); """ def up(db, conf): db.executescript(SQL)
tsteward/the-blue-alliance
refs/heads/master
database/database_query.py
4
import datetime from google.appengine.api import memcache from google.appengine.ext import ndb import logging from models.cached_query_result import CachedQueryResult import random import tba_config MEMCACHE_CLIENT = memcache.Client() class DatabaseQuery(object): DATABASE_QUERY_VERSION = 2 DATABASE_HITS_MEM...
engla/kupfer
refs/heads/master
waflib/Scripting.py
5
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2010 (ita) "Module called for configuring, compiling and installing targets" import os, shutil, traceback, errno, sys, stat from waflib import Utils, Configure, Logs, Options, ConfigSet, Context, Errors, Build, Node build_dir_override = None no_climb_comma...
joone/chromium-crosswalk
refs/heads/2016.04.css-round-display-edtior-draft-1
tools/python/google/process_utils.py
186
# Copyright (c) 2006-2008 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. """Shared process-related utility functions.""" import errno import os import subprocess import sys class CommandNotFound(Exception): pass TASKKI...
sharaf84/digi
refs/heads/dev
shared/themes/frontend/node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/xcode.py
526
# 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. import filecmp import gyp.common import gyp.xcodeproj_file import errno import os import sys import posixpath import re import shutil import subprocess import temp...
pulinagrawal/nupic
refs/heads/master
examples/opf/experiments/classification/scalar_TP_0/description.py
2
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
ardekantur/pyglet
refs/heads/master
contrib/layout/layout/Plex/Transitions.py
30
# # Plex - Transition Maps # # This version represents state sets direcly as dicts # for speed. # from copy import copy import string from sys import maxint from types import TupleType class TransitionMap: """ A TransitionMap maps an input event to a set of states. An input event is one of: a range of cha...
savoirfairelinux/connector-interfaces
refs/heads/8.0
test_base_import_async/__openerp__.py
2
# -*- coding: utf-8 -*- ############################################################################### # # Module for OpenERP # Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu). # @author Stéphane Bidoul <stephane.bidoul@acsone.eu> # # This program is free software: you can redistribute it and/or modify # ...
Gitlab11/odoo
refs/heads/8.0
addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py
292
########################################################################## # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gener...
bratsche/Neutron-Drive
refs/heads/master
google_appengine/lib/django_1_3/django/contrib/sitemaps/models.py
914
# This file intentionally left blank
williamthegrey/swift
refs/heads/master
swift/common/header_key_dict.py
5
# Copyright (c) 2010-2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
nekulin/arangodb
refs/heads/devel
3rdParty/V8-4.3.61/third_party/python_26/Lib/encodings/punycode.py
586
# -*- coding: iso-8859-1 -*- """ Codec for the Punicode encoding, as specified in RFC 3492 Written by Martin v. Löwis. """ import codecs ##################### Encoding ##################################### def segregate(str): """3.1 Basic code point segregation""" base = [] extended = {} for c in st...
zynthian/zynthian-ui
refs/heads/master
zyngui/zynthian_gui_audio_out.py
1
#!/usr/bin/python3 # -*- coding: utf-8 -*- #****************************************************************************** # ZYNTHIAN PROJECT: Zynthian GUI # # Zynthian GUI Audio-Out Selector Class # # Copyright (C) 2015-2018 Fernando Moyano <jofemodo@zynthian.org> # #*************************************************...
micropython/micropython
refs/heads/master
tests/float/string_format_modulo2.py
15
# test formatting floats with large precision, that it doesn't overflow the buffer def test(num, num_str): if num == float("inf") or num == 0.0 and num_str != "0.0": # skip numbers that overflow or underflow the FP precision return for kind in ("e", "f", "g"): # check precision either ...
enacuavlab/pprzros
refs/heads/master
pprzros/setup.py
1
## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup # fetch values from package.xml setup_args = generate_distutils_setup( packages=['pprzros'], package_dir={'': 'src'}) setup(**setup_args)
infoxchange/lettuce
refs/heads/master
tests/integration/lib/Django-1.3/tests/regressiontests/handlers/tests.py
29
from django.utils import unittest from django.conf import settings from django.core.handlers.wsgi import WSGIHandler class HandlerTests(unittest.TestCase): def test_lock_safety(self): """ Tests for bug #11193 (errors inside middleware shouldn't leave the initLock locked). """ ...
django-nonrel/django-nonrel
refs/heads/develop
django/db/backends/mysql/validation.py
392
from django.db.backends import BaseDatabaseValidation class DatabaseValidation(BaseDatabaseValidation): def validate_field(self, errors, opts, f): """ There are some field length restrictions for MySQL: - Prior to version 5.0.3, character fields could not exceed 255 characters in...
decause/pyglet-remy
refs/heads/master
tests/graphics/IMMEDIATE_INDEXED.py
18
#!/usr/bin/env python ''' ''' __docformat__ = 'restructuredtext' __version__ = '$Id: $' import unittest import pyglet from graphics_common import * __noninteractive = True class TEST_CASE(unittest.TestCase): def check(self, expected, result, dimensions): if len(expected) != len(result) * dimensions /...
bis12/yapwaf
refs/heads/master
examples/hello/app/models/user.py
2
import yapwaf as Y from sqlalchemy import Column, Integer, String class User(Y.Base): __tablename__ = 'users' id = Column(Integer, primary_key=True) first_name = Column(String) last_name = Column(String) def __init__(self, first, last): self.first_name = first self.last_name = las...
trotterdylan/grumpy
refs/heads/master
third_party/pypy/_struct.py
7
# # This module is a pure Python version of pypy.module.struct. # It is only imported if the vastly faster pypy.module.struct is not # compiled in. For now we keep this version for reference and # because pypy.module.struct is not ootype-backend-friendly yet. # """Functions to convert between Python values and C stru...
phamelin/ardupilot
refs/heads/master
libraries/AP_OSD/fonts/mcm_all.py
21
#!/usr/bin/env python def convert(in_file, out_file): '''Compile mcm file to binary''' with open(in_file) as inp: content = inp.readlines() inp.close() content.pop(0) out = open(out_file, 'wb') i = -1 for line in content: i = i + 1 if i % 64 < 54: b = in...
mcardacci/tools_of_the_dark_arts
refs/heads/master
Veil-Evasion/tools/backdoor/intel/MachoIntel64.py
12
''' Copyright (c) 2013-2014, Joshua Pitts 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. Redistributions of source code must retain the above copyright notice, this list of conditions and t...
olexiim/edx-platform
refs/heads/master
lms/djangoapps/courseware/tabs.py
8
""" This module is essentially a broker to xmodule/tabs.py -- it was originally introduced to perform some LMS-specific tab display gymnastics for the Entrance Exams feature """ from django.conf import settings from django.utils.translation import ugettext as _ from courseware.access import has_access from student.mod...
ustramooner/CouchPotato
refs/heads/NzbIndexCom
library/hachoir_core/field/float.py
84
from hachoir_core.field import Bit, Bits, FieldSet from hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN import struct # Make sure that we use right struct types assert struct.calcsize("f") == 4 assert struct.calcsize("d") == 8 assert struct.unpack("<d", "\x1f\x85\xebQ\xb8\x1e\t@")[0] == 3.14 assert struct.unpack(...
ALSchwalm/python-prompt-toolkit
refs/heads/master
setup.py
1
#!/usr/bin/env python import os from setuptools import setup, find_packages long_description = open( os.path.join( os.path.dirname(__file__), 'README.rst' ) ).read() setup( name='prompt_toolkit', author='Jonathan Slenders', version='0.47', license='LICENSE.txt', url='http...
jamesjjliao/linux
refs/heads/v4.2-rc2-clk
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
spark-test/spark
refs/heads/master
examples/src/main/python/mllib/summary_statistics_example.py
128
# # 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...
avicizhu/Load-balancer
refs/heads/master
src/propagation/bindings/modulegen__gcc_LP64.py
10
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
tartavull/google-cloud-python
refs/heads/master
speech/nox.py
2
# Copyright 2016 Google 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 or agreed to in writing, ...
TUB-Control/PaPI
refs/heads/master
papi/pyqtgraph/imageview/tests/test_imageview.py
33
import pyqtgraph as pg import numpy as np app = pg.mkQApp() def test_nan_image(): img = np.ones((10,10)) img[0,0] = np.nan v = pg.image(img) app.processEvents() v.window().close()
jeyraof/python-social-auth
refs/heads/master
setup.py
47
# -*- coding: utf-8 -*- """Setup file for easy installation""" import sys import os from os.path import join, dirname, split from setuptools import setup PY3 = os.environ.get('BUILD_VERSION') == '3' or sys.version_info[0] == 3 version = __import__('social').__version__ LONG_DESCRIPTION = """ Python Social Auth is a...
davesteele/cloudprint-service
refs/heads/master
cloudprint/__init__.py
6
# Copyright 2014 Jason Michalski <armooo@armooo.net> # # This file is part of cloudprint. # # cloudprint 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...
mkaluza/external_chromium_org
refs/heads/kk44
tools/mac/symbolicate_crash.py
178
#!/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. """ This script can take an Apple-style CrashReporter log and symbolicate it. This is useful for when a user's reports aren't being...
megan-guidry/dssr2017ABI-mgui210
refs/heads/master
modelVersions/testConnection.py
1
import sys import os sys.path.append(os.path.abspath("../")) import InterfaceTest print("IMPORT SUCCESS!") #dataFile = InterfaceTest.dataFile #print("Testoutput " + dataFile)
jhawkesworth/ansible
refs/heads/devel
lib/ansible/modules/monitoring/pagerduty.py
52
#!/usr/bin/python # -*- coding: utf-8 -*- # # 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', ...
bhadram/linux
refs/heads/master
Documentation/target/tcm_mod_builder.py
337
#!/usr/bin/python # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD # # Copyright (c) 2010 Rising Tide Systems # Copyright (c) 2010 Linux-iSCSI.org # # Author: nab@kernel.org # import os, sys import subprocess as sub import string import re import optparse tcm_dir = "" fabric_ops...