repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
phborba/dsgtoolsop
refs/heads/master
ProfileTool/pyqtgraph/multiprocess/remoteproxy.py
11
import os, time, sys, traceback, weakref import numpy as np import threading try: import __builtin__ as builtins import cPickle as pickle except ImportError: import builtins import pickle # color printing for debugging from ..util import cprint class ClosedError(Exception): """Raised when an event...
katiecheng/Bombolone
refs/heads/master
env/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/latin1prober.py
200
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
zhaohuaw/connector-magento
refs/heads/8.0
magentoerpconnect/tests/data_product.py
16
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
mdeemer/XlsxWriter
refs/heads/master
xlsxwriter/test/comparison/test_chart_gridlines07.py
8
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
Zentyal/openchange
refs/heads/master
mapiproxy/services/client/newmail.py
13
#!/usr/bin/python import os,sys import argparse import ConfigParser from OCSManager import Network def parse_config_file(filename): """Parse configuration file.""" cfg = {'username': None, 'password': None, 'encryption': None, 'host': None, 'port': None} if filename is None: return cfg config = Conf...
cc13ny/Allin
refs/heads/master
leetcode/217-Contains-Duplicate/ContainDup_002.py
5
class Solution(object): def containsDuplicate(self, nums): """ :type nums: List[int] :rtype: bool """ return not (len(nums) == len(set(nums)))
alexa-infra/negine
refs/heads/master
thirdparty/boost-python/libs/python/test/map_indexing_suite.py
12
# Copyright Joel de Guzman 2004. 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) ''' ##################################################################### # Check an object that we will use as container element...
minorua/QGIS
refs/heads/master
python/pyplugin_installer/installer.py
11
# -*- coding:utf-8 -*- """ /*************************************************************************** Plugin Installer module ------------------- Date : May 2013 Copyright : (C) 2013 by Borys Jurgiel Email :...
labtoast/apm_planner
refs/heads/master
libs/mavlink/share/pyshared/pymavlink/scanwin32.py
48
#!/usr/bin/env python # this is taken from the pySerial documentation at # http://pyserial.sourceforge.net/examples.html import ctypes import re def ValidHandle(value): if value == 0: raise ctypes.WinError() return value NULL = 0 HDEVINFO = ctypes.c_int BOOL = ctypes.c_int CHAR = ctypes.c_char PCTSTR...
mikeing2001/LoopDetection
refs/heads/master
pox/openflow/webservice.py
26
# Copyright 2012 James McCauley # # This file is part of POX. # # POX 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. # # POX is distri...
nazo/ansible
refs/heads/devel
test/units/plugins/connection/test_network_cli.py
48
# # (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 d...
pancentric/django-cms
refs/heads/develop
cms/plugins/file/migrations/__init__.py
12133432
d2emon/newspaperizer
refs/heads/master
src/note/migrations/__init__.py
12133432
mtivadar/fs_ntfs
refs/heads/master
fs_ntfs/__init__.py
12133432
blindroot/django
refs/heads/master
tests/test_discovery_sample2/__init__.py
12133432
dcroc16/skunk_works
refs/heads/master
google_appengine/lib/django-1.4/tests/regressiontests/localflavor/cl/__init__.py
12133432
AlexanderKaluzhny/instanotifier
refs/heads/master
instanotifier/parser/rss/test_utils.py
1
def get_test_rss_feed(): from instanotifier.fetcher.tests import fetch_test_rss_url from instanotifier.parser.rss.parser import RssParser feed = fetch_test_rss_url() parser = RssParser(feed) return feed, parser def get_test_rss_feed_items(): raw_feed, parser = get_test_rss_feed() feed_i...
akretion/odoo
refs/heads/12-patch-paging-100-in-o2m
addons/crm/models/__init__.py
15
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import res_users from . import calendar from . import crm_lead from . import crm_stage from . import crm_team from . import res_config_settings from . import res_partner from . import digest
memento7/KINCluster
refs/heads/master
KINCluster/core/cluster.py
1
from typing import List, Iterator, Union from collections import Counter from KINCluster.core.item import Item from KINCluster.lib.tokenizer import tokenizer from KINCluster import settings import numpy as np from gensim.models import Doc2Vec from gensim.models.doc2vec import TaggedDocument from scipy.cluster import ...
Semi-global/edx-platform
refs/heads/master
lms/djangoapps/support/tests/test_views.py
70
""" Tests for support views. """ import ddt from django.test import TestCase from django.core.urlresolvers import reverse from student.roles import GlobalStaff, SupportStaffRole from student.tests.factories import UserFactory class SupportViewTestCase(TestCase): """ Base class for support view tests. ""...
willrp/willbuyer
refs/heads/master
backend/tests/integration/controller/api/__init__.py
12133432
eHealthAfrica/rapidpro
refs/heads/develop
temba/values/__init__.py
12133432
poiati/django
refs/heads/master
tests/queryset_pickle/__init__.py
12133432
mcr/ietfdb
refs/heads/master
django/conf/locale/nn/__init__.py
12133432
hasadna/django
refs/heads/master
django/contrib/sessions/management/__init__.py
12133432
cslzchen/osf.io
refs/heads/develop
api_tests/base/__init__.py
12133432
blosm-org/blosm-core
refs/heads/develop
vle/migrations/__init__.py
12133432
whip112/tornado
refs/heads/master
tornado/test/stack_context_test.py
200
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement from tornado import gen from tornado.log import app_log from tornado.stack_context import (StackContext, wrap, NullContext, StackContextInconsistentError, ExceptionStackContext, run...
Akasurde/ansible
refs/heads/devel
lib/ansible/modules/import_role.py
15
#!/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 DOCUMENTATION = r''' --- author: Ansible Core Team (@ansible) modul...
da1z/intellij-community
refs/heads/master
python/helpers/py2only/docutils/utils/math/latex2mathml.py
104
#!/usr/bin/env python # -*- coding: utf-8 -*- # :Id: $Id: latex2mathml.py 7668 2013-06-04 12:46:30Z milde $ # :Copyright: © 2010 Günter Milde. # Based on rst2mathml.py from the latex_math sandbox project # © 2005 Jens Jørgen Mortensen # :License: Released under the terms of the `2-Clause BSD li...
albf/spitz
refs/heads/master
monitor/Alloc.py
1
from MonitorData import * from Config import * a = Config() Data = MonitorData(1, 10) Data.allocateNodes(4,1, a.subscription_id, a.certificate_path, a.windows_blob_url, a.image, a.location, a.linux_user, a.linux_pass, a.VMHeader)
QuLogic/iris
refs/heads/master
lib/iris/tests/unit/lazy_data/test_as_concrete_data.py
1
# (C) British Crown Copyright 2017, Met Office # # This file is part of Iris. # # Iris 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 ve...
brain-tec/bank-statement-reconcile
refs/heads/8.0
account_statement_one_move/__openerp__.py
14
# -*- coding: utf-8 -*- ############################################################################### # # account_statement_one_move for OpenERP # Copyright (C) 2013-TODAY Akretion <http://www.akretion.com>. # @author Sébastien BEAU <sebastien.beau@akretion.com> # # This program is free software: you can redi...
ojengwa/oh-mainline
refs/heads/master
vendor/packages/docutils/test/test_parsers/test_rst/test_directives/test_images.py
16
#! /usr/bin/env python # $Id: test_images.py 7621 2013-03-04 13:20:49Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Tests for images.py image directives. """ from __init__ import DocutilsTestSupport from docutils.nodes import reprunicode de...
fafaman/django
refs/heads/master
django/core/serializers/base.py
273
""" Module for abstract serializer/unserializer base classes. """ from django.db import models from django.utils import six class SerializerDoesNotExist(KeyError): """The requested serializer was not found.""" pass class SerializationError(Exception): """Something bad happened during serialization.""" ...
jylaxp/django
refs/heads/master
django/core/management/commands/diffsettings.py
479
from django.core.management.base import BaseCommand def module_to_dict(module, omittable=lambda k: k.startswith('_')): """Converts a module namespace to a Python dictionary.""" return {k: repr(v) for k, v in module.__dict__.items() if not omittable(k)} class Command(BaseCommand): help = """Displays diff...
xuvw/viewfinder
refs/heads/master
backend/db/contact.py
13
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Viewfinder contact. Contact: contact information for a user account """ __author__ = 'spencer@emailscrubbed.com (Spencer Kimball)' import base64 import hashlib from tornado import gen from viewfinder.backend.base import util from viewfinder.backend.db imp...
mupi/escolamupi
refs/heads/master
notes/admin.py
1
# -*- coding: utf-8 -*- from django.contrib import admin from notes.models import Note class NoteAdmin(admin.ModelAdmin): model = Note admin.site.register(Note, NoteAdmin)
armaan/edx-configuration
refs/heads/master
util/balancecontainers.py
12
import argparse import logging import os import sys try: # This script is used by docker.mk at parse-time, which means when you run # "make requirements" to install the required Python packages, this script # runs before its requirements are installed. That means this import will # fail. To prevent a ...
refractionPOINT/py-beach
refs/heads/master
beach/hostmanager.py
1
# Copyright (C) 2015 refractionPOINT # # 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 ...
Arcanemagus/SickRage
refs/heads/master
lib/sqlalchemy/orm/descriptor_props.py
78
# orm/descriptor_props.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 """Descriptor properties are more "auxiliary" properties that exist as configu...
caleb531/ssh-wp-backup
refs/heads/master
tests/test_remote.py
1
#!/usr/bin/env python3 import os import os.path import subprocess import nose.tools as nose import swb.remote as swb from mock import patch WP_PATH = 'tests/files/mysite' with open(os.path.join(WP_PATH, 'wp-config.php'), 'r') as wp_config: WP_CONFIG_CONTENTS = wp_config.read() def test_read_wp_config(): ""...
andreimaximov/algorithms
refs/heads/master
leetcode/algorithms/interleaving-string/solution.py
1
#!/usr/bin/env python class Solution(object): def isInterleave(self, a, b, c): """ Returns a boolean indicating if string c can be formed by interleaving strings a and b. Algorithm takes O(nm) time and space. This can be trivially optimized to O(min{n, m}) space because we are only...
FlaPer87/django-nonrel
refs/heads/master
tests/regressiontests/special_headers/tests.py
50
from django.test import TestCase from django.contrib.auth.models import User class SpecialHeadersTest(TestCase): fixtures = ['data.xml'] def test_xheaders(self): user = User.objects.get(username='super') response = self.client.get('/special_headers/article/1/') # import pdb; pdb.set_tr...
mahak/cinder
refs/heads/master
cinder/volume/drivers/pure.py
1
# Copyright (c) 2014 Pure Storage, 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 re...
Opentrons/labware
refs/heads/master
robot-server/robot_server/service/session/command_execution/callable_executor.py
2
import typing from robot_server.util import duration from .base_executor import CommandExecutor from .command import Command, CompletedCommand, CommandResult CommandHandler = typing.Callable[ [str, typing.Dict[typing.Any, typing.Any]], typing.Coroutine] class CallableExecutor(CommandExecutor): """A com...
zpincus/IOTool
refs/heads/master
py/setup.py
2
import distutils.core distutils.core.setup(name = 'iotool', version = '1.0', description = 'iotool package', packages = ['iotool'])
michaelpacer/networkx
refs/heads/master
examples/algorithms/krackhardt_centrality.py
44
#!/usr/bin/env python """ Centrality measures of Krackhardt social network. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)""" __date__ = "$Date: 2005-05-12 14:33:11 -0600 (Thu, 12 May 2005) $" __credits__ = """""" __revision__ = "$Revision: 998 $" # Copyright (C) 2004 by # Aric Hagberg <hagberg@lanl.gov> # ...
apyrgio/synnefo
refs/heads/release-0.16
snf-astakos-app/astakos/im/migrations/0075_auto__chg_field_projectresourcegrant_project_capacity__chg_field_proje.py
10
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'ProjectResourceGrant.project_capacity' db.alter_column('im_projectresourcegrant', 'proje...
mne-tools/mne-python
refs/heads/main
mne/io/ctf/__init__.py
24
"""CTF module for conversion to FIF.""" # Author: Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) from .ctf import read_raw_ctf, RawCTF
kenorb/BitTorrent
refs/heads/master
BTL/ubencode.py
8
# The contents of this file are subject to the Python Software Foundation # License Version 2.3 (the License). You may not copy or use this file, in # either source code or executable form, except in compliance with the License. # You may obtain a copy of the License at http://www.python.org/license. # # Software dist...
gotomypc/scikit-learn
refs/heads/master
sklearn/linear_model/tests/test_coordinate_descent.py
40
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # License: BSD 3 clause from sys import version_info import numpy as np from scipy import interpolate, sparse from copy import deepcopy from sklearn.datasets import load_boston from sklearn.utils.testing ...
10clouds/edx-platform
refs/heads/dev
common/test/acceptance/tests/studio/test_studio_bad_data.py
173
from base_studio_test import ContainerBase from ...fixtures.course import XBlockFixtureDesc from ...pages.studio.utils import verify_ordering class BadComponentTest(ContainerBase): """ Tests that components with bad content do not break the Unit page. """ __test__ = False def get_bad_html_content...
tashaxe/Red-DiscordBot
refs/heads/develop
lib/pip/_vendor/distlib/database.py
334
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2016 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import contextlib import hashlib import logging import os import posixpath import sys import z...
ptthiem/nose2
refs/heads/master
nose2/tests/functional/support/scenario/layers_and_attributes/test_layers_and_attributes.py
2
import unittest STATE = {} class L1(object): @classmethod def setUp(cls): STATE['L1'] = 'setup' @classmethod def tearDown(cls): del STATE['L1'] class L2(object): @classmethod def setUp(cls): STATE['L2'] = 'setup' @classmethod def tearDown(cls): de...
yongshengwang/hue
refs/heads/master
desktop/core/ext-py/cx_Oracle-5.1.2/test/test.py
34
"""Runs all defined unit tests.""" import cx_Oracle import imp import os import sys import unittest print "Running tests for cx_Oracle version", cx_Oracle.version import TestEnv inSetup = (os.path.basename(sys.argv[0]).lower() == "setup.py") if len(sys.argv) > 1 and not inSetup: moduleNames = [os.path.splitext...
simonwydooghe/ansible
refs/heads/devel
test/units/module_utils/xenserver/test_set_vm_power_state.py
23
# -*- coding: utf-8 -*- # # Copyright: (c) 2019, Bojan Vitnik <bvitnik@mainstream.rs> # 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 import pytest from .FakeAnsibleModule import FailJs...
ingadhoc/sale
refs/heads/13.0
sale_exception_price_security/__manifest__.py
1
############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pub...
lukeis/selenium
refs/heads/master
py/test/selenium/webdriver/support/event_firing_webdriver_tests.py
65
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
vitorio/bite-project
refs/heads/master
deps/gdata-python-client/tests/gdata_tests/apps/migration/service_test.py
38
#!/usr/bin/python2.4 # # Copyright 2008 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 require...
FireBladeNooT/Medusa_1_6
refs/heads/master
lib/js2py/prototypes/jsobject.py
71
class ObjectPrototype: def toString(): return '[object %s]'%this.Class def valueOf(): return this.to_object() def toLocaleString(): return this.callprop('toString') def hasOwnProperty(prop): return this.get_own_property(prop.to_string().value) is not None def is...
aaron-zou/contact-words
refs/heads/master
process_dict.py
1
#!/usr/bin/env python3 import os import sys import re import argparse from string import (ascii_lowercase, punctuation) from trie import Trie PATH = os.path.dirname(os.path.realpath(__file__)) PUNCTATION_REGEX = re.compile('[{}]'.format(re.escape(punctuation))) def write_output(char, sorted_words): os.makedirs(o...
Detailscool/YHSpider
refs/heads/master
BillboardAnalysis/bill/spiders/billtoprock.py
1
from bill.items import BillItem from scrapy import Spider, Request class BillSpider(Spider): name = 'billtoprock_spider' allowed_ulrs = ['http://www.billboard.com/charts'] start_urls = ['http://www.billboard.com/charts/year-end/' + str(i) + '/hot-rock-songs' for i in range(2009, 2017)] def parse(self, response)...
fnouama/intellij-community
refs/heads/master
python/testData/resolve/multiFile/fromNamespacePackageImport/p1/m1.py
819
def foo(): pass
idlesign/django-siteprefs
refs/heads/master
siteprefs/tests/conftest.py
1
from pytest_djangoapp import configure_djangoapp_plugin pytest_plugins = configure_djangoapp_plugin({ 'SITEPREFS_EXPOSE_MODEL_TO_ADMIN': True, 'SITEPREFS_DISABLE_AUTODISCOVER': True, }, admin_contrib=True)
napkindrawing/ansible
refs/heads/devel
lib/ansible/modules/network/aos/aos_login.py
40
#!/usr/bin/python # # (c) 2017 Apstra Inc, <community@apstra.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 opt...
tdyas/pants
refs/heads/master
tests/python/pants_test/backend/codegen/antlr/java/test_java_antlr_library.py
1
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from textwrap import dedent from pants.backend.codegen.antlr.java.java_antlr_library import JavaAntlrLibrary from pants.base.exceptions import TargetDefinitionException from pants.build_g...
vsemionov/boomerang
refs/heads/master
boomerang/__init__.py
12133432
xfournet/intellij-community
refs/heads/master
python/testData/resolve/multiFile/fromImportExplicit/mypackage/ch/__init__.py
12133432
c0710204/edx-platform
refs/heads/master
common/test/acceptance/tests/lms/__init__.py
12133432
paulfurley/django-project-template
refs/heads/master
skel/project/apps/__init__.py
12133432
openstack/solum
refs/heads/master
solum/objects/sqlalchemy/migration/__init__.py
12133432
mrkulk/text-world
refs/heads/master
evennia/scripts/migrations/0005_auto_20150306_1441.py
14
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('scripts', '0004_auto_20150306_1354'), ] operations = [ migrations.DeleteModel( name='CheckSessions', ), ...
caiocsalvador/whats_the_craic
refs/heads/master
lib/python3.4/site-packages/django/conf/locale/en_AU/formats.py
504
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j M Y' # '25 Oc...
mancoast/CPythonPyc_test
refs/heads/master
cpython/260_test_property.py
51
# Test case for property # more tests are in test_descr import unittest from test.test_support import run_unittest class PropertyBase(Exception): pass class PropertyGet(PropertyBase): pass class PropertySet(PropertyBase): pass class PropertyDel(PropertyBase): pass class BaseClass(object): def ...
elainenaomi/sciwonc-dataflow-examples
refs/heads/master
dissertation2017/Experiment 1A/instances/11_2_workflow_full_10files_secondary_wmj_3sh_3rs_with_annot_with_proj_3s_hash/work/ubuntu/pegasus/example_workflow/20161108T032501+0000/ConfigDB_Calc_StatsCPUMemory_7.py
36
HOST = "ip-172-31-29-102.us-west-2.compute.internal:27017,ip-172-31-29-103.us-west-2.compute.internal:27017,ip-172-31-29-104.us-west-2.compute.internal:27017,ip-172-31-29-105.us-west-2.compute.internal:27017,ip-172-31-29-101.us-west-2.compute.internal:27017,ip-172-31-29-106.us-west-2.compute.internal:27017,ip-172-31-29...
kkampardi/Plinth
refs/heads/master
plinth/modules/names/tests/test_names.py
9
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
Semi-global/edx-platform
refs/heads/master
openedx/core/djangoapps/credit/migrations/0008_delete_credit_provider_timestamp.py
80
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'CreditRequest.timestamp' db.delete_column('credit_credi...
indirectlylit/kolibri
refs/heads/develop
kolibri/plugins/user/kolibri_plugin.py
2
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from kolibri.core.auth.constants.user_kinds import ANONYMOUS from kolibri.core.device.utils import get_device_setting from kolibri.core.device.utils import is_landing_page from kolibri.core.device.utils...
GaetanoCarlucci/CPULoadGenerator
refs/heads/master
utils/openLoopActuator.py
1
#Authors: Gaetano Carlucci # Giuseppe Cofano import time from Plot import realTimePlot class openLoopActuator(): """ Generates CPU load by tuning the sleep time """ def __init__(self, monitor, duration, cpu_core, plot): self.sleep_time = 0.03 self.monitor = monitor ...
alanjds/django_object_permissions
refs/heads/master
object_permissions/views/__init__.py
12133432
ggaughan/pipe2py
refs/heads/master
pipe2py/lib/__init__.py
12133432
2013Commons/hue
refs/heads/master
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/__init__.py
12133432
alexlo03/ansible
refs/heads/devel
lib/ansible/modules/cloud/dimensiondata/__init__.py
12133432
fmontoto/bot-valevista
refs/heads/master
src/test/get_page.py
1
"""Test call for testing web retrieve, don't call automatically, as it does a real http GET.""" import unittest from unittest import TestCase from src.utils import Rut from src import web class TestGetPage(TestCase): """Get a real page using dummy_rut.""" def setUp(self): self.dummy_rut = Rut.build_...
etkirsch/legends-of-erukar
refs/heads/master
erukar/content/conditions/negative/Frozen.py
1
from erukar.system.engine import Condition class Frozen(Condition): IsTemporary = True Duration = 1 # In ticks, where a tick is 5 seconds Incapacitates = True DamageMitigations = { 'bludgeoning': (-0.3, 0), 'piercing': (0.75, 0), 'slashing': (0.75, 0), 'ice': (1, 0), ...
parksandwildlife/borgcollector
refs/heads/master
layergroup/urls.py
124
try: from django.conf.urls import * except ImportError: # django < 1.4 from django.conf.urls.defaults import * # place app url patterns here
psawaya/Mental-Ginger
refs/heads/master
djangotoolbox/sites/dynamicsite.py
98
from django.conf import settings from django.core.cache import cache from django.contrib.sites.models import Site from djangotoolbox.utils import make_tls_property _default_site_id = getattr(settings, 'SITE_ID', None) SITE_ID = settings.__class__.SITE_ID = make_tls_property() class DynamicSiteIDMiddleware(object): ...
simartin/servo
refs/heads/master
tests/wpt/web-platform-tests/service-workers/service-worker/resources/update-max-aged-worker-imported-script.py
20
import time from wptserve.utils import isomorphic_encode def main(request, response): headers = [(b'Content-Type', b'application/javascript'), (b'Cache-Control', b'max-age=86400'), (b'Last-Modified', isomorphic_encode(time.strftime(u"%a, %d %b %Y %H:%M:%S GMT", time.gmtime())))] ...
BrianVermeire/PyFR
refs/heads/develop
pyfr/backends/opencl/provider.py
3
# -*- coding: utf-8 -*- import numpy as np import pyopencl as cl from pyfr.backends.base import (BaseKernelProvider, BasePointwiseKernelProvider, ComputeKernel) import pyfr.backends.opencl.generator as generator from pyfr.util import memoize class OpenCLKernelProvider(BaseKernelProvi...
glogiotatidis/snippets-service
refs/heads/master
snippets/base/bundles.py
2
import itertools import json import os from datetime import datetime from io import StringIO import brotli from django.conf import settings from django.core.files.base import ContentFile from django.core.files.storage import default_storage from django.db.models import Q from product_details import product_details fr...
dhruvagarwal/django
refs/heads/master
tests/proxy_model_inheritance/app2/__init__.py
12133432
bchess/pushmanager
refs/heads/master
tools/__init__.py
12133432
apache/libcloud
refs/heads/trunk
docs/examples/dns/durabledns/__init__.py
12133432
obutkalyuk/Python_15
refs/heads/master
fixture/__init__.py
12133432
MOA-2011/enigma2.pli4.0
refs/heads/master
lib/python/Components/ResourceManager.py
32
class ResourceManager: def __init__(self): self.resourceList = {} def addResource(self, name, resource): print "adding Resource", name self.resourceList[name] = resource print "resources:", self.resourceList def getResource(self, name): if not self.hasResource(name): return None return self.resourc...
MWisBest/android_kernel_amazon_bowser-common
refs/heads/aosp-5.0
scripts/rt-tester/rt-tester.py
11005
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # import os import sys import getopt import sh...
creativcoder/servo
refs/heads/master
tests/wpt/css-tests/tools/pytest/pytest.py
209
# PYTHON_ARGCOMPLETE_OK """ pytest: unit and functional testing with Python. """ __all__ = [ 'main', 'UsageError', 'cmdline', 'hookspec', 'hookimpl', '__version__', ] if __name__ == '__main__': # if run as a script or by 'python -m pytest' # we trigger the below "else" condition by the foll...
twitter/pants
refs/heads/master
tests/python/pants_test/process/test_subprocess.py
1
# coding=utf-8 # Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals from pants.process.subprocess import Subprocess from pants_test.subsystem.subsystem_util ...
momingsong/ns-3
refs/heads/master
src/applications/bindings/modulegen__gcc_ILP32.py
28
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)) ...