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 |
|---|---|---|---|---|---|
rmccoy7541/egillettii-rnaseq | scripts/snp_performance_analysis.py | 1 | 3682 | #! /bin/env python
import sys
from optparse import OptionParser
import copy
import matplotlib
matplotlib.use('Agg')
import pylab
import scipy.optimize
import numpy
from numpy import array
import dadi
import os
#call ms program from within dadi, using optimized parameters (converted to ms units)
core = "-n 1 0.922 -n 2... | mit |
robobrobro/ballin-octo-shame | lib/Python-3.4.3/Lib/encodings/utf_32.py | 180 | 5128 | """
Python 'utf-32' Codec
"""
import codecs, sys
### Codec APIs
encode = codecs.utf_32_encode
def decode(input, errors='strict'):
return codecs.utf_32_decode(input, errors, True)
class IncrementalEncoder(codecs.IncrementalEncoder):
def __init__(self, errors='strict'):
codecs.IncrementalEncoder.__ini... | mit |
andela-bojengwa/talk | venv/lib/python2.7/site-packages/rest_framework/viewsets.py | 21 | 5303 | """
ViewSets are essentially just a type of class based view, that doesn't provide
any method handlers, such as `get()`, `post()`, etc... but instead has actions,
such as `list()`, `retrieve()`, `create()`, etc...
Actions are only bound to methods at the point of instantiating the views.
user_list = UserViewSet.a... | mit |
mit0110/oppia | core/tests/test_util_jobs.py | 19 | 4472 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
dakerfp/AutobahnPython | examples/twisted/wamp/basic/rpc/timeservice/backend.py | 8 | 1139 | ###############################################################################
##
## Copyright (C) 2014 Tavendo GmbH
##
## 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 |
jelugbo/hebs_master | lms/djangoapps/licenses/tests.py | 30 | 9472 | """Tests for License package"""
import logging
import json
from uuid import uuid4
from random import shuffle
from tempfile import NamedTemporaryFile
import factory
from factory.django import DjangoModelFactory
from django.test import TestCase
from django.test.client import Client
from django.test.utils import overrid... | agpl-3.0 |
ttroy50/vsid | tools/reset_protocol_model.py | 1 | 2350 | #!/usr/bin/python
#
"""
Reset an Protocol in the database to 0
"""
import sys
import yaml
from optparse import OptionParser
def reset_protocol(file, dest, name, attributes=None):
try:
with open(file, 'r') as stream:
database = yaml.load(stream)
except Exception, ex:
print "Excepti... | mit |
SEL-Columbia/commcare-hq | corehq/apps/reports/tests/test_cache.py | 1 | 5210 | import uuid
from django.http import HttpRequest
from django.test import TestCase
from corehq.apps.domain.shortcuts import create_domain
from corehq.apps.reports.cache import CacheableRequestMixIn, request_cache
from corehq.apps.users.models import WebUser
class MockReport(CacheableRequestMixIn):
def __init__(sel... | bsd-3-clause |
pwarren/AGDeviceControl | agdevicecontrol/thirdparty/site-packages/linux2/twisted/trial/reporter.py | 3 | 15233 | # -*- test-case-name: twisted.trial.test.test_trial -*-
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
#
# Author: Jonathan D. Simms <slyphon@twistedmatrix.com>
# Original Author: Jonathan Lange <jml@twistedmatrix.com>
from __future__ import generators
import sys, types
import war... | gpl-2.0 |
eebssk1/CAF_MSM_Kernel_msm8916_64 | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
frreiss/tensorflow-fred | tensorflow/compiler/tests/matrix_triangular_solve_op_test.py | 14 | 7183 | # 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 |
awatts/boto | boto/sdb/db/model.py | 152 | 10158 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# 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 to use, copy,... | mit |
guewen/odoo | addons/account/project/wizard/account_analytic_journal_report.py | 378 | 3164 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
3dfxsoftware/cbss-addons | vauxoo_reports/sale_order_report/report/amd_computadoras_sale_report.py | 1 | 1740 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# author.name@company.com
#
# This program is free software: you can redistrib... | gpl-2.0 |
webu/django-cms | cms/test_utils/project/emailuserapp/forms.py | 61 | 3574 | # -*- coding: utf-8 -*-
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import ReadOnlyPasswordHashField
from .models import EmailUser
class UserCreationForm(forms.ModelForm):
"""
A form for creating a new user, including the required
email and passw... | bsd-3-clause |
TimofeyFox/GT-S7270_kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
Fafou/Sick-Beard | sickbeard/clients/requests/packages/urllib3/contrib/ntlmpool.py | 262 | 4740 | # urllib3/contrib/ntlmpool.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://co... | gpl-3.0 |
dpayne9000/Rubixz-Coin | qa/rpc-tests/test_script_address2.py | 1 | 4079 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test new Rubixzcoin multisig prefix functionality.
#
from test_framework.test_framework import Bitco... | mit |
sightmachine/simplecv2-facerecognizer | examples/mustachinator.py | 1 | 1560 | #!/usr/bin/python
from operator import add
from simplecv.core.camera import Camera
from simplecv.display import Display
from simplecv.factory import Factory
cam = Camera()
display = Display((800,600))
counter = 0
# load the cascades
face_cascade = HaarCascade("face")
nose_cascade = HaarCascade("nose")
stache = Image... | bsd-2-clause |
UoK-Psychology/Openethics | root/tests/views.py | 1 | 5023 | from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from mock import patch, call
from ethicsapplication.models import EthicsApplication
class IndexViewTestCase(TestCase):
def setUp(self):
self.user = User.objects.create_user... | gpl-3.0 |
fabada/pootle | pootle/apps/pootle_app/project_tree.py | 5 | 16115 | #!/usr/bin/env python
# -*- 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 errno
import lo... | gpl-3.0 |
NMGRL/pychron | pychron/mv/diode_locator.py | 2 | 1121 | # ===============================================================================
# Copyright 2012 Jake Ross
#
# 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/licens... | apache-2.0 |
StudTeam6/competition | sw/ground_segment/python/udp_link/datalink_to_w5100.py | 89 | 1441 | #!/usr/bin/python
import os
import sys
import socket
import struct
from optparse import OptionParser
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
parser = OptionParser()
parser.add_option("-d", "--destip", dest="dest_addr", help="Destination IP for messages picked up from local socket", default="1... | gpl-2.0 |
faux123/private_msm8660_ics | 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 |
idjaw/cliff | cliff/formatters/base.py | 3 | 1507 | """Base classes for formatters.
"""
import abc
import six
@six.add_metaclass(abc.ABCMeta)
class Formatter(object):
@abc.abstractmethod
def add_argument_group(self, parser):
"""Add any options to the argument parser.
Should use our own argument group.
"""
@six.add_metaclass(abc.AB... | apache-2.0 |
coll-gate/collgate | server/main/language.py | 1 | 4780 | # -*- coding: utf-8; -*-
#
# @file language.py
# @brief Views related to the language type.
# @author Frédéric SCHERMA (INRA UMR1095)
# @date 2016-09-01
# @copyright Copyright (c) 2016 INRA/CIRAD
# @license MIT (see LICENSE file)
# @details
from django.core.exceptions import SuspiciousOperation
from django.shortcuts i... | mit |
PacktPublishing/Mastering-Mesos | Chapter4/Aurora/src/test/python/apache/aurora/common/test_cluster_option.py | 14 | 2562 | #
# 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 ... | mit |
petewarden/tensorflow | tensorflow/python/data/experimental/ops/prefetching_ops.py | 17 | 11416 | # 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 |
ctismer/pyfilesystem | fs/contrib/tahoelafs/__init__.py | 14 | 15472 | '''
fs.contrib.tahoelafs
====================
This modules provides a PyFilesystem interface to the Tahoe Least Authority
File System. Tahoe-LAFS is a distributed, encrypted, fault-tolerant storage
system:
http://tahoe-lafs.org/
You will need access to a Tahoe-LAFS "web api" service.
Example (it wil... | bsd-3-clause |
kumarkrishna/sympy | sympy/printing/latex.py | 7 | 71602 | """
A Printer which converts an expression into its LaTeX equivalent.
"""
from __future__ import print_function, division
from sympy.core import S, Add, Symbol
from sympy.core.function import _coeff_isneg
from sympy.core.sympify import SympifyError
from sympy.core.alphabets import greeks
from sympy.core.operations im... | bsd-3-clause |
codecollision/DropboxToFlickr | django/contrib/localflavor/br/forms.py | 308 | 5803 | # -*- coding: utf-8 -*-
"""
BR-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, CharField, Select
from django.utils.encoding import smart_unicode
from django.utils.translation import ugettext_lazy as _
... | bsd-3-clause |
catapult-project/catapult | third_party/gsutil/gslib/vendored/boto/boto/swf/layer1_decisions.py | 153 | 11938 | """
Helper class for creating decision responses.
"""
class Layer1Decisions(object):
"""
Use this object to build a list of decisions for a decision response.
Each method call will add append a new decision. Retrieve the list
of decisions from the _data attribute.
"""
def __init__(self):
... | bsd-3-clause |
abzaloid/maps | django-project/lib/python2.7/site-packages/django/core/servers/fastcgi.py | 170 | 6631 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is an adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standal... | mit |
sajuptpm/murano | murano/dsl/exceptions.py | 1 | 3632 | # Copyright (c) 2014 Mirantis, 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... | apache-2.0 |
rafafigueroa/amrws | src/amrpkg/scripts/virtual_tracking.py | 1 | 5059 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Twist
from geometry_msgs.msg import PoseStamped
from tf.transformations import euler_from_quaternion
import numpy as np
def minAngle(ang):
return np.arctan2(np.sin(ang), np.cos(ang))
def ori... | mit |
knehez/edx-platform | lms/djangoapps/shoppingcart/urls.py | 159 | 1390 | from django.conf.urls import patterns, url
from django.conf import settings
urlpatterns = patterns(
'shoppingcart.views',
url(r'^postpay_callback/$', 'postpay_callback'), # Both the ~accept and ~reject callback pages are handled here
url(r'^receipt/(?P<ordernum>[0-9]*)/$', 'show_receipt'),
url(r'^don... | agpl-3.0 |
cxysteven/Paddle | python/paddle/v2/dataset/imikolov.py | 1 | 3909 | # Copyright (c) 2016 PaddlePaddle 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 applic... | apache-2.0 |
peterfpeterson/mantid | scripts/Muon/GUI/Common/calculate_pair_and_group.py | 3 | 5823 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
riteshshrv/django | django/http/__init__.py | 341 | 1103 | from django.http.cookie import SimpleCookie, parse_cookie
from django.http.request import (
HttpRequest, QueryDict, RawPostDataException, UnreadablePostError,
)
from django.http.response import (
BadHeaderError, FileResponse, Http404, HttpResponse,
HttpResponseBadRequest, HttpResponseForbidden, HttpResponse... | bsd-3-clause |
angdraug/nova | nova/tests/objects/test_instance_info_cache.py | 32 | 4744 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
apt-helion/viperidae | data/models.py | 1 | 2405 | import datetime
from peewee import *
from pymongo import MongoClient
from .config import Config
database = Config.DATABASE
# monkey patch the DateTimeField to add support for the isoformt which is what
# peewee exports as from DataSet
DateTimeField.formats.append('%Y-%m-%dT%H:%M:%S')
DateField.formats.append('%Y-%m-... | gpl-3.0 |
brianmoose/civet | client/tests/test_JobRunner.py | 2 | 13950 |
# Copyright 2016 Battelle Energy Alliance, 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 agr... | apache-2.0 |
claws/AutobahnPython | autobahn/autobahn/websocket/http.py | 35 | 19607 | ###############################################################################
##
## Copyright (C) 2011-2013 Tavendo GmbH
##
## 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
##
## h... | apache-2.0 |
nthall/pip | pip/compat/dictconfig.py | 921 | 23096 | # This is a copy of the Python logging.config.dictconfig module,
# reproduced with permission. It is provided here for backwards
# compatibility for Python versions prior to 2.7.
#
# Copyright 2009-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# docu... | mit |
pombredanne/libcomps | libcomps/src/python/docs/doc-sources/conf.py | 2 | 8487 | # -*- coding: utf-8 -*-
#
# x documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 9 16:34:26 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All confi... | gpl-2.0 |
Health123/ansible | lib/ansible/utils/module_docs_fragments/cloudstack.py | 85 | 2161 | # -*- coding: utf-8 -*-
# Copyright (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 Software Foundation, either version 3 of the License, or
# (... | gpl-3.0 |
go-smart/glossia-quickstart | code/problem.py | 1 | 13906 | """This requires CGAL mesher applied to series of surfaces. See readme.txt for details.
"""
from __future__ import print_function
# Use FEniCS for Finite Element
import fenics as d
# Useful to import the derivative separately
from dolfin import dx
# Useful numerical libraries
import numpy as N
import matplotlib
mat... | mit |
restudToolbox/package | development/testing/_modules/auxiliary_reliability.py | 1 | 6085 | from statsmodels.tools.eval_measures import rmse
from copy import deepcopy
import numpy as np
import shlex
import os
from config import SPEC_DIR
import respy
def get_est_log_info():
""" Get the choice probabilities.
"""
with open('est.respy.info') as in_file:
for line in in_file.readlines():
... | mit |
yesho/MITMf | core/proxyplugins.py | 13 | 4292 | # Copyright (c) 2010-2011 Ben Schmidt, Marcello Salvati
#
# 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 progr... | gpl-3.0 |
kracwarlock/Lasagne | lasagne/tests/layers/test_conv.py | 9 | 18394 | import numpy as np
import pytest
import importlib
import theano
import lasagne
from lasagne.utils import floatX
def conv2d(input, kernel, border_mode):
output = np.zeros((input.shape[0],
kernel.shape[0],
input.shape[2] + kernel.shape[2] - 1,
in... | mit |
UdjinM6/dash | test/functional/feature_help.py | 2 | 1909 | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Verify that starting dashd with -h works as expected."""
import subprocess
from test_framework.test_framewo... | mit |
richardcs/ansible | lib/ansible/utils/module_docs_fragments/dimensiondata_wait.py | 192 | 1429 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Dimension Data
#
# This module 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 ... | gpl-3.0 |
Perferom/android_kernel_lge_msm7x27-3.0.x | scripts/build-all.py | 1250 | 9474 | #! /usr/bin/env python
# Copyright (c) 2009-2011, Code Aurora Forum. 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
# n... | gpl-2.0 |
level420/iconfont | generate.py | 1 | 4953 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# qooxdoo - the new era of web development
#
# http://qooxdoo.org
#
# Copyright:
# 2008 - 2012 1&1 Internet AG, Germany, http://www.1und1.de
#
# License:
# MIT: https://opensource.o... | mit |
pitch-sands/i-MPI | flask/Lib/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py | 17 | 15432 | # postgresql/psycopg2.py
# Copyright (C) 2005-2012 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
"""Support for the PostgreSQL database via the psycopg2 driver.
Driver
------
... | bsd-3-clause |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247971765/PyKDE4/kdeui/KPixmapSequence.py | 1 | 1041 | # encoding: utf-8
# module PyKDE4.kdeui
# from /usr/lib/python3/dist-packages/PyKDE4/kdeui.cpython-34m-x86_64-linux-gnu.so
# by generator 1.135
# no doc
# imports
import PyKDE4.kdecore as __PyKDE4_kdecore
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtGui as __PyQt4_QtGui
import PyQt4.QtSvg as __PyQt4_QtSvg
cl... | gpl-2.0 |
vimagick/youtube-dl | youtube_dl/extractor/channel9.py | 124 | 11345 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class Channel9IE(InfoExtractor):
'''
Common extractor for channel9.msdn.com.
The type of provided URL (video or playlist) is determined according to
meta Search.PageType from web p... | unlicense |
lizoyu/kaggle-DigitRecognizer | jupyter/resume_train.py | 1 | 1272 | from lib.data_utils import get_MNIST_data
from keras.models import load_model
from keras.backend import tf as ktf
from keras.optimizers import RMSprop
from keras.callbacks import ModelCheckpoint, EarlyStopping
# Read the MNIST data. Notice that we assume that it's 'kaggle-DigitRecognizer/data/train.csv', and we use he... | gpl-3.0 |
GoogleCloudPlatform/ml-pipeline-generator-python | examples/kfp/demo.py | 1 | 2531 | # python3
# Copyright 2020 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
ernstp/kivy | kivy/tests/test_lang.py | 26 | 5715 | '''
Language tests
==============
'''
import unittest
from weakref import proxy
from functools import partial
class BaseClass(object):
uid = 0
# base class needed for builder
def __init__(self, **kwargs):
super(BaseClass, self).__init__()
self.proxy_ref = proxy(self)
self.childre... | mit |
tempbottle/kbengine | kbe/src/lib/python/Lib/distutils/spawn.py | 81 | 7514 | """distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
import sys
import os
from distutils.errors import DistutilsPlatformError, D... | lgpl-3.0 |
benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/tm/tmsamlssoprofile.py | 3 | 70968 | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | apache-2.0 |
askeing/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/example/hsts_wsh.py | 486 | 1784 | # Copyright 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 f... | mpl-2.0 |
siddharths067/HuHubaProject | lib/urllib3/util/__init__.py | 204 | 1044 | from __future__ import absolute_import
# For backwards compatibility, provide imports that used to be here.
from .connection import is_connection_dropped
from .request import make_headers
from .response import is_fp_closed
from .ssl_ import (
SSLContext,
HAS_SNI,
IS_PYOPENSSL,
IS_SECURETRANSPORT,
as... | mit |
SRabbelier/Melange | thirdparty/google_appengine/google/appengine/ext/bulkload/transform.py | 3 | 15896 | #!/usr/bin/env python
#
# 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
#
# Unless required by applicable law o... | apache-2.0 |
anaran/olympia | apps/amo/management/commands/clean_redis.py | 9 | 3337 | import logging
import os
import socket
import subprocess
import sys
import tempfile
import time
from django.core.management.base import BaseCommand
import redisutils
import redis as redislib
log = logging.getLogger('z.redis')
# We process the keys in chunks of size CHUNK.
CHUNK = 3000
# Remove any sets with less th... | bsd-3-clause |
dataxu/ansible | lib/ansible/parsing/yaml/dumper.py | 90 | 2246 | # (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 |
akiss77/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/test_stream.py | 446 | 6264 | from __future__ import absolute_import, division, unicode_literals
from . import support # flake8: noqa
import unittest
import codecs
from io import BytesIO
from six.moves import http_client
from html5lib.inputstream import (BufferedStream, HTMLInputStream,
HTMLUnicodeInputStream, ... | mpl-2.0 |
turon/openthread | tools/harness-automation/cases/router_9_2_6.py | 1 | 1878 | #!/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
# notic... | bsd-3-clause |
inspirehep/invenio | modules/bibindex/lib/bibindex_engine_tokenizer_unit_tests.py | 5 | 20948 | # -*- coding:utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2010, 2011, 2012, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (... | gpl-2.0 |
SpokesmanReview/django-boundaryservice | boundaryservice/management/commands/loadshapefiles.py | 3 | 10135 | import logging
log = logging.getLogger('boundaries.api.load_shapefiles')
from optparse import make_option
import os, os.path
import sys
from zipfile import ZipFile
from tempfile import mkdtemp
from django.conf import settings
from django.contrib.gis.gdal import (CoordTransform, DataSource, OGRGeometry,
... | mit |
pvt88/scrapy-cloud | cobweb/spiders/search_spider_tbds.py | 2 | 2712 | import scrapy
from datetime import datetime
from cobweb.items import PropertyItem
from cobweb.utilities import extract_number, extract_unit, extract_property_id, strip, extract_listing_type
class SearchSpiderTBDS(scrapy.Spider):
name = 'search_spider_tbds'
def __init__(self, vendor=None, crawl_url=None, typ... | gpl-3.0 |
celadevra/ParaJumper | parajumper/cli/new.py | 1 | 3231 | """module to handle 'new' command."""
import tempfile
import os
import re
from subprocess import call
from clint.textui import prompt, puts, indent, colored
import parajumper.item as item
import parajumper.config as config
import parajumper.db as db
EDITOR = os.environ.get('EDITOR', 'vim')
def dispatch(args):
""... | gpl-3.0 |
fharenheit/template-spark-app | src/main/python/ml/index_to_string_example.py | 123 | 2014 | #
# 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 |
felix1m/pyspotify | spotify/user.py | 3 | 2597 | from __future__ import unicode_literals
import spotify
from spotify import ffi, lib, serialized, utils
__all__ = [
'User',
]
class User(object):
"""A Spotify user.
You can get users from the session, or you can create a :class:`User`
yourself from a Spotify URI::
>>> session = spotify.Se... | apache-2.0 |
Becksteinlab/MDPOW | mdpow/version.py | 1 | 1579 | # POW package __init__.py
# Copyright (c) 2010 Oliver Beckstein <orbeckst@gmail.com>
# Released under the GNU Public License 3 (or higher, your choice)
# See the file COPYING for details.
"""\
MDPOW version information
=========================
MDPOW uses `semantic versioning`_ with the release number consisting
of a... | gpl-3.0 |
mortada/numpy | numpy/core/tests/test_umath_complex.py | 70 | 19916 | from __future__ import division, absolute_import, print_function
import sys
import platform
from numpy.testing import *
import numpy.core.umath as ncu
import numpy as np
# TODO: branch cuts (use Pauli code)
# TODO: conj 'symmetry'
# TODO: FPU exceptions
# At least on Windows the results of many complex functions ar... | bsd-3-clause |
Teamxrtc/webrtc-streaming-node | third_party/webrtc/src/chromium/src/tools/real_world_impact/nsfw_urls.py | 113 | 2143 | # 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.
"""NSFW urls in the Alexa top 2000 sites."""
nsfw_urls = set([
"http://xhamster.com/",
"http://xvideos.com/",
"http://livejasmin.com/",
"http://pornh... | mit |
RUNDSP/luigi-swf | luigi_swf/examples/task_basic.py | 1 | 1677 | #!/usr/bin/env python
import datetime
import logging
import os.path
from subprocess import call
import luigi
from luigi_swf import cw, LuigiSwfExecutor
logger = logging.getLogger(__name__)
seconds = 1.
minutes = 60. * seconds
hours = 60. * minutes
class DemoBasicTask(luigi.Task):
# Workaround for when the... | apache-2.0 |
zero-rp/miniblink49 | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py | 34 | 7369 | # Copyright (C) 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 of conditions and the ... | apache-2.0 |
matthiasdiener/spack | lib/spack/spack/test/cmd/list.py | 3 | 2522 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Mystic-Mirage/android_kernel_gigabyte_roma_r2_plus | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
dmlc/tvm | python/tvm/topi/arm_cpu/depthwise_conv2d.py | 1 | 24416 | # 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 |
PaulKinlan/cli-caniuse | site/app/scripts/bower_components/jsrepl-build/extern/python/unclosured/lib/python2.7/msilib/__init__.py | 43 | 17579 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2005 Martin v. Löwis
# Licensed to PSF under a Contributor Agreement.
from _msi import *
import os, string, re, sys
AMD64 = "AMD64" in sys.version
Itanium = "Itanium" in sys.version
Win64 = AMD64 or Itanium
# Partially taken from Wine
datasizemask= 0x00ff
type_valid= ... | apache-2.0 |
wuga214/Django-Wuga | env/lib/python2.7/site-packages/django/template/__init__.py | 165 | 1889 | """
Django's support for templates.
The django.template namespace contains two independent subsystems:
1. Multiple Template Engines: support for pluggable template backends,
built-in backends and backend-independent APIs
2. Django Template Language: Django's own template engine, including its
built-in loaders, ... | apache-2.0 |
binhqnguyen/lena | src/lte/test/examples-to-run.py | 151 | 3664 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
... | gpl-2.0 |
andela-earinde/bellatrix-py | app/js/lib/lib/modules/pyrepl/pygame_console.py | 13 | 11980 | # Copyright 2000-2004 Michael Hudson-Doyle <micahel@gmail.com>
#
# All Rights Reserved
#
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose is hereby granted without fee,
# provided that the above copyright notice appear in all copies and
#... | mit |
ROMFactory/android_external_chromium_org | build/android/symbolize.py | 97 | 2639 | #!/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.
"""Symbolizes stack traces generated by Chromium for Android.
Sample usage:
adb logcat chromium:V | symbolize.py
"""
import os
im... | bsd-3-clause |
dietrichc/streamline-ppc-reports | examples/dfp/v201411/custom_targeting_service/update_custom_targeting_keys.py | 4 | 2407 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
ioam/holoviews | holoviews/tests/core/testcollation.py | 2 | 3718 | """
Test cases for Collator
"""
import itertools
import numpy as np
from holoviews.core import Collator, HoloMap, NdOverlay, Overlay, GridSpace
from holoviews.element import Curve
from holoviews.element.comparison import ComparisonTestCase
class TestCollation(ComparisonTestCase):
def setUp(self):
alphas,... | bsd-3-clause |
abreen/socrates.py | blessed/tests/test_core.py | 1 | 14455 | # -*- coding: utf-8 -*-
"Core blessed Terminal() tests."
# std
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import collections
import warnings
import platform
import locale
import sys
import imp
import os
# local
from .accessories import (
as_subprocess,
TestTerminal,... | gpl-2.0 |
IRI-Research/django | tests/managers_regress/tests.py | 62 | 8228 | from __future__ import unicode_literals
from django.apps import apps
from django.db import models
from django.template import Context, Template
from django.test import TestCase, override_settings
from django.utils.encoding import force_text
from .models import (
Child1,
Child2,
Child3,
Child4,
Chi... | bsd-3-clause |
zhoulingjun/zipline | zipline/utils/security_list.py | 18 | 4472 | from datetime import datetime
from os import listdir
import os.path
import pandas as pd
import pytz
import zipline
from zipline.finance.trading import with_environment
DATE_FORMAT = "%Y%m%d"
zipline_dir = os.path.dirname(zipline.__file__)
SECURITY_LISTS_DIR = os.path.join(zipline_dir, 'resources', 'security_lists')
... | apache-2.0 |
AOSPU/external_chromium_org | build/android/gyp/finalize_apk.py | 9 | 1864 | #!/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.
"""Signs and zipaligns APK.
"""
import optparse
import shutil
import sys
import tempfile
from util import build_utils
def SignApk(... | bsd-3-clause |
lamby/django-cache-toolbox | cache_toolbox/templatetags/cache_toolbox.py | 1 | 2014 | from django import template
from django.core.cache import cache
from django.template import Node, TemplateSyntaxError, Variable
register = template.Library()
class CacheNode(Node):
def __init__(self, nodelist, expire_time, key):
self.nodelist = nodelist
self.expire_time = Variable(expire_time)
... | bsd-3-clause |
anant-dev/django | tests/forms_tests/models.py | 261 | 3805 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import itertools
import tempfile
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
callable_default_counter = itertools.count()
def callab... | bsd-3-clause |
joedeller/pymine | helloworld.py | 1 | 3234 | #! /usr/bin/python
# Joe Deller 2014
# Our first Minecraft program written in the Python language
# Level : Beginner
# Uses : Libraries
# When learning any programming language there is a tradition of writing
# your first program to simply say "Hello World!"
# The very first line of this program tells the Raspberr... | mit |
devendermishrajio/nova_test_latest | nova/tests/unit/volume/test_cinder.py | 43 | 16898 | # Copyright 2013 Mirantis, Inc.
# Copyright 2013 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
#
# Un... | apache-2.0 |
mnuthan1/workflow | lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/genshistream.py | 1730 | 2278 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... | apache-2.0 |
ktsamis/repose | repose/command/install.py | 2 | 1838 | import concurrent.futures
from . import Command
from itertools import chain
import logging
from ..utils import blue
logger = logging.getLogger("repose.command.install")
class Install(Command):
command = True
def _run(self, repoq, target):
repositories = {}
for repa in self.repa:
... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.