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
ThinkingBridge/platform_external_chromium_org
chrome/common/extensions/docs/server2/manifest_data_source_test.py
23
2819
#!/usr/bin/env python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import json import unittest from compiled_file_system import CompiledFileSystem from manifest_data_source import ManifestDataSource fr...
bsd-3-clause
feigaochn/leetcode
p116_populating_next_right_pointers_in_each_node.py
2
2293
# coding: utf-8 # author: Fei Gao <leetcode.com@feigao.xyz> # Problem: populating next right pointers in each node # # Given a binary tree # # struct TreeLinkNode { # TreeLinkNode *left; # TreeLinkNode *right; # TreeLinkNode *next; # } # # Populate each next pointer to point to its next ri...
mit
nikste/tensorflow
tensorflow/compiler/tests/lstm.py
132
6452
# 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
nhenezi/kuma
kuma/search/decorators.py
26
1278
import logging from django.db.models.signals import pre_delete from elasticsearch.exceptions import ConnectionError from kuma.wiki.signals import render_done from .signals import render_done_handler, pre_delete_handler log = logging.getLogger('kuma.search.decorators') def requires_good_connection(fun): """D...
mpl-2.0
mattuuh7/incubator-airflow
airflow/example_dags/docker_copy_data.py
22
3304
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
JohnVCS/fossologyFunTime
newsrc/nodeDict.py
1
1062
#!/usr/bin/python # Copyright (C) 2016 Jesse Moseman, and John Carlo B. Viernes IV # # This file is part of fossologyFunTime. # # fossologyFunTime 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 versio...
gpl-2.0
abhijo89/Django-facebook
docs/docs_env/Lib/encodings/cp855.py
593
34106
""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.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'): ...
bsd-3-clause
ubic135/odoo-design
addons/hr_holidays/report/hr_holidays_report.py
341
2369
# -*- 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
AstroPrint/AstroBox
src/astroprint/printfiles/gcode.py
1
10242
# coding=utf-8 from __future__ import absolute_import __author__ = "Gina Häußge <osd@foosel.net> based on work by David Braam" __author__ = "Daniel Arroyo. 3DaGogo, Inc <daniel@astroprint.com>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' import os import logging import math...
agpl-3.0
dacjames/scrapy
scrapy/spiders/feed.py
151
5441
""" This module implements the XMLFeedSpider which is the recommended spider to use for scraping from an XML feed. See documentation in docs/topics/spiders.rst """ from scrapy.spiders import Spider from scrapy.utils.iterators import xmliter, csviter from scrapy.utils.spider import iterate_spider_output from scrapy.sel...
bsd-3-clause
broesamle/servo
components/script/dom/bindings/codegen/parser/tests/test_constructor.py
102
5283
import WebIDL def WebIDLTest(parser, harness): def checkArgument(argument, QName, name, type, optional, variadic): harness.ok(isinstance(argument, WebIDL.IDLArgument), "Should be an IDLArgument") harness.check(argument.identifier.QName(), QName, "Argument has the right QName") ...
mpl-2.0
AzamYahya/shogun
examples/undocumented/python_modular/graphical/converter_ffsep_bss.py
26
1095
""" Blind Source Separation using the FFSep Algorithm with Shogun Based on the example from scikit-learn http://scikit-learn.org/ Kevin Hughes 2013 """ import numpy as np import pylab as pl from modshogun import RealFeatures from modshogun import FFSep # Generate sample data np.random.seed(0) n_samples = 2000 ti...
gpl-3.0
mquandalle/rethinkdb
external/v8_3.30.33.16/build/gyp/test/mac/gyptest-xctest.py
221
1196
#!/usr/bin/env python # Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Verifies that xctest targets are correctly configured. """ import TestGyp import sys if sys.platform == 'darwin': test = TestGyp.Te...
agpl-3.0
vighneshbirodkar/scikit-image
doc/examples/color_exposure/plot_adapt_rgb.py
9
4535
""" ========================================= Adapting gray-scale filters to RGB images ========================================= There are many filters that are designed to work with gray-scale images but not with color images. To simplify the process of creating functions that can adapt to RGB images, scikit-image p...
bsd-3-clause
40423107/2017springcd_hw
plugin/liquid_tags/test_flickr.py
278
2466
from . import flickr try: from unittest.mock import patch except ImportError: from mock import patch import os import pytest import re PLUGIN_DIR = os.path.dirname(__file__) TEST_DATA_DIR = os.path.join(PLUGIN_DIR, 'test_data') @pytest.mark.parametrize('input,expected', [ ('18873146680 large "test 1"', ...
agpl-3.0
codysoyland/django-grappelli
grappelli/sites.py
1
9327
# coding: utf-8 import re from django import http, template from django.contrib.admin import ModelAdmin from django.contrib.admin import actions from django.contrib.auth import authenticate, login from django.db.models.base import ModelBase from django.core.exceptions import ImproperlyConfigured from django.core.urlre...
bsd-3-clause
kvaps/vdsm
vdsm_hooks/hostusb/after_vm_destroy.py
1
2558
#!/usr/bin/python import os import re import sys import traceback import hooking ''' after_vm_destroy: return the original owner of the usb device ''' HOOK_HOSTUSB_PATH = '/var/run/vdsm/hooks/hostusb-permissions' def get_owner(devpath): uid = pid = -1 content = '' if not os.path.isfile(HOOK_HOSTUSB_P...
gpl-2.0
manojgudi/sandhi
modules/gr36/gnuradio-core/src/python/gnuradio/gr/prefs.py
13
3739
# # Copyright 2006,2009 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version...
gpl-3.0
Technocaveman/There-is-no-Third-Step
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/templates.py
291
56003
# -*- coding: utf-8 -*- """ pygments.lexers.templates ~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for various template engines' markup. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexers.web import \ PhpLexer, H...
mit
WhiteMagic/JoystickGremlin
gremlin/ui/dialogs.py
1
45199
# -*- coding: utf-8; -*- # Copyright (C) 2015 - 2019 Lionel Ott # # 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. # # T...
gpl-3.0
lthurlow/Boolean-Constrained-Routing
networkx-1.8.1/build/lib/networkx/algorithms/isolate.py
46
1669
# encoding: utf-8 """ Functions for identifying isolate (degree zero) nodes. """ # Copyright (C) 2004-2011 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import networkx as nx __author__ = """\n""".join(['D...
mit
moio/spacewalk
backend/server/test/unit-test/test_rhnLib_timestamp.py
1
2399
#!/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
Marshal-82/pi_video_looper
Adafruit_Video_Looper/usb_drive_mounter.py
8
3078
# Copyright 2015 Adafruit Industries. # Author: Tony DiCola # License: GNU GPLv2, see LICENSE.txt import glob import subprocess import time import pyudev class USBDriveMounter(object): """Service for automatically mounting attached USB drives.""" def __init__(self, root='/mnt/usbdrive', readonly=False): ...
gpl-2.0
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py
360
7937
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
gpl-3.0
anoopcs9/samba
python/samba/kcc/ldif_import_export.py
10
14000
# LDIF helper functions for the samba_kcc tool # # Copyright (C) Dave Craft 2011 # Copyright (C) Andrew Bartlett 2015 # # Andrew Bartlett's alleged work performed by his underlings Douglas # Bagnall and Garming Sam. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU...
gpl-3.0
UTNkar/moore
src/materialize/templatetags/materialize.py
1
1928
from django import template from django.template import loader from django.utils.translation import gettext_lazy as _ register = template.Library() def get_widget_name(field): return field.field.widget.__class__.__name__ def append_classes(field, widget=''): field.field.label_suffix = '' classes = fiel...
agpl-3.0
splav/servo
components/script/dom/bindings/codegen/parser/tests/test_extended_attributes.py
8
2886
import WebIDL def WebIDLTest(parser, harness): parser.parse(""" [NoInterfaceObject] interface TestExtendedAttr { [Unforgeable] readonly attribute byte b; }; """) results = parser.finish() parser = parser.reset() parser.parse(""" [Pref="foo.bar",Pref=flop]...
mpl-2.0
benpatterson/edx-platform
lms/djangoapps/verify_student/admin.py
48
1958
from ratelimitbackend import admin from verify_student.models import ( SoftwareSecurePhotoVerification, VerificationStatus, SkippedReverification, ) class SoftwareSecurePhotoVerificationAdmin(admin.ModelAdmin): """ Admin for the SoftwareSecurePhotoVerification table. """ list_display = ('i...
agpl-3.0
trondhindenes/ansible
lib/ansible/modules/windows/win_environment.py
35
2820
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
annajordanous/network-analysis
get_minimal.py
2
5752
import add_data as ad import get_soundcloud_data as gsd import genre_relationships as gr import sqlite3 class DbHandler(object): def __init__(self,db_name): self.conn = sqlite3.connect(db_name) self.curs = self.conn.cursor() def create_table(self,table_name): ad.create_table(self.curs,...
gpl-2.0
sanger-pathogens/ariba
ariba/tests/reference_data_test.py
2
32281
import unittest import filecmp import os import pyfastaq from ariba import reference_data, sequence_metadata modules_dir = os.path.dirname(os.path.abspath(reference_data.__file__)) data_dir = os.path.join(modules_dir, 'tests', 'data') class TestReferenceData(unittest.TestCase): def test_init_fails(self): ...
gpl-3.0
stepos01/ns3-lr-wpan-mlme
src/visualizer/visualizer/base.py
160
3799
import ns.point_to_point import ns.csma import ns.wifi import ns.bridge import ns.internet import ns.mesh import ns.wimax import ns.wimax import ns.lte import gobject import os.path import sys PIXELS_PER_METER = 3.0 # pixels-per-meter, at 100% zoom level class PyVizObject(gobject.GObject): __gtype_name__ = "PyVi...
gpl-2.0
TedaLIEz/sentry
src/sentry/rules/conditions/tagged_event.py
25
2665
""" sentry.rules.conditions.tagged_event ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from collections import OrderedDict from django import forms from sentry.r...
bsd-3-clause
BT-jmichaud/account-financial-reporting
account_financial_report_webkit/__openerp__.py
18
8410
# -*- encoding: utf-8 -*- ############################################################################## # # Authors: Nicolas Bessi, Guewen Baconnier # Copyright Camptocamp SA 2011 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
agpl-3.0
wolverineav/neutron
neutron/extensions/bgp.py
3
8616
# Copyright 2016 Hewlett Packard Development Coompany LP # # 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 la...
apache-2.0
charlesbrandt/medley
medley/playlist.py
1
15002
from __future__ import print_function from __future__ import absolute_import from builtins import str from builtins import next from builtins import object import os, codecs, re from .helpers import save_json, load_json from .content import Content class Position(object): """ more than just a number of an item...
mit
mcarton/thefuck
tests/rules/test_fix_file.py
3
7028
# -*- coding: utf-8 -*- import pytest import os from thefuck.rules.fix_file import match, get_new_command from tests.utils import Command # (script, file, line, col (or None), stdout, stderr) tests = ( ('gcc a.c', 'a.c', 3, 1, '', """ a.c: In function 'main': a.c:3:1: error: expected expression before '}' token } ...
mit
windskyer/nova
nova/tests/unit/virt/test_imagecache.py
63
7011
# Copyright 2013 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 ...
gpl-2.0
Scriptkiddi/Ankipubsub-Client
pubsub/gui/auto_gen/publish_deck.py
1
4376
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'publish_deck.ui' # # Created by: PyQt4 UI code generator 4.11.4 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: def _fromUtf8(...
gpl-3.0
TheNikiz/android_kernel_huawei_msm8909
scripts/gcc-wrapper.py
580
3524
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
gzc/isystem
bigdata/spark/sparktest/ml/kmeans.py
1
1161
# -*- coding: utf-8 -*- from pyspark.mllib.clustering import KMeans, KMeansModel from numpy import array from math import sqrt from pyspark import SparkContext, SparkConf conf = SparkConf() conf.setAppName("deep test")#.setMaster("spark://192.168.1.14:7077")#.setExecutorEnv("CLASSPATH", path) #conf.set("spark.schedule...
mit
yjpark/dotfiles
bin/osx/unity-fix-sln.py
1
3323
#!/usr/bin/env python import os import sys import argparse import glob from threading import Timer from blessings import Terminal term = Terminal() test_mode = False verbose_mode = False watch_delay = 5 def info(msg): print term.normal + msg def verbose(msg): if verbose_mode: info(msg) def error(...
mit
tudyzhb/yichui
djangotoolbox/db/basecompiler.py
5
22890
import datetime import random from django.conf import settings from django.db.models.fields import NOT_PROVIDED from django.db.models.query import QuerySet from django.db.models.sql import aggregates as sqlaggregates from django.db.models.sql.compiler import SQLCompiler from django.db.models.sql.constants import LOOKU...
bsd-3-clause
proxysh/Safejumper-for-Desktop
buildmac/Resources/env/lib/python2.7/site-packages/pip/_vendor/retrying.py
934
9972
## Copyright 2013-2014 Ray Holder ## ## 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 ...
gpl-2.0
intfrr/laikaboss
laikaboss/modules/explode_ole.py
17
3204
# Copyright 2015 Lockheed Martin 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 required by applicable law or agr...
apache-2.0
quantrocket-llc/quantrocket-client
quantrocket/db.py
1
11911
# Copyright 2017 QuantRocket - 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 ...
apache-2.0
Jgarcia-IAS/localizacion
openerp/addons-extra/odoo-pruebas/odoo-server/addons/hr_attendance/wizard/__init__.py
375
1073
# -*- 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
waprin/continuous-deployment-demo
lib/werkzeug/debug/console.py
280
5557
# -*- coding: utf-8 -*- """ werkzeug.debug.console ~~~~~~~~~~~~~~~~~~~~~~ Interactive console support. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD. """ import sys import code from types import CodeType from werkzeug.utils import escape from werkzeug.loca...
apache-2.0
batxes/4c2vhic
Six_zebra_models/Six_zebra_models_final_output_0.1_-0.1_13000/Six_zebra_models48389.py
2
13921
import _surface import chimera try: import chimera.runCommand except: pass from VolumePath import markerset as ms try: from VolumePath import Marker_Set, Link new_marker_set=Marker_Set except: from VolumePath import volume_path_dialog d= volume_path_dialog(True) new_marker_set= d.new_marker_set marker_set...
gpl-3.0
Pike/elmo
apps/elmo_commons/tests/test_bleach.py
2
1492
# 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/. """tests for bleach filter""" from __future__ import absolute_import from __future__ import unicode_literals from djang...
mpl-2.0
xchenum/quantum
quantum/plugins/cisco/common/cisco_credentials_v2.py
9
3007
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 Cisco Systems, 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...
apache-2.0
google/earthenterprise
earth_enterprise/src/server/wsgi/common/string_utils.py
5
1113
#!/usr/bin/env python2.7 # # Copyright 2017 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 l...
apache-2.0
xychix/gtrcrt
sendPacket.py
1
4229
#!/usr/bin/python # Version 0.1 # This is POC code to proof that we can send out spoofed packets to arrive on the other end maintaining needed data. # Ensure a wireshark / tcpdump is listening on the catcher side # Python and Impacket need to be installed import socket import re import struct import types import str...
gpl-2.0
seanli9jan/tensorflow
tensorflow/python/profiler/profiler_test.py
63
8452
# 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
zcbenz/cefode-chromium
build/linux/rewrite_dirs.py
259
2013
#!/usr/bin/env python # Copyright (c) 2011 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. """Rewrites paths in -I, -L and other option to be relative to a sysroot.""" import sys import os import optparse REWRITE_PREFIX ...
bsd-3-clause
aforalee/keystone
keystone/trust/core.py
8
9651
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
jaggu303619/asylum
openerp/addons/hr_payroll/wizard/hr_payroll_contribution_register_report.py
52
2123
# -*- 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
melbit-kevinwessel/ansible-modules-extras
cloud/lxc/lxc_container.py
28
55183
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Kevin Carter <kevin.carter@rackspace.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...
gpl-3.0
adist/drunken-sansa
openerp/addons/warning/warning.py
13
14330
# -*- 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
nitely/http-lazy-headers
http_lazy_headers/fields/content_range.py
1
7244
# -*- coding: utf-8 -*- from ..shared.generic import cleaners from ..shared.utils import constraints from .. import exceptions from ..settings import settings from ..shared import bases from ..shared.values import ranges from ..shared.utils import assertions def content_range_bytes( start=None, end=N...
mit
thombashi/DataProperty
test/test_function.py
1
4369
""" .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ import pytest from dataproperty import get_integer_digit, get_number_of_digit nan = float("nan") inf = float("inf") class Test_get_integer_digit: @pytest.mark.parametrize( ["value", "expected"], [ [0, 1], ...
mit
UPDDI/mps-database-server
assays/migrations/0039.py
1
2368
# Generated by Django 2.2.10 on 2020-05-11 17:00 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('cellsamples', '0010'), ('drugtrials', '0011'), ('assays', '0038'), ] operations = [ migrat...
mit
fisheess/modular_SSD_tensorflow
nets/lenet.py
1
3641
# 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...
mit
horstjens/ThePythonGameBook
en/python/battleship/chat_server.py
1
3173
#!/usr/bin/env python3 """Server for multithreaded (asynchronous) chat application.""" from socket import AF_INET, socket, SOCK_STREAM from threading import Thread def accept_incoming_connections(): """Sets up handling for incoming clients.""" while True: client, client_address = SERVER.accept() # c...
gpl-3.0
mountain213/neo4jworkshop
REST_clients/Python_client/requests/packages/chardet/euckrprober.py
2931
1675
######################## 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...
mit
greenoaktree/pfp
tests/test_fields.py
3
1741
#!/usr/bin/env python # encoding: utf-8 import os try: from StringIO import StringIO # StringIO does not exist in python3 except ImportError as e: from io import StringIO import struct import sys import unittest sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..")) import pfp import pfp.errors from pfp...
mit
tiagocoutinho/bliss
bliss/common/measurementgroup.py
1
6755
# -*- coding: utf-8 -*- # # This file is part of the bliss project # # Copyright (c) 2016 Beamline Control Unit, ESRF # Distributed under the GNU LGPLv3. See LICENSE for more info. import itertools from bliss import setup_globals from bliss.config import settings from .session import get_current as _current_session c...
lgpl-3.0
earthoutreach/pykml
src/utilities/test_gen_pykml.py
7
34140
from pykml.kml_gx.factory import KML_ElementMaker as KML from pykml.kml_gx.factory import ATOM_ElementMaker as ATOM from pykml.kml_gx.factory import GX_ElementMaker as GX doc = KML.kml( KML.Document( KML.name("KML Samples"), KML.open("1"), KML.description("Unleash your creativity with the help of these e...
bsd-3-clause
dcroc16/skunk_works
google_appengine/lib/django-1.4/django/contrib/formtools/tests/wizard/wizardtests/forms.py
313
2203
import os import tempfile from django import forms from django.contrib.auth.models import User from django.core.files.storage import FileSystemStorage from django.forms.formsets import formset_factory from django.forms.models import modelformset_factory from django.http import HttpResponse from django.template import ...
mit
jcpowermac/ansible
lib/ansible/modules/network/nxos/nxos_snmp_contact.py
106
3931
#!/usr/bin/python # # 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 distribut...
gpl-3.0
timheap/wagtail
wagtail/wagtailimages/utils/feature_detection.py
3
2819
import os from django.conf import settings # only try to import OpenCV if WAGTAILIMAGES_FEATURE_DETECTION_ENABLED is True - # avoids spurious "libdc1394 error: Failed to initialize libdc1394" errors on sites that # don't even use OpenCV if getattr(settings, 'WAGTAILIMAGES_FEATURE_DETECTION_ENABLED', False): try: ...
bsd-3-clause
ARMmbed/mbedtls
scripts/mbedtls_dev/build_tree.py
1
1411
"""Mbed TLS build tree information and manipulation. """ # Copyright The Mbed TLS Contributors # SPDX-License-Identifier: Apache-2.0 # # 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:...
apache-2.0
Inspq/ansible
test/units/utils/test_shlex.py
174
1291
# (c) 2015, Marius Gedminas <marius@gedmin.as> # # 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 vers...
gpl-3.0
CeltonMcGrath/TACTIC
src/tactic/ui/examples/fx_anim_examples_wdg.py
6
3464
########################################################### # # Copyright (c) 2009, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
mancoast/CPythonPyc_test
cpython/277_test_startfile.py
120
1421
# Ridiculously simple test of the os.startfile function for Windows. # # empty.vbs is an empty file (except for a comment), which does # nothing when run with cscript or wscript. # # A possible improvement would be to have empty.vbs do something that # we can detect here, to make sure that not only the os.startfile() #...
gpl-3.0
brion/operations-debs-ffmpeg2theorawmf
frontend/Simple Theora Encoder.py
3
8467
#!/usr/bin/env python # vi:si:et:sw=2:sts=2:ts=2 # -*- coding: utf-8 -*- # Written 2007 by j@v2v.cc # # see LICENSE.txt for license information # __version__ = "1.0" import os from os.path import join, dirname, basename, abspath import sys import time import thread import xmlrpclib import wx try: from xml.etree.Ele...
gpl-2.0
rghe/ansible
lib/ansible/modules/system/service.py
26
61239
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@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_v...
gpl-3.0
alsrgv/tensorflow
tensorflow/python/util/memory.py
47
1845
# 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
sarvesh-ranjan/swift
test/unit/container/test_reconciler.py
14
79314
# 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 # distributed under the...
apache-2.0
XiaosongWei/crosswalk-test-suite
apptools/apptools-linux-tests/apptools/build_path.py
18
2180
#!/usr/bin/env python # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of conditions and t...
bsd-3-clause
bgxavier/nova
nova/tests/unit/virt/libvirt/test_designer.py
97
1241
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
apache-2.0
joopert/home-assistant
homeassistant/components/emulated_hue/upnp.py
4
5016
"""Support UPNP discovery method that mimics Hue hubs.""" import threading import socket import logging import select from aiohttp import web from homeassistant import core from homeassistant.components.http import HomeAssistantView _LOGGER = logging.getLogger(__name__) class DescriptionXmlView(HomeAssistantView):...
apache-2.0
Pflanzgurke/glimpse_client
3rdparty/breakpad/src/tools/gyp/test/win/gyptest-command-quote.py
296
1282
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Make sure the program in a command can be a called batch file, or an application in the path. Specifically, this means not quoting some...
bsd-3-clause
ESS-LLP/erpnext
erpnext/education/doctype/course_schedule/course_schedule.py
24
1722
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class CourseSchedule(Document): def validate(self): self.instru...
gpl-3.0
hzc1126/dell_gallo_kernel_ics
tools/perf/scripts/python/sctop.py
895
1936
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
andreaskern/bitcoin
qa/rpc-tests/test_framework/coverage.py
20
2931
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ This module contains utilities for doing coverage analysis on the RPC interface. It provides a way t...
mit
dpwrussell/openmicroscopy
components/tools/OmeroPy/test/unit/tablestest/test_hdfstorage.py
11
10650
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test of the HDF storage for the Tables API. Copyright 2009-2014 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import time import pytest import omero.columns import omero.tables import logging import ...
gpl-2.0
poulpito/Flexget
flexget/tests/test_proper_movies.py
13
1887
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import pytest from jinja2 import Template class TestProperMovies(object): _config = """ templates: global: seen_movies: strict ...
mit
Krossom/python-for-android
python-modules/twisted/twisted/conch/test/test_conch.py
60
13236
# -*- test-case-name: twisted.conch.test.test_conch -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. import os, sys, socket from twisted.cred import portal from twisted.internet import reactor, defer, protocol from twisted.internet.error import ProcessExitedAlready from twisted.py...
apache-2.0
windedge/odoo
addons/l10n_es/__openerp__.py
314
2772
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved. # Jordi Esteve <jesteve@zikzakmedia.com> # Copy...
agpl-3.0
hbrunn/OpenUpgrade
addons/hr_attendance/wizard/__init__.py
375
1073
# -*- 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
TEAM-Gummy/platform_external_chromium_org
third_party/closure_linter/closure_linter/ecmametadatapass.py
155
18062
#!/usr/bin/env python # # Copyright 2010 The Closure Linter 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 #...
bsd-3-clause
resmo/cloudstack
test/integration/plugins/nuagevsp/test_nuage_vpc_network.py
2
5478
# 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
denismakogon/trove-guestagent
trove_guestagent/openstack/common/utils.py
6
1583
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
apache-2.0
azureplus/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/draw.py
56
5590
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # 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 2.1 of the License, or (at you...
apache-2.0
sestrella/ansible
lib/ansible/modules/network/f5/bigip_remote_role.py
38
17947
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
chengjf/database-interface-doc-management
flask-demo/flask/Lib/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py
477
30319
import errno import logging import sys import warnings from socket import error as SocketError, timeout as SocketTimeout import socket try: # Python 3 from queue import LifoQueue, Empty, Full except ImportError: from Queue import LifoQueue, Empty, Full import Queue as _ # Platform-specific: Windows fr...
apache-2.0
taedori81/wagtail
wagtail/wagtailembeds/embeds.py
3
4575
from datetime import datetime import json # Needs to be imported like this to allow @patch to work in tests from six.moves.urllib import request as urllib_request from six.moves.urllib.request import Request from six.moves.urllib.error import URLError from six.moves.urllib.parse import urlencode from django.utils.mo...
bsd-3-clause
mkieszek/odoo
addons/sale/wizard/sale_line_invoice.py
3
5219
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp.osv import osv, fields from openerp.tools.translate import _ from openerp import workflow from openerp.exceptions import UserError class sale_order_line_make_invoice(osv.osv_memory): _name = "sale.order...
agpl-3.0
DanielSBrown/osf.io
api/addons/views.py
4
2693
from rest_framework.exceptions import NotFound from rest_framework import generics, permissions as drf_permissions from framework.auth.oauth_scopes import CoreScopes from api.addons.serializers import AddonSerializer from api.base.permissions import TokenHasScope from api.base.settings import ADDONS_OAUTH from api.b...
apache-2.0