repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
yufengg/tensorflow | refs/heads/master | tensorflow/python/lib/io/file_io_test.py | 31 | # 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... |
supersven/intellij-community | refs/heads/master | python/helpers/docutils/parsers/rst/languages/de.py | 57 | # $Id: de.py 5174 2007-05-31 00:01:52Z wiemann $
# Authors: Engelbert Gruber <grubert@users.sourceforge.net>;
# Lea Wiemann <LeWiemann@gmail.com>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.... |
plissonf/scikit-learn | refs/heads/master | sklearn/neighbors/approximate.py | 71 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... |
aperigault/ansible | refs/heads/devel | lib/ansible/plugins/filter/urlsplit.py | 146 | # Copyright (c) 2017 Ansible Project
# 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': '1.1',
'status': ['preview'],
'supported_by':... |
Hellowlol/plexpy | refs/heads/master | lib/mutagen/id3/_specs.py | 22 | # -*- coding: utf-8 -*-
# Copyright (C) 2005 Michael Urman
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
import struct
from struct import unpack, pack
from warnings import wa... |
synappio/chapman | refs/heads/master | chapman/script.py | 1 | import os
import time
import base64
import logging.config
from ConfigParser import ConfigParser
from docopt import docopt
from pyramid.paster import bootstrap
from formencode import validators as fev
from formencode import schema as fes
from formencode import variabledecode as fevd
from formencode import foreach as fe... |
phoenix367/AAMToolbox | refs/heads/master | contribute/gtest/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... |
custode/reviewboard | refs/heads/master | contrib/internal/conf/settings_local.py | 7 | from __future__ import unicode_literals
import os
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'build-media.db',
}
}
LOCAL_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__),
'..', '..', '..', 'reviewboard'))
... |
csababarta/ntdsxtract | refs/heads/master | ntds/dsdatabase.py | 1 | # This file is part of ntdsxtract.
#
# ntdsxtract 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.
#
# ntdsxtract is distributed in the ... |
gritlogic/incubator-airflow | refs/heads/master | airflow/example_dags/example_latest_only.py | 10 | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... |
hazelcast/hazelcast-python-client | refs/heads/master | tests/hzrc/RemoteController.py | 1 | # fmt: off
#
# Autogenerated by Thrift Compiler (0.13.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:new_style,utf8strings
#
from thrift.Thrift import TType, TMessageType, TFrozenDict, TException, TApplicationException
from thrift.protocol.TProtocol import TProtocolExce... |
aidanlister/django | refs/heads/master | tests/model_inheritance/same_model_name/__init__.py | 12133432 | |
jathak/ok-client | refs/heads/master | tests/sources/ok_test/__init__.py | 12133432 | |
drfrink/adminLTE_Django | refs/heads/master | webappdemo/models.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
# Create your models here.
|
osnoob/flkweb | refs/heads/master | apps/config.py | 1 | #!/usr/bin/env python
# -*-coding:utf-8-*-
__author__ = "Allen Woo"
class Role():
'''
用户角色权重,使用二进制
'''
PERMISSIONS = [
("USER",0b00000001), #普通用户
("ADMIN",0b01000000), #管理员
("ROOT",0b10000000) #超级管理员
]
USER = 0b00000001
ADMIN =0b01000000
ROOT =0b10000000
|
bobcyw/django | refs/heads/master | tests/admin_scripts/custom_templates/project_template/project_name/settings.py | 738 | # Django settings for {{ project_name }} test project.
|
mozilla/mozillians | refs/heads/master | mozillians/funfacts/migrations/0001_initial.py | 9 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import mozillians.funfacts.models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='FunFact',
fields=[
... |
broferek/ansible | refs/heads/devel | lib/ansible/modules/network/check_point/checkpoint_run_script.py | 18 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
terbolous/SickRage | refs/heads/master | lib/stevedore/driver.py | 21 | from .exception import NoMatches, MultipleMatches
from .named import NamedExtensionManager
class DriverManager(NamedExtensionManager):
"""Load a single plugin with a given name from the namespace.
:param namespace: The namespace for the entry points.
:type namespace: str
:param name: The name of the ... |
HyperloopTeam/FullOpenMDAO | refs/heads/master | lib/python2.7/site-packages/openmdao.main-0.13.0-py2.7.egg/openmdao/main/test/test_replace3.py | 1 | import unittest
from openmdao.main.api import Component, Assembly, Driver, set_as_top
from openmdao.main.datatypes.api import Float
class BaseComp(Component):
# inputs: None
# outputs: myout
myout = Float(3.14, iotype='out')
def execute(self):
self.myout *= 0.5
class Extende... |
sankhesh/VTK | refs/heads/master | ThirdParty/Twisted/twisted/python/dist.py | 23 | # -*- test-case-name: twisted.python.test.test_dist -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Distutils convenience functionality.
Don't use this outside of Twisted.
Maintainer: Christopher Armstrong
"""
from distutils.command import build_scripts, install_data, build_ext
from ... |
DEKHTIARJonathan/BilletterieUTC | refs/heads/master | badgingServer/Install/swigwin-3.0.7/Examples/test-suite/python/inplaceadd_runme.py | 4 | import inplaceadd
a = inplaceadd.A(7)
a += 5
if a.val != 12:
print a.val
raise RuntimeError
a -= 5
if a.val != 7:
raise RuntimeError
a *= 2
if a.val != 14:
raise RuntimeError
a += a
if a.val != 28:
raise RuntimeError
|
gmorph/ardupilot | refs/heads/master | mk/PX4/Tools/genmsg/src/genmsg/__init__.py | 215 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 ... |
rackerlabs/lunr | refs/heads/master | testlunr/functional/test_lock.py | 2 | #! /usr/bin/env python
# Copyright (c) 2011-2016 Rackspace US, 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 ap... |
phw/weblate | refs/heads/master | weblate/trans/tests/test_edit.py | 2 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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, eith... |
zeedunk/statsite | refs/heads/master | sinks/influxdb.py | 5 | """
Supports flushing statsite metrics to InfluxDB
"""
import sys
import httplib, urllib, logging, json, re
##
# InfluxDB sink for statsite
# ==========================
#
# Use with the following stream command:
#
# stream_command = python sinks/influxdb.py influxdb.ini INFO
#
# The InfluxDB sink takes an INI format ... |
codekaki/odoo | refs/heads/7.0 | addons/survey/__init__.py | 66 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
xaedes/canopen_301_402 | refs/heads/master | src/canopen_301_402/__init__.py | 12133432 | |
christian6/django-upicr | refs/heads/master | icrperu/apps/logistica/inclogistica/__init__.py | 12133432 | |
hkariti/ansible-modules-core | refs/heads/devel | files/ini_file.py | 91 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Jan-Piet Mens <jpmens () 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 L... |
waytai/odoo | refs/heads/8.0 | addons/l10n_gt/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Soluciones Tecnologócias Prisma S.A. All Rights Reserved.
# José Rodrigo Fernández Menegazzo, Soluciones Tecnologócias Prisma S.A.
# (http://www.solucionesprisma.com)
#
# This program is ... |
amimoto/walky | refs/heads/master | tests/walkydata/generate-self-signed-certs.py | 1 | from OpenSSL import crypto, SSL
from socket import gethostname
from pprint import pprint
from time import gmtime, mktime
CERT_FILE = "ssl.crt"
KEY_FILE = "ssl.key"
def create_self_signed_cert():
# create a key pair
k = crypto.PKey()
k.generate_key(crypto.TYPE_RSA, 1024)
# create a self-signed cert
... |
kslundberg/pants | refs/heads/master | tests/python/pants_test/net/http/test_fetcher.py | 14 | # 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)
import os
from conte... |
ajlopez/PythonSharp | refs/heads/master | Src/PythonSharp.Tests/Examples/complex.py | 1 | class Complex:
def __init__(self, realpart, imagpart):
self.r = realpart
self.i = imagpart
x = Complex(3.0, 4.5)
|
ibinti/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/core/handlers/modpython.py | 189 | import os
from pprint import pformat
import sys
from warnings import warn
from django import http
from django.core import signals
from django.core.handlers.base import BaseHandler
from django.core.urlresolvers import set_script_prefix
from django.utils import datastructures
from django.utils.encoding import force_unic... |
grigoriy-chirkov/mipt-mips-2015 | refs/heads/master | libs/gtest-1.6.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... |
infobloxopen/neutron | refs/heads/master | neutron/db/common_db_mixin.py | 13 | # Copyright (c) 2014 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... |
Laurawly/tvm-1 | refs/heads/master | python/tvm/auto_scheduler/dispatcher.py | 1 | # 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... |
genome/flow-core | refs/heads/master | flow/shell_command/petri_net/actions.py | 1 | from flow.petri_net.actions.merge import BasicMergeAction
import logging
LOG = logging.getLogger(__name__)
class ShellCommandDispatchAction(BasicMergeAction):
place_refs = [
"msg: dispatch_failure",
"msg: dispatch_success",
"msg: execute_begin",
"msg: execute_fai... |
jnewland/home-assistant | refs/heads/ci | homeassistant/components/raincloud/sensor.py | 7 | """Support for Melnor RainCloud sprinkler water timer."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_MONITORED_CONDITIONS
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.icon import icon_for_b... |
SungEun-Steve-Kim/test-mp | refs/heads/master | tests/bytecode/mp-tests/augassign1.py | 22 | [] = ()
x += 1
x.y += 1
x.f().y += 1
x[1] += 2
|
Celedhrim/persomov | refs/heads/master | libs/caper/__init__.py | 81 | # Copyright 2013 Dean Gardiner <gardiner91@gmail.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 required by applicable law or a... |
huawenyu/Design-Patterns-in-C | refs/heads/master | auto-gen/tools/comn.py | 1 |
def get_value_else_default(rdict, key, def_val):
rval = rdict.get(key, def_val)
if not rval:
rval = def_val
return rval
def parse_parameters(params_str):
params = params_str.split(',')
args = []
for one_param in params:
find = False
for idx in range(len(one_param)-1, 0, -1):
one_char = one_param[idx]
... |
Bloodyaugust/sugarlabcppboilerplate | refs/heads/master | lib/boost/libs/python/test/calling_conventions_mf.py | 12 | # Copyright Nicolas Lelong, 2010. Distributed under the Boost
# Software License, Version 1.0 (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from calling_conventions_mf_ext import *
>>> x = X__cdecl()
>>> x.f0()
>>> x.g0()
>>> x.f1(1)
>>> x.g1(1)
>>> x.f2(... |
eformat/vertx-web | refs/heads/master | vertx-web/src/test/sockjs-protocol/venv/lib/python2.7/site-packages/setuptools/command/register.py | 475 | from distutils.command.register import register as _register
class register(_register):
__doc__ = _register.__doc__
def run(self):
# Make sure that we are using valid current name/version info
self.run_command('egg_info')
_register.run(self)
|
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/wearables/bracelet/item_bracelet_r_set_officer_utility_b_01_01.py | 2 | import sys
def setup(core, object):
object.setStfFilename('static_item_n')
object.setStfName('item_bracelet_r_set_officer_utility_b_01_01')
object.setDetailFilename('static_item_d')
object.setDetailName('item_bracelet_r_set_officer_utility_b_01_01')
object.setStringAttribute('class_required', 'Officer')
object.s... |
gurneyalex/OpenUpgrade | refs/heads/master | addons/web_tests_demo/__init__.py | 423 | from openerp.osv import orm, fields
class TestObject(orm.TransientModel):
_name = 'web_tests_demo.model'
_columns = {
'name': fields.char("Name", required=True),
'thing': fields.char("Thing"),
'other': fields.char("Other", required=True)
}
_defaults = {
'other': "bob"
... |
sknepneklab/SAMoS | refs/heads/development | analysis/batch_nematic/batch_analyze_nematic_R16b.py | 1 | # ################################################################
#
# Active Particles on Curved Spaces (APCS)
#
# Author: Silke Henkes
#
# ICSMB, Department of Physics
# University of Aberdeen
# Author: Rastko Sknepnek
#
# Division of Physics
# School of Engineering, Physics and Mathem... |
deepmind/spriteworld | refs/heads/master | spriteworld/tasks.py | 1 | # Copyright 2019 DeepMind Technologies 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
google/mirandum | refs/heads/master | alerts/donations/migrations/0002_toplist.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
krzychb/rtd-test-bed | refs/heads/master | components/esptool_py/esptool/test/test_imagegen.py | 2 | #!/usr/bin/env python
import os
import os.path
import subprocess
import struct
import sys
import unittest
import hashlib
from elftools.elf.elffile import ELFFile
TEST_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)), "elf2image")
os.chdir(TEST_DIR)
try:
ESPTOOL_PY = os.environ["ESPTOOL_PY"]
except Ke... |
FSX/misaka | refs/heads/master | tests/test_xss_protection.py | 3 | # -*- coding: utf-8 -*-
from chibitest import TestCase, ok
from misaka import escape_html, Markdown, SaferHtmlRenderer
class EscapeHtmlTest(TestCase):
def test_escape_html(self):
ok(escape_html('a&<>"\'/')) == 'a&<>"'/'
def test_escape_html_slash(self):
ok(escape_html('a&<... |
danmergens/mi-instrument | refs/heads/master | mi/dataset/parser/test/test_velpt_ab.py | 7 | #!/usr/bin/env python
"""
@package mi.dataset.parser.test.test_velpt_ab
@file mi-dataset/mi/dataset/parser/test/test_velpt_ab_dcl.py
@author Chris Goodrich
@brief Test code for the velpt_ab parser
"""
__author__ = 'Chris Goodrich'
import os
import re
from nose.plugins.attrib import attr
from mi.core.exceptions imp... |
Stanford-Online/edx-platform | refs/heads/master | openedx/stanford/djangoapps/auth_lagunita/__init__.py | 1 | # -*- coding: utf-8 -*-
"""
Record extra lagunita-centric user data
"""
from __future__ import unicode_literals
|
clarammdantas/Online-Jugdes-Problems | refs/heads/master | online_judge_solutions/uri-1923.py | 2 | # URI 1923 - Rerisson and Barbecue
n, g = map(int, raw_input().split())
friends = {}
for i in range(n):
p1, p2 = raw_input().split()
if friends.get(p1) == None:
friends[p1] = [p2]
else:
friends[p1].append(p2)
if friends.get(p2) == None:
friends[p2] = [p1]
else:
friends[p2].append(p1)
level = {"Reriss... |
archf/ansible | refs/heads/devel | lib/ansible/modules/network/f5/bigip_monitor_tcp.py | 16 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2017 F5 Networks 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
# ... |
SteveXiSong/UW-Madison-ECE757-S15-MulticastSnooping | refs/heads/master | src/arch/x86/isa/insts/general_purpose/control_transfer/jump.py | 40 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
ssteinerx/pingparser | refs/heads/master | setup.py | 2 | #!/usr/bin/env python
# coding: utf-8
from setuptools import setup
try:
import configparser
except ImportError:
import ConfigParser as configparser
SETUP_ARGS = {"name" : ("metadata",),
"version" : ("metadata",),
"description" : ("metadata", "summary"),
"author" : ("... |
ApplebyCoin/ApplebyCoin | refs/heads/master | share/demurrage_parameters_arithmetic.py | 41 | #!/usr/bin/env python
from __future__ import division
try:
from gmpy2 import mpq as Fraction
except ImportError:
from fractions import Fraction
TOTAL_SUPPLY = 10**16 - 1
EQ_HEIGHT = 161280
TITHE_RATIO = Fraction(4,5)
TITHE_AMOUNT = TOTAL_SUPPLY * TITHE_RATIO / EQ_HEIGHT
DEMURRAGE_RATE = 2**20
de... |
timlinux/QGIS | refs/heads/master | python/core/auto_additions/qgsmapclippingregion.py | 29 | # The following has been generated automatically from src/core/qgsmapclippingregion.h
# monkey patching scoped based enum
QgsMapClippingRegion.FeatureClippingType.ClipToIntersection.__doc__ = "Clip the geometry of these features to the region prior to rendering (i.e. feature boundaries will follow the clip region)"
Qgs... |
lexus42/4022322442test | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_functools.py | 727 | def partial(func, *args, **keywords):
def newfunc(*fargs, **fkeywords):
newkeywords = keywords.copy()
newkeywords.update(fkeywords)
return func(*(args + fargs), **newkeywords)
newfunc.func = func
newfunc.args = args
newfunc.keywords = keywords
return newfunc
def reduce(func,... |
openiitbombayx/edx-platform | refs/heads/master | lms/djangoapps/django_comment_client/tests/unicode.py | 206 | # coding=utf-8
class UnicodeTestMixin(object):
def test_ascii(self):
self._test_unicode_data(u"This post contains ASCII.")
def test_latin_1(self):
self._test_unicode_data(u"Thís pøst çòñtáins Lätin-1 tæxt")
def test_CJK(self):
self._test_unicode_data(u"イんノ丂 アo丂イ co刀イムノ刀丂 cフズ")
... |
Dave667/service | refs/heads/master | script.module.requests/lib/requests/packages/charade/langgreekmodel.py | 22 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Ri... |
chriskiehl/Gooey | refs/heads/master | gooey/gui/util/filedrop.py | 1 | import wx
class FileDrop(wx.FileDropTarget):
def __init__(self, window, dropStrategy=None):
wx.FileDropTarget.__init__(self)
self.window = window
self.dropHandler = dropStrategy or self._defaultStrategy
def OnDropFiles(self, x, y, filenames):
return self.dropHandler(... |
naokimiyasaka/sublime-text | refs/heads/master | Backup/20130812102255/Package Control/lib/windows/ntlm/des.py | 4 | # This file is part of 'NTLM Authorization Proxy Server' http://sourceforge.net/projects/ntlmaps/
# Copyright 2001 Dmitry A. Rozmanov <dima@xenon.spb.ru>
#
# This library 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 Soft... |
hryamzik/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/ec2_snapshot_copy.py | 26 | #!/usr/bin/python
# Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
module: ec2_snapshot_copy
short_... |
vitan/django | refs/heads/master | tests/sessions_tests/tests.py | 8 | import base64
import os
import shutil
import string
import tempfile
import unittest
from datetime import timedelta
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.sessions.backends.cached_db import \
SessionStore as CacheDBSession... |
YKonovalov/guesti | refs/heads/master | guesti/cloud/os/commands.py | 1 | # This file is part of GuestI.
#
# GuestI 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.
#
# SSP is distributed in the hope that it wi... |
Pretio/boto | refs/heads/develop | boto/mturk/connection.py | 112 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
technologiescollege/Blockly-rduino-communication | refs/heads/master | scripts_XP/Lib/idlelib/idle_test/test_text.py | 14 | # Test mock_tk.Text class against tkinter.Text class by running same tests with both.
import unittest
from test.support import requires
from _tkinter import TclError
class TextTest(object):
hw = 'hello\nworld' # usual initial insert after initialization
hwn = hw+'\n' # \n present at initialization, before ... |
hlmnrmr/superdesk-core | refs/heads/master | superdesk/io/commands/__init__.py | 395 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
|
JoshuaRBogart/unreal_tools | refs/heads/master | vertex_animation.py | 1 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# This program is ... |
crobby/sahara | refs/heads/master | sahara/plugins/vanilla/edp_engine.py | 15 | # Copyright (c) 2014 Mirantis 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 agreed to in writ... |
glwu/python-for-android | refs/heads/master | python-modules/twisted/twisted/web/soap.py | 54 | # -*- test-case-name: twisted.web.test.test_soap -*-
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
SOAP support for twisted.web.
Requires SOAPpy 0.10.1 or later.
Maintainer: Itamar Shtull-Trauring
Future plans:
SOAPContext support of some kind.
Pluggable method lookup polici... |
JFriel/honours_project | refs/heads/master | venv/lib/python2.7/site-packages/pip/vendor/html5lib/sanitizer.py | 805 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... |
cephalization/autokey | refs/heads/master | src/test/configurationmanagertest.py | 53 | import unittest
import lib.configurationmanager as conf
from lib.phrase import *
CONFIG_FILE = "../../config/abbr.ini"
class LegacyImporterTest(unittest.TestCase):
def setUp(self):
self.importer = conf.LegacyImporter()
self.importer.load_config(CONFIG_FILE)
def testGlobalSetting... |
havard024/prego | refs/heads/master | venv/lib/python2.7/site-packages/south/tests/brokenapp/migrations/__init__.py | 12133432 | |
leafclick/intellij-community | refs/heads/master | python/testData/formatter/fStringFragmentWrappingSplitInsideExpression.py | 12 | s = f'aaaaaa{oct(42)}'
|
woltage/ansible | refs/heads/devel | lib/ansible/executor/task_queue_manager.py | 5 | # (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... |
pedrobaeza/odoo | refs/heads/master | addons/website_event_sale/controllers/main.py | 54 | # -*- 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 ... |
croxis/SpaceDrive | refs/heads/master | spacedrive/renderpipeline/toolkit/pathtracing_reference/res/tex/convert_cubemap.py | 1 | """
Converts the cubemap to a spherical one
"""
from __future__ import division, print_function
from panda3d.core import *
load_prc_file_data("", "textures-power-2 none")
import direct.directbase.DirectStart
cubemap = loader.load_cube_map("../../../../data/default_cubemap/source/#.jpg")
w, h = 4096, 204... |
direvus/ansible | refs/heads/devel | lib/ansible/plugins/loader.py | 10 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> and others
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ... |
defionscode/ansible | refs/heads/devel | lib/ansible/module_utils/network/fortimanager/fortimanager.py | 64 | # 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... |
indictranstech/ebuy-now-frappe | refs/heads/develop | frappe/defaults.py | 4 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.desk.notifications import clear_notifications
# Note: DefaultValue records are identified by parenttype
# __default, __global or 'User Permission'
comm... |
landryb/QGIS | refs/heads/master | python/plugins/processing/gui/AlgorithmExecutor.py | 11 | # -*- coding: utf-8 -*-
"""
***************************************************************************
AlgorithmExecutor.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*********************... |
100star/h2o | refs/heads/master | py/testdir_single_jvm/rf_simple_example.py | 9 | import sys
import json
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_import as h2i, h2o_args
#
# This is intended to be the simplest possible RF example.
# Look at sandbox/commands.log for REST API requests to H2O.
#
print "--------------------------------------------------------------------------------... |
kevinmel2000/sl4a | refs/heads/master | python/src/Lib/test/test_support.py | 48 | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.test_support':
raise ImportError('test_support must be imported from the test package')
import contextlib
import errno
import socket
import sys
import os
import shutil
import warnings
import unittest
__all__ = ["Error", "TestFaile... |
ravello/ansible | refs/heads/devel | docsite/_themes/srtd/__init__.py | 1504 | """Sphinx ReadTheDocs theme.
From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
"""
import os
VERSION = (0, 1, 5)
__version__ = ".".join(str(v) for v in VERSION)
__version_full__ = __version__
def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = os.path.abspath(os.path.dirn... |
blinkboxbooks/android-app | refs/heads/master | app/scripts/itemizer.py | 1 | #!/usr/bin/env python
import sys
outdata = ''
def printitem(inputstring):
global outdata
inputstring = inputstring.strip()
name = inputstring[:inputstring.find("=")]
item = inputstring[inputstring.find('"')+1:-1]
outdata += '<item name="' + name + '">' + item + '</item>\n'
for line in iter(sys.s... |
NervanaSystems/neon | refs/heads/master | neon/util/shelver.py | 1 | # ******************************************************************************
# Copyright 2017-2018 Intel Corporation
#
# 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.apa... |
tuxerman/cdn-old | refs/heads/master | cdn/openstack/common/timeutils.py | 20 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... |
jeremyfix/pylearn2 | refs/heads/master | pylearn2/testing/datasets.py | 7 | """ Simple datasets to be used for unit tests. """
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import numpy as np
from theano.compat.six.move... |
sahutd/youtube-dl | refs/heads/master | test/__init__.py | 12133432 | |
dantebarba/docker-media-server | refs/heads/master | plex/Sub-Zero.bundle/Contents/Libraries/Shared/fcache/__init__.py | 12133432 | |
TridevGuha/django | refs/heads/master | tests/view_tests/app3/__init__.py | 12133432 | |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.7.2/Lib/lib-tk/test/test_ttk/__init__.py | 12133432 | |
valintinr/opennode-management | refs/heads/master | opennode/oms/backend/__init__.py | 12133432 | |
mgit-at/ansible | refs/heads/devel | test/legacy/setup_gce.py | 185 | '''
Create GCE resources for use in integration tests.
Takes a prefix as a command-line argument and creates two persistent disks named
${prefix}-base and ${prefix}-extra and a snapshot of the base disk named
${prefix}-snapshot. prefix will be forced to lowercase, to ensure the names are
legal GCE resource names.
'''
... |
bmwiedemann/osc | refs/heads/master | osc/meter.py | 5 | # Copyright (C) 2018 SUSE Linux. All rights reserved.
# This program is free software; it may be used, copied, modified
# and distributed under the terms of the GNU General Public Licence,
# either version 2, or (at your option) any later version.
try:
import progressbar as pb
have_pb_module = True
except Imp... |
axbaretto/beam | refs/heads/master | sdks/python/.tox/lint/lib/python2.7/site-packages/hamcrest/core/base_matcher.py | 6 | from __future__ import absolute_import
__author__ = "Jon Reid"
__copyright__ = "Copyright 2011 hamcrest.org"
__license__ = "BSD, see License.txt"
from hamcrest.core.matcher import Matcher
from hamcrest.core.string_description import tostring
class BaseMatcher(Matcher):
"""Base class for all :py:class:`~hamcrest.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.