repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
Onager/plaso | plaso/cli/helpers/viper_analysis.py | # -*- coding: utf-8 -*-
"""The Viper analysis plugin CLI arguments helper."""
from plaso.analysis import viper
from plaso.cli.helpers import interface
from plaso.cli.helpers import manager
from plaso.lib import errors
class ViperAnalysisArgumentsHelper(interface.ArgumentsHelper):
"""Viper analysis plugin CLI argum... |
younfor/django-fly-blog | flyblog/site-packages/DjangoUeditor/models.py | #coding: utf-8
from django.db import models
from django.contrib.admin import widgets as admin_widgets
from widgets import UEditorWidget,AdminUEditorWidget
class UEditorField(models.TextField):
"""
百度HTML编辑器字段,初始化时,可以提供以下参数
initial:初始内容
toolbars:提供工具按钮列表,取值为列表,如['bold', 'italic'],取值为:... |
home-assistant/home-assistant | tests/components/sonarr/test_sensor.py | """Tests for the Sonarr sensor platform."""
from datetime import timedelta
from unittest.mock import patch
import pytest
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.sonarr.const import DOMAIN
from homeassistant.const import (
ATTR_ICON,
ATTR_UNIT_OF_MEASUR... |
Ztiany/Repository | Python/Python3-Base/07_oop/objects/Static.py | #########################
# 静态属性和方法
#########################
class TestStatic:
country = 'China' # 类属性
_city = "BeiJin"
# 类方法:是类对象所拥有的方法,第一个参数必须是类对象,一般约定为cls
@classmethod
def test_class(cls):
return cls.country
@classmethod
def test_class_set(cls, country):
cls.country ... |
thanos/mykonosbiennale.org | imagelabs/processor.py | # encoding: utf-8
import json, os
import requests
from boto.s3.connection import S3Connection
from boto.s3.key import Key
from StringIO import StringIO
from urlparse import urlparse
from pilkit.lib import Image, ImageDraw
from pilkit.processors import (Resize, ResizeToFill, ResizeToFit, SmartCrop,
... |
DinoCow/airflow | tests/providers/amazon/aws/log/test_cloudwatch_task_handler.py | #
# 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... |
kch8qx/osf.io | admin_tests/metrics/test_utils.py | from nose import tools as nt
from datetime import timedelta, datetime
from tests.base import AdminTestCase
from tests.factories import (
NodeFactory, RegistrationFactory, AuthUserFactory, ProjectFactory)
from website.project.model import Node, User
from framework.auth import Auth
from admin.metrics.utils import ... |
apache/avro | lang/py/avro/test/word_count_task.py | #!/usr/bin/env python3
##
# 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
... |
sassoftware/rmake | rmake_test/functional_test/buildtest/buildertest.py | #
# Copyright (c) SAS Institute 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 w... |
kawamon/hue | desktop/core/ext-py/PyJWT-1.7.1/tests/keys/__init__.py | import json
import os
from jwt.utils import base64url_decode, force_bytes
from tests.utils import int_from_bytes
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
def decode_value(val):
decoded = base64url_decode(force_bytes(val))
return int_from_bytes(decoded, 'big')
def load_hmac_key():
with o... |
rackerlabs/python-proboscis | proboscis/check.py | # Copyright (c) 2012 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... |
stdweird/aquilon | lib/python2.6/aquilon/aqdb/model/machine_specs.py | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... |
NeCTAR-RC/designate | designate/storage/__init__.py | # Copyright 2012 Managed I.T.
#
# Author: Kiall Mac Innes <kiall@managedit.ie>
#
# 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... |
mahak/cinder | cinder/tests/unit/image/test_cache.py | # Copyright (C) 2015 Pure Storage, 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 la... |
dunkhong/grr | colab/grr_colab/magics_impl_test.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import io
import time
from absl.testing import absltest
import ipaddress
import mock
import pandas as... |
autodesk-cloud/ochothon | images/portal/resources/toolset/toolset/commands/scale.py | #
# Copyright (c) 2015 Autodesk 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 l... |
Huyuwei/tvm | tutorials/frontend/from_mxnet.py | # 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... |
jmolina116/kaldi-yesno-tutorial | steps/nnet3/train_dnn.py | #!/usr/bin/env python
# Copyright 2016 Vijayaditya Peddinti.
# Apache 2.0.
# this script is based on steps/nnet3/lstm/train.sh
import subprocess
import argparse
import sys
import pprint
import logging
import imp
import traceback
from nnet3_train_lib import *
nnet3_log_parse = imp.load_source('', 'steps/nnet3/rep... |
jbonofre/beam | sdks/python/apache_beam/runners/direct/watermark_manager.py | #
# 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 us... |
zstackorg/zstack-woodpecker | integrationtest/vm/simulator/dhcp_server_ip/test_stub_for_dhcp_ip.py | '''
prepare resource for dhcp ip feature
@author Antony WeiJiang
'''
import zstackwoodpecker.operations.net_operations as net_ops
import zstackwoodpecker.operations.resource_operations as res_ops
import zstackwoodpecker.operations.deploy_operations as dep_ops
import zstackwoodpecker.operations.vm_operations as vm_op... |
Cinntax/home-assistant | homeassistant/components/xiaomi/device_tracker.py | """Support for Xiaomi Mi routers."""
import logging
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_U... |
wileeam/airflow | airflow/kubernetes/pod_generator.py | # 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... |
nugget/home-assistant | homeassistant/components/velbus/sensor.py | """Support for Velbus sensors."""
import logging
from homeassistant.components.velbus import (
DOMAIN as VELBUS_DOMAIN, VelbusEntity)
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['velbus']
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
"""Set up the... |
dreamhost/akanda-rug | akanda/rug/openstack/common/rpc/impl_qpid.py | # Copyright 2014 DreamHost, LLC
#
# Author: DreamHost, 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 applicabl... |
cloudbase/nova | nova/tests/functional/db/test_aggregate.py | # 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... |
pgroudas/pants | tests/python/pants_test/targets/test_jvm_app_integration.py | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants_test.pant... |
wrigri/libcloud | libcloud/dns/types.py | # 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 use ... |
avagin/libct | py/setup.py | # setup.py: setup script
#
# Copyright (C) 2014 Parallels, Inc.
#
# This library 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 2.1 of the License, or (at your option) any later versio... |
jonparrott/google-cloud-python | bigquery_datatransfer/google/cloud/bigquery_datatransfer_v1/gapic/data_transfer_service_client.py | # -*- coding: utf-8 -*-
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
amwelch/a10sdk-python | a10sdk/core/cgnv6/cgnv6_ds_lite_alg.py | from a10sdk.common.A10BaseClass import A10BaseClass
class Alg(A10BaseClass):
"""Class Description::
DS-Lite ALG Parameters.
Class alg supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param DeviceProxy: The device proxy f... |
mikalstill/nova | nova/conf/__init__.py | # Copyright 2015 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... |
tomdee/calico-containers | calicoctl/calico_ctl/utils.py | # Copyright 2015 Metaswitch Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... |
JsonChiu/openrunlog | openrunlog/constants.py |
calculate_streaks = 'orl:workers:streaks'
races = [
'400m',
'800m',
'1500m',
'1600m',
'1 mile',
'3000m',
'3200m',
'2 mile',
'3 mile',
'5000m',
'4 mile',
'8000m',
'5 mile',
'10000m',
'half marathon',
'marathon',
'50k',
'50 mile',
'100k',
'... |
jcbagneris/fms | fms/contrib/coleman/agents/mem1trader.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
"""
Module defining Mem1Trader agent class.
"""
import random
from fms import agents
from fms.utils import BUY, SELL
from fms.utils.exceptions import MissingParameter
class Mem1Trader(agents.Agent):
"""
Simulate an agent taking random decisions
This agent sub... |
beeftornado/sentry | src/sentry/auth/manager.py | from __future__ import absolute_import, print_function
__all__ = ["ProviderManager"]
import six
from .exceptions import ProviderNotRegistered
# Ideally this and PluginManager abstracted from the same base, but
# InstanceManager has become convoluted and wasteful
class ProviderManager(object):
def __init__(self... |
joergdietrich/astropy | astropy/stats/__init__.py | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This subpackage contains statistical tools provided for or used by Astropy.
While the `scipy.stats` package contains a wide range of statistical
tools, it is a general-purpose package, and is missing some that are
particularly useful to astronomy or a... |
sinhrks/expandas | pandas_ml/skaccessors/test/test_feature_selection.py | #!/usr/bin/env python
import pytest
import sklearn.datasets as datasets
import sklearn.feature_selection as fs
import pandas_ml as pdml
import pandas_ml.util.testing as tm
class TestFeatureSelection(tm.TestCase):
def test_objectmapper(self):
df = pdml.ModelFrame([])
self.assertIs(... |
venicegeo/eventkit-cloud | eventkit_cloud/utils/views.py | # -*- coding: utf-8 -*-
"""UI view definitions."""
from logging import getLogger
from urllib.parse import parse_qs
from django.http.request import HttpRequest
from django.http.response import HttpResponse
from eventkit_cloud.core.helpers import get_cached_model
from eventkit_cloud.tasks.models import DataProvider
fro... |
tyarkoni/featureX | pliers/filters/audio.py | ''' Filters that operate on TextStim inputs. '''
from copy import deepcopy
from pliers.stimuli import AudioStim
from pliers.utils import attempt_to_import, verify_dependencies
from .base import Filter, TemporalTrimmingFilter
librosa = attempt_to_import('librosa')
class AudioFilter(Filter):
''' Base class for a... |
knownsec/workin | workin/extensions.py | #!/usr/bin/env python
# encoding: utf-8
import logging
from workin.utils import importlib
def find_extensions(ext_module):
ext_class = None
try:
ext_class = importlib.import_module(ext_module + '.discover')
except ImportError, e:
logging.exception("Error found while discovering workin "
... |
Nikola-K/django-recurrence | recurrence/migrations/0001_initial.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Date',
fields=[
('id', models.AutoField(verbose... |
jack-pappas/PyTables | tables/carray.py | # -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: June 15, 2005
# Author: Antonio Valentino
# Modified by: Francesc Alted
#
# $Id$
#
########################################################################
"""Here is defined the CArray class."... |
coreos/chromite | scripts/deploy_chrome_unittest.py | #!/usr/bin/python
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import sys
import time
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)),
... |
alperyeg/elephant | elephant/gpfa/gpfa.py | """
Gaussian-process factor analysis (GPFA) is a dimensionality reduction method
[#f1]_ for neural trajectory visualization of parallel spike trains. GPFA applies
factor analysis (FA) to time-binned spike count data to reduce the
dimensionality and at the same time smoothes the resulting low-dimensional
trajectories by... |
twz915/django | django/middleware/csrf.py | """
Cross Site Request Forgery Middleware.
This module provides a middleware that implements protection
against request forgeries from other sites.
"""
import logging
import re
import string
from urllib.parse import urlparse
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from... |
imbasimba/astroquery | astroquery/esa/hubble/__init__.py | """
@author: Javier Duran
@contact: javier.duran@sciops.esa.int
European Space Astronomy Centre (ESAC)
European Space Agency (ESA)
Created on 13 Aug. 2018
"""
from astropy import config as _config
class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.esa.hubble`.
"""
D... |
chintak/scikit-image | doc/examples/plot_join_segmentations.py | """
==========================================
Find the intersection of two segmentations
==========================================
When segmenting an image, you may want to combine multiple alternative
segmentations. The `skimage.segmentation.join_segmentations` function
computes the join of two segmentations, in wh... |
mikemitr/business_directory | business_directory/aldryn_blog/cms_toolbar.py | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from cms.toolbar_pool import toolbar_pool
from cms.toolbar_base import CMSToolbar
from . import request_post_identifier
from .models import Post
@toolbar_pool.register
class BlogToolbar(CMSTo... |
anguoyang/SMQTK | python/EventContentDescriptor/perf_estimation.py | """
LICENCE
-------
Copyright 2013 by Kitware, Inc. All Rights Reserved. Please refer to
KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
"""
import os
import numpy as np
import itertools
def compute_errorRate(labels, scores, target... |
django-bmf/django-bmf | djangobmf/contrib/stock/migrations/0002_stock_stock_type.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-24 10:36
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('djangobmf_stock', '0001_initial'),
]
operations = [
migrations.AddField(
... |
wagtail/wagtail | wagtail/admin/mail.py | import logging
from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.mail import get_connection
from django.core.mail.message import EmailMultiAlternatives
from django.template.loader import render_to_string
from django.utils.translation import override
from wagtail.admin.au... |
django-bmf/django-bmf | djangobmf/views/defaults.py | #!/usr/bin/python
# ex:set fileencoding=utf-8:
from __future__ import unicode_literals
from django.http import HttpResponseBadRequest
from django.http import HttpResponseForbidden
from django.http import HttpResponseNotFound
from django.http import HttpResponseServerError
from django.template import Context
from djan... |
memtoko/django | django/core/management/templates.py | import cgi
import errno
import mimetypes
import os
import posixpath
import re
import shutil
import stat
import sys
import tempfile
from os import path
import django
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import handle_extensions
from django.template import C... |
isotoma/django-cms | cms/signals/apphook.py | # -*- coding: utf-8 -*-
import sys
from django.core.management import color_style
from django.core.urlresolvers import clear_url_caches
from django.core.signals import request_finished
from cms.models import Title
DISPATCH_UID = 'cms-restart'
def apphook_pre_title_checker(instance, **kwargs):
"""
Store the ... |
stscieisenhamer/glue | glue/core/tests/test_link_manager.py | # pylint: disable=I0011,W0613,W0201,W0212,E1101,E1103
from __future__ import absolute_import, division, print_function
import numpy as np
from ..component_link import ComponentLink
from ..data import ComponentID, DerivedComponent
from ..data import Data, Component
from ..data_collection import DataCollection
from ..... |
overdrive3000/skytools | scripts/queue_splitter.py | #! /usr/bin/env python
"""Puts events into queue specified by field from 'queue_field' config parameter.
Config parameters::
## Parameters for queue_splitter
# database locations
src_db = dbname=sourcedb_test
dst_db = dbname=destdb_test
# event fields from where target qu... |
KevinJiao/myo-python | myo/utils/enum.py | # Copyright (c) 2015 Niklas Rosenstein
#
# 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 rights
# to use, copy, modify, merge, publish, ... |
fireduck64/electrum | gui/qt/paytoedit.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
frankvdp/HamlPy | hamlpy/test/node_factory_test.py | from hamlpy import nodes
class TestNodeFactory():
def test_creates_element_node_with_percent(self):
node = nodes.create_node('%div')
assert isinstance(node, nodes.ElementNode)
node = nodes.create_node(' %html')
assert isinstance(node, nodes.ElementNode)
... |
zinic/pyrox | tests/server/proxyng/upstreamhandler_test.py | import unittest
import mock
import pyrox.filtering as filtering
from pyrox.filtering import HttpFilterPipeline
from pyrox.server.proxyng import UpstreamHandler
request = None
on_head_got_request = False
on_body_got_request = False
class ResponseFilterUsesRequest(filtering.HttpFilter):
@filtering.handles_response... |
keatonb/tsphot | spe_process.py | #!/usr/bin/env python
"""
Read .spe file and do aperture photometry.
"""
from __future__ import division
from astropy.io import fits
from astropy.time import Time
import glob
import os
import photutils
import scipy.optimize as sco
import numpy as np
import argparse
import sys
import read_spe
import d... |
sgallagher/reviewboard | contrib/internal/prepare-dev.py | #!/usr/bin/env python
from __future__ import print_function, unicode_literals
import os
import platform
import sys
from optparse import OptionParser
from random import choice
options = None
class SiteOptions(object):
copy_media = platform.system() == "Windows"
def create_settings():
if not os.path.exist... |
bamueh/dark-matter | dark/score.py | from functools import total_ordering
@total_ordering
class HigherIsBetterScore(object):
"""
Provide comparison functions for scores where numerically higher values
are considered better.
@param score: The numeric score of this HSP.
"""
def __init__(self, score):
self.score = score
... |
nizox/circuits | tests/web/test_client.py | #!/usr/bin/env python
from circuits.web import Controller
from circuits.web.client import Client, request
class Root(Controller):
def index(self):
return "Hello World!"
def test(webapp):
client = Client()
client.start()
client.fire(request("GET", webapp.server.http.base))
while clien... |
Universal-Model-Converter/UMC3.0a | data/Python/x86/Lib/site-packages/scipy/optimize/cobyla.py | """
Interface to Constrained Optimization By Linear Approximation
Functions
---------
.. autosummary::
:toctree: generated/
fmin_cobyla
"""
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy.lib.six import callable
from scipy.optimize import _cobyla
from .optimize... |
gmatteo/pymatgen | pymatgen/analysis/chemenv/connectivity/tests/test_environment_nodes.py | #!/usr/bin/env python
__author__ = "waroquiers"
import os
import shutil
import networkx as nx
from pymatgen.analysis.chemenv.connectivity.environment_nodes import (
EnvironmentNode,
get_environment_node,
)
from pymatgen.util.testing import PymatgenTest
try:
import bson # type: ignore # Ignore bson i... |
jasco/authomatic | examples/pyramid/simple/main.py | # -*- coding: utf-8 -*-
# main.py
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
from authomatic import Authomatic
from authomatic.adapters import WebObAdapter
from config import CONFIG
authomatic = Authomatic(config=CONFIG, secret='some ra... |
F483/bikesurf.org | apps/bike/views.py | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Fabian Barkhau <fabian.barkhau@gmail.com>
# License: MIT (see LICENSE.TXT file)
import datetime
from random import shuffle
from dateutil.parser import parse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from... |
anrl/gini | frontend/src/gbuilder/Core/Compiler.py | """The compiler that turns topologies into xml network definitions"""
from Core.Item import nodeTypes
from Core.Device import Device
from Core.globals import options, environ, mainWidgets
from PyQt4 import QtCore
import os, re
class Compiler:
def __init__(self, device_list, filename):
"""
... |
kalle/duplicity | duplicity/compilec.py | #!/usr/bin/env python
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2002 Ben Escoto <ben@emerose.org>
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
#
# This file is part of duplicity.
#
# Duplicity is free software; you can redistribute it and/or modify it
# under the terms of the GNU ... |
Mellthas/quodlibet | quodlibet/qltk/bookmarks.py | # Copyright 2006 Joe Wreschnig
# 2016-17 Nick Boultbee
#
# 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.
# FIXME... |
Yadnyawalkya/integration_tests | cfme/utils/grafana.py | """Wrap interactions with Grafana or logging Grafana URLs."""
from cfme.utils.conf import cfme_performance
from cfme.utils.log import logger
def get_scenario_dashboard_urls(scenario, from_ts, to_ts, output_to_log=True):
"""Builds a dictionary of URLs to Grafana Dashboards of relevant appliances for a single
w... |
tardyp/buildbot | master/buildbot/test/unit/process/test_log.py | # This file is part of Buildbot. Buildbot 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.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
MSusik/invenio | invenio/modules/upgrader/upgrades/invenio_2013_12_04_seqSTORE_larger_value.py | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 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 option) a... |
mortbauer/openfoam-extend-Breeder-other-scripting-PyFoam | PyFoam/ThirdParty/Gnuplot/gp_java.py | # $Id: gp_java.py 291 2006-03-03 08:58:48Z mhagger $
# Copyright (C) 2002-2003 Michael Haggerty <mhagger@alum.mit.edu>
#
# This file is licensed under the GNU Lesser General Public License
# (LGPL). See LICENSE.txt for details.
"""gp_java -- an interface to gnuplot used under Jython/Java.
This file implements a low... |
corvorepack/REPOIVAN | plugin.video.tv.ultra.7k/resources/tools/yt_playlist.py | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# Youtube Playlist para TV Ultra 7K
# Version 0.1 (02.11.2014)
#------------------------------------------------------------
# License: GPL (http://www.gnu.org/licenses/gpl-3.0.html)
# Gracias a la librería plugintools de Jesús (www.m... |
nijel/translate | translate/lang/test_nqo.py | from translate.lang import factory
def test_punctranslate():
"""Tests that we can translate punctuation."""
language = factory.getlanguage("nqo")
assert language.punctranslate("") == ""
assert language.punctranslate("abc efg") == "abc efg"
assert language.punctranslate("abc efg.") == "abc efg."
... |
Passw/gn_GFW | build/linux/dump_app_syms.py | # Copyright 2015 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.
# Helper script to run dump_syms on Chrome Linux executables and strip
# them if needed.
import os
import subprocess
import sys
if len(sys.argv) != 5:
pr... |
Yinameah/linux-show-player | lisp/ui/widgets/qiconpushbutton.py | # -*- coding: utf-8 -*-
#
# This file is part of Linux Show Player
#
# Copyright 2012-2017 Francesco Ceruti <ceppofrancy@gmail.com>
#
# Linux Show Player 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 ... |
justathoughtor2/atomicApe | cygwin/lib/python2.7/site-packages/pylint/test/functional/deprecated_lambda.py | # pylint: disable=missing-docstring,bad-builtin,invalid-name,no-absolute-import
import functools
# Don't do this, use a comprehension instead.
assert map(lambda x: x*2, [1, 2, 3]) == [2, 4, 6] # [deprecated-lambda]
assert filter(lambda x: x != 1, [1, 2, 3]) == [2, 3] # [deprecated-lambda]
# It's still ok to use map... |
vineodd/PIMSim | GEM5Simulation/gem5/src/python/m5/util/dot_writer.py | # Copyright (c) 2012-2013 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functiona... |
zbqf109/goodo | openerp/addons/sale_stock/res_config.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from openerp import SUPERUSER_ID
from openerp import api, fields, models, _
from openerp.exceptions import AccessError
class SaleConfiguration(models.TransientModel):
_inherit = 'sale.config.settings'
module_de... |
djo938/supershell | pyshell/arg/accessor/test/container_test.py | #!/usr/bin/env python -t
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Jonathan Delvaux <pyshell@djoproject.net>
# 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... |
jdemel/gnuradio | gr-filter/examples/gr_filtdes_callback.py | #!/usr/bin/env python
#
# Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import unicode_literals
from gnuradio.filter import filter_design
import sys
try:
from PyQt4 import Qt, ... |
alogg/dolfin | demo/pde/biharmonic/python/demo_biharmonic.py | """This demo program solves the Biharmonic equation,
nabla^4 u(x, y) = f(x, y)
on the unit square with source f given by
f(x, y) = 4 pi^4 sin(pi*x)*sin(pi*y)
and boundary conditions given by
u(x, y) = 0
nabla^2 u(x, y) = 0
using a discontinuous Galerkin formulation (interior penalty method... |
fungjj92/DRIVER | app/driver/settings_travis.py |
"""
Django settings for DRIVER project testing.
Override base settings.py
"""
from driver.settings import *
# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'prs',
'HOST': ... |
veg/idepi | idepi/feature_extraction/_msavectorizer.py |
from numpy import zeros
from sklearn.base import BaseEstimator, TransformerMixin
from idepi.filters import null_filter
from idepi.labeledmsa import LabeledMSA
__all__ = ['MSAVectorizer']
class MSAVectorizer(BaseEstimator, TransformerMixin):
def __init__(self, encoder, filter=null_filter):
self.__ali... |
zxytim/pynojo | utils/test-model.py | # -*- coding: utf-8 -*-
# $File: test-model.py
# $Date: Sun Mar 04 12:05:50 2012 +0800
# $Author: jiakai <jia.kai66@gmail.com>
from os.path import isfile
from sqlalchemy import create_engine, event
from sqlalchemy.orm import sessionmaker
from pynojo.model import install_db
from pynojo.model.user import *
from pynojo... |
klahnakoski/SpotManager | vendor/jx_base/expressions/is_number_op.py | # encoding: utf-8
#
#
# 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
"""
# NOTE:
THE self.lang[operator] PATTERN ... |
aaronsw/watchdog | utils/wyrapp.py | """
web interface to Write Your Rep
"""
import web
import forms, helpers, auth
from users import fill_user_details, update_user_details
from wyrutils import *
from settings import db, render
import writerep
import simplejson
urls = (
'/', 'write_rep',
'/getcaptcha', 'get_captchas',
'/verifyzip', 'verify_z... |
open-craft/edx-analytics-data-api | analyticsdataserver/settings/test.py | """Test settings and globals."""
from analyticsdataserver.settings.base import *
########## IN-MEMORY TEST DATABASE
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": ":memory:",
"USER": "",
"PASSWORD": "",
"HOST": "",
"PORT": "",
},
}
I... |
Curahelper/Cura | plugins/UltimakerMachineActions/__init__.py | # Copyright (c) 2016 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from . import BedLevelMachineAction
from . import UpgradeFirmwareMachineAction
from . import UMOCheckupMachineAction
from . import UMOUpgradeSelection
from . import UM2UpgradeSelection
from UM.i18n import i18nCatalog
catal... |
tanmaykm/edx-platform | lms/djangoapps/gating/signals.py | """
Signal handlers for the gating djangoapp
"""
from django.dispatch import receiver
from opaque_keys.edx.keys import CourseKey, UsageKey
from xmodule.modulestore.django import modulestore
from lms.djangoapps.grades.signals.signals import SCORE_CHANGED
from gating import api as gating_api
@receiver(SCORE_CHANGED)
de... |
wscullin/spack | var/spack/repos/builtin/packages/discovar/package.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
TheTimmy/spack | lib/spack/spack/directory_layout.py | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
iulian787/spack | var/spack/repos/builtin/packages/bamutil/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bamutil(MakefilePackage):
"""bamUtil is a repository that contains several programs
... |
theheros/kbengine | kbe/res/scripts/common/Lib/test/test_grp.py | """Test script for the grp module."""
import unittest
from test import support
grp = support.import_module('grp')
class GroupDatabaseTestCase(unittest.TestCase):
def check_value(self, value):
# check that a grp tuple has the entries and
# attributes promised by the docs
self.... |
Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/idlelib/config.py | """idlelib.config -- Manage IDLE configuration information.
The comments at the beginning of config-main.def describe the
configuration files and the design implemented to update user
configuration information. In particular, user configuration choices
which duplicate the defaults will be removed from the user's
conf... |
scrapinghub/keystone | keystone/assignment/backends/sql.py | # Copyright 2012-13 OpenStack Foundation
#
# 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... |
jonparrott/compute-cassandra-python | tools/create_cluster.py | #!/usr/bin/env python
# Copyright 2013 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 re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.