repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
blacklin/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/test/test_unpack.py | 174 | doctests = """
Unpack tuple
>>> t = (1, 2, 3)
>>> a, b, c = t
>>> a == 1 and b == 2 and c == 3
True
Unpack list
>>> l = [4, 5, 6]
>>> a, b, c = l
>>> a == 4 and b == 5 and c == 6
True
Unpack implied tuple
>>> a, b, c = 7, 8, 9
>>> a == 7 and b == 8 and c == 9
True
Unpa... |
rahuldhote/scikit-learn | refs/heads/master | sklearn/metrics/__init__.py | 214 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... |
dslab-epfl/bugbase | refs/heads/master | doc/source/conf.py | 1 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Bugbase documentation build configuration file, created by
# sphinx-quickstart on Mon May 4 11:56:47 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# au... |
CptDemocracy/Python | refs/heads/master | MITx-6.00.1x-EDX-Introduction-to-Computer-Science/Week-2/Lecture-3/problem5a.py | 1 | """
Problem 5a.
In this problem you'll be given a chance to practice writing
some for loops.
Convert the following code into code that uses a for loop:
print 2
print 4
print 6
print 8
print 10
print "Goodbye!"
"""
for n in range(2, 11, 2):
print str(n)
print 'Goodbye!'
|
mbrinkmeier/AbbozzaCore | refs/heads/master | build/classes/js/lib/blockly/i18n/create_messages.py | 128 | #!/usr/bin/python
# Generate .js files defining Blockly core and language messages.
#
# Copyright 2013 Google Inc.
# https://developers.google.com/blockly/
#
# 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 t... |
zhengyongbo/phantomjs | refs/heads/master | src/breakpad/src/tools/gyp/pylib/gyp/__init__.py | 137 | #!/usr/bin/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 copy
import gyp.input
import optparse
import os.path
import re
import shlex
import sys
# Default debug modes for GYP
debug = {}
# List ... |
ycsoft/FatCat-Server | refs/heads/master | LIBS/boost_1_58_0/libs/python/test/operators_wrapper.py | 12 | from operators_wrapper_ext import *
class D2(vector): pass
d2 = D2()
for lhs in (v,d,d2):
-lhs
for rhs in (v,d,d2):
lhs + rhs
lhs += rhs
|
toontownfunserver/Panda3D-1.9.0 | refs/heads/master | direct/gui/__init__.py | 12133432 | |
tushar7795/MicroBlog | refs/heads/master | flask/lib/python2.7/site-packages/wtforms/ext/i18n/__init__.py | 12133432 | |
sergiocorato/odoomrp-wip | refs/heads/8.0 | stock_quant_manual_assign_without_lock_lot/tests/test_stock_quant_manual_assign_without_lock_lot.py | 5 | # -*- coding: utf-8 -*-
# Copyright © 2017 Ainara Galdona - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp.addons.stock_quant_manual_assign.tests\
.test_stock_quant_manual_assign import TestStockQuantManualAssign
from openerp.tests.common import at_install, post_install
@a... |
zbal/ansible | refs/heads/devel | test/units/parsing/test_unquote.py | 152 | # coding: utf-8
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.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 o... |
jorpramo/flask | refs/heads/master | flask/blueprints.py | 141 | # -*- coding: utf-8 -*-
"""
flask.blueprints
~~~~~~~~~~~~~~~~
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrap... |
mwv/scikit-learn | refs/heads/master | sklearn/covariance/tests/test_covariance.py | 142 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... |
maohongyuan/kbengine | refs/heads/master | kbe/src/lib/python/Lib/email/message.py | 63 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Basic message object for the email package object model."""
__all__ = ['Message']
import re
import uu
import quopri
import warnings
from io import BytesIO, StringIO
# Intrapackage imports
from email import... |
modulexcite/PTVS | refs/heads/master | Python/Tests/TestData/WFastCgi/DjangoSimpleAppUrlRewrite/manage.py | 56 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "DjangoApplication.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
suncycheng/intellij-community | refs/heads/master | python/helpers/epydoc/log.py | 99 | # epydoc -- Logging
#
# Copyright (C) 2005 Edward Loper
# Author: Edward Loper <edloper@loper.org>
# URL: <http://epydoc.sf.net>
#
# $Id: log.py 1488 2007-02-14 00:34:27Z edloper $
"""
Functions used to report messages and progress updates to the user.
These functions are delegated to zero or more registered L{Logger}... |
smishenk/blink-crosswalk | refs/heads/master | Tools/Scripts/webkitpy/tool/steps/abstractstep.py | 50 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
chaosblog/pyload | refs/heads/stable | module/database/StorageDatabase.py | 41 | # -*- coding: utf-8 -*-
"""
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 ... |
jnewland/home-assistant | refs/heads/ci | homeassistant/components/uvc/camera.py | 7 | """Support for Ubiquiti's UVC cameras."""
import logging
import socket
import requests
import voluptuous as vol
from homeassistant.const import CONF_PORT, CONF_SSL
from homeassistant.components.camera import Camera, PLATFORM_SCHEMA
import homeassistant.helpers.config_validation as cv
from homeassistant.exceptions imp... |
Ibtiss4m/sendprismApp | refs/heads/master | sendprism/contrib/sites/__init__.py | 1349 | # -*- coding: utf-8 -*- |
sdn-ixp/iSDX | refs/heads/master | visualization/dockers/redis-service/pub-sub/sub.py | 3 | from settings import r
import sys
if __name__ == '__main__':
channel = sys.argv[1]
pubsub = r.pubsub()
pubsub.subscribe(channel)
print 'Listening to {channel}'.format(**locals())
while True:
for item in pubsub.listen():
print item['data']
|
allenlavoie/tensorflow | refs/heads/master | tensorflow/contrib/autograph/converters/call_trees_test.py | 1 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
JorisDeRieck/Flexget | refs/heads/develop | flexget/components/notify/notifiers/prowl.py | 4 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import xml.etree.ElementTree as ET
from flexget import plugin
from flexget.config_schema import one_or_more
from flexget.event import event
from flexget.plu... |
Freso/picard | refs/heads/master | picard/tagger.py | 2 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2004 Robert Kaye
# Copyright (C) 2006 Lukáš Lalinský
#
# 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; ... |
akarki15/mozillians | refs/heads/master | vendor-local/lib/python/celery/tests/test_bin/test_celeryev.py | 14 | from __future__ import absolute_import
from nose import SkipTest
from celery.app import app_or_default
from celery.bin import celeryev
from celery.tests.utils import Case, patch
class MockCommand(object):
executed = []
def execute_from_commandline(self, **kwargs):
self.executed.append(True)
def ... |
hynnet/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/host/lib/python2.7/lib2to3/tests/data/different_encoding.py | 295 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
print u'ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ'
def f(x):
print '%s\t-> α(%2i):%s β(%s)'
|
mabushadi/dpxdt | refs/heads/master | dependencies/WTForms/tests/validators.py | 2 | #!/usr/bin/env python
from unittest import TestCase
from wtforms.compat import text_type
from wtforms.validators import (
StopValidation, ValidationError, email, equal_to,
ip_address, length, required, optional, regexp,
url, NumberRange, AnyOf, NoneOf, mac_address, UUID
)
from functools import partial
clas... |
pandoraui/electron | refs/heads/master | script/create-dist.py | 34 | #!/usr/bin/env python
import os
import re
import shutil
import subprocess
import sys
import stat
from lib.config import LIBCHROMIUMCONTENT_COMMIT, BASE_URL, PLATFORM, \
get_target_arch, get_chromedriver_version
from lib.util import scoped_cwd, rm_rf, get_atom_shell_version, make_zip, \
... |
decvalts/landlab | refs/heads/master | landlab/grid/tests/test_raster_funcs/test_gradients_at_active_links.py | 1 | import numpy as np
from numpy.testing import assert_array_equal
from nose import with_setup
try:
from nose.tools import assert_is
except ImportError:
from landlab.testing.tools import assert_is
from landlab import RasterModelGrid
_GRIDS = {}
def setup_grids():
_GRIDS.update({
'unit': RasterModel... |
saurabh6790/test-erp | refs/heads/develop | erpnext/selling/doctype/product_bundle/__init__.py | 12133432 | |
Fantomas42/django-blog-zinnia | refs/heads/develop | zinnia/migrations/0002_lead_paragraph_and_image_caption.py | 3 | from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('zinnia', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='entry',
name='image_caption',
field=models.TextField(
... |
steven004/TestSteps | refs/heads/master | test_examples/test_lesson1_autolog.py | 1 | __author__ = 'Steven LI'
from test_steps import *
import logging, time
def my_add(*args):
ret = 0
for i in args:
ret += i
return ret
def my_mul(*args):
ret = 1
for i in args:
ret *= i
return ret
def test_logger_setup():
''' Add file-logging into test_logger
This ... |
acarmel/CouchPotatoServer | refs/heads/master | libs/tornado/wsgi.py | 73 | #!/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... |
kidmaple/CoolWall | refs/heads/nios2 | user/python/Tools/compiler/dumppyc.py | 3 | #! /usr/bin/env python
import marshal
import dis
import types
def dump(obj):
print obj
for attr in dir(obj):
print "\t", attr, repr(getattr(obj, attr))
def loadCode(path):
f = open(path)
f.read(8)
co = marshal.load(f)
f.close()
return co
def walk(co, match=None):
if match is ... |
msebire/intellij-community | refs/heads/master | python/testData/completion/py3595/moduleX.py | 83 | import smname
import smname.moduleY
smname.moduleY.mod<caret>
|
ramondeklein/energymeter | refs/heads/master | log.py | 1 | from config import configuration
import logging
import os
def initialize_logging(section):
# Default is no log warnings
log_warnings = []
# Determine the logfile
log_file = configuration.get(section, 'logfile') if configuration.has_option(section, 'logfile') else None
# Determine the log level
... |
ktarrant/options_csv | refs/heads/master | journal/trades/apps.py | 1 | from django.apps import AppConfig
class TradesConfig(AppConfig):
name = 'trades'
|
jounex/hue | refs/heads/master | desktop/core/ext-py/PyYAML-3.09/lib3/yaml/serializer.py | 293 |
__all__ = ['Serializer', 'SerializerError']
from .error import YAMLError
from .events import *
from .nodes import *
class SerializerError(YAMLError):
pass
class Serializer:
ANCHOR_TEMPLATE = 'id%03d'
def __init__(self, encoding=None,
explicit_start=None, explicit_end=None, version=None, ta... |
ahmedaljazzar/edx-platform | refs/heads/master | openedx/core/djangoapps/dark_lang/admin.py | 24 | """
Admin site bindings for dark_lang
"""
from config_models.admin import ConfigurationModelAdmin
from django.contrib import admin
from openedx.core.djangoapps.dark_lang.models import DarkLangConfig
admin.site.register(DarkLangConfig, ConfigurationModelAdmin)
|
joomel1/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/postdiffforcommit.py | 147 | # Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... |
kryptohash/kryptohash | refs/heads/master | share/qt/make_spinner.py | 563 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload.png'
TMPDIR='../../src/qt/res/movies/'
TMPNAME='spinner-%03i.png'
NUMFRAMES=35
FRAMERA... |
trevor/mailman3 | refs/heads/master | src/mailman/rest/users.py | 1 | # Copyright (C) 2011-2014 by the Free Software Foundation, Inc.
#
# This file is part of GNU Mailman.
#
# GNU Mailman 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 you... |
scalado/contexo | refs/heads/master | contexo/cmdline/ctx2tengil.py | 1 | #!/usr/bin/env python
###############################################################################
# #
# ctx2make.py #
# Generate GNU Makefiles from Contexo views - (c) Scala... |
ampax/edx-platform | refs/heads/master | lms/djangoapps/debug/management/commands/__init__.py | 12133432 | |
matsumoto-r/synciga | refs/heads/master | src/tools/gyp/pylib/gyp/MSVSNew.py | 225 | # 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.
"""New implementation of Visual Studio project generation for SCons."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the ... |
ampling/pass | refs/heads/passmenu_multi-clip | contrib/importers/keepass2pass.py | 11 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Stefan Simroth <stefan.simroth@gmail.com>. All Rights Reserved.
# Based on the script for KeepassX by Juhamatti Niemelä <iiska@iki.fi>.
# This file is licensed under the GPLv2+. Please see COPYING for more information.
#
# Usage:
# ./keepass2pass.py ... |
wdwvt1/scikit-bio | refs/heads/master | skbio/sequence/tests/test_iupac_sequence.py | 3 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... |
DavidWhittingham/agsadmin | refs/heads/develop | agsadmin/sharing_admin/portals/RolesResponse.py | 1 | from __future__ import (absolute_import, division, print_function, unicode_literals)
from builtins import (ascii, bytes, chr, dict, filter, hex, input, int, map, next, oct, open, pow, range, round, str,
super, zip)
class RolesResponse(object):
@property
def num(self):
return self... |
crwilcox/PyGithub | refs/heads/master | github/tests/GitRef.py | 39 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
psawaya/Mental-Ginger | refs/heads/master | django/contrib/localflavor/ro/ro_counties.py | 428 | # -*- coding: utf-8 -*-
"""
A list of Romanian counties as `choices` in a formfield.
This exists as a standalone file so that it's only imported into memory when
explicitly needed.
"""
COUNTIES_CHOICES = (
('AB', u'Alba'),
('AR', u'Arad'),
('AG', u'Argeş'),
('BC', u'Bacău'),
('BH', u'Bihor'),
... |
vvv1559/intellij-community | refs/heads/master | python/testData/refactoring/inlinelocal/py994.before.py | 83 | class C:
def foo(self):
co<caret>nf = Conference()
return conf |
thepropterhoc/Cha_The_Pivot | refs/heads/master | app/node_modules/mailin/python/verifydkim.py | 9 | #!/usr/bin/env python
"""
Given a raw email message on stdin, verify its dkim signature. Exit with code 11
if the signature is not valid.
"""
import dkim
import os
import sys
def main():
msg = sys.stdin.read()
res = None
res = dkim.verify(msg)
print('[' + os.path.basename(__file__) + '] isDkimValid =... |
ReganBell/QReview | refs/heads/master | networkx/algorithms/tests/test_distance_regular.py | 87 | #!/usr/bin/env python
from nose.tools import *
import networkx as nx
class TestDistanceRegular:
def test_is_distance_regular(self):
assert_true(nx.is_distance_regular(nx.icosahedral_graph()))
assert_true(nx.is_distance_regular(nx.petersen_graph()))
assert_true(nx.is_distance_regular(nx.cub... |
kivio/PerfKitBenchmarker | refs/heads/master | perfkitbenchmarker/flag_util.py | 4 | # Copyright 2015 PerfKitBenchmarker 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 appli... |
olgabrani/synnefo | refs/heads/feature-newui-pithos | snf-astakos-app/astakos/oa2/backends/djangobackend.py | 9 | # Copyright (C) 2010-2014 GRNET S.A.
#
# 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 i... |
ucapdak/loewner | refs/heads/master | main/PythonTools/LoewnerRun.py | 1 | from Constants import *
import matplotlib.pyplot as plt
from subprocess import check_output, CalledProcessError
import matlab.engine
from mpmath import findroot, cot
from cmath import log
from cmath import sqrt as csqrt
from cmath import cos as ccos
from cmath import sin as csin
from math import pi, sin, floor, cos, sq... |
ptemplier/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_sflow.py | 26 | #!/usr/bin/python
#
# 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 distribut... |
kwailamchan/programming-languages | refs/heads/master | javascript/backbone/backbone-templates/backbone-fileupload/venvs/lib/python2.7/site-packages/django/contrib/localflavor/is_/__init__.py | 12133432 | |
helenst/django | refs/heads/master | django/conf/locale/it/__init__.py | 12133432 | |
jamesblunt/gunicorn | refs/heads/master | examples/frameworks/pylonstest/pylonstest/controllers/__init__.py | 12133432 | |
naousse/odoo | refs/heads/8.0 | addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py | 381 | # -*- 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... |
aranjan7/contrail-controller-aranjan | refs/heads/master | src/config/api-server/tests/test_askip.py | 7 | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
from vnc_api.vnc_api import *
import uuid
def all(ip='10.84.13.34', port=8082, domain_name='my-domain',
proj_name='my-proj', subnet='192.168.1.0', prefix=24, vn_name='my-fe',
compute_node='a2s3.contrail.juniper.net'):
vnc_lib = V... |
sdroege/openwebrtc | refs/heads/master | bindings/java/type_registry.py | 1 | # Copyright (c) 2014, Ericsson AB. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the fol... |
gotomypc/scikit-learn | refs/heads/master | sklearn/utils/tests/test_fast_dict.py | 252 | """ Test fast_dict.
"""
import numpy as np
from nose.tools import assert_equal
from sklearn.utils.fast_dict import IntFloatDict, argmin
from sklearn.externals.six.moves import xrange
def test_int_float_dict():
rng = np.random.RandomState(0)
keys = np.unique(rng.randint(100, size=10).astype(np.intp))
value... |
sajuptpm/neutron-ipam | refs/heads/stable/icehouse | neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Cloudbase Solutions SRL
# Copyright 2013 Pedro Navarro Perez
# 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... |
mkusz/invoke | refs/heads/master | tests/_support/subcollection_task_name.py | 2 | from invoke import task
@task(name='explicit_name')
def implicit_name(ctx):
pass
|
TAKEALOT/Diamond | refs/heads/master | src/collectors/nfacct/nfacct.py | 60 | # coding=utf-8
"""
Collect counters from Netfilter accounting
#### Dependencies
* [nfacct](http://www.netfilter.org/projects/nfacct/)
"""
import diamond.collector
from subprocess import Popen, PIPE
import re
from diamond.collector import str_to_bool
class NetfilterAccountingCollector(diamond.collector.Collecto... |
ListerLab/TEPID | refs/heads/master | Scripts/genotype.py | 1 | #! /usr/bin/env python
from argparse import ArgumentParser
parser = ArgumentParser(description='Genotype TE insertions')
group = parser.add_mutually_exclusive_group()
group.add_argument('-d', '--deletions', help='run on deletions', action='store_true', required=False, default=False)
group.add_argument('-i', '--inser... |
gunchleoc/django | refs/heads/master | tests/invalid_models_tests/test_backend_specific.py | 191 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.core.checks import Error
from django.db import connections, models
from django.test import mock
from .base import IsolatedModelsTestCase
def dummy_allow_migrate(db, app_label, **hints):
# Prevent checks from being run on the 'other' d... |
uwosh/Campus_Directory_web_service | refs/heads/master | CampusDirectoryZEM001VALUOVWCX.py | 1 | # Web service for campus directory project
import cx_Oracle
import xmlrpclib
Randy_Loch = '192.168.0.1'
Kim_Nguyen_G5 = '192.168.0.1'
def CampusDirectoryZEM001VALUOVWCX (self, org_unit='None'):
request = self.REQUEST
RESPONSE = request.RESPONSE
remote_addr = request.REMOTE_ADDR
if remote_addr in [Ra... |
ringo-framework/ringo | refs/heads/master | ringo/alembic/versions/3520cf26d8d8_.py | 4 | """Rename gid to default_gid in usergroups and modules
Revision ID: 3520cf26d8d8
Revises: 4ff2bc4eb9bf
Create Date: 2015-07-21 22:51:53.672633
"""
# revision identifiers, used by Alembic.
revision = '3520cf26d8d8'
down_revision = '4ff2bc4eb9bf'
from alembic import op
import sqlalchemy as sa
UPGRADE = """
"""
DOWN... |
xuchao666/msz | refs/heads/master | msz/market/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
... |
andmos/ansible | refs/heads/devel | lib/ansible/modules/net_tools/haproxy.py | 17 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ravi Bhure <ravibhure@gmail.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',
... |
WSDC-NITWarangal/django | refs/heads/master | django/views/__init__.py | 12133432 | |
tarunlnmiit/django-crispy-forms | refs/heads/dev | crispy_forms/models.py | 12133432 | |
brandonPurvis/osf.io | refs/heads/develop | api_tests/files/__init__.py | 12133432 | |
gauravbose/digital-menu | refs/heads/master | django/conf/locale/tr/__init__.py | 12133432 | |
knewmanTE/FrameworkBenchmarks | refs/heads/master | frameworks/Python/turbogears/models/World.py | 79 | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column
from sqlalchemy.types import String, Integer
Base = declarative_base()
class World(Base):
__tablename__ = "world"
id = Column(Integer, primary_key = True)
randomNumber = Column(Integer)
def serialize(self):
... |
esikachev/my-dev-client | refs/heads/master | my_dev/utils.py | 1 | import os
def write_to_config(username, host):
with open(os.path.join(os.path.expanduser("~"), '.my.conf'), 'w') as cfg:
config = '[DEFAULT]\nusername=%s\nhost=%s\n'
cfg.write(config % (username, host))
|
vulhub/vulhub | refs/heads/master | php/inclusion/exp.py | 1 | #!/usr/bin/python
import sys
import threading
import socket
def setup(host, port):
TAG="Security Test"
PAYLOAD="""%s\r
<?php file_put_contents('/tmp/g', '<?=eval($_REQUEST[1])?>')?>\r""" % TAG
REQ1_DATA="""-----------------------------7dbff1ded0714\r
Content-Disposition: form-data; name="dummyname"; filen... |
ColdrickSotK/storyboard | refs/heads/master | storyboard/db/migration/alembic_migrations/versions/059_add_a_table_for_comment_history.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... |
Block137/Dual2 | refs/heads/Dual2 | mk/PX4/Tools/genmsg/test/test_genmsg_command_line.py | 216 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above... |
mei3am/androguard | refs/heads/master | androcsign.py | 38 | #!/usr/bin/env python
# This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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,... |
Ssawa/Diamond | refs/heads/master | src/collectors/vmstat/vmstat.py | 16 | # coding=utf-8
"""
Uses /proc/vmstat to collect data on virtual memory manager
#### Dependencies
* /proc/vmstat
"""
import diamond.collector
import os
import re
class VMStatCollector(diamond.collector.Collector):
PROC = '/proc/vmstat'
MAX_VALUES = {
'pgfault': diamond.collector.MAX_COUNTER,
... |
clar/gyp | refs/heads/master | test/make_global_settings/full-toolchain/gyptest-make_global_settings.py | 83 | #!/usr/bin/env python
# Copyright (c) 2014 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 make_global_settings works with the full toolchain.
"""
import os
import sys
import TestGyp
if sys.platform == 'win32':
# c... |
errx/django | refs/heads/master | django/contrib/gis/db/models/sql/query.py | 32 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.constants import ALL_TERMS
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion ... |
kalwar/openelisglobal-core | refs/heads/develop | liquibase/OE4.2/testCatalogHT_LNSP/scripts/createLocalCode.py | 25 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def trim( name, length):
if len( name ) <= length:
return name
else:
last_space = name.find(" ")
if last_space == -1:
return name[:35]
else:
return trim( name[:last_space], length)
def translate(... |
std05048/Thesis | refs/heads/master | src/config-store/bindings/modulegen__gcc_LP64.py | 42 | 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))
... |
rsvip/Django | refs/heads/master | tests/template_tests/test_logging.py | 210 | from __future__ import unicode_literals
import logging
from django.template import Engine, Variable, VariableDoesNotExist
from django.test import SimpleTestCase
class TestHandler(logging.Handler):
def __init__(self):
super(TestHandler, self).__init__()
self.log_record = None
def emit(self, ... |
Nikea/VisTrails | refs/heads/master | vistrails/db/versions/v0_9_0/persistence/xml/xml_dao.py | 16 | ###############################################################################
##
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary for... |
cbenhagen/kivy | refs/heads/master | examples/includes/main.py | 40 | from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.button import Button
class SpecialButton(Button):
pass
class CustomLayout(BoxLayout):
pass
class TestApp(App):
pass
if __name__ == '__main__':
TestApp().run()
|
yeatmanlab/AFQ-viz | refs/heads/master | doc/conf.py | 5 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# afqbrowser documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 14 10:29:06 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
#... |
sandan/sqlalchemy | refs/heads/master | lib/sqlalchemy/testing/assertsql.py | 21 | # testing/assertsql.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from ..engine.default import DefaultDialect
from .. import util
import re
impor... |
freenas/samba | refs/heads/freenas/master | third_party/dnspython/examples/name.py | 82 | #!/usr/bin/env python
import dns.name
n = dns.name.from_text('www.dnspython.org')
o = dns.name.from_text('dnspython.org')
print n.is_subdomain(o) # True
print n.is_superdomain(o) # False
print n > o # True
rel = n.relativize(o) # rel is the relative name www
n2 = rel + o
pr... |
fpy171/django | refs/heads/master | tests/decorators/__init__.py | 12133432 | |
CEG-FYP-OpenStack/scheduler | refs/heads/master | nova/network/security_group/__init__.py | 12133432 | |
Clyde-fare/scikit-learn | refs/heads/master | sklearn/tests/__init__.py | 12133432 | |
kool79/intellij-community | refs/heads/master | python/testData/resolve/multiFile/fromPackageImportIntoInit/pack/mod.py | 12133432 | |
google/autobidding-readiness-monitor | refs/heads/master | dags/algo_readiness_scheduler_dag.py | 1 | #
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
ndingwall/scikit-learn | refs/heads/master | sklearn/linear_model/_stochastic_gradient.py | 2 | # Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
import warnings
from abc import ABCMeta, abstractmethod
from joblib imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.