repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
edgarRd/incubator-airflow | refs/heads/master | tests/dags/test_mark_success.py | 15 | # -*- coding: utf-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
#... |
archf/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/bar0/__init__.py | 12133432 | |
caotianwei/django | refs/heads/master | tests/utils_tests/__init__.py | 12133432 | |
uw-it-aca/canvas-event-consumer | refs/heads/master | events/migrations/__init__.py | 12133432 | |
molecular-toolkit/chemistry-docker-images | refs/heads/master | makefiles/buildfiles/pyscf/getresuts.py | 12133432 | |
peterbraden/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/preprocessing/text.py | 7 | """Implements a number of text preprocessing utilities."""
# Copyright 2015-present The Scikit Flow 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
#
# htt... |
jarn0ld/gnuradio | refs/heads/master | gr-wxgui/python/wxgui/histo_window.py | 47 | #
# Copyright 2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... |
RNAer/qiita | refs/heads/master | qiita_pet/handlers/stats.py | 1 | from __future__ import division
from random import choice
from moi import r_client
from tornado.gen import coroutine, Task
from qiita_db.util import get_count
from qiita_db.study import Study
from qiita_db.util import get_lat_longs
from .base_handlers import BaseHandler
class StatsHandler(BaseHandler):
def _ge... |
nuncjo/odoo | refs/heads/8.0 | addons/sale_stock/__openerp__.py | 214 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
jrk/llvm-py | refs/heads/llvm-2.9 | test/typehandle.py | 5 | #!/usr/bin/env python
from llvm.core import *
# create a type handle object
th = TypeHandle.new(Type.opaque())
# create the struct with an opaque* instead of self*
ts = Type.struct([ Type.int(), Type.pointer(th.type) ])
# unify the types
th.type.refine(ts)
# create a module, and add a "typedef"
m = Module.new('mod... |
sonya/eea | refs/heads/master | py/parsers/shp.py | 1 | #
# Copyright 2012 Sonya Huang
#
# 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... |
jondo/shogun | refs/heads/develop | examples/undocumented/python_modular/regression_linear_ridge_modular.py | 16 | #!/usr/bin/env python
###########################################################################
# linear ridge regression
###########################################################################
from numpy import array
from numpy.random import seed, rand
from tools.load import LoadMatrix
lm=LoadMatrix()
traindat ... |
citrix-openstack-build/neutron | refs/heads/master | neutron/plugins/ml2/drivers/mech_arista/mechanism_arista.py | 3 | # Copyright (c) 2013 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 or agreed to ... |
xujun10110/Hammer | refs/heads/master | lib/theHarvester/discovery/pgpsearch.py | 16 | import string
import httplib, sys
import myparser
class search_pgp:
def __init__(self,word):
self.word=word
self.results=""
self.server="pgp.rediris.es:11371"
self.hostname="pgp.rediris.es"
self.userAgent="(Mozilla/5.0 (Windows; U; Windows NT 6.0;en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6"
def process(... |
dnsserver/datahub | refs/heads/master | src/examples/python/gen_py/datahub/account/constants.py | 162 | #
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
|
WikiWatershed/gwlf-e | refs/heads/develop | CreateVariableFiles.py | 1 | import os
variable_name = raw_input("Enter the name of the variable:")
#write variable file
var_filename = "%s.py"%(variable_name)
if os.path.exists("gwlfe/"+var_filename):
raise IOError("File already exists")
else:
with open("gwlfe/"+var_filename,"w") as file:
file.write("from numpy import zeros\n"
... |
kiwitcms/Kiwi | refs/heads/master | kiwi_lint/bulk_create.py | 2 | # Copyright (c) 2018 Alexander Todorov <atodorov@MrSenko.com>
# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
from pylint import checkers, interfaces
from pylint.checkers import utils
class BulkCreateChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker... |
2013Commons/HUE-SHARK | refs/heads/master | build/env/lib/python2.7/site-packages/Django-1.2.3-py2.7.egg/django/core/__init__.py | 12133432 | |
Clemson-DPA/dpa-pipe-backend | refs/heads/master | dpa/_site/__init__.py | 12133432 | |
BehavioralInsightsTeam/edx-platform | refs/heads/release-bit | lms/djangoapps/course_wiki/__init__.py | 12133432 | |
ahb0327/intellij-community | refs/heads/master | python/testData/inspections/PyUnresolvedReferencesInspection/FromPackageImportBuiltin/importSource/__init__.py | 12133432 | |
rtucker-mozilla/mozilla_inventory | refs/heads/master | vendor-local/src/django-extensions/build/lib/django_extensions/management/__init__.py | 12133432 | |
flochaz/horizon | refs/heads/stable/juno | openstack_dashboard/dashboards/project/volumes/__init__.py | 12133432 | |
yokose-ks/edx-platform | refs/heads/gacco3/master | lms/djangoapps/django_comment_client/tests/__init__.py | 12133432 | |
bcl/pykickstart | refs/heads/master | pykickstart/errors.py | 2 | #
# errors.py: Kickstart error handling.
#
# Chris Lumens <clumens@redhat.com>
#
# This copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the GNU
# General Public License v.2. This program is distributed in the hope that it
# wil... |
pepetreshere/odoo | refs/heads/patch-2 | addons/sms/models/res_partner.py | 11 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ResPartner(models.Model):
_name = 'res.partner'
_inherit = ['res.partner', 'mail.thread.phone']
def _sms_get_default_partners(self):
""" Override of mail.thread method... |
Ssawa/Diamond | refs/heads/master | src/collectors/snmpraw/test/testsnmpraw.py | 29 | #!/usr/bin/python
# coding=utf-8
###############################################################################
import time
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from snmpraw import SNMPRawCollector
from diamond.... |
minesense/VisTrails | refs/heads/master | vistrails/gui/modules/stringformat_configuration.py | 2 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... |
DANCEcollaborative/forum-xblock | refs/heads/master | XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/django/db/models/sql/compiler.py | 32 | from itertools import izip
from django.core.exceptions import FieldError
from django.db import transaction
from django.db.backends.util import truncate_name
from django.db.models.query_utils import select_related_descend
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import Empty... |
rishirajsurti/BuildingMachineLearningSystemsWithPython | refs/heads/master | ch05/chose_instances.py | 24 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
import os
try:
import ujson as json # UltraJSON if available
except:
import json
import sys
fr... |
hynekcer/django | refs/heads/master | django/conf/locale/sq/__init__.py | 12133432 | |
medghaim/PokemonGo-Map | refs/heads/master | pogom/pgoapi/protos/__init__.py | 12133432 | |
zenist/ZLib | refs/heads/master | io/codec/url_response.py | 1 | # -*- coding: utf-8 -*-
import unittest
import codecs
class TestUrlResponseCodec(unittest.TestCase):
def test_01(self):
__target = "\u5267\u60c5"
print __target.decode('unicode-escape')
def test(self):
__str = '''{
"args": {},
"data": ""{\"q\": \"\\u5f20\... |
ImmaculateObsession/nest | refs/heads/master | nest/wsgi.py | 1 | """
WSGI config for nest 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_APPLICATION`` set... |
gisadmin/vb2py | refs/heads/master | vb2py/test/testclassmethods.py | 2 | from complexframework import *
# << ClassMethod tests >> (1 of 7)
#
# Simple public method
tests.append((
VBClassModule(),
"""
Public my_a As String
Public Sub SetA(Value As Integer)
my_a = Value
End Sub
""",
("A = MyClass()\n"
"A.SetA('hel... |
redhatrises/freeipa | refs/heads/master | ipalib/rpc.py | 2 | # Authors:
# Jason Gerard DeRose <jderose@redhat.com>
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... |
clhernandez/foris | refs/heads/master | ex2_1.py | 1 | import math
def fib(n):
i = 1
j = 0
print n
for k in xrange(0,n-1):
t = i+j
i = j
j = t
return j
def divisoresPrimos(n):
primo = 1
listPrimos = {}
resultado = False
cnt=1
while resultado != True:
cociente = n // primo
rest... |
harmslab/pdbtools | refs/heads/master | pdbtools/dist_filter.py | 1 | #!/usr/bin/env python
# Copyright 2007, Michael J. Harms
# This program is distributed under General Public License v. 3. See the file
# COPYING for a copy of the license.
__author__ = "Michael J. Harms"
__date__ = "070709"
__description__ = \
"""
pdb_dist-filter.py
Takes pdb file and calculates the distance betwee... |
ostrovok-team/django-mediagenerator | refs/heads/master | blocks_project/demo/views.py | 2 | # Create your views here.
from django.shortcuts import render
def index(request):
return render(request, 'index.html')
|
jonashagstedt/django-jsx | refs/heads/master | tests/test_template_tag.py | 2 | from django.template import RequestContext
from django.test import TestCase
from django_jsx.templatetags import djangojs
from django_jsx.templatetags.djangojs import JsMissingTemplateDirException
class TestLoader(TestCase):
def test_render_template(self):
"""
Render a template with the template ta... |
AltSchool/django | refs/heads/master | django/conf/locale/is/__init__.py | 12133432 | |
masonm12/SavePics | refs/heads/master | savepics.py | 1 | #!/usr/bin/env python
import argparse
import os
import re
import time
import filecmp
import shutil
import glob
version = 'v2.1.0'
ignored = {
'Thumbs.db'
}
fileNumberPattern = re.compile('([0-9]+)')
argParser = argparse.ArgumentParser(prog='savepics',
description='Sorts picture files from an input directory into an... |
marxin/youtube-dl | refs/heads/master | youtube_dl/extractor/keek.py | 119 | from __future__ import unicode_literals
from .common import InfoExtractor
class KeekIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?keek\.com/(?:!|\w+/keeks/)(?P<id>\w+)'
IE_NAME = 'keek'
_TEST = {
'url': 'https://www.keek.com/ytdl/keeks/NODfbab',
'md5': '09c5c109067536c1cec8bac8c21f... |
stweil/letsencrypt | refs/heads/master | acme/acme/jose/jwa_test.py | 66 | """Tests for acme.jose.jwa."""
import unittest
from acme import test_util
from acme.jose import errors
RSA256_KEY = test_util.load_rsa_private_key('rsa256_key.pem')
RSA512_KEY = test_util.load_rsa_private_key('rsa512_key.pem')
RSA1024_KEY = test_util.load_rsa_private_key('rsa1024_key.pem')
class JWASignatureTest(... |
endolith/scipy | refs/heads/master | scipy/stats/_generate_pyx.py | 7 | import pathlib
from shutil import copyfile
import subprocess
import sys
def isNPY_OLD():
'''
A new random C API was added in 1.18 and became stable in 1.19.
Prefer the new random C API when building with recent numpy.
'''
import numpy as np
ver = tuple(int(num) for num in np.__version__.split(... |
minhphung171093/OpenERP_V7 | refs/heads/master | openerp/addons/base/tests/test_ir_attachment.py | 68 | import hashlib
import os
import unittest2
import openerp
import openerp.tests.common
class test_ir_attachment(openerp.tests.common.TransactionCase):
def test_00_attachment_flow(self):
registry, cr, uid = self.registry, self.cr, self.uid
root_path = openerp.tools.config['root_path']
ira =... |
sfepy/sfepy | refs/heads/master | sfepy/homogenization/coefs_base.py | 3 | from __future__ import absolute_import
import os
import numpy as nm
import scipy as sc
from collections.abc import Iterable
from sfepy.base.base import output, assert_, get_default, debug, Struct
from sfepy.base.timing import Timer
from sfepy.discrete.evaluate import eval_equations
from sfepy.solvers.ts import TimeSt... |
DLR-SC/tigl | refs/heads/master | thirdparty/googletest/googletest/test/googletest-param-test-invalid-name2-test.py | 122 | #!/usr/bin/env python
#
# Copyright 2015 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... |
tboyce1/home-assistant | refs/heads/dev | homeassistant/components/snips.py | 4 | """
Support for Snips on-device ASR and NLU.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/snips/
"""
import asyncio
import json
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.helpers import intent, config_v... |
duncanHsu/CowMQ-Python | refs/heads/master | cow_mq/__init__.py | 12133432 | |
tralamazza/micropython | refs/heads/master | tests/cpydiff/modules2/subpkg/bar.py | 12133432 | |
eneldoserrata/marcos_openerp | refs/heads/master | addons/report_geraldo/lib/geraldo/site/newsite/site-geraldo/django/contrib/localflavor/no/__init__.py | 12133432 | |
varunarya10/rally | refs/heads/master | tests/unit/benchmark/__init__.py | 12133432 | |
jpirates1/Django-python-pro | refs/heads/master | venv/lib/python2.7/site-packages/setuptools/command/build_py.py | 301 | from glob import glob
from distutils.util import convert_path
import distutils.command.build_py as orig
import os
import sys
import fnmatch
import textwrap
try:
from setuptools.lib2to3_ex import Mixin2to3
except ImportError:
class Mixin2to3:
def run_2to3(self, files, doctests=True):
"do not... |
jeremycline/pulp | refs/heads/master | playpen/deploy/utils/__init__.py | 12133432 | |
dusenberrymw/incubator-systemml | refs/heads/master | src/main/python/systemml/random/sampling.py | 13 | #-------------------------------------------------------------
#
# 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... |
donkirkby/django | refs/heads/master | django/contrib/gis/gdal/field.py | 355 | from ctypes import byref, c_int
from datetime import date, datetime, time
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import ds as capi
from django.utils.encoding import force_text
# For more information, see the OG... |
JazzeYoung/VeryDeepAutoEncoder | refs/heads/master | pylearn2/pylearn2/costs/mlp/missing_target_cost.py | 34 | """
The MissingTargetCost class.
"""
__author__ = 'Vincent Archambault-Bouffard'
from functools import wraps
import theano.tensor as T
from pylearn2.costs.cost import Cost
from pylearn2.space import CompositeSpace
class MissingTargetCost(Cost):
"""
Dropout but with some targets optionally missing. The miss... |
grahamu/django-test-plus | refs/heads/master | test_plus/test.py | 1 | from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Permission
from django.core.exceptions import ImproperlyConfigured
from django.db import connections, DEFAULT_DB_ALIAS
from django.db.models import Q
from django.shortcuts import resolve_url
from djang... |
WelcomeHUME/svn-caucho-com-resin | refs/heads/master | doc.py | 5 | #! /usr/bin/env python
import argparse as ap
import os
import sys
import re
from string import join
from glob import glob
#re_title_element = re.compile(r'<title>(.*)</title>')
#re_description = re.compile(r'<description>(.*)</description>')
#re_product = re.compile(r'<description>(.*)</description>')
re_title_attr... |
nrwahl2/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/sub/bam/bam.py | 298 | #!/usr/bin/env python
bam = "BAM FROM sub/bam/bam.py"
|
takaaptech/sky_engine | refs/heads/master | build/gypi_to_gn.py | 106 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Converts a given gypi file to a python scope and writes the result to stdout.
It is assumed that the file contains a toplevel dictionary, and this script... |
simplyguru-dot/ansible-modules-core | refs/heads/devel | web_infrastructure/django_manage.py | 55 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Scott Anderson <scottanderson42@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 o... |
harry-ops/opencloud | refs/heads/master | webvirtmgr/storages/views.py | 1 | from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
from django.core.urlresolvers import reverse
from servers.models import Compute
from storages.forms import AddStgPool, AddImage... |
cdht/androguard | refs/heads/master | androguard/core/analysis/sign.py | 22 | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# 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... |
40223151/2014c2g9 | refs/heads/master | w2/static/Brython2.0.0-20140209-164925/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,... |
niceguydave/wagtail-cookiecutter-foundation | refs/heads/master | {{cookiecutter.repo_name}}/products/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
phvu/CarND-behavioral-cloning | refs/heads/master | test.py | 1 | from keras.models import load_model
from scipy.ndimage import imread
model = load_model('model.h5')
print('Start')
image_array = imread('./data/IMG/center_2016_12_01_13_36_16_767.jpg')
transformed_image_array = image_array[None, :, 1:-1, :]
transformed_image_array = ((transformed_image_array / 255.) - 0.5) * 2
steer... |
mgbarrero/xbob.db.biosecuridsigngf | refs/heads/master | xbob/db/biosecuridsigngf/__init__.py | 1 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# 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, version 3 of the License.
#
# This program is distributed in the hope that it will be usef... |
DDShadoww/grab | refs/heads/master | grab/script/start_project.py | 12 | import os
import logging
import shutil
import re
from grab.error import GrabError
logger = logging.getLogger('grab.script.start_project')
def setup_arg_parser(parser):
parser.add_argument('project_name')
parser.add_argument('--template')
def process_content(content, context):
for key, value in context.... |
zstackorg/zstack-woodpecker | refs/heads/master | integrationtest/vm/virtualrouter/vlan/test_reboot_vm.py | 4 | '''
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
def test():
global test_obj_dict
test_util.test_... |
alexsanjoseph/duolingo-save-streak | refs/heads/master | urllib3/util/__init__.py | 204 | from __future__ import absolute_import
# For backwards compatibility, provide imports that used to be here.
from .connection import is_connection_dropped
from .request import make_headers
from .response import is_fp_closed
from .ssl_ import (
SSLContext,
HAS_SNI,
IS_PYOPENSSL,
IS_SECURETRANSPORT,
as... |
HoracioAlvarado/fwd | refs/heads/master | venv/Lib/site-packages/setuptools/command/sdist.py | 111 | from glob import glob
from distutils import log
import distutils.command.sdist as orig
import os
import sys
import io
from setuptools.extern import six
from setuptools.utils import cs_path_exists
import pkg_resources
READMES = 'README', 'README.rst', 'README.txt'
_default_revctrl = list
def walk_revctrl(dirname='... |
etherkit/OpenBeacon2 | refs/heads/master | client/win/venv/Lib/site-packages/setuptools/command/install.py | 529 | from distutils.errors import DistutilsArgError
import inspect
import glob
import warnings
import platform
import distutils.command.install as orig
import setuptools
# Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for
# now. See https://github.com/pypa/setuptools/issues/199/
_install = orig.in... |
caioserra/apiAdwords | refs/heads/master | tests/adspygoogle/dfp/v201211/creative_set_service_unittest.py | 4 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
#
# Copyright 2012 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... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-3.3.0/Lib/encodings/utf_32_be.py | 703 | """
Python 'utf-32-be' Codec
"""
import codecs
### Codec APIs
encode = codecs.utf_32_be_encode
def decode(input, errors='strict'):
return codecs.utf_32_be_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
return codecs.utf_32_be_en... |
miyazaki-tm/aoj | refs/heads/master | Volume0/0043.py | 2 | """
Puzzle
"""
def solve(hand, count, janto):
if count == 0:
return True
i = [x for x in xrange(9) if hand[x] > 0][0]
if not janto and hand[i] >= 2:
if solve(decrease(hand, [i, i]), count - 2, not janto):
return True
if hand[i] >= 3:
if solve(decrease(hand, [i, i, i... |
winnerineast/Origae-6 | refs/heads/master | origae/inference/text/__init__.py | 1 | from __future__ import absolute_import
from .job import TextInferenceJob
__all__ = ['TextInferenceJob']
|
xbmc/xbmc-antiquated | refs/heads/master | xbmc/lib/libPython/Python/Demo/tkinter/guido/brownian.py | 50 | # Brownian motion -- an example of a multi-threaded Tkinter program.
from Tkinter import *
import random
import threading
import time
import sys
WIDTH = 400
HEIGHT = 300
SIGMA = 10
BUZZ = 2
RADIUS = 2
LAMBDA = 10
FILL = 'red'
stop = 0 # Set when main loop exits
def particle(canvas):
... |
Microsoft/PTVS | refs/heads/master | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/win32comext/axdebug/stackframe.py | 11 | """Support for stack-frames.
Provides Implements a nearly complete wrapper for a stack frame.
"""
import sys
from .util import _wrap, RaiseNotImpl
import expressions, gateways, axdebug, winerror
import pythoncom
from win32com.server.exception import COMException
from .util import trace
#def trace(*args):
# pass... |
twiest/openshift-tools | refs/heads/stg | openshift/installer/vendored/openshift-ansible-git-2016-04-27/roles/os_firewall/library/os_firewall_manage_iptables.py | 68 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# vim: expandtab:tabstop=4:shiftwidth=4
# pylint: disable=fixme, missing-docstring
from subprocess import call, check_output
DOCUMENTATION = '''
---
module: os_firewall_manage_iptables
short_description: This module manages iptables rules for a given chain
author: Jason DeTibe... |
harikrishnakanchi/jeeves | refs/heads/master | grammifier/__init__.py | 12133432 | |
filias/django | refs/heads/master | tests/i18n/other/__init__.py | 12133432 | |
jaeilepp/eggie | refs/heads/master | ui/__init__.py | 12133432 | |
Maccimo/intellij-community | refs/heads/master | python/testData/completion/relativeFromImportInNamespacePackage/nspkg1/nspkg2/bar.py | 12133432 | |
harshilasu/GraphicMelon | refs/heads/master | y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/cloudfront/identity.py | 170 | # Copyright (c) 2006-2009 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... |
alvin319/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/plat-mac/Carbon/OSA.py | 81 | from _OSA import *
|
sdodson/openshift-ansible | refs/heads/master | roles/lib_openshift/src/lib/clusterrole.py | 64 | # pylint: skip-file
# flake8: noqa
# pylint: disable=too-many-public-methods
class ClusterRole(Yedit):
''' Class to model an openshift ClusterRole'''
rules_path = "rules"
def __init__(self, name=None, content=None):
''' Constructor for clusterrole '''
if content is None:
conte... |
bytor99999/vertx-web | refs/heads/master | src/test/sockjs-protocol/venv/lib/python2.7/site-packages/pip/_vendor/html5lib/html5parser.py | 169 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass
import types
from . import inputstream
from . import tokenizer
from . import treebuilders
from .treebuilders._base import Marker
from . import utils
from . import constants
from .constants import spaceChara... |
shahar-stratoscale/nova | refs/heads/master | nova/api/openstack/compute/contrib/flavormanage.py | 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
# d... |
52-41-4d/fs-master | refs/heads/master | spec/spec_base.py | 4 | import unittest
import fslib.common as fscommon
class FsTestBase(unittest.TestCase):
@classmethod
def setUpClass(cls):
'''Set up logging; turn on debug messages'''
fscommon.setup_logger(None, True)
|
doom369/FrameworkBenchmarks | refs/heads/master | frameworks/Python/turbogears/app.py | 51 | from functools import partial
from operator import attrgetter
import os
from random import randint
import sys
import json
from jinja2 import Environment, PackageLoader
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from tg import expose, TGController, AppConfig
from model... |
sestrella/ansible | refs/heads/devel | test/units/modules/network/iosxr/test_iosxr_command.py | 54 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... |
neopoly/rubyfox-server | refs/heads/master | lib/rubyfox/server/data/lib/Lib/test/zxjdbc/sptest.py | 5 |
# Jython Database Specification API 2.0
#
# $Id: sptest.py 2101 2002-05-10 16:11:41Z bzimmer $
#
# Copyright (c) 2001 brian zimmer <bzimmer@ziclix.com>
from zxtest import zxCoreTestCase
class OracleSPTest(zxCoreTestCase):
def setUp(self):
zxCoreTestCase.setUp(self)
c = self.cursor()
try:
try:
c.exec... |
spacy-io/spaCy | refs/heads/master | spacy/tests/matcher/test_pattern_validation.py | 2 | import pytest
from spacy.matcher import Matcher
from spacy.errors import MatchPatternError
from spacy.schemas import validate_token_pattern
# (pattern, num errors with validation, num errors identified with minimal
# checks)
TEST_PATTERNS = [
# Bad patterns flagged in all cases
([{"XX": "foo"}], 1, 1),
([... |
arengela/AngelaUCSFCodeAll | refs/heads/master | libsvm-3.12/tools/grid.py | 20 | #!/usr/bin/env python
import os, sys, traceback
import getpass
from threading import Thread
from subprocess import *
if(sys.hexversion < 0x03000000):
import Queue
else:
import queue as Queue
# svmtrain and gnuplot executable
is_win32 = (sys.platform == 'win32')
if not is_win32:
svmtrain_exe = "../svm-tr... |
ropik/chromium | refs/heads/master | chrome/PRESUBMIT.py | 14 | # Copyright (c) 2011 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.
"""Presubmit script for changes affecting chrome/
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the... |
KyleAMoore/KanjiNani | refs/heads/master | Android/.buildozer/android/platform/build/build/python-installs/KanjiNani/usr/local/share/kivy-examples/widgets/colorusage.py | 21 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.lang import Builder
Builder.load_string("""
#:import hex kivy.utils.get_color_from_hex
<Root>:
cols: 2
canvas:
Color:
rgba: 1, 1, 1, 1
Rectangle:
pos: self.pos
size: self.size
... |
MuSystemsAnalysis/craigslist_area_search | refs/heads/master | checkPage.py | 1 | #!/usr/bin/python
# coding: utf-8
import urllib.request
import re
def thereAreResults(searchUrl):
#Create the soup object from the HTML data
page = urllib.request.urlopen(searchUrl).read()
if not re.findall(b'no results', page):
#print("There was something there.")
return True
if re.findall(b'no results'... |
errx/django | refs/heads/master | tests/utils_tests/test_safestring.py | 29 | from __future__ import unicode_literals
from django.template import Template, Context
from django.test import TestCase
from django.utils.encoding import force_text, force_bytes
from django.utils.functional import lazy
from django.utils.safestring import mark_safe, mark_for_escaping, SafeData, EscapeData
from django.ut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.