repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ajfriend/cvxpy | refs/heads/master | examples/extensions/kmeans.py | 11 | import cvxpy as cvx
import mixed_integer as mi
print(__doc__)
from time import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn import metrics
from sklearn.cluster import KMeans
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale
... |
mehanig/scrapi | refs/heads/develop | scrapi/harvesters/pubmedcentral.py | 2 | """
Harvester of PubMed Central for the SHARE notification service
Example API call: http://www.ncbi.nlm.nih.gov/pmc/oai/oai.cgi?verb=ListRecords&metadataPrefix=oai_dc&from=2015-04-13&until=2015-04-14
"""
from __future__ import unicode_literals
from scrapi.base import helpers
from scrapi.base import OAIHarvester
... |
ryannathans/micropython | refs/heads/master | tests/bench/arrayop-1-list_inplace.py | 101 | # Array operation
# Type: list, inplace operation using for. What's good about this
# method is that it doesn't require any extra memory allocation.
import bench
def test(num):
for i in iter(range(num//10000)):
arr = [0] * 1000
for i in range(len(arr)):
arr[i] += 1
bench.run(test)
|
blademainer/intellij-community | refs/heads/master | python/helpers/docutils/readers/standalone.py | 197 | # $Id: standalone.py 4802 2006-11-12 18:02:17Z goodger $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Standalone file Reader for the reStructuredText markup syntax.
"""
__docformat__ = 'reStructuredText'
import sys
from docutils import frontend, rea... |
hellodata/hellodate | refs/heads/master | 2/site-packages/django/contrib/gis/gdal/error.py | 104 | """
This module houses the OGR & SRS Exception objects, and the
check_err() routine which checks the status code returned by
OGR methods.
"""
#### OGR & SRS Exceptions ####
class GDALException(Exception):
pass
class OGRException(Exception):
pass
class SRSException(Exception):
pass
class OGRIndexE... |
katrid/django | refs/heads/master | tests/gis_tests/geogapp/tests.py | 253 | """
Tests for geography support in PostGIS
"""
from __future__ import unicode_literals
import os
from unittest import skipUnless
from django.contrib.gis.db.models.functions import Area, Distance
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.measure import D
from django.test import TestCase, ign... |
frankiecjunle/yunblog | refs/heads/master | venv/lib/python2.7/site-packages/flask/sessions.py | 119 | # -*- coding: utf-8 -*-
"""
flask.sessions
~~~~~~~~~~~~~~
Implements cookie based sessions based on itsdangerous.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import uuid
import hashlib
from base64 import b64encode, b64decode
from datetime import dateti... |
TU-Berlin-DIMA/myriad-toolkit | refs/heads/master | src/python/myriad/dgen.py | 2 | '''
Copyright 2010-2013 DIMA Research Group, TU Berlin
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... |
ox-it/django-conneg | refs/heads/master | django_conneg/tests/priorities.py | 1 | import itertools
import unittest
from django.http import HttpResponse
from django_conneg import http, views, decorators
class PriorityTestCase(unittest.TestCase):
mimetypes = ('text/plain', 'application/xml', 'text/html', 'application/json')
def getRenderer(self, format, mimetypes, name, priority):
... |
jason-weirather/IDP | refs/heads/master | bin/parseRef.py | 2 | #!/usr/bin/python
from operator import itemgetter, attrgetter
from datetime import *
import sys
"""
Note:
"""
### Compute number of bases to junction gap from an exon index (exclusive)
### exon_list format: [start+point, end_point, len]
##########
def comp_len_to_junc_gap_forward(start_index, exon_list, isoform_ex... |
amjadm61/bedrock | refs/heads/master | vendor-local/lib/python/south/tests/__init__.py | 93 | from __future__ import print_function
#import unittest
import os
import sys
from functools import wraps
from django.conf import settings
from south.hacks import hacks
# Make sure skipping tests is available.
try:
# easiest and best is unittest included in Django>=1.3
from django.utils import unittest
except I... |
balint256/gr-baz | refs/heads/master | python/introspective_xmlrpc_server.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# untitled.py
#
# Copyright 2014 Balint Seeber <balint@crawfish>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of th... |
pattisdr/osf.io | refs/heads/develop | api/tokens/urls.py | 3 | from django.conf.urls import url
from api.tokens import views
app_name = 'osf'
urlpatterns = [
url(r'^$', views.TokenList.as_view(), name='token-list'),
url(r'^(?P<_id>\w+)/$', views.TokenDetail.as_view(), name='token-detail'),
]
|
anbasile/flask_sample | refs/heads/master | flask/lib/python2.7/site-packages/setuptools/command/upload_docs.py | 390 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
from distutils.command.upload import upload
import os
import s... |
google/orbit | refs/heads/main | third_party/conan/recipes/llvm_textapi/conanfile.py | 1 | from conans import python_requires
import os
common = python_requires('llvm-common/0.0.3@orbitdeps/stable')
class LLVMObject(common.LLVMModulePackage):
version = common.LLVMModulePackage.version
name = 'llvm_textapi'
llvm_component = 'llvm'
llvm_module = 'TextAPI'
llvm_requires = ['llvm_headers', ... |
unor/schemaorg | refs/heads/master | lib/isodate/isodatetime.py | 12 | ##############################################################################
# Copyright 2009, Gerhard Weis
# 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 ... |
pacogomez/pyvcloud | refs/heads/master | pyvcloud/vcd/test.py | 1 | # VMware vCloud Director Python SDK
# Copyright (c) 2017 VMware, 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
#... |
susansalkeld/discsongs | refs/heads/master | discsongs/lib/python2.7/site-packages/werkzeug/script.py | 147 | # -*- coding: utf-8 -*-
r'''
werkzeug.script
~~~~~~~~~~~~~~~
.. admonition:: Deprecated Functionality
``werkzeug.script`` is deprecated without replacement functionality.
Python's command line support improved greatly with :mod:`argparse`
and a bunch of alternative modules.
Most ... |
juanleal/perfilResolve | refs/heads/master | node_modules/laravel-elixir/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py | 778 | #!/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.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... |
jerbob92/CouchPotatoServer | refs/heads/master | couchpotato/core/providers/automation/rottentomatoes/main.py | 10 | from couchpotato.core.helpers.rss import RSS
from couchpotato.core.helpers.variable import tryInt, splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.providers.automation.base import Automation
from xml.etree.ElementTree import QName
import datetime
import re
log = CPLog(__name__)
class Rotte... |
zhimin711/nova | refs/heads/master | nova/conf/__init__.py | 2 | # 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... |
eharney/nova | refs/heads/master | nova/api/openstack/compute/contrib/evacuate.py | 8 | # Copyright 2013 OpenStack Foundation
#
# 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... |
xrmx/django-stored-messages | refs/heads/master | stored_messages/backends/redis/__init__.py | 2 | # flake8: noqa
from .backend import RedisBackend, Message
|
cyril51/Sick-Beard | refs/heads/development | lib/hachoir_parser/file_system/linux_swap.py | 90 | """
Linux swap file.
Documentation: Linux kernel source code, files:
- mm/swapfile.c
- include/linux/swap.h
Author: Victor Stinner
Creation date: 25 december 2006 (christmas ;-))
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (ParserError, GenericVector,
UInt32, String,
Bytes,... |
Eddy0402/Environment | refs/heads/master | vim/ycmd/cpp/ycm/tests/gmock/gtest/test/gtest_xml_output_unittest.py | 1815 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | parallel/test_cases/8NodeBrick/cantilever_different_Poisson/NumberOfDivision4/PoissonRatio0.35/extract_numerical_solution.py | 170 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... |
kmoocdev2/edx-platform | refs/heads/real_2019 | common/djangoapps/entitlements/migrations/0010_backfill_refund_lock.py | 13 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
from django.db import migrations, models
def backfill_refundability(apps, schema_editor):
CourseEntitlementSupportDetail = apps.get_model('entitlements', 'CourseEntitlementSupportDetail')
for support_detail in Cour... |
jandom/rdkit | refs/heads/master | rdkit/sping/PS/latin1MetricsCache.py | 12 | FontWidths = {
'courier':
[600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600... |
dataxu/ansible | refs/heads/dx-stable-2.5 | lib/ansible/modules/network/aci/aci_tenant_ep_retention_policy.py | 14 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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'],
... |
knxd/PyKNyX | refs/heads/master | tests/core/dptXlator/dptXlatorFactory.py | 2 | # -*- coding: utf-8 -*-
from pyknyx.core.dptXlator.dptXlatorFactory import *
import unittest
# Mute logger
from pyknyx.services.logger import logging
logger = logging.getLogger(__name__)
logging.getLogger("pyknyx").setLevel(logging.ERROR)
class DPTMainTypeMapperTestCase(unittest.TestCase):
def setUp(self):
... |
ddietze/pyFSRS | refs/heads/master | available_modules/Devices/dummyValveY.py | 2 | """
.. module: dummyValveY
:platform: Windows
.. moduleauthor:: Scott Ellis skellis@berkeley.edu>
dummyAxis provides a dummy axis device for testing purposes.
You can use this file as a starting point when writing your own axis device module for pyFSRS.
..
This file is part of the pyFSRS app.
This program i... |
DinoV/PTVS | refs/heads/master | Python/Product/Pyvot/Pyvot/xl/_impl/table.py | 7 | # PyVot
# Copyright(c) Microsoft Corporation
# 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
#
# THIS CODE IS PROVIDED ON AN ... |
hyperized/ansible | refs/heads/devel | contrib/inventory/collins.py | 37 | #!/usr/bin/env python
"""
Collins external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
Collins ... |
sgiavasis/nipype | refs/heads/master | tools/toollib.py | 10 | """Various utilities common to IPython release and maintenance tools.
"""
from builtins import map
# Library imports
import os
import sys
from subprocess import Popen, PIPE, CalledProcessError, check_call
from distutils.dir_util import remove_tree
# Useful shorthands
pjoin = os.path.join
cd = os.chdir
# Utility fu... |
leilihh/nova | refs/heads/stable/icehouse | nova/tests/compute/test_compute_utils.py | 5 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
# 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... |
ivan-fedorov/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/tests/relatedapp/tests.py | 123 | from django.test import TestCase
from django.contrib.gis.geos import GEOSGeometry, Point, MultiPoint
from django.contrib.gis.db.models import Collect, Count, Extent, F, Union
from django.contrib.gis.geometry.backend import Geometry
from django.contrib.gis.tests.utils import mysql, oracle, no_mysql, no_oracle, no_spati... |
linuxmidhun/0install | refs/heads/master | zeroinstall/gtkui/help_box.py | 8 | """A dialog box for displaying help text."""
# Copyright (C) 2009, Thomas Leonard
# See the README file for details, or visit http://0install.net.
import gtk
import sys
class HelpBox(object):
"""A dialog for showing longish help texts.
The GTK widget is not created until L{display} is called.
"""
box = None
titl... |
clovett/MissionPlanner | refs/heads/master | Lib/distutils/filelist.py | 50 | """distutils.filelist
Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""
__revision__ = "$Id$"
import os, re
import fnmatch
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils im... |
maliciamrg/xbmc-addon-tvtumbler | refs/heads/master | resources/lib/dns/tsig.py | 18 | # Copyright (C) 2001-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... |
bclau/nova | refs/heads/master | nova/tests/api/openstack/compute/contrib/test_quotas.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
# 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
#... |
jedie/DragonPy | refs/heads/master | dragonpy/Dragon32/machine.py | 1 | #!/usr/bin/env python2
"""
Dragon 32
~~~~~~~~~
:created: 2014 by Jens Diemer - www.jensdiemer.de
:copyleft: 2014 by the DragonPy team, see AUTHORS for more details.
:license: GNU GPL v3 or above, see LICENSE for more details.
"""
import logging
from dragonpy.core.gui import DragonTkinterGUI
fro... |
sandeepdsouza93/TensorFlow-15712 | refs/heads/master | tensorflow/python/framework/tensor_shape_test.py | 79 | # 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... |
40223119/2015w11 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/unittest/test/testmock/testmagicmethods.py | 737 | import unittest
import inspect
import sys
from unittest.mock import Mock, MagicMock, _magics
class TestMockingMagicMethods(unittest.TestCase):
def test_deleting_magic_methods(self):
mock = Mock()
self.assertFalse(hasattr(mock, '__getitem__'))
mock.__getitem__ = Mock()
self.asser... |
mparus/android_kernel_huawei_msm8916_g760 | refs/heads/master | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
jwlawson/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/ops/ops_test.py | 94 | # 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... |
noamkatzir/palm-hand-reading | refs/heads/master | tests/test8.py | 1 | __author__ = 'noam'
import os
import cv2
import numpy as np
from matplotlib import pyplot as plt
from numpy import linalg
from operator import itemgetter, attrgetter, methodcaller
# return list of center sorted descending to the contour area
# and the min rect cordinates
def mapPalmAndFingers(contours, image):
ha... |
xHeliotrope/injustice_dropper | refs/heads/master | env/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/sbcharsetprober.py | 2926 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
bfirsh/needle | refs/heads/master | tests/__init__.py | 4 | import sys
from PIL import Image, ImageDraw
if sys.version_info >= (3, 0):
from io import BytesIO as IOClass
else:
try:
from cStringIO import StringIO as IOClass
except ImportError:
from StringIO import StringIO as IOClass
class ImageTestCaseMixin(object):
def get_image(self, colour... |
ahmetyazar/adj-demo | refs/heads/master | fulfillment/urllib3/util/ssl_.py | 87 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
IS_PYOPENSSL = False
IS_SECURETRANSPORT = Fals... |
trishnaguha/ansible | refs/heads/devel | lib/ansible/modules/crypto/acme/acme_certificate_revoke.py | 9 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net>
# 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_versio... |
sbidoul/buildbot | refs/heads/master | master/buildbot/test/unit/test_steps_source_bzr.py | 9 | # 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 WARRANTY; without eve... |
emptyewer/DEEPN | refs/heads/master | listen.py | 1 | import socket
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while 1:
try:
client_socket.connect(("localhost", 1599))
data = raw_input ( "Enter text to be upper-cased, q to quit\n" )
client_socket.send(data)
if ( data == 'q' or data == 'Q'):
client_soc... |
tiramiseb/awesomeshop | refs/heads/master | back/shop/__init__.py | 2 | # -*- coding: utf8 -*-
# Copyright 2015 Sébastien Maccagnoni
#
# This file is part of AwesomeShop.
#
# AwesomeShop is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (a... |
odooindia/odoo | refs/heads/master | addons/marketing_campaign/__openerp__.py | 67 | # -*- 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... |
adiog/dotfiles | refs/heads/master | .bin/fastcc.py | 1 | #!/usr/bin/python3
import os
from re import search
from fileinput import input
stl = {
'algorithm': ['max', 'min', 'sort'],
'numeric': ['accumulate'],
'array': ['array'],
'bitset': ['bitset'],
'iostream': ['cin', 'cout'],
'map': ['map'],
'memory': ['make_shared', 'make_unique', 'shared_ptr... |
rlucioni/rotations | refs/heads/master | rotations/tests/conftest.py | 1 | from pytest_factoryboy import register
from rotations.tests.factories import MemberFactory, RotationFactory
register(MemberFactory)
register(RotationFactory)
|
jaywreddy/django | refs/heads/master | django/contrib/auth/handlers/modwsgi.py | 537 | from django import db
from django.contrib import auth
from django.utils.encoding import force_bytes
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on whether the user exists and authen... |
jylaxp/django | refs/heads/master | tests/template_tests/filter_tests/test_escapejs.py | 324 | from __future__ import unicode_literals
from django.template.defaultfilters import escapejs_filter
from django.test import SimpleTestCase
from ..utils import setup
class EscapejsTests(SimpleTestCase):
@setup({'escapejs01': '{{ a|escapejs }}'})
def test_escapejs01(self):
output = self.engine.render_... |
Manojkumar91/odoo_inresto | refs/heads/master | addons/base_vat/base_vat.py | 2 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
webknjaz/routes | refs/heads/main | tests/test_units/test_base.py | 5 | import unittest
from routes import request_config, _RequestConfig
from routes.base import Route
class TestBase(unittest.TestCase):
def test_route(self):
route = Route(None, ':controller/:action/:id')
assert not route.static
def test_request_config(self):
orig_config = request_confi... |
pythonprobr/tekton | refs/heads/master | backend/apps/produto_app/produto_facade.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from produto_app.produto_commands import ListProdutoCommand, UpdateProdutoCommand, ProdutoForm,\
GetProdutoCommand, ListarProdutosPorCategoria, SalvarProdutoAtreladoACategoria, \
DeletarProdutosEArcoParaCategoria
def save_produto... |
ceesprojectofficial/rest_api | refs/heads/master | requesthandler.py | 2 | """
File: requesthandler.py
Author: Fernando Crespo Gravalos (cees.project.official@gmail.com)
Date: 2014/6/18
"""
"""
These functions provide request handling, leaving the views receive requests and sending real HTTP CEES responses.
"""
import ceesvalidator as cv
import ceesdbwrapper as cdbw
import constants as c
imp... |
TecnoSalta/bg | refs/heads/master | mezzanine/pages/models.py | 4 | from __future__ import unicode_literals
from future.builtins import filter, str
try:
from urllib.parse import urljoin
except ImportError: # Python 2
from urlparse import urljoin
from django.core.urlresolvers import resolve, reverse
from django.db import models
from django.utils.encoding import python_2_uni... |
kate-v-stepanova/scilifelab | refs/heads/master | tests/bcbio/test_bcbio.py | 4 | import os
import tempfile
import shutil
import unittest
from ..data import data_files
from scilifelab.bcbio.qc import RunInfoParser
filedir = os.path.abspath(os.path.realpath(os.path.dirname(__file__)))
RunInfo = data_files["RunInfo.xml"]
class TestBcbioQC(unittest.TestCase):
"""Test for bcbio qc module"""
d... |
keedio/hue | refs/heads/master | desktop/core/ext-py/python-ldap-2.3.13/Tests/t_cext.py | 40 |
import unittest, slapd
import _ldap
import logging
reusable_server = None
def get_reusable_server():
global reusable_server
if reusable_server is None:
reusable_server = slapd.Slapd()
return reusable_server
class TestLdapCExtension(unittest.TestCase):
"""Tests the LDAP C Extension module, _ld... |
sisap-ics/sisaptools | refs/heads/master | sisaptools/aes.py | 1 | # -*- coding: utf8 -*-
"""
Encriptació i desencriptació amb AES.
La clau es guarda en un fitxer.
"""
import base64
import hashlib
import os
from Crypto.Cipher import AES
from Crypto import Random
from .constants import APP_CHARSET
class AESCipher(object):
"""
Classe principal.
"""
def __init__(sel... |
acourtney2015/boto | refs/heads/develop | boto/cacerts/__init__.py | 260 | # Copyright 2010 Google Inc.
# 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 to use, copy, modify, merg... |
DavidMS51/TFWordclock | refs/heads/master | pixtest1.py | 1 | from luma.core.interface.serial import spi, noop
from luma.core.render import canvas
from luma.led_matrix.device import max7219
from time import sleep
serial = spi(port=0, device=0, gpio=noop())
device = max7219(serial)
#font = ImageFont.truetype("examples/pixelmix.ttf", 8)
#with canvas(device) as draw:
# draw.r... |
andela-ifageyinbo/django | refs/heads/master | tests/utils_tests/test_numberformat.py | 307 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
from sys import float_info
from unittest import TestCase
from django.utils.numberformat import format as nformat
class TestNumberFormat(TestCase):
def test_format_number(self):
self.assertEqual(nformat(1234, '... |
uweschmitt/emzed | refs/heads/master | libms/tools.py | 1 | #encoding: latin-1
## start of http://code.activestate.com/recipes/523004/ }}}
import gc, sys
from types import FrameType
def print_cycles(objects=gc.garbage, outstream=sys.stdout, show_progress=False):
"""
objects: A list of objects to find cycles in. It is often useful
to pass in gc... |
LittleSmaug/summercamp2k17 | refs/heads/master | src/physics/body.py | 1 | from .vector import Vector
class Body(object):
def __init__(self, m, p=Vector(), v=Vector()):
assert m > 0
self.m = m
self.forces = []
self.p = p
self.v = v
self.a = Vector()
self.space = None
def apply_force(self, force):
self.forces.append(force)
def reset_forces(self):
self.forces = []
def ... |
Maccimo/intellij-community | refs/heads/master | python/testData/paramInfo/NestedMultiArg.py | 83 | # py 2.x only
def foo(a, (b, c), d):
pass
foo(<arg1>1, <arg23>range(2), <arg4>4)
|
kdwink/intellij-community | refs/heads/master | python/helpers/pydev/tests_runfiles/test_pydevd_property.py | 56 | '''
Created on Aug 22, 2011
@author: hussain.bohra
@author: fabioz
'''
import os
import sys
import unittest
#=======================================================================================================================
# Test
#================================================================================... |
lmprice/ansible | refs/heads/devel | lib/ansible/plugins/lookup/credstash.py | 96 | # (c) 2015, Ensighten <infra@ensighten.com>
# (c) 2017 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
DOCUMENTATION = """
lookup: credstash
version_added: "2.0"
... |
josircg/raizcidadanista | refs/heads/master | raizcidadanista/cms/urls.py | 1 | # coding: utf-8
from django.conf.urls import patterns, include, url
from views import *
from forms import CustomPasswordResetForm
from cms.sitemap import sitemaps
urlpatterns = patterns('',
url(r'^$', HomeView.as_view(), name='home'),
url(r'^pesquisa/$', SearchView.as_view(), name='search'),
url(r'^circulo... |
houlixin/BBB-TISDK | refs/heads/master | linux-devkit/sysroots/i686-arago-linux/usr/lib/python2.7/_weakrefset.py | 135 | # Access WeakSet through the weakref module.
# This code is separated-out because it is needed
# by abc.py to load everything else at startup.
from _weakref import ref
__all__ = ['WeakSet']
class _IterationGuard(object):
# This context manager registers itself in the current iterators of the
# weak containe... |
4144414D/pytruecrypt | refs/heads/master | examples/keysearch.py | 1 | """
keyseaerch helps locate data by attempting to decrypt sectors with supplied
keys and seeing how random the resutls are.
Encryption modes can be assigned long or short hand where:
aes = a
twofish = t
serpent = s
For example 'aes-twofish' can be shortened to 'at' and aes-twofish-serpent
to ats.
GitHub: http... |
rsnakamura/iperflexer | refs/heads/master | tests/testpipe.py | 1 | from unittest import TestCase
from mock import MagicMock
from iperflexer.iperfparser import IperfParser
from iperflexer.sumparser import SumParser
FRAGMENT = """
------------------------------------------------------------
Client connecting to 192.168.20.99, TCP port 5001
TCP window size: 16.0 KByte (default)
-------... |
AmericanResearchInstitute/poweru-server | refs/heads/master | cmis_storage/views.py | 6027 | # Create your views here.
|
EShamaev/ardupilot | refs/heads/master | Tools/scripts/runplanetest.py | 37 | #!/usr/bin/env python
import pexpect, time, sys
from pymavlink import mavutil
def wait_heartbeat(mav, timeout=10):
'''wait for a heartbeat'''
start_time = time.time()
while time.time() < start_time+timeout:
if mav.recv_match(type='HEARTBEAT', blocking=True, timeout=0.5) is not None:
re... |
elba7r/builder | refs/heads/master | frappe/desk/doctype/todo/__init__.py | 1829 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
|
indhub/mxnet | refs/heads/master | python/mxnet/contrib/onnx/onnx2mx/import_model.py | 5 | # 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... |
jonjonarnearne/smi2021 | refs/heads/smi2021-kernel-4.1 | tools/perf/scripts/python/netdev-times.py | 1544 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/baremetalinfrastructure/azure-mgmt-baremetalinfrastructure/azure/mgmt/baremetalinfrastructure/_version.py | 9 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
jackkiej/SickRage | refs/heads/master | lib/pgi/obj.py | 18 | # Copyright 2012, 2013 Christoph Reiter
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
import itertools
fro... |
laszlocsomor/tensorflow | refs/heads/master | tensorflow/contrib/mpi_collectives/mpi_allgather_test.py | 69 | # 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... |
ssbarnea/ansible | refs/heads/devel | test/lib/ansible_test/_data/sanity/validate-modules/validate_modules/main.py | 6 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Matt Martz <matt@sivel.net>
# Copyright (C) 2015 Rackspace US, Inc.
#
# 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 ... |
jomauricio/abgthe | refs/heads/master | abgthe/apps/profiles/migrations/0003_auto_20150505_1813.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('profiles', '0002_auto_20150421_1529'),
]
operations = [
migrations.AlterField(
model_name='profile',
... |
mlalic/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/__init__.py | 1229 | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a ... |
rodrigosetti/recruitr | refs/heads/master | candidates/views.py | 1 | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.shortcuts import render, redirect
from django.utils.translation import ugettext as _
from .forms import UserForm, CandidateForm
from .models import Candidate
@login_required
def update_candidate(request):
if... |
liang42hao/bokeh | refs/heads/master | examples/plotting/server/brewer.py | 42 | # The plot server must be running
# Go to http://localhost:5006/bokeh to view this plot
from collections import OrderedDict
import numpy as np
import pandas as pd
from bokeh.plotting import figure, show, output_server
from bokeh.palettes import brewer
N = 20
categories = ['y' + str(x) for x in range(10)]
data = {}
... |
cslzchen/osf.io | refs/heads/develop | addons/s3/tests/factories.py | 32 | # -*- coding: utf-8 -*-
"""Factories for the S3 addon."""
import factory
from factory.django import DjangoModelFactory
from osf_tests.factories import UserFactory, ProjectFactory, ExternalAccountFactory
from addons.s3.models import (
UserSettings,
NodeSettings
)
class S3AccountFactory(ExternalAccountFactory):... |
patrickwestphal/owlapy | refs/heads/master | tests/vocab/owl2datatype_tests.py | 1 | import unittest
from owlapy.vocab.owl2datatype import OWL2Datatype
from owlapy.vocab.owl2datatype import Category
from owlapy.model import IRI
from owlapy.model import EntityType
from owlapy.model import OWLDatatype
from owlapy.model import OWLDataVisitor, OWLDataVisitorEx
from owlapy.model import OWLRuntimeException
... |
CompPhysics/ThesisProjects | refs/heads/master | doc/MSc/msc_students/former/AudunHansen/Audun/Pythonscripts/matrix_transforms.py | 1 | from numpy import *
class transforms():
def __init__(self, Np, Nh):
self.Np = Np
self.Nh = Nh
self.Tab = zeros((Np**2), dtype = int)
for b in range(Np):
self.Tab[range(b*Np,(b+1)*Np)] = range(b,Np**2, Np)
self.Tai = zeros((Np*Nh), d... |
darkwing/kuma | refs/heads/master | kuma/wiki/views/edit.py | 4 | # -*- coding: utf-8 -*-
import textwrap
from urllib import urlencode
import newrelic.agent
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.utils.translation import uget... |
leopittelli/Django-on-App-Engine-Example | refs/heads/master | django/contrib/sitemaps/tests/test_http.py | 109 | from __future__ import unicode_literals
import os
from datetime import date
from django.conf import settings
from django.contrib.sitemaps import Sitemap, GenericSitemap
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.test.utils import override_settings
... |
rjeschmi/easybuild-easyblocks | refs/heads/master | easybuild/easyblocks/s/soapdenovo.py | 3 | ##
# This file is an EasyBuild reciPY as per https://github.com/hpcugent/easybuild
#
# Copyright:: Copyright 2012-2013 University of Luxembourg/Luxembourg Centre for Systems Biomedicine
# Authors:: Cedric Laczny <cedric.laczny@uni.lu>, Fotis Georgatos <fotis.georgatos@uni.lu>, Kenneth Hoste
# License:: MIT/GPL
# $I... |
BRAINSia/ITK | refs/heads/master | Modules/Segmentation/LevelSets/wrapping/test/ThresholdSegmentationLevelSetImageFilterTest.py | 7 | # ==========================================================================
#
# Copyright NumFOCUS
#
# 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/... |
pitunti/alfaPitunti | refs/heads/master | plugin.video.alfa/channels/wopelis.py | 1 | # -*- coding: utf-8 -*-
import re
from core import channeltools
from core import httptools
from core import scrapertools
from core import servertools
from core import tmdb
from core.item import Item
from platformcode import config, logger
HOST = 'http://www.wopelis.com'
__channel__ = 'wopelis'
parameters = channelto... |
nsnam/ns-3-dev-git | refs/heads/master | src/propagation/bindings/modulegen__gcc_LP64.py | 4 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.