repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
srm912/servo | refs/heads/master | tests/wpt/web-platform-tests/html/semantics/scripting-1/the-script-element/serve-with-content-type.py | 161 | import os
def main(request, response):
directory = os.path.dirname(__file__)
try:
file_name = request.GET.first("fn")
content_type = request.GET.first("ct")
with open(os.path.join(directory, file_name), "rb") as fh:
content = fh.read()
response.headers.set("Content... |
TheSocialDigits/thesocialdigits-python | refs/heads/master | thesocialdigits/api.py | 1 | """
This is a generic python interface for communication with The Social Digits API
version 1.
Se more: https://github.com/TheSocialDigits/thesocialdigits-python
"""
import urllib2, json, string, random
import config
class TheSocialDigitsAPI(object):
def __init__(self, key=None, server=None):
"""
... |
puzan/ansible | refs/heads/devel | lib/ansible/modules/database/mysql/mysql_user.py | 13 | #!/usr/bin/python
# (c) 2012, Mark Theunissen <mark.theunissen@gmail.com>
# Sponsored by Four Kitchens http://fourkitchens.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... |
MountainWei/nova | refs/heads/master | nova/tests/unit/virt/hyperv/test_hostutilsv2.py | 42 | # Copyright 2015 Cloudbase Solutions Srl
# 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 r... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/draft_schematic/dance_prop/prop_torch_l.py | 85615 | import sys
def setup(core, object):
return |
zhengyongbo/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/stack_utils_unittest.py | 124 | # Copyright (C) 2011 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 ... |
derwentx/WooGenerator | refs/heads/master | tests/abstract.py | 1 | from context import TESTS_DATA_DIR, get_testdata, woogenerator
import unittest
# import argparse
import pytest
import logging
from woogenerator.namespace.core import (
MatchNamespace, ParserNamespace, SettingsNamespaceProto, UpdateNamespace
)
from woogenerator.conf.parser import ArgumentParserCommon, ArgumentParse... |
Orochimarufan/youtube-dl | refs/heads/master | youtube_dl/extractor/carambatv.py | 20 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
float_or_none,
int_or_none,
try_get,
)
from .videomore import VideomoreIE
class CarambaTVIE(InfoExtractor):
_VALID_URL = r'(?:carambatv:|https?://video1\.ca... |
tximikel/kuma | refs/heads/master | vendor/packages/pyflakes/messages.py | 34 | """
Provide the class Message and its subclasses.
"""
class Message(object):
message = ''
message_args = ()
def __init__(self, filename, loc):
self.filename = filename
self.lineno = loc.lineno
self.col = getattr(loc, 'col_offset', 0)
def __str__(self):
return '%s:%s: ... |
LPM-HMS/COSMOS-2.0 | refs/heads/master | cosmos/core/cmd_fxn/signature.py | 2 | import decorator
import funcsigs
def get_call_kwargs(cmd_fxn, params, input_map, output_map):
sig = funcsigs.signature(cmd_fxn)
def gen_params():
for keyword, param in list(sig.parameters.items()):
if keyword in input_map:
yield keyword, input_map[keyword]
elif... |
rahlk/Experimental-Algorithms | refs/heads/master | multiProc/src/Models/_POM3.py | 1 | import sys
import os
_pwd = os.getcwd()
sys.path.insert(0, _pwd + '/pom3/')
from pom3.pom3_teams import *
from pom3.pom3_requirements import *
import random
from numpy.random.mtrand import shuffle
"""##############################################################################
### -@author: Joseph Krall
### -@n... |
cjaymes/pyscap | refs/heads/master | src/scap/model/oval_5/defs/windows/PortObjectElement.py | 1 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... |
RegaliaEzz/Hexa-N9208 | refs/heads/master | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
madmouser1/beets | refs/heads/master | beets/autotag/mb.py | 4 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... |
nzmm/granite | refs/heads/master | pages/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import granite.utils.cache
import granite.validators
class Migration(migrations.Migration):
dependencies = [
('websites', '0001_initial'),
migrations.swappabl... |
spcui/tp-qemu | refs/heads/master | qemu/tests/check_block_size.py | 7 | import logging
from autotest.client.shared import error
from virttest import utils_test
@error.context_aware
def run(test, params, env):
"""
Check physical block size and logical block size for virtio block device:
1) Install guest with a new image.
2) Verify whether physical/logical block size in gue... |
CiscoSystems/tempest | refs/heads/master | tempest/thirdparty/boto/test_ec2_instance_run.py | 1 | # Copyright 2012 OpenStack Foundation
# 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 requ... |
megraf/asuswrt-merlin | refs/heads/master | release/src/router/samba36/lib/testtools/testtools/tests/test_fixturesupport.py | 20 | import unittest
from testtools import (
TestCase,
content,
content_type,
)
from testtools.helpers import try_import
from testtools.tests.helpers import (
ExtendedTestResult,
)
fixtures = try_import('fixtures')
LoggingFixture = try_import('fixtures.tests.helpers.LoggingFixture')
class TestFix... |
ezequielpereira/Time-Line | refs/heads/master | timelinelib/utilities/encodings.py | 2 |
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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 ... |
teeple/pns_server | refs/heads/master | work/install/Python-2.7.4/Lib/logging/handlers.py | 29 | # Copyright 2001-2012 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
jobiols/server-tools | refs/heads/8.0 | setup/_metapackage/setup.py | 4 | import setuptools
with open('VERSION.txt', 'r') as f:
version = f.read().strip()
setuptools.setup(
name="odoo8-addons-oca-server-tools",
description="Meta package for oca-server-tools Odoo addons",
version=version,
install_requires=[
'odoo8-addon-admin_technical_features',
'odoo8-a... |
AdamIsrael/PerfKitBenchmarker | refs/heads/master | perfkitbenchmarker/linux_packages/gluster.py | 3 | # Copyright 2016 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... |
rockneurotiko/django | refs/heads/master | tests/ordering/tests.py | 301 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from django.db.models import F
from django.test import TestCase
from .models import Article, Author, Reference
class OrderingTests(TestCase):
def setUp(self):
self.a1 = Article.objects.create(
... |
TraMZzz/test | refs/heads/master | server/project/config/test.py | 2 | # -*- coding: utf-8 -*-
'''
Test Configurations
- Nose Runner
- Dummy Cache
- MD5 Password Hasher
- Celery
'''
from .common import *
INSTALLED_APPS += ("django_nose", )
# nose setup
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.Dumm... |
teeple/pns_server | refs/heads/master | work/install/Python-2.7.4/Tools/scripts/logmerge.py | 94 | #! /usr/bin/env python
"""Consolidate a bunch of CVS or RCS logs read from stdin.
Input should be the output of a CVS or RCS logging command, e.g.
cvs log -rrelease14:
which dumps all log messages from release1.4 upwards (assuming that
release 1.4 was tagged with tag 'release14'). Note the trailing
colon!
Thi... |
nicolargo/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/models/fields/proxy.py | 634 | """
Field-like classes that aren't really fields. It's easier to use objects that
have the same attributes as fields sometimes (avoids a lot of special casing).
"""
from django.db.models import fields
class OrderWrt(fields.IntegerField):
"""
A proxy for the _order database field that is used when
Meta.ord... |
omprakasha/odoo | refs/heads/8.0 | addons/l10n_be_hr_payroll/l10n_be_hr_payroll.py | 379 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... |
girving/tensorflow | refs/heads/master | tensorflow/python/ops/linalg_ops.py | 5 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
cshenry/Workspace | refs/heads/master | lib/biop3/Workspace/WorkspaceClient.py | 3 | ############################################################
#
# Autogenerated by the KBase type compiler -
# any changes made here will be overwritten
#
############################################################
try:
import json as _json
except ImportError:
import sys
sys.path.append('simplejson-2.3.3')... |
heeraj123/oh-mainline | refs/heads/master | vendor/packages/Django/django/contrib/databrowse/datastructures.py | 100 | """
These classes are light wrappers around Django's database API that provide
convenience functionality and permalink functions for the databrowse app.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils import formats
from django.utils.text import capfirst
from django.utils.enc... |
jayesh92/vms | refs/heads/master | vms/organization/views.py | 1 | from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from organization.forms import OrganizationForm
from organization.services import *
@login_required
def create(request):
... |
Solinea/horizon | refs/heads/master | openstack_dashboard/dashboards/project/data_processing/data_sources/workflows/create.py | 23 | # 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 the... |
eviljeff/zamboni | refs/heads/master | mkt/developers/management/commands/exclude_unrated.py | 16 | import logging
from django.core.management.base import BaseCommand
import mkt
from mkt.webapps.models import Geodata, Webapp
from mkt.webapps.tasks import index_webapps
log = logging.getLogger('z.task')
class Command(BaseCommand):
help = ('Exclude pre-IARC unrated public apps in Brazil/Germany.')
def han... |
wabu/zeroflo | refs/heads/master | zeroflo/top/container.py | 1 | from functools import reduce
from collections import defaultdict
class Ref(tuple):
def __new__(cls, name, id):
return super().__new__(cls, (name,id))
@property
def name(self):
return self[0]
@property
def id(self):
return self[1]
def __str__(self):
return
cla... |
jodonnell/Minesweeper- | refs/heads/master | urls.py | 1 | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Example:
(r'^$', 'minesweeper.views.index'),
(r'^clear$', 'minesweeper.views.clea... |
yoer/hue | refs/heads/master | desktop/core/ext-py/python-openid-2.2.5/setup.py | 56 | import sys
import os
from distutils.core import setup
if 'sdist' in sys.argv:
os.system('./admin/makedoc')
version = '[library version:2.2.5]'[17:-1]
setup(
name='python-openid',
version=version,
description='OpenID support for servers and consumers.',
long_description='''This is a set of Python... |
fdvarela/odoo8 | refs/heads/master | addons/l10n_hr/__init__.py | 432 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright (C) 2011- Slobodni programi d.o.o., Zagreb
# Contrib... |
mtnman38/ktaR | refs/heads/master | valpy/fileimport.py | 1 | """
Functions to import both class and results folder files
"""
import os, data
def getList(folder):
return os.listdir(folder)
def loadFile(folder, thisFile, seper):
return data.Data(folder + "/" + thisFile, seper, skiprow=False)
def loadKT(thisFile, seper):
return data.Data(thisFile, seper, skiprow=True) |
tudyzhb/yichui | refs/heads/master | django/contrib/staticfiles/urls.py | 475 | from django.conf import settings
from django.conf.urls.static import static
urlpatterns = []
def staticfiles_urlpatterns(prefix=None):
"""
Helper function to return a URL pattern for serving static files.
"""
if prefix is None:
prefix = settings.STATIC_URL
return static(prefix, view='djang... |
tomkralidis/geonode | refs/heads/master | geonode/base/migrations/0030_auto_20180309_0833.py | 6 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.13 on 2018-03-09 08:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('base', '0029_auto_20171114_0341'),
]
operations = [
migrations.AlterField(
model_name='region',
... |
CarolinaSGomes/jaikuengine | refs/heads/master | common/test/notification.py | 30 | # 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, ... |
Jack-Q/GYP-copy | refs/heads/master | test/win/gyptest-link-mapfile.py | 254 | #!/usr/bin/env python
# Copyright (c) 2013 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.
"""
Make sure mapfile settings are extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp... |
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/Twisted/twisted/internet/interfaces.py | 1 | # Copyright (c) 2001-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Interface documentation.
Maintainer: Itamar Shtull-Trauring
"""
from zope.interface import Interface, Attribute
class IAddress(Interface):
"""
An address, e.g. a TCP C{(host, port)}.
Default implementations are in L... |
menghanY/LeetCode-Python | refs/heads/master | Tree/FindModeInBinarySearchTree.py | 1 | #https://leetcode.com/problems/find-mode-in-binary-search-tree/
import collections
class Solution(object):
# https: // discuss.leetcode.com / topic / 77062 / simple - python - explanation
def findMode(self, root):
if not root: return []
count = collections.Counter()
def dfs(node):
... |
RyanYoung25/tensorflow | refs/heads/master | tensorflow/python/framework/function.py | 2 | # Copyright 2015 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... |
dwadler/QGIS | refs/heads/master | python/plugins/processing/algs/grass7/ext/r_li_mpa.py | 12 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_mpa.py
-----------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
************************************... |
DavidNorman/tensorflow | refs/heads/master | tensorflow/python/eager/wrap_function.py | 1 | # Copyright 2018 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... |
xq262144/hue | refs/heads/master | desktop/core/ext-py/requests-2.10.0/requests/packages/urllib3/contrib/pyopenssl.py | 7 | '''SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... |
hxsf/OnlineJudge | refs/heads/master | contest/migrations/0007_contestsubmission_ac_time.py | 6 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('contest', '0006_merge'),
]
operations = [
migrations.AddField(
model_name='contestsubmission',
name=... |
cytec/Sick-Beard | refs/heads/master | sickbeard/searchCurrent.py | 61 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... |
gmargari/apache-cassandra-1.1.0-src | refs/heads/master | test/system/__init__.py | 3 | # 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... |
irinabov/debian-qpid-dispatch | refs/heads/master | tests/system_tests_qdstat.py | 2 | #
# 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... |
luckielordie/conan | refs/heads/develop | conans/client/generators/compiler_args.py | 2 | from conans.client.build.cppstd_flags import cppstd_flag
from conans.model import Generator
from conans.paths import BUILD_INFO_COMPILER_ARGS
from conans.client.build.compiler_flags import (architecture_flag, sysroot_flag,
format_defines, format_include_paths,
... |
KennethPierce/pylearnk | refs/heads/fixNogil/master | pylearn2/cross_validation/train_cv_extensions.py | 19 | """
Cross-validation training extensions.
"""
__author__ = "Steven Kearnes"
__copyright__ = "Copyright 2014, Stanford University"
__license__ = "3-clause BSD"
__maintainer__ = "Steven Kearnes"
import numpy as np
import os
from pylearn2.train import SerializationGuard
from pylearn2.train_extensions.best_params import... |
dcroc16/skunk_works | refs/heads/master | google_appengine/google/storage/speckle/python/api/rdbms_googleapi.py | 13 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
Chilledheart/chromium | refs/heads/master | build/android/devil/android/md5sum.py | 7 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import posixpath
import re
from devil.android import device_errors
from devil.utils import cmd_helper
from pylib import constants
MD5SUM_DEVICE_L... |
dongjoon-hyun/tensorflow | refs/heads/master | tensorflow/python/eager/tensor_test.py | 2 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
daira/tahoe-lafs-debian | refs/heads/master | src/allmydata/key_generator.py | 5 |
import os
import time
from foolscap.api import Referenceable, Tub
from zope.interface import implements
from twisted.internet import reactor
from twisted.application import service
from allmydata.util import log, fileutil
from pycryptopp.publickey import rsa
from allmydata.interfaces import RIKeyGenerator
class Key... |
tagatac/scrapy | refs/heads/master | tests/test_logformatter.py | 80 | import unittest
import six
from scrapy.spiders import Spider
from scrapy.http import Request, Response
from scrapy.item import Item, Field
from scrapy.logformatter import LogFormatter
class CustomItem(Item):
name = Field()
def __str__(self):
return "name: %s" % self['name']
class LoggingContribTe... |
Dhivyap/ansible | refs/heads/devel | lib/ansible/modules/network/dellos6/dellos6_facts.py | 50 | #!/usr/bin/python
#
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# Copyright (c) 2016 Dell 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
ANSIBLE_METADATA = {'metadata_versio... |
jlspyaozhongkai/Uter | refs/heads/master | third_party_build/Python-2.7.9/lib/python2.7/json/tests/test_decode.py | 31 | import decimal
from StringIO import StringIO
from collections import OrderedDict
from json.tests import PyTest, CTest
class TestDecode(object):
def test_decimal(self):
rval = self.loads('1.1', parse_float=decimal.Decimal)
self.assertTrue(isinstance(rval, decimal.Decimal))
self.assertEqual(... |
trhoden/ceph-deploy | refs/heads/master | ceph_deploy/tests/parser/test_calamari.py | 3 | import pytest
from ceph_deploy.cli import get_parser
from ceph_deploy.tests.util import assert_too_few_arguments
class TestParserCalamari(object):
def setup(self):
self.parser = get_parser()
def test_calamari_help(self, capsys):
with pytest.raises(SystemExit):
self.parser.parse_... |
malrpy/MissionPlanner | refs/heads/master | ExtLibs/Mavlink/pymavlink/generator/lib/minixsv/minixsvWrapper.py | 79 | #!/usr/local/bin/python
import sys
import getopt
from ..genxmlif import GenXmlIfError
from xsvalErrorHandler import ErrorHandler, XsvalError
from ..minixsv import *
from pyxsval import parseAndValidate
##########################################
# minixsv Wrapper for calling mi... |
facelessuser/ColorHelper | refs/heads/master | tests/validate_json_format.py | 13 | """
Validate JSON format.
Licensed under MIT
Copyright (c) 2012-2015 Isaac Muse <isaacmuse@gmail.com>
"""
import re
import codecs
import json
RE_LINE_PRESERVE = re.compile(r"\r?\n", re.MULTILINE)
RE_COMMENT = re.compile(
r'''(?x)
(?P<comments>
/\*[^*]*\*+(?:[^/*][^*]*\*+)*/ # multi-line comme... |
gwsu2008/automation | refs/heads/master | python/python-sequential.py | 1 | import time
import boto3
class VolumesSequential(object):
"""Finds total volume size for all EC2 instances"""
def __init__(self):
self.ec2 = boto3.resource('ec2')
def instance_volumes(self, instance):
"""
Finds total size of the EBS volumes attached
to an EC2 instance
... |
jolevq/odoopub | refs/heads/master | addons/anonymization/__openerp__.py | 119 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
paulmadore/Eric-IDE | refs/heads/master | 6-6.0.9/eric/ThirdParty/Pygments/pygments/lexers/__init__.py | 2 | # -*- coding: utf-8 -*-
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import types
import fnmatch
from os.path import basename
from pygments.lexers._mapping import LEX... |
mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | refs/heads/master | PyFoam/Applications/CommonPlotLines.py | 2 |
"""
Class that implements common functionality for collecting plot-lines
"""
import re
from os import path
from optparse import OptionGroup
from PyFoam.Basics.CustomPlotInfo import readCustomPlotInfo,resetCustomCounter
from PyFoam.ThirdParty.six import print_
ruleList=[]
def addRegexpInclude(option,opt,value,parse... |
xadahiya/django | refs/heads/master | tests/template_tests/syntax_tests/test_named_endblock.py | 521 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class NamedEndblockTests(SimpleTestCase):
@setup({'namedendblocks01': '1{% block first %}_{% block second %}'
'2{% endblock second %}_{% endblock first %}3'})
def ... |
rajathkumarmp/BinPy | refs/heads/develop | BinPy/tests/expr_tests.py | 6 | from BinPy import *
from nose.tools import with_setup, nottest
def parse_test():
assert Expr('A & B').parse() == 'AND(B, A)'
assert Expr('(A & B)').parse() == 'AND(B, A)'
assert Expr('(~A) & B').parse() == 'AND(B, NOT(A))'
assert Expr('~(A & B)').parse() == 'NAND(B, A)'
assert E... |
hcsturix74/django | refs/heads/master | tests/template_tests/syntax_tests/test_width_ratio.py | 342 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from django.utils import six
from ..utils import setup
class WidthRatioTagTests(SimpleTestCase):
libraries = {'custom': 'template_tests.templatetags.custom'}
@setup({'widthratio01': '{% widthratio a b 0 %}'})
def test... |
MakeHer/edx-platform | refs/heads/dashboard.2 | lms/djangoapps/certificates/migrations/0007_certificateinvalidation.py | 53 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
from django.conf import settings
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODE... |
tenstream/tenstream | refs/heads/master | python/bmc_example.py | 1 | #!/bin/env python3
from pylab import *
from mpi4py import MPI
from python.py_boxmc import m_py_boxmc as P
def delta_scale(kabs, ksca, g, f=None, max_g=None):
import numpy as np
if f is None:
f = g**2
if max_g is not None:
f = (max_g-g) / (max_g-1)
if g < max_g:
return n... |
GbalsaC/bitnamiP | refs/heads/master | venv/lib/python2.7/site-packages/social/storage/sqlalchemy_orm.py | 53 | """SQLAlchemy models for Social Auth"""
import base64
import six
import json
try:
import transaction
except ImportError:
transaction = None
from sqlalchemy import Column, Integer, String
from sqlalchemy.exc import IntegrityError
from sqlalchemy.types import PickleType, Text
from sqlalchemy.schema import Uniqu... |
rhelmot/idalink | refs/heads/master | example.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from idalink import idalink
# We want debug messages for now
import logging
idalink_log = logging.getLogger('idalink')
idalink_log.addHandler(logging.StreamHandler())
idalink_log.setLevel(logging.DEBUG)
# Let's do some testing with ... |
Estmator/EstmatorApp | refs/heads/development | estmator_project/est_profile/views.py | 6445 | from django.shortcuts import render
# Create your views here.
|
40223119/2015w13 | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/multiprocessing/dummy/connection.py | 707 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... |
uberamd/NGECore2 | refs/heads/master | scripts/object/weapon/ranged/pistol/pistol_fwg5.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/mobile/npc_dressed_corellia_bannoc_gnoc.py | 85615 | import sys
def setup(core, object):
return |
Comunitea/OCB | refs/heads/8.0 | addons/project_timesheet/report/task_report.py | 336 | # -*- 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... |
kingvuplus/boom | refs/heads/master | lib/python/Components/Converter/EtAnalogClock.py | 2 | # Embedded file name: /usr/lib/enigma2/python/Components/Converter/EtAnalogClock.py
from Converter import Converter
from time import localtime, strftime
from Components.Element import cached
class EtAnalogClock(Converter, object):
DEFAULT = 0
OMA_SEC = 1
OMA_MIN = 2
OMA_HOUR = 3
def __i... |
BT-rmartin/odoo | refs/heads/BT_2900 | addons/website_crm_partner_assign/models/__init__.py | 1273 | import res_partner
|
AllanYangZhou/oppia | refs/heads/develop | core/domain/fs_domain_test.py | 23 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
istio/envoy | refs/heads/master | test/extensions/filters/network/kafka/protocol/launcher.py | 6 | #!/usr/bin/python
# Launcher for generating Kafka protocol tests.
import source.extensions.filters.network.kafka.protocol.generator as generator
import sys
import os
def main():
"""
Kafka test generator script
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Generates tests from Kafka protocol specification.
Usage:
launc... |
jsteemann/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/distutils/sysconfig.py | 90 | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... |
Ingenico-ePayments/connect-sdk-python3 | refs/heads/master | ingenico/connect/sdk/merchant/__init__.py | 128 | #
# This file was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1
#
|
EricNeedham/assignment-1 | refs/heads/master | venv/lib/python2.7/site-packages/pip/commands/__init__.py | 476 | """
Package containing all pip commands
"""
from pip.commands.bundle import BundleCommand
from pip.commands.completion import CompletionCommand
from pip.commands.freeze import FreezeCommand
from pip.commands.help import HelpCommand
from pip.commands.list import ListCommand
from pip.commands.search import SearchComman... |
statik/grr | refs/heads/master | server/data_server/store.py | 1 | #!/usr/bin/env python
"""Data store proxy for a data server."""
import base64
import functools
import os
import threading
import time
import uuid
import logging
from grr.lib import access_control
from grr.lib import config_lib
from grr.lib import data_store
from grr.lib import utils
from grr.lib.data_stores import... |
RIOT-OS/RIOT | refs/heads/master | tests/driver_at86rf2xx_aes/tests-with-config/01-run.py | 10 | #!/usr/bin/env python3
import sys
from testrunner import run
def testfunc(child):
child.expect('START')
child.expect('ECB test 1 done')
child.expect('ECB test 2 done')
child.expect('CBC test 1 done')
child.expect('CBC test 2 done')
child.expect('CBC test 3 done')
child.expect('SUCCESS')
... |
kylemanna/tweepy | refs/heads/master | tweepy/streaming.py | 34 | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import, print_function
import logging
import requests
from requests.exceptions import Timeout
from thre... |
yceruto/django | refs/heads/master | tests/admin_custom_urls/tests.py | 5 | from __future__ import unicode_literals
from django.contrib.admin.utils import quote
from django.core.urlresolvers import reverse
from django.template.response import TemplateResponse
from django.test import TestCase
from django.test.utils import override_settings
from .models import Action, Person, Car
@override_s... |
tersmitten/ansible | refs/heads/devel | test/units/modules/network/enos/enos_module.py | 31 | # Copyright (C) 2017 Lenovo, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansi... |
ehealthafrica-ci/rapidsms-decisiontree-app | refs/heads/develop | setup.py | 2 | from setuptools import setup, find_packages
setup(
name='rapidsms-decisiontree-app',
version=__import__('decisiontree').__version__,
author='Caktus Consulting Group',
author_email='solutions@caktusgroup.com',
packages=find_packages(),
include_package_data=True,
url='http://github.com/caktu... |
badreddinetahir/pwn_plug_sources | refs/heads/master | src/miranda/miranda.py | 8 | #!/usr/bin/env python
################################
# Interactive UPNP application #
# Craig Heffner #
# www.sourcesec.com #
# 07/16/2008 #
################################
try:
import sys,os
from socket import *
from urllib2 import URLError, HTTPError
from platform i... |
mtconley/turntable | refs/heads/master | test/lib/python2.7/site-packages/scipy/optimize/nnls.py | 116 | from __future__ import division, print_function, absolute_import
from . import _nnls
from numpy import asarray_chkfinite, zeros, double
__all__ = ['nnls']
def nnls(A, b):
"""
Solve ``argmin_x || Ax - b ||_2`` for ``x>=0``. This is a wrapper
for a FORTAN non-negative least squares solver.
Parameters... |
dgarros/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ansible_tower/tower_label.py | 36 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# 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 opti... |
InAnimaTe/CouchPotatoServer | refs/heads/master | libs/oauth2/clients/smtp.py | 884 | """
The MIT License
Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the ... |
sh1nu11bi/sulley | refs/heads/master | utils/ida_fuzz_library_extender.py | 6 | #!c:\python\python.exe
#
# Aaron Portnoy
# TippingPoint Security Research Team
# (C) 2007
#
########################################################################################################################
def get_string( ea):
str_type = GetStringType(ea)
if str_type == 0:
string_bu... |
p12tic/awn-extras | refs/heads/master | applets/maintained/cairo-clock/cairo-clock.py | 1 | #!/usr/bin/python
# Copyright (C) 2008 - 2010 onox <denkpadje@gmail.com>
#
# 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, version 2 of the License.
#
# This program is distributed in the hope ... |
stypr/stypr_crypt | refs/heads/master | crypto.py | 1 | import random
def stypr_encrypt(d):
try:
k = random.randint(1, 1024)
n = 0
f = ""
for i in range(len(d)):
n += 1
c = (n * n) ^ 0x3E
f += ("00000" + hex(int(oct(ord(d[i]) ^ (k ^ 0xAFE43 ^ 0x399AA3 ^ c))))[2:])[-6:]
f = (("000" + hex(k ^ 0xA9F ^ 0xE77E)[2:])[-4:] + f)[::-1].upper()
return f
except... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.