repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
G-P-S/depot_tools | refs/heads/master | recipes/nacl.py | 22 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
import recipe_util # pylint: disable=F0401
# This class doesn't need an __init__ method, so we disable the warning
# pylint: disable=W0232
cla... |
marwoodandrew/superdesk-core | refs/heads/master | superdesk/vocabularies/__init__.py | 9 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from .vocabu... |
koobonil/Boss2D | refs/heads/master | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/contrib/keras/python/keras/layers/convolutional.py | 15 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
pombreda/django-hotclub | refs/heads/master | libs/external_libs/ybrowserauth/setup.py | 5 | # ybrowserauth installation script
#
from distutils.core import setup
setup(name='ybrowserauth',
version='1.2',
py_modules=['ybrowserauth'],
license='http://www.opensource.org/licenses/bsd-license.php',
url='http://developer.yahoo.com/auth',
description='Lets you add Yahoo! Brows... |
sorenh/cc | refs/heads/master | vendor/Twisted-10.0.0/twisted/spread/ui/__init__.py | 81 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Twisted Spread UI: UI utilities for various toolkits connecting to PB.
"""
# Undeprecating this until someone figures out a real plan for alternatives to spread.ui.
##import warnings
##warnings.warn("twisted.spread.ui is deprecate... |
RobinPetit/OpenWifiLocalizator | refs/heads/master | GraphMaker/app/database/tables.py | 1 | class PlanTable:
def __init__(self, name, ppm, on_parent, bg_coord, angle, image_dir):
assert type(on_parent) is type(bg_coord) is tuple
self.image_dir = image_dir
self.name = name
self.ppm = ppm
self.on_parent = on_parent
self.bg_coord = bg_coord
self.angle =... |
jabbalaci/PrimCom | refs/heads/master | data/python/join_url.py | 1 | import urlparse
base = 'http://example.com/'
fname = 'img.jpg'
print urlparse.urljoin(base, fname) # http://example.com/img.jpg
|
ibm-cds-labs/pixiedust | refs/heads/master | pixiedust/display/tests/test2.py | 1 | # -------------------------------------------------------------------------------
# Copyright IBM Corp. 2017
#
# 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... |
wanghongjuan/meta-iotqa-1 | refs/heads/master | lib/oeqa/runtime/security/ca_certificate.py | 3 | #!/usr/bin/env python
#
# Author: Alexandru Cornea <alexandru.cornea@intel.com>
import unittest
import os
import random
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.decorators import *
from oeqa.utils.helper import get_files_dir
@tag(TestType = 'FVT', FeatureID = 'IOTOS-431')
class TestCACertificate(oeRunti... |
DanielWinklehner/py_particle_processor | refs/heads/master | py_particle_processor/drivers/OPALDriver/__init__.py | 1 | from OPALDriver import *
|
naturali/tensorflow | refs/heads/r0.11 | tensorflow/python/kernel_tests/edit_distance_op_test.py | 21 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
Andypsamp/CODjunit | refs/heads/master | beets/ui/__init__.py | 9 | # This file is part of beets.
# Copyright 2015, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, ... |
mistercrunch/airflow | refs/heads/master | tests/providers/openfaas/__init__.py | 5130 | #
# 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... |
EttusResearch/gnuradio | refs/heads/master | gnuradio-runtime/python/gnuradio/gr/exceptions.py | 78 | #
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version.
#
#... |
jigarkb/CTCI | refs/heads/master | LeetCode/922-E-SortArrayByParityII.py | 2 | # Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even.
#
# Sort the array so that whenever A[i] is odd, i is odd; and whenever A[i] is even, i is even.
#
# You may return any answer array that satisfies this condition.
#
#
#
# Example 1:
#
# Input: [4,2,5,7]
#... |
dkorolev/tarantool | refs/heads/master | test/long_run/finalizers.test.py | 8 | import os
import sys
import re
import yaml
from lib.tarantool_server import TarantoolServer
server = TarantoolServer(server.ini)
server.script = 'long_run/lua/finalizers.lua'
server.vardir = os.path.join(server.vardir, 'finalizers')
try:
server.deploy()
except:
print "Expected error:", sys.exc_info()[0]
else:
... |
rajpushkar83/cloudmesh | refs/heads/master | cloudmesh/metric/openstack/cm_metric_openstack.py | 1 | from cloudmesh.config.cm_config import get_mongo_db
class cm_metric_openstack:
def __init__(self, collection=None):
if collection is None:
collection = "metric"
self.db_qstat = get_mongo_db(collections)
def update(self, query, values=None):
'''
executes a query ... |
dmnfarrell/mirnaseq | refs/heads/master | doc/source/conf.py | 2 | # -*- coding: utf-8 -*-
#
# pandastable documentation build configuration file, created by
# sphinx-quickstart on Wed Feb 5 22:43:09 2014.
#
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
extensions = [
'sphinx.ext.auto... |
joelstanner/electrum | refs/heads/master | plugins/keepkey/cmdline.py | 3 | from keepkey import KeepKeyPlugin
from electrum.util import print_msg
class KeepKeyCmdLineHandler:
def get_passphrase(self, msg):
import getpass
print_msg(msg)
return getpass.getpass('')
def get_pin(self, msg):
t = { 'a':'7', 'b':'8', 'c':'9', 'd':'4', 'e':'5', 'f':'6', 'g':'1... |
michaelgallacher/intellij-community | refs/heads/master | python/helpers/py2only/docutils/parsers/rst/languages/sk.py | 128 | # $Id: sk.py 7119 2011-09-02 13:00:23Z milde $
# Author: Miroslav Vasko <zemiak@zoznam.sk>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be
# translated fo... |
fermasia/kernel_v700 | refs/heads/master | tools/perf/scripts/python/syscall-counts.py | 11181 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... |
Ingenico-ePayments/connect-sdk-python3 | refs/heads/master | ingenico/connect/sdk/merchant/services/__init__.py | 128 | #
# This file was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1
#
|
caiych/zsh-multi-line | refs/heads/master | split_lines.py | 1 | #! /usr/bin/python
import sys
raw = sys.stdin.read()
tokens = raw.split(' ')
splitted = []
last = 0
for token in tokens:
if last + len(token) > 80:
splitted.append('\\\n')
last = 0
last += len(token)
splitted.append(token)
sys.stdout.write(' '.join(splitted))
|
huihoo/reader | refs/heads/master | vendor/haystack/management/commands/update_index.py | 2 | from datetime import timedelta
from optparse import make_option
import logging
import os
from django import db
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import LabelCommand
from django.db import reset_queries
from django.utils.encoding imp... |
dorotan/pythontraining | refs/heads/master | env/Lib/site-packages/setuptools/monkey.py | 71 | """
Monkey patching of distutils.
"""
import sys
import distutils.filelist
import platform
import types
import functools
from .py26compat import import_module
from setuptools.extern import six
import setuptools
__all__ = []
"""
Everything is private. Contact the project team
if you think you need this functionality... |
komsas/OpenUpgrade | refs/heads/master | addons/account/partner.py | 29 | # -*- 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... |
yokose-ks/edx-platform | refs/heads/gacco3/master | common/lib/xmodule/xmodule/tests/test_crowdsource_hinter.py | 13 | """
Tests the crowdsourced hinter xmodule.
"""
from mock import Mock, MagicMock
import unittest
import copy
from xmodule.crowdsource_hinter import CrowdsourceHinterModule
from xmodule.vertical_module import VerticalModule, VerticalDescriptor
from xblock.field_data import DictFieldData
from xblock.fragment import Frag... |
machinalis/iepy | refs/heads/develop | tests/test_rules.py | 2 | from unittest import mock
from iepy.extraction import rules
from iepy.data.models import RichToken
from .manager_case import ManagerTestCase
from .factories import EvidenceFactory
class TestCachedSegmentEnrichedTokens(ManagerTestCase):
def setUp(self):
rules.cached_segment_enriched_tokens.cache_clear()
... |
joeythesaint/yocto-autobuilder | refs/heads/master | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/web/test/test_xml.py | 40 | # -*- test-case-name: twisted.web.test.test_xml -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Some fairly inadequate testcases for Twisted XML support.
"""
from twisted.trial.unittest import TestCase
from twisted.web import sux
from twisted.web import microdom
from twisted.web import... |
harpribot/deep-summarization | refs/heads/master | models/gru_stacked_simple.py | 1 | import tensorflow as tf
from models.stacked_simple import StackedSimple
class GruStackedSimple(StackedSimple):
def __init__(self, review_summary_file, checkpointer, num_layers, attention=False):
"""
:param review_summary_file:
:param checkpointer:
:param num_layers:
:param... |
cslzchen/osf.io | refs/heads/develop | framework/transactions/handlers.py | 9 | # -*- coding: utf-8 -*-
from rest_framework import status as http_status
import logging
from framework.exceptions import HTTPError
from django.db import transaction
from flask import request, current_app, has_request_context, _request_ctx_stack
from werkzeug.local import LocalProxy
LOCK_ERROR_CODE = http_status.HTT... |
metaml/nupic | refs/heads/master | tests/external/__init__.py | 463 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
xHeliotrope/injustice_dropper | refs/heads/master | env/lib/python3.4/site-packages/pip/_vendor/retrying.py | 934 | ## Copyright 2013-2014 Ray Holder
##
## 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 ... |
bodylabs/drf-to-s3 | refs/heads/master | drf_to_s3/tests/test_serializers.py | 2 | import datetime, json, unittest
from django.core.exceptions import ValidationError
class DefaultPolicySerializerTest(unittest.TestCase):
def setUp(self):
from drf_to_s3.serializers import DefaultPolicySerializer
self.serializer_class = DefaultPolicySerializer
def test_serialize_is_valid(self... |
mjirayu/sit_academy | refs/heads/master | common/lib/capa/capa/inputtypes.py | 39 | #
# File: courseware/capa/inputtypes.py
#
"""
Module containing the problem elements which render into input objects
- textline
- textbox (aka codeinput)
- schematic
- choicegroup (aka radiogroup, checkboxgroup)
- javascriptinput
- imageinput (for clickable image)
- optioninput (for option list)
- filesubmission (... |
cbrewster/servo | refs/heads/master | tests/wpt/web-platform-tests/x-frame-options/support/xfo.py | 43 | def main(request, response):
headers = [("Content-Type", "text/html"), ("X-Frame-Options", request.GET.first("value"))]
if "value2" in request.GET:
headers.append(("X-Frame-Options", request.GET.first("value2")))
body = """<!DOCTYPE html>
<html>
<head>
<title>XFO.</title>
... |
Amitgb14/sos | refs/heads/master | sos/plugins/sar.py | 11 | # 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.
# This program is distributed in the hope that it will be useful,
# but... |
bhairavmehta95/flashcard-helper-alexa-skill | refs/heads/master | venv/lib/python2.7/site-packages/wheel/test/test_keys.py | 565 | import tempfile
import os.path
import unittest
import json
from wheel.signatures import keys
wheel_json = """
{
"verifiers": [
{
"scope": "+",
"vk": "bp-bjK2fFgtA-8DhKKAAPm9-eAZcX_u03oBv2RlKOBc"
},
{
"scope": "+",
"vk": "KAHZBfyqFW3OcFDbLSG4nPCjXxUPy72phP9I4Rn9MAo"
},
... |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/loot/creature_loot/kashyyyk_loot/mouf_pelt_01.py | 85615 | import sys
def setup(core, object):
return |
sandeepgupta2k4/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/distributions/multinomial_test.py | 48 | # 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... |
onitake/ansible | refs/heads/devel | lib/ansible/modules/network/onyx/onyx_bgp.py | 66 | #!/usr/bin/python
#
# Copyright: Ansible Project
# 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'],
... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/lib/python2.6/dist-packages/twisted/spread/jelly.py | 2 | ../../../../../share/pyshared/twisted/spread/jelly.py |
JonnyFunFun/django-cufon | refs/heads/master | cufon/tests/tests.py | 1 | from django.test import TestCase
from django.template.loader import get_template_from_string
from django.template import Context, TemplateSyntaxError
import re
class TestHeadTags(TestCase):
def setUp(self):
pass
def tearDown(self):
pass
def test_cufon_script_tag(self):
template =... |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/calendar.py | 122 | """Calendar printing functions
Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday)."""
import sys
import da... |
solring/TWCompanyTree | refs/heads/master | TWCTenv/lib/python2.7/site-packages/jinja2/testsuite/imports.py | 404 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.imports
~~~~~~~~~~~~~~~~~~~~~~~~
Tests the import features (with includes).
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Environm... |
Chiil/microhh | refs/heads/master | cases/ib_sine/sine_input.py | 5 | import numpy as np
import matplotlib.pylab as pl
import netCDF4 as nc
from microhh_tools import * # available in MICROHH_DIR/python; copy to this directory
# Class to create a smooth stretched vertical grid
class Grid:
def __init__(self, kmax, nloc1, nbuf1, dz1, dz2):
dn = 1./kmax
n ... |
wangyongtan/H5 | refs/heads/master | common/test11/test-1.py | 1 | #Fibonacci series:斐波纳契数列
#两个元素的总和确定下一个数
a,b = 0,1
while b<1000:
print(b,end=',')
#关键字end可以用于将结果输出到同一行,
# 或者在输出的末尾添加不同的字符
a,b = b,a+b
|
PaulieC/rls-c | refs/heads/master | ClientPackage/PlayerGUI.py | 2 | __author__ = "Paul Council, Anand Patel"
__version__ = "sprint5"
from Tkinter import *
import tkMessageBox
from PlayerClient import *
from AvailablePlayers.TestPlayer1 import *
import importlib
player = TestPlayer1()
client = PlayerClient(player)
def list_files(path):
"""
Lists files inside the given path
... |
eval1749/elang | refs/heads/master | build/android/devil/android/perf/perf_control_unittest.py | 17 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# pylint: disable=W0212
import os
import sys
import unittest
sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir))
from devil.andr... |
Bryukh-Checkio-Tasks/checkio-task-loading-cargo | refs/heads/master | verification/referee.py | 46 | from checkio.signals import ON_CONNECT
from checkio import api
from checkio.referees.io import CheckiOReferee
from tests import TESTS
api.add_listener(
ON_CONNECT,
CheckiOReferee(tests=TESTS).on_ready)
|
CiscoSystems/quantum | refs/heads/master | neutron/plugins/nicira/api_client/request_eventlet.py | 12 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira, 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... |
gofortargets/CNN_brandsafety | refs/heads/master | data_helpers.py | 1 | import numpy as np
import re
from sklearn.datasets import fetch_20newsgroups
from sklearn.datasets import load_files
def batch_iter(data, batch_size, num_epochs, shuffle=True):
"""
Generates a batch iterator for a dataset.
"""
data = np.array(data)
data_size = len(data)
num_batches_per_epoch = ... |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/modules/network/aci/aci_interface_selector_to_switch_policy_leaf_profile.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Bruno Calogero <brunocalogero@hotmail.com>
# 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_... |
mungerd/plastex | refs/heads/master | plasTeX/Base/LaTeX/Crossref.py | 8 | #!/usr/bin/env python
"""
C.11.2 Cross-References (p209)
"""
from plasTeX import Command, Environment
class label(Command):
args = 'label:id'
class ref(Command):
args = 'label:idref'
class pageref(Command):
args = 'label:idref'
|
Eugene-Dobrorodnov/prom_chat | refs/heads/master | prom_chat/registration/admin.py | 13848 | from django.contrib import admin
# Register your models here.
|
Gigatron/git | refs/heads/master | git_remote_helpers/util.py | 46 | #!/usr/bin/env python
"""Misc. useful functionality used by the rest of this package.
This module provides common functionality used by the other modules in
this package.
"""
import sys
import os
import subprocess
try:
from subprocess import CalledProcessError
except ImportError:
# from python2.7:subproces... |
c0ntribut0r/django-mptt-urls | refs/heads/master | mptt_urls/__init__.py | 1 | from django.conf import settings
from django.utils.module_loading import import_string
def _load(module):
return import_string(module) if isinstance(module, str) else module
class view():
def __init__(self, model, view, slug_field='slug', trailing_slash=getattr(settings, 'APPEND_SLASH', True)):
self... |
mikelambert/flask-admin | refs/heads/master | examples/auth/app.py | 7 | import os
from flask import Flask, url_for, redirect, render_template, request, abort
from flask_sqlalchemy import SQLAlchemy
from flask_security import Security, SQLAlchemyUserDatastore, \
UserMixin, RoleMixin, login_required, current_user
from flask_security.utils import encrypt_password
import flask_admin
from f... |
adrianbrink/tendereum | refs/heads/master | vendor/github.com/ethereumproject/go-ethereum/_vendor-20171227092235/github.com/ethereumproject/ethash/test/python/test_pyethash.py | 35 | import pyethash
from random import randint
def test_get_cache_size_not_None():
for _ in range(100):
block_num = randint(0,12456789)
out = pyethash.get_cache_size(block_num)
assert out != None
def test_get_full_size_not_None():
for _ in range(100):
block_num = randint(0,12456789... |
surhudm/scipy | refs/heads/master | scipy/io/netcdf.py | 29 | """
NetCDF reader/writer module.
This module is used to read and create NetCDF files. NetCDF files are
accessed through the `netcdf_file` object. Data written to and from NetCDF
files are contained in `netcdf_variable` objects. Attributes are given
as member variables of the `netcdf_file` and `netcdf_variable` objects... |
BT-jmichaud/partner-contact | refs/heads/8.0 | portal_partner_merge/wizard/portal_wizard.py | 37 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... |
xuxiaoxin/micropython | refs/heads/master | tests/basics/object_new.py | 63 | # object.__new__(cls) is the only way in Python to allocate empty
# (non-initialized) instance of class.
# See e.g. http://infohost.nmt.edu/tcc/help/pubs/python/web/new-new-method.html
# TODO: Find reference in CPython docs
class Foo:
def __init__(self):
print("in __init__")
self.attr = "something... |
marcore/edx-platform | refs/heads/master | lms/djangoapps/lti_provider/admin.py | 118 | """
Admin interface for LTI Provider app.
"""
from django.contrib import admin
from .models import LtiConsumer
class LtiConsumerAdmin(admin.ModelAdmin):
"""Admin for LTI Consumer"""
search_fields = ('consumer_name', 'consumer_key', 'instance_guid')
list_display = ('id', 'consumer_name', 'consumer_key', ... |
mhnatiuk/phd_sociology_of_religion | refs/heads/master | scrapper/build/scrapy/build/lib.linux-x86_64-2.7/scrapy/utils/job.py | 212 | import os
def job_dir(settings):
path = settings['JOBDIR']
if path and not os.path.exists(path):
os.makedirs(path)
return path
|
mixturemodel-flow/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/batch_matmul_op_test.py | 109 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
EmbraceLife/codecombat | refs/heads/master | scripts/analytics/mixpanelABSubscribeCopy.py | 96 | # Calculate subscribe copy A/B test results
import sys
from mixpanel import Mixpanel
try:
import json
except ImportError:
import simplejson as json
# NOTE: mixpanel dates are by day and inclusive
# E.g. '2014-12-08' is any date that day, up to 2014-12-09 12am
if __name__ == '__main__':
if not len(sys.ar... |
tkwon/dj-stripe | refs/heads/tk | djstripe/migrations/0009_auto_20160501_1838.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import djstripe.fields
class Migration(migrations.Migration):
dependenc... |
Alpistinho/FreeCAD | refs/heads/master | src/Mod/Robot/InitGui.py | 19 | # Robot gui init module
# (c) 2009 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
#***************************************************************************
#* (c) Juergen Riegel (juergen.riegel@web... |
beeftornado/sentry | refs/heads/master | src/sentry/tasks/collect_project_platforms.py | 3 | from __future__ import absolute_import
from datetime import timedelta
from django.db.models import Max
from django.utils import timezone
from sentry.constants import VALID_PLATFORMS
from sentry.models import Group, Project, ProjectPlatform
from sentry.tasks.base import instrumented_task
@instrumented_task(name="sen... |
sam-tsai/django | refs/heads/master | tests/handlers/tests_custom_error_handlers.py | 300 | from django.conf.urls import url
from django.core.exceptions import PermissionDenied
from django.template.response import TemplateResponse
from django.test import SimpleTestCase, override_settings
def template_response_error_handler(request, exception=None):
return TemplateResponse(request, 'test_handler.html', s... |
catapult-project/catapult-csm | refs/heads/master | telemetry/telemetry/internal/browser/possible_browser.py | 7 | # Copyright 2012 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.
from telemetry.internal.app import possible_app
class PossibleBrowser(possible_app.PossibleApp):
"""A browser that can be controlled.
Call Create() to... |
jejimenez/django | refs/heads/master | tests/test_runner/test_debug_sql.py | 210 | import sys
import unittest
from django.db import connection
from django.test import TestCase
from django.test.runner import DiscoverRunner
from django.utils import six
from django.utils.encoding import force_text
from .models import Person
@unittest.skipUnless(connection.vendor == 'sqlite', 'Only run on sqlite so w... |
julien78910/CouchPotatoServer | refs/heads/develop | libs/bencode/__init__.py | 171 | # The contents of this file are subject to the BitTorrent Open Source License
# Version 1.1 (the License). You may not copy or use this file, in either
# source code or executable form, except in compliance with the License. You
# may obtain a copy of the License at http://www.bittorrent.com/license/.
#
# Software di... |
ericfc/django | refs/heads/master | tests/template_tests/syntax_tests/test_extends.py | 86 | from django.test import SimpleTestCase
from ..utils import setup
inheritance_templates = {
'inheritance01': "1{% block first %}&{% endblock %}3{% block second %}_{% endblock %}",
'inheritance02': "{% extends 'inheritance01' %}"
"{% block first %}2{% endblock %}{% block second %}4{% endblo... |
mcsosa121/cafa | refs/heads/master | cafaenv/lib/python2.7/site-packages/django/conf/locale/ko/formats.py | 404 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'Y년 n월 j일'
TIME_FORMAT = 'A g:i'
D... |
mantidproject/mantid | refs/heads/master | qt/python/mantidqt/widgets/workspacedisplay/table/test/test_tableworkspacedisplay_presenter.py | 3 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
# T... |
googleapis/googleapis-gen | refs/heads/master | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/common/types/segments.py | 1 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
Denisolt/IEEE-NYIT-MA | refs/heads/master | local/lib/python2.7/site-packages/wheel/signatures/djbec.py | 566 | # Ed25519 digital signatures
# Based on http://ed25519.cr.yp.to/python/ed25519.py
# See also http://ed25519.cr.yp.to/software.html
# Adapted by Ron Garret
# Sped up considerably using coordinate transforms found on:
# http://www.hyperelliptic.org/EFD/g1p/auto-twisted-extended-1.html
# Specifically add-2008-hwcd-4 and d... |
KodeKracker/Rotto-Links-Scraper | refs/heads/master | rottoscraper/gui/__init__.py | 1 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
__all__ = ['app']
from app import app
|
lihui7115/ChromiumGStreamerBackend | refs/heads/master | tools/linux/dump-static-initializers.py | 38 | #!/usr/bin/env python
# Copyright (c) 2012 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.
"""Dump functions called by static intializers in a Linux Release binary.
Usage example:
tools/linux/dump-static-intializers.py ... |
SSJohns/osf.io | refs/heads/develop | scripts/populate_conferences.py | 11 | #!/usr/bin/env python
# encoding: utf-8
import os
import sys
from modularodm import Q
from modularodm.exceptions import ModularOdmException
from framework.auth.core import User
from website import settings
from website.app import init_app
from website.conferences.model import Conference
from datetime import datetim... |
SaschaMester/delicium | refs/heads/master | tools/perf/page_sets/key_silk_cases.py | 1 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class KeySilkCasesPage(page_module.P... |
kazlewis/bmi203_finalproject | refs/heads/master | bmi203fp/io_tools.py | 1 | import numpy as np
import copy
def read_pos_data(filename):
'''
IO function to read in positive data, given in the format of 17 BP sequences.
Input: filename of .txt file with 17 BP character sequences separated by newlines
Output: list of sequences as characters
'''
sequences = []
wit... |
blooparksystems/odoo | refs/heads/9.0 | addons/website_sale/__openerp__.py | 36 | {
'name': 'eCommerce',
'category': 'Website',
'sequence': 55,
'summary': 'Sell Your Products Online',
'website': 'https://www.odoo.com/page/e-commerce',
'version': '1.0',
'description': """
OpenERP E-Commerce
==================
""",
'depends': ['website', 'sale', 'payment', 'web... |
offenesdresden/ParkAPI | refs/heads/master | park_api/cities/Bonn.py | 1 | from bs4 import BeautifulSoup
from park_api.geodata import GeoData
from park_api.util import utc_now
geodata = GeoData(__file__)
lot_map = {
0: "Münsterplatzgarage",
1: "Stadthausgarage",
2: "Beethoven-Parkhaus",
3: "Bahnhofgarage",
4: "Friedensplatzgarage",
5: "Marktgarage",
}
def parse_htm... |
dahlstrom-g/intellij-community | refs/heads/master | python/testData/formatter/spaceAroundKeywords_after.py | 83 | True and False
|
surligas/gnuradio | refs/heads/master | gr-digital/examples/narrowband/transmit_path.py | 41 | #
# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later ... |
richpolis/siveinpy | refs/heads/master | env/lib/python2.7/site-packages/django/contrib/flatpages/forms.py | 113 | from django import forms
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext, ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
help_text = _("... |
shuhaowu/wrtfreezer | refs/heads/master | wrtfreezer/wrt_builder.py | 1 | from __future__ import absolute_import, print_function
import logging
import json
import os
import os.path
import subprocess
import shutil
import sys
import requests
from .utils import logging_formatter, get_intermediates_dir, get_targets_dir, md5_file, cd, IMAGE_BUILDER_DIR_NAME
from .device import Device
CHUNK_S... |
m-kuhn/QGIS | refs/heads/master | python/plugins/processing/algs/qgis/VariableDistanceBuffer.py | 4 | # -*- coding: utf-8 -*-
"""
***************************************************************************
VariableDistanceBuffer.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************... |
diagramsoftware/odoo | refs/heads/8.0 | addons/sale/wizard/sale_line_invoice.py | 222 | # -*- 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... |
klahnakoski/intermittents | refs/heads/master | pyLibrary/debugs/log_usingElasticSearch.py | 1 | # 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/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import unicode_literals
from __... |
smices/mWorkerService | refs/heads/master | tool/check.py | 1 | #!/usr/bin/env python
import os
import sys
import glob
import pep8
from pyflakes.scripts import pyflakes
def cur_file_dir():
path = sys.path[0]
if os.path.isdir(path):
return path
elif os.path.isfile(path):
return os.path.dirname(path)
def findpy(path):
for cfile in glob.glob(os.pat... |
prasadtalasila/MMTP | refs/heads/master | CSA/Sample_Tests/Test_CSA.py | 1 | from subprocess import call
from random import randint
#for _ in range(100):
u = 1642
for i in range(101):
x = randint(0,u)
y = randint(0,u)
z = call(["python","CSA_v3.py",str(x),str(y)])
print z
|
ffrree/redis-py | refs/heads/master | setup.py | 26 | #!/usr/bin/env python
import os
import sys
from redis import __version__
try:
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
... |
viniciusgama/blog_gae | refs/heads/master | django/contrib/contenttypes/management.py | 315 | from django.contrib.contenttypes.models import ContentType
from django.db.models import get_apps, get_models, signals
from django.utils.encoding import smart_unicode
def update_contenttypes(app, created_models, verbosity=2, **kwargs):
"""
Creates content types for models in the given app, removing any model
... |
JustinTulloss/harmonize.fm | refs/heads/master | uploader/test_hfile.py | 1 | from hfile import HFile, HFileException
import os.path as path
files = ['mp3_file.mp3', 'no_tags.mp3', 'not_an_mp3.mp3',
'mp4_file', 'not_an_mp3_bin.mp3', 'no_tags.m4a',
'does_not_exist.mp3', 'empty_file.mp3', 'not_an_mp3_bin.m4a',
'not_an_mp3.m4a', 'no_access.mp3']
abs_files = [path.abspath(path.joi... |
victos/busuu_anki | refs/heads/master | anki/statsbg.py | 25 | # from subtlepatterns.com
bg = """\
iVBORw0KGgoAAAANSUhEUgAAABIAAAANCAMAAACTkM4rAAAAM1BMVEXy8vLz8/P5+fn19fXt7e329vb4+Pj09PTv7+/u7u739/fw8PD7+/vx8fHr6+v6+vrs7Oz2LjW2AAAAkUlEQVR42g3KyXHAQAwDQYAQj12ItvOP1qqZZwMMPVnd06XToQvz4L2HDQ2iRgkvA7yPPB+JD+OUPnfzZ0JNZh6kkQus5NUmR7g4Jpxv5XN6nYWNmtlq9o3zuK6w3XRsE1pQIEGPIsdtTP3m2cYwlPv6... |
mcrowson/django | refs/heads/master | tests/context_processors/models.py | 547 | from django.db import models
class DebugObject(models.Model):
pass
|
TwinkleChawla/nova | refs/heads/master | nova/api/openstack/compute/create_backup.py | 9 | # Copyright 2011 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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 requir... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.