repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
jermainewang/mxnet
example/stochastic-depth/sd_cifar10.py
25
10327
# 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
vipulroxx/sympy
sympy/combinatorics/tests/test_prufer.py
102
2396
from sympy.combinatorics.prufer import Prufer from sympy.utilities.pytest import raises def test_prufer(): # number of nodes is optional assert Prufer([[0, 1], [0, 2], [0, 3], [0, 4]], 5).nodes == 5 assert Prufer([[0, 1], [0, 2], [0, 3], [0, 4]]).nodes == 5 a = Prufer([[0, 1], [0, 2], [0, 3], [0, 4]]...
bsd-3-clause
t-hey/QGIS-Original
tests/src/python/test_qgslayoutunitscombobox.py
22
2561
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutUnitsComboBox .. note:: 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....
gpl-2.0
eduNEXT/edunext-platform
openedx/features/course_experience/views/course_outline.py
3
7943
""" Views to show a course outline. """ import datetime import re import six from completion import waffle as completion_waffle from django.contrib.auth.models import User from django.db.models import Q from django.shortcuts import redirect from django.template.context_processors import csrf from django.template.loa...
agpl-3.0
Ruide/angr-dev
angr-management/angrmanagement/ui/widgets/qdisasm_statusbar.py
1
1757
from PySide.QtGui import QFrame, QHBoxLayout, QLabel, QPushButton from ..menus.disasm_options_menu import DisasmOptionsMenu class QDisasmStatusBar(QFrame): def __init__(self, disasm_view, parent=None): super(QDisasmStatusBar, self).__init__(parent) self.disasm_view = disasm_view # widg...
bsd-2-clause
jcurbelo/networkx
networkx/algorithms/approximation/kcomponents.py
14
12634
""" Fast approximation for k-component structure """ # Copyright (C) 2015 by # Jordi Torrents <jtorrents@milnou.net> # All rights reserved. # BSD license. import itertools import collections import networkx as nx from networkx.exception import NetworkXError from networkx.utils import not_implemented_for ...
bsd-3-clause
maxamillion/ansible
lib/ansible/modules/copy.py
15
35147
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ ...
gpl-3.0
migua1204/jikexueyuan
极客学院/BusStopBoard/node_modules/.3.4.0@node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
apache-2.0
Venturi/oldcms
env/lib/python2.7/site-packages/taggit/migrations/0001_initial.py
7
1710
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0001_initial'), ] operations = [ migrations.CreateModel( name='Tag', fields=[ ...
apache-2.0
jessamynsmith/fontbakery
bakery_cli/pipe/copy.py
1
7851
# coding: utf-8 # Copyright 2013 The Font Bakery 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 re...
apache-2.0
wimnat/ansible-modules-core
network/cumulus/cl_interface_policy.py
19
5117
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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...
gpl-3.0
ubic135/odoo-design
addons/share/wizard/__init__.py
448
1067
# -*- 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
AstroFloyd/LearningPython
Fitting/scipy.optimize.least_squares.py
1
2724
#!/bin/env python3 # https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.least_squares.html """Solve a curve fitting problem using robust loss function to take care of outliers in the data. Define the model function as y = a + b * exp(c * t), where t is a predictor variable, y is an observation and a,...
gpl-3.0
nataddrho/DigiCue-USB
Python3/src/venv/Lib/site-packages/setuptools/_vendor/packaging/_compat.py
58
1128
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import sys from ._typing import TYPE_CHECKING if TYPE_CHECKING: # pragm...
mit
imsparsh/python-for-android
python3-alpha/python3-src/Lib/ctypes/_endian.py
45
1958
import sys from ctypes import * _array_type = type(c_int * 3) def _other_endian(typ): """Return the type with the 'other' byte order. Simple types like c_int and so on already have __ctype_be__ and __ctype_le__ attributes which contain the types, for more complicated types arrays and structures are s...
apache-2.0
addition-it-solutions/project-all
addons/website_crm_score/tests/test_assign.py
10
1560
# -*- coding: utf-8 -*- from openerp.addons.website_crm_score.tests.common import TestScoring from openerp.tools import mute_logger class test_assign(TestScoring): @mute_logger('openerp.addons.base.ir.ir_model', 'openerp.models') def test_00_assign(self): cr, uid = self.cr, self.uid # scoring...
agpl-3.0
garg10may/youtube-dl
youtube_dl/extractor/behindkink.py
145
1645
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import url_basename class BehindKinkIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?behindkink\.com/(?P<year>[0-9]{4})/(?P<month>[0-9]{2})/(?P<day>[0-9]{2})/(?P<id>[^/#?_]+)' _TEST = { ...
unlicense
matthewalbani/scipy
scipy/constants/constants.py
31
13312
""" Collection of physical constants and conversion factors. Most constants are in SI units, so you can do print '10 mile per minute is', 10*mile/minute, 'm/s or', 10*mile/(minute*knot), 'knots' The list is not meant to be comprehensive, but just a convenient list for everyday use. """ from __future__ import division...
bsd-3-clause
sugartom/tensorflow-alien
tensorflow/contrib/learn/python/learn/tests/dataframe/in_memory_source_test.py
62
3960
# 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
moreati/django
tests/template_tests/filter_tests/test_default.py
521
2159
from django.template.defaultfilters import default from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class DefaultTests(SimpleTestCase): """ Literal string arguments to the default filter are always treated as safe strings, regardless of the au...
bsd-3-clause
theguardian/CherryStrap
lib/apscheduler/jobstores/mongodb.py
2
5038
from __future__ import absolute_import import warnings from lib.apscheduler.jobstores.base import BaseJobStore, JobLookupError, ConflictingIdError from lib.apscheduler.util import maybe_ref, datetime_to_utc_timestamp, utc_timestamp_to_datetime from lib.apscheduler.job import Job try: import cPickle as pickle exce...
gpl-2.0
STHITAPRAJNAS/currentcostgui
electricitygeneration.py
9
9516
# -*- coding: utf-8 -*- # # CurrentCost GUI # # Copyright (C) 2008 Dale Lane # # 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 # (a...
gpl-3.0
redreamality/semanticizer
semanticizer/server/__main__.py
3
3787
# Copyright 2012-2013, University of Amsterdam. This program is free software: # you can redistribute it and/or modify it under the terms of the GNU Lesser # General Public License as published by the Free Software Foundation, either # version 3 of the License, or (at your option) any later version. # # This program...
gpl-3.0
MungoRae/home-assistant
homeassistant/components/alarm_control_panel/manual.py
3
6540
""" Support for manual alarms. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/alarm_control_panel.manual/ """ import datetime import logging import voluptuous as vol import homeassistant.components.alarm_control_panel as alarm import homeassistant.util...
apache-2.0
ykwd/thrift
test/crossrunner/collect.py
44
5099
# # 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
toshywoshy/ansible
lib/ansible/module_utils/network/ftd/configuration.py
19
24150
# Copyright (c) 2018 Cisco and/or its affiliates. # # 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 v...
gpl-3.0
draugiskisprendimai/odoo
addons/account_followup/report/account_followup_report.py
382
4561
# -*- 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
zapbot/zap-mgmt-scripts
vulnerableApp/vulnerableApp_spider_scan.py
1
2701
#!/usr/bin/env python import time, sys, getopt from pprint import pprint from zapv2 import ZAPv2 def main(argv): # ------------------------------------------------------------------------- # Default Configurations - use -z/-zap and -w/-vulnerableApp for different IP addrs # ----------------------------...
apache-2.0
shurihell/testasia
lms/djangoapps/courseware/tests/factories.py
60
4810
# Factories are self documenting # pylint: disable=missing-docstring import json from functools import partial import factory from factory.django import DjangoModelFactory # Imported to re-export from student.tests.factories import UserFactory # Imported to re-export from student.tests.factories import UserProfileFa...
agpl-3.0
tornadozou/tensorflow
tensorflow/python/summary/writer/event_file_writer.py
104
5848
# 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
CLVsol/odoo_api
clv_abcfarma.py
1
22488
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
agpl-3.0
marxin/youtube-dl
youtube_dl/extractor/syfy.py
159
1827
from __future__ import unicode_literals import re from .common import InfoExtractor class SyfyIE(InfoExtractor): _VALID_URL = r'https?://www\.syfy\.com/(?:videos/.+?vid:(?P<id>[0-9]+)|(?!videos)(?P<video_name>[^/]+)(?:$|[?#]))' _TESTS = [{ 'url': 'http://www.syfy.com/videos/Robot%20Combat%20League/...
unlicense
rotofly/odoo
addons/website_report/report.py
257
2124
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2014-Today OpenERP SA (<http://www.openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
friebsch/example-code
attic/dicts/strkeydict_dictsub.py
7
2206
"""StrKeyDict always converts non-string keys to `str` This is a variation of `strkeydict.StrKeyDict` implemented as a `dict` built-in subclass (instead of a `UserDict` subclass) Test for initializer: keys are converted to `str`. >>> d = StrKeyDict([(2, 'two'), ('4', 'four')]) >>> sorted(d.keys()) ['2', ...
mit
cmmorrow/sci-analysis
sci_analysis/test/test_correlation.py
1
9050
import unittest import numpy as np import scipy.stats as st from ..analysis import Correlation from ..analysis.exc import MinimumSizeError, NoDataError from ..data import UnequalVectorLengthError, Vector class MyTestCase(unittest.TestCase): def test_Correlation_corr_pearson(self): """Test the Correlation...
mit
Read-Lab-Confederation/nyc-subway-anthrax-study
data/01-accessing-data-and-controls/extract-pathogens.py
1
2526
#! /usr/bin/env python """ Read supplementary table and extract pathogens. sys.argv[1]: data/DataTable5-metaphlan-metadata_v19.txt Extract the sample id and the columns which pertain to yersinia and anthracis. """ def split_header(header): """ Some headers are really long, return only the last portion. ...
mit
zozo123/buildbot
master/buildbot/util/maildir.py
1
6077
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-3.0
makersauce/web-laser
src/sender.py
1
2239
#!/usr/bin/env python import serial import re import time import sys import argparse # import threading RX_BUFFER_SIZE = 128 def send(job=None,sname='/dev/ttyACM0'): if job == None: yield 'Invalid Job' try: s = serial.Serial(sname,9600) except Exception, e: yield str(e).spl...
mit
at1as/IMDB-Scrape
tests/test_helpers.py
2
1045
from src import helpers import unittest class TestHelpers(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_path_of_depth(self): self.assertEquals("f/g", helpers.path_of_depth("a/b/c/d/e/f/g", 2)) self.assertEquals("a/b/c", helpers.path_of_depth("a/b/c", 100)) def ...
mit
livid/v2ex
mapreduce/lib/blobstore/blobstore.py
22
21851
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
bsd-3-clause
scikit-monaco/scikit-monaco
skmonaco/benchmarks/bench_uniform.py
1
1374
from __future__ import print_function from numpy.testing import measure from skmonaco import mcquad def run_print(test_list): print() print(" Integrating sum(x**2) -- Uniform Monte Carlo") print(" ============================================") print() print(" ndims | npoints | nprocs | time ") ...
bsd-3-clause
chriscauley/django-shop
shop/views/order.py
17
1105
from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from shop.views import ShopListView, ShopDetailView from shop.models import Order class OrderListView(ShopListView): """ Display list or orders for logged in user. """ queryset = Order.objec...
bsd-3-clause
jgeewax/gcloud-python
bigquery/google/cloud/bigquery/_helpers.py
3
19674
# Copyright 2015 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
sdn-ixp/iSDX
flanc/lib.py
2
16349
# Author: # Rudiger Birkner (Networked Systems Group ETH Zurich) import json import logging from Queue import Queue import os import sys np = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) if np not in sys.path: sys.path.append(np) import util.log from ofdpa20 import OFDPA20 # COOKIES NO_COOKI...
apache-2.0
oliverhr/odoo
addons/mail/wizard/mail_compose_message.py
218
20346
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
thatguystone/verbinator
word.py
1
28502
# -*- coding: utf-8 -*- # # Copyright (c) 2010 Andrew Stone # # This file is part of of Verbinator. # # Verbinator 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...
gpl-3.0
bonzini/rube-gmail
py/gmail-filters.py
1
11406
# gmail-filters.py # # Uses the GMail API to remotely manipulate filters for # mailing lists and the corresponding labels. # # Author: Paolo Bonzini <pbonzini@redhat.com> # License: AGPLv3 from __future__ import print_function import httplib2 import os, sys, io import argparse, copy import mailbox try: from googl...
agpl-3.0
dials/dials
algorithms/shadowing/filter.py
1
1446
def filter_shadowed_reflections(experiments, reflections, experiment_goniometer=False): from dxtbx.masking import is_inside_polygon from scitbx.array_family import flex shadowed = flex.bool(reflections.size(), False) for expt_id in range(len(experiments)): expt = experiments[expt_id] im...
bsd-3-clause
gchp/django
tests/check_framework/test_urls.py
84
1652
from django.core.checks.urls import check_url_config from django.test import SimpleTestCase from django.test.utils import override_settings class CheckUrlsTest(SimpleTestCase): @override_settings(ROOT_URLCONF='check_framework.urls.no_warnings') def test_no_warnings(self): result = check_url_config(Non...
bsd-3-clause
fancasy/final
lib/zope/interface/ro.py
33
2004
############################################################################## # # Copyright (c) 2003 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
apache-2.0
nikita-moor/morfeusz-wrapper
morfeusz.py
1
8855
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import morfeusz2 import sys, os import getopt reload(sys) sys.setdefaultencoding('utf8') def usage(): print("Use: morfeusz.py przykład") def m_number(f): abbr = { "sg" : ["sing.", "singular"], "pl" : ["pl.", "plural" ], } htm...
bsd-2-clause
g3rd/django-timetable
timetable/admin.py
1
1781
from timetable.models import Calendar, Classification, Color, Event, EventClassification from django.contrib import admin from django.utils.translation import ugettext_lazy as _ class CalendarAdmin(admin.ModelAdmin): list_display = ('color_display', 'name', ) list_display_links = ('name', ) prepopulated_...
mit
TalShafir/ansible
test/units/module_utils/basic/test_get_file_attributes.py
131
1764
# -*- coding: utf-8 -*- # Copyright: # (c) 2017, Pierre-Louis Bonicoli <pierre-louis@libregerbil.fr> # License: GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division) __metaclass__ = type from itert...
gpl-3.0
klmitch/glance
glance/db/sqlalchemy/metadef_api/object.py
5
5731
# Copyright (c) 2014 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 re...
apache-2.0
agrimk/merlin
venv/lib/python2.7/site-packages/setuptools/msvc9_support.py
429
2187
try: import distutils.msvc9compiler except ImportError: pass unpatched = dict() def patch_for_specialized_compiler(): """ Patch functions in distutils.msvc9compiler to use the standalone compiler build for Python (Windows only). Fall back to original behavior when the standalone compiler is no...
mit
ben-ng/swift
benchmark/scripts/generate_harness/generate_harness.py
1
3413
#!/usr/bin/env python # ===--- generate_harness.py ---------------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See ...
apache-2.0
himanshuo/osf.io
website/addons/forward/tests/test_models.py
44
1805
# -*- coding: utf-8 -*- from nose.tools import * # PEP8 asserts from modularodm.exceptions import ValidationError from tests.base import OsfTestCase from website.addons.forward.tests.factories import ForwardSettingsFactory class TestSettingsValidation(OsfTestCase): def setUp(self): super(TestSettings...
apache-2.0
akshara775/PerfKitBenchmarker-master-2
perfkitbenchmarker/providers/rackspace/rackspace_disk.py
2
6771
# Copyright 2014 PerfKitBenchmarker 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 appli...
apache-2.0
kvar/ansible
test/units/module_utils/common/test_dict_transformations.py
78
4363
# -*- coding: utf-8 -*- # (c) 2017, Will Thames <will.thames@xvt.com.au> # # 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 y...
gpl-3.0
slyphon/pants
contrib/go/src/python/pants/contrib/go/tasks/go_test.py
10
2311
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.exce...
apache-2.0
zxombie/aarch64-freebsd-binutils
gdb/testsuite/gdb.python/py-finish-breakpoint2.py
41
1221
# Copyright (C) 2011-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
yterauchi/primecloud-controller
iaas-gw/src/iaasgw/ClientTest.py
5
14460
# coding: UTF-8 # # Copyright 2014 by SCSK Corporation. # # This file is part of PrimeCloud Controller(TM). # # PrimeCloud Controller(TM) 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 versi...
gpl-2.0
dhritzkiv/three.js
utils/exporters/blender/tests/scripts/review.py
305
3697
import os import json import stat import shutil import argparse os.chdir(os.path.dirname(os.path.realpath(__file__))) os.chdir('..') review = os.path.join(os.getcwd(), 'review') MASK = stat.S_IRWXU|stat.S_IRGRP|stat.S_IXGRP|stat.S_IROTH|stat.S_IXOTH HTML = '''<!doctype html> <html lang='en'> <head> <title>%(t...
mit
abdullah2891/remo
vendor-local/lib/python/docutils/parsers/rst/tableparser.py
60
20328
# $Id: tableparser.py 4564 2006-05-21 20:44:42Z wiemann $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ This module defines table parser classes,which parse plaintext-graphic tables and produce a well-formed data structure suitable for building a CALS t...
bsd-3-clause
scienceopen/spectral_analysis
scripts/FilterDesign.py
1
3846
#!/usr/bin/env python """ Design FIR filter coefficients using Parks-McClellan or windowing algorithm and plot filter transfer function. Michael Hirsch, Ph.D. example for PiRadar CW prototype, writing filter coefficients for use by filters.f90: ./FilterDesign.py 9950 10050 100e3 -L 4096 -m firwin -o cwfir.asc Refs: h...
mit
alikins/ansible
lib/ansible/modules/network/nxos/nxos_vtp_password.py
16
8124
#!/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
biocore/qiita
qiita_db/meta_util.py
2
20723
r""" Util functions (:mod: `qiita_db.meta_util`) =========================================== ..currentmodule:: qiita_db.meta_util This module provides utility functions that use the ORM objects. ORM objects CANNOT import from this file. Methods ------- ..autosummary:: :toctree: generated/ get_lat_longs """...
bsd-3-clause
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/json.py
33
2071
# mysql/json.py # Copyright (C) 2005-2017 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 import json from ...sql import elements from ...
mit
ctrlaltdel/python-devicecloud
setup.py
3
2469
import re import os from setuptools import setup, find_packages def get_version(): # In order to get the version safely, we read the version.py file # as text. This is necessary as devicecloud/__init__.py uses # things that won't yet be present when the package is being # installed. verstrline = ...
mpl-2.0
opoplawski/fedmsg_meta_fedora_infrastructure
fedmsg_meta_fedora_infrastructure/koschei.py
3
2997
# This file is part of fedmsg. # Copyright (C) 2014 Red Hat, Inc. # # fedmsg is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. #...
lgpl-2.1
renyi533/tensorflow
tensorflow/python/lib/core/bfloat16_test.py
4
10202
# 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
mcalmer/spacewalk
client/rhel/rhnlib/rhn/nonblocking.py
14
2427
# # # import select import fcntl import os class NonBlockingFile: def __init__(self, fd): # Keep a copy of the file descriptor self.fd = fd fcntl.fcntl(self.fd.fileno(), fcntl.F_SETFL, os.O_NDELAY) # Set the callback-related stuff self.read_fd_set = [] self.write_fd...
gpl-2.0
pfmoore/blist
blist/test/btuple_tests.py
3
5407
# Based on Python's tuple_tests.py, licensed under the Python License # Agreement import sys import random import gc from blist import btuple from blist.test import unittest from blist.test import seq_tests class bTupleTest(seq_tests.CommonTest): type2test = btuple def test_constructors(self): super(...
bsd-3-clause
janbrohl/tometa
tometa.py
1
4373
# -*- coding: utf-8 -*- from urllib.parse import parse_qsl from xml.sax.saxutils import escape, quoteattr import re __version__ = "0.5" def wrap_file(environ, filelike, block_size=8192): # copied from # http://legacy.python.org/dev/peps/pep-3333/#optional-platform-specific-file-handling if 'wsgi.file_wr...
bsd-3-clause
nikolas/lettuce
tests/integration/lib/Django-1.3/tests/modeltests/m2m_intermediary/tests.py
92
1251
from datetime import datetime from django.test import TestCase from models import Reporter, Article, Writer class M2MIntermediaryTests(TestCase): def test_intermeiary(self): r1 = Reporter.objects.create(first_name="John", last_name="Smith") r2 = Reporter.objects.create(first_name="Jane", last_na...
gpl-3.0
Salat-Cx65/python-for-android
python3-alpha/python3-src/Lib/email/feedparser.py
46
20778
# Copyright (C) 2004-2006 Python Software Foundation # Authors: Baxter, Wouters and Warsaw # Contact: email-sig@python.org """FeedParser - An email feed parser. The feed parser implements an interface for incrementally parsing an email message, line by line. This has advantages for certain applications, such as thos...
apache-2.0
wemanuel/smry
server-auth/ee/tests/filter_test.py
10
6525
#!/usr/bin/env python """Test for the ee.filter module.""" import datetime import unittest import ee from ee import apitestcase class FilterTest(apitestcase.ApiTestCase): def testConstructors(self): """Verifies that constructors understand valid parameters.""" empty = ee.Filter() self.assertEquals...
apache-2.0
alfasin/st2
st2auth/st2auth/gunicorn_config.py
1
1784
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
apache-2.0
DrDub/pilas
pilasengine/tareas/__init__.py
6
4479
# -*- encoding: utf-8 -*- # pilas engine: un motor para hacer videojuegos # # Copyright 2010-2014 - Hugo Ruscitti # License: LGPLv3 (see http://www.gnu.org/licenses/lgpl.html) # # Website - http://www.pilas-engine.com.ar from pilasengine.tareas.tarea import Tarea from pilasengine.tareas.tarea_condicional import TareaC...
lgpl-3.0
richardcs/ansible
lib/ansible/plugins/cliconf/edgeos.py
19
2196
# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import json from itertools import chain from ansible.module_utils._text import to_te...
gpl-3.0
40223101/2015cda_g1
static/Brython3.1.1-20150328-091302/Lib/_string.py
625
1112
"""string helper module""" import re class __loader__(object): pass def formatter_field_name_split(fieldname): """split the argument as a field name""" _list=[] for _name in fieldname: _parts = _name.split('.') for _item in _parts: is_attr=False #fix me if re....
gpl-3.0
SSGL-SEP/t-sne_cruncher
utils/utils.py
1
6152
import os import errno import csv from typing import List, Dict, TypeVar, Any from argparse import Namespace import numpy as np T = TypeVar("T") def all_files(folder_path: str, exts: List[str]) -> str: """ Gather all files conforming to provided extensions. :param folder_path: Path to folder :type...
mit
hydratk/hydratk-ext-yoda
src/hydratk/extensions/yoda/yoda.py
1
36383
# -*- coding: utf-8 -*- """Providing automated testing functionality .. module:: yoda.yoda :platform: Unix :synopsis: Providing automated testing functionality .. moduleauthor:: Petr Czaderna <pc@hydratk.org> """ """ Events: ------- yoda_before_init_tests yoda_before_append_test_file yoda_before_process_tests ...
bsd-3-clause
rbrich/keys
tests/test_shell.py
1
6272
import sys import os import time import pexpect import pytest class Expect: def __init__(self, expected, args=None, regex=False): """`expected` is either string or callable with optional `args` Unless `regex` is enabled, the `expected` string is matched as-is (raw). """ self._e...
mit
mrquim/repository.mrquim
repo/script.module.youtube.dl/lib/youtube_dl/extractor/promptfile.py
52
2425
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( determine_ext, ExtractorError, urlencode_postdata, ) class PromptFileIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?promptfile\.com/l/(?P<id>[0-9A-Z\-]+)' _TEST = { ...
gpl-2.0
jounex/hue
desktop/core/ext-py/kazoo-2.0/kazoo/protocol/connection.py
30
24684
"""Zookeeper Protocol Connection Handler""" import logging import os import random import select import socket import sys import time from binascii import hexlify from contextlib import contextmanager from kazoo.exceptions import ( AuthFailedError, ConnectionDropped, EXCEPTIONS, SessionExpiredError, ...
apache-2.0
adit-chandra/tensorflow
tensorflow/python/ops/sparse_ops_test.py
4
5982
# 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
eriknstr/ThinkPad-FreeBSD-setup
FreeBSD/crypto/heimdal/lib/wind/gen-combining.py
35
3062
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id$ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
isc
PCurd/python_koans
python2/koans/about_with_statements.py
24
3640
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Based on AboutSandwichCode in the Ruby Koans # from runner.koan import * import re # For regular expression string comparisons class AboutWithStatements(Koan): def count_lines(self, file_name): try: f = open(file_name) try: ...
mit
pepeportela/edx-platform
common/lib/xmodule/xmodule/tests/test_capa_module.py
5
127036
# -*- coding: utf-8 -*- """ Tests of the Capa XModule """ # pylint: disable=missing-docstring # pylint: disable=invalid-name import datetime import json import random import requests import os import textwrap import unittest import ddt from lxml import etree from mock import Mock, patch, DEFAULT import webob from web...
agpl-3.0
popazerty/enigma2
lib/python/Components/Sources/CurrentService.py
72
1404
from Components.PerServiceDisplay import PerServiceBase from enigma import iPlayableService from Source import Source from Components.Element import cached import NavigationInstance class CurrentService(PerServiceBase, Source): def __init__(self, navcore): Source.__init__(self) PerServiceBase.__init__(self, navco...
gpl-2.0
saez0pub/ansible-modules-extras
cloud/profitbricks/profitbricks.py
112
20794
#!/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 distributed...
gpl-3.0
nigelsmall/py2neo
test/test_transaction.py
1
11243
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright 2011-2016, Nigel Small # # 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 # # Unle...
apache-2.0
jagguli/intellij-community
python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/version.py
102
36813
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2009-2014, Mario Vilas # 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...
apache-2.0
patriciolobos/desa8
openerp/addons/account_test/__openerp__.py
313
2078
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2011 CCI Connect asbl (http://www.cciconnect.be) All Rights Reserved. # Philmer <philmer@cciconnect.be> # # This progra...
agpl-3.0
lwerdna/alib
py/logic/BoolExpr.py
1
16510
#!/usr/bin/python #------------------------------------------------------------------------------ # # This file is a part of autils. # # Copyright 2011-2016 Andrew Lamoureux # # autils is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fr...
gpl-3.0
fibbo/DIRAC
Core/Utilities/test/ListTestCase.py
10
5481
######################################################################## # $HeadURL $ # File: ListTestCase.py # Author: Krzysztof.Ciba@NOSPAMgmail.com # Date: 2011/01/17 08:17:58 ######################################################################## """.. module:: ListTestCase Test cases for DIRAC.Core.Utilities.L...
gpl-3.0
samphippen/dynpk
config.py
1
1259
import ConfigParser class Config: "Configuration parser" def __init__(self, fname): self.parser = ConfigParser.ConfigParser() self.parser.read( fname ) self.rpms = self._opt_break( "rpms" ) self.local_rpms = self._opt_break( "local_rpms" ) self.files = self._opt_break(...
gpl-3.0
ptitjes/quodlibet
quodlibet/util/tagsfrompath.py
2
2841
# Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna # # 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. impor...
gpl-2.0
timabbott/zulip
zerver/views/realm_domains.py
3
2632
from django.core.exceptions import ValidationError from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.decorator import require_realm_admin from zerver.lib.actions import do_add_realm_domain, do_change_realm_domain, do_remove_realm_domain from zerver.lib.dom...
apache-2.0