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 |
|---|---|---|---|---|---|
jmoh/WADRC_DWI_Processing | archive/determineIncludedVolumes.py | 1 | 2771 | import string, os, sys, subprocess
#Use MRIConvert to convert images to nifti format. Images will be saved as a 4D file and then split into separate flip angles
if len(sys.argv[1:]) < 1:
print 'Correct Usage: python determineIncludedVolumes.py <Path to DTIPrep QC Report (.txt) > <output root directory> <dwi file> ... | gpl-3.0 |
bikalabs/bika.wine | bika/wine/controlpanel/bika_storageconditions.py | 1 | 3289 | from AccessControl.SecurityInfo import ClassSecurityInfo
from bika.wine import bikaMessageFactory as _
from bika.wine.config import PROJECTNAME
from bika.wine.interfaces import IStorageConditions
from bika.lims import bikaMessageFactory as _b
from bika.lims.browser.bika_listing import BikaListingView
from plone.app.con... | agpl-3.0 |
valtandor/easybuild-easyblocks | easybuild/easyblocks/m/mrbayes.py | 12 | 4157 | ##
# Copyright 2009-2015 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://vscentrum.be/nl/en),
# the Hercules foundation (htt... | gpl-2.0 |
waterblue13/tensor2tensor | tensor2tensor/layers/modalities_test.py | 1 | 4931 | # coding=utf-8
# Copyright 2017 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | apache-2.0 |
osrg/ryu | ryu/cmd/ryu_base.py | 7 | 2456 | # Copyright (C) 2014 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2014 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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 |
ncliam/serverpos | openerp/addons/website_hr_recruitment/controllers/main.py | 53 | 6494 | # -*- coding: utf-8 -*-
import base64
from openerp import SUPERUSER_ID
from openerp import http
from openerp.tools.translate import _
from openerp.http import request
from openerp.addons.website.models.website import slug
class website_hr_recruitment(http.Controller):
@http.route([
'/jobs',
'/job... | agpl-3.0 |
alihalabyah/ansible | lib/ansible/plugins/lookup/inventory_hostnames.py | 69 | 1496 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Steven Dossett <sdossett@panath.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 versio... | gpl-3.0 |
Big-B702/python-for-android | python-build/python-libs/gdata/build/lib/gdata/tlslite/utils/Cryptlib_AES.py | 359 | 1364 | """Cryptlib AES implementation."""
from cryptomath import *
from AES import *
if cryptlibpyLoaded:
def new(key, mode, IV):
return Cryptlib_AES(key, mode, IV)
class Cryptlib_AES(AES):
def __init__(self, key, mode, IV):
AES.__init__(self, key, mode, IV, "cryptlib")
sel... | apache-2.0 |
mdrumond/tensorflow | tensorflow/contrib/learn/python/learn/datasets/__init__.py | 121 | 3534 | # 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 |
Nevtep/omniwallet | api/properties_service.py | 1 | 8154 | import urlparse
import os, sys, re
import time
from flask import Flask, request, jsonify, abort, json, make_response
from msc_apps import *
#tools_dir = os.environ.get('TOOLSDIR')
#lib_path = os.path.abspath(tools_dir)
#sys.path.append(lib_path)
data_dir_root = os.environ.get('DATADIR')
app = Flask(__name__)
app.debu... | agpl-3.0 |
lewislone/mStocks | packets-analysis/lib/XlsxWriter-0.7.3/xlsxwriter/compat_collections.py | 15 | 7974 | """
From the GC3Pie project: https://code.google.com/p/gc3pie/
A backport of the Python standard `collections` package, providing
`namedtuple` and `defaultdict` also on Python 2.4 and 2.5.
This package actually imports your Python `collections`, and adds
its own versions of `namedtuple` and `defaultdict` only if they... | mit |
stuart-knock/tvb-framework | tvb/core/adapters/abcadapter.py | 1 | 57742 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | gpl-2.0 |
girving/tensorflow | tensorflow/contrib/session_bundle/exporter_test.py | 20 | 10272 | # 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 |
PaulAYoung/f2014_iolab | pymongoProject/venv/lib/python2.7/site-packages/bson/code.py | 18 | 2618 | # Copyright 2009-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | unlicense |
paulcwatts/drf-json-schema | tests/dummy/settings.py | 1 | 2773 | """Django settings for drf_json_schema project."""
import os
from typing import List
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.django... | mit |
vipul-sharma20/oh-mainline | vendor/packages/Django/tests/modeltests/aggregation/tests.py | 53 | 21335 | from __future__ import absolute_import
import datetime
from decimal import Decimal
from django.db.models import Avg, Sum, Count, Max, Min
from django.test import TestCase, Approximate
from .models import Author, Publisher, Book, Store
class BaseAggregateTestCase(TestCase):
fixtures = ["aggregation.json"]
... | agpl-3.0 |
cgstudiomap/cgstudiomap | main/eggs/Babel-2.1.1-py2.7.egg/babel/messages/checkers.py | 189 | 6094 | # -*- coding: utf-8 -*-
"""
babel.messages.checkers
~~~~~~~~~~~~~~~~~~~~~~~
Various routines that help with validation of translations.
:since: version 0.9
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from babel.messages.catalog import TranslationE... | agpl-3.0 |
cloudbase/nova | nova/virt/xenapi/vmops.py | 2 | 112152 | # Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010 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... | apache-2.0 |
cwurld/django_tracker | django_tracker/utils.py | 1 | 1774 | import os
import codecs
import csv
from collections import namedtuple
import dateutil.parser
Record = namedtuple('Record', 'datetime url email ip')
def read_tracker_file(tracker_dir: str, the_date: str, target: str, exclude_anonymous: bool = False):
"""
:param tracker_dir:
:param the_date:
:p... | mit |
eeijcea/Arduino-1 | arduino-core/src/processing/app/i18n/python/requests/packages/charade/jisfreq.py | 3131 | 47315 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | lgpl-2.1 |
neoascetic/cmsplugin-filer | cmsplugin_filer_teaser/migrations/0004_add_optional_external_image_url.py | 31 | 15233 | # 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 field 'FilerTeaser.image_url'
db.add_column('cmsplugin_filerteaser', 'image_url', self.gf('dj... | mit |
vallsv/pyqtgraph | pyqtgraph/graphicsItems/AxisItem.py | 3 | 41244 | from ..Qt import QtGui, QtCore
from ..python2_3 import asUnicode
import numpy as np
from ..Point import Point
from .. import debug as debug
import weakref
from .. import functions as fn
from .. import getConfigOption
from .GraphicsWidget import GraphicsWidget
__all__ = ['AxisItem']
class AxisItem(GraphicsWidget):
... | mit |
xuru/pyvisdk | pyvisdk/do/customization_ip_settings.py | 1 | 1113 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def CustomizationIPSettings(vim, *args, **kwargs):
'''IP settings for a virtual network a... | mit |
40223136/cadp_w11 | wsgi/gear.py | 48 | 16142 | #@+leo-ver=5-thin
#@+node:2015.20140907143819.2142: * @file gear.py
#@@language python
#@@tabwidth -4
#@+<<declarations>>
#@+node:2015.20140907143819.2143: ** <<declarations>> (application)
#@@language python
import cherrypy
import os
import sys
# 這個程式要計算正齒輪的齒面寬, 資料庫連結希望使用 pybean 與 SQLite
# 導入 pybean 模組與所要使用的 Store 及... | gpl-3.0 |
christianurich/VIBe2UrbanSim | 3rdparty/opus/src/psrc/faz/population_per_acre.py | 2 | 3583 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.logger import logger
from opus_core.variables.variable import Variable
from urbansim.functions import attribute_label
class population_per_acre(Variable):
"""The population... | gpl-2.0 |
Si-elegans/Web-based_GUI_Tools | wiki/core/plugins/registry.py | 3 | 1679 | # -*- coding: utf-8 -*-
from django.utils.importlib import import_module
from six import string_types
_cache = {}
_settings_forms = []
_markdown_extensions = []
_article_tabs = []
_sidebar = []
def register(PluginClass):
"""
Register a plugin class. This function will call back your plugin's
constructor.
... | apache-2.0 |
RenaudParis/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/sub/plain_wsh.py | 499 | 1789 | # Copyright 2009, 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 |
shiinoandra/wavegano | Program/Wavegano/Wavegano/Wavegano.py | 1 | 21939 | import operation as op
import random
import math
import Helper
import GRDEI
import RDE
import GDE
import Wave
import os
import numpy
import matplotlib.pyplot as plt
numpy.set_printoptions(threshold=numpy.nan)
#def encode(payload_path,cover_path,threshold,segment_size,partition_segment_size,method):
# file_name = c... | mit |
edermartioli/fotometria | photUtils.py | 1 | 2674 | # -*- coding: iso-8859-1 -*-
"""
Created on Wed Jul 12, 2017
@author: Eder Martioli & Janderson Oliveira
Laboratorio Nacional de Astrofisica, Brazil
"""
from astropy.io.fits import getheader
import astropy.io.fits as fits
import photlib
import numpy as np
########### READ TABLE OF COORDINATES #########... | gpl-3.0 |
xuleiboy1234/autoTitle | tensorflow/tensorflow/python/kernel_tests/bcast_ops_test.py | 102 | 4542 | # 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 |
nrwahl2/ansible | lib/ansible/plugins/action/dellos9.py | 12 | 4381 | #
# (c) 2016 Red Hat Inc.
#
# Copyright (c) 2017 Dell 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) an... | gpl-3.0 |
vinc456/coala | coalib/processes/Processing.py | 1 | 28893 | import multiprocessing
import os
import platform
import queue
import subprocess
from itertools import chain
from coalib.collecting import Dependencies
from coalib.collecting.Collectors import collect_files
from coalib.misc.StringConverter import StringConverter
from coalib.output.printers.LOG_LEVEL import LOG_LEVEL
fr... | agpl-3.0 |
mehmetkose/tornado | demos/blog/blog.py | 97 | 8511 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
lokirius/python-for-android | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_map.py | 170 | 3058 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.
As a special case, map(None, X) is changed into list(X). (This is
... | apache-2.0 |
SAM-IT-SA/odoo | addons/survey_crm/__openerp__.py | 312 | 1593 | # -*- 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 |
fitermay/intellij-community | python/helpers/py2only/docutils/transforms/frontmatter.py | 104 | 19347 | # $Id: frontmatter.py 7595 2013-01-21 17:33:56Z milde $
# Author: David Goodger, Ueli Schlaepfer <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Transforms related to the front matter of a document or a section
(information found before the main text):
- `DocTitle`: Used to tra... | apache-2.0 |
grilo/ansible-1 | lib/ansible/modules/network/lenovo/cnos_save.py | 26 | 5059 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Lenovo, 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
# ... | gpl-3.0 |
ThomasMiconi/htmresearch | tests/frameworks/layers/l2l4_network_creation_test.py | 2 | 28303 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2016, 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 |
lidavidm/mathics-heroku | venv/lib/python2.7/site-packages/django/core/context_processors.py | 232 | 2269 | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from __future__ i... | gpl-3.0 |
rbovard/las_extractor | bootstrap-buildout.py | 120 | 7458 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | gpl-2.0 |
ehashman/oh-mainline | vendor/packages/Django/tests/modeltests/fixtures/tests.py | 41 | 29331 | from __future__ import absolute_import
from django.contrib.sites.models import Site
from django.core import management
from django.db import connection, IntegrityError
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from django.utils import six
from .models import Article, Book, Spy, Tag, V... | agpl-3.0 |
pas256/ansible | lib/ansible/compat/six/_six.py | 2715 | 30098 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... | gpl-3.0 |
KlubbAlfaRomeoNorge/members | admin/__init__.py | 1 | 5300 | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------
# Portello membership system
# Copyright (C) 2014 Klubb Alfa Romeo Norge
#
# 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
# t... | gpl-2.0 |
joewalnes/idea-community | plugins/hg4idea/testData/bin/hgext/inotify/linux/watcher.py | 2 | 10503 | # watcher.py - high-level interfaces to the Linux inotify subsystem
# Copyright 2006 Bryan O'Sullivan <bos@serpentine.com>
# 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, or any later version.
'''High-level interfa... | apache-2.0 |
richo/groundstation | test/handlers/test_listallobjects_handler.py | 1 | 2821 | from support.handler_fixture import StationHandlerTestCase
from groundstation.transfer.request_handlers import handle_listallobjects
from groundstation.transfer.response_handlers import handle_terminate
import groundstation.transfer.response as response
from groundstation.proto.object_list_pb2 import ObjectList
cla... | mit |
AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/werkzeug/wsgi.py | 146 | 37745 | # -*- coding: utf-8 -*-
"""
werkzeug.wsgi
~~~~~~~~~~~~~
This module implements WSGI related helpers.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import os
import sys
import posixpath
import mimetypes
from itert... | mit |
jmahler/linux-next | Documentation/sphinx/kfigure.py | 125 | 18600 | # -*- coding: utf-8; mode: python -*-
# pylint: disable=C0103, R0903, R0912, R0915
u"""
scalable figure and image handling
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sphinx extension which implements scalable image handling.
:copyright: Copyright (C) 2016 Markus Heiser
:license: GPL Version 2, June 1... | gpl-2.0 |
pong3489/TEST_Mission | Lib/site-packages/numpy/lib/stride_tricks.py | 89 | 3980 | """
Utilities that manipulate strides to achieve desirable effects.
An explanation of strides can be found in the "ndarray.rst" file in the
NumPy reference guide.
"""
import numpy as np
__all__ = ['broadcast_arrays']
class DummyArray(object):
""" Dummy object that just exists to hang __array_interface__ diction... | gpl-3.0 |
apollo13/ansible | lib/ansible/module_utils/api.py | 62 | 4456 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
jagguli/intellij-community | python/lib/Lib/site-packages/django/core/paginator.py | 356 | 4021 | from math import ceil
class InvalidPage(Exception):
pass
class PageNotAnInteger(InvalidPage):
pass
class EmptyPage(InvalidPage):
pass
class Paginator(object):
def __init__(self, object_list, per_page, orphans=0, allow_empty_first_page=True):
self.object_list = object_list
self.per_pa... | apache-2.0 |
leekchan/django_test | tests/admin_widgets/widgetadmin.py | 68 | 1222 | from django.contrib import admin
from . import models
class WidgetAdmin(admin.AdminSite):
pass
class CarAdmin(admin.ModelAdmin):
list_display = ['make', 'model', 'owner']
list_editable = ['owner']
class CarTireAdmin(admin.ModelAdmin):
def formfield_for_foreignkey(self, db_field, request, **kwargs... | bsd-3-clause |
pwoodworth/intellij-community | python/lib/Lib/email/Generator.py | 93 | 13142 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Classes to generate plain text from a message object tree."""
__all__ = ['Generator', 'DecodedGenerator']
import re
import sys
import time
import random
import warnings
from cStringIO import StringIO
from ... | apache-2.0 |
JayKickliter/gr-ieee802-15-4 | python/qa_codeword_demapper_ib.py | 3 | 2031 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Felix Wunsch, Communications Engineering Lab (CEL) / Karlsruhe Institute of Technology (KIT) <wunsch.felix@googlemail.com>.
#
# This is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publis... | gpl-3.0 |
KiChjang/servo | tests/wpt/webgl/tests/closure-library/closure/bin/calcdeps.py | 223 | 18544 | #!/usr/bin/env python
#
# Copyright 2006 The Closure Library 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
... | mpl-2.0 |
luther07/dak | tests/dbtest_fingerprint.py | 10 | 2559 | #!/usr/bin/env python
from db_test import DBDakTestCase
from daklib.dbconn import Fingerprint, Uid
from daklib.dak_exceptions import DBUpdateError
from sqlalchemy.exc import IntegrityError
import unittest
class FingerprintTestCase(DBDakTestCase):
"""
The FingerprintTestCase tests the relation between Finger... | gpl-2.0 |
kambysese/mne-python | examples/preprocessing/plot_otp.py | 10 | 3240 | """
===========================================================
Plot sensor denoising using oversampled temporal projection
===========================================================
This demonstrates denoising using the OTP algorithm :footcite:`LarsonTaulu2018`
on data with with sensor artifacts (flux jumps) and ran... | bsd-3-clause |
Evervolv/android_kernel_lge_v500 | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py | 12980 | 5411 | # SchedGui.py - Python extension for perf script, basic GUI code for
# traces drawing and overview.
#
# Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com>
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
... | gpl-2.0 |
Darkdadaah/pywikibot-core | pywikibot/editor.py | 5 | 4997 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""Text editor class for your favourite editor."""
from __future__ import absolute_import, unicode_literals
#
# (C) Gerrit Holl, 2004
# (C) Pywikibot team, 2004-2017
#
# Distributed under the terms of the MIT license.
#
__version__ = '$Id$'
#
import codecs
import os
import su... | mit |
freeflightsim/ffs-app-engine | freeflightsim.appspot.com/distlib/tipfy/__init__.py | 1 | 41328 | # -*- coding: utf-8 -*-
"""
tipfy
~~~~~
Minimalist WSGI application and utilities for App Engine.
:copyright: 2010 by tipfy.org.
:license: BSD, see LICENSE.txt for more details.
"""
import logging
import os
from wsgiref.handlers import CGIHandler
# Werkzeug swiss knife.
# Need to import werkzeug ... | gpl-2.0 |
lucab85/WebFundamentals | gae/lib/markdown/blockparser.py | 127 | 3517 | from __future__ import unicode_literals
from __future__ import absolute_import
from . import util
from . import odict
class State(list):
""" Track the current and nested state of the parser.
This utility class is used to track the state of the BlockParser and
support multiple levels if nesting. It's just... | apache-2.0 |
godfreyy/scrapy | scrapy/utils/trackref.py | 120 | 2081 | """This module provides some functions and classes to record and report
references to live object instances.
If you want live objects for a particular class to be tracked, you only have to
subclass from object_ref (instead of object).
About performance: This library has a minimal performance impact when enabled,
and ... | bsd-3-clause |
tylerwmarrs/single-artist-lyric-analysis | lyricanalysis/utils.py | 1 | 1576 | import unicodedata
import sys
from nltk.stem import PorterStemmer
def split_sentences(text):
sentences = []
for sentence in text.split('\n'):
sentence = sentence.strip()
if sentence:
sentences.append(sentence)
return sentences
stemmer = PorterStemmer()
def stem_... | mit |
repotvsupertuga/tvsupertuga.repository | script.module.media3d/js2py/es6/__init__.py | 27 | 1270 | INITIALISED = False
babel = None
babelPresetEs2015 = None
def js6_to_js5(code):
global INITIALISED, babel, babelPresetEs2015
if not INITIALISED:
import signal, warnings, time
warnings.warn('\nImporting babel.py for the first time - this can take some time. \nPlease note that currently Javascrip... | gpl-2.0 |
bverburg/CouchPotatoServer | libs/apscheduler/triggers/cron/fields.py | 115 | 3058 | """
Fields represent CronTrigger options which map to :class:`~datetime.datetime`
fields.
"""
from calendar import monthrange
from apscheduler.triggers.cron.expressions import *
__all__ = ('MIN_VALUES', 'MAX_VALUES', 'DEFAULT_VALUES', 'BaseField',
'WeekField', 'DayOfMonthField', 'DayOfWeekField')
MIN_VA... | gpl-3.0 |
nuwainfo/treeio | finance/migrations/0003_treeiocurrency.py | 6 | 22140 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Add currenci... | mit |
underyx/ansible | lib/ansible/utils/plugins.py | 108 | 9866 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.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 |
blueshed/blueshed-py | src/blueshed/fling/fling_rpc.py | 1 | 1225 | '''
Created on Nov 12, 2013
@author: peterb
'''
import logging
import time
from blueshed.fling.fling_client import FlingClient
from tornado.ioloop import IOLoop
class FlingRPC(FlingClient):
def __init__(self, target, url="ws://localhost:7777/ws", reconnect=1):
FlingClient.__init__(self, url=url)
... | mit |
gvb/odoo | addons/account/report/account_invoice_report.py | 224 | 12489 | # -*- 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 |
turbokongen/home-assistant | homeassistant/components/homematicip_cloud/alarm_control_panel.py | 11 | 4476 | """Support for HomematicIP Cloud alarm control panel."""
import logging
from typing import Any, Dict
from homematicip.functionalHomes import SecurityAndAlarmHome
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntity
from homeassistant.components.alarm_control_panel.const import (
SUPPOR... | apache-2.0 |
moijes12/oh-mainline | vendor/packages/Django/django/contrib/gis/feeds.py | 225 | 5932 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C G... | agpl-3.0 |
grrr2/Flexget | flexget/plugins/input/pogcal.py | 20 | 2098 | from __future__ import unicode_literals, division, absolute_import
import logging
from bs4 import BeautifulSoup
from flexget import plugin
from flexget.entry import Entry
from flexget.event import event
from flexget.utils import requests
log = logging.getLogger('pogcal')
class InputPogDesign(object):
schema =... | mit |
Gitlab11/odoo | addons/website/models/ir_actions.py | 363 | 3074 | # -*- coding: utf-8 -*-
import urlparse
from openerp.http import request
from openerp.osv import fields, osv
class actions_server(osv.Model):
""" Add website option in server actions. """
_name = 'ir.actions.server'
_inherit = ['ir.actions.server']
def _compute_website_url(self, cr, uid, id, websit... | agpl-3.0 |
nrwahl2/ansible | lib/ansible/modules/cloud/amazon/iam_cert.py | 4 | 12125 | #!/usr/bin/python
# 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... | gpl-3.0 |
veteman/thepython2blob | timei.py | 1 | 6839 | #Copyright 2015 B. Johan G. Svensson
#Licensed under the terms of the MIT license (see LICENSE).
def datetest(y,m,d,bc=False):
# datetest(y ,m ,d [,bc])
if (type(y)!=type(1) and type(y)!=type(1L)) or \
(type(m)!=type(1) and type(y)!=type(1L)) or \
(type(d)!=type(1) and type(y)!=type(1L)):
... | mit |
dariemp/odoo | addons/hr_holidays/report/holidays_summary_report.py | 333 | 10372 | # -*- 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 |
wsyzxcn/tornado | tornado/httputil.py | 13 | 33009 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
javierip/parallel-processing-teaching-toolkit | 04-GPU-accelerators/04-PyOpenCL/03-vector_multi/vector_multi.py | 2 | 1995 | # -*- coding: utf-8 -*-
# Parallel Processing Teaching Toolkit
# PyOpenCL - Example 03
# Vector Multiplication
# https://github.com/javierip/parallel-processing-teaching-toolkit
import pyopencl as cl
import numpy as np
import time # For measure the running times
VECTOR_SIZE = 50000 # Elements of vector
# Create ... | apache-2.0 |
sclooney94/example-avi-gaiadr1-magnitude-distribution | views.py | 1 | 2732 | """
GAVIP Example AVIS: Simple AVI
@req: SOW-FUN-010
@req: SOW-FUN-040
@req: SOW-FUN-046
@req: SOW-INT-001
@comp: AVI Web System
This is a simple example AVI which demonstrates usage of the GAVIP AVI framework
Here in views.py, you can define any type of functions to handle
HTTP requests. Any of these functions can ... | lgpl-3.0 |
rajsadho/django | tests/template_backends/test_django.py | 53 | 3866 | from template_tests.test_response import test_processor_name
from django.template.backends.django import DjangoTemplates
from django.template.library import InvalidTemplateLibrary
from django.test import RequestFactory, override_settings
from .test_dummy import TemplateStringsTests
class DjangoTemplatesTests(Templa... | bsd-3-clause |
drandykass/fatiando | gallery/gravmag/eqlayer_transform.py | 6 | 3046 | """
Equivalent layer for griding and upward-continuing gravity data
-------------------------------------------------------------------------
The equivalent layer is one of the best methods for griding and upward
continuing gravity data and much more. The trade-off is that performing this
requires an inversion and lat... | bsd-3-clause |
ContinuumIO/nutchpy | setup.py | 8 | 4958 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function
import os
import sys
from fnmatch import fnmatchcase
from distutils.core import Command, setup
from distutils.util import convert_path
import glob
import subprocess
import shutil
#------------------------------------------------... | apache-2.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/site-packages/twisted/mail/test/test_mailmail.py | 77 | 2683 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.mail.scripts.mailmail}, the implementation of the
command line program I{mailmail}.
"""
import sys
from StringIO import StringIO
from twisted.trial.unittest import TestCase
from twisted.mail.scripts.mailmail import parseO... | gpl-2.0 |
lavvy/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x025.py | 252 | 3871 | data = (
'-', # 0x00
'-', # 0x01
'|', # 0x02
'|', # 0x03
'-', # 0x04
'-', # 0x05
'|', # 0x06
'|', # 0x07
'-', # 0x08
'-', # 0x09
'|', # 0x0a
'|', # 0x0b
'+', # 0x0c
'+', # 0x0d
'+', # 0x0e
'+', # 0x0f
'+', # 0x10
'+', # 0x11
'+', # 0x12
'+', # 0x13
'+', # 0... | gpl-2.0 |
g2p/systems | lib/systems/context.py | 1 | 17949 | # vim: set fileencoding=utf-8 sw=2 ts=2 et :
from __future__ import absolute_import
from __future__ import with_statement
from logging import getLogger
import networkx as NX
import yaml
from systems.collector import Aggregate, CResource
from systems.registry import get_registry
from systems.typesystem import EResour... | gpl-2.0 |
rodorad/spark-tk | python/sparktk/frame/ops/binary_classification_metrics.py | 14 | 5906 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
gw-sd-2016/Codir | codirSublime/SocketIO/requests/packages/__init__.py | 838 | 1384 | '''
Debian and other distributions "unbundle" requests' vendored dependencies, and
rewrite all imports to use the global versions of ``urllib3`` and ``chardet``.
The problem with this is that not only requests itself imports those
dependencies, but third-party code outside of the distros' control too.
In reaction to t... | gpl-2.0 |
pixelogik/NearPy | nearpy/filters/__init__.py | 8 | 1396 | # -*- coding: utf-8 -*-
# Copyright (c) 2013 Ole Krause-Sparmann
# 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 |
paour/weblate | weblate/trans/models/__init__.py | 1 | 1926 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2014 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# 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, eithe... | gpl-3.0 |
Eric-Zhong/odoo | addons/l10n_be_invoice_bba/__init__.py | 438 | 1101 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# it u... | agpl-3.0 |
diorcety/intellij-community | python/lib/Lib/bisect.py | 91 | 2394 | """Bisection algorithms."""
def insort_right(a, x, lo=0, hi=None):
"""Insert item x in list a, and keep it sorted assuming a is sorted.
If x is already in a, insert it to the right of the rightmost x.
Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
"""
... | apache-2.0 |
ryancoleman/analysis-scripts | statistics.py | 2 | 10576 | #just a bunch of handy methods for basic stats
import math
import random
def computeMean(totalList):
if len(totalList) > 0:
return sum(totalList)/float(len(totalList))
else:
return 0.
def computeStdDev(totalList, mean):
if len(totalList) > 0:
sumSq = 0.
for datum in totalList:
sumSq += (d... | gpl-2.0 |
ErwinRieger/ddprint | host/intmath.py | 1 | 5070 | # -*- coding: utf-8 -*-
#
#/*
# This file is part of ddprint - a 3D printer firmware.
#
# Copyright 2021 erwin.rieger@ibrieger.de
#
# ddprint 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 ... | gpl-2.0 |
silly-wacky-3-town-toon/SOURCE-COD | Panda3D-1.10.0/direct/distributed/TimeManager.py | 11 | 6863 | from direct.showbase.DirectObject import *
from pandac.PandaModules import *
from direct.task import Task
from direct.distributed import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from direct.distributed.ClockDelta import globalClockDelta
class TimeManager(DistributedObject.Distribute... | apache-2.0 |
mapycz/mapnik | scons/scons-local-2.5.1/SCons/Scanner/LaTeX.py | 3 | 16233 | """SCons.Scanner.LaTeX
This module implements the dependency scanner for LaTeX code.
"""
#
# Copyright (c) 2001 - 2016 The SCons Foundation
#
# 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 Softwar... | lgpl-2.1 |
sgruszka/iwlegacy | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
grezesf/Research | Reservoirs/Task0_Replication/code/preprocessing/feat_extract.py | 1 | 2574 | #!/usr/bin/python
import os
import sys
import datetime
# README
# reads the TIMIT dataset, copies the directory structure
# performs a mffc extraction on the audio files
# input:
# TIMITPath: path to the base of the dataset directory
# SMILExtractPath: path to SMILExtract executable
# ConfPath: path to the SMILExtract... | mit |
johnson1228/pymatgen | pymatgen/transformations/tests/test_advanced_transformations.py | 4 | 25899 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
import unittest
import os
import json
import warnings
import numpy as np
from pymatgen import Lattice, Structure, Specie, Element
from pymatgen.transformations... | mit |
jxs/servo | tests/wpt/harness/wptrunner/update/base.py | 196 | 2148 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
exit_unclean = object()
exit_clean = object()
class Step(object):
provides = []
def __init__(self, logger):
... | mpl-2.0 |
vuchau/ansible | lib/ansible/utils/hashing.py | 202 | 3125 | # (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 |
thonkify/thonkify | src/lib/pkg_resources/__init__.py | 7 | 108158 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.