repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
MartynShaw/audacity | refs/heads/master | lib-src/lv2/sord/waflib/ConfigSet.py | 266 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import copy,re,os
from waflib import Logs,Utils
re_imp=re.compile('^(#)*?([^#=]*?)\ =\ (.*?)$',re.M)
class ConfigSet(object):
__slots__=('table','parent')
def __init__(self,... |
diogenesjf/userinfuser | refs/heads/master | fantasm/action.py | 28 | """ Fantasm: A taskqueue-based Finite State Machine for App Engine Python
Docs and examples: http://code.google.com/p/fantasm/
Copyright 2010 VendAsta Technologies 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 ob... |
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/gis/tests/geogapp/tests.py | 222 | """
Tests for geography support in PostGIS 1.5+
"""
import os
from django.contrib.gis import gdal
from django.contrib.gis.measure import D
from django.test import TestCase
from models import City, County, Zipcode
class GeographyTest(TestCase):
def test01_fixture_load(self):
"Ensure geography features load... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/263_test_future3.py | 238 | from __future__ import nested_scopes
from __future__ import division
import unittest
from test import test_support
x = 2
def nester():
x = 3
def inner():
return x
return inner()
class TestFuture(unittest.TestCase):
def test_floor_div_operator(self):
self.assertEqual(7 // 2, 3)
... |
helldorado/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_firewall_interface_policy6.py | 24 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 3 of the Lic... |
redhat-openstack/horizon | refs/heads/mitaka-patches | openstack_dashboard/dashboards/project/network_topology/instances/tables.py | 23 | # Copyright 2013 NTT Innovation Institute 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 applic... |
RichHelle/data-science-from-scratch | refs/heads/master | first-edition/code/charts.py | 12133432 | |
garnertb/geonode | refs/heads/master | geonode/upload/templatetags/__init__.py | 12133432 | |
yousharizvi1/django_workshop_poll_app | refs/heads/master | polls/__init__.py | 12133432 | |
perezg/infoxchange | refs/heads/master | BASE/lib/python2.7/site-packages/django/conf/locale/he/__init__.py | 12133432 | |
jcfr/mystic | refs/heads/master | models/venkataraman.py | 1 | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Author: Alta Fang (altafang @caltech and alta @princeton)
# Copyright (c) 1997-2015 California Institute of Technology.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.edu/project... |
gkarlin/django-jenkins | refs/heads/master | build/Django/tests/regressiontests/i18n/commands/__init__.py | 149 | from django.utils.translation import ugettext as _
# Translators: This comment should be extracted
dummy1 = _("This is a translatable string.")
# This comment should not be extracted
dummy2 = _("This is another translatable string.")
|
blueboxgroup/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_microversions.py | 42 | # Copyright 2014 IBM Corp.
#
# 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 t... |
gmission/gmission | refs/heads/remaster | hkust-gmission/test/concurrent_test.py | 1 | __author__ = 'chenzhao'
# coding:utf8
import gevent;
from gevent import monkey; monkey.patch_all()
import os
import sys
import json
import flask
import random
import urllib2
import datetime
from termcolor import colored
from geventhttpclient import HTTPClient
from geventhttpclient.url import URL
def color_prin... |
anurag-ks/eden | refs/heads/master | modules/s3db/msg.py | 7 | # -*- coding: utf-8 -*-
""" Sahana Eden Messaging Model
@copyright: 2009-2015 (c) Sahana Software Foundation
@license: MIT
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 wit... |
syphar/django | refs/heads/master | tests/i18n/test_compilation.py | 16 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gettext as gettext_module
import os
import stat
import unittest
from subprocess import Popen
from django.core.management import (
CommandError, call_command, execute_from_command_line,
)
from django.core.management.commands.makemessages import... |
ak2703/edx-platform | refs/heads/master | lms/djangoapps/courseware/features/staff_debug_info.py | 173 | """
Steps for staff_debug_info.feature lettuce tests
"""
from django.contrib.auth.models import User
from lettuce import world, step
from common import create_course, course_id
from courseware.courses import get_course_by_id
from instructor.access import allow_access
@step(u'i am staff member for the course "([^"]*)... |
nirmeshk/oh-mainline | refs/heads/master | vendor/packages/Django/django/conf/locale/vi/formats.py | 237 | # -*- 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 = r'\N\gà\y d \t\há\n\g n \nă\m Y'
T... |
zaihui/wechatpy | refs/heads/master | wechatpy/client/api/group.py | 4 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.utils import to_text
from wechatpy.client.api.base import BaseWeChatAPI
class WeChatGroup(BaseWeChatAPI):
def create(self, name):
"""
创建分组
详情请参考
http://mp.weixin.qq.com/wiki/0/56d992c6... |
mangadul/WhatsAppy | refs/heads/master | yowsup/layers/protocol_acks/protocolentities/__init__.py | 70 | from .ack import AckProtocolEntity
from .ack_incoming import IncomingAckProtocolEntity
from .ack_outgoing import OutgoingAckProtocolEntity |
mattvonrocketstein/smash | refs/heads/master | smashlib/ipy3x/qt/console/ansi_code_processor.py | 1 | """ Utilities for processing ANSI escape codes and special ASCII characters.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Standard library imports
from collections import namedtuple
import r... |
hail-is/hail | refs/heads/master | hail/python/hail/ir/register_aggregators.py | 1 | from .ir import register_aggregator
def register_aggregators():
from hail.expr.types import dtype
register_aggregator('ApproxCDF', (dtype('int32'),), (dtype('int32'),),
dtype('struct{values:array<int32>,ranks:array<int64>,_compaction_counts:array<int32>}'))
register_aggregator('Ap... |
pywinauto/pywinauto | refs/heads/atspi | pywinauto/windows/win32functions.py | 1 | # GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# ... |
labcodes/django | refs/heads/master | tests/foreign_object/models/empty_join.py | 25 | from django.db import models
from django.db.models.fields.related import (
ForeignObjectRel, ReverseManyToOneDescriptor,
)
from django.db.models.lookups import StartsWith
from django.db.models.query_utils import PathInfo
class CustomForeignObjectRel(ForeignObjectRel):
"""
Define some extra Field methods s... |
zozo123/buildbot | refs/heads/master | master/buildbot/test/unit/test_master.py | 1 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
mtndesign/mtnvim | refs/heads/master | myvim/bundle/ropevim/ftplugin/python/libs/rope/base/oi/doa.py | 59 | import cPickle as pickle
import marshal
import os
import socket
import subprocess
import sys
import tempfile
import threading
class PythonFileRunner(object):
"""A class for running python project files"""
def __init__(self, pycore, file_, args=None, stdin=None,
stdout=None, analyze_data=None... |
hectord/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/forms/models.py | 43 | """
Helper functions for creating Form classes from Django models
and database field objects.
"""
from django.db import connections
from django.utils.encoding import smart_unicode, force_unicode
from django.utils.datastructures import SortedDict
from django.utils.text import get_text_list, capfirst
from django.utils.t... |
crichardson17/starburst_atlas | refs/heads/master | SFH_comparison/SFH_plotter_IR.py | 1 | ############################################################
########## Plotting File for SFH comparison Plots ##########
################## Data read from Cloudy ###################
################ Helen Meskhidze, Fall 2015 ################
#################### Elon University #######################
#--------------... |
Limezero/libreoffice | refs/heads/master | helpcontent2/wiki-to-help/hhc.py | 2 | import platform, os
from executor import Executor
class HHC(object):
""" Class for execution of Html Help Compiler """
hhcexe="c:\\htmlhelp\\hhc.exe"
def __init__(self,**args):
"""
@args Arguments for Executor.__init__()
"""
self.args=args
def exWindows(self,source):
... |
yghannam/teuthology | refs/heads/master | teuthology/task/swift.py | 10 | """
Test Swfit api.
"""
from cStringIO import StringIO
from configobj import ConfigObj
import base64
import contextlib
import logging
import os
from teuthology import misc as teuthology
from teuthology import contextutil
from ..config import config as teuth_config
from ..orchestra import run
from ..orchestra.connectio... |
zhumingliang1209/Ardupilot | refs/heads/master | ardupilot/Tools/autotest/apm_unit_tests/dev/arducopter_climb_descend.py | 250 | import arducopter
def unit_test(mavproxy, mav):
'''A scripted flight plan'''
if (
arducopter.calibrate_level(mavproxy, mav) and
arducopter.arm_motors(mavproxy, mav) and
arducopter.takeoff(mavproxy,mav, alt_min=30, takeoff_throttle=1510) and
arducopter.change_alt(mavproxy, mav... |
pwong-mapr/private-hue | refs/heads/HUE-1096-abe | desktop/core/ext-py/Django-1.4.5/tests/regressiontests/context_processors/views.py | 200 | from django.core import context_processors
from django.shortcuts import render_to_response
from django.template.context import RequestContext
def request_processor(request):
return render_to_response('context_processors/request_attrs.html',
RequestContext(request, {}, processors=[context_processors.reques... |
bristy/login_app_flask | refs/heads/master | env/lib/python2.7/site-packages/werkzeug/debug/__init__.py | 280 | # -*- coding: utf-8 -*-
"""
werkzeug.debug
~~~~~~~~~~~~~~
WSGI application traceback debugger.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import json
import mimetypes
from os.path import join, dirname, basename, isfile
... |
iamutkarshtiwari/sympy | refs/heads/master | sympy/plotting/pygletplot/plot_rotation.py | 94 | from __future__ import print_function, division
try:
from pyglet.gl.gl import c_float
except ImportError:
pass
from pyglet.gl import *
from math import sqrt as _sqrt, acos as _acos
def cross(a, b):
return (a[1] * b[2] - a[2] * b[1],
a[2] * b[0] - a[0] * b[2],
a[0] * b[1] - a[1] *... |
weese/seqan | refs/heads/master | misc/seqan_instrumentation/bin/classes/sync.py | 6 | import os
import subprocess
class Sync(object):
MAX_REVISION_LENGTH = 16
def __init__(self, bin_dir):
self.bin_dir = bin_dir
def make_comparison_copy(self, from_dir, to_dir, excluded_resources):
if(os.name == "nt"):
p = subprocess.Popen([self.bin_dir + "/robocopy.exe", from_dir, to_dir, "/w:1", "/... |
ianmiell/shutit-test | refs/heads/master | test/bash_tests/2/test2.py | 1 | from shutit_module import ShutItModule
class test2(ShutItModule):
def build(self, shutit):
shutit.send('rm -rf git-101-tutorial')
shutit.send('git clone https://github.com/ianmiell/git-101-tutorial')
shutit.send('pushd git-101-tutorial')
orig_expect = shutit.get_default_shutit_pexpect_session_expect()
new... |
AnderEnder/ansible-modules-extras | refs/heads/devel | notification/mail.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.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 Lice... |
waytai/odoo | refs/heads/8.0 | addons/l10n_de/__init__.py | 693 | # -*- encoding: 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 t... |
NeostreamTechnology/Microservices | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/upload_docs.py | 173 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
import os
import socket
import zipfile
import tempfile
import ... |
cpennington/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/exceptions.py | 22 | class InvalidDefinitionError(Exception):
pass
class NotFoundError(Exception):
pass
class ProcessingError(Exception):
'''
An error occurred while processing a request to the XModule.
For example: if an exception occurs while checking a capa problem.
'''
pass
class InvalidVersionError(Ex... |
nfco/netforce | refs/heads/master | netforce_messaging/netforce_messaging/__init__.py | 16 | # Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... |
TathagataChakraborti/resource-conflicts | refs/heads/master | PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/test/test_imgfile.py | 43 | #! /usr/bin/env python
"""Simple test script for imgfile.c
Roger E. Masse
"""
from test.test_support import verbose, unlink, findfile
import imgfile, uu, os
def main():
uu.decode(findfile('testrgb.uue'), 'test.rgb')
uu.decode(findfile('greyrgb.uue'), 'greytest.rgb')
# Test a 3 byte color image
... |
bop/foundation | refs/heads/master | lib/python2.7/site-packages/django/contrib/auth/context_processors.py | 57 | # PermWrapper and PermLookupDict proxy the permissions system into objects that
# the template system can understand.
class PermLookupDict(object):
def __init__(self, user, module_name):
self.user, self.module_name = user, module_name
def __repr__(self):
return str(self.user.get_all_permission... |
ubc/edx-platform | refs/heads/release | pavelib/utils/test/suites/bokchoy_suite.py | 57 | """
Class used for defining and running Bok Choy acceptance test suite
"""
from time import sleep
from paver.easy import sh
from pavelib.utils.test.suites.suite import TestSuite
from pavelib.utils.envs import Env
from pavelib.utils.test import bokchoy_utils
from pavelib.utils.test import utils as test_utils
try:
... |
benrudolph/commcare-hq | refs/heads/master | corehq/apps/registration/forms.py | 1 | from corehq.apps.programs.models import Program
from corehq.apps.users.models import CouchUser
from django import forms
from django.contrib.auth.models import User
from corehq.apps.users.forms import RoleForm, SupplyPointSelectWidget
import re
from corehq.apps.domain.forms import clean_password, max_pwd
from django.cor... |
shsingh/ansible | refs/heads/devel | lib/ansible/modules/cloud/centurylink/clc_publicip.py | 47 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['previe... |
helldorado/ansible | refs/heads/devel | lib/ansible/module_utils/network/slxos/__init__.py | 12133432 | |
sjhewitt/graphene | refs/heads/master | examples/__init__.py | 12133432 | |
recto/lynda_uar_python_django | refs/heads/master | ch02/02_04/start/firstdjango/inventory/__init__.py | 12133432 | |
MechanisM/django-hosts | refs/heads/develop | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# django-hosts documentation build configuration file, created by
# sphinx-quickstart on Mon Sep 26 16:39:46 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.
#
... |
rehandalal/morgoth | refs/heads/master | morgoth/addons/tests/__init__.py | 1 | import factory
from tempfile import NamedTemporaryFile
from unittest.mock import patch
from morgoth.addons.models import Addon, AddonGroup
from morgoth.base.tests import FuzzyUnicode, FuzzyVersionNumber
FAKE_XPI_HASH = ('c383ffa8d660821158c1313690e7676eaeb917ac12de0bde06e3059920d106e8'
'656a6273655... |
smendes/django-andablog | refs/heads/master | demo/common/migrations/0001_initial.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='User',
... |
fnouama/intellij-community | refs/heads/master | python/testData/surround/SurroundWithIf.py | 150 | def foo():
<selection>print "hello"</selection>
|
bocaaust/FreshLife | refs/heads/master | django_project/env/lib/python2.7/site-packages/django/views/generic/detail.py | 108 | from __future__ import unicode_literals
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.db import models
from django.http import Http404
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, ContextMixin, View
class Sin... |
GuillaumeGomez/servo | refs/heads/master | tests/wpt/css-tests/tools/sslutils/openssl.py | 61 | import functools
import os
import random
import shutil
import subprocess
import tempfile
from datetime import datetime
class OpenSSL(object):
def __init__(self, logger, binary, base_path, conf_path, hosts, duration,
base_conf_path=None):
"""Context manager for interacting with OpenSSL.
... |
QQuick/Transcrypt | refs/heads/master | transcrypt/development/automated_tests/transcrypt/proxies/__init__.py | 1 | from org.transcrypt.stubs.browser import __pragma__
def run (autoTester):
class CodedStore:
def __init__ (self):
try:
__pragma__ ('js', '{}', 'self ["__dict__"] = {}')
except:
pass
def __setattr__ (self, name, message):
... |
pdfminer/pdfminer.six | refs/heads/develop | pdfminer/converter.py | 1 | import io
import logging
import re
import sys
from .pdfdevice import PDFTextDevice
from .pdffont import PDFUnicodeNotDefined
from .layout import LTContainer
from .layout import LTPage
from .layout import LTText
from .layout import LTLine
from .layout import LTRect
from .layout import LTCurve
from .layout import LTFigur... |
maheshakya/scikit-learn | refs/heads/master | examples/linear_model/plot_logistic_l1_l2_sparsity.py | 384 | """
==============================================
L1 Penalty and Sparsity in Logistic Regression
==============================================
Comparison of the sparsity (percentage of zero coefficients) of solutions when
L1 and L2 penalty are used for different values of C. We can see that large
values of C give mo... |
M4sse/chromium.src | refs/heads/nw12 | build/android/pylib/utils/run_tests_helper.py | 113 | # 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.
"""Helper functions common to native, java and host-driven test runners."""
import logging
import sys
import time
class CustomFormatter(logging.Format... |
dalegregory/odoo | refs/heads/8.0 | addons/account/test/test_parent_structure.py | 432 | # -*- 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... |
chokribr/invenio | refs/heads/master | invenio/ext/sqlalchemy/types/pickle_binary.py | 17 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012, 2013, 2014 CERN.
#
# Invenio 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... |
adlnet-archive/edx-platform | refs/heads/master | lms/djangoapps/django_comment_client/migrations/0001_initial.py | 188 | # -*- coding: 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):
# Adding model 'Role'
db.create_table('django_comment_client_role', (
('id', self.gf('django.db.... |
JohnTheodore/cloud-custodian | refs/heads/master | tests/test_s3.py | 2 | # Copyright 2015-2017 Capital One Services, LLC
#
# 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 ... |
WoLpH/CouchPotatoServer | refs/heads/master | libs/sqlalchemy/ext/mutable.py | 18 | # ext/mutable.py
# Copyright (C) 2005-2013 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
"""Provide support for tracking of in-place changes to scalar values,
which are propaga... |
berquist/cclib | refs/heads/master | test/method/testmoments.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2018, the cclib development team
#
# This file is part of cclib (http://cclib.github.io) and is distributed under
# the terms of the BSD 3-Clause License.
"""Test the Moments method in cclib"""
import unittest
from unittest import mock
import numpy as np
from numpy.testing i... |
dunkhong/grr | refs/heads/master | grr/server/grr_response_server/gui/api_plugins/report_plugins/server_report_plugins.py | 2 | #!/usr/bin/env python
"""UI server report handling classes."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
import math
import re
from future.builtins import range
from future.utils import iteritems
from grr_response_core.lib import... |
don-github/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/transcripts.py | 54 | # disable missing docstring
# pylint: disable=missing-docstring
import os
from lettuce import world, step
from django.conf import settings
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.exceptions import NotFoundError
from splinter.request_han... |
tlhallock/line-search-dfo | refs/heads/master | python/algorithms/filter_linesearch.py | 1 | from math import inf as infinity
from numpy import int as integral
from numpy import bmat as blockmat
from numpy import concatenate
from numpy import dot
from numpy import empty
from numpy import zeros
from numpy.linalg import cond as condition_number
from numpy.linalg impo... |
ofgulban/scikit-image | refs/heads/ncut-rag-options | skimage/feature/tests/test_match.py | 11 | import numpy as np
from numpy.testing import assert_equal, assert_raises
from skimage import data
from skimage import transform as tf
from skimage.color import rgb2gray
from skimage.feature import (BRIEF, match_descriptors,
corner_peaks, corner_harris)
def test_binary_descriptors_unequal_... |
amitsaha/learning | refs/heads/master | recipes/print_all_leaders.py | 1 | '''
Print all leaders from an array:
A leader is an element for which all the numbers to it's right are
either equal or less than it
'''
from __future__ import print_function
def find_leaders(arr):
max = arr[-1]
for elem in arr[::-1]:
if elem >= max:
print(elem)
max = elem
f... |
Epse/EpPos | refs/heads/master | web/pos/helper.py | 1 | from django.contrib.auth.models import User
from .models import Order, Cash, Order_Item, Setting
def get_currency():
"""
Gets the current currency from the Settings database table
"""
currency, is_created = Setting.objects.get_or_create(key="currency")
if is_created:
currency.value = "€"... |
jlspyaozhongkai/Uter | refs/heads/master | third_party_backup/Python-2.7.9/Lib/stat.py | 319 | """Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... |
rledisez/shinken | refs/heads/master | test/test_nested_hostgroups.py | 17 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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 F... |
holmes/intellij-community | refs/heads/master | python/testData/quickFixes/AddCallSuperQuickFixTest/newStyle_after.py | 80 |
class A(object):
def __init__(self):
a = 1
class C(A):
def __init__(self):
super(C, self).__init__()
def foo(self):
pass |
CredoReference/edx-platform | refs/heads/integration-hawthorn-qa | lms/djangoapps/commerce/migrations/0004_auto_20160531_0950.py | 50 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('commerce', '0003_auto_20160329_0709'),
]
operations = [
migrations.AddField(
model_name='commerceconfiguration',... |
hep-gc/glint-horizon | refs/heads/master | horizon/forms/fields.py | 2 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nebula, 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
#
# ... |
julian-seward1/servo | refs/heads/master | tests/wpt/harness/wptrunner/config.py | 196 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import ConfigParser
import os
import sys
from collections import OrderedDict
here = os.path.split(__file__)[0]
class C... |
tinfoil/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/generator-output/gyptest-rules.py | 151 | #!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies --generator-output= behavior when using rules.
"""
import TestGyp
test = TestGyp.TestGyp()
test.writable(test.workpath('rule... |
jinankjain/zamboni | refs/heads/master | apps/zadmin/__init__.py | 22 | from django.shortcuts import render
from django.template import loader
from django.template.response import SimpleTemplateResponse
import jingo
def jinja_for_django(template_name, context=None, **kw):
"""
If you want to use some built in logic (or a contrib app) but need to
override the templates to work... |
jordotech/satchmofork | refs/heads/master | scripts/clonesatchmo.py | 6 | #!/usr/bin/env python
"""
This is the installation script for Satchmo. It will create the base Satchmo configuration.
Before running this script, you must have python and pip installed.
It is also recommended that you install Python Imaging using your distribution's
package method.
The simplest way to install Satchmo... |
cloudera/hue | refs/heads/master | desktop/libs/notebook/src/notebook/models.py | 2 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
blueboxgroup/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/contrib/test_fixed_ips.py | 12 | # Copyright 2012 IBM Corp.
#
# 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 t... |
chrisfilda/edx_platform | refs/heads/master | lms/djangoapps/django_comment_client/migrations/__init__.py | 12133432 | |
hobarrera/django | refs/heads/master | django/test/testcases.py | 11 | from __future__ import unicode_literals
import difflib
import errno
import json
import os
import posixpath
import socket
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util... |
Sciprios/EvolutionaryPartyProblemSimulator | refs/heads/master | PartyProblemSimulator/BooleanEquation/AndNode.py | 2 | from PartyProblemSimulator.BooleanEquation.CombinationNode import CombinationNode
class AndNode(CombinationNode):
""" This class allows two child nodes to be AND'ed together. """
def evaluate(self, input_vector):
""" And's two child nodes to produce an output. """
return (self._lhs_child.evalu... |
2uller/LotF | refs/heads/master | App/Lib/site-packages/numpy/distutils/from_template.py | 43 | #!/usr/bin/python
"""
process_file(filename)
takes templated file .xxx.src and produces .xxx file where .xxx
is .pyf .f90 or .f using the following template rules:
'<..>' denotes a template.
All function and subroutine blocks in a source file with names that
contain '<..>' will be replicated according to ... |
roadmapper/ansible | refs/heads/devel | test/units/modules/network/fortios/test_fortios_wireless_controller_hotspot20_h2qp_conn_capability.py | 21 | # Copyright 2019 Fortinet, Inc.
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
edmorley/django | refs/heads/master | django/conf/locale/da/formats.py | 65 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = 'j. F Y H:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMA... |
zcm19900902/picasso-graphic | refs/heads/master | tools/gyp/tools/pretty_sln.py | 806 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
UOMx/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/xml/test_inheritance.py | 193 | """
Test that inherited fields work correctly when parsing XML
"""
from nose.tools import assert_equals, assert_in # pylint: disable=no-name-in-module
from xmodule.tests.xml import XModuleXmlImportTest
from xmodule.tests.xml.factories import CourseFactory, SequenceFactory, ProblemFactory, XmlImportFactory
class Tes... |
ubirch/aws-tools | refs/heads/master | virtual-env/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer/__init__.py | 1731 | from __future__ import absolute_import, division, unicode_literals
from .. import treewalkers
from .htmlserializer import HTMLSerializer
def serialize(input, tree="etree", format="html", encoding=None,
**serializer_opts):
# XXX: Should we cache this?
walker = treewalkers.getTreeWalker(tree)
... |
wibowo87/doorsale | refs/heads/master | doorsale/payments/migrations/0001_initial.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.core.management import call_command
def load_data(apps, schema_editor):
call_command('loaddata', 'initial_data', app_label='payments', verbosity=0)
class Migration(migrations.Migration):
de... |
rrrrrr8/vnpy | refs/heads/master | vnpy/api/ctp/pyscript/generate_md_functions.py | 25 | # encoding: UTF-8
__author__ = 'CHENXY'
from string import join
from ctp_struct import structDict
def processCallBack(line):
orignalLine = line
line = line.replace('\tvirtual void ', '') # 删除行首的无效内容
line = line.replace('{};\n', '') # 删除行尾的无效内容
content = line.split('(')
cbNa... |
bohlian/erpnext | refs/heads/develop | erpnext/manufacturing/__init__.py | 12133432 | |
ammarkhann/FinalSeniorCode | refs/heads/master | lib/python2.7/site-packages/nbformat/v2/tests/__init__.py | 12133432 | |
Lokke/eden | refs/heads/master | modules/ClimateDataPortal/DSL/Stringification.py | 53 |
from . import *
def Months__str__(month_filter):
return "Months(%s)" % (
", ".join(
Months.sequence[month_number + 1]
for month_number in month_filter.month_numbers
)
)
Months.__str__ = Months__str__
def From__str__(from_date):
original_args = [from_date.year]
... |
Loudr/asana-hub | refs/heads/master | asana_hub/actions/__init__.py | 1 | """actions module contains all actions."""
import os
import glob
modules = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = [ os.path.basename(f)[:-3] for f in modules]
|
bob123bob/Sick-Beard | refs/heads/development | cherrypy/_cptree.py | 45 | """CherryPy Application and Tree objects."""
import os
import cherrypy
from cherrypy import _cpconfig, _cplogging, _cprequest, _cpwsgi, tools
from cherrypy.lib import httputil
class Application(object):
"""A CherryPy Application.
Servers and gateways should not instantiate Request objects directly.
... |
htzy/bigfour | refs/heads/master | cms/djangoapps/xblock_config/migrations/__init__.py | 12133432 | |
pombreda/swarming | refs/heads/master | appengine/components/components/auth/proto/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.