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 |
|---|---|---|---|---|---|
shinyChen/browserscope | categories/richtext2/tests/queryValue.py | 16 | 16735 |
QUERYVALUE_TESTS = {
'id': 'QV',
'caption': 'queryCommandValue Tests',
'checkAttrs': False,
'checkStyle': False,
'styleWithCSS': False,
'Proposed': [
{ 'desc': '',
'tests': [
]
},
{ 'desc': '[HTML5] query bold value',
'qcvalue': 'b... | apache-2.0 |
aristanetworks/neutron | neutron/tests/unit/plugins/ml2/test_extension_driver_api.py | 11 | 10642 | # 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, software
# d... | apache-2.0 |
laurimyllari/xbmc | lib/gtest/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | gpl-2.0 |
ryfeus/lambda-packs | Keras_tensorflow/source/numpy/fft/tests/test_fftpack.py | 134 | 6052 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.random import random
from numpy.testing import TestCase, run_module_suite, assert_array_almost_equal
from numpy.testing import assert_array_equal
import threading
import sys
if sys.version_info[0] >= 3:
import queue
else... | mit |
Xeralux/tensorflow | tensorflow/contrib/learn/python/learn/ops/losses_ops.py | 3 | 3366 | # 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 |
kaku289/paparazzi | sw/tools/airframe_editor/airframe_editor.py | 74 | 12033 | #!/usr/bin/env python
from __future__ import print_function
import pygtk
import gtk
pygtk.require('2.0')
from os import path
# Owm Modules
import gui_dialogs
import xml_airframe
import paparazzi
# Airframe File
airframe_file = path.join(paparazzi.airframes_dir, "examples/quadrotor_lisa_m_2_pwm_spektrum.xml")
cl... | gpl-2.0 |
rlr/standup | standup/apps/api/views.py | 3 | 6498 | from flask import Blueprint, current_app, request
from sqlalchemy import desc
from standup import csrf, OrderedDict
from standup.apps.api.decorators import api_key_required
from standup.apps.status.models import Project, Status
from standup.apps.users.models import User
from standup.database import get_session
from sta... | bsd-3-clause |
jasonseminara/OpenSourceFinal | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/trie/py.py | 1323 | 1775 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError... | mit |
scylladb/scylla-artifact-tests | scylla_private_repo.py | 1 | 5238 | #!/usr/bin/env python
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hop... | apache-2.0 |
Motwani/firefox-ui-tests | firefox_ui_tests/functional/locationbar/test_escape_autocomplete.py | 3 | 2269 | # 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/.
from marionette_driver import Wait
from firefox_ui_harness.decorators import skip_under_xvfb
from firefox_puppeteer.tes... | mpl-2.0 |
vveerava/Openstack | neutron/extensions/multiprovidernet.py | 18 | 4327 | # Copyright (c) 2013 OpenStack Foundation.
# 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... | apache-2.0 |
kangkot/arangodb | 3rdParty/V8-4.3.61/third_party/binutils/download.py | 25 | 2889 | #!/usr/bin/env python
# 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.
# vim: set ts=2 sw=2 et sts=2 ai:
"""Minimal tool to download binutils from Google storage.
TODO(mithro): Replace with generic downloa... | apache-2.0 |
alexlo03/ansible | lib/ansible/module_utils/network/netconf/netconf.py | 36 | 3910 | #
# (c) 2018 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is ... | gpl-3.0 |
ferno/greenery | greenery/lego.py | 1 | 55607 | # -*- coding: utf-8 -*-
'''
LEGO:
Classes and methods for the creation and manipulation of regular expression
objects and components.
* A regular expression is a "pattern" object.
* Each pattern alternates (with a pipe, "|") between zero or more "conc"
(concatenation) objects.
* Each conc is a concatenation of... | mit |
3manuek/scikit-learn | examples/manifold/plot_mds.py | 261 | 2616 | """
=========================
Multi-dimensional scaling
=========================
An illustration of the metric and non-metric MDS on generated noisy data.
The reconstructed points using the metric MDS and non metric MDS are slightly
shifted to avoid overlapping.
"""
# Author: Nelle Varoquaux <nelle.varoquaux@gmail.... | bsd-3-clause |
mnooner256/pyqrcode | pyqrcode/tables.py | 2 | 31446 | # -*- coding: utf-8 -*-
# Copyright (c) 2013, Michael Nooner
# 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, ... | bsd-3-clause |
vitan/hue | desktop/core/ext-py/guppy-0.1.10/guppy/heapy/Monitor.py | 37 | 12734 | #._cv_part guppy.heapy.Monitor
import os, pprint, signal, socket, SocketServer, sys, threading, time, traceback
import cPickle as pickle
try:
import readline # Imported to _enable_ command line editing
except ImportError:
pass
import select, Queue
from guppy.heapy.RemoteConstants import *
from guppy.heapy.Co... | apache-2.0 |
bywbilly/tornado | tornado/wsgi.py | 127 | 13436 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
thiagopena/PySIGNFe | pysignfe/nfe/manual_401/conssitnfe_200.py | 1 | 3143 | # -*- coding: utf-8 -*-
from pysignfe.xml_sped import *
from pysignfe.nfe.manual_401 import ESQUEMA_ATUAL
from pysignfe.nfe.manual_300 import conssitnfe_107
from pysignfe.nfe.manual_401 import ProtNFe_200, RetCancNFe_200
import os
DIRNAME = os.path.dirname(__file__)
class ConsSitNFe(conssitnfe_107.ConsSitNFe):
d... | lgpl-2.1 |
kidburglar/youtube-dl | youtube_dl/extractor/skylinewebcams.py | 20 | 1452 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class SkylineWebcamsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html'
_TEST = {
'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/r... | unlicense |
xianjunzhengbackup/Cloud-Native-Python | env/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py | 2360 | 3778 | """The match_hostname() function from Python 3.3.3, essential when using SSL."""
# Note: This file is under the PSF license as the code comes from the python
# stdlib. http://docs.python.org/3/license.html
import re
__version__ = '3.4.0.2'
class CertificateError(ValueError):
pass
def _dnsname_match(dn, host... | mit |
firstblade/xbmc | lib/gtest/scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/usr/bin/env python
#
# Copyright 2006, 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-2.0 |
GOFAI/glasstone | examples/wseg10.py | 1 | 1738 | import matplotlib.pyplot as plt
from matplotlib import cm, colors, colorbar
import numpy as np
from glasstone.fallout import WSEG10
# ground zero x & y locations (st. mi)
gzx = 1
gzy = 1
# yield in megatons
yld = 0.01
# fission fraction
ff = 1.0
# wind speed (mph)
wind_speed = 1.151515 * 2.0
# wind direction (in degre... | mit |
xyzz/vcmi-build | project/jni/python/src/Demo/tkinter/matt/menu-all-types-of-entries.py | 35 | 9110 | from Tkinter import *
# some vocabulary to keep from getting confused. This terminology
# is something I cooked up for this file, but follows the man pages
# pretty closely
#
#
#
# This is a MENUBUTTON
# V
# +-------------+
# | |
#
# +------------++------------++------------+
# | || ... | lgpl-2.1 |
synergeticsedx/deployment-wipro | common/lib/xmodule/xmodule/mako_module.py | 27 | 2004 | """
Code to handle mako templating for XModules and XBlocks.
"""
from xblock.fragment import Fragment
from .x_module import XModuleDescriptor, DescriptorSystem, shim_xmodule_js
class MakoDescriptorSystem(DescriptorSystem):
def __init__(self, render_template, **kwargs):
super(MakoDescriptorSystem, self)._... | agpl-3.0 |
qedi-r/home-assistant | homeassistant/components/remember_the_milk/__init__.py | 3 | 12661 | """Support to interact with Remember The Milk."""
import json
import logging
import os
from rtmapi import Rtm, RtmRequestFailedException
import voluptuous as vol
from homeassistant.const import CONF_API_KEY, CONF_ID, CONF_NAME, CONF_TOKEN, STATE_OK
import homeassistant.helpers.config_validation as cv
from homeassista... | apache-2.0 |
alex1770/footballpredictions | getresults.py | 1 | 10181 | #!/usr/bin/python
import urllib2,csv,sys,datetime,time,re,bs4,string
from subprocess import PIPE,Popen
def err(s):
print >>sys.stderr,datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'),s
err("Info: starting getresults.py "+' '.join(sys.argv[1:]))
if len(sys.argv)<=1:
print >>sys.stderr,"Usage:",sys.argv[0],"... | mit |
rosmo/ansible | test/units/compat/mock.py | 156 | 4556 | # (c) 2014, Toshio Kuratomi <tkuratomi@ansible.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 |
xapi-project/sm | tests/test_lvutil.py | 1 | 7779 | import unittest
import testlib
import lvmlib
import mock
import os
import lvutil
import util
ONE_MEGABYTE = 1 * 1024 * 1024
def with_lvm_subsystem(func):
@testlib.with_context
def decorated(self, context, *args, **kwargs):
lvsystem = lvmlib.LVSubsystem(context.log, context.add_executable)
re... | lgpl-2.1 |
vivekanand1101/bodhi | bodhi/util.py | 3 | 18057 | # 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 version.
#
# This program is distributed in the hope that it will be useful,
# bu... | gpl-2.0 |
teamfx/openjfx-10-dev-rt | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py | 2 | 29529 | # Copyright (C) 2010 Google Inc. All rights reserved.
# Copyright (C) 2010 Gabor Rapcsanyi (rgabor@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:
#
# * Redistributions of so... | gpl-2.0 |
ShaneHarvey/mongo-python-driver | pymongo/client_session.py | 2 | 40387 | # Copyright 2017 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | apache-2.0 |
nikhilm/muzicast | muzicast/web/genre.py | 1 | 1359 | from sqlobject import DESC
from sqlobject.main import SQLObjectNotFound
from flask import Module, url_for, redirect, session, escape, request
from muzicast.const import DB_FILE
from muzicast.meta import Genre, GenreStatistics
from muzicast.web import playlist
from muzicast.web.util import render_master_page, page_view... | mit |
nikste/tensorflow | tensorflow/python/util/nest_test.py | 23 | 13634 | # 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 |
zephyrplugins/zephyr | zephyr.plugin.jython/jython2.5.2rc3/Lib/test/test_urlparse.py | 16 | 14795 | #! /usr/bin/env python
from test import test_support
import unittest
import urlparse
RFC1808_BASE = "http://a/b/c/d;p?q#f"
RFC2396_BASE = "http://a/b/c/d;p?q"
class UrlParseTestCase(unittest.TestCase):
def checkRoundtrips(self, url, parsed, split):
result = urlparse.urlparse(url)
self.assertEqua... | epl-1.0 |
python-rope/rope | rope/base/oi/memorydb.py | 14 | 3098 | from rope.base.oi import objectdb
class MemoryDB(objectdb.FileDict):
def __init__(self, project, persist=None):
self.project = project
self._persist = persist
self.files = self
self._load_files()
self.project.data_files.add_write_hook(self.write)
def _load_files(self)... | lgpl-3.0 |
jundongl/PyFeaST | skfeature/function/sparse_learning_based/UDFS.py | 3 | 3369 | import numpy as np
import scipy
import math
from skfeature.utility.sparse_learning import generate_diagonal_matrix, calculate_l21_norm
from sklearn.metrics.pairwise import pairwise_distances
def udfs(X, **kwargs):
"""
This function implements l2,1-norm regularized discriminative feature
selection for unsu... | gpl-2.0 |
Pallokala/ansible-modules-core | cloud/amazon/ec2_group.py | 37 | 16735 | #!/usr/bin/python
# -*- coding: utf-8 -*-
DOCUMENTATION = '''
---
module: ec2_group
author: "Andrew de Quincey (@adq)"
version_added: "1.3"
short_description: maintain an ec2 VPC security group.
description:
- maintains ec2 security groups. This module has a dependency on python-boto >= 2.5
options:
name:
d... | gpl-3.0 |
HenryHu/pybbs | bbsauth.py | 1 | 1665 | """bbsauth -- verifies session token
<http://www.ietf.org/rfc/rfc4616.txt>
Copyright (c) 2009, Coptix, Inc. All rights reserved.
See the LICENSE file for license terms and warranty disclaimer.
"""
from __future__ import absolute_import
from sasl import mechanism as mech, auth
__all__ = ('BBSAuth')
class BBSAuth(me... | bsd-2-clause |
arbrandes/edx-platform | openedx/core/djangoapps/user_authn/migrations/0001_data__add_login_service.py | 4 | 1740 | from django.conf import settings
from django.db import migrations
def add_login_service(apps, schema_editor):
"""
Adds a user and DOT application for the login service.
"""
login_service_name = 'Login Service for JWT Cookies'
login_service_client_id = settings.JWT_AUTH['JWT_LOGIN_CLIENT_ID']
l... | agpl-3.0 |
be-cloud-be/horizon-addons | server-tools/database_cleanup/models/purge_tables.py | 4 | 4291 | # -*- coding: utf-8 -*-
# © 2014-2016 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models, _
from openerp.exceptions import UserError
from ..identifier_adapter import IdentifierAdapter
class CleanupPurgeLineTable(models.TransientModel... | agpl-3.0 |
QuLogic/meson | tools/boost_names.py | 1 | 9365 | #!/usr/bin/env python3
# Copyright 2017 Niklas Claesson
# 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 |
freevo/kaa-metadata | src/image/core.py | 1 | 4330 | # -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------------
# core.py - basic image class
# -----------------------------------------------------------------------------
# $Id$
#
# -----------------------------------------------------------------------------
# kaa-Metada... | gpl-2.0 |
ubgarbage/gae-blog | blog/tests.py | 1 | 3078 | from django.test.client import Client
from django.test import TestCase
from models import Post, Subscriber
from django.contrib.auth.models import User
from django.contrib.comments.models import Comment
from test_utils import AuthViews
class PostTest(TestCase):
def setUp(self):
self.user = User.objects.cre... | bsd-3-clause |
kvar/ansible | lib/ansible/modules/notification/pushover.py | 37 | 3699 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Jim Richardson <weaselkeeper@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_vers... | gpl-3.0 |
thaim/ansible | lib/ansible/module_utils/network/iosxr/facts/l2_interfaces/l2_interfaces.py | 21 | 4504 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The iosxr l2_interfaces fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
base... | mit |
shaz13/oppia | core/storage/email/gae_models.py | 2 | 14295 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | apache-2.0 |
dh7/ML-Tutorial-Notebooks | images2gif.py | 1 | 36077 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein, Ant1, Marius van Voorden
#
# This code is subject to the (new) BSD license:
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of s... | bsd-2-clause |
danielpronych/pyramid-doxygen | pyramid/tests/test_config/test_views.py | 1 | 165038 | import unittest
from pyramid import testing
from pyramid.tests.test_config import IDummy
from pyramid.tests.test_config import dummy_view
from pyramid.compat import (
im_func,
text_,
)
from pyramid.exceptions import ConfigurationError
from pyramid.exceptions import ConfigurationExecutionError
from pyrami... | bsd-2-clause |
savoirfairelinux/OpenUpgrade | addons/purchase/purchase.py | 17 | 79204 | # -*- 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 |
tochikuji/pyPyrTools | pyrtools/showIm.py | 1 | 3701 | import numpy
from PIL import Image
import scipy.stats
import matplotlib.pyplot as plt
def showIm(*args):
# check and set input parameters
if len(args) == 0:
print("showIm( matrix, range, zoom, label, nshades )")
print(" matrix is string. It should be the name of a 2D array.")
print(" ... | mit |
sencha/chromium-spacewalk | tools/vim/chromium.ycm_extra_conf.py | 6 | 7192 | # 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.
# Autocompletion config for YouCompleteMe in Chromium.
#
# USAGE:
#
# 1. Install YCM [https://github.com/Valloric/YouCompleteMe]
# (Googlers s... | bsd-3-clause |
ntoll/yotta | yotta/lib/vcs.py | 2 | 7644 | # Copyright 2014 ARM Limited
#
# Licensed under the Apache License, Version 2.0
# See LICENSE file for details.
# standard library modules, , ,
import os
import subprocess
import tempfile
import logging
import hgapi
import errno
# fsutils, , misc filesystem utils, internal
import fsutils
git_logger = logging.getLogg... | apache-2.0 |
pcaro/jurko-suds | suds/sax/date.py | 9 | 14022 | # -*- coding: utf-8 -*-
# This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 i... | lgpl-3.0 |
JioCloud/python-novaclient | novaclient/v1_1/virtual_interfaces.py | 17 | 1039 | # Copyright 2012 OpenStack Foundation
# 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 requ... | apache-2.0 |
tejo-esperanto/pasportaservo | tests/models/test_gender_model.py | 1 | 1457 | from django.test import tag
from django_webtest import WebTest
from ..factories import GenderFactory
@tag('models')
class GenderModelTests(WebTest):
def test_field_max_lengths(self):
gender = GenderFactory.build()
self.assertEquals(gender._meta.get_field('name_en').max_length, 255)
self.... | agpl-3.0 |
synasius/django | django/contrib/gis/db/backends/oracle/introspection.py | 539 | 1977 | import sys
import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
from django.utils import six
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDS... | bsd-3-clause |
azumimuo/family-xbmc-addon | script.video.F4mProxy/lib/flvlib/scripts/debug_flv.py | 98 | 3580 | import sys
import logging
from optparse import OptionParser
from flvlib import __versionstr__
from flvlib import tags
from flvlib import helpers
from flvlib.astypes import MalformedFLV
log = logging.getLogger('flvlib.debug-flv')
log.setLevel(logging.ERROR)
def debug_file(filename, quiet=False, metadata=False):
... | gpl-2.0 |
jamespacileo/django-france | django/contrib/localflavor/pl/pl_administrativeunits.py | 433 | 13194 | # -*- coding: utf-8 -*-
"""
Polish administrative units as in http://pl.wikipedia.org/wiki/Podzia%C5%82_administracyjny_Polski
"""
ADMINISTRATIVE_UNIT_CHOICES = (
('wroclaw', u'Wrocław'),
('jeleniagora', u'Jelenia Góra'),
('legnica', u'Legnica'),
('boleslawiecki', u'bolesławiecki'),
('dzierzoniows... | bsd-3-clause |
vulcansteel/autorest | AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/StorageManagementClient/storage_management_client/models/usage_name.py | 1 | 1109 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
hale36/SRTV | lib/sqlalchemy/testing/assertions.py | 75 | 15418 | # testing/assertions.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
from . import util as testutil
from sqla... | gpl-3.0 |
keras-team/keras-io | examples/vision/xray_classification_with_tpus.py | 1 | 12745 | """
Title: Pneumonia Classification on TPU
Author: Amy MiHyun Jang
Date created: 2020/07/28
Last modified: 2020/08/24
Description: Medical image classification on TPU.
"""
"""
## Introduction + Set-up
This tutorial will explain how to build an X-ray image classification model
to predict whether an X-ray scan shows pre... | apache-2.0 |
Logan1x/Python-Scripts | bin/findlargefiles.py | 5 | 2553 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# findlargefiles.py Searches a file location and subdirectories for
# files larger than a given size.
"""
findlargefiles.py Searches a file location and subdirectories for
files larger than a given size.
Useful for phones which might hide files in FileExplorer.
Di... | mit |
Manuel1510/Manuelbot | requests/packages/chardet/langhungarianmodel.py | 2763 | 12536 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | unlicense |
DirkHoffmann/indico | indico/modules/events/registration/fields/base.py | 1 | 6511 | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from copy import deepcopy
from wtforms.validators import DataRequired, Optional
from indico.modules.even... | gpl-3.0 |
PLOS/rhino | test/api/RequestObject/articlecc.py | 1 | 3666 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2017 Public Library of Science
#
# 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 limitat... | mit |
aifil/odoo | addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py | 47 | 5890 | #-*- coding:utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import time
import datetime
from openerp.report import report_sxw
from openerp.osv import osv
class employees_yearly_salary_report(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(empl... | gpl-3.0 |
dcroc16/skunk_works | google_appengine/lib/webob-1.2.3/webob/etag.py | 80 | 4531 | """
Does parsing of ETag-related headers: If-None-Matches, If-Matches
Also If-Range parsing
"""
from webob.datetime_utils import (
parse_date,
serialize_date,
)
from webob.descriptors import _rx_etag
from webob.util import (
header_docstring,
warn_deprecation,
)
__all__ = ['AnyETag', 'NoETag... | mit |
itsmemattchung/github3.py | github3/decorators.py | 10 | 3027 | # -*- coding: utf-8 -*-
"""
github3.decorators
==================
This module provides decorators to the rest of the library
"""
from functools import wraps
from requests.models import Response
import os
try: # (No coverage)
# python2
from StringIO import StringIO # (No coverage)
except ImportError: # (N... | bsd-3-clause |
johankaito/fufuka | microblog/old-flask/lib/python2.7/codecs.py | 265 | 35266 | """ codecs -- Python Codec Registry, API and helpers.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import __builtin__, sys
### Registry and builtin stateless codec functions
try:
from _codecs import *
except ImportError, why:
raise SystemErr... | apache-2.0 |
Russell-IO/ansible | test/units/modules/remote_management/oneview/test_oneview_enclosure_facts.py | 68 | 4920 | # Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from ansible.compat.tests import unittest
from oneview_module_loader import OneViewModuleBase
from ansible.modules.remote_management.oneview.oneview_enclosure... | gpl-3.0 |
Yong-Lee/django | tests/custom_methods/tests.py | 228 | 1197 | from __future__ import unicode_literals
from datetime import date
from django.test import TestCase
from .models import Article
class MethodsTests(TestCase):
def test_custom_methods(self):
a = Article.objects.create(
headline="Area man programs in Python", pub_date=date(2005, 7, 27)
... | bsd-3-clause |
FedorSelitsky/eventrack | eventrack/settings/base.py | 1 | 5825 | import os
from celery.schedules import crontab
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'djan... | mit |
matteocrippa/dsl-n55u-bender | release/src/router/samba-3.5.8/source4/scripting/python/samba/shares.py | 24 | 1715 | #!/usr/bin/python
# Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2009
#
# 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
#... | gpl-2.0 |
gtolan/mrkttrdr | node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py | 1825 | 17014 | # 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.
"""GYP backend that generates Eclipse CDT settings files.
This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be importe... | mit |
lmazuel/ansible | lib/ansible/module_utils/dellos10.py | 51 | 5728 | #
# (c) 2015 Peter Sprygada, <psprygada@ansible.com>
# (c) 2017 Red Hat, Inc
#
# Copyright (c) 2016 Dell Inc.
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamica... | gpl-3.0 |
mancoast/CPythonPyc_test | fail/341_test_epoll.py | 79 | 8882 | # Copyright (c) 2001-2006 Twisted Matrix Laboratories.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, m... | gpl-3.0 |
hchen1202/django-react | virtualenv/lib/python3.6/site-packages/django/db/migrations/operations/fields.py | 64 | 12272 | from __future__ import unicode_literals
from django.db.models.fields import NOT_PROVIDED
from django.utils.functional import cached_property
from .base import Operation
class FieldOperation(Operation):
def __init__(self, model_name, name):
self.model_name = model_name
self.name = name
@cach... | mit |
jandersson/website | lib/flask/globals.py | 783 | 1137 | # -*- coding: utf-8 -*-
"""
flask.globals
~~~~~~~~~~~~~
Defines all the global objects that are proxies to the current
active context.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import partial
from werkzeug.local import LocalStack, ... | apache-2.0 |
TRESCLOUD/odoo | addons/base_status/__init__.py | 61 | 1087 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2012-today OpenERP SA (<http://openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
stackforge/tricircle | setup.py | 154 | 1030 | # Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
#
# 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 |
wjw12/emc | density.py | 1 | 3126 | from particle import *
@mlab.show
def show(a):
mlab.pipeline.volume(mlab.pipeline.scalar_field(a))
@mlab.show
def drawp(points):
mlab.points3d(points[:,0],points[:,1],points[:,2])
def test0():
# rotate a point
a = 17
r = 8
p = np.ones((a,a))
m = np.zeros((a,a,a))
m[r,:,:] = p
new_... | gpl-2.0 |
cwisecarver/osf.io | api_tests/registrations/views/test_withdrawn_registrations.py | 3 | 7970 | from urlparse import urlparse
from api_tests.nodes.views.test_node_contributors_list import NodeCRUDTestCase
from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from tests.base import fake
from osf_tests.factories import (
ProjectFactory,
... | apache-2.0 |
outboxafrica/pimaa | PiMaa/sensors/lib/GrovePi/grove_moisture_sensor.py | 2 | 2286 | #!/usr/bin/env python
#
# GrovePi Example for using the Grove Moisture Sensor (http://www.seeedstudio.com/wiki/Grove_-_Moisture_sensor)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this example? A... | gpl-3.0 |
Rctue/nao-lib | gestures/Happy3.py | 1 | 11061 | # Choregraphe bezier export in Python.
from naoqi import ALProxy
names = list()
times = list()
keys = list()
names.append("HeadPitch")
times.append([ 0.90000, 1.10000, 1.30000, 4.60000, 4.80000])
keys.append([ [ 0.51487, [ 3, -0.30000, 0.00000], [ 3, 0.06667, 0.00000]], [ 0.51487, [ 3, -0.06667, 0.00000], [ 3, 0.06667... | gpl-2.0 |
stefanv/scipy3 | scipy/weave/catalog.py | 2 | 29261 | """ Track relationships between compiled extension functions & code fragments
catalog keeps track of which compiled(or even standard) functions are
related to which code fragments. It also stores these relationships
to disk so they are remembered between Python sessions. When
a = 1
compi... | bsd-3-clause |
willingc/zulip | zerver/management/commands/rate_limit.py | 115 | 2756 | from __future__ import absolute_import
from zerver.models import UserProfile, get_user_profile_by_email
from zerver.lib.rate_limiter import block_user, unblock_user
from django.core.management.base import BaseCommand
from optparse import make_option
class Command(BaseCommand):
help = """Manually block or unblock... | apache-2.0 |
liuzzfnst/tp-libvirt | libvirt/tests/src/virsh_cmd/filter/virsh_nwfilter_dumpxml.py | 7 | 3551 | import logging
from autotest.client.shared import error
from virttest import virsh, libvirt_xml
from provider import libvirt_version
def check_list(uuid, name):
"""
Return True if filter found in nwfilter-list
:param uuid: filter uuid
:param name: filter name
:return: True if found, False if not ... | gpl-2.0 |
mrbox/django | django/contrib/gis/db/backends/postgis/adapter.py | 373 | 1695 | """
This object provides quoting for GEOS geometries into PostgreSQL/PostGIS.
"""
from __future__ import unicode_literals
from psycopg2 import Binary
from psycopg2.extensions import ISQLQuote
class PostGISAdapter(object):
def __init__(self, geom, geography=False):
"Initializes on the geometry."
... | bsd-3-clause |
fnkr/POSS | config.dist.py | 1 | 1144 | import sys
import os
# Debug mode
DEBUG = False
# Enable debug mode if --debug
for argument in sys.argv:
if argument == '--debug':
DEBUG = True
# Host, Port
HOST = '127.0.0.1'
PORT = 8080
# Domain
SERVER_NAME = 'localhost:8080'
# Database
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://poss:poss@localhost/p... | mit |
commshare/testLiveSRS | trunk/objs/CherryPy-3.2.4/cherrypy/wsgiserver/ssl_pyopenssl.py | 51 | 9377 | """A library for integrating pyOpenSSL with CherryPy.
The OpenSSL module must be importable for SSL functionality.
You can obtain it from http://pyopenssl.sourceforge.net/
To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of
SSLAdapter. There are two ways to use SSL:
Method One
----------
* ``s... | mit |
cxhernandez/osprey | osprey/tests/test_cli_worker_and_dump.py | 1 | 2065 | from __future__ import print_function, absolute_import, division
import os
import sys
import json
import shutil
import subprocess
import tempfile
from distutils.spawn import find_executable
from numpy.testing.decorators import skipif
try:
__import__('msmbuilder')
HAVE_MSMBUILDER = True
except:
HAVE_MSMBUIL... | apache-2.0 |
bopo/django-allauth | allauth/socialaccount/providers/angellist/views.py | 80 | 1056 | import requests
from allauth.socialaccount.providers.oauth2.views import (OAuth2Adapter,
OAuth2LoginView,
OAuth2CallbackView)
from .provider import AngelListProvider
class AngelListOAuth2Adapter(OAuth2... | mit |
myriadteam/myriadcoin | test/functional/tool_wallet.py | 6 | 3831 | #!/usr/bin/env python3
# Copyright (c) 2018 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 bitcoin-wallet."""
import subprocess
import textwrap
from test_framework.test_framework import Bitcoin... | mit |
jsirois/pex | pex/vendor/_vendored/pip/pip/_vendor/six.py | 59 | 34159 | # Copyright (c) 2010-2020 Benjamin Peterson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | apache-2.0 |
Ernesto99/odoo | addons/hr_recruitment/__init__.py | 433 | 1145 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
Zyell/home-assistant | tests/components/thermostat/test_heat_control.py | 8 | 7976 | """The tests for the heat control thermostat."""
import unittest
from homeassistant.bootstrap import _setup_component
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_ON,
STATE_OFF,
TEMP_CELSIUS,
)
from homeassistant.components import thermost... | mit |
dostavro/dotfiles | sublime2/Packages/Package Control/package_control/clients/readme_client.py | 9 | 2434 | import re
import os
import base64
try:
# Python 3
from urllib.parse import urlencode
except (ImportError):
# Python 2
from urllib import urlencode
from .json_api_client import JSONApiClient
from ..downloaders.downloader_exception import DownloaderException
# Used to map file extensions to formats
_r... | mit |
oaeproject/oae-fabric | fabfile/cluster/search/__init__.py | 1 | 4757 | from fabric.api import env, runs_once, settings, task
from fabric.tasks import execute
from .. import hosts as cluster_hosts, util as cluster_util
from ... import apt, puppet, search, hilary
__all__ = ["upgrade", "upgrade_host"]
@runs_once
@task
def upgrade(delete_index=False, rebuild_index=False, uninstall=True):
... | apache-2.0 |
yarikoptic/pystatsmodels | tools/examples_rst.py | 30 | 5894 | #! /usr/bin/env python
import os
import sys
import re
import subprocess
import pickle
from StringIO import StringIO
# 3rd party
from matplotlib import pyplot as plt
# Ours
import hash_funcs
#----------------------------------------------------
# Globals
#----------------------------------------------------
# these ... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.