repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
0k/openerp-server | refs/heads/ocb-7.0 | openerp/report/render/rml2pdf/trml2pdf.py | 2 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
erizhang/shadowsocks | refs/heads/rm | shadowsocks/eventloop.py | 949 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# 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... |
rhdedgar/openshift-tools | refs/heads/stg | openshift/installer/vendored/openshift-ansible-3.6.173/roles/lib_openshift/src/ansible/oc_volume.py | 64 | # pylint: skip-file
# flake8: noqa
def main():
'''
ansible oc module for volumes
'''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type='str',
... |
SUSE/kiwi | refs/heads/master | kiwi/oci_tools/buildah.py | 1 | # Copyright (c) 2019 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi is free software: you can redistribute it and/or modify
# it under the terms owf the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
kashif/scikit-learn | refs/heads/master | sklearn/svm/tests/test_svm.py | 29 | """
Testing for Support Vector Machine module (sklearn.svm)
TODO: remove hard coded numerical results when possible
"""
import numpy as np
import itertools
from numpy.testing import assert_array_equal, assert_array_almost_equal
from numpy.testing import assert_almost_equal
from scipy import sparse
from nose.tools im... |
sparkslabs/kamaelia_ | refs/heads/master | Code/Python/Kamaelia/Kamaelia/SampleTemplateComponent.py | 3 | #!/usr/bin/env python2.3
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache Lice... |
eLBati/odoo | refs/heads/master | openerp/cli/deploy.py | 369 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import requests
import sys
import tempfile
import zipfile
from . import Command
class Deploy(Command):
"""Deploy a module on an Odoo instance"""
def __init__(self):
super(Deploy, self).__init__()
self.session = requests.se... |
giovaroma/bootstrap4 | refs/heads/master | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... |
restless/mezzanine-slider-revolution | refs/heads/master | slider_revolution/models.py | 1 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.fields import FileField, MultiChoiceField
from mezzanine.core.models import ... |
polyaxon/polyaxon | refs/heads/master | sdks/python/http_client/v1/polyaxon_sdk/models/v1_list_searches_response.py | 1 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... |
rahmalik/trafficserver | refs/heads/master | tests/gold_tests/basic/copy_config.test.py | 8 | '''
'''
# 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");... |
EnTeQuAk/dotfiles | refs/heads/master | sublime-text-3/Packages/HTML-CSS-JS Prettify/src/py/utils/file_utils.py | 4 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""Various utility functions used by this plugin"""
from codecs import open as fopen
from os import makedirs
from os.pat... |
ioram7/keystone-federado-pgid2013 | refs/heads/master | build/requests/build/lib.linux-x86_64-2.7/requests/sessions.py | 58 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .compat import cookielib, OrderedDict, urljoin, urlparse
from ... |
sujithshankar/anaconda | refs/heads/master | tests/glade/check_mnemonics.py | 9 | #
# Copyright (C) 2015 Red Hat, Inc.
#
# This program 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 2.1 of the License, or
# (at your option) any later version.
#
# This program is dis... |
MediaMath/Diamond | refs/heads/master | src/collectors/openstackswiftrecon/openstackswiftrecon.py | 8 | # coding=utf-8
"""
Openstack Swift Recon collector. Reads any present recon cache files and
reports their current metrics.
#### Dependencies
* Running Swift services must have a recon enabled
"""
import os
try:
import json
json # workaround for pyflakes issue #13
except ImportError:
import simplejson... |
jcrist/blaze | refs/heads/master | blaze/expr/tests/test_method_dispatch.py | 18 | from blaze.expr.method_dispatch import select_functions, name, partial
def iseven(n):
return isinstance(n, int) and n % 2 == 0
def inc(x):
return Foo(x.data + 1)
def dec(x):
return Foo(x.data - 1)
def lower(x):
return Foo(x.data.lower())
def upper(x):
return Foo(x.data.upper())
def halve(x):
... |
tempbottle/Nuitka | refs/heads/develop | tests/basics/MinimalClass.py | 2 | # Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... |
cheungpat/rq-scheduler | refs/heads/master | rq_scheduler/__init__.py | 4 | VERSION = (0, 5, 1)
from .scheduler import Scheduler
|
shashank971/edx-platform | refs/heads/master | common/test/acceptance/pages/studio/settings.py | 51 | # coding: utf-8
"""
Course Schedule and Details Settings page.
"""
from __future__ import unicode_literals
from bok_choy.promise import EmptyPromise
from .course_page import CoursePage
from .utils import press_the_notification_button
class SettingsPage(CoursePage):
"""
Course Schedule and Details Settings pa... |
zycdragonball/tensorflow | refs/heads/master | tensorflow/contrib/saved_model/python/saved_model/signature_def_utils.py | 113 | # 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... |
ctuning/ck-env | refs/heads/master | package/tool-bazel-0.6.1-win/custom.py | 2 | #
# Collective Knowledge workflow framework
#
# Developer: Grigori Fursin, Grigori.Fursin@cTuning.org, http://fursin.net
#
import os
import sys
import json
##############################################################################
# customize installation
def setup(i):
"""
Input: {
cfg ... |
vadimtk/chrome4sdp | refs/heads/master | build/gyp_chromium_test.py | 27 | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import unittest
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
SRC_DIR = os.path.dirname(SCRIPT_DIR)
sy... |
aperigault/ansible | refs/heads/devel | lib/ansible/modules/system/debconf.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2014, Brian Coca <briancoca+ansible@gmail.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_ve... |
jmesteve/medical | refs/heads/master | openerp/tools/import_email.py | 105 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
groschovskiy/gsa-admin-toolkit | refs/heads/master | sso_test.py | 3 | #!/usr/bin/python2.4
#
# Copyright (C) 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
#
# Unless required by applicable l... |
xbmc/atv2 | refs/heads/atv2 | xbmc/lib/libPython/Python/Mac/Modules/qt/setup.py | 39 | # This is a temporary setup script to allow distribution of
# MacPython 2.4 modules for MacPython 2.3.
from distutils.core import Extension, setup
setup(name="QuickTime", version="0.2",
ext_modules=[
Extension('QuickTime._Qt', ['_Qtmodule.c'],
extra_link_args=['-framework', 'Ca... |
pottzer/home-assistant | refs/heads/dev | homeassistant/helpers/state.py | 5 | """
homeassistant.helpers.state
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Helpers that help with state related things.
"""
import logging
from homeassistant.core import State
import homeassistant.util.dt as dt_util
from homeassistant.const import (
STATE_ON, STATE_OFF, SERVICE_TURN_ON, SERVICE_TURN_OFF,
SERVICE_MEDIA_PLAY,... |
AlexandreProenca/django-elasticsearch | refs/heads/master | test_project/test_project/wsgi.py | 73 | """
WSGI config for test_project project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATI... |
cynngah/uofthacksIV | refs/heads/master | generate-jobs/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.py | 422 | #-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy ... |
ahaw021/SSL-MAIL-PROTOCOLS-TESTING | refs/heads/master | conversations.py | 1 | from constants import *
import base64
def decide_protocol_handler(client, PROTOCOL):
"""
Function to decide what conversation based on protocol. As each protocol has a different syntax we need this function to point to the right function.
params:
client - a python Socket Client - can be secure on ins... |
tianweizhang/nova | refs/heads/v0 | nova/vnc/xvp_proxy.py | 16 | #!/usr/bin/env python
# Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICEN... |
fusionbox/django-two-factor-auth | refs/heads/master | two_factor/urls.py | 4 | from django.conf.urls import patterns, url
from two_factor.views import (LoginView,
PhoneDeleteView, PhoneSetupView, DisableView,
BackupTokensView, SetupCompleteView, SetupView,
ProfileView, QRGeneratorView)
core = patterns(
... |
NickWoodhams/flask-admin | refs/heads/master | examples/layout/app.py | 41 | import os
import os.path as op
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
import flask_admin as admin
from flask_admin.contrib.sqla import ModelView
# Create application
app = Flask(__name__)
# Create dummy secrey key so we can use sessions
app.config['SECRET_KEY'] = '123456790'
# Create in-me... |
CingHu/neutron-ustack | refs/heads/master | neutron/tests/unit/test_extension_pnet.py | 3 | # Copyright 2013 VMware
# 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 applic... |
vveerava/Openstack | refs/heads/master | neutron/db/migration/alembic_migrations/versions/1d6ee1ae5da5_db_healing.py | 17 | # Copyright 2014 OpenStack Foundation
#
# 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 ... |
ddsc/ddsc-incron | refs/heads/master | setup.py | 1 | from setuptools import setup
version = '0.1dev'
long_description = '\n\n'.join([
open('README.rst').read(),
open('CREDITS.rst').read(),
open('CHANGES.rst').read(),
])
install_requires = [
'celery',
'ddsc-logging',
'setuptools',
],
tests_require = [
'coverage',
'nose',
]
... |
akshaya9/fosswebsite | refs/heads/master | attendance/admin.py | 2 | from django.contrib import admin
from attendance.models import DailyAttendance, SSIDName
admin.site.register(DailyAttendance)
admin.site.register(SSIDName)
|
CloudBotIRC/CloudBot | refs/heads/master | plugins/minecraft_ping.py | 21 | import socket
from mcstatus import MinecraftServer
from cloudbot import hook
mc_colors = [('\xa7f', '\x0300'), ('\xa70', '\x0301'), ('\xa71', '\x0302'), ('\xa72', '\x0303'),
('\xa7c', '\x0304'), ('\xa74', '\x0305'), ('\xa75', '\x0306'), ('\xa76', '\x0307'),
('\xa7e', '\x0308'), ('\xa7a', '\... |
aduchate/bigcouch | refs/heads/master | couchjs/scons/scons-local-2.0.1/SCons/Tool/suncc.py | 61 | """SCons.Tool.suncc
Tool-specific initialization for Sun Solaris (Forte) CC and cc.
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... |
J861449197/edx-platform | refs/heads/master | common/djangoapps/status/status.py | 86 | """
A tiny app that checks for a status message.
"""
from django.conf import settings
import logging
from .models import GlobalStatusMessage
log = logging.getLogger(__name__)
def get_site_status_msg(course_key):
"""
Pull the status message from the database.
Caches the message by course.
"""
t... |
antoinecarme/pyaf | refs/heads/master | tests/periodicities/Hour/Cycle_Hour_25_H_7.py | 1 | import tests.periodicities.period_test as per
per.buildModel((7 , 'H' , 25));
|
ChameleonCloud/horizon | refs/heads/chameleoncloud/train | openstack_dashboard/test/integration_tests/pages/admin/overviewpage.py | 3 | # 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
# d... |
carolFrohlich/nipype | refs/heads/master | nipype/interfaces/dipy/tensors.py | 5 | # -*- coding: utf-8 -*-
"""Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath, '../../testing/data'))
>>> os.chdir(datadir)
"""
from __future__ import print_function, divisi... |
xrg/openerp-server | refs/heads/pg84-next | bin/workflow/__init__.py | 76 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
michaupl/braincloud | refs/heads/master | braincloud/urls.py | 1 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.contrib.auth.views import login, logout
from tastypie.api import Api
from brainblog.views import *
from brainblog.api import UserResource
from brainindex.api import TextThoughtAjaxResource
admin.autodiscover()
# rest ap... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/244_test_xrange.py | 15 | # Python test set -- built-in functions
import test.test_support, unittest
import sys
import warnings
warnings.filterwarnings("ignore", "integer argument expected",
DeprecationWarning, "unittest")
class XrangeTest(unittest.TestCase):
def test_xrange(self):
self.assertEqual(list(xr... |
NixaSoftware/CVis | refs/heads/master | venv/bin/tools/build/v2/test/core_update_now.py | 45 | #!/usr/bin/python
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
import os
def basic():
t = BoostBuild.Tester(pass_toolset=0, pass_d0=False)
t.write("file.jam",... |
awkspace/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/apache2_mod_proxy.py | 47 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Olivier Boukili <boukili.olivier@gmail.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_version':... |
pluckljn/paimei | refs/heads/master | console/modules/_PAIMEIexplorer/ExplorerTreeCtrl.py | 6 | #
# PaiMei
# Copyright (C) 2006 Pedram Amini <pedram.amini@gmail.com>
#
# $Id: ExplorerTreeCtrl.py 193 2007-04-05 13:30:01Z cameron $
#
# 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; eithe... |
tobias47n9e/social-core | refs/heads/master | social_core/tests/backends/test_azuread.py | 5 | """
Copyright (c) 2015 Microsoft Open Technologies, Inc.
All rights reserved.
MIT License
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 ri... |
pneerincx/easybuild-framework | refs/heads/master | easybuild/tools/toolchain/toolchainvariables.py | 9 | # #
# Copyright 2012-2015 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 (ht... |
mKeRix/home-assistant | refs/heads/dev | tests/components/yamaha/__init__.py | 36 | """Tests for the yamaha component."""
|
fabaff/ansible | refs/heads/devel | lib/ansible/new_inventory/__init__.py | 53 | # (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... |
timwee/emacs-starter-kit-mr-flip-forked | refs/heads/master | vendor/rope/rope/base/resources.py | 58 | import os
import re
import rope.base.change
import rope.base.fscommands
from rope.base import exceptions
class Resource(object):
"""Represents files and folders in a project"""
def __init__(self, project, path):
self.project = project
self._path = path
def move(self, new_location):
... |
abhilashnta/edx-platform | refs/heads/master | cms/djangoapps/contentstore/features/course_import.py | 176 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
import os
from lettuce import world, step
from django.conf import settings
def import_file(filename):
world.browser.execute_script("$('input.file-input').css('display', 'block')")
path = os.path.join(... |
fernandojvdasilva/centering_py | refs/heads/master | src/corpus/Sentence.py | 1 | '''
Created on 03/11/2009
@author: Fernando
Copyright 2009-2013 Fernando J. V. da Silva
This file is part of centering_py.
centering_py 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 Fo... |
alexsanjoseph/duolingo-save-streak | refs/heads/master | werkzeug/datastructures.py | 56 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import codecs
import ... |
eliasrg/SURF2017 | refs/heads/master | interactive.py | 1 | # Copyright (c) 2017 Elias Riedel Gårding
# Licensed under the MIT License
import sys, os
sys.path.insert(0,
os.path.abspath(os.path.join(os.path.dirname(__file__), 'code')))
from itertools import islice, count
import numpy as np
import scipy.stats as st
import matplotlib.pyplot as plt
from scipy.integrate im... |
Vaidyanath/tempest | refs/heads/master | tempest/api/compute/admin/test_aggregates.py | 1 | # Copyright 2013 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... |
akosyakov/intellij-community | refs/heads/master | python/testData/intentions/afterReturnTypeInPy3Annotation2.py | 166 | def my_func(p1=1) -> object:
return p1
d = my_func(1) |
michellemorales/OpenMM | refs/heads/master | models/skip_thoughts/skip_thoughts/encoder_manager.py | 14 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Symfomany/Horus | refs/heads/master | py/geopy/geopy/geohash.py | 82 | from geopy import Point
class Geohash(object):
ENCODE_MAP = '0123456789bcdefghjkmnpqrstuvwxyz'
DECODE_MAP = dict([(char, i) for i, char in enumerate(ENCODE_MAP)])
def __init__(self, point_class=Point, precision=12):
self.point_class = point_class
self.precision = precision
def encode(... |
rickerc/nova_audit | refs/heads/cis-havana-staging | nova/tests/cells/test_cells_rpc_driver.py | 11 | # Copyright (c) 2012 Rackspace Hosting
# 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... |
msm8660coolstuff/android_kernel_samsung_msm8660 | refs/heads/cm-11.0 | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
fake-name/ReadableWebProxy | refs/heads/master | WebMirror/management/rss_parser_funcs/feed_parse_extractBlastronDoesSomeThings.py | 1 | def extractBlastronDoesSomeThings(item):
"""
Parser for 'Blastron Does Some Things'
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or 'preview' in item['title'].lower():
return None
tagmap = [
('honzuki no gekokujou', 'honzuki no gekokujou', ... |
jjo/openvpn-ipv6-legacy21 | refs/heads/master | win/js.py | 5 | import json
# usage:
# print JSON().encode(kv)
class JSON(json.JSONEncoder):
def __init__(self, **kwargs):
args = dict(sort_keys=True, indent=2)
args.update(kwargs)
json.JSONEncoder.__init__(self, **args)
|
willingc/oh-mainline | refs/heads/master | vendor/packages/python-social-auth/social/backends/rdio.py | 79 | """
Rdio OAuth1 and OAuth2 backends, docs at:
http://psa.matiasaguirre.net/docs/backends/rdio.html
"""
from social.backends.oauth import BaseOAuth1, BaseOAuth2, OAuthAuth
RDIO_API = 'https://www.rdio.com/api/1/'
class BaseRdio(OAuthAuth):
ID_KEY = 'key'
def get_user_details(self, response):
ful... |
dursk/django | refs/heads/master | tests/model_formsets_regress/tests.py | 173 | from __future__ import unicode_literals
from django import forms
from django.forms.formsets import DELETION_FIELD_NAME, BaseFormSet
from django.forms.models import (
BaseModelFormSet, inlineformset_factory, modelform_factory,
modelformset_factory,
)
from django.forms.utils import ErrorDict, ErrorList
from djan... |
Hasimir/pyjs | refs/heads/master | pyjswidgets/pyjamas/chart/TouchedPointUpdateOption.py | 7 | """
* Copyright 2007,2008,2009 John C. Gunther
* Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
*
* 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/lic... |
wetneb/django | refs/heads/master | django/core/mail/backends/dummy.py | 835 | """
Dummy email backend that does nothing.
"""
from django.core.mail.backends.base import BaseEmailBackend
class EmailBackend(BaseEmailBackend):
def send_messages(self, email_messages):
return len(list(email_messages))
|
logston/cunidecode | refs/heads/master | data/x02c.py | 246 | data = (
'', # 0x00
'', # 0x01
'', # 0x02
'', # 0x03
'', # 0x04
'', # 0x05
'', # 0x06
'', # 0x07
'', # 0x08
'', # 0x09
'', # 0x0a
'', # 0x0b
'', # 0x0c
'', # 0x0d
'', # 0x0e
'', # 0x0f
'', # 0x10
'', # 0x11
'', # 0x12
'', # 0x13
'', # 0x14
'', # 0x15
'',... |
mioann47/mobile-app-privacy-analyzer | refs/heads/master | mypythonscripts/tools/modified/androguard/core/api_specific_resources/aosp_permissions/aosp_permissions_api15.py | 27 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#################################################
### Extracted from platform version: 4.0.4
#################################################
AOSP_PERMISSIONS = {
'android.permission.BIND_WALLPAPER' : {'permissionGroup' : '', 'description' : 'Allows the holder to bind to the... |
ganshun666/micropython | refs/heads/redbear-duo | tests/basics/generator_closure.py | 116 | # a generator that closes over outer variables
def f():
x = 1 # closed over by g
def g():
yield x
yield x + 1
return g()
for i in f():
print(i)
# a generator that has its variables closed over
def f():
x = 1 # closed over by g
def g():
return x + 1
yield g()
x = ... |
Sticklyman1936/workload-automation | refs/heads/master | wlauto/devices/android/note3/__init__.py | 9 | # Copyright 2013-2015 ARM Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
muntasirsyed/intellij-community | refs/heads/master | python/testData/copyPaste/Indent8982.src.py | 83 | <selection>a = 1
b = 1
</selection>c = 1
d = 1 |
pbrunet/pythran | refs/heads/master | pythran/tests/openmp.legacy/omp_single.py | 4 | def omp_single():
nr_threads_in_single = 0
result = 0
nr_iterations = 0
LOOPCOUNT = 1000
if 'omp parallel':
for i in xrange(LOOPCOUNT):
if 'omp single':
'omp flush'
nr_threads_in_single += 1
'omp flush'
nr_iteration... |
Xeralux/tensorflow | refs/heads/master | tensorflow/contrib/boosted_trees/lib/learner/batch/ordinal_split_handler_test.py | 15 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
jackytu/newbrandx | refs/heads/rankx | sites/newbrandx/tests/test_checkout_forms.py | 34 | from django.test import TestCase
from apps.checkout import forms
from oscar.apps.address import models
from oscar.apps.order import models as order_models
class TestBillingAddressForm(TestCase):
def setUp(self):
models.Country.objects.create(
iso_3166_1_a2='GB', name="Great Britain")
... |
berinhard/newfies-dialer | refs/heads/master | newfies/frontend/models.py | 28 | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2013 Star2Billing S.L.
#
# The Initia... |
TathagataChakraborti/resource-conflicts | refs/heads/master | PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/test/test_gdbm.py | 17 | #! /usr/bin/env python
"""Test script for the gdbm module
Roger E. Masse
"""
import gdbm
from gdbm import error
from test.test_support import verbose, verify, TestFailed, TESTFN
filename = TESTFN
g = gdbm.open(filename, 'c')
verify(g.keys() == [])
g['a'] = 'b'
g['12345678910'] = '019237410982340912840198242'
a = ... |
paulrouget/servo | refs/heads/master | etc/ci/performance/submit_to_s3.py | 20 | #!/usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import argparse
import boto3
def main():
parser = argparse.ArgumentParser(
descri... |
LarsMichelsen/pmatic | refs/heads/master | ccu_pkg/python/lib/python2.7/rfc822.py | 36 | """RFC 2822 message manipulation.
Note: This is only a very rough sketch of a full RFC-822 parser; in particular
the tokenizing of addresses does not adhere to all the quoting rules.
Note: RFC 2822 is a long awaited update to RFC 822. This module should
conform to RFC 2822, and is thus mis-named (it's not worth rena... |
shitolepriya/Saloon_erp | refs/heads/master | erpnext/accounts/report/accounts_receivable/accounts_receivable.py | 11 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, scrub
from frappe.utils import getdate, nowdate, flt, cint
class ReceivablePayableReport(object):
def __init__(self, filters=None):... |
CentricWebEstate/bottle | refs/heads/master | test/test_config.py | 13 | import unittest
from bottle import ConfigDict
class TestConfDict(unittest.TestCase):
def test_isadict(self):
""" ConfigDict should behaves like a normal dict. """
# It is a dict-subclass, so this kind of pointless, but it doen't hurt.
d, m = dict(), ConfigDict()
d['key'], m['ke... |
psyonara/listattack | refs/heads/master | lists/forms.py | 1 | from django import forms
class NewListForm(forms.Form):
name = forms.CharField(max_length=100)
is_private = forms.BooleanField()
is_checklist = forms.BooleanField()
|
Jusedawg/SickRage | refs/heads/develop | lib/mako/compat.py | 40 | import sys
import time
py3k = sys.version_info >= (3, 0)
py33 = sys.version_info >= (3, 3)
py2k = sys.version_info < (3,)
py26 = sys.version_info >= (2, 6)
jython = sys.platform.startswith('java')
win32 = sys.platform.startswith('win')
pypy = hasattr(sys, 'pypy_version_info')
if py3k:
# create a "getargspec" from... |
kytvi2p/Sigil | refs/heads/master | src/Resource_Files/python3lib/bs4repair.py | 2 | #!/usr/bin/env python3
import sys
# until we get a properly embedded python 3 with its own site-packages
# force our current module path to come before site_packages
# to prevent name collisions with our versions and any site-packages
def insert_into_syspath():
n = 0
sp = None
ourhome = sys.path[-1]
f... |
houlixin/BBB-TISDK | refs/heads/master | linux-devkit/sysroots/i686-arago-linux/usr/lib/python2.7/distutils/debug.py | 251 | import os
__revision__ = "$Id$"
# If DISTUTILS_DEBUG is anything other than the empty string, we run in
# debug mode.
DEBUG = os.environ.get('DISTUTILS_DEBUG')
|
beatrizjesus/my-first-blog | refs/heads/master | pasta/Lib/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... |
uwosh/Campus_Directory_web_service | refs/heads/master | getClassesWithInstructorsByTermCX.py | 1 | # getClassesWithInstructorsByTermCX - get info (including instructor) on classes offered in a semester; does not include classes without an assigned instructor
import re
import xmlrpclib
import cx_Oracle
Kim_Nguyen_G5 = '192.168.0.1'
Kim_Nguyen_iMac = '192.168.0.1'
Kim_Nguyen_MacBook = '192.168.0.1'
Kim_Nguyen_MacBoo... |
mixman/djangodev | refs/heads/master | tests/regressiontests/generic_views/edit.py | 1 | from __future__ import absolute_import
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django import forms
from django.test import TestCase
from django.utils.unittest import expectedFailure
from . import views
from .models import Artist, Author
class ModelFo... |
romain-li/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/course_wiki.py | 2 | """
Wiki tab on courses
"""
from common.test.acceptance.pages.lms.course_page import CoursePage
from common.test.acceptance.pages.studio.utils import type_in_codemirror
class CourseWikiPage(CoursePage):
"""
Course wiki navigation and objects.
"""
url_path = "wiki"
def is_browser_on_page(self):
... |
Eagles2F/sync-engine | refs/heads/master | migrations/versions/172_update_easuid_schema_4.py | 8 | """update_easuid_schema_4
Revision ID: d0427f9f3d1
Revises: 584356bf23a3
Create Date: 2015-05-19 21:35:03.342221
"""
# revision identifiers, used by Alembic.
revision = 'd0427f9f3d1'
down_revision = '584356bf23a3'
from alembic import op
def upgrade():
from inbox.ignition import main_engine
engine = main_e... |
onlyjus/pyqtgraph | refs/heads/develop | pyqtgraph/opengl/items/GLScatterPlotItem.py | 39 | from OpenGL.GL import *
from OpenGL.arrays import vbo
from .. GLGraphicsItem import GLGraphicsItem
from .. import shaders
from ... import QtGui
import numpy as np
__all__ = ['GLScatterPlotItem']
class GLScatterPlotItem(GLGraphicsItem):
"""Draws points at a list of 3D positions."""
def __init__(self, **kw... |
mayblue9/scikit-learn | refs/heads/master | sklearn/preprocessing/tests/test_function_transformer.py | 176 | from nose.tools import assert_equal
import numpy as np
from sklearn.preprocessing import FunctionTransformer
def _make_func(args_store, kwargs_store, func=lambda X, *a, **k: X):
def _func(X, *args, **kwargs):
args_store.append(X)
args_store.extend(args)
kwargs_store.update(kwargs)
... |
jcoady9/python-for-android | refs/heads/master | python-modules/twisted/twisted/conch/insults/colors.py | 146 | """
You don't really want to use this module. Try helper.py instead.
"""
CLEAR = 0
BOLD = 1
DIM = 2
ITALIC = 3
UNDERSCORE = 4
BLINK_SLOW = 5
BLINK_FAST = 6
REVERSE = 7
CONCEALED = 8
FG_BLACK = 30
FG_RED = 31
FG_GREEN = 32
FG_YELLOW = 33
FG_BLUE = 34
FG_MAGENTA = 35
FG_CYAN = 36
FG_WHITE = 37
BG_BLACK = 40
BG_RED = 41
... |
msebire/intellij-community | refs/heads/master | python/testData/completion/heavyStarPropagation/lib/_pkg0/_pkg0_1/_pkg0_1_0/_pkg0_1_0_1/_pkg0_1_0_1_0/_mod0_1_0_1_0_4.py | 30 | name0_1_0_1_0_4_0 = None
name0_1_0_1_0_4_1 = None
name0_1_0_1_0_4_2 = None
name0_1_0_1_0_4_3 = None
name0_1_0_1_0_4_4 = None |
leotada/pyrpg | refs/heads/master | sprite.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# sprite.py
#
# Copyright 2016 Leonardo <leonardo_tada@hotmail.com>
#
import pygame
from gameobjects.vector2 import Vector2
class Sprite():
def __init__(self, game, image_name):
self.game = game
self.image = None
self.image_name = imag... |
837468220/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/ssl_servers.py | 57 | import os
import sys
import ssl
import pprint
import socket
import urllib.parse
# Rename HTTPServer to _HTTPServer so as to avoid confusion with HTTPSServer.
from http.server import (HTTPServer as _HTTPServer,
SimpleHTTPRequestHandler, BaseHTTPRequestHandler)
from test import support
threading = support.import_mod... |
obtuse/ahmia | refs/heads/master | onionMongoBot/onionMongoBot/items.py | 5 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
from scrapy.item import Field, Item
class CrawledWebsiteItem(Item):
"""A web site"""
domain = Field()
url = Field()
title = Field()
h1 = Field()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.