repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
dbohn/openlab | tools/sniffer.py | 6 | 4999 | #!/usr/bin/env python
from optparse import OptionParser
import serial
import sys
import time
import struct
import datetime
parser = OptionParser()
parser.add_option("-p", "--portnum", help="select the ttyUSB port number, default 0", type="int", default=0)
parser.add_option("-b", "--baudrate", help="select the baudrat... | gpl-3.0 |
hbldh/sudokuextract | sudokuextract/imgproc/binary.py | 1 | 1736 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`binary`
==================
Created by hbldh <henrik.blidh@nedomkull.com>
Created on 2016-01-26
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import absolute_import
import numpy... | mit |
GerbenJavado/LinkFinder | linkfinder.py | 1 | 13951 | #!/usr/bin/env python
# Python 3
# LinkFinder
# By Gerben_Javado
# Fix webbrowser bug for MacOS
import os
os.environ["BROWSER"] = "open"
# Import libraries
import re, sys, glob, html, argparse, jsbeautifier, webbrowser, subprocess, base64, ssl, xml.etree.ElementTree
from gzip import GzipFile
from string import Templ... | mit |
ownport/ansiblite | src/ansiblite/utils/path.py | 1 | 2926 | # (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 |
varunarya10/nova_test_latest | nova/tests/unit/compute/monitors/test_monitors.py | 18 | 1453 | # Copyright 2013 Intel 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
#
# Unless require... | apache-2.0 |
mogui/pyorient | pyorient/ogm/vertex.py | 3 | 2195 | from .element import GraphElement
from .broker import VertexBroker
class Vertex(GraphElement):
Broker = VertexBroker
# TODO
# Edge information is carried in vertexes retrieved from database,
# as OrientBinaryObject. Can likely optimise these traversals
# when we know how to parse these.
def ou... | apache-2.0 |
rigdenlab/SIMBAD | simbad/command_line/simbad_full.py | 1 | 6513 | #!/usr/bin/env python
__author__ = "Adam Simpkin, and Felix Simkovic"
__contributing_authors__ = "Jens Thomas, and Ronan Keegan"
__credits__ = "Daniel Rigden, William Shepard, Charles Ballard, Villi Uski, and Andrey Lebedev"
__date__ = "05 May 2017"
__email__ = "hlasimpk@liv.ac.uk"
__version__ = "0.1"
import argparse... | bsd-3-clause |
spirrello/spirrello-pynet-work | applied_python/lib/python2.7/site-packages/pylint/pyreverse/main.py | 3 | 6220 | # # Copyright (c) 2000-2013 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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,... | gpl-3.0 |
tvoli/shaka-player | third_party/gjslint/closure_linter-2.3.13/closure_linter/common/htmlutil.py | 286 | 4732 | #!/usr/bin/env python
#
# Copyright 2007 The Closure Linter 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
#... | apache-2.0 |
ric2b/Vivaldi-browser | chromium/third_party/tlslite/scripts/tlsdb.py | 110 | 3763 | #!/usr/bin/env python
# Authors:
# Trevor Perrin
# Martin von Loewis - python 3 port
#
# See the LICENSE file for legal information regarding use of this file.
from __future__ import print_function
import sys
import os
import socket
import math
if __name__ != "__main__":
raise "This must be run as a command... | bsd-3-clause |
kawamon/hue | desktop/core/ext-py/pysaml2-4.9.0/src/saml2/server.py | 2 | 37965 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
"""Contains classes and functions that a SAML2.0 Identity provider (IdP)
or attribute authority (AA) may use to conclude its tasks.
"""
import logging
import os
import importlib
import dbm
import shelve
import six
import threading
import saml2.cryptography.symmetric
fr... | apache-2.0 |
mdavidsaver/spicetools | spicetools/bench/fileframe.py | 1 | 2613 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2014 Michael Davidsaver
License is GPL3+, see file LICENSE for details
"""
import logging
_log=logging.getLogger(__name__)
import os, os.path
from PyQt4 import QtCore, QtGui
from PyQt4.QtCore import Qt
from .fileframe_ui import Ui_FileFrame
class FileFrame(QtGui.QFrame):
... | gpl-3.0 |
tcdog001/ap_project | target/linux/x86/image/mkimg_bifferboard.py | 561 | 1265 | #!/usr/bin/env python
"""
Create firmware for 4/8MB Bifferboards, suitable for uploading using
either bb_upload8.py or bb_eth_upload8.py
"""
import struct, sys
# Increase the kmax value if the script gives errors about the kernel being
# too large. You need to set the Biffboot kmax value to the same value yo... | gpl-2.0 |
timhuanggithub/pox_load_balancing | pox/messenger/tcp_transport.py | 26 | 3464 | # Copyright 2011,2012 James McCauley
#
# This file is part of POX.
#
# POX 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.
#
# POX is d... | gpl-3.0 |
Gagaro/django | tests/model_regress/tests.py | 326 | 8962 | from __future__ import unicode_literals
import datetime
from operator import attrgetter
from django.core.exceptions import ValidationError
from django.db import router
from django.db.models.sql import InsertQuery
from django.test import TestCase, skipUnlessDBFeature
from django.utils import six
from django.utils.time... | bsd-3-clause |
Foxfanmedium/python_training | OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/IPython/utils/tests/test_tempdir.py | 35 | 1039 | #-----------------------------------------------------------------------------
# Copyright (C) 2012- The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this software.
#---------------------------------------------------... | apache-2.0 |
d0ugal/readthedocs.org | readthedocs/urls.py | 7 | 5788 | from django.conf.urls import url, patterns, include
from django.contrib import admin
from django.conf import settings
from django.views.generic.base import TemplateView
from tastypie.api import Api
from api.base import (ProjectResource, UserResource, BuildResource,
VersionResource, FileResource)... | mit |
zathras777/pywind | pywind/ofgem/objects.py | 1 | 8218 | # coding=utf-8
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdi... | unlicense |
ftomassetti/intellij-community | python/lib/Lib/site-packages/django/db/backends/sqlite3/introspection.py | 88 | 5864 | import re
from django.db.backends import BaseDatabaseIntrospection
# This light wrapper "fakes" a dictionary interface, because some SQLite data
# types include variables in them -- e.g. "varchar(30)" -- and can't be matched
# as a simple dictionary lookup.
class FlexibleFieldLookupDict(object):
# Maps SQL types t... | apache-2.0 |
cbrentharris/swift | validation-test/stdlib/Slice/Inputs/GenerateSliceTests.py | 9 | 2335 | #!/usr/bin/env python
import itertools
traversal_options = [ 'Forward', 'Bidirectional', 'RandomAccess' ]
base_kind_options = [ 'Defaulted', 'Minimal' ]
mutable_options = [ False, True ]
for traversal, base_kind, mutable in itertools.product(
traversal_options, base_kind_options, mutable_options):
# Test Slic... | apache-2.0 |
Alphadelta14/ansible | v1/ansible/constants.py | 90 | 14499 | # (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 |
lancezlin/pylearn2 | pylearn2/sandbox/cuda_convnet/tests/test_stochastic_pool.py | 42 | 2837 | import copy
import numpy
from theano.compat.six.moves import xrange
import theano
from theano.compat.python2x import Counter
from pylearn2.sandbox.cuda_convnet.stochastic_pool import (stochastic_max_pool_c01b,
weighted_max_pool_c01b)
from pylearn2.testing.ski... | bsd-3-clause |
robertnishihara/ray | python/ray/autoscaler/_private/aws/utils.py | 1 | 4590 | from collections import defaultdict
from ray.autoscaler._private.cli_logger import cli_logger
import colorful as cf
class LazyDefaultDict(defaultdict):
"""
LazyDefaultDict(default_factory[, ...]) --> dict with default factory
The default factory is call with the key argument to produce
a new value w... | apache-2.0 |
zaneveld/picrust | picrust/util.py | 1 | 16630 | #!/usr/bin/env python
# File created on 23 Nov 2011
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2015, The PICRUSt Project"
__credits__ = ["Greg Caporaso", "Morgan Langille", "Daniel McDonald"]
__license__ = "GPL"
__version__ = "1.1.0"
__maintainer__ = "Greg Caporaso"
__email... | gpl-3.0 |
prodromou87/gem5 | src/cpu/o3/O3Checker.py | 69 | 1724 | # Copyright (c) 2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
certik/chess | common/appenginepatch/appenginepatcher/patch.py | 1 | 9983 | # -*- coding: utf-8 -*-
from google.appengine.ext import db
import logging, os, sys
def patch_all():
patch_python()
patch_app_engine()
patch_django()
setup_logging()
def patch_python():
# Remove modules that we want to override
for module in ('httplib', 'urllib', 'urllib2', 'memcache',):
... | mit |
tinkerthaler/odoo | addons/purchase_analytic_plans/__openerp__.py | 260 | 1725 | # -*- 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 |
masamichi/bite-project | deps/gdata-python-client/tests/all_tests_clear_cache.py | 128 | 1057 | #!/usr/bin/env python
#
# Copyright (C) 2009 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... | apache-2.0 |
charbeljc/OCB | addons/project_issue/__init__.py | 433 | 1131 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
dan1/horizon-proto | openstack_dashboard/test/api_tests/cinder_rest_tests.py | 47 | 3408 | # Copyright 2015 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 agreed to in writing, sof... | apache-2.0 |
veger/ansible | lib/ansible/plugins/action/script.py | 7 | 7442 | # (c) 2012, 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) any lat... | gpl-3.0 |
astynax/ranger | examples/plugin_pmount_dynamic.py | 3 | 2674 | # Tested with ranger 1.7.2
#
# This plugin creates a bunch of keybindings used to mount and unmount
# the devices using pmount(1).
#
# (multiple partitions): alt+m <letter> <digit> : mount /dev/sd<letter><digit>
# (one partition): alt+m <letter> : mount /dev/sd<letter>1
# (no partitions): alt+m <l... | gpl-3.0 |
ronin13/pyvolume | pyvolume/sshfs.py | 1 | 4118 | # -*- coding: utf-8 -*-
""" Module providing SSHFileSystem implementation."""
from __future__ import unicode_literals
from __future__ import absolute_import
import logging
import os
import os.path
from plumbum import ProcessExecutionError
from plumbum.cmd import sshfs
from plumbum.cmd import sudo
from plumbum.cmd imp... | mit |
PhilLidar-DAD/geonode | geonode/eula/models.py | 1 | 2090 | from django.db import models
from geonode.layers.models import Layer
from geonode.documents.models import Document
from datetime import datetime
from django.utils.translation import ugettext_lazy as _
from geonode.base.models import ResourceBase
from geonode.people.models import OrganizationType
from django_enumfield i... | gpl-3.0 |
timpalpant/calibre | src/calibre/gui2/viewer/keys.py | 14 | 2684 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from calibre.constants import isosx
SHORTCUTS = {
'Next Page' : (['PgDown',... | gpl-3.0 |
wikimedia/pywikibot-core | tests/textlib_tests.py | 1 | 76796 | # -*- coding: utf-8 -*-
"""Test textlib module."""
#
# (C) Pywikibot team, 2011-2019
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, division, unicode_literals
import codecs
from collections import OrderedDict
import functools
import os
import re
import pywikibot
import p... | mit |
marcelovilaca/DIRAC | DataManagementSystem/Client/MetaQuery.py | 11 | 8882 | ########################################################################
# File: MetaQuery.py
# Author: A.T.
# Date: 24.02.2015
# $HeadID$
########################################################################
""" Utilities for managing metadata based queries
"""
__RCSID__ = "$Id$"
from DIRAC import S_OK, S_ERROR
... | gpl-3.0 |
liqd/adhocracy | src/adhocracy/lib/cache/invalidate.py | 4 | 2235 | import logging
from adhocracy import model
from adhocracy.lib.cache.util import clear_tag
log = logging.getLogger(__name__)
def invalidate_badge(badge):
log.debug('invalidate_badge %s' % badge)
clear_tag(badge)
def invalidate_userbadges(userbadges):
clear_tag(userbadges)
invalidate_user(userbadges.... | agpl-3.0 |
ZhangXinNan/tensorflow | tensorflow/contrib/autograph/utils/tensor_list.py | 64 | 2440 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
tstieven/amiunique | website/venv/lib/python2.7/site-packages/setuptools/command/build_clib.py | 314 | 4484 | import distutils.command.build_clib as orig
from distutils.errors import DistutilsSetupError
from distutils import log
from setuptools.dep_util import newer_pairwise_group
class build_clib(orig.build_clib):
"""
Override the default build_clib behaviour to do the following:
1. Implement a rudimentary time... | mit |
JazzeYoung/VeryDeepAutoEncoder | pylearn2/optimization/feature_sign.py | 44 | 13515 | """
L1-penalized minimization using the feature sign search algorithm.
"""
__authors__ = "David Warde-Farley"
__copyright__ = "Copyright 2010-2011, Universite de Montreal"
__credits__ = ["David Warde-Farley"]
__license__ = "3-clause BSD"
__maintainer__ = "David Warde-Farley"
__email__ = "wardefar@iro"
__all__ = ["fea... | bsd-3-clause |
FlintHill/SUAS-Competition | env/lib/python2.7/site-packages/pip/_internal/vcs/subversion.py | 7 | 7676 | from __future__ import absolute_import
import logging
import os
import re
from pip._internal.models.link import Link
from pip._internal.utils.logging import indent_log
from pip._internal.utils.misc import (
display_path, make_vcs_requirement_url, rmtree, split_auth_from_netloc,
)
from pip._internal.vcs import Ver... | mit |
ganeshgore/myremolab | server/src/build/lib.linux-i686-2.7/weblab/core/comm/web/labview.py | 2 | 2151 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individual... | bsd-2-clause |
farhaanbukhsh/sympy | examples/galgebra/simple_check_latex.py | 66 | 1160 | #!/usr/bin/env python
from __future__ import print_function
from sympy.galgebra import xdvi, Get_Program, Print_Function
from sympy.galgebra import MV, Format
def basic_multivector_operations_3D():
Print_Function()
(ex, ey, ez) = MV.setup('e*x|y|z')
print('g_{ij} =', MV.metric)
A = MV('A', 'mv')
... | bsd-3-clause |
2015fallhw/cdw11 | static/plugin/summary/summary.py | 30 | 2942 | """
Summary
-------
This plugin allows easy, variable length summaries directly embedded into the
body of your articles.
"""
from __future__ import unicode_literals
from pelican import signals
from pelican.generators import ArticlesGenerator, StaticGenerator, PagesGenerator
def initialized(pelican):
... | agpl-3.0 |
Griger/Intel-CervicalCancer-KaggleCompetition | featureHOG.py | 1 | 1456 | from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img
import numpy as np
from math import pi
from keras.preprocessing.image import ImageDataGenerator
import cv2
from sklearn.cluster import KMeans
import sklearn.preprocessing as prepro
# Generamos nuevos ejemplos
'''
... | gpl-3.0 |
yawnosnorous/python-for-android | python3-alpha/python3-src/Lib/mailbox.py | 45 | 75952 | #! /usr/bin/env python3
"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""
# Notes for authors of new mailbox subclasses:
#
# Remember to fsync() changes to disk before closing a modified file
# or returning from a flush() method. See functions _sync_flush() and
# _sync_close().
import sys
i... | apache-2.0 |
m3z/HT | openstack_dashboard/api/swift.py | 1 | 9568 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | apache-2.0 |
chrisseto/osf.io | api_tests/reviews/mixins/comment_settings.py | 1 | 3030 | from datetime import timedelta
import pytest
from furl import furl
from osf_tests.factories import (
AuthUserFactory,
PreprintFactory,
PreprintProviderFactory,
)
from reviews.permissions import GroupHelper
from reviews_tests.factories import ReviewLogFactory
from website.util import permissions as osf_per... | apache-2.0 |
alvin319/CarnotKE | jyhton/lib-python/2.7/hotshot/__init__.py | 215 | 2670 | """High-perfomance logging profiler, mostly written in C."""
import _hotshot
from _hotshot import ProfilerError
from warnings import warnpy3k as _warnpy3k
_warnpy3k("The 'hotshot' module is not supported in 3.x, "
"use the 'profile' module instead.", stacklevel=2)
class Profile:
def __init__(self, logf... | apache-2.0 |
rimbalinux/MSISDNArea | django/utils/unittest/main.py | 12 | 9629 | """Unittest main program"""
import sys
import os
import types
from django.utils.unittest import loader, runner
try:
from django.utils.unittest.signals import installHandler
except ImportError:
installHandler = None
__unittest = True
FAILFAST = " -f, --failfast Stop on first failure\n"
... | bsd-3-clause |
jfdsmabalot/kernel_lge_g2 | 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 |
350dotorg/Django | django/core/mail/message.py | 1 | 10976 | import mimetypes
import os
import random
import time
from email import Charset, Encoders
from email.MIMEText import MIMEText
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.Header import Header
from email.Utils import formatdate, getaddresses, formataddr
from django.conf im... | bsd-3-clause |
zstackio/zstack-woodpecker | integrationtest/vm/virt_plus/capacity/test_delete_image_bs_capacity.py | 3 | 3563 | '''
New Integration Test for bs capacity when delete added image.
The file should be placed in MN.
@author: Youyk
'''
import os
import time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpeck... | apache-2.0 |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/InputDialog.py | 1 | 10376 | # encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
from Dialog import Dialog
class InputDialog(Dialog):
"""
O... | gpl-2.0 |
omnirom/android_kernel_htc_msm8960 | 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 |
xuerenlv/scrapy | scrapy/commands/__init__.py | 129 | 3656 | """
Base class for Scrapy commands
"""
import os
from optparse import OptionGroup
from twisted.python import failure
from scrapy.utils.conf import arglist_to_dict
from scrapy.exceptions import UsageError
class ScrapyCommand(object):
requires_project = False
crawler_process = None
# default settings to ... | bsd-3-clause |
erichaase/topcoder-python | topcoder/knights_tour.py | 1 | 2012 | """
`KnightsTour <http://community.topcoder.com/stat?c=problem_statement&pm=10577>`__
"""
def solution (board):
b, n = Board(board), 1
while b.update(): n += 1
return n
class Board:
def __init__ (self, board):
self.board = [list(row) for row in board]
def update (self):
k, t = sel... | mit |
alex/readthedocs.org | readthedocs/projects/migrations/0013_remove_extensions_and_docpath.py | 16 | 9513 | # 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):
# Deleting field 'Project.docs_directory'
db.delete_column('projects_project', 'docs_directory')
... | mit |
openmb/openblackhole-enigma2 | tools/host_tools/FormatConverter/satxml.py | 22 | 2756 | import os
from datasource import datasource
from xml.dom import minidom
from xml.dom.minidom import Document
from input import inputText
class satxml(datasource):
def __init__(self, filename = "satellites.xml"):
self.filename = filename
datasource.__init__(self)
if not os.path.isfile(filename):
print "File ... | gpl-2.0 |
mach0/QGIS | python/plugins/db_manager/db_plugins/vlayers/info_model.py | 77 | 1563 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : Virtual layers plugin for DB Manager
Date : December 2015
copyright : (C) 2015 by Hugo Mercier
email : hugo dot mercier at oslandia dot com
*******... | gpl-2.0 |
sridevikoushik31/nova | nova/tests/integrated/test_login.py | 13 | 1096 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
# 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.apach... | apache-2.0 |
WladimirSidorenko/SentiLex | scripts/vo.py | 1 | 10974 | #!/usr/bin/env python2.7
# -*- mode: python; coding: utf-8; -*-
"""Module for generating lexicon using Velikovich's method (2010).
"""
##################################################################
# Imports
from __future__ import unicode_literals, print_function
from collections import Counter
from copy import... | mit |
NiclasEriksen/py-towerwars | src/numpy/fft/tests/test_fftpack.py | 45 | 2003 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_array_almost_equal
from numpy.testing import assert_array_equal
import threading
import sys
if sys.version_info[0] >= 3:
import queue
else:
import Queue as queue
de... | cc0-1.0 |
fupadev/FuME | fume/threads/DownloadProcessor.py | 1 | 5680 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# --------------------------------------------------------------------------
# FuME FuPa Match Explorer Copyright (c) 2017 Andreas Feldl <fume@afeldl.de>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Publi... | gpl-3.0 |
stonegithubs/odoo | addons/event/res_partner.py | 329 | 1228 | # -*- 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 |
ibc/MediaSoup | worker/deps/catch/projects/TestScripts/testRandomOrder.py | 1 | 2135 | #!/usr/bin/env python3
"""
This test script verifies that the random ordering of tests inside
Catch2 is invariant in regards to subsetting. This is done by running
the binary 3 times, once with all tests selected, and twice with smaller
subsets of tests selected, and verifying that the selected tests are in
the same r... | isc |
h2oai/h2o-3 | h2o-py/h2o/estimators/random_forest.py | 2 | 83030 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
#
# This file is auto-generated by h2o-3/h2o-bindings/bin/gen_python.py
# Copyright 2016 H2O.ai; Apache License Version 2.0 (see LICENSE for details)
#
from __future__ import absolute_import, division, print_function, unicode_literals
from h2o.utils.metaclass import dep... | apache-2.0 |
arpitprogressive/arpittest | intergration_test/banner.py | 1 | 18254 | # -*- coding: utf-8 -*-
"""
banner
Description goes here...
:copyright: (c) 2014 by Openlabs Technologies & Consulting (P) Limited
:license: BSD, see LICENSE for more details.
"""
import unittest
from selenium.webdriver.common.by import By
from selenium.common.exceptions import NoSuchElementException... | bsd-3-clause |
aarongilmore/realfoodni.github.io | node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_sln.py | 1831 | 5099 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prints the information in a sln file in a diffable way.
It first outputs each projects in alphabetical order with their
dependenci... | mit |
hfegetude/PresentacionEquiposElectronicos | node_modules/node-gyp/gyp/gyptest.py | 1752 | 8019 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... | mit |
lixiangning888/whole_project | modules/signatures/antiav_detectreg.py | 3 | 5595 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Accuvant, Inc. (bspengler@accuvant.com)
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
from lib.cuckoo.common.abstracts import Signature
class AntiAVDetectReg(Signature):
name = "antiav_detectr... | lgpl-3.0 |
wrwrwr/mezzanine | mezzanine/bin/mezzanine_project.py | 4 | 2790 | #!/usr/bin/env python
from distutils.dir_util import copy_tree
from optparse import OptionParser
import os
from shutil import move
from uuid import uuid4
from mezzanine.utils.importing import path_for_import
def create_project():
"""
Copies the contents of the project_template directory to a new
directo... | bsd-2-clause |
ajjohnso/ajjohnso-byte1-attempt56 | lib/werkzeug/debug/repr.py | 313 | 9350 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | apache-2.0 |
jhawkesworth/ansible | test/units/modules/network/nxos/test_nxos_banner.py | 68 | 3645 | # 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 distributed in the hope that ... | gpl-3.0 |
sunny-wyb/xen-4.1.2 | tools/python/xen/xend/server/vusbif.py | 43 | 5097 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
rfdougherty/dipy | dipy/core/sphere_stats.py | 11 | 8218 | """ Statistics on spheres
"""
from __future__ import division, print_function, absolute_import
import numpy as np
import dipy.core.geometry as geometry
from itertools import permutations
def random_uniform_on_sphere(n=1, coords='xyz'):
r'''Random unit vectors from a uniform distribution on the sphere.
Param... | bsd-3-clause |
mfazekas/safaridriver | selenium/src/py/lib/docutils/io.py | 5 | 13686 | # Author: David Goodger
# Contact: goodger@users.sourceforge.net
# Revision: $Revision: 4506 $
# Date: $Date: 2006-04-12 03:12:31 +0200 (Wed, 12 Apr 2006) $
# Copyright: This module has been placed in the public domain.
"""
I/O classes provide a uniform API for low-level input and output. Subclasses
will exis... | apache-2.0 |
YannChemin/wxGIPE | pyplottest.py | 1 | 3074 | # -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: wxGIPE
# Purpose: Satellite image [multi/hyper][spectral/temporal] pixel plotting
# Author: Yann Chemin, <yann.chemin@gmail.com>
#
#####################################################... | unlicense |
davidzchen/tensorflow | tensorflow/python/data/benchmarks/batch_benchmark.py | 16 | 2887 | # 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 |
highweb-project/highweb-webcl-html5spec | tools/perf/profile_creators/cookie_profile_extender.py | 14 | 3339 | # 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.
import multiprocessing
import os
try:
import sqlite3 # Not present on ChromeOS DUT.
except ImportError:
pass
import page_sets
from profile_creators im... | bsd-3-clause |
belkinsky/SFXbot | src/pyAudioAnalysis/audioTrainTest.py | 1 | 46228 | import sys
import numpy
import time
import os
import glob
import pickle
import shutil
import audioop
import signal
import csv
import ntpath
from . import audioFeatureExtraction as aF
from . import audioBasicIO
from matplotlib.mlab import find
import matplotlib.pyplot as plt
import scipy.io as sIO
from scipy import lina... | mit |
RebeccaWPerry/vispy | vispy/app/backends/_ipynb_vnc.py | 21 | 13720 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
vispy backend for the IPython notebook (vnc approach).
We aim to have:
* ipynb_static - export visualization to a static notebook
* ipynb_vnc - vnc-approach: render in Py... | bsd-3-clause |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/PyQt4/examples/designer/plugins/python/helloglwidgetplugin.py | 20 | 3589 | #!/usr/bin/env python
"""
helloglwidgetplugin.py
A simple OpenGL custom widget plugin for Qt Designer.
Copyright (C) 2006 David Boddie <david@boddie.org.uk>
Copyright (C) 2005-2006 Trolltech ASA. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU ... | gpl-3.0 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/tests/gis_tests/gis_migrations/test_operations.py | 5 | 9227 | from __future__ import unicode_literals
from unittest import skipIf
from django.contrib.gis.db.models import fields
from django.contrib.gis.geos import MultiPolygon, Polygon
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, migrations, models
from django.db.migrations.migration... | apache-2.0 |
therealjumbo/python_summer | pipeg/TkUtil/TextEdit.py | 2 | 3482 | #!/usr/bin/env python3
# Copyright © 2012-13 Qtrac Ltd. All rights reserved.
# This program or 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)... | gpl-3.0 |
alfa-addon/addon | plugin.video.alfa/channels/bloghorror.py | 1 | 5917 | # -*- coding: utf-8 -*-
# -*- Channel BlogHorror -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
import os
import re
from bs4 import BeautifulSoup
from core import httptools
from core impor... | gpl-3.0 |
FluidityStokes/fluidity | tests/viscous_fs_zhong_spatial/solution.py | 24 | 28499 |
from fluidity_tools import stat_parser as stat
from math import log, pi, cos, sin, cosh, sinh, exp
from numpy import sqrt, interp
from scipy.integrate import quad
wavelengthfactor = 1.0
eta0 = 0. # m
xi0 = 0. # m
#eta0 = 1.e3 # m
#xi0 = 1.e3 # m
depth=1.5e6 # m
rho0 = 4500. # kg/m**3
rhou = 2*rho0 # kg/m**3
mu0 = 1.... | lgpl-2.1 |
janez87/social-knowledge-extractor | orchestrator.py | 2 | 1401 | from utils import mongo_manager
from datetime import datetime
class Orchestrator(object):
def run(self):
print("Orchestrator: starting crawling pipeline")
experiment = list(self.db_manager.find("experiment",{"_id":self.id_experiment}))[0]
experiment["status"] = "CRAWLING"
exper... | apache-2.0 |
persiaAziz/trafficserver | tests/gold_tests/headers/via-observer.py | 10 | 1352 | '''
Extract the protocol information from the VIA headers and store it in a log file for later verification.
'''
# 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 o... | apache-2.0 |
kinooo/Sick-Beard | sickbeard/clients/requests/packages/charade/gb2312prober.py | 231 | 1722 | ######################## 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.
... | gpl-3.0 |
naucoin/VTKSlicerWidgets | Examples/Modelling/Python/expCos.py | 8 | 2383 | #!/usr/bin/env python
# This example demonstrates how to use a programmable filter and how
# to use the special vtkDataSetToDataSet::GetOutputPort() methods
import vtk
from math import *
# We create a 100 by 100 point plane to sample
plane = vtk.vtkPlaneSource()
plane.SetXResolution(100)
plane.SetYResolution(100)
#... | bsd-3-clause |
kouaw/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/fc2.py | 12 | 2006 | #! -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import hashlib
from .common import InfoExtractor
from ..utils import (
ExtractorError,
compat_urllib_request,
compat_urlparse,
)
class FC2IE(InfoExtractor):
_VALID_URL = r'^http://video\.fc2\.com/((?P<lang>[^/]+)/)?content/(?... | gpl-3.0 |
CMLL/taiga-back | tests/integration/resources_permissions/test_wiki_resources.py | 9 | 21856 | from django.core.urlresolvers import reverse
from taiga.base.utils import json
from taiga.permissions.permissions import MEMBERS_PERMISSIONS, ANON_PERMISSIONS, USER_PERMISSIONS
from taiga.projects.notifications.services import add_watcher
from taiga.projects.occ import OCCResourceMixin
from taiga.projects.wiki.seriali... | agpl-3.0 |
NicholasHoCode/Galaxy | assets/code/GF.py | 1 | 2040 | from PIL import Image
import numpy as np
import math
from scipy import signal
def boxfilter(n):
assert (n%2 != 0),"Dimension must be odd"
a = np.empty((n, n))
a.fill(1/(n*n))
return a
def gauss1d(sigma):
arr_length = 6*sigma
if arr_length % 2 == 0:
val = ((arr_length)/2)+1
elif arr... | mit |
dezynetechnologies/odoo | addons/hr_payroll/__init__.py | 433 | 1137 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it ... | agpl-3.0 |
DJArmstrong/autovet | Features/old/Centroiding/scripts/index_transits.py | 2 | 5857 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 27 12:55:39 2016
@author:
Maximilian N. Guenther
Battcock Centre for Experimental Astrophysics,
Cavendish Laboratory,
JJ Thomson Avenue
Cambridge CB3 0HE
Email: mg719@cam.ac.uk
"""
# REFACTORED: CHECK
import numpy as np
"""
DUPLICATE FROM MY_TOOLS - My_Utils
"""
d... | gpl-3.0 |
nekulin/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/sunau.py | 82 | 16515 | """Stuff to parse Sun and NeXT audio files.
An audio file consists of a header followed by the data. The structure
of the header is as follows.
+---------------+
| magic word |
+---------------+
| header size |
+---------------+
| data size |
+--------... | apache-2.0 |
jobsafran/mediadrop | mediadrop/plugin/events.py | 9 | 14024 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
Azure/azure-sdk-for-python | common/smoketest/key_vault_keys_async.py | 1 | 1475 | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import uuid
from azure.keyvault.keys.aio import KeyClient
from key_vault_base_async import KeyVaultBaseAsync
class KeyVaultKeys(KeyVaultBaseAsync):
def __init__(se... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.