repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
shipci/boto | refs/heads/develop | tests/unit/dynamodb/test_batch.py | 136 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
rebearteta/social-ideation | refs/heads/master | app/migrations/0004_socialnetworkapp_last_real_time_update_sig.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('app', '0003_auto_20150817_1530'),
]
operations = [
migrations.AddField(
model_name='socialnetworkapp',
... |
infobloxopen/neutron | refs/heads/master | neutron/db/external_net_db.py | 23 | # Copyright (c) 2013 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... |
maropu/spark | refs/heads/master | examples/src/main/python/mllib/correlations_example.py | 27 | #
# 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... |
rettigs/rob421-applied-robotics | refs/heads/master | combined_robot/app.py | 1 | #!/usr/bin/env python
from __future__ import division
import cv
import cv2
import video
from common import draw_str, RectSelector
from mosse import MOSSE
# Constants
LAUNCH = 0
CARRIAGE = 1
class App:
def __init__(self, video_src, robotq, appq, launchspeed, swatted):
self.cap = video.create_capture(vid... |
misli/softwarecollections | refs/heads/master | softwarecollections/tests.py | 24123 | from django.test import TestCase
# Create your tests here.
|
catmaid/CATMAID | refs/heads/master | django/applications/catmaid/management/commands/catmaid_get_auth_token.py | 2 | # -*- coding: utf-8 -*-
import getpass
import logging
from django.contrib.auth import authenticate
from rest_framework.authtoken.models import Token
from django.core.management.base import BaseCommand, CommandError
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "Get an API token for a g... |
jrper/fluidity | refs/heads/master | python/vtktools.py | 4 | #!/usr/bin/env python
import math
import sys
import numpy
import vtk
# All returned arrays are cast into either numpy or numarray arrays
arr=numpy.array
class vtu:
"""Unstructured grid object to deal with VTK unstructured grids."""
def __init__(self, filename = None):
"""Creates a vtu object by reading the s... |
MGautier/security-sensor | refs/heads/master | trunk/Documentacion/Memoria/trozos-codigo/codigo-9-events-test-events-source.py | 2 | def test_events_source(self):
"""
Comprobacion de que la fuente de seguridad, a la que pertenece, es igual a la asociada
Returns:
"""
log_sources = LogSources.objects.get(Type="Iptables")
events = Events.objects.get(ID_Source=log_sources)
self.assertEqual(events.get_source(), log_sources)
|
blueboxgroup/horizon | refs/heads/master | horizon/test/tests/middleware.py | 61 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
mbareta/edx-platform-ft | refs/heads/open-release/eucalyptus.master | openedx/core/lib/api/view_utils.py | 29 | """
Utilities related to API views
"""
import functools
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError, ObjectDoesNotExist
from django.http import Http404
from django.utils.translation import ugettext as _
from rest_framework import status, response
from rest_framework.exceptions import APIExcept... |
NEricN/RobotCSimulator | refs/heads/master | Python/App/Lib/lib2to3/tests/test_refactor.py | 38 | """
Unit tests for refactor.py.
"""
from __future__ import with_statement
import sys
import os
import codecs
import operator
import StringIO
import tempfile
import shutil
import unittest
import warnings
from lib2to3 import refactor, pygram, fixer_base
from lib2to3.pgen2 import token
from . import support
TEST_DAT... |
tknapen/RL_7T_experiment | refs/heads/RL | exp_tools/EyeLinkCoreGraphicsPsychopy.py | 1 | import pylink
RIGHT_EYE = 1
LEFT_EYE = 0
BINOCULAR = 2
HIGH = 1
LOW = 0
WHITE = (255,255,255)
GRAY = GREY = (128,128,128)
BLACK = (0,0,0)
buttons =(0, 0);
class EyeLinkCoreGraphicsPsychopy(pylink.EyeLinkCustomDisplay):
def __init__(self, tracker, display, displaySize):
'''Initialize a Custom ... |
idea4bsd/idea4bsd | refs/heads/idea4bsd-master | python/testData/highlighting/awaitInSetPy35.py | 23 | async def f11(x):
y = {await<error descr="expression expected"> </error>for await<error descr="expression expected"> </error>in []} # fail
await x
def f12(x):
y = {await for await in []}
return x
async def f21(x):
y = {mapper(await<error descr="expression expected">)</error> for await<error des... |
vmindru/ansible | refs/heads/devel | lib/ansible/modules/remote_management/oneview/oneview_network_set_facts.py | 125 | #!/usr/bin/python
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# 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',
... |
missionpinball/mpf-examples | refs/heads/dev | tutorial/step_2/tests/test_step.py | 7 | """Contains tests for the MPF tutorial."""
from mpf.tests.MpfMachineTestCase import MpfMachineTestCase
class TestTutorialMachine(MpfMachineTestCase):
"""Contains tests for the MPF machine config"""
def test_attract(self):
"""Test that machine starts attract."""
self.assertModeRunning('attra... |
USGSDenverPychron/pychron | refs/heads/develop | launchers/pyview.py | 1 | # ===============================================================================
# Copyright 2014 Jake Ross
#
# 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/licens... |
hyperized/ansible | refs/heads/devel | lib/ansible/modules/network/fortios/fortios_icap_profile.py | 13 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# 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 Lic... |
nju520/django | refs/heads/master | tests/view_tests/default_urls.py | 405 | from django.conf.urls import url
from django.contrib import admin
urlpatterns = [
# This is the same as in the default project template
url(r'^admin/', admin.site.urls),
]
|
Russell-IO/ansible | refs/heads/devel | lib/ansible/modules/network/netscaler/netscaler_gslb_service.py | 72 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
# 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',
... |
haiyangd/server-watch-client- | refs/heads/master | modules/local.py | 2 | # -*- coding: utf-8 -*-
from modules.base_module import BaseModule
from monitoring.services import service_is_running
from monitoring.system import system_load, system_uptime, system_resources_summary
class UptimeMonitor(BaseModule):
def run(self):
self.log(system_uptime())
class LoadMonitor(BaseModule)... |
takeshineshiro/cinder | refs/heads/master | cinder/tests/unit/test_api_urlmap.py | 17 | # Copyright (c) 2013 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 required by applicab... |
danduggan/hltd | refs/heads/master | lib/elasticsearch-py-1.4/elasticsearch/connection/http_urllib3.py | 2 | import time
import urllib3_hltd as urllib3
from urllib3_hltd.exceptions import ReadTimeoutError, SSLError as UrllibSSLError
import warnings
from .base import Connection
from ..exceptions import ConnectionError, ImproperlyConfigured, ConnectionTimeout, SSLError
from ..compat import urlencode
class Urllib3HttpConnectio... |
allenp/odoo | refs/heads/9.0 | addons/payment_buckaroo/controllers/main.py | 10 | # -*- coding: utf-8 -*-
import json
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class BuckarooController(http.Controller):
_return_url = '/payment/buckaroo/return'
_cancel_url = '/payment/buckaroo/... |
rmcgibbo/mongo-task | refs/heads/master | mongo_task/__init__.py | 12133432 | |
mammique/django | refs/heads/tp_alpha | django/contrib/gis/db/backends/__init__.py | 12133432 | |
eduNEXT/edx-platform | refs/heads/master | openedx/core/djangoapps/user_authn/__init__.py | 12133432 | |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v21/tests/check_framework/tests.py | 56 | import sys
from io import StringIO
from django.apps import apps
from django.core import checks
from django.core.checks import Error, Warning
from django.core.checks.registry import CheckRegistry
from django.core.management import call_command
from django.core.management.base import CommandError
from django.db import m... |
feynmanliang/bachbot | refs/heads/master | Chorale-Beat-Count.py | 1 | from music21 import *
#Filter for every Bach chorale that is in 4/4:
catalog = stream.Opus()
for workName in corpus.getBachChorales():
work = converter.parse(workName)
firstTS = work.flat.getTimeSignatures()[0]
if firstTS.ratioString == '4/4':
catalog.append(work)
#Count usages
allbeats = list();
for p in c... |
omgbebebe/warzone2100 | refs/heads/master | tools/conversion/ini2json/ini2json_challenge.py | 9 | import ConfigParser
import json
import sys
if len(sys.argv) < 2:
print 'Need file parameter'
sys.exit(1)
config = ConfigParser.ConfigParser()
config.optionxform = str # stop making keys lowercase
config.read(sys.argv[1])
def is_number(s):
try:
int(s)
return True
except ValueError:
return False
data = {}
f... |
hobbeswalsh/tensor | refs/heads/master | tensor/outputs/riemann.py | 1 | import time
from twisted.internet import reactor, defer, task
from twisted.python import log
try:
from OpenSSL import SSL
from twisted.internet import ssl
except:
SSL=None
from tensor.protocol import riemann
from tensor.objects import Output
if SSL:
class ClientTLSContext(ssl.ClientContextFactory):... |
yangdw/PyRepo | refs/heads/master | src/annotation/Firefly/gfirefly/management/commands/reloadmodule.py | 16 | #coding:utf8
'''
Created on 2013-8-12
@author: lan (www.9miao.com)
'''
import urllib,sys
def execute(*args):
"""
"""
if not args:
masterport =9998
else:
masterport = int(args[0])
url = "http://localhost:%s/reloadmodule"%masterport
try:
response = urllib.urlopen(url)
... |
lulandco/SickRage | refs/heads/develop | lib/mako/ext/extract.py | 76 | import re
from mako import compat
from mako import lexer
from mako import parsetree
class MessageExtractor(object):
def process_file(self, fileobj):
template_node = lexer.Lexer(
fileobj.read(),
input_encoding=self.config['encoding']).parse()
for extracted in self.extract_n... |
SuperDARNCanada/borealis | refs/heads/master | experiments/testing_archive/test_wavetype_not_defined.py | 4 | #!/usr/bin/python
# write an experiment that raises an exception
import sys
import os
BOREALISPATH = os.environ['BOREALISPATH']
sys.path.append(BOREALISPATH)
import experiments.superdarn_common_fields as scf
from experiment_prototype.experiment_prototype import ExperimentPrototype
class TestExperiment(ExperimentP... |
mfherbst/spack | refs/heads/develop | var/spack/repos/builtin/packages/sqlitebrowser/package.py | 4 | ##############################################################################
# Copyright (c) 2013-2018, 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... |
metacloud/python-neutronclient | refs/heads/mc/2013.1.7 | neutronclient/neutron/v2_0/quota.py | 5 | # Copyright 2012 OpenStack LLC.
# 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... |
earsneyes/ardupilot | refs/heads/master | Tools/autotest/common.py | 142 | import util, pexpect, time, math
from pymavlink import mavwp
# a list of pexpect objects to read while waiting for
# messages. This keeps the output to stdout flowing
expect_list = []
def expect_list_clear():
'''clear the expect list'''
global expect_list
for p in expect_list[:]:
expect_list.remov... |
micropython/micropython | refs/heads/master | examples/rp2/pio_uart_rx.py | 5 | # Example using PIO to create a UART RX interface.
#
# To make it work you'll need a wire connecting GPIO4 and GPIO3.
#
# Demonstrates:
# - PIO shifting in data on a pin
# - PIO jmp(pin) instruction
# - PIO irq handler
# - using the second core via _thread
import _thread
from machine import Pin, UART
from rp2 ... |
arnavd96/Cinemiezer | refs/heads/master | myvenv/lib/python3.4/site-packages/botocore/vendored/requests/packages/chardet/jisfreq.py | 3130 | ######################## 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... |
apache/airflow | refs/heads/main | airflow/providers/amazon/aws/hooks/dynamodb.py | 3 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
glwu/python-for-android | refs/heads/master | python-build/python-libs/xmpppy/doc/examples/xsend.py | 87 | #!/usr/bin/python
# $Id: xsend.py,v 1.8 2006/10/06 12:30:42 normanr Exp $
import sys,os,xmpp,time
if len(sys.argv) < 2:
print "Syntax: xsend JID text"
sys.exit(0)
tojid=sys.argv[1]
text=' '.join(sys.argv[2:])
jidparams={}
if os.access(os.environ['HOME']+'/.xsend',os.R_OK):
for ln in open(os.environ['HOME... |
asurve/incubator-systemml | refs/heads/master | scripts/perftest/python/run_perftest.py | 13 | #!/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 ... |
spensmith/ops-devbox | refs/heads/master | action_plugins/copyv.py | 5 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@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) an... |
zedr/django | refs/heads/master | tests/comment_tests/custom_comments/views.py | 182 | from django.http import HttpResponse
def custom_submit_comment(request):
return HttpResponse("Hello from the custom submit comment view.")
def custom_flag_comment(request, comment_id):
return HttpResponse("Hello from the custom flag view.")
def custom_delete_comment(request, comment_id):
return HttpResp... |
jangorecki/h2o-3 | refs/heads/master | h2o-py/tests/testdir_hdfs/pyunit_INTERNAL_HDFS_airlines_glrm_profile.py | 4 | from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import h2o
import time
from tests import pyunit_utils
from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator
#----------------------------------------------------------------------
# Purpose: This test is to run GLRM on airline data ... |
suneeshtr/persona | refs/heads/master | node_modules/l/node_modules/hook.io/node_modules/npm/node_modules/node-gyp/gyp/test/generator-output/gyptest-actions.py | 74 | #!/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.
"""
Verifies --generator-output= behavior when using actions.
"""
import TestGyp
# Ninja and Android don't support --generator-output.
tes... |
rfguri/vimfiles | refs/heads/master | bundle/ycm/third_party/ycmd/third_party/requests/requests/packages/chardet/eucjpprober.py | 2918 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... |
prmdsharma/PredictionIO | refs/heads/develop | examples/experimental/scala-parallel-recommendation-entitymap/data/import_eventserver.py | 48 | """
Import sample data for recommendation engine
"""
import predictionio
import argparse
import random
SEED = 3
def import_events(client):
random.seed(SEED)
count = 0
print "Importing data..."
# generate 10 users, with user uid1,2,....,10
# with some random attributes
user_ids = [ ("uid"+str(i)) for i i... |
UOMx/edx-platform | refs/heads/master | cms/djangoapps/contentstore/__init__.py | 12133432 | |
IRI-Research/django | refs/heads/master | tests/many_to_one_regress/__init__.py | 12133432 | |
crateio/crate.pypi | refs/heads/master | crate/pypi/simple/__init__.py | 12133432 | |
mig5/felicity | refs/heads/master | fabfile.py | 1 | from fabric.api import *
import ConfigParser
def deploy(server):
env.user = 'root'
# Fetch some values from the config file
# @TODO fix this so that fabfile doesn't depend on ConfigParser at all
config = ConfigParser.RawConfigParser()
config.read('config/felicity.ini')
# The Duplicity... |
geraldinepascal/FROGS | refs/heads/master | assessment/bin/qiime_completTax.py | 1 | #!/usr/bin/env python2.7
#
# Copyright (C) 2016 INRA
#
# 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 ... |
lazy404/ansible-for-devops | refs/heads/master | dynamic-inventory/digitalocean/digital_ocean.py | 63 | #!/usr/bin/env python
'''
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
d... |
lemieuxl/pyGenClean | refs/heads/master | docs/conf.py | 1 | # -*- coding: utf-8 -*-
#
# pyGenClean documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 12 15:08:13 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
OpenDMM/bitbake | refs/heads/master | lib/bb/event.py | 2 | # ex:ts=4:sw=4:sts=4:et
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
"""
BitBake 'Event' implementation
Classes and functions for manipulating 'events' in the
BitBake build tools.
"""
# Copyright (C) 2003, 2004 Chris Larson
#
# This program is free software; you can redistribute it and/or modify
... |
gauravbose/digital-menu | refs/heads/master | django/core/cache/backends/locmem.py | 586 | "Thread-safe in-memory cache backend."
import time
from contextlib import contextmanager
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.utils.synch import RWLock
try:
from django.utils.six.moves import cPickle as pickle
except ImportError:
import pickle
# Global in-memor... |
bak1an/django | refs/heads/master | tests/decorators/tests.py | 53 | from functools import update_wrapper, wraps
from unittest import TestCase
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import (
login_required, permission_required, user_passes_test,
)
from django.http import HttpRequest, HttpResponse, HttpResponseNotA... |
QuLogic/python-future | refs/heads/master | src/future/moves/dbm/ndbm.py | 83 | from __future__ import absolute_import
from future.utils import PY3
if PY3:
from dbm.ndbm import *
else:
__future_module__ = True
from dbm import *
|
ettm2012/MissionPlanner | refs/heads/master | Lib/macpath.py | 49 | """Pathname and path-related operations for the Macintosh."""
import os
import warnings
from stat import *
import genericpath
from genericpath import *
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getat... |
nicolargo/intellij-community | refs/heads/master | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_except.py | 326 | """Fixer for except statements with named exceptions.
The following cases will be converted:
- "except E, T:" where T is a name:
except E as T:
- "except E, T:" where T is not a name, tuple or list:
except E as t:
T = t
This is done because the target of an "except" clause must be a
... |
davidwaroquiers/pymatgen | refs/heads/master | pymatgen/util/sequence.py | 5 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
This module provides utilities to chunk large sequences and display progress
bars during processing.
"""
import math
def get_chunks(sequence, size=1):
"""
Args:
sequence ():
size ... |
hclivess/Stallion | refs/heads/master | nuitka/Cryptodome/SelfTest/Hash/__init__.py | 5 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/__init__.py: Self-test for hash modules
#
# 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 dedication to t... |
vbannai/neutron | refs/heads/master | neutron/plugins/vmware/nsxlib/versioning.py | 36 | # Copyright 2014 VMware, 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 a... |
fnouama/intellij-community | refs/heads/master | python/testData/quickFixes/PyAugmentAssignmentQuickFixTest/simple.py | 83 | <weak_warning descr="Assignment can be replaced with augmented assignment">var = <caret>var + 3</weak_warning>
|
animekita/selvbetjening | refs/heads/master | selvbetjening/sadmin2/templatetags/sadmin2_menu.py | 1 |
from django import template
from django.core.urlresolvers import reverse
register = template.Library()
@register.simple_tag(takes_context=True)
def sadmin2_emit_name(context, menu_item):
if 'name' in menu_item:
return menu_item['name']
return menu_item['name_callback'](context)
@register.simple_... |
jackrzhang/zulip | refs/heads/master | tools/setup/__init__.py | 12133432 | |
52-41-4d/fs-generic | refs/heads/master | flowexport/__init__.py | 12133432 | |
GheRivero/ansible | refs/heads/devel | test/units/modules/network/iosxr/__init__.py | 12133432 | |
rouault/Quantum-GIS | refs/heads/master | python/plugins/processing/algs/saga/ext/__init__.py | 12133432 | |
firmanm/ansible | refs/heads/devel | lib/ansible/plugins/shell/powershell.py | 35 | # (c) 2014, Chris Church <chris@ninemoreminutes.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 lat... |
sumit4iit/django-guardian | refs/heads/master | guardian/backends.py | 12 | from django.db import models
from guardian.conf import settings
from guardian.exceptions import WrongAppError
from guardian.core import ObjectPermissionChecker
from guardian.models import User
class ObjectPermissionBackend(object):
supports_object_permissions = True
supports_anonymous_user = True
supports... |
mickburgs/taxi-sam | refs/heads/master | node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py | 1824 | # Copyright (c) 2011 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.
"""gypd output module
This module produces gyp input as its output. Output files are given the
.gypd extension to avoid overwriting the .gyp files that they are ... |
Distrotech/reportlab | refs/heads/master | tests/test_pdfgen_callback.py | 15 | #!/bin/env python
#Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
__doc__='checks callbacks work'
__version__=''' $Id$ '''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import unittest
from reportlab.pdfgen.canvas import ... |
alaski/nova | refs/heads/master | nova/virt/block_device.py | 2 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
olemis/sqlalchemy | refs/heads/master | examples/sharding/__init__.py | 30 | """A basic example of using the SQLAlchemy Sharding API.
Sharding refers to horizontally scaling data across multiple
databases.
The basic components of a "sharded" mapping are:
* multiple databases, each assigned a 'shard id'
* a function which can return a single shard id, given an instance
to be saved; this is c... |
lamby/live-studio | refs/heads/master | contrib/django/conf/project_template/__init__.py | 12133432 | |
bumper-app/bumper-bianca | refs/heads/master | bianca/orm/__init__.py | 12133432 | |
lwiecek/django | refs/heads/master | tests/admin_scripts/management/commands/__init__.py | 12133432 | |
DamienIrving/ocean-analysis | refs/heads/master | data_processing/calc_annual.py | 1 | """
Filename: calc_annual.py
Author: Damien Irving, irving.damien@gmail.com
Description: Apply annual timescale smoothing
"""
# Import general Python modules
import sys, os, pdb
import argparse
import iris
import cmdline_provenance as cmdprov
# Import my modules
cwd = os.getcwd()
repo_dir = '/'
for direc... |
40223247/2015cdb_0622 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/browser/websocket.py | 618 | from browser import window
import javascript
WebSocket = javascript.JSConstructor(window.WebSocket) |
jeffchao/xen-3.3-tcg | refs/heads/master | tools/python/build/lib.linux-i686-2.6/xen/xend/XendBase.py | 8 | #!/usr/bin/python
#============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distribu... |
Adel-Magebinary/odoo | refs/heads/8.0 | addons/website_project/models/__init__.py | 391 | import website_project |
tchellomello/home-assistant | refs/heads/dev | homeassistant/components/totalconnect/binary_sensor.py | 14 | """Interfaces with TotalConnect sensors."""
import logging
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_DOOR,
DEVICE_CLASS_GAS,
DEVICE_CLASS_SMOKE,
BinarySensorEntity,
)
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass, entry, asy... |
tis-intern-apparel/ApparelStrategy | refs/heads/master | server/dialogue_system/backend/apis/__init__.py | 1349 | # -*- coding: utf-8 -*- |
PaddlePaddle/models | refs/heads/develop | PaddleCV/video/application/video_tag/tsn_extractor.py | 1 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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... |
sxjscience/tvm | refs/heads/master | tests/python/contrib/test_arm_compute_lib/test_reshape.py | 2 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
vaygr/ansible | refs/heads/devel | lib/ansible/plugins/action/fail.py | 31 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2012, Dag Wieers <dag@wieers.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 ... |
40223236/2015cd_midterm_1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/importlib/machinery.py | 635 | """The machinery of importlib: finders, loaders, hooks, etc."""
import _imp
from ._bootstrap import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
OPTIMIZED_BYTECODE_SUFFIXES, #BYTECODE_SUFFIXES,
EXTENSION_SUFFIXES)
from ._bootstrap import BuiltinImporter
from ._bootstrap... |
remybaranx/qtaste | refs/heads/master | tools/jython/lib/Lib/encodings/koi8_r.py | 9 | """ Python Character Mapping Codec generated from 'KOI8-R.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... |
barbour-em/osf.io | refs/heads/develop | website/util/rubeus.py | 1 | # -*- coding: utf-8 -*-
"""Contains helper functions for generating correctly
formatted hgrid list/folders.
"""
import datetime
import hurry.filesize
from modularodm import Q
from framework.auth.decorators import Auth
from website.util import paths
from website.util import sanitize
from website.settings import (
... |
TeachAtTUM/edx-platform | refs/heads/master | common/djangoapps/third_party_auth/models.py | 3 | # -*- coding: utf-8 -*-
"""
Models used to implement SAML SSO support in third_party_auth
(inlcuding Shibboleth support)
"""
from __future__ import absolute_import
import json
import logging
import re
from config_models.models import ConfigurationModel, cache
from django.conf import settings
from django.contrib.sites... |
rvlad1987/repository.rvlad1987.xbmc-addons | refs/heads/master | helix/source/plugin.video.diafilms/resources/__init__.py | 12133432 | |
xaviercobain88/framework-python | refs/heads/master | build/lib.linux-i686-2.7/openerp/addons/point_of_sale/wizard/pos_discount.py | 55 | # -*- 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... |
CGATOxford/Optic | refs/heads/master | scripts/tree2svg.py | 1 | '''
tree2svg.py - plot a tree in svg format
========================================
:Author: Andreas Heger
:Release: $Id$
:Date: |today|
:Tags: Python
Purpose
-------
plot a tree in New-Hampshire format. The output is svg.
Usage
-----
Type::
python <script_name>.py --help
for command line help.
Examples
---... |
javierj/kobudo-katas | refs/heads/master | Kata-RestConsumer/main.py | 1 | __author__ = 'Javier'
from gindex_presenter import GIndexPresenter
class ConsoleView(object):
def show_gindex(self, gindex):
print("Gindex: ", gindex)
# Runner
presenter = GIndexPresenter(ConsoleView())
presenter.request_gindex_for("Pybonacci", "scikit-aero")
|
skrueger111/zazzie | refs/heads/dev | src/sassie/tools/contrast_calculator/gui_mimic_contrast_calculator.py | 2 | '''
Driver method to run the contrast calculator module
'''
import sys
import os
import shutil
import time
import sassie.tools.contrast_calculator.contrast_calculator as contrast_calculator
#import contrast_calculator as contrast_calculator
import sassie.interface.input_filter as input_filter
import sassie.interface.... |
VigneshMohan1/spark-branch-2.3 | refs/heads/master | python/pyspark/sql/streaming.py | 12 | #
# 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... |
cmorgan/zipline | refs/heads/master | zipline/utils/tradingcalendar_lse.py | 35 | #
# Copyright 2013 Quantopian, 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 wr... |
ejconlon/bottle-bootstrap | refs/heads/master | bottle.py | 6 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with url parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.