repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
Bismarrck/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/mvn_diag_plus_low_rank_test.py | 25 | # 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... |
joyent/zookeeper | refs/heads/master | src/contrib/zkpython/src/test/callback_test.py | 159 | #!/usr/bin/python
#
# 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
# "Lic... |
kaedroho/django | refs/heads/master | tests/migrations/test_migrations_plan/0001_initial.py | 73 | from django.db import migrations, models
def grow_tail(x, y):
"""Grow salamander tail."""
pass
def shrink_tail(x, y):
"""Shrink salamander tail."""
pass
class Migration(migrations.Migration):
initial = True
operations = [
migrations.CreateModel(
'Salamander',
... |
olymk2/maidstone-hackspace | refs/heads/master | website/pages/donate.py | 2 | from flask import Blueprint
from flask import request
from flask import redirect, abort
from scaffold import web
from scaffold.core.validate import validate
from pages import header, footer
from data import donate, site_user, badges, members
from libs.payments import payment
from config.settings import *
donate_page... |
elias-winberg/PhantomJS | refs/heads/master | phantomjs/test_phantom.py | 2 | from .page import Page
from .phantom import Phantom
from .driver import Driver
import pytest
@pytest.fixture()
def phantom(request):
driver = Driver(engine='phantomjs', port=3000)
driver.start()
driver.wait_for_ready()
phantom = Phantom(driver=driver)
request.addfinalizer(driver.kill)
return p... |
Southpaw-TACTIC/TACTIC | refs/heads/4.7 | src/tactic/ui/table/expression_element_wdg.py | 1 | ###########################################################
#
# Copyright (c) 2005-2008, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written ... |
zyc9012/sdrl | refs/heads/master | sdrl/Gui/Domains/InfCartPoleBalance.py | 1 | #-*- coding: utf-8 -*-
import os
from PyQt4.QtGui import *
from PyQt4.QtCore import *
from PyQt4 import uic
from sdrl.Gui import BaseFrame
from sdrl.Gui.Utils import *
from rlpy.Domains import InfCartPoleBalance
class InfCartPoleBalanceFrame( BaseFrame ):
title = 'InfCartPoleBalance'
def __init__( self, p... |
loongson-community/EFI-MIPS | refs/heads/master | ToolKit/cmds/python/Lib/test/good/test_call.py | 90 | import unittest
from test import test_support
# The test cases here cover several paths through the function calling
# code. They depend on the METH_XXX flag that is used to define a C
# function, which can't be verified from Python. If the METH_XXX decl
# for a C function changes, these tests may not cover the righ... |
mindbody/API-Examples | refs/heads/master | SDKs/Python/test/test_size.py | 1 | # coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
impo... |
Tranzystorek/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_special_methods.py | 32 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface SpecialMethods {
getter long long (unsigned long index);
setter long long (unsigned long index, long long value);
creator long long (unsigned long index, long long value);
getter boolean (DOMSt... |
ibc/MediaSoup | refs/heads/v3 | worker/deps/gyp/test/ninja/empty-and-non-empty-duplicate-name/gyptest-empty-and-non-empty-duplicate-name.py | 100 | #!/usr/bin/env python
# Copyright (c) 2014 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 a phony target isn't output if a target exists with the same name that
was output.
"""
import TestGyp
test = TestGyp.TestGyp(... |
DeepVisionTeam/TensorFlowBook | refs/heads/master | Titanic/01_tensorflow_basic.py | 2 | import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.model_selection import train_test_split
################################
# Preparing Data
################################
# read data from file
data = pd.read_csv('data/train.csv')
# fill nan values with 0
data = data.fillna(0)
# convert ['... |
jamesblunt/edx-platform | refs/heads/master | common/test/acceptance/pages/lms/course_wiki.py | 146 | """
Wiki tab on courses
"""
from .course_page import CoursePage
from ...pages.studio.utils import type_in_codemirror
class CourseWikiPage(CoursePage):
"""
Course wiki navigation and objects.
"""
url_path = "wiki"
def is_browser_on_page(self):
"""
Browser is on the wiki page if t... |
eblade/images5 | refs/heads/porting | exifread/utils.py | 16 | """
Misc utilities.
"""
def ord_(dta):
if isinstance(dta, str):
return ord(dta)
return dta
def make_string(seq):
"""
Don't throw an exception when given an out of range character.
"""
string = ''
for c in seq:
# Screen out non-printing characters
try:
... |
nouiz/ccw_tutorial_theano | refs/heads/master | 04_debugging/02_compute_test_value.py | 4 | # Run
# python 01_compute_test_value.py
# It should raise an exception when it tries to execute the call to fn.
# The exception doesn't make it easy to tell which line of the python script
# first created an invalid expression though.
# Modify the script to use compute_test_value to find the first bad line.
#
# This sh... |
Matt-Deacalion/django | refs/heads/master | tests/template_tests/filter_tests/test_ljust.py | 521 | from django.template.defaultfilters import ljust
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class LjustTests(SimpleTestCase):
@setup({'ljust01': '{% autoescape off %}.{{ a|ljust:"5" }}. .{{ b|ljust:"5" }}.{% endautoescape %}'})
def test_lju... |
tacaswell/scikit-xray | refs/heads/master | skbeam/core/calibration.py | 5 | # ######################################################################
# Copyright (c) 2014, Brookhaven Science Associates, Brookhaven #
# National Laboratory. All rights reserved. #
# #
# Redistribution and use in ... |
dgjustice/ansible | refs/heads/devel | lib/ansible/cli/vault.py | 5 | # (c) 2014, James Tanner <[email protected]>
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed i... |
dmacd/FB-try1 | refs/heads/master | pyramid/frameworkbenchmarks/models.py | 4 | """
Benchmark models.
"""
import json
import psycopg2
from collections import Iterable
from sqlalchemy import create_engine, MetaData, Table, Column, Integer, String
from sqlalchemy.orm import sessionmaker
from sqlalchemy.pool import QueuePool
from sqlalchemy.ext.declarative import declarative_base, DeclarativeMeta
D... |
pselle/calibre | refs/heads/master | src/calibre/ebooks/oeb/transforms/filenames.py | 14 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <[email protected]>'
__docformat__ = 'restructuredtext en'
import posixpath
from urlparse import urldefrag, urlparse
from lxml import etree
from calibre.ebooks.oeb.base import rew... |
heke123/chromium-crosswalk | refs/heads/master | third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py | 4 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
kawasaki2013/python-for-android-x86 | refs/heads/master | python-build/python-libs/gdata/src/gdata/docs/service.py | 133 | #!/usr/bin/python
#
# Copyright 2009 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 required b... |
earies/ncclient | refs/heads/master | ncclient/logging_.py | 6 | import logging
class SessionLoggerAdapter(logging.LoggerAdapter):
"""Logger adapter that automatically adds session information to logs."""
def process(self, msg, kwargs):
if 'session' not in self.extra or self.extra['session'] is None:
return msg, kwargs
session = self.extra['sess... |
janztec/empc-arpi-linux | refs/heads/rpi-3.18.y | tools/perf/scripts/python/netdev-times.py | 1544 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
farazrehman/aws-resources | refs/heads/master | CloudFormation/nash/lib/python2.7/site-packages/troposphere/autoscaling.py | 1 | # Copyright (c) 2012-2013, Mark Peek <[email protected]>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSHelperFn, AWSObject, AWSProperty, If, FindInMap, Ref
from .validators import boolean, integer
from . import cloudformation
EC2_INSTANCE_LAUNCH = "autoscaling:EC2_INSTANCE_LAUNCH"
EC2_IN... |
Shaps/ansible | refs/heads/devel | test/units/plugins/test_plugins.py | 23 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# 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... |
godfather1103/WeiboRobot | refs/heads/master | python27/1.0/lib/unittest/test/test_setups.py | 153 | import sys
from cStringIO import StringIO
import unittest
def resultFactory(*_):
return unittest.TestResult()
class TestSetups(unittest.TestCase):
def getRunner(self):
return unittest.TextTestRunner(resultclass=resultFactory,
stream=StringIO())
def ru... |
charbeljc/server-tools | refs/heads/8.0 | users_ldap_populate/__init__.py | 257 | from . import model
|
ronakkhunt/kuma | refs/heads/master | kuma/authkeys/views.py | 31 | from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, render, redirect
from django.contrib.auth.decorators import login_required, permission_required
from kuma.core.utils import paginate
from .models import Key
from .forms import KeyForm
ITEMS_PER_PAGE = 15
@login_req... |
mlperf/training_results_v0.7 | refs/heads/master | Google/benchmarks/transformer/implementations/transformer-research-TF-tpu-v3-8192/lingvo/core/generic_input.py | 3 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
mjudsp/Tsallis | refs/heads/master | sklearn/preprocessing/__init__.py | 268 | """
The :mod:`sklearn.preprocessing` module includes scaling, centering,
normalization, binarization and imputation methods.
"""
from ._function_transformer import FunctionTransformer
from .data import Binarizer
from .data import KernelCenterer
from .data import MinMaxScaler
from .data import MaxAbsScaler
from .data ... |
kylelwm/ponus | refs/heads/master | venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.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... |
jennyzhang0215/incubator-mxnet | refs/heads/master | example/bi-lstm-sort/rnn_model.py | 19 | # 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... |
GitHublong/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/django/conf/locale/uk/formats.py | 236 | # -*- 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 = 'j E Y р.'
TIME_FORMAT = 'H:i:s'
... |
jtopjian/st2 | refs/heads/master | st2api/tests/unit/controllers/v1/test_runnertypes.py | 7 | # Licensed to the StackStorm, Inc ('StackStorm') 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 th... |
locationtech/geowave | refs/heads/master | python/src/main/python/pygw/base/writer.py | 2 | #
# Copyright (c) 2013-2020 Contributors to the Eclipse Foundation
#
# See the NOTICE file distributed with this work for additional information regarding copyright
# ownership. All rights reserved. This program and the accompanying materials are made available
# under the terms of the Apache License, Version 2.0 whic... |
ribeiro-ucl/viewflow | refs/heads/master | tests/examples/helloworld/admin.py | 3 | from django.contrib import admin
from viewflow.admin import ProcessAdmin, TaskAdmin
from . import models, flows
class HelloWorldProcessAdmin(ProcessAdmin):
list_display = ['pk', 'created', 'status', 'participants',
'text', 'approved']
list_display_links = ['pk', 'created']
class HelloWor... |
wevoice/wesub | refs/heads/staging | apps/api/extra.py | 1 | # Amara, universalsubtitles.org
#
# Copyright (C) 2016 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your opti... |
unicefuganda/mics | refs/heads/master | survey/tests/utils/__init__.py | 17 | __author__ = 'mnandri'
|
reverland/scripts | refs/heads/master | python/missile.py | 1 | import matplotlib.pyplot as plt
import numpy as np
tolerance = 1e-1
radius = np.pi
# missile 1
x_m1, y_m1 = -np.pi, 0
v_m1 = 5
# missile 2
x_m2, y_m2 = 0, np.pi
v_m2 = v_m1
# missile 3
x_m3, y_m3 = np.pi, 0
v_m3 = v_m1
# missile 4
x_m4, y_m4 = 0, -np.pi
v_m4 = v_m1
plt.figure(figsize=(10, 10), dpi=80)
plt.title(" mi... |
songmonit/CTTMSONLINE | refs/heads/master | addons/portal/tests/__init__.py | 177 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... |
Pharas/PyTalk | refs/heads/master | PyTalk - Raspberry Pi/sr.py | 1 | """Library for performing speech recognition with the Google Speech Recognition API."""
__author__ = 'Anthony Zhang (Uberi)'
__version__ = '1.1.0'
__license__ = 'BSD'
import io, os, subprocess, wave, sys
import math, audioop, collections
import json
try: # try to use python2 module
from urllib2 import Request, ... |
rspavel/spack | refs/heads/develop | var/spack/repos/builtin/packages/r-suppdists/package.py | 5 | # 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 RSuppdists(RPackage):
"""Ten distributions supplementing those built into R. Inverse Gauss... |
kikobr/projetoextintor | refs/heads/master | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/templates.py | 291 | # -*- coding: utf-8 -*-
"""
pygments.lexers.templates
~~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for various template engines' markup.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexers.web import \
PhpLexer, H... |
RydrDojo/Ridr | refs/heads/master | pylotVenv/lib/python2.7/site-packages/mako/ext/autohandler.py | 61 | # ext/autohandler.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""adds autohandler functionality to Mako templates.
requires that the TemplateLookup class is... |
ruanima/flasky-test | refs/heads/master | app/main/__init__.py | 1 | #coding=utf-8
from flask import Blueprint
main = Blueprint('main', __name__)
from . import views, errors
from ..models import Permission
@main.app_context_processor
def inject_permissions():
return dict(Permission=Permission) |
eugene1g/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/openbugs.py | 124 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... |
SchrodingersGat/kicad-footprint-generator | refs/heads/master | scripts/Connector/Connector_Molex/conn_molex_slimstack-502430.py | 1 | #!/usr/bin/env python3
# KicadModTree 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.
#
# KicadModTree is distributed in the hope that... |
LeeKamentsky/CellProfiler | refs/heads/master | cellprofiler/modules/tests/test_makeprojection.py | 2 | '''test_makeprojection - Test the MakeProjection module
CellProfiler is distributed under the GNU General Public License.
See the accompanying file LICENSE for details.
Copyright (c) 2003-2009 Massachusetts Institute of Technology
Copyright (c) 2009-2015 Broad Institute
All rights reserved.
Please see the AUTHORS fi... |
h4r5h1t/django-hauthy | refs/heads/hauthy | django/contrib/gis/shortcuts.py | 197 | import zipfile
from io import BytesIO
from django.conf import settings
from django.http import HttpResponse
from django.template import loader
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."
kmz = BytesIO()
zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED)
zf.writestr('d... |
samchrisinger/osf.io | refs/heads/develop | api/wikis/urls.py | 23 | from django.conf.urls import url
from api.wikis import views
urlpatterns = [
url(r'^(?P<wiki_id>\w+)/$', views.WikiDetail.as_view(), name=views.WikiDetail.view_name),
url(r'^(?P<wiki_id>\w+)/content/$', views.WikiContent.as_view(), name=views.WikiContent.view_name),
]
|
xubayer786/namebench | refs/heads/master | libnamebench/nameserver_list.py | 173 | # Copyright 2009 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 required by applicable law or ... |
rdipietro/tensorflow | refs/heads/master | tensorflow/contrib/metrics/python/ops/confusion_matrix_ops.py | 12 | # 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... |
kalov/ShapePFCN | refs/heads/master | caffe-ours/scripts/copy_notebook.py | 75 | #!/usr/bin/env python
"""
Takes as arguments:
1. the path to a JSON file (such as an IPython notebook).
2. the path to output file
If 'metadata' dict in the JSON file contains 'include_in_docs': true,
then copies the file to output file, appending the 'metadata' property
as YAML front-matter, adding the field 'categor... |
skynetera/skynet | refs/heads/master | skynet-server/conf/__init__.py | 3 | #!/usr/bin/env python
# coding: utf-8
__author__ = 'whoami'
"""
@version: 1.0
@author: whoami
@license: Apache Licence 2.0
@contact: [email protected]
@site: http://www.itweet.cn
@software: PyCharm Community Edition
@file: __init__.py.py
@time: 2015-11-26 下午8:33
"""
def run():
print("hello")
if __name__ == "... |
tumbl3w33d/ansible | refs/heads/devel | lib/ansible/module_utils/network/nxos/config/hsrp_interfaces/hsrp_interfaces.py | 13 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Cisco and/or its affiliates.
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The nxos hsrp_interfaces class
This class creates a command set to bring the current device configuration
to a desired end-state. The command set is ... |
puzan/ansible | refs/heads/devel | lib/ansible/modules/database/mysql/mysql_variables.py | 25 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage mysql variables
(c) 2013, Balazs Pocze <[email protected]>
Certain parts are taken from Mark Theunissen's mysqldb module
This file is part of Ansible
Ansible is free software: you can redistribute it and/or modify
it under the terms of the GNU G... |
MagicNews/ASMagic | refs/heads/master | config.py | 1 | # -*- coding: utf-8 -*-
redis_db = 0 # Set your redis db number 0 - 15
token = "SET_YOUR_TOKEN_HERE"
sudos = []
admins = []
errors_chat = #Set your errors chat(group/channel/user) id here!
log_chat = #Set your logs chat(group/supergroup) id here!
|
raccoongang/xblock-video | refs/heads/dev | video_xblock/tests/unit/mocks/brightcove.py | 1 | """
Brightcove backend mocks.
"""
import json
from copy import copy, deepcopy
from video_xblock.backends import brightcove
from video_xblock.exceptions import VideoXBlockException, VideoXBlockMockException
from video_xblock.tests.unit.mocks.base import BaseMock, RequestsMock, ResponseStub
class BrightcoveAuthMock(Ba... |
willowrose/QubitCoin | refs/heads/master | qa/rpc-tests/getblocktemplate_proposals.py | 145 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from binasci... |
joyeshmishra/spark-tk | refs/heads/master | regression-tests/sparktkregtests/testcases/frames/frame_group_by_test.py | 13 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... |
rohit21122012/DCASE2013 | refs/heads/master | runs/2016/dnn2016med_traps/traps3/src/ui.py | 56 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools
import sys
spinner = itertools.cycle(["`", "*", ";", ","])
def title(text):
"""Prints title
Parameters
----------
text : str
Title
Returns
-------
Nothing
"""
print "--------------------------------"
p... |
drgarcia1986/muffin-elasticsearch | refs/heads/master | tests.py | 1 | import muffin
import pytest
@pytest.fixture(scope='session')
def app(loop):
return muffin.Application(
'elasticsearch_app', loop=loop,
PLUGINS=('muffin_elasticsearch',)
)
def test_plugin_register(app):
assert 'elasticsearch' in app.ps
assert app.ps.elasticsearch.conn
@pytest.mark.a... |
bokzor/guimovie | refs/heads/master | build/releases/Guimovie/mac/Guimovie.app/Contents/Resources/app.nw/node_modules/nw-gyp/gyp/pylib/gyp/MSVSUtil.py | 566 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
_TARGET_TYPE_EXT = {
'executable': '.exe',
'loadable_module': '.dll',
... |
guiquanz/msaf | refs/heads/master | msaf/algorithms/interface.py | 1 | """Interface for all the algorithms in MSAF."""
import numpy as np
import msaf.input_output as io
import msaf.utils as U
class SegmenterInterface:
"""This class is an interface for all the segmenter algorithms included
in MSAF. These segmenters must inherit from it and implement one of the
following method... |
rc/sfepy | refs/heads/master | sfepy/discrete/fem/fields_hierarchic.py | 3 | import numpy as nm
from sfepy.base.base import assert_
from sfepy.discrete.fem.utils import prepare_remap, prepare_translate
from sfepy.discrete.common.dof_info import expand_nodes_to_dofs
from sfepy.discrete.fem.fields_base import VolumeField, H1Mixin
class H1HierarchicVolumeField(H1Mixin, VolumeField):
family_n... |
elegion/djangodash2012 | refs/heads/master | fortuitus/frunner/urls.py | 1 | from django.conf.urls import patterns, url
from fortuitus.frunner import views
urlpatterns = patterns('',
url(r'^(?P<company_slug>[\w\d_-]+)/projects/(?P<project_slug>[\w\d_-]+)/runs/$',
views.project_runs, name='frunner_project_runs'),
url(r'^(?P<company_slug>[\w\d_-]+)/projects/(?P<project_slug>[\w... |
sabi0/intellij-community | refs/heads/master | python/testData/console/indent1.py | 83 | for x in range(1, 10):
print x |
django-nonrel/django | refs/heads/nonrel-1.6 | tests/mail/__init__.py | 45382 | |
plotly/python-api | refs/heads/master | packages/python/plotly/plotly/graph_objs/waterfall/decreasing/__init__.py | 6 | import sys
if sys.version_info < (3, 7):
from ._marker import Marker
from . import marker
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [".marker"], ["._marker.Marker"]
)
|
WhireCrow/openwrt-mt7620 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/root-ralink/usr/lib/python2.7/distutils/command/build_clib.py | 176 | """distutils.command.build_clib
Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""
__revision__ = "$Id$"
# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly ... |
ojengwa/sympy | refs/heads/master | sympy/functions/combinatorial/tests/test_comb_numbers.py | 2 | import string
from sympy import (bernoulli, Symbol, symbols, Dummy, Sum, harmonic, Rational, oo,
zoo, pi, I, bell, fibonacci, lucas, euler, catalan, binomial, gamma, sqrt,
hyper, log, digamma, trigamma, polygamma, diff, Expr, sympify, expand_func,
EulerGamma, factorial)
from sympy.utilities.pytest import ... |
NeuralEnsemble/neuroConstruct | refs/heads/master | lib/jython/Lib/test/test_future1.py | 432 | """This is a test"""
# Import the name nested_scopes twice to trigger SF bug #407394 (regression).
from __future__ import nested_scopes, nested_scopes
def f(x):
def g(y):
return x + y
return g
result = f(2)(4)
|
abessifi/pytd | refs/heads/master | pytd/compat.py | 84 | # -*- coding: utf-8 -*-
"""Python 2/3 compatibility module."""
import sys
PY2 = int(sys.version[0]) == 2
if PY2:
text_type = unicode
binary_type = str
string_types = (str, unicode)
unicode = unicode
basestring = basestring
else:
text_type = str
binary_type = bytes
string_types = (str... |
jarzofjam/tenshi | refs/heads/master | tools/split_lbr.py | 11 | #!/usr/bin/env python
# Licensed to Pioneers in Engineering under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Pioneers in Engineering licenses
# this file to you under the Apache License, Version 2.0 (the
#... |
skerit/romcollectionbrowser | refs/heads/master | resources/lib/configxmlwriter.py | 10 | import os
import util
from util import *
import config
from config import *
from xml.etree.ElementTree import *
class ConfigXmlWriter:
def __init__(self, createNew):
Logutil.log('init ConfigXmlWriter', util.LOG_LEVEL_INFO)
self.createNew = createNew
if(createNew):
configFile = ... |
teamtuga4/teamtuga4ever.repository | refs/heads/master | plugin.video.traquinas/resources/lib/sources/muchmovies_mv_tv.py | 7 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2016 mrknow
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 l... |
hfp/tensorflow-xsmm | refs/heads/master | tensorflow/contrib/distributions/python/ops/autoregressive.py | 1 | # Copyright 2017 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... |
GSI/uzbl | refs/heads/next | tests/event-manager/testcookie.py | 5 | #!/usr/bin/env python
import sys
if '' not in sys.path:
sys.path.insert(0, '')
import unittest
from emtest import EventManagerMock
from uzbl.plugins.cookies import Cookies
from uzbl.plugins.config import Config
cookies = (
r'".nyan.cat" "/" "__utmb" "183192761.1.10.1313990640" "http" "1313992440"',
r'"... |
jimsimon/sky_engine | refs/heads/master | tools/git/for-all-touched-files.py | 68 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""
Invokes the specified (quoted) command for all files modified
between the current git branch and the specified branch or co... |
mbohlool/client-python | refs/heads/master | kubernetes/test/test_v1beta1_ingress_tls.py | 1 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... |
google-code/android-scripting | refs/heads/master | python/src/Lib/test/test_cpickle.py | 51 | import cPickle, unittest
from cStringIO import StringIO
from test.pickletester import AbstractPickleTests, AbstractPickleModuleTests
from test import test_support
class cPickleTests(AbstractPickleTests, AbstractPickleModuleTests):
def setUp(self):
self.dumps = cPickle.dumps
self.loads = cPickle.lo... |
MattDevo/edk2 | refs/heads/master | AppPkg/Applications/Python/Python-2.7.2/Lib/json/tests/test_check_circular.py | 17 | from json.tests import PyTest, CTest
def default_iterable(obj):
return list(obj)
class TestCheckCircular(object):
def test_circular_dict(self):
dct = {}
dct['a'] = dct
self.assertRaises(ValueError, self.dumps, dct)
def test_circular_list(self):
lst = []
... |
ghtmtt/QGIS | refs/heads/master | tests/src/python/test_qgslayoutaligner.py | 41 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsLayoutAligner
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
_... |
TathagataChakraborti/resource-conflicts | refs/heads/master | PLANROB-2015/py2.5/lib/python2.5/encodings/mac_cyrillic.py | 593 | """ Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inp... |
tensorflow/autograph | refs/heads/master | reference_tests/assertion_test.py | 1 | # Copyright 2017 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... |
suneeth51/neutron | refs/heads/master | neutron/tests/tempest/common/tempest_fixtures.py | 102 | # Copyright 2013 IBM Corp.
# 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 app... |
espressopp/espressopp | refs/heads/master | testsuite/cap_force/testCapForce.py | 1 | # Copyright (C) 2018
# Max Planck Institute for Polymer Research
#
# This file is part of ESPResSo++.
#
# ESPResSo++ 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, o... |
johankaito/fufuka | refs/heads/master | microblog/old-flask/lib/python2.7/site-packages/sqlalchemy/connectors/mxodbc.py | 80 | # connectors/mxodbc.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
Provide an SQLALchemy connector for the eGenix mxODBC commercial
Python ada... |
DigitalGlobe/gbdxtools | refs/heads/master | gbdxtools/images/exceptions/driver.py | 1 | class DriverConfigurationError(AttributeError):
pass
class UnsupportedImageProduct(KeyError):
pass
|
CollabQ/CollabQ | refs/heads/master | .google_appengine/lib/django/django/db/backends/ado_mssql/creation.py | 32 | DATA_TYPES = {
'AutoField': 'int IDENTITY (1, 1)',
'BooleanField': 'bit',
'CharField': 'varchar(%(maxlength)s)',
'CommaSeparatedIntegerField': 'varchar(%(maxlength)s)',
'DateField': 'smalldatetime',
'DateTimeField': 'smalldatetime',
'FileField': 'varc... |
enthought/etsproxy | refs/heads/master | enthought/util/random_state.py | 1 | #------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... |
marcoarruda/MissionPlanner | refs/heads/master | Lib/lib2to3/fixes/fix_paren.py | 61 | """Fixer that addes parentheses where they are required
This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""
# By Taek Joo Kim and Benjamin Peterson
# Local imports
from .. import fixer_base
from ..fixer_util import LParen, RParen
# XXX This doesn't support nested for loops like [x for x in ... |
twitterdev/twitter-python-ads-sdk | refs/heads/master | twitter_ads/__init__.py | 1 | # Copyright (C) 2015 Twitter, Inc.
VERSION = (9, 0, 0)
API_VERSION = '9'
from twitter_ads.utils import get_version
__version__ = get_version()
|
j-bennet/pgcli | refs/heads/master | release.py | 7 | #!/usr/bin/env python
from __future__ import print_function
import re
import ast
import subprocess
import sys
DEBUG = False
def version(version_file):
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open(version_file, 'rb') as f:
ver = str(ast.literal_eval(_version_re.search(
f.r... |
phobson/statsmodels | refs/heads/master | statsmodels/tsa/tests/test_stattools.py | 1 | from statsmodels.compat.python import lrange
from statsmodels.tsa.stattools import (adfuller, acf, pacf_ols, pacf_yw,
pacf, grangercausalitytests,
coint, acovf, kpss, ResultsStore,
... |
jaredks/rumps | refs/heads/master | examples/example_timers.py | 2 | import rumps
import time
def timez():
return time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime())
@rumps.timer(1)
def a(sender):
print('%r %r' % (sender, timez()))
@rumps.clicked('Change timer')
def changeit(_):
response = rumps.Window('Enter new interval').run()
if response.clicked:
... |
anduslim/codex | refs/heads/master | codex_project/actors/migrations/0004_auto__chg_field_reading_value.py | 1 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Reading.value'
db.alter_column('actors_reading', 'valu... |
domainxz/cuda-convnet2 | refs/heads/master | shownet.py | 180 | # Copyright 2014 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 required by applicable law or... |
NeCTAR-RC/heat | refs/heads/nectar/icehouse | heat/engine/resources/neutron/subnet.py | 1 |
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.