repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
jlegendary/nupic | refs/heads/master | external/linux32/lib/python2.6/site-packages/matplotlib/delaunay/testfuncs.py | 72 | """Some test functions for bivariate interpolation.
Most of these have been yoinked from ACM TOMS 792.
http://netlib.org/toms/792
"""
import numpy as np
from triangulate import Triangulation
class TestData(dict):
def __init__(self, *args, **kwds):
dict.__init__(self, *args, **kwds)
self.__dict__ ... |
DivineHime/seishirou | refs/heads/master | lib/youtube_dl/extractor/dailymotion.py | 1 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
import itertools
from .common import InfoExtractor
from ..utils import (
determine_ext,
error_to_compat_str,
ExtractorError,
int_or_none,
parse_iso8601,
sanitized_Request,
str_to_int,
unescapeHTML,
mimet... |
jk1/intellij-community | refs/heads/master | python/testData/refactoring/pushdown/existingmethod.before.py | 83 | class Foo:
def foo(self):
print("a")
class Boo(Foo):
def foo(self):
print "rrrrr" |
hoytak/SFrame | refs/heads/master | oss_src/unity/python/sframe/visualization/show.py | 5 | '''
Copyright (C) 2016 Turi
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
'''
from multipledispatch import dispatch as _dispatch
show_dispatch = _dispatch
@show_dispatch(object)
def show(obj, **kwargs):
raise NotImplemente... |
hradec/gaffer | refs/heads/master | python/GafferSceneUI/TransformToolUI.py | 7 | ##########################################################################
#
# Copyright (c) 2018, Image Engine Design 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:
#
# * Redistrib... |
Shouqun/node-gn | refs/heads/master | tools/depot_tools/recipes/recipe_modules/tryserver/__init__.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.
DEPS = [
'gerrit',
'git',
'git_cl',
'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_en... |
ivanhorvath/openshift-tools | refs/heads/prod | openshift/installer/vendored/openshift-ansible-3.4.40/roles/lib_openshift/src/ansible/oc_adm_ca_server_cert.py | 13 | # pylint: skip-file
# flake8: noqa
def main():
'''
ansible oc adm module for ca create-server-cert
'''
module = AnsibleModule(
argument_spec=dict(
state=dict(default='present', type='str', choices=['present']),
debug=dict(default=False, type='bool'),
kubecon... |
asgard-lab/neutron | refs/heads/master | neutron/tests/tempest/common/isolated_creds.py | 27 | # 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 required by applicable law or agreed t... |
NicolasRanc/AnimalBreedingDB | refs/heads/master | LievreDB.py | 1 | # -*- coding: utf-8 -*-
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
import rdpedfile
import wtcrossxlfl
import pedigree
from os.path import split
class filedialog(QWidget):
"""filedialog class is QApplication that shows graphical interface for LievreDB
with methods:
getfiles that allows importi... |
deveah/gerberlicious | refs/heads/master | gerberlicious/point.py | 1 |
class Point:
"""
A pair of coordinates (x, y).
"""
def __init__(self, x, y):
self.x = x
self.y = y
|
vimilimiv/weibo-popularity_judge-and-content_optimization | refs/heads/master | news/delete.py | 1 | #-------------------------------------------------------------------------------
# Name: 妯″潡1
# Purpose:
#
# Author: zhx
#
# Created: 17/05/2016
# Copyright: (c) zhx 2016
# Licence: <your licence>
#-------------------------------------------------------------------------------
import openpyxl
def... |
EDUlib/edx-platform | refs/heads/master | openedx/core/djangoapps/content/course_overviews/migrations/0021_courseoverviewtab_link.py | 8 | # Generated by Django 2.2.12 on 2020-04-21 15:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('course_overviews', '0020_courseoverviewtab_url_slug'),
]
operations = [
migrations.AddField(
model_name='courseoverviewtab',
... |
indirectlylit/kolibri | refs/heads/develop | kolibri/core/logger/models.py | 2 | """
This app provides the core functionality for tracking user
engagement with content and the Kolibri app.
It stores:
* details of users' interactions with content
* summaries of those interactions
* interactions with the software in general
Eventually, it may also store user feedback on the content and the softwar... |
cfobel/parallel-tsp | refs/heads/master | fancy_table.py | 1 | # coding: utf-8
# # [Fancy Table][1] #
# Dynamic table views for the IPython Notebook
#
# [1]: http://www.snip2code.com/Snippet/47354/Fancy-Table-Using-IPython-Widgets
from math import ceil
from IPython.html import widgets
from IPython.display import display
from IPython.display import display_html, clear_output
d... |
Cuuuurzel/KiPyCalc | refs/heads/master | sympy/printing/tests/test_gtk.py | 124 | from sympy import print_gtk, sin
from sympy.utilities.pytest import XFAIL, raises
# this test fails if python-lxml isn't installed. We don't want to depend on
# anything with SymPy
@XFAIL
def test_1():
from sympy.abc import x
print_gtk(x**2, start_viewer=False)
print_gtk(x**2 + sin(x)/4, start_viewer=Fal... |
jerli/sympy | refs/heads/master | sympy/core/coreerrors.py | 123 | """Definitions of common exceptions for :mod:`sympy.core` module. """
from __future__ import print_function, division
class BaseCoreError(Exception):
"""Base class for core related exceptions. """
class NonCommutativeExpression(BaseCoreError):
"""Raised when expression didn't have commutative property. """... |
ericholscher/django-tastypie | refs/heads/master | tests/core/tests/__init__.py | 48 | import warnings
warnings.simplefilter('ignore', Warning)
from core.tests.api import *
from core.tests.authentication import *
from core.tests.authorization import *
from core.tests.cache import *
from core.tests.commands import *
from core.tests.fields import *
from core.tests.http import *
from core.tests.paginator i... |
Chilledheart/chromium | refs/heads/master | tools/findit/stacktrace.py | 74 | # Copyright (c) 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 re
import crash_utils
SYZYASAN_STACK_FRAME_PATTERN = re.compile(
r'(CF: )?(.*?)( \(FPO: .*\) )?( \(CONV: .*\) )?\[(.*) @ (\d+)\]')
FILE_PAT... |
MissCatLady/AlarmEZ | refs/heads/master | venv/lib/python2.7/site-packages/jinja2/bccache.py | 256 | # -*- coding: utf-8 -*-
"""
jinja2.bccache
~~~~~~~~~~~~~~
This module implements the bytecode cache system Jinja is optionally
using. This is useful if you have very complex template situations and
the compiliation of all those templates slow down your application too
much.
Situations whe... |
zorojean/scrapy | refs/heads/master | tests/test_http_request.py | 54 | import cgi
import unittest
import six
from six.moves import xmlrpc_client as xmlrpclib
from six.moves.urllib.parse import urlparse
from scrapy.http import Request, FormRequest, XmlRpcRequest, Headers, HtmlResponse
from scrapy.utils.python import to_bytes, to_native_str
class RequestTest(unittest.TestCase):
req... |
alobbs/ansible | refs/heads/devel | lib/ansible/playbook/base.py | 9 | # (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... |
l50/cuckooVagrantBox | refs/heads/master | json_tools/filter_json.py | 1 | import json as json
from os import listdir
from os.path import isfile, join
import glob
# path = './'
# file_list = [ f for f in listdir(path) if isfile(join(path,f)) ]
file_list = glob.glob('*.json')
for fi in file_list:
with open(fi) as f:
json_data = f.read()
data = json.loads(json_data)
... |
krad-radio/xmms2-krad | refs/heads/kradout | utils/gen-tree-hashes.py | 8 | #!/usr/bin/env python
from subprocess import check_output
from operator import itemgetter
import os
def collect_hashes(*paths):
hashes = []
for path in paths:
data = check_output("git --git-dir=%s/.git ls-tree -r HEAD" % path, shell=True)
for line in data.split("\n"):
line = line.st... |
ahmedbodi/p2pool-dev-fee | refs/heads/master | nattraverso/ipdiscover.py | 288 | """
Generic methods to retreive the IP address of the local machine.
TODO: Example
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
import random, socket, logging, itertools
from twisted.internet... |
apolikamixitos/hubcommander | refs/heads/master | command_plugins/travis_ci/config.py | 2 |
USER_AGENT = "Travis/NetflixNathanExplosion1.0.0"
USER_COMMAND_DICT = {}
|
frankrousseau/weboob | refs/heads/master | weboob/applications/weboobcli/weboobcli.py | 7 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Romain Bignon
#
# This file is part of weboob.
#
# weboob 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... |
labordoc/labordoc-next | refs/heads/labordoc-next | modules/websearch/lib/websearch_regression_tests.py | 1 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version ... |
minhphung171093/GreenERP_V8 | refs/heads/master | openerp/addons/purchase_requisition/__openerp__.py | 260 | ##############################################################################
#
# 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 Affero General Public L... |
JCBarahona/edX | refs/heads/master | lms/djangoapps/commerce/tests/test_views.py | 85 | """ Tests for commerce views. """
import json
from uuid import uuid4
from nose.plugins.attrib import attr
import ddt
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
import mock
from student.tests.factories import UserFactory
class UserMixin(object):
... |
lizardsystem/lizard-map | refs/heads/master | lizard_map/api/__init__.py | 57 | #package
|
computbiolgeek/seq_utils | refs/heads/master | src/score_residue_conservation.py | 1 | """
@summary:
"""
from argparse import ArgumentParser
# parse command line arguments
parser = ArgumentParser( description = """Computes position-specific conservation scores
given a multiple sequence alignment.""" )
parser.add_argument( '-i', '--input', dest = 'msa', required = True,
hel... |
JDFagan/InterviewInPython | refs/heads/master | questions/test/test_tree.py | 1 | from questions import tree
def test1():
"""
3
/| \
1 4 11
/ / \ \
0 2 5 3
:return: [3, 16, 10]
"""
# Build the tree
r = tree.TreeNode(3)
n = tree.TreeNode(1)
n.insert(tree.TreeNode(0))
r.insert(n)
n = tree.TreeNode(4)
n.insert(tr... |
pku9104038/edx-platform | refs/heads/master | common/lib/capa/capa/safe_exec/tests/test_files/pylib/constant.py | 285 | THE_CONST = 23
|
jart/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/conv3d_transpose_test.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... |
IrishaS/python_training | refs/heads/master | fixture/group.py | 1 | from model.group import Group
class GroupHelper:
def __init__(self,app):
self.app = app
def open_groups_page(self):
wd = self.app.wd
if not (wd.current_url.endswith("/group.php") and len(wd.find_elements_by_name("new"))>0):
wd.find_element_by_link_text("groups").click()
... |
mjrulesamrat/xbmcbackup | refs/heads/master | resources/lib/guisettings.py | 4 | import utils as utils
from xml.dom import minidom
from xml.parsers.expat import ExpatError
import json
import xbmc,xbmcvfs
class GuiSettingsManager:
settingsFile = None
doc = None
settings_allowed = list()
found_settings = list()
def __init__(self,settingsFile):
self._readFile(xbmc.tr... |
mirrorcoder/CloudFerry | refs/heads/master | tests/cloudferrylib/os/actions/test_converter_volume_to_image.py | 9 | # Copyright 2014: Mirantis 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... |
jclc/discus-inferno | refs/heads/master | flaskenv/lib/python2.7/site-packages/werkzeug/testsuite/compat.py | 76 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.compat
~~~~~~~~~~~~~~~~~~~~~~~~~
Ensure that old stuff does not break on update.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import warnings
from werkzeug.testsuite import WerkzeugTestCase
... |
jesopo/bitbot | refs/heads/master | src/utils/_consts_256_color.py | 1 | COLORS = {}
COLORS[16] = 52
COLORS[17] = 94
COLORS[18] = 100
COLORS[19] = 58
COLORS[20] = 22
COLORS[21] = 29
COLORS[22] = 23
COLORS[23] = 24
COLORS[24] = 17
COLORS[25] = 54
COLORS[26] = 53
COLORS[27] = 89
COLORS[28] = 88
COLORS[29] = 130
COLORS[30] = 142
COLORS[31] = 64
COLORS[32] = 28
COLORS[33] = 35
COLORS[34] = 30
... |
KaranToor/MA450 | refs/heads/master | google-cloud-sdk/lib/surface/compute/target_https_proxies/delete.py | 7 | # 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 ag... |
yeming233/horizon | refs/heads/master | openstack_dashboard/test/integration_tests/pages/settings/changepasswordpage.py | 11 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... |
codepantry/django | refs/heads/master | tests/admin_views/custom_has_permission_admin.py | 380 | """
A custom AdminSite for AdminViewPermissionsTest.test_login_has_permission().
"""
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.auth import get_permission_codename
from django.contrib.auth.forms import AuthenticationForm
from . import admin as base_admin, models
PERM... |
ebranca/owasp-pysec | refs/heads/master | pysec/io/dcheck.py | 5 | # Python Security Project (PySec) and its related class files.
#
# PySec is a set of tools for secure application development under Linux
#
# Copyright 2014 PySec development team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You... |
supersven/intellij-community | refs/heads/master | python/testData/fillParagraph/commentSecondParagraph_after.py | 83 | # my new string blah blah blah ;j;dsjv sd;fj;dsjf;ds js;djgf ;jsg s;dgj; sjd;gj sd;gj ;sjg;j asdl j;sjdg; jasdgl j;sldjg ;jsd;gj
# my new string blah blah blah ;j;dsjv sd;fj;dsjf;ds js;djgf ;jsg s;dgj; sjd;gj sd;gj ;sjg;j asdl j;sjdg; jasdgl
# j;sldjg ;jsd;gj |
sdkbox/sdkbox-facebook-sample-v2 | refs/heads/master | external/emscripten/third_party/ply/test/yacc_term1.py | 174 | # -----------------------------------------------------------------------------
# yacc_term1.py
#
# Terminal used on the left-hand-side
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex impor... |
l33tdaima/l33tdaima | refs/heads/master | pr1103e/distribute_candies.py | 1 | from typing import List
class Solution:
# Time complexity O(sqrt(candies))
def distributeCandiesV1(self, candies: int, num_people: int) -> List[int]:
i, ans = 0, [0] * num_people
while candies > 0:
ans[i % num_people] += min(candies, i + 1)
candies -= i + 1
... |
devGregA/code | refs/heads/master | build/lib.linux-x86_64-2.7/scrapy/http/request/rpc.py | 169 | """
This module implements the XmlRpcRequest class which is a more convenient class
(that Request) to generate xml-rpc requests.
See documentation in docs/topics/request-response.rst
"""
from six.moves import xmlrpc_client as xmlrpclib
from scrapy.http.request import Request
from scrapy.utils.python import get_func_a... |
zaquestion/interview | refs/heads/master | 9.3_binary_search_rotated_list.py | 2 | import unittest
def binary_search_rotated(a_list, low, high, n):
mid = (high + low) / 2
if a_list[low] < a_list[high] or low == high:
if a_list[low] > n or a_list[high] < n:
return None
else:
return binary_search(a_list, low, high, n)
else:
l = binary_search... |
mscuthbert/abjad | refs/heads/master | abjad/tools/pitchtools/test/test_pitchtools_PitchClassSet_multiply.py | 2 | # -*- encoding: utf-8 -*-
from abjad import *
def test_pitchtools_PitchClassSet_multiply_01():
assert pitchtools.PitchClassSet([0, 1, 5]).multiply(5) == \
pitchtools.PitchClassSet([0, 1, 5])
assert pitchtools.PitchClassSet([1, 2, 6]).multiply(5) == \
pitchtools.PitchClassSet([5, 6, 10])
a... |
OriHoch/django-oscar-demo | refs/heads/master | demo/4.custom-pricing/oscardemo/settings/__init__.py | 3 | __author__ = 'orihoch'
|
unnikrishnankgs/va | refs/heads/master | venv/lib/python3.5/site-packages/external/protobuf/python/google/protobuf/internal/api_implementation.py | 82 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
praemdonck/micropython | refs/heads/master | tests/basics/try_finally_loops.py | 63 | # Test various loop types, some may be implemented/optimized differently
while True:
try:
break
finally:
print('finally 1')
for i in [1, 5, 10]:
try:
continue
finally:
print('finally 2')
for i in range(3):
try:
continue
finally:
print('finally 3... |
abretaud/python-chado | refs/heads/master | test/expression_test.py | 1 | from . import ChadoTestCase, ci
class ExpressionTest(ChadoTestCase):
def test_add_biomaterial(self):
# Setup testing data
biomaterial_name = "test_biomat"
biomaterial_provider = "Helena Ventseslav"
biomaterial_description = "This is a description"
biosample_accession = 'b... |
pandeyop/tempest | refs/heads/master | tempest/stress/actions/server_create_destroy.py | 15 | # Copyright 2013 Quanta Research Cambridge, 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 appli... |
vadimtk/chrome4sdp | refs/heads/master | tools/telemetry/telemetry/internal/actions/loop.py | 32 | # Copyright 2013 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.
"""A Telemetry page_action that loops media playback.
Action parameters are:
- loop_count: The number of times to loop media.
- selector: If no selector is ... |
aneeshusa/servo | refs/heads/master | components/script/dom/bindings/codegen/parser/tests/test_builtin_filename.py | 276 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface Test {
attribute long b;
};
""");
attr = parser.finish()[0].members[0]
harness.check(attr.type.filename(), '<builtin>', 'Filename on builtin type')
|
haripradhan/MissionPlanner | refs/heads/master | Lib/string.py | 55 | """A collection of string operations (most are no longer used).
Warning: most of the code you see here isn't normally used nowadays.
Beginning with Python 1.6, many of these functions are implemented as
methods on the standard string object. They used to be implemented by
a built-in module called strop, but strop... |
dancingdan/tensorflow | refs/heads/master | tensorflow/python/training/server_lib_test.py | 7 | # 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... |
MiltosD/CEFELRC | refs/heads/master | lib/python2.7/site-packages/django/contrib/localflavor/za/za_provinces.py | 544 | from django.utils.translation import gettext_lazy as _
PROVINCE_CHOICES = (
('EC', _('Eastern Cape')),
('FS', _('Free State')),
('GP', _('Gauteng')),
('KN', _('KwaZulu-Natal')),
('LP', _('Limpopo')),
('MP', _('Mpumalanga')),
('NC', _('Northern Cape')),
('NW', _('North West')),
('WC'... |
jesseditson/rethinkdb | refs/heads/next | external/v8_3.30.33.16/build/gyp/pylib/gyp/win_tool.py | 58 | #!/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.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... |
1013553207/django | refs/heads/master | django/utils/version.py | 344 | from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/loot/creature_loot/generic/heroic_echo_tauntaun_junk_02.py | 85615 | import sys
def setup(core, object):
return |
agry/NGECore2 | refs/heads/master | scripts/object/tangible/lair/base/lair_base_den_earthen_dark.py | 85615 | import sys
def setup(core, object):
return |
fajoy/nova | refs/heads/grizzly-2 | nova/scheduler/filters/project_host_filter.py | 1 | # Copyright (c) 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 requi... |
renatosamperio/context_task_queue | refs/heads/master | __init__.py | 1 | #!/usr/bin/python
from Provider import *
from Services import *
from Tools import *
from Utils import *
|
dgellis90/nipype | refs/heads/master | nipype/interfaces/fsl/tests/test_auto_FEATModel.py | 12 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ....testing import assert_equal
from ..model import FEATModel
def test_FEATModel_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ev_files=dict(argstr='%s',
copyfile=False,
mand... |
tobi-weber/levitas-memstorage | refs/heads/master | src/levitas_memstorage/memstoraged.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2013 Tobias Weber <tobi-weber@gmx.de>
#
# 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 ... |
Asnelchristian/coala | refs/heads/master | tests/results/SourceRangeTest.py | 21 | import unittest
from collections import namedtuple
from os.path import abspath
from coalib.results.SourcePosition import SourcePosition
from coalib.results.SourceRange import SourceRange
from coalib.results.AbsolutePosition import AbsolutePosition
from coalib.results.Diff import Diff
class SourceRangeTest(unittest.T... |
15Dkatz/pants | refs/heads/master | contrib/confluence/src/python/pants/contrib/confluence/targets/doc_page.py | 2 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.payl... |
z0by/django | refs/heads/master | tests/contenttypes_tests/urls.py | 426 | from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib.contenttypes import views
urlpatterns = [
url(r'^shortcut/([0-9]+)/(.*)/$', views.shortcut),
]
|
joequery/django | refs/heads/master | tests/auth_tests/__init__.py | 742 | # The password for the fixture data users is 'password'
|
rjoudrey/volatility | refs/heads/master | volatility/plugins/linux/proc_maps.py | 44 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... |
el-ethan/kivy | refs/heads/master | examples/widgets/bubble_test.py | 56 | '''
Bubble
======
Test of the widget Bubble.
'''
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.button import Button
from kivy.lang import Builder
from kivy.uix.bubble import Bubble
Builder.load_string('''
<cut_copy_paste>
size_hint: (None, None)
size: (160, 120)
pos_... |
mhorn71/StarinetPythonLogger | refs/heads/master | actions/setRate.py | 1 | # StarinetPython3Logger a data logger for the Beaglebone Black.
# Copyright (C) 2015 Mark Horn
#
# This file is part of StarinetPython3Logger.
#
# StarinetPython3Logger 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 Fou... |
raquel-ucl/tinydb | refs/heads/master | tinydb/database.py | 4 | """
Contains the :class:`database <tinydb.database.TinyDB>` and
:class:`tables <tinydb.database.Table>` implementation.
"""
import warnings
from tinydb import JSONStorage
from tinydb.utils import LRUCache
class Element(dict):
"""
Represents an element stored in the database.
This is a transparent proxy f... |
mlaidouni/Artistfunds | refs/heads/master | manage.py | 1 | from artistfunds import manager
if __name__ == "__main__":
manager.run() |
kerneltask/micropython | refs/heads/master | tests/thread/thread_exc2.py | 15 | # test raising exception within thread which is not caught
import utime
import _thread
def thread_entry():
raise ValueError
_thread.start_new_thread(thread_entry, ())
utime.sleep(1)
print("done")
|
cntnboys/410Lab6 | refs/heads/master | build/django/build/lib.linux-x86_64-2.7/django/conf/locale/es/formats.py | 82 | # -*- 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 = r'j \d\e F \d\e Y'
TIME_FORMAT = '... |
hortonworks/hortonworks-sandbox | refs/heads/master | desktop/core/ext-py/Django-1.2.3/tests/modeltests/invalid_models/models.py | 10 | """
26. Invalid models
This example exists purely to point out errors in models.
"""
from django.db import models
class FieldErrors(models.Model):
charfield = models.CharField()
charfield2 = models.CharField(max_length=-1)
charfield3 = models.CharField(max_length="bad")
decimalfield = models.DecimalF... |
nkurihar/pulsar | refs/heads/master | pulsar-functions/python-examples/user_exception.py | 7 | #!/usr/bin/env 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
# "... |
ABaldwinHunter/django-clone | refs/heads/master | django/contrib/sitemaps/management/commands/ping_google.py | 645 | from django.contrib.sitemaps import ping_google
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Ping Google with an updated sitemap, pass optional url of sitemap"
def add_arguments(self, parser):
parser.add_argument('sitemap_url', nargs='?', default=None)
... |
abstract-open-solutions/OCB | refs/heads/8.0 | addons/account_sequence/account_sequence.py | 338 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
rohit21122012/DCASE2013 | refs/heads/master | runs/2016/dnn2016med_traps/traps18/src/files.py | 56 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import cPickle as pickle
import csv
import numpy
import os
import wave
import librosa
import yaml
def load_audio(filename, mono=True, fs=44100):
"""Load audio file into numpy array
Supports 24-bit wav-format, and flac audio through librosa.
Parameters
... |
samthor/intellij-community | refs/heads/master | python/helpers/pycharm/utrunner.py | 39 | import sys
import imp
import os
import fnmatch
helpers_dir = os.getenv("PYCHARM_HELPERS_DIR", sys.path[0])
if sys.path[0] != helpers_dir:
sys.path.insert(0, helpers_dir)
from tcunittest import TeamcityTestRunner
from nose_helper import TestLoader, ContextSuite
from pycharm_run_utils import import_system_module
from... |
pizzaro13/FakeNewsDetector | refs/heads/master | Main.py | 1 | import got
def main():
def printTweet(descr, t):
print descr
print "Username: %s" % t.username
print "Retweets: %d" % t.retweets
print "Text: %s" % t.text
print "Mentions: %s" % t.mentions
print "Hashtags: %s\n" % t.hashtags
# Example 1 - Get tweets by username
tweetCriteria = got.manager.TweetCrite... |
JavML/django | refs/heads/master | tests/handlers/urls.py | 359 | from __future__ import unicode_literals
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^regular/$', views.regular),
url(r'^streaming/$', views.streaming),
url(r'^in_transaction/$', views.in_transaction),
url(r'^not_in_transaction/$', views.not_in_transaction),
url(r'^s... |
emilybache/texttest-runner | refs/heads/master | src/main/python/storytext/lib/storytext/javarcptoolkit/describer.py | 1 | from storytext.javaswttoolkit import describer as swtdescriber
from org.eclipse.core.internal.runtime import InternalPlatform
from org.eclipse.ui.forms.widgets import ExpandableComposite
import os
from pprint import pprint
class Describer(swtdescriber.Describer):
swtdescriber.Describer.stateWidgets = [ ExpandableC... |
ruzhytskyi/Koans | refs/heads/master | python3/runner/mockable_test_result.py | 278 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
# Needed to stop unittest.TestResult itself getting Mocked out of existence,
# which is a problem when testing the helper classes! (It confuses the runner)
class MockableTestResult(unittest.TestResult):
pass |
GalaxyTab4/android_kernel_motorola_msm8226 | refs/heads/lp5.1 | tools/perf/scripts/python/netdev-times.py | 11271 | # 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... |
savoirfairelinux/account-financial-tools | refs/heads/7.0 | currency_rate_update/__openerp__.py | 1 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 Camtocamp SA
# @author JB Aubort, Nicolas Bessi, Joel Grand-Guillaume
# European Central Bank and Polish National Bank invented by Grzegorz Grzelak
# Ported to OpenERP 7.0 by Lorenzo... |
Justin-Yuan/Image2Music-Generator | refs/heads/master | library/jython2.5.3/Lib/test/test_codecmaps_cn.py | 16 | #!/usr/bin/env python
#
# test_codecmaps_cn.py
# Codec mapping tests for PRC encodings
#
from test import test_support
from test import test_multibytecodec_support
import unittest
class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'gb2312'
map... |
zendesk/dd-agent | refs/heads/master | tests/checks/mock/test_jenkins.py | 46 | # stdlib
from collections import defaultdict
import datetime
import logging
import os
import shutil
import tempfile
import unittest
# 3p
import xml.etree.ElementTree as ET
# project
from tests.checks.common import get_check
logger = logging.getLogger(__file__)
DATETIME_FORMAT = '%Y-%m-%d_%H-%M-%S'
LOG_DATA = 'Finis... |
abalkin/numpy | refs/heads/master | numpy/core/tests/test_errstate.py | 17 | import pytest
import sysconfig
import numpy as np
from numpy.testing import assert_, assert_raises
# The floating point emulation on ARM EABI systems lacking a hardware FPU is
# known to be buggy. This is an attempt to identify these hosts. It may not
# catch all possible cases, but it catches the known cases of gh-4... |
bvcms/bvcms | refs/heads/develop | CmsWeb/Lib/fractions.py | 252 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Rational, infinite-precision, real numbers."""
from __future__ import division
from decimal import Decimal
import math
import numbers
import operator
import re
__all__ = ['Fraction', 'gcd']
Rational... |
TobbeTripitaka/src | refs/heads/master | book/cwp/geo2008InterferometricImagingCondition/iic.py | 5 | from rsf.proj import *
import fdmod,gfield,math
# ------------------------------------------------------------
def param():
par = {
'co':3000, # velocity (m/s)
'fo':200, # central frequency (Hz)
'nt':3000, 'ot':0, 'dt':0.0001, 'lt':'Time', 'ut':'s', 'nht':10,
'nx':1201, 'ox':... |
ghostwords/localore | refs/heads/master | localore/about/models.py | 1 | from django.db import models
from modelcluster.fields import ParentalKey
from wagtail.wagtailadmin.edit_handlers import FieldPanel, InlinePanel
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailcore.models import Orderable, Page
from wagtail.wagtailsearch import index
from blog.models import R... |
mkrupcale/ansible | refs/heads/devel | lib/ansible/modules/identity/ipa/ipa_group.py | 28 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
... |
def-/commandergenius | refs/heads/sdl_android | project/jni/python/src/Lib/ctypes/test/test_numbers.py | 51 | from ctypes import *
import unittest
import struct
def valid_ranges(*types):
# given a sequence of numeric types, collect their _type_
# attribute, which is a single format character compatible with
# the struct module, use the struct module to calculate the
# minimum and maximum value allowed for this... |
cfpb/django-cache-tools | refs/heads/master | cache_tools/templatetags/get_group_key.py | 1 | from django import template
from cache_tools.tools import get_group_key
register = template.Library()
class GetGroupKeyNode(template.Node):
def __init__(self, group, var_name):
self.group = group
self.var_name = var_name
def render(self, context):
context[self.var_name] = get_group_k... |
evernym/plenum | refs/heads/master | plenum/test/zstack_tests/test_restart_client_stack.py | 2 | def test_send_with_clientstack_restarts(looper,
txnPoolNodeSet):
for _ in range(10):
for node in txnPoolNodeSet:
node.restart_clientstack()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.