repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
cyx1231st/nova | refs/heads/eventually-consistent-host-state-mitaka | nova/tests/unit/api/openstack/compute/test_baremetal_nodes.py | 7 | # Copyright (c) 2013 NTT DOCOMO, 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 requ... |
dudonwai/dudonsblog | refs/heads/master | Lib/site-packages/django/conf/locale/ml/formats.py | 394 | # -*- 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 = 'N j, Y'
TIME_FORMAT = 'P'
DATETIM... |
yufengg/tensorflow | refs/heads/master | tensorflow/python/framework/random_seed_test.py | 35 | # 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... |
avadacatavra/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_recwarn.py | 13 | from __future__ import absolute_import, division, print_function
import warnings
import re
import py
import pytest
from _pytest.recwarn import WarningsRecorder
def test_recwarn_functional(testdir):
reprec = testdir.inline_runsource("""
import warnings
def test_method(recwarn):
warning... |
llonchj/sentry | refs/heads/master | src/sentry/migrations/0181_auto__del_field_release_environment__del_unique_release_project_versio.py | 34 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Release', fields ['project', 'version', 'environ... |
otherway/sepa-tools | refs/heads/master | account_payment_sepa_direct_debit/wizard/export_sdd.py | 1 | # -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Direct Debit module for OpenERP
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redi... |
izonder/intellij-community | refs/heads/master | python/testData/refactoring/pullup/moveInstanceAttributesNoInit.after.py | 80 | class Parent:
def __init__(self):
self.instance_field = "eggs"
class Child(Parent):
def __init__(self):
Parent2.__init__(self)
|
mfraezz/osf.io | refs/heads/develop | osf/migrations/0147_repoint_preprint_pagecounters.py | 11 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-12-06 15:44
from __future__ import unicode_literals
from bulk_update.helper import bulk_update
from django.contrib.contenttypes.models import ContentType
from django.db import migrations
from tqdm import tqdm
def noop(*args, **kwargs):
# No brakes on ... |
liaorubei/depot_tools | refs/heads/master | third_party/logilab/common/graph.py | 93 | # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as publ... |
mdanielwork/intellij-community | refs/heads/master | python/testData/quickdoc/ClassConstructor.py | 83 | # direct class doc
class Foo(object):
"<the_doc>Doc of Foo."
pass
<the_ref>Foo()
|
python-fedex-devs/python-fedex | refs/heads/master | fedex/services/track_service.py | 2 | """
Tracking Service Module
This package contains the shipment tracking methods defined by Fedex's
TrackService WSDL file. Each is encapsulated in a class for easy access.
For more details on each, refer to the respective class's documentation.
"""
from ..base_service import FedexBaseService, FedexError
class Fed... |
djangocali/portal | refs/heads/master | blog/urls.py | 3 | from django.conf.urls import url
from .views import (DetalleArticulo, CrearArticulo, CrearCategoria,
ListaCategorias, blog_list)
urlpatterns = [
url(r'^$', blog_list, name="lista_articulos"),
url(r'^crear-articulo/$', CrearArticulo.as_view(), name='crear_articulo'),
url(r'^crear-catego... |
hdinsight/hue | refs/heads/master | desktop/core/ext-py/boto-2.38.0/boto/cloudsearch/optionstatus.py | 185 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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... |
joisig/grit-i18n | refs/heads/master | grit/node/misc_unittest.py | 4 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Unit tests for misc.GritNode'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname... |
10clouds/edx-platform | refs/heads/dev | cms/djangoapps/contentstore/management/commands/reindex_course.py | 94 | """ Management command to update courses' search index """
import logging
from django.core.management import BaseCommand, CommandError
from optparse import make_option
from textwrap import dedent
from contentstore.courseware_index import CoursewareSearchIndexer
from search.search_engine_base import SearchEngine
from e... |
JianyuWang/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/test_attach_interfaces.py | 25 | # Copyright 2012 SINA 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 app... |
linglung/ytdl | refs/heads/master | youtube_dl/extractor/collegerama.py | 11 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
float_or_none,
int_or_none,
sanitized_Request,
)
class CollegeRamaIE(InfoExtractor):
_VALID_URL = r'https?://collegerama\.tudelft\.nl/Mediasite/Play/(?P<id>[\da-f]+)'
_TESTS = [
{
... |
stackforge/monasca-log-api | refs/heads/master | monasca_log_api/healthcheck/kafka_check.py | 1 | # Copyright 2015-2017 FUJITSU LIMITED
#
# 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... |
qmagico/sampleappqm | refs/heads/master | src/django/contrib/redirects/models.py | 442 | from django.db import models
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
class Redirect(models.Model):
site = models.ForeignKey(Site)
old_path = models.CharField(_('redirect from'), max_length=200, db_index=True,
help_text=_("This should be an ab... |
bslatkin/8-bits | refs/heads/master | appengine-mapreduce/python/test/mapreduce/namespace_range_test.py | 4 | #!/usr/bin/env python
#
# Copyright 2010 Google 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 o... |
habeanf/Open-Knesset | refs/heads/upmaster | auxiliary/management/commands/process_tags_file.py | 14 | import os, csv
from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from django.conf import settings
from auxiliary.models import TagSynonym
from tagging.models import Tag
from django.db import IntegrityError
DATA_ROOT = getattr(settings, 'DATA_ROOT',
os.path.join(sett... |
asdfsx/chardet | refs/heads/master | chardet/version.py | 53 | """
This module exists only to simplify retrieving the version number of chardet
from within setup.py and from chardet subpackages.
:author: Dan Blanchard (dblanchard@ets.org)
"""
__version__ = "2.3.0"
VERSION = __version__.split('.')
|
hyrole/scrapy | refs/heads/master | scrapy/contrib/pipeline/images.py | 144 | import warnings
from scrapy.exceptions import ScrapyDeprecationWarning
warnings.warn("Module `scrapy.contrib.pipeline.images` is deprecated, "
"use `scrapy.pipelines.images` instead",
ScrapyDeprecationWarning, stacklevel=2)
from scrapy.pipelines.images import *
|
3DGenomes/tadbit | refs/heads/master | _pytadbit/utils/fastq_utils.py | 1 | """
12 nov. 2014
"""
from warnings import warn
from gzip import open as gopen
from os import SEEK_END
from subprocess import Popen, PIPE
from itertools import izip_longest
... |
perlygatekeeper/glowing-robot | refs/heads/master | Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/pip/_internal/utils/setuptools_build.py | 9 | import sys
from pip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import List
# Shim to wrap setup.py invocation with setuptools
#
# We set sys.argv[0] to the path to the underlying setup.py file so
# setuptools / distutils don't take the path to the setup.py to be "-c" when... |
dreispt/server-tools | refs/heads/master | __unported__/server_environment/__openerp__.py | 10 | # -*- coding: utf-8 -*-
##############################################################################
#
# Adapted by Nicolas Bessi. Copyright Camptocamp SA
# Based on Florent Xicluna original code. Copyright Wingo SA
#
# This program is free software: you can redistribute it and/or modify
# it under the te... |
flh/odoo | refs/heads/master | addons/email_template/ir_actions.py | 281 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... |
urbaniak/gunicorn | refs/heads/master | tests/requests/valid/013.py | 40 | request = {
"method": "POST",
"uri": uri("/chunked_w_extensions"),
"version": (1, 1),
"headers": [
("TRANSFER-ENCODING", "chunked")
],
"body": b"hello world"
}
|
edx/ecommerce | refs/heads/master | ecommerce/courses/migrations/0002_historicalcourse.py | 1 | # -*- coding: utf-8 -*-
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('courses', '0001_initial'),
]
operation... |
fquinto/Wireless_sensor_network | refs/heads/master | CodigoFuente/web/cgi-bin/emulatorMSP430_windows.py | 2 | #!C:\Python32\python.exe -u
#!/usr/bin/env python
# Description:
# SERIAL PORT EMULATOR
# for specific sentence to emulate MSP430
# Author Version Date Change
# F.Quinto 1.0 2012-08-05 Initial release
import serial
import sys
import time
from time import time,slee... |
bokeh/bokeh | refs/heads/branch-2.4 | bokeh/util/callback_manager.py | 1 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
n0trax/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ecs_taskdefinition_facts.py | 12 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... |
thisisshi/cloud-custodian | refs/heads/master | c7n/actions/webhook.py | 2 | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
try:
import certifi
except ImportError:
certifi = None
import jmespath
import urllib3
from urllib import parse
from c7n import utils
from .core import EventAction
class Webhook(EventAction):
"""Calls a webhook with optional... |
open-synergy/hr | refs/heads/8.0 | setup/hr_employee_reference/setup.py | 7073 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
|
kyvinh/home-assistant | refs/heads/dev | tests/components/test_introduction.py | 23 | """The tests for the Introduction component."""
import unittest
from homeassistant.bootstrap import setup_component
from homeassistant.components import introduction
from tests.common import get_test_home_assistant
class TestIntroduction(unittest.TestCase):
"""Test Introduction."""
def setUp(self):
... |
jinghaomiao/apollo | refs/heads/master | modules/tools/realtime_plot/xyitem.py | 3 | #!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo 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... |
collective/fourdigits.portlet.keywordrelated | refs/heads/master | fourdigits/portlet/keywordrelated/tests/base.py | 1 | from Products.Five import zcml
from Products.Five import fiveconfigure
from Testing import ZopeTestCase as ztc
from Products.PloneTestCase import PloneTestCase as ptc
from Products.PloneTestCase.layer import onsetup
@onsetup
def setup_product():
"""Set up additional products and ZCML required to test this produ... |
Fkawala/gcloud-python | refs/heads/master | bigtable/google/cloud/bigtable/row_filters.py | 6 | # Copyright 2016 Google 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 writing, ... |
cuker/django-directupload | refs/heads/master | directupload/templatetags/directupload_tags.py | 1 | from django import template
from django.db import models
from django.db.models.fields import FieldDoesNotExist
import copy
register = template.Library()
from classytags.core import Options
from classytags.helpers import InclusionTag
from classytags.arguments import Argument, KeywordArgument
from directupload.widget... |
olituks/sentinella | refs/heads/master | frontend/library/web2py/gluon/contrib/markdown/__init__.py | 43 | from markdown2 import *
from gluon.html import XML
def WIKI(text, encoding="utf8", safe_mode='escape', html4tags=False, **attributes):
if not text:
test = ''
if attributes.has_key('extras'):
extras = attributes['extras']
del attributes['extras']
else:
extras=None
text = ... |
moazzemi/HAMEX | refs/heads/master | cpu/gem5/ext/ply/test/yacc_unused_rule.py | 174 | # -----------------------------------------------------------------------------
# yacc_unused_rule.py
#
# Grammar with an unused rule
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import ... |
Thetoxicarcade/ac | refs/heads/master | congredi/auth/register/test/__init__.py | 927 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
|
brownharryb/erpnext | refs/heads/develop | erpnext/selling/doctype/customer/__init__.py | 37694 | from __future__ import unicode_literals
|
davidandreoletti/pymedia | refs/heads/master | stream/imagestream.py | 1 | from stream.mediastream import MediaStream
class ImageStream(MediaStream):
"""
An image media
"""
def __init__(self, filename=None, width=None, height=None,
quality=None, densityX=None, densityY=None):
"""
Constructor
@param: filename Path to media file
... |
bluedisk/bunker1_endpoint | refs/heads/master | requests/status_codes.py | 695 | # -*- coding: utf-8 -*-
from .structures import LookupDict
_codes = {
# Informational.
100: ('continue',),
101: ('switching_protocols',),
102: ('processing',),
103: ('checkpoint',),
122: ('uri_too_long', 'request_uri_too_long'),
200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'... |
klmitch/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/251_add_numa_topology_to_comput_nodes.py | 81 | # 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... |
JizhouZhang/SDR | refs/heads/master | gr-digital/python/digital/bpsk.py | 49 | #
# Copyright 2005,2006,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)
# any later ve... |
saurabh6790/aimobilize | refs/heads/develop | hr/doctype/employment_type/test_employment_type.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
test_records = [[{"doctype":"Employment Type",
"employee_type_name": "_Test Employment Type"}]] |
naslanidis/ansible | refs/heads/devel | lib/ansible/plugins/lookup/__init__.py | 50 | # (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... |
mchristopher/PokemonGo-DesktopMap | refs/heads/master | app/pywin/Lib/idlelib/idle_test/test_io.py | 27 | import unittest
import io
from idlelib.PyShell import PseudoInputFile, PseudoOutputFile
from test import test_support as support
class Base(object):
def __str__(self):
return '%s:str' % type(self).__name__
def __unicode__(self):
return '%s:unicode' % type(self).__name__
def __len__(self):
... |
arne-cl/alt-mulig | refs/heads/master | iwantmyfeeds/feedgen_willkommen_oesterreich.py | 1 |
# coding: utf-8
# # Willkommen Österreich
# In[1]:
import collections
import os
import re
from feedgen.feed import FeedGenerator
from lxml import etree
BASE_URL = "http://willkommen-oesterreich.tv/"
EPISODES_SCRAPING_URL = os.path.join(BASE_URL, "pl.php")
PLAYLIST_BASE_URL = os.path.join(BASE_URL, 'playlists')
E... |
toabctl/ansible-modules-extras | refs/heads/devel | messaging/rabbitmq_plugin.py | 63 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Chatham Financial <oss@chathamfinancial.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... |
sorenk/ansible | refs/heads/devel | lib/ansible/vars/manager.py | 16 | # (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... |
skython/eXe | refs/heads/master | nevow/test/test_disktemplate.py | 14 | # Copyright (c) 2004 Divmod.
# See LICENSE for details.
from __future__ import generators
from nevow import context
from nevow import flat
from nevow import rend
from nevow import testutil
from nevow import loaders
from nevow import util
class req(testutil.FakeRequest):
def __init__(self):
testutil.Fake... |
draugiskisprendimai/odoo | refs/heads/8.0 | openerp/addons/test_converter/tests/test_html.py | 257 | # -*- encoding: utf-8 -*-
import json
import os
import datetime
from lxml import etree
from openerp.tests import common
from openerp.tools import html_escape as e
from openerp.addons.base.ir import ir_qweb
directory = os.path.dirname(__file__)
class TestExport(common.TransactionCase):
_model = None
def set... |
do-mpc/do-mpc | refs/heads/master | examples/industrial_poly/template_model.py | 1 | #
# This file is part of do-mpc
#
# do-mpc: An environment for the easy, modular and efficient implementation of
# robust nonlinear model predictive control
#
# Copyright (c) 2014-2019 Sergio Lucia, Alexandru Tatulea-Codrean
# TU Dortmund. All rights reserved
#
# do-mpc is free sof... |
doomsterinc/odoo | refs/heads/8.0 | addons/account_cancel/__init__.py | 183 | # -*- 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... |
jtpereyda/boofuzz | refs/heads/master | network_monitor.py | 1 | import getopt
import os
import sys
import threading
import time
from io import open
import impacket.ImpactDecoder # pytype: disable=import-error
import netifaces as ni
# noinspection PyUnresolvedReferences
import pcapy # pytype: disable=import-error
from boofuzz import helpers, pedrpc
MAX_PACKET_LENGTH = 65535 #... |
guludo/ardupilot-1 | refs/heads/master | Tools/autotest/pysim/rotmat.py | 154 | #!/usr/bin/env python
#
# vector3 and rotation matrix classes
# This follows the conventions in the ArduPilot code,
# and is essentially a python version of the AP_Math library
#
# Andrew Tridgell, March 2012
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser... |
Mrs-X/Darknet | refs/heads/master | test/functional/test_framework/messages.py | 2 | #!/usr/bin/env python3
# Copyright (c) 2010 ArtForz -- public domain half-a-node
# Copyright (c) 2012 Jeff Garzik
# Copyright (c) 2010-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Bitcoin test... |
RedhawkSDR/integration-gnuhawk | refs/heads/master | gnuradio/gnuradio-core/src/python/gnuradio/gr/qa_vector_insert.py | 14 | #!/usr/bin/env python
#
# 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)
... |
malemburg/epcon | refs/heads/ep2017 | conference/ical.py | 2 | # -*- coding: UTF-8 -*-
from datetime import datetime
# FIXME: We can use an external library.
def encode(line):
if isinstance(line, unicode):
line = line.encode('utf-8')
if not line.endswith('\r\n'):
line += '\r\n'
if len(line) > 75:
fold = [ line ]
while len(fold[-1]) > 7... |
tobias47n9e/social-core | refs/heads/master | social_core/tests/backends/test_readability.py | 4 | import json
from six.moves.urllib_parse import urlencode
from .oauth import OAuth1Test
class ReadabilityOAuth1Test(OAuth1Test):
backend_path = 'social_core.backends.readability.ReadabilityOAuth'
user_data_url = 'https://www.readability.com/api/rest/v1/users/_current'
expected_username = 'foobar'
acc... |
clair3st/code-katas | refs/heads/master | src/needle.py | 1 | """Return the word needle from haystack."""
def find_needle(haystack):
"""Return needle in haystack."""
return 'found the needle at position {}'.format(haystack.index('needle'))
|
0todd0000/spm1d | refs/heads/master | spm1d/examples/nonparam/0d/ex_anova2nested.py | 1 |
import numpy as np
import spm1d
#(0) Load dataset:
dataset = spm1d.data.uv0d.anova2nested.QIMacros()
# dataset = spm1d.data.uv0d.anova2nested.SouthamptonNested1()
y,A,B = dataset.get_data()
print( dataset )
#(1) Conduct non-parametric test:
np.random.seed(0)
alpha = 0.05
snpmlist = spm1d.stats.n... |
maciej-gol/tenant-schemas-celery | refs/heads/master | test_app/test_app/tenant/models.py | 1 | from __future__ import unicode_literals
from django.db import models
class DummyModel(models.Model):
name = models.CharField(max_length=16)
|
assemblio/arda-crm | refs/heads/master | arda/mod_services/forms/checkboxwidgets.py | 4 | from wtforms import SelectMultipleField, widgets
class MultiCheckboxField(SelectMultipleField):
'''
A multiple-select, except displays a list of checkboxes.
Iterating the field will produce subfields, allowing custom rendering of
the enclosed checkbox fields.
'''
widget = widgets... |
mrquim/repository.mrquim | refs/heads/master | script.module.pycryptodome/lib/Crypto/SelfTest/Protocol/test_KDF.py | 5 | # -*- coding: utf-8 -*-
#
# SelfTest/Protocol/test_KDF.py: Self-test for key derivation functions
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is... |
digris/openbroadcast.org | refs/heads/development | website/base/templatetags/form_error_tags.py | 2 | from django import template
from django import forms
from django.forms.forms import NON_FIELD_ERRORS
from django.forms.utils import ErrorDict
register = template.Library()
@register.filter
def nice_errors(form, non_field_msg="General form errors"):
nice_errors = ErrorDict()
if isinstance(form, forms.BaseForm... |
chenc10/Spark-PAF | refs/heads/master | dist/ec2/lib/boto-2.34.0/tests/unit/s3/test_connection.py | 90 | # Copyright (c) 2013 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 ... |
elli89/ubertooth | refs/heads/master | host/python/specan_ui/build/lib.linux-x86_64-2.7/specan/Ubertooth.py | 13 | #!/usr/bin/env python
#
# Copyright 2011 Jared Boone
#
# This file is part of Project Ubertooth.
#
# 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, or (at your option)
# any lat... |
piosz/test-infra | refs/heads/master | gubernator/third_party/defusedxml/minidom.py | 53 | # defusedxml
#
# Copyright (c) 2013 by Christian Heimes <christian@python.org>
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
"""Defused xml.dom.minidom
"""
from __future__ import print_function, absolute_import
from xml.dom.minidom import _do_pulldom_pa... |
ceramos/micropython | refs/heads/master | tests/cmdline/cmd_verbose.py | 111 | # cmdline: -v -v
# test verbose output
print(1)
|
apark263/tensorflow | refs/heads/master | tensorflow/contrib/tpu/python/tpu/util.py | 15 | # 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... |
dvliman/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.3/django/contrib/gis/geos/prototypes/errcheck.py | 623 | """
Error checking functions for GEOS ctypes prototype functions.
"""
import os
from ctypes import c_void_p, string_at, CDLL
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.libgeos import GEOS_VERSION
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the... |
Alzon/SUR | refs/heads/SURmagnum | magnum/common/pythonk8sclient/client/models/V1beta3_ContainerStatus.py | 15 | #!/usr/bin/env python
"""
Copyright 2015 Reverb Technologies, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless require... |
google/or-tools | refs/heads/stable | ortools/sat/samples/bool_or_sample_sat.py | 1 | #!/usr/bin/env python3
# Copyright 2010-2021 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | openerp/report/render/render.py | 457 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
maxming2333/v2ex | refs/heads/master | html5lib/tests/support.py | 73 | import os
import sys
import codecs
import glob
base_path = os.path.split(__file__)[0]
if os.path.exists(os.path.join(base_path, 'testdata')):
#release
test_dir = os.path.join(base_path, 'testdata')
else:
#development
test_dir = os.path.abspath(
os.path.join(base_path,
os.p... |
def-/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/test/test_fork1.py | 70 | """This test checks for correct fork() behavior.
"""
import os
import time
from test.fork_wait import ForkWait
from test.test_support import TestSkipped, run_unittest, reap_children
try:
os.fork
except AttributeError:
raise TestSkipped, "os.fork not defined -- skipping test_fork1"
class ForkTest(ForkWait):
... |
tecan/xchat-rt | refs/heads/master | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/build/lib/supybot/plugins/MoobotFactoids/test.py | 14 | # -*- encoding: utf-8 -*-
###
# Copyright (c) 2003-2005, Daniel DiPaolo
# 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 notic... |
ProfessionalIT/professionalit-webiste | refs/heads/master | sdk/google_appengine/google/appengine/_internal/django/core/serializers/pyyaml.py | 7 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
from StringIO import StringIO
import decimal
import yaml
from google.appengine._internal.django.db import models
from google.appengine._internal.django.core.serializers.python import Serializer as PythonSerializer
from... |
philsch/ansible | refs/heads/devel | lib/ansible/parsing/utils/addresses.py | 241 | # Copyright 2015 Abhijit Menon-Sen <ams@2ndQuadrant.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) any ... |
gauribhoite/personfinder | refs/heads/master | env/google_appengine/lib/django-1.4/django/contrib/staticfiles/urls.py | 475 | from django.conf import settings
from django.conf.urls.static import static
urlpatterns = []
def staticfiles_urlpatterns(prefix=None):
"""
Helper function to return a URL pattern for serving static files.
"""
if prefix is None:
prefix = settings.STATIC_URL
return static(prefix, view='djang... |
daenamkim/ansible | refs/heads/devel | lib/ansible/modules/system/crypttab.py | 82 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Steve <yo@groks.org>
# 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',
... |
mohamedhagag/community-addons | refs/heads/8.0 | openeducat_erp/wizard/op_all_student_wizard.py | 1 | # -*- coding: utf-8 -*-
###############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2009-TODAY Tech-Receptives(<http://www.techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... |
kevcooper/bitcoin | refs/heads/master | test/functional/sendheaders.py | 2 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test behavior of headers messages to announce blocks.
Setup:
- Two nodes, two p2p connections to nod... |
dmlc/tvm | refs/heads/main | python/tvm/topi/cuda/scatter.py | 1 | # 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... |
ipcamit/ipcamit.github.io | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/html.py | 268 | # -*- coding: utf-8 -*-
"""
pygments.formatters.html
~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for HTML output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
import os.path
import StringIO
from pygments.formatter impo... |
abhisg/scikit-learn | refs/heads/master | sklearn/discriminant_analysis.py | 2 | """
Linear Discriminant Analysis and Quadratic Discriminant Analysis
"""
# Authors: Clemens Brunner
# Martin Billinger
# Matthieu Perrot
# Mathieu Blondel
# License: BSD 3-Clause
from __future__ import print_function
import warnings
import numpy as np
from scipy import linalg
from .extern... |
wufangjie/leetcode | refs/heads/master | 127. Word Ladder.py | 1 | '''
Given two words (beginWord and endWord), and a dictionary's word list, find the length of shortest transformation sequence from beginWord to endWord, such that:
Only one letter can be changed at a time
Each intermediate word must exist in the word list
For example,
Given:
beginWord = "hit"
endWord = "cog... |
mistydemeo/gyp | refs/heads/master | test/msvs/list_excluded/gyptest-all.py | 347 | #!/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 msvs_list_excluded_files=0 doesn't list files that would
normally be in _excluded_files, and that if that flag is not set,... |
haonancool/OnlineJudge | refs/heads/master | leetcode/python/two_sum.py | 1 | class Solution(object):
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
table = {}
ret = []
for i, num in enumerate(nums, 1):
if target-num in table:
ret.append(table[target-... |
yonglehou/swoole-src | refs/heads/master | examples/process/echo.py | 57 | import sys
def main():
s = raw_input()
print "Python:" + s
main()
|
sdague/home-assistant | refs/heads/dev | tests/components/avri/test_config_flow.py | 6 | """Test the Avri config flow."""
from homeassistant import config_entries, setup
from homeassistant.components.avri.const import DOMAIN
from tests.async_mock import patch
async def test_form(hass):
"""Test we get the form."""
await setup.async_setup_component(hass, "avri", {})
result = await hass.config_... |
nitin-cherian/Webapps | refs/heads/master | TalkPython/P4E/my_web_app/.env/lib/python3.5/site-packages/pip/compat/__init__.py | 342 | """Stuff that differs in different Python versions and platform
distributions."""
from __future__ import absolute_import, division
import os
import sys
from pip._vendor.six import text_type
try:
from logging.config import dictConfig as logging_dictConfig
except ImportError:
from pip.compat.dictconfig import ... |
gri-is/lodjob | refs/heads/master | OLD_REPOSITORY/jobs/knoedler/tasks/sale_date.py | 1 | import os
from datetime import datetime
from pprint import pprint
from utils.data_templates import make_processing_event
from utils.date_parsing import *
file_name = os.path.basename(__file__).split('.')[-2]
def main(mongo):
"""
Uses date parsing utils to convert Knoedler sale date
fields into a timespan ... |
ju1ius/clisnips | refs/heads/master | clisnips/tui/widgets/field/field.py | 1 | import urwid
from clisnips.tui.urwid_types import TextMarkup
class Field:
signals = ['changed']
def get_value(self):
raise NotImplementedError()
class Entry:
signals = ['changed']
def get_value(self):
raise NotImplementedError()
class SimpleField(Field, urwid.Pile):
def _... |
meiavy/python-weixin | refs/heads/master | lib/python2.7/site-packages/setuptools/command/install_egg_info.py | 357 | from setuptools import Command
from setuptools.archive_util import unpack_archive
from distutils import log, dir_util
import os, shutil, pkg_resources
class install_egg_info(Command):
"""Install an .egg-info directory for the package"""
description = "Install an .egg-info directory for the package"
user_... |
pfalcon/picotui | refs/heads/master | picotui/context.py | 1 | from .screen import Screen
class Context:
def __init__(self, cls=True, mouse=True):
self.cls = cls
self.mouse = mouse
def __enter__(self):
Screen.init_tty()
if self.mouse:
Screen.enable_mouse()
if self.cls:
Screen.cls()
return self
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.