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 |
|---|---|---|---|---|---|
vitan/hue | desktop/core/ext-py/Django-1.6.10/django/contrib/messages/tests/base.py | 104 | 14243 | from django import http
from django.conf import settings, global_settings
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.storage import default_storage, base
from django.contrib.messages.storage.base import M... | apache-2.0 |
ContextLogic/luigi | luigi/contrib/ecs.py | 17 | 6185 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Outlier Bio, 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 la... | apache-2.0 |
amghost/myblog | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/cmdline.py | 95 | 13621 | # -*- coding: utf-8 -*-
"""
pygments.cmdline
~~~~~~~~~~~~~~~~
Command line interface.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
import getopt
from textwrap import dedent
from pygments import __version__, highlight
fro... | mit |
RadioFreeAsia/RDacity | lib-src/lv2/suil/waflib/Tools/d_scan.py | 292 | 3029 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import re
from waflib import Utils,Logs
def filter_comments(filename):
txt=Utils.readf(filename)
i=0
buf=[]
max=len(txt)
begin=0
while i<max:
c=txt[i]
if c=='"'or c=... | gpl-2.0 |
jakereps/qiime2 | qiime2/core/archive/format/tests/test_v0.py | 2 | 2307 | # ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | bsd-3-clause |
Endika/OpenUpgrade | addons/pad/py_etherpad/__init__.py | 505 | 7804 | """Module to talk to EtherpadLite API."""
import json
import urllib
import urllib2
class EtherpadLiteClient:
"""Client to talk to EtherpadLite API."""
API_VERSION = 1 # TODO probably 1.1 sometime soon
CODE_OK = 0
CODE_INVALID_PARAMETERS = 1
CODE_INTERNAL_ERROR = 2
CODE_INVALID_FUNCTION = 3
... | agpl-3.0 |
angelbot/geoincentives | geoincentives/models.py | 1 | 3064 | from django.db import models
from django.contrib.auth.models import User as DjangoUser
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import UserManager
import hashlib
class User(models.Model):
USER_TYPE = (
(1, 'student'),
(2, 'business'),
(3, 'non... | gpl-2.0 |
zhenv5/scikit-learn | examples/feature_selection/plot_feature_selection.py | 249 | 2827 | """
===============================
Univariate Feature Selection
===============================
An example showing univariate feature selection.
Noisy (non informative) features are added to the iris data and
univariate feature selection is applied. For each feature, we plot the
p-values for the univariate feature s... | bsd-3-clause |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/tensorflow/contrib/keras/api/keras/applications/xception/__init__.py | 57 | 1148 | # 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... | bsd-2-clause |
delhivery/django | tests/gis_tests/gdal_tests/test_driver.py | 335 | 1253 | import unittest
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.gdal import Driver, GDALException
valid_drivers = (
# vector
'ESRI Shapefile', 'MapInfo File', 'TIGER', 'S57', 'DGN', 'Memory', 'CSV',
'GML', 'KML',
# raster
'GTiff', 'JPEG', 'MEM', 'PNG',
)
in... | bsd-3-clause |
kezabelle/django-sniplates | docs/conf.py | 4 | 8236 | # -*- coding: utf-8 -*-
#
# Django Sniplates documentation build configuration file, created by
# sphinx-quickstart on Sat Sep 6 10:23:25 2014.
#
# 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 fi... | mit |
damianam/easybuild-framework | easybuild/toolchains/linalg/atlas.py | 3 | 1662 | ##
# Copyright 2012-2017 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
sunze/py_flask | venv/lib/python3.4/site-packages/pip/req/req_requirement.py | 118 | 1245 | from pip._vendor.packaging.version import parse as parse_version
class InstallationCandidate(object):
def __init__(self, project, version, location):
self.project = project
self.version = parse_version(version)
self.location = location
self._key = (self.project, self.version, self... | mit |
rchlin/ShadowsocksFork | shadowsocks/crypto/util.py | 1032 | 4287 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
kslundberg/pants | tests/python/pants_test/backend/python/tasks/test_python_repl.py | 2 | 6547 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import sys... | apache-2.0 |
Castronova/EMIT | utilities/geometry.py | 1 | 9692 | __author__ = 'tonycastronova'
import numpy
from osgeo import ogr
import stdlib
from emitLogging import elog
def fromWKB(wkb):
"""
Builds a stdlib.Geometry object from a WKB string
:param wkb: wkb string
:return: stdlib.Geometry
"""
geom = None
# parse the wkt string into ogr
ogrgeo... | gpl-2.0 |
GoogleCloudPlatform/PerfKitBenchmarker | perfkitbenchmarker/linux_packages/aws_credentials.py | 1 | 4345 | # Copyright 2018 PerfKitBenchmarker 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 appli... | apache-2.0 |
jshleap/Collaboration | contactList/contacts-classification.py | 1 | 4165 | #!/usr/bin/python
'''
Utility scripts for contacts
Copyright (C) 2012 Alex Safatli, Christian Blouin, Jose Sergio Hleap
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... | gpl-3.0 |
rlbabyuk/integration_tests | utils/version.py | 2 | 11791 | # -*- coding: utf-8 -*-
import re
from cached_property import cached_property
from collections import namedtuple
from datetime import date, datetime
import multimethods as mm
from fixtures.pytest_store import store
def get_product_version(ver):
"""Return product version for given Version obj or version string
... | gpl-2.0 |
tayfun/django | tests/auth_tests/models/invalid_models.py | 251 | 1340 | from django.contrib.auth.models import AbstractBaseUser, UserManager
from django.db import models
class CustomUserNonUniqueUsername(AbstractBaseUser):
"""
A user with a non-unique username.
This model is not invalid if it is used with a custom authentication
backend which supports non-unique username... | bsd-3-clause |
iw3hxn/LibrERP | revenue_stamp/revenue_stamp.py | 3 | 7654 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2014 Didotech SRL (info at didotech.com)
# All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole re... | agpl-3.0 |
SivilTaram/edx-platform | lms/djangoapps/shoppingcart/migrations/0018_auto__add_donation.py | 120 | 15611 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Donation'
db.create_table('shoppingcart_donation', (
('orderitem_ptr', self.gf('... | agpl-3.0 |
glaudsonml/kurgan-ai | tools/sqlmap/lib/controller/checks.py | 1 | 61798 | #!/usr/bin/env python
"""
Copyright (c) 2006-2016 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import copy
import httplib
import random
import re
import socket
import time
from subprocess import Popen as execute
from extra.beep.beep import beep
from lib.core.agent imp... | apache-2.0 |
lino-framework/welfare | lino_welfare/projects/gerd/tests/dumps/18.8.0/countries_place.py | 2 | 8075 | # -*- coding: UTF-8 -*-
logger.info("Loading 78 objects to table countries_place...")
# fields: id, parent, name, country, zip_code, type, show_type, inscode
loader.save(create_countries_place(1,None,['Eupen', '', ''],u'BE',u'4700',u'50',False,u'63023'))
loader.save(create_countries_place(2,1,['Nispert', '', ''],u'BE',... | agpl-3.0 |
rvraghav93/scikit-learn | sklearn/neighbors/approximate.py | 3 | 22554 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... | bsd-3-clause |
stdweird/aquilon | lib/python2.6/aquilon/worker/commands/show_organization_all.py | 2 | 1252 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013 Contributor
#
# 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... | apache-2.0 |
wangxianliang/facenet | tmp/mnist_noise_labels.py | 1 | 15390 | # 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... | mit |
Weihonghao/ECM | Vpy34/lib/python3.5/site-packages/tensorflow/python/training/adagrad_da.py | 34 | 5998 | # 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... | agpl-3.0 |
bregman-arie/ansible | lib/ansible/modules/cloud/azure/azure_rm_availabilityset_facts.py | 15 | 4569 | #!/usr/bin/python
#
# Copyright (c) 2016 Julien Stroheker, <juliens@microsoft.com>
# 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 |
jagguli/intellij-community | python/lib/Lib/distutils/file_util.py | 81 | 8341 | """distutils.file_util
Utility functions for operating on single files.
"""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: file_util.py 37828 2004-11-10 22:23:15Z loewis $"
import os
from distutils.errors import DistutilsFileError
from distutils import log
# for generating verbose ou... | apache-2.0 |
dya2/python-for-android | python3-alpha/extra_modules/bs4/testing.py | 46 | 18683 | """Helper classes for tests."""
import copy
import functools
import unittest
from unittest import TestCase
from bs4 import BeautifulSoup
from bs4.element import (
Comment,
Doctype,
SoupStrainer,
)
from bs4.builder import HTMLParserTreeBuilder
default_builder = HTMLParserTreeBuilder
class SoupTest(unitte... | apache-2.0 |
partofthething/home-assistant | homeassistant/components/google_assistant/__init__.py | 2 | 3785 | """Support for Actions on Google Assistant Smart Home Control."""
import logging
from typing import Any, Dict
import voluptuous as vol
# Typing imports
from homeassistant.const import CONF_API_KEY, CONF_NAME
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import config_validation ... | mit |
jendap/tensorflow | tensorflow/contrib/boosted_trees/estimator_batch/dnn_tree_combined_estimator_test.py | 20 | 9393 | # 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 |
eurosata1/e2 | lib/python/Components/Converter/ClockToText.py | 42 | 3445 | from Converter import Converter
from time import localtime, strftime
from Components.Element import cached
class ClockToText(Converter, object):
DEFAULT = 0
WITH_SECONDS = 1
IN_MINUTES = 2
DATE = 3
FORMAT = 4
AS_LENGTH = 5
TIMESTAMP = 6
FULL = 7
SHORT_DATE = 8
LONG_DATE = 9
VFD = 10
AS_LENGTHHOURS = 11
AS... | gpl-2.0 |
0todd0000/spm1d | spm1d/rft1d/examples/val_max_4_anova1_1d.py | 1 | 2121 |
import numpy as np
from matplotlib import pyplot
from spm1d import rft1d
eps = np.finfo(float).eps
def here_anova1(Y, X, X0, Xi, X0i, df):
Y = np.matrix(Y)
### estimate parameters:
b = Xi*Y
eij = Y - X*b
R = eij.T*eij
### reduced design:
b0 = X0i*Y
eij0 = Y... | gpl-3.0 |
hogarthj/ansible | lib/ansible/plugins/connection/network_cli.py | 5 | 19736 | # (c) 2016 Red Hat Inc.
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
---
author: Ansible Networking Team
connection: network_cli
short_... | gpl-3.0 |
weightedEights/runDBcheck | RADAR_DATA/20170713.001/Source/Shell/proxies/txcProxy.py | 5 | 2285 | """
Txc proxy.
This proxy handles all communication between the Txc and the
shell programs
"""
from shell.proxies.baseProxy import baseProxy
import os,re
import time
from xmlrpclib import ServerProxy
import siteconfig
class txcProxy(baseProxy):
def __init__(self,experiment):
baseProxy.__init__(self,'txc... | gpl-3.0 |
jorgealmerio/QEsg | core/ezdxf/modern/solid3d.py | 1 | 2503 | # Purpose: support for ACIS based 3D entities - BODY, REGION, 3DSOLID
# Created: 24.05.2015
# Copyright (C) 2015, Manfred Moitzi
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"
from contextlib import contextmanager
from .graphics import none_subclass, entity_subcl... | gpl-3.0 |
tudorbarascu/QGIS | python/plugins/processing/algs/qgis/BasicStatistics.py | 30 | 13335 | # -*- coding: utf-8 -*-
"""
***************************************************************************
BasicStatistics.py
---------------------
Date : November 2016
Copyright : (C) 2016 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
************... | gpl-2.0 |
manashmndl/kivy | kivy/gesture.py | 50 | 14632 | '''
Gesture recognition
===================
This class allows you to easily create new
gestures and compare them::
from kivy.gesture import Gesture, GestureDatabase
# Create a gesture
g = Gesture()
g.add_stroke(point_list=[(1,1), (3,4), (2,1)])
g.normalize()
# Add it to the database
gdb ... | mit |
chenc10/Spark-PAF | ec2/lib/boto-2.34.0/boto/s3/user.py | 171 | 1968 | # Copyright (c) 2006,2007 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, modi... | apache-2.0 |
pulinagrawal/nupic | scripts/run_swarm.py | 9 | 7871 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
alqfahad/odoo | addons/auth_openid/utils.py | 428 | 1589 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... | agpl-3.0 |
TwinkleChawla/nova | nova/db/sqlalchemy/migrate_repo/versions/300_migration_context.py | 44 | 1117 | # 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 |
msingh172/youtube-dl | youtube_dl/downloader/common.py | 95 | 13848 | from __future__ import division, unicode_literals
import os
import re
import sys
import time
from ..compat import compat_str
from ..utils import (
encodeFilename,
decodeArgument,
format_bytes,
timeconvert,
)
class FileDownloader(object):
"""File Downloader class.
File downloader objects are... | unlicense |
armink/rt-thread | bsp/k210/rtconfig.py | 6 | 1560 | import os
# toolchains options
ARCH ='risc-v'
CPU ='k210'
CROSS_TOOL ='gcc'
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
else:
RTT_ROOT = r'../..'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if CROSS_TOOL == 'gcc':
PLATFORM = 'gcc'
EXEC_PATH = r'/... | apache-2.0 |
ChenJunor/hue | desktop/core/ext-py/Django-1.6.10/django/db/backends/oracle/creation.py | 104 | 12331 | import sys
import time
from django.conf import settings
from django.db.backends.creation import BaseDatabaseCreation
from django.utils.six.moves import input
TEST_DATABASE_PREFIX = 'test_'
PASSWORD = 'Im_a_lumberjack'
class DatabaseCreation(BaseDatabaseCreation):
# This dictionary maps Field objects to their ass... | apache-2.0 |
bjolivot/ansible | lib/ansible/plugins/action/iosxr_config.py | 79 | 4164 | #
# (c) 2017, Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is... | gpl-3.0 |
MicronSW/linux-zynq | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
home-assistant/home-assistant | homeassistant/components/jewish_calendar/sensor.py | 5 | 6627 | """Platform to retrieve Jewish calendar information for Home Assistant."""
import logging
import hdate
from homeassistant.components.sensor import SensorEntity
from homeassistant.const import DEVICE_CLASS_TIMESTAMP, SUN_EVENT_SUNSET
from homeassistant.helpers.sun import get_astral_event_date
import homeassistant.util... | apache-2.0 |
sharkykh/SickRage | sickbeard/databases/cache_db.py | 5 | 5192 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 L... | gpl-3.0 |
daemonmaker/pylearn2 | pylearn2/space/tests/test_space.py | 32 | 58117 | """
Tests for space utilities.
"""
from __future__ import print_function
import itertools
import warnings
import numpy as np
from theano.compat.six.moves import xrange
import theano
from theano import tensor
# Can't use nose.tools.assert_raises, only introduced in python 2.7. Use
# numpy.testing.assert_raises instea... | bsd-3-clause |
k0001/mediasancion | mediasancion/core/migrations/0001_initial.py | 1 | 15801 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Distrito'
db.create_table('core_distrito', (
('id', self.gf('django.db.models.... | agpl-3.0 |
py4n6/pyflag | utilities/raid_test.py | 7 | 1982 | # This is a good example of how the sk.c stuff can be integrated into
# the raid stuff to be able to verify the image without unpacking the
# whole thing.
import mapper
import optparse,sys
import sk
if __name__ == '__main__':
parser = optparse.OptionParser()
parser.add_option('-p','--period',default=6, type=... | gpl-2.0 |
muravjov/ansible | v2/ansible/plugins/action/set_fact.py | 15 | 1402 | # Copyright 2013 Dag Wieers <dag@wieers.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) any later versio... | gpl-3.0 |
efiring/UTide | utide/utilities.py | 1 | 8730 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import numpy as np
from scipy.io import loadmat
# This module is an excerpt from the one in python-gsw.
# Based on Robert Kern's Bunch; taken from
# http://currents.soest.hawaii.edu/hgstage/pycurrents/
# pycurrents/system/uti... | mit |
DrkVenom/roots | roots.py | 1 | 9713 | #Name: Tony Ranieri
#Created: October 2014
#Modified: August 2015
import numpy as np
import pylab as py
import matplotlib.pyplot as plt
def roots(f,df,a,b,niter,epsilon):
# Input
# f: the function that we need to find roots for
# df: derivative of the function f
# a: initial left bracket x... | gpl-2.0 |
happyemi/friendlypi | serverpi/src/plugins/test.py | 1 | 1122 | # Copyright 2013-2014 Emiliano Mennucci
#
# This file is part of FriendlyPi.
#
# FriendlyPi 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 yo... | gpl-3.0 |
FranzSchubert92/cw | python/game_of_stones.py | 1 | 2265 | """
Two players (numbered 1 and 2) are playing a game with n stones. Player 1
always plays first, and the two players move in alternating turns. The game's
rules are as follows:
In a single move, a player can remove 2, 3, or 5 stones from the game board.
If a player is unable to make a move, that player loses the ga... | bsd-3-clause |
adlius/osf.io | website/project/views/node.py | 1 | 51221 | # -*- coding: utf-8 -*-
import os
import logging
from rest_framework import status as http_status
import math
from collections import defaultdict
from flask import request
from django.apps import apps
from django.utils import timezone
from django.core.exceptions import ValidationError
from django.db.models import Q, O... | apache-2.0 |
vberaudi/scipy | scipy/io/arff/tests/test_arffread.py | 27 | 7727 | #!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import datetime
import os
import sys
from os.path import join as pjoin
if sys.version_info[0] >= 3:
from io import StringIO
else:
from cStringIO import StringIO
import numpy as np
from numpy.testing import (TestCase, asse... | bsd-3-clause |
8l/beri | cheritest/trunk/tests/cp2/test_cp2_ctoptr_tag.py | 2 | 1520 | #-
# Copyright (c) 2014 Michael Roe
# All rights reserved.
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237
# ("CTSRD"), as part of the DARPA CRASH research programme.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BER... | apache-2.0 |
coolsvap/dox | dox/tests/test_images.py | 1 | 3848 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | apache-2.0 |
Microsoft/PTVS | Python/Product/Miniconda/Miniconda3-x64/Lib/idlelib/idle_test/test_run.py | 3 | 1099 | import unittest
from unittest import mock
from test.support import captured_stderr
import idlelib.run as idlerun
class RunTest(unittest.TestCase):
def test_print_exception_unhashable(self):
class UnhashableException(Exception):
def __eq__(self, other):
return True
ex1... | apache-2.0 |
FCP-INDI/nipype | nipype/interfaces/fsl/tests/test_utils.py | 10 | 10430 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
from tempfile import mkdtemp
from shutil import rmtree
import numpy as np
import nibabel as nb
from nipype.testing import (assert_equal, assert_not_equal,
assert_rai... | bsd-3-clause |
mozilla/verbatim | local_apps/pootle_project/urls.py | 6 | 1178 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 t... | gpl-2.0 |
amarouni/incubator-beam | sdks/python/apache_beam/transforms/sideinputs_test.py | 9 | 11625 | #
# 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 |
edunham/wok | wok/util.py | 11 | 1471 | import re
from unicodedata import normalize
from datetime import date, time, datetime, timedelta
def chunk(li, n):
"""Yield succesive n-size chunks from l."""
for i in xrange(0, len(li), n):
yield li[i:i+n]
def date_and_times(meta):
date_part = None
time_part = None
if 'date' in meta:
... | mit |
walterbender/portfolio | odf/draw.py | 1 | 5639 | # -*- 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... | gpl-3.0 |
laiqiqi886/kbengine | kbe/src/lib/python/Lib/concurrent/futures/thread.py | 93 | 4548 | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ThreadPoolExecutor."""
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
import atexit
from concurrent.futures import _base
import queue
import threading
import weakref
# Workers are created as daemon... | lgpl-3.0 |
TravisCG/SI_scripts | samerec.py | 1 | 1175 | #!/usr/bin/python
"""
Read a pair of fastq files and filter out reads which IDs not found in both files
"""
import sys
fq1 = open(sys.argv[1])
fq2 = open(sys.argv[2])
out1 = open(sys.argv[3], "w")
out2 = open(sys.argv[4], "w")
stack1 = dict()
stack2 = dict()
counter = 0
same = False
while True:
read1 = fq1.rea... | gpl-3.0 |
firerszd/kbengine | kbe/src/lib/python/Lib/tkinter/test/test_ttk/test_widgets.py | 59 | 56828 | import unittest
import tkinter
from tkinter import ttk
from test.support import requires
import sys
from tkinter.test.test_ttk.test_functions import MockTclObj
from tkinter.test.support import (AbstractTkTest, tcl_version, get_tk_patchlevel,
simulate_mouse_click)
from tkinter.test.wid... | lgpl-3.0 |
berendkleinhaneveld/VTK | ThirdParty/Twisted/twisted/internet/protocol.py | 31 | 26263 | # -*- test-case-name: twisted.test.test_factories,twisted.internet.test.test_protocol -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Standard implementations of Twisted protocol-related interfaces.
Start here if you are looking to write a new protocol implementation for
Twisted. The ... | bsd-3-clause |
gnowledge/ncert_nroer | gstudio/templatetags/gstudio_tags.py | 1 | 27697 |
# Copyright (c) 2011, 2012 Free Software 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 ver... | agpl-3.0 |
doormon/doormon-server | server/lib/flask/helpers.py | 776 | 33793 | # -*- coding: utf-8 -*-
"""
flask.helpers
~~~~~~~~~~~~~
Implements various helpers.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
import pkgutil
import posixpath
import mimetypes
from time import time
from zlib import adler32
from th... | gpl-2.0 |
gemfire/py-gemfire-rest | tests/PerformanceTests.py | 2 | 2432 | '''
Copyright (c) 2014 Pivotal Software, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or ... | apache-2.0 |
UdK-VPT/Open_eQuarter | mole3/stat_corr/rb_present_wall_uvalue_AVG_by_building_age_lookup.py | 2 | 2425 | # coding: utf8
# OeQ autogenerated lookup function for 'U-Values of Walls in correlation to year of construction, based on the source data of the survey for the "German Building Typology developed by the "Institut für Wohnen und Umwelt", Darmstadt/Germany, 2011-2013'
import math
import numpy as np
from . import oeqLoo... | gpl-2.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/nbformat/v4/tests/test_validate.py | 3 | 2506 | """Tests for nbformat validation"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import io
import os
import nose.tools as nt
from nbformat.validator import validate, ValidationError
from ..nbjson import reads
from ..nbbase import (
nbformat,
new_code_c... | mit |
bstadie/cgt | examples/demo_char_rnn.py | 13 | 12470 | """
A nearly direct translation of Andrej's code
https://github.com/karpathy/char-rnn
"""
from __future__ import division
import cgt
from cgt import nn, utils, profiler
import numpy as np, numpy.random as nr
import os.path as osp
import argparse
from time import time
from StringIO import StringIO
from param_collection... | mit |
jacshfr/mozilla-bedrock | vendor-local/packages/chardet/chardet/mbcsgroupprober.py | 236 | 1889 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mpl-2.0 |
ToonTownInfiniteRepo/ToontownInfinite | Panda3D-1.9.0/python/Lib/site-packages/setuptools/tests/test_upload_docs.py | 522 | 2139 | """build_ext tests
"""
import sys, os, shutil, tempfile, unittest, site, zipfile
from setuptools.command.upload_docs import upload_docs
from setuptools.dist import Distribution
SETUP_PY = """\
from setuptools import setup
setup(name='foo')
"""
class TestUploadDocsTest(unittest.TestCase):
def setUp(self):
... | mit |
mrquim/repository.mrquim | script.module.pycryptodome/lib/Crypto/SelfTest/Cipher/test_CFB.py | 5 | 16124 | # ===================================================================
#
# Copyright (c) 2014, 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. Redistributio... | gpl-2.0 |
lukleh/TwistedBot | twistedbot/plugins/base.py | 1 | 2342 |
import os
import pkgutil
import abc
from functools import wraps
class PluginMeta(abc.ABCMeta):
def __new__(meta, name, bases, dct):
cls = super(PluginMeta, meta).__new__(meta, name, bases, dct)
cls.handlers = []
for name, obj in cls.__dict__.iteritems():
if hasattr(obj, "__c... | mit |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/gunicorn/arbiter.py | 24 | 17047 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
from __future__ import with_statement
import errno
import os
import random
import select
import signal
import sys
import time
import traceback
from gunicorn.errors import HaltServer, AppImpo... | mit |
nikesh-mahalka/cinder | cinder/api/views/cgsnapshots.py | 23 | 2446 | # Copyright (C) 2012 - 2014 EMC 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.org/licenses/LICENSE-2.0
#
# Unle... | apache-2.0 |
vivianli32/TravelConnect | flask/lib/python3.4/site-packages/openid/extension.py | 13 | 1703 | import warnings
from openid import message as message_module
class Extension(object):
"""An interface for OpenID extensions.
@ivar ns_uri: The namespace to which to add the arguments for this
extension
"""
ns_uri = None
ns_alias = None
def getExtensionArgs(self):
"""Get the ... | mit |
the76thHunter/tmdbsimple | tmdbsimple/search.py | 8 | 6919 | # -*- coding: utf-8 -*-
"""
tmdbsimple.search
~~~~~~~~~~~~~~~~~
This module implements the Search functionality of tmdbsimple.
Created by Celia Oakley on 2013-10-31.
:copyright: (c) 2013-2014 by Celia Oakley
:license: GPLv3, see LICENSE for more details
"""
from .base import TMDB
class Search(TMDB):
"""
Se... | gpl-3.0 |
gripped2/xbmc | addons/service.xbmc.versioncheck/lib/common.py | 82 | 7008 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Team-XBMC
#
# 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 versio... | gpl-2.0 |
MQQiang/kbengine | kbe/res/scripts/common/Lib/site-packages/setuptools/command/easy_install.py | 206 | 72706 | #!/usr/bin/env python
"""
Easy Install
------------
A tool for doing automatic download/extract/build of distutils-based Python
packages. For detailed documentation, see the accompanying EasyInstall.txt
file, or visit the `EasyInstall home page`__.
__ https://pythonhosted.org/setuptools/easy_install.html
"""
impo... | lgpl-3.0 |
jquacinella/IS602_Project | web/gluon/rocket.py | 19 | 58903 | # -*- coding: utf-8 -*-
# This file is part of the Rocket Web Server
# Copyright (c) 2011 Timothy Farrell
# Modified by Massimo Di Pierro
# Import System Modules
import sys
import errno
import socket
import logging
import platform
# Define Constants
VERSION = '1.2.6'
SERVER_NAME = socket.gethostname()
SERVER_SOFTWAR... | gpl-2.0 |
MSylvia/pyNES | pynes/tests/adc_test.py | 27 | 4340 | # -*- coding: utf-8 -*-
'''
ADC, Add with Carry Test
This is an arithmetic instruction of the 6502.
'''
import unittest
from pynes.tests import MetaInstructionCase
class AdcImmTest(unittest.TestCase):
'''
Test the arithmetic operation ADC between decimal 16
and the content of the accumulator.
'''
... | bsd-3-clause |
awalls-cx18/gnuradio | gr-blocks/python/blocks/qa_skiphead.py | 2 | 4748 | #!/usr/bin/env python
#
# Copyright 2007,2010,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 your ... | gpl-3.0 |
materialsproject/pymatgen | pymatgen/io/xtb/inputs.py | 1 | 4045 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Classes for writing XTB input files
"""
import logging
import os
from typing import Dict, Optional, Union, List
from monty.json import MSONable
from pymatgen.core import Molecule
__author__ = "Alex Epstein... | mit |
shayneholmes/plover | plover/machine/base.py | 7 | 5860 | # Copyright (c) 2010-2011 Joshua Harlan Lifton.
# See LICENSE.txt for details.
# TODO: add tests for all machines
# TODO: add tests for new status callbacks
"""Base classes for machine types. Do not use directly."""
import serial
import threading
from plover.exception import SerialPortException
import collections
S... | gpl-2.0 |
google-code/android-scripting | python/src/Lib/test/test_curses.py | 55 | 8582 | #
# Test script for the curses module
#
# This script doesn't actually display anything very coherent. but it
# does call every method and function.
#
# Functions not tested: {def,reset}_{shell,prog}_mode, getch(), getstr(),
# init_color()
# Only called, not tested: getmouse(), ungetmouse()
#
import curses, sys, tempf... | apache-2.0 |
msarana/selenium_python | ENV/Lib/site-packages/pip/utils/ui.py | 25 | 11320 | from __future__ import absolute_import
from __future__ import division
import itertools
import sys
from signal import signal, SIGINT, default_int_handler
import time
import contextlib
import logging
from pip.compat import WINDOWS
from pip.utils import format_size
from pip.utils.logging import get_indentation
from pip... | apache-2.0 |
edgedb/edgedb | edb/pgsql/delta.py | 1 | 188387 | # mypy: ignore-errors
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2008-present MagicStack Inc. and the EdgeDB 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 ... | apache-2.0 |
wasade/qiime | qiime/remote.py | 1 | 13012 | #!/usr/bin/env python
from __future__ import division
__author__ = "Jai Ram Rideout"
__copyright__ = "Copyright 2012, The QIIME project"
__credits__ = ["Jai Ram Rideout"]
__license__ = "GPL"
__version__ = "1.8.0-dev"
__maintainer__ = "Jai Ram Rideout"
__email__ = "jai.rideout@gmail.com"
"""Contains functionality to i... | gpl-2.0 |
olafhauk/mne-python | mne/utils/numerics.py | 4 | 36095 | # -*- coding: utf-8 -*-
"""Some utility functions."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD (3-clause)
from contextlib import contextmanager
import hashlib
from io import BytesIO, StringIO
from math import sqrt
import numbers
import operator
import os
import os.path as op
from ma... | bsd-3-clause |
tiefpunkt/thingstore | thingstore/models.py | 1 | 2775 | from django.db import models
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.utils.timezone import now, utc
import calendar, datetime, string, random
# Create your models here.
class Thing(models.Model):
name = models.CharField(max_length=255)
location = models.C... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.