repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
Gandi/pyramid_kvs
refs/heads/master
pyramid_kvs/__init__.py
1
""" pyramid_kvs is a Key/Value Store helpers for pyramid. See the README.rst file for more information. """ __version__ = '0.4.1' from pyramid.events import NewRequest from .session import SessionFactory from .perlsess import PerlSession from .cache import ApplicationCache from .ratelimit import Ratelimit def sub...
plotly/python-api
refs/heads/master
packages/python/plotly/plotly/validators/heatmapgl/hoverlabel/_bordercolor.py
1
import _plotly_utils.basevalidators class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="bordercolor", parent_name="heatmapgl.hoverlabel", **kwargs ): super(BordercolorValidator, self).__init__( plotly_name=plotly_name, ...
Vagab0nd/SiCKRAGE
refs/heads/master
sickchill/views/home.py
1
import ast import base64 import datetime import json import os import time import urllib.parse from operator import attrgetter from urllib.parse import unquote_plus from github.GithubException import GithubException from tornado.escape import xhtml_unescape import sickchill.oldbeard from sickchill import adba, logger...
elpaso/QGIS
refs/heads/master
python/plugins/processing/algs/gdal/proximity.py
15
# -*- coding: utf-8 -*- """ *************************************************************************** proximity.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *****************************...
abhattad4/Digi-Menu
refs/heads/master
digimenu2/django/contrib/gis/db/models/sql/__init__.py
127
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField, GMLField __all__ = [ 'AreaField', 'DistanceField', 'GeomField', 'GMLField' ]
jhg/django
refs/heads/master
django/contrib/gis/db/models/sql/__init__.py
127
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField, GMLField __all__ = [ 'AreaField', 'DistanceField', 'GeomField', 'GMLField' ]
bitmonk/fabtools
refs/heads/python3
fabtools/tests/test_files.py
9
import hashlib import unittest from mock import patch import pytest @patch('fabtools.require.files._mode') @patch('fabtools.require.files._owner') @patch('fabtools.require.files.umask') @patch('fabtools.require.files.put') @patch('fabtools.require.files.md5sum') @patch('fabtools.require.files.is_file') class FilesTe...
ravindrapanda/tensorflow
refs/heads/master
tensorflow/python/ops/manip_grad.py
3
# 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...
astrorafael/twisted-mqtt
refs/heads/master
mqtt/client/publisher.py
1
# ---------------------------------------------------------------------- # Copyright (C) 2015 by Rafael Gonzalez # # 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, includ...
jjmiranda/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/library_content_module.py
15
# -*- coding: utf-8 -*- """ LibraryContent: The XBlock used to include blocks from a library in a course. """ import json from lxml import etree from copy import copy from capa.responsetypes import registry from gettext import ngettext from lazy import lazy from .mako_module import MakoModuleDescriptor from opaque_key...
yongshengwang/hue
refs/heads/master
desktop/core/ext-py/lxml/src/lxml/html/tests/test_xhtml.py
48
import unittest, sys from lxml.tests.common_imports import make_doctest import lxml.html def test_suite(): suite = unittest.TestSuite() suite.addTests([make_doctest('test_xhtml.txt')]) return suite if __name__ == '__main__': unittest.main()
TifaSky/zenoss_midrest
refs/heads/master
app/utils/db_manager.py
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ File: db_manager.py Author: fangfei Email: fangfei@youku.com Description: """ import os import sys import logging parentdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, parentdir) import MySQLdb import memcache from utils.switch_...
40223220/cd0504
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/tokenize.py
728
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for EOF). ...
Tejeshwarabm/Westwood
refs/heads/master
src/antenna/bindings/modulegen__gcc_ILP32.py
38
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)) ...
flakerimi/ajenti
refs/heads/master
plugins/pkgman/pm_portage.py
17
import os import subprocess import lxml.etree from ajenti.com import * from ajenti.utils import shell, shell_bg from ajenti import apis class PortagePackageManager(Plugin): implements(apis.pkgman.IPackageManager) platform = ['gentoo'] _pending = {} def refresh(self, st): st.full = self.eix_p...
georgtroska/root
refs/heads/master
interpreter/llvm/src/utils/lit/tests/shtest-timeout.py
24
# REQUIRES: python-psutil # Test per test timeout using external shell # RUN: not %{lit} \ # RUN: %{inputs}/shtest-timeout/infinite_loop.py \ # RUN: %{inputs}/shtest-timeout/quick_then_slow.py \ # RUN: %{inputs}/shtest-timeout/short.py \ # RUN: %{inputs}/shtest-timeout/slow.py \ # RUN: -j 1 -v --debug --timeout 1 --pa...
JohnDenker/brython
refs/heads/master
www/src/Lib/test/test_call.py
182
import unittest from test import support # The test cases here cover several paths through the function calling # code. They depend on the METH_XXX flag that is used to define a C # function, which can't be verified from Python. If the METH_XXX decl # for a C function changes, these tests may not cover the right pat...
ryannathans/micropython
refs/heads/master
tests/basics/dict_iterator.py
118
d = {1: 2, 3: 4} els = [] for i in d: els.append((i, d[i])) print(sorted(els))
malconis/deproxy
refs/heads/master
deproxy/request.py
1
class Request: """A simple HTTP Request, with method, path, headers, and body.""" def __init__(self, method, path, headers, body): self.method = method self.path = path self.headers = dict(headers) self.body = body def __repr__(self): return ('Request(method=%r, pa...
itziakos/haas
refs/heads/master
haas/plugins/i_result_handler_plugin.py
3
# -*- coding: utf-8 -*- # Copyright (c) 2013-2014 Simon Jagoe # All rights reserved. # # This software may be modified and distributed under the terms # of the 3-clause BSD license. See the LICENSE.txt file for details. from __future__ import absolute_import, unicode_literals from abc import ABCMeta, abstractmethod ...
hoangminhitvn/flask
refs/heads/master
flask/lib/python2.7/site-packages/flask/testsuite/test_apps/flaskext/oldext_simple.py
629
ext_id = 'oldext_simple'
NationalGenomicsInfrastructure/charon
refs/heads/master
charon/test_seqrun.py
3
""" Charon: nosetests /api/v1/seqrun Requires env vars CHARON_API_TOKEN and CHARON_BASE_URL. """ import os import json import requests import nose def url(*segments): "Synthesize absolute URL from path segments." return "{0}api/v1/{1}".format(BASE_URL,'/'.join([str(s) for s in segments])) API_TOKEN = os.get...
JohnFrazier/pacman
refs/heads/master
test/pacman/tests/sync009.py
56
self.description = "Install a package from a sync db" sp = pmpkg("dummy") sp.files = ["bin/dummy", "usr/man/man1/dummy.1"] self.addpkg2db("sync", sp) self.args = "-S %s" % sp.name self.addrule("PACMAN_RETCODE=0") self.addrule("PKG_EXIST=dummy") for f in sp.files: self.addrule("FILE_EXIST=%s" % f)
yeraydiazdiaz/nonrel-blog
refs/heads/master
search/core.py
9
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.db.models import signals from djangotoolbox.fields import ListField from djangotoolbox.utils import getattr_by_path from copy import deepcopy import re import string _PUNCTUATION_REGEX = re.c...
ankurjimmy/catawampus
refs/heads/master
tr/vendor/curtain/digest.py
5
from tornado.web import * from hashlib import md5 class DigestAuthMixin(object): def apply_checksum(self, data): return md5(data).hexdigest() def apply_digest(self, secret, data): return self.apply_checksum(secret + ":" + data) def A1(self, algorithm, auth_pass): """ If '...
csrocha/OpenUpgrade
refs/heads/8.0
addons/pos_discount/__init__.py
315
# -*- 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...
chipaca/snapcraft
refs/heads/master
tests/unit/test_mountinfo.py
2
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
FreekingDean/home-assistant
refs/heads/dev
homeassistant/helpers/service.py
19
"""Service calling related helpers.""" import asyncio import functools import logging # pylint: disable=unused-import from typing import Optional # NOQA import voluptuous as vol from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant # NOQA from homeassistant.exceptions import Te...
ColumbiaCMB/kid_readout
refs/heads/master
apps/data_taking_scripts/2017-05-jpl-lf-n1-optical/single-horn/sweep_stream_mmw_compressor_off.py
1
import time import numpy as np from equipment.custom import mmwave_source from equipment.hittite import signal_generator from equipment.srs import lockin from xystage import stepper from kid_readout.interactive import * from kid_readout.equipment import hardware from kid_readout.measurement import mmw_source_sweep, ...
nagadomi/keras
refs/heads/master
activations.py
2
import theano import theano.tensor as T import types def softmax(x): return T.nnet.softmax(x) def softplus(x): return T.nnet.softplus(x) def relu(x): return (x + abs(x)) / 2.0 def tanh(x): return T.tanh(x) def sigmoid(x): return T.nnet.sigmoid(x) def hard_sigmoid(x): return T.nnet.hard_sig...
andydandy74/ClockworkForDynamo
refs/heads/master
nodes/0.7.x/python/Wall.CreationMethodIsStandard.py
4
import clr clr.AddReference('RevitAPI') from Autodesk.Revit.DB import * clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) wallinstances = UnwrapElement(IN[0]) booleans = list() for item in wallinstances: try: if item.GetType().Name == 'Wall': booleans.append(True) else: boole...
wglas85/math
refs/heads/master
src/mathx/solver.py
1
''' Created on 24.09.2015 @author: michi ''' from mathx import formula from mathx import ast from copy import deepcopy import os import logging log = logging.getLogger('mathx.gleichungslöser') #handler = logging.StreamHandler(open('/dev/stderr', 'w')) #formatter = logging.Formatter( '%(asctime)s %(levelname)s %(mes...
GenericStudent/home-assistant
refs/heads/dev
tests/components/notion/test_config_flow.py
5
"""Define tests for the Notion config flow.""" import aionotion import pytest from homeassistant import data_entry_flow from homeassistant.components.notion import DOMAIN, config_flow from homeassistant.config_entries import SOURCE_USER from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from tests.async_moc...
Letractively/userinfuser
refs/heads/master
serverside/main.py
12
# Copyright (C) 2011, CloudCaptive # # 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 program is distributed i...
ohinckel/smarthome
refs/heads/master
lib/config.py
1
#!/usr/bin/env python3 # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2013 Marcus Popp marcus@popp.mx # Copyright 2016 The SmartHomeNG team ######################################...
mdaniel/intellij-community
refs/heads/master
python/testData/refactoring/inlineFunction/usesArgumentUnpacking.py
12
def foo(a, b, c, d): print(a, b, c, d) arg = (1, 2, 3, 4) fo<caret>o(*arg)
godLoveLucifer/viewfinder
refs/heads/master
backend/db/notification.py
13
# Copyright 2012 Viewfinder Inc. All Rights Reserved. """Viewfinder notification. Notifications are the mechanism by which the client is notified of incremental modifications to server assets. Notifications enable the client to incrementally keep its state in sync with the server. Furthermore, pushed alerts not...
jmgilbert2/energi
refs/heads/energi_v0_egihash_integration
qa/rpc-tests/bipdersig-p2p.py
40
#!/usr/bin/env python2 # # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from test_framework.test_framework import ComparisonTestFramework from test_framework.util import * from test_framework.mininode import CTransaction, N...
gauribhoite/personfinder
refs/heads/master
env/google_appengine/lib/django-1.2/django/contrib/flatpages/tests/views.py
47
import os from django.conf import settings from django.test import TestCase class FlatpageViewTests(TestCase): fixtures = ['sample_flatpages'] urls = 'django.contrib.flatpages.tests.urls' def setUp(self): self.old_MIDDLEWARE_CLASSES = settings.MIDDLEWARE_CLASSES flatpage_middleware_class =...
dkarakats/edx-platform
refs/heads/master
cms/djangoapps/contentstore/management/commands/populate_creators.py
182
""" Script for granting existing course instructors course creator privileges. This script is only intended to be run once on a given environment. """ from course_creators.views import add_user_with_status_granted, add_user_with_status_unrequested from django.core.management.base import BaseCommand from django.contri...
Azulinho/ansible
refs/heads/devel
lib/ansible/modules/source_control/github_issue.py
44
#!/usr/bin/python # (c) 2017, Abhijeet Kasurde <akasurde@redhat.com> # 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', 's...
yjmade/odoo
refs/heads/8.0
addons/sale/sales_team.py
61
# -*- coding: utf-8 -*- import calendar from datetime import date from dateutil import relativedelta import json from openerp import tools from openerp.osv import fields, osv class crm_case_section(osv.osv): _inherit = 'crm.case.section' def _get_sale_orders_data(self, cr, uid, ids, field_name, arg, contex...
ammarkhann/FinalSeniorCode
refs/heads/master
lib/python2.7/site-packages/IPython/core/prefilter.py
8
# encoding: utf-8 """ Prefiltering components. Prefilters transform user input before it is exec'd by Python. These transforms are used to implement additional syntax such as !ls and %magic. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from keyword import ...
axelkennedal/dissen
refs/heads/master
dissenEnv/lib/python3.5/site-packages/pip/_vendor/requests/structures.py
149
# -*- coding: utf-8 -*- """ requests.structures ~~~~~~~~~~~~~~~~~~~ Data structures that power Requests. """ import collections from .compat import OrderedDict class CaseInsensitiveDict(collections.MutableMapping): """ A case-insensitive ``dict``-like object. Implements all methods and operations of...
WaltHP/os-brick
refs/heads/master
os_brick/tests/initiator/test_connector.py
1
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 re...
mosser/ArduinoML-kernel
refs/heads/master
externals/xtext/vscode-extension-self-contained/.gradle/nodejs/node-v10.16.0-linux-x64/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
# Copyright (c) 2014 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. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
miniconfig/home-assistant
refs/heads/dev
homeassistant/components/sensor/command_line.py
13
""" Allows to configure custom shell commands to turn a value for a sensor. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.command_line/ """ from datetime import timedelta import logging import subprocess import voluptuous as vol from homeassist...
hwu25/AppPkg
refs/heads/trunk
Applications/Python/Python-2.7.2/Tools/gdb/libpython.py
6
#!/usr/bin/python ''' From gdb 7 onwards, gdb's build can be configured --with-python, allowing gdb to be extended with Python code e.g. for library-specific data visualizations, such as for the C++ STL types. Documentation on this API can be seen at: http://sourceware.org/gdb/current/onlinedocs/gdb/Python-API.ht...
yanheven/glance
refs/heads/master
glance/tests/functional/v2/test_metadef_objects.py
5
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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...
MounirMesselmeni/django
refs/heads/master
tests/template_tests/filter_tests/test_capfirst.py
521
from django.template.defaultfilters import capfirst from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class CapfirstTests(SimpleTestCase): @setup({'capfirst01': '{% autoescape off %}{{ a|capfirst }} {{ b|capfirst }}{% endautoescape %}'}) def test_...
andybak/hendrix
refs/heads/master
examples/django_hx_chatserver/example_app/example_app/settings.py
4
""" Django settings for example_app project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
romain-li/edx-platform
refs/heads/master
openedx/core/djangoapps/embargo/views.py
10
"""Views served by the embargo app. """ from django.http import Http404 from django.views.generic.base import View from edxmako.shortcuts import render_to_response from . import messages class CourseAccessMessageView(View): """Show a message explaining that the user was blocked from a course. """ ENROLLME...
timkrentz/SunTracker
refs/heads/master
IMU/VTK-6.2.0/ThirdParty/Twisted/twisted/protocols/memcache.py
2
# -*- test-case-name: twisted.test.test_memcache -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Memcache client protocol. Memcached is a caching server, storing data in the form of pairs key/value, and memcache is the protocol to talk with it. To connect to a server, create a ...
EricMuller/mywebmarks-backend
refs/heads/master
requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/application/runner/test/test_runner.py
11
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.application.runner._runner}. """ from signal import SIGTERM from io import BytesIO import errno from twisted.logger import ( LogLevel, LogPublisher, LogBeginner, FileLogObserver, FilteringLogObserver, LogLevelFilt...
endlessm/chromium-browser
refs/heads/master
third_party/depot_tools/tests/auth_test.py
2
#!/usr/bin/env vpython3 # Copyright (c) 2017 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 auth.py""" import calendar import datetime import json import os import unittest import sys if sys.version_in...
grahamgilbert/Crypt-Server
refs/heads/master
server/migrations/0009_secret_rotation_required.py
1
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2018-04-30 21:37 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("server", "0008_auto_20150814_2140")] operations = [ migrations.AddField( model...
noba3/KoTos
refs/heads/master
addons/plugin.video.mega/resources/lib/platform_libraries/Darwin/osx/Crypto/Random/Fortuna/SHAd256.py
11
# -*- coding: ascii -*- # # Random/Fortuna/SHAd256.py : SHA_d-256 hash function implementation # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that de...
madarou/angular-django
refs/heads/master
app/__init__.py
22
__author__ = 'RaPoSpectre'
igorcompuff/ns-3.26
refs/heads/master
src/nix-vector-routing/test/examples-to-run.py
200
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more i...
ZsTizy/heekscnc
refs/heads/master
area_funcs.py
24
import area from nc.nc import * import math import kurve_funcs # some globals, to save passing variables as parameters too much area_for_feed_possible = None tool_radius_for_pocket = None def cut_curve(curve, need_rapid, p, rapid_safety_space, current_start_depth, final_depth): prev_p = p first = T...
hanicker/odoo
refs/heads/8.0
addons/account_bank_statement_extensions/account_bank_statement.py
131
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
CloudWareChile/OpenChile
refs/heads/master
openerp/addons/account_anglo_saxon/__init__.py
9
############################################################################## # # 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 GNU Affero General Publ...
dufferzafar/picard
refs/heads/master
picard/ui/options/cdlookup.py
6
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # Copyright (c) 2004 Robert Kaye # Copyright (C) 2006 Lukáš Lalinský # # 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; ...
coreos/autotest
refs/heads/master
client/shared/common.py
12
import os, sys try: import autotest.client.setup_modules as setup_modules client_dir = os.path.dirname(setup_modules.__file__) except ImportError: dirname = os.path.dirname(sys.modules[__name__].__file__) client_dir = os.path.abspath(os.path.join(dirname, "..")) sys.path.insert(0, client_dir) im...
proxysh/Safejumper-for-Mac
refs/heads/master
buildlinux/env64/lib/python2.7/encodings/gbk.py
816
# # gbk.py: Python Unicode Codec for GBK # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_cn, codecs import _multibytecodec as mbc codec = _codecs_cn.getcodec('gbk') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(mbc.MultibyteIncrementalEnco...
sayoun/workalendar
refs/heads/master
workalendar/usa/mississippi.py
1
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from .core import UnitedStates class Mississippi(UnitedStates): """Mississippi""" include_thanksgiving_friday = True include_confederation_day = True include_columbus_d...
srimai/odoo
refs/heads/8.0
openerp/http.py
66
# -*- coding: utf-8 -*- #---------------------------------------------------------- # OpenERP HTTP layer #---------------------------------------------------------- import ast import collections import contextlib import datetime import errno import functools import getpass import inspect import logging import mimetypes...
DavidEGrayson/MSYS2-pacman
refs/heads/master
test/pacman/tests/sync200.py
10
self.description = "Synchronize the local database" self.option['XferCommand'] = ['/usr/bin/curl %u > %o'] sp1 = pmpkg("spkg1", "1.0-1") sp1.depends = ["spkg2"] sp2 = pmpkg("spkg2", "2.0-1") sp2.depends = ["spkg3"] sp3 = pmpkg("spkg3", "3.0-1") sp3.depends = ["spkg1"] for sp in sp1, sp2, sp3: self.addpkg2db("sync",...
waddedMeat/asteroids-ish
refs/heads/master
Asteroids/Asteroid.py
1
__author__ = 'jmoran' from Asteroids import MovingObject from Asteroids.Colors import * from random import getrandbits, randint from math import sin, cos, radians class Asteroid(MovingObject): def __init__(self, window, game, init_point, size): slope = (1 if getrandbits(1) else -1, 1 if getrandbits(1) el...
unnikrishnankgs/va
refs/heads/master
venv/lib/python3.5/site-packages/matplotlib/tests/test_labeled_data_unpacking.py
5
from __future__ import (absolute_import, division, print_function) from nose.tools import (assert_raises, assert_equal) from nose.plugins.skip import SkipTest try: # 3.2+ versions from nose.tools import assert_regex, assert_not_regex except ImportError: # 2.7 versions from nose.tools import assert_reg...
v-iam/azure-sdk-for-python
refs/heads/master
azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/connectivity_issue.py
2
# 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 ...
DSLituiev/scikit-learn
refs/heads/master
sklearn/neural_network/_base.py
29
"""Utilities for the neural network modules """ # Author: Issam H. Laradji <issam.laradji@gmail.com> # Licence: BSD 3 clause import numpy as np from ..utils.fixes import expit as logistic_sigmoid def identity(X): """Simply return the input array. Parameters ---------- X : {array-like, sparse matri...
omni5cience/django-inlineformfield
refs/heads/master
.tox/py27/lib/python2.7/site-packages/django/test/simple.py
51
""" This module is pending deprecation as of Django 1.6 and will be removed in version 1.8. """ from importlib import import_module import json import re import unittest as real_unittest import warnings from django.apps import apps from django.test import _doctest as doctest from django.test import runner from django...
jnishi/chainer
refs/heads/master
tests/chainer_tests/distributions_tests/test_one_hot_categorical.py
2
import numpy from chainer import cuda from chainer import distributions from chainer import testing def _numpy_stack(xs, axis): try: return numpy.stack(xs, axis) except AttributeError: # in case numpy<1.10, which does not have numpy.stack return numpy.concatenate( [numpy.e...
samfpetersen/gnuradio
refs/heads/master
gr-digital/python/digital/ofdm_txrx.py
27
# # Copyright 2013 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 version. # #...
tarikkdiry/Flock
refs/heads/master
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py
2918
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
ddki/my_study_project
refs/heads/master
language/python/frameworks/flask/venv/lib/python2.7/site-packages/click/exceptions.py
199
from ._compat import PY2, filename_to_ui, get_text_stderr from .utils import echo class ClickException(Exception): """An exception that Click can handle and show to the user.""" #: The exit code for this exception exit_code = 1 def __init__(self, message): if PY2: if message is n...
allotria/intellij-community
refs/heads/master
python/testData/optimizeImports/moduleLevelDunderWithImportFromFutureAbove.after.py
12
from __future__ import print_function __author__ = "akniazev" from collections import OrderedDict from datetime import date, time from foo import bar date(1, 1, 1) time(1) OrderedDict() bar()
utcompling/textgrounder
refs/heads/master
data/lists/python/fix-state-abbrevs.py
1
#!/usr/bin/python # Fix up state abbrevations inside of parentheses to the full state names. # Meant to be run after a file has been converted to standard form, where the # state in inside of parens. Only acts inside of parens to avoid munging # Twitter handles containing state abbrevs. import fileinput import re a...
Xeralux/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/random/random_crop_test.py
133
# 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...
wangjun/pythoner.net
refs/heads/dev
pythoner/accounts/templatetags/accounts_tags.py
3
# -*- coding: utf-8 -*- # Data:11-6-14 下午10:09 # Author: T-y(master@t-y.me) # File:accounts_tags import urllib, hashlib from django import template from django.contrib.auth.models import User from accounts.models import UserProfile register = template.Library() @register.inclusion_tag('account_latest.t...
GNOME/kupfer
refs/heads/master
kupfer/plugin/show_text.py
4
__kupfer_name__ = _("Show Text") __kupfer_actions__ = ( "ShowText", "LargeType", "ShowNotification", ) __description__ = _("Display text in a window") __version__ = "" __author__ = "US" from kupfer.objects import Action, Leaf, TextLeaf from kupfer import icons, uiutils from kupfer import textutils class ShowT...
Andr3iC/courtlistener
refs/heads/master
cl/tests/test_visualizations.py
1
# coding=utf-8 """ Functional tests for the Visualization feature of CourtListener """ from django.contrib.auth.models import User from cl.users.models import UserProfile from cl.tests.base import BaseSeleniumTest class VisualizationCrudTests(BaseSeleniumTest): """ Test CRUD operations from the browser point ...
faun/django_test
refs/heads/master
mysite/urls.py
1
from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^mysite/', include('mysite.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' ...
ranjinidas/Axelrod
refs/heads/master
axelrod/tests/unit/test_mathematicalconstants.py
2
"""Test for the golden and other mathematical strategies.""" import axelrod from .test_player import TestPlayer C, D = axelrod.Actions.C, axelrod.Actions.D class TestGolden(TestPlayer): name = '$\phi$' player = axelrod.Golden expected_classifier = { 'memory_depth': float('inf'), # Long memory...
ivanhorvath/openshift-tools
refs/heads/prod
openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_openshift/src/test/unit/test_oc_adm_registry.py
45
#!/usr/bin/env python ''' Unit tests for oc adm registry ''' import os import six import sys import unittest import mock # Removing invalid variable names for tests so that I can # keep them brief # pylint: disable=invalid-name,no-name-in-module # Disable import-error b/c our libraries aren't loaded in jenkins # pyl...
burzillibus/RobHome
refs/heads/master
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py
354
from __future__ import absolute_import, division, unicode_literals from . import sax __all__ = ["sax"] try: from . import genshi # noqa except ImportError: pass else: __all__.append("genshi")
ltilve/ChromiumGStreamerBackend
refs/heads/master
tools/telemetry/telemetry/core/discover_unittest.py
16
# 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. import os import unittest from telemetry.core import discover from telemetry.core import util class DiscoverTest(unittest.TestCase): def setUp(self): ...
chromium2014/src
refs/heads/master
tools/site_compare/scrapers/ie/ie7.py
189
#!/usr/bin/env python # Copyright (c) 2011 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. """Does scraping for all known versions of IE.""" import pywintypes import time import types from drivers import keyboard from dr...
ActiveState/code
refs/heads/master
recipes/Python/576564_Walkers_alimethod_random_objects_different/recipe-576564.py
1
#!/usr/bin/env python """ Walker's alias method for random objects with different probablities walkerrandom.py Examples -------- # 0 1 2 or 3 with probabilities .1 .2 .3 .4 -- wrand = Walkerrandom( [10, 20, 30 40] ) # builds the Walker tables wrand.random() # each call -> 0 1 2 or 3 # for example, 1...
plamut/ggrc-core
refs/heads/develop
src/ggrc/utils/rules.py
4
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Mapping rules for Relationship validation and map:model import columns.""" import copy def get_mapping_rules(): """ Get mappings rules as defined in business_object.js Special cases: Aduit has...
richard-fisher/repository
refs/heads/master
xorg/fonts/font-adobe-100dpi/actions.py
37
#!/usr/bin/env python from pisi.actionsapi import shelltools, get, autotools, pisitools def setup(): autotools.configure ("--disable-static --prefix=/usr") def build(): autotools.make () def install(): autotools.rawInstall ("DESTDIR=%s" % get.installDIR())
isabernardes/Heriga
refs/heads/master
Herigaenv/lib/python2.7/site-packages/django/utils/module_loading.py
320
import copy import os import sys from importlib import import_module from django.utils import six def import_string(dotted_path): """ Import a dotted module path and return the attribute/class designated by the last name in the path. Raise ImportError if the import failed. """ try: module...
bertrand-l/numpy
refs/heads/master
numpy/core/tests/test_records.py
3
from __future__ import division, absolute_import, print_function import sys import collections import pickle import warnings from os import path import numpy as np from numpy.compat import asbytes from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_array_equal, assert_array_a...
shuggiefisher/potato
refs/heads/master
django/contrib/gis/db/backend/__init__.py
307
from django.db import connection if hasattr(connection.ops, 'spatial_version'): from warnings import warn warn('The `django.contrib.gis.db.backend` module was refactored and ' 'renamed to `django.contrib.gis.db.backends` in 1.2. ' 'All functionality of `SpatialBackend` ' 'has been m...
nielsbuwen/ilastik
refs/heads/master
ilastik/applets/featureSelection/__init__.py
4
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # mod...
devinbalkind/eden
refs/heads/master
private/templates/skeleton/controllers.py
94
# -*- coding: utf-8 -*- from gluon import * from s3 import S3CustomController THEME = "skeleton" # ============================================================================= class index(S3CustomController): """ Custom Home Page """ def __call__(self): output = {} # Allow editing of page...
Endika/edx-platform
refs/heads/master
lms/djangoapps/edxnotes/exceptions.py
201
""" Exceptions related to EdxNotes. """ class EdxNotesParseError(Exception): """ An exception that is raised whenever we have issues with data parsing. """ pass class EdxNotesServiceUnavailable(Exception): """ An exception that is raised whenever EdxNotes service is unavailable. """ ...
zhebrak/raftos
refs/heads/master
raftos/server.py
1
import asyncio import functools from .network import UDPProtocol from .state import State async def register(*address_list, cluster=None, loop=None): """Start Raft node (server) Args: address_list — 127.0.0.1:8000 [, 127.0.0.1:8001 ...] cluster — [127.0.0.1:8001, 127.0.0.1:8002, ...] """ ...
sriprasanna/django-1.3.1
refs/heads/master
tests/regressiontests/comment_tests/tests/moderation_view_tests.py
50
from django.contrib.auth.models import User, Permission from django.contrib.comments import signals from django.contrib.comments.models import Comment, CommentFlag from django.contrib.contenttypes.models import ContentType from regressiontests.comment_tests.tests import CommentTestCase class FlagViewTests(CommentTes...