repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
mysociety/fixmytransport | refs/heads/master | script/domain-analysis/analyse-domains.py | 1 | #!/usr/bin/python
# This script finds the first problem report from each unique email
# address, and classifies it according to whether it was confirmed or
# unconfirmed. It outputs a CSV file that groups these results by
# domain, tell you how many confirmed emails, bounced emails and
# neither-confirmed-nor-bounced... |
fzheng/codejam | refs/heads/master | lib/python2.7/site-packages/ipyparallel/controller/dictdb.py | 1 | """A Task logger that presents our DB interface,
but exists entirely in memory and implemented with dicts.
TaskRecords are dicts of the form::
{
'msg_id' : str(uuid),
'client_uuid' : str(uuid),
'engine_uuid' : str(uuid) or None,
'header' : dict(header),
'content': dict(con... |
anandsimmy/ecommerce | refs/heads/master | src/oscar/apps/dashboard/users/app.py | 10 | from django.conf.urls import url
from oscar.core.application import DashboardApplication
from oscar.core.loading import get_class
class UserManagementApplication(DashboardApplication):
name = None
default_permissions = ['is_staff', ]
index_view = get_class('dashboard.users.views', 'IndexView')
user_... |
justathoughtor2/atomicApe | refs/heads/encaged | cygwin/lib/python2.7/site-packages/docutils/readers/pep.py | 136 | # $Id: pep.py 7320 2012-01-19 22:33:02Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Python Enhancement Proposal (PEP) Reader.
"""
__docformat__ = 'reStructuredText'
from docutils.readers import standalone
from docutils.transforms import pep... |
xuxiaoxin/micropython | refs/heads/master | tests/basics/seq_unpack.py | 111 | # Basics
a, b = 1, 2
print(a, b)
a, b = (1, 2)
print(a, b)
(a, b) = 1, 2
print(a, b)
(a, b) = (1, 2)
print(a, b)
# Tuples/lists are optimized
a, b = [1, 2]
print(a, b)
[a, b] = 100, 200
print(a, b)
# optimised 3-way swap
a = 1
b = 2
c = 3
a, b, c = b, c, a
print(a, b, c)
try:
a, b, c = (1, 2)
except ValueError:
... |
gauravbose/digital-menu | refs/heads/master | digimenu2/django/utils/functional.py | 36 | import copy
import operator
import sys
import warnings
from functools import wraps
from django.utils import six
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.six.moves import copyreg
# You can't trivially replace this with `functools.partial` because this binds
# to classes and retu... |
Bysmyyr/chromium-crosswalk | refs/heads/master | tools/perf/metrics/cpu_unittest.py | 69 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
from metrics import cpu
# Testing private method.
# pylint: disable=W0212
class CpuMetricTest(unittest.TestCase):
def testSubtractCpuStat... |
mgaleae/android_kernel_samsung_smdk4412_utouch | 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,... |
disperse/ripping-yarns | refs/heads/master | module_system-1.166/process_dialogs.py | 1 | import string
import types
from module_info import *
from module_triggers import *
from module_dialogs import *
from process_common import *
from process_operations import *
speaker_pos = 0
ipt_token_pos = 1
sentence_conditions_pos = 2
text_pos = 3
opt_token_pos = 4
sentence_consequences_pos = 5
sentence_voice_over... |
GheRivero/ansible | refs/heads/devel | lib/ansible/plugins/action/ce.py | 24 | #
# (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
# (at your option) any later version.
#
# Ansible is d... |
maxdeliso/elevatorSim | refs/heads/master | Lib/test/json_tests/test_indent.py | 60 | import textwrap
from io import StringIO
from test.json_tests import PyTest, CTest
class TestIndent:
def test_indent(self):
h = [['blorpie'], ['whoops'], [], 'd-shtaeou', 'd-nthiouh', 'i-vhbjkhnth',
{'nifty': 87}, {'field': 'yes', 'morefield': False} ]
expect = textwrap.dedent("""\
... |
hell-sing/hacker-rank | refs/heads/master | Python/Strings/String_Split_and_Join.py | 2 | def split_and_join(line):
# write your code here
line = line.split(" ")
line = "-".join(line)
return line |
pombreda/sulley | refs/heads/master | unit_tests/primitives.py | 6 | from sulley import *
def run ():
signed_tests()
string_tests()
fuzz_extension_tests()
# clear out the requests.
blocks.REQUESTS = {}
blocks.CURRENT = None
########################################################################################################################
de... |
danmcp/origin | refs/heads/master | vendor/k8s.io/kubernetes/hack/lookup_pull.py | 194 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
benpatterson/edx-platform | refs/heads/master | cms/urls.py | 2 | from django.conf import settings
from django.conf.urls import patterns, include, url
# There is a course creators admin table.
from ratelimitbackend import admin
admin.autodiscover()
# pylint: disable=bad-continuation
# Pattern to match a course key or a library key
COURSELIKE_KEY_PATTERN = r'(?P<course_key_string>(... |
tranx/pyffmpeg | refs/heads/master | examples/playvideo_qt_alsa.py | 1 | # -*- coding: utf-8 -*-
## Simple demo for pyffmpegb
##
## Copyright -- Bertrand Nouvel 2009
## import your modules
from pyffmpeg import *
from PyQt4 import QtCore
from PyQt4 import QtGui
import sys, numpy, time
import alsaaudio
try:
LazyDisplayQt__imgconvarray={
1:QtGui.QImage.Format_In... |
nervous-laughter/qiime2 | refs/heads/master | qiime2/core/type/grammar.py | 3 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2017, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... |
canaryhealth/jstc | refs/heads/master | jstc/engines/base.py | 1 | # -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# file: $Id$
# auth: Philip J Grabner <phil@canary.md>
# date: 2016/09/12
# copy: (C) Copyright 2016-EOT Canary Health, Inc., All Rights Reserved.
#--------------------------------------------------------------------... |
imapp-pl/golem | refs/heads/develop | tests/golem/environments/test_environments_manager.py | 3 | import unittest
from golem.environments.environmentsmanager import EnvironmentsManager
from golem.environments.environment import Environment
import logging
logger = logging.getLogger(__name__)
class TestEnvironmentsManager(unittest.TestCase):
def test_get_environment_by_id(self):
em = EnvironmentsManag... |
cloudify-cosmo/cloudify-chef-plugin | refs/heads/master | chef_plugin/operations.py | 2 | ########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... |
Ednilsonpalhares/SCEFA | refs/heads/master | SCEFA/urls.py | 2 | from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf.urls import url,include
from django.contrib import admin
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'',include('appPonto.urls')),
url(r'', include('appAlunos.urls')),
url(r'', include('appPortas.urls')),
]
... |
Jionglun/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/test/test_re.py | 718 | # FIXME: brython: implement test.support
#from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \
# cpython_only
verbose = True
# FIXME: brython: Not used in this module ?
#import io
import re
# FIXME: brython: implement re.Scanner
#from re import Scanner
import sre_constants
import sys... |
cyx1231st/nova | refs/heads/eventually-consistent-host-state-mitaka | nova/api/openstack/compute/schemas/create_backup.py | 21 | # Copyright 2014 NEC Corporation. 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 ... |
Ideabin/Gist | refs/heads/master | gist.py | 1 | # -*- coding: utf-8 -*-
import sublime
import sublime_plugin
import os
import sys
import json
import functools
import webbrowser
import tempfile
import traceback
import threading
import shutil
PY3 = sys.version > '3'
if PY3:
from .request import *
from .settings import *
from .helpers import *
from .... |
youssef-emad/shogun | refs/heads/develop | applications/asp/signal_detectors.py | 26 | #
# 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.
#
# Written (W) 2006-2009 Soeren Sonnenburg
# Written (W) 2007 Gunnar ... |
TNT-Samuel/Coding-Projects | refs/heads/master | DNS Server/Source - Copy/Lib/site-packages/toolz/tests/test_compatibility.py | 28 | from toolz.compatibility import map, filter, iteritems, iterkeys, itervalues
def test_map_filter_are_lazy():
def bad(x):
raise Exception()
map(bad, [1, 2, 3])
filter(bad, [1, 2, 3])
def test_dict_iteration():
d = {'a': 1, 'b': 2, 'c': 3}
assert not isinstance(iteritems(d), list)
asse... |
FelixZYY/gyp | refs/heads/master | pylib/gyp/win_tool.py | 33 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... |
tchellomello/home-assistant | refs/heads/dev | homeassistant/components/ads/cover.py | 7 | """Support for ADS covers."""
import logging
import voluptuous as vol
from homeassistant.components.cover import (
ATTR_POSITION,
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
SUPPORT_CLOSE,
SUPPORT_OPEN,
SUPPORT_SET_POSITION,
SUPPORT_STOP,
CoverEntity,
)
from homeassistant.const import CONF... |
medunigraz/outpost | refs/heads/master | src/outpost/django/typo3/migrations/0004_auto_20170906_1021.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-06 08:21
from __future__ import unicode_literals
from django.db import migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('typo3', '0003_auto_20170818_1538'),
]
forward = [
... |
SlimRoms/kernel_motorola_ghost | refs/heads/lp5.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... |
pyocd/pyOCD | refs/heads/develop | pyocd/target/builtin/target_MK28FN2M0xxx15.py | 3 | # pyOCD debugger
# Copyright (c) 2016,2018 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
madslonnberg/blog | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/formatters/bbcode.py | 362 | # -*- coding: utf-8 -*-
"""
pygments.formatters.bbcode
~~~~~~~~~~~~~~~~~~~~~~~~~~
BBcode formatter.
:copyright: Copyright 2006-2013 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... |
dsajkl/123 | refs/heads/master | common/lib/xmodule/xmodule/open_ended_grading_classes/__init__.py | 248 | __author__ = 'vik'
|
nreimers/truecaser | refs/heads/master | EvaluateTruecaser.py | 1 | from Truecaser import *
import cPickle
import nltk
import string
def evaluateTrueCaser(testSentences, wordCasingLookup, uniDist, backwardBiDist, forwardBiDist, trigramDist):
correctTokens = 0
totalTokens = 0
for sentence in testSentences:
tokensCorrect = nltk.word_tokenize(sentence)
t... |
tempbottle/Rusthon | refs/heads/master | regtests/loop/yield.py | 2 | '''
generator function
'''
def fib(n:int) -> int:
int a = 0
int b = 1
int c = 0
for x in range(n):
#print('looping')
yield a
c = b
b = a+b
a = c
yield -1 ## signals end
def main():
arr = []int()
for n in fib(20):
#print(n)
arr.append( n )
TestError( arr[0]==0 )
TestError( arr[1]==1 )
TestE... |
tonioo/modoboa | refs/heads/master | modoboa/limits/constants.py | 1 | # -*- coding: utf-8 -*-
"""Modoboa limits constants."""
from __future__ import unicode_literals
import collections
from django.utils.translation import ugettext_lazy as _
DEFAULT_USER_LIMITS = collections.OrderedDict((
("domains", {
"content_type": "admin.domain", "label": _("Domains"),
"help":... |
marcwebbie/passpie | refs/heads/master | tests/test_clipboard.py | 3 | import pytest
from passpie import clipboard
def test_clipboard_on_osx_ensure_commands(mocker):
mocker.patch('passpie.clipboard.process.call')
mock_ensure_commands = mocker.patch('passpie.clipboard.ensure_commands')
commands = clipboard.OSX_COMMANDS
clipboard._copy_osx('text')
mock_ensure_comman... |
JianyuWang/neutron | refs/heads/master | neutron/extensions/l3.py | 25 | # Copyright 2012 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 by ... |
Rudde/pyroscope | refs/heads/master | pyroscope/pyroscope/controllers/error.py | 2 | import cgi
from paste.urlparser import PkgResourcesParser
from pylons import request
from pylons.controllers.util import forward
from pylons.middleware import error_document_template
from webhelpers.html.builder import literal
from pyroscope.lib.base import BaseController
class ErrorController(BaseController):
... |
rjeschmi/easybuild-easyblocks | refs/heads/master | easybuild/easyblocks/generic/binary.py | 3 | ##
# Copyright 2009-2013 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundation (htt... |
braams/shtoom | refs/heads/master | shtoom/ui/mfcui/__init__.py | 1 | # This file is necessary to make this directory a package
from main import *
|
sajuptpm/neutron-ipam | refs/heads/stable/icehouse | neutron/plugins/ml2/drivers/cisco/nexus/exceptions.py | 36 | # Copyright (c) 2013 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 ... |
practicalswift/bitcoin | refs/heads/master | contrib/verifybinaries/verify.py | 5 | #!/usr/bin/env python3
# Copyright (c) 2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Script for verifying Bitoin Core release binaries
This script attempts to download the signature file SHA25... |
wido/libcloud | refs/heads/trunk | libcloud/common/vultr.py | 29 | from libcloud.common.base import ConnectionKey, JsonResponse
__all__ = [
'API_HOST',
'VultrConnection',
'VultrException',
'VultrResponse',
]
# Endpoint for the Vultr API
API_HOST = 'api.vultr.com'
class VultrResponse(JsonResponse):
objects = None
error_dict = {}
errors = None
ERROR... |
mrpau/kolibri | refs/heads/develop | kolibri/core/auth/migrations/0010_auto_20180320_1320.py | 4 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.10 on 2018-03-20 20:20
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [("kolibriauth", "0009_auto_20180301_1123")]
operations = [
migration... |
nacelle/nacelle | refs/heads/master | nacelle/contrib/lockdown/dispatcher.py | 2 | """
Custom dispatcher for nacelle that implements lockdown support
"""
# marty mcfly imports
from __future__ import absolute_import
# stdlib imports
import re
# third-party imports
import webapp2
from nacelle.conf import settings
from nacelle.core.dispatcher import nacelle_dispatcher
# local imports
from .utils impo... |
vaaceves/repue-repositorio-universidad-empresa | refs/heads/master | home/forms.py | 1 | #importamos api forms desde django
from django import forms
from django.utils.text import slugify
from django.forms import ModelForm
#importamos los modelos
from models import Contenido
class FormCrearContenido(forms.ModelForm):
"""Clase para crear un formulario
a partir de un modelo definido"""
class Met... |
grevutiu-gabriel/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/suggestnominations.py | 119 | # Copyright (c) 2011 Google Inc. All rights reserved.
# Copyright (c) 2011 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 t... |
chrisschuette/Nyx | refs/heads/master | third_party/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... |
Captnoord/openpli-enigma2 | refs/heads/master | lib/python/Tools/Transponder.py | 12 | from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersCable, eDVBFrontendParametersTerrestrial
from Components.NimManager import nimmanager
def ConvertToHumanReadable(tp, type = None):
ret = { }
if type is None:
type = tp.get("tuner_type", "None")
if type == "DVB-S":
ret["tuner_type"] = _("S... |
akhilari7/pa-dude | refs/heads/master | lib/python2.7/site-packages/django/test/client.py | 132 | from __future__ import unicode_literals
import json
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from django.apps import apps
from django.conf import settings
from django.core import urlresolvers
from django.core.handlers.base import ... |
storm-computers/odoo | refs/heads/9.0 | addons/base_gengo/ir_translation.py | 46 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import api
from openerp.osv import fields, osv
from openerp.exceptions import UserError
LANG_CODE_MAPPING = {
'ar_SY': ('ar', 'Arabic'),
'id_ID': ('id', 'Indonesian'),
'nl_NL': ('nl', 'Dutch'),
... |
nitzmahone/tower-cli | refs/heads/master | tests/test_utils_datastructures.py | 2 | # Copyright 2014, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.com>
#
# 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 requi... |
sdague/home-assistant | refs/heads/dev | homeassistant/components/acmeda/__init__.py | 15 | """The Rollease Acmeda Automate integration."""
import asyncio
from homeassistant import config_entries, core
from .const import DOMAIN
from .hub import PulseHub
CONF_HUBS = "hubs"
PLATFORMS = ["cover", "sensor"]
async def async_setup(hass: core.HomeAssistant, config: dict):
"""Set up the Rollease Acmeda Auto... |
40223244/cdb-2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/__init__.py | 603 | ## pygame - Python Game Library
## Copyright (C) 2000-2001 Pete Shinners
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Library General Public
## License as published by the Free Software Foundation; either
## version 2 of the License, or (... |
grzes/djangae | refs/heads/master | djangae/contrib/backup/utils.py | 1 | from django.conf import settings
SETTINGS_PREFIX = "DJANGAE_BACKUP_"
def get_backup_setting(name, required=True, default=None):
settings_name = "{}{}".format(SETTINGS_PREFIX, name)
if required and not hasattr(settings, settings_name):
raise Exception("{} is required".format(settings_name))
retur... |
DefyVentures/edx-platform | refs/heads/master | common/static/js/vendor/mathjax-MathJax-c9db6ac/docs/source/conf.py | 104 | # -*- coding: utf-8 -*-
#
# MathJax documentation build configuration file, created by
# sphinx-quickstart on Sun May 16 23:18:19 2010.
#
# 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 file.
#
# All... |
ekkleesia3/google-app-engine-django | refs/heads/master | appengine_django/management/commands/rollback.py | 60 | #!/usr/bin/python2.4
#
# Copyright 2008 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
#
# Unless required by applicable law or... |
franekp/millandict | refs/heads/master | ankidict/thirdparty/sqlalchemy/orm/session.py | 2 | # orm/session.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the Session class and related utilities."""
import weakref
from .. impor... |
dcjohnson1989/selenium | refs/heads/master | py/test/selenium/test_prompts.py | 65 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
lgscofield/odoo | refs/heads/8.0 | addons/event_sale/__init__.py | 428 | # -*- 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... |
AutorestCI/azure-sdk-for-python | refs/heads/master | azure-mgmt-applicationinsights/azure/mgmt/applicationinsights/models/application_insights_component_quota_status.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
severb/flowy-website | refs/heads/master | js/Lib/unittest/test/testmock/testhelpers.py | 4 | import unittest
from unittest.mock import (
call, _Call, create_autospec, MagicMock,
Mock, ANY, _CallList, patch, PropertyMock
)
from datetime import datetime
class SomeClass(object):
def one(self, a, b):
pass
def two(self):
pass
def three(self, a=None):
pas... |
sriki18/scipy | refs/heads/master | scipy/stats/tests/test_kdeoth.py | 41 | from __future__ import division, print_function, absolute_import
from scipy import stats
import numpy as np
from numpy.testing import assert_almost_equal, assert_, assert_raises, \
assert_array_almost_equal, assert_array_almost_equal_nulp, run_module_suite
def test_kde_1d():
#some basic tests comparing to no... |
phalt/django | refs/heads/master | django/contrib/staticfiles/views.py | 581 | """
Views and functions for serving static files. These are only to be used during
development, and SHOULD NOT be used in a production setting.
"""
import os
import posixpath
from django.conf import settings
from django.contrib.staticfiles import finders
from django.http import Http404
from django.utils.six.moves.url... |
Yingmin-Li/pyspider | refs/heads/master | pyspider/webui/index.py | 59 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-22 23:20:39
import socket
from flask import render_template, request, json
from flask.ext import login
from .app import app
index_fields = ['name... |
apanju/odoo | refs/heads/8.0 | openerp/addons/base/tests/test_func.py | 379 | # -*- coding: utf-8 -*-
import functools
import unittest2
from openerp.tools.func import compose
class TestCompose(unittest2.TestCase):
def test_basic(self):
str_add = compose(str, lambda a, b: a + b)
self.assertEqual(
str_add(1, 2),
"3")
def test_decorator(self):
... |
sudhanshuptl/Machine-Learning | refs/heads/master | TeST/plot2.py | 1 | __auther__='Sudhanshu Patel'
import sklearn.datasets as data
from sklearn.svm import SVC
import numpy as np
# Get digits Dataset****
data=data.load_digits()
X=data.data #feature vector
Y=data.target #Label Vector
# **************************
#** Plot
import matplotlib.pyplot as plt
for x, y in zip(X, Y):
plt.scat... |
jsvelasquezv/agroind-mobile | refs/heads/master | platforms/browser/www/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | #!/usr/bin/env python
# Copyright 2013 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.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... |
karolmajta/officetune | refs/heads/master | server/src/officetune/officetune/settings.py | 1 | # Django settings for officetune project.
import os
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'm... |
RITC3/RC3_CTFD | refs/heads/master | populate.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from CTFd.models import Users, Solves, Challenges, WrongKeys, Keys, Tags, Files, Tracking, Teams
from CTFd import create_app
from random import randint
import datetime
import random
import hashlib
import os
import sys
app = create_app()
USER_AMOUNT = 50
TEAM_AMOUNT = 10
CHA... |
yask123/django | refs/heads/master | tests/urlpatterns_reverse/views_broken.py | 501 | # I just raise an AttributeError to confuse the view loading mechanism
raise AttributeError('I am here to confuse django.core.urlresolvers.get_callable')
|
fosstp/fosstp | refs/heads/master | alembic/env.py | 1 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... |
rajsadho/django | refs/heads/master | tests/migrations/test_executor.py | 80 | from django.apps.registry import apps as global_apps
from django.db import connection
from django.db.migrations.exceptions import InvalidMigrationPlan
from django.db.migrations.executor import MigrationExecutor
from django.db.migrations.graph import MigrationGraph
from django.db.migrations.recorder import MigrationReco... |
BartoszCichecki/onlinepython | refs/heads/master | onlinepython/pypy-2.4.0-win32/lib-python/2.7/plat-mac/lib-scriptpackages/SystemEvents/Disk_Folder_File_Suite.py | 81 | """Suite Disk-Folder-File Suite: Terms and Events for controlling Disks, Folders, and Files
Level 1, version 1
Generated from /System/Library/CoreServices/System Events.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = 'cdis'
class Disk_Folder_File_Suite_Events:
_... |
andimarafioti/intercomunicador | refs/heads/master | helpers/worker/worker.py | 1 | import threading
__author__ = 'Dev6'
'''
This class simplifies thread usage. Examples:
1 - Worker.call(aFunction).withArgs(arg1, arg2..argN).start() / Runs a normal thread starting at aFunction
2 - Worker.call(aFunction).withArgs(arg1, arg2..argN).asDaemon.start() / Same as before, but uses a daemon thread
3 - Wo... |
vitan/hue | refs/heads/master | desktop/core/ext-py/Paste-1.7.2/paste/auth/grantip.py | 28 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
Grant roles and logins based on IP address.
"""
from paste.util import ip4
class GrantIPMiddleware(object):
"""
On each request, ``ip_map... |
silviolima/EstudoAppengine | refs/heads/master | tekton/tekton-master/test/web_test/home.py | 2 | __author__ = 'renzo'
def index():
pass
|
p4datasystems/CarnotKE | refs/heads/master | jyhton/out/production/jyhton/support.py | 13 | import sys
is_jython = sys.platform[:4] == "java"
import re, exceptions, thread, os, shutil
import support_config as cfg
if is_jython:
import jarray
from java.io import FileInputStream
from java.io import FileOutputStream
from java.util.jar import JarEntry
from java.util.jar import JarFile
fro... |
thomasgilgenast/gilgistatus-nonrel | refs/heads/master | django/utils/dates.py | 488 | "Commonly-used date structures"
from django.utils.translation import ugettext_lazy as _, pgettext_lazy
WEEKDAYS = {
0:_('Monday'), 1:_('Tuesday'), 2:_('Wednesday'), 3:_('Thursday'), 4:_('Friday'),
5:_('Saturday'), 6:_('Sunday')
}
WEEKDAYS_ABBR = {
0:_('Mon'), 1:_('Tue'), 2:_('Wed'), 3:_('Thu'), 4:_('Fri')... |
CyanogenMod/android_kernel_motorola_msm8610 | refs/heads/cm-14.1 | 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... |
mgogoulos/libcloud | refs/heads/trunk | libcloud/backup/drivers/dummy.py | 31 | # 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 ... |
kanagasabapathi/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/test_stringtransport.py | 56 | # Copyright (c) 2009-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.test.proto_helpers}.
"""
from zope.interface.verify import verifyObject
from twisted.internet.interfaces import (ITransport, IPushProducer, IConsumer,
IReactorTCP, IReactorSSL, IReactorUNIX, IAddress, IListe... |
pixelated-project/pixelated-user-agent | refs/heads/master | service/test/perf/tags/__init__.py | 159 | #
# Copyright (c) 2014 ThoughtWorks, Inc.
#
# Pixelated 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 License, or
# (at your option) any later version.
#
# Pixelated is distrib... |
sarvex/django | refs/heads/master | tests/admin_autodiscover/admin.py | 513 | from django.contrib import admin
from .models import Story
admin.site.register(Story)
raise Exception("Bad admin module")
|
akeym/cyder | refs/heads/master | vendor-local/src/django-extensions/build/lib/django_extensions/management/commands/passwd.py | 41 | from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
import getpass
class Command(BaseCommand):
help = "Clone of the UNIX program ``passwd'', for django.contrib.auth."
requires_model_validation = False
def handle(self, *args, **options):
i... |
antoinecarme/pyaf | refs/heads/master | tests/artificial/transf_Integration/trend_Lag1Trend/cycle_12/ar_12/test_artificial_1024_Integration_Lag1Trend_12_12_0.py | 1 | import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "Lag1Trend", cycle_length = 12, transform = "Integration", sigma = 0.0, exog_count = 0, ar_order = 12); |
wesleywiser/cargo | refs/heads/master | src/etc/dl-snapshot.py | 1 | import distutils.spawn
import hashlib
import os
import subprocess
import sys
import tarfile
import shutil
import contextlib
with open('src/snapshots.txt') as f:
lines = f.readlines()
date = lines[0]
linux32 = lines[1]
linux64 = lines[2]
mac32 = lines[3]
mac64 = lines[4]
win32 = lines[5]
win64 = lines[6]
triple = ... |
dhruvsrivastava/OJ | refs/heads/master | flask/lib/python2.7/site-packages/setuptools/command/develop.py | 450 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os
import glob
from pkg_resources import Distribution, PathMetadata, normalize_path
from setuptools.command.easy_install import easy_install
from setuptools.compat import PY3
impor... |
emorozov/django-select2 | refs/heads/master | testapp/testapp/testmain/views.py | 10 | import json
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.shortcuts import render, get_object_or_404
from .forms import EmployeeForm, DeptForm, MixedForm, InitialValueForm, QuestionForm, QuestionNonAutoForm, WordsForm, SchoolForm, \
GetSearchTes... |
maxsocl/django | refs/heads/master | tests/template_tests/syntax_tests/test_builtins.py | 521 | from django.test import SimpleTestCase
from ..utils import setup
class BuiltinsTests(SimpleTestCase):
@setup({'builtins01': '{{ True }}'})
def test_builtins01(self):
output = self.engine.render_to_string('builtins01')
self.assertEqual(output, 'True')
@setup({'builtins02': '{{ False }}'}... |
mlperf/training_results_v0.7 | refs/heads/master | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/relay/_make.py | 2 | # 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... |
MDI2017/hide_and_seek | refs/heads/master | jugadores/jugador.py | 1 | from pygame import *
from gui.ficha import Ficha
class Jugador:
"""
Clase que crea un jugador con nombre y avatar que le designemos
"""
def __init__(self, nombre, avatar):
self.nombre = nombre
self.avatar = avatar
self.ficha = None
|
geekboxzone/lollipop_external_chromium_org | refs/heads/geekbox | build/android/pylib/device/device_blacklist.py | 79 | # 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 json
import os
import threading
from pylib import constants
_BLACKLIST_JSON = os.path.join(
constants.DIR_SOURCE_ROOT,
os.environ.get('CHROMI... |
GrandmasterK/XScheduler | refs/heads/master | venv/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/specifiers.py | 527 | # Copyright 2014 Donald Stufft
#
# 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, so... |
dongguangming/python-twitter | refs/heads/master | tests/test_trend.py | 16 | import twitter
import unittest
import json
class TrendTest(unittest.TestCase):
SAMPLE_JSON = '''{"name": "Kesuke Miyagi", "query": "Kesuke Miyagi"}'''
def _GetSampleTrend(self):
return twitter.Trend(name='Kesuke Miyagi',
query='Kesuke Miyagi',
... |
joshowen/django-allauth | refs/heads/master | allauth/socialaccount/providers/dropbox_oauth2/models.py | 4209 | # Create your models here.
|
B3AU/waveTree | refs/heads/waveTree | sklearn/manifold/isomap.py | 12 | """Isomap for manifold learning"""
# Author: Jake Vanderplas -- <vanderplas@astro.washington.edu>
# License: BSD 3 clause (C) 2011
import numpy as np
from ..base import BaseEstimator, TransformerMixin
from ..neighbors import NearestNeighbors, kneighbors_graph
from ..utils import check_arrays
from ..utils.graph impor... |
wuga214/Django-Wuga | refs/heads/master | env/lib/python2.7/site-packages/django/apps/registry.py | 51 | import sys
import threading
import warnings
from collections import Counter, OrderedDict, defaultdict
from functools import partial
from django.core.exceptions import AppRegistryNotReady, ImproperlyConfigured
from django.utils import lru_cache
from .config import AppConfig
class Apps(object):
"""
A registry... |
christophlsa/odoo | refs/heads/8.0 | addons/l10n_eu_service/__init__.py | 303 | import wizard
import models |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.