repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
kaysinds/PoopDog | refs/heads/master | dicts/fi/finnish_syllables.py | 4 | # coding=utf-8
from finnish_functions import *
# -*- coding: utf-8 -*-
# note: initial consonant cluster not listed in inseparable clusters will be split up (e.g., traffic -> .t.raf.fic.)
# for a word w, syllable boundaries are represented by a list l of length len(w)+1
# l[i] = 1 iff w[i] should be preceded by a sy... |
chrisdjscott/Atoman | refs/heads/master | atoman/__init__.py | 1 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
|
idea4bsd/idea4bsd | refs/heads/idea4bsd-master | python/testData/completion/exportedConstants/a.after.py | 83 | from Xkinter import *
LEFT<caret>
|
allmightyspiff/softlayer-python | refs/heads/master | SoftLayer/CLI/securitygroup/edit.py | 4 | """Edit details of a security group."""
# :license: MIT, see LICENSE for more details.
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
@click.command()
@click.argument('group_id')
@click.option('--name', '-n',
help="The name of the security grou... |
yongli3/rt-thread | refs/heads/master | bsp/rm48x50/rtconfig.py | 3 | import os
# toolchains options
ARCH='arm'
CPU='cortex-r4'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'C:\Program Files\GNU Tools ARM Embedded\4.7 2013q3\bin'
elif CROSS_TOOL == 'keil':
PLATFORM = 'armcc'
EXEC_PA... |
TheLampshady/all_voice | refs/heads/master | all_voice/handler/lambda_function.py | 1 | from all_voice.models import AlexaSkill
def lambda_handler(event, context={}):
return AlexaSkill(event=event).response()
|
simonalpha/cm_tools | refs/heads/master | cm_tools/__init__.py | 1 | #!/usr/bin/env python
"""
Cloudman CLI Launcher v0.0.1
Usage: cm-launcher [options]
Options:
--access_key=key
--secret_key=key
--cluster_name=name Set the cluster name
--cluster_type=type Specify cluster type (Test/Data/Galaxy/Shared_cluster)
--default_bucket_url=url Set default... |
ksmit799/Toontown-Source | refs/heads/master | toontown/ai/HalloweenHolidayDecorator.py | 1 | # TODO: Load DNA file 'loadDNAFile'
from panda3d.core import Vec4, CSDefault, TransformState, NodePath, TransparencyAttrib
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import *
from direct.interval.IntervalGlobal import *
import HolidayDecorator
from toontown.toonbase import Too... |
AndresCidoncha/BubecasBot | refs/heads/master | telegram/forcereply.py | 3 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
buptlsl/learn-python3 | refs/heads/master | samples/multitask/multi_threading.py | 21 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time, threading
# 新线程执行的代码:
def loop():
print('thread %s is running...' % threading.current_thread().name)
n = 0
while n < 5:
n = n + 1
print('thread %s >>> %s' % (threading.current_thread().name, n))
time.sleep(1)
print('th... |
OneBitSoftware/jwtSample | refs/heads/master | src/Spa/env1/Lib/site-packages/pkg_resources/__init__.py | 40 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... |
faeli/joke | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name = 'joke',
version = '0.0.1',
# ...,
setup_requires = ['pytest-runner'],
tests_require = ['pytest']
# ...,
)
|
TheoRettisch/p2pool-hirocoin | refs/heads/master | wstools/WSDLTools.py | 292 | # Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISC... |
Verizon/libcloud | refs/heads/trunk | docs/examples/compute/vsphere/connect_host.py | 56 | from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
cls = get_driver(Provider.VSPHERE)
driver = cls(host='192.168.1.100',
username='admin', password='admin')
print(driver.list_nodes())
# ...
|
romain-li/edx-platform | refs/heads/master | openedx/core/djangoapps/theming/tests/test_microsites.py | 26 | """
Tests for microsites and comprehensive themes.
"""
from django.conf import settings
from django.test import TestCase
from django.contrib.sites.models import Site
from openedx.core.djangoapps.theming.models import SiteTheme
from openedx.core.djangolib.testing.utils import skip_unless_lms
@skip_unless_lms
clas... |
thaim/ansible | refs/heads/fix-broken-link | test/integration/targets/ansible-doc/library/test_docs_no_metadata.py | 64 | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: test_docs_no_metadata
short_description: Test module
description:
- Test module
author:
- Ansible Core Team
'''
EXAMPLES = '''
'''
RETURN = '''
'''
from ansible.module_ut... |
tbeadle/django | refs/heads/master | django/conf/locale/fy/formats.py | 852 | # -*- 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 =
# TIME_FORMAT =
# DATETIME_FORMA... |
callowayproject/django-elections | refs/heads/master | elections/management/commands/import_bios.py | 1 | import time
import datetime
from django.core.management.base import LabelCommand, CommandError
from elections.models import Candidate
class Command(LabelCommand):
args = '[file1 file2 ...]'
help = 'Imports candidate biographies'
def handle_label(self, label, **options):
import csv
bios = ... |
nkmk/python-snippets | refs/heads/master | notebook/numpy_ndim_shape_size.py | 1 | import numpy as np
a_1d = np.arange(3)
print(a_1d)
# [0 1 2]
a_2d = np.arange(12).reshape((3, 4))
print(a_2d)
# [[ 0 1 2 3]
# [ 4 5 6 7]
# [ 8 9 10 11]]
a_3d = np.arange(24).reshape((2, 3, 4))
print(a_3d)
# [[[ 0 1 2 3]
# [ 4 5 6 7]
# [ 8 9 10 11]]
#
# [[12 13 14 15]
# [16 17 18 19]
# [20 2... |
Beeblio/django | refs/heads/master | django/core/handlers/wsgi.py | 3 | from __future__ import unicode_literals
import codecs
import logging
import sys
from io import BytesIO
from threading import Lock
import warnings
from django import http
from django.conf import settings
from django.core import signals
from django.core.handlers import base
from django.core.urlresolvers import set_scri... |
talhajaved/nyuadmarket | refs/heads/master | flask/lib/python2.7/site-packages/whoosh/idsets.py | 52 | """
An implementation of an object that acts like a collection of on/off bits.
"""
import operator
from array import array
from bisect import bisect_left, bisect_right, insort
from whoosh.compat import integer_types, izip, izip_longest, next, xrange
from whoosh.util.numeric import bytes_for_bits
# Number of '1' bit... |
scrollback/kuma | refs/heads/master | vendor/packages/pyparsing/examples/apicheck.py | 6 | # apicheck.py
# A simple source code scanner for finding patterns of the form
# [ procname1 $arg1 $arg2 ]
# and verifying the number of arguments
from pyparsing import *
# define punctuation and simple tokens for locating API calls
LBRACK,RBRACK,LBRACE,RBRACE = map(Suppress,"[]{}")
ident = Word(alph... |
jamdin/jdiner-mobile-byte3 | refs/heads/master | lib/numpy/numarray/matrix.py | 102 |
__all__ = ['Matrix']
from numpy import matrix as _matrix
def Matrix(data, typecode=None, copy=1, savespace=0):
return _matrix(data, typecode, copy=copy)
|
varunagrawal/azure-services | refs/heads/master | varunagrawal/site-packages/django/contrib/gis/db/backends/spatialite/introspection.py | 401 | from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.sqlite3.introspection import DatabaseIntrospection, FlexibleFieldLookupDict
class GeoFlexibleFieldLookupDict(FlexibleFieldLookupDict):
"""
Sublcass that includes updates the `base_data_types_reverse` dict
for geometry field types.
... |
blockstack/packaging | refs/heads/master | imported/future/src/future/backports/email/mime/application.py | 83 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Keith Dart
# Contact: [email protected]
"""Class representing application/* type MIME documents."""
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from future.backports.email import encode... |
pkreissl/espresso | refs/heads/python | testsuite/scripts/tutorials/test_visualization.py | 3 | # Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 versio... |
sorenk/ansible | refs/heads/devel | lib/ansible/modules/system/debconf.py | 82 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Brian Coca <[email protected]>
# 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_ve... |
ilya-klyuchnikov/buck | refs/heads/master | third-party/py/argparse/doc/source/conf.py | 84 | # -*- coding: utf-8 -*-
#
# argparse documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 27 01:27:16 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.
#
# Al... |
fretsonfire/fof-python | refs/heads/master | src/Object.py | 1 | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... |
wdmchaft/taskcoach | refs/heads/master | taskcoachlib/widgets/buttonbox.py | 1 | '''
Task Coach - Your friendly task manager
Copyright (C) 2004-2010 Task Coach developers <[email protected]>
Task Coach 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
... |
maxrp/autopsy | refs/heads/develop | pythonExamples/Aug2015DataSourceTutorial/RunExe.py | 2 | # Sample module in the public domain. Feel free to use this as a template
# for your modules (and you can remove this header and take complete credit
# and liability)
#
# Contact: Brian Carrier [carrier <at> sleuthkit [dot] org]
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is f... |
Darkmer/masterchief | refs/heads/master | CourseBuilderenv/lib/python2.7/site-packages/setuptools/py27compat.py | 958 | """
Compatibility Support for Python 2.7 and earlier
"""
import sys
def get_all_headers(message, key):
"""
Given an HTTPMessage, return all headers matching a given key.
"""
return message.get_all(key)
if sys.version_info < (3,):
def get_all_headers(message, key):
return message.getheaders(key)
|
jeffchao/xen-3.3-tcg | refs/heads/master | tools/xm-test/tests/create/07_create_mem64_pos.py | 42 | #!/usr/bin/python
# Copyright (C) International Business Machines Corp., 2005
# Author: Li Ge <[email protected]>
# Test Description:
# Positive Test
# Test for creating domain with mem=64.
import sys
import re
import time
from XmTestLib import *
rdpath = os.environ.get("RD_PATH")
if not rdpath:
rdpath = "../ramd... |
dagwieers/ansible | refs/heads/devel | lib/ansible/modules/network/aci/mso_schema_template_anp_epg.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (@dagwieers) <[email protected]>
# 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_ve... |
alekz112/statsmodels | refs/heads/master | statsmodels/tsa/tests/test_seasonal.py | 27 | import numpy as np
from numpy.testing import assert_almost_equal, assert_equal, assert_raises
from statsmodels.tsa.seasonal import seasonal_decompose
from pandas import DataFrame, DatetimeIndex
class TestDecompose:
@classmethod
def setupClass(cls):
# even
data = [-50, 175, 149, 214, 247, 237, ... |
goblinr/omim | refs/heads/master | search/pysearch/run_search_engine.py | 7 | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import os
import pysearch as search
DIR = os.path.dirname(__file__)
RESOURCE_PATH = os.path.realpath(os.path.join(DIR, '..', '..', 'data'))
MWM_PATH = os.path.realpath(os.path.join(DIR, '..', '..', 'data'))
parser... |
mozilla/make.mozilla.org | refs/heads/master | vendor-local/lib/python/celery/tests/test_backends/test_mongodb.py | 14 | from __future__ import absolute_import
import uuid
from mock import MagicMock, Mock, patch, sentinel
from nose import SkipTest
from celery import states
from celery.backends.mongodb import MongoBackend
from celery.tests.utils import Case
try:
import pymongo
except ImportError:
pymongo = None # noqa
COLL... |
davidmoravek/python-beaver | refs/heads/master | beaver/transports/stomp_transport.py | 7 | # -*- coding: utf-8 -*-
import stomp
from beaver.transports.base_transport import BaseTransport
from beaver.transports.exception import TransportException
class StompTransport(BaseTransport):
def __init__(self, beaver_config, logger=None):
"""
Mosquitto client initilization. Once this this trans... |
plecto/motorway | refs/heads/master | examples/ramps.py | 1 | import time
import uuid
from motorway.contrib.amazon_kinesis.ramps import KinesisRamp
from motorway.contrib.amazon_kinesis.intersections import KinesisInsertIntersection
from motorway.contrib.amazon_sqs.ramps import SQSRamp
from motorway.messages import Message
from motorway.ramp import Ramp
import random
class WordR... |
shakamunyi/tensorflow | refs/heads/master | tensorflow/compiler/tests/argminmax_test.py | 5 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
vdemeester/docker-py | refs/heads/master | docker/api/image.py | 3 | import logging
import os
import six
from .. import auth, errors, utils
from ..constants import DEFAULT_DATA_CHUNK_SIZE
log = logging.getLogger(__name__)
class ImageApiMixin(object):
@utils.check_resource('image')
def get_image(self, image, chunk_size=DEFAULT_DATA_CHUNK_SIZE):
"""
Get a tar... |
janslow/boto | refs/heads/develop | tests/integration/rds/test_db_subnet_group.py | 130 | # Copyright (c) 2013 Franc Carter [email protected]
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... |
jness/django-rest-framework | refs/heads/master | tests/urls.py | 94 | """
Blank URLConf just to keep the test suite happy
"""
urlpatterns = []
|
akatsoulas/snippets-service | refs/heads/master | snippets/base/tests/test_admin.py | 2 | from django.contrib.auth.models import User
from django.test.client import RequestFactory
from mock import Mock, patch
from snippets.base.admin import SnippetAdmin, SnippetTemplateAdmin
from snippets.base.models import Snippet, SnippetTemplate, SnippetTemplateVariable
from snippets.base.tests import SnippetTemplateFa... |
pneerincx/easybuild-framework | refs/heads/master | test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme.py | 9 | ##
# Copyright 2013-2015 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
igemsoftware/SYSU-Software2013 | refs/heads/master | project/Python27/Lib/unittest/result.py | 223 | """Test result object"""
import os
import sys
import traceback
from StringIO import StringIO
from . import util
from functools import wraps
__unittest = True
def failfast(method):
@wraps(method)
def inner(self, *args, **kw):
if getattr(self, 'failfast', False):
self.stop()
retur... |
de-vri-es/qtile | refs/heads/develop | libqtile/xcbq.py | 1 | # Copyright (c) 2009-2010 Aldo Cortesi
# Copyright (c) 2010 matt
# Copyright (c) 2010, 2012, 2014 dequis
# Copyright (c) 2010 Philip Kranz
# Copyright (c) 2010-2011 Paul Colomiets
# Copyright (c) 2011 osebelin
# Copyright (c) 2011 Mounier Florian
# Copyright (c) 2011 Kenji_Takahashi
# Copyright (c) 2011 Tzbob
# Copyrig... |
rebost/django | refs/heads/master | tests/regressiontests/pagination_regress/tests.py | 9 | from __future__ import unicode_literals
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from django.utils.unittest import TestCase
class PaginatorTests(TestCase):
"""
Tests for the Paginator and Page classes.
"""
def check_paginator(self, params, output):
"""
... |
martydill/url_shortener | refs/heads/master | code/venv/lib/python2.7/site-packages/flask_restful/utils/cors.py | 42 | from datetime import timedelta
from flask import make_response, request, current_app
from functools import update_wrapper
def crossdomain(origin=None, methods=None, headers=None, expose_headers=None,
max_age=21600, attach_to_all=True,
automatic_options=True, credentials=False):
"""... |
sephalon/python-ivi | refs/heads/master | ivi/agilent/agilentE3644A.py | 7 | """
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2014 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... |
pombredanne/metamorphosys-desktop | refs/heads/master | metamorphosys/META/models/DynamicsTeam/MasterInterpreter/post_processing/common/post_processing_class.py | 18 | # Copyright (C) 2013-2015 MetaMorph Software, Inc
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this data, including any software or models in source or binary
# form, as well as any drawings, specifications, and documentation
# (collectively "the Data"), to deal in the Data ... |
ruibarreira/linuxtrail | refs/heads/master | usr/lib/python3.4/encodings/shift_jisx0213.py | 816 | #
# shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213
#
# Written by Hye-Shik Chang <[email protected]>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... |
ivanhorvath/openshift-tools | refs/heads/prod | scripts/monitoring/cron-openshift-pruner.py | 4 | #!/usr/bin/env python
# vim: expandtab:tabstop=4:shiftwidth=4
'''
Prune images/builds/deployments
'''
#
# Copyright 2016 Red Hat 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 ... |
swayf/pyLoad | refs/heads/master | module/plugins/crypter/QuickshareCzFolder.py | 2 | # -*- coding: utf-8 -*-
import re
from module.plugins.Crypter import Crypter
class QuickshareCzFolder(Crypter):
__name__ = "QuickshareCzFolder"
__type__ = "crypter"
__pattern__ = r"http://(www\.)?quickshare.cz/slozka-\d+.*"
__version__ = "0.1"
__description__ = """Quickshare.cz Folder Plugin"""
... |
apg/canoe | refs/heads/master | canoe/watch.py | 1 | import os
import sys
import time
import threading
from data import Buffer
class WatchedFile(object):
def __init__(self, fname, bufn=0):
self.filename = fname
self.fd = open(fname, 'r')
self.st = os.stat(fname)
self.buf = Buffer(bufn)
self.ends_n... |
dgault/bioformats | refs/heads/develop | components/xsd-fu/python/genshi/filters/tests/test_html.py | 14 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2006-2009 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://genshi.edgewall.org/wiki/License.
#
# This software consist... |
mrshelly/openerp71313 | refs/heads/master | openerp/addons/hr_recruitment/__openerp__.py | 52 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
laurent-george/weboob | refs/heads/master | weboob/applications/qhandjoob/qhandjoob.py | 7 | # -*- coding: utf-8 -*-
# Copyright(C) 2013 Sébastien Monel
#
# This file is part of weboob.
#
# weboob 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 op... |
mrrrgn/AutobahnPython | refs/heads/master | autobahn/autobahn/wamp/test/test_uri_pattern.py | 3 | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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:/... |
crr0004/taiga-back | refs/heads/master | taiga/projects/history/migrations/0006_fix_json_field_not_null.py | 26 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django_pgjson.fields import JsonField
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('history', '0005_auto_20141120_1119'),
]
operations = [
migrations.RunSQL(
... |
ZLLab-Mooc/edx-platform | refs/heads/named-release/dogwood.rc | lms/djangoapps/course_wiki/tests/test_access.py | 44 | """
Tests for wiki permissions
"""
from django.contrib.auth.models import Group
from nose.plugins.attrib import attr
from student.tests.factories import UserFactory
from xmodule.modulestore.tests.factories import CourseFactory
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from courseware.test... |
neraliu/tpjs | refs/heads/master | src/breakpad/src/tools/gyp/test/defines/gyptest-defines.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 build of an executable with C++ defines.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('defines.gyp')
test.build... |
DedMemez/ODS-August-2017 | refs/heads/master | ai/HolidayGlobals.py | 1 | # Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.ai.HolidayGlobals
from toontown.toonbase import ToontownGlobals, TTLocalizer
from toontown.parties import ToontownTimeZone
import calendar, datetime
TIME_ZONE = ToontownTimeZone.ToontownTimeZone()
TRICK_OR_TREAT = 0
WINTER_CAROLING = 1
CAROLING_... |
gVallverdu/pymatgen | refs/heads/master | pymatgen/io/tests/test_cssr.py | 7 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
'''
Created on Jan 24, 2012
'''
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "[email protected]"
__da... |
ahb0327/intellij-community | refs/heads/master | python/testData/inspections/PyProtectedMemberInspection/namedTuple.py | 60 | from collections import namedtuple
i = namedtuple('Point', ['x', 'y'], verbose=True)
i._replace( **{"a":"a"})
|
savoirfairelinux/OpenUpgrade | refs/heads/master | addons/l10n_be/__init__.py | 430 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
elibixby/gcloud-python | refs/heads/master | scripts/rewrite_imports.py | 1 | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
chrisndodge/edx-platform | refs/heads/master | openedx/core/djangoapps/user_api/tests/test_helpers.py | 14 | """
Tests for helper functions.
"""
import json
import mock
import ddt
from django import forms
from django.http import HttpRequest, HttpResponse
from django.test import TestCase
from nose.tools import raises
from ..helpers import (
intercept_errors, shim_student_view,
FormDescription, InvalidFieldError
)
cla... |
M4rtinK/tsubame | refs/heads/master | core/bundle/future/moves/dbm/gnu.py | 83 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from dbm.gnu import *
else:
__future_module__ = True
from gdbm import *
|
gdestuynder/MozDef | refs/heads/master | tests/mq/plugins/test_parse_su.py | 1 | # 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/.
# Copyright (c) 2017 Mozilla Corporation
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".... |
b-me/django | refs/heads/master | tests/i18n/forms.py | 500 | from django import forms
from .models import Company
class I18nForm(forms.Form):
decimal_field = forms.DecimalField(localize=True)
float_field = forms.FloatField(localize=True)
date_field = forms.DateField(localize=True)
datetime_field = forms.DateTimeField(localize=True)
time_field = forms.TimeF... |
CaliopeProject/CaliopeServer | refs/heads/master | src/cid/core/forms/models.py | 1 | # -*- encoding: utf-8 -*-
"""
@authors: Andrés Felipe Calderón [email protected]
@license: GNU AFFERO GENERAL PUBLIC LICENSE
SIIM Models are the data definition of SIIM2 Framework
Copyright (C) 2013 Infometrika Ltda.
This program is free software: you can redistribute it and/or modify
it under ... |
MiLk/youtube-dl | refs/heads/master | youtube_dl/extractor/metacafe.py | 13 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_parse_qs,
compat_urllib_parse,
compat_urllib_request,
determine_ext,
ExtractorError,
)
class MetacafeIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?metacafe\.com/watch/([^/]+)... |
zhjunlang/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/idlelib/RemoteDebugger.py | 137 | """Support for remote Python debugging.
Some ASCII art to describe the structure:
IN PYTHON SUBPROCESS # IN IDLE PROCESS
#
# oid='gui_adapter'
+----------+ # +------------+ ... |
Nettacker/Nettacker | refs/heads/master | lib/payload/shellcode/stack/engine.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import binascii
from core.alert import error
from core.compatible import version
def shellcoder(shellcode):
n = 0
xshellcode = '\\x'
for w in shellcode:
n += 1
xshellcode += str(w)
if n == 2:
n = 0
xshellcode +=... |
CMSS-BCRDB/RDS | refs/heads/master | trove/openstack/common/crypto/utils.py | 7 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Red Hat, 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
#
#... |
mhrivnak/pulp_docker | refs/heads/master | plugins/test/unit/plugins/importers/test_sync.py | 4 | import inspect
import json
import os
import shutil
import tempfile
import unittest
import mock
from nectar.request import DownloadRequest
from pulp.common.plugins import importer_constants, reporting_constants
from pulp.plugins.config import PluginCallConfiguration
from pulp.plugins.model import Repository as Reposito... |
jubatus/jubakit | refs/heads/master | jubakit/test/integration/_cli/service/base.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from unittest import TestCase
class BaseCLITestCase(TestCase):
def __init__(self, *args, **kwargs):
super(BaseCLITestCase, self).__init__(*args, **kwargs)
def _shell(self, input=None):
return self.... |
MaxiCM-Test/android_kernel_lge_msm8226 | refs/heads/maxi-5.1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <[email protected]>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
Foxugly/medagenda | refs/heads/master | patient/urls.py | 1 | # -*- coding: utf-8 -*-
#
# Copyright 2015, Foxugly. 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 published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any late... |
jgoclawski/django | refs/heads/master | tests/migrations/migrations_test_apps/lookuperror_a/models.py | 415 | from django.db import models
class A1(models.Model):
pass
class A2(models.Model):
pass
class A3(models.Model):
b2 = models.ForeignKey('lookuperror_b.B2', models.CASCADE)
c2 = models.ForeignKey('lookuperror_c.C2', models.CASCADE)
class A4(models.Model):
pass
|
adrienbrault/home-assistant | refs/heads/dev | homeassistant/components/hdmi_cec/switch.py | 18 | """Support for HDMI CEC devices as switches."""
import logging
from homeassistant.components.switch import DOMAIN, SwitchEntity
from homeassistant.const import STATE_OFF, STATE_ON, STATE_STANDBY
from . import ATTR_NEW, CecEntity
_LOGGER = logging.getLogger(__name__)
ENTITY_ID_FORMAT = DOMAIN + ".{}"
def setup_pla... |
xadahiya/django | refs/heads/master | tests/messages_tests/test_fallback.py | 330 | from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import (
CookieStorage, FallbackStorage,
)
from django.test import SimpleTestCase
from .base import BaseTests
from .test_cookie import set_cookie_data, stored_cookie_messages_count
from .test_session import set_session_data... |
omg-insa/server | refs/heads/master | django/contrib/flatpages/tests/templatetags.py | 228 | import os
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, User
from django.template import Template, Context, TemplateSyntaxError
from django.test import TestCase
class FlatpageTemplateTagTests(TestCase):
fixtures = ['sample_flatpages']
urls = 'django.contrib.flatpages.te... |
lmiccini/sos | refs/heads/master | sos/plugins/scsi.py | 5 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but... |
lmaurits/harvest | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from harvest import __version__ as version
setup(
name='harvest',
version=version,
description='Grow linguistic data on trees',
author='Luke Maurits',
author_email='[email protected]... |
drrk/micropython | refs/heads/master | tests/basics/string_strip.py | 86 | print("".strip())
print(" \t\n\r\v\f".strip())
print(" T E S T".strip())
print("abcabc".strip("ce"))
print("aaa".strip("b"))
print("abc efg ".strip("g a"))
print(' spacious '.lstrip())
print('www.example.com'.lstrip('cmowz.'))
print(' spacious '.rstrip())
print('mississippi'.rstrip('ipz'))
print(b'mississip... |
rense/django-avatar | refs/heads/master | avatar/admin.py | 10 | from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from avatar.models import Avatar
from avatar.templatetags.avatar_tags import avatar
from avatar.util import User
class AvatarAdmin(admin.ModelAdmin):
list_display = ('get_avatar', 'user', 'primary', "date_uploaded")
list_... |
eblossom/gnuradio | refs/heads/master | gr-blocks/python/blocks/__init__.py | 47 | #
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... |
beni55/thefuck | refs/heads/master | tests/rules/test_git_pull.py | 16 | import pytest
from thefuck.rules.git_pull import match, get_new_command
from tests.utils import Command
@pytest.fixture
def stderr():
return '''There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details
git pull <remote> <branch>
... |
izonder/intellij-community | refs/heads/master | python/testData/console/indent4.py | 83 | print 1
for j in range(0, 2):
for i in range(1, 10):
print i
print '!' |
wong2/sentry | refs/heads/master | tests/sentry/auth/test_access.py | 10 | from __future__ import absolute_import
from mock import Mock
from sentry.auth import access
from sentry.models import AnonymousUser, AuthProvider
from sentry.testutils import TestCase
class FromUserTest(TestCase):
def test_no_access(self):
organization = self.create_organization()
team = self.cr... |
XristosMallios/cache | refs/heads/master | exareme-tools/madis/src/lib/chardet/langgreekmodel.py | 235 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
themurph/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.5.45/roles/lib_openshift/src/class/oc_label.py | 20 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-instance-attributes
class OCLabel(OpenShiftCLI):
''' Class to wrap the oc command line tools '''
# pylint allows 5
# pylint: disable=too-many-arguments
def __init__(self,
name,
namespace,
... |
jalut/jalut.github.io | refs/heads/master | node_modules/node-gyp/gyp/gyp_main.py | 1452 | #!/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.
import os
import sys
# Make sure we're using the version of pylib in this repo, not one installed
# elsewhere on the system.
sys.path.inser... |
cogeorg/econlib | refs/heads/master | networkx/algorithms/tests/test_smetric.py | 95 |
from nose.tools import assert_equal,raises
import networkx as nx
def test_smetric():
g = nx.Graph()
g.add_edge(1,2)
g.add_edge(2,3)
g.add_edge(2,4)
g.add_edge(1,4)
sm = nx.s_metric(g,normalized=False)
assert_equal(sm, 19.0)
# smNorm = nx.s_metric(g,normalized=True)
# assert_equal(sm... |
valtech-mooc/edx-platform | refs/heads/master | common/test/acceptance/fixtures/base.py | 148 | """
Common code shared by course and library fixtures.
"""
import re
import requests
import json
from lazy import lazy
from . import STUDIO_BASE_URL
class StudioApiLoginError(Exception):
"""
Error occurred while logging in to the Studio API.
"""
pass
class StudioApiFixture(object):
"""
Base... |
DrMeers/django | refs/heads/master | django/contrib/gis/utils/__init__.py | 237 | """
This module contains useful utilities for GeoDjango.
"""
# Importing the utilities that depend on GDAL, if available.
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.utils.ogrinfo import ogrinfo, sample # NOQA
from django.contrib.gis.utils.ogrinspect import mapping, ogrin... |
wanby/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/api/texture.py | 125 | from bpy import data, types
from .. import constants, logger
from .constants import IMAGE, MAG_FILTER, MIN_FILTER, MAPPING
from . import image
def _texture(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
... |
pbrod/numpy | refs/heads/master | numpy/lib/_iotools.py | 9 | """A collection of functions designed to help I/O with ascii files.
"""
__docformat__ = "restructuredtext en"
import numpy as np
import numpy.core.numeric as nx
from numpy.compat import asbytes, asunicode
def _decode_line(line, encoding=None):
"""Decode bytes from binary input streams.
Defaults to decoding... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.