repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ChillarAnand/junction | refs/heads/master | tests/integrations/test_proposal_views.py | 1 | # -*- coding: utf-8 -*-
import pytest
from django.core.urlresolvers import reverse
from .. import factories as f
from . import helpers
pytestmark = pytest.mark.django_db
# Proposal
def test_list_proposals_pass(client, settings):
conference = f.create_conference()
url = reverse('proposals-list', kwargs={'co... |
xbmc/atv2 | refs/heads/atv2 | xbmc/lib/libPython/Python/Lib/plat-mac/Carbon/CG.py | 82 | from _CG import *
|
antoviaque/edx-platform | refs/heads/master | common/djangoapps/request_cache/middleware.py | 98 | import threading
class _RequestCache(threading.local):
"""
A thread-local for storing the per-request cache.
"""
def __init__(self):
super(_RequestCache, self).__init__()
self.data = {}
self.request = None
REQUEST_CACHE = _RequestCache()
class RequestCache(object):
@cla... |
CharlPels/azure-quickstart-templates | refs/heads/master | bosh-cf-crossregion/scripts/setup_env.py | 123 | #!/usr/bin/env python
import json
import netaddr
import os
import random
import re
import requests
import sys
from azure.storage.blob import AppendBlobService
from azure.storage.table import TableService
import azure.mgmt.network
from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.network ... |
joebowen/LogMyRocket_API | refs/heads/master | LogMyRocket/libraries/sys_packages/docutils/utils/math/__init__.py | 160 | # :Id: $Id: __init__.py 7218 2011-11-08 17:42:40Z milde $
# :Author: Guenter Milde.
# :License: Released under the terms of the `2-Clause BSD license`_, in short:
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# noti... |
holmes-app/holmes-api | refs/heads/master | holmes/models/violation.py | 1 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sqlalchemy as sa
from collections import defaultdict
from holmes.models import Base, JsonTypeGzipped
from holmes.models.keys import Key
class Violation(Base):
__tablename__ = "violations"
id = sa.Column(sa.Integer, primary_key=True)
value = sa.Column('va... |
mkraemer67/pylearn2 | refs/heads/master | pylearn2/datasets/tests/test_vector_spaces_dataset.py | 48 | # Currently this test file does nothing but make sure the module can be
# imported.
from pylearn2.datasets import vector_spaces_dataset
|
bolkedebruin/airflow | refs/heads/master | airflow/models/dag.py | 1 | # -*- coding: utf-8 -*-
#
# 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
#... |
nagyv/account-financial-tools | refs/heads/8.0 | account_tax_analysis/__init__.py | 46 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author Vincent Renaville. Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# publis... |
wong2/sentry | refs/heads/master | src/sentry/db/models/fields/__init__.py | 34 | """
sentry.db.models.fields
~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from .bounded import * # NOQA
from .foreignkey import * # NOQA
from .gzippeddict import * # NOQA
f... |
etherkit/OpenBeacon2 | refs/heads/master | client/linux-arm/venv/lib/python3.6/site-packages/PyInstaller/hooks/hook-torch.py | 1 | #-----------------------------------------------------------------------------
# Copyright (c) 2013-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... |
enovance/numeter | refs/heads/master | web-app/numeter_webapp/multiviews/tests/view.py | 2 | """
View model tests module.
"""
from django.test import LiveServerTestCase
from django.core.urlresolvers import reverse
from core.models import Host
from core.tests.utils import set_storage, set_users
from multiviews.models import View, Event
from multiviews.tests.utils import create_view, create_event
class View_... |
geodrinx/gearthview | refs/heads/master | ext-libs/twisted/trial/unittest.py | 4 | # -*- test-case-name: twisted.trial.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Things likely to be used by writers of unit tests.
"""
from __future__ import division, absolute_import
# Define the public API from the two implementation modules
from twisted.trial._synctest imp... |
virtool/virtool | refs/heads/master | virtool/jobs/create_subtraction.py | 2 | import os
import pymongo
import virtool.subtractions.db
import virtool.jobs.job
import virtool.jobs.utils
import virtool.subtractions.utils
import virtool.utils
class Job(virtool.jobs.job.Job):
"""
A subclass of :class:`.Job` that adds a new host to Virtool from a passed FASTA file.
"""
def __init... |
noslenfa/tdjangorest | refs/heads/master | uw/lib/python2.7/site-packages/Crypto/SelfTest/Util/test_number.py | 115 | # -*- coding: utf-8 -*-
#
# SelfTest/Util/test_number.py: Self-test for parts of the Crypto.Util.number module
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# th... |
davy39/eric | refs/heads/master | Plugins/VcsPlugins/vcsMercurial/RebaseExtension/rebase.py | 1 | # -*- coding: utf-8 -*-
# Copyright (c) 2011 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing the rebase extension interface.
"""
from __future__ import unicode_literals
import os
from PyQt5.QtWidgets import QDialog
from ..HgExtension import HgExtension
from ..HgDialog import HgDialog
... |
evangeline97/localwiki-backend-server | refs/heads/master | xx_github_lang_hack.py | 3 | null |
bestephe/ns-3-tcpbolt | refs/heads/master | src/netanim/bindings/modulegen__gcc_ILP32.py | 354 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... |
alunduil/aiohttp | refs/heads/master | aiohttp/multidict.py | 16 | """Multidict implementation.
HTTP Headers and URL query string require specific data structure:
multidict. It behaves mostly like a dict but it can have
several values for the same key.
"""
from collections import abc
import os
import sys
__all__ = ('MultiDictProxy', 'CIMultiDictProxy',
'MultiDict', 'CIM... |
suvarnaraju/robotframework | refs/heads/master | src/robot/utils/robotenv.py | 24 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... |
davidbartonau/server_stats | refs/heads/master | stats.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import common
import disk_stats
import cpu_stats
import mem_stats
import network_stats
import apache_logs_stats
def main():
parser = argparse.ArgumentParser(description='Collect statistics from this server and POST json to a URL.')
parser.add_arg... |
multidadosti-erp/multidadosti-addons | refs/heads/develop | sale_order_line_category/__init__.py | 1262 | from . import models
|
annegabrielle/secure_adhoc_network_ns-3 | refs/heads/master | ns3_source_code/ns-3.10/.waf-1.5.16-e6d03192b5ddfa5ef2c8d65308e48e42/wafadmin/Tools/gob2.py | 10 | #! /usr/bin/env python
# encoding: utf-8
import TaskGen
TaskGen.declare_chain(name='gob2',rule='${GOB2} -o ${TGT[0].bld_dir(env)} ${GOB2FLAGS} ${SRC}',ext_in='.gob',ext_out='.c')
def detect(conf):
gob2=conf.find_program('gob2',var='GOB2',mandatory=True)
conf.env['GOB2']=gob2
conf.env['GOB2FLAGS']=''
|
embeddedarm/android_external_chromium_org | refs/heads/imx_KK4.4.3_2.0.0-ga | ppapi/generate_ppapi_size_checks.py | 177 | #!/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.
"""This script should be run manually on occasion to make sure all PPAPI types
have appropriate size checking.
"""
import optparse... |
stephanerobert/fake-switches | refs/heads/master | setup.py | 84 | #!/usr/bin/env python
from setuptools import setup
setup(
setup_requires=['pbr'],
pbr=True,
)
|
xin3liang/platform_external_chromium_org | refs/heads/master | native_client_sdk/src/build_tools/tests/sdktools_commands_test.py | 76 | #!/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.
import os
import sys
import re
import tarfile
import tempfile
import unittest
from sdktools_test import SdkToolsTestCase
SCRIPT_DI... |
algorhythms/LeetCode | refs/heads/master | 563 Binary Tree Tilt.py | 1 | #!/usr/bin/python3
"""
Given a binary tree, return the tilt of the whole tree.
The tilt of a tree node is defined as the absolute difference between the sum of
all left subtree node values and the sum of all right subtree node values. Null
node has tilt 0.
The tilt of the whole tree is defined as the sum of all nodes... |
YumiBunny/WebMarker | refs/heads/master | producto/apps.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ProductoConfig(AppConfig):
name = 'producto'
|
Tayamarn/socorro | refs/heads/master | webapp-django/crashstats/crashstats/templatetags/jinja_helpers.py | 1 | import datetime
import json
import re
import urllib
import isodate
import jinja2
import humanfriendly
from django_jinja import library
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.template import engines
from django.template.loader import render_to_string
from django.ut... |
anaruse/chainer | refs/heads/master | chainer/datasets/cifar.py | 13 | import os
import sys
import tarfile
import numpy
import six.moves.cPickle as pickle
import chainer
from chainer.dataset import download
from chainer.datasets import tuple_dataset
def get_cifar10(withlabel=True, ndim=3, scale=1., dtype=None):
"""Gets the CIFAR-10 dataset.
`CIFAR-10 <https://www.cs.toronto.e... |
aman-iitj/scipy | refs/heads/master | tools/cythonize.py | 67 | #!/usr/bin/env python
""" cythonize
Cythonize pyx files into C files as needed.
Usage: cythonize [root_dir]
Default [root_dir] is 'scipy'.
Checks pyx files to see if they have been changed relative to their
corresponding C files. If they have, then runs cython on these files to
recreate the C files.
The script th... |
asfaltboy/jirash | refs/heads/experimental | deps/requests/api.py | 637 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
Retur... |
Asana/mypipe | refs/heads/master | avro/lang/py/lib/simplejson/tool.py | 291 | r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m simplejson.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m simplejson.tool
Expecting property name: line 1 column 2 (char 2)
"""
import sys
import simplejson
def main():
if len(... |
GiulianoFranchetto/zephyr | refs/heads/master | boards/xtensa/intel_s1000_crb/support/download.py | 1 | #!/usr/bin/env python3
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# Author: Sathish Kuttan <sathish.k.kuttan@intel.com>
# This script is the top level script that an user can invoke to
# download a Zephyr application binary from a Linux host connected
# over SPI to Intel Sue Cre... |
kennethreitz/pipenv | refs/heads/master | pipenv/patched/notpip/_vendor/chardet/sbcharsetprober.py | 269 | ######################## 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... |
happyleavesaoc/home-assistant | refs/heads/dev | homeassistant/components/media_player/yamaha.py | 5 | """
Support for Yamaha Receivers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.yamaha/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_... |
chriskmanx/qmole | refs/heads/master | QMOLEDEV/boost_1_49_0/tools/build/v2/test/chain.py | 15 | #!/usr/bin/python
# Copyright 2003 Dave Abrahams
# Copyright 2002, 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
# This tests that :
# 1) the 'make' correctly assigns types to produced targets
# 2... |
romain-dartigues/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_securitygroup.py | 78 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... |
xiaoyong0312/Python-dev | refs/heads/master | Python2.x/Python2.x-0-basic/003_condition.py | 1 | # -*- coding: UTF-8 -*-
# 条件语句
# !condition Sentence
flag = False
name = 'xuyong'
if name == 'python':
flag = True
print 'hello python!'
else:
print '-->>' + name;
|
kustodian/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_vpc_offering.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017, David Passante (@dpassante)
# 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'... |
cnbeining/you-get | refs/heads/develop | src/you_get/extractors/twitter.py | 2 | #!/usr/bin/env python
__all__ = ['twitter_download']
from ..common import *
from .vine import vine_download
def extract_m3u(source):
r1 = get_content(source)
s1 = re.findall(r'(/ext_tw_video/.*)', r1)
r2 = get_content('https://video.twimg.com%s' % s1[-1])
s2 = re.findall(r'(/ext_tw_video/.*)', r2)
... |
cyberphox/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/matrixlib/setupscons.py | 102 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
import os
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('matrixlib', parent_package, top_path)
config.add_data_dir('tests')
... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.7/dist-packages/Crypto/SelfTest/Hash/test_SHA256.py | 2 | ../../../../../../share/pyshared/Crypto/SelfTest/Hash/test_SHA256.py |
WhireCrow/openwrt-mt7620 | refs/heads/master | staging_dir/host/lib/python2.7/test/test_pstats.py | 136 | import unittest
from test import test_support
import pstats
class AddCallersTestCase(unittest.TestCase):
"""Tests for pstats.add_callers helper."""
def test_combine_results(self):
"""pstats.add_callers should combine the call results of both target
and source by adding the call time. See iss... |
Vassy/odoo | refs/heads/master | addons/l10n_multilang/l10n_multilang.py | 378 | # -*- 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... |
karst87/ml | refs/heads/master | 01_openlibs/tensorflow/00_resource/tf_examples/examples/2_BasicModels/logistic_regression.py | 2 | '''
A logistic regression learning algorithm example using TensorFlow library.
This example is using the MNIST database of handwritten digits
(http://yann.lecun.com/exdb/mnist/)
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
'''
from __future__ import print_function
import tens... |
waseem18/oh-mainline | refs/heads/master | vendor/packages/distribute/setuptools/command/setopt.py | 167 | import distutils, os
from setuptools import Command
from distutils.util import convert_path
from distutils import log
from distutils.errors import *
__all__ = ['config_file', 'edit_config', 'option_base', 'setopt']
def config_file(kind="local"):
"""Get the filename of the distutils, local, global, or per-user co... |
naresh21/synergetics-edx-platform | refs/heads/oxa/master.fic | lms/envs/devstack_with_worker.py | 24 | """
This config file follows the devstack enviroment, but adds the
requirement of a celery worker running in the background to process
celery tasks.
When testing locally, run lms/cms with this settings file as well, to test queueing
of tasks onto the appropriate workers.
In two separate processes on devstack:
pav... |
kdart/pycopia | refs/heads/master | process/pycopia/crontab.py | 1 | #!/usr/bin/python2.7
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# 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
... |
ubiar/odoo | refs/heads/8.0 | addons/website_sale_options/__openerp__.py | 322 | {
'name': 'eCommerce Optional Products',
'category': 'Website',
'version': '1.0',
'website': 'https://www.odoo.com/page/e-commerce',
'description': """
OpenERP E-Commerce
==================
""",
'author': 'OpenERP SA',
'depends': ['website_sale'],
'data': [
'views/views.... |
blazewicz/micropython | refs/heads/master | tests/thread/mutate_set.py | 43 | # test concurrent mutating access to a shared set object
#
# MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd
import _thread
# the shared set
se = set([-1, -2, -3, -4])
# main thread function
def th(n, lo, hi):
for repeat in range(n):
for i in range(lo, hi):
se.add(i)
... |
bjolivot/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_user.py | 26 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... |
ahmadiga/min_edx | refs/heads/master | lms/djangoapps/course_api/blocks/transformers/tests/test_navigation.py | 32 | # pylint: disable=protected-access
"""
Tests for BlockNavigationTransformer.
"""
import ddt
from unittest import TestCase
from lms.djangoapps.course_api.blocks.transformers.block_depth import BlockDepthTransformer
from lms.djangoapps.course_api.blocks.transformers.navigation import BlockNavigationTransformer
from open... |
ychen820/microblog | refs/heads/master | y/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/instances/get_serial_port_output.py | 4 | # Copyright 2014 Google Inc. All Rights Reserved.
"""Command for reading the serial port output of an instance."""
from googlecloudsdk.compute.lib import base_classes
from googlecloudsdk.compute.lib import request_helper
from googlecloudsdk.compute.lib import utils
from googlecloudsdk.core import log
class GetSerialP... |
kraktos/Eagle | refs/heads/master | eagle/core.py | 1 | import logging
from scipy import misc
from scipy import ndimage
from skimage import exposure
import pylab
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use("gtk")
_logger = logging.getLogger(__name__)
class ImageConverter:
def __init__(self, img):
self.name = img
self.image = mis... |
Serag8/Bachelor | refs/heads/master | google_appengine/lib/django-1.4/django/forms/forms.py | 81 | """
Form classes
"""
from __future__ import absolute_import
import copy
from django.core.exceptions import ValidationError
from django.forms.fields import Field, FileField
from django.forms.util import flatatt, ErrorDict, ErrorList
from django.forms.widgets import Media, media_property, TextInput, Textarea
from djan... |
jrior001/Torched_kernel | refs/heads/Torched | arch/ia64/scripts/unwcheck.py | 13143 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... |
mitshel/book_tools | refs/heads/master | book_tools/pymobi/compression.py | 1 | import struct
class Uncompression(object):
def pack(self, data):
return data
def unpack(self, data):
return data
class Palmdoc(object):
def pack(self, i):
raise ValueError('not implement')
def unpack(self, i):
o, p = '', 0
while p < len(i):
c = o... |
consbio/landscapesim | refs/heads/master | landscapesim/tasks.py | 1 | from landscapesim.async import tasks |
lipro/linux-tqs | refs/heads/tqma35 | arch/ia64/scripts/unwcheck.py | 916 | #!/usr/bin/env python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthe... |
s3nk4s/flaskTutorials | refs/heads/master | FlaskApp/FlaskApp/venv/local/lib/python2.7/encodings/iso8859_2.py | 593 | """ Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.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,errors='... |
bmazin/ARCONS-pipeline | refs/heads/master | examples/Pal2014_landoltPhot/plot3DImage.py | 1 | import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from sdssgaussfitter import twodgaussian
#rawfile = '/home/srmeeker/scratch/standards/Landolt9542_raw_0.npz'
#rawfile = '/home/srmeeker/scratch/standards/pg0220a_raw_0.npz'
rawfile = '/home/srmeeker/s... |
InspurUSA/kudu | refs/heads/master | build-support/iwyu.py | 2 | #!/usr/bin/env python
# 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
# "L... |
Galaxy-J5/TWRP_kernel_samsung_j5lte | refs/heads/5.1 | Documentation/target/tcm_mod_builder.py | 2358 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
dorodj/support-tools | refs/heads/master | wiki_to_md/impl/pragma_handler.py | 126 | # 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... |
evalsocket/tensorflow | refs/heads/master | object_detection/object_detection/protos/anchor_generator_pb2.py | 7 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/anchor_generator.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pro... |
beernarrd/gramps | refs/heads/sl-master | gramps/gen/filters/rules/person/_multiplemarriages.py | 6 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# 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 you... |
jimtyhurst/team-budget | refs/heads/master | budget_proj/budget_app/filters.py | 2 | from django.db.models import CharField
from django_filters import rest_framework as filters
from . import models
class CustomFilterBase(filters.FilterSet):
"""
Extends Filterset to populate help_text from the associated model field.
Works with swagger but not the builtin docs.
"""
@classmethod
... |
myself659/linux | refs/heads/master | scripts/gdb/linux/dmesg.py | 630 | #
# gdb helper commands and functions for Linux kernel debugging
#
# kernel log buffer dump
#
# Copyright (c) Siemens AG, 2011, 2012
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
class LxDmesg(gdb.Command... |
apache/incubator-superset | refs/heads/master | superset/migrations/versions/33d996bcc382_update_slice_model.py | 5 | # 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... |
CredoReference/edx-platform | refs/heads/integration-hawthorn-qa | common/djangoapps/course_modes/migrations/0011_change_regex_for_comma_separated_ints.py | 13 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-01-30 17:38
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
import re
class Migration(migrations.Migration):
dependencies = [
('course_modes', '0010_archived_suggested_prices_to_ch... |
sqzr1/Getter-Setter-Generator | refs/heads/master | tests/regression_test_samples/python/otherTaskScheduler.py | 1 | # Other More Complete Task Scheduler Example
import os, sys
import datetime
import operator
import re
import time
import pythoncom
from win32com.taskscheduler import taskscheduler
def _set (obj, key, value):
obj.__dict__[key] = value
class Constants (object):
def __init__ (self):
pass
constants = Constants ... |
reedloden/ansible | refs/heads/devel | lib/ansible/plugins/lookup/file.py | 43 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
#
# 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 lat... |
marcoscaceres/bedrock | refs/heads/master | bedrock/firefox/tests/test_helpers.py | 11 | import jingo
from django.conf import settings
from django.test.client import RequestFactory
from django.test.utils import override_settings
from mock import patch
from nose.tools import assert_false, eq_, ok_
from pyquery import PyQuery as pq
from product_details import product_details
from bedrock.mozorg.tests impor... |
JuxhinDB/gw2-api-interface | refs/heads/master | test/test_commerce.py | 1 | """
Tests functionality of commerce API for version 2
"""
import inspect
import functools
import json
import os
import pathlib
import pytest
import requests_mock
from gw2api import GuildWars2Client
def test_coins_to_gems(gw2_client, mock_adapter):
"""Tests conversion of coins to gems
Args:
gw2_cli... |
Frostman/eho-horizon | refs/heads/master | openstack_dashboard/dashboards/settings/dashboard.py | 7 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Openstack, LLC
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apac... |
shuxin/androguard | refs/heads/master | androguard/gui/DisasmViewMode.py | 2 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from PyQt5 import QtGui, QtCore
from builtins import hex
from builtins import range
from androguard.core.bytecodes import dvm
from . import TextSelection
from .ViewMode import *
from .cemu import *
import log... |
Xobb/fabric-bolt | refs/heads/master | src/fabric_bolt/projects/migrations/0016_auto__add_field_deployment_configuration.py | 18 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Deployment.configuration'
db.add_column(u'projects_deployment', 'configuration',
... |
ebar0n/django | refs/heads/master | tests/template_tests/syntax_tests/test_filter_tag.py | 521 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FilterTagTests(SimpleTestCase):
@setup({'filter01': '{% filter upper %}{% endfilter %}'})
def test_filter01(self):
output = self.engine.render_to_string('filter01')
self.ass... |
cocagne/zpax | refs/heads/master | test/test_network.py | 2 | import os
import os.path
import sys
from twisted.internet import reactor, defer
from twisted.trial import unittest
pd = os.path.dirname
this_dir = pd(os.path.abspath(__file__))
sys.path.append( pd(this_dir) )
from zpax.network import zmq_node, test_node
def delay(t):
d = defer.Deferred()
reactor.callLa... |
kapiziak/mtasa-blue | refs/heads/master | vendor/google-breakpad/src/tools/gyp/test/actions/src/subdir3/generate_main.py | 377 | #!/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.
import sys
contents = """
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello from generate_main.py\\n");
return 0;
}
... |
proteansec/pelican-plugins | refs/heads/master | clean_summary/__init__.py | 74 | from .clean_summary import *
|
drawks/ansible | refs/heads/devel | lib/ansible/plugins/httpapi/checkpoint.py | 25 | # (c) 2018 Red Hat 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
DOCUMENTATION = """
---
author: Ansible Networking Team
httpapi : checkpoint
short_description: HttpApi Plugin f... |
y-higuchi/ramcloud | refs/heads/master | scripts/dumpstr.py | 20 | # Copyright (c) 2011 Stanford University
#
# 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 PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ... |
NicovincX2/Python-3.5 | refs/heads/master | Algorithmique/Algorithme/Algorithme numérique/Algorithme de recherche d'un zéro d'une fonction/heron.py | 1 | # -*- coding: utf-8 -*-
import os
def racine(a, xk, n):
"""
Calcule une approximation de a à partir d'une première valeur par défaut xk
On effectue n itérations de l'algorithme de Babylone (ou de Héron)
"""
if n == 0:
return xk
else:
return racine(a, (xk + a / xk) * 0.5, n - 1... |
jpfeil/toil-scripts | refs/heads/master | src/toil_scripts/rnaseq_unc/rnaseq_unc_tcga_versions.py | 2 | #!/usr/bin/env python2.7
"""
UNC Best Practice RNA-Seq Pipeline
Author: John Vivian
Affiliation: UC Santa Cruz Genomics Institute
Please see the README.md in the same directory
Tree Structure of RNA-Seq Pipeline (per sample)
0---> 2
| |
1 3 - - - - -> Consolidate Output -> Upload_to_S3
/... |
drunknbass/plexpy | refs/heads/master | lib/html5lib/trie/_base.py | 1735 | from __future__ import absolute_import, division, unicode_literals
from collections import Mapping
class Trie(Mapping):
"""Abstract base class for tries"""
def keys(self, prefix=None):
keys = super().keys()
if prefix is None:
return set(keys)
# Python 2.6: no set compre... |
lodemo/CATANA | refs/heads/master | src/face_recognition/youtube_dl/extractor/libraryofcongress.py | 44 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
parse_filesize,
)
class LibraryOfCongressIE(InfoExtractor):
IE_NAME = 'loc'
IE_DESC = 'Library of Congress'
_VALID_URL = r... |
divio/django | refs/heads/master | tests/admin_inlines/tests.py | 118 | from __future__ import unicode_literals
import datetime
import warnings
from django.contrib.admin import ModelAdmin, TabularInline
from django.contrib.admin.helpers import InlineAdminForm
from django.contrib.admin.tests import AdminSeleniumWebDriverTestCase
from django.contrib.auth.models import Permission, User
from... |
barma1309/Kalista | refs/heads/master | .virtualenvs/Kalista/lib/python3.4/site-packages/django/utils/encoding.py | 106 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import codecs
import datetime
import locale
from decimal import Decimal
from django.utils import six
from django.utils.functional import Promise
from django.utils.six.moves.urllib.parse import quote, unquote
if six.PY3:
from urllib.parse import un... |
monsdar/RowLog | refs/heads/master | Storage/__init__.py | 12 | __author__ = 'monsdar'
|
vmarkovtsev/django | refs/heads/master | tests/prefetch_related/models.py | 255 | import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Basic tests
@python_2_unicode_compatible
class Author(models.... |
robbi/pyload | refs/heads/stable | module/plugins/hoster/UploadhereCom.py | 7 | # -*- coding: utf-8 -*-
from ..internal.DeadHoster import DeadHoster
class UploadhereCom(DeadHoster):
__name__ = "UploadhereCom"
__type__ = "hoster"
__version__ = "0.17"
__status__ = "stable"
__pattern__ = r'http://(?:www\.)?uploadhere\.com/\w{10}'
__config__ = [] # @TODO: Remove in 0.4.10
... |
AlexLisovoy/aiohttp | refs/heads/master | aiohttp/hdrs.py | 18 | """HTTP Headers constants."""
from .multidict import upstr
METH_ANY = upstr('*')
METH_CONNECT = upstr('CONNECT')
METH_HEAD = upstr('HEAD')
METH_GET = upstr('GET')
METH_DELETE = upstr('DELETE')
METH_OPTIONS = upstr('OPTIONS')
METH_PATCH = upstr('PATCH')
METH_POST = upstr('POST')
METH_PUT = upstr('PUT')
METH_TRACE = ups... |
xingh/jaikuengine | refs/heads/master | actor/__init__.py | 1073 | # Copyright 2009 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
uberamd/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_rebel_lance_corporal_human_male_01.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/mobile/perlek_hue.py | 85615 | import sys
def setup(core, object):
return |
yencarnacion/jaikuengine | refs/heads/master | .google_appengine/lib/django-1.3/tests/modeltests/many_to_one_null/models.py | 92 | """
16. Many-to-one relationships that can be null
To define a many-to-one relationship that can have a null foreign key, use
``ForeignKey()`` with ``null=True`` .
"""
from django.db import models
class Reporter(models.Model):
name = models.CharField(max_length=30)
def __unicode__(self):
return self... |
flotre/sickbeard-vfvo | refs/heads/master | lib/requests/packages/oauthlib/oauth2/__init__.py | 186 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
oauthlib.oauth2
~~~~~~~~~~~~~~
This module is a wrapper for the most recent implementation of OAuth 2.0 Client
and Server classes.
"""
from .draft25 import Client, Server
|
googleapis/googleapis-gen | refs/heads/master | google/cloud/securitycenter/settings/v1beta1/securitycenter-settings-v1beta1-py/google/cloud/securitycenter/settings_v1beta1/services/security_center_settings_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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.