repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tmm1/home-assistant | refs/heads/dev | homeassistant/components/device_tracker/thomson.py | 9 | """
homeassistant.components.device_tracker.thomson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Device tracker platform that supports scanning a THOMSON router for device
presence.
This device tracker needs telnet to be enabled on the router.
Configuration:
To use the THOMSON tracker you will need to add somethi... |
BennyRe/rosbridge_suite | refs/heads/develop | rosbridge_server/src/tornado/iostream.py | 15 | #!/usr/bin/env python
#
# Copyright 2009 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... |
tempbottle/pycapnp | refs/heads/develop | test/test_struct.py | 2 | import pytest
import capnp
import os
import tempfile
import sys
this_dir = os.path.dirname(__file__)
@pytest.fixture
def addressbook():
return capnp.load(os.path.join(this_dir, 'addressbook.capnp'))
@pytest.fixture
def all_types():
return capnp.load(os.path.join(this_dir, 'all_types.capnp'))
def test_whi... |
blacklin/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/asyncio/base_events.py | 61 | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... |
danielchalef/gensim | refs/heads/develop | gensim/summarization/pagerank_weighted.py | 21 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
from numpy import empty as empty_matrix
from scipy.sparse import csr_matrix
from scipy.linalg import eig
from six.moves import xrange
try:
from numpy import VisibleDeprecationWarning
impo... |
babble/babble | refs/heads/master | include/jython/Lib/encodings/mac_iceland.py | 593 | """ Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... |
ali/mopidy | refs/heads/develop | tests/internal/__init__.py | 190 | from __future__ import absolute_import, unicode_literals
|
ronekko/chainer | refs/heads/master | tests/chainer_tests/functions_tests/loss_tests/test_hinge.py | 1 | import unittest
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import functions
from chainer import gradient_check
from chainer import testing
from chainer.testing import attr
@testing.parameterize(*testing.product({
'reduce': ['no', 'mean'],
'norm': ['L1', 'L2'],
... |
NEricN/RobotCSimulator | refs/heads/master | Python/App/Lib/test/test_stringprep.py | 115 | # To fully test this module, we would need a copy of the stringprep tables.
# Since we don't have them, this test checks only a few codepoints.
import unittest
from test import test_support
from stringprep import *
class StringprepTests(unittest.TestCase):
def test(self):
self.assertTrue(in_table_a1(u"\u... |
simongibbons/numpy | refs/heads/main | numpy/distutils/from_template.py | 8 | #!/usr/bin/env python3
"""
process_file(filename)
takes templated file .xxx.src and produces .xxx file where .xxx
is .pyf .f90 or .f using the following template rules:
'<..>' denotes a template.
All function and subroutine blocks in a source file with names that
contain '<..>' will be replicated accordin... |
msenin94/salt-mk-verificator | refs/heads/master | mk_verificator/tests/packet_checker/test_packet_checker.py | 2 | import pytest
import json
from mk_verificator import utils
@pytest.mark.parametrize(
"group",
utils.get_groups(utils.get_configuration(__file__))
)
def test_check_package_versions(local_salt_client, group):
config = utils.get_configuration(__file__)
output = local_salt_client.cmd(group, 'lowpkg.list_... |
ptisserand/ansible | refs/heads/devel | lib/ansible/vars/clean.py | 23 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
from copy import deepcopy
from ansible import c... |
ehashman/oh-mainline | refs/heads/master | vendor/packages/mock/tests/support.py | 18 | import sys
info = sys.version_info
if info[:3] >= (3, 2, 0):
# for Python 3.2 ordinary unittest is fine
import unittest as unittest2
else:
import unittest2
try:
# need to turn it into a local variable or we can't
# import it from here under Python 2
apply = apply
except NameError:
# no ap... |
jainanisha90/WeVoteServer | refs/heads/develop | apis_v1/documentation_source/organization_stop_following_doc.py | 3 | # apis_v1/documentation_source/organization_stop_following_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def organization_stop_following_doc_template_values(url_root):
"""
Show documentation about organizationStopFollowing
"""
required_query_parameter_list = [
{
... |
jandom/rdkit | refs/heads/master | Code/Demos/boost/smartPtrsAndIters/test.py | 12 | # Copyright Rational Discovery LLC 2005
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import SPtrTestModule as TestModule
import unittest
class TestCase(unittest.TestCase):
def setUp(self):
pass
def te... |
nagyv/python-api-library | refs/heads/master | kayako/tests/object/test_ticket_custom_field.py | 4 | # -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Copyright (c) 2011, Evan Leis
#
# Distributed under the terms of the Lesser GNU General Public License (LGPL)
#-----------------------------------------------------------------------------
'''
Created on May 10, 201... |
eino-makitalo/odoo | refs/heads/8.0 | addons/account_payment/wizard/account_payment_pay.py | 382 | # -*- 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... |
chyeh727/django | refs/heads/master | django/contrib/gis/db/backends/mysql/schema.py | 448 | import logging
from django.contrib.gis.db.models.fields import GeometryField
from django.db.backends.mysql.schema import DatabaseSchemaEditor
from django.db.utils import OperationalError
logger = logging.getLogger('django.contrib.gis')
class MySQLGISSchemaEditor(DatabaseSchemaEditor):
sql_add_spatial_index = 'C... |
darmaa/odoo | refs/heads/master | openerp/addons/test_impex/__init__.py | 2148 | import models
|
henryfjordan/django | refs/heads/master | tests/model_meta/test_legacy.py | 199 | import warnings
from django import test
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import FieldDoesNotExist
from django.db.models.fields import CharField, related
from django.utils.deprecation import RemovedInDjango110Warning
from .models import BasePerson, Person
from ... |
aricchen/openHR | refs/heads/master | openerp/addons/survey/wizard/survey_print_statistics.py | 54 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
mythos234/SimplKernel-LL-N910F | refs/heads/master | tools/perf/tests/attr.py | 3174 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... |
owlzhou/ttornado | refs/heads/master | env/Lib/site-packages/pip/_vendor/html5lib/trie/py.py | 1323 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... |
sunny94/temp | refs/heads/iss8501_parsing | sympy/ntheory/egyptian_fraction.py | 16 | from __future__ import print_function, division
import sympy.polys
from sympy import Integer
from fractions import gcd
def egyptian_fraction(r, algorithm="Greedy"):
"""
Return the list of denominators of an Egyptian fraction
expansion [1]_ of the said rational `r`.
Parameters
==========
r :... |
bond-anton/BDMesh | refs/heads/master | tests/test_Mesh1DUniform.py | 1 | import random
import math as m
import numpy as np
import unittest
from BDMesh import Mesh1DUniform, Mesh1D
class TestMesh1DUniform(unittest.TestCase):
def setUp(self):
self.mesh = Mesh1DUniform(m.pi, 2*m.pi)
def test_equality(self):
other_mesh = Mesh1DUniform(m.pi, 2 * m.pi)
self.as... |
mammadori/pyglet | refs/heads/master | pyglet/gl/glu.py | 45 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... |
xuxiao/zulip | refs/heads/master | analytics/management/commands/user_stats.py | 114 | from __future__ import absolute_import
import datetime
import pytz
from django.core.management.base import BaseCommand
from zerver.models import UserProfile, Realm, Stream, Message
class Command(BaseCommand):
help = "Generate statistics on user activity."
def add_arguments(self, parser):
parser.add_... |
v-iam/azure-sdk-for-python | refs/heads/master | azure-mgmt-resource/azure/mgmt/resource/links/v2016_09_01/models/resource_link_filter.py | 2 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
Dewl/apv | refs/heads/master | pdfview/scripts/pjpp.py | 111 | #!/usr/bin/env pypy
import os, sys, logging, re
import argparse
import fnmatch
configurations = {'lite', 'pro'}
package_dirs = {
'lite': ('src/cx/hell/android/pdfview',),
'pro': ('src/cx/hell/android/pdfviewpro',)
}
file_replaces = {
'lite': (
'cx.hell.android.pdfview.',
'"cx.hell.an... |
dd00/commandergenius | refs/heads/dd00 | project/jni/python/src/Lib/distutils/tests/test_build_scripts.py | 47 | """Tests for distutils.command.build_scripts."""
import os
import unittest
from distutils.command.build_scripts import build_scripts
from distutils.core import Distribution
from distutils import sysconfig
from distutils.tests import support
class BuildScriptsTestCase(support.TempdirManager,
... |
kennedyshead/home-assistant | refs/heads/dev | tests/components/motioneye/__init__.py | 2 | """Tests for the motionEye integration."""
from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, Mock, patch
from motioneye_client.const import DEFAULT_PORT
from homeassistant.components.motioneye.const import DOMAIN
from homeassistant.config_entries import ConfigEntry
from h... |
TeamHG-Memex/scrapy-cdr | refs/heads/master | scrapy_cdr/es_upload.py | 1 | import argparse
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime
from itertools import islice
import logging
import os
import shutil
import sys
from six.moves.urllib.parse import urlsplit
import time
import traceback
import json_lines
import elasticsea... |
tuxfux-hlp-notes/python-batches | refs/heads/master | archieves/batch-62/modules/mysheets/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py | 171 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(... |
xbezdick/tempest | refs/heads/master | tempest/api/volume/test_volumes_snapshots.py | 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
openstack/swift | refs/heads/master | test/unit/cli/__init__.py | 12133432 | |
carthagecollege/django-djtinue | refs/heads/master | djtinue/__init__.py | 12133432 | |
louyihua/edx-platform | refs/heads/master | openedx/core/djangoapps/bookmarks/tests/__init__.py | 12133432 | |
uetke/experimentor | refs/heads/master | examples/config/config.py | 1 | from experimentor.config import Config
# Settings specific to the GUI. These settings can be changed if, for example, the GUI is not responsive enough or if
# there is an overflow of information going to the screen (i.e. updates happening>60Hz).
Config.monitor_read_scan = 10 # How many times do we update the signal d... |
EvgeneOskin/taiga-back | refs/heads/master | taiga/projects/custom_attributes/migrations/0001_initial.py | 27 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('projects', '0015_auto_20141230_1212'),
]
operations = [
migrations.CreateModel(
nam... |
arifsetiawan/edx-platform | refs/heads/master | common/djangoapps/cors_csrf/migrations/0001_initial.py | 98 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'XDomainProxyConfiguration'
db.create_table('cors_csrf_xdo... |
apixandru/intellij-community | refs/heads/master | python/testData/codeInsight/smartEnter/dict_after.py | 83 | class A:
def foo(self):
self.a = {"1": 1, "2":2}<caret> |
syci/account-financial-tools | refs/heads/8.0 | account_move_reconcile_helper/__init__.py | 4 | # -*- coding: utf-8 -*-
from . import models
from .post_install import set_reconcile_ref
|
surround-io/three.js | refs/heads/master | utils/exporters/blender/addons/io_three/exporter/io.py | 201 | import os
import shutil
from .. import constants, logger
from . import _json
def copy_registered_textures(dest, registration):
"""Copy the registered textures to the destination (root) path
:param dest: destination directory
:param registration: registered textures
:type dest: str
:type registrat... |
RO-ny9/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/encodings/__init__.py | 46 | """ Standard "encodings" Package
Standard Python encoding modules are stored in this package
directory.
Codec modules must have names corresponding to normalized encoding
names as defined in the normalize_encoding() function below, e.g.
'utf-8' must be implemented by the module 'utf_8.py'.
Ea... |
MaxGuevara/quark | refs/heads/master | qa/rpc-tests/txn_doublespend.py | 152 | #!/usr/bin/env python2
# Copyright (c) 2014 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 proper accounting with malleable transactions
#
from test_framework import BitcoinTestFramework
from... |
charbeljc/server-tools | refs/heads/8.0 | auth_from_http_remote_user/utils.py | 50 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Laurent Mignon
# Copyright 2014 'ACSONE SA/NV'
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... |
HIPS/optofit | refs/heads/master | examples/gp_squid_test.py | 1 | import numpy as np
seed = np.random.randint(2**16)
# seed = 50431
seed = 58482
print "Seed: ", seed
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from optofit.cneuron.compartment import Compartment, SquidCompartment
from optofit.cneuron.channels import LeakChannel, NaChannel, KdrChannel
from ... |
flavour/ifrc_qa | refs/heads/master | modules/s3db/delphi.py | 1 | # -*- coding: utf-8 -*-
""" Sahana Eden Delphi Decision Maker Model
@copyright: 2009-2016 (c) Sahana Software Foundation
@license: MIT
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 ... |
kelseyoo14/Wander | refs/heads/master | venv_2_7/lib/python2.7/site-packages/pandas/tests/test_reshape.py | 9 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101
from copy import deepcopy
from datetime import datetime, timedelta
import operator
import os
import nose
from pandas import DataFrame, Series
from pandas.core.sparse import SparseDataFrame
import pandas as pd
from numpy import nan
import numpy as np
from pan... |
FHannes/intellij-community | refs/heads/master | python/lib/Lib/distutils/file_util.py | 81 | """distutils.file_util
Utility functions for operating on single files.
"""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: file_util.py 37828 2004-11-10 22:23:15Z loewis $"
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose ou... |
zhangxujinsh/keras | refs/heads/master | keras/wrappers/scikit_learn.py | 35 | from __future__ import absolute_import
import copy
import numpy as np
from ..utils.np_utils import to_categorical
class KerasClassifier(object):
"""
Implementation of the scikit-learn classifier API for Keras.
Parameters
----------
model : object
An un-compiled Keras model object is requi... |
seravok/LPTHW | refs/heads/master | ex9.py | 1 | # Here's some new strange stuff, remember type it exactly
# Defines days of the week
days = "Mon Tue Wed Thu Fri Sat Sun"
# Defines the months that will be printed after calling "months"
# A new line is created after every month
months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"
# Print the days and then the months
pr... |
oracal/cineworld | refs/heads/master | cineworld/cineworld.py | 1 | #!/usr/bin/env python
'''
Created on 17 Jul 2011
@author: oracal
'''
from cineworld_api_key import API_KEY
from fuzzywuzzy.fuzz import WRatio
from operator import itemgetter
from urllib import urlencode
import datetime
try:
import json
except ImportError:
import simplejson as json
try:
from urllib2... |
zenx/xhtml2pdf | refs/heads/master | test/story2canvas.py | 155 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... |
Jonneitapuro/isoskaba2 | refs/heads/master | skaba/util.py | 1 | from skaba.models import User, Event
import csv
from io import StringIO
from datetime import datetime
"""
Check if user has admin status.
"""
def check_admin(user):
if (user.is_authenticated() and (user.profile.role == "admin") or (user.is_superuser)):
return True
return False
"""
Check if user has mo... |
Juniper/nova | refs/heads/master | nova/api/openstack/compute/extended_availability_zone.py | 4 | # Copyright 2013 Netease, LLC.
# 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 appli... |
AWPorter/aima-python | refs/heads/master | submissions/Kinley/myBayes.py | 15 | import traceback
from submissions.Kinley import drugs
#
#
class DataFrame:
data = []
feature_names = []
target = []
target_names = []
drugData = DataFrame()
drugData.data = []
targetData = []
alcohol = drugs.get_surveys('Alcohol Dependence')
#tobacco = drugs.get_surveys('Tobacco Use')
i=0
for ... |
dgjustice/ansible | refs/heads/devel | lib/ansible/modules/cloud/amazon/sns_topic.py | 18 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This is a 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.
#
# This Ansible library is distri... |
unaxfromsibiria/roolet | refs/heads/master | clients/python3/roolet/client.py | 1 | # @author: Michael Vorotyntsev
# @email: linkofwise@gmail.com
# @github: unaxfromsibiria
import base64
import pickle
import socket
import time
from uuid import uuid4
from random import SystemRandom
from .config import Configuration, LoggerWrapper
from .common import CommandBuilder, Command
from .exceptions import Exe... |
wkschwartz/django | refs/heads/stable/3.2.x | tests/i18n/other/locale/fr/__init__.py | 12133432 | |
DigitalSlideArchive/HistomicsTK | refs/heads/master | histomicstk/cli/ComputeNucleiFeatures/__init__.py | 12133432 | |
blublud/networkx | refs/heads/master | networkx/algorithms/components/tests/test_biconnected.py | 43 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
from networkx.algorithms.components import biconnected
from networkx import NetworkXNotImplemented
def assert_components_edges_equal(x, y):
sx = {frozenset([frozenset(e) for e in c]) for c in x}
sy = {frozenset([frozenset(e) for e in c]) for ... |
xyjin/Program_trade_system | refs/heads/master | strategies/trending.py | 1 | # A module for all built-in commands.
# vim: sw=4: et
LICENSE="""
Copyright (C) 2011 Michael Ihde
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)... |
tadebayo/myedge | refs/heads/master | myvenv/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... |
Onager/l2tdevtools | refs/heads/master | tests/dependency_writers/travis.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the Travis-CI script writers."""
from __future__ import unicode_literals
import unittest
from l2tdevtools import dependencies
from l2tdevtools.dependency_writers import travis
from l2tdevtools.helpers import project
from tests import test_lib
class TravisI... |
janewilson90/auchtermuchty | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... |
GinnyN/towerofdimensions-django | refs/heads/master | django/core/management/commands/runfcgi.py | 674 | from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Runs this project as a FastCGI application. Requires flup."
args = '[various KEY=val options, use `runfcgi help` for help]'
def handle(self, *args, **options):
from django.conf import settings
from djan... |
openstack/horizon | refs/heads/master | openstack_dashboard/dashboards/admin/volume_types/qos_specs/tables.py | 1 | # 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
# distributed under t... |
menify/sandbox | refs/heads/master | trunk/setup/setup_flexelint.py | 1 |
import os.path
import aql.utils
from aql.setup import toolSetup
import aql.local_host
#//---------------------------------------------------------------------------//
@toolSetup('aql_tool_flexelint')
def setup_flexelint( options, os_env, env ):
if aql.local_host.os == 'cygwin':
_drive_d = '/cygd... |
owers19856/django-cms | refs/heads/develop | cms/models/settingmodels.py | 39 | # -*- coding: utf-8 -*-
from django.conf import settings
from django.db import models
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@python_2_unicode_compatible
class UserSettings(models.Model):
user = models.OneToOneField(setting... |
ibrahimkarahan/Flexget | refs/heads/develop | flexget/ui/plugins/movies/movies.py | 5 | from __future__ import unicode_literals, division, absolute_import
import time
import logging
import posixpath
from flask import render_template, Blueprint, request, redirect, flash, send_file
from flask.helpers import url_for
from flexget.plugin import DependencyError, get_plugin_by_name
from flexget.ui.webui import r... |
hadmagic/Aidez-moi | refs/heads/master | ticket/tables.py | 1 | # coding=utf-8
__author__ = 'had'
# The MIT License (MIT)
# Copyright (c) [2015] [Houtmann Hadrien]
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the Aidez-moi), to deal
# in the Software without restriction, including without limi... |
GarethNelson/distcc | refs/heads/master | test/onetest.py | 26 | #!/usr/bin/python2.4
#
# Copyright 2007 Google Inc.
#
# 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 later version.
#
# This program i... |
farhi-naz/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/test/generator-output/gyptest-rules.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.
"""
Verifies --generator-output= behavior when using rules.
"""
import TestGyp
test = TestGyp.TestGyp()
test.writable(test.workpath('rule... |
dims/neutron | refs/heads/master | neutron/db/migration/alembic_migrations/versions/liberty/contract/11926bcfe72d_add_geneve_ml2_type_driver.py | 23 | # Copyright 2015 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
codester2/devide | refs/heads/master | modules/vtk_basic/vtkWin32VideoSource.py | 7 | # class generated by DeVIDE::createDeVIDEModuleFromVTKObject
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase
import vtk
class vtkWin32VideoSource(SimpleVTKClassModuleBase):
def __init__(self, module_manager):
SimpleVTKClassModuleBase.__init__(
self, module_manager,
v... |
sourcepole/qgis-wps-client | refs/heads/master | Ui_qgswpsgui.py | 1 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'qgswpsgui.ui'
#
# Created by: PyQt5 UI code generator 5.15.0
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, Qt... |
severin31/suplemon | refs/heads/master | suplemon/modules/linter.py | 2 | # -*- encoding: utf-8
import subprocess
from suplemon.suplemon_module import Module
class Linter(Module):
def init(self):
self.init_logging(__name__)
if not self.has_flake8_support():
self.logger.warning("Flake8 not available. Can't show linting.")
return False
#... |
Quantipy/quantipy | refs/heads/master | quantipy/sandbox/pptx/__init__.py | 12133432 | |
cgre-aachen/gempy | refs/heads/master | examples/examples/geometries/foo/__init__.py | 12133432 | |
uwdata/termite-visualizations | refs/heads/master | web2py/scripts/extract_mysql_models.py | 33 | '''
Create the web2py code needed to access your mysql legacy db.
To make this work all the legacy tables you want to access need to have an "id" field.
This plugin needs:
mysql
mysqldump
installed and globally available.
Under Windows you will probably need to add the mysql executable directory to the PATH variable... |
BambooL/jeeves | refs/heads/master | demo/tests/simpleRule/jelf/settings.py | 12 | """
Django settings for jelf project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
impo... |
heeraj123/oh-mainline | refs/heads/master | vendor/packages/celery/celery/backends/amqp.py | 17 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import with_statement
import socket
import threading
import time
from itertools import count
from kombu.entity import Exchange, Queue
from kombu.messaging import Consumer, Producer
from .. import states
from ..exceptions import TimeoutEr... |
leafclick/intellij-community | refs/heads/master | python/testData/mover/oneLineCompoundOutside.py | 80 | if condition:
pass
elif other_condition:
if another_one:
if T<caret>rue: a = 1 # <- move statement up here
else: b = 2
|
canance/signpi-server | refs/heads/master | manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "signpi.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
siosio/intellij-community | refs/heads/master | python/testData/completion/hasattrCompletion/hasattrIfPyramidAndOr.py | 12 | def foo(x):
if hasattr(x, 'foo'):
if hasattr(x, 'bar') or hasattr(x, 'baz'):
if hasattr(x, 'qux') and (hasattr(x, 'quux') or hasattr(x, 'quuz')) and hasattr(x, 'corge'):
print(x.<caret>) |
open-power-host-os/builds | refs/heads/master | lib/subcommands/update_metapackage.py | 3 | # Copyright (C) IBM Corp. 2017.
#
# 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... |
scrollback/kuma | refs/heads/master | vendor/packages/ipython/docs/examples/core/example-embed-short.py | 7 | """Quick code snippets for embedding IPython into other programs.
See example-embed.py for full details, this file has the bare minimum code for
cut and paste use once you understand how to use the system."""
#---------------------------------------------------------------------------
# This code loads IPython but mo... |
adelina-t/neutron | refs/heads/master | neutron/tests/functional/agent/linux/helpers.py | 26 | # Copyright (c) 2014 Red Hat, 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 require... |
uiri/pxqz | refs/heads/master | venv/lib/python2.7/site-packages/django/dispatch/saferef.py | 86 | """
"Safe weakrefs", originally from pyDispatcher.
Provides a way to safely weakref any function, including bound methods (which
aren't handled by the core weakref module).
"""
import traceback
import weakref
def safeRef(target, onDelete = None):
"""Return a *safe* weak reference to a callable target
target... |
mikemow/youtube-dl | refs/heads/master | youtube_dl/extractor/pyvideo.py | 158 | from __future__ import unicode_literals
import re
import os
from .common import InfoExtractor
class PyvideoIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?pyvideo\.org/video/(?P<id>\d+)/(.*)'
_TESTS = [
{
'url': 'http://pyvideo.org/video/1737/become-a-logging-expert-in-30-minutes',
... |
person142/scipy | refs/heads/master | scipy/interpolate/tests/test_fitpack.py | 3 | import itertools
import os
import numpy as np
from numpy.testing import (assert_equal, assert_allclose, assert_,
assert_almost_equal, assert_array_almost_equal)
from pytest import raises as assert_raises
from numpy import array, asarray, pi, sin, cos, arange, dot, ravel, sqrt, round
from sc... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | openerp/addons/base/module/wizard/base_export_language.py | 178 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2004-2012 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
instantchow/home-assistant | refs/heads/master | tests/components/test_api.py | 4 | """The tests for the Home Assistant HTTP component."""
# pylint: disable=protected-access,too-many-public-methods
from contextlib import closing
import json
import tempfile
import unittest
from unittest.mock import patch
import requests
from homeassistant import bootstrap, const
import homeassistant.core as ha
import... |
rchav/vinerack | refs/heads/master | saleor/dashboard/discount/__init__.py | 12133432 | |
memtoko/django | refs/heads/master | tests/signed_cookies_tests/__init__.py | 12133432 | |
liorvh/golismero | refs/heads/master | plugins/report/__init__.py | 12133432 | |
collingreen/yaib_ludumdare | refs/heads/master | modules/__init__.py | 12133432 | |
simsong/grr-insider | refs/heads/master | lib/aff4_objects/client_stats.py | 3 | #!/usr/bin/env python
# Copyright 2012 Google Inc. All Rights Reserved.
"""AFF4 object representing client stats."""
from grr.lib import aff4
from grr.lib import rdfvalue
from grr.lib.aff4_objects import standard
class ClientStats(standard.VFSDirectory):
"""A container for all client statistics."""
class Schem... |
oliverlee/sympy | refs/heads/master | sympy/matrices/expressions/tests/test_dotproduct.py | 12 | from sympy.matrices import Matrix
from sympy.matrices.expressions.dotproduct import DotProduct
from sympy.utilities.pytest import raises
A = Matrix(3, 1, [1, 2, 3])
B = Matrix(3, 1, [1, 3, 5])
C = Matrix(4, 1, [1, 2, 4, 5])
def test_docproduct():
assert DotProduct(A, B).doit() == 22
raises(TypeError, lambda:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.