repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
muhammad-ammar/mongoengine | refs/heads/master | mongoengine/python_support.py | 28 | """Helper functions and types to aid with Python 2.5 - 3 support."""
import sys
import pymongo
if pymongo.version_tuple[0] < 3:
IS_PYMONGO_3 = False
else:
IS_PYMONGO_3 = True
PY3 = sys.version_info[0] == 3
if PY3:
import codecs
from io import BytesIO as StringIO
# return s converted to binary.... |
sysadminmatmoz/odoo-clearcorp | refs/heads/8.0 | pos_price_confirm/__init__.py | 6 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... |
mahiso/poloniexlendingbot | refs/heads/master | docs/conf.py | 6 | # -*- coding: utf-8 -*-
#
# Poloniexlendingbot documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 11 16:56:46 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated ... |
camradal/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_host_pm.py | 15 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, 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
#... |
kracekumar/drf_tada | refs/heads/master | drf_tada/settings.py | 2 | """
Django settings for drf_tada project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... |
mbohlool/client-python | refs/heads/master | kubernetes/client/models/v1beta1_replica_set_condition.py | 1 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... |
qsnake/gpaw | refs/heads/master | gpaw/test/lrtddft.py | 1 | import os
from ase import Atom, Atoms
from gpaw import GPAW
from gpaw.test import equal
from gpaw.lrtddft import LrTDDFT
from gpaw.mpi import world
txt='-'
txt='/dev/null'
io_only=False
#io_only=True
load=False
#load=True
if not io_only:
R=0.7 # approx. experimental bond length
a = 3.0
c = 4.0
H2 = At... |
mapineda/litecoin | refs/heads/master-0.10 | qa/rpc-tests/mempool_spendcoinbase.py | 149 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test spending coinbase transactions.
# The coinbase transaction in block N can appear in block
# N+100... ... |
nvbn/coviolations_web | refs/heads/develop | violations/tests/test_jslint.py | 1 | import sure
from django.test import TestCase
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from ..jslint import jslint_violation
from .base import get_content
class JSlintViolationCase(TestCase):
"""JSlint violation case"""
def test_success(self):
"""Test success result"""
data = {'ra... |
lasalesi/erpnext | refs/heads/develop | erpnext/setup/setup_wizard/test_setup_wizard.py | 30 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.setup.setup_wizard.test_setup_data import args
from frappe.desk.page.setup_wizard.setup_wizard import setup_complete
import ... |
WeitBelou/technotrack-web1-spring-2017 | refs/heads/master | core/admin.py | 1 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from .models import User
class UserAdmin(BaseUserAdmin):
fieldsets = BaseUserAdmin.fieldsets + (
(u'Дополнительно', {'fields': ('admin_avatar', 'avatar', 'rating')}),
)
readonly_fields = ('admin_ava... |
stefanv/aandete | refs/heads/master | app/lib/packaging/version.py | 1151 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... |
baby5/Django-httpbin | refs/heads/master | httpbin/bin/helpers.py | 1 | from functools import wraps
import json
from django.http import JsonResponse, HttpResponseNotAllowed
from django.utils.decorators import available_attrs
def methods(method_list):
def decorator(func):
@wraps(func, assigned=available_attrs(func))
def inner(request, *args, **kw):
if requ... |
mccarrion/python-practice | refs/heads/master | effective_python/chapter01/item_13.py | 1 | handle = open('random_data.txt')
try:
data = handle.read()
finally:
handle.close()
|
tkelman/utf8rewind | refs/heads/master | tools/gyp/test/no-output/gyptest-no-output.py | 349 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verified things don't explode when there are targets without outputs.
"""
import TestGyp
# TODO(evan): in ninja when there are no targ... |
dayutianfei/impala-Q | refs/heads/master | thirdparty/thrift-0.9.0/lib/py/src/protocol/TProtocol.py | 30 | #
# 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... |
mansilladev/zulip | refs/heads/master | zerver/lib/statistics.py | 116 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from zerver.models import UserProfile, UserActivity, UserActivityInterval, Message
from django.utils.timezone import utc
from datetime import timedelta
from itertools import chain
def median(data):
data = sorted(data)
size = len(data)
if si... |
XXMrHyde/android_external_chromium_org | refs/heads/darkkat-4.4 | chrome/common/extensions/docs/server2/fake_fetchers.py | 23 | # 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.
# These are fake fetchers that are used for testing and the preview server.
# They return canned responses for URLs. appengine_wrappers.py uses the fake
... |
cgstudiomap/cgstudiomap | refs/heads/develop | main/parts/odoo/addons/website_crm/__openerp__.py | 321 | {
'name': 'Contact Form',
'category': 'Website',
'website': 'https://www.odoo.com/page/website-builder',
'summary': 'Create Leads From Contact Form',
'version': '1.0',
'description': """
OpenERP Contact Form
====================
""",
'author': 'OpenERP SA',
'depends': ['website_... |
ajayuranakar/django-blog | refs/heads/master | lib/python2.7/site-packages/pip/vendor/html5lib/trie/py.py | 80 | from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError(... |
blacklin/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/concurrent/futures/thread.py | 93 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ThreadPoolExecutor."""
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
import atexit
from concurrent.futures import _base
import queue
import threading
import weakref
# Workers are created as daemon... |
rockneurotiko/django | refs/heads/master | django/conf/locale/is/formats.py | 578 | # -*- 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'
# DAT... |
hujiajie/pa-chromium | refs/heads/master | third_party/closure_linter/closure_linter/common/filetestcase.py | 135 | #!/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
#... |
Limags/MissionPlanner | refs/heads/master | Lib/lib2to3/btm_matcher.py | 61 | """A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of no... |
hainm/statsmodels | refs/heads/master | statsmodels/robust/scale.py | 29 | """
Support and standalone functions for Robust Linear Models
References
----------
PJ Huber. 'Robust Statistics' John Wiley and Sons, Inc., New York, 1981.
R Venables, B Ripley. 'Modern Applied Statistics in S'
Springer, New York, 2002.
"""
from statsmodels.compat.python import callable, range
import numpy as n... |
fffy2366/image-processing | refs/heads/master | nude.py | 1 | #!/usr/bin/env python
# encoding: utf-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import copy
import math
import sys
import time
from collections import namedtuple
from PIL import Image
import matplotlib.path as mplPath
import numpy as np
def is_nude... |
dharmabumstead/ansible | refs/heads/devel | lib/ansible/modules/clustering/openshift/_oc.py | 58 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Kenneth D. Evensen <kevensen@redhat.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_versio... |
marosi/SocialDesktopClient | refs/heads/master | plugins/buddycloud/3rdparty/swift/3rdParty/SCons/scons-local-2.0.0.final.0/SCons/Tool/masm.py | 34 | """SCons.Tool.masm
Tool-specific initialization for the Microsoft Assembler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The S... |
dpassante/ansible | refs/heads/devel | lib/ansible/playbook/attribute.py | 68 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) an... |
cpyou/odoo | refs/heads/master | openerp/addons/test_workflow/tests/test_workflow.py | 392 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.tests import common
class test_workflows(common.TransactionCase):
def check_activities(self, model_name, i, names):
""" Check that the record i has workitems in the given activity names.
"""
instance = se... |
hynnet/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/bsddb/test/test_thread.py | 41 | """TestCases for multi-threaded access to a DB.
"""
import os
import sys
import time
import errno
from random import random
DASH = '-'
try:
WindowsError
except NameError:
class WindowsError(Exception):
pass
import unittest
from test_all import db, dbutils, test_support, verbose, have_threads, \
... |
campbe13/openhatch | refs/heads/master | vendor/packages/Django/django/utils/unittest/collector.py | 572 | import os
import sys
from django.utils.unittest.loader import defaultTestLoader
def collector():
# import __main__ triggers code re-execution
__main__ = sys.modules['__main__']
setupDir = os.path.abspath(os.path.dirname(__main__.__file__))
return defaultTestLoader.discover(setupDir)
|
DEVELByte/incubator-airflow | refs/heads/master | tests/dags/test_scheduler_dags.py | 58 | # -*- coding: utf-8 -*-
#
# 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, software
... |
0k/kids.common | refs/heads/master | src/kids/__init__.py | 916 | # See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
try:
__import__('pkg_resources').declare_namespace(__name__)
except ImportError:
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
|
negar-rostamzadeh/GroundHog | refs/heads/master | scripts/binarize-phrase-table.py | 8 | #!/usr/bin/env python
# Converts moses phrase table file to HDF5 files
# Written by Bart van Merrienboer (University of Montreal)
import argparse
import cPickle
import gzip
import sys
import tables
import numpy
parser = argparse.ArgumentParser()
parser.add_argument("input",
type=argparse.FileTy... |
Venturi/cms | refs/heads/master | env/lib/python2.7/site-packages/cms/models/metaclasses.py | 67 | # -*- coding: utf-8 -*-
from cms.publisher.manager import PublisherManager
from django.db.models.base import ModelBase
class PageMetaClass(ModelBase):
def __new__(cls, name, bases, attrs):
super_new = super(PageMetaClass, cls).__new__
if 'objects' in attrs:
if not isinstance(attrs['ob... |
unho/pootle | refs/heads/master | pytest_pootle/fixtures/models/permission.py | 10 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
@pytest.fixture(scope="sessi... |
abhishekgahlot/kivy | refs/heads/master | examples/tutorials/pong/steps/step4/main.py | 57 | from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ReferenceListProperty,\
ObjectProperty
from kivy.vector import Vector
from kivy.clock import Clock
from random import randint
class PongBall(Widget):
velocity_x = NumericProperty(0)
velocity_y = Numeri... |
meteotest/hurray-py | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
import io
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from hurraypy import __version__
with io.open('README.rst', encoding='utf-8') as f:
long_description = f.read()
setup(
name='hurraypy',
version=__version__,
description='P... |
clumsy/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/UsedUnresolvedNameImportedSeveralTimes/my_package/my_module.py | 240 | def my_func():
pass |
XileForce/Vindicator-S6-Uni-Old | refs/heads/master | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
batxes/4c2vhic | refs/heads/master | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models47597.py | 2 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... |
retoomey/WDSS2Python | refs/heads/master | w2py/netcdf/sci_netcdf_reader.py | 1 | """
Scientific Python Netcdf Reader class file
This reader uses the Scientific Python library to access a netcdf file.
This isn't installed in arcgis python by default, but this class is faster.
@author: Robert Toomey (retoomey)
"""
import Scientific.IO.NetCDF
from w2py import log
import netcdf_reader
... |
Ebag333/Pyfa | refs/heads/master | eos/effects/freightercargobonusa2.py | 2 | # freighterCargoBonusA2
#
# Used by:
# Variations of ship: Providence (2 of 2)
type = "passive"
def handler(fit, ship, context):
fit.ship.boostItemAttr("capacity", ship.getModifiedItemAttr("freighterBonusA2"), skill="Amarr Freighter")
|
stestagg/mu | refs/heads/master | mu/modes/base.py | 1 | """
Contains the base classes for Mu editor modes.
Copyright (c) 2015-2017 Nicholas H.Tollervey and others (see the AUTHORS file).
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of... |
ucldc/ucldc-merritt | refs/heads/master | ramicova_debug.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pynux import utils
from os.path import expanduser
import collections
import pprint
pp = pprint.PrettyPrinter(indent=4)
CHILD_NXQL = "SELECT * FROM Document WHERE ecm:parentId = '{}' AND " \
"ecm:isTrashed = 0 ORDER BY ecm:pos"
nx = utils.Nuxeo(rcfile=o... |
c-o-m-m-a-n-d-e-r/CouchPotatoServer | refs/heads/master | libs/xmpp/session.py | 199 | ##
## XMPP server
##
## Copyright (C) 2004 Alexey "Snake" Nezhdanov
##
## 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 option)
## any later version.
... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | addons/plugin/plugin_handler.py | 39 | '''
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... |
bjoshua/ansible | refs/heads/devel | v1/tests/TestFilters.py | 107 | '''
Test bundled filters
'''
import os.path
import unittest, tempfile, shutil
from ansible import playbook, inventory, callbacks
import ansible.runner.filter_plugins.core
import ansible.runner.filter_plugins.mathstuff
INVENTORY = inventory.Inventory(['localhost'])
BOOK = '''
- hosts: localhost
vars:
var: { a: ... |
ininex/geofire-python | refs/heads/master | resource/lib/python2.7/site-packages/future/builtins/misc.py | 79 | """
A module that brings in equivalents of various modified Python 3 builtins
into Py2. Has no effect on Py3.
The builtin functions are:
- ``ascii`` (from Py2's future_builtins module)
- ``hex`` (from Py2's future_builtins module)
- ``oct`` (from Py2's future_builtins module)
- ``chr`` (equivalent to ``unichr`` on Py... |
danielneis/osf.io | refs/heads/develop | tests/test_transactions.py | 58 | # -*- coding: utf-8 -*-
import logging
import mock
import webtest_plus
import unittest
from nose.tools import * # noqa
from tests.base import DbTestCase
from flask import make_response
from pymongo.errors import CollectionInvalid, OperationFailure
from framework.flask import add_handlers
from framework.mongo impor... |
fly19890211/edx-platform | refs/heads/master | common/djangoapps/embargo/models.py | 53 | """
Models for embargoing visits to certain courses by IP address.
WE'RE USING MIGRATIONS!
If you make changes to this model, be sure to create an appropriate migration
file and check it in at the same time as your model changes. To do that,
1. Go to the edx-platform dir
2. ./manage.py lms schemamigration embargo --... |
openearth/delft3d-gt-server | refs/heads/develop | delft3dcontainermanager/test_tasks.py | 1 | from __future__ import absolute_import
import os
import sys
from time import time
from django.test import TestCase
from fakeredis import FakeStrictRedis
from mock import MagicMock, Mock, patch
from delft3dcontainermanager.tasks import (
delft3dgt_kube_pulse,
do_argo_create,
do_argo_remove,
do_argo_st... |
eoneil1942/voltdb-4.7fix | refs/heads/master | tests/testrunner-ng/testsupport/__init__.py | 2 | # This file is part of VoltDB.
# Copyright (C) 2008-2014 VoltDB 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, c... |
AltSchool/django | refs/heads/master | django/utils/lorem_ipsum.py | 505 | """
Utility functions for generating "lorem ipsum" Latin text.
"""
from __future__ import unicode_literals
import random
COMMON_P = (
'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod '
'tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim '
'veniam, quis nostrud e... |
access-missouri/am-django-project | refs/heads/master | am/am/urls.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# flake8: noqa
"""
am URL Configuration.
"""
from django.conf.urls import url, include
from django.contrib import admin
from general.views import HomePageView, PersonVotesListView, PersonDetailView, PeopleHomeView
from legislative.views import BillDetailView, VoteDetailVie... |
caktus/rapidsms-reports | refs/heads/master | runtests.py | 1 | #!/usr/bin/env python
import optparse
import sys
from django.conf import settings
if not settings.configured:
settings.configure(
DATABASES={
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
},
HEALTHCARE_ST... |
amcgee/pymomo | refs/heads/master | pymomo/config/site_scons/utilities.py | 2 | #utilities.py
from SCons.Script import *
from SCons.Environment import Environment
import os
import fnmatch
import json as json
import sys
import os.path
import pic12
import StringIO
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from pymomo.utilities import build
from pymomo.mib.config12 import MIB1... |
wengyian/project-manager-system | refs/heads/master | node_modules/.3.6.0@node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | # Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... |
sam-tsai/django-old | refs/heads/master | django/contrib/comments/feeds.py | 310 | from django.conf import settings
from django.contrib.syndication.views import Feed
from django.contrib.sites.models import Site
from django.contrib import comments
from django.utils.translation import ugettext as _
class LatestCommentFeed(Feed):
"""Feed of latest comments on the current site."""
def title(sel... |
havard024/prego | refs/heads/master | venv/lib/python2.7/site-packages/django/conf/locale/gl/formats.py | 231 | # -*- 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 = r'j \d\e F \d\e Y'
TIME_FORMAT = '... |
goddino/libjingle | refs/heads/master | trunk/tools/gyp/test/actions-none/src/fake_cross.py | 332 | #!/usr/bin/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.
import sys
fh = open(sys.argv[-1], 'wb')
for filename in sys.argv[1:-1]:
fh.write(open(filename).read())
fh.close()
|
PandaPayProject/PandaPay | refs/heads/master | contrib/qt_translations.py | 1 | #!/usr/bin/env python
# Helpful little script that spits out a comma-separated list of
# language codes for Qt icons that should be included
# in binary PandaPay Core distributions
import glob
import os
import re
import sys
if len(sys.argv) != 3:
sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%s... |
rubinius/rubinius-benchmark | refs/heads/master | yarv/other-lang/fib.py | 26 | def fib(n):
if n < 3:
return 1
else:
return fib(n-1) + fib(n-2)
fib(34)
|
sofianehaddad/ot-svn | refs/heads/master | python/test/t_Gamma_std.py | 2 | #! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator.SetSeed(0)
try:
allDistributions = [Gamma(1.5, 2.5, -0.5), Gamma(15.0, 2.5)]
for n in range(len(allDistributions)):
distribution = allDistributions[n]
print "Distribution ", distribution
# Is this distribut... |
eonpatapon/nova | refs/heads/master | nova/openstack/common/report/models/__init__.py | 82 | # Copyright 2013 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... |
sinomiko/project | refs/heads/master | django_project/test_mode/testdb.py | 1 | # -*- coding: utf-8 -*-
from django.http import HttpResponse
from test_model.models import *
# 数据库操作
def testdb(request):
test1 = Test(name='w3cschool.cc')
test1.save()
return HttpResponse("<p>数据添加成功!</p>") |
robertjpayne/rethinkdb | refs/heads/next | test/common/http_support/werkzeug/local.py | 147 | # -*- coding: utf-8 -*-
"""
werkzeug.local
~~~~~~~~~~~~~~
This module implements context-local objects.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrapper
from werkzeug.wsgi import ClosingIt... |
dlorenc/runtimes-common | refs/heads/master | testing/lib/example/example_test.py | 5 | # Copyright 2017 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 ag... |
tempbottle/ironpython3 | refs/heads/master | Src/Scripts/test_cgcheck.py | 3 | #####################################################################################
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of t... |
dan-sw/linux-v2.6.38.8-dan3400 | refs/heads/master | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
jobiols/odoomrp-wip | refs/heads/8.0 | sale_order_recalculate_prices_variants/models/__init__.py | 11 | # -*- coding: utf-8 -*-
##############################################################################
#
# 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 L... |
osmanbaskaya/algorithm-implementation | refs/heads/master | algorithm/sort.py | 1 | import numpy as np
from random import randint
import sys
from data_structure.heap import Heap
import math
def insertion_sort(array):
"""
In-place insertion sort
"""
length = len(array)
for i in range(1, length):
# [i-1, i-2, ..., 0]
index = i
e = array[index]
for j... |
yayraj/basic-python-programs | refs/heads/master | elementary/1-7-multiplication-tables.py | 1 | # Although I'm still solving elementary problems, I strongly feel that writing a function will make sense for such a problem :)
def table(num):
for i in range(1, 11):
ans = i * num
print(num, "x", i, "=", ans)
# let's loop through the function calls as well :)
for i in range(1, 13):
table(i) |
slevenhagen/odoo | refs/heads/8.0 | 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... |
alrusdi/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/regressiontests/decorators/tests.py | 47 | from sys import version_info
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.4 fallback.
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
from django.contrib.admin.views.decorators import staff_member_req... |
cwisecarver/osf.io | refs/heads/develop | api/registrations/views.py | 1 | from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import ValidationError, NotFound
from framework.auth.oauth_scopes import CoreScopes
from modularodm import Q
from osf.models import AbstractNode as Node
from api.base import permissions as base_permissions
from api.base.... |
FHannes/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/docstringArgsAndKwargs.py | 83 | def f1(foo, bar, *args):
"""
:param foo: resolves to foo
:param baz: resolves to *args
"""
pass
def f2(foo, bar, **kwargs):
"""
:param foo: resolves to foo
:param baz: resolves to **kwargs
"""
pass
|
deadman96385/android_kernel_leeco_msm8996 | refs/heads/cm-14.1 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
daniponi/django | refs/heads/master | django/contrib/gis/geoip/prototypes.py | 535 | from ctypes import POINTER, Structure, c_char_p, c_float, c_int, string_at
from django.contrib.gis.geoip.libgeoip import free, lgeoip
# #### GeoIP C Structure definitions ####
class GeoIPRecord(Structure):
_fields_ = [('country_code', c_char_p),
('country_code3', c_char_p),
('cou... |
quentinsf/ansible | refs/heads/devel | contrib/inventory/abiquo.py | 128 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
External inventory script for Abiquo
====================================
Shamelessly copied from an existing inventory script.
This script generates an inventory that Ansible can understand by making API requests to Abiquo API
Requires some python libraries, ensure ... |
imoseyon/leanKernel-d2usc-deprecated | refs/heads/lk-tw | external/webkit/Tools/Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py | 15 | # Copyright (C) 2010 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 conditions and the ... |
meilinxiaoxue/diaphora | refs/heads/master | pygments/lexers/actionscript.py | 47 | # -*- coding: utf-8 -*-
"""
pygments.lexers.actionscript
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for ActionScript and MXML.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, bygroups, using,... |
dimagol/trex-core | refs/heads/master | scripts/external_libs/nose-1.3.4/python3/nose/plugins/deprecated.py | 107 | """
This plugin installs a DEPRECATED error class for the :class:`DeprecatedTest`
exception. When :class:`DeprecatedTest` is raised, the exception will be logged
in the deprecated attribute of the result, ``D`` or ``DEPRECATED`` (verbose)
will be output, and the exception will not be counted as an error or failure.
It ... |
Lektorium-LLC/edx-platform | refs/heads/master | openedx/core/djangoapps/theming/management/__init__.py | 61 | """
Management commands related to Comprehensive Theming.
"""
|
watonyweng/nova | refs/heads/master | nova/virt/libvirt/volume/hgst.py | 5 | # Copyright 2015 HGST
# 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 applicab... |
aljscott/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/botinfo_unittest.py | 121 | # Copyright (c) 2011 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 conditions and the ... |
camptocamp/ngo-addons-backport | refs/heads/master | addons/portal_project_long_term/__init__.py | 51 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... |
mats116/ElasticBigQuery | refs/heads/master | boilerplate/external/babel/messages/__init__.py | 67 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software cons... |
molobrakos/home-assistant | refs/heads/master | tests/components/ring/test_init.py | 12 | """The tests for the Ring component."""
from copy import deepcopy
import os
import unittest
import requests_mock
from homeassistant import setup
import homeassistant.components.ring as ring
from tests.common import (
get_test_config_dir, get_test_home_assistant, load_fixture)
ATTRIBUTION = 'Data provided by Ring... |
aviciimaxwell/odoo | refs/heads/8.0 | addons/board/controllers.py | 348 | # -*- coding: utf-8 -*-
from xml.etree import ElementTree
from openerp.addons.web.controllers.main import load_actions_from_ir_values
from openerp.http import Controller, route, request
class Board(Controller):
@route('/board/add_to_dashboard', type='json', auth='user')
def add_to_dashboard(self, menu_id, act... |
Mystic-Mirage/android_kernel_gigabyte_roma_r2_plus | refs/heads/master | tools/perf/scripts/python/net_dropmonitor.py | 1258 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... |
turbokongen/home-assistant | refs/heads/dev | tests/components/zwave_js/test_init.py | 1 | """Test the Z-Wave JS init module."""
from copy import deepcopy
from unittest.mock import patch
import pytest
from zwave_js_server.model.node import Node
from homeassistant.components.hassio.handler import HassioAPIError
from homeassistant.components.zwave_js.const import DOMAIN
from homeassistant.components.zwave_js... |
CydarLtd/ansible | refs/heads/devel | lib/ansible/modules/utilities/logic/set_fact.py | 50 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Dag Wieers <dag@wieers.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 Lice... |
afrolov1/nova | refs/heads/master | nova/openstack/common/context.py | 25 | # Copyright 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 req... |
scality/cinder | refs/heads/master | cinder/tests/unit/api/extensions/foxinsocks.py | 30 | # Copyright 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 requ... |
andrewAsdf/meerkat-webclient | refs/heads/master | example/test_server.py | 1 | # This is an example server. It is also used to test the client bot.
from flask import Flask
from flask import request
from flask import Response
app = Flask(__name__)
@app.route('/', methods=['GET'])
def index():
return 'MeerkatWebClient test webservice'
@app.route('/holecards', methods=['POST'])
def hole_car... |
supertree-toolkit/stk | refs/heads/master | stk_gui/stk_gui/sliceview.py | 7 | #!/usr/bin/env python
# This file is part of Diamond.
#
# Diamond 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.
#
# ... |
xiangshouding/nv | refs/heads/master | node/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/bbcode.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.formatters.bbcode
~~~~~~~~~~~~~~~~~~~~~~~~~~
BBcode formatter.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt
__al... |
jmerkow/VTK | refs/heads/master | ThirdParty/Twisted/twisted/web/_auth/__init__.py | 86 | # -*- test-case-name: twisted.web.test.test_httpauth -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
HTTP header-based authentication migrated from web2
"""
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.