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 |
|---|---|---|---|---|---|
szilveszter/django | django/contrib/gis/gdal/tests/test_ds.py | 26 | 11473 | import os
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geometry.test_data import get_ds_file, TestDS, TEST_DATA
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, OGRException, OGRIndexError, GDAL_VERSION
... | bsd-3-clause |
myFengo2015/volatility | volatility/plugins/malware/timers.py | 44 | 7834 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2010, 2011, 2012 Michael Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility 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... | gpl-2.0 |
kubanaltan/pixfc-sse | tools/scripts/compare_timings.py | 2 | 3749 | #!/usr/bin/python
#
# compare_timings.py
#
# Copyright (C) 2011 PixFC Team (pixelfc@gmail.com)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-2.0 |
highco-groupe/odoo | addons/hr_gamification/__openerp__.py | 320 | 1676 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
larsbutler/swift | swift/common/direct_client.py | 4 | 21786 | # Copyright (c) 2010-2012 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
#
# Unless required by applicable law or agree... | apache-2.0 |
maurobaraldi/grab | test/util_module.py | 12 | 2109 | from unittest import TestCase
from grab.util.module import (build_spider_registry, SPIDER_REGISTRY,
load_spider_class)
from grab.spider import Spider
from grab.spider.error import SpiderInternalError
from test.util import TMP_DIR
import os
import sys
class BaseSpider(Spider):
class Me... | mit |
AMOboxTV/AMOBox.LegoBuild | plugin.video.ManiacTV/resources/lib/sources/alluc_mv_tv.py | 20 | 7085 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any l... | gpl-2.0 |
theodoregoetz/wernher | sandbox/KRPC Testing.py | 1 | 3144 | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
%run -i 'KRPC.ipynb'
# <codecell>
conn = krpc.connect(name='laptop', address='192.168.1.9')
ksc = conn.space_center
vessel = ksc.active_vessel
obt = vessel.orbit
ap = vessel.auto_pilot
con = vessel.control
vrf = vessel.reference_frame
srfrf = vessel.... | gpl-3.0 |
dmsimard/ansible | lib/ansible/plugins/action/pause.py | 2 | 10920 | # Copyright 2012, Tim Bielawa <tbielawa@redhat.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later... | gpl-3.0 |
zhufangxing/ndnCDN | src/visualizer/visualizer/base.py | 160 | 3799 | import ns.point_to_point
import ns.csma
import ns.wifi
import ns.bridge
import ns.internet
import ns.mesh
import ns.wimax
import ns.wimax
import ns.lte
import gobject
import os.path
import sys
PIXELS_PER_METER = 3.0 # pixels-per-meter, at 100% zoom level
class PyVizObject(gobject.GObject):
__gtype_name__ = "PyVi... | gpl-2.0 |
elshize/qutebrowser | qutebrowser/utils/javascript.py | 2 | 2703 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
zaccoz/odoo | addons/account_analytic_plans/report/crossovered_analytic.py | 60 | 8953 | # -*- 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 |
riak-synrc/riak_pb | msgcodegen.py | 3 | 6961 | # Copyright 2013 Basho Technologies, Inc.
#
# This file is provided to you 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 |
aabadie/scikit-learn | sklearn/covariance/graph_lasso_.py | 51 | 26432 | """GraphLasso: sparse inverse covariance estimation with an l1-penalized
estimator.
"""
# Author: Gael Varoquaux <gael.varoquaux@normalesup.org>
# License: BSD 3 clause
# Copyright: INRIA
import warnings
import operator
import sys
import time
import numpy as np
from scipy import linalg
from .empirical_covariance_ im... | bsd-3-clause |
liberorbis/libernext | apps/frappe/frappe/utils/backups.py | 27 | 7513 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
"""This module handles the On Demand Backup utility"""
from __future__ import unicode_literals
#Imports
from frappe import _
import os, frappe
from datetime import datetime
from frappe.utils import cstr, get_url
#... | gpl-2.0 |
pandeyadarsh/sympy | sympy/combinatorics/polyhedron.py | 42 | 28379 | from __future__ import print_function, division
from sympy.core import Basic, Tuple
from sympy.sets import FiniteSet
from sympy.core.compatibility import as_int, range
from sympy.combinatorics import Permutation as Perm
from sympy.combinatorics.perm_groups import PermutationGroup
from sympy.utilities.iterables import ... | bsd-3-clause |
saltzm/yadi | yadi/datalog2sql/parse2tokens/parser_tests.py | 1 | 6246 | from .Parser import Parser
p = Parser()
#Tests to check syntax
print(p.parsesentence("q.")) # Atom, zero arity
print(p.parsesentence("q(x).")) # Atom, one var
print(p.parsesentence("q('3').")) # Atom, string
print(p.parse... | bsd-3-clause |
blaisb/cfdemUtilities | cylinderPorosity/pythons/getParticlePositionsFOAM.py | 1 | 2828 | # This program converts OpenFOAM raw data to a text file containing information on the particles
# in the format that can be read by the porosity code
#
# position (x y z) and radius
# THIS PROGRAM REQUIRES A DIRECTORY particles in the main folder
#In the current form of the software the radius must be fixed byu the... | lgpl-3.0 |
travistang/late_fyt | model.py | 1 | 10888 | from keras.models import *
from keras.layers import *
from keras.layers.advanced_activations import *
from keras.callbacks import *
from keras.optimizers import Adam
from keras.initializers import *
import tensorflow as tf
from utils import huber_loss
def guide_v1():
S = Input(shape = (64,64,12))
x = C... | mit |
neobuddy89/android_kernel_cyanogen_msm8916 | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
aachik/flask-blog-abdulmx | env/lib/python2.7/site-packages/markupsafe/_native.py | 1243 | 1187 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... | mit |
mytest-e2/ritest-e2 | lib/python/Components/NetworkTime.py | 35 | 1566 | from Components.Console import Console
from config import config
from enigma import eTimer, eDVBLocalTimeHandler, eEPGCache
from Tools.StbHardware import setRTCtime
from time import time, ctime
# _session = None
#
def AutoNTPSync(session=None, **kwargs):
global ntpsyncpoller
ntpsyncpoller = NTPSyncPoller()
ntpsyncp... | gpl-2.0 |
wgcv/SWW-Crashphone | lib/python2.7/site-packages/django/core/management/commands/createcachetable.py | 55 | 3782 | from optparse import make_option
from django.conf import settings
from django.core.cache import caches
from django.core.cache.backends.db import BaseDatabaseCache
from django.core.management.base import BaseCommand, CommandError
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from djan... | apache-2.0 |
rrussell39/selenium | py/test/selenium/webdriver/common/executing_async_javascript_tests.py | 63 | 10607 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
openstack/nova | nova/tests/unit/scheduler/test_manager.py | 2 | 21731 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
vlukes/sfepy | sfepy/postprocess/probes_vtk.py | 4 | 10771 | """Classes for probing values of Variables, for example, along a line,
using PyVTK library"""
from __future__ import absolute_import
import numpy as nm
import vtk
from vtk.util import numpy_support as vtknm
import os.path as osp
from sfepy.base.base import Struct, output
from sfepy.linalg import make_axis_rotation_ma... | bsd-3-clause |
sn1k/app_mundial | lib/python2.7/site-packages/django/forms/widgets.py | 52 | 31660 | """
HTML Widget classes
"""
from __future__ import unicode_literals
import copy
from itertools import chain
import warnings
from django.conf import settings
from django.forms.utils import flatatt, to_current_timezone
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.deprecation impo... | gpl-2.0 |
krieger-od/nwjs_chromium.src | third_party/typ/typ/tests/stats_test.py | 84 | 2292 | # Copyright 2014 Dirk Pranke. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
talumbau/webapp-public | webapp/apps/taxbrain/migrations/0072_auto_20150314_2144.py | 3 | 1132 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('taxbrain', '0071_auto_20150314_2143'),
]
operations = [
migrations.RenameField(
model_name='taxsaveinputs',
... | mit |
mujiansu/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/xml/dom/xmlbuilder.py | 72 | 12349 | """Implementation of the DOM Level 3 'LS-Load' feature."""
import copy
import xml.dom
from xml.dom.NodeFilter import NodeFilter
__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]
class Options:
"""Features object that has variables set for each DOMBuilder feature.
The DOMBuilder class uses a... | apache-2.0 |
alexteodor/odoo | addons/mail/mail_group.py | 247 | 12877 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
incaser/odoo-odoo | addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py | 374 | 6855 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
TheMOOCAgency/edx-platform | openedx/core/djangoapps/safe_sessions/tests/test_middleware.py | 15 | 12716 | # pylint: disable=no-member
# pylint: disable=protected-access
"""
Unit tests for SafeSessionMiddleware
"""
import ddt
from django.conf import settings
from django.contrib.auth import SESSION_KEY
from django.contrib.auth.models import AnonymousUser
from django.http import HttpResponse, HttpResponseRedirect, SimpleCooki... | agpl-3.0 |
mwcz/pelican-plugins | liquid_tags/test_generation.py | 306 | 3919 | # -*- coding: utf-8 -*-
from __future__ import print_function
import filecmp
import os
import unittest
from shutil import rmtree
from tempfile import mkdtemp
import pytest
from pelican import Pelican
from pelican.settings import read_settings
from .notebook import IPYTHON_VERSION
PLUGIN_DIR = os.path.dirname(__file... | agpl-3.0 |
kostajaitachi/shogun | examples/undocumented/python_modular/features_string_char_compressed_modular.py | 24 | 3676 | #!/usr/bin/env python
parameter_list = [['features_string_char_compressed_modular.py']]
def features_string_char_compressed_modular (fname):
from modshogun import StringCharFeatures, StringFileCharFeatures, RAWBYTE
from modshogun import UNCOMPRESSED,SNAPPY,LZO,GZIP,BZIP2,LZMA, MSG_DEBUG
from modshogun import Decomp... | gpl-3.0 |
kaplun/ops | modules/websubmit/lib/functions/Move_From_Pending.py | 35 | 2030 | ## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your ... | gpl-2.0 |
OpenWinCon/OpenWinNet | web-gui/myvenv/lib/python3.4/site-packages/pip/_vendor/distlib/compat.py | 357 | 38875 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import absolute_import
import os
import re
import sys
if sys.version_info[0] < 3:
from StringIO import StringIO
stri... | apache-2.0 |
nok07635/UnleaZhed_XTZ | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
simongoffin/my_odoo_tutorial | addons/stock_landed_costs/__init__.py | 373 | 1087 | # -*- 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 |
bsmrstu-warriors/Moytri---The-Drone-Aider | LogAnalyzer/tests/TestIMUMatch.py | 14 | 4066 | from LogAnalyzer import Test,TestResult
import DataflashLog
from math import sqrt
class TestIMUMatch(Test):
'''test for empty or near-empty logs'''
def __init__(self):
Test.__init__(self)
self.name = "IMU Mismatch"
def run(self, logdata, verbose):
#tuning parameters:
war... | gpl-3.0 |
bionoid/kivy | kivy/uix/behaviors/__init__.py | 9 | 3531 | '''
Behaviors
=========
.. versionadded:: 1.8.0
Behavior mixin classes
----------------------
This module implements behaviors that can be
`mixed in <https://en.wikipedia.org/wiki/Mixin>`_
with existing base widgets. The idea behind these classes is to encapsulate
properties and events associated with certain types ... | mit |
Validus-Kernel/android_kernel_moto_shamu | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
wummel/linkchecker-gui | linkcheck_gui/syntax.py | 1 | 3578 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2011-2016 Bastian Kleineidam
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later versi... | gpl-3.0 |
simone/django-gb | django/db/models/fields/files.py | 4 | 18658 | import datetime
import os
from django import forms
from django.db.models.fields import Field
from django.core import checks
from django.core.files.base import File
from django.core.files.storage import default_storage
from django.core.files.images import ImageFile
from django.db.models import signals
from django.utils... | bsd-3-clause |
AndKe/MAVProxy | MAVProxy/modules/lib/wxgrapheditor.py | 5 | 2953 | '''
Graphical editing of graph definition
'''
from MAVProxy.modules.lib.wx_loader import wx
from MAVProxy.modules.lib.graphdefinition import GraphDefinition
class GraphDialog(wx.Dialog):
def __init__(self, title, graphdef, callback):
wx.Dialog.__init__(self, None, -1, title, size=(900, 400))
self.... | gpl-3.0 |
boisde/Greed_Island | business_logic/order_collector/transwarp/validate.py | 1 | 2044 | #!/usr/bin/env python
# coding:utf-8
import logging
RECORD_NORMAL = 0
RECORD_DELETED = 1
RECORD_CHOICE = (
(RECORD_NORMAL, u'正常'),
(RECORD_DELETED, u'已删除'),
)
def is_valid_kw(obj, is_update=False, **kw):
mappings = obj.__mappings__
if is_update and kw.get('deleted', None) == RECORD_DELETED:
... | mit |
oVirt/ovirt-node | src/ovirtnode/storage.py | 2 | 49085 | #!/usr/bin/python
# storage.py - Copyright (C) 2010 Red Hat, Inc.
# Written by Joey Boggs <jboggs@redhat.com>
#
# 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 2 of the License.
#
# This... | gpl-2.0 |
praba230890/junction | junction/proposals/templatetags/proposal_filters.py | 3 | 2669 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
# Standard Library
import collections
import re
# Third Party Stuff
from django import template
# Junction Stuff
from junction.proposals.models import (
ProposalComment,
ProposalSectionReviewer,
ProposalSectionReviewerVote,
... | mit |
Rbeuque74/brie-aurore | Brie/brie/websetup.py | 1 | 1479 | # -*- coding: utf-8 -*-
"""Setup the Brie application"""
import logging
import transaction
from tg import config
from brie.config.environment import load_environment
__all__ = ['setup_app']
log = logging.getLogger(__name__)
def setup_app(command, conf, vars):
"""Place any commands to setup brie here"""
l... | bsd-2-clause |
nexdatas/configtool | test/__main__.py | 1 | 4436 | #!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2012-2017 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | gpl-3.0 |
chrisxue815/leetcode_python | problems/test_0093_iterative_post_validate.py | 1 | 1973 | import unittest
class Solution:
def restoreIpAddresses(self, s):
"""
:type s: str
:rtype: List[str]
"""
result = []
slen = len(s)
# [0,p1) [p1,p2) [p2,p3) [p3,slen)
for p1 in range(1, 4):
for p2 in range(p1 + 1, p1 + 4):
f... | unlicense |
papallas/baxter_cashier | scripts/baxter_cashier_manipulation/src/environment_factory.py | 1 | 6798 | #!/usr/bin/env python
"""
Factory for Environments.
This file contains some static classes that represents environments in real
life. If Baxter for example is placed somewhere in a real environment let's
name it "Robotics Lab" then we wish to define obstacles around Baxter in this
specific environment. In... | gpl-3.0 |
fynjah/django-pimp-my-filter | filter_manager/views.py | 1 | 7132 | import datetime
try:
import simplejson as json
except ImportError:
from django.utils import simplejson as json
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.models import User
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseNotFound, HttpResponseForb... | bsd-3-clause |
LaurentClaessens/phystricks | src/MathStructures.py | 1 | 3272 | # -*- coding: utf8 -*-
###########################################################################
# This is part of the module phystricks
#
# phystricks 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... | gpl-3.0 |
mclaughlin6464/pylearn2 | pylearn2/gui/get_weights_report.py | 44 | 11849 | """
.. todo::
WRITEME
"""
import logging
from theano.compat.six.moves import input
from pylearn2.utils import serial
from pylearn2.gui import patch_viewer
from pylearn2.config import yaml_parse
from pylearn2.datasets import control
import numpy as np
from pylearn2.utils.exc import reraise_as
logger = logging... | bsd-3-clause |
jelugbo/hebs_repo | common/djangoapps/third_party_auth/tests/test_pipeline.py | 78 | 1656 | """Unit tests for third_party_auth/pipeline.py."""
import random
from third_party_auth import pipeline, provider
from third_party_auth.tests import testutil
# Allow tests access to protected methods (or module-protected methods) under
# test. pylint: disable-msg=protected-access
class MakeRandomPasswordTest(testu... | agpl-3.0 |
ccomb/OpenUpgrade | addons/account/account_bank.py | 258 | 5481 | # -*- 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 |
xzturn/tensorflow | tensorflow/python/autograph/pyct/origin_info.py | 3 | 9355 | # 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 |
ENCODE-DCC/encoded | src/encoded/tests/test_upgrade_file.py | 1 | 8535 | import pytest
def test_file_upgrade(upgrader, file_1):
value = upgrader.upgrade('file', file_1, target_version='2')
assert value['schema_version'] == '2'
assert value['status'] == 'current'
def test_file_upgrade2(root, upgrader, file_2, file, threadlocals, dummy_request):
context = root.get_by_uuid(... | mit |
ojengwa/django-1 | django/core/paginator.py | 215 | 5037 | import collections
from math import ceil
from django.utils import six
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... | bsd-3-clause |
kenwang815/KodiPlugins | script.module.oceanktv/lib/youtube_dl/extractor/extractors.py | 3 | 24962 | # flake8: noqa
from __future__ import unicode_literals
from .abc import ABCIE
from .abc7news import Abc7NewsIE
from .abcnews import (
AbcNewsIE,
AbcNewsVideoIE,
)
from .academicearth import AcademicEarthCourseIE
from .acast import (
ACastIE,
ACastChannelIE,
)
from .addanime import AddAnimeIE
from .adob... | gpl-2.0 |
ShanghaiTimes/Audacity2015 | lib-src/portmidi/pm_python/pyportmidi/midi.py | 90 | 19419 | """
Module for interacting with midi input and output.
The midi module can send output to midi devices, and get input
from midi devices. It can also list midi devices on the system.
Including real midi devices, and virtual ones.
It uses the portmidi library. Is portable to which ever platforms
portmidi supports (c... | gpl-2.0 |
xiangel/hue | desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/Cipher/common.py | 115 | 16599 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/common.py: Common code for Crypto.SelfTest.Hash
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicat... | apache-2.0 |
alexbrand/kubernetes | hack/update_owners.py | 137 | 9054 | #!/usr/bin/env python
# Copyright 2016 The Kubernetes 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 appli... | apache-2.0 |
Adel-Magebinary/odoo | addons/web/tests/test_menu.py | 303 | 1628 | # -*- coding: utf-8 -*-
import unittest2
from ..controllers import main
class ActionMungerTest(unittest2.TestCase):
def test_actual_treeview(self):
action = {
"views": [[False, "tree"], [False, "form"],
[False, "calendar"]],
"view_type": "tree",
"... | agpl-3.0 |
google-code-export/pyglet | experimental/profile_layout.py | 28 | 9398 | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
from pyglet.ext.layout import *
from pyglet.window import *
window = Window(visible=False)
def print_time(start, msg):
dt = time.time() - start
print '%f\t%s' % (dt, msg)
def profile(xhtml, widths=[800,600,4... | bsd-3-clause |
Obihoernchen/RocketMap | pogom/app.py | 2 | 23343 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import calendar
import logging
from flask import Flask, abort, jsonify, render_template, request,\
make_response
from flask.json import JSONEncoder
from flask_compress import Compress
from datetime import datetime
from s2sphere import LatLng
from pogom.utils import get_ar... | agpl-3.0 |
stefanwebb/tensorflow-models | tensorflow_models/models/vae_normal_obs.py | 1 | 5404 | # MIT License
#
# Copyright (c) 2017, Stefan Webb. All Rights Reserved.
#
# 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 us... | mit |
40123148/w17b | static/Brython3.1.1-20150328-091302/Lib/xml/sax/handler.py | 925 | 13922 | """
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.
Many of these classes are empty and are included only as documentation
of the interfaces.
$Id$
"""
version ... | agpl-3.0 |
scripnichenko/nova | nova/tests/functional/api/client.py | 13 | 12893 | # Copyright (c) 2011 Justin Santa Barbara
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
Leila20/django | tests/admin_registration/tests.py | 46 | 4401 | from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.admin.decorators import register
from django.contrib.admin.sites import site
from django.core.exceptions import ImproperlyConfigured
from django.test import SimpleTestCase
from .models import Location, Person, Place, Traveler... | bsd-3-clause |
lamestation/packthing | packthing/util.py | 1 | 7019 | import errno
import os
import platform
import shutil
import string
import subprocess
import sys
import tarfile
import zipfile
from contextlib import contextmanager
def get_platform():
_platform = dict()
_platform["system"] = platform.system().lower()
machine = platform.machine().lower()
if machine =... | gpl-3.0 |
BondAnthony/ansible | test/units/module_utils/facts/network/test_fc_wwn.py | 54 | 2910 | # -*- coding: utf-8 -*-
# Copyright (c) 2019 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
from ansible.module_utils.facts.network import fc_wwn
from units.compat.mock i... | gpl-3.0 |
schambers/civmarket | civmarket/lib/python2.7/site-packages/django/db/models/query.py | 28 | 69525 | """
The main QuerySet implementation. This provides the public API for the ORM.
"""
import copy
import itertools
import sys
import warnings
from django.conf import settings
from django.core import exceptions
from django.db import connections, router, transaction, DatabaseError
from django.db.models.constants import L... | apache-2.0 |
tklengyel/patchwork | apps/patchwork/views/xmlrpc.py | 1 | 13846 | # Patchwork - automated patch tracking system
# Copyright (C) 2008 Jeremy Kerr <jk@ozlabs.org>
#
# This file is part of the Patchwork package.
#
# Patchwork 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; eith... | gpl-2.0 |
andriisoldatenko/Django-facebook | docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/backwardcompat.py | 33 | 3015 | """Stuff that differs in different Python versions"""
import sys
import os
import shutil
__all__ = ['any', 'WindowsError', 'md5', 'copytree']
try:
WindowsError = WindowsError
except NameError:
class NeverUsedException(Exception):
"""this exception should never be raised"""
WindowsError = NeverUse... | bsd-3-clause |
myfavouritekk/TPN | src/tpn/recurrent_extract_features.py | 1 | 5385 | #!/usr/bin/env python
import os
import os.path as osp
import numpy as np
import tensorflow as tf
from model import TPNModel
import argparse
import glog as log
import glob
from data_io import tpn_test_iterator
import cPickle
def bbox_transform_inv(boxes, deltas):
if boxes.shape[0] == 0:
return np.zeros((0,... | mit |
sloria/osf.io | addons/s3/utils.py | 18 | 4323 | import re
import httplib
from boto import exception
from boto.s3.connection import S3Connection
from boto.s3.connection import OrdinaryCallingFormat
from framework.exceptions import HTTPError
from addons.base.exceptions import InvalidAuthError, InvalidFolderError
from addons.s3.settings import BUCKET_LOCATIONS
def ... | apache-2.0 |
TeamEOS/external_chromium_org | tools/perf/measurements/loading_measurement_analyzer.py | 43 | 7062 | #!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Parses CSV output from the loading_measurement and outputs interesting stats.
Example usage:
$ tools/perf/run_measurement --browser... | bsd-3-clause |
maddabini/robotframework-selenium2library | src/Selenium2Library/keywords/_waiting.py | 37 | 3039 | import time
import robot
from keywordgroup import KeywordGroup
class _WaitingKeywords(KeywordGroup):
# Public
def wait_for_condition(self, condition, timeout=None, error=None):
"""Waits until the given `condition` is true or `timeout` expires.
`code` may contain multiple lines of code but mu... | apache-2.0 |
TeamExodus/external_chromium_org | tools/memory_inspector/memory_inspector/frontends/background_tasks.py | 35 | 5318 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Background tasks for the www_server module.
This module has the logic for handling background tasks for the www frontend.
Long term actions (like periodi... | bsd-3-clause |
JeanFred/carbon | lib/carbon/tests/test_aggregator_rules.py | 13 | 1625 | import os
import unittest
from carbon.aggregator.rules import AggregationRule
class AggregationRuleTest(unittest.TestCase):
def test_inclusive_regexes(self):
"""
Test case for https://github.com/graphite-project/carbon/pull/120
Consider the two rules:
aggregated.hist.p99 (... | apache-2.0 |
sinkuri256/python-for-android | python-build/python-libs/gdata/src/gdata/urlfetch.py | 276 | 9330 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... | apache-2.0 |
mrbox/django | django/views/decorators/csrf.py | 586 | 2202 | from functools import wraps
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import available_attrs, decorator_from_middleware
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds... | bsd-3-clause |
volpino/Yeps-EURAC | scripts/metagenomics/convert_title.py | 2 | 1094 | #! /usr/bin/python
"""
convert nt and wgs data (fasta format) to giNumber_seqLen
run formatdb in the command line: gunzip -c nt.gz |formatdb -i stdin -p F -n "nt.chunk" -v 2000
"""
import os, sys, math
if __name__ == '__main__':
seq = []
len_seq = 0
invalid_lines = 0
for i, line in enumera... | mit |
florian-dacosta/OCB | addons/point_of_sale/report/pos_receipt.py | 380 | 3100 | # -*- 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 |
CiuffysHub/MITMf | mitmflib-0.18.4/mitmflib/impacket/krb5/crypto.py | 2 | 25799 | # Copyright (C) 2013 by the Massachusetts Institute of Technology.
# 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... | gpl-3.0 |
hterkelsen/mal | python/stepA_mal.py | 6 | 5838 | import sys, traceback
import mal_readline
import mal_types as types
import reader, printer
from env import Env
import core
# read
def READ(str):
return reader.read_str(str)
# eval
def is_pair(x):
return types._sequential_Q(x) and len(x) > 0
def quasiquote(ast):
if not is_pair(ast):
return types._... | mpl-2.0 |
Asana/boto | boto/vpc/subnet.py | 168 | 2101 | # Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
glennyonemitsu/MarkupHiveSDK | werkzeug/contrib/profiler.py | 91 | 3969 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.profiler
~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the :mod:`profile` or
:mod:`cProfile` module to do the profiling and writes the stats to the
stream provide... | mit |
microcom/odoo | addons/website_customer/models/website_customer.py | 44 | 1220 | # -*- coding: utf-8 -*-
from openerp.osv import osv, fields
class res_partner(osv.Model):
_inherit = 'res.partner'
_columns = {
'website_tag_ids': fields.many2many('res.partner.tag', id1='partner_id', id2='tag_id', string='Website tags', oldname="tag_ids"),
}
class res_partner_tags(osv.Model):... | agpl-3.0 |
razisayyed/django-ads | ads/conf.py | 1 | 1926 | from django.conf import settings
from appconf import AppConf
from django.utils.translation import ugettext_lazy as _
gettext = lambda s: s
class AdsConf(AppConf):
class Meta:
prefix = 'ads'
GOOGLE_ADSENSE_CLIENT = None # 'ca-pub-xxxxxxxxxxxxxxxx'
ZONES = {
'header': {
'na... | apache-2.0 |
Euphoria-OS-Devices/android_kernel_lge_msm8974 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
Vocalocity/sippy | sippy/SipReplaces.py | 2 | 2867 | # Copyright (c) 2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gpl-2.0 |
0x73/rust | src/etc/lldb_rust_formatters.py | 3 | 8302 | # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://... | apache-2.0 |
h4ck3rm1k3/FEC-Field-Documentation | fec/version/v6_4/F5.py | 5 | 1991 | import fechbase
class Records(fechbase.RecordsBase):
def __init__(self):
fechbase.RecordsBase.__init__(self)
self.fields = [
{'name': 'FORM TYPE', 'number': '1'},
{'name': "FILER'S FEC ID NUMBER", 'number': '2'},
{'name': 'ENTITY TYPE', 'number': '3'},
... | unlicense |
hdinsight/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/thumbnail.py | 135 | 31736 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This contains a 128x128 px thumbnail in PNG format
# Taken from http://www.zwahlendesign.ch/en/node/20
# openoffice_icons/openoffice_icons_linux/openoffice11.png
# License: Freeware
import base64
iconstr = """\
iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAAG0OVFdAAAABGdBTUEAANbY1E9Y... | apache-2.0 |
akihikot/fabric | bddtests/steps/orderer_impl.py | 6 | 3116 |
# Copyright IBM Corp. 2016 All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
Sylrob434/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/addanime.py | 14 | 3065 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_HTTPError,
compat_str,
compat_urllib_parse,
compat_urllib_parse_urlparse,
ExtractorError,
)
class AddAnimeIE(InfoExtractor):
_VALID_URL = r'^http://(?:\w+\.)?add-anime\.net/watc... | gpl-3.0 |
shikhar413/openmc | openmc/data/urr.py | 9 | 7404 | from collections.abc import Iterable
from numbers import Integral, Real
import numpy as np
import openmc.checkvalue as cv
from openmc.mixin import EqualityMixin
from .data import EV_PER_MEV
class ProbabilityTables(EqualityMixin):
r"""Unresolved resonance region probability tables.
Parameters
----------... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.