repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
PyMamba/mamba-framework | refs/heads/master | mamba/utils/output.py | 3 | # -*- test-case-name: mamba.test.test_output -*-
# Copyright (c) 2012 Oscar Campos <oscar.campos@member.fsf.org>
# See LICENSE for more details
"""
.. module:: output
:platform: Unix, Windows
:synopsys: Output facilities, inspired on Gentoo portage
.. moduleauthor:: Oscar Campos <oscar.campos@member.fsf.org>
... |
PhilZ-cwm6/android_kernel_htc_vigor | refs/heads/cm-11.0_hybrid | tools/perf/scripts/python/check-perf-trace.py | 11214 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... |
JiYouMCC/python | refs/heads/master | renzongxian/0012/0012.py | 40 | # Source:https://github.com/Show-Me-the-Code/show-me-the-code
# Author:renzongxian
# Date:2014-12-22
# Python 3.4
"""
第 0012 题: 敏感词文本文件 filtered_words.txt,里面的内容 和 0011题一样,当用户输入敏感词语,则用 星号 * 替换,
例如当用户输入「北京是个好城市」,则变成「**是个好城市」。
"""
def filter_words(words):
# Read filtered words from file named 'filtered_words.txt'... |
katrid/django | refs/heads/master | tests/staticfiles_tests/storage.py | 332 | from datetime import datetime
from django.contrib.staticfiles.storage import CachedStaticFilesStorage
from django.core.files import storage
class DummyStorage(storage.Storage):
"""
A storage class that does implement modified_time() but raises
NotImplementedError when calling
"""
def _save(self, ... |
danielharbor/openerp | refs/heads/master | build/lib/openerp/modules/db.py | 442 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... |
umuzungu/zipline | refs/heads/master | zipline/utils/munge.py | 5 | #
# Copyright 2015 Quantopian, 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 wr... |
poojavade/Genomics_Docker | refs/heads/master | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/pybedtools-0.7.6-py2.7-linux-x86_64.egg/pybedtools/contrib/__init__.py | 1 | from . import bigwig
from . import bigbed
from . import venn_maker
from . import long_range_interaction
from .classifier import MultiClassifier
from .intersection_matrix import IntersectionMatrix
|
rockneurotiko/django | refs/heads/master | tests/admin_changelist/models.py | 276 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
class Event(models.Model):
# Oracle can have problems with a column named "date"
date = models.DateField(db_column="event_date")
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(mo... |
tunneff/tef | refs/heads/master | deps/boost_1_63_0/tools/build/test/core_modifiers.py | 71 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# This tests the "existing" and "updated" modifiers on actions.
import BoostBuild
import string
t = BoostBuild.Tester(pass_t... |
SandroTognana/ardupilotJDU | refs/heads/master | Tools/run_sim_mission.py | 64 | import os.path
import random
import sys
import time
import pexpect
MODULE_DIR = os.path.dirname(os.path.realpath(__file__))
from pymavlink import mavutil, mavwp
# So is this.
sys.path.insert(0, os.path.join(MODULE_DIR, 'autotest'))
sys.path.insert(0, os.path.join(MODULE_DIR, 'autotest', 'pysim'))
import arducopter
... |
candy7393/VTK | refs/heads/master | ThirdParty/Twisted/twisted/test/test_setup.py | 42 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for C{setup.py}, Twisted's distutils integration file.
"""
from __future__ import division, absolute_import
import os, sys
import twisted
from twisted.trial.unittest import SynchronousTestCase
from twisted.python.filepath import FileP... |
routeflow/AutomaticConfigurationRouteFlow | refs/heads/master | POX_CONTROLLER/pox/forwarding/l2_flowvisor.py | 47 | # Copyright 2012 James McCauley
#
# 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 writi... |
Cenditel/cenditel.comunidades.cynin | refs/heads/master | src/ubify.coretypes/ubify/coretypes/content/folder.py | 5 | ###############################################################################
#cyn.in is an open source Collaborative Knowledge Management Appliance that
#enables teams to seamlessly work together on files, documents and content in
#a secure central environment.
#
#cyn.in v2 an open source appliance is distributed ... |
williamfeng323/py-web | refs/heads/master | flask/lib/python3.6/site-packages/setuptools/command/upload_docs.py | 110 | # -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
PyPI's pythonhosted.org).
"""
from base64 import standard_b64encode
from distutils import log
from distutils.errors import DistutilsOptionError
import os
import socket
import zipfile
import tempfile
import ... |
Anfauglith/iop-hd | refs/heads/master | test/functional/wallet-hd.py | 2 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Hierarchical Deterministic wallet function."""
from test_framework.test_framework import IoPTestFramew... |
Eficent/odoomrp-wip | refs/heads/8.0 | mrp_bom_through_attributes/tests/__init__.py | 13 | # -*- coding: utf-8 -*-
# © 2015 Pedro M. Baeza <pedro.baeza@serviciosbaeza.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_mrp_bom_through_attribute
|
akarki15/mozillians | refs/heads/master | vendor-local/lib/python/celery/tests/test_task/test_task_sets.py | 14 | from __future__ import absolute_import
from __future__ import with_statement
import anyjson
from celery.app import app_or_default
from celery.task import Task
from celery.task.sets import subtask, TaskSet
from celery.tests.utils import Case
class MockTask(Task):
name = "tasks.add"
def run(self, x, y, **kw... |
gkumar7/AlGDock | refs/heads/master | Pipeline/dock6_to_nc.py | 2 | import sys
inFN = sys.argv[-1]
if inFN.endswith('.mol2'):
outFN = inFN[:-5]+'.nc'
elif inFN.endswith('.mol2.gz'):
outFN = inFN[:-8]+'.nc'
import os
if os.path.isfile(outFN):
sys.exit()
import AlGDock.IO
IO_dock6_mol2 = AlGDock.IO.dock6_mol2()
(confs, Es) = IO_dock6_mol2.read(inFN)
if confs==[]:
F = open(inF... |
denverfoundation/storybase | refs/heads/develop | apps/storybase_story/migrations/0022_auto__add_storytemplate__add_storytemplatetranslation__add_field_story.py | 1 | # 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):
# Adding model 'StoryTemplate'
db.create_table('storybase_story_storytemplate', (
('id', self.... |
lvhuafu/openwrt | refs/heads/master | target/linux/x86/image/mkimg_bifferboard.py | 561 | #!/usr/bin/env python
"""
Create firmware for 4/8MB Bifferboards, suitable for uploading using
either bb_upload8.py or bb_eth_upload8.py
"""
import struct, sys
# Increase the kmax value if the script gives errors about the kernel being
# too large. You need to set the Biffboot kmax value to the same value yo... |
dmitry-r/incubator-airflow | refs/heads/master | airflow/contrib/executors/__init__.py | 880 | # -*- 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
... |
tecan/xchat-rt | refs/heads/master | plugins/scripts/Supybot-0.83.4.1-bitcoinotc-bot/build/lib/supybot/plugins/Config/plugin.py | 6 | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009, James Vega
# 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 copyri... |
SUNY-Albany-CCI/INF_202_Survey | refs/heads/master | models/db.py | 1 | # -*- coding: utf-8 -*-
#########################################################################
## This scaffolding model makes your app work on Google App Engine too
## File is released under public domain and you can use without limitations
#########################################################################
... |
ltilve/ChromiumGStreamerBackend | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/pyasn1/pyasn1/codec/ber/decoder.py | 185 | # BER decoder
from pyasn1.type import tag, base, univ, char, useful, tagmap
from pyasn1.codec.ber import eoo
from pyasn1.compat.octets import oct2int, octs2ints, isOctetsType
from pyasn1 import debug, error
class AbstractDecoder:
protoComponent = None
def valueDecoder(self, fullSubstrate, substrate, asn1Spec, ... |
projectcalico/calico-nova | refs/heads/calico-readme | nova/tests/unit/api/openstack/compute/contrib/test_block_device_mapping_v1.py | 4 | # Copyright (c) 2014 IBM Corp.
# 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... |
nikolas/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/core/signals.py | 747 | from django.dispatch import Signal
request_started = Signal()
request_finished = Signal()
got_request_exception = Signal(providing_args=["request"])
|
jbfavre/exaproxy | refs/heads/master | lib/exaproxy/html/humans.py | 4 | # encoding: utf-8
"""
humans.py
Created by Thomas Mangin on 2012-02-25.
Copyright (c) 2011-2013 Exa Networks. All rights reserved.
"""
from .images import thomas,david
class humans:
txt = """\
/* TEAM */
Slave Driver / Grand Visionary: Thomas Mangin
Google+: https://plus.google.com/104241996506596749840
Gith... |
Phynix/uniphy | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
"""
Setup of uniphy
"""
from setuptools import setup
import io
import os
current_dir = os.path.abspath(os.path.dirname(__file__))
with io.open(os.path.join(current_dir, 'requirements.txt')) as f:
requirements = f.read().split('\n')
def readme():
"""Open README.md, read the file and... |
abhitopia/tensorflow | refs/heads/master | tensorflow/python/ops/image_grad.py | 101 | # 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... |
daniel-kurushin/iisu | refs/heads/master | tmp/rfind.py | 1 | class Rfind:
pass
|
VisionistInc/advent-of-code-2016 | refs/heads/master | joshgordon/10/bot.py | 1 | class Bot():
def __init__(self):
self.chips = []
self.give_to = [(False, None), (False, None)]
def get(self, chip):
self.chips.append(chip)
self.chips.sort()
def give_chips(self, low, high):
self.give_to = [low, high]
def give(self):
chips = self.chips
self.chips = []
return [... |
Naftoreiclag/Python-Tests | refs/heads/master | source/PygameTest.py | 1 | import pygame, sys
from pygame.locals import *
print pygame.ver
foo = "../resources/hail-damage.jpg"
bar = "../resources/rocket-fly.png"
pygame.init()
screen = pygame.display.set_mode((640, 360), 0, 32)
background = pygame.image.load(foo).convert()
cursor = pygame.image.load(bar).convert_alpha()
x,y = 0,0
movex, ... |
timabbott/zulip | refs/heads/master | zerver/lib/send_email.py | 2 | import datetime
import hashlib
import logging
import os
from email.headerregistry import Address
from email.parser import Parser
from email.policy import default
from email.utils import parseaddr
from typing import Any, Dict, List, Mapping, Optional, Tuple
import ujson
from django.conf import settings
from django.core... |
bobcyw/django | refs/heads/master | django/conf/locale/eo/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = r'j\-\a \d\e F Y' # '26-a ... |
astropy/astropy | refs/heads/main | astropy/coordinates/orbital_elements.py | 4 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module contains convenience functions implementing some of the
algorithms contained within Jean Meeus, 'Astronomical Algorithms',
second edition, 1998, Willmann-Bell.
"""
import numpy as np
from numpy.polynomial.polynomial import polyval
import e... |
leppa/home-assistant | refs/heads/dev | homeassistant/components/proximity/__init__.py | 1 | """Support for tracking the proximity of a device."""
import logging
import voluptuous as vol
from homeassistant.const import CONF_DEVICES, CONF_UNIT_OF_MEASUREMENT, CONF_ZONE
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event import t... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | analytic_solution/test_cases/Contact/Stress_Based_Contact_Verification/SoftContact_ElPPlShear/Area/A_1e-4/compare_HDF5_Gauss_Output.py | 402 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... |
saurabh6790/omn-app | refs/heads/master | accounts/doctype/payment_to_invoice_matching_tool/__init__.py | 37694 | from __future__ import unicode_literals
|
ttgc/TtgcBot | refs/heads/master | src/help.py | 1 | #!usr/bin/env python3.7
#-*-coding:utf-8-*-
## TtgcBot - a bot for discord
## Copyright (C) 2017 Thomas PIOT
##
## 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... |
iabdalkader/openmv | refs/heads/master | scripts/unittest/script/15-find_apriltags.py | 3 | def unittest(data_path, temp_path):
import image
img = image.Image("unittest/data/apriltags.pgm", copy_to_fb=True)
tags = img.find_apriltags()
return len(tags) == 1 and tags[0][0:8] == (45, 27, 69, 69, 255, 16, 80, 61)
|
krieger-od/webrtc | refs/heads/master | PRESUBMIT.py | 37 | # Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... |
ahb0327/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/geos/__init__.py | 518 | """
The GeoDjango GEOS module. Please consult the GeoDjango documentation
for more details:
http://geodjango.org/docs/geos.html
"""
from django.contrib.gis.geos.geometry import GEOSGeometry, wkt_regex, hex_regex
from django.contrib.gis.geos.point import Point
from django.contrib.gis.geos.linestring import LineStrin... |
tango-controls/pytango | refs/heads/develop | tango/asyncio_tools.py | 4 | """Backport some asyncio features."""
from __future__ import absolute_import
import concurrent.futures
try:
import asyncio
except ImportError:
import trollius as asyncio
__all__ = ("run_coroutine_threadsafe",)
def _set_concurrent_future_state(concurrent, source):
"""Copy state from a future to a concur... |
MonicaHsu/truvaluation | refs/heads/master | venv/lib/python2.7/site-packages/pip/exceptions.py | 398 | """Exceptions used throughout package"""
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class DistributionNotFound(InstallationError)... |
orezpraw/unnaturalcode | refs/heads/master | unnaturalcode/testdata/makehuman/makehuman/apps/catmull_clark_subdivision.py | 2 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
"""
Mesh Subdivision Plugin.
**Project Name:** MakeHuman
**Product Home Page:** http://www.makehuman.org/
**Code Home Page:** https://bitbucket.org/MakeHuman/makehuman/
**Authors:** Marc Flerackers, Glynn Clements
**Copyright(c):** MakeHuman Tea... |
mikegraham/dask | refs/heads/master | dask/threaded.py | 3 | """
A threaded shared-memory scheduler
See async.py
"""
from __future__ import absolute_import, division, print_function
from multiprocessing.pool import ThreadPool
from threading import current_thread
from .async import get_async, inc, add
from .compatibility import Queue
from .context import _globals
default_pool... |
sergecodd/FireFox-OS | refs/heads/master | B2G/gecko/media/webrtc/trunk/tools/gyp/pylib/gyp/generator/ninja.py | 2 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import hashlib
import os.path
import re
import subprocess
import sys
import gyp
import gyp.common
import gyp.msvs_emulation
import gyp.MSVSVersion
impo... |
dondi/interview-questions | refs/heads/master | purchase_extractor.py | 1 | def extractPurchases(events):
purchases = []
for event in events:
if event.type == 'purchase':
purchases = purchases + [event]
return purchases
|
Tokyo-Buffalo/tokyosouth | refs/heads/master | env/lib/python3.6/site-packages/scrapy/core/downloader/handlers/__init__.py | 38 | """Download handlers for different schemes"""
import logging
from twisted.internet import defer
import six
from scrapy.exceptions import NotSupported, NotConfigured
from scrapy.utils.httpobj import urlparse_cached
from scrapy.utils.misc import load_object
from scrapy.utils.python import without_none_values
from scrapy... |
jsburg/xdsme | refs/heads/master | XIO/XIO.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Maintained by P.Legrand
28th March 2005
TODO:
- if given, get the goniometer angles (list of 4 angles omega, kappa/chi, phi, theta).
- What needs to be unicode compatible (type(val) == str or unicode)???
New BSD License http://www.opensource.org/licenses/bsd-lice... |
JesselJohn/electron | refs/heads/master | script/lib/config.py | 41 | #!/usr/bin/env python
import errno
import os
import platform
import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'http://github-janky-artifacts.s3.amazonaws.com/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = '8482fe555913dea3bde8a74f754524e2cfb02bc5'
PLATFORM = {
'cygwin': 'win32',
'darwin': ... |
ddd332/presto | refs/heads/master | presto-docs/target/sphinx/docutils/languages/nl.py | 200 | # $Id: nl.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Martijn Pieters <mjpieters@users.sourceforge.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must ... |
shaanlan/youtube-dl | refs/heads/master | youtube_dl/extractor/sharesix.py | 128 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
parse_duration,
)
class ShareSixIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sharesix\.com/(?:f/)?(?P... |
jgsogo/game-dictionary | refs/heads/master | appweb/engine/models.py | 3 | from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.core.urlresolvers import reverse
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from django.utils import timezone
from django.apps import apps
class GameManager(models.Manag... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/loot/npc_loot/jewelry_ear_s02.py | 85615 | import sys
def setup(core, object):
return |
OpenUpgrade-dev/OpenUpgrade | refs/heads/8.0 | openerp/addons/test_inherit/models.py | 15 | # -*- coding: utf-8 -*-
from openerp import models, fields, api, osv
# We just create a new model
class mother(models.Model):
_name = 'test.inherit.mother'
_columns = {
# check interoperability of field inheritance with old-style fields
'name': osv.fields.char('Name', required=True),
}
... |
MartinDelzant/scikit-learn | refs/heads/master | sklearn/tree/setup.py | 150 | import os
import numpy
from numpy.distutils.misc_util import Configuration
def configuration(parent_package="", top_path=None):
config = Configuration("tree", parent_package, top_path)
libraries = []
if os.name == 'posix':
libraries.append('m')
config.add_extension("_tree",
... |
anryko/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudscale/cloudscale_server.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, Gaudenz Steinlin <gaudenz.steinlin@cloudscale.ch>
# Copyright: (c) 2019, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, prin... |
leehosung/writing_sandbox | refs/heads/develop | quiz/migrations/0007_phrase_difficulty.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('quiz', '0006_auto_20141116_1555'),
]
operations = [
migrations.AddField(
model_name='phrase',
name='... |
deanrock/kmotion | refs/heads/v2 | www/www/cgi_bin/xmlHttp_func.py | 3 | #!/usr/bin/env python
# Copyright 2008 David Selby dave6502@googlemail.com
# This file is part of kmotion.
# kmotion 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... |
avanov/django | refs/heads/master | tests/sitemaps_tests/test_generic.py | 379 | from __future__ import unicode_literals
from django.test import override_settings
from .base import SitemapTestsBase
from .models import TestModel
@override_settings(ABSOLUTE_URL_OVERRIDES={})
class GenericViewsSitemapTests(SitemapTestsBase):
def test_generic_sitemap(self):
"A minimal generic sitemap c... |
eliasdorneles/scrapy | refs/heads/master | tests/test_spiderloader/test_spiders/spider2.py | 147 | from scrapy.spiders import Spider
class Spider2(Spider):
name = "spider2"
allowed_domains = ["scrapy2.org", "scrapy3.org"]
|
zero323/spark | refs/heads/master | examples/src/main/python/ml/decision_tree_classification_example.py | 27 | #
# 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 us... |
adairtaosy/spring-security | refs/heads/master | itest/context/src/integration-test/resources/someMethod.py | 49 | print authentication.name;
for authority in authentication.authorities:
print authority
print "Granting access"
allow = 1
|
fw1121/ete | refs/heads/master | ete2/evol/evoltree.py | 3 | # #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# t... |
eskwire/evesrp | refs/heads/master | tests/views/requests/test_lists.py | 1 | from __future__ import absolute_import
from __future__ import unicode_literals
import datetime as dt
from bs4 import BeautifulSoup
from evesrp import db
from evesrp.models import Request, ActionType
from evesrp.auth import PermissionType
from evesrp.auth.models import Pilot, Division, Permission
from ...util_tests impo... |
clumsy/intellij-community | refs/heads/master | python/testData/formatter/shebangCommentIgnored.py | 83 | #!/usr/bin/python3 |
alkemics/luigi | refs/heads/master | luigi/interface.py | 13 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
vincentbernat/feedhq | refs/heads/master | feedhq/feeds/management/commands/add_missing.py | 2 | from django.conf import settings
from ...models import Feed, UniqueFeed, enqueue_favicon
from . import SentryCommand
class Command(SentryCommand):
"""Updates the users' feeds"""
def handle_sentry(self, *args, **kwargs):
missing = Feed.objects.raw(
"""
select f.id, f.url
... |
ryfeus/lambda-packs | refs/heads/master | Opencv_pil/source36/PIL/_util.py | 2 | import os
import sys
py3 = sys.version_info.major >= 3
if py3:
def isStringType(t):
return isinstance(t, str)
def isPath(f):
return isinstance(f, (bytes, str))
else:
def isStringType(t):
return isinstance(t, basestring) # noqa: F821
def isPath(f):
return isinstance(f... |
criccomini/airflow | refs/heads/master | airflow/contrib/operators/mongo_to_s3.py | 9 | # -*- 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
... |
DInnaD/CS50 | refs/heads/master | pset6/sentiments/application.py | 1 | from flask import Flask, redirect, render_template, request, url_for
import os
import helpers
from analyzer import Analyzer
import sys
import nltk
app = Flask(__name__)
@app.route("/")
def index():
return render_template("index.html")
#В application покопировать куски кода из smile
# чтобы найти файлы словарей и ... |
40223201/40223201 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/markdown2.py | 669 | import browser.html
import re
class URL:
def __init__(self,src):
elts = src.split(maxsplit=1)
self.href = elts[0]
self.alt = ''
if len(elts)==2:
alt = elts[1]
if alt[0]=='"' and alt[-1]=='"':self.alt=alt[1:-1]
elif alt[0]=="'" and alt[-1]=="'":sel... |
adlerweb/otr-verwaltung | refs/heads/master | otrverwaltung/config.py | 3 | # -*- coding: utf-8 -*-
### BEGIN LICENSE
# Copyright (C) 2010 Benjamin Elbers <elbersb@gmail.com>
#This program is free software: you can redistribute it and/or modify it
#under the terms of the GNU General Public License version 3, as published
#by the Free Software Foundation.
#
#This program is distributed in the... |
titienmiami/mmc.repository | refs/heads/master | plugin.video.tvalacarta/tvalacarta/channels/rtvv.py | 3 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# tvalacarta - XBMC Plugin
# Canal para Extremadura TV
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,urllib,re
from core import logger
from core i... |
borysiasty/inasafe | refs/heads/develop | safe_extras/parameters/html_widgets/__init__.py | 10 | # coding=utf-8
__author__ = 'ismailsunni'
__project_name = 'parameters'
__filename = '__init__.py'
__date__ = '8/18/14'
__copyright__ = 'ismail@kartoza.com'
__doc__ = ''
|
DXCanas/kolibri | refs/heads/develop | kolibri/core/content/migrations/0005_auto_20171009_0903.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2017-10-09 16:03
from __future__ import unicode_literals
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('content', '0004_auto_20170825_1038'),
]
operations = [
... |
joopert/home-assistant | refs/heads/dev | tests/components/sensor/__init__.py | 104 | """The tests for Sensor platforms."""
|
rgom/Pydev | refs/heads/development | plugins/org.python.pydev.jython/Lib/xml/parsers/expat.py | 35 | # coding: utf-8
#------------------------------------------------------------------------------
# Copyright (c) 2008 Sébastien Boisgérault
#
# 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 w... |
git001/openshift-ansible | refs/heads/master | roles/lib_openshift/library/oc_adm_policy_user.py | 2 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... |
start-jsk/jsk_apc | refs/heads/master | jsk_2015_05_baxter_apc/node_scripts/interface_generator2.py | 2 | #! /usr/bin/env python
# -*- encoding: utf-8 -*-
# ********************************************************************
# Software License Agreement (BSD License)
#
# Copyright (c) 2015, University of Colorado, Boulder
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# m... |
chouseknecht/ansible-modules-core | refs/heads/devel | cloud/openstack/os_volume.py | 69 | #!/usr/bin/python
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# This module 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 late... |
lhellebr/spacewalk | refs/heads/master | client/rhel/rhnlib/test/22-base16values.py | 15 | #!/usr/bin/python
#
# Checking if the values encoded in hex (base 16) are properly decoded.
#
import os
import sys
filename = "base16values.txt"
filename = os.path.join(os.path.dirname(sys.argv[0]), filename)
f = open(filename)
while 1:
line = f.readline()
if not line:
break
arr = line.split(" ", ... |
d40223223/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/etree/ElementPath.py | 785 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... |
bbaumer/ansible-modules-core | refs/heads/devel | cloud/amazon/_ec2_ami_search.py | 25 | #!/usr/bin/python
#
# (c) 2013, Nimbis Services
#
# 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 ver... |
beermix/PySocks | refs/heads/master | sockshandler.py | 59 | #!/usr/bin/env python
"""
SocksiPy + urllib2 handler
version: 0.3
author: e<e@tr0ll.in>
This module provides a Handler which you can use with urllib2 to allow it to tunnel your connection through a socks.sockssocket socket, with out monkey patching the original socket...
"""
import ssl
try:
import urllib2
im... |
willprice/weboob | refs/heads/master | modules/piratebay/browser.py | 4 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2015 Julien Veyssier, Laurent Bachelier
#
# This file is part of weboob.
#
# weboob 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, either version 3 of the L... |
MikeAmy/django | refs/heads/master | tests/auth_tests/models/uuid_pk.py | 33 | import uuid
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.tests.custom_user import RemoveGroupsAndPermissions
from django.db import models
with RemoveGroupsAndPermissions():
class UUIDUser(AbstractUser):
"""A user with a UUID as primary key"""
id = models.UUIDField(d... |
agry/NGECore2 | refs/heads/master | scripts/object/draft_schematic/droid/component/struct_maint_module_2.py | 85615 | import sys
def setup(core, object):
return |
uberamd/NGECore2 | refs/heads/master | scripts/object/tangible/ship/components/weapon/wpn_tiefighter_basic.py | 85615 | import sys
def setup(core, object):
return |
zooba/PTVS | refs/heads/master | Python/Tests/TestData/DebuggerProject/LocalsTestBug484.py | 7 | class weirdlist(list):
def items(self):
return []
x = weirdlist([2,3,4])
print(x) |
jbbskinny/sympy | refs/heads/master | sympy/polys/rings.py | 12 | """Sparse polynomial rings. """
from __future__ import print_function, division
from operator import add, mul, lt, le, gt, ge
from types import GeneratorType
from sympy.core.expr import Expr
from sympy.core.symbol import Symbol, symbols as _symbols
from sympy.core.numbers import igcd, oo
from sympy.core.sympify impo... |
darkwing/kuma | refs/heads/master | vendor/packages/pygments/lexers/inferno.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.inferno
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for Inferno os and all the related stuff.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, by... |
minfun/leetcode | refs/heads/master | notes/producer_consumer2.py | 1 | # Github: https://github.com/minfun/leetcode
# Email: nowican@live.com
# Wechat: creategoodthing
import threading
import time
import Queue
q = Queue.Queue(10)
def producer(worker, q):
count = 0
while True:
if not q.full():
q.put(count)
print('{} produce {}, qsize {}'.format(w... |
eHealthAfrica/onadata | refs/heads/master | onadata/apps/logger/migrations/0002_auto__del_unique_xform_id_string__add_unique_xform_id_string_user.py | 13 | # 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 'XForm', fields ['id_string']
db.delete_unique('odk_logger_xform', ['id_st... |
FreezyExp/dndtools | refs/heads/master | dndtools/dnd/character_classes/urls.py | 3 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, url
urlpatterns = patterns(
'dnd.character_classes.views',
# classes
url(
r'^$',
'character_class_list',
name='character_class_list',
),
# classes > detail
url(
r'^(?P<character_class_slug>[^/]+)/... |
cchurch/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/sts_assume_role.py | 50 | #!/usr/bin/python
# Copyright: 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': ['stableinterf... |
naturali/tensorflow | refs/heads/r0.11 | tensorflow/contrib/learn/python/learn/monitored_session.py | 1 | # pylint: disable=g-bad-file-header
# Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
Mushirahmed/gnuradio | refs/heads/master | gr-wxgui/src/python/__init__.py | 17 | #
# Copyright 2011 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.
#
#... |
SnappleCap/oh-mainline | refs/heads/master | vendor/packages/twisted/twisted/names/root.py | 25 | # -*- test-case-name: twisted.names.test.test_rootresolve -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Resolver implementation for querying successive authoritative servers to
lookup a record, starting from the root nameservers.
@author: Jp Calderone
todo::
robustify it
doc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.