repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
JioCloud/nova | refs/heads/master | nova/scheduler/filters/extra_specs_ops.py | 78 | # Copyright (c) 2011 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 ... |
seaotterman/tensorflow | refs/heads/master | tensorflow/contrib/session_bundle/session_bundle_test.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... |
j7nn7k/django-flashpacker | refs/heads/master | flashpacker/runtests/settings.py | 1 | # Django settings for testproject project.
from __future__ import unicode_literals
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DEBUG_PROPAGATE_EXCEPTIONS = True
ALLOWED_HOSTS = ['*']
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.ba... |
nilnvoid/wagtail | refs/heads/master | wagtail/wagtailcore/blocks/base.py | 1 | from __future__ import absolute_import, unicode_literals
import collections
from importlib import import_module
from django import forms
from django.core import checks
from django.core.exceptions import ImproperlyConfigured
from django.template.loader import render_to_string
from django.utils import six
from django.u... |
slayher/android_kernel_samsung_trlte | refs/heads/cm-12.0 | tools/perf/python/twatch.py | 7370 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... |
nodice73/hspipeline | refs/heads/master | web/env/lib/python2.7/site-packages/markupsafe/__init__.py | 144 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
import string
from collections import Mapping
from markupsafe._compat import text_type, string_types, int_types, \
u... |
nkgilley/home-assistant | refs/heads/dev | tests/components/luftdaten/__init__.py | 40 | """Define tests for the Luftdaten component."""
|
Esri/workflowmanager-admin-tools | refs/heads/master | Documentation/ActiveDirectorySample1.py | 1 | # ---------------------------------------------------------------------------
# ActiveDirectorySample1.py
#
# SAMPLE #1:
# This script shows one possible scenario for using the "Import Active
# Directory Configuration" tool.
# ---------------------------------------------------------------------------
import arcpy
imp... |
kazmiruk/gevent-socketio | refs/heads/master | socketio/packet.py | 9 | from socketio.defaultjson import default_json_dumps, default_json_loads
MSG_TYPES = {
'disconnect': 0,
'connect': 1,
'heartbeat': 2,
'message': 3,
'json': 4,
'event': 5,
'ack': 6,
'error': 7,
'noop': 8,
}
MSG_VALUES = dict((v, k) for k, v in MSG_TYPES.iteritems())
ERROR_REASON... |
iamwrm/coding | refs/heads/master | leetcode/a1.py | 1 | class Solution:
def twoSum(self, nums, target):
"""
:type nums: List[int]
:type target: int
:rtype: List[int]
"""
for i,j in nums:
if (not (i == j )) and (i+j == nums):
return i. |
darktears/chromium-crosswalk | refs/heads/master | ppapi/generate_ppapi_size_checks.py | 177 | #!/usr/bin/env python
# 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.
"""This script should be run manually on occasion to make sure all PPAPI types
have appropriate size checking.
"""
import optparse... |
microhuang/mongrel2 | refs/heads/master | examples/python/mongrel2/config/commands.py | 90 | from mongrel2 import config
from mongrel2.config import args
import mongrel2.config.commands
from uuid import uuid4
from mongrel2.config import model
import getpass
import sys
import os
import signal
from sqlite3 import OperationalError
def try_reading(reader):
try:
cmd = reader.readline()
return ... |
pombredanne/pyjs | refs/heads/master | tests/test022.py | 13 | import ui
class DynaTable:
def onModuleLoad(self):
slot = ui.RootPanel.get("calendar") |
phil65/KodiDevKit | refs/heads/master | libs/include.py | 1 | # -*- coding: utf8 -*-
# Copyright (C) 2015 - Philipp Temminghoff <phil65@kodi.tv>
# This program is Free Software see LICENSE file for details
from lxml import etree as ET
import os
class Include(dict):
"""
Represents an include-like kodi object
"""
constant_attribs = {"x", "y", "width", "height",... |
alikins/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py | 25 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... |
ResolveWang/algrithm_qa | refs/heads/master | basic_algrithms/sort_algrithms/insert_sort.py | 1 | """
插入排序
"""
from basic_algrithms.sort_algrithms.benchmark import Comparator
def insert_sort(arr):
if not arr or len(arr) < 2:
return arr
for i in range(1, len(arr)):
j = i - 1
while j >= 0 and arr[j] > arr[j+1]:
arr[j], arr[j+1] = arr[j+1], arr[j]
j -= 1
... |
leekchan/django_test | refs/heads/master | tests/context_processors/models.py | 547 | from django.db import models
class DebugObject(models.Model):
pass
|
loic/django | refs/heads/master | tests/forms_tests/field_tests/test_imagefield.py | 37 | from __future__ import unicode_literals
import os
import unittest
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import ImageField
from django.test import SimpleTestCase
from django.utils._os import upath
try:
from PIL import Image
except ImportError:
Image = None
def get_i... |
mSenyor/sl4a | refs/heads/master | python/src/Misc/Vim/syntax_test.py | 82 | """Test file for syntax highlighting of editors.
Meant to cover a wide range of different types of statements and expressions.
Not necessarily sensical or comprehensive (assume that if one exception is
highlighted that all are, for instance).
Extraneous trailing whitespace can't be tested because of svn pre-commit ho... |
wizcoin/wizcoin | refs/heads/master | contrib/wallettools/walletunlock.py | 2299 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) |
kingvuplus/boom2 | refs/heads/master | lib/python/Plugins/SystemPlugins/NFIFlash/downloader.py | 67 | # -*- coding: utf-8 -*-
from boxbranding import getImageVersion,getMachineBrand, getMachineName
from os import system, access, R_OK
import re
from enigma import eConsoleAppContainer, eTimer
from twisted.web import client
from Plugins.SystemPlugins.Hotplug.plugin import hotplugNotifier
from Screens.Screen import Scree... |
chenss/ChatRoom | refs/heads/master | 14.5 已经能运行(虽然有很多Warning)的Django-nonrel框架/django/contrib/databrowse/sites.py | 329 | from django import http
from django.db import models
from django.contrib.databrowse.datastructures import EasyModel
from django.shortcuts import render_to_response
from django.utils.safestring import mark_safe
class AlreadyRegistered(Exception):
pass
class NotRegistered(Exception):
pass
class DatabrowsePlugi... |
0x3a/crits | refs/heads/master | crits/core/api.py | 2 | import json
import yaml
from bson.objectid import ObjectId
from dateutil.parser import parse
from django.http import HttpResponse
from lxml.etree import tostring
from django.core.urlresolvers import resolve, get_script_prefix
from tastypie.exceptions import BadRequest, ImmediateHttpResponse
from tastypie.serializers... |
jeffchao/xen-3.3-tcg | refs/heads/master | dist/install/usr/lib/python/xen/sv/CreateDomain.py | 42 | from xen.sv.Wizard import *
from xen.sv.util import *
from xen.sv.GenTabbed import PreTab
from xen.xm.create import make_config, OptVals
from xen.xend.XendClient import server
class CreateDomain( Wizard ):
def __init__( self, urlWriter ):
sheets = [ CreatePage0,
CreatePage1,
... |
simplyguru-dot/ansible | refs/heads/devel | lib/ansible/plugins/shell/sh.py | 63 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
#
# This file is part of Ansible.
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... |
michelts/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/conf/locale/id/formats.py | 355 | # -*- 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 N Y'
DATETIME_FORMAT = "j N Y, G.i.s"
TIME_FORMAT = 'G.i.s'
YEAR_MONTH_... |
apple/llvm-project | refs/heads/llvm.org/main | llvm/utils/lit/tests/shtest-keyword-parse-errors.py | 8 | # RUN: not %{lit} -j 1 -vv %{inputs}/shtest-keyword-parse-errors > %t.out
# RUN: FileCheck -input-file %t.out %s
#
# END.
# CHECK: Testing: 3 tests
# CHECK-LABEL: UNRESOLVED: shtest-keyword-parse-errors :: empty.txt
# CHECK: {{^}}Test has no 'RUN:' line{{$}}
# CHECK-LABEL: UNRESOLVED: shtest-keyword-parse-erro... |
chidea/GoPythonDLLWrapper | refs/heads/master | bin/lib/site-packages/pip/_vendor/cachecontrol/wrapper.py | 953 | from .adapter import CacheControlAdapter
from .cache import DictCache
def CacheControl(sess,
cache=None,
cache_etags=True,
serializer=None,
heuristic=None):
cache = cache or DictCache()
adapter = CacheControlAdapter(
cache,
c... |
ncliam/serverpos | refs/heads/master | openerp/addons/point_of_sale/__openerp__.py | 261 | # -*- 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... |
moreati/django-allauth | refs/heads/master | allauth/socialaccount/providers/tumblr/provider.py | 70 | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth.provider import OAuthProvider
class TumblrAccount(ProviderAccount):
def get_profile_url_(self):
return 'http://%s.tumblr.com/' \
% self.accoun... |
tecan/xchat-rt | refs/heads/master | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/plugins/ChannelLogger/config.py | 8 | ###
# Copyright (c) 2005, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright n... |
nkgilley/home-assistant | refs/heads/dev | homeassistant/components/ohmconnect/__init__.py | 36 | """The ohmconnect component."""
|
zstyblik/infernal-twin | refs/heads/master | build/pip/build/lib.linux-i686-2.7/pip/_vendor/html5lib/treewalkers/_base.py | 436 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, string_types
__all__ = ["DOCUMENT", "DOCTYPE", "TEXT", "ELEMENT", "COMMENT", "ENTITY", "UNKNOWN",
"TreeWalker", "NonRecursiveTreeWalker"]
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE... |
cginternals/cppexpose | refs/heads/master | source/tests/googletest/googlemock/scripts/generator/cpp/utils.py | 1158 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google 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... |
bejondshao/grape | refs/heads/master | org/bejond/basic/analysis/__init__.py | 23 | # -*- coding: UTF-8 -*-
|
PiRSquared17/creoleparser | refs/heads/master | creoleparser/core.py | 4 | # core.py
# -*- coding: utf-8 -*-
#
# Copyright © Stephen Day
#
# This module is part of Creoleparser and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
#
import re
import warnings
import genshi.builder as bldr
__docformat__ = 'restructuredtext en'
escape_cha... |
kool79/intellij-community | refs/heads/master | python/lib/Lib/encodings/cp875.py | 593 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
ArcherSys/ArcherSys | refs/heads/master | Lib/site-packages/IPython/lib/security.py | 19 | """
Password generation for the IPython notebook.
"""
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Stdlib
import getpass
import hashlib
import random
# Our own
from IPython.core.error import Usa... |
kiriappeee/lemur | refs/heads/master | lemur/default.conf.py | 9 | # This is just Python which means you can inherit and tweak settings
import os
_basedir = os.path.abspath(os.path.dirname(__file__))
ADMINS = frozenset([''])
THREADS_PER_PAGE = 8
# General
# These will need to be set to `True` if you are developing locally
CORS = False
debug = False
# Logging
LOG_LEVEL = "DEBUG"... |
sathnaga/avocado-vt | refs/heads/master | virttest/qemu_io.py | 3 | import re
import aexpect
from avocado.utils import process
from virttest import utils_misc
from virttest import error_context
class QemuIOParamError(Exception):
"""
Parameter Error for qemu-io command
"""
pass
class QemuIO(object):
"""
A class for execute qemu-io command
"""
def... |
masakaya/fxref | refs/heads/master | test/Framework/gtest/test/gtest_shuffle_test.py | 3023 | #!/usr/bin/env python
#
# Copyright 2009 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of... |
endocode/contrib | refs/heads/master | flannel-server/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py | 1139 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... |
emonty/ansible-modules-core | refs/heads/devel | packaging/os/apt_key.py | 10 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, Jayson Vantuyl <jayson@aggressive.ly>
#
# 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
#... |
gordonb3/domoticz | refs/heads/development | plugins/examples/Pinger.py | 14 | # ICMP Plugin
#
# Author: Dnpwwo, 2017 - 2018
#
"""
<plugin key="ICMP" name="Pinger (ICMP)" author="dnpwwo" version="3.1.1">
<description>
ICMP Pinger Plugin.<br/><br/>
Specify comma delimted addresses (IP or DNS names) of devices that are to be pinged.<br/>
When remote devices are found a m... |
ruud-v-a/rhythmbox | refs/heads/album-artist | plugins/artsearch/artsearch.py | 1 | # -*- Mode: python; coding: utf-8; tab-width: 8; indent-tabs-mode: t; -*-
#
# Copyright (C) 2011 Jonathan Matthew
#
# 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, or (at your ... |
yvaucher/vertical-ngo | refs/heads/8.0 | logistic_requisition/wizard/logistic_requisition_cancel.py | 5 | # -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier
# Copyright 2013-2014 Camptocamp SA
#
# 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
# Li... |
BeegorMif/HTPC-Manager | refs/heads/master | tornado/test/websocket_test.py | 2 | from __future__ import absolute_import, division, print_function, with_statement
import traceback
from tornado.concurrent import Future
from tornado.httpclient import HTTPError, HTTPRequest
from tornado.log import gen_log
from tornado.testing import AsyncHTTPTestCase, gen_test, bind_unused_port, ExpectLog
from tornad... |
Manojkumar91/odoo_inresto | refs/heads/master | addons/subscription/__openerp__.py | 7 | # -*- 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... |
forte916/hello_world | refs/heads/master | python/xor1.py | 1 | #!/usr/bin/env python
# coding: UTF-8
'''
XOR calculation samples.
'''
Enc = lambda plain, key: ''.join([chr(ord(x) ^ key) for x in plain])
Dec = Enc
print(Dec(Enc("abcd", 0x4f), 0x4f)) # => "abcd"
|
srene/ndnSIM-inrpp | refs/heads/master | waf-tools/clang_compilation_database.py | 99 | #!/usr/bin/env python
# encoding: utf-8
# Christoph Koke, 2013
"""
Writes the c and cpp compile commands into build/compile_commands.json
see http://clang.llvm.org/docs/JSONCompilationDatabase.html
Usage:
def configure(conf):
conf.load('compiler_cxx')
...
conf.load('clang_compilation_data... |
ulope/django | refs/heads/master | tests/i18n/patterns/urls/path_unused.py | 47 | from django.conf.urls import url
from django.views.generic import TemplateView
view = TemplateView.as_view(template_name='dummy.html')
urlpatterns = [
url(r'^nl/foo/', view, name='not-translated'),
]
|
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/application_gateway_path_rule.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 ... |
RaviTezu/yowsup | refs/heads/master | yowsup/demos/echoclient/stack.py | 27 | from yowsup.stacks import YowStack
from .layer import EchoLayer
from yowsup.layers import YowLayerEvent
from yowsup.layers.auth import YowCryptLayer, YowAuthenticationProtocolLayer, AuthError
from yowsup.layers.coder import YowCoderLayer
from yowsup.layers.network ... |
agry/NGECore2 | refs/heads/master | scripts/mobiles/dathomir/cavern_spider_broodling.py | 2 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobi... |
isyippee/ceilometer | refs/heads/master | ceilometer/tests/unit/compute/virt/vmware/test_vsphere_operations.py | 12 | # Copyright (c) 2014 VMware, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... |
kschwank/paperwork | refs/heads/stable | src/paperwork/paperwork.py | 1 | #!/usr/bin/env python
# Paperwork - Using OCR to grep dead trees the easy way
# Copyright (C) 2012-2014 Jerome Flesch
#
# Paperwork 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 versio... |
wakatime/sublime-wakatime | refs/heads/master | packages/wakatime/session_cache.py | 3 | # -*- coding: utf-8 -*-
"""
wakatime.session_cache
~~~~~~~~~~~~~~~~~~~~~~
Persist requests.Session for multiprocess SSL handshake pooling.
:copyright: (c) 2015 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
import logging
import os
import pickle
import sys
try:
import sqlite... |
wencongyang/qemu-colo | refs/heads/master | tests/image-fuzzer/qcow2/__init__.py | 95 | from layout import create_image
|
sauloal/pycluster | refs/heads/master | pypy-1.9_64/lib-python/2.7/test/test_smtplib.py | 20 | import asyncore
import email.utils
import socket
import smtpd
import smtplib
import StringIO
import sys
import time
import select
import unittest
from test import test_support
try:
import threading
except ImportError:
threading = None
HOST = test_support.HOST
def server(evt, buf, serv):
serv.listen(5)
... |
fjorba/invenio | refs/heads/master | modules/webcomment/lib/webcomment_regression_tests.py | 1 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2010, 2011, 2012 CERN.
##
## Invenio 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
## ... |
Tesora/tesora-tempest | refs/heads/master | tempest/lib/services/compute/certificates_client.py | 12 | # Copyright 2013 IBM Corp
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
zhaobin19918183/zhaobinCode | refs/heads/master | BlogDjango/BlogDjango/wsgi.py | 1 | """
WSGI config for BlogDjango 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/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... |
dufresnedavid/canada | refs/heads/7.0-ddufresne-employer-contributions | l10n_ca_hr_payroll_leave_type/__init__.py | 1 | # -*- coding:utf-8 -*-
##############################################################################
#
# Copyright (C) 2012 - 2014 Odoo Canada. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as publish... |
davido/buck | refs/heads/master | src/com/facebook/buck/json/buck_parser/buck_test.py | 7 | from .buck import (
BuildFileContext,
LazyBuildEnvPartial,
flatten_dicts,
get_mismatched_args,
subdir_glob,
)
from .glob_mercurial import _load_manifest_trie, glob_mercurial_manifest
from .glob_watchman import format_watchman_query_params
from .glob_internal import path_component_contains_dot, glob_... |
trungnt13/uef-summerschool2016 | refs/heads/master | logistic_regression.py | 1 | # make our code python2 and python3 compatible
from __future__ import print_function, absolute_import, division
# use appropriate matplotlib backend for ipython notebook
import matplotlib
matplotlib.use('Agg')
from IPython.core.pylabtools import figsize
figsize(12, 4)
# figures and plot library
from matplotlib import ... |
pathompongoo/ThGovJobApp | refs/heads/master | env/lib/python2.7/site-packages/dominate/util.py | 10 | '''
Utility classes for creating dynamic html documents
'''
__license__ = '''
This file is part of Dominate.
Dominate 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 License, or (a... |
xuxiao19910803/edx-platform | refs/heads/master | common/djangoapps/heartbeat/urls.py | 154 | from django.conf.urls import url, patterns
urlpatterns = patterns(
'',
url(r'^$', 'heartbeat.views.heartbeat', name='heartbeat'),
)
|
Donkyhotay/MoonPy | refs/heads/master | zope/documenttemplate/dt_insv.py | 1 | ##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... |
bigdatauniversity/edx-platform | refs/heads/master | lms/djangoapps/courseware/tests/test_discussion_module.py | 62 | # -*- coding: utf-8 -*-
"""Test for Discussion Xmodule functional logic."""
import ddt
from mock import Mock
from . import BaseTestXmodule
from courseware.module_render import get_module_for_descriptor_internal
from xmodule.discussion_module import DiscussionModule
from xmodule.modulestore import ModuleStoreEnum
from x... |
nathanial/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/contrib/gis/geometry/backend/__init__.py | 388 | from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
geom_backend = getattr(settings, 'GEOMETRY_BACKEND', 'geos')
try:
module = import_module('.%s' % geom_backend, 'django.contrib.gis.geometry.backend')
except ImportError, e:
... |
Echelon85/volatility | refs/heads/master | volatility/plugins/procdump.py | 44 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2008 Brendan Dolan-Gavitt <bdolangavitt@wesleyan.edu>
#
# Additional Authors:
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of... |
ihsanudin/odoo | refs/heads/8.0 | addons/account/wizard/account_open_closed_fiscalyear.py | 237 | # -*- 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... |
40123148/2015cdbg11_0420 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/logging/config.py | 739 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
marmyshev/bug_1117098 | refs/heads/master | openlp/core/__init__.py | 2 | # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... |
abzaloid/maps | refs/heads/master | django-project/lib/python2.7/site-packages/django/conf/locale/fr/formats.py | 116 | # -*- 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 = 'j F Y'
TIME_FORMAT = 'H:i'
DATETI... |
xshotD/pyglet | refs/heads/master | contrib/layout/layout/gl/device.py | 29 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
from ctypes import *
import re
from pyglet.gl import *
import pyglet.font
from layout.base import *
from layout.frame import *
from layout.locator import *
from pyglet import image
class GLRenderDevice(RenderDevice):
_stock... |
rajanandakumar/DIRAC | refs/heads/integration | DataManagementSystem/Client/DataManager.py | 1 | """
:mod: DataManager
.. module: DataManager
:synopsis: DataManager links the functionalities of StorageElement and FileCatalog.
This module consists of DataManager and related classes.
"""
# # RSCID
__RCSID__ = "$Id$"
# # imports
from datetime import datetime, timedelta
import fnmatch
import os
import time
from ... |
titasakgm/brc-stock | refs/heads/master | openerp/addons/plugin/plugin_handler.py | 11 | '''
Created on 18 oct. 2011
@author: openerp
'''
from openerp.osv import osv
from openerp.tools.translate import _
class plugin_handler(osv.osv_memory):
_name = 'plugin.handler'
def _make_url(self, cr, uid, res_id, model, context=None):
"""
@param res_id: on which document the message is... |
pratikmallya/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/gis/utils/wkt.py | 219 | """
Utilities for manipulating Geometry WKT.
"""
from django.utils import six
def precision_wkt(geom, prec):
"""
Returns WKT text of the geometry according to the given precision (an
integer or a string). If the precision is an integer, then the decimal
places of coordinates WKT will be truncated to... |
davidfraser/sqlalchemy | refs/heads/master | lib/sqlalchemy/testing/provision.py | 47 | from sqlalchemy.engine import url as sa_url
from sqlalchemy import text
from sqlalchemy.util import compat
from . import config, engines
FOLLOWER_IDENT = None
class register(object):
def __init__(self):
self.fns = {}
@classmethod
def init(cls, fn):
return register().for_db("*")(fn)
... |
edcast-inc/edx-platform-edcast | refs/heads/master | lms/djangoapps/open_ended_grading/staff_grading.py | 192 | """
LMS part of instructor grading:
- views + ajax handling
- calls the instructor grading service
"""
import logging
log = logging.getLogger(__name__)
class StaffGrading(object):
"""
Wrap up functionality for staff grading of submissions--interface exposes get_html, ajax views.
"""
def __init__(s... |
AnhellO/DAS_Sistemas | refs/heads/development | Ago-Dic-2017/Enrique Castillo/Ordinario/test/Lib/site-packages/django/contrib/gis/gdal/prototypes/srs.py | 88 | from ctypes import POINTER, c_char_p, c_int, c_void_p
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (
const_string_output, double_output, int_output, srs_output, string_output,
void_output,
)
# Shortcut generation for routines with known... |
gdbdzgd/namebench | refs/heads/master | nb_third_party/jinja2/sandbox.py | 284 | # -*- coding: utf-8 -*-
"""
jinja2.sandbox
~~~~~~~~~~~~~~
Adds a sandbox layer to Jinja as it was the default behavior in the old
Jinja 1 releases. This sandbox is slightly different from Jinja 1 as the
default behavior is easier to use.
The behavior can be changed by subclassing the environm... |
adammenges/statsmodels | refs/heads/master | docs/source/plots/graphics_boxplot_beanplot.py | 44 | # -*- coding: utf-8 -*-
"""
Created on Fri May 04 00:22:40 2012
Author: Ralf Gommers
"""
import numpy as np
import matplotlib.pyplot as plt
import statsmodels.api as sm
data = sm.datasets.anes96.load_pandas()
party_ID = np.arange(7)
labels = ["Strong Democrat", "Weak Democrat", "Independent-Democrat",
"In... |
elventear/ansible | refs/heads/devel | lib/ansible/modules/network/junos/junos_netconf.py | 8 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
jeremiahyan/odoo | refs/heads/master | addons/sale_expense/__manifest__.py | 1 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Sales Expense',
'version': '1.0',
'category': 'Sales/Sales',
'summary': 'Quotation, Sales Orders, Delivery & Invoicing Control',
'description': """
Reinvoice Employee Expense
==============... |
muffl0n/ansible | refs/heads/devel | contrib/inventory/zone.py | 138 | #!/usr/bin/env python
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
#
# 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
# ... |
iulian787/spack | refs/heads/develop | var/spack/repos/builtin/packages/valgrind/package.py | 3 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import glob
import sys
class Valgrind(AutotoolsPackage, SourcewarePackage):
"""An instrumentatio... |
Jayflux/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/sslutils/pregenerated.py | 470 | class PregeneratedSSLEnvironment(object):
"""SSL environment to use with existing key/certificate files
e.g. when running on a server with a public domain name
"""
ssl_enabled = True
def __init__(self, logger, host_key_path, host_cert_path,
ca_cert_path=None):
self._ca_cert... |
puppies/fl2440 | refs/heads/master | linux-3.10.33/scripts/tracing/draw_functrace.py | 14679 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... |
srimai/odoo | refs/heads/8.0 | addons/website/models/website.py | 53 | # -*- coding: utf-8 -*-
import cStringIO
import contextlib
import datetime
import hashlib
import inspect
import logging
import math
import mimetypes
import unicodedata
import os
import re
import time
import urlparse
from PIL import Image
from sys import maxint
import werkzeug
# optional python-slugify import (https:/... |
RickyCook/DockCI | refs/heads/master | tests/db/api/test_job_api_db.py | 2 | """ Test ``dockci.api.jwt`` against the DB """
import json
import pytest
def job_url_for(job):
""" Job API URL for the given job """
return '/api/v1/projects/{project}/jobs/{job}'.format(
project=job.project.slug,
job=job.slug,
)
def stage_url_for(stage):
""" Stage API URL for the gi... |
mainglis/adminpanel | refs/heads/master | nextgensbl/users2/urls.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.views.generic import TemplateView
from django.conf.urls import url, patterns
from . import views
# urlpatterns = patterns('',
# url(r'^$', TemplateView.as_view(template_name='base.html')),
# )
urlpatterns = [
url(r'... |
devdelay/home-assistant | refs/heads/dev | tests/components/test_init.py | 4 | """The testd for Core components."""
# pylint: disable=protected-access,too-many-public-methods
import unittest
from unittest.mock import patch
from tempfile import TemporaryDirectory
import yaml
import homeassistant.core as ha
from homeassistant import config
from homeassistant.const import (
STATE_ON, STATE_OFF... |
keybar/keybar | refs/heads/master | src/keybar/tests/helpers.py | 1 | import errno
import socket
import pytest
from django.db import connections
from django.test.testcases import LiveServerThread as LiveServerThreadBase
from pytest_django.live_server_helper import parse_addr
from tornado import ioloop
from urllib3.util.url import parse_url
from keybar.client import LocalClient
from key... |
triplekiller/code-snippet | refs/heads/master | python/decorator.py | 2 | #!/usr/bin/env python3
# Decorator: function wrappers that are run when the python interpreter loads
# the function, and can modify what the function receives and returns.
from time import sleep
from functools import wraps
import logging
logging.basicConfig()
log = logging.getLogger("retry")
def retry(f):
@wrap... |
sherazkasi/SabreSoftware | refs/heads/master | Lib/site-packages/numpy/distutils/command/build_scripts.py | 100 | """ Modified version of build_scripts that handles building scripts from functions.
"""
from distutils.command.build_scripts import build_scripts as old_build_scripts
from numpy.distutils import log
from numpy.distutils.misc_util import is_string
class build_scripts(old_build_scripts):
def generate_scripts(self,... |
hydrospanner/DForurm | refs/heads/master | DForurm/env/Lib/site-packages/django/contrib/gis/db/backends/oracle/models.py | 111 | """
The GeometryColumns and SpatialRefSys models for the Oracle spatial
backend.
It should be noted that Oracle Spatial does not have database tables
named according to the OGC standard, so the closest analogs are used.
For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns
model and the `SDO_... |
rezib/cloubed | refs/heads/master | cloubed/DomainEvent.py | 1 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright 2013 Rémi Palancher
#
# This file is part of Cloubed.
#
# Cloubed 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 Lice... |
mozilla/make.mozilla.org | refs/heads/master | make_mozilla/core/fields.py | 1 | from django.core.exceptions import SuspiciousOperation
from django.core.files.base import ContentFile
from django.db import models
from django.db.models.fields import files
from PIL import Image
from os import path
import cStringIO
import make_mozilla
from south.modelsinspector import add_introspection_rules
add_intro... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.