repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
stanlyxiang/incubator-hawq | refs/heads/master | tools/bin/pythonSrc/pychecker-0.8.18/pychecker/CodeChecks.py | 7 | #!/usr/bin/env python
# Copyright (c) 2001-2006, MetaSlash Inc. All rights reserved.
# Portions Copyright (c) 2005, Google, Inc. All rights reserved.
"""
Find warnings in byte code from Python source files.
"""
import string
import types
from pychecker import msgs
from pychecker import utils
from pychecker import... |
0Chencc/CTFCrackTools | refs/heads/master | Lib/site-packages/pip/_vendor/distlib/resources.py | 335 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2016 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import ... |
LiaoPan/blaze | refs/heads/master | blaze/compute/tests/test_spark.py | 3 | from __future__ import absolute_import, division, print_function
import pytest
pyspark = pytest.importorskip('pyspark')
import pandas as pd
from blaze import compute, symbol, summary, exp, by, join, merge
from toolz import identity
data = [['Alice', 100, 1],
['Bob', 200, 2],
['Alice', 50, 3]]
data2... |
majora2007/plexpy | refs/heads/master | lib/unidecode/x056.py | 252 | data = (
'Di ', # 0x00
'Qi ', # 0x01
'Jiao ', # 0x02
'Chong ', # 0x03
'Jiao ', # 0x04
'Kai ', # 0x05
'Tan ', # 0x06
'San ', # 0x07
'Cao ', # 0x08
'Jia ', # 0x09
'Ai ', # 0x0a
'Xiao ', # 0x0b
'Piao ', # 0x0c
'Lou ', # 0x0d
'Ga ', # 0x0e
'Gu ', # 0x0f
'Xiao ', # 0x10
'Hu... |
megcunningham/django-debug-toolbar | refs/heads/master | debug_toolbar/panels/sql/__init__.py | 41 | from debug_toolbar.panels.sql.panel import SQLPanel # noqa
|
graehl/nplm01 | refs/heads/master | python/testNeuralLM.py | 6 | import nplm
if __name__ == "__main__":
import sys
import fileinput
import argparse
parser = argparse.ArgumentParser(description='Score sentences using n-gram language model.')
parser.add_argument('--test_file', metavar='file', dest='test_file', help='test text file')
parser.add_argument('--mod... |
deepfield/ibis | refs/heads/master | ibis/tests/test_version.py | 1 | import os
from pkg_resources import parse_version
from pkg_resources.extern.packaging.version import Version
import pytest
import ibis
@pytest.mark.skipif(
bool(os.environ.get('CIRCLECI', None)),
reason='Testing import time on CI is flaky due to VM variance',
)
def test_import_time():
sh = pytest.impor... |
sio2project/oioioi | refs/heads/master | oioioi/problems/migrations/0028_problemname.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2021-05-10 16:50
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('problems', '0027_problem_alter_legacy_name'),
]
o... |
gameduell/duell | refs/heads/master | bin/win/python2.7.9/Lib/site-packages/pip/_vendor/html5lib/treewalkers/lxmletree.py | 355 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
... |
j127/Gladiator-Arena | refs/heads/dev | alembic/env.py | 76 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python... |
JohnDevitt/appengine-django-skeleton-master | refs/heads/master | lib/django/contrib/sites/requests.py | 695 | from __future__ import unicode_literals
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class RequestSite(object):
"""
A class that shares the primary interface of Site (i.e., it has
``domain`` and ``name`` attributes) but gets its data from a Django
HttpReq... |
halvertoluke/edx-platform | refs/heads/default_branch | openedx/core/djangoapps/credit/exceptions.py | 60 | """Exceptions raised by the credit API. """
from __future__ import unicode_literals
from django.utils.translation import ugettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException
# TODO: Cleanup this mess! ECOM-2908
class CreditApiBadRequest(Exception):
"""
Could... |
swiftstack/pympler | refs/heads/master | test/tracker/test_stats.py | 4 |
import os
import re
import sys
import unittest
from shutil import rmtree
from tempfile import mkdtemp, mkstemp
from pympler.util.compat import StringIO, BytesIO
from pympler.classtracker import ClassTracker
from pympler.classtracker_stats import ConsoleStats, HtmlStats, Stats
from pympler.asizeof import Asizer, asi... |
antiagainst/shaderc | refs/heads/master | glslc/test/option_dash_S.py | 16 | # Copyright 2015 The Shaderc 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... |
an146/pacman | refs/heads/master | test/pacman/tests/sync-nodepversion03.py | 27 | self.description = "nodepversion: -Sdd works but no deps"
p1 = pmpkg("pkg1", "1.0-2")
p1.depends = ["provision>=1.0-2"]
self.addpkg2db("sync", p1)
p2 = pmpkg("pkg2", "1.0-2")
p2.provides = ["provision=1.0-1"]
self.addpkg2db("sync", p2)
self.args = "-Sdd %s" % p1.name
self.addrule("PACMAN_RETCODE=0")
self.addrule("P... |
heran7/edx-platform | refs/heads/master | cms/djangoapps/contentstore/management/commands/populate_creators.py | 14 | """
Script for granting existing course instructors course creator privileges.
This script is only intended to be run once on a given environment.
"""
from auth.authz import get_users_with_instructor_role, get_users_with_staff_role
from course_creators.views import add_user_with_status_granted, add_user_with_status_un... |
furious-luke/python-utils | refs/heads/master | pythonutils/containers.py | 1 | def find(ctr, match, default=None):
def _find(ctr, match):
if hasattr(ctr, '__iter__'):
if match in ctr:
if hasattr(ctr, 'itervalues'):
# Dereference to value.
return (ctr[match], True)
else:
# Return act... |
ingokegel/intellij-community | refs/heads/master | python/testData/codeInsight/controlflow/lambda.py | 83 | {(lambda i=i: i) for i in range(4)}
|
itsyouonline/identityserver | refs/heads/master | clients/python/itsyouonline/Grant.py | 1 | """
Auto-generated class for Grant
"""
from six import string_types
Grant = string_types
|
Technocaveman/There-is-no-Third-Step | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/pygments/formatters/img.py | 268 | # -*- coding: utf-8 -*-
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from pygments.formatter import Formatter
from pygments.util import ge... |
vipulkanade/EventbriteDjango | refs/heads/master | src_eventbrite_django/topthree/models.py | 1 | from __future__ import unicode_literals
from django.db import models
# Create your models here.
CATEGORIES = (
('music', 'Music'),
('business', 'Business & Professional'),
('food', 'Food & Drink'),
('community', 'Community & Culture'),
('performing','Performing & Visual Arts'),
('film', 'Film,... |
jeffreylu9/django-cms | refs/heads/wlsite | cms/extensions/__init__.py | 82 | from .models import PageExtension # nopyflakes
from .models import TitleExtension # nopyflakes
from .extension_pool import extension_pool # nopyflakes
from .admin import PageExtensionAdmin # nopyflakes
from .admin import TitleExtensionAdmin # nopyflakes
|
mikrosimage/rez | refs/heads/20160619_master.mikros.1 | src/rez/tests/data/packages/py_packages/single_unversioned.py | 8 | name = 'single_unversioned'
# Copyright 2013-2016 Allan Johns.
#
# 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 Software Foundation, either
# version 3 of the License, or (at your option) any later version... |
rgommers/scipy | refs/heads/master | scipy/special/tests/test_spence.py | 60 | import numpy as np
from numpy import sqrt, log, pi
from scipy.special._testutils import FuncData
from scipy.special import spence
def test_consistency():
# Make sure the implementation of spence for real arguments
# agrees with the implementation of spence for imaginary arguments.
x = np.logspace(-30, 30... |
valentin-krasontovitsch/ansible | refs/heads/devel | lib/ansible/modules/files/file.py | 7 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# 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__ ... |
vstorm/douban-fm-client | refs/heads/master | test/test_collect.py | 1 | # import nose
from test import client
def test_collect_channel():
cids = {"3000411": "You're Beautiful",
"3701080": "亲密爱人",
"3813365": "愛をこめて。海"}
for cid in cids.keys():
client.fm.collect_channel(cid=cid)
def test_collect_programmes():
pids = {"1364115": "日本BGM",
... |
you21979/phantomjs | refs/heads/2.0 | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/earlywarningsystemtask.py | 127 | # 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 list of conditions and the ... |
bbenko/django-dice | refs/heads/master | dice/views.py | 6027 | # Create your views here.
|
jasonthomas/zamboni | refs/heads/master | lib/geoip/tests/test_geoip.py | 19 | from random import randint
import mock
import requests
from nose.tools import eq_
import mkt.site.tests
from lib.geoip import GeoIP
def generate_settings(url='', default='restofworld', timeout=0.2):
return mock.Mock(GEOIP_URL=url, GEOIP_DEFAULT_VAL=default,
GEOIP_DEFAULT_TIMEOUT=timeout)
... |
kgraves/new-machine-bootstrap | refs/heads/master | fabfile.py | 1 | # TODO possibly start using visudo so we don't have to type in password during
# run of fabric. Although it's not a huge deal right now.
from fabric.api import abort
from fabric.api import env
from fabric.api import execute
from fabric.api import get
from fabric.api import local
from fabric.api import put
from fabric.... |
zerkrx/zerkbox | refs/heads/develop | lib/pip/commands/hash.py | 514 | from __future__ import absolute_import
import hashlib
import logging
import sys
from pip.basecommand import Command
from pip.status_codes import ERROR
from pip.utils import read_chunks
from pip.utils.hashes import FAVORITE_HASH, STRONG_HASHES
logger = logging.getLogger(__name__)
class HashCommand(Command):
""... |
aospan/linux-stable-netup-universal-dvb-1.4 | refs/heads/master | tools/perf/scripts/python/netdev-times.py | 1544 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
Leaderman/pyspark | refs/heads/master | 1.5.1/examples/sql/spark_sql_dataframe_select.py | 1 | from pyspark import SparkConf, SparkContext
from pyspark.sql import SQLContext, Row
conf = SparkConf().setAppName("spark_sql_dataframe_select")
sc = SparkContext(conf=conf)
sqlCtx = SQLContext(sc)
lines = sc.parallelize(["a,1", "b,2", "c,3"])
people = lines.map(lambda line: line.split(",")).map(
lambda words: ... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/src/Lib/bsddb/test/test_thread.py | 33 | """TestCases for multi-threaded access to a DB.
"""
import os
import sys
import time
import errno
from random import random
DASH = '-'
try:
WindowsError
except NameError:
class WindowsError(Exception):
pass
import unittest
from test_all import db, dbutils, test_support, verbose, have_threads, \
... |
zenodo/invenio | refs/heads/zenodo-master | invenio/legacy/websubmit/functions/Link_Records.py | 13 |
# This file is part of Invenio.
# Copyright (C) 2012, 2014 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, or (at your option) any later version.
#
# Inven... |
mikelj/h-store | refs/heads/master | src/benchmarks/edu/brown/benchmark/auctionmark/docs/ddl2latex.py | 9 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import re
import string
table_regex = re.compile("CREATE TABLE ([A-Z\_]+)[\s]+\(", re.IGNORECASE)
col_regex = re.compile("[\s]+([a-z\_]+)[\s]+([A-Z]+).*?(?:REFERENCES[\s]+([A-Z\_]+)[\s]+\([\s]*([a-z\_]+)[\s]*\))?[\s]*,")
headers = [ 'Column', 'Type',... |
kervi/kervi | refs/heads/master | kervi/kervi/plugin/message_bus/kervi_bus.py | 1 |
class KerviBus:
def __init__(self, config):
pass
@property
def is_connected(self):
raise NotImplementedError
def reset(self, process_id, signal_port, ip=None, root_address=None, event_port=None):
raise NotImplementedError
def stop(self):
raise NotImple... |
zvolsky/codex2020 | refs/heads/master | controllers/library.py | 1 | # -*- coding: utf-8 -*-
from mzutils import slugify
from plugin_mz import formstyle_bootstrap3_compact_factory
from dal_common import hide_all_fields
# from dal_common import ... # in choose_library()
@auth.requires_login()
def choose_library():
"""
request.args(0): missing: Show, 'all': ShowAll, '<id>':... |
ridwannaruto/WikiLanka | refs/heads/Initialize | vendor/doctrine/orm/docs/en/conf.py | 2448 | # -*- coding: utf-8 -*-
#
# Doctrine 2 ORM documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 3 18:10:24 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
... |
2ndQuadrant/ansible | refs/heads/master | lib/ansible/modules/cloud/amazon/ec2_placement_group.py | 39 | #!/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... |
akosyakov/intellij-community | refs/heads/master | python/testData/intentions/afterReplaceBackQuoteExpression.py | 83 | repr(a + b, 34 + a) |
manderson23/NewsBlur | refs/heads/master | apps/rss_feeds/migrations/0051_unique_hash.py | 18 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Removing unique constraint on 'Feed', fields ['feed_address']
db.delete_unique('feeds', ['feed_address']... |
vinoth3v/In | refs/heads/master | In/templates/html/TextDiv.tpl.py | 2 | <<%= tag %> <%= attributes %>><%= value %> <%= children %></<%= tag %>> |
fcelda/tuned | refs/heads/master | tuned/exports/dbus_exporter.py | 2 | import interfaces
import decorator
import dbus.service
import dbus.mainloop.glib
import gobject
import inspect
import threading
class DBusExporter(interfaces.ExporterInterface):
"""
Export method calls through DBus Interface.
We take a method to be exported and create a simple wrapper function
to call it. This is... |
blurstudio/cross3d | refs/heads/master | cross3d/abstract/abstractscenemodel.py | 1 | ##
# \namespace cross3d.abstract.abstractscenemodel
#
# \remarks The AbstractSceneModel class provides the base foundation for the 3d Object framework for the cross3d system
# This class will provide a generic overview structure for all manipulations of 3d models
#
# \author douglas
# \author Blur Studio
... |
SlashRoot/hendrix | refs/heads/master | hendrix/utils/__init__.py | 4 | from importlib import import_module
import chalk
import os
import six
import sys
HENDRIX_DIR = os.path.dirname(os.path.abspath(__file__))
SHARE_PATH = os.path.join(
os.path.dirname(sys.executable),
'share/hendrix'
)
def get_pid(options):
"""returns The default location of the pid file for process mana... |
AndreLamurias/IBRel | refs/heads/master | src/reader/Transmir_corpus.py | 2 | import logging
import random
import progressbar as pb
from postprocessing import ssm
from reader.pubmed_corpus import PubmedCorpus
from mirna_base import MirbaseDB
from config import config
from text.mirna_entity import MirnaEntity, mirna_graph
from text.protein_entity import ProteinEntity, get_uniprot_name
class T... |
broferek/ansible | refs/heads/devel | lib/ansible/plugins/terminal/frr.py | 47 | #
# (c) 2018 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
MarkTheF4rth/youtube-dl | refs/heads/master | youtube_dl/extractor/ssa.py | 122 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
unescapeHTML,
parse_duration,
)
class SSAIE(InfoExtractor):
_VALID_URL = r'http://ssa\.nls\.uk/film/(?P<id>\d+)'
_TEST = {
'url': 'http://ssa.nls.uk/film/3561',
'info_dict': {
'... |
adamlincoln/pokersim | refs/heads/master | tests/test_brains/test_foldwithnopostfloppairorbetter.py | 1 | from pokersim.Table import Table
from pokersim.Player import Player
from pokersim.Card import Card
from pokersim.Decision import Decision
def test_foldwithnopostfloppairorbetter_call_preflop():
table = Table()
num_players = 3
for i in xrange(num_players):
player = Player(10, 'FoldWithNoPostFlopPair... |
edmorley/django | refs/heads/master | tests/template_loader/tests.py | 153 | from django.template import TemplateDoesNotExist
from django.template.loader import (
get_template, render_to_string, select_template,
)
from django.test import SimpleTestCase, override_settings
from django.test.client import RequestFactory
@override_settings(TEMPLATES=[{
'BACKEND': 'django.template.backends.... |
rwl/openpowersystem | refs/heads/master | ucte/core/curve_data.py | 1 | #------------------------------------------------------------------------------
# Copyright (C) 2009 Richard Lincoln
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation; version 2 dated June... |
chrisspen/burlap | refs/heads/master | burlap/tarball.py | 1 | from __future__ import print_function
from burlap import Satchel
from burlap.constants import *
from burlap.decorators import task
from burlap.common import only_hostname
RSYNC = 'rsync'
#DEPRECATED: TODO: remove tarball functionality, and rename to CodeSatchel
class TarballSatchel(Satchel):
name = 'tarball'
... |
stephansigg/IPSN_localisation_active-DF | refs/heads/master | Sources/mainwindow.py | 1 | import wx
class MainWindow(wx.Frame):
def __init__(self, parent, title):
self.dirname=''
wx.Frame.__init__(self, parent, title=title, size=(200,-1))
#self.quote = wx.StaticText(self, label="Your quote :", pos=(20, 30))
# A multiline TextCtrl - This is here to show how the eve... |
neumerance/deploy | refs/heads/master | openstack_dashboard/dashboards/admin/domains/panel.py | 12 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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.... |
larsks/cloud-init-patches | refs/heads/lpc-rhel-7-patches | tests/unittests/test_pathprefix2dict.py | 10 | from cloudinit import util
from .helpers import TestCase, populate_dir
import shutil
import tempfile
class TestPathPrefix2Dict(TestCase):
def setUp(self):
super(TestPathPrefix2Dict, self).setUp()
self.tmp = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree, self.tmp)
def test_requir... |
guillochon/staged-recipes | refs/heads/master | .travis_scripts/create_feedstocks.py | 1 | #!/usr/bin/env python
"""
Convert all recipes into feedstocks.
This script is to be run in a TravisCI context, with all secret environment variables defined (BINSTAR_TOKEN, GH_TOKEN)
Such as:
export GH_TOKEN=$(cat ~/.conda-smithy/github.token)
"""
from __future__ import print_function
from conda_build.metadata ... |
mhils/HoneyProxy | refs/heads/master | libhproxy/flowcollection.py | 1 | from libmproxy import encoding
from libhproxy.honey import HoneyProxy
import re, socket, cgi, StringIO
import hashlib #@UnusedImport
"""
flatten a given fieldStorage and return a dict with the following structure:
{"filenameA":"filecontentA",...}
This dict will be processed for creating hash checksums
"""
def getParts... |
Darkmer/masterchief | refs/heads/master | CourseBuilderenv/lib/python2.7/site-packages/pip/basecommand.py | 392 | """Base Command class, and related routines"""
import os
import sys
import tempfile
import traceback
import time
import optparse
from pip import cmdoptions
from pip.locations import running_under_virtualenv
from pip.log import logger
from pip.download import PipSession
from pip.exceptions import (BadCommand, Installa... |
caasiu/xbmc-addons-chinese | refs/heads/master | plugin.video.cntv-replay/default.py | 6 | import sys, os, time
import urllib, urlparse
import xbmc, xbmcgui, xbmcplugin, xbmcaddon
def cn_time_s(): # return CST (China Standard Time) in seconds
lc_time=time.localtime()
gm_time_s=time.mktime(time.gmtime())
return gm_time_s + (8-lc_time.tm_isdst)*60*60 # CST = GMT + 8h, tm_isdst = {1,0,-1}
addo... |
saideepchandg/oracle-r12-accounting | refs/heads/master | lib/django/core/mail/backends/smtp.py | 477 | """SMTP email backend class."""
import smtplib
import ssl
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from django.core.mail.utils import DNS_NAME
class EmailBackend(BaseEmailBackend):
"""
A... |
ASCrookes/django | refs/heads/master | tests/admin_inlines/test_templates.py | 285 | from __future__ import unicode_literals
from django.template.loader import render_to_string
from django.test import SimpleTestCase
class TestTemplates(SimpleTestCase):
def test_javascript_escaping(self):
context = {
'inline_admin_formset': {
'formset': {'prefix': 'my-prefix'},... |
Yen-Chung-En/2015cdb_g1_0623-2 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/event.py | 603 | #!/usr/bin/env python
'''Pygame module for interacting with events and queues.
Pygame handles all it's event messaging through an event queue. The routines
in this module help you manage that event queue. The input queue is heavily
dependent on the pygame display module. If the display has not been
initialized and a ... |
torchingloom/edx-platform | refs/heads/select/release | common/lib/xmodule/xmodule/tests/test_stringify.py | 68 | from nose.tools import assert_equals # pylint: disable=E0611
from lxml import etree
from xmodule.stringify import stringify_children
def test_stringify():
text = 'Hi <div x="foo">there <span>Bruce</span><b>!</b></div>'
html = '''<html a="b" foo="bar">{0}</html>'''.format(text)
xml = etree.fromstring(html... |
todaychi/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/forms_tests/tests/test_media.py | 131 | # -*- coding: utf-8 -*-
from django.forms import TextInput, Media, TextInput, CharField, Form, MultiWidget
from django.template import Template, Context
from django.test import TestCase
from django.test.utils import override_settings
@override_settings(
STATIC_URL=None,
MEDIA_URL='http://media.example.com/med... |
hthompson6/contrail-controller | refs/heads/master | src/config/utils/service_appliance.py | 13 | #!/usr/bin/python
#
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import sys
import time
import argparse
import ConfigParser
import json
from vnc_api.vnc_api import *
from cfgm_common.exceptions import *
class SAProvisioner(object):
def __init__(self, args_str=None):
self._args = N... |
2013Commons/HUE-SHARK | refs/heads/master | desktop/core/ext-py/Django-1.2.3/django/contrib/gis/geos/point.py | 403 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
class Point(GEOSGeometry):
_minlength = 2
_maxlength = 3
def __init__(self, x, y=None, z=None, srid=None):
... |
dialogtekgeek/DSTC6-End-to-End-Conversation-Modeling | refs/heads/master | ChatbotBaseline/tools/do_conversation.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Interactive neural conversation demo
Copyright (c) 2017 Takaaki Hori (thori@merl.com)
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
"""
import argparse
import sys
import os
import pickle
import re
import six... |
nthien/docker-registry | refs/heads/master | docker_registry/lib/rqueue.py | 35 | # -*- coding: utf-8 -*-
# this module is a slight modification of Ted Nyman's QR
# https://raw.github.com/tnm/qr/master/qr.py
import logging
from docker_registry.core import compat
json = compat.json
class NullHandler(logging.Handler):
"""A logging handler that discards all logging records."""
def emit(sel... |
public-ink/public-ink | refs/heads/master | server/appengine/lib/graphql/utils/build_ast_schema.py | 3 | from ..execution.values import get_argument_values
from ..language import ast
from ..pyutils.ordereddict import OrderedDict
from ..type import (GraphQLArgument, GraphQLBoolean,
GraphQLDeprecatedDirective, GraphQLDirective,
GraphQLEnumType, GraphQLEnumValue, GraphQLField,
... |
mingdachen/cuda-convnet2 | refs/heads/master | layer.py | 162 | # Copyright 2014 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
#
# Unless required by applicable law or... |
fengren/python_koans | refs/heads/master | python2/koans/about_scope.py | 100 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import jims
import joes
counter = 0 # Global
class AboutScope(Koan):
#
# NOTE:
# Look in jims.py and joes.py to see definitions of Dog used
# for this set of tests
#
def test_dog_is_not_available_in_the_current_sc... |
markfinger/recipe-crawler-for-beaney | refs/heads/master | requests/packages/chardet/utf8prober.py | 2918 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Rights Reserved.
#
# Con... |
akaariai/django | refs/heads/master | tests/migrations/test_migrations_squashed_erroneous/1_auto.py | 1155 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
Chilledheart/seahub | refs/heads/master | seahub/auth/management/__init__.py | 96 | """
Creates permissions for all installed apps that need permissions.
"""
from django.db.models import get_models, signals
from django.contrib.auth import models as auth_app
def _get_permission_codename(action, opts):
return u'%s_%s' % (action, opts.object_name.lower())
def _get_all_permissions(opts):
"Retur... |
project-capo/amber-python-drivers | refs/heads/master | src/amberdriver/common/__init__.py | 47 | __author__ = 'paoolo'
|
bmotlaghFLT/FLT_PhantomJS | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/checkout.py | 119 | # 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 ... |
jarus/django-registration | refs/heads/master | registration/tests/urls.py | 138 | """
URLs used in the unit tests for django-registration.
You should not attempt to use these URLs in any sort of real or
development environment; instead, use
``registration/backends/default/urls.py``. This URLconf includes those
URLs, and also adds several additional URLs which serve no purpose
other than to test tha... |
nadeaud/binutils-gdb | refs/heads/master | etc/update-copyright.py | 7 | #!/usr/bin/python
#
# Copyright (C) 2013-2017 Free Software Foundation, Inc.
#
# This script 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.
# This s... |
avasilevich/spolks | refs/heads/master | p2p/utils/interfaces.py | 1 | import netifaces
def list_interfaces():
broadcast_interfaces = {}
interfaces = netifaces.interfaces()
for entry in interfaces:
try:
entry_data = netifaces.ifaddresses(entry)[netifaces.AF_INET][0]
if 'broadcast' in entry_data:
broadcast_interfaces[entry] =... |
retomerz/intellij-community | refs/heads/master | python/testData/copyPaste/singleLine/Indent22.after.py | 747 | class C:
def foo(self):
x = 1
y = 2
|
rbtcollins/pip | refs/heads/develop | pip/baseparser.py | 424 | """Base option parser setup"""
from __future__ import absolute_import
import sys
import optparse
import os
import re
import textwrap
from distutils.util import strtobool
from pip._vendor.six import string_types
from pip._vendor.six.moves import configparser
from pip.locations import (
legacy_config_file, config_b... |
CyrusBiotechnology/gcloud-python | refs/heads/master | gcloud/datastore/helpers.py | 7 | # Copyright 2014 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
#
# Unless required by applicable law or a... |
henrykironde/scikit-learn | refs/heads/master | sklearn/externals/joblib/_memory_helpers.py | 303 | try:
# Available in Python 3
from tokenize import open as open_py_source
except ImportError:
# Copied from python3 tokenize
from codecs import lookup, BOM_UTF8
import re
from io import TextIOWrapper, open
cookie_re = re.compile("coding[:=]\s*([-\w.]+)")
def _get_normal_name(orig_enc):
... |
seojunyang/pyconkr-2015 | refs/heads/master | pyconkr/wsgi.py | 6 | """
WSGI config for pyconkr project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pyconkr.settings")
from django.core.w... |
stvstnfrd/edx-platform | refs/heads/master | import_shims/lms/third_party_auth/apps.py | 4 | """Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('third_party_auth.apps', 'common.djangoapps.third_p... |
cogeorg/black_rhino | refs/heads/master | examples/Georg2012/networkx/algorithms/link_analysis/tests/test_hits.py | 10 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
from nose.plugins.attrib import attr
import networkx
# Example from
# A. Langville and C. Meyer, "A survey of eigenvector methods of web
# information retrieval." http://citeseer.ist.psu.edu/713792.html
class TestHITS:
def setUp(self):
... |
evilynux/fofix | refs/heads/master | pkg/ListToNSIS.py | 15 | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2009 myfingershurt ... |
mhefley/hackart | refs/heads/master | api/rest_framework_config.py | 1 | from rest_framework.authentication import SessionAuthentication
class CsrfExemptSessionAuthentication (SessionAuthentication):
def enforce_csrf(self, request):
return |
flyfei/python-for-android | refs/heads/master | python-modules/twisted/twisted/test/test_socks.py | 59 | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.protocol.socks}, an implementation of the SOCKSv4 and
SOCKSv4a protocols.
"""
import struct, socket
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.internet import defer, a... |
EricMuller/mywebmarks-backend | refs/heads/master | requirements/twisted/Twisted-17.1.0/build/lib.linux-x86_64-3.5/twisted/conch/test/test_default.py | 12 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.client.default}.
"""
from __future__ import absolute_import, division
import sys
from twisted.python.reflect import requireModule
if requireModule('cryptography') and requireModule('pyasn1'):
from twisted.conc... |
gliderkite/ants | refs/heads/master | src/sim.py | 1 | #! /usr/bin/env python
"""Ants simulator module."""
import random
import entity
import behavior
def place_food(world, cardinality, quantity):
"""Place some food in random cells of the world."""
world.food_quantity = cardinality * quantity
width, height = world.size
i = 0
while i < cardinality:
loc = ... |
molobrakos/home-assistant | refs/heads/master | homeassistant/auth/permissions/types.py | 9 | """Common code for permissions."""
from typing import Mapping, Union
# MyPy doesn't support recursion yet. So writing it out as far as we need.
ValueType = Union[
# Example: entities.all = { read: true, control: true }
Mapping[str, bool],
bool,
None
]
# Example: entities.domains = { light: … }
SubCat... |
adelina-t/neutron | refs/heads/master | neutron/tests/unit/extensions/base.py | 29 | # Copyright 2014 Intel Corporation.
# Copyright 2014 Isaku Yamahata <isaku.yamahata at intel com>
# <isaku.yamahata at gmail com>
# All Rights Reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the Lic... |
bdh1011/cupeye | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/lockfile/symlinklockfile.py | 487 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class SymlinkLockFile(LockBase):
"""Lock access to a file using symlink(2)."""
def __init__(self, path, threaded=True, timeout=None):
# s... |
zbyufei/open-budgets | refs/heads/develop | openbudget/apps/contexts/factories.py | 2 | import datetime
import factory
from django.utils.timezone import utc
from openbudget.apps.entities.factories import EntityFactory
from openbudget.apps.contexts.models import Context
class ContextFactory(factory.DjangoModelFactory):
FACTORY_FOR = Context
entity = factory.SubFactory(EntityFactory)
data = ... |
tsunli/shadowsocks | refs/heads/master | shadowsocks/udprelay.py | 924 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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 b... |
pferreir/indico-backup | refs/heads/master | bin/utils/proposeAbstractsToAccept.py | 2 | # -*- coding: utf-8 -*-
##
##
## This file is part of Indico.
## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
##
## Indico 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... |
openstack/congress | refs/heads/master | thirdparty/antlr3-antlr-3.5/runtime/Python/tests/t031emptyAlt.py | 22 | import antlr3
import testbase
import unittest
class t031emptyAlt(testbase.ANTLRTest):
def setUp(self):
self.compileGrammar()
def testValid1(self):
cStream = antlr3.StringStream('foo')
lexer = self.getLexer(cStream)
tStream = antlr3.CommonTokenStream(lexer)
par... |
ThCC/postman-client | refs/heads/master | .eggs/requests-2.11.0-py2.7.egg/requests/packages/urllib3/filepost.py | 713 | from __future__ import absolute_import
import codecs
from uuid import uuid4
from io import BytesIO
from .packages import six
from .packages.six import b
from .fields import RequestField
writer = codecs.lookup('utf-8')[3]
def choose_boundary():
"""
Our embarassingly-simple replacement for mimetools.choose_b... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.