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 |
|---|---|---|---|---|---|
ma-compbio/PEP | genVecs.py | 1 | 7271 | #encoding:utf-8
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
import pandas as pd
import numpy as np
import os
import sys
import math
import random
import processSeq
import warnings
import threading
from multiprocessing.dummy import Pool as ThreadPool
from sklearn imp... | mit |
Karosuo/Linux_tools | xls_handlers/xls_sum_venv/lib/python3.6/site-packages/wheel/cli/pack.py | 8 | 2263 | from __future__ import print_function
import os.path
import re
import sys
from wheel.cli import WheelError
from wheel.wheelfile import WheelFile
DIST_INFO_RE = re.compile(r"^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$")
def pack(directory, dest_dir, build_number):
"""Repack a previously unpacked whee... | gpl-3.0 |
brianhelba/pylibtiff | libtiff/tiff_sample_plane.py | 2 | 11678 | """ Implements TIFF sample plane.
"""
# Author: Pearu Peterson
# Created: Jan 2011
import numpy
import tif_lzw
__all__ = ['TiffSamplePlane']
def set_array(output_array, input_array):
dtype = numpy.uint8
numpy.frombuffer(output_array.data, dtype=dtype)[:] = numpy.frombuffer(input_array.data, dtype=dtype)
cl... | bsd-3-clause |
jalexvig/tensorflow | tensorflow/contrib/gan/python/eval/python/summaries_impl.py | 15 | 8343 | # 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 |
charlesvdv/servo | tests/wpt/web-platform-tests/tools/six/test_six.py | 418 | 22226 | import operator
import sys
import types
import py
import six
def test_add_doc():
def f():
"""Icky doc"""
pass
six._add_doc(f, """New doc""")
assert f.__doc__ == "New doc"
def test_import_module():
from logging import handlers
m = six._import_module("logging.handlers")
asser... | mpl-2.0 |
thnee/ansible | lib/ansible/modules/cloud/amazon/aws_ses_rule_set.py | 13 | 8315 | #!/usr/bin/python
# Copyright (c) 2017, Ben Tomasik <ben@tomasik.io>
# 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 |
noelbk/neutron-juniper | neutron/plugins/nec/db/api.py | 9 | 7966 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 NEC Corporation. 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.or... | apache-2.0 |
kenorb-contrib/BitTorrent | BTL/twisted_brpc.py | 5 | 24332 | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-3.0 |
F5Networks/f5-common-python | f5/bigip/tm/asm/test/functional/test_signature_statuses.py | 1 | 2730 | # Copyright 2015 F5 Networks 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 agreed to in writi... | apache-2.0 |
shaufi10/odoo | openerp/addons/base/ir/ir_exports.py | 338 | 1672 | # -*- 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... | agpl-3.0 |
cucs-numpde/class | fdtools.py | 1 | 3922 | import numpy
def cosspace(a, b, n=50):
return (a + b)/2 + (b - a)/2 * (numpy.cos(numpy.linspace(-numpy.pi, 0, n)))
def vander_chebyshev(x, n=None):
if n is None:
n = len(x)
T = numpy.ones((len(x), n))
if n > 1:
T[:,1] = x
for k in range(2,n):
T[:,k] = 2 * x * T[:,k-1] - T[:... | bsd-2-clause |
UrusTeam/android_ndk_toolchain_cross | lib/python2.7/ctypes/test/test_arrays.py | 72 | 4269 | import unittest
from ctypes import *
formats = "bBhHiIlLqQfd"
formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \
c_long, c_ulonglong, c_float, c_double, c_longdouble
class ArrayTestCase(unittest.TestCase):
def test_simple(self):
# create classes holding simple numeric types, and che... | gpl-2.0 |
arpankapoor/pambu | pambu.py | 1 | 9458 | #!/usr/bin/env python3
import copy
import curses
import curses.ascii
from enum import Enum
import locale
import math
import sys
import signal
class Direction(Enum):
north, east, south, west = range(4)
def is_opp(self, other):
return ((self == Direction.north and other == Direction.south) or
... | isc |
theflofly/tensorflow | tensorflow/tools/docs/doc_generator_visitor.py | 9 | 10118 | # 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 |
wartman4404/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/standalone.py | 410 | 46785 | #!/usr/bin/env python
#
# Copyright 2012, 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... | mpl-2.0 |
philoniare/horizon | openstack_dashboard/test/integration_tests/tests/test_user_create_delete.py | 16 | 1186 | # 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... | apache-2.0 |
wevote/WeVoteServer | elected_office/urls.py | 1 | 1066 | # elected_office/urls.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.conf.urls import re_path
from . import views_admin
urlpatterns = [
# views_admin
re_path(r'^$', views_admin.elected_office_list_view, name='elected_office_list', ),
re_path(r'^delete/$', views_admin.elected... | mit |
vincepandolfo/django | django/contrib/auth/management/commands/changepassword.py | 4 | 2639 | from __future__ import unicode_literals
import getpass
from django.contrib.auth import get_user_model
from django.contrib.auth.password_validation import validate_password
from django.core.exceptions import ValidationError
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT... | bsd-3-clause |
PoonKang/Kernel_GT-N8013_ICS | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
asm-products/movie-database-service | ani/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | agpl-3.0 |
tensorflow/lingvo | lingvo/tools/beam_utils.py | 1 | 3573 | # Lint as: python3
# 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 ... | apache-2.0 |
zofuthan/edx-platform | common/lib/xmodule/xmodule/library_root_xblock.py | 47 | 5037 | """
'library' XBlock (LibraryRoot)
"""
import logging
from xmodule.studio_editable import StudioEditableModule
from xblock.fields import Scope, String, List, Boolean
from xblock.fragment import Fragment
from xblock.core import XBlock
log = logging.getLogger(__name__)
# Make '_' a no-op so we can scrape strings
_ = ... | agpl-3.0 |
mnunberg/couchbase-python-client | examples/search_keywords.py | 1 | 3016 | #!/usr/bin/env python
#
# Copyright 2013, Couchbase, 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 r... | apache-2.0 |
jackru/pybrain | pybrain/rl/environments/simplerace/simpleracetcp.py | 25 | 4101 | from __future__ import print_function
__author__ = 'Julian Togelius, julian@idsia.ch'
from pybrain.rl.environments import Environment
from math import sqrt
import socket
import string
from scipy import zeros
class SimpleraceEnvironment(Environment):
firstCarScore = 0
secondCarScore = 0
lastStepCurrentWp... | bsd-3-clause |
arkatebi/DynamicalSystems | toggleSwitch/tSwitch-det-pSet-3.py | 1 | 9567 | #/usr/bin/env python
import auxiliary_functions as aux
import PyDSTool as dst
from PyDSTool import common as cmn
import numpy as np
from matplotlib import pyplot as plt
import sys
#------------------------------------------------------------------------------#
def defineSystem():
'''
Create an object that def... | gpl-3.0 |
thomasgilgenast/spqr-nonrel | django/contrib/localflavor/uy/forms.py | 310 | 2083 | # -*- coding: utf-8 -*-
"""
UY-specific form helpers.
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms.fields import Select, RegexField
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.contrib.localflavor.uy.util import get_vali... | bsd-3-clause |
kizniche/Mycodo | mycodo/functions/backup_rsync.py | 1 | 15933 | # coding=utf-8
#
# backup_rsync.py - Periodically perform backup of Mycodo assets to remote system using rsync
#
# Copyright (C) 2015-2020 Kyle T. Gabriel <mycodo@kylegabriel.com>
#
# This file is part of Mycodo
#
# Mycodo is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
leonardowolf/bookfree | flask/lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py | 515 | 2165 | from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
:param obj:
The file-like object to check.
"""
try:
# Check vi... | mit |
catapult-project/catapult | dashboard/dashboard/update_test_suites_test.py | 3 | 13778 | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
import webapp2
import webtest
... | bsd-3-clause |
Odingod/mne-python | mne/gui/tests/test_kit2fiff_gui.py | 13 | 3412 | # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
import os
import warnings
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from nose.tools import assert_true, assert_false, assert_equal
import mne
from mne.io.kit.tests import data_dir as kit_data_... | bsd-3-clause |
t-artistik/browserscope | categories/richtext2/tests/forwarddelete.py | 14 | 15254 |
FORWARDDELETE_TESTS = {
'id': 'FD',
'caption': 'Forward-Delete Tests',
'command': 'forwardDelete',
'checkAttrs': True,
'checkStyle': False,
'Proposed': [
{ 'desc': '',
'tests': [
]
},
{ 'desc': 'forward-delete single characters',
'tests': ... | apache-2.0 |
slightstone/SickRage | lib/hachoir_parser/image/tga.py | 90 | 2927 | """
Truevision Targa Graphic (TGA) picture parser.
Author: Victor Stinner
Creation: 18 december 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import FieldSet, UInt8, UInt16, Enum, RawBytes
from lib.hachoir_core.endian import LITTLE_ENDIAN
from lib.hachoir_parser.image.common import Palett... | gpl-3.0 |
nacc/autotest | mirror/config-sample.py | 6 | 4369 | """
Sample configuration file for the "mirror" script that will use
rsync://rsync.kernel.org to fetch a kernel file list and schedule jobs on new
kernel releases.
This file has to be valid python code executed by the "mirror" script. The file
may define and do anything but the following "names" are special:
- a globa... | gpl-2.0 |
wenxer/fbone | fbone/settings/views.py | 8 | 2765 | # -*- coding: utf-8 -*-
import os
import hashlib
from datetime import datetime
from flask import Blueprint, render_template, current_app, request, flash
from flask.ext.login import login_required, current_user
from ..extensions import db
from ..user import User
from ..utils import allowed_file, make_dir
from .forms... | bsd-3-clause |
newmediamedicine/indivo_server_1_0 | indivo/tests/integration/test_modules/messaging.py | 1 | 2631 | import data
PRD = 'prd'
from utils import *
def test_messaging(IndivoClient):
try:
BODY = 'body'
SUBJECT = 'subject'
MSG_ID = 'message_id'
SEVERITY = 'severity'
admin_client = IndivoClient(data.machine_app_email, data.machine_app_secret)
admin_client.set_app_id(data.app_email)
ac... | gpl-3.0 |
anaruse/chainer | tests/chainer_tests/utils_tests/test_type_check.py | 2 | 11918 | import sys
import unittest
import numpy
from chainer.backends import cuda
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check as T
class TestConstant(unittest.TestCase):
def setUp(self):
self.x = T.Constant(10)
def test_str(self):
self.assertEq... | mit |
JamesTFarrington/flask | flask/debughelpers.py | 318 | 6024 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string, text_type
from .app import Flask
from .bl... | bsd-3-clause |
PeterDaveHello/eden | modules/templates/CRMT/controllers.py | 20 | 3102 | # -*- coding: utf-8 -*-
from gluon import current
#from gluon.html import *
from gluon.storage import Storage
from s3 import S3CustomController
THEME = "CRMT"
# =============================================================================
class index(S3CustomController):
""" Custom Home Page """
def __call... | mit |
2014c2g12/c2g12 | c2wp/w2/static/Brython2.0.0-20140209-164925/Lib/ui/slider.py | 111 | 2275 | import widget
from browser import doc,html
class Slider(widget.Widget):
def __init__(self, id=None, label=False):
self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all")
widget.Widget.__init__(self, self._div_shell, 'slider', id)
self._handle=h... | gpl-2.0 |
uclaros/QGIS | tests/src/python/test_selective_masking.py | 22 | 29190 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsVirtualLayerDefinition
From build dir, run: ctest -R PyQgsSelectiveMasking -V
QGIS_PREFIX_PATH=/home/hme/src/QGIS/build_ninja/output PYTHONPATH=/home/hme/src/QGIS/build_ninja/output/python/:/home/hme/src/QGIS/build_ninja/output/python/plugins:/home/hme/src/QGIS/tests/... | gpl-2.0 |
CapOM/ChromiumGStreamerBackend | chrome/test/chromedriver/embed_js_in_cpp.py | 165 | 1485 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Embeds standalone JavaScript snippets in C++ code.
Each argument to the script must be a file containing an associated JavaScri... | bsd-3-clause |
peremen/gzone_ics_kernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
JoaquimPatriarca/senpy-for-gis | gasp/gdal/manage/general.py | 1 | 3528 | """
General tools for data management
"""
def copy_features(inLyr, outLyr, outDefn, only_geom=True):
"""
Copy the features of one layer to another layer...
If the layers have the same fields, this method could also copy
the tabular data
TODO: See if the input is a layer or not and make ar... | gpl-3.0 |
hkariti/ansible | test/runner/lib/sanity/ansible_doc.py | 16 | 3498 | """Sanity test for ansible-doc."""
from __future__ import absolute_import, print_function
import re
from lib.sanity import (
SanityMultipleVersion,
SanityFailure,
SanitySuccess,
SanitySkipped,
SanityMessage,
)
from lib.util import (
SubprocessError,
display,
intercept_command,
)
from... | gpl-3.0 |
ryfeus/lambda-packs | Tensorflow/source/tensorboard/plugins/distribution/distributions_plugin.py | 5 | 3411 | # 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... | mit |
telwertowski/QGIS | tests/src/python/test_qgscolorbutton.py | 35 | 3786 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsColorButton.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
"""
__... | gpl-2.0 |
tingletech/solr_api | testindex/grab_random_solr_docs.py | 1 | 2229 | import solr
import random
import json
import datetime
SOLR_NEW = solr.Solr('http://127.0.0.1:8983/solr/dc-collection')
SOLR=solr.SearchHandler(solr.Solr('https://registry.cdlib.org/solr',
post_headers = { 'X-Authentication-Token':'xxxyyyzzz'}), "/query")
def get_collection_urls():
q_collections=SOLR(q="*:*", rows... | bsd-3-clause |
matteo88/gasistafelice | gasistafelice/rest/views/blocks/transactions.py | 2 | 6543 | from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from django.core import urlresolvers
from django.http import HttpResponse, HttpResponseServerError
from flexi_auth.models import ObjectWithContext
from gasistafelice.rest.views.blocks.base import BlockSSDataTables, ResourceBlockAction, CREATE_... | agpl-3.0 |
Nihhaar/android_kernel_xiaomi_mocha | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
lostdj/Jaklin-OpenJFX | modules/web/src/main/native/Tools/gtk/gtkdoc.py | 2 | 18084 | # Copyright (C) 2011 Igalia S.L.
#
# 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 of the License, or (at your option) any later version.
#
# This library is distribute... | gpl-2.0 |
40223135/40223135w17 | static/Brython3.1.1-20150328-091302/Lib/pydoc.py | 637 | 102017 | #!/usr/bin/env python3
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydoc <name>" to show documentation ... | gpl-3.0 |
jumpstarter-io/cinder | cinder/tests/brick/fake_lvm.py | 9 | 2074 | # 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... | apache-2.0 |
puneetgkaur/backup_sugar_shell_for_cordova | src/jarabe/model/screen.py | 4 | 1532 | # Copyright (C) 2006-2008 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribute... | gpl-2.0 |
onecue/pybbm | test/test_project/test_app/south_migrations/0001_initial.py | 6 | 8667 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from pybb.compat import get_image_field_full_name, get_user_model_path, get_user_frozen_models
AUTH_USER = get_user_model_path()
class Migration(Schema... | bsd-2-clause |
chouseknecht/galaxy | galaxy/wsgi.py | 1 | 1085 | # (c) 2012-2018, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
... | apache-2.0 |
dcalacci/Interactive_estimation | game/interactive/migrations/0001_squashed_0011_interactive_channel.py | 2 | 3024 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-09-25 06:31
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
replaces = [('interactive', '0001_initial'), ('intera... | mit |
interactomix/iis | iis/tests/test_daemonize.py | 1 | 1182 | import time
from iis.extensions import db
from test_utils.base import BaseTestCase
from iis.util.daemons import daemonize
import iis.models
class TestDaemonize(BaseTestCase):
DAEMON_PID_PATH = "/tmp"
def test_no_exception_raised_and_returns_pid(self):
self.app.logger.debug("Testing daemonize")
... | agpl-3.0 |
SRabbelier/Melange | app/soc/modules/gci/logic/models/timeline.py | 1 | 1347 | #!/usr/bin/env python2.5
#
# Copyright 2009 the Melange 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 applic... | apache-2.0 |
hojel/calibre | src/chardet/escprober.py | 215 | 3029 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
Vimos/scikit-learn | sklearn/metrics/__init__.py | 28 | 3604 | """
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... | bsd-3-clause |
nikitasingh981/scikit-learn | sklearn/decomposition/fastica_.py | 9 | 18717 | """
Python implementation of the fast ICA algorithms.
Reference: Tables 8.3 and 8.4 page 196 in the book:
Independent Component Analysis, by Hyvarinen et al.
"""
# Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux,
# Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann
# License: BS... | bsd-3-clause |
sysalexis/kbengine | kbe/src/lib/python/Lib/tokenize.py | 78 | 24876 | """Tokenization help for Python programs.
tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens. It decodes the bytes according to PEP-0263 for
determining source file encoding.
It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF). ... | lgpl-3.0 |
pattisdr/osf.io | osf/migrations/0086_pre_migrate_collections.py | 17 | 4590 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-05 16:30
from __future__ import unicode_literals
from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import osf.models.validato... | apache-2.0 |
DarkSand/Sasila | sasila/system_normal/downloader/http/selenium_response.py | 1 | 1112 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
from posixpath import normpath
if sys.version_info < (3, 0):
reload(sys)
sys.setdefaultencoding('utf-8')
from urlparse import urljoin, urlparse, urlunparse
else:
from urllib.parse import urljoin, urlparse, urlunparse
class SeleniumRes... | apache-2.0 |
apixandru/intellij-community | python/lib/Lib/site-packages/django/db/backends/sqlite3/base.py | 93 | 12206 | """
SQLite3 backend for django.
Python 2.4 requires pysqlite2 (http://pysqlite.org/).
Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the
standard library.
"""
import re
import sys
import datetime
from django.db import utils
from django.db.backends import *
from django.db.backends.signals i... | apache-2.0 |
sxjscience/tvm | python/tvm/relay/frontend/qnn_torch.py | 2 | 27334 | # 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 |
lamby/jenkins.debian.net | bin/reproducible_scheduler.py | 1 | 31885 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright © 2015 Mattia Rizzolo <mattia@mapreri.org>
# Copyright © 2015-2017 Holger Levsen <holger@layer-acht.org>
# Based on reproducible_scheduler.sh © 2014-2015 Holger Levsen <holger@layer-acht.org>
# Licensed under GPL-2
#
# Depends: python3 python3-debian
#
# Schedule... | gpl-2.0 |
sdague/home-assistant | homeassistant/components/lifx_cloud/scene.py | 15 | 2756 | """Support for LIFX Cloud scenes."""
import asyncio
import logging
from typing import Any
import aiohttp
from aiohttp.hdrs import AUTHORIZATION
import async_timeout
import voluptuous as vol
from homeassistant.components.scene import Scene
from homeassistant.const import (
CONF_PLATFORM,
CONF_TIMEOUT,
CONF... | apache-2.0 |
tiexinliu/odoo_addons | smile_model_methods/wizard/wizard_ir_model_method.py | 5 | 1527 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Smile (<http://www.smile.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Aff... | agpl-3.0 |
alfredodeza/boto | boto/sqs/regioninfo.py | 167 | 1524 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# 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 res... | mit |
shenghaozou/PythonGrader | P6/gradeSettings.py | 1 | 8808 | import re
ASSIGNMENT_NAME = 'P6'
ASSIGNMENT_TEST_NUM = 7
EMAIL_SEND = 0
EAMIL_SEND_UPPER_BOUND = 0
def toset(x):
if x != None:
return set(x)
else:
return None
OUTPUT_RESULT_REG_EXP = []
SCRIPT_REG_EXP = []
SCRIPT_EXISTENCE_REG_EXP = []
FUNCTION_ORDER = ['get_level', 'g... | apache-2.0 |
CyanogenMod/android_kernel_htc_m7 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
style95/openwhisk | tools/actionProxy/invoke.py | 3 | 5428 | #!/usr/bin/env python
"""Executable Python script for testing the action proxy.
/*
* 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 thi... | apache-2.0 |
manassolanki/erpnext | erpnext/setup/setup_wizard/operations/company_setup.py | 6 | 4042 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr, getdate
from frappe.utils.file_manager import save_file
from .default_website import w... | gpl-3.0 |
ticosax/django | tests/middleware/tests.py | 5 | 32482 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
import random
import re
from io import BytesIO
from unittest import skipIf
from django.conf import settings
from django.core import mail
from django.http import (
FileResponse, HttpRequest, HttpResponse, HttpResponsePermanentRedirect,
... | bsd-3-clause |
edusegzy/pychemqt | lib/reaction.py | 1 | 9477 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
# Module to define chemical reaction functionality
###############################################################################
from math import exp, log
import sqlite3
from numpy import pol... | gpl-3.0 |
jqug/microscopy-object-detection | readdata.py | 1 | 10627 | import skimage
from lxml import etree
import os
import glob
from sklearn.cross_validation import train_test_split
import numpy as np
from progress_bar import ProgressBar
from skimage import io
from scipy import misc
def create_sets(img_dir, train_set_proportion=.6, test_set_proportion=.2, val_set_proportion=.2):
'... | mit |
keszybz/gnuplot-py | gp_unix.py | 1 | 8276 | # $Id$
# Copyright (C) 1998-2003 Michael Haggerty <mhagger@alum.mit.edu>
#
# This file is licensed under the GNU Lesser General Public License
# (LGPL). See LICENSE.txt for details.
"""gp_unix -- an interface to gnuplot used for unix platforms.
This file implements a low-level interface to a gnuplot program for a
u... | lgpl-2.1 |
cherusk/ansible | lib/ansible/modules/cloud/vmware/vmware_guest.py | 10 | 58143 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This module is also sponsored by E.T.A.I. (www.etai.fr)
#
# 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... | gpl-3.0 |
jasonbot/django | tests/template_tests/filter_tests/test_add.py | 503 | 1688 | from datetime import date, timedelta
from django.template.defaultfilters import add
from django.test import SimpleTestCase
from ..utils import setup
class AddTests(SimpleTestCase):
"""
Tests for #11687 and #16676
"""
@setup({'add01': '{{ i|add:"5" }}'})
def test_add01(self):
output = se... | bsd-3-clause |
redhat-openstack/manila | manila_tempest_tests/tests/api/admin/test_quotas.py | 2 | 13084 | # 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 by... | apache-2.0 |
vnsofthe/odoo-dev | openerp/addons/test_impex/tests/test_import.py | 231 | 30712 | # -*- coding: utf-8 -*-
import openerp.modules.registry
import openerp
from openerp.tests import common
from openerp.tools.misc import mute_logger
def ok(n):
""" Successful import of ``n`` records
:param int n: number of records which should have been imported
"""
return n, 0, 0, 0
def error(row, me... | agpl-3.0 |
MIPS/external-chromium_org | chrome/test/chromedriver/embed_extension_in_cpp.py | 158 | 1124 | #!/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.
"""Embeds Chrome user data files in C++ code."""
import base64
import optparse
import os
import StringIO
import sys
import zipfile
im... | bsd-3-clause |
cloudera/hue | desktop/core/ext-py/pytest-django-3.10.0/tests/test_db_setup.py | 2 | 16810 | import pytest
from pytest_django.lazy_django import get_django_version
from pytest_django_test.db_helpers import (
db_exists,
drop_database,
mark_database,
mark_exists,
skip_if_sqlite_in_memory,
)
def test_db_reuse_simple(django_testdir):
"A test for all backends to check that `--reuse-db` wo... | apache-2.0 |
lfairchild/PmagPy | programs/di_eq.py | 3 | 1144 | #!/usr/bin/env python
from __future__ import print_function
import sys
import numpy
import pmagpy.pmag as pmag
def main():
"""
NAME
di_eq.py
DESCRIPTION
converts dec, inc pairs to x,y pairs using equal area projection
NB: do only upper or lower hemisphere at a time: does not dist... | bsd-3-clause |
haroldl/homeworklog | django/contrib/formtools/tests/__init__.py | 151 | 15220 | import os
from django import forms, http
from django.conf import settings
from django.contrib.formtools import preview, wizard, utils
from django.test import TestCase
from django.utils import unittest
success_string = "Done was called!"
class TestFormPreview(preview.FormPreview):
def get_context(self, request, ... | bsd-3-clause |
VitalPet/account-financial-tools | account_journal_period_close/model/account_period.py | 39 | 2628 | # -*- coding: utf-8 -*-
#
#
# Authors: Adrien Peiffer
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
# All Rights Reserved
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences result... | agpl-3.0 |
aliaspider/RetroArch | tools/vulkan_loader_generator.py | 17 | 6901 | #!/usr/bin/env python3
import sys
import re
def entry_is_device(entry):
first_arg_type = entry[1][1:].split(' ')[0]
device_types = ['VkDevice', 'VkCommandBuffer', 'VkQueue']
return (first_arg_type in device_types) and (entry[0] != 'vkGetDeviceProcAddr')
def main():
pure_entrypoints = []
entrypoin... | gpl-3.0 |
mattclay/ansible | test/units/modules/test_unarchive.py | 11 | 2342 | from __future__ import absolute_import, division, print_function
__metaclass__ = type
import pytest
from ansible.modules.unarchive import ZipArchive, TgzArchive
class AnsibleModuleExit(Exception):
def __init__(self, *args, **kwargs):
self.args = args
self.kwargs = kwargs
class ExitJson(Ansib... | gpl-3.0 |
abelkhan/websearch | websearch/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
steventimberman/masterDebater | venv/lib/python2.7/site-packages/django/utils/dateparse.py | 44 | 4235 | """Functions to parse datetime objects."""
# We're using regular expressions rather than time.strptime because:
# - They provide both validation and parsing.
# - They're more flexible for datetimes.
# - The date/datetime/time constructors produce friendlier error messages.
import datetime
import re
from django.utils... | mit |
booto/dolphin | Externals/fmt/support/manage.py | 10 | 8973 | #!/usr/bin/env python
"""Manage site and releases.
Usage:
manage.py release [<branch>]
manage.py site
"""
from __future__ import print_function
import datetime, docopt, errno, fileinput, json, os
import re, requests, shutil, sys, tempfile
from contextlib import contextmanager
from distutils.version import LooseV... | gpl-2.0 |
ahb0327/intellij-community | python/lib/Lib/site-packages/django/contrib/contenttypes/models.py | 307 | 4052 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class ContentTypeManager(models.Manager):
# Cache to avoid re-looking up ContentType objects all over the place.
# This cache is shared by all the get_for_* methods.
_cache ... | apache-2.0 |
RhodriM/rugby_rankings_py | tests/test_ratings_input.py | 1 | 1207 | import unittest
import rugby_rankings.ratings_input
class TestRatingsInput(unittest.TestCase):
def test_construct(self):
inputObj = rugby_rankings.ratings_input.RatingsInput(0.0, 0.0, 0, 0)
self.assertTrue(
isinstance(inputObj, rugby_rankings.ratings_input.RatingsInput)
)
... | mit |
bverburg/CouchPotatoServer | couchpotato/core/notifications/pushbullet.py | 32 | 3088 | import base64
import json
from couchpotato.core.helpers.encoding import toUnicode
from couchpotato.core.helpers.variable import splitString
from couchpotato.core.logger import CPLog
from couchpotato.core.notifications.base import Notification
log = CPLog(__name__)
autoload = 'Pushbullet'
class Pushbullet(Notifica... | gpl-3.0 |
lhfei/spark-in-action | spark-2.x/src/main/python/wordcount.py | 1 | 1501 | #
# 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 n... | apache-2.0 |
ismailsunni/inasafe | safe/common/parameters/test/example.py | 6 | 1728 | # coding=utf-8
"""Example usage of custom parameters."""
import sys
from safe.definitions.constants import INASAFE_TEST
from safe.test.utilities import get_qgis_app
QGIS_APP, CANVAS, IFACE, PARENT = get_qgis_app(qsetting=INASAFE_TEST)
from qgis.PyQt.QtWidgets import QApplication, QWidget, QGridLayout # NOQA
from ... | gpl-3.0 |
liam2/liam2 | tools/simulation_txt2yaml.py | 1 | 31398 | import csv
import itertools
from itertools import izip
import operator
import os
from os import path
import sys
import yaml
from expr import *
from align_txt2csv import convert_txt_align
# TODO
# - filter fields: output only those which are actually used (comment out
# the rest)
# - convert "leaf" ... | gpl-3.0 |
scalable-networks/gnuradio-3.7.0.1 | gr-filter/python/filter/qa_fractional_interpolator.py | 10 | 3149 | #!/usr/bin/env python
#
# Copyright 2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at ... | gpl-3.0 |
mvanderkolff/xhtml2pdf | xhtml2pdf/pdf.py | 41 | 1949 | # -*- coding: utf-8 -*-
# Copyright 2010 Dirk Holtwick, holtwick.it
#
# 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 ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.