repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
huseyinbiyik/plugin.program.ump | refs/heads/master | lib/providers/video_url_cloudy.py | 2 | import re
import urlparse
def run(hash,ump,referer=None):
src = ump.get_page("http://www.cloudy.ec/embed.php?id="+hash,"utf8")
keys={}
keys["file"]=re.findall('file: ?"(.*?)"',src)[0]
keys["key"]=re.findall('key: ?"(.*?)"',src)[0]
src = ump.get_page("http://www.cloudy.ec/api/player.api.php","utf8",query=keys)
k... |
sencha/chromium-spacewalk | refs/heads/master | tools/perf/measurements/image_decoding.py | 4 | # Copyright 2012 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.
from metrics import power
from telemetry.page import page_test
from telemetry.timeline import model
from telemetry.value import scalar
class ImageDecoding(... |
Workday/OpenFrame | refs/heads/master | tools/telemetry/third_party/gsutilz/gslib/third_party/storage_apitools/storage_v1_messages.py | 23 | # 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... |
dashpay/p2pool-dash | refs/heads/master | p2pool/util/deferral.py | 2 | from __future__ import division
import itertools
import random
import sys
from twisted.internet import defer, reactor
from twisted.python import failure, log
def sleep(t):
d = defer.Deferred(canceller=lambda d_: dc.cancel())
dc = reactor.callLater(t, d.callback, None)
return d
def run_repeatedly(f, *arg... |
CrimsonDev14/crimsoncoin | refs/heads/master | qa/rpc-tests/test_framework/bignum.py | 1 | #!/usr/bin/env python3
#
# bignum.py
#
# This file is copied from python-crimsonlib.
#
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
"""Bignum routines"""
import struct
# generic big endian MPI format
def bn_bytes(v, have... |
tdfischer/organizer | refs/heads/master | crm/admin.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import csv
import logging
from django.utils.html import format_html
from django.core.urlresolvers import reverse
from django.template import loader
from django.urls.resolvers import NoReverseMatch
from django.conf.urls import url
from django.shortcuts imp... |
cr/fxos-certsuite | refs/heads/master | certsuite/reportmanager.py | 7 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import report
import zipfile
import sys
import os
from datetime import datetime
class ReportManager(object):
def __... |
nkrinner/nova | refs/heads/master | nova/scheduler/filters/core_filter.py | 27 | # Copyright (c) 2011 OpenStack Foundation
# Copyright (c) 2012 Justin Santa Barbara
#
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.ap... |
chacoroot/planetary | refs/heads/master | addons/website_customer/__openerp__.py | 313 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the term... |
neno1978/pelisalacarta | refs/heads/develop | python/main-classic/channels/tengourl.py | 2 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para ver un vídeo conociendo su URL
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
from core import logger
from core impo... |
ibmsoe/tensorflow | refs/heads/master | tensorflow/contrib/training/python/training/hparam_test.py | 43 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
mhrivnak/pulp | refs/heads/master | nodes/child/pulp_node/handlers/__init__.py | 187 | # Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or implied,
# including the impl... |
fyffyt/scikit-learn | refs/heads/master | sklearn/__check_build/__init__.py | 345 | """ Module to give helpful messages to the user that did not
compile the scikit properly.
"""
import os
INPLACE_MSG = """
It appears that you are importing a local scikit-learn source tree. For
this, you need to have an inplace install. Maybe you are in the source
directory and you need to try from another location.""... |
misterhat/youtube-dl | refs/heads/master | youtube_dl/extractor/blinkx.py | 199 | from __future__ import unicode_literals
import json
from .common import InfoExtractor
from ..utils import (
remove_start,
int_or_none,
)
class BlinkxIE(InfoExtractor):
_VALID_URL = r'(?:https?://(?:www\.)blinkx\.com/#?ce/|blinkx:)(?P<id>[^?]+)'
IE_NAME = 'blinkx'
_TEST = {
'url': 'http:... |
mhfowler/brocascoconut | refs/heads/master | settings/live.py | 2 | from settings.common import *
DEBUG=True
DATABASES = {
'default': SECRETS_DICT['DATABASES']['LIVE']
}
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# Allow all host headers
ALLOWED_HOSTS = ['*']
# Static asset configuration
STATIC_R... |
EricZaporzan/evention | refs/heads/master | docs/__init__.py | 887 | # Included so that Django's startproject comment runs against the docs directory
|
chuanchang/tp-libvirt | refs/heads/master | samples/ls_disk.py | 35 | """
Shows all existing disk partitions.
This test requires test-provider to be qemu.
Try this test without config, than put ls_disk.cfg into $tests/cfg/ directory
and see the difference.
Additionally you might put ls_disk_v2.cfg into $tests/cfg/ directory and
execute ls_disk_v2 test (which also uses this script!) and... |
kirti3192/spoken-website | refs/heads/master | cron/spoken_search/whoosh/query/terms.py | 30 | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... |
qedi-r/home-assistant | refs/heads/dev | tests/components/sonos/__init__.py | 44 | """Tests for the Sonos component."""
|
khoanguyen0791/cs170 | refs/heads/master | CS170_homework/Asg 52.py | 1 | from PIL import Image
#This is the pixel function:
def pix_manipulate(pic):
(r,g,b) = pic
if r != 0 and g != 0 and b == 0:
r = 0
g = 0
return r,g,b
def y_block(pic,pix_func):
c = pic.copy()
w,h = c.size
for width in range(w):
for height in range(h):
pix = c.... |
NullSoldier/django | refs/heads/master | django/contrib/gis/geometry/regex.py | 657 | import re
# Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure
# to prevent potentially malicious input from reaching the underlying C
# library. Not a substitute for good Web security programming practices.
hex_regex = re.compile(r'^[0-9A-F]+$', re.I)
wkt_regex = re.compile(r'^(SRID=(?P<srid... |
spring-week-topos/horizon-week | refs/heads/spring-week | openstack_dashboard/dashboards/admin/networks/ports/tabs.py | 8 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... |
lrq3000/author-detector | refs/heads/master | authordetector/lib/debug/pympler/muppy.py | 7 | import gc
from pympler import summary
from pympler.util import compat
from inspect import isframe, stack
# default to asizeof if sys.getsizeof is not available (prior to Python 2.6)
try:
from sys import getsizeof as _getsizeof
except ImportError:
from pympler.asizeof import flatsize
_getsizeof = flatsize... |
ArcherSys/ArcherSys | refs/heads/master | Lib/unittest/test/testmock/testmock.py | 1 | <<<<<<< HEAD
<<<<<<< HEAD
import copy
import sys
import unittest
from unittest.test.testmock.support import is_instance
from unittest import mock
from unittest.mock import (
call, DEFAULT, patch, sentinel,
MagicMock, Mock, NonCallableMock,
NonCallableMagicMock, _CallList,
create_autospec
)
class Iter... |
espadrine/opera | refs/heads/master | chromium/src/third_party/WebKit/Tools/Scripts/webkitpy/style/checkers/changelog_unittest.py | 122 | # Copyright (C) 2010 Apple Inc. All rights reserved.
# Copyright (C) 2011 Patrick Gansterer <[email protected]>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the abov... |
40223102/2015cd_midterm | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/_strptime.py | 518 | """Strptime-related classes and functions.
CLASSES:
LocaleTime -- Discovers and stores locale-specific time information
TimeRE -- Creates regexes for pattern matching a string of text containing
time information
FUNCTIONS:
_getlang -- Figure out what language is being used for the locale
... |
kmonsoor/python-for-android | refs/heads/master | python-modules/twisted/twisted/web/test/test_proxy.py | 49 | # Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test for L{twisted.web.proxy}.
"""
from twisted.trial.unittest import TestCase
from twisted.test.proto_helpers import StringTransportWithDisconnection
from twisted.test.proto_helpers import MemoryReactor
from twisted.web.resource i... |
eliksir/mailmojo-python-sdk | refs/heads/master | mailmojo_sdk/models/inline_response200.py | 1 | # coding: utf-8
"""
MailMojo API
v1 of the MailMojo API # noqa: E501
OpenAPI spec version: 1.1.0
Contact: [email protected]
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class InlineResponse200(object):
"""NOTE: Thi... |
robmcdan/python-goose | refs/heads/develop | tests/extractors/publishdate.py | 15 | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... |
Morphux/IRC-Bot | refs/heads/master | main.py | 1 | #!/usr/bin/python
# -*- coding: utf8 -*-
# IRC MORPHUX BOT v2
# By: Louis <[email protected]>
#18:09 @Ne02ptzero: !ascii CL4P_TP
#18:09 @CL4P_TP: _____ _ _ _ _____ _______ _____
#18:09 @CL4P_TP: / ____| | | || | | __ \ \__ __| __ \
#18:09 @CL4P_TP: | | | | | || |_| |__) | | | | |__) |... |
AdrianGaudebert/socorro | refs/heads/master | socorro/external/es/supersearch.py | 2 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import datetime
import re
from collections import defaultdict
from elasticsearch.exceptions import NotFoundError, Reque... |
3dfxmadscientist/cbss-server | refs/heads/master | addons/document/content_index.py | 430 | # -*- 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... |
ilmanzo/scratch_extensions | refs/heads/master | venv/lib/python3.4/site-packages/setuptools/tests/test_windows_wrappers.py | 151 | """
Python Script Wrapper for Windows
=================================
setuptools includes wrappers for Python scripts that allows them to be
executed like regular windows programs. There are 2 wrappers, one
for command-line programs, cli.exe, and one for graphical programs,
gui.exe. These programs are almost ident... |
georgemarshall/django | refs/heads/master | django/conf/locale/cs/formats.py | 35 | # This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j. E Y G:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORM... |
MicroTrustRepos/microkernel | refs/heads/master | src/l4/pkg/python/contrib/Tools/scripts/linktree.py | 101 | #! /usr/bin/env python
# linktree
#
# Make a copy of a directory tree with symbolic links to all files in the
# original tree.
# All symbolic links go to a special symbolic link at the top, so you
# can easily fix things if the original source tree moves.
# See also "mkreal".
#
# usage: mklinks oldtree newtree
import... |
AnishShah/tensorflow | refs/heads/master | tensorflow/compiler/tests/fused_batchnorm_test.py | 2 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
frohoff/Empire | refs/heads/master | lib/modules/python/privesc/osx/piggyback.py | 2 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
# metadata info about the module, not modified during runtime
self.info = {
# name for the module that will appear in module menus
'Name': 'SudoPiggyback',
# list of one or ... |
sean797/Flexget | refs/heads/develop | flexget/plugins/sites/koreus.py | 8 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import re
from flexget import plugin
from flexget.event import event
from flexget.plugins.internal.urlrewriting import UrlRewritingError
from flexget.utils.... |
Alpistinho/FreeCAD | refs/heads/master | src/Mod/Plot/plotSave/TaskPanel.py | 26 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <[email protected]> *
#* ... |
andaag/scikit-learn | refs/heads/master | benchmarks/bench_multilabel_metrics.py | 276 | #!/usr/bin/env python
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function
from timeit import timeit
from functools import partial
import itertools
import argparse
import sys
import matplotlib.pyplot as plt
import scipy.sparse as... |
Belgabor/django | refs/heads/master | tests/regressiontests/i18n/models.py | 11 | from datetime import datetime
from django.db import models
from django.utils.translation import ugettext_lazy as _
class TestModel(models.Model):
text = models.CharField(max_length=10, default=_('Anything'))
class Company(models.Model):
name = models.CharField(max_length=50)
date_added = models.DateTimeFi... |
acarmel/CouchPotatoServer | refs/heads/master | libs/tornado/platform/posix.py | 352 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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... |
apple/swift-clang | refs/heads/stable | docs/analyzer/conf.py | 33 | # -*- coding: utf-8 -*-
#
# Clang Static Analyzer documentation build configuration file, created by
# sphinx-quickstart on Wed Jan 2 15:54:28 2013.
#
# 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... |
DannyVim/ToolsCollection | refs/heads/master | Outdated/db_movie.py | 1 | # -*- coding: utf-8 -*-
"""
这是一个用以获取用户豆瓣数据的爬虫,使得用户可以进行数据的本地备份。
支持:
1.豆瓣电影,豆瓣读书【暂不支持】
2.csv文件为逗号分割符文件。
@author: DannyVim
"""
import urllib2 as ur
from bs4 import BeautifulSoup as bs
import sys
import time
reload(sys)
sys.setdefaultencoding('utf8')
# BASE URL
def basepage(wa):
m_wish = 'http://movie.douban.com/p... |
JoergFritz/genRouteDb | refs/heads/master | correctTrackCities.py | 1 | import MySQLdb as mdb
import numpy as np
from haversine import haversine
# connect to database with running routes
con=mdb.connect(host="mysql.server",user="JoergFritz", \
db="JoergFritz$runRoutesTest",passwd="you-wish")
cur = con.cursor(mdb.cursors.DictCursor)
cur.execute("SELECT MapMyRunId,City,StartLat... |
josephnoir/RIOT | refs/heads/master | tests/thread_msg_block_race/tests/01-run.py | 25 | #!/usr/bin/env python3
# Copyright (C) 2019 Freie Universität Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import sys
from testrunner import run
from pexpect import TIMEOUT
def testfun... |
s40523207/2016fallcp_hw | refs/heads/gh-pages | plugin/sitemap/sitemap.py | 292 | # -*- coding: utf-8 -*-
'''
Sitemap
-------
The sitemap plugin generates plain-text or XML sitemaps.
'''
from __future__ import unicode_literals
import re
import collections
import os.path
from datetime import datetime
from logging import warning, info
from codecs import open
from pytz import timezone
from pelican... |
ghickman/django | refs/heads/master | django/test/__init__.py | 341 | """
Django Unit Test and Doctest framework.
"""
from django.test.client import Client, RequestFactory
from django.test.testcases import (
LiveServerTestCase, SimpleTestCase, TestCase, TransactionTestCase,
skipIfDBFeature, skipUnlessAnyDBFeature, skipUnlessDBFeature,
)
from django.test.utils import (
ignore... |
smartdata-x/robots | refs/heads/master | pylib/Twisted/twisted/test/test_ftp.py | 23 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
FTP tests.
"""
import os
import errno
from StringIO import StringIO
import getpass
from zope.interface import implements
from zope.interface.verify import verifyClass
from twisted.trial import unittest
from twisted.python.randbytes import i... |
popazerty/e2-gui | refs/heads/master | RecordTimer.py | 4 | from boxbranding import getMachineBrand, getMachineName
import xml.etree.cElementTree
from time import localtime, strftime, ctime, time
from bisect import insort
from sys import maxint
import os
from enigma import eEPGCache, getBestPlayableServiceReference, eServiceReference, eServiceCenter, iRecordableService, quitMa... |
harikishen/addons-server | refs/heads/master | src/olympia/search/utils.py | 5 | import re
from olympia.versions.compare import version_re
def floor_version(version):
if version:
version = str(
version).replace('.x', '.0').replace('.*', '.0').replace('*', '.0')
match = re.match(version_re, version)
if match:
major, minor = match.groups()[:2]
... |
stainsteelcrown/nonsense-story-generator | refs/heads/master | venv/lib/python2.7/site-packages/flask/testsuite/test_apps/config_package_app/__init__.py | 1257 | import os
import flask
here = os.path.abspath(os.path.dirname(__file__))
app = flask.Flask(__name__)
|
lupyuen/RaspberryPiImage | refs/heads/master | usr/share/pyshared/ajenti/plugins/services/__init__.py | 1 | from ajenti.api import *
from ajenti.plugins import *
info = PluginInfo(
title='Services',
icon='play',
dependencies=[
PluginDependency('main'),
PluginDependency('dashboard'),
],
)
def init():
import api
try:
import dbus
import sm_upstart
imp... |
mitre/hybrid-curation | refs/heads/master | src/simple-score.py | 1 | """
Copyright 2015 The MITRE Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
djkonro/client-python | refs/heads/master | kubernetes/test/test_v1_gce_persistent_disk_volume_source.py | 2 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... |
tushar7795/MicroBlog | refs/heads/master | flask/lib/python2.7/site-packages/wheel/install.py | 472 | """
Operations on existing wheel files, including basic installation.
"""
# XXX see patched pip to install
import sys
import warnings
import os.path
import re
import zipfile
import hashlib
import csv
import shutil
try:
_big_number = sys.maxsize
except NameError:
_big_number = sys.maxint
from wheel.decorato... |
youprofit/ansible | refs/heads/devel | test/units/plugins/inventory/__init__.py | 7690 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
endlessm/chromium-browser | refs/heads/master | third_party/llvm/lldb/test/API/python_api/thread/TestThreadAPI.py | 1 | """
Test SBThread APIs.
"""
from __future__ import print_function
import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
from lldbsuite.test.lldbutil import get_stopped_thread, get_caller_symbol
class ThreadAPITestCase(TestBase):
mydir = T... |
sabi0/intellij-community | refs/heads/master | python/testData/dotNet/import_system.py | 80 | from S<caret>ystem.Web import AspNetHostingPermission
print AspNetHostingPermission |
Nick-OpusVL/odoo | refs/heads/8.0 | addons/account/wizard/account_subscription_generate.py | 347 | # -*- 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... |
achals/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/pulldom.py | 1729 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... |
burakbayramli/dersblog | refs/heads/master | algs/algs_105_mesquita/test3.py | 2 | import bdm
# In 10, Out 1
bdm.run("brexit.csv",iter=4)
|
scrapinghub/disco | refs/heads/master | lib/disco/schemes/scheme_discodb.py | 2 | import __builtin__
from disco import util
from discodb import DiscoDB, Q
def open(url, task=None):
if task:
disco_data = task.disco_data
ddfs_data = task.ddfs_data
else:
from disco.settings import DiscoSettings
settings = DiscoSettings()
disco_data = settings['DISCO_DAT... |
uwdata/termite-data-server | refs/heads/master | web2py/gluon/contrib/gae_memcache.py | 9 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Developed by Robin Bhattacharyya (memecache for GAE)
Released under the web2py license (LGPL)
from gluon.contrib.gae_memcache import MemcacheClient
cache.ram=cache.disk=MemcacheClient(request)
"""
import time
from google.appengine.api.memcache import Client
class M... |
a0c/odoo | refs/heads/master | addons/hw_posbox_upgrade/controllers/main.py | 45 | # -*- coding: utf-8 -*-
import logging
import os
import time
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
import threading
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
upgrade_template = """
<!DOCTY... |
ghandiosm/Test | refs/heads/master | addons/website_livechat/models/website.py | 43 | # -*- coding: utf-8 -*-
from openerp.osv import osv
from openerp import api, fields, models
from openerp.http import request
class Website(models.Model):
_inherit = "website"
channel_id = fields.Many2one('im_livechat.channel', string='Website Live Chat Channel')
class WebsiteConfigSettings(models.Transient... |
devendermishrajio/nova_test_latest | refs/heads/master | nova/tests/unit/virt/libvirt/test_driver.py | 4 | # Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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.... |
msebire/intellij-community | refs/heads/master | python/testData/copyPaste/LineToPrev.src.py | 249 | print 1<selection>
print 2</selection>
print 3
|
leppa/home-assistant | refs/heads/dev | tests/components/water_heater/test_reproduce_state.py | 5 | """Test reproduce state for Water heater."""
from homeassistant.components.water_heater import (
ATTR_AWAY_MODE,
ATTR_OPERATION_MODE,
ATTR_TEMPERATURE,
SERVICE_SET_AWAY_MODE,
SERVICE_SET_OPERATION_MODE,
SERVICE_SET_TEMPERATURE,
STATE_ECO,
STATE_GAS,
)
from homeassistant.const import SERV... |
AlexMold/shopify | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 899 | # 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 collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... |
rorasa/NotifyMe | refs/heads/master | requests/packages/chardet/universaldetector.py | 1775 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
orekyuu/intellij-community | refs/heads/master | python/testData/copyPaste/singleLine/Indent11.dst.py | 747 | class C:
def foo(self):
<caret>y = 2
|
koying/xbmc-pivos | refs/heads/master | tools/EventClients/Clients/XBMC Send/xbmc-send.py | 49 | #!/usr/bin/python
#
# XBMC Media Center
# XBMC Send
# Copyright (c) 2009 team-xbmc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any la... |
khaliiid/newvisualizer | refs/heads/master | src/components/jit/webpy/web/browser.py | 16 | """Browser to test web applications.
(from web.py)
"""
from utils import re_compile
from net import htmlunquote
import httplib, urllib, urllib2
import cookielib
import copy
from StringIO import StringIO
DEBUG = False
__all__ = [
"BrowserError",
"Browser", "AppBrowser",
"AppHandler"
]
class BrowserError(... |
bryanbrazil/xbmc | refs/heads/master | lib/gtest/test/gtest_env_var_test.py | 2408 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
Futubank/django-futupayments | refs/heads/master | example/app/tests.py | 1 | from django.test import LiveServerTestCase
try:
from django.urls import reverse
except:
from django.core.urlresolvers import reverse
class TestMainUsage(LiveServerTestCase):
def setUp(self):
from selenium import webdriver
self.selenium = webdriver.Chrome()
self.selenium.implicitly_... |
AppliedMicro/ENGLinuxLatest | refs/heads/apm_linux_v3.18 | tools/perf/scripts/python/sctop.py | 1996 | # system call top
# (c) 2010, Tom Zanussi <[email protected]>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
SteveViss/readthedocs.org | refs/heads/master | readthedocs/doc_builder/loader.py | 33 | from django.utils.importlib import import_module
from django.conf import settings
# Managers
mkdocs = import_module(
getattr(settings, 'MKDOCS_BACKEND',
'readthedocs.doc_builder.backends.mkdocs'))
sphinx = import_module(
getattr(settings, 'SPHINX_BACKEND',
'readthedocs.doc_builder.backe... |
ToontownUprising/src | refs/heads/master | toontown/cogdominium/CogdoMazeSuits.py | 3 | from pandac.PandaModules import Point3, VBase4
from direct.fsm.FSM import FSM
from direct.interval.IntervalGlobal import Sequence, Parallel, ActorInterval, Func, Wait, ParticleInterval, Track, LerpColorScaleInterval, LerpScaleInterval, LerpHprInterval
from direct.task.Task import Task
from toontown.battle import Battle... |
alex-march/micropython | refs/heads/master | tests/thread/mutate_dict.py | 43 | # test concurrent mutating access to a shared dict object
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd
import _thread
# the shared dict
di = {'a':'A', 'b':'B', 'c':'C', 'd':'D'}
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
... |
xxsergzzxx/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/codesearch/service.py | 103 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2007 Benoit Chesneau <[email protected]>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS... |
zwadar/pyqode.python | refs/heads/master | pyqode/python/modes/autoindent.py | 1 | # -*- coding: utf-8 -*-
""" Contains smart indent modes """
import re
from pyqode.core.api import TextHelper, get_block_symbol_data
from pyqode.qt.QtGui import QTextCursor
from pyqode.core.modes import AutoIndentMode, SymbolMatcherMode
from pyqode.core.modes.matcher import CLOSE, PAREN, SQUARE, BRACE, OPEN
class PyAu... |
zorojean/scrapy | refs/heads/master | tests/mocks/dummydbm.py | 179 | """DBM-like dummy module"""
import collections
class DummyDB(dict):
"""Provide dummy DBM-like interface."""
def close(self):
pass
error = KeyError
_DATABASES = collections.defaultdict(DummyDB)
def open(file, flag='r', mode=0o666):
"""Open or create a dummy database compatible.
Arguments ... |
netsamir/dotfiles | refs/heads/master | files/vim/bundle/YouCompleteMe/third_party/ycmd/third_party/python-future/src/libpasteurize/fixes/fix_unpacking.py | 60 | u"""
Fixer for:
(a,)* *b (,c)* [,] = s
for (a,)* *b (,c)* [,] in d: ...
"""
from lib2to3 import fixer_base
from itertools import count
from lib2to3.fixer_util import (Assign, Comma, Call, Newline, Name,
Number, token, syms, Node, Leaf)
from libfuturize.fixer_util import indentation, sui... |
sonjagruen/elephant | refs/heads/master | elephant/spike_train_correlation.py | 3 | # -*- coding: utf-8 -*-
"""
Spike train correlation
This modules provides functions to calculate correlations between spike trains.
:copyright: Copyright 2015 by the Elephant team, see AUTHORS.txt.
:license: Modified BSD, see LICENSE.txt for details.
"""
from __future__ import division
import numpy as np
def corrco... |
etkirsch/scikit-learn | refs/heads/master | examples/classification/plot_lda_qda.py | 78 | """
====================================================================
Linear and Quadratic Discriminant Analysis with confidence ellipsoid
====================================================================
Plot the confidence ellipsoids of each class and decision boundary
"""
print(__doc__)
from scipy import lin... |
coolbombom/CouchPotato | refs/heads/master | cherrypy/process/win32.py | 93 | """Windows service. Requires pywin32."""
import os
import win32api
import win32con
import win32event
import win32service
import win32serviceutil
from cherrypy.process import wspbus, plugins
class ConsoleCtrlHandler(plugins.SimplePlugin):
"""A WSPBus plugin for handling Win32 console events (like Ctrl-C)."""
... |
youprofit/zato | refs/heads/master | code/zato-server/src/zato/server/service/internal/security/wss.py | 6 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2010 Dariusz Suchojad <dsuch at zato.io>
Licensed under LGPLv3, see LICENSE.txt for terms and conditions.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# stdlib
from contextlib import closing
from traceback import format_exc
from uui... |
cloudera/Impala | refs/heads/cdh6.3.0 | tests/query_test/test_chars.py | 1 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
jlcarmic/producthunt_simulator | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sjisprober.py | 1776 | ######################## 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... |
ahmadsyarif/Python-Agent | refs/heads/master | Data.py | 2 | __author__ = 'Ahmad Syarif'
import pika
import json
from pydispatch import dispatcher
VISUAL_FACE_DETECTION = 'VISUAL_FACE_DETECTION'
VISUAL_FACE_DETECTION = 'VISUAL_FACE_DETECTION'
VISUAL_FACE_RECOGNITION ='VISUAL_FACE_RECOGNITION'
VISUAL_FACE_TRACKING = 'VISUAL_FACE_TRACKING'
VISUAL_HUMAN_TRACKING = 'VISUAL_HUMAN_TR... |
obi-two/Rebelion | refs/heads/master | data/scripts/templates/object/tangible/deed/naboo/player_house_deed/shared_naboo_house_large_deed.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/naboo/player_house_deed/shared_naboo_house_large_deed.iff"
res... |
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/payments_account_service/transports/base.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
manassolanki/frappe | refs/heads/develop | frappe/website/doctype/help_category/help_category.py | 22 | # Copyright (c) 2013, Frappe and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.website.website_generator import WebsiteGenerator
from frappe.website.doctype.help_article.help_article import clear_cache
class HelpCategory(WebsiteGenerat... |
Tomsod/gemrb | refs/heads/master | gemrb/GUIScripts/demo/LoadScreen.py | 6 | def StartLoadScreen():
pass
def SetLoadScreen():
pass
|
geminy/aidear | refs/heads/master | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/tools/grit/grit/lazy_re.py | 63 | #!/usr/bin/env python
# Copyright (c) 2012 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.
'''In GRIT, we used to compile a lot of regular expressions at parse
time. Since many of them never get used, we use lazy_re to co... |
elmerdpadilla/iv | refs/heads/8.0 | addons/auth_openid/__openerp__.py | 313 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
beni55/picochess | refs/heads/master | libs/paramiko/dsskey.py | 11 | # Copyright (C) 2003-2007 Robey Pointer <[email protected]>
#
# This file is part of paramiko.
#
# Paramiko 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 2.1 of the License, or (a... |
Carmezim/tensorflow | refs/heads/master | tensorflow/contrib/solvers/python/__init__.py | 959 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
390910131/Misago | refs/heads/master | misago/core/tests/test_momentjs.py | 8 | from django.conf import settings
from django.test import TestCase
from misago.core.momentjs import list_available_locales, get_locale_path
class MomentJSTests(TestCase):
def test_list_available_locales(self):
"""list_available_locales returns list of locales"""
TEST_CASES = (
'af',
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.