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 |
|---|---|---|---|---|---|
JonathanSwaim/Tjagonaj_Translator | en/tags.py | 10 | 2345 | # TAGS - last updated for NodeBox 1rc7
# Author: Tom De Smedt <tomdesmedt@organisms.be>
# See LICENSE.txt for details.
tags_html = [
"!--", "!doctype", "a", "abbr", "acronym", "address",
"applet", "area", "b", "base", "basefont", "bdo",
"big", "blockquote", "body", "br", "button", "caption",
"center", ... | gpl-2.0 |
xodus7/tensorflow | tensorflow/tools/ci_build/copy_binary.py | 26 | 4203 | #!/usr/bin/python
# 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 r... | apache-2.0 |
janelia-flyem/pydvid | tests/test_keyvalue.py | 1 | 3531 | import os
import shutil
import tempfile
import httplib
import h5py
from pydvid import keyvalue
from mockserver.h5mockserver import H5MockServer, H5MockServerDataFile
class TestKeyValue(object):
@classmethod
def setupClass(cls):
"""
Override. Called by nosetests.
- Create an hdf5... | bsd-3-clause |
ammarkhann/FinalSeniorCode | lib/python2.7/site-packages/pandas/io/date_converters.py | 10 | 1827 | """This module is designed for community supported date conversion functions"""
from pandas.compat import range, map
import numpy as np
import pandas._libs.lib as lib
def parse_date_time(date_col, time_col):
date_col = _maybe_cast(date_col)
time_col = _maybe_cast(time_col)
return lib.try_parse_date_and_ti... | mit |
simonjbeaumont/sm | tests/lvhd_test/test_intellicache.py | 12 | 9921 | #!/usr/bin/python
#
# Basic IntelliCache tests. Assumes the environment has been setup
# accordingly: a VM has been installed on an NFS SR and caching has been
# enabled on the host. libaio must be installed on the VM.
# TODO review whether the aforementioned requirements are well-explained
#
# It shuts down ... | lgpl-2.1 |
m-labs/milkymist | cores/softusb/navre_regress/test_opcodes/test_ADIW.py | 5 | 3556 | #! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | lgpl-3.0 |
beni55/rinohtype | rinoh/annotation.py | 1 | 1363 | # This file is part of RinohType, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from .util import Decorator
from .text import MixedStyle... | agpl-3.0 |
Feverup/ansible-modules-extras | notification/campfire.py | 59 | 5135 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | gpl-3.0 |
rrrene/django | django/conf/locale/tr/formats.py | 504 | 1141 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'd F Y'
TIME_FORMAT = 'H:i'
DATETI... | bsd-3-clause |
felipessalvatore/CNNexample | src/tunning/fc.py | 1 | 2217 | import os
import sys
from random import randint
import numpy as np
import inspect
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from ut... | mit |
rouault/mapnik | scons/scons-local-2.3.4/SCons/Variables/ListVariable.py | 9 | 4404 | """engine.SCons.Variables.ListVariable
This file defines the option type for SCons implementing 'lists'.
A 'list' option may either be 'all', 'none' or a list of names
separated by comma. After the option has been processed, the option
value holds either the named list elements, all list elemens or no
list elements a... | lgpl-2.1 |
IvanGavran/scrapy | tests/test_utils_log.py | 140 | 3417 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import logging
import unittest
from testfixtures import LogCapture
from twisted.python.failure import Failure
from scrapy.utils.log import (failure_to_exc_info, TopLevelFormatter,
LogCounterHandler, StreamLogger)
fr... | bsd-3-clause |
google-research/dreamer | dreamer/models/base.py | 1 | 2449 | # Copyright 2019 The Dreamer 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 applicabl... | apache-2.0 |
ropik/chromium | tools/json_schema_compiler/schema_bundle_generator.py | 6 | 5060 | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import code
import cpp_util
import json
import os
import re
# TODO(miket/asargent) - parameterize this.
SOURCE_BASE_PATH = 'chrome/common/extensions/ap... | bsd-3-clause |
kevinastone/sentry | src/sentry/migrations/0011_auto__add_field_groupedmessage_score.py | 36 | 5085 | # 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 'GroupedMessage.score'
db.add_column('sentry_groupedmessage', 'score', self.gf('django.db.models.fi... | bsd-3-clause |
frewsxcv/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Action.py | 19 | 47042 | """SCons.Action
This encapsulates information about executing any sort of action that
can build one or more target Nodes (typically files) from one or more
source Nodes (also typically files) given a specific Environment.
The base class here is ActionBase. The base class supplies just a few
OO utility methods and so... | apache-2.0 |
JavaRabbit/CS496_capstone | bigtable/hello/main.py | 8 | 3959 | #!/usr/bin/env python
# Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
jonyroda97/redbot-amigosprovaveis | lib/youtube_dl/extractor/commonmistakes.py | 44 | 1591 | from __future__ import unicode_literals
import sys
from .common import InfoExtractor
from ..utils import ExtractorError
class CommonMistakesIE(InfoExtractor):
IE_DESC = False # Do not list
_VALID_URL = r'''(?x)
(?:url|URL)$
'''
_TESTS = [{
'url': 'url',
'only_matching': Tru... | gpl-3.0 |
agarciamontoro/root | tutorials/pyroot/qtexample.py | 31 | 1792 | ## \file
## \ingroup tutorial_pyroot
## Qt example
##
## \macro_code
##
## \author Wim Lavrijsen
import sys
from PyQt4.QtGui import *
from PyQt4.QtCore import *
import ROOT
import sip
class window(QMainWindow):
def __init__(self):
# Init the main window.
QMainWindow.__init__(self)
self.res... | lgpl-2.1 |
xujun10110/golismero | thirdparty_libs/django/core/cache/__init__.py | 98 | 5086 | """
Caching framework.
This package defines set of cache backends that all conform to a simple API.
In a nutshell, a cache is a set of values -- which can be any object that
may be pickled -- identified by string keys. For the complete API, see
the abstract BaseCache class in django.core.cache.backends.base.
Client ... | gpl-2.0 |
dyyi/moneybook | venv/Lib/site-packages/django/conf/locale/ru/formats.py | 1059 | 1267 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j E Y г.'
TIME_FORMAT = 'G:i'
DAT... | apache-2.0 |
zinsword/p2pool | wstools/logging.py | 292 | 8187 | # Copyright (c) 2003, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of
# any required approvals from the U.S. Dept. of Energy). All rights
# reserved.
#
"""Logging"""
ident = "$Id$"
import os, sys
WARN = 1
DEBUG = 2
class ILogger:
'''Logger int... | gpl-3.0 |
jolyonb/edx-platform | common/lib/xmodule/xmodule/video_module/transcripts_utils.py | 1 | 37083 | """
Utility functions for transcripts.
++++++++++++++++++++++++++++++++++
"""
from __future__ import absolute_import
import copy
import json
import logging
import os
from functools import wraps
import requests
import six
from django.conf import settings
from lxml import etree
from pysrt import SubRipFile, SubRipItem,... | agpl-3.0 |
webostin/django-btc | tests/template_tests/filter_tests/test_lower.py | 2 | 1119 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import lower
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import render, setup
class LowerTests(SimpleTestCase):
@setup({'lower01': '{% autoescape off %}{{ a|... | bsd-3-clause |
mlk/thefuck | thefuck/rules/apt_get.py | 1 | 1174 | from thefuck.specific.apt import apt_available
from thefuck.utils import memoize, which
from thefuck.shells import shell
try:
from CommandNotFound import CommandNotFound
command_not_found = CommandNotFound()
enabled_by_default = apt_available
except ImportError:
enabled_by_default = False
def _get_e... | mit |
IlyaGusev/PoetryCorpus | poetry/apps/corpus/views/comparison_view.py | 1 | 4872 | from collections import namedtuple
from typing import List
from django.views.generic import TemplateView, View
from django.http import HttpResponse
from braces.views import LoginRequiredMixin, GroupRequiredMixin
from poetry.apps.corpus.models import Poem, MarkupVersion
from rupo.main.markup import Markup
def get_ac... | apache-2.0 |
vikrant82/android_kernel_samsung_mondrianwifi | scripts/gcc-wrapper.py | 1276 | 3382 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
piensa/geonode | scripts/backup-restore/backup.py | 16 | 4844 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
VisTrails/VisTrails | vistrails/packages/persistence/repo.py | 2 | 10344 | ###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## ... | bsd-3-clause |
okanasik/JdeRobot | src/drivers/MAVLinkServer/MAVProxy/modules/lib/wxsettings.py | 10 | 2465 | '''
Graphical editing of mp_settings object
'''
import os, sys
import multiprocessing, threading
class WXSettings(object):
'''
a graphical settings dialog for mavproxy
'''
def __init__(self, settings):
self.settings = settings
self.parent_pipe,self.child_pipe = multiprocessing.Pipe()
... | gpl-3.0 |
lanfker/tdma_imac | .waf-1.6.7-0a94702c61504c487a251b8d0a04ca9a/waflib/Options.py | 3 | 5245 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file
import os,tempfile,optparse,sys,re
from waflib import Logs,Utils,Context
cmds='distclean configure build install clean uninstall check dist distcheck'.split()
options={}
comma... | gpl-2.0 |
samuelmaudo/yepes | yepes/view_mixins/cache.py | 1 | 2980 | # -*- coding:utf-8 -*-
from __future__ import unicode_literals
import hashlib
from django.contrib import messages
from django.http import HttpResponsePermanentRedirect
from django.utils.encoding import force_bytes
from yepes.cache import MintCache
from yepes.conf import settings
from yepes.utils.minifier import min... | bsd-3-clause |
evvers/git-pre-commit-hook-utils | tests/test_git_pre_commit_hook_utils.py | 1 | 2519 | import git_pre_commit_hook_utils as utils
import scripttest
import os
import copy
def test_git_mode():
m = utils.GitMode('120000')
assert m.is_symlink()
assert not m.is_gitlink()
def test_with_empty_repo(tmpdir):
os_environ = copy.deepcopy(os.environ)
os_environ['GIT_DIR'] = str(tmpdir) + '/.git... | mit |
vincent-fei/django-xadmin | xadmin/views/detail.py | 16 | 10295 | import copy
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import PermissionDenied, ObjectDoesNotExist
from django.db import models
from django.forms.models import modelform_factory
from django.http import Http404
from django.template import loader
from ... | bsd-3-clause |
rohit01/sethji | sethji/util.py | 1 | 2148 | import datetime
import calendar
import re
def validate_email(email, email_regex_csv):
regex_list = [e.strip() for e in email_regex_csv.split(',')]
for user_regex in regex_list:
## Only * is allowed in user email regex
match_regex = re.escape(user_regex)
match_regex = "^%s$" % match_reg... | mit |
kthordarson/CouchPotatoServer | libs/guessit/fileutils.py | 53 | 3122 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
Eric89GXL/scipy | scipy/linalg/_matfuncs_inv_ssq.py | 65 | 28050 | """
Matrix functions that use Pade approximation with inverse scaling and squaring.
"""
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from scipy.linalg._matfuncs_sqrtm import SqrtmError, _sqrtm_triu
from scipy.linalg.decomp_schur import schur, rsf2csf
from scipy... | bsd-3-clause |
jmaher/randomtools | wget/wget_helper.py | 1 | 4423 | import subprocess
import re
import os
filename = ''
def findAndGet(url, lines):
retVal = None
fname, root, query = getFilename(url)
resrc = re.compile('.*src="%s(.*)".*' % url)
rebg = re.compile('.*\(%s(.*)\).*' % url)
for line in lines:
match = resrc.match(line)
if match:
... | mpl-2.0 |
bkendzior/scipy | scipy/linalg/decomp_svd.py | 38 | 7226 | """SVD decomposition functions."""
from __future__ import division, print_function, absolute_import
import numpy
from numpy import zeros, r_, diag
# Local imports.
from .misc import LinAlgError, _datacopied
from .lapack import get_lapack_funcs, _compute_lwork
from .decomp import _asarray_validated
from scipy._lib.six... | bsd-3-clause |
ceibal-tatu/software-center | softwarecenter/log.py | 3 | 4524 | #!/usr/bin/python
# Copyright (C) 2010 Canonical
#
# Authors:
# Geliy Sokolov
# Michael Vogt
#
# 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; version 3.
#
# This program is distributed in the... | lgpl-3.0 |
aselle/tensorflow | tensorflow/contrib/quantize/python/quant_ops.py | 17 | 11486 | # 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 |
LumPenPacK/NetworkExtractionFromImages | osx_build/nefi2_osx_amd64_xcode_2015/site-packages/networkx/algorithms/tests/test_cycles.py | 46 | 7790 | #!/usr/bin/env python
from nose.tools import *
import networkx
import networkx as nx
from networkx.algorithms import find_cycle
FORWARD = nx.algorithms.edgedfs.FORWARD
REVERSE = nx.algorithms.edgedfs.REVERSE
class TestCycles:
def setUp(self):
G=networkx.Graph()
G.add_cycle([0,1,2,3])
G.add... | bsd-2-clause |
CartoDB/cartoframes | tests/unit/viz/test_map.py | 1 | 12097 | from cartoframes.auth import Credentials
from cartoframes.viz import Map, Layer, popup_element, constants
from cartoframes.viz.source import Source
from cartoframes.io.managers.context_manager import ContextManager
from .utils import build_geodataframe
from ..mocks.kuviz_mock import KuvizPublisherMock
def setup_mo... | bsd-3-clause |
superdesk/superdesk-content-api | features/environment.py | 5 | 2766 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import json
... | agpl-3.0 |
WenZhuang/pyspider | tests/test_fetcher.py | 63 | 12804 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-15 22:10:35
import os
import json
import copy
import time
import umsgpack
import subprocess
import unittest2 as unittest
from multiprocessing impor... | apache-2.0 |
cnbird1999/ava | misc/ldap_export.py | 3 | 5575 | from pip._vendor.distlib.compat import raw_input
__author__ = 'ladynerd'
from ldap3 import Server, Connection, LDAPExceptionError, SUBTREE
import sys
import json
import getpass
class ActiveDirectoryHelper:
def __init__(self):
pass
PAGESIZE = 1000
def get_connection(self, parameters):
t... | gpl-2.0 |
hdmetor/scikit-learn | examples/mixture/plot_gmm_selection.py | 248 | 3223 | """
=================================
Gaussian Mixture Model Selection
=================================
This example shows that model selection can be performed with
Gaussian Mixture Models using information-theoretic criteria (BIC).
Model selection concerns both the covariance type
and the number of components in th... | bsd-3-clause |
harmy/kbengine | kbe/res/scripts/common/Lib/encodings/iso8859_8.py | 37 | 11343 | """ Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,i... | lgpl-3.0 |
darkwing/kuma | vendor/packages/pbr/hooks/commands.py | 46 | 2479 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... | mpl-2.0 |
anurag313/scikit-learn | sklearn/utils/tests/test_multiclass.py | 128 | 12853 |
from __future__ import division
import numpy as np
import scipy.sparse as sp
from itertools import product
from sklearn.externals.six.moves import xrange
from sklearn.externals.six import iteritems
from scipy.sparse import issparse
from scipy.sparse import csc_matrix
from scipy.sparse import csr_matrix
from scipy.sp... | bsd-3-clause |
saimn/astropy | astropy/wcs/utils.py | 3 | 40588 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy import units as u
from astropy.utils import unbroadcast
import copy
from .wcs import WCS, WCSSUB_LONGITUDE, WCSSUB_LATITUDE
__doctest_skip__ = ['wcs_to_celestial_frame', 'celestial_frame_to_wcs']
__all__ = ['add_stokes_... | bsd-3-clause |
AlienCowEatCake/ImageViewer | src/ThirdParty/Zstandard/zstd-1.4.8/tests/automated_benchmarking.py | 2 | 13256 | # ################################################################
# Copyright (c) 2020-2020, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under both the BSD-style license (found in the
# LICENSE file in the root directory of this source tree) and the GPLv2 (found
# in the COPYING file in the ... | gpl-3.0 |
zhanghenry/stocks | django/contrib/sites/migrations/0001_initial.py | 276 | 1096 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.Create... | bsd-3-clause |
mikewied/perfrunner | perfrunner/helpers/monitor.py | 2 | 5877 | import time
from logger import logger
from perfrunner.helpers.rest import RestHelper
class Monitor(RestHelper):
POLLING_INTERVAL = 2
MAX_RETRY = 30
REBALANCE_TIMEOUT = 3600 * 2
DISK_QUEUES = (
'ep_queue_size',
'ep_flusher_todo',
'ep_diskqueue_items',
'vb_active_queu... | apache-2.0 |
Nitaco/ansible | lib/ansible/modules/windows/win_environment.py | 35 | 2820 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
googleads/google-ads-python | google/ads/googleads/v6/enums/types/matching_function_context_type.py | 1 | 1242 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
zjuwangg/scrapy | scrapy/signalmanager.py | 123 | 2474 | from __future__ import absolute_import
from pydispatch import dispatcher
from scrapy.utils import signal as _signal
class SignalManager(object):
def __init__(self, sender=dispatcher.Anonymous):
self.sender = sender
def connect(self, receiver, signal, **kwargs):
"""
Connect a receiver... | bsd-3-clause |
mihailignatenko/erp | addons/mrp/stock.py | 4 | 17806 | # -*- 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 |
grouan/udata | udata/tests/site/test_site_api.py | 1 | 3123 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date
from flask import url_for
from udata.core.site.models import Site
from udata.core.site.metrics import SiteMetric
from udata.core.site.views import current_site
from udata.models import db, WithMetrics
from udata.tests.api impo... | agpl-3.0 |
Azure/azure-sdk-for-python | sdk/storage/azure-storage-file-share/azure/storage/fileshare/_generated/models/_models_py3.py | 1 | 39940 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
maikito26/script.foscam | resources/lib/utils.py | 1 | 6718 | import os
import time
import glob
import xbmc
import xbmcaddon
import xbmcgui
import requests
__addon__ = xbmcaddon.Addon()
__id__ = __addon__.getAddonInfo('id')
__icon__ = __addon__.getAddonInfo('icon').decode("utf-8")
__version__ = __addon__.getAddonInfo('version')
addon_name = __addon__.getLocalizedString(320... | gpl-3.0 |
jseabold/scikit-learn | sklearn/tests/test_naive_bayes.py | 32 | 17897 | import pickle
from io import BytesIO
import numpy as np
import scipy.sparse
from sklearn.datasets import load_digits, load_iris
from sklearn.model_selection import train_test_split
from sklearn.model_selection import cross_val_score
from sklearn.externals.six.moves import zip
from sklearn.utils.testing import assert... | bsd-3-clause |
sahiljain/catapult | dashboard/dashboard/pinpoint/models/quest/run_test_test.py | 1 | 7300 | # Copyright 2016 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 unittest
import mock
from dashboard.pinpoint.models.quest import run_test
_SWARMING_TASK_EXTRA_ARGS = [
'test_suite', '--story-filter', 'test'... | bsd-3-clause |
CoolCloud/flask-admin | flask_admin/contrib/peewee/view.py | 13 | 15977 | import logging
from flask import flash
from flask_admin._compat import string_types
from flask_admin.babel import gettext, ngettext, lazy_gettext
from flask_admin.model import BaseModelView
from flask_admin.model.form import wrap_fields_in_fieldlist
from flask_admin.model.fields import ListEditableFieldList
from pee... | bsd-3-clause |
AndiDog/git-cola | cola/widgets/main.py | 1 | 40624 | """This view provides the main git-cola user interface.
"""
from __future__ import division, absolute_import, unicode_literals
import os
from functools import partial
from qtpy import QtCore
from qtpy import QtGui
from qtpy import QtWidgets
from qtpy.QtCore import Qt
from qtpy.QtCore import Signal
from ..compat impor... | gpl-2.0 |
delhivery/django | django/conf/locale/nb/formats.py | 504 | 1766 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
Jaden-J/shpescape | shapeft/models.py | 18 | 1495 | import random
import md5
from django.db import models
from ft_auth.models import OAuthAccessToken
STATUS_CODES = {
1 : 'In Queue (%s ahead of you)',
2 : 'Initial Processing',
3 : 'Importing into Fusion Tables',
4 : 'Complete',
6 : 'Error'
}
class shapeUpload(models.Model):
"""An upload -- includes location ... | apache-2.0 |
hmen89/odoo | addons/l10n_tr/__init__.py | 429 | 1050 | # -*- 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... | agpl-3.0 |
smeissner/eden | modules/eden/dvr.py | 9 | 8000 | # -*- coding: utf-8 -*-
""" Sahana Eden Disaster Victim Registration Model
@copyright: 2012 (c) Sahana Software Foundation
@license: MIT
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 th... | mit |
sid5432/pyOTDR | pyotdr/main.py | 1 | 1399 | import os
import logging
import argparse
from pyotdr.dump import tofile, ExportDataType
from pyotdr.read import sorparse
logging.basicConfig(format="%(message)s")
logger = logging.getLogger(__name__)
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG")
logger.setLevel(LOG_LEVEL)
def main():
parser = argparse.ArgumentPars... | gpl-3.0 |
zhouyao1994/incubator-superset | superset/utils/dashboard_import_export.py | 1 | 1863 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
solintegra/addons | l10n_br/__init__.py | 430 | 1403 | # -*- encoding: utf-8 -*-
###############################################################################
# #
# Copyright (C) 2009 Renato Lima - Akretion #
# ... | agpl-3.0 |
gideondsouza/onionpad | scintilla/scripts/GenerateCaseConvert.py | 3 | 4403 | # Script to generate CaseConvert.cxx from Python's Unicode data
# Should be run rarely when a Python with a new version of Unicode data is available.
# Should not be run with old versions of Python.
# Current best approach divides case conversions into two cases:
# simple symmetric and complex.
# Simple symmetric is ... | gpl-2.0 |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/mpl_toolkits/axisartist/axisline_style.py | 8 | 5277 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from matplotlib.patches import _Style, FancyArrowPatch
from matplotlib.transforms import IdentityTransform
from matplotlib.path import Path
import numpy as np
class _FancyAxislineStyle:
class S... | mit |
vorghahn/SSTV-PLEX-PLUGIN | smoothstreams3.bundle/Contents/Libraries/Shared/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 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 without l... | mit |
CasparLi/calibre | recipes/sltrib.py | 27 | 2617 | from calibre.web.feeds.news import BasicNewsRecipe
class AdvancedUserRecipe1278347258(BasicNewsRecipe):
title = u'Salt Lake City Tribune'
__author__ = 'Charles Holbert'
oldest_article = 7
max_articles_per_feed = 100
description = '''Utah's independent news source since 1871'''
... | gpl-3.0 |
lmorchard/django-allauth | allauth/socialaccount/providers/oauth/views.py | 50 | 4232 | from __future__ import absolute_import
from django.core.urlresolvers import reverse
from allauth.socialaccount.helpers import render_authentication_error
from allauth.socialaccount.providers.oauth.client import (OAuthClient,
OAuthError)
from allauth.socialacco... | mit |
2ndQuadrant/ansible | lib/ansible/module_utils/storage/hpe3par/hpe3par.py | 40 | 2302 | # Copyright: (c) 2018, Hewlett Packard Enterprise Development LP
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
from ansible.module_utils import basic
def convert_to_binary_multiple(size_with_unit):
if size_with_unit is None:
return -1
valid... | gpl-3.0 |
dagwieers/ansible | lib/ansible/modules/network/ovs/openvswitch_port.py | 102 | 8041 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2013, David Stygstra <david.stygstra@gmail.com>
# Portions copyright @ 2015 VMware, Inc.
# 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
ANSI... | gpl-3.0 |
x111ong/django | tests/one_to_one/tests.py | 90 | 19540 | from __future__ import unicode_literals
from django.db import IntegrityError, connection, transaction
from django.test import TestCase
from .models import (
Bar, Director, Favorites, HiddenPointer, ManualPrimaryKey, MultiModel,
Place, Pointer, RelatedModel, Restaurant, School, Target, UndergroundBar,
Wait... | bsd-3-clause |
RobbieNor/note-extractor | settings.py | 1 | 9569 | #!/usr/bin/python
import ConfigParser, inspect, os, importlib
import stringbar
#Settings
args = {'arg_backuppath' : None, 'arg_show' : None, 'arg_sideratio' : None, 'arg_bordersize' : None, 'arg_osn' : None, 'arg_workspacepath' : None, 'arg_rotateleft' : None, 'arg_rotateright' : None, 'arg_pageheight' : None, 'arg_ba... | gpl-2.0 |
dnevels/heekscnc | circular_pocket.py | 24 | 9240 | #!/usr/local/bin/python
"""
Circular Pocket G-Code Generator.
This source is taken and modified from the
Counterbore G-Code Generator
Version 1.3
Copyright (C) <2008> <John Thornton>
It is being used with permission from John Thornton for inclusion in the HeeksCNC project.
"""
from... | bsd-3-clause |
mitchrule/Miscellaneous | Django_Project/django/Lib/site-packages/django/contrib/messages/storage/fallback.py | 704 | 2172 | from django.contrib.messages.storage.base import BaseStorage
from django.contrib.messages.storage.cookie import CookieStorage
from django.contrib.messages.storage.session import SessionStorage
class FallbackStorage(BaseStorage):
"""
Tries to store all messages in the first backend, storing any unstored
me... | mit |
inorton/junit2html | junit2htmlreport/matrix.py | 1 | 7952 | """
Handle multiple parsed junit reports
"""
from __future__ import unicode_literals
import os
from . import parser
from .common import ReportContainer
from .parser import SKIPPED, FAILED, PASSED, ABSENT
from .render import HTMLMatrix, HTMLReport
UNTESTED = "untested"
PARTIAL_PASS = "partial pass"
PARTIAL_FAIL = "part... | mit |
lokirius/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/integration/TLSSocketServerMixIn.py | 320 | 2203 | """TLS Lite + SocketServer."""
from gdata.tlslite.TLSConnection import TLSConnection
class TLSSocketServerMixIn:
"""
This class can be mixed in with any L{SocketServer.TCPServer} to
add TLS support.
To use this class, define a new class that inherits from it and
some L{SocketServer.TCPServer} (wi... | apache-2.0 |
pluskid/mxnet | python/mxnet/profiler.py | 15 | 1375 | # coding: utf-8
# pylint: disable=fixme, invalid-name, too-many-arguments, too-many-locals, too-many-lines
# pylint: disable=too-many-branches, too-many-statements
"""Profiler setting methods."""
from __future__ import absolute_import
import ctypes
from .base import _LIB, check_call, c_str
def profiler_set_config(mod... | apache-2.0 |
Antiun/odoo | addons/account/edi/__init__.py | 450 | 1062 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
Andy-hpliu/AirtestX | atx/__init__.py | 1 | 1668 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""This module is to make mobile test more easily
"""
from __future__ import absolute_import
import os
import sys
import signal
import pkg_resources
try:
version = pkg_resources.get_distribution("atx").version
except pkg_resources.DistributionNotFound:
version =... | apache-2.0 |
todaychi/hue | desktop/core/ext-py/Pygments-1.3.1/pygments/plugin.py | 74 | 1862 | # -*- coding: utf-8 -*-
"""
pygments.plugin
~~~~~~~~~~~~~~~
Pygments setuptools plugin interface. The methods defined
here also work if setuptools isn't installed but they just
return nothing.
lexer plugins::
[pygments.lexers]
yourlexer = yourmodule:YourLexer
formatter pl... | apache-2.0 |
sestrella/ansible | lib/ansible/plugins/connection/winrm.py | 18 | 30873 | # (c) 2014, Chris Church <chris@ninemoreminutes.com>
# Copyright (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 Core Te... | gpl-3.0 |
erdc-cm/air-water-vv | 2d/numericalTanks/randomWavesFast/ls_n.py | 5 | 2444 | from proteus.default_n import *
import ls_p as physics
from proteus import (StepControl,
TimeIntegration,
NonlinearSolvers,
LinearSolvers,
LinearAlgebraTools)
from proteus.mprans import NCLS
from proteus import Context
ct = Context.get... | mit |
Vassy/odoo | addons/account_payment/account_move_line.py | 66 | 2705 | # -*- 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 |
lisael/pg-django | django/conf/locale/ka/formats.py | 329 | 1888 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i:s a'
DATETIME_FORMAT = 'j F, Y h:i:s a'
YEA... | bsd-3-clause |
dinomyte72/rtbkit | jml/tsne/testing/tsne_python_test.py | 21 | 2253 | import numpy
import pylab as Plot
import sys
from os import getenv
# WARNING: security risk; don't do this for anything that might be installed
sys.path.append(getenv("BIN"))
import tsne
print "numpy version", numpy.version.version
try:
tsne.vectors_to_distances(None)
except:
pass
else:
assert ~"excepti... | apache-2.0 |
sonaht/ansible | lib/ansible/plugins/shell/csh.py | 69 | 1478 | # (c) 2014, Chris Church <chris@ninemoreminutes.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 |
Azure/azure-sdk-for-python | sdk/maintenance/azure-mgmt-maintenance/azure/mgmt/maintenance/operations/_configuration_assignments_operations.py | 1 | 28766 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
aburnap/JMD2015-When-Crowdsourcing-Fails | human_crowds/model.py | 1 | 4057 | #-----------------------------------------------------------------------------
#
# Paper: When Crowdsourcing Fails: A Study of Expertise on Crowdsourced
# Design Evaluation
# Author: Alex Burnap - aburnap@umich.edu
# Date: October 10, 2014
# License: Apache v2
# Descrip... | mit |
ralphbean/moksha | moksha/tests/quickstarts/tg2app/tg2app/model/__init__.py | 2 | 2335 | # -*- coding: utf-8 -*-
"""The application's model objects"""
from zope.sqlalchemy import ZopeTransactionExtension
from sqlalchemy.orm import scoped_session, sessionmaker
#from sqlalchemy import MetaData
from sqlalchemy.ext.declarative import declarative_base
# Global session manager: DBSession() returns the Thread-l... | apache-2.0 |
Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/xml/dom/minidom.py | 77 | 66009 | """\
minidom.py -- a lightweight DOM implementation.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
interface
* SAX 2 namespaces
"""
import xml.dom... | gpl-3.0 |
prosodylab/Prosodylab-Aligner | aligner/__main__.py | 1 | 6425 | # Copyright (c) 2011-2014 Kyle Gorman and Michael Wagner
#
# 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, modify,... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.