repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
CrazyGuo/bokeh | refs/heads/master | tests/travis/__init__.py | 12133432 | |
sushramesh/lwc | refs/heads/master | lib/python2.7/site-packages/django/core/servers/__init__.py | 12133432 | |
slohse/ansible | refs/heads/devel | test/units/module_utils/gcp/test_utils.py | 127 | # -*- coding: utf-8 -*-
# (c) 2016, Tom Melendez <tom@supertom.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 o... |
prometheus42/MangaLoader | refs/heads/master | src/plugins/MangaFoxPlugin.py | 1 | #!/usr/bin/python3
import logging
import urllib
from bs4 import BeautifulSoup
import src.PluginBase as PluginBase
from src.data import Manga, Chapter, Image
from src.helper import memoized
logger = logging.getLogger('MangaLoader.MangaFoxPlugin')
BASE_URL = 'http://mangafox.me/'
MANGA_LIST_URL = BASE_URL + 'manga/... |
marxin/youtube-dl | refs/heads/master | youtube_dl/extractor/fourtube.py | 39 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_request,
)
from ..utils import (
parse_duration,
parse_iso8601,
str_to_int,
)
class FourTubeIE(InfoExtractor):
IE_NAME = '4tube'
_VALID_URL = r'https?://(?:www\.)?4tube\.c... |
AloneRoad/Inforlearn | refs/heads/1.0-rc3 | django/core/files/base.py | 16 | import os
from django.utils.encoding import smart_str, smart_unicode
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
class File(object):
DEFAULT_CHUNK_SIZE = 64 * 2**10
def __init__(self, file):
self.file = file
self._name = file.name
sel... |
santidediego/LearningDjango | refs/heads/master | lib/python3.5/site-packages/pip/_vendor/html5lib/filters/sanitizer.py | 1734 | from __future__ import absolute_import, division, unicode_literals
from . import _base
from ..sanitizer import HTMLSanitizerMixin
class Filter(_base.Filter, HTMLSanitizerMixin):
def __iter__(self):
for token in _base.Filter.__iter__(self):
token = self.sanitize_token(token)
if tok... |
mattilyra/scikit-learn | refs/heads/master | sklearn/tests/test_multioutput.py | 39 | import numpy as np
import scipy.sparse as sp
from sklearn.utils import shuffle
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_raises_regex
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing impor... |
bright-sparks/wpull | refs/heads/master | wpull/document/__init__.py | 2 | '''Document handling.'''
|
eeneku/baller | refs/heads/master | src/systems/movement_system.py | 1 | # -*- coding: utf-8 -*-
from engine import system
from components import Transform
from components import Movement
class MovementSystem(system.System):
""" Movement system. Moves the entity around. """
def __init__(self, entity_manager=None, *args, **kwargs):
super(MovementSystem, self).__init__... |
40223145c2g18/c2g18 | refs/heads/master | w2/static/Brython2.0.0-20140209-164925/Lib/_collections.py | 115 | # "High performance data structures
# "
# copied from pypy repo
#
# Copied and completed from the sandbox of CPython
# (nondist/sandbox/collections/pydeque.py rev 1.1, Raymond Hettinger)
#
# edited for Brython line 558 : catch ImportError instead of AttributeError
import operator
#try:
# from thread import get_i... |
iulian787/spack | refs/heads/develop | var/spack/repos/builtin/packages/qnnpack/package.py | 5 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Qnnpack(CMakePackage):
"""QNNPACK (Quantized Neural Networks PACKage) is a mobile-optimize... |
uwafsl/ardupilot | refs/heads/master | mk/PX4/Tools/genmsg/test/test_genmsg_base.py | 216 | def test_log():
from genmsg.base import log
log("hello", "there")
def test_plog():
class Foo(object):
pass
from genmsg.base import plog
plog("hello", Foo())
def test_exceptions():
from genmsg import InvalidMsgSpec
try:
raise InvalidMsgSpec('hello')
except Invali... |
kelseyoo14/Wander | refs/heads/master | venv_2_7/lib/python2.7/site-packages/pandas/io/tests/test_sql.py | 9 | """SQL io tests
The SQL tests are broken down in different classes:
- `PandasSQLTest`: base class with common methods for all test classes
- Tests for the public API (only tests with sqlite3)
- `_TestSQLApi` base class
- `TestSQLApi`: test the public API with sqlalchemy engine
- `TestSQLiteFallbackApi`: t... |
aviarypl/mozilla-l10n-addons-server | refs/heads/master | src/olympia/translations/__init__.py | 18 | from django.conf import settings
from django.utils.translation import trans_real
from jinja2.filters import do_dictsort
LOCALES = [(trans_real.to_locale(k).replace('_', '-'), v) for k, v in
do_dictsort(settings.LANGUAGES)]
|
codrut3/tensorflow | refs/heads/master | tensorflow/python/framework/tensor_util_test.py | 14 | # Copyright 2015 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... |
elainexmas/boto | refs/heads/develop | tests/integration/kms/test_kms.py | 99 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. 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 rights ... |
jayrav13/presidency | refs/heads/master | presidency/executive_orders/year.py | 1 | from lxml import html
import requests
import json
import time
import sys
"""
Year
A class to return all years for which Executive Orders are archived.
"""
class Year():
"""
all
Return a list of all years.
"""
@staticmethod
def all():
page = requests.get('http://www.presidency.ucsb.e... |
ondrokrc/gramps | refs/heads/master | gramps/plugins/export/export.gpr.py | 1 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2009 Benny Malengier
#
# 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) ... |
hj3938/panda3d | refs/heads/master | direct/src/interval/IndirectInterval.py | 8 | """IndirectInterval module: contains the IndirectInterval class"""
__all__ = ['IndirectInterval']
from panda3d.core import *
from panda3d.direct import *
from direct.directnotify.DirectNotifyGlobal import *
import Interval
import LerpBlendHelpers
class IndirectInterval(Interval.Interval):
"""
This class can ... |
mcrowson/django | refs/heads/master | tests/auth_tests/test_remote_user.py | 275 | from datetime import datetime
from django.conf import settings
from django.contrib.auth import authenticate
from django.contrib.auth.backends import RemoteUserBackend
from django.contrib.auth.middleware import RemoteUserMiddleware
from django.contrib.auth.models import User
from django.test import TestCase, modify_set... |
kailIII/geraldo | refs/heads/master | site/newsite/django_1_0/django/contrib/localflavor/it/it_province.py | 30 | # -*- coding: utf-8 -*
PROVINCE_CHOICES = (
('AG', 'Agrigento'),
('AL', 'Alessandria'),
('AN', 'Ancona'),
('AO', 'Aosta'),
('AR', 'Arezzo'),
('AP', 'Ascoli Piceno'),
('AT', 'Asti'),
('AV', 'Avellino'),
('BA', 'Bari'),
# ('BT', 'Barletta-Andria-Trani'), # active starting from 2009... |
xiandiancloud/edx-platform | refs/heads/master | common/djangoapps/course_modes/migrations/0005_auto__add_field_coursemode_expiration_datetime.py | 59 | # -*- 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 field 'CourseMode.expiration_datetime'
db.add_column('course_modes_coursemode', 'expiration_datetim... |
tomekwojcik/BTHEventSource | refs/heads/master | backend/btheventsource.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 by Tomasz Wójcik <labs@tomekwojcik.pl>
#
# 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 r... |
gram526/VTK | refs/heads/master | ThirdParty/Twisted/twisted/protocols/sip.py | 31 | # -*- test-case-name: twisted.test.test_sip -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Session Initialization Protocol.
Documented in RFC 2543.
[Superceded by 3261]
This module contains a deprecated implementation of HTTP Digest authentication.
See L{twisted.cred.credentials} a... |
RobertWWong/WebDev | refs/heads/master | djangoApp/ENV/lib/python3.5/site-packages/django/conf/locale/sk/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. F Y'
TIME_FORMAT = 'G:i'
DATET... |
blueboxgroup/nova | refs/heads/master | nova/db/api.py | 3 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file... |
jefftc/changlab | refs/heads/master | web2py/gluon/contrib/login_methods/cas_auth.py | 5 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This file is part of web2py Web Framework (Copyrighted, 2007-2009).
Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu>.
License: GPL v2
Tinkered by Szabolcs Gyuris < szimszo n @ o regpreshaz dot eu>
"""
from gluon import current, redirect
class CasAuth(object... |
hisilicon/git-repo | refs/heads/master | project.py | 5 | # Copyright (C) 2008 The Android Open Source Project
#
# 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 ... |
eric100lin/Qt-4.8.6 | refs/heads/master | src/3rdparty/webkit/Source/ThirdParty/gyp/test/actions/src/subdir2/make-file.py | 973 | #!/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 sys
contents = "Hello from make-file.py\n"
open(sys.argv[1], 'wb').write(contents)
|
weepingdog/byteofpython | refs/heads/master | src/using_list.py | 2 | #!/usr/bin/env python
# Filename: using_list.py
# This is my shopping list
shoplist=['apple','mango','carrot','banana']
print 'I have',len(shoplist),'items to purchase.'
print 'These items are:', # Notice the comma at end of the line
for item in shoplist:
print item,
print '\nI also have to buy rice.'
shoplist.app... |
zzzombat/lucid-python-django | refs/heads/master | tests/regressiontests/forms/tests/models.py | 50 | # -*- coding: utf-8 -*-
import datetime
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import Form, ModelForm, FileField, ModelChoiceField
from django.test import TestCase
from regressiontests.forms.models import ChoiceModel, ChoiceOptionModel, ChoiceFieldModel, FileModel, Group, Bounda... |
danbradham/mtoatools | refs/heads/master | mtoatools/packages/yaml/serializer.py | 561 |
__all__ = ['Serializer', 'SerializerError']
from error import YAMLError
from events import *
from nodes import *
class SerializerError(YAMLError):
pass
class Serializer(object):
ANCHOR_TEMPLATE = u'id%03d'
def __init__(self, encoding=None,
explicit_start=None, explicit_end=None, version=No... |
cnsoft/kbengine-cocos2dx | refs/heads/cocos2dx-cnsoft | kbe/res/scripts/common/Lib/test/test_asynchat.py | 89 | # test asynchat
from test import support
# If this fails, the test will be skipped.
thread = support.import_module('_thread')
import asyncore, asynchat, socket, time
import unittest
import sys
try:
import threading
except ImportError:
threading = None
HOST = support.HOST
SERVER_QUIT = b'QUIT\n'
if threadin... |
openstack/keystone | refs/heads/master | keystone/common/sql/expand_repo/versions/077_placeholder.py | 30 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
SatoshiNXSimudrone/sl4a-damon-clone | refs/heads/master | python/gdata/src/gdata/Crypto/test.py | 225 | #
# Test script for the Python Cryptography Toolkit.
#
__revision__ = "$Id: test.py,v 1.7 2002/07/11 14:31:19 akuchling Exp $"
import os, sys
# Add the build directory to the front of sys.path
from distutils.util import get_platform
s = "build/lib.%s-%.3s" % (get_platform(), sys.version)
s = os.path.join(os.getcwd(... |
Balaji2198/coala | refs/heads/master | tests/test_bears/ErrorTestBear.py | 26 | from coalib.bearlib.abstractions.Linter import linter
@linter(executable='I_do_not_exist',
output_format='regex',
output_regex=r'.+:(?P<line>\d+):(?P<message>.*)')
class ErrorTestBear:
"""
Causes error when run due to missing executable.
"""
@staticmethod
def create_arguments(filen... |
tchellomello/home-assistant | refs/heads/dev | homeassistant/components/bmw_connected_drive/device_tracker.py | 14 | """Device tracker for BMW Connected Drive vehicles."""
import logging
from homeassistant.util import slugify
from . import DOMAIN as BMW_DOMAIN
_LOGGER = logging.getLogger(__name__)
def setup_scanner(hass, config, see, discovery_info=None):
"""Set up the BMW tracker."""
accounts = hass.data[BMW_DOMAIN]
... |
kvalle/diy-lang | refs/heads/master | tests/test_2_evaluating_simple_expressions.py | 3 | # -*- coding: utf-8 -*-
from nose.tools import assert_equals, assert_raises
from diylang.types import DiyLangError
from diylang.types import Environment
from diylang.evaluator import evaluate
from diylang.parser import parse
"""
We will start by implementing evaluation of simple expressions.
"""
def test_evaluatin... |
thurt/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/lib/ntsecuritycon.py | 21 | # Hacked from winnt.h
DELETE = (65536)
READ_CONTROL = (131072)
WRITE_DAC = (262144)
WRITE_OWNER = (524288)
SYNCHRONIZE = (1048576)
STANDARD_RIGHTS_REQUIRED = (983040)
STANDARD_RIGHTS_READ = (READ_CONTROL)
STANDARD_RIGHTS_WRITE = (READ_CONTROL)
STANDARD_RIGHTS_EXECUTE = (READ_CONTROL)
STANDARD_RIGHTS_ALL = (2031616)
SP... |
turbokongen/home-assistant | refs/heads/dev | homeassistant/components/emulated_hue/const.py | 21 | """Constants for emulated_hue."""
HUE_SERIAL_NUMBER = "001788FFFE23BFC2"
HUE_UUID = "2f402f80-da50-11e1-9b23-001788255acc"
|
shubhdev/openedx | refs/heads/master | pavelib/paver_tests/test_paver_quality.py | 26 | """
Tests for paver quality tasks
"""
import os
from path import path # pylint: disable=no-name-in-module
import tempfile
import unittest
from mock import patch, MagicMock, mock_open
from ddt import ddt, file_data
import pavelib.quality
import paver.easy
import paver.tasks
from paver.easy import BuildFailure
@ddt
c... |
KanchanChauhan/erpnext | refs/heads/develop | erpnext/patches/v6_6/remove_fiscal_year_from_leave_allocation.py | 71 | from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype("Leave Allocation")
if frappe.db.has_column("Leave Allocation", "fiscal_year"):
for leave_allocation in frappe.db.sql("select name, fiscal_year from `tabLeave Allocation`", as_dict=True):
dates = frappe.db.get_value("Fisc... |
vad/django-cms | refs/heads/develop | cms/south_migrations/0054_new_publisher_data.py | 63 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
for page in orm['cms.Page'].objects.filter(publisher_is_draft=True):
title... |
marineam/coreos-dev-util | refs/heads/master | host/lib/write_firmware.py | 3 | # Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import binascii
import glob
import os
import re
import struct
import time
from tools import CmdError
def RoundUp(value, boundary):
"""Align a value... |
jbassen/edx-platform | refs/heads/master | common/djangoapps/util/tests/test_db.py | 109 | """Tests for util.db module."""
import ddt
import threading
import time
import unittest
from django.contrib.auth.models import User
from django.db import connection, IntegrityError
from django.db.transaction import commit_on_success, TransactionManagementError
from django.test import TestCase, TransactionTestCase
fr... |
harshmaur/elasticsearch-dsl-py | refs/heads/master | test_elasticsearch_dsl/test_integration/test_fields.py | 16 | from elasticsearch_dsl.search import Search
def test_search_can_be_limited_to_fields(data_client):
s = Search(using=data_client).index('git').doc_type('repos').fields('organization')
response = s.execute()
assert response.hits.total == 1
assert response.hits[0] == {'organization': ['elasticsearch']}
|
wkschwartz/django | refs/heads/stable/3.2.x | tests/user_commands/management/commands/subparser_dest.py | 28 | from django.core.management.base import BaseCommand
from django.utils.version import PY37
class Command(BaseCommand):
def add_arguments(self, parser):
kwargs = {'required': True} if PY37 else {}
subparsers = parser.add_subparsers(dest='subcommand', **kwargs)
parser_foo = subparsers.add_par... |
ajgallegog/gem5_arm | refs/heads/master | ext/ply/test/lex_token4.py | 174 | # lex_token4.py
#
# Bad token name
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.lex as lex
tokens = [
"PLUS",
"MINUS",
"-",
"NUMBER",
]
t_PLUS = r'\+'
t_MINUS = r'-'
t_NUMBER = r'\d+'
def t_error(t):
pass
lex.lex()
|
EddyTheB/Warbler | refs/heads/master | webCam/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
MMaus/mutils | refs/heads/master | mmnotebooks/bslip.py | 1 | from libshai import integro
from pylab import (norm, pi, hstack, vstack, array, sign, sin, cos, arctan2,
sqrt, zeros,
figure, subplot, plot, legend, xlabel, ylabel)
from numpy import float64
from copy import deepcopy
import mutils.io as mio
import fastode # local!
class SimulationError(Exception):
... |
antoinecarme/pyaf | refs/heads/master | tests/model_control/detailed/transf_Anscombe/model_control_one_enabled_Anscombe_ConstantTrend_NoCycle_ARX.py | 1 | import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Anscombe'] , ['ConstantTrend'] , ['NoCycle'] , ['ARX'] ); |
chirilo/mozillians | refs/heads/master | vendor-local/lib/python/celery/signals.py | 12 | # -*- coding: utf-8 -*-
"""
celery.signals
~~~~~~~~~~~~~~
See :ref:`signals`.
:copyright: (c) 2009 - 2012 by Ask Solem.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from .utils.dispatch import Signal
task_sent = Signal(providing_args=["task_id", "task"... |
code4futuredotorg/reeborg_tw | refs/heads/master | src/libraries/Brython3.2.3/Lib/atexit.py | 743 | """allow programmer to define multiple exit functions to be executedupon normal program termination.
Two public functions, register and unregister, are defined.
"""
class __loader__(object):
pass
def _clear(*args,**kw):
"""_clear() -> None
Clear the list of previously registered exit functions."""
... |
zvolsky/edga | refs/heads/master | controllers/fixdata.py | 1 | # coding: utf8
def browser():
import httpagentparser
agent = request.env.http_user_agent
return BEAUTIFY(httpagentparser.simple_detect(agent))
def browser2():
import httpagentparser
agent = request.env.http_user_agent
return BEAUTIFY(httpagentparser.detect(agent))
@auth.requires_membership('ad... |
reddymeghraj/showroom | refs/heads/master | erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py | 120 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
from erpnext.controllers.print_settings import print_settings_for_item_table
class SalesInvoi... |
georgefrank/ansible-modules-extras | refs/heads/devel | database/misc/riak.py | 67 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.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 Fou... |
wengyanqing/incubator-hawq | refs/heads/master | tools/bin/pythonSrc/unittest2-0.5.1/unittest2/test/test_unittest2_with.py | 111 | from __future__ import with_statement
import unittest2
from unittest2.test.support import OldTestResult, catch_warnings
import warnings
# needed to enable the deprecation warnings
warnings.simplefilter('default')
class TestWith(unittest2.TestCase):
"""Tests that use the with statement live in this
module so ... |
dmonopoly/livefeedback | refs/heads/master | classroom/wsgi.py | 1 | """
WSGI config for classroom project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "classroom.settings")
from django.co... |
jskulski/Flask-FeatureFlags | refs/heads/master | tests/fixtures.py | 3 | # -*- coding: utf-8 -*-
from flask import Flask, render_template_string
import flask_featureflags as feature_flags
FEATURE_NAME = u"śőmé féátúŕé thíńg"
FEATURE_IS_ON = u'OK'
FEATURE_IS_OFF = u"flag is off"
FLAG_CONFIG = feature_flags.FEATURE_FLAGS_CONFIG
RAISE_ERROR = feature_flags.RAISE_ERROR_ON_MISSING_FEATURES
... |
omerucel/basitapi-account | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
import basitapi_account
def read(fname):
try:
return open(os.path.join(os.path.dirname(__file__), fname)).read()
except IOError:
return ''
setup(
name='basitapi-account',
version=basitapi_account.__version__... |
stvreumi/electronic-blackboard | refs/heads/master | broadcast_api.py | 1 | from mysql import mysql
from mysql import DB_Exception
from datetime import date
from datetime import datetime
from datetime import timedelta
from dataAccessObjects import *
import os.path
import json
def getDisplayContent(sche_target_id,return_msg):
"""
Get the display content of the display target.
Args... |
hectord/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/tests/regressiontests/forms/localflavor/is_.py | 89 | from django.contrib.localflavor.is_.forms import (ISIdNumberField,
ISPhoneNumberField, ISPostalCodeSelect)
from utils import LocalFlavorTestCase
class ISLocalFlavorTests(LocalFlavorTestCase):
def test_ISPostalCodeSelect(self):
f = ISPostalCodeSelect()
out = u'''<select name="foo">
<option val... |
clld/lexibank | refs/heads/master | lexibank/views.py | 9480 | #
|
cpennington/edx-platform | refs/heads/master | lms/djangoapps/ccx/api/v0/serializers.py | 5 | """ CCX API v0 Serializers. """
import six
from ccx_keys.locator import CCXLocator
from rest_framework import serializers
from lms.djangoapps.ccx.models import CustomCourseForEdX
class CCXCourseSerializer(serializers.ModelSerializer):
"""
Serializer for CCX courses
"""
ccx_course_id = serializers.S... |
ruchikd/Algorithms | refs/heads/master | Python/PalindromePairs/palindromPairsPart2.py | 1 | def palindromePairs(words):
if words is None:
return None
bigList = []
for word in words:
for w in words:
if w == word:
continue
posPalindrome = w + word
if posPalindrome == posPalindrome[::-1]:
smallList = []
smallList.append(words.index(w))
smallList.append(words.index(word))
if s... |
maxtorete/frappe | refs/heads/develop | frappe/patches/v7_1/disabled_print_settings_for_custom_print_format.py | 17 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
frappe.reload_doctype('Print Format')
frappe.db.sql("""
update
`tabPrint Format`
set
... |
sassoftware/saspy | refs/heads/main | saspy/tests/test_sastabulate.py | 2 | import unittest
from contextlib import redirect_stdout
from io import StringIO
from re import match
import pandas as pd
import saspy
from saspy.sastabulate import Tabulate, Class, Var, Statistic, Grouping
class TestSASTabulate(unittest.TestCase):
def setUp(self):
# Use the first entry in the configuration ... |
sdh11/gnuradio | refs/heads/master | gr-digital/python/digital/generic_mod_demod.py | 6 | #
# Copyright 2005,2006,2007,2009,2011 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)
# an... |
sdague/home-assistant | refs/heads/dev | homeassistant/components/ipma/config_flow.py | 20 | """Config flow to configure IPMA component."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE, CONF_MODE, CONF_NAME
import homeassistant.helpers.config_validation as cv
from .const import DOMAIN, HOME_LOCATION_NAME
from .weather import F... |
Gamebasis/3DGamebasisServer | refs/heads/master | GameData/blender-2.71-windows64/2.71/python/lib/encodings/koi8_r.py | 272 | """ Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors... |
cosanlab/emote | refs/heads/master | src/gui/image.py | 1 | import os
import cv2
from util.constants import FRAME_WIDTH, FRAME_HEIGHT
from face_process import detect_and_align_face
def process_image(expresser, path, grayscale=False):
""" Uses a detector model, expresser model, and prints the results of the expresser model for the given image path
:param expresser: Mod... |
alrusdi/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/gis/utils/wkt.py | 419 | """
Utilities for manipulating Geometry WKT.
"""
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated to that number:
>>> pnt =... |
JDat/RocketTestStand | refs/heads/dev | web_framework/modules/__init__.py | 12133432 | |
devilry/trix2 | refs/heads/master | trix/trix_student/middleware/__init__.py | 12133432 | |
stuntman723/rap-analyzer | refs/heads/master | rap_analyzer/lib/python2.7/site-packages/django/http/multipartparser.py | 105 | """
Multi-part parsing for file uploads.
Exposes one class, ``MultiPartParser``, which feeds chunks of uploaded data to
file upload handlers for processing.
"""
from __future__ import unicode_literals
import base64
import binascii
import cgi
import sys
from django.conf import settings
from django.core.exceptions imp... |
jamesmarva/ripozo | refs/heads/master | ripozo/resources/request.py | 2 | """
The RequestContainer.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from ripozo.resources.constants import input_categories
class RequestContainer(object):
"""
An object that represents an incoming ... |
rdio/translate-toolkit | refs/heads/master | lang/test_poedit.py | 3 | from translate.lang.poedit import isocode
def test_isocode():
"""Test the isocode function"""
# Standard lookup
assert isocode("French") == "fr"
# Dialect lookups: Portuguese
assert isocode("Portuguese") == "pt" # No country we default to 'None'
assert isocode("Portuguese", "BRAZIL") == "pt_B... |
nelsonsar/ansible | refs/heads/devel | lib/ansible/executor/task_queue_manager.py | 52 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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 option) an... |
javachengwc/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/core/management/commands/runfcgi.py | 674 | from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Runs this project as a FastCGI application. Requires flup."
args = '[various KEY=val options, use `runfcgi help` for help]'
def handle(self, *args, **options):
from django.conf import settings
from djan... |
xfournet/intellij-community | refs/heads/master | python/helpers/pydev/pydev_ipython/version.py | 142 | # encoding: utf-8
"""
Utilities for version comparison
It is a bit ridiculous that we need these.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the f... |
johnnyliu27/openmc | refs/heads/develop | tests/regression_tests/mgxs_library_nuclides/test.py | 4 | import hashlib
import openmc
import openmc.mgxs
from openmc.examples import pwr_pin_cell
from tests.testing_harness import PyAPITestHarness
class MGXSTestHarness(PyAPITestHarness):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Initialize a two-group structure
... |
iansf/sky_engine | refs/heads/master | sky/tools/webkitpy/thirdparty/mod_pywebsocket/_stream_hybi.py | 628 | # Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
Theb-1/home-assistant | refs/heads/dev | homeassistant/helpers/event_decorators.py | 4 | """ Event Decorators for custom components """
import functools
from homeassistant.helpers import event
HASS = None
def track_state_change(entity_ids, from_state=None, to_state=None):
""" Decorator factory to track state changes for entity id """
def track_state_change_decorator(action):
""" Decor... |
baishancloud/pykit | refs/heads/master | proc/__init__.py | 2 | from .proc import (
ProcError,
command,
command_ex,
shell_script,
start_process,
)
__all__ = [
'ProcError',
'command',
'command_ex',
'shell_script',
'start_process',
]
|
Proyag/nematus | refs/heads/master | test/test_translate.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import unittest
import requests
sys.path.append(os.path.abspath('../nematus'))
from translate import main as translate
from settings import TranslationSettings
def load_wmt16_model(src, target):
path = os.path.join('models', '{0}-{1}'.format... |
390910131/Misago | refs/heads/master | misago/threads/tests/test_threads_moderation.py | 8 | from misago.forums.models import Forum
from misago.users.testutils import AuthenticatedUserTestCase
from misago.threads import moderation, testutils
from misago.threads.models import Label, Thread, Post, Event
class ThreadsModerationTests(AuthenticatedUserTestCase):
def setUp(self):
super(ThreadsModerati... |
miguelparaiso/PracticaOdoo | refs/heads/master | addons/l10n_cn/__init__.py | 339 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2007-2014 Jeff Wang(<http://jeff@osbzr.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
freakboy3742/django | refs/heads/main | tests/forms_tests/field_tests/test_multivaluefield.py | 27 | from datetime import datetime
from django.core.exceptions import ValidationError
from django.forms import (
CharField, Form, MultipleChoiceField, MultiValueField, MultiWidget,
SelectMultiple, SplitDateTimeField, SplitDateTimeWidget, TextInput,
)
from django.test import SimpleTestCase
beatles = (('J', 'John'),... |
StackStorm/python-mistralclient | refs/heads/master | mistralclient/tests/unit/test_utils.py | 1 | # Copyright 2015 - StackStorm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
raycarnes/odoomrp-wip | refs/heads/8.0 | mrp_bom_catch_product_code/__openerp__.py | 27 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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... |
koparasy/faultinjection-gem5 | refs/heads/master | src/arch/x86/isa/insts/general_purpose/__init__.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
unixhot/opencmdb | refs/heads/master | django_mongoengine/mongo_admin/apps.py | 3 | from django.apps import AppConfig
from django.core import checks
from django.utils.translation import ugettext_lazy as _
def check_admin_app(**kwargs):
from .sites import system_check_errors
return system_check_errors
class SimpleMongoAdminConfig(AppConfig):
"""Simple AppConfig which does not do automati... |
ryanpitts/source | refs/heads/master | source/people/management/commands/__init__.py | 12133432 | |
geolinkedata/api | refs/heads/master | api_tutorial/api_tutorial/__init__.py | 12133432 | |
Suninus/erpnext | refs/heads/develop | erpnext/patches/v4_4/__init__.py | 12133432 | |
anchit1/mBlog | refs/heads/master | micro_blog/wsgi.py | 1 | """
WSGI config for micro_blog project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_S... |
poderopedia/podermapa | refs/heads/master | languages/fr.py | 140 | # coding: utf8
{
'!langcode!': 'fr',
'!langname!': 'Français',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" est une expression optionnelle comme "champ1=\'nouvellevaleur\'". Vous ne pouvez mettre à jour ou supprimer les résultats d\'un JOI... |
weave-lab/nw.js | refs/heads/nw13 | tools/file_util.py | 77 | # Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights
# reserved. Use of this source code is governed by a BSD-style license that
# can be found in the LICENSE file.
from glob import iglob
import os
import shutil
import sys
import time
def read_file(name, normalize = True):
""" Read a file. """... |
ekhdkv/vboxweb | refs/heads/master | cherrypy/_cptools.py | 17 | """CherryPy tools. A "tool" is any helper, adapted to CP.
Tools are usually designed to be used in a variety of ways (although some
may only offer one if they choose):
Library calls:
All tools are callables that can be used wherever needed.
The arguments are straightforward and should be detai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.