repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Huehnerbrust/romcollectionbrowser | refs/heads/master | resources/lib/xbmcgui.py | 10 |
#Dummy module to satisfy the required import in dbupdate |
CydarLtd/ansible | refs/heads/devel | lib/ansible/modules/network/netconf/__init__.py | 12133432 | |
dbbhattacharya/kitsune | refs/heads/master | vendor/packages/sqlalchemy/test/ex/__init__.py | 12133432 | |
zenoss/Community-Zenpacks | refs/heads/master | ZenPacks.chudler.GoogleAppEngine/ZenPacks/chudler/GoogleAppEngine/appenginemodeler.py | 3 | """Inspired by the Zenoss Enterprise VMware ESX Plugin"""
import time
import Globals
from Products.ZenEvents import Event
from Products.ZenHub.PBDaemon import PBDaemon
from Products.ZenUtils.Driver import drive, driveLater
from ZenPacks.chudler.GoogleAppEngine.gaeclient import createGAEClient
from ZenPacks.chudler.Goo... |
kyhwsk/shadowsocks | refs/heads/master | tests/test_udp_src.py | 1009 | #!/usr/bin/python
import socket
import socks
SERVER_IP = '127.0.0.1'
SERVER_PORT = 1081
if __name__ == '__main__':
# Test 1: same source port IPv4
sock_out = socks.socksocket(socket.AF_INET, socket.SOCK_DGRAM,
socket.SOL_UDP)
sock_out.set_proxy(socks.SOCKS5, SERVER_IP, S... |
idem2lyon/persomov | refs/heads/master | libs/guessit/transfo/split_explicit_groups.py | 150 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2012 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... |
stanley-cheung/grpc | refs/heads/master | src/python/grpcio_tests/tests_aio/channelz/__init__.py | 32 | # Copyright 2020 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
cwgis/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/no-output/gyptest-no-output.py | 151 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verified things don't explode when there are targets without outputs.
"""
import TestGyp
test = TestGyp.TestGyp()
test.run_gyp('noout... |
aidanlister/django | refs/heads/master | tests/urlpatterns_reverse/urls_error_handlers_callables.py | 513 | # Used by the ErrorHandlerResolutionTests test case.
from .views import empty_view
urlpatterns = []
handler400 = empty_view
handler404 = empty_view
handler500 = empty_view
|
Suwings/Yeinw | refs/heads/master | src/Suwings/route/route_file_manager.py | 1 | # -*- coding: utf-8 -*-
from bottle.bottle import route, run, template,static_file,request
from bottle.bottle import abort as Googbye
from Suwings.file_system import manager
from Suwings import global_manager
from Suwings import const
from Suwings.const import *
from Suwings.security.path_filter import *
from Suwing... |
tristantao/py-bing-search | refs/heads/master | tests/__init__.py | 12133432 | |
webgeodatavore/django | refs/heads/master | django/contrib/admin/migrations/__init__.py | 12133432 | |
emuikernel/BaijieCppUILib | refs/heads/master | AggRender/Graphin/src/agg/freetype2/src/tools/docmaker/utils.py | 6 | import string, sys, os, glob
# current output directory
#
output_dir = None
# This function is used to sort the index. It is a simple lexicographical
# sort, except that it places capital letters before lowercase ones.
#
def index_sort( s1, s2 ):
if not s1:
return -1
if not s2:
return 1
... |
aktech/codeplay | refs/heads/master | playcode/migrations/__init__.py | 12133432 | |
saurabh6790/trufil_app | refs/heads/master | buying/report/supplier_addresses_and_contacts/__init__.py | 12133432 | |
sciencewiz1/datahub | refs/heads/master | src/datahub/util/__init__.py | 12133432 | |
pelikanchik/edx-platform | refs/heads/master | common/djangoapps/static_replace/management/__init__.py | 12133432 | |
sirrice/scorpion | refs/heads/master | tests/unit/sharedobj.py | 1 | from scorpion.sharedobj import *
from scorpion.sql import *
from scorpion.sqlparser import *
from scorpion.db import *
parsed = parse_sql("select hr, avg(temp) from readings group by hr")
parsed.where.append("sensor in %s")
params = [('1', '2', '18')]
db = connect("intel")
obj = SharedObj(db, parsed=parsed, params... |
jcpowermac/ansible | refs/heads/devel | lib/ansible/plugins/action/junos.py | 10 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... |
lsqtongxin/django | refs/heads/master | tests/postgres_tests/migrations/0001_setup_extensions.py | 310 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
try:
from django.contrib.postgres.operations import (
HStoreExtension, UnaccentExtension,
)
except ImportError:
from django.test import mock
HStoreExtension = mock.Mock()
UnaccentExtension = mo... |
jphnoel/udata | refs/heads/dev | udata/core/site/factories.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import factory
from factory.mongoengine import MongoEngineFactory
from udata import models
from udata.utils import faker
class SiteSettingsFactory(MongoEngineFactory):
class Meta:
model = models.SiteSettings
class SiteFactory(MongoEngine... |
TeachAtTUM/edx-platform | refs/heads/master | cms/djangoapps/models/settings/course_metadata.py | 7 | """
Django module for Course Metadata class -- manages advanced settings and related parameters
"""
from django.conf import settings
from django.utils.translation import ugettext as _
from six import text_type
from xblock.fields import Scope
from xblock_django.models import XBlockStudioConfigurationFlag
from xmodule.m... |
mnahm5/django-estore | refs/heads/master | Lib/site-packages/boto/rds2/layer1.py | 72 | # Copyright (c) 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... |
gravio-net/graviocoin | refs/heads/gio.0.1.8 | qa/rpc-tests/mempool_resurrect_test.py | 99 | #!/usr/bin/env python3
# Copyright (c) 2014-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 resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework... |
vilorious/pyload | refs/heads/stable | module/plugins/hoster/KickloadCom.py | 15 | # -*- coding: utf-8 -*-
from module.plugins.internal.DeadHoster import DeadHoster, create_getInfo
class KickloadCom(DeadHoster):
__name__ = "KickloadCom"
__type__ = "hoster"
__version__ = "0.22"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?kickload\.com/get/.+'
__config__ ... |
clemkoa/scikit-learn | refs/heads/master | examples/cluster/plot_kmeans_assumptions.py | 76 | """
====================================
Demonstration of k-means assumptions
====================================
This example is meant to illustrate situations where k-means will produce
unintuitive and possibly unexpected clusters. In the first three plots, the
input data does not conform to some implicit assumptio... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/share/pyshared/telepathy/server/channelmanager.py | 5 | # telepathy-python - Base classes defining the interfaces of the Telepathy framework
#
# Copyright (C) 2009-2010 Collabora Limited
#
# 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... |
jayfk/cookiecutter-django-docker | refs/heads/master | {{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/users/urls.py | 262 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
# URL pattern for the UserListView
url(
regex=r'^$',
view=views.UserListView.as_view(),
name='list'
),
# URL pattern for the U... |
breisfeld/avoplot | refs/heads/master | src/avoplot/gui/analysis_tools.py | 3 | #Copyright (C) Nial Peters 2013
#
#This file is part of AvoPlot.
#
#AvoPlot 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.
#
#AvoPlot is ... |
sbrichards/rockstor-core | refs/heads/test_initial | src/rockstor/storageadmin/views/clone_helpers.py | 1 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor 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... |
ammaradil/fibonacci | refs/heads/master | Lib/site-packages/pip/_vendor/cachecontrol/serialize.py | 317 | import base64
import io
import json
import zlib
from pip._vendor.requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, pickle
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def _b64_decode... |
rosecatherinek/TransNets | refs/heads/master | src/StreamingUtils/__init__.py | 12133432 | |
scherroman/mugen | refs/heads/master | scripts/__init__.py | 12133432 | |
adrian-soto/Waterpack | refs/heads/master | pack/__init__.py | 12133432 | |
ryfeus/lambda-packs | refs/heads/master | Pdf_docx_pptx_xlsx_epub_png/source/pptx/opc/packuri.py | 8 | # encoding: utf-8
"""
Provides the PackURI value type along with some useful known pack URI strings
such as PACKAGE_URI.
"""
import posixpath
import re
class PackURI(str):
"""
Provides access to pack URI components such as the baseURI and the
filename slice. Behaves as |str| otherwise.
"""
_file... |
dushu1203/chromium.src | refs/heads/nw12 | tools/binary_size/binary_size_utils.py | 53 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Common utilities for tools that deal with binary size information.
"""
import logging
import re
def ParseNm(nm_lines):
"""Parse nm output, returning ... |
mbayon/TFG-MachineLearning | refs/heads/master | venv/lib/python3.6/site-packages/scipy/signal/tests/test_windows.py | 4 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import array
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_allclose,
assert_equal, assert_, assert_array_less)
from pytest import raise... |
arun6582/django | refs/heads/master | tests/test_client/test_conditional_content_removal.py | 131 | import gzip
from django.http import HttpRequest, HttpResponse, StreamingHttpResponse
from django.test import SimpleTestCase
from django.test.client import conditional_content_removal
class ConditionalContentTests(SimpleTestCase):
def test_conditional_content_removal(self):
"""
Content is removed... |
drrk/micropython | refs/heads/master | tests/import/pkg3/__init__.py | 259 | print("pkg __name__:", __name__)
|
ffsdmad/af-web | refs/heads/master | cgi-bin/plugins2/public/fond_num_search.py | 1 | # -*- coding: utf8 -*-
SQL = (
("fond","""select SQL_CALC_FOUND_ROWS KOD as FOND_ID, FKOD,FNAME, A1,A6,A7,A9 FROM `af3_fond` where FKOD like '%%%(q)s%%' order by FKOD limit %(offset)d,%(limit)d;"""),
("achiv", "SELECT SQL_CALC_FOUND_ROWS ANAME,L1,L2,L3 FROM ARHIV limit 1;"),
)
FOUND_ROWS = True
ROOT = "list_fon... |
bitifirefly/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_html_module.py | 76 | import unittest
from mock import Mock
from xblock.field_data import DictFieldData
from xmodule.html_module import HtmlModule, HtmlDescriptor
from . import get_test_system, get_test_descriptor_system
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xblock.fields import ScopeIds
def instantiate_des... |
induane/pazar | refs/heads/master | tests/base58_tests.py | 1 | # Standard
from unittest import TestCase
# Project
from pazar.utils import base58
class Base58Tests(TestCase):
def test_encode_1(self):
self.assertEqual('Tgmc', base58.encode(10002343))
def test_decode_1(self):
self.assertEqual(10002343, base58.decode('Tgmc'))
def test_encode_1(self):
self.asser... |
budnyjj/ofagent | refs/heads/master | networking_ofagent/plugins/ofagent/agent/ofswitch.py | 21 | # Copyright (C) 2014 VA Linux Systems Japan K.K.
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
# 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... |
mzdaniel/oh-mainline | refs/heads/master | vendor/packages/gdata/src/gdata/tlslite/FileObject.py | 359 | """Class returned by TLSConnection.makefile()."""
class FileObject:
"""This class provides a file object interface to a
L{tlslite.TLSConnection.TLSConnection}.
Call makefile() on a TLSConnection to create a FileObject instance.
This class was copied, with minor modifications, from the
_fileobject... |
Cisco-Talos/pyrebox | refs/heads/master | volatility/volatility/plugins/addrspaces/ieee1394.py | 58 | # Volatility
#
# Authors:
# Mike Auty <mike.auty@gmail.com>
#
# This file is part of Volatility.
#
# Volatility 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 op... |
scls19fr/blaze | refs/heads/master | blaze/server/tests/test_server.py | 6 | from __future__ import absolute_import, division, print_function
import pytest
pytest.importorskip('flask')
from base64 import b64encode
import datashape
import numpy as np
from datetime import datetime
from pandas import DataFrame
from toolz import pipe
from odo import odo
from blaze.utils import example
from blaz... |
SwagColoredKitteh/servo | refs/heads/master | tests/wpt/web-platform-tests/subresource-integrity/tools/generate_javascript.py | 210 | from os import path, listdir
from hashlib import sha512, sha256, md5
from base64 import b64encode
import re
JS_DIR = path.normpath(path.join(__file__, "..", ".."))
'''
Yield each file in the javascript directory
'''
def js_files():
for f in listdir(JS_DIR):
if path.isfile(f) and f.endswith(".js"):
yield f... |
fritsvanveen/QGIS | refs/heads/master | python/plugins/processing/gui/RenderingStyleFilePanel.py | 15 | # -*- coding: utf-8 -*-
"""
***************************************************************************
RenderingStyleFilePanel.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
***************... |
jjmleiro/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/contrib/auth/middleware.py | 56 | from django.contrib import auth
from django.contrib.auth import load_backend
from django.contrib.auth.backends import RemoteUserBackend
from django.core.exceptions import ImproperlyConfigured
from django.utils.functional import SimpleLazyObject
def get_user(request):
if not hasattr(request, '_cached_user'):
... |
abzaloid/maps | refs/heads/master | django-project/lib/python2.7/site-packages/django/conf/locale/es_NI/formats.py | 115 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y \a \l\a\s H:i'
YEAR_MONTH_FORMAT = r'F \d\e Y'
MONTH_DAY_FORMAT = r'j \d\e F'
SHORT_DATE_... |
Muscaw/MangaReader | refs/heads/master | downloader.py | 1 | #!/usr/bin/python
# 1: output folder
# 2: manga
from bs4 import BeautifulSoup
import sys
import os
import requests
import mimetypes
import zipfile
from os.path import basename
base_url = "http://www.mangareader.net/"
ind_output_folder = 1
ind_manga = 2
ind_start_chapter = 3
ind_end_chapter = 4
def start_zip_file(ou... |
troika-framework/troika-http | refs/heads/master | tests/test_route.py | 1 | import unittest
from troika.http import route
|
colonelnugget/pychess | refs/heads/master | lib/pychess/ic/managers/AutoLogOutManager.py | 22 | #from gobject import *
from gi.repository import GObject
class AutoLogOutManager (GObject.GObject):
__gsignals__ = {
'logOut': (GObject.SignalFlags.RUN_FIRST, None, ())
}
def __init__ (self, connection):
GObject.GObject.__init__(self)
self.connection = connection
... |
pothos/zpaqlpy | refs/heads/master | test/pnm.py | 1 | #!/usr/bin/env python3
# Copyright (C) 2016 Kai Lüke kailueke@riseup.net
# This program comes with ABSOLUTELY NO WARRANTY and is free software, you are welcome to redistribute it
# under certain conditions, see https://www.gnu.org/licenses/gpl-3.0.en.html
### BEGIN OF EDITABLE SECTION - do not remove this marker or pla... |
YinongLong/scikit-learn | refs/heads/master | examples/ensemble/plot_random_forest_regression_multioutput.py | 28 | """
============================================================
Comparing random forests and the multi-output meta estimator
============================================================
An example to compare multi-output regression with random forest and
the :ref:`multioutput.MultiOutputRegressor <_multiclass>` meta-... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/251_test_logging.py | 7 | #!/usr/bin/env python
#
# Copyright 2001-2004 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... |
rvalyi/OpenUpgrade | refs/heads/master | addons/auth_oauth/res_users.py | 34 | import logging
import werkzeug.urls
import urlparse
import urllib2
import simplejson
import openerp
from openerp.osv import osv, fields
from openerp import SUPERUSER_ID
_logger = logging.getLogger(__name__)
class res_users(osv.Model):
_inherit = 'res.users'
_columns = {
'oauth_provider_id': fields.... |
jinie/sublime-wakatime | refs/heads/master | packages/wakatime/packages/simplejson/tests/test_bitsize_int_as_string.py | 121 | from unittest import TestCase
import simplejson as json
class TestBitSizeIntAsString(TestCase):
# Python 2.5, at least the one that ships on Mac OS X, calculates
# 2 ** 31 as 0! It manages to calculate 1 << 31 correctly.
values = [
(200, 200),
((1 << 31) - 1, (1 << 31) - 1),
((1 <... |
achals/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/testing/test_cache.py | 177 | import sys
import _pytest
import pytest
import os
import shutil
pytest_plugins = "pytester",
class TestNewAPI:
def test_config_cache_makedir(self, testdir):
testdir.makeini("[pytest]")
config = testdir.parseconfigure()
with pytest.raises(ValueError):
config.cache.makedir("key/... |
pztrick/django-allauth | refs/heads/master | allauth/socialaccount/providers/bitly/views.py | 10 | import requests
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from .provider import BitlyProvider
class BitlyOAuth2Adapter(OAuth2Adapter):
provider_id = BitlyProvider.id
access_token_url = 'https://api-ssl.bitly.com/oauth/access_... |
simvisage/oricreate | refs/heads/master | apps/miura_ori/sim_miura_ori_nxny_psi_cntl.py | 1 | r'''
Fold the Miura ori crease pattern using psi control
---------------------------------------------------
'''
import numpy as np
from oricreate.api import MiuraOriCPFactory
from oricreate.api import \
SimulationTask, SimulationConfig, \
FTV, FTA
from oricreate.forming_tasks.forming_process import FormingPro... |
shoreflyer/cerbero | refs/heads/master | cerbero/tools/pkgconfig.py | 26 | #!/usr/bin/env python
# cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free So... |
sahiljain/catapult | refs/heads/master | third_party/gsutil/third_party/boto/boto/rds/vpcsecuritygroupmembership.py | 177 | # Copyright (c) 2013 Anthony Tonns http://www.corsis.com/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify... |
Finalfantasykid/PenguinCMS | refs/heads/master | PenguinCMS/vendor/simplediff/simplediff.py | 1 |
# Simple Diff for Python v 0.1
# (C) Paul Butler 2008 <http://www.paulbutler.org/>
# May be used and distributed under the zlib/libpng license
# <http://www.opensource.org/licenses/zlib-license.php>
def diff(old, new):
"""Find the differences between two lists. Returns a list of pairs, where the first value
i... |
DinoCow/airflow | refs/heads/master | tests/providers/sftp/operators/__init__.py | 4185 | # 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... |
kingvuplus/PKT-gui2 | refs/heads/master | lib/python/enigma_py_patcher.py | 139 | #read the comment to this file in lib/service/iservice.h !!
import sys
import os
filename = sys.argv[1]
os.rename(filename, filename + ".org")
source=open(filename + ".org", "r")
dest=open(filename, "w")
for line, str in enumerate(source):
oldstr = str[:]
str = str.replace('_ENUMS)', ')')
pos = str.find('_ENUMS'... |
guettli/django | refs/heads/master | django/contrib/contenttypes/fields.py | 36 | from __future__ import unicode_literals
from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, models, router, transaction
from django... |
garbas/mozilla-releng-services | refs/heads/master | src/releng_notification_identity/tests/conftest.py | 2 | # -*- coding: utf-8 -*-
# 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/.
from __future__ import absolute_import
import pytest
import backend_common
@pytest.fixture(s... |
vuteam/BlackHole-New | refs/heads/master | lib/python/Components/Sources/ServiceList.py | 132 | from Source import Source
from enigma import eServiceCenter, eServiceReference
class ServiceList(Source):
def __init__(self, root, command_func = None, validate_commands = True):
Source.__init__(self)
self.root = root
self.command_func = command_func
self.validate_commands = validate_commands
def getService... |
druuu/django | refs/heads/master | django/contrib/sites/models.py | 316 | from __future__ import unicode_literals
import string
from django.core.exceptions import ImproperlyConfigured, ValidationError
from django.db import models
from django.db.models.signals import pre_delete, pre_save
from django.http.request import split_domain_port
from django.utils.encoding import python_2_unicode_com... |
beqa2323/learntosolveit | refs/heads/version1 | languages/python/networking_twisted_parallel1.py | 7 | from twisted.internet import defer, task
from twisted.python import log
from twisted.internet import reactor
from twisted.web import client
from twisted.internet.utils import getProcessValue
def parallel(iterable, count, callable, *args, **named):
print args, named
coop = task.Cooperator()
work = (callable... |
Khameleon-2016/TeamWork | refs/heads/master | public/node_modules/node-forge/tests/forge_ssl/forge/ssl.py | 169 | # Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""\
This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O er... |
dayatz/Django-on-OpenShift | refs/heads/master | demo/views.py | 1 | import platform
import pip
from django import get_version
from django.shortcuts import render
def home(request):
c = dict(python_version=platform.python_version(), django_version=get_version(), pip_version=pip.__version__)
return render(request, 'demo/demo.html', c)
|
back-to/streamlink | refs/heads/master | src/streamlink/plugins/aljazeeraen.py | 5 | import re
from streamlink.plugin import Plugin
from streamlink.plugins.brightcove import BrightcovePlayer
from streamlink.stream import RTMPStream
class AlJazeeraEnglish(Plugin):
url_re = re.compile(r"https?://(?:\w+\.)?aljazeera\.com")
account_id = 665003303001
render_re = re.compile(r'''RenderPagesVide... |
ioannistsanaktsidis/invenio | refs/heads/prod | modules/bibformat/lib/elements/bfe_title.py | 23 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 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
## ... |
kuri65536/python-for-android | refs/heads/master | python-modules/twisted/twisted/internet/endpoints.py | 49 | # -*- test-case-name: twisted.internet.test.test_endpoints -*-
# Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Implementations of L{IStreamServerEndpoint} and L{IStreamClientEndpoint} that
wrap the L{IReactorTCP}, L{IReactorSSL}, and L{IReactorUNIX} interfaces.
This also implement... |
Austin503/pyglet | refs/heads/master | experimental/mt_media/setup_path.py | 28 | #!/usr/bin/python
# $Id: setup_path.py 1580 2008-01-15 15:08:39Z Alex.Holkner $
import os.path
import sys
script_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(script_dir, '..', '..'))
sys.path.insert(0, script_dir)
|
jdfreder/nteract | refs/heads/master | applications/jupyter-extension/nteract_on_jupyter/semver.py | 4 |
# This file comes from https://github.com/podhmo/python-semver/blob/f0392c5567717ad001c058d80fa09887e482ad62/semver/__init__.py
#
# It is licensed under the following license:
#
# MIT License
# Copyright (c) 2016 podhmo
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software... |
jnerin/ansible | refs/heads/devel | test/units/modules/network/f5/test_bigip_software_update.py | 23 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... |
arthurdarcet/tornado | refs/heads/master | tornado/test/process_test.py | 123 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
import logging
import os
import signal
import subprocess
import sys
from tornado.httpclient import HTTPClient, HTTPError
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.log i... |
michaelimfeld/adapo | refs/heads/master | adapo/__init__.py | 12133432 | |
ShashaQin/erpnext | refs/heads/develop | erpnext/selling/report/pending_so_items_for_purchase_request/__init__.py | 12133432 | |
julienvey/solum | refs/heads/master | solum/openstack/common/db/__init__.py | 12133432 | |
buremba/django-admin-tools | refs/heads/master | admin_tools/menu/management/__init__.py | 12133432 | |
azaghal/ansible | refs/heads/devel | test/units/parsing/vault/__init__.py | 12133432 | |
Deepakkothandan/ansible | refs/heads/devel | lib/ansible/modules/utilities/__init__.py | 12133432 | |
glenux/contrib-docker-registry | refs/heads/master | setup.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
import setuptools
except ImportError:
import distutils.core as setuptools
import sys
# XXX as ugly as this looks, namespaces break terribly otherwise
# import docker_registry.lib as lib
execfile('./docker_registry/server/__init__.py')
requirements_txt = ope... |
franky88/emperioanimesta | refs/heads/master | env/Lib/site-packages/django/middleware/common.py | 39 | import logging
import re
from django import http
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.mail import mail_managers
from django.urls import is_valid_path
from django.utils.cache import get_conditional_response, set_response_etag
from django.utils.deprecation... |
percyfal/bokeh | refs/heads/master | bokeh/tests/test_widgets.py | 11 | from __future__ import absolute_import
import unittest
import inspect
def get_prop_set(class_object):
# all this does is get a list of every property implemented by the object that is not present in the baseclasses of said object
# note it wont detect overridden properties!
base_classes = list(inspect.ge... |
Icenowy/MissionPlanner | refs/heads/master | Lib/encodings/utf_32.py | 86 | """
Python 'utf-32' Codec
"""
import codecs, sys
### Codec APIs
encode = codecs.utf_32_encode
def decode(input, errors='strict'):
return codecs.utf_32_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def __init__(self, errors='strict'):
codecs.Incrementa... |
rtindru/django | refs/heads/master | tests/validation/test_picklable.py | 576 | import pickle
from unittest import TestCase
from django.core.exceptions import ValidationError
class PickableValidationErrorTestCase(TestCase):
def test_validationerror_is_picklable(self):
original = ValidationError('a', code='something')
unpickled = pickle.loads(pickle.dumps(original))
... |
HyperBaton/ansible | refs/heads/devel | lib/ansible/modules/cloud/rackspace/rax_files.py | 57 | #!/usr/bin/python
# (c) 2013, Paul Durivage <paul.durivage@rackspace.com>
# 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',
... |
aurora-pro/apex-sigma | refs/heads/master | sigma/core/blacklist.py | 2 | from config import permitted_id
from sigma.core.permission import check_admin
def check_black(db, message):
black_channel = False
black_user = False
server_is_black = False
black = False
global_user_blacklist = db.find_one('BlacklistedUsers', {'UserID': message.author.id})
if message.guild:
... |
robertnishihara/ray | refs/heads/master | python/ray/tune/progress_reporter.py | 1 | from __future__ import print_function
import collections
import sys
import numpy as np
import time
from ray.tune.result import (EPISODE_REWARD_MEAN, MEAN_ACCURACY, MEAN_LOSS,
TRAINING_ITERATION, TIME_TOTAL_S, TIMESTEPS_TOTAL,
AUTO_RESULT_KEYS)
from ray.tune.u... |
abhabongse/lemoneval | refs/heads/master | lemoneval/backbones/sessions.py | 1 | # Lemoneval Project
# Author: Abhabongse Janthong <6845502+abhabongse@users.noreply.github.com>
"""A session object defines an interaction of a player with a particular
exercise framework. A session could be created in one of two ways:
1. A new session is created by calling `framework.create_session` from a
... |
vishwanathan-iyer/chorPolice | refs/heads/master | chorPolice/src_shubham/GameClient.py | 1 | import socket
import re
import threading
class Client:
"""
Class implementing the client for the game
"""
def __init__(self, server_addr, server_port, type):
"""
__init__(Client, str, int) -> None
Initializes the client to connect to the specified server at the ... |
intel-ctrlsys/actsys | refs/heads/master | actsys/control/bmc/mock/__init__.py | 38 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Intel Corp.
#
|
AlceConsorcio/account-closing | refs/heads/8.0 | __unported__/account_multicurrency_revaluation/report/__init__.py | 11 | from . import currency_unrealized_report
|
abhitopia/tensorflow | refs/heads/master | tensorflow/tools/quantization/quantize_graph.py | 40 | # 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... |
blab/stability | refs/heads/master | augur/src/fitness_model.py | 2 | import argparse
import numpy as np
import dendropy
from collections import defaultdict
from datetime import date
from date_util import calendar_date
from itertools import izip
from fitness_predictors import *
min_freq = 0.1
max_freq = 0.99
min_tips = 10
pc=1e-2
regularization = 1e-3
default_predictors = ['lb', 'ep', '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.