repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
ftomassetti/intellij-community | refs/heads/master | python/testData/psi/MissingParenInCall.py | 83 | def get_key():
if isinstance(self.instance,
def clean():
pass
|
kubeflow/katib | refs/heads/master | test/suggestion/v1beta1/test_darts_service.py | 1 | # Copyright 2021 The Kubeflow Authors.
#
# 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 ... |
fgesora/odoo | refs/heads/8.0 | openerp/addons/base/res/__init__.py | 384 | # -*- coding: 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 GNU... |
PhilSk/zulip | refs/heads/master | zerver/webhooks/stash/tests.py | 26 | # -*- coding: utf-8 -*-
from typing import Text
from zerver.lib.test_classes import WebhookTestCase
class StashHookTests(WebhookTestCase):
STREAM_NAME = 'stash'
URL_TEMPLATE = u"/api/v1/external/stash?stream={stream}"
def test_stash_message(self):
# type: () -> None
"""
Messages ar... |
soldag/home-assistant | refs/heads/dev | homeassistant/components/aftership/sensor.py | 4 | """Support for non-delivered packages recorded in AfterShip."""
from datetime import timedelta
import logging
from pyaftership.tracker import Tracking
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import ATTR_ATTRIBUTION, CONF_API_KEY, CONF_NAME, HTTP_OK... |
wpjesus/codematch | refs/heads/dev | form_utils/fields.py | 3 | from django import forms
from form_utils.widgets import ClearableFileInput
class FakeEmptyFieldFile(object):
"""
A fake FieldFile that will convice a FileField model field to
actually replace an existing file name with an empty string.
FileField.save_form_data only overwrites its instance data if... |
ebesson/ansible-cozy-playbook | refs/heads/master | molecule/default/tests/test_couchdb.py | 1 | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_couchdb_package(host):
assert host.package("cozy-couchdb").is_installed
def test_couchdb_service(host):
couchdb = host.servi... |
zerodengxinchao/ovirt-engine | refs/heads/eayunos-4.2 | packaging/setup/plugins/ovirt-engine-setup/ovirt-engine/core/__init__.py | 8 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2014-2015 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
#
# Unl... |
moijes12/oh-mainline | refs/heads/master | vendor/packages/Django/django/db/backends/signals.py | 1430 | from django.dispatch import Signal
connection_created = Signal(providing_args=["connection"])
|
william-richard/moto | refs/heads/master | tests/test_cloudformation/test_server.py | 2 | from __future__ import unicode_literals
import json
from six.moves.urllib.parse import urlencode
import re
import sure # noqa
import moto.server as server
"""
Test the different server responses
"""
def test_cloudformation_server_get():
backend = server.create_backend_app("cloudformation")
stack_name = "t... |
cc13ny/Allin | refs/heads/master | leetcode/020-Valid-Parentheses/Val_Parent_best.py | 5 | class Solution(object):
def isValid(self, s):
"""
:type s: str
:rtype: bool
"""
stack = []
pairs = {'(':')', '[':']', '{':'}'}
for c in s:
if c == ')' or c == ']' or c == '}':
if not stack or pairs[stack.pop()] != c:
... |
leafclick/intellij-community | refs/heads/master | python/testData/completion/oldStyleClassAttributes.py | 83 | class C:
pass
c = C()
c.__cla<caret>
|
mhdella/scikit-learn | refs/heads/master | examples/text/document_clustering.py | 230 | """
=======================================
Clustering text documents using k-means
=======================================
This is an example showing how the scikit-learn can be used to cluster
documents by topics using a bag-of-words approach. This example uses
a scipy.sparse matrix to store the features instead of ... |
lpsinger/astropy | refs/heads/main | astropy/io/ascii/ecsv.py | 3 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Define the Enhanced Character-Separated-Values (ECSV) which allows for reading and
writing all the meta data associated with an astropy Table object.
"""
import re
from collections import OrderedDict
import warnings
import json
import numpy as np
fr... |
SNeuhausen/training_management | refs/heads/master | models/literature/__init__.py | 1 | """
Initialization file for this python package
"""
# Import the literature python module. This will
# run the model class definition which makes the
# internal name of the model class public to the database
# system.
import literature
|
shastikk/youtube-dl | refs/heads/master | youtube_dl/extractor/thesixtyone.py | 109 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import unified_strdate
class TheSixtyOneIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?thesixtyone\.com/
(?:.*?/)*
(?:
s|
song/comments/list|
song... |
gchaimovitz/CouchPotatoServer | refs/heads/master | couchpotato/core/media/_base/search/__init__.py | 81 | from .main import Search
def autoload():
return Search()
|
gavin-feng/odoo | refs/heads/8.0 | addons/website_event_sale/tests/__init__.py | 461 | import test_ui
|
alexgorban/models | refs/heads/master | research/slim/datasets/download_and_convert_visualwakewords.py | 1 | # Copyright 2019 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... |
tonyteate/pydocxgae | refs/heads/master | pydocx/DocxParser.py | 1 | import logging
import os
import zipfile
from abc import abstractmethod, ABCMeta
from contextlib import contextmanager
from pydocx.utils import (
MulitMemoizeMixin,
PydocxPreProcessor,
find_all,
find_ancestor_with_tag,
find_first,
get_list_style,
has_descendant_with_tag,
parse_xml_from_... |
unaguil/hyperion-ns2 | refs/heads/master | experiments/measures/multicast/AvgFoundParameters.py | 1 | import re
import numpy
import os.path
import measures.generic.Units as Units
from measures.generic.GenericAvgMeasure import GenericAvgMeasure
class AvgFoundParameters(GenericAvgMeasure):
def __init__(self, period, simulationTime):
GenericAvgMeasure.__init__(self, period, simulationTime, Units.RATIO)
self.... |
LuoZijun/pybot | refs/heads/master | xmpp_bot.py | 1 | #!/usr/bin/env python
#-*- coding:utf-8 -*-
#author:luozijun
#email:gnulinux@126.com
import logging
from sleekxmpp import ClientXMPP
from sleekxmpp.exceptions import IqError, IqTimeout
"""
推荐使用 SleekXMPP
Lib: pyxmpp/xmpppy/pyjabber/SleekXMPP
Main Page:
https://github.com/fritzy/SleekXMPP
Install :
$:sudo... |
lisong521/wireshark | refs/heads/master | tools/dftestlib/bytes_ipv6.py | 40 | # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# 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.
#
# Th... |
wang1352083/pythontool | refs/heads/master | python-2.7.12-lib/email/mime/audio.py | 414 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Anthony Baxter
# Contact: email-sig@python.org
"""Class representing audio/* type MIME documents."""
__all__ = ['MIMEAudio']
import sndhdr
from cStringIO import StringIO
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
... |
IL2HorusTeam/il2fb-commons | refs/heads/master | tests/test_belligerents.py | 1 | import unittest
from candv import Constants
from candv import SimpleConstant
from candv import Values
from candv import VerboseValueConstant
from candv import with_constant_class
from il2fb.commons.belligerents import BelligerentConstant
class BelligerentsTestCase(unittest.TestCase):
def test_to_group(self):
... |
ktbs/ktbs | refs/heads/develop | lib/rdfrest/http_server.py | 1 | # This file is part of RDF-REST <http://champin.net/2012/rdfrest>
# Copyright (C) 2011-2012 Pierre-Antoine Champin <pchampin@liris.cnrs.fr> /
# Universite de Lyon <http://www.universite-lyon.fr>
#
# RDF-REST is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Ge... |
srikantbmandal/ansible | refs/heads/devel | lib/ansible/plugins/lookup/csvfile.py | 46 | # (c) 2013, Jan-Piet Mens <jpmens(at)gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... |
steedos/odoo7 | refs/heads/master | openerp/addons/account_check_writing/report/__init__.py | 446 | # -*- 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... |
kogaki/pqkmeans | refs/heads/master | test/clustering/test_pure_python_clustering_sample.py | 2 | import unittest
import pqkmeans
import numpy
import pipe
class TestPurePythonClusteringSample(unittest.TestCase):
def data_source(self, n: int):
for i in range(n):
for _ in range(3):
yield [i * 100] * 5
def setUp(self):
self.clustering = pqkmeans.clustering.PurePyt... |
eahneahn/free | refs/heads/master | djangoproject/social_auth/tests/google.py | 13 | import re
from social_auth.utils import setting
from social_auth.tests.base import SocialAuthTestsCase, FormParserByID, \
FormParser, RefreshParser
from django.conf import settings
class GoogleTestCase(SocialAuthTestsCase):
name = 'google'
def setUp(self, *args, **kwargs):... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.7.2/Lib/test/test_new.py | 130 | import unittest
from test import test_support
import sys
new = test_support.import_module('new', deprecated=True)
class NewTest(unittest.TestCase):
def test_spam(self):
class Eggs:
def get_yolks(self):
return self.yolks
m = new.module('Spam')
m.Eggs = Eggs
... |
ivanhorvath/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.9.40/roles/lib_openshift/library/oc_atomic_container.py | 36 | #!/usr/bin/env python
# pylint: disable=missing-docstring
# flake8: noqa: T001
# ___ ___ _ _ ___ ___ _ _____ ___ ___
# / __| __| \| | __| _ \ /_\_ _| __| \
# | (_ | _|| .` | _|| / / _ \| | | _|| |) |
# \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____
# | \ / _ \ | \| |/ _ \_ _| | __| \_ ... |
BaconPancakes/valor | refs/heads/master | lib/youtube_dl/extractor/vesti.py | 71 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
from .rutv import RUTVIE
class VestiIE(InfoExtractor):
IE_DESC = 'Вести.Ru'
_VALID_URL = r'https?://(?:.+?\.)?vesti\.ru/(?P<id>.+)'
_TESTS = [
{
'ur... |
Natim/sentry | refs/heads/master | src/sentry/models/grouptagvalue.py | 10 | """
sentry.models.grouptagvalue
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from datetime import timedelta
from django.db import connections, models
from django.db.models... |
belmiromoreira/nova | refs/heads/master | nova/tests/unit/scheduler/filters/test_pci_passthrough_filters.py | 41 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/_configuration.py | 1 | # 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 may ... |
conan-io/conan | refs/heads/develop | conans/test/integration/settings/cppstd/default_cppstd_test.py | 1 | # coding=utf-8
import json
import os
import textwrap
import unittest
from conans.client.build.cppstd_flags import cppstd_default
from conans.client.conf import get_default_settings_yml
from conans.client.tools import environment_append, save, load
from conans.model.settings import Settings
from conans.test.utils.test... |
Deepakkothandan/ansible-modules-extras | refs/heads/devel | notification/jabber.py | 44 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Brian Coca <bcoca@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 Licen... |
stevepiercy/readthedocs.org | refs/heads/master | readthedocs/settings/onebox.py | 3 | import os
from .base import * # noqa
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(SITE_ROOT, 'dev.db'),
}
}
BROKER_URL = 'redis://localhost:6379/0'
CELERY_RESULT_BACKEND = 'redis://localhost:6379/0'
CELERY_ALWAYS_EAGER = False
HAYSTACK_CONNECTIONS ... |
luca76/QGIS | refs/heads/master | python/ext-libs/pygments/lexers/_openedgebuiltins.py | 370 | # -*- coding: utf-8 -*-
"""
pygments.lexers._openedgebuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Builtin list for the OpenEdgeLexer.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
OPENEDGEKEYWORDS = [
'ABSOLUTE', 'ABS', 'ABSO', 'A... |
Nepherhotep/django | refs/heads/master | tests/select_related_onetoone/tests.py | 301 | from __future__ import unicode_literals
import unittest
from django.core.exceptions import FieldError
from django.test import SimpleTestCase, TestCase
from .models import (
AdvancedUserStat, Child1, Child2, Child3, Child4, Image, Parent1, Parent2,
Product, StatDetails, User, UserProfile, UserStat, UserStatRe... |
letouriste001/SmartForest_2.0 | refs/heads/master | python3.4Smartforest/lib/python3.4/site-packages/setuptools/command/test.py | 25 | import sys
import contextlib
from distutils.errors import DistutilsOptionError
from unittest import TestLoader
from setuptools.extern import six
from setuptools.extern.six.moves import map
from pkg_resources import (resource_listdir, resource_exists, normalize_path,
working_set, _namespace_... |
tark-hidden/jinja2 | refs/heads/master | jinja2/bccache.py | 346 | # -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations whe... |
janusnic/shoop | refs/heads/master | shoop_tests/core/test_addresses.py | 6 | # -*- coding: utf-8 -*-
# This file is part of Shoop.
#
# Copyright (c) 2012-2015, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from django.core.exceptions import ValidationError
from django.forms.models ... |
openstack/senlin | refs/heads/master | senlin/tests/unit/engine/actions/test_cluster_action.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 unde... |
enikesha/yos-social-python | refs/heads/master | examples/appengine/djangodemo/yosdemo/views.py | 2 | # views.py
from django.http import HttpResponse
def main(request):
result = "demo .........................................................."
return HttpResponse(result)
|
tanhaiwang/gmusicapi | refs/heads/develop | gmusicapi/test/local_tests.py | 3 | # -*- coding: utf-8 -*-
"""
Tests that don't hit the Google Music servers.
"""
from collections import namedtuple
import os
import time
from mock import MagicMock
from proboscis.asserts import (
assert_raises, assert_true, assert_false, assert_equal,
assert_is_not, Check
)
from proboscis import test
import ... |
mengxn/tensorflow | refs/heads/master | tensorflow/python/debug/wrappers/framework_test.py | 24 | # Copyright 2016 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... |
swagiaal/kubernetes | refs/heads/master | cluster/juju/charms/trusty/kubernetes/hooks/lib/__init__.py | 723 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
colony005/dnspython194 | refs/heads/master | dns/rdtypes/ANY/SPF.py | 248 | # Copyright (C) 2006, 2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED... |
bstroebl/QGIS | refs/heads/master | python/plugins/sextante/admintools/geoserver/style.py | 4 | # -*- coding: utf-8 -*-
"""
***************************************************************************
style.py
---------------------
Date : November 2012
Copyright : (C) 2012 by David Winslow
Email : dwins at opengeo dot com
******************************... |
s-kic/TDDBC_Learning | refs/heads/master | gmock/gtest/test/gtest_break_on_failure_unittest.py | 1050 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
liangazhou/django-rdp | refs/heads/master | packages/eclipse/plugins/org.python.pydev_4.4.0.201510052309/pysrc/pydev_app_engine_debug_startup.py | 104 | if False:
config = None
# See: https://docs.google.com/document/d/1CCSaRiIWCLgbD3OwmuKsRoHHDfBffbROWyVWWL0ZXN4/edit
if ':' not in config.version_id:
# The default server version_id does not contain ':'
import json
import os
import sys
startup = config.python_config.startup_args
... |
tbinjiayou/Odoo | refs/heads/master | addons/google_drive/__openerp__.py | 320 | # -*- 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... |
lepistone/account-payment | refs/heads/8.0 | __unported__/account_payment_extension/wizard/__init__.py | 18 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# AvanzOSC, Av... |
selahssea/ggrc-core | refs/heads/develop | test/integration/ggrc/converters/test_imported_api_requests.py | 5 | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Check number of db queries per API request.
This is in converters because it depends on import to provide data
"""
import collections
from ggrc.models import all_models
from ggrc.utils import QueryCoun... |
asnorkin/sentiment_analysis | refs/heads/master | site/lib/python2.7/site-packages/requests/packages/urllib3/packages/backports/makefile.py | 339 | # -*- coding: utf-8 -*-
"""
backports.makefile
~~~~~~~~~~~~~~~~~~
Backports the Python 3 ``socket.makefile`` method for use with anything that
wants to create a "fake" socket object.
"""
import io
from socket import SocketIO
def backport_makefile(self, mode="r", buffering=None, encoding=None,
... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.7/StringIO.py | 120 | r"""File-like objects that read from or write to a string buffer.
This implements (nearly) all stdio methods.
f = StringIO() # ready for writing
f = StringIO(buf) # ready for reading
f.close() # explicitly release resources held
flag = f.isatty() # always false
pos = f.tell() # get current pos... |
vjmac15/Lyilis | refs/heads/master | lib/youtube_dl/extractor/acast (VJ Washington's conflicted copy 2017-08-29).py | 36 | # coding: utf-8
from __future__ import unicode_literals
import re
import functools
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
int_or_none,
parse_iso8601,
OnDemandPagedList,
)
class ACastIE(InfoExtractor):
IE_NAME = 'acast'
_VALID_URL = r'https?://(?:w... |
imanmafi/pyNES | refs/heads/0.1.x | pynes/tests/__init__.py | 27 | # -*- coding: utf-8 -*-
from unittest import TestCase
from pynes.composer import compose
from pynes.compiler import compile
from pynes import sprite
import os
from pynes.compiler import lexical, syntax, semantic
class MetaInstructionCase(type):
def __new__(cls, name, bases, args):
def gen_lex():
... |
MattWellie/FastqSimulator | refs/heads/master | comparison.py | 1 | import cPickle
import os
import re
__author__ = 'mwelland'
class VCF_Comparison:
def __init__(self, run_number, pickle_dir, vcf_dir):
self.vcf_file = os.path.join(vcf_dir, '%d_anno.vcf.hg19_multianno.vcf' % run_number)
self.pickle_dir = pickle_dir
self.pickles = os.listdir(os.path.join(se... |
fqez/JdeRobot | refs/heads/master | src/tools/colorTuner_py/QDarkStyleSheet/qdarkstyle/__init__.py | 4 | # -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) <2013-2014> <Colin Duquesnoy>
#
# 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 limi... |
tsaini123/TestRepo2 | refs/heads/master | node_modules/node-forge/tests/policyserver.py | 171 | #!/usr/bin/env python
"""
Flash Socket Policy Server.
- Starts Flash socket policy file server.
- Defaults to port 843.
- NOTE: Most operating systems require administrative privileges to use
ports under 1024.
$ ./policyserver.py [options]
"""
"""
Also consider Adobe's solutions:
http://www.adobe.com/devnet/fla... |
nightjean/Deep-Learning | refs/heads/master | tensorflow/contrib/learn/python/learn/estimators/state_saving_rnn_estimator_test.py | 82 | # Copyright 2016 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... |
hwangsyin/crm | refs/heads/master | lib/tornado/platform/interface.py | 387 | #!/usr/bin/env python
#
# Copyright 2011 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... |
Blackinator101/sporemaster | refs/heads/master | SporeMaster/scripts/GenerateGuessFiles.py | 1 | # Use a variable order markov model (PPM-C) to generate a large amount of gibberish
# statistically similar to Spore filenames. Divide it into left and right "halves"
# and build guess_left.txt and guess_right.txt. The names "tried" by the SporeMaster
# hash guesser (with no prefix, suffix, or contains strin... |
biocore/qiime | refs/heads/master | scripts/make_qiime_py_file.py | 15 | #!/usr/bin/env python
# make_qiime_py_file.py
"""
This is a script which will add headers and footers to new python files
and make them executable.
"""
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Greg Caporaso", "Adam Robbins-Pianka"]
__license__ = "GPL"
__version_... |
jondo/shogun | refs/heads/develop | tests/integration/python_modular/tester.py | 16 | #!/usr/bin/env python
import modshogun
import pickle
import os
import filecmp
import numpy
import sys
import difflib
from generator import setup_tests, get_fname, blacklist, get_test_mod, run_test
def is_python2():
return sys.version_info[0]==2
def typecheck(a, b):
if str(type(a)).find('shogun')>=0 and \
str(ty... |
plumgrid/plumgrid-nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/157_add_security_group_default_rules.py | 21 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicab... |
sestrella/ansible | refs/heads/devel | lib/ansible/modules/web_infrastructure/ansible_tower/tower_workflow_launch.py | 21 | #!/usr/bin/python
# coding: utf-8 -*-
# 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',
'status': ['preview'],
... |
CWRoos/msp430-python-raspberry-pi | refs/heads/master | msp430/memory/error.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2002-2010 Chris Liechti <cliechti@gmx.net>
# All Rights Reserved.
# Simplified BSD License (see LICENSE.txt for full text)
"""\
Error messages for file handler modules.
"""
class FileFormatError(Exception):
"""\
Exception for "file is not in the ... |
qmarlats/pyquizz | refs/heads/master | env-3/lib/python3.5/site-packages/docutils/parsers/rst/languages/__init__.py | 170 | # $Id: __init__.py 7648 2013-04-18 07:36:22Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
# Internationalization details are documented in
# <http://docutils.sf.net/docs/howto/i18n.html>.
"""
This package contains modules for language-dependent fe... |
dagwieers/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_vscan_on_access_policy.py | 15 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit tests for Ansible module: na_ontap_vscan_scanner_pool '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch... |
dstrockis/outlook-autocategories | refs/heads/master | lib/dill/objtypes.py | 7 | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2017 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - http://trac.mystic.cacr.caltech.ed... |
wmles/scholarium | refs/heads/master | Bibliothek/admin.py | 2 | from django.contrib import admin
from .models import *
# Register your models here.
@admin.register(Buch)
class BuchAdmin(admin.ModelAdmin):
list_display = ('autor', 'titel', 'herausgeber')
list_filter = ['jahr']
|
fightforthefuture/idl-members | refs/heads/master | internetdefense/settings/staging.py | 2 | """
Settings specific to the production environment.
"""
import os
from memcacheify import memcacheify
from postgresify import postgresify
from settings.base import INSTALLED_APPS
DEBUG = True
TEMPLATE_DEBUG = DEBUG
SITE_ID = 1
INSTALLED_APPS = INSTALLED_APPS + [
'gunicorn',
]
DATABASES = postgresify()
CACH... |
daenamkim/ansible | refs/heads/devel | lib/ansible/module_utils/facts/system/service_mgr.py | 12 | # Collect facts related to system service manager and init.
#
# 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) a... |
ewandor/home-assistant | refs/heads/dev | homeassistant/components/apcupsd.py | 9 | """
Support for status output of APCUPSd via its Network Information Server (NIS).
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/apcupsd/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.const import (CONF... |
Zopieux/plugin.video.pulsar | refs/heads/master | resources/site-packages/pulsar/monitor.py | 8 | import xbmc
import urllib2
import threading
from pulsar.config import PULSARD_HOST
class PulsarMonitor(xbmc.Monitor):
def __init__(self):
self._closing = threading.Event()
@property
def closing(self):
return self._closing
def onAbortRequested(self):
# Only when closing Kodi
... |
chrisseto/tornado | refs/heads/master | demos/benchmark/template_benchmark.py | 30 | #!/usr/bin/env python
#
# A simple benchmark of tornado template rendering, based on
# https://github.com/mitsuhiko/jinja2/blob/master/examples/bench.py
import sys
from timeit import Timer
from tornado.options import options, define, parse_command_line
from tornado.template import Template
define('num', default=100,... |
yongshengwang/hue | refs/heads/master | desktop/core/ext-py/Pygments-1.3.1/external/moin-parser.py | 46 | # -*- coding: utf-8 -*-
"""
The Pygments MoinMoin Parser
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is a MoinMoin parser plugin that renders source code to HTML via
Pygments; you need Pygments 0.7 or newer for this parser to work.
To use it, set the options below to match your setup and put this file in
... |
tobi-wan-kenobi/timewarp | refs/heads/master | tests/test_ec2_list.py | 1 | import mock
import unittest
import datetime
from . import mock_boto3
import timewarp.ec2
class TestEc2List(unittest.TestCase):
def setUp(self):
self.boto3 = mock_boto3.Boto3Mock()
self.someInstanceId = "i-123456789"
self.someCheckpointId = "12345"
tags = [
{"Key":... |
tacaswell/scikit-beam | refs/heads/master | skbeam/core/tests/test_smoothing.py | 5 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... |
nzavagli/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Twisted-15.2.1/twisted/conch/ssh/forwarding.py | 10 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module contains the implementation of the TCP forwarding, which allows
clients and servers to forward arbitrary TCP data across the connection.
Maintainer: Paul Swartz
"""
import struct
from twisted.internet import protocol, reactor
fr... |
joelin3246/Project_2121038 | refs/heads/master | components/external/freetype/src/tools/docmaker/sources.py | 367 | # Sources (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009
# David Turner <david@freetype.org>
#
#
# this file contains definitions of classes needed to decompose
# C sources files into a series of multi-line "blocks". There are
# two kinds of blocks:
#
# - normal blocks, which contain source code or ordinary comment... |
goodwinnk/intellij-community | refs/heads/master | python/testData/optimizeImports/orderByType.after.py | 114 | from __future__ import with_statement
import datetime
import sys
import foo
from bar import *
sys.path
datetime.datetime
foo.bar() |
snswa/django-iris | refs/heads/master | iris/example/backends.py | 1 | from django.contrib.auth.models import User
from iris.models import Participant
class ContrivedBackend(object):
"""A contrived authentication backend."""
supports_object_permissions = True
supports_anonymous_user = True
def has_perm(self, user_obj, perm, obj=None):
# Anonymous users can vie... |
bgporter/mp3utilities | refs/heads/master | mover.py | 1 | #! /usr/bin/env python
''' Utility to move and rename MP3 files into a master repository location.
Requires that you have the mutagen ID parsing library installed.
'''
import os
import fileSource
import fileDestination
kTargetBasePath = "/Volumes/zappa_files/music"
def DebugLog(src, dest, rate=0):
print src... |
nakamoo/domain_watch | refs/heads/master | index.py | 1 | # -*- coding: utf-8 -*-
import os
from bottle import route, run
@route("/")
def hello_world():
return "" # ここで返す内容は何でもよい
run(host="0.0.0.0", port=int(os.environ.get("PORT", 5000)))
|
djcode/XBMC-rTorrent-Plugin | refs/heads/master | resources/lib/__init__.py | 2547 | # Dummy file to make this directory a package.
|
pombredanne/python-v8 | refs/heads/master | tests/test_wrapper.py | 2 | # -*- coding: utf-8 -*-
from datetime import *
import pytest
import os
import sys
from v8 import *
from v8.utils import *
if is_py3k:
def toUnicodeString(s):
return s
else:
def toUnicodeString(s, encoding='utf-8'):
return s if isinstance(s, unicode) else unicode(s, encoding)
def testObject():
... |
ttm/oscEmRede | refs/heads/master | venv/lib/python2.7/site-packages/werkzeug/formparser.py | 312 | # -*- coding: utf-8 -*-
"""
werkzeug.formparser
~~~~~~~~~~~~~~~~~~~
This module implements the form parsing. It supports url-encoded forms
as well as non-nested multipart uploads.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more deta... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | analytic_solution/test_cases/4NodeANDES/cantilever_different_element_number/NumberOfElement6/compare_essi_version.py | 409 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
# automatically find the script directory.
# script_dir=sys.argv[1]
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own command line color function
# ... |
AndreasMadsen/tensorflow | refs/heads/master | tensorflow/python/summary/writer/writer.py | 21 | # Copyright 2016 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... |
garyjyao1/ansible | refs/heads/devel | contrib/inventory/nova.py | 131 | #!/usr/bin/env python
# (c) 2012, Marco Vito Moscaritolo <marco@agavee.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
# ... |
ahb0327/intellij-community | refs/heads/master | python/testData/formatter/comment.py | 158 | def foo(a):
if a == 5:
# a is 5
print 'no'
foo(5) |
pombredanne/scrapy | refs/heads/master | scrapy/link.py | 95 | """
This module defines the Link object used in Link extractors.
For actual link extractors implementation see scrapy.linkextractors, or
its documentation in: docs/topics/link-extractors.rst
"""
import warnings
import six
from scrapy.utils.python import to_bytes
class Link(object):
"""Link objects represent an ... |
BorisJeremic/Real-ESSI-Examples | refs/heads/master | dynamic_test/Newmark/gamma0.8/time_integrator_analysis.py | 11 | from scipy import *
from scipy.interpolate import interp1d
from scipy.optimize import bisect
import scipy.linalg as lin
#Simple peak finder for these very smooth signals
def findpeaks(y, imax = -1):
N = y.shape[0]
if imax == -1:
imax = N
#print N
i = 1
peak_indices = []
whi... |
arju88nair/projectCulminate | refs/heads/master | venv/lib/python3.5/importlib/abc.py | 45 | """Abstract base classes related to import."""
from . import _bootstrap
from . import _bootstrap_external
from . import machinery
try:
import _frozen_importlib
except ImportError as exc:
if exc.name != '_frozen_importlib':
raise
_frozen_importlib = None
try:
import _frozen_importlib_external
exc... |
tsuru/redisapi | refs/heads/master | tests/test_auth.py | 1 | # Copyright 2015 redisapi 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 unittest
import os
import mock
from redisapi.auth import scheme_info, Unauthorized, user_info
class AuthTest(unittest.TestCase):
@mock.patch("requ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.