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
lukeiwanski/tensorflow
tensorflow/contrib/distribute/__init__.py
11
1910
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
SEMAFORInformatik/femagtools
femagtools/winding_diagram.py
1
6730
from xml.etree import ElementTree as ET def _winding_data(Q, p, m): slots_per_pole_and_phase = int(Q / p / 2 / m) keys = [p + 1 for p in range(m) for _ in range(slots_per_pole_and_phase)] * p * 2 direction = -1 for i in range(Q): if i % slots_per_pole_and_phase == 0: direction *...
bsd-2-clause
yoava333/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_stream_hixie75.py
496
2285
#!/usr/bin/env python # # Copyright 2011, 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...
mpl-2.0
jeremiahmarks/sl4a
python-build/python-libs/gdata/src/gdata/base/service.py
166
9638
#!/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
Serag8/Bachelor
google_appengine/lib/django-1.5/django/dispatch/dispatcher.py
105
9373
import weakref import threading from django.dispatch import saferef from django.utils.six.moves import xrange WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref) def _make_id(target): if hasattr(target, '__func__'): return (id(target.__self__), id(target.__func__)) return id(target) ...
mit
lento/cortex
test/IECoreGL/MeshPrimitiveTest.py
4
7978
########################################################################## # # Copyright (c) 2008-2013, 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
rg3/youtube-dl
youtube_dl/YoutubeDL.py
2
110536
#!/usr/bin/env python # coding: utf-8 from __future__ import absolute_import, unicode_literals import collections import contextlib import copy import datetime import errno import fileinput import io import itertools import json import locale import operator import os import platform import re import shutil import su...
unlicense
deathping1994/sendmail-api
venv/lib/python2.7/site-packages/werkzeug/contrib/wrappers.py
295
10331
# -*- coding: utf-8 -*- """ werkzeug.contrib.wrappers ~~~~~~~~~~~~~~~~~~~~~~~~~ Extra wrappers or mixins contributed by the community. These wrappers can be mixed in into request objects to add extra functionality. Example:: from werkzeug.wrappers import Request as RequestBase fr...
apache-2.0
stefrobb/namebench
nb_third_party/dns/ipv6.py
248
4995
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation 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 ...
apache-2.0
Achint08/open-event-orga-server
app/views/users/my_tickets.py
7
1355
from flask import Blueprint from flask import render_template from app.helpers.data_getter import DataGetter from app.helpers.ticketing import TicketingManager my_tickets = Blueprint('my_tickets', __name__, url_prefix='/mytickets') @my_tickets.route('/') def display_my_tickets(): page_content = {"tab_upcoming_e...
gpl-3.0
bankonmecoin/bitcoin
qa/rpc-tests/test_framework/netutil.py
328
4562
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Linux network utilities import sys import socket import fcntl import struct import array import os import bi...
mit
3manuek/scikit-learn
sklearn/linear_model/passive_aggressive.py
106
9705
# Authors: Rob Zinkov, Mathieu Blondel # License: BSD 3 clause from .stochastic_gradient import BaseSGDClassifier from .stochastic_gradient import BaseSGDRegressor from .stochastic_gradient import DEFAULT_EPSILON class PassiveAggressiveClassifier(BaseSGDClassifier): """Passive Aggressive Classifier Read mor...
bsd-3-clause
eyesnears/ardupilot
Tools/autotest/arducopter.py
8
44386
# fly ArduCopter in SITL # Flight mode switch positions are set-up in arducopter.param to be # switch 1 = Circle # switch 2 = Land # switch 3 = RTL # switch 4 = Auto # switch 5 = Loiter # switch 6 = Stabilize import util, pexpect, sys, time, math, shutil, os from common import * from pymavlink import mavut...
gpl-3.0
oihane/odoo
addons/l10n_in_hr_payroll/report/report_payroll_advice.py
374
3442
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it...
agpl-3.0
mahabs/nitro
nssrc/com/citrix/netscaler/nitro/resource/config/dns/dnsnaptrrec.py
1
14627
# # Copyright (c) 2008-2015 Citrix Systems, 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 l...
apache-2.0
openatv/enigma2
lib/python/Plugins/SystemPlugins/SoftwareManager/ImageBackup.py
1
39463
################################################################################# # FULL BACKUP UYILITY FOR ENIGMA2, SUPPORTS THE MODELS OE-A 4.4 # # # # MAKES A FULLBACK-UP READY FOR FLASHING. # # # ##########################...
gpl-2.0
jumpstarter-io/neutron
neutron/api/api_common.py
17
10729
# Copyright 2011 Citrix System. # 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 b...
apache-2.0
HalCanary/skia-hc
tools/skp/page_sets/skia_tiger8svg_desktop.py
6
1271
# Copyright 2015 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. # pylint: disable=W0401,W0614 from telemetry import story from telemetry.page import page as page_module from telemetry.page import shared_page_state clas...
bsd-3-clause
rspavel/spack
var/spack/repos/builtin/packages/daligner/package.py
5
1234
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Daligner(MakefilePackage): """Daligner: The Dazzler "Overlap" Module.""" homepage = "...
lgpl-2.1
hjanime/VisTrails
vistrails/tests/__init__.py
2
1913
############################################################################### ## ## Copyright (C) 2014-2015, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
edx/edx-platform
pavelib/servers.py
3
10174
""" Run and manage servers for local development. """ import argparse import sys from paver.easy import call_task, cmdopts, consume_args, needs, sh, task from .assets import collect_assets from .utils.cmd import cmd, django_cmd from .utils.envs import Env from .utils.process import run_multi_processes, run_process ...
agpl-3.0
ppanczyk/ansible
lib/ansible/modules/packaging/language/easy_install.py
41
6867
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Matt Wright <matt@nobien.net> # 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
ClearCorp/odoo-clearcorp
TODO-9.0/account_invoice_journal_defaults/account_invoice_journal_defaults.py
3
8382
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
jean/sentry
tests/sentry/api/endpoints/test_organization_member_team_details.py
2
5902
from __future__ import absolute_import from django.core.urlresolvers import reverse from sentry.models import (Organization, OrganizationAccessRequest, OrganizationMemberTeam) from sentry.testutils import APITestCase class CreateOrganizationMemberTeamTest(APITestCase): def test_can_join_as_owner_without_open_me...
bsd-3-clause
convexengineering/gplibrary
gpkitmodels/GP/aircraft/wing/wing_test.py
1
2433
" wing test " from gpkitmodels.GP.aircraft.wing.wing import Wing from gpkitmodels.GP.aircraft.wing.wing_skin import WingSkin from gpkitmodels.GP.aircraft.wing.wing_core import WingCore from gpkitmodels.GP.aircraft.wing.boxspar import BoxSpar from gpkit import Model, parse_variables #pylint: disable=no-member, exec-use...
mit
htzy/bigfour
lms/djangoapps/commerce/__init__.py
18
1176
""" Commerce app. """ from django.conf import settings from ecommerce_api_client.client import EcommerceApiClient from eventtracking import tracker def create_tracking_context(user): """ Assembles attributes from user and request objects to be sent along in ecommerce api calls for tracking purposes. """ r...
agpl-3.0
irvingpop/digital-beer-menu
src/lib/flaskext/wtf/recaptcha/validators.py
27
2281
import urllib2 from flask import request, current_app from wtforms import ValidationError from werkzeug import url_encode RECAPTCHA_VERIFY_SERVER = 'http://api-verify.recaptcha.net/verify' __all__ = ["Recaptcha"] class Recaptcha(object): """Validates a ReCaptcha.""" _error_codes = { 'invalid-site-...
gpl-2.0
theflofly/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/mvn_diag_test.py
22
11376
# 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
ovidiul/XCloner-Wordpress
vendor/sabre/dav/bin/googlecode_upload.py
124
8913
#!/usr/bin/env python # # Copyright 2006, 2007 Google Inc. All Rights Reserved. # Author: danderson@google.com (David Anderson) # # Script for uploading files to a Google Code project. # # This is intended to be both a useful script for people who want to # streamline project uploads and a reference implementation for ...
gpl-2.0
ibm-research-ireland/sparkoscope
python/pyspark/ml/tests.py
10
67778
# # 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
kellielu/q
lib/werkzeug/test.py
183
34152
# -*- coding: utf-8 -*- """ werkzeug.test ~~~~~~~~~~~~~ This module implements a client to WSGI applications for testing. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import sys import mimetypes from time import time from...
apache-2.0
dirkjot/kivy
kivy/core/audio/audio_gstplayer.py
40
2636
''' Audio Gstplayer =============== .. versionadded:: 1.8.0 Implementation of a VideoBase with Kivy :class:`~kivy.lib.gstplayer.GstPlayer` This player is the prefered player, using Gstreamer 1.0, working on both Python 2 and 3. ''' from kivy.lib.gstplayer import GstPlayer, get_gst_version from kivy.core.audio import...
mit
yufish/youtube-dl
youtube_dl/extractor/vgtv.py
102
7096
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, ) class VGTVIE(InfoExtractor): IE_DESC = 'VGTV and BTTV' _VALID_URL = r'''(?x) (?: vgtv:| ...
unlicense
Azure/azure-sdk-for-python
sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_vpn_gateways_operations.py
1
30312
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
nitin-cherian/LifeLongLearning
Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/jedi/evaluate/representation.py
3
25594
""" Like described in the :mod:`jedi.parser.python.tree` module, there's a need for an ast like module to represent the states of parsed modules. But now there are also structures in Python that need a little bit more than that. An ``Instance`` for example is only a ``Class`` before it is instantiated. This class repr...
mit
tima/ansible
lib/ansible/plugins/vars/__init__.py
128
1329
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.be> # # 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 Foundat...
gpl-3.0
livecd-tools/livecd-tools
imgcreate/errors.py
4
1198
# # errors.py : exception definitions # # Copyright 2007, Red Hat, Inc. # Copyright 2017, Fedora Project # # 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 prog...
gpl-2.0
todaychi/hue
desktop/core/ext-py/Django-1.6.10/tests/servers/test_basehttp.py
45
2207
import sys from django.core.servers.basehttp import WSGIRequestHandler from django.test import TestCase from django.utils.six import BytesIO, StringIO class Stub(object): def __init__(self, **kwargs): self.__dict__.update(kwargs) class WSGIRequestHandlerTestCase(TestCase): def test_strips_undersco...
apache-2.0
FedoraScientific/salome-smesh
src/Tools/blocFissure/gmu/facesFissure.py
1
2085
# -*- coding: utf-8 -*- import logging from geomsmesh import geompy # ----------------------------------------------------------------------------- # --- faces fissure dans et hors tore, et edges face hors tore def facesFissure(blocp, faceFissure, extrusionDefaut, genint): """ extraction des faces de fissure dan...
lgpl-2.1
rubyinhell/brython
www/src/Lib/unittest/test/testmock/testmagicmethods.py
737
12145
import unittest import inspect import sys from unittest.mock import Mock, MagicMock, _magics class TestMockingMagicMethods(unittest.TestCase): def test_deleting_magic_methods(self): mock = Mock() self.assertFalse(hasattr(mock, '__getitem__')) mock.__getitem__ = Mock() self.asser...
bsd-3-clause
vincentintime/vnpy
vn.trader/ctpGateway.py
9
36058
# encoding: UTF-8 from vnctpmd import MdApi from vnctptd import TdApi from gateway import * import os ######################################################################## class CtpGateway(VtGateway): """CTP接口""" #---------------------------------------------------------------------- def __init__(s...
mit
sublime1809/django
django/db/models/related.py
34
3413
from collections import namedtuple from django.utils.encoding import smart_text from django.db.models.fields import BLANK_CHOICE_DASH # PathInfo is used when converting lookups (fk__somecol). The contents # describe the relation in Model terms (model Options and Fields for both # sides of the relation. The join_field...
bsd-3-clause
Bulochkin/tensorflow_pack
tensorflow/contrib/memory_stats/python/ops/memory_stats_ops.py
67
1396
# 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
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/action/copy.py
21
26766
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2017 Toshio Kuratomi <tkuraotmi@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...
bsd-3-clause
ClusterHQ/libcloud
libcloud/test/compute/test_abiquo.py
1
20736
# 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
littleweaver/django-daguerre
daguerre/adjustments.py
1
11610
from PIL import Image from daguerre.utils import exif_aware_resize, exif_aware_size class AdjustmentRegistry(object): def __init__(self): self._registry = {} self._default = None def register(self, cls): self._registry[cls.__name__.lower()] = cls return cls def __getitem...
bsd-3-clause
herow/planning_qgis
python/plugins/processing/algs/lidar/lastools/lasground.py
9
3362
# -*- coding: utf-8 -*- """ *************************************************************************** lasground.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com --------------------- ...
gpl-2.0
bdrung/audacity
lib-src/lv2/lv2/plugins/eg-fifths.lv2/waflib/Context.py
177
8376
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,imp,sys from waflib import Utils,Errors,Logs import waflib.Node HEXVERSION=0x1071000 WAFVERSION="1.7.16" WAFREVISION="73c1705078f8c9c51a33e20f221a309d5a94b5e1" ABI=9...
gpl-2.0
CouchPotato/CouchPotatoV1
library/sqlalchemy/dialects/mysql/pyodbc.py
18
2514
"""Support for the MySQL database via the pyodbc adapter. pyodbc is available at: http://pypi.python.org/pypi/pyodbc/ Connecting ---------- Connect string:: mysql+pyodbc://<username>:<password>@<dsnname> Limitations ----------- The mysql-pyodbc dialect is subject to unresolved character encoding issues ...
gpl-3.0
jinnykoo/wuyisj
src/oscar/apps/order/south_migrations/0017_auto__add_field_order_shipping_code.py
13
36010
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Order.shipping_code' db...
bsd-3-clause
DataDog/integrations-extras
tidb/tests/conftest.py
1
3226
import os from copy import deepcopy import mock import pytest from datadog_checks.dev import get_docker_hostname, get_here HERE = get_here() HOST = get_docker_hostname() TIDB_PORT = 10080 TIKV_PORT = 20180 PD_PORT = 2379 TIFLASH_PROXY_PORT = 20292 TIFLASH_PORT = 8234 TICDC_PORT = 8301 DM_MASTER_PORT = 8261 DM_WORKER...
bsd-3-clause
gzzhanghao/mitmproxy
mitmproxy/protocol/http_replay.py
3
4482
from __future__ import absolute_import, print_function, division import traceback import netlib.exceptions from mitmproxy import controller from mitmproxy import exceptions from mitmproxy import models from netlib.http import http1 from netlib import basethread # TODO: Doesn't really belong into mitmproxy.protocol....
mit
lhl/vrdev
002-pyopengl/PyOpenGL-Demo-3.0.1b1/PyOpenGL-Demo/dek/PILNumeric.py
2
1160
# This is statement is required by the build system to query build info if __name__ == '__build__': raise Exception ## This isn't really a PyOpenGL demo, but it's a nice ## example of how Numeric, Tkinter, and PIL can be used ## together to create all sorts of images. try: import numpy as Numeric except ImportError...
apache-2.0
joealcorn/xbox
xbox/vendor/requests/packages/chardet/compat.py
2943
1157
######################## BEGIN LICENSE BLOCK ######################## # Contributor(s): # Ian Cordasco - port to Python # # 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 # versio...
mit
fernandalavalle/mlab-ns
environment_bootstrap.py
1
1853
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright 2015 Measurement Lab # # 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
R4stl1n/allianceauth
allianceauth/services/modules/mumble/auth_hooks.py
5
2642
import logging from django.conf import settings from django.template.loader import render_to_string from allianceauth.notifications import notify from allianceauth import hooks from allianceauth.services.hooks import ServicesHook from .tasks import MumbleTasks from .models import MumbleUser from .urls import urlpatte...
gpl-2.0
KyleJamesWalker/ansible
lib/ansible/modules/files/acl.py
44
11662
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
gpl-3.0
OsirisSPS/osiris-sps
client/share/plugins/AF9A4C281070FDB0F34CF417CDB168AB38C8A388/lib/plat-irix6/readcd.py
132
8576
# Class interface to the CD module. from warnings import warnpy3k warnpy3k("the readcd module has been removed in Python 3.0", stacklevel=2) del warnpy3k import cd, CD class Error(Exception): pass class _Stop(Exception): pass def _doatime(self, cb_type, data): if ((data[0] * 60) + data[1]) * 75 + data[2]...
gpl-3.0
mkieszek/odoo
addons/purchase/partner.py
3
1605
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import fields, osv class res_partner(osv.osv): _name = 'res.partner' _inherit = 'res.partner' def _purchase_invoice_count(self, cr, uid, ids, field_name, arg, context=None): Purchas...
agpl-3.0
odin1314/security_monkey
security_monkey/views/__init__.py
6
4669
# Copyright 2014 Netflix, 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
liberation/django-elasticsearch
test_project/test_app/views.py
5
2183
from django.core import serializers from django.http import HttpResponse from django.db.models import Model from django.views.generic.detail import SingleObjectMixin from django_elasticsearch.views import ElasticsearchListView from django_elasticsearch.views import ElasticsearchDetailView from test_app.models import...
mit
grandchild/autohidewibox
autohidewibox.py
1
6439
#!/usr/bin/env python3 import configparser import os.path as path import re import subprocess import sys import threading MODE_TRANSIENT = "transient" MODE_TOGGLE = "toggle" config = configparser.ConfigParser() try: user_awesome_conf = path.join( path.expanduser("~"), ".config/awesome/autohidewibox.conf" ...
cc0-1.0
zhukaixy/kbengine
kbe/src/lib/python/Lib/ctypes/test/test_internals.py
113
2631
# This tests the internal _objects attribute import unittest from ctypes import * from sys import getrefcount as grc # XXX This test must be reviewed for correctness!!! # ctypes' types are container types. # # They have an internal memory block, which only consists of some bytes, # but it has to keep references to ot...
lgpl-3.0
dendisuhubdy/tensorflow
tensorflow/contrib/framework/python/ops/checkpoint_ops.py
76
8864
# 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
ATNF/askapsdp
Code/Base/py-iceutils/current/askap/iceutils/icesession.py
1
8460
#!/usr/bin/env python # Copyright (c) 2012 CSIRO # Australia Telescope National Facility (ATNF) # Commonwealth Scientific and Industrial Research Organisation (CSIRO) # PO Box 76, Epping NSW 1710, Australia # atnf-enquiries@csiro.au # # This file is part of the ASKAP software distribution. # # The ASKAP software distri...
gpl-2.0
varigit/VAR-SOM-AM33-Kernel-3-14
tools/perf/util/setup.py
989
1543
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
eloquence/unisubs
apps/videos/tests/test_video_types.py
2
14077
# -*- coding: utf-8 -*- # Amara, universalsubtitles.org # # Copyright (C) 2013 Participatory Culture Foundation # # 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 #...
agpl-3.0
pgmillon/ansible
lib/ansible/modules/network/fortios/fortios_address.py
24
10246
#!/usr/bin/python # # Ansible module to manage IP addresses on fortios devices # (c) 2016, Benjamin Jolivot <bjolivot@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_M...
gpl-3.0
sim0629/linux-openwrt
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
hashems/Mobile-Cloud-Development-Projects
appengine/standard/taskqueue/counter/worker.py
9
1335
# 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 a...
apache-2.0
miguelgrinberg/Flask-Moment
docs/conf.py
1
2232
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
mit
gabrielhuang/OhSnap
segment.py
1
3771
import pyaudio import sys import wave import numpy as np import scipy.ndimage import scipy.signal import matplotlib.pyplot as plt from sklearn.externals import joblib def decode(in_data, channels): """ Convert a byte stream into a 2D numpy array with shape (chunk_size, channels) Samples are interleave...
mit
golismero/golismero-devel
plugins/testing/scan/zone_transfer.py
8
3586
#!/usr/bin/python # -*- coding: utf-8 -*- __license__ = """ GoLismero 2.0 - The web knife - Copyright (C) 2011-2014 Golismero project site: http://golismero-project.com Golismero project mail: contact@golismero-project.com This program is free software; you can redistribute it and/or modify it under the terms of th...
gpl-2.0
aspuru-guzik-group/mission_control
setup.py
1
1103
import os from setuptools import find_packages, setup # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) dependencies = [ *[ {'install_requires_value': simple_dependency} for simple_dependency in [ 'dill', ...
apache-2.0
sbellem/django
tests/auth_tests/test_templates.py
328
2785
from django.contrib.auth import authenticate from django.contrib.auth.models import User from django.contrib.auth.tokens import PasswordResetTokenGenerator from django.contrib.auth.views import ( password_change, password_change_done, password_reset, password_reset_complete, password_reset_confirm, password_res...
bsd-3-clause
jorik041/robotframework
utest/result/test_visitor.py
36
1590
import unittest from os.path import dirname, join from robot.result import ExecutionResult from robot.result.visitor import SuiteVisitor RESULT = ExecutionResult(join(dirname(__file__), 'golden.xml')) class TestVisitingSuite(unittest.TestCase): def test_abstract_visitor(self): RESULT.suite.visit(Suite...
apache-2.0
idrogeno/FusionOE
lib/python/Components/TuneTest.py
28
10716
from enigma import eDVBFrontendParametersSatellite, eDVBFrontendParametersTerrestrial, eDVBFrontendParametersCable, eDVBFrontendParameters, eDVBResourceManager, eTimer class Tuner: def __init__(self, frontend, ignore_rotor=False): self.frontend = frontend self.ignore_rotor = ignore_rotor # transponder = (freque...
gpl-2.0
druuu/django
tests/csrf_tests/tests.py
152
19350
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_KEY_LENGTH, CsrfViewMiddleware, get_token, ) from django.template import RequestContext, Template from django....
bsd-3-clause
krousey/test-infra
triage/summarize.py
5
18589
#!/usr/bin/env python2 # Copyright 2017 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
InstaMineNuggets/InstaMineNuggets
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
annarev/tensorflow
tensorflow/python/training/training_ops_test.py
9
19664
# 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
JGarcia-Panach/odoo
addons/note/note.py
223
8893
# -*- 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
Pajinek/spacewalk
client/tools/rhncfg/config_management/rhncfg-manager.py
7
1282
#!/usr/bin/python # # Copyright (c) 2008--2013 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should...
gpl-2.0
SafeStack/ava
ava_core/gather/gather_ldap/views.py
2
10561
import json import logging from rest_framework import status, viewsets, permissions from rest_framework.response import Response from ava_core.abstract.permissions import IsRetrieveOnly from ava_core.organize.models import Group, Person, Identifier from ava_core.organize.tasks import task_run_intro_email from ava_cor...
gpl-3.0
moto-timo/robotframework
src/robot/reporting/resultwriter.py
4
5932
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
apache-2.0
Pinecast/pinecast
notifications/migrations/0003_notificationevent.py
3
1085
# -*- coding: utf-8 -*- # Generated by Django 1.11 on 2018-05-01 01:54 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import uuid class Migration(migrations.Migration): dependencies = [ ('podcasts', '0048_auto_20180501_0154'), ('...
apache-2.0
marqh/cartopy
lib/cartopy/io/shapereader.py
1
8691
# (C) British Crown Copyright 2011 - 2012, Met Office # # This file is part of cartopy. # # cartopy 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 3 of the License, or # (at your option)...
gpl-3.0
yudingding6197/fin_script
debug/sina_guben.py
1
1796
#!/usr/bin/env python # -*- coding:gbk -*- import sys import re import os import string import datetime import urllib import urllib2 from openpyxl import Workbook from openpyxl.reader.excel import load_workbook sys.path.append(".") sys.path.append("..") from internal.ts_common import * #µÃµ½ËùÓеĹɱ¾±ä¶¯ÐÅÏ¢£¬ÐèÒªµ...
gpl-2.0
akhmadMizkat/odoo
addons/report_webkit/convert.py
47
1389
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # Author : Nicolas Bessi (Camptocamp) from openerp.tools import convert original_xml_import = convert.xml_import class WebkitXMLImport(original_xml_import...
gpl-3.0
corygiltner/CSB
bp_includes/external/babel/messages/tests/extract.py
36
19857
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists of v...
lgpl-3.0
mbayon/TFG-MachineLearning
vbig/lib/python2.7/site-packages/pandas/tests/plotting/test_series.py
6
30296
# coding: utf-8 """ Test cases for Series.plot """ import itertools import pytest from datetime import datetime import pandas as pd from pandas import Series, DataFrame, date_range from pandas.compat import range, lrange import pandas.util.testing as tm from pandas.util.testing import slow import numpy as np from...
mit
joshmoore/openmicroscopy
components/tools/OmeroFS/test/drivers.py
1
13464
#!/usr/bin/env python """ Utility classes for generating file-system-like events for testing. Copyright 2009 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import exceptions import logging import os import threading import time import unittest im...
gpl-2.0
tsgit/invenio
modules/bibrank/lib/bibrankadmin_regression_tests.py
17
2863
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## Licens...
gpl-2.0
ChinaMassClouds/copenstack-server
openstack/src/horizon-2014.2/openstack_dashboard/dashboards/admin/volumes/volume_types/extras/tables.py
14
2569
# 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...
gpl-2.0
dannyboi104/SickRage
lib/guessit/test/test_hashes.py
33
1966
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
kustodian/ansible
lib/ansible/module_utils/network/netvisor/pn_nvos.py
38
1832
# Copyright: (c) 2018, Pluribus Networks # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) # from __future__ import absolute_import, division, print_function __metaclass__ = type from ansible.module_utils.network.netvisor.netvisor import run_commands def pn_...
gpl-3.0
bigswitch/nova
nova/conductor/rpcapi.py
3
15993
# Copyright 2013 IBM Corp. # Copyright 2013 Red Hat, 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 r...
apache-2.0
yarshure/v2ex
mapreduce/util.py
19
4805
#!/usr/bin/env python # # Copyright 2010 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...
bsd-3-clause
lildadou/Flexget
flexget/api/schema.py
1
1296
from flask import jsonify from flexget.api import api, APIResource from flexget.config_schema import schema_paths, resolve_ref schema_api = api.namespace('schema', description='Config and plugin schemas') _plugins_cache = None schema_api_list = api.schema('schema.list', { 'type': 'object', 'properties': { ...
mit
keen99/SickRage
lib/hachoir_core/field/__init__.py
94
2280
# Field classes from hachoir_core.field.field import Field, FieldError, MissingField, joinPath from hachoir_core.field.bit_field import Bit, Bits, RawBits from hachoir_core.field.byte_field import Bytes, RawBytes from hachoir_core.field.sub_file import SubFile, CompressedField from hachoir_core.field.character import C...
gpl-3.0