repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
spinicist/ITK | Wrapping/Generators/Python/Tests/wrappingCoverage.py | 8 | 2909 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
solarjoe/numpy | tools/npy_tempita/compat3.py | 42 | 1094 | from __future__ import absolute_import, division, print_function
import sys
__all__ = ['PY3', 'b', 'basestring_', 'bytes', 'next', 'is_unicode',
'iteritems']
PY3 = True if sys.version_info[0] == 3 else False
if sys.version_info[0] < 3:
def next(obj):
return obj.next()
def iteritems(d, *... | bsd-3-clause |
wulczer/ansible | lib/ansible/inventory/__init__.py | 13 | 25475 | # (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... | gpl-3.0 |
tensorflow/models | official/nlp/nhnet/configs.py | 1 | 3203 | # Copyright 2021 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 |
spezi77/android_kernel_htc_qsd8k_3.0 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
bertucho/epic-movie-quotes-quiz | dialogos/build/scrapy/tests/test_utils_url.py | 15 | 10500 | import unittest
from scrapy.spiders import Spider
from scrapy.utils.url import url_is_from_any_domain, url_is_from_spider, canonicalize_url
__doctests__ = ['scrapy.utils.url']
class UrlUtilsTest(unittest.TestCase):
def test_url_is_from_any_domain(self):
url = 'http://www.wheele-bin-art.co.uk/get/produc... | mit |
mbaijal/incubator-mxnet | python/mxnet/lr_scheduler.py | 18 | 11542 | # 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 |
mick-d/nipype_source | nipype/interfaces/freesurfer/tests/test_auto_MRIMarchingCubes.py | 5 | 1293 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.freesurfer.utils import MRIMarchingCubes
def test_MRIMarchingCubes_inputs():
input_map = dict(args=dict(argstr='%s',
),
connectivity_value=dict(argstr='%d',
position=-1,
usedefault=T... | bsd-3-clause |
firebitsbr/discover | parsers/parse-nmap.py | 7 | 4345 | #!/usr/bin/env python
#
# by Saviour Emmanuel
from xml.dom import minidom
class NMAP_XMLParser(object):
def __init__(self,file_path):
self._xml_object = object()
self._xml_path = file_path
self._output_path = str()
self._csv_string = str()
self._open_xml()
def _open_xm... | bsd-3-clause |
Crach1015/plugin.video.superpack | zip/plugin.video.Robinhood2.0/youtubedl.py | 255 | 1840 | # -*- coding: utf-8 -*-
import xbmc,xbmcgui
try:
from YDStreamExtractor import getVideoInfo
from YDStreamExtractor import handleDownload
except Exception:
print 'importing Error. You need youtubedl module which is in official xbmc.org'
xbmc.executebuiltin("XBMC.Notification(LiveStreamsPro,Please [C... | gpl-2.0 |
kmoocdev2/edx-platform | lms/djangoapps/verify_student/management/commands/manual_verifications.py | 13 | 3261 | """
Django admin commands related to verify_student
"""
import logging
import os
from pprint import pformat
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User
from lms.djangoapps.verify_student.models import ManualVerification
from lms.djangoapps.verify_stude... | agpl-3.0 |
bansallab/roundup | _214_scrape.py | 1 | 6944 | import csv
from urllib.request import Request, urlopen
import dateutil.parser
import re
from os import system
from sys import argv
from bs4 import BeautifulSoup
from datetime import date
import scrape_util
default_sale, base_url, prefix = scrape_util.get_market(argv)
default_sale = default_sale[0]
report_path = 'mar... | mit |
kwrl/trondheim.kodeklubben.no | backend/wsgi/usermanagement/forms.py | 2 | 1601 | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
from django.forms import ModelForm
class RegistrationForm(UserCreationForm):
email = forms.EmailField(required=True)
first_name = forms.CharField(required=True)... | gpl-3.0 |
houshengbo/nova_vmware_compute_driver | nova/scheduler/manager.py | 2 | 11613 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 OpenStack, LLC.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... | apache-2.0 |
JavaRabbit/CS496_capstone | language/api/analyze.py | 8 | 2746 | #!/usr/bin/env python
# Copyright 2016 Google, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
cedi4155476/QGIS | python/ext-libs/pygments/formatters/svg.py | 362 | 5867 | # -*- coding: utf-8 -*-
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.util import get_bool_opt, get... | gpl-2.0 |
bbc/kamaelia | Sketches/AB/backup/Bookmarks/LiveAnalysis.py | 3 | 37390 | #! /usr/bin/python
'''
Analyses saved data in DB to give something more useful. Saves to output DB ready for display in web interface
Any looking at natural language engines / subtitles should be done here or in components following this
Need to ensure one rogue user can't cause a trend - things must be mentioned by s... | apache-2.0 |
Alecto3-D/testable-greeter | bb-master/sandbox/lib/python3.5/site-packages/buildbot_worker/commands/transfer.py | 3 | 12816 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | mit |
lisong/protobuf-ios-and-android-ndk | python/google/protobuf/service_reflection.py | 601 | 11010 | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions o... | bsd-3-clause |
40223119/2015w13 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_assertions.py | 738 | 15398 | import datetime
import warnings
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... | gpl-3.0 |
ms-iot/python | cpython/Lib/plat-linux/CDROM.py | 330 | 5035 | # Generated by h2py from /usr/include/linux/cdrom.h
CDROMPAUSE = 0x5301
CDROMRESUME = 0x5302
CDROMPLAYMSF = 0x5303
CDROMPLAYTRKIND = 0x5304
CDROMREADTOCHDR = 0x5305
CDROMREADTOCENTRY = 0x5306
CDROMSTOP = 0x5307
CDROMSTART = 0x5308
CDROMEJECT = 0x5309
CDROMVOLCTRL = 0x530a
CDROMSUBCHNL = 0x530b
CDROMREADMODE2 = 0x530c
... | bsd-3-clause |
heytcass/homeassistant-config | deps/sqlalchemy/sql/operators.py | 34 | 23013 | # sql/operators.py
# Copyright (C) 2005-2016 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
# This module is part of SQLAlchemy and is released under
# the MIT License: http:/... | mit |
xiangel/hue | desktop/core/ext-py/pysaml2-2.4.0/example/idp2/idp_uwsgi.py | 29 | 36330 | #!/usr/bin/env python
import importlib
import argparse
import base64
import re
import logging
import time
from hashlib import sha1
from urlparse import parse_qs
from Cookie import SimpleCookie
import os
from saml2.authn import is_equal
from saml2.profile import ecp
from saml2 import server
from saml2 import BINDING_H... | apache-2.0 |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/4NodeANDES/cantilever_different_Poisson/NumberOfDivision1/PoissonRatio0.49/compare_HDF5_ALL.py | 424 | 3382 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... | cc0-1.0 |
jordiclariana/ansible | lib/ansible/modules/system/selinux_permissive.py | 48 | 4345 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Michael Scherer <misc@zarb.org>
# inspired by code of github.com/dandiker/
#
# 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 Softwar... | gpl-3.0 |
hankcs/CS224n | assignment2/utils/parser_utils.py | 7 | 15552 | """Utilities for training the dependency parser.
You do not need to read/understand this code
"""
import time
import os
import logging
from collections import Counter
from general_utils import logged_loop, get_minibatches
from q2_parser_transitions import PartialParse, minibatch_parse
import numpy as np
P_PREFIX = ... | gpl-3.0 |
hazrpg/calibre | src/calibre/gui2/dialogs/confirm_delete.py | 14 | 2426 | #!/usr/bin/env python2
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal kovid@kovidgoyal.net'
__docformat__ = 'restructuredtext en'
from PyQt5.Qt import (
QDialog, Qt, QPixmap, QIcon, QSize, QVBoxLayout, QHBoxLayout, QLabel,
QCheckBox, QDialogButtonBox)
from calibre import confirm_config_name
from... | gpl-3.0 |
LeZhang2016/openthread | tests/scripts/thread-cert/Cert_6_1_03_RouterAttachConnectivity.py | 3 | 4589 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause |
walty8/trac | trac/versioncontrol/web_ui/tests/changeset.py | 1 | 1258 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://trac.edgewall.com/license.html.
#
# This software consists of vo... | bsd-3-clause |
roofmonkey/kubernetes | cluster/juju/return-node-ips.py | 310 | 1024 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | apache-2.0 |
Emergya/icm-openedx-educamadrid-platform-basic | common/djangoapps/course_modes/tests/test_signals.py | 28 | 3279 | """
Unit tests for the course_mode signals
"""
from datetime import datetime, timedelta
from mock import patch
import ddt
from pytz import UTC
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from course_modes.models import CourseMod... | agpl-3.0 |
wkennington/rethinkdb | external/gtest_1.6.0/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | agpl-3.0 |
spring-week-topos/horizon-week | openstack_dashboard/dashboards/admin/networks/forms.py | 7 | 5239 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC 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
#... | apache-2.0 |
mathspace/django | tests/gis_tests/test_geoforms.py | 26 | 15044 | from unittest import skipUnless
from django.contrib.gis import forms
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import GEOSGeometry
from django.forms import ValidationError
from django.test import SimpleTestCase, override_settings, skipUnlessDBFeature
from django.utils.html import escape... | bsd-3-clause |
mlaitinen/odoo | openerp/osv/fields.py | 9 | 74532 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
ysyrov/yaml-cpp | test/gmock-1.7.0/scripts/generator/cpp/keywords.py | 1157 | 2004 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 Google 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... | mit |
ravindrapanda/tensorflow | tensorflow/python/eager/graph_only_ops.py | 69 | 2363 | # 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... | apache-2.0 |
andyaguiar/tornado | demos/appengine/blog.py | 114 | 5385 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | apache-2.0 |
peercoin/peercoin | test/functional/test_framework/test_shell.py | 49 | 2402 | #!/usr/bin/env python3
# Copyright (c) 2019 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
class TestShell:
"""Wrapper Class for Bitc... | mit |
iromli/flosculus | setup.py | 1 | 1639 | import codecs
import os.path
import re
from setuptools import setup
from setuptools import find_packages
def find_version(*file_paths):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, *file_paths), 'r') as f:
version_file = f.read()
version_match = re.search(r... | mit |
vegetableman/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/suggestreviewers.py | 125 | 2506 | # 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 ... | bsd-3-clause |
Jhonbeltran/information-layer8 | informationLayer8/settings.example.py | 1 | 4057 | """
Django settings for informationLayer8 project.
Generated by 'django-admin startproject' using Django 1.10.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
... | mit |
jacksemancik/PokemonPerlaBot | views.py | 1 | 3646 | import pyautogui, time
from color import color_from_mouse
def keypress(key):
pyautogui.keyDown(key)
time.sleep(.5)
pyautogui.keyUp(key)
def save():
keypress('enter')
keypress('up')
keypress('up')
keypress('up')
keypress('x')
keypress('x')
keypress('x')
keypress('x')#spams x to assure that the saving proces... | mit |
yaegashi/ansible-modules-extras | cloud/cloudstack/cs_loadbalancer_rule_member.py | 44 | 10054 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, Darren Worrall <darren@iweb.co.uk>
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 So... | gpl-3.0 |
ahmedsalman/threadedcomments | threadedcomments/management/commands/migratecomments.py | 17 | 2145 | from django.core.management.base import BaseCommand
from django.contrib.comments.models import Comment, FreeComment
from threadedcomments.models import ThreadedComment, FreeThreadedComment
class Command(BaseCommand):
help = "Migrates Django's built-in django.contrib.comments data to threadedcomments data"
... | bsd-3-clause |
mchristopher/PokemonGo-DesktopMap | app/pylibs/win32/Cryptodome/SelfTest/Hash/test_SHAKE.py | 2 | 4960 | # ===================================================================
#
# Copyright (c) 2015, Legrandin <helderijs@gmail.com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redi... | mit |
aclifton/cpeg853-gem5 | src/arch/x86/isa/insts/general_purpose/data_transfer/move.py | 40 | 9122 | # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... | bsd-3-clause |
linked67/p2pool-phicoin | p2pool/test/test_data.py | 276 | 1605 | import random
import unittest
from p2pool import data
from p2pool.bitcoin import data as bitcoin_data
from p2pool.test.util import test_forest
from p2pool.util import forest
def random_bytes(length):
return ''.join(chr(random.randrange(2**8)) for i in xrange(length))
class Test(unittest.TestCase):
def test_h... | gpl-3.0 |
mengxn/tensorflow | tensorflow/contrib/learn/python/learn/tests/dataframe/sparsify_densify_test.py | 62 | 3824 | # 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 |
jasonwzhy/django | tests/model_inheritance/models.py | 227 | 4810 | """
XX. Model inheritance
Model inheritance exists in two varieties:
- abstract base classes which are a way of specifying common
information inherited by the subclasses. They don't exist as a separate
model.
- non-abstract base classes (the default), which are models in their own
right with ... | bsd-3-clause |
ESSS/numpy | numpy/distutils/unixccompiler.py | 155 | 4656 | """
unixccompiler - can handle very long argument lists for ar.
"""
from __future__ import division, absolute_import, print_function
import os
from distutils.errors import DistutilsExecError, CompileError
from distutils.unixccompiler import *
from numpy.distutils.ccompiler import replace_method
from numpy.distutils.... | bsd-3-clause |
mavit/ansible | lib/ansible/modules/files/fetch.py | 22 | 3596 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# This is a virtual module that is entirely implemented as an action plugin and runs on the controller
from __future__ import absolute_import, ... | gpl-3.0 |
hoosteeno/mozillians | vendor-local/lib/python/tablib/packages/odf/text.py | 91 | 17212 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library 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 2.1 of the License, or (at you... | bsd-3-clause |
atvcaptain/enigma2 | lib/python/Components/Converter/ConfigEntryTest.py | 1 | 1749 | from __future__ import print_function
from __future__ import absolute_import
from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.config import configfile
class ConfigEntryTest(Converter, object):
def __init__(self, argstr):
Converter.__init__(self, argstr)
a... | gpl-2.0 |
AlanZatarain/raft | ui/DiffWindow.py | 11 | 3420 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'DiffWindow.ui'
#
# Created: Sun Oct 3 00:57:43 2010
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_DiffWindow(object):
def setupUi(self, DiffW... | gpl-3.0 |
zefciu/django-extensions | tests/test_clean_pyc.py | 12 | 2392 | import fnmatch
import os
import shutil
import six
from django.core.management import call_command
from django.test import TestCase
from django_extensions.management.utils import get_project_root
class CleanPycTests(TestCase):
def setUp(self):
self._settings = os.environ.get('DJANGO_SETTINGS_MODULE')
... | mit |
luismasuelli/python-server-cantrips | cantrips/task/timed.py | 1 | 4468 | from six import integer_types
from cantrips.types.exception import factory
from .features import TornadoTimerFeature, TwistedTimerFeature, ThreadedTimerFeature
class Timeout(object):
"""
Lets a timeout be triggered and cancelled. If the timeout is reached,
an exception is triggered.
Notes: Processo... | lgpl-3.0 |
marcelovilaca/DIRAC | DataManagementSystem/Client/test/FTSSiteTests.py | 15 | 2616 | ########################################################################
# File: FTSSiteTests.py
# Author: Krzysztof.Ciba@NOSPAMgmail.com
# Date: 2013/04/16 08:52:36
########################################################################
""" :mod: FTSSiteTests
==================
.. module: FTSSiteTests
:... | gpl-3.0 |
ROB-Seismology/oq-hazardlib | openquake/hazardlib/calc/__init__.py | 1 | 1266 | # The Hazard Library
# Copyright (C) 2012 GEM 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 option) any later version.
#
# Th... | agpl-3.0 |
ngugi/geonode | geonode/catalogue/backends/pycsw_local.py | 3 | 6015 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | gpl-3.0 |
nhejazi/scikit-learn | sklearn/linear_model/least_angle.py | 6 | 58438 | """
Least Angle Regression algorithm. See the documentation on the
Generalized Linear Model for a complete discussion.
"""
from __future__ import print_function
# Author: Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux
#
# License: BSD 3 ... | bsd-3-clause |
etianen/cms | src/cms/apps/news/admin.py | 2 | 1829 | """Admin settings for the CMS news app."""
from django.contrib import admin
from cms.admin import PageBaseAdmin
from cms.apps.news.models import Category, Article
class CategoryAdmin(PageBaseAdmin):
"""Admin settings for the Category model."""
fieldsets = (
PageBaseAdmin.TITLE_FIELDS,
... | bsd-3-clause |
IndonesiaX/edx-platform | common/test/acceptance/pages/studio/textbooks.py | 65 | 2540 | """
Course Textbooks page.
"""
import requests
from path import Path as path
from ..common.utils import click_css
from .course_page import CoursePage
class TextbooksPage(CoursePage):
"""
Course Textbooks page.
"""
url_path = "textbooks"
def is_browser_on_page(self):
return self.q(css='b... | agpl-3.0 |
povellesto/blobygames | Blob Rage App/random/blobrage.py | 1 | 5331 | import random
from Tkinter import *
root = Tk()
print("")
print("Welcome to Blob Rage Beta 2")
print("Instructions:")
print("To kill blobs you click them until they are dead. You do 2.5 damage to a blob on contact.")
print("")
print("Blobs:")
print("Green Blob: 10 to 50 health, and speed equals a range of -2 to 2.")
p... | unlicense |
cpyou/odoo | openerp/addons/base/ir/ir_cron.py | 276 | 15096 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
rubyinhell/brython | www/src/Lib/test/test_dict.py | 21 | 29053 | import unittest
from test import support
import collections, random, string
import collections.abc
import gc, weakref
import pickle
class DictTest(unittest.TestCase):
def test_invalid_keyword_arguments(self):
class Custom(dict):
pass
for invalid in {1 : 2}, Custom({1 : 2}):
... | bsd-3-clause |
mattjmorrison/logilab-common-clone | optparser.py | 25 | 3344 | # -*- coding: utf-8 -*-
# copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of logilab-common.
#
# logilab-common is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser Genera... | gpl-2.0 |
gaddman/ansible | test/units/modules/network/onyx/test_onyx_l3_interface.py | 68 | 4375 | #
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from units.compat.mock import patch
from ansible.modules.network.onyx impor... | gpl-3.0 |
navodissa/python-flask | flask/lib/python2.7/site-packages/setuptools/tests/test_resources.py | 345 | 23973 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# NOTE: the shebang and encoding lines are for ScriptHeaderTests do not remove
import os
import sys
import tempfile
import shutil
from unittest import TestCase
import pkg_resources
from pkg_resources import (parse_requirements, VersionConflict, parse_version,
Distribution... | bsd-3-clause |
csachs/openmicroscopy | components/tools/OmeroPy/test/unit/gatewaytest/test_argument_errors.py | 13 | 2006 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015 University of Dundee & Open Microscopy Environment.
# All rights reserved.
#
# 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;... | gpl-2.0 |
zxsted/scipy | scipy/linalg/_expm_frechet.py | 117 | 12182 | """Frechet derivative of the matrix exponential."""
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
__all__ = ['expm_frechet', 'expm_cond']
def expm_frechet(A, E, method=None, compute_expm=True, check_finite=True):
"""
Frechet derivative of the matrix ... | bsd-3-clause |
carolineLe/miasm | example/asm/shellcode.py | 3 | 3732 | #! /usr/bin/env python2
from __future__ import print_function
from argparse import ArgumentParser
from pdb import pm
from future.utils import viewitems
from miasm.loader import pe_init
from miasm.loader.strpatchwork import StrPatchwork
from miasm.core import parse_asm, asmblock
from miasm.analysis.machine import Mach... | gpl-2.0 |
bsipocz/ginga | examples/gtk/example2_gtk.py | 1 | 7364 | #! /usr/bin/env python
#
# example2_gtk.py -- Simple, configurable FITS viewer.
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from __future__ import print_function
im... | bsd-3-clause |
aioue/ansible | lib/ansible/modules/monitoring/rollbar_deployment.py | 41 | 4131 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014, Max Riveiro, <kavu13@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... | gpl-3.0 |
SiccarPoint/numpy | numpy/lib/__init__.py | 71 | 1189 | from __future__ import division, absolute_import, print_function
import math
from .info import __doc__
from numpy.version import version as __version__
from .type_check import *
from .index_tricks import *
from .function_base import *
from .nanfunctions import *
from .shape_base import *
from .stride_tricks import *... | bsd-3-clause |
dwillis/django-calaccess-raw-data | calaccess_raw/admin/__init__.py | 29 | 4140 | from calaccess_raw.admin.base import BaseAdmin
from calaccess_raw.admin.campaign import (
CvrSoCdAdmin,
Cvr2SoCdAdmin,
CvrCampaignDisclosureCdAdmin,
Cvr2CampaignDisclosureCdAdmin,
RcptCdAdmin,
Cvr3VerificationInfoCdAdmin,
LoanCdAdmin,
S401CdAdmin,
ExpnCdAdmin,
F495P2CdAdmin,
... | mit |
12AngryMen/votca-scripts | cluster/collectjobs.py | 2 | 3419 | #!bin/python
import os
import re
import shutil
import subprocess
username="wehnerj"
sortstring="8PNPO12"
#sortstring=None
apename="APE_ISO"
workground="WORKGROUND"
class cd:
"""Context manager for changing the current working directory"""
def __init__(self, newPath):
self.newPath = os.path.expanduser(... | apache-2.0 |
Endika/django | django/contrib/sites/managers.py | 4 | 2070 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf import settings
from django.core import checks
from django.core.exceptions import FieldDoesNotExist
from django.db import models
class CurrentSiteManager(models.Manager):
"Use this to limit objects to those associated with the curre... | bsd-3-clause |
hobarrera/django | tests/test_utils/tests.py | 18 | 41065 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
import warnings
from django.conf.urls import url
from django.contrib.staticfiles.finders import get_finder, get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.storage import default_stora... | bsd-3-clause |
googleapis/python-compute | google/cloud/compute_v1/services/region_instances/transports/__init__.py | 1 | 1024 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
sgerhart/ansible | contrib/inventory/ec2.py | 21 | 72932 | #!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... | mit |
bennyhat/me-benbrewer-academic-thesis-ns-3 | src/propagation/bindings/modulegen__gcc_LP64.py | 10 | 158617 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
BrandonY/gsutil | gslib/commands/compose.py | 7 | 7297 | # -*- coding: utf-8 -*-
# Copyright 2013 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 require... | apache-2.0 |
phuongtg/zerorpc-python | zerorpc/socket.py | 134 | 1737 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
insomnia-lab/calibre | src/calibre/utils/bibtex.py | 19 | 100975 | """ Collection of python utility-methodes commonly used by other
bibliograph packages.
From http://pypi.python.org/pypi/bibliograph.core/
from Tom Gross <itconsense@gmail.com>
Adapted for calibre use
Zope Public License (ZPL) Version 2.1
A copyright notice accompanies this license document th... | gpl-3.0 |
fkazimierczak/flask | examples/minitwit/test_minitwit.py | 156 | 4798 | # -*- coding: utf-8 -*-
"""
MiniTwit Tests
~~~~~~~~~~~~~~
Tests the MiniTwit application.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import minitwit
import tempfile
import pytest
@pytest.fixture
def client(request):
db_fd, minitwit.app.... | bsd-3-clause |
quoniammm/happy-machine-learning | Udacity-ML/boston_housing-master_0/visuals.py | 6 | 5008 | ###########################################
# Suppress matplotlib user warnings
# Necessary for newer version of matplotlib
import warnings
warnings.filterwarnings("ignore", category = UserWarning, module = "matplotlib")
#
# Display inline matplotlib plots with IPython
from IPython import get_ipython
get_ipython().run_... | mit |
ZENGXH/scikit-learn | examples/applications/plot_stock_market.py | 227 | 8284 | """
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... | bsd-3-clause |
ifduyue/sentry | src/sentry/filters/manager.py | 10 | 1101 | from __future__ import absolute_import, print_function
__all__ = ['FilterManager', 'FilterNotRegistered']
import six
class FilterNotRegistered(Exception):
pass
# TODO(dcramer): a lot of these managers are very similar and should abstracted
# into some kind of base class
class FilterManager(object):
def __... | bsd-3-clause |
redhat-openstack/django_openstack_auth | openstack_auth/backend.py | 2 | 10356 | # 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
# distributed under the... | apache-2.0 |
buddylindsey/photo-blogger | photob/settings.py | 1 | 6132 | # Django settings for photob project.
import os
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
path = lambda *a: os.path.join(ROOT, *a)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
from postgresify import postgresify
DATABASES... | bsd-2-clause |
laplaceliu/readthedocs.org | readthedocs/builds/filters.py | 33 | 1312 | from django.utils.translation import ugettext_lazy as _
import django_filters
from readthedocs.builds import constants
from readthedocs.builds.models import Build, Version
ANY_REPO = (
('', _('Any')),
)
BUILD_TYPES = ANY_REPO + constants.BUILD_TYPES
class VersionSlugFilter(django_filters.FilterSet):
cla... | mit |
yuchangfu/pythonfun | flaskenv/Lib/site-packages/pip/_vendor/html5lib/trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | gpl-3.0 |
edgarRd/incubator-airflow | airflow/contrib/operators/bigquery_to_gcs.py | 7 | 4491 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
scripnichenko/nova | nova/tests/unit/api/openstack/compute/test_admin_actions.py | 35 | 3992 | # Copyright 2011 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 or a... | apache-2.0 |
pattisdr/osf.io | api_tests/comments/views/test_comment_report_detail.py | 17 | 16596 | from django.utils import timezone
import mock
import pytest
from addons.wiki.tests.factories import WikiFactory
from api.base.settings.defaults import API_BASE
from api_tests import utils as test_utils
from osf.models import Guid
from osf_tests.factories import (
ProjectFactory,
AuthUserFactory,
CommentFac... | apache-2.0 |
lyft/incubator-airflow | airflow/contrib/hooks/gcs_hook.py | 5 | 1514 | #
# 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 |
jjas0nn/solvem | tensorflow/lib/python2.7/site-packages/setuptools/sandbox.py | 86 | 14317 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
import six
from six.moves import builtins, map
import pkg_resources
if sys.platform.startswith('java'):
import org.python.modules.posix.PosixModule as _os
else:
_os = sys.modules[o... | mit |
303750856/linux-3.1 | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # 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... | gpl-2.0 |
edevil/django | django/contrib/gis/gdal/prototypes/ds.py | 10 | 4282 | """
This module houses the ctypes function prototypes for OGR DataSource
related data structures. OGR_Dr_*, OGR_DS_*, OGR_L_*, OGR_F_*,
OGR_Fld_* routines are relevant here.
"""
from ctypes import c_char_p, c_double, c_int, c_long, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from djang... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.