repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
garverp/gnuradio
gr-blocks/python/blocks/qa_vector_map.py
47
3902
#!/usr/bin/env python # # Copyright 2012,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your optio...
gpl-3.0
matt-kwong/grpc
src/python/grpcio_tests/tests/stress/test_runner.py
17
2021
# Copyright 2016 gRPC 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 law or agreed to in writing...
apache-2.0
sinanm89/fabfile
fabfile.py
1
5586
from fabric.api import * from fabric.contrib.files import exists from fabric.utils import puts from fabtools.vagrant import vagrant from fabtools import require, fabtools import hashlib @task def setup(vagrant=False): """ I have no strings attached. """ if vagrant: puts("--------STARTING IN V...
mit
gymnasium/edx-platform
openedx/core/djangoapps/credit/tests/test_views.py
9
30675
""" Tests for credit app views. """ # pylint: disable=no-member from __future__ import unicode_literals import datetime import json import ddt import pytz from django.conf import settings from django.urls import reverse from django.test import TestCase, Client from django.test.utils import override_settings from ed...
agpl-3.0
JoyTeam/metagam
mg/test/testorm-2.py
1
1140
#!/usr/bin/python2.6 # -*- coding: utf-8 -*- # This file is a part of Metagam project. # # Metagam 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 # any later version. # #...
gpl-3.0
Br1an6/ACS_Netplumber_Implementation
hassel-c/net_plumbing/headerspace/test/test_headerspace.py
6
5203
''' Created on Jul 2, 2012 @author: peymank ''' import unittest from utils.wildcard import wildcard_create_from_string from headerspace.hs import headerspace class Test(unittest.TestCase): def testCreate(self): ''' Test if creating a headerspace object creates correct number of bytearray...
gpl-2.0
mopemope/jega
jega/ext/jssl.py
1
14992
# # This file is part of Evergreen. See the NOTICE for more information. # from __future__ import absolute_import import errno import sys from jega import is_py3, is_py33, exc_clear from jega.ext.jsocket import socket, _fileobject from jega.ext.jsocket import error as socket_error, timeout as socket_timeout from jeg...
bsd-3-clause
abhattad4/Digi-Menu
digimenu2/django/db/models/functions.py
84
4733
""" Classes that represent database functions. """ from django.db.models import IntegerField from django.db.models.expressions import Func, Value class Coalesce(Func): """ Chooses, from left to right, the first non-null expression and returns it. """ function = 'COALESCE' def __init__(self, *expr...
bsd-3-clause
drpngx/tensorflow
tensorflow/contrib/cluster_resolver/__init__.py
28
1721
# 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
alblue/swift-corelibs-foundation
lib/phases.py
1
17578
# This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See http://swift.org/LICENSE.txt for license information # See http://swift.org/CONTRIBUTORS.txt for the list of ...
apache-2.0
BanzaiTokyo/akihabara-tokyo
askapp/admin.py
1
4646
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.db import models from markdownx.widgets import AdminMarkdownxWidget from askapp.models import Profile, UserLevel, Thread, Tag, Post, ThreadLike from django.db.models import Value, Cha...
apache-2.0
batermj/algorithm-challenger
code-analysis/programming_anguage/python/source_codes/Python3.8.0/Python-3.8.0/Lib/lib2to3/fixes/fix_itertools_imports.py
202
2086
""" Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """ # Local imports from lib2to3 import fixer_base from lib2to3.fixer_util import BlankLine, syms, token class FixItertoolsImports(fixer_base.BaseFix): BM_compatible = True PATTERN = """ import_from< 'from' 'itertools' 'import'...
apache-2.0
billyhunt/osf.io
tests/test_registrations/base.py
26
2371
import datetime as dt from modularodm import Q from framework.auth import Auth from website.util import permissions from website.models import MetaSchema from website.project.model import ensure_schemas from tests.base import OsfTestCase from tests.factories import AuthUserFactory, ProjectFactory, DraftRegistration...
apache-2.0
will-moore/openmicroscopy
components/tools/OmeroPy/test/integration/gatewaytest/test_image_wrapper.py
9
4916
# -*- coding: utf-8 -*- # Copyright (C) 2015 Glencoe Software, Inc. # All rights reserved. # # Use is subject to license terms supplied in LICENSE.txt """ gateway tests - Testing the gateway image wrapper pytest fixtures used as defined in conftest.py: - gatewaywrapper """ import pytest from library impor...
gpl-2.0
chemelnucfin/tensorflow
tensorflow/python/autograph/converters/lists.py
30
8339
# 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
Kaffa-MY/docker
vendor/src/github.com/hashicorp/go-msgpack/codec/msgpack_test.py
1232
3478
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). import msgpack, msgpackrpc, sys, os, threading def get_test_data_list(): # get list with all primitive typ...
apache-2.0
bigbiff/android_kernel_samsung_hlte
tools/perf/python/twatch.py
7370
1334
#! /usr/bin/python # -*- python -*- # -*- coding: utf-8 -*- # twatch - Experimental use of the perf python interface # Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com> # # This application is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License...
gpl-2.0
xydinesh/webdev
jinja2/testsuite/filters.py
74
13236
# -*- coding: utf-8 -*- """ jinja2.testsuite.filters ~~~~~~~~~~~~~~~~~~~~~~~~ Tests for the jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Markup, Environment en...
apache-2.0
sajeeshcs/nested_quota_latest
nova/tests/unit/virt/vmwareapi/test_io_util.py
94
1218
# Copyright (c) 2014 VMware, 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 a...
apache-2.0
wkentaro/fcn
fcn/external/fcn.berkeleyvision.org/voc-fcn16s/net.py
1
3346
import caffe from caffe import layers as L, params as P from caffe.coord_map import crop def conv_relu(bottom, nout, ks=3, stride=1, pad=1): conv = L.Convolution(bottom, kernel_size=ks, stride=stride, num_output=nout, pad=pad, param=[dict(lr_mult=1, decay_mult=1), dict(lr_mult=2, decay_mult=0)]) ...
mit
you21979/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/performance_tests/perftestsrunner_unittest.py
119
12170
# Copyright (C) 2012 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 ...
bsd-3-clause
Dhivyap/ansible
test/units/modules/network/fortios/test_fortios_router_ripng.py
21
7215
# Copyright 2019 Fortinet, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
gpl-3.0
ListFranz/tornado
demos/benchmark/chunk_benchmark.py
98
1568
#!/usr/bin/env python # # Downloads a large file in chunked encoding with both curl and simple clients import logging from tornado.curl_httpclient import CurlAsyncHTTPClient from tornado.simple_httpclient import SimpleAsyncHTTPClient from tornado.ioloop import IOLoop from tornado.options import define, options, parse_...
apache-2.0
EduPepperPD/pepper2013
common/djangoapps/cache_toolbox/core.py
19
3477
""" Core methods ------------ .. autofunction:: cache_toolbox.core.get_instance .. autofunction:: cache_toolbox.core.delete_instance .. autofunction:: cache_toolbox.core.instance_key """ from django.core.cache import cache from django.db import DEFAULT_DB_ALIAS from . import app_settings def get_instance(model, i...
agpl-3.0
quheng/scikit-learn
sklearn/tests/test_dummy.py
186
17778
from __future__ import division import numpy as np import scipy.sparse as sp from sklearn.base import clone from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_almost_eq...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/242_test_codecmaps_cn.py
15
1062
#!/usr/bin/env python # # test_codecmaps_cn.py # Codec mapping tests for PRC encodings # # $CJKCodecs: test_codecmaps_cn.py,v 1.3 2004/06/19 06:09:55 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class TestGB2312Map(test_multibytecodec_support.TestBase_Mappin...
gpl-3.0
Haynie-Research-and-Development/jarvis
deps/lib/python3.4/site-packages/Cryptodome/Hash/RIPEMD.py
7
1211
# -*- coding: utf-8 -*- # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, # non-exclusive license to e...
gpl-2.0
Lekensteyn/Solaar
lib/solaar/tasks.py
4
1847
#!/usr/bin/env python # -*- python-mode -*- # -*- coding: UTF-8 -*- ## Copyright (C) 2012-2013 Daniel Pavel ## ## 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 Licens...
gpl-2.0
shinyChen/browserscope
test/test_admin_rankers.py
9
5821
#!/usr/bin/python2.5 # # Copyright 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the 'License') # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
UQ-UQx/edx-platform_lti
common/djangoapps/track/views/tests/test_views.py
24
8565
# pylint: disable=missing-docstring,maybe-no-member from track import views from track.middleware import TrackMiddleware from mock import patch, sentinel from freezegun import freeze_time from django.test import TestCase from django.test.client import RequestFactory from eventtracking import tracker from datetime i...
agpl-3.0
CyanogenMod/android_external_chromium_org
build/android/pylib/symbols/elf_symbolizer.py
8
17340
# 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. import collections import datetime import logging import multiprocessing import os import posixpath import Queue import re import subprocess import sys impor...
bsd-3-clause
mancoast/CPythonPyc_test
cpython/266_test_sax.py
58
24149
# regression test for SAX 2.0 -*- coding: iso-8859-1 -*- # $Id: test_sax.py 61997 2008-03-28 07:36:31Z neal.norwitz $ from xml.sax import make_parser, ContentHandler, \ SAXException, SAXReaderNotAvailable, SAXParseException try: make_parser() except SAXReaderNotAvailable: # don't...
gpl-3.0
Nik0las1984/mudpyl
mudpyl/tests/test_mudconnect.py
1
2013
from __future__ import with_statement from mudpyl.mudconnect import main from mudpyl.modules import BaseModule from mock import Mock, _importer, patch, sentinel from contextlib import contextmanager, nested @contextmanager def patched(target, attribute, new = None): if isinstance(target, basestring): targe...
gpl-2.0
taotie12010/bigfour
common/lib/i18n/tests/test_extract_and_generate.py
121
4581
""" This test tests that i18n extraction (`paver i18n_extract -v`) works properly. """ from datetime import datetime, timedelta import os import random import re import sys import string import subprocess from unittest import TestCase from mock import patch from polib import pofile from pytz import UTC from i18n impo...
agpl-3.0
exu0/play-streams
play-stream.py
1
3987
# -*- coding: utf-8 -*- from gi.repository import GObject from gi.repository import Gst import gst import sys import gobject import os import requests import ConfigParser import StringIO def getURLsFromPLS(fp): out = [] config = ConfigParser.ConfigParser() try: config.readfp(fp) section = ...
mit
jazzband/django-sorter
docs/conf.py
3
7490
# -*- coding: utf-8 -*- # # django-sorter documentation build configuration file, created by # sphinx-quickstart on Thu Sep 1 19:29:09 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
bsd-3-clause
lasting-yang/shadowsocks
tests/coverage_server.py
1072
1655
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
kholidfu/django
django/conf/__init__.py
135
7622
""" Settings and configuration for Django. Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment variable, and then from django.conf.global_settings; see the global settings file for a list of all possible variables. """ import importlib import os import time import warnings from dj...
bsd-3-clause
MOSAIC-UA/802.11ah-ns3
ns-3/src/wimax/bindings/modulegen__gcc_LP64.py
19
773543
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
ximenesuk/openmicroscopy
components/tools/OmeroPy/test/gatewaytest/test_chgrp.py
4
11908
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright (C) 2012 University of Dundee & Open Microscopy Environment. All Rights Reserved. Copyright 2013 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt pytest fixtures used as def...
gpl-2.0
pearsonlab/thunder
thunder/factorization/svd.py
8
5347
""" Class for performing Singular Value Decomposition """ from numpy import zeros, shape from thunder.utils.common import checkParams from thunder.rdds.series import Series from thunder.rdds.matrices import RowMatrix class SVD(object): """ Singular value decomposition on a distributed matrix. Parameter...
apache-2.0
wu-ty/LINE_PROJECT
feedreader/admin.py
1
1601
from __future__ import absolute_import from django.contrib import admin from .models import Options, Group, Feed, Entry class OptionsAdmin(admin.ModelAdmin): list_display = ['number_initially_displayed', 'number_additionally_displayed', 'max_entries_saved'] admin.site.register(Options, OptionsAdmin) class G...
bsd-3-clause
mleist/gttg
gttg/users/views.py
1
1469
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.views.generic import DetailView, ListView, RedirectView, UpdateView from django.contrib.auth.mixins import LoginRequiredMixin from gttg.users.models import User class UserDetail...
mit
nouiz/pylearn2
pylearn2/sandbox/cuda_convnet/tests/test_image_acts_strided.py
44
6169
from __future__ import print_function __authors__ = "Heng Luo" from pylearn2.testing.skip import skip_if_no_gpu skip_if_no_gpu() import numpy as np from theano.compat.six.moves import xrange from theano import shared from theano.tensor import grad, constant from pylearn2.sandbox.cuda_convnet.filter_acts import Filter...
bsd-3-clause
maxhawkins/random_diet_club
lib/jinja2/nodes.py
3
28988
# -*- coding: utf-8 -*- """ jinja2.nodes ~~~~~~~~~~~~ This module implements additional nodes derived from the ast base node. It also provides some node tree helper functions like `in_lineno` and `get_nodes` used by the parser and translator in order to normalize python and jinja nodes. :...
apache-2.0
eciis/web
backend/handlers/user_handler.py
1
3844
# -*- coding: utf-8 -*- """User Handler.""" import json from models import Invite, RequestUser from utils import Utils from util import login_required from models import User from utils import json_response from models import InstitutionProfile from service_messages import send_message_notification from util import J...
gpl-3.0
ahmadiga/min_edx
common/djangoapps/student/migrations/0021_remove_askbot.py
188
11582
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models ASKBOT_AUTH_USER_COLUMNS = ( 'website', 'about', 'gold', 'email_isvalid', 'real_name', 'location', 'reputation', 'gravatar', 'bronze', 'last_seen', ...
agpl-3.0
trishnaguha/ansible
test/units/playbook/test_taggable.py
64
4326
# (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
skg-net/ansible
lib/ansible/modules/cloud/misc/rhevm.py
4
51120
#!/usr/bin/python # (c) 2016, Timothy Vandenbrande <timothy.vandenbrande@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
wangjun/wakatime
wakatime/packages/requests/packages/urllib3/poolmanager.py
678
9406
import logging try: # Python 3 from urllib.parse import urljoin except ImportError: from urlparse import urljoin from ._collections import RecentlyUsedContainer from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool from .connectionpool import port_by_scheme from .exceptions import LocationValue...
bsd-3-clause
sebadiaz/kafka
tests/kafkatest/tests/client/consumer_rolling_upgrade_test.py
23
4200
# 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 use ...
apache-2.0
anilmuthineni/tensorflow
tensorflow/contrib/rnn/python/kernel_tests/rnn_cell_test.py
5
36106
# 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...
apache-2.0
kernsuite-debian/lofar
CEP/GSM/bremen/src/updater.py
1
1810
#!/usr/bin/env python3 from src.sqllist import get_sql _UPDATER_EXTRAS = { 'runningcatalog': ['runcatid'], 'runningcatalog_fluxes': ['runcat_id', 'band', 'stokes'], } def _refactor_update(sql): """ Special refactoring for MonetDB update..from imitation. """ def _get_extra_conditions(tabname):...
gpl-3.0
dscotese/bitcoin
test/functional/feature_abortnode.py
35
1685
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoind aborts if can't disconnect a block. - Start a single node and generate 3 blocks. - Delet...
mit
atareao/Touchpad-Indicator
src/preferences_dialog.py
1
46119
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of Touchpad-Indicator # # Copyright (C) 2010-2019 Lorenzo Carbonell<lorenzo.carbonell.cerezo@gmail.com> # Copyright (C) 2010-2012 Miguel Angel Santamaría Rogado<leibag@gmail.com> # # This program is free software: you can redistribute it and/or modify...
gpl-3.0
maartenq/ansible
lib/ansible/modules/storage/netapp/na_elementsw_volume_clone.py
9
8961
#!/usr/bin/python # (c) 2018, NetApp, Inc # GNU General Public License v3.0+ (see COPYING or # https://www.gnu.org/licenses/gpl-3.0.txt) """Element Software volume clone""" from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
Ensembles/ert
python/python/ert_gui/shell/gen_kw_keys.py
4
1222
from ert_gui.shell import ShellPlot, assertConfigLoaded, ErtShellCollection from ert_gui.plottery import PlotDataGatherer as PDG class GenKWKeys(ErtShellCollection): def __init__(self, parent): super(GenKWKeys, self).__init__("gen_kw", parent) self.addShellFunction(name="list", function=GenKWKeys....
gpl-3.0
jbasko/configmanager
configmanager/schema_parser.py
1
2942
import collections.abc import inspect import six from .base import BaseItem, BaseSection def parse_config_schema(schema, parent_section=None, root=None): if root: parent_section = root is_valid_config_root_schema = ( inspect.ismodule(schema) or ( ...
mit
shoopio/shoop
shuup/campaigns/admin_module/views/_list.py
2
5132
# This file is part of Shuup. # # Copyright (c) 2012-2019, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from babel.dates import format_datetime from django.utils.timezone import localtime from d...
agpl-3.0
kergoth/OE-Signatures
lib/test_reftracker.py
1
11663
#!/usr/bin/env python import unittest import sys import os basedir = os.path.dirname(os.path.abspath(os.path.dirname(__file__))) oedir = os.path.dirname(basedir) searchpath = [os.path.join(basedir, "lib"), os.path.join(oedir, "openembedded", "lib"), os.path.join(oedir, "bitbake", "lib")] s...
mit
devinplatt/ms-thesis
tfrecords/make_tfrecords.py
1
9468
""" This script creates TFRecords from FMA mp3 files. To run more quickly, it uses multiprocessing. To save space, it uses ZLIB compression. Due to laziness, the directory with FMA audio files (fma_large_dir) is a hard-coded string rather than a command line argument. To run this script, one needs to download the fma...
mit
JSansalone/VirtualBox4.1.18
src/VBox/Additions/common/crOpenGL/DD_glc.py
17
3289
print """ /** @file * VBox OpenGL chromium functions header */ /* * Copyright (C) 2009-2010 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of t...
gpl-2.0
bboalimoe/ndn-cache-policy
bindings/callbacks_list.py
16
1400
callback_classes = [ ['void', 'ns3::Ptr<ns3::ndn::Name const>', 'ns3::Ptr<ns3::ndn::Interest const>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3...
gpl-3.0
JamesMura/sentry
src/sentry/south_migrations/0177_fill_member_counters.py
34
36807
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): from sentry.utils.query import RangeQuerySetWrapperWithProgressBar Organizati...
bsd-3-clause
raymondnijssen/QGIS
python/plugins/processing/algs/gdal/GridInverseDistanceNearestNeighbor.py
5
9167
# -*- coding: utf-8 -*- """ *************************************************************************** GridInverseDistanceNearestNeighbor.py --------------------- Date : September 2017 Copyright : (C) 2017 by Alexander Bruy Email : alexander dot bruy at gm...
gpl-2.0
yinquan529/platform-external-chromium_org-tools-grit
grit/format/rc_header_unittest.py
9
6724
#!/usr/bin/env python # 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. '''Unit tests for the rc_header formatter''' # GRD samples exceed the 80 character limit. # pylint: disable-msg=C6310 import os i...
bsd-2-clause
sklnet/openhdf-enigma2
lib/python/Plugins/Extensions/PluginHider/plugin.py
11
3311
from __future__ import print_function from . import _ # Plugin definition from Plugins.Plugin import PluginDescriptor from Components.PluginComponent import PluginComponent from Components.config import config, ConfigSubsection, ConfigSet from PluginHiderSetup import PluginHiderSetup from operator import attrgette...
gpl-2.0
HyShai/youtube-dl
youtube_dl/extractor/vine.py
25
3373
from __future__ import unicode_literals import re import json import itertools from .common import InfoExtractor from ..utils import unified_strdate class VineIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?vine\.co/v/(?P<id>\w+)' _TEST = { 'url': 'https://vine.co/v/b9KOOWX7HUx', 'md5':...
unlicense
insidenothing/3D-Printing-Software
skein_engines/skeinforge-35/fabmetheus_utilities/fabmetheus_tools/interpret_plugins/stl.py
6
5252
""" This page is in the table of contents. The stl.py script is an import translator plugin to get a carving from an stl file. An import plugin is a script in the interpret_plugins folder which has the function getCarving. It is meant to be run from the interpret tool. To ensure that the plugin works on platforms wh...
gpl-2.0
christianurich/VIBe2Modules
scripts/__modules/whitenoise2.py
1
1771
""" @file @author Chrisitan Urich <christian.urich@gmail.com> @version 1.0 @section LICENSE This file is part of VIBe2 Copyright (C) 2011 Christian Urich 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 Founda...
gpl-2.0
RiccardoPecora/MP
Lib/xml/dom/xmlbuilder.py
64
12723
"""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 DOMBuilde...
gpl-3.0
blade2005/dosage
dosagelib/plugins/comicgenesis.py
1
5725
# -*- coding: utf-8 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2015-2016 Tobias Gruetzmacher from __future__ import absolute_import, division, print_function from re import compile from ..scraper import _BasicScraper from ..util im...
mit
tushtu/bharatham
splitaudio.py
1
1047
#!/usr/bin/env python # Adapted from https://stackoverflow.com/questions/25120363/python-multiprocessing-execute-external-command-and-wait-before-proceeding from multiprocessing import Pool import subprocess import shlex import pysrt video = '../Bharatham.mp4' srt = 'Bharatham.srt' def split(cmd): p = subproces...
mit
peerster/CouchPotatoServer
libs/tornado/platform/auto.py
139
1599
#!/usr/bin/env python # # Copyright 2011 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...
gpl-3.0
maxamillion/openshift-ansible
roles/lib_utils/library/swapoff.py
43
3783
#!/usr/bin/env python # pylint: disable=missing-docstring # # Copyright 2017 Red Hat, Inc. and/or its affiliates # and other contributors as indicated by the @author tags. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obt...
apache-2.0
dulems/hue
desktop/core/ext-py/Django-1.6.10/tests/serializers/models.py
109
2914
# -*- coding: utf-8 -*- """ 42. Serialization ``django.core.serializers`` provides interfaces to converting Django ``QuerySet`` objects to and from "flat" data (i.e. strings). """ from __future__ import unicode_literals from decimal import Decimal from django.db import models from django.utils import six from django...
apache-2.0
cldershem/osf.io
website/addons/dataverse/tests/test_views.py
29
16116
# -*- coding: utf-8 -*- import nose from nose.tools import * # noqa import mock import httplib as http from tests.factories import AuthUserFactory from dataverse.exceptions import UnauthorizedError from framework.auth.decorators import Auth from website.util import api_url_for from website.addons.dataverse.serial...
apache-2.0
denisff/python-for-android
python-build/python-libs/gdata/tests/gdata_tests/photos_test.py
133
2360
#!/usr/bin/python # # Copyright (C) 2006 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
tedder/ansible
lib/ansible/module_utils/facts/virtual/hpux.py
199
2486
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
gcodetogit/depot_tools
third_party/gsutil/gslib/commands/setdefacl.py
51
3990
# Copyright 2011 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
bsd-3-clause
mnahm5/django-estore
Lib/site-packages/django/db/models/sql/where.py
76
17910
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import collections import datetime import warnings from itertools import repeat from django.conf import settings from django.db.models.fields import DateTimeField, Field from django.db.models.sql.datastructures import Empty, EmptyResultSet ...
mit
rikirenz/inspire-next
tests/unit/utils/test_utils_export.py
3
10867
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
gpl-3.0
infoburp/8get
get.py
1
1279
import urllib.request, urllib.parse, urllib.error, os, re, glob board = input('Enter board e.g. "b":') if board=='': board='b' thread = input('Enter thread e.g. "527104":') if thread=='': thread='527104' thumbs = input('Download thumbs(return), or full(y, or anything else):') url='https://8chan.co/'+board+'/res/'+thr...
gpl-2.0
kyleabeauchamp/HMCNotes
code/correctness/old/test_john_hmc.py
1
1318
import lb_loader import pandas as pd import simtk.openmm.app as app import numpy as np import simtk.openmm as mm from simtk import unit as u from openmmtools import hmc_integrators, testsystems sysname = "ljbox" system, positions, groups, temperature, timestep = lb_loader.load(sysname) integrator = hmc_integrators.G...
gpl-2.0
maciek263/django2
myvenv/Lib/site-packages/django/utils/daemonize.py
169
2046
import os import sys from . import six buffering = int(six.PY3) # No unbuffered text I/O on Python 3 (#20815). if os.name == 'posix': def become_daemon(our_home_dir='.', out_log='/dev/null', err_log='/dev/null', umask=0o022): "Robustly turn into a UNIX daemon, running in our_...
mit
Vogeltak/pauselan
lib/python3.4/site-packages/tornado/test/escape_test.py
117
11251
#!/usr/bin/env python from __future__ import absolute_import, division, print_function, with_statement import tornado.escape from tornado.escape import utf8, xhtml_escape, xhtml_unescape, url_escape, url_unescape, to_unicode, json_decode, json_encode, squeeze, recursive_unicode from tornado.util import u, unicode_ty...
gpl-2.0
drmrd/ansible
lib/ansible/modules/net_tools/nios/nios_network.py
3
6931
#!/usr/bin/python # Copyright (c) 2018 Red Hat, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview...
gpl-3.0
nikhilprathapani/python-for-android
python3-alpha/python3-src/Lib/distutils/tests/test_cygwinccompiler.py
147
5671
"""Tests for distutils.cygwinccompiler.""" import unittest import sys import os from io import BytesIO import subprocess from test.support import run_unittest from distutils import cygwinccompiler from distutils.cygwinccompiler import (CygwinCCompiler, check_config_h, CONFIG_H_OK...
apache-2.0
JimCircadian/ansible
lib/ansible/modules/network/system/net_system.py
104
3068
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Ansible by Red Hat, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
keithhamilton/blackmaas
lib/python2.7/encodings/iso2022_jp_2.py
816
1061
# # iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_2') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class Incrementa...
bsd-3-clause
Vixionar/django
django/contrib/contenttypes/views.py
380
3608
from __future__ import unicode_literals from django import http from django.apps import apps from django.contrib.contenttypes.models import ContentType from django.contrib.sites.requests import RequestSite from django.core.exceptions import ObjectDoesNotExist from django.utils.translation import ugettext as _ def sh...
bsd-3-clause
pwong-mapr/private-hue
apps/search/src/search/migrations/0002_auto__del_core__add_collection.py
39
4305
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting model 'Core' db.delete_table('search_core') # Adding model 'Collection' db.create_tabl...
apache-2.0
bbusemeyer/busempyer
busempyer/fit_tools.py
2
12588
''' Convenience tools for simple and quick fitting. ''' from inspect import getargspec from scipy.optimize import curve_fit import numpy as np ### Fitting tools. class FitFunc: """ Define a function that can be fit to and plotted with. """ def __init__(self,form,jacobian=None,pnames=[]): self.form = form...
gpl-2.0
wengole/nasman
nasman/snapshots/admin.py
1
1322
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from sitetree.admin import TreeItemAdmin, override_item_admin from .models import File, IconMapping from .forms import FileForm @admin.register(File) class FileAdmin(admin.ModelAdmin): list_display = ('original_path', 'snaps...
bsd-3-clause
trangel/OPTpy
examples/single-tasks/response.py
1
1607
from OPTpy import RESPONSEflow flow = RESPONSEflow( dirname="05-sigma", prefix="gaas", # lt="total", # Total number of bands in the NSCF calculation: nband=36, # Total number fo valence bands: nval_total=8, # Number of valence and conduction bands to compute the response: # These could be less than t...
gpl-3.0
simonmulser/bitcoin
share/qt/extract_strings_qt.py
95
2709
#!/usr/bin/env python # Copyright (c) 2012-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Extract _("...") strings for translation and convert to Qt stringdefs so that they can be picked up by ...
mit
pekeler/arangodb
3rdParty/V8-4.3.61/build/gyp/test/actions/gyptest-all.py
243
3677
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies simple actions when using an explicit build target of 'all'. """ import glob import os import TestGyp test = TestGyp.TestGyp(...
apache-2.0
erickt/hue
desktop/core/ext-py/Django-1.6.10/django/db/models/base.py
92
45515
from __future__ import unicode_literals import copy import sys from functools import update_wrapper from django.utils.six.moves import zip import django.db.models.manager # Imported to register signal handler. from django.conf import settings from django.core.exceptions import (ObjectDoesNotExist, MultipleObject...
apache-2.0
benjaminrigaud/django
django/contrib/auth/decorators.py
65
3164
from functools import wraps from django.conf import settings from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import PermissionDenied from django.utils.decorators import available_attrs from django.utils.encoding import force_str from django.utils.six.moves.urllib.parse import urlparse fr...
bsd-3-clause
tousix/tousix-manager
tousix_manager/urls.py
1
2063
"""web_TouSIX URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-...
gpl-3.0