repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
incaser/odoo-odoo | refs/heads/8.0 | addons/hw_posbox_homepage/__init__.py | 1894 | # -*- 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... |
kaedroho/django | refs/heads/master | tests/mail/custombackend.py | 131 | """A custom backend for testing."""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.test_outbox = []
def send_messages(self, email_messages):
# Messages are ... |
smainand/scapy | refs/heads/master | scapy/contrib/automotive/bmw/__init__.py | 2 | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Nils Weiss <nils@we155.de>
# This program is published under a GPLv2 license
"""
Package of contrib automotive bmw specific modules
that have to be loaded explicitly.
"""
|
ninotoshi/tensorflow | refs/heads/master | tensorflow/examples/tutorials/mnist/mnist_softmax.py | 9 | # Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
sadatay/beets | refs/heads/master | beetsplug/bpm.py | 25 | # This file is part of beets.
# Copyright 2015, aroquen
#
# 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, ... |
rhyolight/nupic.son | refs/heads/master | app/soc/modules/gsoc/logic/conversation_updater.py | 1 | # Copyright 2014 the Melange authors.
#
# 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 wr... |
zephyrplugins/zephyr | refs/heads/master | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_sax_jy.py | 23 | import sys
import StringIO
import unittest
from xml.sax import saxutils
from xml.sax import make_parser
from xml.sax.handler import feature_namespaces
from test import test_support
file = StringIO.StringIO("""<collection>
<comic title="Sandman" number='62'>
<writer>Neil Gaiman</writer>
<penciller pages='1-... |
barzan/dbseer | refs/heads/master | rs-sysmon2/plugins/dstat_nfsd3.py | 4 | ### Author: Dag Wieers <dag@wieers.com>
class dstat_plugin(dstat):
def __init__(self):
self.name = 'nfs3 server'
self.nick = ('read', 'writ', 'rdir', 'inod', 'fs', 'cmmt')
self.vars = ('read', 'write', 'readdir', 'inode', 'filesystem', 'commit')
self.type = 'd'
self.width = ... |
shitolepriya/Saloon_erp | refs/heads/master | erpnext/setup/doctype/item_group/__init__.py | 37694 | from __future__ import unicode_literals
|
omprakasha/odoo | refs/heads/8.0 | addons/account/wizard/account_automatic_reconcile.py | 340 | # -*- 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... |
beckastar/django | refs/heads/master | django/contrib/contenttypes/models.py | 18 | from django.apps import apps
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_text, force_text
from django.utils.encoding import python_2_unicode_compatible
class ContentTypeManager(models.Manager):
# Cache to avoid re-looking up Content... |
aclef/microservices | refs/heads/master | microservices/queues/test.py | 1 | import unittest
from microservices.utils import set_logging
set_logging()
class TestService(unittest.TestCase):
def test_service(self):
from microservices.queues.service import Microservice
from microservices.queues.client import Client
from kombu.connection import Connection
mic... |
OCA/account-analytic | refs/heads/12.0 | setup/pos_analytic_by_config/setup.py | 7073 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
|
hujiajie/chromium-crosswalk | refs/heads/master | remoting/tools/remote_test_helper/SimpleJSONRPCServer.py | 51 | # Copyright 2014 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.
"""Module to implement the SimpleXMLRPCServer module using JSON-RPC.
This module uses SimpleXMLRPCServer as the base and only overrides those
portions that i... |
bala4901/odoo | refs/heads/master | addons/account_bank_statement_extensions/report/bank_statement_balance_report.py | 378 | # -*- 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 ... |
michael-k/swampdragon | refs/heads/master | swampdragon/model_tools.py | 9 | try:
from django.apps import apps
get_django_model = apps.get_model
except ImportError:
from django.db.models.loading import get_model as get_django_model
def get_property(obj, field):
field = field.replace('__', '.')
if '.' in field:
attr_chain = field.split('.')
attr = obj
... |
dav1x/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/qux2/quux.py | 298 | data = 'qux2:quux'
|
vdrhtc/Measurement-automation | refs/heads/master | lib2/QuantumState.py | 1 | # This file is to implement the preparation and tomography of arbitrary quantum states.
from numpy import *
from scipy.linalg import expm
eye = matrix([[1, 0], [0, 1]])
sig_x = matrix([[0, 1], [1, 0]])
sig_y = matrix([[0, -1j], [1j, 0]], dtype=complex)
sig_z = matrix([[1, 0], [0, -1]])
operators = {"I": eye, "X": sig... |
dcramer/django-compositepks | refs/heads/master | tests/regressiontests/admin_views/views.py | 107 | from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponse
def secure_view(request):
return HttpResponse('%s' % request.POST)
secure_view = staff_member_required(secure_view) |
fxfitz/ansible | refs/heads/devel | contrib/inventory/fleet.py | 46 | #!/usr/bin/env python
"""
fleetctl base external inventory script. Automatically finds the IPs of the booted coreos instances and
returns it under the host group 'coreos'
"""
# Copyright (C) 2014 Andrew Rothstein <andrew.rothstein at gmail.com>
#
# This program is free software: you can redistribute it and/or modify
... |
elgambitero/FreeCAD_sf_master | refs/heads/master | src/Mod/Arch/InitGui.py | 16 | #***************************************************************************
#* *
#* Copyright (c) 2011 *
#* Yorik van Havre <yorik@uncreated.net> *
#* ... |
kbrebanov/ansible-modules-extras | refs/heads/devel | notification/mqtt.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 2014, Jan-Piet Mens <jpmens () 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... |
JJediny/python-social-auth | refs/heads/master | social/backends/goclio.py | 77 | from social.backends.oauth import BaseOAuth2
class GoClioOAuth2(BaseOAuth2):
name = 'goclio'
AUTHORIZATION_URL = 'https://app.goclio.com/oauth/authorize/'
ACCESS_TOKEN_METHOD = 'POST'
ACCESS_TOKEN_URL = 'https://app.goclio.com/oauth/token/'
REDIRECT_STATE = False
STATE_PARAMETER = False
d... |
chennan47/osf.io | refs/heads/develop | api/base/wsgi.py | 22 | """
WSGI config for api project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/
"""
from website import settings
from api.base import settings as api_settings
if not settings.DEBUG_MODE... |
thomasgilgenast/gilgistatus-nonrel | refs/heads/master | django/conf/locale/hr/formats.py | 232 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y.'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = 'j. E Y. H:i'
YEAR_MONTH... |
zhenzhai/edx-platform | refs/heads/master | common/lib/sandbox-packages/hint/hint_class/Week7/Prob6_Part11.py | 1 | # Make sure you name your file with className.py
from hint_class_helpers.find_matches import find_matches
class Prob6_Part11:
"""
Author: Shen Ting Ang
Date: 11/7/2016
"""
def check_attempt(self, params):
self.attempt = params['attempt'] #student's attempt
self.answer = params['answ... |
alexston/calibre-webserver | refs/heads/master | src/calibre/ebooks/docx/images.py | 4 | #!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import os
from lxml.html.builder import IMG, HR
from calibre.constants impo... |
vijayjt/AzureScripts | refs/heads/master | azure-ip-ranges/summarise_azure_ips.py | 1 | #!/usr/bin/env python
################################################################################
# Author: Vijay Thakorlal and Morgan Jones (https://github.com/mogthesprog/)
# Date: January 12, 2016
# File name: summarise_azure_ips.py
# Version: 0.0.1
# Purpose: Retrieves the Azure IP ranges and calculates subne... |
foursquare/pants | refs/heads/master | src/python/pants/reporting/reporting_utils.py | 2 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import str
from pants.util.strutil import pluralize
def items_to_report_... |
rryan/django-cms | refs/heads/develop | cms/templatetags/cms_tags.py | 13 | # -*- coding: utf-8 -*-
from datetime import datetime
from itertools import chain
from copy import copy
try:
from collections import OrderedDict
except ImportError:
from django.utils.datastructures import SortedDict as OrderedDict
from django import template
from django.conf import settings
from django.contr... |
akozumpl/anaconda | refs/heads/master | pyanaconda/ui/gui/categories/customization.py | 7 | # Localization category classes
#
# Copyright (C) 2011, 2013 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is d... |
analyst-collective/dbt | refs/heads/experiment/typetag | test/unit/test_exceptions.py | 2 | import pytest
from dbt.exceptions import raise_duplicate_macro_name, CompilationException
from .utils import MockMacro
def test_raise_duplicate_macros_different_package():
macro_1 = MockMacro(package='dbt', name='some_macro')
macro_2 = MockMacro(package='dbt-myadapter', name='some_macro')
with pytest.ra... |
devs1991/test_edx_docmode | refs/heads/master | pylint-django-0.6.1/pylint_django/transforms/__init__.py | 2 | """Transforms."""
import os
import re
from pylint_django.transforms import foreignkey, fields
from astroid import MANAGER
from astroid.builder import AstroidBuilder
from astroid import nodes
foreignkey.add_transform(MANAGER)
fields.add_transforms(MANAGER)
def _add_transform(package_name, *class_names):
"""Trans... |
deepgram/sidomo | refs/heads/master | examples/ffmpeg.py | 1 | """A python FFMPEG module built from sdpm."""
from sidomo import Container
def transcode_file(url):
"""Any format --> 20000 Hz mono wav audio."""
with Container(
'cellofellow/ffmpeg',
memory_limit_gb=2,
stdout=False
) as c:
for line in c.run(
'bash -c \"\
... |
gagoncal/Selenium | refs/heads/master | Selenium with python/Final project with Page objects/TravelingTony/tests/SendRequestTest.py | 5 | from TravelingTony.Constants import TT_Constants
from TravelingTony.pages.ContactPage import ContactPage
from TravelingTony.BaseTestCase import BaseTestCase
import unittest
import time
class SendRequestTest(BaseTestCase, unittest.TestCase):
def setUp(self):
super(SendRequestTest, se... |
Havate/havate-openstack | refs/heads/master | proto-build/gui/horizon/openstack-dashboard/openstack_dashboard/static-raw/scripts/SPConsumer.py | 3 | import sys
import os
import re
import ast
import time
import daemon
import logging
import yaml
from UcsSdk import *
from passlib.apps import custom_app_context as pwd_context
from jinja2 import Template, Environment, FileSystemLoader
from UcsUtils import *
from ConfUtils import *
from CobblerUtils import *
def callbac... |
kvar/ansible | refs/heads/seas_master_2.9.5 | test/units/modules/network/nuage/test_nuage_vspk.py | 59 | # -*- coding: utf-8 -*-
# (c) 2017, Nokia
# 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.
#... |
mfeit-internet2/pscheduler-dev | refs/heads/master | python-pscheduler/pscheduler/pscheduler/filestring.py | 1 | """
Functions for retrieving strings from files
"""
import os
def string_from_file(string, strip=True):
"""
Return an unaltered string or the contents of a file if the string
begins with @ and the rest of it points at a path.
If 'strip' is True, remove leading and trailing whitespace
(default be... |
JustasB/MitralSuite | refs/heads/master | Models/Migliore2014/multisplit_distrib.py | 1 | from common import *
from loadbalutil import lb
import net_mitral_centric as nmc
from balance import load_bal
from destroy_model import destroy_model
from all2all import all2all
import split
import util
import mgrs
def determine_multisplit_complexity(model):
''' single phase '''
cxlist = []
for gid in model.mitr... |
felipebetancur/scipy | refs/heads/master | scipy/sparse/linalg/tests/test_matfuncs.py | 92 | #!/usr/bin/env python
#
# Created by: Pearu Peterson, March 2002
#
""" Test functions for scipy.linalg.matfuncs module
"""
from __future__ import division, print_function, absolute_import
import math
import warnings
import numpy as np
from numpy import array, eye, exp, random
from numpy.linalg import matrix_power
f... |
sametmax/Django--an-app-at-a-time | refs/heads/master | ignore_this_directory/django/db/models/functions/comparison.py | 35 | """Database functions that do comparisons or type conversions."""
from django.db.models.expressions import Func, Value
class Cast(Func):
"""Coerce an expression to a new field type."""
function = 'CAST'
template = '%(function)s(%(expressions)s AS %(db_type)s)'
def __init__(self, expression, output_fi... |
albertomurillo/ansible | refs/heads/devel | test/integration/targets/module_precedence/roles_with_extension/foo/library/ping.py | 480 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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... |
sourceperl/pyHMI | refs/heads/master | pyHMI/Colors.py | 1 | # -*- coding: utf-8 -*-
import tkinter as tk
# some const
# Canvas Pipe width
PIPE_WIDTH = 6
# Colors
RED = '#bc3f3c'
GREEN = '#51c178'
GRAY = '#2d2d2d'
BLUE = '#589df6'
WHITE = '#ffffff'
ORANGE = '#be9117'
PINK = 'hot pink'
BLACK = 'black'
VIOLET = 'dark violet'
# Default colors
STATE_COLOR = (PINK, WHITE, GREEN)
AL... |
Wladislao/Python_Problems | refs/heads/master | 3xxx/35xx/350x/3507.py | 1 | a=int(input())
b=int(input())
c=int(input())
if a==b==c:
print(3)
elif a!=b==c:
print(2)
elif a==b!=c:
print(2)
elif a==c!=b:
print(2)
else:
print(0)
|
MechCoder/sympy | refs/heads/master | sympy/polys/domains/rationalfield.py | 93 | """Implementation of :class:`RationalField` class. """
from __future__ import print_function, division
from sympy.polys.domains.field import Field
from sympy.polys.domains.simpledomain import SimpleDomain
from sympy.polys.domains.characteristiczero import CharacteristicZero
from sympy.utilities import public
@publi... |
badascii/py_koans | refs/heads/master | python3/koans/__init__.py | 158 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# koans |
aerophile/django | refs/heads/master | django/conf/locale/it/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y' # 25 Ottobre 2006
TIME_FO... |
t794104/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_networks_facts.py | 31 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# 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',
... |
sassoftware/mint | refs/heads/master | mint/django_rest/rbuilder/targets/views/v1/views.py | 1 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
undoware/neutron-drive | refs/heads/master | google_appengine/lib/django_1_2/tests/regressiontests/select_related_onetoone/models.py | 144 | from django.db import models
class User(models.Model):
username = models.CharField(max_length=100)
email = models.EmailField()
def __unicode__(self):
return self.username
class UserProfile(models.Model):
user = models.OneToOneField(User)
city = models.CharField(max_length=100)
state... |
mcgachey/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/signup.py | 111 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from nose.tools import assert_true, assert_false # pylint: disable=no-name-in-module
@step('I fill in the registration form$')
def i_fill_in_the_registration_form(step):
def fill_in_reg_form():
reg... |
8u1a/plaso | refs/heads/master | tests/engine/collector.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""The unit tests for the generic collector object."""
import logging
import os
import shutil
import tempfile
import unittest
from dfvfs.helpers import file_system_searcher
from dfvfs.lib import definitions as dfvfs_definitions
from dfvfs.path import factory as path_spec_fact... |
pysigma/standard | refs/heads/master | sigma/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
xNovax/SickRage | refs/heads/master | lib/github/tests/PullRequestComment.py | 39 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
FrauBluher/ShR2 | refs/heads/master | Web Stack/pseudodevice.py | 2 | import sys
from optparse import OptionParser
import requests
import json
import time
import datetime
import random
class Device():
pass
def main():
"""
The purpose of this function is to mimic the behavior of a device
by interacting with the API. This is to test the functionality
of th... |
cluckmaster/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/oldnumeric/fix_default_axis.py | 101 | """
This module adds the default axis argument to code which did not specify it
for the functions where the default was changed in NumPy.
The functions changed are
add -1 ( all second argument)
======
nansum
nanmax
nanmin
nanargmax
nanargmin
argmax
argmin
compress 3
add 0
======
take 3
repeat 3
sum #... |
godfather1103/WeiboRobot | refs/heads/master | python27/1.0/lib/lib-tk/test/test_ttk/test_style.py | 40 | import unittest
import Tkinter as tkinter
import ttk
from test.test_support import requires, run_unittest
from test_ttk.support import AbstractTkTest
requires('gui')
class StyleTest(AbstractTkTest, unittest.TestCase):
def setUp(self):
super(StyleTest, self).setUp()
self.style = ttk.Style(self.roo... |
praveen-pal/edx-platform | refs/heads/master | cms/djangoapps/contentstore/tests/test_contentstore.py | 4 | #pylint: disable=E1101
import json
import shutil
import mock
from textwrap import dedent
from django.test.client import Client
from django.test.utils import override_settings
from django.conf import settings
from django.core.urlresolvers import reverse
from path import path
from tempdir import mkdtemp_clean
from fs.... |
conorpp/napkis | refs/heads/master | napkis/deployment/python2.7/django/db/models/deletion.py | 106 | from functools import wraps
from operator import attrgetter
from django.db import connections, transaction, IntegrityError
from django.db.models import signals, sql
from django.utils.datastructures import SortedDict
from django.utils import six
class ProtectedError(IntegrityError):
def __init__(self, msg, protec... |
jbzdak/edx-platform | refs/heads/master | common/djangoapps/course_modes/tests/test_views.py | 64 | import unittest
import decimal
import ddt
from mock import patch
from django.conf import settings
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from util.testing import UrlResetMixin
from embargo.test_utils import restrict_course
from xmodule.modul... |
usgo/online-ratings | refs/heads/master | web/app/error_mail.py | 2 | '''
Copyright (c) 2012 Jason Feinstein, http://jwf.us/
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, merge, ... |
jkleckner/ansible | refs/heads/devel | plugins/inventory/gce.py | 9 | #!/usr/bin/python
# Copyright 2013 Google Inc.
#
# 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 vers... |
Chaffelson/whoville | refs/heads/master | whoville/cloudbreak/models/workspace_resource_response.py | 1 | # coding: utf-8
"""
Cloudbreak API
Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloud... |
rfguri/vimfiles | refs/heads/master | bundle/ycm/third_party/ycmd/third_party/python-future/src/future/moves/html/__init__.py | 81 | from __future__ import absolute_import
from future.utils import PY3
__future_module__ = True
if PY3:
from html import *
else:
# cgi.escape isn't good enough for the single Py3.3 html test to pass.
# Define it inline here instead. From the Py3.4 stdlib. Note that the
# html.escape() function from the Py... |
SummaLabs/DLS | refs/heads/master | app/backend/core/datasets/__init__.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = 'ar'
from app.backend.core.datasets import dbbuilder, dbconfig, dbhelpers, dbutils, imgproc2d, dbimageinfo, dbwatcher
from app.backend.core.datasets.dlscaffe import caffedls_pb2
if __name__ == '__main__':
pass |
Informatics43-S14/hw2-projects-127 | refs/heads/master | Text/palindrome.py | 15 | """
Check if Palindrome - Checks if the string entered
by the user is a palindrome. That is that it reads
the same forwards as backwards like "racecar"
"""
string = raw_input('Enter a string: ').lower()
if string == string[::-1]:
print '%s is a palindrome' % string
else:
print '%s is not a palindro... |
sdoran35/hate-to-hugs | refs/heads/master | venv/lib/python3.6/site-packages/markupsafe/_native.py | 1243 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... |
rvanlaar/easy-transifex | refs/heads/master | src/transifex/transifex/addons/suggestions/views.py | 2 | # -*- coding: utf-8 -*-
from django.http import (HttpResponse, HttpResponseBadRequest)
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContext
from django.utils.translation import ugettext as _
from authority.views import permission_denied
from transifex.languages... |
Senseg/Py4A | refs/heads/master | python3-alpha/python3-src/Lib/idlelib/AutoExpand.py | 227 | import string
import re
###$ event <<expand-word>>
###$ win <Alt-slash>
###$ unix <Alt-slash>
class AutoExpand:
menudefs = [
('edit', [
('E_xpand Word', '<<expand-word>>'),
]),
]
wordchars = string.ascii_letters + string.digits + "_"
def __init__(self, editwin):
... |
ikcam/django-skeleton | refs/heads/master | myapp/asgi.py | 1 | import os
import django
from channels.routing import get_default_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myapp.settings')
django.setup()
application = get_default_application()
|
rohitwaghchaure/New_Theme_frappe | refs/heads/develop | frappe/website/doctype/website_settings/__init__.py | 37694 | from __future__ import unicode_literals
|
kayhayen/Nuitka | refs/heads/develop | tests/onefile/HelloWorldTest.py | 1 | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python test originally created or extracted from other peoples work. The
# parts from me are licensed as below. It is at least Free Software where
# it's copied from other people. In these cases, that will normally be
# indicated.
#
# L... |
sepehr125/pybrain | refs/heads/master | pybrain/tests/unittests/tools/test_rlgluebridge.py | 25 | """
>>> from pybrain.tools.rlgluebridge import adaptAgent
>>> from rlglue.types import Action as RLGlueAction
>>> from rlglue.types import Observation as RLGlueObservation
Let's take a pseudo agent to test with and make an object of it
>>> klass = adaptAgent(PseudoPybrainAgent)
>>> rlglue_agent =... |
Gabriel439/pants | refs/heads/master | contrib/node/tests/python/pants_test/contrib/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
aeby/localkhan | refs/heads/master | localkhan/serve.py | 1 | # -*- coding: utf-8 -*-
"""
localkhan.serve
~~~~~~~~~~~~~~~
Serves the content player web app and creates
the necessary appcache manifest.
:copyright: (c) 2015 by Reto Aebersold.
:license: MIT, see LICENSE for more details.
"""
from __future__ import print_function
import json
from loader impor... |
manazhao/tf_recsys | refs/heads/r1.0 | tensorflow/contrib/tensor_forest/hybrid/python/layers/decisions_to_data.py | 133 | # 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... |
dwillcox/ode-openacc | refs/heads/master | util/dep.py | 3 | #!/usr/bin/env python
# automatically generate Makefile dependencies for Fortran 90 source.
#
# this will output all the dependency pairs amongst the source files.
#
# M. Zingale (2012-03-21)
import sys
import re
import string
import os
import argparse
def doit(prefix, files):
# regular expression for ' use mod... |
petewarden/tensorflow | refs/heads/master | tensorflow/python/debug/lib/common_test.py | 10 | # 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... |
greenape/disclosure-game-module | refs/heads/master | disclosuregame/__init__.py | 2 | from _version import __version__ |
whitestonelee/tlb_analyzer | refs/heads/master | qemu/gen-charmap.py | 99 | #!/usr/bin/python
#
# a python script used to generate some C constant tables from a key charmap file
#
# usage:
# progname file.kcm > charmap-tab.h
#
import sys, os, string, re
header = """\
#include "android_charmap.h"
/* the following is automatically generated by the 'gen-charmap.py' script
* do not touch. th... |
anudeepsharma/autorest | refs/heads/master | src/generator/AutoRest.Python.Azure.Tests/Expected/AcceptanceTests/AzureSpecials/autorestazurespecialparameterstestclient/operations/subscription_in_method_operations.py | 14 | # 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 ... |
hiearth/langstyle | refs/heads/master | langstyle/install/english_word.py | 1 | #!/usr/bin/env python
import os
import re
import time
from socket import timeout
import urllib.request
from .. import config
character_dir = os.path.join(config.ENGLISH_POPULATION_DIRECTORY, "character")
sound_dir = os.path.join(config.ENGLISH_POPULATION_DIRECTORY, "sound")
cet4_file = os.path.join(character_dir, "CE... |
OpenGazettes/aleph | refs/heads/master | aleph/signals.py | 4 | from blinker import signal
# This file houses plugin endpoints for aleph. These are called at various
# times during the lifecycle of the server and can be used to hook in
# extension functionality.
# Register additional API endpoints.
register_blueprints = signal('register_blueprints')
# Post-process a documents se... |
patricklodder/dogecoin | refs/heads/1.14-dev | qa/rpc-tests/signrawtransactions.py | 39 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
class ... |
EliAndrewC/ensconce | refs/heads/master | tests/unit/dao/test_resources.py | 2 | import random
from ensconce.dao import groups
from ensconce import exc
from tests import BaseModelTest
class TestGroupsDao(BaseModelTest):
def test_get(self):
random_group = random.choice(self.data.groups.values())
match = groups.get(random_group.id)
self.assertIs(random_group, match)
... |
Sri0405/pattern | refs/heads/master | pattern/server/cherrypy/cherrypy/lib/encoding.py | 39 | import struct
import time
import cherrypy
from cherrypy._cpcompat import basestring, BytesIO, ntob, set, unicodestr
from cherrypy.lib import file_generator
from cherrypy.lib import set_vary_header
def decode(encoding=None, default_encoding='utf-8'):
"""Replace or extend the list of charsets used to decode a requ... |
elena/django | refs/heads/master | tests/foreign_object/test_agnostic_order_trimjoin.py | 169 | from operator import attrgetter
from django.test.testcases import TestCase
from .models import Address, Contact, Customer
class TestLookupQuery(TestCase):
@classmethod
def setUpTestData(cls):
cls.address = Address.objects.create(company=1, customer_id=20)
cls.customer1 = Customer.objects.cr... |
aberke/check-list | refs/heads/master | app/auth/__init__.py | 2 | #********************************************************************************
#--------------------------------------------------------------------------------
#
# Significance Labs
# Brooklyn, NYC
#
# Author: Alexandra Berke (aberke)
# Written: Summer 2014
#
#
# /auth/__init__.py
#
#----------------------------... |
mohanprasath/Course-Work | refs/heads/master | algorithms/grid_paths.py | 1 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
# Python3 program to Print all possible paths from
# top left to bottom right of a mXn matrix
allPaths = []
def findPaths(maze,m,n):
path = [0 for d in range(m+n-1)]
findPathsUtil(maze,m,n,0,0,path,0)
def findPathsUti... |
h3biomed/ansible | refs/heads/h3 | lib/ansible/modules/cloud/google/gce_img.py | 59 | #!/usr/bin/python
# Copyright 2015 Google Inc. All Rights Reserved.
# 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
"""An Ansible module to utilize GCE image resources."""
ANSIBLE_METAD... |
fbradyirl/home-assistant | refs/heads/dev | homeassistant/util/volume.py | 1 | """Volume conversion util functions."""
import logging
from numbers import Number
from homeassistant.const import (
VOLUME_LITERS,
VOLUME_MILLILITERS,
VOLUME_GALLONS,
VOLUME_FLUID_OUNCE,
VOLUME,
UNIT_NOT_RECOGNIZED_TEMPLATE,
)
_LOGGER = logging.getLogger(__name__)
VALID_UNITS = [VOLUME_LITERS... |
kawamon/hue | refs/heads/master | desktop/core/ext-py/boto-2.46.1/boto/file/__init__.py | 153 | # Copyright 2010 Google Inc.
#
# 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, merge, publish, dis-
# trib... |
mihaisoloi/conpaas | refs/heads/master | conpaas-services/src/conpaas/services/htcondor/agent/client.py | 4 | # -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
import json
import httplib
from conpaas.core import https
def _check(response):
"""Check the given HTTP response, returning the result if everything went
fine"""
code, body = response
if code != httplib.OK:
... |
emijrp/youtube-dl | refs/heads/master | youtube_dl/extractor/comcarcoff.py | 49 | # encoding: utf-8
from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import parse_iso8601
class ComCarCoffIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?comediansincarsgettingcoffee\.com/(?P<id>[a-z0-9\-]*)'
_TESTS = [{
'url': 'http://comediansinca... |
sampaul0/xbmc-plex | refs/heads/master | tools/Linux/FEH.py | 43 | import os
import sys
import re
AvailableOutputs = []
Output = None
try:
from qt import *
AvailableOutputs.append("--error-output=Qt")
except:
pass
try:
import pygtk
pygtk.require('2.0')
import gtk
AvailableOutputs.append("--error-output=GTK")
except:
pass
try:
import pygame
imp... |
christophelec/github3.py | refs/heads/develop | github3/notifications.py | 10 | # -*- coding: utf-8 -*-
"""
github3.notifications
=====================
This module contains the classes relating to notifications.
See also: http://developer.github.com/v3/activity/notifications/
"""
from __future__ import unicode_literals
from json import dumps
from .models import GitHubCore
class Thread(GitHubC... |
lostemp/kernel-2.6.30 | refs/heads/master | arch/ia64/scripts/unwcheck.py | 916 | #!/usr/bin/env python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthe... |
arruda/ANTLR3-python | refs/heads/master | unittests/testdfa.py | 1 |
import unittest
import antlr3
class TestDFA(unittest.TestCase):
"""Test case for the DFA class."""
def setUp(self):
"""Setup test fixure.
We need a Recognizer in order to instanciate a DFA.
"""
class TRecognizer(antlr3.BaseRecognizer):
antlr_version = antlr3.r... |
idovear/odoo | refs/heads/master | openerp/workflow/__init__.py | 378 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
gregdek/ansible | refs/heads/devel | lib/ansible/plugins/cache/yaml.py | 64 | # (c) 2017, Brian Coca
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
cache: yaml
short_descriptio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.