repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
jaxkodex/odoo | addons/base_report_designer/plugin/openerp_report_designer/test/test_fields.py | 391 | 1308 | #
# Use this module to retrive the fields you need according to the type
# of the OpenOffice operation:
# * Insert a Field
# * Insert a RepeatIn
#
import xmlrpclib
import time
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
def get(object, level=3, ending=None, ending_excl=None, recur=None, roo... | agpl-3.0 |
slipguru/ignet | icing/core/learning_function.py | 2 | 17070 | #!/usr/bin/env python
"""Learning function module for the mutation level correction.
Author: Federico Tomasi
Copyright (c) 2016, Federico Tomasi.
Licensed under the FreeBSD license (see LICENSE.txt).
"""
from __future__ import division, print_function
import logging
import matplotlib; matplotlib.use("Agg")
import mat... | bsd-2-clause |
Bulochkin/tensorflow_pack | tensorflow/python/platform/app_test.py | 202 | 1391 | # 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... | apache-2.0 |
kstilwell/tcex | tests/tokens/test_token.py | 1 | 6935 | """Test the TcEx Batch Module."""
# standard library
import threading
import time
class TestToken:
"""Test the TcEx Batch Module."""
def setup_class(self):
"""Configure setup before all tests."""
@property
def thread_name(self):
"""Return the current thread name."""
return th... | apache-2.0 |
zadgroup/edx-platform | common/djangoapps/terrain/stubs/tests/test_http.py | 172 | 3969 | """
Unit tests for stub HTTP server base class.
"""
import unittest
import requests
import json
from terrain.stubs.http import StubHttpService, StubHttpRequestHandler, require_params
class StubHttpServiceTest(unittest.TestCase):
def setUp(self):
super(StubHttpServiceTest, self).setUp()
self.serv... | agpl-3.0 |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/idlelib/IOBinding.py | 43 | 21185 | # changes by dscherer@cmu.edu
# - IOBinding.open() replaces the current window with the opened file,
# if the current window is both unmodified and unnamed
# - IOBinding.loadfile() interprets Windows, UNIX, and Macintosh
# end-of-line conventions, instead of relying on the standard library,
# which will... | gpl-2.0 |
CMSS-BCRDB/RDSV1.0 | trove/cmd/manage.py | 4 | 7098 | # Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
zak-k/iris | lib/iris/tests/unit/quickplot/test_points.py | 11 | 2168 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
danielballan/ipython_extensions | extensions/jinjasolution.py | 4 | 1427 | """A simple extension that renders cells as jinja templates.
For demonstration purposes, this renders in a simple environment with `solution=True`,
so that a solution notebook *template* will be executable.
Input with:
{% if solution %}
solution_code
{% else %}
student_code
{% endif %}
will be e... | bsd-3-clause |
kivy/kivy | kivy/core/text/text_sdl2.py | 4 | 1287 | '''
SDL2 text provider
==================
Based on SDL2 + SDL2_ttf
'''
__all__ = ('LabelSDL2', )
from kivy.compat import PY2
from kivy.core.text import LabelBase
try:
from kivy.core.text._text_sdl2 import (_SurfaceContainer, _get_extents,
_get_fontdescent, _get_fontasce... | mit |
mastizada/kuma | vendor/packages/lockfile/lockfile.py | 179 | 15120 |
"""
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = FileLock('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'somefile', 'is locked alread... | mpl-2.0 |
jithinbp/appinventor-sources | appinventor/misc/componentcreator/componentcreator.py | 77 | 6421 | from Tkinter import Tk, BOTH, END, IntVar, StringVar, LEFT
from ttk import Button, Checkbutton, Frame, Style, Combobox, Label, Entry
from tkFileDialog import askopenfilename
import tkMessageBox
from helpers import *
import os
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)
clas... | apache-2.0 |
arrabito/DIRAC | FrameworkSystem/scripts/dirac-start-component.py | 5 | 1220 | #!/usr/bin/env python
"""
Start DIRAC component using runsvctrl utility
"""
__RCSID__ = "$Id$"
#
from DIRAC.Core.Base import Script
Script.disableCS()
Script.setUsageMessage( '\n'.join( [ __doc__.split( '\n' )[1],
'Usage:',
' %s [option|cfgfile]... | gpl-3.0 |
luo66/scikit-learn | sklearn/tests/test_isotonic.py | 230 | 11087 | import numpy as np
import pickle
from sklearn.isotonic import (check_increasing, isotonic_regression,
IsotonicRegression)
from sklearn.utils.testing import (assert_raises, assert_array_equal,
assert_true, assert_false, assert_equal,
... | bsd-3-clause |
ndchorley/scipy | scipy/weave/tests/test_c_spec.py | 91 | 18927 | from __future__ import absolute_import, print_function
import os
import sys
import tempfile
import string
import time
from numpy.testing import TestCase, assert_, run_module_suite
from scipy.weave import inline_tools, ext_tools, c_spec
from scipy.weave.build_tools import msvc_exists, gcc_exists
from scipy.weave.cata... | bsd-3-clause |
sekikn/incubator-airflow | tests/utils/test_module_loading.py | 12 | 1373 | #
# 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... | apache-2.0 |
ajinabraham/Nosql-Exploitation-Framework | sniff/sniffmongo2.py | 8 | 1705 | from scapy.all import *
import re
import hashlib
from termcolor import colored
import os
md5 = hashlib.md5
def get_packets(port, iface, count):
packets = sniff(filter="port "+str(port)+"", count=count, iface=str(iface))
return packets
def parse_packets(port, iface, count):
packets=""
packet=""
user=""
nonce=""... | bsd-3-clause |
ppanczyk/ansible | lib/ansible/module_utils/exoscale.py | 39 | 6661 | # -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.net>
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the aut... | gpl-3.0 |
wuhengzhi/chromium-crosswalk | third_party/closure_compiler/processor.py | 45 | 3607 | # 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.
"""Process Chrome resources (HTML/CSS/JS) to handle <include> and <if> tags."""
from collections import defaultdict
import re
import os
class LineNumber(o... | bsd-3-clause |
battlecat/Spirit | spirit/comment/bookmark/models.py | 5 | 1801 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from djconfig import config
from ...core.utils import paginator
class CommentBookmark(models.Model):
user = models.ForeignKey(s... | mit |
Acidburn0zzz/servo | tests/wpt/web-platform-tests/tools/third_party/hyper/hyper/common/bufsocket.py | 38 | 8385 | # -*- coding: utf-8 -*-
"""
hyper/http20/bufsocket.py
~~~~~~~~~~~~~~~~~~~~~~~~~
This file implements a buffered socket wrapper.
The purpose of this is to avoid the overhead of unnecessary syscalls while
allowing small reads from the network. This represents a potentially massive
performance optimisation at the cost o... | mpl-2.0 |
Kattis/problemtools | problemtools/tests/test_languages.py | 1 | 8982 | # -*- coding: utf-8 -*-
from unittest import TestCase
import pytest
import os
import re
from problemtools import languages
class Language_test(TestCase):
@staticmethod
def __language_dict():
return {'name': 'A Language',
'priority': 100,
'files': '*.foo *.bar',
... | mit |
tunneln/CarnotKE | jyhton/lib-python/2.7/plat-irix5/GL.py | 132 | 6361 | from warnings import warnpy3k
warnpy3k("the GL module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
NULL = 0
FALSE = 0
TRUE = 1
ATTRIBSTACKDEPTH = 10
VPSTACKDEPTH = 8
MATRIXSTACKDEPTH = 32
NAMESTACKDEPTH = 1025
STARTTAG = -2
ENDTAG = -3
BLACK = 0
RED = 1
GREEN = 2
YELLOW = 3
BLUE = 4
MAGENTA = 5
CYAN = 6... | apache-2.0 |
OndrejIT/pyload | module/plugins/captcha/AdYouLike.py | 8 | 3577 | # -*- coding: utf-8 -*-
import re
from ..internal.CaptchaService import CaptchaService
from ..internal.misc import json
class AdYouLike(CaptchaService):
__name__ = "AdYouLike"
__type__ = "captcha"
__version__ = "0.11"
__status__ = "testing"
__description__ = """AdYouLike captcha service plugin"... | gpl-3.0 |
alanjw/GreenOpenERP-Win-X86 | openerp/addons/survey/report/survey_form.py | 38 | 24102 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
mikedchavez1010/XX-Net | python27/1.0/lib/linux/gevent/monkey.py | 7 | 8533 | # Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details.
"""Make the standard library cooperative.
The functions in this module patch parts of the standard library with compatible cooperative counterparts
from :mod:`gevent` package.
To patch an individual module call the corresponding ``patch_*`` function. F... | bsd-2-clause |
syphar/django | django/db/utils.py | 143 | 10368 | import os
import pkgutil
from importlib import import_module
from threading import local
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils._os import npath, upath
from django.utils.functional import cached_property
from django.utils.... | bsd-3-clause |
theflofly/tensorflow | tensorflow/compiler/tests/placeholder_test.py | 11 | 1885 | # Copyright 2018 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... | apache-2.0 |
skevas/unshortencache | scripts/unshorten_service.py | 1 | 3405 | #!/usr/bin/env python3
import argparse
import base64
import logging
from logging import FileHandler
from flask import Flask, request
from flask_restful import Resource, Api
from werkzeug.exceptions import BadRequest
from isurlshortenercache.unshorten_cache import UnshortenCache
app = Flask(__name__)
api = Api(app)
... | mit |
tvalacarta/tvalacarta | python/main-classic/servers/descargavideos.py | 1 | 1391 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para descargavideos
# http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core i... | gpl-3.0 |
tadeas482/kernel-old | scripts/build-all.py | 1474 | 10189 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... | gpl-2.0 |
dwaynebailey/pootle | tests/models/language.py | 5 | 2286 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from translate.lang.data impo... | gpl-3.0 |
mblondel/scikit-learn | examples/covariance/plot_covariance_estimation.py | 250 | 5070 | """
=======================================================================
Shrinkage covariance estimation: LedoitWolf vs OAS and max-likelihood
=======================================================================
When working with covariance estimation, the usual approach is to use
a maximum likelihood estimator,... | bsd-3-clause |
ehdr/luigi | examples/execution_summary_example.py | 48 | 3375 | # -*- coding: utf-8 -*-
#
# Copyright 2015-2015 Spotify AB
#
# 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... | apache-2.0 |
BestSonny/examples | snli/model.py | 4 | 2653 | import torch
import torch.nn as nn
from torch.autograd import Variable
class Bottle(nn.Module):
def forward(self, input):
if len(input.size()) <= 2:
return super(Bottle, self).forward(input)
size = input.size()[:2]
out = super(Bottle, self).forward(input.view(size[0]*size[1], ... | bsd-3-clause |
mried/beets | test/test_ui.py | 2 | 45285 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, 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 t... | mit |
ahmedaljazzar/edx-platform | openedx/core/djangoapps/user_api/tests/test_helpers.py | 4 | 10973 | """
Tests for helper functions.
"""
import json
import re
import mock
import ddt
import pytest
from django import forms
from django.http import HttpRequest, HttpResponse
from django.test import TestCase
from six import text_type
from ..helpers import (
intercept_errors, shim_student_view,
FormDescription, Inva... | agpl-3.0 |
runjmc/maraschino | lib/transmissionrpc/httphandler.py | 13 | 3037 | # -*- coding: utf-8 -*-
# Copyright (c) 2011 Erik Svensson <erik.public@gmail.com>
# Licensed under the MIT license.
import sys, httplib, urllib2
from transmissionrpc.error import HTTPHandlerError
class HTTPHandler(object):
"""
Prototype for HTTP handling.
"""
def set_authentication(self, uri, login,... | mit |
NextThought/pypy-numpy | numpy/doc/glossary.py | 54 | 12042 | """
========
Glossary
========
.. glossary::
along an axis
Axes are defined for arrays with more than one dimension. A
2-dimensional array has two corresponding axes: the first running
vertically downwards across rows (axis 0), and the second running
horizontally across columns (axis 1... | bsd-3-clause |
bbansalWolfPack/servo | tests/wpt/css-tests/tools/wptserve/wptserve/server.py | 136 | 17886 | import BaseHTTPServer
import errno
import os
import re
import socket
from SocketServer import ThreadingMixIn
import ssl
import sys
import threading
import time
import traceback
import types
import urlparse
import routes as default_routes
from logger import get_logger
from request import Server, Request
from response i... | mpl-2.0 |
blackzw/openwrt_sdk_dev1 | staging_dir/target-mips_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_compiler.py | 112 | 11233 | import test.test_support
compiler = test.test_support.import_module('compiler', deprecated=True)
from compiler.ast import flatten
import os, sys, time, unittest
from random import random
from StringIO import StringIO
# How much time in seconds can pass before we print a 'Still working' message.
_PRINT_WORKING_MSG_INTE... | gpl-2.0 |
dpac-vlsi/SynchroTrace | util/hgfilesize.py | 88 | 1049 | from mercurial import context
from mercurial.i18n import _
'''
[extensions]
hgfilesize=~/m5/incoming/util/hgfilesize.py
[hooks]
pretxncommit = python:hgfilesize.limit_file_size
pretxnchangegroup = python:hgfilesize.limit_file_size
[limit_file_size]
maximum_file_size = 200000
'''
def limit_file_size(ui, repo, node=N... | bsd-3-clause |
airbnb/airflow | tests/providers/amazon/aws/operators/test_glue.py | 7 | 2346 | # 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... | apache-2.0 |
Inter-Actief/alexia | alexia/apps/consumption/views.py | 1 | 9917 | import calendar
import datetime
from django.contrib.auth.decorators import login_required
from django.core.exceptions import PermissionDenied
from django.http import Http404, JsonResponse
from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse_lazy
from django.utils imp... | bsd-3-clause |
piffey/ansible | lib/ansible/modules/cloud/amazon/ec2_eni_facts.py | 33 | 9487 | #!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that i... | gpl-3.0 |
sbidoul/odoo | addons/resource/faces/observer.py | 433 | 2328 | #@+leo-ver=4
#@+node:@file observer.py
#@@language python
#@<< Copyright >>
#@+node:<< Copyright >>
############################################################################
# Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
# ... | agpl-3.0 |
tumbl3w33d/ansible | lib/ansible/modules/network/cnos/cnos_template.py | 52 | 5475 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, Inc.
#
# 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 Licens... | gpl-3.0 |
hujiajie/chromium-crosswalk | tools/telemetry/third_party/webpagereplay/third_party/dns/rdtypes/ANY/RP.py | 248 | 3275 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | bsd-3-clause |
shakamunyi/neutron | neutron/db/migration/alembic_migrations/versions/81c553f3776c_bsn_consistencyhashes.py | 15 | 1076 | # Copyright 2014 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
airodactyl/qutebrowser | qutebrowser/browser/webkit/webkitinspector.py | 2 | 1412 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
fprados/nipype | nipype/interfaces/slicer/legacy/tests/test_auto_BSplineDeformableRegistration.py | 5 | 1943 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.slicer.legacy.registration import BSplineDeformableRegistration
def test_BSplineDeformableRegistration_inputs():
input_map = dict(FixedImageFileName=dict(argstr='%s',
position=-2,
),
Mov... | bsd-3-clause |
pshen/ansible | test/units/modules/network/nxos/test_nxos_vrf.py | 2 | 2916 | # (c) 2016 Red Hat Inc.
#
# 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.
#
# Ansible is dis... | gpl-3.0 |
Alwnikrotikz/dpkt | examples/dhcprequest.py | 20 | 1033 | #!/usr/bin/env python
import dnet
from dpkt import dhcp
from dpkt import udp
from dpkt import ip
from dpkt import ethernet
sysintf = 'eth0'
hw = dnet.eth(sysintf)
intf = dnet.intf()
# build a dhcp discover packet to request an ip
d = dhcp.DHCP(
chaddr = hw.get(),
xid = 1337,
op = dhcp.DHCPDIS... | bsd-3-clause |
dhcrzf/zulip | scripts/lib/clean_venv_cache.py | 1 | 2226 | #!/usr/bin/env python3
import argparse
import os
import sys
if False:
# See https://zulip.readthedocs.io/en/latest/testing/mypy.html#mypy-in-production-scripts
from typing import Set
ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(ZULIP_PATH)
from scri... | apache-2.0 |
stevenmizuno/QGIS | python/plugins/db_manager/dlg_db_error.py | 77 | 2084 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
SimonSapin/pycairo | examples/cairo_snippets/snippets/curve_rectangle.py | 14 | 1807 | #/* a custom shape, that could be wrapped in a function */
x0 = 0.1 #/*< parameters like cairo_rectangle */
y0 = 0.1
rect_width = 0.8
rect_height = 0.8
radius = 0.4 #/*< and an approximate curvature radius */
snippet_normalize (cr, width, height)
x1=x0+rect_width
y1=y0+rect_height
#if (!rect_width || !rect... | gpl-3.0 |
DARKPOP/external_chromium_org | chrome/common/extensions/docs/server2/manifest_features.py | 122 | 1683 | # 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.
'''
Provides a Manifest Feature abstraction, similar to but more strict than the
Feature schema (see feature_utility.py).
Each Manifest Feature has a 'level... | bsd-3-clause |
ron8hu/spark | examples/src/main/python/transitive_closure.py | 128 | 2408 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
ccn-2m/django | tests/regressiontests/utils/module_loading.py | 30 | 7161 | import os
import sys
import imp
from zipimport import zipimporter
from django.core.exceptions import ImproperlyConfigured
from django.utils import unittest
from django.utils.importlib import import_module
from django.utils.module_loading import import_by_path, module_has_submodule
from django.utils._os import upath
... | bsd-3-clause |
tomhughes/python-mapnik | test/python_tests/agg_rasterizer_integer_overflow_test.py | 5 | 3467 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from nose.tools import eq_
import mapnik
from .utilities import run_all
# geojson box of the world
geojson = {"type": "Feature",
"properties": {},
"geometry": {"type": "Polygon",
"coordinates": [[[-17963313.1432... | lgpl-2.1 |
ShinyROM/android_external_chromium_org | chrome/common/extensions/docs/server2/future_test.py | 58 | 1982 | #!/usr/bin/env python
# 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.
import traceback
import unittest
from future import Future
class FutureTest(unittest.TestCase):
def testNoValueOrDelegate(self):
... | bsd-3-clause |
mnahm5/django-estore | Lib/site-packages/boto/cloudtrail/layer1.py | 125 | 17002 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
RCOS-Grading-Server/HWserver | tests/integrationTests/tests/tutorial_02_simple_cpp/__init__.py | 2 | 3032 | # Necessary imports. Provides library functions to ease writing tests.
from lib import prebuild, testcase, SUBMITTY_TUTORIAL_DIR
import subprocess
import os
import glob
import shutil
import traceback
############################################################################
# COPY THE ASSIGNMENT FROM THE SAMPLE ASS... | bsd-3-clause |
duyet-website/api.duyet.net | lib/numpy/core/tests/test_numeric.py | 8 | 99828 | from __future__ import division, absolute_import, print_function
import sys
import warnings
import itertools
import platform
from decimal import Decimal
import numpy as np
from numpy.core import umath
from numpy.random import rand, randint, randn
from numpy.testing import (
TestCase, run_module_suite, assert_, as... | mit |
ahmetabdi/SickRage | lib/pkg_resources.py | 173 | 85435 | """Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipula... | gpl-3.0 |
lhupfeldt/multiconf | test/access_errors_test.py | 1 | 2795 | # Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
# pylint: disable=E0611
from pytest import raises
from multiconf import mc_config, ConfigItem
from multiconf.envs import EnvFactory
from .utils.utils import config_error, replace_ids
from... | bsd-3-clause |
motine/Ohouse | src/vendor/configdb/plugin.py | 4 | 1339 | import amsoil.core.pluginmanager as pm
"""
Configuration Provider
You always want to create/install the configuration keys on plug-in instantiation - it will *not* re-create the config items if they already exists in the database.
Please see the following code for creating defaults and retrieving them ("flask.bind" a... | bsd-3-clause |
praw-dev/praw | praw/models/reddit/mixins/inboxtoggleable.py | 1 | 1240 | """Provide the InboxToggleableMixin class."""
from ....const import API_PATH
class InboxToggleableMixin:
"""Interface for classes that can optionally receive inbox replies."""
def disable_inbox_replies(self):
"""Disable inbox replies for the item.
Example usage:
.. code-block:: pyth... | bsd-2-clause |
ramsateesh/designate | contrib/tempest/dns_schema/domains.py | 9 | 4197 | # Copyright 2014 Hewlett-Packard Development Company, L.P
#
# 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... | apache-2.0 |
cchurch/ansible | lib/ansible/cli/config.py | 47 | 7576 | # Copyright: (c) 2017, 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
import os
import shlex
import subprocess
import yaml
from ansible import context
from ansible.cli... | gpl-3.0 |
ichbestimmtnicht/NOOBS | config/sense-hat/counter.py | 1 | 1796 | import time
from sense_hat import SenseHat
sense = SenseHat()
def get_num(num, alpha):
c = [255,255,255]
w = [0,0,0]
one="0000100000011000000010000000100000001000000010000000100000011100"
two="0001110000100010000000100000010000001000000100000010000000111110"
three="00011100001000100000001000001100... | gpl-2.0 |
javouhey/airquality | tests/raw_mongo.py | 1 | 11288 | # -*- coding: utf-8 -*-
import datetime
m = [{u'data': {u'concentration': 141.0,
u'display': {u'en': u'Unhealthy (at 24-hour exposure at this level)',
u'fr': u''},
u'index': [195, u'AQI'],
u'missing': False,
u'pollutant': u'PM2.5'},
u'raw': u'02-11-2014 07:00... | mit |
pomegranited/edx-platform | common/djangoapps/util/tests/test_organizations_helpers.py | 57 | 2021 | """
Tests for the organizations helpers library, which is the integration point for the edx-organizations API
"""
from mock import patch
from util import organizations_helpers
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
@patch.d... | agpl-3.0 |
unode/jug | jug/tests/test_jug_invalidate.py | 1 | 2387 | import inspect
import os
import jug.jug
import jug.task
import jug.subcommands.invalidate
import jug.subcommands.cleanup
import jug.subcommands.shell
from jug.task import Task
from jug.backends.dict_store import dict_store
from jug.options import Options, default_options
from jug.tests.utils import simple_execute
from... | mit |
rkhozinov/linux-stable | scripts/gdb/linux/cpus.py | 997 | 3560 | #
# gdb helper commands and functions for Linux kernel debugging
#
# per-cpu tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import tasks, utils
MAX_CPUS = 4096
def get_cu... | gpl-2.0 |
yaroslavvb/tensorflow | tensorflow/contrib/tfprof/python/tools/tfprof/print_model_analysis_test.py | 25 | 7217 | # 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... | apache-2.0 |
kerr-huang/SL4A | python/src/Lib/compiler/pyassem.py | 51 | 26153 | """A flow graph representation for Python bytecode"""
import dis
import types
import sys
from compiler import misc
from compiler.consts \
import CO_OPTIMIZED, CO_NEWLOCALS, CO_VARARGS, CO_VARKEYWORDS
class FlowGraph:
def __init__(self):
self.current = self.entry = Block()
self.exit = Block("... | apache-2.0 |
hande-qmc/hande | tools/pyhande/tests/test_canonical.py | 1 | 7116 | """Tests for canonical.py."""
import warnings
import unittest
import pandas as pd
import numpy as np
import pyhande.canonical as canonical
import tests.create_mock_df as create_mock_df
class TestAnalyseHFObservables(unittest.TestCase):
"""Test canonical.analyse_hf_observables."""
def setUp(self):
# C... | lgpl-2.1 |
sehoonha/green_stair | motion/step_offset_motion.py | 1 | 2813 | import logging
import numpy as np
from parameterized_motion import ParameterizedMotion
class StepOffsetMotion(ParameterizedMotion):
def __init__(self, skel, ref, stair):
super(StepOffsetMotion, self).__init__(skel, ref)
self.logger = logging.getLogger(__name__)
self.set_stair_info(stair)
... | mit |
eoncloud-dev/eonboard | eoncloud_web/biz/image/migrations/0001_initial.py | 4 | 1421 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('idc', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operati... | apache-2.0 |
akarol/cfme_tests | cfme/modeling/base.py | 3 | 6300 | from collections import Callable
import attr
from cached_property import cached_property
from widgetastic.utils import VersionPick
from cfme.utils.appliance import NavigatableMixin
from cfme.utils.log import logger
def load_appliance_collections():
from pkg_resources import iter_entry_points
return {
... | gpl-2.0 |
mancoast/CPythonPyc_test | fail/342_test_operator.py | 84 | 18608 | import unittest
from test import support
py_operator = support.import_fresh_module('operator', blocked=['_operator'])
c_operator = support.import_fresh_module('operator', fresh=['_operator'])
class Seq1:
def __init__(self, lst):
self.lst = lst
def __len__(self):
return len(self.lst)
def _... | gpl-3.0 |
pilou-/ansible | lib/ansible/modules/network/onyx/onyx_facts.py | 31 | 7156 | #!/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'],
... | gpl-3.0 |
nithinmurali/robocomp | tools/install.py | 6 | 1145 | # -*- coding: utf-8 -*-
"""
Created on Sat Feb 14 19:36:39 2015
@author: pbustos
"""
import os, sys
from subprocess import call
modules = ["git","git-annex","cmake","g++","libgsl0-dev","libopenscenegraph-dev","cmake-qt-gui",
"zeroc-ice35","freeglut3-dev","libboost-dev","libboost-thread-dev","qt4-dev-tools",
... | gpl-3.0 |
prrvchr/USBTerminal | USB/Gui/PySerialModel.py | 1 | 6106 | # -*- coding: utf-8 -*-
#***************************************************************************
#* *
#* Copyright (c) 2015 Pierre Vacher <prrvchr@gmail.com> *
#* ... | gpl-2.0 |
kartoza/stream_feature_extractor | test/test_init.py | 121 | 1860 | # coding=utf-8
"""Tests QGIS plugin init."""
__author__ = 'Tim Sutton <tim@linfiniti.com>'
__revision__ = '$Format:%H$'
__date__ = '17/10/2010'
__license__ = "GPL"
__copyright__ = 'Copyright 2012, Australia Indonesia Facility for '
__copyright__ += 'Disaster Reduction'
import os
import unittest
import logging
import ... | gpl-2.0 |
yongfuyang/vnpy | vn.datayes/tests.py | 10 | 2567 | from api import *
def test_config():
cfig = Config()
print cfig.body, cfig.head, cfig.token
cfig.view()
def test_mktbar_D1():
api = PyApi(Config())
data = api.get_equity_D1()
print data.body
def test_mktbar_M1():
api = PyApi(Config())
data = api.get_equity_M1()
print data.body.tail()
def t... | mit |
UdK-VPT/Open_eQuarter | mole/stat_corr/rb_present_window_uvalue_MFH_by_building_age_lookup.py | 1 | 2304 | # coding: utf8
# OeQ autogenerated lookup function for 'U-Values of Windows in correlation to year of construction, based on the source data of the survey for the "German Building Typology developed by the "Institut für Wohnen und Umwelt", Darmstadt/Germany, 2011-2013'
import math
import numpy as np
import oeqLookupta... | gpl-2.0 |
yashu-seth/BinPy | BinPy/examples/source/ic/Series_7400/IC7400.py | 5 | 1248 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <headingcell level=2>
# Usage of IC 7400
# <codecell>
from __future__ import print_function
from BinPy import *
# <codecell>
# Usage of IC 7400:
ic = IC_7400()
print(ic.__doc__)
# <codecell>
# The Pin configuration is:
inp = {1: 1, 2: 0, 4: 0, 5: 0, 7: 0, ... | bsd-3-clause |
crazy-canux/django | django/db/backends/postgresql/operations.py | 207 | 10109 | from __future__ import unicode_literals
from psycopg2.extras import Inet
from django.conf import settings
from django.db.backends.base.operations import BaseDatabaseOperations
class DatabaseOperations(BaseDatabaseOperations):
def unification_cast_sql(self, output_field):
internal_type = output_field.get... | bsd-3-clause |
ar7z1/ansible | lib/ansible/modules/cloud/cloudstack/cs_securitygroup.py | 78 | 5313 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
# 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',
... | gpl-3.0 |
upsuper/servo | components/script/dom/bindings/codegen/parser/tests/test_conditional_dictionary_member.py | 120 | 3162 | def WebIDLTest(parser, harness):
parser.parse("""
dictionary Dict {
any foo;
[ChromeOnly] any bar;
};
""")
results = parser.finish()
harness.check(len(results), 1, "Should have a dictionary")
members = results[0].members;
harness.check(len(members), 2, "Should have tw... | mpl-2.0 |
odacremolbap/kubernetes | translations/extract.py | 377 | 3965 | #!/usr/bin/env python
# Copyright 2017 The Kubernetes Authors.
#
# 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... | apache-2.0 |
AltSchool/django | django/conf/locale/hu/formats.py | 504 | 1117 | # -*- 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. F j.'
TIME_FORMAT = 'G.i'
DATE... | bsd-3-clause |
NifTK/NiftyNet | tests/handler_performance_test.py | 1 | 1815 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function
import tensorflow as tf
import numpy as np
from tests.application_driver_test import get_initialised_driver
from niftynet.engine.application_iteration import IterationMessage
from niftynet.engine.signal import SESS_STARTED, ITER_FINISHED, ... | apache-2.0 |
msiedlarek/qtwebkit | Tools/QueueStatusServer/config/messages.py | 119 | 1677 | # Copyright (C) 2013 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 ... | lgpl-3.0 |
bluemini/kuma | vendor/packages/translate/lang/test_hy.py | 33 | 1448 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.lang import factory
def test_punctranslate():
"""Tests that we can translate punctuation."""
language = factory.getlanguage('hy')
assert language.punctranslate(u"") == u""
assert language.punctranslate(u"abc efg") == u"abc efg"
assert l... | mpl-2.0 |
CredoReference/edx-platform | openedx/core/lib/celery/task_utils.py | 12 | 2424 | from contextlib import contextmanager
from crum import CurrentRequestUserMiddleware
from openedx.core.djangoapps.theming.middleware import CurrentSiteThemeMiddleware
from django.http import HttpResponse
from openedx.core.djangoapps.request_cache import get_request_or_stub
@contextmanager
def emulate_http_request(sit... | agpl-3.0 |
zasdfgbnm/tensorflow | tensorflow/contrib/learn/python/learn/graph_actions.py | 76 | 28682 | # 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... | apache-2.0 |
openego/oeplatform | oedb_datamodels/versions/96bafa638b4d_add_api_constraints.py | 1 | 1139 | """Add API constraints table
Revision ID: 96bafa638b4d
Revises: 4ce486182650
Create Date: 2019-11-26 15:33:05.377190
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '96bafa638b4d'
down_revision = '4ce486182650'
branch_labels = None
depends_on = None
def upgra... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.