repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
steedos/odoo7 | refs/heads/master | openerp/addons/project_long_term/wizard/project_compute_phases.py | 46 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
iceihehe/pipeg | refs/heads/master | python3/texteditor/Find.py | 8 | #!/usr/bin/env python3
# Copyright © 2012-13 Qtrac Ltd. All rights reserved.
# This program or module 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 ... |
bennyrock20/SVSB | refs/heads/master | vendor/imagine/imagine/docs/conf.py | 218 | # -*- coding: utf-8 -*-
#
# Imagine documentation build configuration file, created by
# sphinx-quickstart on Wed Apr 6 00:20:22 2011.
#
# 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... |
likaiguo/etl_utils | refs/heads/master | etl_utils/entropy.py | 5 | # -*- coding: utf-8 -*-
import math
def calculate_entropy(feature_with_count_dict):
assert hasattr(feature_with_count_dict, 'iteritems')
assert isinstance(feature_with_count_dict.iteritems().next()[1], int)
feature_count_sum = float(sum(feature_with_count_dict.values()))
entropy = 0.0
for f1, c... |
akatsoulas/mozillians | refs/heads/master | mozillians/users/signals.py | 2 | import json
import logging
from django.db import transaction
from django.db.models import signals
from django.dispatch import receiver
from django.conf import settings
from django.contrib.auth.models import User
from raven.contrib.django.raven_compat.models import client as sentry_client
from mozillians.common.utils ... |
simone-campagna/invoice | refs/heads/master | invoice/database/upgrade/upgrader_v2_2_x__v2_3_0.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Simone Campagna
#
# 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... |
pwoodworth/intellij-community | refs/heads/master | python/testData/refactoring/inlinelocal/py5832.before.py | 83 | def foo(arg):
print arg
vals = 'a', 'b'
foo(v<caret>als) |
kurkop/server-tools | refs/heads/master | __unported__/disable_openerp_online/model/publisher_warranty_contract.py | 71 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
Workday/OpenFrame | refs/heads/master | tools/telemetry/telemetry/page/__init__.py | 5 | # Copyright 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import inspect
import logging
import os
import urlparse
from telemetry import decorators
from telemetry import story
from catapult_base import cloud_storage
... |
voer-platform/vp.repo | refs/heads/master | vpr/rest_framework/generics.py | 1 | """
Generic views that provide commonly needed behaviour.
"""
from rest_framework import views, mixins
from rest_framework.settings import api_settings
from django.views.generic.detail import SingleObjectMixin
from django.views.generic.list import MultipleObjectMixin
### Base classes for the generic views ###
class... |
jacobwagner/rpcsroast | refs/heads/master | rpcsroast/lxc/containers/common/__init__.py | 33 | """
Copyright 2014 Rackspace
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dist... |
its-lab/MoniTutor | refs/heads/master | models/0tutordb.py | 1 | from gluon.contrib.appconfig import AppConfig
import uuid
app_conf = AppConfig(reload=True)
DATABASE_NAME = app_conf.take("monitutor_env.database_name")
DATABASE_USER = app_conf.take("monitutor_env.database_user")
DATABASE_PASSWORD = app_conf.take("monitutor_env.database_password")
DATABASE_HOST = app_conf.take("monitu... |
Anaphory/p4-phylogeny | refs/heads/master | p4/Nexus.py | 1 | import string,array
from . import func
from .Var import var
from .Alignment import Alignment
#from NexusToken import * # nextTok() et al
from .NexusSets import NexusSets
from .SequenceList import Sequence
from .Glitch import Glitch
# Some definitions from the MadSwofMad Syst Biol Nexus format paper (MSM97).
#
# Punctu... |
Transtech/omim | refs/heads/master | tools/python/stylesheet/drules_merge.py | 29 | #!/usr/bin/python
# Compares two drules files and produces a merged result.
# Also prints differences (missing things in drules1) to stdout.
import sys, re
import copy, collections
import drules_struct_pb2
def read_drules(drules):
"""Parses the structure and extracts elements for lowest and highest zooms
for each ... |
pathway27/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/manifest/tree.py | 19 | import os
from six.moves import cStringIO as StringIO
from fnmatch import fnmatch
from . import vcs
from .log import get_logger
from .utils import is_blacklisted, rel_path_to_url
def chunks(data, n):
for i in range(0, len(data) - 1, n):
yield data[i:i+n]
class TestTree(object):
def __init__(self, tes... |
siosio/intellij-community | refs/heads/master | python/testData/intentions/PyConvertToFStringIntentionTest/percentOperatorExpressionWithBackslash.py | 31 | '%s' % '\n' |
odoomrp/odoomrp-wip | refs/heads/8.0 | procurement_plan_mrp/models/stock_reservation.py | 11 | # -*- coding: utf-8 -*-
# (c) 2015 Alfredo de la Fuente - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import models, fields
class StockReservation(models.Model):
_inherit = 'stock.reservation'
procurement_from_plan = fields.Many2one(
'procurement.order', stri... |
ethanperez/t4k-rms | refs/heads/master | riders/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
LEPT-Development/android_kernel_lge_f6mt | refs/heads/master | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
jccaicedo/localization-agent | refs/heads/master | utils/utils.py | 1 | import os,sys
import timeit
import numpy as np
import random
import pickle
import re
import MemoryUsage
floatType = np.float32
topHards = 5000
randomSeed = 0
tolerance = 1e-9
random.seed( randomSeed )
rnd = random
def loadParams(names):
names = names.split()
if len(sys.argv) < len(names)+1:
print ' Parameters... |
andrewsmedina/django | refs/heads/master | tests/admin_scripts/custom_templates/project_template/manage.py | 738 | # The manage.py of the {{ project_name }} test project
# template context:
project_name = '{{ project_name }}'
project_directory = '{{ project_directory }}'
secret_key = '{{ secret_key }}'
|
agry/NGECore2 | refs/heads/master | scripts/object/mobile/verne_hue.py | 85615 | import sys
def setup(core, object):
return |
mmottahedi/neuralnilm_prototype | refs/heads/master | scripts/e46.py | 2 | from __future__ import print_function, division
from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer
from lasagne.nonlinearities import sigmoid
from lasagne.objectives import crossentropy
from lasagne.init import Uniform, Normal
from lasagne.layers import LSTMLayer, DenseLayer
"""
Setup:
* in_t... |
e-koch/VLA_Lband | refs/heads/master | 14B-088/HI/analysis/HI_example_spectra_figure.py | 1 |
'''
Make a figure showing off some of the different spectra.
Compare archival VLA, new VLA, and VLA+GBT.
'''
from os.path import join as osjoin
from spectral_cube import SpectralCube, Projection
import matplotlib.pyplot as plt
from astropy.io import fits
import astropy.units as u
from astropy.wcs import WCS
from astr... |
CapOM/ChromiumGStreamerBackend | refs/heads/master | chrome/browser/resources/chromeos/chromevox/tools/generate_test_messages.py | 34 | #!/usr/bin/env python
# Copyright 2014 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 test_messages.js from an extension message json file.'''
import optparse
import sys
def Die(message):
'''Prints an er... |
moreati/django | refs/heads/master | django/db/backends/mysql/client.py | 520 | import subprocess
from django.db.backends.base.client import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
@classmethod
def settings_to_cmd_args(cls, settings_dict):
args = [cls.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_dic... |
barnsnake351/neutron | refs/heads/master | neutron/tests/api/admin/test_routers_dvr.py | 29 | # Copyright 2015 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
Akasurde/ansible | refs/heads/devel | lib/ansible/modules/file.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2017, 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__ ... |
kenshay/ImageScript | refs/heads/master | ProgramData/SystemFiles/Python/Lib/site-packages/scipy/optimize/_constraints.py | 4 | """Constraints definition for minimize."""
from __future__ import division, print_function, absolute_import
import numpy as np
from ._hessian_update_strategy import BFGS
from ._differentiable_functions import (
VectorFunction, LinearVectorFunction, IdentityVectorFunction)
class NonlinearConstraint(object):
""... |
Antiun/purchase-workflow | refs/heads/8.0 | vendor_consignment_stock/tests/__init__.py | 25 | # -*- coding: utf-8 -*-
from . import test_delivery_without_owner
from . import test_sale_to_reservation
|
Zeeker/sublime-SortLinesBySelection | refs/heads/master | selection_sorter.py | 1 | import sublime
import sublime_plugin
# The default morph lamda, just returns the input
_DEFAULT_MORPH = lambda s: s
def get_user_morph(morph):
try:
exec("user_morph = lambda s: {}".format(morph))
except:
return _DEFAULT_MORPH
else:
return locals()["user_morph"]
c... |
nvoron23/statsmodels | refs/heads/master | statsmodels/sandbox/examples/bayesprior.py | 33 | #
# This script examines the predictive prior densities of two local level
# models given the same priors for parameters that appear to be the same.
# Reference: Del Negro and Schorfheide.
try:
import pymc
pymc_installed = 1
except:
print("pymc not imported")
pymc_installed = 0
from scipy.stats import ... |
codingjoe/django-stdimage | refs/heads/master | tests/models.py | 1 | from io import BytesIO
from django.core.files.base import ContentFile
from django.core.files.storage import FileSystemStorage
from django.db import models
from PIL import Image
from stdimage import JPEGField, StdImageField
from stdimage.models import StdImageFieldFile
from stdimage.utils import render_variations
from... |
indera/vivo-pump | refs/heads/master | examples/dates/gen_dates.py | 2 | #!/usr/bin/env/python
"""
gen_dates.py -- generate dates for inclusion in VIVO
"""
__author__ = "Michael Conlon"
__copyright__ = "Copyright 2015 (c) Michael Conlon"
__license__ = "New BSD License"
__version__ = "0.01"
from datetime import datetime
from dateutil.relativedelta import relativedelta
out_file = open... |
kevalds51/sympy | refs/heads/master | sympy/ntheory/bbp_pi.py | 50 | '''
This implementation is a heavily modified fixed point implementation of
BBP_formula for calculating the nth position of pi. The original hosted
at: http://en.literateprograms.org/Pi_with_the_BBP_formula_(Python)
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and a... |
python-ivi/python-ivi | refs/heads/master | ivi/agilent/agilent8590A.py | 2 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-2017 Alex Forencich
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... |
agry/NGECore2 | refs/heads/master | scripts/object/static/terrain/corellia/rock_bowl_agrilat_double.py | 85615 | import sys
def setup(core, object):
return |
gg7/sentry | refs/heads/master | src/sentry/interfaces/exception.py | 12 | """
sentry.interfaces.exception
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
__all__ = ('Exception',)
from django.conf import settings
from sentry.interfaces.base impor... |
windyuuy/opera | refs/heads/master | chromium/src/third_party/python_26/Lib/json/encoder.py | 58 | """Implementation of JSONEncoder
"""
import re
import math
try:
from _json import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
c_encode_basestring_ascii = None
__all__ = ['JSONEncoder']
ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')... |
efiring/numpy-work | refs/heads/cfastma | numpy/distutils/command/build_ext.py | 1 | """ Modified version of build_ext that handles fortran source files.
"""
import os
import sys
from glob import glob
from distutils.dep_util import newer_group
from distutils.command.build_ext import build_ext as old_build_ext
from distutils.errors import DistutilsFileError, DistutilsSetupError,\
DistutilsError
f... |
robertchase/spindrift | refs/heads/master | spindrift/mysql/packet.py | 1 | import struct
import spindrift.mysql.charset as charset
from spindrift.mysql.constants import CLIENT, SERVER_STATUS
import spindrift.mysql.util as util
MAX_PACKET_LEN = 2**24-1
NULL_COLUMN = 251
UNSIGNED_CHAR_COLUMN = 251
UNSIGNED_SHORT_COLUMN = 252
UNSIGNED_INT24_COLUMN = 253
UNSIGNED_INT64_COLUMN = 254
def writ... |
openpreserve/Scape-Tool-Tester | refs/heads/master | app/scapetesting/govdocs1/govdocs1.py | 1 | import csv
import os
from scapetesting.govdocs1.groundTruth import FileTruth
from config import truthFile
__author__ = 'abr'
thisDir = os.path.abspath(os.path.dirname(__file__))
dicFile = thisDir+'/csv/mimetype-decoder.csv'
equivFile = thisDir+'/csv/mimetype-equiv.csv'
class Cache(object):
groundTruths = {}... |
Joergen/olympia | refs/heads/master | lib/misc/tests/test_log.py | 15 | import logging
from django.conf import settings
from nose.tools import eq_
from heka.config import client_from_dict_config
import amo.tests
import commonware.log
from lib.log_settings_base import error_fmt
cfg = {
'version': 1,
'formatters': {
'error': {
'()': commonware.log.Formatter,
... |
RealImpactAnalytics/airflow | refs/heads/master | airflow/www_rbac/__init__.py | 353 | # -*- coding: utf-8 -*-
#
# 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
#... |
saradbowman/osf.io | refs/heads/develop | api/wb/views.py | 5 | from rest_framework import status
from rest_framework.exceptions import ValidationError, NotFound
from rest_framework.response import Response
from osf.models import Guid
from rest_framework.views import APIView
from addons.osfstorage.models import OsfStorageFileNode, OsfStorageFolder
from api.base.parsers import HMAC... |
ardekantur/pyglet | refs/heads/master | contrib/spryte/spryte.py | 29 | import os
import math
from pyglet import image, gl, clock, graphics, sprite
class SpriteBatchGroup(graphics.Group):
def __init__(self, x, y, parent=None):
super(SpriteBatchGroup, self).__init__(parent)
self.x, self.y = x, y
def set(self):
if self.x or self.y:
gl.glTranslat... |
demoforwork/public | refs/heads/master | SelfServiceProvisioning/lib/apiclient/__init__.py | 97 | """Retain apiclient as an alias for googleapiclient."""
from six import iteritems
import googleapiclient
try:
import oauth2client
except ImportError:
raise RuntimeError(
'Previous version of google-api-python-client detected; due to a '
'packaging issue, we cannot perform an in-place upgrade. To repa... |
Nick-Hall/gramps | refs/heads/master | gramps/gui/plug/quick/_textbufdoc.py | 9 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2006 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
#
# 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; ... |
s-class/Kona_01 | refs/heads/master | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... |
vyscond/cocos | refs/heads/master | docgen/programming_guide/skeleton/show_root_bone.py | 12 | # This code is so you can run the samples without installing the package
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../../..'))
#
## import all the stuff we need from cocos
import cocos
from cocos.director import director
from cocos.sprite import Sprite
from cocos import skeleton
... |
mrshelly/openerp71313 | refs/heads/master | openerp/tests/addons/test_uninstall/__init__.py | 2074 | # -*- coding: utf-8 -*-
import models
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
basnijholt/holoviews | refs/heads/master | holoviews/tests/plotting/bokeh/testlabels.py | 2 | import numpy as np
from holoviews.core.dimension import Dimension
from holoviews.element import Labels
try:
from bokeh.models import LinearColorMapper, CategoricalColorMapper
except:
pass
from ..utils import ParamLogStream
from .testplot import TestBokehPlot, bokeh_renderer
class TestLabelsPlot(TestBokehPl... |
monikagrabowska/osf.io | refs/heads/develop | scripts/migrate_boxfiles.py | 9 | import logging
from website.app import init_app
from addons.box.model import BoxFile
from scripts import utils as scripts_utils
from framework.transactions.context import TokuTransaction
logger = logging.getLogger(__name__)
def main():
with TokuTransaction():
for file in BoxFile.find():
new_... |
40223139/39g7test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/test/__init__.py | 2547 | # Dummy file to make this directory a package.
|
andersonresende/django | refs/heads/master | django/db/models/fields/related.py | 5 | from __future__ import unicode_literals
from operator import attrgetter
from django.apps import apps
from django.core import checks
from django.db import connection, connections, router, transaction
from django.db.backends import utils
from django.db.models import signals, Q
from django.db.models.deletion import SET_... |
erueloi/django-allauth | refs/heads/master | allauth/account/signals.py | 75 | from django.dispatch import Signal
user_logged_in = Signal(providing_args=["request", "user"])
# Typically followed by `user_logged_in` (unless, e-mail verification kicks in)
user_signed_up = Signal(providing_args=["request", "user"])
password_set = Signal(providing_args=["request", "user"])
password_changed = Signa... |
zhouxiumin/projecteuler | refs/heads/master | python/euler41.py | 1 | #coding=utf-8
from math import sqrt
def isprime(n):
if n==1:
return False
k=int(sqrt(n))+1
for i in range(2,k):
if n%i==0:
return False
return True
def perm(l):
if len(l)<=1:
return [l]
r=[]
for i in range(len(l)):
s=l[:i]+l[i+1:]
p=perm(s)
for x in p:
r.append(l[i:i+1]+x)
return r
str='765... |
havard024/prego | refs/heads/master | venv/lib/python2.7/site-packages/django/contrib/gis/gdal/tests/test_envelope.py | 114 | from django.contrib.gis.gdal import Envelope, OGRException
from django.utils import unittest
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
class EnvelopeTest(unittest.TestCase):
def setUp(self):
self.e = Envelope(0, 0, 5, 5)
def test01_init(self):
... |
nagyistoce/eutester | refs/heads/master | testcases/cloud_user/images/create_image.py | 6 | # Software License Agreement (BSD License)
#
# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... |
rallylee/gem5 | refs/heads/master | ext/ply/ply/__init__.py | 838 | # PLY package
# Author: David Beazley (dave@dabeaz.com)
__all__ = ['lex','yacc']
|
vipul-sharma20/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/auth/views.py | 78 | try:
from urllib.parse import urlparse, urlunparse
except ImportError: # Python 2
from urlparse import urlparse, urlunparse
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, QueryDict
from django.template.response import TemplateResp... |
icgc-dcc/dcc-downloader | refs/heads/develop | dcc-downloader-workflows/src/main/IntegrationTest/runner.py | 1 | #!/usr/bin/python
#
# Copyright (c) 2016 The Ontario Institute for Cancer Research. All rights reserved.
#
# This program and the accompanying materials are made available under the terms of the GNU Public License v3.0.
# You should have received a copy of the GNU General Public License along with
# this program. If no... |
JCROM-Android/jcrom_external_chromium_org | refs/heads/kitkat | chrome/test/webdriver/test/run_webdriver_java_tests.py | 38 | #!/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.
"""Runs the WebDriver Java acceptance tests.
This script is called from buildbot and reports results using the buildbot
annotation... |
mcanthony/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/mac/gyptest-framework.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 that app bundles are built correctly.
"""
import TestGyp
import os
import sys
def ls(path):
'''Returns a list of all file... |
laurenrevere/osf.io | refs/heads/develop | api_tests/preprint_providers/views/test_preprint_provider_subjects_list.py | 4 | from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import SubjectFactory, PreprintProviderFactory
class TestPreprintProviderSubjects(ApiTestCase):
def create_subject_rules(self):
'''
Subject Hierarc... |
csaez/ibl_stuff | refs/heads/master | ibl_stuff/tests/test_qt_helpers.py | 1 | import sys
import unittest
from PySide import QtGui
from ibl_stuff.libs import qt_helpers
class Foo(QtGui.QDialog):
pass
class Bar():
pass
class SimpleTest(unittest.TestCase):
def test_get_parent_empty(self):
self.assertIsNone(qt_helpers.get_parent())
class TestQt(unittest.TestCase):
P... |
Achim63/plover-lookup-enhanced | refs/heads/master | lookup.py | 1 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (c) 2016 Achim Siebert
# License: GPL v3.0
import os
import sys
import codecs
import locale
import argparse
import appdirs
import simplejson as json
class LookUp():
home = ""
dictFileList = []
dictList = []
dictNames = []
defresult = []
... |
maoy/zknova | refs/heads/zk-servicegroup | nova/tests/api/openstack/compute/contrib/test_console_output.py | 4 | # Copyright 2011 Eldar Nugaev
# 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 ... |
openqua/openqua | refs/heads/master | web/wsprnet.py | 1 |
import requests
from bs4 import BeautifulSoup
WSPRNET_DB_URL = "http://wsprnet.org/drupal/wsprnet/spotquery"
def get_wspr_data(callsign):
query = {
'band': 'All',
'count': '10',
'call': callsign,
'reporter': '',
'timelimit': '1209600',
'sor... |
cyberden/CouchPotatoServer | refs/heads/develop | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/myspass.py | 40 | from __future__ import unicode_literals
import os.path
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
)
class MySpassIE(InfoExtractor):
_VALID_URL = r'http://www\.myspass\.de/.*'
_TEST = {
'url': 'http://www.myspa... |
qtproject/qt-creator | refs/heads/master | scripts/makedmg.py | 4 | #!/usr/bin/env python
############################################################################
#
# Copyright (C) 2018 The Qt Company Ltd.
# Contact: https://www.qt.io/licensing/
#
# This file is part of Qt Creator.
#
# Commercial License Usage
# Licensees holding valid commercial Qt licenses may use this file in
# ... |
munkiat/libcloud | refs/heads/trunk | libcloud/common/abiquo.py | 8 | # 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 use ... |
berkerpeksag/pythondotorg | refs/heads/master | pages/managers.py | 13 | from django.db.models.query import QuerySet
class PageQuerySet(QuerySet):
def published(self):
return self.filter(is_published=True)
def draft(self):
return self.filter(is_published=False)
|
Yannig/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_vms.py | 6 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (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
#... |
kosgroup/odoo | refs/heads/10.0 | addons/note/__manifest__.py | 24 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Productivity',
'version': '1.0',
'category': 'Tools',
'description': """
This module allows users to create their own notes inside Odoo
=========================================================... |
spirrello/spirrello-pynet-work | refs/heads/master | applied_python/lib64/python2.7/site-packages/Crypto/SelfTest/st_common.py | 118 | # -*- coding: utf-8 -*-
#
# SelfTest/st_common.py: Common functions for SelfTest modules
#
# 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 dedicati... |
vijayendrabvs/ssl-neutron | refs/heads/master | neutron/plugins/cisco/test/nexus/fake_nexus_driver.py | 16 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Cisco Systems, 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... |
rishita/mxnet | refs/heads/master | example/speech_recognition/stt_io_iter.py | 11 | from __future__ import print_function
import sys
sys.path.insert(0, "../../python")
import mxnet as mx
import random
class SimpleBatch(object):
def __init__(self, data_names, data, label_names, label):
self.data = data
self.label = label
self.data_names = data_names
self.label_n... |
sorenk/ansible | refs/heads/devel | test/runner/lib/cloud/openshift.py | 46 | """OpenShift plugin for integration tests."""
from __future__ import absolute_import, print_function
import json
import os
import re
import time
from lib.cloud import (
CloudProvider,
CloudEnvironment,
)
from lib.util import (
find_executable,
ApplicationError,
display,
SubprocessError,
)
fr... |
tempbottle/simple-rtmp-server | refs/heads/develop | trunk/3rdparty/gprof/gprof2dot.py | 47 | #!/usr/bin/env python
#
# Copyright 2008-2009 Jose Fonseca
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# ... |
m4734/mysql_pio | refs/heads/5.7 | boost_1_59_0/tools/build/test/free_features_request.py | 44 | #!/usr/bin/python
# Copyright (C) Vladimir Prus 2007.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Tests that a free feature specified on the command line applies to all
# targets ever built.
import BoostBui... |
kcpawan/django | refs/heads/master | django/contrib/gis/db/backends/oracle/models.py | 475 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... |
glon/django_test | refs/heads/master | image/migrations/0002_auto_20170808_0841.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2017-08-08 08:41
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('image', '0001_initial'),
]
operations = [
migrations.AlterField(
... |
wistoch/meego-app-browser | refs/heads/master | third_party/tlslite/tlslite/utils/ASN1Parser.py | 80 | """Class for parsing ASN.1"""
from compat import *
from codec import *
#Takes a byte array which has a DER TLV field at its head
class ASN1Parser:
def __init__(self, bytes):
p = Parser(bytes)
p.get(1) #skip Type
#Get Length
self.length = self._getASN1Length(p)
#Get Value
... |
yullo/check-it | refs/heads/master | backend/settings/__init__.py | 1 | """ Settings for backend """
from .base import *
try:
from .local import *
except ImportError, exc:
exc.args = tuple(
['%s (did you rename settings/local-dist.py?)' % exc.args[0]])
raise exc
|
nubark/odoo | refs/heads/9.0 | openerp/addons/base/tests/test_xmlrpc.py | 46 | # -*- coding: utf-8 -*-
import openerp.tests.common
class test_xmlrpc(openerp.tests.common.HttpCase):
at_install = False
post_install = True
def test_01_xmlrpc_login(self):
""" Try to login on the common service. """
db_name = openerp.tests.common.get_db_name()
uid = self.xmlrpc_c... |
willcodefortea/wagtail | refs/heads/master | wagtail/tests/migrations/0003_auto_20140905_0634.py | 7 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('tests', '0002_auto_20140827_0908'),
]
operations = [
migrations.AddField(
model_name='advertplacement',
... |
schnoebe/fedora-mock | refs/heads/master | py/mockbuild/package_manager.py | 1 | import glob
import os.path
import shutil
from textwrap import dedent
from . import util
from .exception import BuildError, Error
from .trace_decorator import traceLog
def PackageManager(config_opts, chroot, plugins):
pm = config_opts.get('package_manager', 'yum')
if pm == 'yum':
return Yum(config_opt... |
gangadharkadam/saloon_frappe | refs/heads/master | frappe/utils/backups.py | 15 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""This module handles the On Demand Backup utility"""
from __future__ import unicode_literals
#Imports
from frappe import _
import os, frappe
from datetime import datetime
from frappe.utils import cstr, get_url
#Glo... |
Caoimhinmg/PmagPy | refs/heads/master | programs/revtest_mm1990.py | 1 | #!/usr/bin/env python
from __future__ import division
from __future__ import print_function
from builtins import input
from builtins import range
from past.utils import old_div
import sys
import numpy
import pmagpy.pmagplotlib as pmagplotlib
import pmagpy.pmag as pmag
#
#contributed by N. Swanson-Hysell on 5/3/2013 r... |
jolene-esposito/osf.io | refs/heads/develop | website/util/__init__.py | 10 | # -*- coding: utf-8 -*-
import re
import logging
import urlparse
import furl
from flask import request, url_for
from website import settings as website_settings
# Keep me: Makes rubeus importable from website.util
from . import rubeus # noqa
logger = logging.getLogger(__name__)
guid_url_node_pattern = re.compi... |
nuigroup/pymt-widgets | refs/heads/master | pymt/ui/widgets/svg.py | 2 | '''
SVG widget: widget that display an svg image
'''
__all__ = ('MTSvg', 'MTSvgButton')
import os
from pymt import pymt_data_dir
from pymt.logger import pymt_logger
from pymt.ui.widgets.widget import MTWidget
from pymt.ui.widgets.button import MTButton
squirtle = None
class MTSvg(MTWidget):
'''Render an svg ima... |
ThirdProject/android_external_protobuf | refs/heads/cm-9.1.0 | python/google/protobuf/internal/containers.py | 43 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... |
AlwinEsch/kodi-agile | refs/heads/master | lib/gtest/test/gtest_xml_output_unittest.py | 1815 | #!/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... |
CredoReference/edx-platform | refs/heads/integration-hawthorn-qa | common/lib/xmodule/xmodule/course_module.py | 1 | """
Django module container for classes and operations related to the "Course Module" content type
"""
import json
import logging
from cStringIO import StringIO
from datetime import datetime, timedelta
import dateutil.parser
from django.conf import settings
import requests
from lazy import lazy
from lxml import etree... |
leafclick/intellij-community | refs/heads/master | python/testData/addImport/relativeImportFromSamePackage/foo/test.py | 12 | from .bar import bar_func |
GbalsaC/bitnamiP | refs/heads/master | venv/lib/python2.7/site-packages/kombu/transport/__init__.py | 15 | """
kombu.transport
===============
Built-in transports.
"""
from __future__ import absolute_import
from kombu.five import string_t
from kombu.syn import _detect_environment
from kombu.utils import symbol_by_name
def supports_librabbitmq():
if _detect_environment() == 'default':
try:
import... |
Galexrt/zulip | refs/heads/master | zerver/lib/i18n.py | 2 | # -*- coding: utf-8 -*-
import operator
from django.conf import settings
from django.utils import translation
from django.utils.translation import ugettext as _
from django.utils.lru_cache import lru_cache
from six.moves import urllib, zip_longest, zip, range
from typing import Any, List, Dict, Optional, Text
import... |
mahendra-r/home-assistant | refs/heads/dev | tests/components/test_mqtt.py | 16 | """
tests.test_component_mqtt
~~~~~~~~~~~~~~~~~~~~~~~~~
Tests MQTT component.
"""
import unittest
from unittest import mock
import socket
import homeassistant.components.mqtt as mqtt
from homeassistant.const import (
EVENT_CALL_SERVICE, ATTR_DOMAIN, ATTR_SERVICE, EVENT_HOMEASSISTANT_START,
EVENT_HOMEASSISTANT... |
robinro/ansible | refs/heads/devel | lib/ansible/modules/database/mysql/mysql_replication.py | 43 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql replication
(c) 2013, Balazs Pocze <banyek@gawker.com>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.