repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
Celthi/youtube-dl-GUI | youtube_dl/extractor/tube8.py | 32 | 3522 | from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_urlparse,
compat_urllib_request,
)
from ..utils import (
int_or_none,
str_to_int,
)
from ..aes import aes_decrypt_text
class Tube8IE(InfoExtractor):
_VALID_U... | mit |
KohlsTechnology/ansible | lib/ansible/modules/network/avi/avi_vsvip.py | 26 | 4732 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.2
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
haeusser/tensorflow | tensorflow/contrib/layers/python/layers/regularizers.py | 63 | 6978 | # 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 |
2uller/LotF | App/Lib/sqlite3/test/userfunctions.py | 2 | 15477 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/userfunctions.py: tests for user-defined functions and
# aggregates.
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
... | gpl-2.0 |
anjalisood/spark-tk | python/sparktk/dicom/ops/filter_by_keywords.py | 14 | 3974 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
DDelon/youtube-dl | youtube_dl/extractor/phoenix.py | 108 | 1527 | from __future__ import unicode_literals
from .common import InfoExtractor
from .zdf import extract_from_xml_url
class PhoenixIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://(?:www\.)?phoenix\.de/content/
(?:
phoenix/die_sendungen/(?:[^/]+/)?
)?
(?P<id>[0-9]+)'''
_TESTS = ... | unlicense |
metaml/nupic | tests/integration/nupic/algorithms/knn_classifier_test/classifier_test.py | 25 | 10208 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditio... | agpl-3.0 |
Aristocles/CouchPotatoServer | libs/pyasn1/debug.py | 185 | 1541 | import sys
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Debug:
defaultPr... | gpl-3.0 |
xNovax/SickRage | lib/html5lib/treewalkers/pulldom.py | 1729 | 2302 | from __future__ import absolute_import, division, unicode_literals
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
from . import _base
from ..constants import voidElements
class TreeWalker(_base.TreeWalker):
def __iter__(self):
ignore_until = None... | gpl-3.0 |
gencer/sentry | src/sentry/south_migrations/0060_fill_filter_key.py | 5 | 28004 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.mo... | bsd-3-clause |
nwjs/chromium.src | third_party/blink/renderer/bindings/scripts/generate_bindings.py | 1 | 2542 | # Copyright 2019 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.
"""
Runs the bindings code generator for the given tasks.
"""
import optparse
import sys
import bind_gen
import web_idl
def parse_options():
parser =... | bsd-3-clause |
piece601/Openkore | src/scons-local-2.0.1/SCons/Warnings.py | 61 | 6806 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without li... | gpl-2.0 |
TomHeatwole/osf.io | scripts/tests/test_triggered_mails.py | 31 | 2280 | import mock
from datetime import datetime, timedelta
from nose.tools import * # noqa
from tests.base import OsfTestCase
from tests.factories import UserFactory
from scripts.triggered_mails import main, find_inactive_users_with_no_inactivity_email_sent_or_queued
from website import mails
class TestTriggeredMails(OsfT... | apache-2.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-61/modules/myenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 1093 | 8936 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_ide... | gpl-3.0 |
EvanK/ansible | test/units/modules/network/f5/test_bigip_configsync_action.py | 21 | 3910 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks 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
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | gpl-3.0 |
JD-P/HackerNewsToJSON | hn2json.py | 1 | 6275 | #!/usr/bin/env python
"""Python-Pinboard
Python script for downloading your saved stories and saved comments on Hacker News
and converting them to a JSON format for easy use.
Originally written on Pythonista on iPad
"""
__version__ = "1.1"
__license__ = "BSD"
__copyright__ = "Copyright 2013-2014, Luciano Fiandesio"
... | bsd-3-clause |
applidget/zxing-ios | cpp/scons/scons-local-2.0.0.final.0/SCons/Util.py | 34 | 49016 | """SCons.Util
Various utility functions go here.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in th... | apache-2.0 |
huijunwu/heron | heron/tools/cli/tests/python/opts_unittest.py | 5 | 2120 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
sometallgit/AutoUploader | Python27/Lib/site-packages/rsa/cli.py | 81 | 12185 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Un... | mit |
ptkool/spark | examples/src/main/python/ml/polynomial_expansion_example.py | 123 | 1522 | #
# 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 us... | apache-2.0 |
michalbe/servo | src/components/script/dom/bindings/codegen/parser/tests/test_special_method_signature_mismatch.py | 241 | 6622 | def WebIDLTest(parser, harness):
threw = False
try:
parser.parse("""
interface SpecialMethodSignatureMismatch1 {
getter long long foo(long index);
};
""")
results = parser.finish()
except:
threw = True
harness.ok(threw, "Should have... | mpl-2.0 |
jward6/academics-python | datastructures/linkedStackTest.py | 1 | 1812 | import unittest
class Empty(Exception):
pass
class Stack:
class _Node:
__slots__ = '_element', '_next'
def __init__(self, e, n):
self._element = e
self._next = n
def __init__(self):
self._head = self._Node(None, None)
self._length = 0
def __len... | mit |
ChrisTruncer/rdpy | rdpy/security/pyDes.py | 2 | 32292 | #############################################################################
# Documentation #
#############################################################################
# Author: Todd Whiteman
# Date: 16th March, 2009
# Verion: 2.0.0
# License: Public Domain - free to d... | gpl-3.0 |
ishay2b/tensorflow | tensorflow/python/kernel_tests/stack_op_test.py | 9 | 11444 | # 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 |
LoHChina/nova | nova/tests/unit/virt/libvirt/volume/test_hgst.py | 38 | 2570 | # Copyright 2015 HGST
# 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 agree... | apache-2.0 |
codester2/devide.johannes | extra/soappy-cvp/SOAPpy/SOAPBuilder.py | 8 | 22127 | """
################################################################################
# Copyright (c) 2003, Pfizer
# Copyright (c) 2001, Cayce Ullman.
# Copyright (c) 2001, Brian Matthews.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | bsd-3-clause |
lmazuel/ansible | lib/ansible/modules/source_control/git_config.py | 70 | 7530 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Marius Gedminas <marius@pov.lt>
# (c) 2016, Matthew Gamble <git@matthewgamble.net>
#
# 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... | gpl-3.0 |
alon/servo | components/script/dom/bindings/codegen/parser/tests/test_lenientSetter.py | 137 | 1867 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
def should_throw(parser, harness, message, code):
parser = parser.reset();
threw = False
try:
parser... | mpl-2.0 |
aperigault/ansible | lib/ansible/modules/cloud/softlayer/sl_vm.py | 34 | 11435 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
Serag8/Bachelor | google_appengine/google/appengine/ext/remote_api/remote_api_stub.py | 4 | 31174 | #!/usr/bin/env python
#
# Copyright 2007 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 o... | mit |
chrismeyersfsu/webapp-bills | form.app.engine.py | 1 | 19113 | import cgi
import urllib, urllib2, Cookie
import cookielib
import re
import logging
from urlparse import urlparse
from django.utils import simplejson
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.api import... | gpl-3.0 |
barykaed/Pelican-Test | fsp_env/Lib/site-packages/pip/_vendor/distlib/index.py | 571 | 20976 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import hashlib
import logging
import os
import shutil
import subprocess
import tempfile
try:
from threading import Thread
except ImportErr... | mit |
coders4help/volunteer_planner | shiftmailer/excelexport.py | 5 | 2641 | # coding: utf-8
import logging
import os
import tempfile
from django.conf import settings
from django.core.mail.message import EmailMessage
from excel_renderer import ExcelRenderer
log = logging.getLogger(__name__)
class GenerateExcelSheet:
def __init__(self, shifts, mailer):
if not shifts:
... | agpl-3.0 |
ryanjmccall/nupic | nupic/frameworks/opf/expdescriptionhelpers.py | 7 | 15073 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | gpl-3.0 |
SeattleTestbed/repy_v2 | safe_check.py | 1 | 1136 | """
Author: Armon Dadgar
Date: June 11th, 2009
Description:
This simple script reads "code" from stdin, and runs safe.safe_check() on it.
The resulting return value or exception is serialized and written to stdout.
The purpose of this script is to be called from the main repy.py script so that the
memory used b... | mit |
ViaQ/watches-cli | tests/commands/test_just_indices_stats.py | 1 | 1384 | """Tests for our `watches just_indices_stats` subcommand."""
import json
from subprocess import PIPE, Popen as popen
from secure_support import TestSecureSupport
class TestJustIndicesStats(TestSecureSupport):
def test_returns_index_per_line(self):
cmd = self.appendSecurityCommands(['watches', 'just_ind... | apache-2.0 |
tomekwojcik/Team-O-Matic | teamomatic/app.py | 1 | 2057 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2011 by Tomasz Wójcik <labs@tomekwojcik.pl>
#
# 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 r... | mit |
zhulin2609/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/commitqueuetask_unittest.py | 119 | 29255 | # Copyright (c) 2010 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 |
blacklin/kbengine | kbe/res/scripts/common/Lib/encodings/cp864.py | 272 | 33663 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.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_map)
def decode(self,input,errors='strict'):
... | lgpl-3.0 |
vrv/tensorflow | tensorflow/contrib/tensor_forest/hybrid/python/kernel_tests/k_feature_routing_function_op_test.py | 103 | 3383 | # 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 |
Trixter69/BookMarka | lib/cherrypy/_cptools.py | 55 | 19093 | """CherryPy tools. A "tool" is any helper, adapted to CP.
Tools are usually designed to be used in a variety of ways (although some
may only offer one if they choose):
Library calls
All tools are callables that can be used wherever needed.
The arguments are straightforward and should be detailed w... | gpl-3.0 |
DARKPOP/external_chromium_org_third_party_skia | gm/rebaseline_server/download_actuals_test.py | 20 | 1491 | #!/usr/bin/python
"""
Copyright 2014 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Test download.py
TODO(epoger): Create a command to update the expected results (in
self._output_dir_expected) when appropriate. For now, you should:
1. examine the resu... | bsd-3-clause |
piiswrong/mxnet | python/mxnet/gluon/model_zoo/vision/densenet.py | 10 | 7848 | # 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 |
catapult-project/catapult | third_party/gsutil/third_party/pyu2f/pyu2f/convenience/baseauthenticator.py | 13 | 2202 | # Copyright 2016 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 ag... | bsd-3-clause |
jreut/Switcharoo | scraper/scraper/entryqueue.py | 2 | 2041 | # Copyright 2015 Adam Greenstein <adamgreenstein@comcast.net>
#
# Switcharoo Cartographer 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 versio... | gpl-3.0 |
sunshine027/mic | mic/utils/misc.py | 5 | 35129 | #!/usr/bin/python -tt
#
# Copyright (c) 2010, 2011 Intel 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; version 2 of the License
#
# This program is distributed in the hope that it will ... | gpl-2.0 |
Endika/django | tests/multiple_database/models.py | 282 | 2472 | from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
clas... | bsd-3-clause |
janewangfb/spark | examples/src/main/python/transitive_closure.py | 128 | 2408 | #
# 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 us... | apache-2.0 |
nilsgrabbert/spark | python/pyspark/mllib/__init__.py | 123 | 1412 | #
# 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 us... | apache-2.0 |
YanTangZhai/tf | tensorflow/python/training/training_ops.py | 1 | 5435 | # Copyright 2015 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... | apache-2.0 |
ashang/calibre | src/calibre/gui2/actions/preferences.py | 14 | 2810 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
from functools import partial
from PyQt5.Qt import QIcon, Qt
from calibre.gui2.actions import InterfaceAction
from calib... | gpl-3.0 |
mlq/fMBT | utils/setup.py | 5 | 4003 | #!/usr/bin/env python2
from distutils.core import setup, Extension
import os
import subprocess
import sys
def pkg_config(package):
if os.name == "nt":
if package == "MagickCore":
# pkg-config cannot be used, try to find needed libraries from the filesystem
import fnmatch
... | lgpl-2.1 |
switchboardOp/ansible | lib/ansible/modules/network/netscaler/netscaler_server.py | 14 | 12592 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Citrix Systems
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
... | gpl-3.0 |
tinloaf/home-assistant | homeassistant/components/binary_sensor/__init__.py | 4 | 3179 | """
Component to interface with binary sensors.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/binary_sensor/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.helpers.entity_component import EntityComponen... | apache-2.0 |
TempSquad/TEMP2016-site-client | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py | 2767 | 2174 | # Copyright (c) 2011 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.
"""Applies a fix to CR LF TAB handling in xml.dom.
Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293
Working around this: http://bugs.python.or... | apache-2.0 |
ujjvala-addsol/addsol_hr | openerp/addons/base_report_designer/__init__.py | 421 | 1136 | # -*- 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 |
ParuninPavel/lenta4_hack | vkapp/contrib/sites/migrations/0003_set_site_domain_and_name.py | 1 | 1085 | """
To understand why this file is here, please read:
http://cookiecutter-django.readthedocs.io/en/latest/faq.html#why-is-there-a-django-contrib-sites-directory-in-cookiecutter-django
"""
from django.conf import settings
from django.db import migrations
def update_site_forward(apps, schema_editor):
"""Set site d... | mit |
sunlianqiang/kbengine | kbe/res/scripts/common/Lib/test/test_zipfile.py | 60 | 70441 | import io
import os
import sys
import importlib.util
import time
import struct
import zipfile
import unittest
from tempfile import TemporaryFile
from random import randint, random, getrandbits
from test.support import (TESTFN, findfile, unlink, rmtree,
requires_zlib, requires_bz2, requires_... | lgpl-3.0 |
cyli/volatility | volatility/plugins/linux/netstat.py | 10 | 2404 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# 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 Software Foundation; either version 2 of the License, or
# (at your o... | gpl-2.0 |
vdmann/cse-360-image-hosting-website | lib/python2.7/site-packages/django/contrib/gis/management/commands/inspectdb.py | 315 | 1466 | from django.core.management.commands.inspectdb import Command as InspectDBCommand
class Command(InspectDBCommand):
db_module = 'django.contrib.gis.db'
gis_tables = {}
def get_field_type(self, connection, table_name, row):
field_type, field_params, field_notes = super(Command, self).get_field_type(... | mit |
Bysmyyr/blink-crosswalk | Tools/Scripts/webkitpy/style/checkers/png.py | 170 | 3914 | # Copyright (C) 2012 Balazs Ankes (bank@inf.u-szeged.hu) University of Szeged
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this lis... | bsd-3-clause |
matthewoliver/swift | test/unit/obj/test_expirer.py | 2 | 34828 | # Copyright (c) 2011 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 agreed to ... | apache-2.0 |
oopy/micropython | tests/basics/exceptpoly2.py | 63 | 1789 | try:
raise MemoryError
except Exception:
print("Caught MemoryError via Exception")
try:
raise MemoryError
except MemoryError:
print("Caught MemoryError")
try:
raise NameError
except Exception:
print("Caught NameError via Exception")
try:
raise NameError
except NameError:
print("Caught... | mit |
haeusser/tensorflow | tensorflow/contrib/ndlstm/python/lstm2d_test.py | 22 | 3473 | # 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 applicable ... | apache-2.0 |
runt18/nupic | tests/unit/nupic/engine/unified_py_parameter_test.py | 35 | 3604 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | agpl-3.0 |
zengenti/ansible | lib/ansible/plugins/callback/junit.py | 92 | 8951 | # (c) 2016 Matt Clay <matt@mystile.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 version.
#
... | gpl-3.0 |
liggitt/docker-registry | depends/docker-registry-core/docker_registry/drivers/file.py | 38 | 4471 | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Docker.
#
# 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 |
mhild/Sick-Beard | lib/hachoir_core/field/seekable_field_set.py | 90 | 6130 | from lib.hachoir_core.field import Field, BasicFieldSet, FakeArray, MissingField, ParserError
from lib.hachoir_core.tools import makeUnicode
from lib.hachoir_core.error import HACHOIR_ERRORS
from itertools import repeat
import lib.hachoir_core.config as config
class RootSeekableFieldSet(BasicFieldSet):
def __init_... | gpl-3.0 |
tectronics/admiral-jiscmrd | test/MiscLib/tests/TestSuperGlobal.py | 8 | 1649 | # $Id: TestSuperGlobal.py 1047 2009-01-15 14:48:58Z graham $
#
# Unit testing for SuperGlobal module
# See http://pyunit.sourceforge.net/pyunit.html
#
import sys
import unittest
sys.path.append("../..")
from MiscLib.SuperGlobal import *
class TestSuperGlobal(unittest.TestCase):
def setUp(self):
return
... | mit |
yavalvas/yav_com | build/matplotlib/examples/widgets/slider_demo.py | 13 | 1179 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button, RadioButtons
fig, ax = plt.subplots()
plt.subplots_adjust(left=0.25, bottom=0.25)
t = np.arange(0.0, 1.0, 0.001)
a0 = 5
f0 = 3
s = a0*np.sin(2*np.pi*f0*t)
l, = plt.plot(t,s, lw=2, color='red')
plt.axis([0, 1, -10, 10])
a... | mit |
karmix/anaconda | tests/gui/inside/storage.py | 13 | 9863 | # Copyright (C) 2014 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# This program is distr... | gpl-2.0 |
rismalrv/edx-platform | common/lib/xmodule/xmodule/foldit_module.py | 68 | 6538 | import logging
from lxml import etree
from pkg_resources import resource_string
from xmodule.editing_module import EditingDescriptor
from xmodule.x_module import XModule
from xmodule.xml_module import XmlDescriptor
from xblock.fields import Scope, Integer, String
from .fields import Date
log = logging.getLogger(__n... | agpl-3.0 |
neumerance/deploy | .venv/lib/python2.7/site-packages/django/contrib/gis/gdal/srs.py | 219 | 11914 | """
The Spatial Reference class, represensents OGR Spatial Reference objects.
Example:
>>> from django.contrib.gis.gdal import SpatialReference
>>> srs = SpatialReference('WGS84')
>>> print(srs)
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHOR... | apache-2.0 |
rambo/asylum | project/members/models.py | 4 | 6401 | # -*- coding: utf-8 -*-
import random
from decimal import Decimal
from access.models import AccessType
from access.utils import resolve_acl
from django.core.exceptions import ValidationError
from django.db import models, transaction
from django.utils import timezone
from django.utils.translation import ugettext_lazy a... | mit |
MoisesTedeschi/python | Scripts-Python/Modulos-Diversos/python-com-scrapy/Lib/site-packages/pip/_vendor/progress/helpers.py | 24 | 2952 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE A... | gpl-3.0 |
SebDieBln/QGIS | python/plugins/processing/algs/taudem/dinfdistdown_multi.py | 12 | 5393 | # -*- coding: utf-8 -*-
"""
***************************************************************************
dinfdistdown_multi.py
---------------------
Date : March 2015
Copyright : (C) 2015 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
********... | gpl-2.0 |
SGCreations/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | apache-2.0 |
shsingh/ansible | test/units/modules/network/fortios/test_fortios_vpn_ssl_web_user_group_bookmark.py | 21 | 7790 | # 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 |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v2_3_0/issue_adhoc_broker.py | 19 | 1697 | from ..broker import Broker
class IssueAdhocBroker(Broker):
controller = "issue_adhocs"
def generate_issue(self, **kwargs):
"""Generates an instance of a custom issue.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required:... | apache-2.0 |
jinnykoo/wuyisj.com | src/oscar/apps/basket/forms.py | 26 | 10178 | from django import forms
from django.conf import settings
from django.forms.models import modelformset_factory, BaseModelFormSet
from django.db.models import Sum
from django.utils.translation import ugettext_lazy as _
from oscar.core.loading import get_model
from oscar.forms import widgets
Line = get_model('basket', ... | bsd-3-clause |
OXPHOS/shogun | examples/undocumented/python/streaming_vw_createcache.py | 5 | 1432 | #!/usr/bin/env python
from shogun import StreamingVwFile
from shogun import StreamingVwCacheFile
from shogun import T_SVMLIGHT
from shogun import StreamingVwFeatures
from shogun import VowpalWabbit
parameter_list=[['../data/fm_train_sparsereal.dat']]
def streaming_vw_createcache (fname):
# First creates a binary cac... | gpl-3.0 |
dagwieers/ansible | lib/ansible/modules/web_infrastructure/sophos_utm/utm_proxy_frontend.py | 36 | 8794 | #!/usr/bin/python
# Copyright: (c) 2018, Johannes Brunswicker <johannes.brunswicker@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... | gpl-3.0 |
bintlabs/pygal-nostatics | pygal/css/style_css.py | 1 | 2851 | # -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012-2014 Kozea
#
# This library is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version... | lgpl-3.0 |
GitAngel/django | django/db/models/aggregates.py | 161 | 6624 | """
Classes to represent the definitions of aggregate functions.
"""
from django.core.exceptions import FieldError
from django.db.models.expressions import Func, Value
from django.db.models.fields import FloatField, IntegerField
__all__ = [
'Aggregate', 'Avg', 'Count', 'Max', 'Min', 'StdDev', 'Sum', 'Variance',
]
... | bsd-3-clause |
andmaj/unrank-bottleneck-bench | sdsl_linear/gtest-1.6.0/scripts/pump.py | 603 | 23316 | #!/usr/bin/env python
#
# Copyright 2008, 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... | gpl-3.0 |
tonicbupt/flask-navigator | tests/test_navbar.py | 2 | 1514 | from pytest import fixture, raises
from flask.ext.navigation.navbar import NavigationBar
from flask.ext.navigation.item import Item, ItemReference
@fixture
def navbar():
navbar = NavigationBar('mybar', [
Item(u'Home', 'home'),
Item(u'News', 'news'),
])
return navbar
def test_attrs(navba... | mit |
ResearchSoftwareInstitute/MyHPOM | hs_file_types/models/base.py | 1 | 39179 | import os
import copy
from django.db import models
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericRelation
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.forms.models import model_to_dict
from django.contrib.postgres... | bsd-3-clause |
forrestv/pyderiv | deriv.py | 1 | 5500 | # This file is part of pyderiv. http://forre.st/pyderiv
#
# pyderiv 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.
#
# pyderiv is distr... | gpl-3.0 |
David-Amaro/bank-payment | __unported__/account_banking/migrations/6.1.0.1.81/post-set-statement-line-state.py | 14 | 1439 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 Therp BV (<http://therp.nl>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by ... | agpl-3.0 |
chrta/canfestival-3-ct | objdictgen/eds_utils.py | 2 | 40678 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#This file is part of CanFestival, a library implementing CanOpen Stack.
#
#Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD
#
#See COPYING file for copyrights details.
#
#This library is free software; you can redistribute it and/or
#modify it under th... | lgpl-2.1 |
ZirkCoin/ZirkCoin | share/qt/extract_strings_qt.py | 1294 | 1784 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by xgettext.
Ret... | mit |
iwarobots/aerodynamics | src/test_section.py | 1 | 1447 | #!/usr/bin/env python
from __future__ import absolute_import, division
from common import Model
# TODO: Refinement needed.
class TestSection(Model):
def __init__(self,
in_mach,
in_area,
in_p,
in_t,
p01,
t01,
... | apache-2.0 |
CeltonMcGrath/TACTIC | 3rd_party/CherryPy/cherrypy/tutorial/tut06_default_method.py | 9 | 2118 | """
Tutorial - The default method
Request handler objects can implement a method called "default" that
is called when no other suitable method/object could be found.
Essentially, if CherryPy2 can't find a matching request handler object
for the given request URI, it will use the default method of the object
located de... | epl-1.0 |
Jumpscale/jumpscale_core8 | lib/JumpScale/baselib/atyourservice81/Service.py | 1 | 30866 | from JumpScale import j
import capnp
import time
class Service:
def __init__(self, aysrepo, actor=None, model=None, name="", args={}, path=None):
"""
init from a template or from a model
"""
self.model = None
self._schema = None
self._path = ""
self._schema... | apache-2.0 |
dstufft/ooni-backend | oonib/otime.py | 1 | 2318 | import time
from oonib import errors as e
from datetime import datetime
def utcDateNow():
"""
Returns the datetime object of the current UTC time.
"""
return datetime.utcnow()
def utcTimeNow():
"""
Returns seconds since epoch in UTC time, it's of type float.
"""
return time.mktime(ti... | bsd-2-clause |
Alwnikrotikz/cortex-vfx | python/IECoreMaya/ParameterUI.py | 12 | 14067 | ##########################################################################
#
# Copyright (c) 2007-2011, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
jaggu303619/asylum | openerp/addons/portal_crm/__openerp__.py | 55 | 1734 | # -*- 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 |
JuliBakagianni/META-SHARE | misc/tools/generateDS-2.7a/generate_coverage.py | 33 | 3800 | #!/usr/bin/env python
#
# Imports
import sys
from optparse import OptionParser
import os
import re
#
# Globals and constants
EXCLUDE_BASE = [
'MixedContainer',
'_MemberSpec',
]
PATTERN = "^class\s*(\w*)"
RE_PATTERN = re.compile(PATTERN)
#
# Functions for external use
def generate_coverage(outfile,... | bsd-3-clause |
cernops/nova | nova/tests/functional/api_sample_tests/test_networks_associate.py | 9 | 3149 | # Copyright 2012 Nebula, Inc.
# Copyright 2014 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
linvictor88/vse-lbaas-driver | quantum/plugins/bigswitch/tests/test_server.py | 3 | 6568 | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Big Switch Networks, 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
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.