repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
tiagocoutinho/bliss | refs/heads/master | bliss/controllers/keithley.py | 1 | # -*- coding: utf-8 -*-
#
# This file is part of the bliss project
#
# Copyright (c) 2016 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
"""
Keithley meters.
YAML_ configuration example:
.. code-block:: yaml
plugin: keithley # (1)
name: k_ctrl_1 ... |
beni55/gunicorn | refs/heads/master | scripts/update_thanks.py | 22 | #!/usr/bin/env python
# Usage: git log --format="%an <%ae>" | python update_thanks.py
# You will get a result.txt file, you can work with the file (update, remove, ...)
#
# Install
# =======
# pip install validate_email pyDNS
#
from __future__ import print_function
import os
import sys
from validate_email import valid... |
wallyworld/juju | refs/heads/develop | acceptancetests/jujupy/client.py | 1 | # This file is part of JujuPy, a library for driving the Juju CLI.
# Copyright 2013-2017 Canonical Ltd.
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the Lesser GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# This program is di... |
DURAARK/duraark-pointcloud-viewer | refs/heads/master | lastools/ArcGIS_toolbox/scripts/lasoverage.py | 1 | #
# lasoverage.py
#
# (c) 2013, martin isenburg - http://rapidlasso.com
# rapidlasso GmbH - fast tools to catch reality
#
# uses lasoverage.exe to mark or remove LiDAR point
# with large scan angles in the flightline overlap
#
# LiDAR input: LAS/LAZ/BIN/TXT/SHP/BIL/ASC/DTM
# LiDAR output: LAS/LAZ/BIN/TXT
#
# for... |
sanjeevtripurari/hue | refs/heads/master | apps/jobsub/src/jobsub/__init__.py | 1198 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
amahabal/PySeqsee | refs/heads/master | farg/apps/seqsee/structure_utils.py | 1 | # Copyright (C) 2011, 2012 Abhijit Mahabal
#
# 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 distribu... |
mozilla/popcorn_maker | refs/heads/master | vendor-local/lib/python/rsa/bigfile.py | 5 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Unl... |
Jeff-Tian/mybnb | refs/heads/master | Python27/Lib/site-packages/pip/download.py | 279 | from __future__ import absolute_import
import cgi
import email.utils
import hashlib
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
try:
import ssl # noqa
HAS_TLS = True
except ImportError:
HAS_TLS = False
from pip._... |
akjohnson/django-mailchimp2 | refs/heads/master | mailchimp2/util.py | 1 | import mailchimp
from django.conf import settings
def get_mailchimp_api():
"""
Uses the MAILCHIMP_API_KEY setting to create a connection to the
mail chimp API.
"""
return mailchimp.Mailchimp(settings.MAILCHIMP_API_KEY)
|
addition-it-solutions/project-all | refs/heads/master | addons/l10n_pl/__openerp__.py | 8 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 - now Grzegorz Grzelak grzegorz.grzelak@openglobe.pl
# All Rights Reserved
# $Id$
#
# This program is free software: you can redistrib... |
LukeC92/iris | refs/heads/latest | lib/iris/tests/unit/cube/test_CubeList.py | 3 | # (C) British Crown Copyright 2014 - 2017, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... |
doganov/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_error_module.py | 146 | """
Tests for ErrorModule and NonStaffErrorModule
"""
import unittest
from xmodule.tests import get_test_system
from xmodule.error_module import ErrorDescriptor, ErrorModule, NonStaffErrorDescriptor
from xmodule.modulestore.xml import CourseLocationManager
from opaque_keys.edx.locations import SlashSeparatedCourseKey, ... |
ryanbackman/zulip | refs/heads/master | zerver/migrations/0011_remove_guardian.py | 41 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db.backends.postgresql_psycopg2.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.db import models, migrations, connection
from django.conf import settings
# Translate the UserProfile fields back ... |
sandeepkoduri/GAE-html-to-pdf | refs/heads/master | libs/html5lib/__init__.py | 154 | """
HTML parsing library based on the WHATWG "HTML5"
specification. The parser is designed to be compatible with existing
HTML found in the wild and implements well-defined error recovery that
is largely compatible with modern desktop web browsers.
Example usage:
import html5lib
f = open("my_document.html")
tree = ht... |
jesseward/py64 | refs/heads/master | tests/test_prg_loader.py | 1 | import unittest
from StringIO import StringIO
from py64.loaders.prg import Loader
class PrgTest(unittest.TestCase):
def setUp(self):
file_bytes = StringIO(
'\x01\x08\x0f\x08\xcf\x07\x9e\x32\x30\x36\x35\x20\x41\x42\x43\x00'
)
self.file_name = 'TestFileName.PRG'
self.l... |
eunchong/build | refs/heads/master | third_party/twisted_10_2/twisted/test/crash_test_dummy.py | 62 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.python import components
from zope.interface import implements, Interface
def foo():
return 2
class X:
def __init__(self, x):
self.x = x
def do(self):
#print 'X',self.x,'doing!'
pass
... |
rvraghav93/scikit-learn | refs/heads/master | benchmarks/bench_lasso.py | 111 | """
Benchmarks of Lasso vs LassoLars
First, we fix a training set and increase the number of
samples. Then we plot the computation time as function of
the number of samples.
In the second benchmark, we increase the number of dimensions of the
training set. Then we plot the computation time as function of
the number o... |
hryamzik/ansible | refs/heads/devel | lib/ansible/modules/packaging/language/cpanm.py | 58 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Franck Cuny <franck@lumberjaph.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',
... |
neurospin/pylearn-epac | refs/heads/master | epac/configuration.py | 1 | # -*- coding: utf-8 -*-
"""
Created on Thu May 23 10:04:34 2013
@author: edouard.duchesnay@cea.fr
"""
## ================================= ##
## == Configuration class == ##
## ================================= ##
import numpy as np
class conf:
TRACE_TOPDOWN = False
REDUCE_TAB_FILENAME = "reduce_tab... |
mm112287/2015cda_g8 | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/_dummy_thread.py | 742 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... |
openstack/neutron | refs/heads/master | neutron/tests/functional/plugins/ml2/drivers/ovn/mech_driver/ovsdb/test_ovn_db_resources.py | 2 | # Copyright 2020 Red Hat, 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 agre... |
bigzz/linux | refs/heads/master | tools/perf/scripts/python/call-graph-from-postgresql.py | 758 | #!/usr/bin/python2
# call-graph-from-postgresql.py: create call-graph from postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free So... |
takaaptech/sky_engine | refs/heads/master | third_party/re2/re2/make_unicode_casefold.py | 218 | #!/usr/bin/python
# coding=utf-8
#
# Copyright 2008 The RE2 Authors. All Rights Reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# See unicode_casefold.h for description of case folding tables.
"""Generate C++ table for Unicode case folding."""
import u... |
MatthewWilkes/django | refs/heads/master | django/core/management/commands/dumpdata.py | 305 | from collections import OrderedDict
from django.apps import apps
from django.core import serializers
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, router
class Command(BaseCommand):
help = ("Output the contents of the database as a fixture of the given ... |
squadran2003/PYTHON-DIRECTORY-WATCHER | refs/heads/master | lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py | 1776 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
wakatime/sublime-wakatime | refs/heads/master | packages/wakatime/packages/py27/pygments/lexers/templates.py | 4 | # -*- coding: utf-8 -*-
"""
pygments.lexers.templates
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for various template engines' markup.
:copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexers.html import HtmlLexer, XmlLex... |
BeyondTheClouds/enoslib | refs/heads/master | enoslib/service/emul/utils.py | 1 | import copy
from typing import List, Optional, Set
from enoslib.api import run_ansible
from enoslib.utils import _check_tmpdir
from enoslib.constants import TMP_DIRNAME
import logging
from collections import defaultdict
from itertools import groupby
from operator import attrgetter
import os
from enoslib.objects import... |
brianzelip/militarization | refs/heads/gh-pages | css/basscss/node_modules/pygmentize-bundled/vendor/pygments/pygments/styles/vs.py | 135 | # -*- coding: utf-8 -*-
"""
pygments.styles.vs
~~~~~~~~~~~~~~~~~~
Simple style with MS Visual Studio colors.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Co... |
MSusik/invenio | refs/heads/master | invenio/modules/upgrader/checks.py | 4 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your opt... |
googleapis/python-billingbudgets | refs/heads/master | google/cloud/billing/budgets_v1beta1/services/budget_service/client.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... |
Hope6537/hope-tactical-equipment | refs/heads/master | hope-python-script/network/windows/screenshotter.py | 2 | # coding=utf-8
"""
截取屏幕快照
"""
import time
import win32api
import win32con
import win32gui
import win32ui
def driver():
# 获得桌面窗口的句柄
hdesktop = win32gui.GetDesktopWindow()
# 获取所有显示器的像素尺寸
width = win32api.GetSystemMetrics(win32con.SM_CXVIRTUALSCREEN)
height = win32api.GetSystemMetrics(win32con.SM_C... |
riklaunim/django-custom-multisite | refs/heads/master | tests/regressiontests/localflavor/fi/tests.py | 33 | from django.contrib.localflavor.fi.forms import (FIZipCodeField,
FISocialSecurityNumber, FIMunicipalitySelect)
from django.test import SimpleTestCase
class FILocalFlavorTests(SimpleTestCase):
def test_FIMunicipalitySelect(self):
f = FIMunicipalitySelect()
out = u'''<select name="municipalitie... |
rachelalbert/CS294-26_code | refs/heads/master | project3_code/part_1/align_images.py | 1 | import math
import numpy as np
import matplotlib.pyplot as plt
import skimage.transform as sktr
from unsharp import *
def get_points(im1, im2):
print('Please select 2 points in each image for alignment.')
plt.imshow(im1)
p1, p2 = plt.ginput(2)
plt.close()
plt.imshow(im2)
p3, p4 = plt.ginput(2)... |
vincentbernat/feedhq | refs/heads/master | feedhq/reader/migrations/0003_auto__add_field_authtoken_client__add_field_authtoken_user_agent__chg_.py | 1 | # -*- 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 'AuthToken.client'
db.add_column(u'reader_authtoken', 'client',
self.gf... |
nvoron23/arangodb | refs/heads/devel | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32comext/mapi/demos/mapisend.py | 17 | #!/usr/bin/env python
"""module to send mail with Extended MAPI using the pywin32 mapi wrappers..."""
# this was based on Jason Hattingh's C++ code at http://www.codeproject.com/internet/mapadmin.asp
# written by David Fraser <davidf at sjsoft.com> and Stephen Emslie <stephene at sjsoft.com>
# you can test this by ch... |
suyashphadtare/sajil-erp | refs/heads/develop | erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py | 31 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import add_days, getdate, cint
from frappe import throw, _
from erpnext.utilities.transaction_base import Transacti... |
zeeman/cyder | refs/heads/master | vendor-local/src/django-tastypie/tests/core/tests/cache.py | 20 | import time
from django.core.cache import cache
from django.test import TestCase
from tastypie.cache import NoCache, SimpleCache
class NoCacheTestCase(TestCase):
def tearDown(self):
cache.delete('foo')
cache.delete('moof')
super(NoCacheTestCase, self).tearDown()
def test_get(self):
... |
facundobatista/logassert | refs/heads/master | logassert/logassert.py | 1 | # Copyright 2015-2020 Facundo Batista
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License version 3, as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY W... |
Nettacker/Nettacker | refs/heads/master | lib/language/messages_hy.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
def all_messages():
"""
keep all messages in hy
Returns:
all messages in JSON
"""
return \
{
"scan_started": "Nettacker շարժիչը սկսվեց ...",
"options": "python nettacker.py [ընտրանքներ]",
"help_menu"... |
naturali/tensorflow | refs/heads/r0.11 | tensorflow/python/kernel_tests/dynamic_partition_op_test.py | 29 | # 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... |
jss-emr/openerp-7-src | refs/heads/master | openerp/report/render/rml2txt/rml2txt.py | 442 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009, P. Christeas, Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or ... |
keithrob/openshift-iojs | refs/heads/master | bin/iojs/lib/node_modules/npm/node_modules/node-gyp/gyp/gyptest.py | 1752 | #!/usr/bin/env python
# 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.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/pylint/test/input/func_return_outside_func.py | 16 | """This is gramatically correct, but it's still a SyntaxError"""
__revision__ = None
return
|
adsznzhang/learntosolveit | refs/heads/version1 | languages/python/web_scan_web.py | 7 | import re
import urllib
regex = re.compile(r'href="([^"]+)"')
def matcher(url, max=10):
"""Print the first several URL references in the given URL"""
data = urllib.urlopen(url).read()
hits = regex.findall(data)
for hit in hits[:max]:
print urllib.basejoin(url,hit)
matcher("http://uthcode.saro... |
splunk/splunk-app-twitter | refs/heads/master | twitter2/bin/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... |
mdpuma/nDeploy | refs/heads/master | scripts/cpanel_suspension_functions_hook_post.py | 1 | #!/usr/bin/env python
import sys
import json
import subprocess
__author__ = "Anoop P Alias"
__copyright__ = "Copyright Anoop P Alias"
__license__ = "GPL"
__email__ = "anoopalias01@gmail.com"
installation_path = "/opt/nDeploy" # Absolute Installation Path
cpjson = json.load(sys.stdin)
mydict = cpjson["data"]
hoo... |
Aorjoa/aiyara-ceph-dash | refs/heads/aiyara | .tox/py27/lib/python2.7/site-packages/dateutil/tz/__init__.py | 105 | from .tz import *
__all__ = ["tzutc", "tzoffset", "tzlocal", "tzfile", "tzrange",
"tzstr", "tzical", "tzwin", "tzwinlocal", "gettz"]
|
django-oscar/django-oscar-sagepay-direct | refs/heads/master | oscar_sagepay/migrations/0001_initial.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'RequestResponse'
db.create_table(u'oscar_sagepay_requestr... |
stylianos-kampakis/scikit-learn | refs/heads/master | sklearn/utils/testing.py | 71 | """Testing utilities."""
# Copyright (c) 2011, 2012
# Authors: Pietro Berkes,
# Andreas Muller
# Mathieu Blondel
# Olivier Grisel
# Arnaud Joly
# Denis Engemann
# License: BSD 3 clause
import os
import inspect
import pkgutil
import warnings
import sys
import re
import platf... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/tangible/furniture/jedi/shared_frn_all_banner_light.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/furniture/jedi/shared_frn_all_banner_light.iff"
result.attribute_te... |
Miller547719886/kopi6.com | refs/heads/gh-pages | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | #!/usr/bin/env python
# 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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... |
thaumos/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_vmpool_facts.py | 55 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
lgp171188/fjord | refs/heads/master | vendor/packages/GitPython/lib/git/cmd.py | 31 | # cmd.py
# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors
#
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os, sys
import subprocess
import re
from utils import *
from errors import GitCommandError
# Ena... |
zhaoluxyz/Hugula | refs/heads/master | Client/tools/site-packages/xlrd/biffh.py | 8 | # -*- coding: cp1252 -*-
##
# Support module for the xlrd package.
#
# <p>Portions copyright © 2005-2010 Stephen John Machin, Lingfo Pty Ltd</p>
# <p>This module is part of the xlrd package, which is released under a BSD-style licence.</p>
##
# 2010-03-01 SJM Reading SCL record
# 2010-03-01 SJM Added more record IDs ... |
forging2012/taiga-back | refs/heads/master | taiga/projects/wiki/migrations/0002_remove_wikipage_watchers.py | 8 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import connection
from django.db import models, migrations
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.management import update_all_contenttypes
def create_notifications(apps, schema_editor):... |
sparkslabs/kamaelia | refs/heads/master | Code/Python/Kamaelia/Kamaelia/Apps/Europython09/BB/Support.py | 6 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... |
sergey-shandar/autorest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyArray/auto_rest_swagger_bat_array_service/models/__init__.py | 32 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
tonk/ansible | refs/heads/devel | test/integration/targets/collections/collection_root_user/ansible_collections/testns/testcoll/plugins/filter/myfilters2.py | 66 | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
def testfilter2(data):
return "{0}_via_testfilter2_from_userdir".format(data)
class FilterModule(object):
def filters(self):
return {
'testfilter2': testfilter2
}
|
naveensuryakumar/json | refs/heads/master | third-party/gtest-1.7.0/scripts/pump.py | 2471 | #!/usr/bin/env python
#
# Copyright 2008, 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... |
gtback/jekyll-hydra | refs/heads/master | config.py | 1 | SQLALCHEMY_DATABASE_URI = 'sqlite:///default.db'
|
jiachenning/odoo | refs/heads/8.0 | addons/l10n_nl/__init__.py | 424 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009 Veritos - Jan Verlaan - www.veritos.nl
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# con... |
Yukarumya/Yukarum-Redfoxes | refs/heads/master | python/mozbuild/mozbuild/action/output_searchplugins_list.py | 1 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import sys
import json
engines = []
locale = sys.argv[2]
with open(sys.argv[1]) as f:
searchinfo = json.load(f)
# ... |
TerraFERMA/benchmarks | refs/heads/master | benchmarks/kramer/1fs/1.0D/solution.py | 1 |
from math import pi, cos, cosh, sinh, exp
from numpy import interp
wavelengthfactor = 1.0
dx = 1./80. # nond
eta0 = 1000. # m
rho0 = 4500. # kg/m^3
mu0 = 1.e21 # Pas
g = 10. # m/s^2
D = 3.e6 # m
def k():
wavelength = wavelengthfactor*D
return 2.0*pi/wavelength
def nond_k():
wavelength = wavelengthf... |
LethusTI/supportcenter | refs/heads/master | vendor/django/tests/modeltests/transactions/tests.py | 26 | from __future__ import with_statement, absolute_import
from django.db import connection, transaction, IntegrityError
from django.test import TransactionTestCase, skipUnlessDBFeature
from .models import Reporter
class TransactionTests(TransactionTestCase):
def create_a_reporter_then_fail(self, first, last):
... |
SrNetoChan/QGIS | refs/heads/master | tests/src/python/test_qgsdefaultvalue.py | 45 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsDefaultValue.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
... |
GenericStudent/home-assistant | refs/heads/dev | tests/components/modbus/test_modbus_switch.py | 5 | """The tests for the Modbus switch component."""
from datetime import timedelta
import pytest
from homeassistant.components.modbus.const import CALL_TYPE_COIL, CONF_COILS
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import CONF_NAME, CONF_SLAVE, STATE_OFF, STATE_ON
fro... |
ffallrain/2x2x2-rubiks-puzzle | refs/heads/master | 2x2_interface.py | 1 | #!/usr/bin/python
import sys,os
import pickle
####### Define Color ######
color={ 'r' :0, 'o' :1, 'g' :2, 'b' :3, 'w' :4, 'y' :5,
'red':0, 'orange':1, 'green':2, 'blue':3, 'white':4, 'yellow':5,
'black': 4, 'B' :4, 'purple': 1, 'p':1
}
####### Input Start State #######
os.system("c... |
cobalys/django | refs/heads/master | tests/regressiontests/introspection/tests.py | 8 | from __future__ import absolute_import,unicode_literals
from functools import update_wrapper
from django.db import connection
from django.test import TestCase, skipUnlessDBFeature, skipIfDBFeature
from .models import Reporter, Article
#
# The introspection module is optional, so methods tested here might raise
# No... |
infobloxopen/infoblox-netmri | refs/heads/master | infoblox_netmri/api/broker/v3_7_0/access_search_broker.py | 14 | from ..broker import Broker
class AccessSearchBroker(Broker):
controller = "access_searches"
def show(self, **kwargs):
"""Shows the details for the specified access search.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``requ... |
vivianli32/TravelConnect | refs/heads/master | flask/lib/python3.4/site-packages/sqlalchemy/ext/declarative/clsregistry.py | 23 | # ext/declarative/clsregistry.py
# Copyright (C) 2005-2014 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
"""Routines to handle the string class registry used by declarative.
... |
gmacchi93/serverInfoParaguay | refs/heads/master | apps/venv/lib/python2.7/site-packages/django/contrib/auth/handlers/modwsgi.py | 537 | from django import db
from django.contrib import auth
from django.utils.encoding import force_bytes
def check_password(environ, username, password):
"""
Authenticates against Django's auth database
mod_wsgi docs specify None, True, False as return value depending
on whether the user exists and authen... |
hanziwang/clamav-devel | refs/heads/master | win32/clamav-for-windows/sigui/wxWidgets-2.9.1/docs/doxygen/scripts/c_tools.py | 16 | """
C bindings generator
Author: Luke A. Guest
"""
import os
from common import *
class CBuilder:
def __init__(self, doxyparse, outputdir):
self.doxyparser = doxyparse
self.output_dir = outputdir
def make_bindings(self):
output_dir = os.path.abspath(os.path.join(self.o... |
mlaitinen/odoo | refs/heads/8.0 | addons/lunch/report/order.py | 377 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... |
CallaJun/hackprince | refs/heads/master | bp_includes/external/wtforms/ext/dateutil/fields.py | 119 | """
A DateTimeField and DateField that use the `dateutil` package for parsing.
"""
from __future__ import unicode_literals
from dateutil import parser
from wtforms.fields import Field
from wtforms.validators import ValidationError
from wtforms.widgets import TextInput
__all__ = (
'DateTimeField', 'DateField',
)... |
yeyanchao/calibre | refs/heads/master | src/calibre/gui2/bars.py | 2 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from PyQt4.Qt... |
catapult-project/catapult | refs/heads/master | third_party/google-endpoints/Crypto/SelfTest/Hash/test_SHA256.py | 116 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/test_SHA256.py: Self-test for the SHA-256 hash function
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that... |
BlueBrain/bluima | refs/heads/master | modules/bluima_utils/src/main/resources/bart/brat-v1.3_Crunchy_Frog/server/lib/simplejson-2.1.5/simplejson/tests/test_pass1.py | 259 | from unittest import TestCase
import simplejson as json
# from http://json.org/JSON_checker/test/pass1.json
JSON = r'''
[
"JSON Test Pattern pass1",
{"object with 1 member":["array with 1 element"]},
{},
[],
-42,
true,
false,
null,
{
"integer": 1234567890,
"real": -... |
partofthething/home-assistant | refs/heads/dev | tests/components/websocket_api/test_http.py | 3 | """Test Websocket API http module."""
from datetime import timedelta
from unittest.mock import patch
from aiohttp import WSMsgType
import pytest
from homeassistant.components.websocket_api import const, http
from homeassistant.util.dt import utcnow
from tests.common import async_fire_time_changed
@pytest.fixture
d... |
talk-to/PjSip-Repo | refs/heads/master | tests/pjsua/scripts-sendto/200_ice_success_2.py | 20 | # $Id$
import inc_sip as sip
import inc_sdp as sdp
sdp = \
"""
v=0
o=- 0 0 IN IP4 127.0.0.1
s=pjmedia
c=IN IP4 127.0.0.1
t=0 0
m=audio 4000 RTP/AVP 0 101
a=rtcp:4382 IN IP4 192.168.0.4
a=ice-ufrag:1234
a=ice-pwd:5678
a=rtpmap:0 PCMU/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=candidate:XX 1 UDP... |
0xwindows/InfoLeak | refs/heads/master | test/test_console_help.py | 10 | import os
from unittest.case import SkipTest
if os.name == "nt":
raise SkipTest("Skipped on Windows.")
import libmproxy.console.help as help
class DummyLoop:
def __init__(self):
self.widget = None
class DummyMaster:
def __init__(self):
self.loop = DummyLoop()
def make_view(self):
... |
huawei-cloud/compass-adapters | refs/heads/master | chef/cookbooks/python/src/11/interacting_with_http_services_as_a_client/example4.py | 5 | # Example of a HEAD request
import requests
resp = requests.head('http://www.python.org/index.html')
status = resp.status_code
last_modified = resp.headers['last-modified']
content_type = resp.headers['content-type']
content_length = resp.headers['content-length']
print(status)
print(last_modified)
print(content_ty... |
CameronLonsdale/sec-tools | refs/heads/master | python2/lib/python2.7/site-packages/setuptools/command/develop.py | 130 | from distutils.util import convert_path
from distutils import log
from distutils.errors import DistutilsError, DistutilsOptionError
import os
import glob
import io
import six
from pkg_resources import Distribution, PathMetadata, normalize_path
from setuptools.command.easy_install import easy_install
from setuptools i... |
frekenbok/frekenbok | refs/heads/master | accountant/tests/test_misc.py | 1 | import json
from datetime import date, datetime
from decimal import Decimal
from os.path import abspath, dirname, join
from unittest import TestCase
from testfixtures import LogCapture
from pytz import timezone
from django.contrib.auth.models import User
from moneyed import RUB
from accountant.misc.fns_parser import ... |
fenginx/django | refs/heads/master | tests/i18n/exclude/__init__.py | 129 | # This package is used to test the --exclude option of
# the makemessages and compilemessages management commands.
# The locale directory for this app is generated automatically
# by the test cases.
from django.utils.translation import gettext as _
# Translators: This comment should be extracted
dummy1 = _("This is a... |
bloff/ZeroNet | refs/heads/master | src/lib/pybitcointools/bitcoin/deterministic.py | 24 | from .main import *
import hmac
import hashlib
from binascii import hexlify
# Electrum wallets
def electrum_stretch(seed):
return slowsha(seed)
# Accepts seed or stretched seed, returns master public key
def electrum_mpk(seed):
if len(seed) == 32:
seed = electrum_stretch(seed)
return privkey_to... |
xfournet/intellij-community | refs/heads/master | python/testData/completion/relativeFromImportInNamespacePackage2/nspkg1/a.py | 79 | from . import f<caret> |
jeffdwyatt/taiga-back | refs/heads/master | taiga/projects/migrations/0019_auto_20150311_0821.py | 26 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import djorm_pgarray.fields
class Migration(migrations.Migration):
dependencies = [
('projects', '0018_auto_20150219_1606'),
]
operations = [
migrations.AlterField(
model... |
VigTech/Vigtech-Services | refs/heads/master | env/lib/python2.7/site-packages/psycopg2/pool.py | 31 | """Connection pooling for psycopg2
This module implements thread-safe (and not) connection pools.
"""
# psycopg/pool.py - pooling code for psycopg
#
# Copyright (C) 2003-2010 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Less... |
jeroyang/automapper | refs/heads/master | automapper/automapper.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
import re
try:
# python 3.4+
from html import unescape
except:
# Python 2.6-2.7
from HTMLParser import HTMLParser
h = ... |
liveblog/liveblog | refs/heads/master | server/liveblog/blogs/blogslist.py | 3 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import loggin... |
LethusTI/supportcenter | refs/heads/master | vendor/django/tests/regressiontests/inspectdb/tests.py | 25 | from StringIO import StringIO
from django.core.management import call_command
from django.test import TestCase, skipUnlessDBFeature
class InspectDBTestCase(TestCase):
@skipUnlessDBFeature('can_introspect_foreign_keys')
def test_attribute_name_not_python_keyword(self):
out = StringIO()
call_c... |
hmoco/osf.io | refs/heads/develop | api_tests/nodes/views/test_node_relationship_institutions.py | 7 | from nose.tools import * # flake8: noqa
from tests.base import ApiTestCase
from osf_tests.factories import InstitutionFactory, AuthUserFactory, NodeFactory
from api.base.settings.defaults import API_BASE
from website.util import permissions
class TestNodeRelationshipInstitutions(ApiTestCase):
def setUp(self)... |
priyankadeswal/network-address-translator | refs/heads/master | src/wimax/bindings/modulegen__gcc_LP64.py | 14 | 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))
... |
nop33/indico-plugin-livesync | refs/heads/master | indico_livesync/util.py | 1 | # This file is part of Indico.
# Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... |
yanheven/neutron | refs/heads/master | neutron/tests/unit/agent/l3/test_namespace_manager.py | 4 | # Copyright (c) 2015 Rackspace
# 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... |
mitocoinorg/mitocoin | refs/heads/master | qa/rpc-tests/disablewallet.py | 102 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Exercise API with -disablewallet.
#
from test_framework.test_framework import BitcoinTestFramework
f... |
undoware/neutron-drive | refs/heads/master | google_appengine/google/appengine/_internal/django/core/management/commands/startapp.py | 23 | import os
from google.appengine._internal.django.core.management.base import copy_helper, CommandError, LabelCommand
from google.appengine._internal.django.utils.importlib import import_module
class Command(LabelCommand):
help = "Creates a Django app directory structure for the given app name in the current direc... |
Lekanich/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/bin/unique-messages.py | 454 | #!/usr/bin/env python
import os
import sys
def unique_messages():
basedir = None
if os.path.isdir(os.path.join('conf', 'locale')):
basedir = os.path.abspath(os.path.join('conf', 'locale'))
elif os.path.isdir('locale'):
basedir = os.path.abspath('locale')
else:
print "this scri... |
ShassAro/ShassAro | refs/heads/master | Bl_project/blVirtualEnv/lib/python2.7/site-packages/django/core/serializers/pyyaml.py | 115 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
import decimal
import yaml
import sys
from io import StringIO
from django.db import models
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSe... |
40223108/w18 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/ui/__init__.py | 606 | from browser import html, document
from .dialog import *
from .progressbar import *
from .slider import *
def add_stylesheet():
_link=html.LINK(Href='/src/Lib/ui/css/smoothness/jquery-ui-1.10.3.custom.min.css')
_link.rel='stylesheet'
document <= _link
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.