repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
giuliov/ansible | refs/heads/devel | lib/ansible/plugins/inventory/directory.py | 93 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# 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... |
debianitram/w2p-acreditacion | refs/heads/master | languages/my-mm.py | 85 | # -*- coding: utf-8 -*-
{
'!langcode!': 'my-mm',
'!langname!': 'မြန်မာ',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%s %%{row} del... |
cailloumajor/home-web | refs/heads/master | backend/heating/serializers.py | 1 | # -*- coding: utf-8 -*-
import operator
from datetime import datetime, time, timedelta
from functools import reduce
from django.db.models import Q
from rest_framework import serializers
from .models import Zone, Slot, Derogation, PilotwireLog
TIME_FORMAT = '%H:%M'
def validate_quarter_hour(value):
if value.m... |
yangleo/cloud-github | refs/heads/master | horizon/templatetags/sizeformat.py | 65 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# 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... |
kvr777/deep-learning | refs/heads/master | transfer-learning/tensorflow_vgg/vgg16.py | 153 | import inspect
import os
import numpy as np
import tensorflow as tf
import time
VGG_MEAN = [103.939, 116.779, 123.68]
class Vgg16:
def __init__(self, vgg16_npy_path=None):
if vgg16_npy_path is None:
path = inspect.getfile(Vgg16)
path = os.path.abspath(os.path.join(path, os.pardir... |
carlosefr/quicklook | refs/heads/master | templates/processes/__init__.py | 1 | #!/usr/bin/env python
# -*- coding: iso8859-1 -*-
#
# Copyright (c) 2005-2007, Carlos Rodrigues <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License (version 2) as
# published by the Free Software Foundation.
#
# ... |
senthil10/scilifelab | refs/heads/master | scripts/demultiplex_mctag.py | 4 | """
Demultiplex haloplex data including molecular tags.
"""
from __future__ import print_function
import argparse
import collections
import datetime
import fcntl
import itertools
import os
import random
import re
import resource
import shlex
import shutil
import subprocess
import sys
import time
#from Bio import Seq... |
AOSPA-L/android_external_skia | refs/heads/lollipop-mr1 | gm/rebaseline_server/download_actuals_test.py | 66 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Test download.py
TODO(epoger): Create a command to update the expected results (in
self._output_dir_expected) when appropriate. For now, you should:
1. examine the resu... |
mozilla/mwc | refs/heads/master | vendor-local/packages/requests/requests/async.py | 4 | # -*- coding: utf-8 -*-
"""
requests.async
~~~~~~~~~~~~~~
This module contains an asynchronous replica of ``requests.api``, powered
by gevent. All API methods return a ``Request`` instance (as opposed to
``Response``). A list of requests can be sent with ``map()``.
"""
try:
import gevent
from gevent import m... |
mdclyburn/ardupilot | refs/heads/master | mk/PX4/Tools/genmsg/src/genmsg/msg_loader.py | 215 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... |
geerlingguy/ansible | refs/heads/devel | hacking/build_library/build_ansible/command_plugins/collection_meta.py | 5 | # coding: utf-8
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import os.path
import pathlib
import yam... |
zakki/openhsp | refs/heads/master | hsp3ll/llvm/utils/lint/common_lint.py | 147 | #!/usr/bin/python
#
# Common lint functions applicable to multiple types of files.
import re
def VerifyLineLength(filename, lines, max_length):
"""Checks to make sure the file has no lines with lines exceeding the length
limit.
Args:
filename: the file under consideration as string
lines: contents of t... |
quasiben/bokeh | refs/heads/master | examples/plotting/server/fourier_animated.py | 6 | # You must first run "bokeh serve" to view this example
#
# Example inspired by:
#
# https://www.youtube.com/watch?v=LznjC4Lo7lE
from __future__ import division
from collections import OrderedDict
from math import pi
import numpy as np
from bokeh.client import push_session
from bokeh.driving import repeat
from bo... |
mxngyn/django-s3direct | refs/heads/master | example/cat/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
Weihonghao/ECM | refs/heads/master | Vpy34/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/jisfreq.py | 3130 | ######################## 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... |
afdnlw/dnf | refs/heads/master | tests/test_i18n.py | 3 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distribute... |
Spoken-tutorial/spoken-website | refs/heads/master | events/migrations/0046_auto_20210318_1807.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2021-03-18 12:37
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0045_auto_20201111_1648'),
]
operations = [
migrations.AlterField(
... |
IptvBrasilGroup/Cleitonleonelcreton.repository | refs/heads/master | plugin.video.iptvbrondemand.PC/mechanize/_gzip.py | 137 | from cStringIO import StringIO
import _response
import _urllib2_fork
# GzipConsumer was taken from Fredrik Lundh's effbot.org-0.1-20041009 library
class GzipConsumer:
def __init__(self, consumer):
self.__consumer = consumer
self.__decoder = None
self.__data = ""
def __getattr__(self... |
jhawkesworth/ansible | refs/heads/devel | test/runner/lib/sanity/validate_modules.py | 14 | """Sanity test using validate-modules."""
from __future__ import absolute_import, print_function
import collections
import json
import os
from lib.sanity import (
SanitySingleVersion,
SanityMessage,
SanityFailure,
SanitySuccess,
SanitySkipped,
)
from lib.util import (
SubprocessError,
dis... |
bkahlert/seqan-research | refs/heads/master | raw/pmsb13/pmsb13-data-20130530/trunk/misc/trac_plugins/IncludeMacro/setup.py | 7 | #!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
import os.path
from setuptools import setup
setup(
name = 'TracIncludeMacro',
version = '2.1fub3',
packages = ['includemacro'],
author = 'Manuel Holtgrewe',
author_email = '[email protected]',
description = 'Include the contents o... |
jasonharrison/Solus | refs/heads/master | main.py | 1 | import asynchat, asyncore, socket, sys, os, time, subprocess
try:
import config
except ImportError:
print("Please edit config.py.dist - rename it to config.py when you're done")
exit()
class asynchat_bot(asynchat.async_chat):
def __init__(self, host, port):
asynchat.async_chat.__init__(self)
... |
mach6/selenium | refs/heads/master | py/selenium/webdriver/opera/webdriver.py | 11 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
bonitadecker77/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/sample_doctest.py | 203 | """This is a sample module that doesn't really test anything all that
interesting.
It simply has a few tests, some of which succeed and some of which fail.
It's important that the numbers remain constant as another test is
testing the running of these tests.
>>> 2+2
4
"""
def foo():
"""
>>> 2+2
5
... |
dexterx17/nodoSocket | refs/heads/master | clients/Python-2.7.6/Lib/test/test_defaultdict.py | 108 | """Unit tests for collections.defaultdict."""
import os
import copy
import tempfile
import unittest
from test import test_support
from collections import defaultdict
def foobar():
return list
class TestDefaultDict(unittest.TestCase):
def test_basic(self):
d1 = defaultdict()
self.assertEqual... |
eustislab/horton | refs/heads/master | data/examples/hamiltonian/even_tempered_li.py | 1 | #!/usr/bin/env python
import numpy as np
from horton import *
# specify the even tempered basis set
alpha_low = 5e-3
alpha_high = 5e2
nbasis = 30
lnratio = (np.log(alpha_high) - np.log(alpha_low))/(nbasis-1)
# build a list of "contractions". These aren't real contractions as every
# contraction only contains one bas... |
infoelliex/addons-yelizariev | refs/heads/8.0 | gamification_extra/__init__.py | 16 | import gamification_extra_models
|
tinloaf/home-assistant | refs/heads/dev | homeassistant/components/notify/sendgrid.py | 6 | """
SendGrid notification service.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.sendgrid/
"""
import logging
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotifi... |
jmartinm/invenio-workflows | refs/heads/master | invenio_workflows/tasks/sample_tasks.py | 5 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 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 option) any... |
harveywwu/vnpy | refs/heads/master | vnpy/trader/app/dataRecorder/drEngine.py | 1 | # encoding: UTF-8
'''
本文件中实现了行情数据记录引擎,用于汇总TICK数据,并生成K线插入数据库。
使用DR_setting.json来配置需要收集的合约,以及主力合约代码。
'''
import json
import csv
import os
import copy
import traceback
from collections import OrderedDict
from datetime import datetime, timedelta
from Queue import Queue, Empty
from threading import Thread
from pymongo.er... |
cedi4155476/QGIS | refs/heads/master | python/plugins/processing/algs/gdal/tri.py | 11 | # -*- coding: utf-8 -*-
"""
***************************************************************************
tri.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*********************... |
flying-circus/asq | refs/heads/master | asq/queryables.py | 5 | '''Classes which support the Queryable interface.'''
# Copyright (c) 2011 Robert Smallshire.
# 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 limitatio... |
DickJC123/mxnet | refs/heads/master | python/mxnet/model.py | 9 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
gbaty/pyside2 | refs/heads/master | tests/pysidetest/typedef_signal_test.py | 3 |
import unittest
from PySide2.QtCore import QObject
from testbinding import TestObject
class Receiver(QObject):
def __init__(self):
QObject.__init__(self)
self.received = None
def slot(self, value):
self.received = value
class TypedefSignal(unittest.TestCase):
def testTypedef(s... |
dbaxa/django | refs/heads/master | tests/gis_tests/gis_migrations/migrations/__init__.py | 12133432 | |
thisiscam/django-db-obfuscate-id | refs/heads/master | db_obfuscate/management/commands/__init__.py | 12133432 | |
vanabo/mattress | refs/heads/master | src/newsletter/migrations/__init__.py | 12133432 | |
patpatpatpatpat/digestus | refs/heads/master | updates/__init__.py | 12133432 | |
libracore/erpnext | refs/heads/v12 | erpnext/education/doctype/course_activity/__init__.py | 12133432 | |
praekelt/mtvc-api-client | refs/heads/master | mtvc_client/client.py | 1 | import logging
import hammock
from requests.auth import AuthBase
logger = logging.getLogger(__name__)
class APIClientException(Exception):
"""
Exception class that contains the error code and message from
the MTVC
"""
def __init__(self, error_code=None, error_message=None, **kwargs):
s... |
ucrawler/cp-uc | refs/heads/master | libs/CodernityDB/env.py | 83 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2011-2013 Codernity (http://codernity.com)
#
# 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/L... |
remitamine/youtube-dl | refs/heads/master | youtube_dl/extractor/vgtv.py | 21 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from .xstream import XstreamIE
from ..utils import (
ExtractorError,
float_or_none,
try_get,
)
class VGTVIE(XstreamIE):
IE_DESC = 'VGTV, BTTV, FTV, Aftenposten and Aftonbladet'
_GEO_BYPASS = False... |
xros/apm_planner | refs/heads/master | libs/mavlink/share/pyshared/pymavlink/examples/apmsetrate.py | 30 | #!/usr/bin/env python
'''
set stream rate on an APM
'''
import sys, struct, time, os
# allow import from the parent directory, where mavlink.py is
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
from optparse import OptionParser
parser = OptionParser("apmsetrate.py [options]")
... |
Dhivyap/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_vscan_on_access_policy.py | 23 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests for Ansible module: na_ontap_vscan_scanner_pool '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch... |
Filechaser/nzbToMedia | refs/heads/master | libs/guessit/rules/properties/bonus.py | 34 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
bonus property
"""
from rebulk.remodule import re
from rebulk import Rebulk, AppendMatch, Rule
from .title import TitleFromPosition
from ..common.formatters import cleanup
from ..common.validators import seps_surround
def bonus():
"""
Builder for rebulk obje... |
divya-csekar/flask-microblog-server | refs/heads/master | flask/Lib/site-packages/sqlalchemy/orm/mapper.py | 22 | # orm/mapper.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Logic to map Python classes to and from selectables.
Defines the :class:`~sqlalche... |
fabianrost84/cython | refs/heads/master | Cython/Build/Tests/TestInline.py | 5 | import os, tempfile
from Cython.Shadow import inline
from Cython.Build.Inline import safe_type
from Cython.TestUtils import CythonTest
try:
import numpy
has_numpy = True
except:
has_numpy = False
test_kwds = dict(force=True, quiet=True)
global_value = 100
class TestInline(CythonTest):
def setUp(self... |
nicholasserra/sentry | refs/heads/master | src/sentry/migrations/0083_migrate_dupe_groups.py | 26 | # -*- coding: utf-8 -*-
from __future__ import print_function
from south.v2 import DataMigration
class Migration(DataMigration):
def forwards(self, orm):
from django.db.models import F
from collections import defaultdict
from sentry.db.models import create_or_update
from sentry.u... |
sgerhart/ansible | refs/heads/maintenance_policy_module | lib/ansible/modules/network/eos/eos_static_route.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
# 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',
... |
wartalker/BlogSpider | refs/heads/master | spider/src/mydm/middlewares/__init__.py | 3 | # -*- coding: utf-8 -*-
from .etag import ETagMiddleware
from .ifmodifysince import IfModifySinceMiddleware
__all__ = [
'ETagMiddleware',
'IfModifySinceMiddleware',
]
|
tyagi-prashant/letsencrypt | refs/heads/master | letsencrypt/proof_of_possession.py | 37 | """Proof of Possession Identifier Validation Challenge."""
import logging
import os
from cryptography import x509
from cryptography.hazmat.backends import default_backend
import zope.component
from acme import challenges
from acme import jose
from acme import other
from letsencrypt import interfaces
from letsencrypt... |
stef1927/python-driver | refs/heads/master | tests/integration/standard/test_custom_protocol_handler.py | 2 | # Copyright 2013-2016 DataStax, 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 agreed to in writi... |
arborh/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/scan_ops_test.py | 20 | # Copyright 2016 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... |
shubhdev/edx-platform | refs/heads/master | common/djangoapps/track/tests/test_shim.py | 111 | """Ensure emitted events contain the fields legacy processors expect to find."""
from mock import sentinel
from django.test.utils import override_settings
from openedx.core.lib.tests.assertions.events import assert_events_equal
from track.tests import EventTrackingTestCase, FROZEN_TIME
LEGACY_SHIM_PROCESSOR = [
... |
bperreault-va/eloworld | refs/heads/master | src/lib/jinja2/debug.py | 132 | # -*- coding: utf-8 -*-
"""
jinja2.debug
~~~~~~~~~~~~
Implements the debug interface for Jinja. This module does some pretty
ugly stuff with the Python traceback system in order to achieve tracebacks
with correct line numbers, locals and contents.
:copyright: (c) 2017 by the Jinja Team.
:... |
louietsai/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/threaded_import_hangers.py | 57 | # This is a helper module for test_threaded_import. The test imports this
# module, and this module tries to run various Python library functions in
# their own thread, as a side effect of being imported. If the spawned
# thread doesn't complete in TIMEOUT seconds, an "appeared to hang" message
# is appended to the m... |
nevil/edash-packager | refs/heads/master | packager/third_party/libxml/src/check-xml-test-suite.py | 347 | #!/usr/bin/python
import sys
import time
import os
import string
sys.path.insert(0, "python")
import libxml2
test_nr = 0
test_succeed = 0
test_failed = 0
test_error = 0
#
# the testsuite description
#
CONF="xml-test-suite/xmlconf/xmlconf.xml"
LOG="check-xml-test-suite.log"
log = open(LOG, "w")
#
# Error and warning... |
gaddman/ansible | refs/heads/devel | lib/ansible/modules/cloud/azure/azure_rm_securitygroup_facts.py | 17 | #!/usr/bin/python
#
# Copyright (c) 2016 Matt Davis, <[email protected]>
# Chris Houseknecht, <[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
ANS... |
guilleramos/django-json-forms | refs/heads/master | django_json_forms/widgets.py | 3 | import datetime
from django.utils.dates import MONTHS
from django.utils.datastructures import SortedDict
class RemoteWidget(object):
def __init__(self, widget, field_name=None):
self.field_name = field_name
self.widget = widget
def as_dict(self):
widget_dict = SortedDict()
wi... |
moondrop-entertainment/django-nonrel-drawp | refs/heads/master | django/conf/locale/pt/formats.py | 232 | # -*- encoding: utf-8 -*-
# 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 = r'j \de F \de Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'j \de F \de Y à... |
SHA2017-badge/micropython-esp32 | refs/heads/master | tests/basics/tuple1.py | 28 | # basic tuple functionality
x = (1, 2, 3 * 4)
print(x)
try:
x[0] = 4
except TypeError:
print("TypeError")
print(x)
try:
x.append(5)
except AttributeError:
print("AttributeError")
print(x[1:])
print(x[:-1])
print(x[2:3])
print(x + (10, 100, 10000))
# inplace add operator
x += (10, 11, 12)
print(x)
# ... |
sadleader/odoo | refs/heads/master | addons/auth_oauth/res_config.py | 292 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... |
Suninus/NewsBlur | refs/heads/master | vendor/yaml/dumper.py | 543 |
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']
from emitter import *
from serializer import *
from representer import *
from resolver import *
class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):
def __init__(self, stream,
default_style=None, default_flow_style=None,
c... |
kevinlondon/sentry | refs/heads/master | src/sentry/db/models/fields/gzippeddict.py | 29 | """
sentry.db.models.fields.gzippeddict
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import six
from django.db import models
from ... |
matthaywardwebdesign/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/test/compiler-override/gyptest-compiler-global-settings.py | 137 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that make_global_settings can be used to override the
compiler settings.
"""
import TestGyp
import os
import copy
import sys
fro... |
raccoongang/edx-platform | refs/heads/ginkgo-rg | common/lib/xmodule/xmodule/tests/test_split_test_module.py | 10 | """
Tests for the Split Testing Module
"""
import ddt
import lxml
from mock import Mock, patch
from fs.memoryfs import MemoryFS
from xmodule.partitions.tests.test_partitions import MockPartitionService, PartitionTestCase, MockUserPartitionScheme
from xmodule.tests.xml import factories as xml
from xmodule.tests.xml imp... |
keithlee/shakeAppPyDev | refs/heads/master | django/conf/locale/bn/formats.py | 433 | # -*- encoding: utf-8 -*-
# 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 = 'g:i:s A'
# DATETIME_FORMAT =
YEAR_MONTH_FORMAT = ... |
Nikea/VisTrails | refs/heads/master | vistrails/db/versions/v0_9_5/persistence/sql/__init__.py | 58 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: [email protected]
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... |
dcjohnson1989/selenium | refs/heads/master | py/selenium/webdriver/remote/__init__.py | 2454 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
almlab/SmileTrain | refs/heads/master | tools/fix_index_fastq.py | 1 | #!/usr/bin/env python
'''
some index fastq's have a weird number of quality line characters. some have an extra
character; others seem to have a single character.
this script truncates quality lines longer than the sequence line and pads quality
lines that are shorter than the sequence line.
author : scott w olesen ... |
mattesno1/CouchPotatoServer | refs/heads/master | libs/pyutil/test/current/json_tests/test_float.py | 106 | import math
from unittest import TestCase
from pyutil import jsonutil as json
class TestFloat(TestCase):
def test_floats(self):
for num in [1617161771.7650001, math.pi, math.pi**100, math.pi**-100]:
self.assertEquals(float(json.dumps(num)), num)
|
MusculoskeletalAtlasProject/mapclient-src | refs/heads/develop | mapclient/tools/pmr/core.py | 3 | import logging
try:
from urllib import quote_plus
except:
from urllib.parse import quote_plus
from requests_oauthlib.oauth1_session import OAuth1Session
logger = logging.getLogger(__name__)
DEFAULT_SITE_URL = 'https://models.physiomeproject.org'
TEACHING_SITE_URL = 'https://teaching.physiomeproject.org'
DE... |
abomyi/django | refs/heads/master | tests/validation/__init__.py | 500 | from django.core.exceptions import ValidationError
from django.test import TestCase
class ValidationTestCase(TestCase):
def assertFailsValidation(self, clean, failed_fields, **kwargs):
with self.assertRaises(ValidationError) as cm:
clean(**kwargs)
self.assertEqual(sorted(failed_fields)... |
OneOneFour/ICSP_Monte_Carlo | refs/heads/master | sgc/sgc/locals.py | 1 | # Copyright 2010-2012 the SGC project developers.
# See the LICENSE file at the top-level directory of this distribution
# and at http://program.sambull.org/sgc/license.html.
"""
Imports useful objects into the local namespace.
Constants:
GUI: Event type for any event emitted by this toolkit.
"""
import types
fr... |
mrnamingo/enigma2-test | refs/heads/master | lib/python/Plugins/Extensions/Infopanel/SoftcamPanel.py | 2 | from Components.config import config, ConfigSubsection, ConfigText, configfile, getConfigListEntry, ConfigSelection
from Components.ConfigList import ConfigListScreen
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaBlend
from Components.MenuList import MenuList
from Components.Lab... |
garwedgess/android_kernel_lge_g4 | refs/heads/M | tools/perf/tests/attr.py | 3174 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... |
MoritzS/django | refs/heads/master | django/db/migrations/loader.py | 8 | import os
import sys
from importlib import import_module, reload
from django.apps import apps
from django.conf import settings
from django.db.migrations.graph import MigrationGraph
from django.db.migrations.recorder import MigrationRecorder
from .exceptions import (
AmbiguityError, BadMigrationError, Inconsistent... |
thSoft/lilypond-hu | refs/heads/translation | python/lilylib.py | 5 | # This file is part of LilyPond, the GNU music typesetter.
#
# Copyright (C) 1998--2015 Han-Wen Nienhuys <[email protected]>
# Jan Nieuwenhuizen <[email protected]>
#
# LilyPond is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... |
jabesq/home-assistant | refs/heads/dev | homeassistant/components/daikin/const.py | 8 | """Constants for Daikin."""
from homeassistant.const import CONF_ICON, CONF_NAME, CONF_TYPE
ATTR_TARGET_TEMPERATURE = 'target_temperature'
ATTR_INSIDE_TEMPERATURE = 'inside_temperature'
ATTR_OUTSIDE_TEMPERATURE = 'outside_temperature'
SENSOR_TYPE_TEMPERATURE = 'temperature'
SENSOR_TYPES = {
ATTR_INSIDE_TEMPERATU... |
clee704/NaverWebtoonFeeds | refs/heads/master | naverwebtoonfeeds/cache.py | 1 | """
naverwebtoonfeeds.cache
~~~~~~~~~~~~~~~~~~~~~~~
Implements a customized version of :class:`flask_cache.Cache` and
customized versions of :class:`werkzeug.contrib.cache.RedisCache`.
"""
import zlib
from datetime import timedelta
from flask_cache import Cache as CacheBase
from werkzeug.contrib.cach... |
JetBrains/intellij-community | refs/heads/master | python/testData/codeInsight/smartEnter/dict_after.py | 83 | class A:
def foo(self):
self.a = {"1": 1, "2":2}<caret> |
bac/horizon | refs/heads/master | horizon/test/firefox_binary.py | 5 | # Copyright 2015, Rackspace, US, 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 agreed to in w... |
dovf/kitty | refs/heads/master | kitty/core/kassert.py | 1 | # Copyright (C) 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
#
# This file is part of Kitty.
#
# Kitty 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, o... |
nirb/whatsapp | refs/heads/master | yowsup/layers/axolotl/protocolentities/test_iq_keys_set.py | 68 | from yowsup.layers.protocol_iq.protocolentities.test_iq import IqProtocolEntityTest
from yowsup.layers.axolotl.protocolentities import SetKeysIqProtocolEntity
from yowsup.structs import ProtocolTreeNode
class SetKeysIqProtocolEntityTest(IqProtocolEntityTest):
def setUp(self):
super(SetKeysIqProtocolEntityTe... |
keyboard-k/youtube-dl-pet | refs/heads/master | youtube_dl/version.py | 1 | from __future__ import unicode_literals
__version__ = '2015.12.21'
|
eweill/ConwayGameOfLife | refs/heads/master | testing/GoLquadtree.py | 1 | # Instance of quadtree from Malcom Kesson for use in Game of Life
# This code is a copy of his code from http://www.fundza.com/algorithmic/quadtree/index.html
# Instead of using inheritance, I just modified what I needed.
# I had to override every function to make it match my needs.
import matplotlib.pyplot as plt
cl... |
aosagie/spark | refs/heads/master | python/pyspark/mllib/classification.py | 8 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
CartoDB/bigmetadata | refs/heads/master | tasks/carto.py | 1 | '''
Tasks to sync data locally to CartoDB
'''
from lib.logger import get_logger
from tasks.base_tasks import TableToCarto, TableToCartoViaImportAPI
from tasks.meta import current_session, OBSTable, OBSColumn, UpdatedMetaTarget
from tasks.util import underscore_slugify, query_cartodb, classpath, shell, unqualified_task... |
mrunge/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/volumes/volumes/views.py | 12 | # 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
# distributed under t... |
agustin380/django-localflavor | refs/heads/master | tests/test_hu.py | 10 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import SimpleTestCase
from localflavor.hu.forms import HUCountySelect
class HULocalFlavorTests(SimpleTestCase):
def test_HUCountySelect(self):
f = HUCountySelect()
out = '''<select name="counties">
<option value... |
srio/shadow3-scripts | refs/heads/master | HIGHLIGHTS/occupation.py | 1 | from orangecontrib.comsyl.util.CompactAFReader import CompactAFReader
# from CompactAFReader import CompactAFReader
import numpy
from srxraylib.plot.gol import plot_image, plot
# from plot_color import plot_with_transparency_one
import pylab as plt
from matplotlib.colors import Normalize, ListedColormap
import ma... |
psav/cfme_tests | refs/heads/master | cfme/configure/documentation.py | 5 | from widgetastic.widget import Text, Image, View
from widgetastic.utils import VersionPick, Version
class LinksView(View):
"""
Widgets for all of the links on the documentation page
Each doc link is an anchor with a child image element, then an anchor with text
Both the image and the text anchor shoul... |
rvswift/BlastNFilter | refs/heads/master | BlastNFilter/Blast/Test.py | 1 | __author__ = 'robswift'
import os
import gzip
import socket
from BlastNFilter.PreRelease import filtering_sets as filtering_sets
from SequenceBase import Base
from collections import defaultdict
from Bio.Alphabet import generic_protein
from Bio import SeqIO
class Test(Base):
"""
"""
if socket.gethostnam... |
cuilishen/cuilishenMissionPlanner | refs/heads/master | Lib/distutils/command/upload.py | 176 | """distutils.command.upload
Implements the Distutils 'upload' subcommand (upload package to PyPI)."""
import os
import socket
import platform
from urllib2 import urlopen, Request, HTTPError
from base64 import standard_b64encode
import urlparse
import cStringIO as StringIO
from hashlib import md5
from distutils.errors... |
rfhk/rqn-custom | refs/heads/10.0 | hr_timesheet_sheet_work_hours_summary/tests/__init__.py | 1 | # -*- coding: utf-8 -*-
from . import test_hr_timesheet_work
|
thurt/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/stringold.py | 293 | # module 'string' -- A collection of string operations
# Warning: most of the code you see here isn't normally used nowadays. With
# Python 1.6, many of these functions are implemented as methods on the
# standard string object. They used to be implemented by a built-in module
# called strop, but strop is now obsolet... |
calispac/digicam_toy | refs/heads/master | digicamtoy/gui/configurator.py | 1 | from tkinter import *
from digicamtoy.core import tracegenerator
import inspect
#from tkinter.ttk import *
class ConfigurationWindow(Frame):
"""Notre fenêtre principale.
Tous les widgets sont stockés comme attributs de cette fenêtre."""
def __init__(self, fenetre, **kwargs):
Frame.__init__(self... |
geekaia/edx-platform | refs/heads/master | common/lib/sandbox-packages/loncapa/__init__.py | 280 | #!/usr/bin/python
from .loncapa_check import *
|
hbrunn/OpenUpgrade | refs/heads/master | addons/point_of_sale/__init__.py | 378 | # -*- 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... |
markdryan/media-service-demo | refs/heads/master | src/msd/__init__.py | 4 | # media-service-demo
#
# Copyright (C) 2012 Intel Corporation. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU Lesser General Public License,
# version 2.1, as published by the Free Software Foundation.
#
# This program is dist... |
rudaoshi/neuralmachines | refs/heads/master | neural_machine/tasks/language/dialog/dialog.py | 3 |
import numpy as np
import mxnet as mx
from neural_machine.tasks.language.common.problem import Problem
from neural_machine.component.lstm import StackedLSTM, SequenceDecoder
class DialogProblem(Problem):
def __init__(self, corpus):
super(DialogProblem, self).__init__(corpus)
def is_supervised(self... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.