repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
awsdocs/aws-doc-sdk-examples | refs/heads/master | python/test_tools/fixtures/common.py | 1 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Common test fixtures that can be used throughout the unit tests for all Python
code examples.
"""
import contextlib
import time
import pytest
from test_tools.stubber_factory import stubber_factory
def pyt... |
amith01994/intellij-community | refs/heads/master | python/testData/inspections/PyTypeCheckerInspection/FunctionParameterReturnType.py | 49 | def func(f, seq):
"""
:param f: my param
:type f: (unknown) -> str
:rtype: list[str]
"""
return [f(v) for v in seq]
def f(x):
return int(x)
def test():
for item in func(<warning descr="Expected type '(Any) -> str', got '(x: Any) -> int' instead">f</warning>, []):
pass
fo... |
mitsuhiko/django | refs/heads/master | django/contrib/localflavor/fi/forms.py | 2 | """
FI-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
class FIZipCodeField(RegexField):
default_error_messages = {
... |
astrorafael/tessflux | refs/heads/master | tessflux/tessflux.py | 1 | # ----------------------------------------------------------------------
# Copyright (c) 2014 Rafael Gonzalez.
#
# See the LICENSE file for details
# ----------------------------------------------------------------------
#--------------------
# System wide imports
# -------------------
from __future__ import divisio... |
atlassian/dd-agent | refs/heads/master | checks.d/vsphere.py | 7 | # stdlib
from copy import deepcopy
from datetime import datetime, timedelta
from hashlib import md5
from Queue import Empty, Queue
import re
import ssl
import time
import traceback
# 3p
from pyVim import connect
from pyVmomi import vim
# project
from checks import AgentCheck
from checks.libs.thread_pool import Pool
f... |
houqp/rumrunner | refs/heads/master | test.py | 1 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
import unittest
import random
import os
import zmq
from rumrunner import Rumrunner
class TestRumrunner(unittest.TestCase):
def test_send_counter_metric(self):
ctx = zmq.Context()
recv_socket = ctx.socket(zmq.PULL)
tmp_metric_socket = '/var/tm... |
ThiagoGarciaAlves/intellij-community | refs/heads/master | python/lib/Lib/encodings/mac_croatian.py | 593 | """ Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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,inp... |
tgerla/ansible | refs/heads/devel | lib/ansible/vars/hostvars.py | 43 | # (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... |
ihousman/earthengine-api | refs/heads/master | python/examples/FeatureCollection/join.py | 5 | #!/usr/bin/env python
"""FeatureCollection Join example.
Show parks in San Francisco within 2 kilometers of a BART station.
"""
import ee
import ee.mapclient
ee.Initialize()
ee.mapclient.centerMap(-122.45, 37.75, 13)
bart = ee.FeatureCollection('ft:1xCCZkVn8DIkB7i7RVkvsYWxAxsdsQZ6SbD9PCXw')
parks = ee.FeatureCollec... |
Code4SA/ecd-crowdsourcing | refs/heads/master | address.py | 1 | import csv
import re
field_names = 'id,source_url,status,category,fax,name,postal_address,phone,reg_no,physical_address,legal_form,reg_date,contact_name,email,reg_status_cell,reg_no_cell,category1,category3,category2'.split(',')
def gen_re():
places = [el.strip() for el in open('zululand_places.txt')]
piped = ... |
ingokegel/intellij-community | refs/heads/master | python/testData/findUsages/Imports.py | 83 | import r<caret>e
x = re.compile('')
|
stack-of-tasks/rbdlpy | refs/heads/master | tutorial/lib/python2.7/site-packages/OpenGL/GL/ARB/robustness_isolation.py | 9 | '''OpenGL extension ARB.robustness_isolation
This module customises the behaviour of the
OpenGL.raw.GL.ARB.robustness_isolation to provide a more
Python-friendly API
Overview (from the spec)
GL_ARB_robustness and supporting window system extensions allow
creating an OpenGL context supporting graphics reset noti... |
jetskijoe/headphones | refs/heads/master | lib/requests/packages/chardet/jpcntx.py | 1776 | ######################## 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... |
martinb07/mysmarthome | refs/heads/develop | plugins/sml/__init__.py | 2 | #!/usr/bin/env python3
# vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab
#########################################################################
# Copyright 2012-2014 Oliver Hinckel github@ollisnet.de
#########################################################################
#
... |
CCI-MOC/haas | refs/heads/master | hil/client/user.py | 4 | """Client library for user-oriented api calls.
These are only meaningful if the server is configured to use
username & password auth.
"""
import json
from hil.client.base import ClientBase
from hil.client.base import check_reserved_chars
class User(ClientBase):
"""Consists of calls to query and
manipulate u... |
codemac/servo | refs/heads/master | tests/wpt/css-tests/tools/wptserve/wptserve/request.py | 57 | import base64
import cgi
import Cookie
import StringIO
import tempfile
import urlparse
import stash
from utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about the
v... |
galengold/split70 | refs/heads/master | qmk_firmware/lib/googletest/googletest/test/gtest_shuffle_test.py | 3023 | #!/usr/bin/env python
#
# Copyright 2009 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... |
Facetracker-project/facetracker-core | refs/heads/master | lib/youtube-dl/youtube_dl/extractor/keezmovies.py | 107 | from __future__ import unicode_literals
import os
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
compat_urllib_request,
)
class KeezMoviesIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?keezmovies\.com/video/.+?(?P<id>[0-9]+)(?:[/?&]|$)'
_TEST =... |
sqrf/nanoacoustics-mie | refs/heads/master | Scripts/lambdalist.py | 1 |
"""
File lambdalist.py
Author Rafael Silva Quiroz
email sqrf87@gmail.com
License educational use
Description List of wavelengths used in Epsilon.py for calculate the corrected dielectric function
Return Wavelengths
Reference Bohren & Hoffman data base
"""
f... |
giovannicode/djangoseller | refs/heads/master | users/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='User',
... |
agvergara/Python | refs/heads/master | X-Serv-15.6-Django-CMS_PUT/cms_put/views.py | 1 | from django.shortcuts import render
from cms.models import Pages
from django.http import HttpResponse, HttpResponseNotAllowed
from django.views.decorators.csrf import csrf_exempt
# Create your views here.
@csrf_exempt
def insertcontent(request):
info = request.body
try:
name = info.split('=')[0]
... |
bmanojlovic/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_user.py | 4 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... |
ourbest/sns_app | refs/heads/master | backend/schedulers.py | 1 | from datetime import datetime, timedelta
import django_rq
scheduler = None
def get_scheduler():
global scheduler
if scheduler:
return scheduler
scheduler = django_rq.get_scheduler('default')
return scheduler
def run_at(timestamp, func, *args, **kwargs):
if isinstance(timestamp, dateti... |
Compunctus/android_kernel_lge_g3 | refs/heads/cm-13.0 | tools/perf/util/setup.py | 4998 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
MattsFleaMarket/python-for-android | refs/heads/master | python-build/python-libs/gdata/tests/gdata_tests/apps/groups/service_test.py | 128 | #!/usr/bin/python
#
# Copyright (C) 2008 Google
#
# 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 ag... |
CALlanoR/VirtShell | refs/heads/master | virtshell_server/virtshell_server/errors.py | 2 | """
VirtShell-Server Errors
"""
class VirtShellServerError(Exception):
def __init__(self, message, code):
self.message = message
self.code = code
super(Exception, self).__init__(message)
# 400
class MissingField(VirtShellServerError):
def __init__(self, field):
IndicoError.__in... |
virneo/nupic | refs/heads/master | tests/unit/nupic/encoders/category_test.py | 7 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
tscohen/chainer | refs/heads/master | tests/chainer_tests/functions_tests/loss_tests/test_hierarchical_softmax.py | 9 | import copy
import unittest
import numpy
import chainer
from chainer import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
class TestHuffmanTree(unittest.TestCase):
def test_empty(self):
... |
Endika/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/transcripts.py | 56 | # disable missing docstring
# pylint: disable=missing-docstring
import os
from lettuce import world, step
from django.conf import settings
from xmodule.contentstore.content import StaticContent
from xmodule.contentstore.django import contentstore
from xmodule.exceptions import NotFoundError
from splinter.request_han... |
pheanex/xpython | refs/heads/master | exercises/tree-building/example.py | 3 | class Record():
def __init__(self, record_id, parent_id):
self.record_id = record_id
self.parent_id = parent_id
def equal_id(self):
return self.record_id == self.parent_id
class Node():
def __init__(self, node_id):
self.node_id = node_id
self.children = []
def va... |
martyngigg/pyqt-msvc | refs/heads/master | examples/painting/basicdrawing/basicdrawing_rc2.py | 5 | # -*- coding: utf-8 -*-
# Resource object code
#
# Created: Wed Mar 20 13:48:13 2013
# by: The Resource Compiler for PyQt (Qt v4.8.4)
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore
qt_resource_data = "\
\x00\x00\x02\xff\
\x89\
\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x... |
rvalyi/OpenUpgrade | refs/heads/master | addons/hr_gamification/models/gamification.py | 388 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
centralniak/railworks-dsd | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
import os
import setuptools
CLASSIFIERS = [
'Development Status :: 3 - Alpha',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: End Users/Desktop',
'License :: OSI Approved :: MIT License',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Py... |
julienbaladier/fuddly | refs/heads/master | framework/database.py | 1 | import sys
import os
import re
import math
import threading
from datetime import datetime
import framework.global_resources as gr
import libs.external_modules as em
from libs.external_modules import *
from libs.utils import ensure_dir, chunk_lines
def regexp(expr, item):
reg = re.compile(expr)
if item is Non... |
thnee/ansible | refs/heads/devel | lib/ansible/modules/cloud/oneandone/oneandone_firewall_policy.py | 21 | #!/usr/bin/python
# 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 later version.
#
# Ansible is distributed... |
n4hy/gnuradio | refs/heads/master | gr-pager/apps/usrp_flex_band.py | 6 | #!/usr/bin/env python
#
# Copyright 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 (a... |
yuruofeifei/mxnet | refs/heads/master | example/bi-lstm-sort/rnn_model.py | 19 | # 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... |
BrotherPhil/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex_multi_apps/app1/1_auto.py | 1155 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
carze/cutlass | refs/heads/master | examples/microbiome_assay_prep.py | 2 | #!/usr/bin/env python
# pylint: disable=C0111, C0325
import logging
import sys
import tempfile
from pprint import pprint
from cutlass import MicrobiomeAssayPrep
from cutlass import iHMPSession
username = "test"
password = "test"
def set_logging():
""" Setup logging. """
root = logging.getLogger()
root.s... |
pigshell/nhnick | refs/heads/vnc-websocket | test/www/__init__.py | 121 | # This file makes test/www/ into a "package" so that
# importing Python response hooks works correctly.
|
mikel-egana-aranguren/SADI-Galaxy-Docker | refs/heads/master | galaxy-dist/eggs/mercurial-2.2.3-py2.7-linux-x86_64-ucs4.egg/mercurial/hgweb/protocol.py | 1 | #
# Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import cgi, cStringIO, zlib, urllib
from mercurial import util, w... |
latusrepo/latus | refs/heads/master | latus/aws/util/aws_util.py | 2 |
from pprint import pprint
import latus.aws.aws_access
def dump_all(aws_local):
access_aws = latus.aws.aws_access.AWSAccess(aws_local)
db_client = access_aws.get_db_client()
s3_client = access_aws.get_s3_client()
s3_resource = access_aws.get_s3_resource()
buckets = s3_client.list_buckets()['Buc... |
buildbot/buildbot | refs/heads/master | worker/buildbot_worker/compat.py | 8 | # coding=utf-8
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRAN... |
lucafavatella/intellij-community | refs/heads/cli-wip | python/testData/quickFixes/PyMakeMethodStaticQuickFixTest/usage_after.py | 75 | class A:
@staticmethod
def m(x):
return x
print A.m(1) |
ResearchSoftwareInstitute/MyHPOM | refs/heads/myhpom-develop | hs_geographic_feature_resource/models.py | 1 | from lxml import etree
from django.db import models
from django.contrib.contenttypes.fields import GenericRelation
from mezzanine.pages.page_processors import processor_for
from dominate.tags import legend, table, tbody, tr, td, th, h4, div
from hs_core.models import BaseResource, ResourceManager, resource_processo... |
tylerreinhart/generator-django-kaiju | refs/heads/master | app/templates/kaiju/apps/core/context_processors.py | 5 | from django.conf import settings
def debug(request):
return {'DEBUG': settings.DEBUG}
|
xin3liang/platform_external_chromium_org | refs/heads/master | tools/telemetry/telemetry/core/heap/live_heap_object.py | 82 | # Copyright 2013 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.
class LiveHeapObject(object):
"""Data structure for representing an object in the heap snapshot.
Attributes:
object_id: int, identifier for the obje... |
Juniper/python-neutronclient | refs/heads/master | neutronclient/tests/unit/test_cli20_subnetpool.py | 3 | # Copyright 2015 OpenStack Foundation.
# 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... |
Brocade-OpenSource/OpenStack-DNRM-Neutron | refs/heads/master | neutron/plugins/bigswitch/extensions/__init__.py | 48 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Big Switch Networks, 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.a... |
foyzur/gpdb | refs/heads/master | gpMgmt/bin/gppylib/programs/__init__.py | 512 | # Make sure Python loads the modules of this package via absolute paths.
from os.path import abspath as _abspath
__path__[0] = _abspath(__path__[0])
|
AnalogJ/lexicon | refs/heads/master | lexicon/tests/providers/test_netcup.py | 1 | """Integration tests for netcup"""
from unittest import TestCase
import pytest
from lexicon.tests.providers.integration_tests import IntegrationTestsV2
# Hook into testing framework by inheriting unittest.TestCase and reuse
# the tests which *each and every* implementation of the interface must
# pass, by inheritan... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/mobile/shared_huurton_pup.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_huurton_pup.iff"
result.attribute_template_id = 9
result.stfN... |
mbkumar/pymatgen | refs/heads/master | pymatgen/util/tests/test_string_utils.py | 2 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import unittest
from pymatgen.util.string import formula_double_format, latexify, \
latexify_spacegroup, transformation_to_string, htmlify, unicodeify, \
disordered_formula, unicodeify_spacegroup, uni... |
johnchase/scikit-bio | refs/heads/master | skbio/stats/ordination/_utils.py | 3 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
diox/app-validator | refs/heads/master | appvalidator/testcases/javascript/predefinedentities.py | 3 | import math
import call_definitions
from appvalidator.constants import JS_DEBUG
from call_definitions import python_wrap
from entity_values import entity
from jstypes import JSGlobal, JSLiteral
# See https://github.com/mozilla/app-validator/wiki/JS-Predefined-Entities
# for details on entity properties.
def resolve... |
prutseltje/ansible | refs/heads/devel | test/units/module_utils/facts/other/test_ohai.py | 118 | # unit tests for ansible ohai fact collector
# -*- coding: utf-8 -*-
#
# 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 later version.
#
# An... |
luzpaz/QGIS | refs/heads/master | python/plugins/processing/core/outputs.py | 15 | # -*- coding: utf-8 -*-
"""
***************************************************************************
Output.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************************... |
myfreecomm/fixofx | refs/heads/master | 3rdparty/dateutil/rrule.py | 9 | """
Copyright (c) 2003-2005 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard python 2.3+
datetime module.
"""
__author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>"
__license__ = "PSF License"
import itertools
import datetime
import calendar
import thread
import sys
__all__ = ["... |
xrmx/xhtml2pdf | refs/heads/master | demo/tgpisa/setup.py | 168 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from turbogears.finddata import find_package_data
import os
execfile(os.path.join("tgpisa", "release.py"))
packages=find_packages()
package_data = find_package_data(where='tgpisa',
package='tgpisa')
if os.path.isdir('locales'):
packages.appe... |
freedomtan/tensorflow | refs/heads/master | tensorflow/python/training/momentum.py | 20 | # 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... |
zkan/pronto-feedback | refs/heads/master | pronto_feedback/officevibe/apis.py | 1 | import requests
class OfficeVibeManager(object):
def __init__(self):
self.feedback_url = 'https://app.officevibe.com/api/v2/feedback'
def get_feedback(self):
requests.get(self.feedback_url)
|
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.4/Lib/posixpath.py | 1 | """Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is a... |
VDuda/DjangoBookWorm | refs/heads/master | functional_tests/test_list_app.py | 1 | #! /usr/bin/env python3
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
import sys
class NewVisitorTest(StaticLiveServerTestCase):
@classmethod
def setUpClass(cls):
for arg in sys.argv:
... |
the-zebulan/CodeWars | refs/heads/master | katas/kyu_7/character_counter.py | 1 | from collections import Counter
def validate_word(word):
return len(set(Counter(word.lower()).itervalues())) == 1
|
adrienbrault/home-assistant | refs/heads/dev | tests/components/control4/__init__.py | 18 | """Tests for the Control4 integration."""
|
ljwolf/pysal | refs/heads/master | pysal/spreg/tests/test_sur.py | 7 | import unittest
import numpy as np
import pysal
from pysal.spreg.sur_utils import sur_dictxy,sur_dictZ
from pysal.spreg.sur import SUR,ThreeSLS
from pysal.common import RTOL
PEGP = pysal.examples.get_path
def dict_compare(actual, desired, rtol):
for i in actual.keys():
np.testing.assert_allclose(actual[i]... |
jshiv/turntable | refs/heads/master | test/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/euctwfreq.py | 3132 | ######################## 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... |
edouard-lopez/ansible-modules-core | refs/heads/devel | cloud/amazon/ec2_metric_alarm.py | 61 | #!/usr/bin/python
# 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 later version.
#
# Ansible is distributed... |
xaviercobain88/framework-python | refs/heads/master | openerp/addons/stock/__init__.py | 64 | # -*- 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... |
alexandrul-ci/robotframework | refs/heads/master | utest/model/test_testsuite.py | 7 | import unittest
from robot.utils.asserts import assert_equal, assert_true, assert_raises
from robot.model import TestSuite
from robot.utils import PY2, PY3
if PY3:
unicode = str
class TestTestSuite(unittest.TestCase):
def setUp(self):
self.suite = TestSuite(metadata={'M': 'V'})
def test_modif... |
incorrectusername/coala | refs/heads/master | tests/processes/BearRunningTest.py | 21 | import multiprocessing
import queue
import unittest
from coalib.bears.GlobalBear import GlobalBear
from coalib.bears.LocalBear import LocalBear
from coalib.processes.BearRunning import (
LOG_LEVEL, LogMessage, run, send_msg, task_done)
from coalib.processes.CONTROL_ELEMENT import CONTROL_ELEMENT
from coalib.result... |
mikesun/xen-cow-checkpointing | refs/heads/master | tools/python/xen/util/asserts.py | 52 | #===========================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope tha... |
hynnet/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/host/lib/scons-2.1.0/SCons/Defaults.py | 21 | """SCons.Defaults
Builders and other things for the local site. Here's where we'll
duplicate the functionality of autoconf until we move it into the
installation procedure or use something like qmconf.
The code that reads the registry to find MSVC components was borrowed
from distutils.msvccompiler.
"""
#
# Copyri... |
perlygatekeeper/glowing-robot | refs/heads/master | Little_Alchemy_2/Scraper_python/env/lib/python3.7/site-packages/bs4/formatter.py | 3 | from bs4.dammit import EntitySubstitution
class Formatter(EntitySubstitution):
"""Describes a strategy to use when outputting a parse tree to a string.
Some parts of this strategy come from the distinction between
HTML4, HTML5, and XML. Others are configurable by the user.
Formatters are passed in as... |
raster-foundry/raster-foundry | refs/heads/develop | app-tasks/rf/setup.py | 1 | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import print_function
import io
from glob import glob
from os.path import basename
from os.path import dirname
from os.path import join
from os.path import splitext
from setuptools import find_packages
from setuptools import setup
def read... |
wadetb/tinynumpy | refs/heads/master | docs/ext/numpydoc.py | 9 | """
========
numpydoc
========
Sphinx extension that handles docstrings in the Numpy standard format. [1]
It will:
- Convert Parameters etc. sections to field lists.
- Convert See Also section to a See also entry.
- Renumber references.
- Extract the signature from the docstring, if it can't be determined otherwise.... |
itai12312/workspaces | refs/heads/master | hellodjango/venv/lib/python2.7/site-packages/django/contrib/gis/tests/test_measure.py | 221 | """
Distance and Area objects to allow for sensible and convienient calculation
and conversions. Here are some tests.
"""
from django.contrib.gis.measure import Distance, Area, D, A
from django.utils import unittest
class DistanceTest(unittest.TestCase):
"Testing the Distance object"
def testInit(self):
... |
AllMyChanges/allmychanges.com | refs/heads/master | allmychanges/tests/registration.py | 1 | # coding: utf-8
from nose.tools import eq_
from .utils import check_status_code, create_user, refresh
from allmychanges import chat
from allmychanges.models import EmailVerificationCode
from django.core import mail
from django.test import Client
from django.core.urlresolvers import reverse
def test_user_creation_le... |
levkar/odoo-addons | refs/heads/8.0 | product_stock_location/__openerp__.py | 1 | # -*- coding: utf-8 -*-
{
'name': 'Product Stock Location',
'version': '1.0',
'category': 'Sales Management',
'sequence': 14,
'summary': 'Sales, Product, Category, Clasification',
'description': """
Product Stock Location
======================
""",
'author': 'Ingenieria ADHOC',
'we... |
marcellodesales/svnedge-console | refs/heads/master | ext/windows/pkg-toolkit/pkg/vendor-packages/doc/pycurl/tests/test_post.py | 13 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# vi:ts=4:et
# $Id: test_post.py,v 1.9 2003/04/21 18:46:11 mfx Exp $
import urllib
import pycurl
# simple
pf = {'field1': 'value1'}
# multiple fields
pf = {'field1':'value1', 'field2':'value2 with blanks', 'field3':'value3'}
# multiple fields with & in field
pf = ... |
lrivallain/openvolunteer | refs/heads/master | views.py | 1 | #-*- coding: utf-8 -*-
"""
---------------------------------------------------------------------------
OpenVolunteer
Copyright 2009, Ludovic Rivallain
---------------------------------------------------------------------------
This file is part of OpenVo... |
neurospin/pylearn-epac | refs/heads/master | examples/run_multi_processes.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 24 12:13:11 2013
@author: edouard.duchesnay@cea.fr
@author: benoit.da_mota@inria.fr
@author: jinpeng.li@cea.fr
Introduction
------------
The library Epac can create an Epac tree for machine learning algorithms.
This example shows how to compute Ep... |
quinot/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_network.py | 15 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... |
kotnik/nikola | refs/heads/master | nikola/plugins/task_copy_files.py | 3 | # -*- coding: utf-8 -*-
# Copyright © 2012-2013 Roberto Alsina and others.
# 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 t... |
libcrosswind/libcrosswind | refs/heads/master | platform/windows/compilers/x64/TDM-GCC-64/gdb64/bin/lib/msilib/text.py | 159 | import msilib,os;dirname=os.path.dirname(__file__)
ActionText = [
(u'InstallValidate', u'Validating install', None),
(u'InstallFiles', u'Copying new files', u'File: [1], Directory: [9], Size: [6]'),
(u'InstallAdminPackage', u'Copying network install files', u'File: [1], Directory: [9], Size: [6]'),
(u'FileCost', u'C... |
cristianquaglio/odoo | refs/heads/master | addons/account/wizard/account_chart.py | 271 | # -*- 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... |
GeographicaGS/moocng | refs/heads/master | moocng/api/admin.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2012-2013 UNED
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
erhuabushuo/crossbar | refs/heads/master | crossbar/twisted/tests/test_endpoint.py | 2 | #####################################################################################
#
# Copyright (C) Tavendo GmbH
#
# Unless a separate license agreement exists between you and Tavendo GmbH (e.g. you
# have purchased a commercial license), the license terms below apply.
#
# Should you enter into a separate licen... |
deandunbar/html2bwml | refs/heads/master | venv/lib/python2.7/site-packages/django/db/models/options.py | 49 | from __future__ import unicode_literals
from bisect import bisect
from collections import OrderedDict
import warnings
from django.apps import apps
from django.conf import settings
from django.db.models.fields.related import ManyToManyRel
from django.db.models.fields import AutoField, FieldDoesNotExist
from django.db.... |
otsaloma/poor-maps | refs/heads/master | poor/test/test_voice.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2017 Osmo Salomaa
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... |
almarklein/scikit-image | refs/heads/master | skimage/exposure/exposure.py | 1 | import warnings
import numpy as np
from skimage import img_as_float
from skimage.util.dtype import dtype_range, dtype_limits
from skimage._shared.utils import deprecated
__all__ = ['histogram', 'cumulative_distribution', 'equalize',
'rescale_intensity', 'adjust_gamma',
'adjust_log', 'adjust_sig... |
PaulWay/spacewalk | refs/heads/master | client/tools/rhn-virtualization/actions/virt.py | 7 | #
# Copyright (c) 2008--2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
aflaxman/scikit-learn | refs/heads/master | sklearn/cross_validation.py | 21 | """
The :mod:`sklearn.cross_validation` module includes utilities for cross-
validation and performance evaluation.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>,
# Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
from... |
dnozay/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/regressiontests/defaultfilters/tests.py | 49 | # -*- coding: utf-8 -*-
import datetime
from django.utils import unittest
from django.template.defaultfilters import *
class DefaultFiltersTests(unittest.TestCase):
def test_floatformat(self):
self.assertEqual(floatformat(7.7), u'7.7')
self.assertEqual(floatformat(7.0), u'7')
self.assertE... |
pkoutsias/SickRage | refs/heads/master | lib/mako/lookup.py | 34 | # mako/lookup.py
# Copyright (C) 2006-2015 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import os
import stat
import posixpath
import re
from mako import exceptions, util
from mako.templa... |
sburnett/seattle | refs/heads/master | softwareupdater/generatekeys.py | 1 | import repyhelper
# simple keypair creator...
import sys
import random
repyhelper.translate_and_import("rsa.repy")
# need to support random number generation
randomfloat = random.random
pubfn = sys.argv[1]+'.publickey'
privfn = sys.argv[1]+'.privatekey'
if len(sys.argv) == 3:
keylength = int(sys.argv[2])
else:
... |
edulramirez/nova | refs/heads/master | nova/tests/unit/objects/test_block_device.py | 5 | # Copyright 2013 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
aduric/crossfit | refs/heads/master | nonrel/tests/regressiontests/templates/nodelist.py | 54 | from django.template.loader import get_template_from_string
from django.template import VariableNode
from django.utils.unittest import TestCase
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}{{ a }}{% endfor %}'
template = get_template_from_string(source)
vars... |
Glasgow2015/team-10 | refs/heads/master | env/lib/python2.7/site-packages/setuptools/script template.py | 486 | # EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r
__requires__ = """%(spec)r"""
import pkg_resources
pkg_resources.run_script("""%(spec)r""", """%(script_name)r""")
|
srznew/heat | refs/heads/master | heat/engine/clients/os/ceilometer.py | 8 | #
# 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
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.