repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
codingforentrepreneurs/CFE-Django-Hosts | refs/heads/master | src/posts/urls.py | 1 | from django.conf.urls import url
from django.contrib import admin
from .views import (
post_list,
post_detail,
)
urlpatterns = [
url(r'^$', post_list, name='list'),
url(r'^(?P<slug>[\w-]+)/$', post_detail, name='detail'),
] |
crmccreary/openerp_server | refs/heads/master | openerp/pychart/color_doc.py | 15 | # -*- coding: utf-8 -*-
# automatically generated by generate_docs.py.
doc="""Attributes supported by this class are:
r(type:number) default="The intensity of red. The value is between 0 and 1.".
b(type:number) default="The intensity of blue. The value is between 0 and 1.".
g(type:number) default="The intensity of gree... |
open-power-ref-design-toolkit/cluster-genesis | refs/heads/master | tests/unit/__init__.py | 1 | #
# Copyright 2017, IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... |
svenstaro/ansible | refs/heads/devel | lib/ansible/modules/cloud/google/gce.py | 43 | #!/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... |
emonty/pyos | refs/heads/master | samples/cloud_dns/create_domain.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... |
formiano/enigma2 | refs/heads/master | lib/python/Components/Renderer/ODScrollLabel.py | 4 | import skin
from Components.VariableText import VariableText
from Components.config import config
from Renderer import Renderer
from enigma import eLabel, eWidget, ePoint, eSize, gFont, fontRenderClass, eTimer
class ODScrollLabel(VariableText, Renderer):
def __init__(self):
Renderer.__init__(self)
VariableText.__... |
pongad/api-client-staging | refs/heads/master | generated/python/proto-google-cloud-spanner-v1/google/cloud/proto/spanner/v1/keys_pb2_grpc.py | 460 | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from grpc.framework.common import cardinality
from grpc.framework.interfaces.face import utilities as face_utilities
|
cl4rke/scikit-learn | refs/heads/master | sklearn/linear_model/theil_sen.py | 42 | # -*- coding: utf-8 -*-
"""
A Theil-Sen Estimator for Multiple Linear Regression Model
"""
# Author: Florian Wilhelm <florian.wilhelm@gmail.com>
#
# License: BSD 3 clause
from __future__ import division, print_function, absolute_import
import warnings
from itertools import combinations
import numpy as np
from scipy... |
sakuraba001/android_kernel_samsung_kactivelte | refs/heads/master | Documentation/networking/cxacru-cf.py | 14668 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 the License, or (at your option)
# any later version.
#
# This program i... |
ZellMechanik-Dresden/dclab | refs/heads/master | dclab/rtdc_dataset/fmt_tdms/event_image.py | 1 | """
Class for efficiently handling image/video data
"""
import pathlib
import sys
import warnings
import imageio
import numpy as np
from .exc import InvalidVideoFileError
ISWIN = sys.platform.startswith("win")
class CorruptFrameWarning(UserWarning):
pass
class InitialFrameMissingWarning(CorruptFrameWarning... |
surligas/cs436-gnuradio | refs/heads/master | docs/exploring-gnuradio/dial_tone.py | 58 | #!/usr/bin/env python
#
# Copyright 2004,2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your ... |
SuperMap/iClient-for-JavaScript | refs/heads/master | examples/js/proj4js/tools/closure.py | 209 | import sys
import os
import tempfile
path = "../tools/closure-compiler.jar"
if not os.path.exists(path):
raise Exception("No closure-compiler.jar at %s; read README.txt!" % path)
def minimize(code):
ntf = tempfile.NamedTemporaryFile(delete=False)
ntf.write(code)
ntf.flush()
ntf2 = tempfile.NamedT... |
darktears/chromium-crosswalk | refs/heads/master | third_party/closure_linter/closure_linter/common/matcher.py | 284 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... |
mrshelly/openerp71313 | refs/heads/master | openerp/addons/base_report_designer/openerp_sxw2rml/openerp_sxw2rml.py | 112 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c):
#
# 2005 pyopenoffice.py Martin Simon (http://www.bezirksreiter.de)
# 2005 Fabien Pinckaers, TINY SPRL. (http://tiny.be)
#
# This program is free software: you can redistribute it and/or ... |
RadonX-ROM/external_skia | refs/heads/lp-mr1 | gm/rebaseline_server/imagepairset.py | 67 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
ImagePairSet class; see its docstring below.
"""
# System-level imports
import posixpath
# Local imports
import column
import imagepair
# Keys used within dictionary r... |
sbstp/streamlink | refs/heads/master | src/streamlink/plugins/dmcloud_embed.py | 3 | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
HEADERS = {
"User-Agent": ("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) "
"Gecko/20100101 Firefox/25.0")
}
URLS = [
re.compile("http(s)?://(\w+\.)?action24.gr")
]
_embed_re = re.compile("http(s)?://... |
colinligertwood/odoo | refs/heads/master | addons/web_graph/controllers/__init__.py | 2262 | import main |
CalvinHsu1223/LinuxCNC-HAL-EtherCAT-Driver-with-ILC | refs/heads/master | configs/plasma-thc/mp1000_serial.py | 11 | #!/usr/bin/python
import hal, time, serial
from threading import Thread
#DEBUG
DEBUG = 0
# Create a new HAL pin which can be hooked to pyvcp
h = hal.component("serial_interface")
h.newpin("vcpt_voltage", hal.HAL_FLOAT, hal.HAL_IN)
h.newpin("vcpc_voltage", hal.HAL_FLOAT, hal.HAL_OUT)
h.ready()
# Serial Stuff, change ... |
vijayendrabvs/ssl-python-neutronclient | refs/heads/master | neutronclient/v2_0/__init__.py | 108 | # Copyright 2012 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 req... |
terceiro/squad | refs/heads/master | test/test_mail.py | 2 | from django.test import TestCase
from squad.mail import Message
class TestMessage(TestCase):
def setUp(self):
self.msg = Message('mail subject', 'mail body', 'sender@example.com', ['recipient@example.com'])
def test_precedence(self):
self.assertEqual('bulk', self.msg.extra_headers["Precedenc... |
racker/service-registry | refs/heads/master | node_modules/rproxy/node_modules/cluster2/node_modules/npm/node_modules/node-gyp/gyp/test/win/gyptest-link-additional-deps.py | 344 | #!/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.
"""
Make sure additional library dependencies are handled.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.Tes... |
JohnHwee/show-me-the-code | refs/heads/master | Python/0071/main.py | 3 | def is_palindromic(number, start, end):
"""Checks if the number palindromic."""
str_number = str(number)[start:end]
return str_number[::] == str_number[::-1]
def check(i):
"""Checks whether the integer(i) has the properties described\
in the puzzler."""
return (is_palindromic(i, 2, 6) ... |
jmehnle/ansible | refs/heads/devel | lib/ansible/modules/monitoring/rollbar_deployment.py | 41 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014, Max Riveiro, <kavu13@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the... |
sevamoo/SOMPY | refs/heads/master | sompy/visualization/view.py | 1 | from matplotlib import pyplot as plt
class View(object):
def __init__(self, width, height, title, show_axis=True, packed=True,
text_size=2.8, show_text=True, col_size=6, *args, **kwargs):
self.width = width
self.height = height
self.title = title
self.show... |
hugs/django | refs/heads/master | django/contrib/sessions/backends/cache.py | 2 | from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.core.cache import cache
class SessionStore(SessionBase):
"""
A cache-based session store.
"""
def __init__(self, session_key=None):
self._cache = cache
super(SessionStore, self).__init__(session_key)
... |
Arundhatii/erpnext | refs/heads/develop | erpnext/accounts/doctype/c_form/__init__.py | 37694 | from __future__ import unicode_literals
|
ThiagoGarciaAlves/erpnext | refs/heads/develop | erpnext/selling/page/sales_analytics/__init__.py | 37694 | from __future__ import unicode_literals
|
fuhongliang/erpnext | refs/heads/develop | erpnext/hr/doctype/salary_slip_earning/__init__.py | 37694 | from __future__ import unicode_literals
|
zenoss/Community-Zenpacks | refs/heads/master | ZenPacks.mcgov.IBMMQMonitor/ZenPacks/__init__.py | 13048 | __import__('pkg_resources').declare_namespace(__name__)
|
jayme-github/CouchPotatoServer | refs/heads/master | libs/pyutil/test/current/json_tests/test_dump.py | 106 | from unittest import TestCase
from cStringIO import StringIO
from pyutil import jsonutil as json
class TestDump(TestCase):
def test_dump(self):
sio = StringIO()
json.dump({}, sio)
self.assertEquals(sio.getvalue(), '{}')
def test_dumps(self):
self.assertEquals(json.dumps({}), '... |
brian-l/django-1.4.10 | refs/heads/master | tests/regressiontests/localflavor/generic/tests.py | 34 | import datetime
from django.contrib.localflavor.generic.forms import DateField, DateTimeField
from django.test import SimpleTestCase
class GenericLocalFlavorTests(SimpleTestCase):
def test_GenericDateField(self):
error_invalid = [u'Enter a valid date.']
valid = {
datetime.date(2006, ... |
benschmaus/catapult | refs/heads/master | third_party/WebOb/setup.py | 16 | from setuptools import setup
version = '1.5.0a0'
testing_extras = ['nose', 'coverage']
docs_extras = ['Sphinx']
setup(
name='WebOb',
version=version,
description="WSGI request and response object",
long_description="""\
WebOb provides wrappers around the WSGI request environment, and an
object to he... |
gltn/stdm | refs/heads/master | stdm/third_party/FontTools/fontTools/misc/classifyTools.py | 1 | """ fontTools.misc.classifyTools.py -- tools for classifying things.
"""
from fontTools.misc.py23 import *
class Classifier(object):
"""
Main Classifier object, used to classify things into similar sets.
"""
def __init__(self, sort=True):
self._things = set() # set of all things known so far
self._sets = [... |
tornadomeet/mxnet | refs/heads/master | tests/python/unittest/common.py | 7 | # 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... |
ChanderG/scipy | refs/heads/master | scipy/linalg/decomp.py | 30 | #
# Author: Pearu Peterson, March 2002
#
# additions by Travis Oliphant, March 2002
# additions by Eric Jones, June 2002
# additions by Johannes Loehnert, June 2006
# additions by Bart Vandereycken, June 2006
# additions by Andrew D Straw, May 2007
# additions by Tiziano Zito, November 2008
#
# April 2010: Functio... |
damienmg/bazel | refs/heads/master | third_party/protobuf/3.4.0/python/google/protobuf/internal/testing_refleaks.py | 75 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
huggingface/pytorch-transformers | refs/heads/master | examples/pytorch/language-modeling/run_mlm.py | 1 | #!/usr/bin/env python
# coding=utf-8
# Copyright 2020 The HuggingFace Team 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-... |
jamestwebber/scipy | refs/heads/master | scipy/optimize/tests/test__differential_evolution.py | 1 | """
Unit tests for the differential global minimization algorithm.
"""
import gc
import multiprocessing
import sys
import platform
from scipy.optimize._differentialevolution import (DifferentialEvolutionSolver,
_ConstraintWrapper)
from scipy.optimize import differenti... |
jseabold/scikit-learn | refs/heads/master | examples/ensemble/plot_gradient_boosting_oob.py | 50 | """
======================================
Gradient Boosting Out-of-Bag estimates
======================================
Out-of-bag (OOB) estimates can be a useful heuristic to estimate
the "optimal" number of boosting iterations.
OOB estimates are almost identical to cross-validation estimates but
they can be compute... |
franosincic/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/stringify.py | 275 | # -*- coding: utf-8 -*-
from lxml import etree
def stringify_children(node):
'''
Return all contents of an xml tree, without the outside tags.
e.g. if node is parse of
"<html a="b" foo="bar">Hi <div>there <span>Bruce</span><b>!</b></div><html>"
should return
"Hi <div>there <span>Bruce... |
magicicada-bot/magicicada-server | refs/heads/master | lib/ubuntuone/__init__.py | 1 | # Copyright 2008-2015 Canonical
# Copyright 2015-2018 Chicharreros (https://launchpad.net/~chicharreros)
#
# This program 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
# Licens... |
nuwainfo/treeio | refs/heads/master | account/admin.py | 6 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Account: backend admin definitions
"""
from treeio.account.models import NotificationSetting, Notification
from django.contrib import admin
class NotificationAdmin(admin.ModelAdmin):
list_display ... |
thomazs/geraldo | refs/heads/master | site/newsite/site-geraldo/appengine_django/conf/app_template/models.py | 69 | from appengine_django.models import BaseModel
from google.appengine.ext import db
# Create your models here.
|
Vvucinic/Wander | refs/heads/master | venv_2_7/lib/python2.7/site-packages/numpy/lib/shape_base.py | 17 | from __future__ import division, absolute_import, print_function
import warnings
import numpy.core.numeric as _nx
from numpy.core.numeric import (
asarray, zeros, outer, concatenate, isscalar, array, asanyarray
)
from numpy.core.fromnumeric import product, reshape
from numpy.core import vstack, atleast_3d
_... |
kaksmet/servo | refs/heads/master | tests/wpt/css-tests/css-text-decor-3_dev/xhtml1/reference/support/generate-text-emphasis-position-property-tests.py | 841 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-position-property-001 ~ 006
which cover all possible values of text-emphasis-position property with
all combination of three main writing modes and two orientations. Only
test files are generated by this script. It also out... |
maohongyuan/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/crashers/mutation_inside_cyclegc.py | 346 |
# The cycle GC collector can be executed when any GC-tracked object is
# allocated, e.g. during a call to PyList_New(), PyDict_New(), ...
# Moreover, it can invoke arbitrary Python code via a weakref callback.
# This means that there are many places in the source where an arbitrary
# mutation could unexpectedly occur.... |
robweber/maraschino | refs/heads/master | lib/flask/testsuite/blueprints.py | 14 | # -*- coding: utf-8 -*-
"""
flask.testsuite.blueprints
~~~~~~~~~~~~~~~~~~~~~~~~~~
Blueprints (and currently modules)
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import flask
import unittest
import warnings
from fl... |
FrankBian/kuma | refs/heads/master | vendor/packages/sqlalchemy/lib/sqlalchemy/dialects/oracle/cx_oracle.py | 17 | """Support for the Oracle database via the cx_oracle driver.
Driver
------
The Oracle dialect uses the cx_oracle driver, available at
http://cx-oracle.sourceforge.net/ . The dialect has several behaviors
which are specifically tailored towards compatibility with this module.
Version 5.0 or greater is **strongly**... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/operations/_virtual_network_taps_operations.py | 1 | # 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 ... |
jaruba/chromium.src | refs/heads/nw12 | third_party/stp/genastkinds.py | 26 | # 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.
import os
import os.path
import subprocess
import sys
(script, source, out,) = sys.argv[1:]
subprocess.check_call([
"perl", script,
"--file", source,
]... |
duerrp/pyexperiment | refs/heads/master | pyexperiment/utils/stdout_redirector.py | 4 | """Context to redirect stdout (inspired by a tutorial by Eli Bendersky)
Adapted by Peter Duerr
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from contextlib import contextmanager
import sys
@contextmanager
de... |
Adai0808/scikit-learn | refs/heads/master | sklearn/naive_bayes.py | 128 | # -*- coding: utf-8 -*-
"""
The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These
are supervised learning methods based on applying Bayes' theorem with strong
(naive) feature independence assumptions.
"""
# Author: Vincent Michel <vincent.michel@inria.fr>
# Minor fixes by Fabian Pedre... |
henkelis/sonospy | refs/heads/msrefactor5 | web2py/options_win.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import os
#ip = '127.0.0.1'
ip = '0.0.0.0'
port = 8000
password = '<recycle>'
pid_filename = 'httpserver.pid'
log_filename = 'httpserver.log'
profiler_filename = None
ssl_certificate = ''
ssl_private_key = ''
numthreads = 10
#server_name = socket.gethostname()
s... |
Slezhuk/ansible | refs/heads/devel | lib/ansible/modules/packaging/os/opkg.py | 54 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Patrick Pelletier <pp.pelletier@gmail.com>
# Based on pacman (Afterburn) and pkgin (Shaun Zinck) modules
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Softwa... |
brymaster5000/m7_4.1 | refs/heads/master | scripts/gcc-wrapper.py | 501 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, Code Aurora Forum. 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 a... |
munnerz/CouchPotatoServer | refs/heads/master | libs/subliminal/services/subscenter.py | 7 | # -*- coding: utf-8 -*-
# Copyright 2012 Ofir Brukner <ofirbrukner@gmail.com>
#
# This file is part of subliminal.
#
# subliminal 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 3 of the ... |
waytai/django-rest-framework | refs/heads/master | rest_framework/utils/humanize_datetime.py | 144 | """
Helper functions that convert strftime formats into more readable representations.
"""
from rest_framework import ISO_8601
def datetime_formats(formats):
format = ', '.join(formats).replace(
ISO_8601,
'YYYY-MM-DDThh:mm[:ss[.uuuuuu]][+HH:MM|-HH:MM|Z]'
)
return humanize_strptime(format)
... |
ESS-LLP/erpnext-medical | refs/heads/develop | erpnext/education/doctype/guardian_interest/guardian_interest.py | 54 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class GuardianInterest(Document):
pass
|
40223141/2015cda_g6 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/unittest/test/testmock/testpatch.py | 739 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import os
import sys
import unittest
from unittest.test.testmock import support
from unittest.test.testmock.support import SomeClass, is_instance
from unittest.mock import... |
niftynei/zulip | refs/heads/master | zerver/templatetags/minified_js.py | 13 | from __future__ import absolute_import
from typing import Any
from django.template import Node, Library, TemplateSyntaxError
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
if False:
# no need to add dependency
from django.template.base import Parser, Token
... |
couchbaselabs/priority15 | refs/heads/master | lib/mc_bin_client.py | 2 | #!/usr/bin/env python
"""
Binary memcached test client.
Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
"""
import hmac
import socket
import select
import random
import struct
import exceptions
import zlib
from memcacheConstants import REQ_MAGIC_BYTE, RES_MAGIC_BYTE
from memcacheConstants import REQ_PKT_FMT, RE... |
Preetwinder/scrapy | refs/heads/master | scrapy/selector/__init__.py | 183 | """
Selectors
"""
from scrapy.selector.unified import *
from scrapy.selector.lxmlsel import *
|
anistark/mozillians | refs/heads/master | vendor-local/lib/python/unidecode/x070.py | 252 | data = (
'You ', # 0x00
'Yang ', # 0x01
'Lu ', # 0x02
'Si ', # 0x03
'Jie ', # 0x04
'Ying ', # 0x05
'Du ', # 0x06
'Wang ', # 0x07
'Hui ', # 0x08
'Xie ', # 0x09
'Pan ', # 0x0a
'Shen ', # 0x0b
'Biao ', # 0x0c
'Chan ', # 0x0d
'Mo ', # 0x0e
'Liu ', # 0x0f
'Jian ', # 0x10
'P... |
attilahorvath/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/optparser.py | 175 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... |
KSanthanam/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/werkzeug/testsuite/__init__.py | 146 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite
~~~~~~~~~~~~~~~~~~
Contains all test Werkzeug tests.
:copyright: (c) 2014 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import with_statement
import re
import sys
import unittest
import shutil
import tempfile
im... |
kailIII/emaresa | refs/heads/7.0 | trunk.pe.bk/account_bank_voucher/account.py | 7 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the ... |
sunlightlabs/django-simplepay | refs/heads/master | setup.py | 1 | from distutils.core import setup
long_description = open('README.rst').read()
setup(
name='django-simplepay',
version="0.2",
packages=['simplepay'],
package_dir={'simplepay': 'simplepay'},
package_data={'simplepay': ['templates/simplepay/*.html']},
description='Amazon Simple Pay buttons',
... |
glatard/nipype | refs/heads/master | nipype/interfaces/fsl/tests/test_model.py | 14 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import tempfile
import shutil
from nipype.testing import (assert_equal, assert_true,
skipif)
import nipype.interfaces.fsl.model as fsl
from nipype.interfaces.fsl impor... |
jdsika/TUM_HOly | refs/heads/master | openrave/sympy/physics/quantum/hilbert.py | 6 | """Hilbert spaces for quantum mechanics.
Authors:
* Brian Granger
* Matt Curry
"""
from sympy import Basic, Interval, oo, sympify
from sympy.printing.pretty.stringpict import prettyForm
from sympy.physics.quantum.qexpr import QuantumError
from sympy.core.compatibility import reduce
__all__ = [
'HilbertSpaceErr... |
armbrustlab/seaflowpy | refs/heads/develop | src/seaflowpy/cli/commands/db_cmd.py | 1 | import sys
import click
from seaflowpy import db
from seaflowpy.errors import SeaFlowpyError
from seaflowpy import fileio
from seaflowpy import sfl
# Subcommand aliases for backwards compatibility
aliases = {'create': 'import-sfl'}
class AliasedGroup(click.Group):
def get_command(self, ctx, cmd_name):
r... |
adaur/SickRage | refs/heads/master | lib/github/GitCommit.py | 74 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
gentoo/webapp-config | refs/heads/master | WebappConfig/debug.py | 2 | #################################################################################
# WEBAPP-CONFIG - DEBUGGING FUNCTIONS
#################################################################################
# debug.py -- Utility function for debugging
# Copyright 2005 Gunnar Wrobel
# Distributed under the terms of the GNU G... |
wyc/django | refs/heads/master | tests/staticfiles_tests/storage.py | 332 | from datetime import datetime
from django.contrib.staticfiles.storage import CachedStaticFilesStorage
from django.core.files import storage
class DummyStorage(storage.Storage):
"""
A storage class that does implement modified_time() but raises
NotImplementedError when calling
"""
def _save(self, ... |
vim-scripts/Vim-SQL-Workbench | refs/heads/master | resources/py/lib/sqlwbserver.py | 1 | from __future__ import with_statement
import commands
import datetime
import os
import uuid
import socket
import re
import string
import shlex
import sys
import thread
import time
import subprocess
class SQLWorkbench(object):
profile = None
port = 5000
log = None
log_f = None
log_sem = thread.allo... |
JCROM-Android/jcrom_external_chromium_org | refs/heads/kitkat | media/tools/bug_hunter/bug_hunter_test.py | 47 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Integration tests for bug hunter."""
import csv
from optparse import Values
import os
import unittest
from bug_hunter import BugHunter
try:
impor... |
mattilyra/scikit-learn | refs/heads/master | examples/linear_model/plot_sgd_loss_functions.py | 73 | """
==========================
SGD: convex loss functions
==========================
A plot that compares the various convex loss functions supported by
:class:`sklearn.linear_model.SGDClassifier` .
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
def modified_huber_loss(y_true, y_pred):
z ... |
pmlrsg/ol3 | refs/heads/master | bin/split-example.py | 60 | import os
import re
import sys
def split_example_file(example, dst_dir):
lines = open(example, 'rU').readlines()
target_lines = []
target_require_lines = []
found_requires = False
found_code = False
for line in lines:
m = re.match(r'goog.require\(\'(.*)\'\);', line)
if m:
... |
ging/horizon | refs/heads/master | openstack_dashboard/dashboards/idm/organizations/views.py | 1 | # Copyright (C) 2014 Universidad Politecnica de Madrid
#
# 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 la... |
ofermend/medicare-demo | refs/heads/master | socialite/jython/Lib/test/test_long_int_args.py | 24 | """Ensure longs passed to int arguments are handled correctly
Made for Jython.
"""
import array
import cStringIO
import tempfile
from test import test_support
import unittest
import StringIO
class LongIntArgsTestCase(unittest.TestCase):
def test_array(self):
a = array.array('c', 'jython')
assert ... |
YuMatsuzawa/HadoopEclipseProject | refs/heads/master | contrib/hod/hodlib/Common/__init__.py | 1638 | #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 use thi... |
arju88nair/projectCulminate | refs/heads/master | venv/lib/python3.5/site-packages/pylint/test/regrtest_data/wrong_import_position.py | 9 | """Test that wrong-import-position is properly reset when
other errors are disabled.
"""
# pylint: disable=unused-import, too-few-public-methods
class Something(object):
"""A class before an import."""
import os
|
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py | 1 | # 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 ... |
oskar456/youtube-dl | refs/heads/master | youtube_dl/extractor/mofosex.py | 39 | from __future__ import unicode_literals
from ..utils import (
int_or_none,
str_to_int,
unified_strdate,
)
from .keezmovies import KeezMoviesIE
class MofosexIE(KeezMoviesIE):
_VALID_URL = r'https?://(?:www\.)?mofosex\.com/videos/(?P<id>\d+)/(?P<display_id>[^/?#&.]+)\.html'
_TESTS = [{
'url... |
UdK-VPT/Open_eQuarter | refs/heads/master | mole3/qgisinteraction/layer_interaction.py | 1 | from qgis.core import QgsVectorLayer, QgsRasterLayer, QgsCoordinateReferenceSystem, QgsVectorFileWriter, QgsMapRendererSequentialJob
from qgis.core import QgsProject, QgsMapLayer, QgsMapSettings, QgsMapRendererJob, QgsProject, QgsField, QgsMapRendererCustomPainterJob
#from qgis.core.processing import QgsOverlayUtils
fr... |
Nick-OpusVL/odoo | refs/heads/8.0 | addons/calendar/calendar.py | 43 | # -*- coding: utf-8 -*-
import pytz
import re
import time
import openerp
import openerp.service.report
import uuid
import collections
import babel.dates
from werkzeug.exceptions import BadRequest
from datetime import datetime, timedelta
from dateutil import parser
from dateutil import rrule
from dateutil.relativedelta... |
skirsdeda/django-filer | refs/heads/develop | filer/contrib/django_cms/cms_toolbars.py | 3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.urlresolvers import reverse
from django.utils.encoding import force_text
from django.utils.translation import ugettext_lazy as _
from cms.cms_toolbars import ADMIN_MENU_IDENTIFIER, ADMINISTRATION_BREAK
from cms.toolbar.items import Brea... |
erdincay/youtube-dl | refs/heads/master | youtube_dl/extractor/wat.py | 114 | # coding: utf-8
from __future__ import unicode_literals
import re
import hashlib
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
)
class WatIE(InfoExtractor):
_VALID_URL = r'http://www\.wat\.tv/video/(?P<display_id>.*)-(?P<short_id>.*?)_.*?\.html'
IE_NAME = '... |
plusplus7/geototype | refs/heads/master | src/stage/__init__.py | 1 |
import demo_stage
__stages = {
"demo1" : demo_stage.DemoStage,
}
def load_stage(name):
return __stages[name]()
|
qCzar/ComicBot | refs/heads/gonzobot | cloudbot/util/test/test_formatting.py | 5 | from cloudbot.util.formatting import munge, dict_format, pluralize, strip_colors, truncate, truncate_str, \
strip_html, multi_replace, multiword_replace, truncate_words, smart_split, get_text_list, ireplace, chunk_str
test_munge_input = "The quick brown fox jumps over the lazy dog"
test_munge_count = 3
test_munge_... |
namccart/pybombs | refs/heads/master | pybombs/__init__.py | 2 | #
# Copyright 2015-2016 Free Software Foundation, Inc.
#
# This file is part of PyBOMBS
#
# PyBOMBS 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.
#
... |
TeamSWAP/swap | refs/heads/master | external/pyinstaller/PyInstaller/hooks/hook-pywintypes.py | 10 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
bplancher/odoo | refs/heads/9.0 | addons/delivery/models/partner.py | 44 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import fields, models
class ResPartner(models.Model):
_inherit = 'res.partner'
property_delivery_carrier_id = fields.Many2one('delivery.carrier', company_dependent=True, string="Delivery Method", ... |
CooperLuan/devops.notes | refs/heads/master | taobao/top/api/rest/WangwangEserviceNewevalsGetRequest.py | 1 | '''
Created by auto_sdk on 2014-12-17 17:22:51
'''
from top.api.base import RestApi
class WangwangEserviceNewevalsGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.btime = None
self.etime = None
self.query_ids = None
def getapiname... |
antoviaque/edx-platform | refs/heads/master | common/lib/capa/capa/tests/test_targeted_feedback.py | 196 | """
Tests the logic of the "targeted-feedback" attribute for MultipleChoice questions,
i.e. those with the <multiplechoiceresponse> element
"""
import unittest
import textwrap
from . import test_capa_system, new_loncapa_problem, load_fixture
class CapaTargetedFeedbackTest(unittest.TestCase):
'''
Testing clas... |
borysiasty/QGIS | refs/heads/master | scripts/qgis_fixes/fix_idioms.py | 77 | from lib2to3.fixes.fix_idioms import FixIdioms
|
ovpn-to/oVPN.to-Client-Software | refs/heads/patch-to-python-3.4.4 | win_notification.py | 1 | # -*- coding: utf-8 -*-
from debug import debug
import os, platform, threading, ctypes
from win32api import GetSystemMetrics, GetModuleHandle, PostQuitMessage, LoadResource
from win32con import CW_USEDEFAULT, IMAGE_ICON, IMAGE_BITMAP, IDI_INFORMATION, IDI_APPLICATION, LR_DEFAULTSIZE, LR_DEFAULTCOLOR, LR_LOADFROMFILE, ... |
DCSaunders/tensorflow | refs/heads/master | tensorflow/contrib/bayesflow/python/ops/monte_carlo.py | 13 | # 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... |
bpshetty/erpnext | refs/heads/master | erpnext/crm/doctype/lead/.py | 106 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class Lead(Document):
pass
|
PeterWangIntel/chromium-crosswalk | refs/heads/master | third_party/closure_linter/closure_linter/requireprovidesorter_test.py | 127 | #!/usr/bin/env python
#
# Copyright 2012 The Closure Linter 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
#... |
PetePriority/home-assistant | refs/heads/dev | tests/components/sensor/test_integration.py | 1 | """The tests for the integration sensor platform."""
from datetime import timedelta
from unittest.mock import patch
from homeassistant.setup import async_setup_component
import homeassistant.util.dt as dt_util
async def test_state(hass):
"""Test integration sensor state."""
config = {
'sensor': {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.