repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
slobberchops/sordid-tools | refs/heads/master | machine/src/sordid/machine.py | 1 | #!/usr/bin/env python
#
# Copyright 2012 Rafe Kaplan
#
# 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 o... |
AOSC-Dev/IE4unix | refs/heads/master | gui/model/installer.py | 1 |
# Defines the main GUI installer
class InstallerDefinition:
def __init__(self):
self.tabs = []
self.buttons = []
def set_title(self, title, show=True):
if show: self.title = title
return self
def set_logo(self, logo, show=True):
#TODO validates file existence
if show: self.logo = logo
return self
... |
clef/python-social-auth | refs/heads/master | social/tests/backends/test_strava.py | 87 | import json
from social.tests.backends.oauth import OAuth2Test
class StravaOAuthTest(OAuth2Test):
backend_path = 'social.backends.strava.StravaOAuth'
user_data_url = 'https://www.strava.com/api/v3/athlete'
expected_username = '227615'
access_token_body = json.dumps({
"access_token": "83ebeabdec... |
ItsLastDay/academic_university_2016-2018 | refs/heads/master | subjects/SoftwareDesign/au-software_design-2017/roguelike/src/tests/test_items.py | 1 | import unittest
from roguelike.world.exceptions import ExitFromMapException
from roguelike.position import Position
from roguelike.world.hero import Hero
from roguelike.world.items import *
from roguelike.world.game_settings import GameSettings
class MapMock:
@staticmethod
def exit_from_map():
raise ... |
kg-bot/SupyBot | refs/heads/master | plugins/Pastebin/plugin.py | 1 | ###
# Copyright (c) 2005, Ali Afshar
# 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, a... |
xshotD/pyglet | refs/heads/master | tests/window/EVENT_MOUSE_ENTER_LEAVE.py | 33 | #!/usr/bin/env python
'''Test that mouse enter and leave events work correctly.
Expected behaviour:
One window will be opened. Move the mouse in and out of this window
and ensure the events displayed are correct.
Close the window or press ESC to end the test.
'''
__docformat__ = 'restructuredtext'
__ve... |
toenuff/treadmill | refs/heads/master | lib/python/treadmill/sproc/vring.py | 1 | """Treadmill vring manager."""
from __future__ import absolute_import
import signal
import sys
import logging
import yaml
import click
from .. import context
from .. import discovery
from .. import logcontext as lc
from .. import utils
from .. import vring
from .. import zkutils
_LOGGER = logging.getLogger(__name... |
unaizalakain/django | refs/heads/master | tests/migrations/faulty_migrations/namespace/foo/__init__.py | 12133432 | |
ibrahimkarahan/Flexget | refs/heads/develop | flexget/ui/plugins/__init__.py | 12133432 | |
gkarlin/django-jenkins | refs/heads/master | build/Django/django/conf/locale/ru/__init__.py | 12133432 | |
marksantesson/xmldump | refs/heads/master | xmldump/__init__.py | 12133432 | |
pk400/catering | refs/heads/master | myvenv/lib/python3.4/site-packages/django/contrib/humanize/templatetags/__init__.py | 12133432 | |
agrubb/tensorboard | refs/heads/master | tensorboard/plugins/scalar/scalars_plugin_test.py | 4 | # -*- coding: utf-8 -*-
# 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
#
# Un... |
dimid/ansible-modules-extras | refs/heads/devel | files/__init__.py | 12133432 | |
vmturbo/nova | refs/heads/master | nova/tests/unit/api/openstack/compute/legacy_v2/__init__.py | 12133432 | |
marook/roxappletbuilder2 | refs/heads/master | framework/src/test/roxappletbuilder_test/__init__.py | 12133432 | |
shankig/wye | refs/heads/master | wye/organisations/__init__.py | 12133432 | |
wsyzxcn/tornado | refs/heads/master | dev/server/__init__.py | 12133432 | |
NewpTone/stacklab-nova | refs/heads/master | nova/api/openstack/volume/volumes.py | 5 | # Copyright 2011 Justin Santa Barbara
# 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... |
Ivicel/shadowsocks | refs/heads/master | shadowsocks/crypto/table.py | 1044 | # !/usr/bin/env python
#
# Copyright 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 required by applicable law or... |
marcocaccin/scikit-learn | refs/heads/master | sklearn/decomposition/fastica_.py | 54 | """
Python implementation of the fast ICA algorithms.
Reference: Tables 8.3 and 8.4 page 196 in the book:
Independent Component Analysis, by Hyvarinen et al.
"""
# Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux,
# Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann
# License: BS... |
rexshihaoren/scikit-learn | refs/heads/master | examples/cluster/plot_digits_agglomeration.py | 377 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Feature agglomeration
=========================================================
These images how similar features are merged together using
feature agglomeration.
"""
print(__doc__)
# Code source: Gaël Varoquaux
#... |
Tatsh-ansible/ansible | refs/heads/devel | test/units/module_utils/facts/test_collectors.py | 39 | # unit tests for ansible fact collectors
# -*- coding: utf-8 -*-
#
# 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.
#
# Ansibl... |
deshipu/micropython | refs/heads/master | tests/basics/async_await.py | 63 | # test basic await expression
# adapted from PEP0492
async def abinary(n):
print(n)
if n <= 0:
return 1
l = await abinary(n - 1)
r = await abinary(n - 1)
return l + 1 + r
o = abinary(4)
try:
while True:
o.send(None)
except StopIteration:
print('finished')
|
ideasiii/ControllerPlatform | refs/heads/master | Controller-Mongodb/extLibs/mongo-cxx-driver/src/third_party/gtest-1.7.0/test/gtest_output_test.py | 1733 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
Pflanzgurke/glimpse_client | refs/heads/develop | 3rdparty/breakpad/src/tools/gyp/tools/pretty_sln.py | 806 | #!/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.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... |
aisipos/django | refs/heads/master | django/conf/locale/mn/formats.py | 619 | # -*- 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 = 'd F Y'
TIME_FORMAT = 'g:i A'
# DA... |
bearstech/ansible | refs/heads/devel | lib/ansible/modules/network/vyos/vyos_static_route.py | 11 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Ansible by Red Hat, inc
#
# This file is part of Ansible by Red Hat
#
# 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 Li... |
jmolloy/pedigree | refs/heads/master | images/install/disk-contents/libraries/python2.6/pdb.py | 51 | #! /usr/bin/env python
"""A Python debugger."""
# (See pdb.doc for documentation.)
import sys
import linecache
import cmd
import bdb
from repr import Repr
import os
import re
import pprint
import traceback
class Restart(Exception):
"""Causes a debugger to be restarted for the debugged python program."""
pa... |
iglpdc/nipype | refs/heads/master | nipype/interfaces/semtools/utilities/tests/test_auto_BRAINSClipInferior.py | 12 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from .....testing import assert_equal
from ..brains import BRAINSClipInferior
def test_BRAINSClipInferior_inputs():
input_map = dict(BackgroundFillValue=dict(argstr='--BackgroundFillValue %s',
),
acLowerBound=dict(argstr='--acLowerBound %f',
),
... |
msebire/intellij-community | refs/heads/master | python/testData/refactoring/move/relativeImportsToModulesInSameMovedPackageNotUpdated/after/src/subpkg/subsubpkg/__init__.py | 12133432 | |
ifduyue/django | refs/heads/master | tests/migrations/test_migrations_squashed_extra/__init__.py | 12133432 | |
cwolferh/heat-scratch | refs/heads/master | heat/api/__init__.py | 12133432 | |
barseghyanartur/python-social-auth | refs/heads/master | examples/django_me_example/example/app/__init__.py | 12133432 | |
Hodorable/0602 | refs/heads/master | openstack_dashboard/dashboards/identity/domains/__init__.py | 12133432 | |
eestay/edx-platform | refs/heads/master | pavelib/i18n.py | 6 | """
Internationalization tasks
"""
import sys
import subprocess
from path import path
from paver.easy import task, cmdopts, needs, sh
try:
from pygments.console import colorize
except ImportError:
colorize = lambda color, text: text # pylint: disable-msg=invalid-name
@task
@needs(
"pavelib.i18n.i18n_val... |
vperron/sentry | refs/heads/master | src/sentry/api/serializers/models/team.py | 13 | from __future__ import absolute_import
import itertools
from collections import defaultdict
from sentry.api.serializers import Serializer, register, serialize
from sentry.models import (
OrganizationAccessRequest, OrganizationMemberType, Project, ProjectStatus,
Team
)
@register(Team)
class TeamSerializer(S... |
mmalyska/eve-wspace | refs/heads/develop | evewspace/Jabber/alert_methods.py | 25 | from Alerts.method_registry import registry
from jabber_method import JabberAlertMethod
registry.register("Jabber", JabberAlertMethod)
|
bavoha/export2d | refs/heads/master | render_sprite.py | 1 | bl_info = {"name": "Render Spritesheet", "category": "Render"}
import bpy
import os
import addon_utils
class RenderSpritesheetOperator(bpy.types.Operator):
bl_idname = "render.render_sprite"
bl_label = "Render Spritesheet"
def _cleanup(self,path):
files = [ f for f in os.listdir(path) if f.e... |
saisai/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/commitinfo.py | 118 | # 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 ... |
luistorresm/odoo | refs/heads/8.0 | addons/website_membership/controllers/__init__.py | 7372 | import main
|
blacklin/kbengine | refs/heads/master | kbe/src/lib/python/Lib/email/parser.py | 86 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org
"""A parser of RFC 2822 and MIME email messages."""
__all__ = ['Parser', 'HeaderParser', 'BytesParser', 'BytesHeaderParser',
'FeedParser', 'BytesFeedParser']
from io ... |
gauribhoite/personfinder | refs/heads/master | env/site-packages/pygments/styles/trac.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.styles.trac
~~~~~~~~~~~~~~~~~~~~
Port of the default trac highlighter design.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Na... |
hehongliang/tensorflow | refs/heads/master | tensorflow/python/training/checkpointable/base.py | 11 | """An object-local variable management scheme."""
# 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/l... |
benoitsteiner/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/specs/python/params_ops.py | 186 | # 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 applicable ... |
Dirbaio/btcmagic | refs/heads/master | btcmagic/test_transaction.py | 1 | from unittest import TestCase
from btcmagic import transaction, convert
import os
import json
class TestTransaction(TestCase):
def setUp(self):
self.tx_bin = convert.hex_to_bytes(
'0100000001637aaf20d708fcff67bb688af6e41d1807e6883f736c50eacb6042bf6e6c829c010000008c493046022100da1e59d78bb88ca7c... |
hcrudolph/ciphersuite.info | refs/heads/master | directory/management/commands/scrapeiana.py | 1 | from django.core.management.base import BaseCommand, CommandError
from directory.models import CipherSuite, Rfc
from os import linesep
from requests import get
import re
class FailedDownloadException(Exception):
pass
class Command(BaseCommand):
help = 'Scrapes TLS cipher suites from iana.org'
# definitio... |
buckbaskin/stopsign | refs/heads/master | src/v1/group_by_image.py | 1 | #!/usr/bin/env python
import rospkg
import cv2
import datetime
import gc
import joblib
import numpy as np
import pandas as pd
from imblearn.under_sampling import RandomUnderSampler
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.gaussian_process import GaussianProcessClassifier
from sklearn.line... |
boomsbloom/dtm-fmri | refs/heads/master | DTM/for_gensim/lib/python2.7/site-packages/boto/kinesis/__init__.py | 22 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... |
ctiller/grpc | refs/heads/master | tools/run_tests/performance/massage_qps_stats.py | 25 | # Copyright 2017 gRPC 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 applicable law or agreed to in writing... |
ThinkingBridge/platform_external_chromium_org | refs/heads/kitkat | third_party/tlslite/tlslite/utils/keyfactory.py | 361 | """Factory functions for asymmetric cryptography.
@sort: generateRSAKey, parseXMLKey, parsePEMKey, parseAsPublicKey,
parseAsPrivateKey
"""
from compat import *
from RSAKey import RSAKey
from Python_RSAKey import Python_RSAKey
import cryptomath
if cryptomath.m2cryptoLoaded:
from OpenSSL_RSAKey import OpenSSL_RSAK... |
buguelos/odoo | refs/heads/master | addons/lunch/tests/test_lunch.py | 345 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
agaffney/ansible | refs/heads/devel | test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/action/net_base.py | 47 | # Copyright: (c) 2015, Ansible Inc,
# 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
import copy
from ansible.errors import AnsibleError
from ansible.plugins.action import ActionBase
fro... |
rkokkelk/CouchPotatoServer | refs/heads/master | libs/pyutil/test/deprecated/test_xor.py | 106 | #!/usr/bin/env python
# Copyright (c) 2002-2009 Zooko Wilcox-O'Hearn
# portions Copyright (c) 2001 Autonomous Zone Industries
# This file is part of pyutil; see README.rst for licensing terms.
#
import unittest
from pyutil.xor import xor
# unit tests
def _help_test(xf):
assert xf('\000', '\000') == '\000'
... |
pahaz/prospector | refs/heads/master | tests/finder/testdata/test1/package1/__init__.py | 12133432 | |
dhruvagarwal/django | refs/heads/master | tests/generic_relations_regress/__init__.py | 12133432 | |
snorp/hyde | refs/heads/master | repos/__init__.py | 12133432 | |
yungchin/pykafka | refs/heads/master | tests/pykafka/__init__.py | 12133432 | |
ELNOGAL/CMNT_00040_2016_ELN_addons | refs/heads/master | product_data_sheet/wizard/__init__.py | 2 | # -*- coding: utf-8 -*-
# Copyright 2021 El Nogal - Pedro Gómez <pegomez@elnogal.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import copy_product_ldm |
dtsinc/DTS-Sound-Integration_CAF-Android-kernel | refs/heads/master | scripts/gcc-wrapper.py | 90 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... |
k0ste/ansible | refs/heads/devel | lib/ansible/module_utils/facts/network/darwin.py | 128 | # This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that ... |
lenoch/tagsetbench | refs/heads/master | html_writer.py | 1 | from collections import OrderedDict
from pathlib import PosixPath
with PosixPath(__file__).with_name('template.html').open() as f:
raw_template = f.read()
before_content, after_content = raw_template.split('\n{content}\n')
# TODO: možná vyhodit?
def header(title='', argv=None):
if not argv:
argv = ... |
wskplho/sl4a | refs/heads/master | python/src/Tools/scripts/methfix.py | 96 | #! /usr/bin/env python
# Fix Python source files to avoid using
# def method(self, (arg1, ..., argn)):
# instead of the more rational
# def method(self, arg1, ..., argn):
#
# Command line arguments are files or directories to be processed.
# Directories are searched recursively for files whose name looks
#... |
martydill/url_shortener | refs/heads/master | code/venv/lib/python2.7/site-packages/dateutil/__init__.py | 133 | # -*- coding: utf-8 -*-
__version__ = "2.4.2"
|
biswajitsahu/kuma | refs/heads/master | vendor/packages/pygments/lexers/web.py | 77 | # -*- coding: utf-8 -*-
"""
pygments.lexers.web
~~~~~~~~~~~~~~~~~~~
Just export previously exported lexers.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexers.html import HtmlLexer, DtdLexer, XmlLexer, XsltLexer, \
... |
RalphBariz/RalphsDotNet | refs/heads/master | Old/RalphsDotNet.Apps.OptimizationStudio/Resources/PyLib/numpy/core/arrayprint.py | 55 | """Array printing function
$Id: arrayprint.py,v 1.9 2005/09/13 13:58:44 teoliphant Exp $
"""
__all__ = ["array2string", "set_printoptions", "get_printoptions"]
__docformat__ = 'restructuredtext'
#
# Written by Konrad Hinsen <hinsenk@ere.umontreal.ca>
# last revision: 1996-3-13
# modified by Jim Hugunin 1997-3-3 for r... |
wsoula/jenkins-job-builder | refs/heads/master | tests/publishers/test_publishers.py | 11 | # Joint copyright:
# - Copyright 2012,2013 Wikimedia Foundation
# - Copyright 2012,2013 Antoine "hashar" Musso
# - Copyright 2013 Arnaud Fabre
#
# 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 ... |
sexroute/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/distutils/unixccompiler.py | 33 | """distutils.unixccompiler
Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
* macros defined with -Dname[=value]
* macros undefined with -Uname
* include search directories specified with -Idir
* libraries specified with -lllib
* library... |
mabevillar/rmtk | refs/heads/master | rmtk/plotting/common/parse_exposure.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# LICENSE
#
# Copyright (c) 2010-2014, GEM Foundation, V. Silva
#
# The Risk Modellers Toolkit is free software: you can redistribute
# it and/or modify it under the terms of the GNU Affero General Public
# License as published by... |
Ahmad31/Web_Flask_Cassandra | refs/heads/master | flask/lib/python2.7/site-packages/pip/_vendor/re-vendor.py | 1240 | import os
import sys
import pip
import glob
import shutil
here = os.path.abspath(os.path.dirname(__file__))
def usage():
print("Usage: re-vendor.py [clean|vendor]")
sys.exit(1)
def clean():
for fn in os.listdir(here):
dirname = os.path.join(here, fn)
if os.path.isdir(dirname):
... |
praekelt/txtalert | refs/heads/develop | txtalert/apps/general/__init__.py | 12133432 | |
Zhongqilong/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_email/test__header_value_parser.py | 68 | import string
import unittest
from email import _header_value_parser as parser
from email import errors
from email import policy
from test.test_email import TestEmailBase, parameterize
class TestTokens(TestEmailBase):
# EWWhiteSpaceTerminal
def test_EWWhiteSpaceTerminal(self):
x = parser.EWWhiteSpace... |
pyq881120/Empire | refs/heads/master | lib/modules/persistence/elevated/registry.py | 13 | import os
from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-Registry',
'Author': ['@mattifestation', '@harmj0y'],
'Description': ('Persist a stager (or script) via the HKLM:SOFTWARE\Microsoft\Windows\C... |
ashishnitinpatil/django_appengine_project_template | refs/heads/master | django/utils/text.py | 104 | from __future__ import unicode_literals
import re
import unicodedata
from gzip import GzipFile
from io import BytesIO
from django.utils.encoding import force_text
from django.utils.functional import allow_lazy, SimpleLazyObject
from django.utils import six
from django.utils.six.moves import html_entities
from django.... |
ingadhoc/product | refs/heads/13.0 | product_uoms_sale/models/__init__.py | 1 | ##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import product_uoms
from . import product_product
from . import sa... |
alheinecke/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/distributions/python/ops/normal.py | 7 | # 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... |
stenskjaer/scrapy | refs/heads/master | tests/test_webclient.py | 112 | """
from twisted.internet import defer
Tests borrowed from the twisted.web.client tests.
"""
import os
from six.moves.urllib.parse import urlparse
from twisted.trial import unittest
from twisted.web import server, static, error, util
from twisted.internet import reactor, defer
from twisted.test.proto_helpers import St... |
takeflight/wagtail | refs/heads/master | wagtail/core/migrations/0002_initial_data.py | 24 | # -*- coding: utf-8 -*-
from django.db import migrations
def initial_data(apps, schema_editor):
ContentType = apps.get_model('contenttypes.ContentType')
Group = apps.get_model('auth.Group')
Page = apps.get_model('wagtailcore.Page')
Site = apps.get_model('wagtailcore.Site')
GroupPagePermission = ap... |
ujenmr/ansible | refs/heads/devel | lib/ansible/module_utils/network/a10/a10.py | 52 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... |
robk5uj/invenio | refs/heads/bft2012-01-03 | modules/bibsword/lib/bibsword_webinterface.py | 31 | '''
Forward to ArXiv.org source code
'''
## This file is part of Invenio.
## Copyright (C) 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, o... |
kemalakyol48/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/pdb.py | 47 | #! /usr/bin/env python3
"""
The Python Debugger Pdb
=======================
To use the debugger in its simplest form:
>>> import pdb
>>> pdb.run('<a statement>')
The debugger's prompt is '(Pdb) '. This will stop in the first
function call in <a statement>.
Alternatively, if a statement terminated ... |
baroquebobcat/pants | refs/heads/master | tests/python/pants_test/backend/codegen/protobuf/java/test_protobuf_gen.py | 1 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from textwrap import... |
Kolguyev/samples | refs/heads/master | vaxel_beraknare/VaxelRaknare_v2.py | 1 |
class ValorRaknare(object):
''' Beraknar antalet av en viss valor,
givet ett belopp.
'''
def __init__(self, valor):
self.valor = valor
def AntalOchAterstaende(self, belopp):
''' Raknar antalet av en valor '''
aterstaende = belopp%self.valor
antal = belopp/self.... |
intgr/django | refs/heads/master | tests/template_tests/filter_tests/test_unordered_list.py | 7 | from django.template.defaultfilters import unordered_list
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class UnorderedListTests(SimpleTestCase):
@setup({'unordered_list01': '{{ a|unordered_list }}'})
def test_unordered_list01(self):
o... |
ddico/odoomrp-utils | refs/heads/8.0 | account_invoice_supplier_ref_required/__init__.py | 44 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
|
jokey2k/sentry | refs/heads/master | src/sentry/web/frontend/organization_auth_settings.py | 1 | from __future__ import absolute_import
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.models import F
from django.http import HttpResponse, HttpResponseRedirect
from django.utils.translation import ugettext_lazy as _
from sentry import... |
pescobar/easybuild-framework | refs/heads/master | easybuild/toolchains/pmkl.py | 2 | ##
# Copyright 2012-2020 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://www.vscentrum.be),
# Flemish Research Foundation (F... |
ernestoalarcon/competitiveprogramming | refs/heads/master | quicksort1.py | 1 | #!/bin/python
def partition(ar):
left = []
right = []
equal = []
if len(ar) > 0:
pivot = ar[0]
for x in ar:
if x < pivot:
left.append(x)
elif x > pivot:
right.append(x)
else:
equal.append(x)
return le... |
anupcshan/bazel | refs/heads/master | third_party/py/gflags/tests/gflags_googletest.py | 132 | #!/usr/bin/env python
# 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 l... |
chemelnucfin/tensorflow | refs/heads/master | tensorflow/python/platform/logging_test.py | 210 | # Copyright 2015 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... |
popazerty/try | refs/heads/master | tools/create_picon_links.py | 192 | #
# create links for picon
# usage: create_picon_links lamedb
# run in picon directory.
# It will read the servicenames from the lamedb and create symlinks
# for the servicereference names.
import os, sys
f = open(sys.argv[1]).readlines()
f = f[f.index("services\n")+1:-3]
while len(f):
ref = [int(x, 0x10) for x ... |
jamesbeebop/CouchPotatoServer | refs/heads/master | libs/pyutil/test/current/json_tests/test_fail.py | 106 | from unittest import TestCase
from pyutil import jsonutil as json
# Fri Dec 30 18:57:26 2005
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json... |
uannight/reposan | refs/heads/master | plugin.video.tvalacarta/lib/simplejson/scanner.py | 928 | """JSON token scanner
"""
import re
try:
from simplejson._speedups import make_scanner as c_make_scanner
except ImportError:
c_make_scanner = None
__all__ = ['make_scanner']
NUMBER_RE = re.compile(
r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
(re.VERBOSE | re.MULTILINE | re.DOTALL))
def py_make_scan... |
waytai/odoo | refs/heads/8.0 | addons/base_geolocalize/__openerp__.py | 211 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013_Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
rdonnelly/ultimate-league-app | refs/heads/master | src/ultimate/index/migrations/0003_auto_20170416_2031.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('index', '0002_staticcontent_type'),
]
operations = [
migrations.AddField(
model_name='staticcontent',
... |
aterrel/datashape | refs/heads/master | datashape/predicates.py | 1 | from .util import collect, dshape
from .internal_utils import remove
from .coretypes import *
# https://github.com/ContinuumIO/datashape/blob/master/docs/source/types.rst
__all__ = ['isdimension', 'ishomogeneous', 'istabular', 'isfixed']
dimension_types = (Fixed, Var, Ellipsis)
isunit = lambda x: isinstance(x, Unit... |
iniverno/RnR-LLC | refs/heads/master | simics-3.0-install/simics-3.0.31/amd64-linux/lib/python2.4/encodings/cp866.py | 15 | """ Python Character Mapping Codec generated from 'CP866.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,error... |
Ashaba/rms | refs/heads/master | rmslocalenv/lib/python2.7/site-packages/xhtml2pdf/util.py | 23 | # -*- coding: utf-8 -*-
from reportlab.lib.colors import Color, CMYKColor, getAllNamedColors, toColor, \
HexColor
from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_RIGHT, TA_JUSTIFY
from reportlab.lib.units import inch, cm
import base64
import httplib
import logging
import mimetypes
import os.path
import re
im... |
Austin503/pyglet | refs/heads/master | contrib/wydget/wydget/style.py | 29 |
from pyglet.gl import *
from pyglet import font
from layout import *
import util
class Style(object):
font_name = ''
font_size = 14
def getFont(self, name=None, size=None):
if name is None: name = self.font_name
if size is None: size = self.font_size
return font.load(name, size)... |
neharejanjeva/techstitution | refs/heads/master | app/logs/venv/lib/python2.7/site-packages/wheel/test/test_wheelfile.py | 327 | import os
import wheel.install
import wheel.archive
import hashlib
try:
from StringIO import StringIO
except ImportError:
from io import BytesIO as StringIO
import codecs
import zipfile
import pytest
import shutil
import tempfile
from contextlib import contextmanager
@contextmanager
def environ(key, value):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.