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
Vixionar/django
tests/model_forms/models.py
135
14126
""" XX. Generating HTML forms from models This is mostly just a reworking of the ``form_for_model``/``form_for_instance`` tests to use ``ModelForm``. As such, the text may not make sense in all cases, and the examples are probably a poor fit for the ``ModelForm`` syntax. In other words, most of these tests should be r...
bsd-3-clause
redondomarco/useradm
doc/pykadm5/setup.py
2
1039
include_dirs = ['/usr/include'] library_dirs = ['/usr/lib'] runtime_library_dirs = ['/usr/lib'] libraries = ['kadm5clnt', 'com_err'] define_macros = [('NO_DEBUG', 1)] from distutils.core import setup, Extension setup(name='pykadm5', version='0.2', py_modules=['pykadm...
gpl-3.0
stevenwudi/Kernelized_Correlation_Filter
pyhog/pyhog.py
2
1030
import numpy as np import features_pedro_py try: from scipy.misc import imrotate imrotate_available = True except ImportError: imrotate_available = False def features_pedro(img, sbin): imgf = img.copy('F') hogf = features_pedro_py.process(imgf, sbin) return hogf def hog_picture(w, bs=20): ...
gpl-3.0
JFriel/honours_project
networkx/build/lib/networkx/algorithms/__init__.py
16
3109
from networkx.algorithms.assortativity import * from networkx.algorithms.block import * from networkx.algorithms.boundary import * from networkx.algorithms.centrality import * from networkx.algorithms.cluster import * from networkx.algorithms.clique import * from networkx.algorithms.community import * from networkx.alg...
gpl-3.0
stableShip/shadowsocks
shadowsocks/encrypt.py
990
5180
#!/usr/bin/env python # # Copyright 2012-2015 clowwindy # # 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
tomkun/stem
test/integ/descriptor/reader.py
4
18413
""" Integration tests for stem.descriptor.reader. """ import getpass import os import signal import sys import tarfile import time import unittest import stem.descriptor.reader import test.mocking import test.runner from stem.util import system BASIC_LISTING = """ /tmp 123 /bin/grep 4567 /file with spaces/and \\ st...
lgpl-3.0
ZhaoCJ/django
tests/defer_regress/tests.py
6
11237
from __future__ import unicode_literals from operator import attrgetter from django.contrib.contenttypes.models import ContentType from django.contrib.sessions.backends.db import SessionStore from django.db.models import Count from django.db.models.loading import cache from django.test import TestCase from django.tes...
bsd-3-clause
unnikrishnankgs/va
venv/lib/python3.5/site-packages/tensorflow/models/object_detection/utils/test_utils_test.py
23
2678
# 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...
bsd-2-clause
hoosteeno/mozillians
vendor-local/lib/python/tablib/formats/_tsv.py
6
1288
# -*- coding: utf-8 -*- """ Tablib - TSV (Tab Separated Values) Support. """ from tablib.compat import is_py3, csv, StringIO title = 'tsv' extentions = ('tsv',) DEFAULT_ENCODING = 'utf-8' def export_set(dataset): """Returns a TSV representation of Dataset.""" stream = StringIO() if is_py3: ...
bsd-3-clause
BellScurry/gem5-fault-injection
tests/configs/simple-timing-mp-ruby.py
28
3570
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
bsd-3-clause
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.5.0/Lib/test/test_docxmlrpc.py
7
8523
from xmlrpc.server import DocXMLRPCServer import http.client import sys from test import support threading = support.import_module('threading') import time import socket import unittest PORT = None def make_request_and_skipIf(condition, reason): # If we skip the test, we have to make a request because # the s...
mit
RusDavies/ansible-modules-core
cloud/amazon/elasticache.py
68
21293
#!/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
zzhi191/easyleveldb
node_modules/leveldown/node_modules/prebuild/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
395
12634
#!/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. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
mit
gundalow/ansible
lib/ansible/galaxy/collection/__init__.py
11
55418
# -*- coding: utf-8 -*- # Copyright: (c) 2019-2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """Installed collections management package.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import errno import f...
gpl-3.0
timohtey/mediadrop_copy
mediacore_env/Lib/encodings/iso8859_2.py
593
13660
""" Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.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_table) def decode(self,input,errors='...
gpl-3.0
lollipopi9000/android_kernel_samsung_aries
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
maxamillion/product-definition-center
pdc/apps/common/viewsets.py
5
8185
# # Copyright (c) 2015 Red Hat # Licensed under The MIT License (MIT) # http://opensource.org/licenses/MIT # import re import json from django.contrib.contenttypes.models import ContentType from django.shortcuts import get_object_or_404 from django.core.exceptions import FieldError from django.http import Http404 from...
mit
nickleefly/youtube-dl
youtube_dl/extractor/nowtv.py
34
9503
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_str from ..utils import ( ExtractorError, determine_ext, int_or_none, parse_iso8601, parse_duration, remove_start, ) class NowTVBaseIE(InfoExtractor): _VIDEO_FI...
unlicense
20c/xbahn
xbahn/connection/memory.py
1
1497
from xbahn.connection import ( register, Poller as BasePoller, Receiver as BaseReceiver, Sender as BaseSender ) receivers = {} senders = {} class Poller(BasePoller): def __init__(self, name): super(Poller, self).__init__() self.name = name class Receiver(BaseReceiver): can_sen...
apache-2.0
mtholder/bootstrap-open-tree-software
open_tree_env.py
1
5325
#!/usr/bin/env python '''Wraps common operations on settings and environmental variables needed during build. ''' import os _DEF_OPEN_TREE_VERSION = '0.0.1' _build_env_var_list = ['OPEN_TREE_USER_SETTINGS_DIR', 'OPEN_TREE_INSTALL_DIR', 'OPEN_TREE_VERSION', ...
bsd-2-clause
zhujzhuo/openstack-trove
trove/guestagent/db/models.py
4
16889
# Copyright (c) 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
awkspace/ansible
lib/ansible/modules/storage/netapp/na_ontap_cifs_server.py
10
11343
#!/usr/bin/python """ this is cifs_server module (c) 2018, NetApp, 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', 'stat...
gpl-3.0
ipramono/therejectedbot
oauth2client/contrib/_metadata.py
20
4477
# 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 ...
apache-2.0
reustle/flask-security
tests/test_passwordless.py
18
3211
# -*- coding: utf-8 -*- """ test_passwordless ~~~~~~~~~~~~~~~~~ Passwordless tests """ import time import pytest from flask import Flask from flask_security.core import UserMixin from flask_security.signals import login_instructions_sent from flask_security.utils import capture_passwordless_login_reques...
mit
mrquim/repository.mrquim
repo/script.module.nanscrapers/lib/nanscrapers/modules/js2py/legecy_translators/nparser.py
96
99391
# JUST FOR NOW, later I will write my own - much faster and better. # Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com> # Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com> # Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com> # Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be> # Copyright (...
gpl-2.0
krelbel/ALttPLinkSpriteSwapper
Main.py
1
4488
import logging import argparse import os __version__ = '0.1-dev' #Usage: python Main.py --write --sprite zelda.spr --rom lttpromtobepatched.sfc #generates zelda_lttpromtobepatched.sfc # python Main.py --read --sprite zelda.spr --rom lttpromtobescanned.sfc #generates zelda.spr #General rom patching logic copied ...
mit
ceph/ceph-deploy
ceph_deploy/tests/parser/test_install.py
4
6383
import pytest from ceph_deploy.cli import get_parser from ceph_deploy.tests.util import assert_too_few_arguments COMP_FLAGS = [ 'mon', 'mds', 'rgw', 'osd', 'common', 'all' ] class TestParserInstall(object): def setup(self): self.parser = get_parser() def test_install_help(self, capsys): ...
mit
abretaud/tools-iuc
tools/heinz/heinz_scoring.py
21
3661
#!/usr/bin/env python """Calculate scores for Heinz. This script transform a p-value into a score: 1. Use alpha and lambda to calculate a threshold P-value. 2. Calculate a score based on each P-value by alpha and the threshold. For more details, please refer to the paper doi:10.1093/bioinformatics/btn161 Inp...
mit
rogerfan/simpleml
simpleml/metrics.py
1
1076
''' Metric functions. ''' import numpy as np import numexpr as ne __all__ = ('entropy', 'gini', 'misclass', 'tanh', 'logistic') # Purity measures for binary variables. def entropy(prop): return ne.evaluate('where((prop != 0) & (prop != 1),' '-prop*log(prop) - (1-prop)*log(1-prop), 0)') de...
mpl-2.0
xuhdev/nikola
nikola/plugins/task/__init__.py
4
1166
# -*- coding: utf-8 -*- # Copyright © 2012-2017 Roberto Alsina and others. # Permission is hereby granted, free of charge, to any # person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the # Software without restriction, including without limitation # the rights t...
mit
jasonwee/asus-rt-n14uhp-mrtg
tmp/ve_asus-rt-n14uhp-mrtg/lib/python3.4/site-packages/setuptools/command/upload_docs.py
20
7037
# -*- coding: utf-8 -*- """upload_docs Implements a Distutils 'upload_docs' subcommand (upload documentation to PyPI's pythonhosted.org). """ from base64 import standard_b64encode from distutils import log from distutils.errors import DistutilsOptionError import os import socket import zipfile import tempfile import ...
apache-2.0
willingc/oh-mainline
vendor/packages/whoosh/tests/test_matching.py
16
13944
from __future__ import with_statement from random import randint, choice, sample from nose.tools import assert_equal, assert_not_equal #@UnresolvedImport from whoosh import fields, matching, query from whoosh.compat import u from whoosh.filedb.filestore import RamStorage from whoosh.query import And, Term from whoos...
agpl-3.0
Avinash-Raj/appengine-django-skeleton
lib/django/contrib/gis/db/backends/oracle/models.py
475
2275
""" The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_...
bsd-3-clause
KohlsTechnology/ansible
lib/ansible/modules/windows/win_timezone.py
52
1808
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Phil Schwartz <schwartzmx@gmail.com> # 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'], 'supported_by...
gpl-3.0
OndrejIT/pyload
module/PullEvents.py
41
3688
# -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in...
gpl-3.0
Rashminadig/SDN
ryu/tests/unit/packet/test_packet.py
7
51295
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli...
apache-2.0
psyke83/android_kernel_huawei_msm7x25
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
MusculoskeletalAtlasProject/mapclient
src/mapclient/view/dialogs/log/loginformation.py
2
4487
""" MAP Client, a program to generate detailed musculoskeletal models for OpenSim. Copyright (C) 2012 University of Auckland This file is part of MAP Client. (http://launchpad.net/mapclient) MAP Client is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Li...
gpl-3.0
byaka/flaskJSONRPCServer
bench/utils.py
1
3754
#!/usr/bin/env python # -*- coding: utf-8 -*- __all__=['arrMin', 'arrMax', 'arrMedian', 'arrTrimean', 'arrMode', 'arrAverage', 'oGet', 'arrUnique'] def arrUnique(arr, key=None): #unique elements of array if not(arr): return [] tArr1=arr if key: tArr1=[key(s) for s in tArr1] tArr1=set(list(tArr1)) re...
apache-2.0
akiss77/servo
tests/wpt/web-platform-tests/old-tests/webdriver/user_input/clear_test.py
142
2601
# -*- mode: python; fill-column: 100; comment-column: 100; -*- import os import sys import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test from selenium.common import exceptions class ElementClearTest(base_test.WebDriverBaseTest): def test_writable_text_input_eleme...
mpl-2.0
usc-isi/horizon-old
horizon/horizon/dashboards/syspanel/flavors/forms.py
1
2657
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
bitdomo2/android_kernel_lge_gammaw
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
ckloss/LIGGGHTS-PUBLIC
python/examples/viz_gl.py
25
1846
#!/usr/bin/env python -i # preceeding line should have path for Python on your machine # viz_gl.py # Purpose: viz running LAMMPS simulation via GL tool in Pizza.py # Syntax: viz_gl.py in.lammps Nfreq Nsteps # in.lammps = LAMMPS input script # Nfreq = dump and viz shapshot every this many steps # ...
gpl-2.0
ingted/crmsh
contrib/setup.py
3
1050
#!/usr/bin/python from setuptools import setup setup(name='pygments-crmsh-lexers', version='0.0.5', description='Pygments crmsh custom lexers.', keywords='pygments crmsh lexer', license='BSD', author='Kristoffer Gronlund', author_email='kgronlund@suse.com', url='https://git...
gpl-2.0
MadCat34/Sick-Beard
lib/hachoir_parser/archive/ace.py
90
9964
""" ACE parser From wotsit.org and the SDK header (bitflags) Partial study of a new block type (5) I've called "new_recovery", as its syntax is very close to the former one (of type 2). Status: can only read totally file and header blocks. Author: Christophe Gisquet <christophe.gisquet@free.fr> Creation date: 19 jan...
gpl-3.0
utecuy/edx-platform
lms/djangoapps/ccx/tests/test_field_override_performance.py
44
9734
# coding=UTF-8 """ Performance tests for field overrides. """ import ddt import itertools import mock from nose.plugins.skip import SkipTest from courseware.views import progress # pylint: disable=import-error from courseware.field_overrides import OverrideFieldData from datetime import datetime from django.conf impo...
agpl-3.0
juergh/dwarf
tests/clients/test_nova.py
2
4430
#!/usr/bin/env python # # Copyright (c) 2017 Hewlett Packard Enterprise, L.P. # Copyright (c) 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.apach...
apache-2.0
behzadnouri/numpy
numpy/random/__init__.py
84
5492
""" ======================== Random Number Generation ======================== ==================== ========================================================= Utility functions ============================================================================== random Uniformly distributed values of a given sha...
bsd-3-clause
malayaleecoder/servo
tests/wpt/web-platform-tests/tools/pytest/_pytest/nose.py
228
2527
""" run test suites written for nose. """ import sys import py import pytest from _pytest import unittest def get_skip_exceptions(): skip_classes = set() for module_name in ('unittest', 'unittest2', 'nose'): mod = sys.modules.get(module_name) if hasattr(mod, 'SkipTest'): skip_cla...
mpl-2.0
bzzzz/cython
Cython/Tests/TestCodeWriter.py
132
2316
from Cython.TestUtils import CythonTest class TestCodeWriter(CythonTest): # CythonTest uses the CodeWriter heavily, so do some checking by # roundtripping Cython code through the test framework. # Note that this test is dependant upon the normal Cython parser # to generate the input trees to the CodeW...
apache-2.0
fedjo/thesis
project/aat/object_detection/core/preprocessor.py
14
78525
# 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
ric2b/Vivaldi-browser
chromium/components/policy/tools/template_writers/writers/plist_strings_writer_unittest.py
10
13019
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Unit tests for writers.plist_strings_writer''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os...
bsd-3-clause
spock1104/android_kernel_zte_msm8930
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
waxmanr/moose
gui/vtk/MeshRenderWidget.py
34
21092
import os, sys, getopt try: from PyQt4 import QtCore, QtGui QtCore.Signal = QtCore.pyqtSignal QtCore.Slot = QtCore.pyqtSlot except ImportError: try: from PySide import QtCore, QtGui QtCore.QString = str except ImportError: raise ImportError("Cannot load either PyQt or PySide...
lgpl-2.1
steven-albanese/sams
sams/tests/test_analyze.py
1
1207
""" Test SAMS analysis code. """ __author__ = 'John D. Chodera' ################################################################################ # IMPORTS ################################################################################ from simtk import openmm, unit from simtk.openmm import app import os, os.path i...
mit
lmazuel/azure-sdk-for-python
azure-batch/azure/batch/models/job_schedule_patch_options.py
1
3130
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
m1ck/bookadoptions
django/utils/log.py
152
3494
import logging import sys from django.core import mail # Make sure a NullHandler is available # This was added in Python 2.7/3.2 try: from logging import NullHandler except ImportError: class NullHandler(logging.Handler): def emit(self, record): pass # Make sure that dictConfig is availabl...
bsd-3-clause
lcf8858/Sample_Lua
frameworks/cocos2d-x/tools/cocos2d-console/plugins/plugin_luacompile/__init__.py
11
10258
#!/usr/bin/python # ---------------------------------------------------------------------------- # cocos "luacompile" plugin # # Copyright 2013 (C) Intel # # License: MIT # ---------------------------------------------------------------------------- ''' "luacompile" plugin for cocos command line tool ''' __docformat_...
mit
lukw00/shogun
tests/integration/generator/regression.py
22
3484
"""Generator for Regression""" import shogun.Regression as regression from shogun.Kernel import GaussianKernel import fileop import featop import dataop import category def _compute (params, feats, kernel, pout): """ Compute a regression and gather result data. @param params misc parameters for the regression m...
gpl-3.0
antoviaque/edx-platform
openedx/core/djangoapps/programs/tasks/v1/tests/test_tasks.py
7
17412
""" Tests for programs celery tasks. """ import ddt import httpretty import json import mock import unittest from celery.exceptions import MaxRetriesExceededError from django.conf import settings from django.test import override_settings, TestCase from edx_rest_api_client.client import EdxRestApiClient from oauth2_p...
agpl-3.0
billbonney/ardupilot
mk/PX4/Tools/genmsg/test/test_genmsg_command_line.py
216
1937
# Software License Agreement (BSD License) # # Copyright (c) 2011, Willow Garage, 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...
gpl-3.0
crisely09/horton
horton/scripts/test/test_wpart.py
1
5071
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2016 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
gpl-3.0
samskeller/zeroclickinfo-fathead
lib/fathead/UNCLEAN/parse_cplusplus.py
1
1380
from BeautifulSoup import BeautifulSoup import re import os import sys import MySQLdb conn = MySQLdb.connect(user='root') openclosetags = re.compile('''<.*?>|</.*?>''',re.DOTALL) files = [] for file in os.listdir('./docs/cplusplus/'): files.append('./docs/cplusplus/%s'%(file)) #http://www.cplusp...
apache-2.0
ldts/zephyr
scripts/west_commands/runners/hifive1.py
2
1307
# Copyright (c) 2019, Timon Baetz # # SPDX-License-Identifier: Apache-2.0 '''HiFive1-specific (flash only) runner.''' from os import path from runners.core import ZephyrBinaryRunner, RunnerCaps class HiFive1BinaryRunner(ZephyrBinaryRunner): '''Runner front-end for the HiFive1 board, using openocd.''' def ...
apache-2.0
Anonymous-X6/django
tests/admin_registration/tests.py
266
4640
from __future__ import unicode_literals from django.contrib import admin from django.contrib.admin.decorators import register from django.contrib.admin.sites import site from django.core.exceptions import ImproperlyConfigured from django.test import SimpleTestCase from .models import Location, Person, Place, Traveler...
bsd-3-clause
colloquium/spacewalk
client/solaris/smartpm/smart/fetcher.py
1
64875
# # Copyright (c) 2004 Conectiva, Inc. # # Written by Gustavo Niemeyer <niemeyer@conectiva.com> # # This file is part of Smart Package Manager. # # Smart Package Manager 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 Fou...
gpl-2.0
masklinn/babel
babel/util.py
86
8167
# -*- coding: utf-8 -*- """ babel.util ~~~~~~~~~~ Various utility classes and functions. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. """ import codecs from datetime import timedelta, tzinfo import os import re import textwrap from babel._compat import izip...
bsd-3-clause
jregovic/python-driver
tests/unit/io/utils.py
6
3730
# Copyright 2013-2015 DataStax, 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 writi...
apache-2.0
Skullmonkey/IPS-Syntax
html_completions.py
13
10848
import sublime, sublime_plugin import re def match(rex, str): m = rex.match(str) if m: return m.group(0) else: return None # This responds to on_query_completions, but conceptually it's expanding # expressions, rather than completing words. # # It expands these simple expressions: # tag.cl...
mit
minorua/QGIS
python/plugins/processing/algs/grass7/ext/i_smap.py
45
1530
# -*- coding: utf-8 -*- """ *************************************************************************** i_smap.py --------- Date : March 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr *******************************************...
gpl-2.0
baojie/pydatalog
examples/metamodeling.py
2
1778
from pyDatalog import pyDatalog # OUT: pyDatalog version 0.12.0 # create some atoms. an atomic could a symbol, varaiable (and others) pyDatalog.create_atoms('people, alice, bob') # insert a fact + people(alice) # 'people' is a symbol print people # OUT: <pyDatalog.pyParser.Symbol object at 0x93e744c> # declare a va...
lgpl-2.1
ocefpaf/cf_units
cf_units/util.py
2
3978
# (C) British Crown Copyright 2010 - 2019, Met Office # # This file is part of cf-units. # # cf-units 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 optio...
lgpl-3.0
jefftc/changlab
web2py/applications/admin/controllers/wizard.py
2
23288
# -*- coding: utf-8 -*- import os import uuid import re import pickle import urllib import glob from gluon.admin import app_create, plugin_install from gluon.fileutils import abspath, read_file, write_file def reset(session): session.app = { 'name': '', 'params': [('title', 'My New App'), ...
mit
aYukiSekiguchi/ACCESS-Chromium
chrome/tools/build/generate_policy_source.py
3
15372
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''python %prog [options] platform chromium_os_flag template platform specifies which platform source is being generated for and...
bsd-3-clause
rmasters/inbox
migrations/versions/013_add_spool_msg.py
11
1490
"""Add SpoolMessage table Revision ID: f7dbd9bf4a6 Revises: 13102e0e6fbd Create Date: 2014-04-16 03:51:49.484697 """ # revision identifiers, used by Alembic. revision = 'f7dbd9bf4a6' down_revision = '193802835c33' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto generated by Ale...
agpl-3.0
kennedyshead/home-assistant
homeassistant/components/arest/switch.py
21
6607
"""Support for an exposed aREST RESTful API of a device.""" import logging import requests import voluptuous as vol from homeassistant.components.switch import PLATFORM_SCHEMA, SwitchEntity from homeassistant.const import CONF_NAME, CONF_RESOURCE, HTTP_OK import homeassistant.helpers.config_validation as cv _LOGGER...
apache-2.0
webostin/django-btc
tests/m2m_through_regress/tests.py
68
9143
from __future__ import unicode_literals from django.core import management from django.contrib.auth.models import User from django.test import TestCase from django.utils.six import StringIO from .models import (Person, Group, Membership, UserMembership, Car, Driver, CarDriver) class M2MThroughTestCase(TestCase)...
bsd-3-clause
bobrock/eden
static/scripts/tools/jsmin.py
513
7471
#!/usr/bin/python # This code is original from jsmin by Douglas Crockford, it was translated to # Python by Baruch Even. The original code had the following copyright and # license. # # /* jsmin.c # 2007-01-08 # # Copyright (c) 2002 Douglas Crockford (www.crockford.com) # # Permission is hereby granted, free of ch...
mit
apollo13/ansible
lib/ansible/module_utils/facts/system/python.py
232
1999
# 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 in the hope that ...
gpl-3.0
rolandmansilla/microblog
flask/lib/python2.7/site-packages/pip/exceptions.py
32
7741
"""Exceptions used throughout package""" from __future__ import absolute_import from itertools import chain, groupby, repeat from pip._vendor.six import iteritems class PipError(Exception): """Base pip exception""" class InstallationError(PipError): """General exception during installation""" class Unin...
bsd-3-clause
5j9/wikitextparser
wikitextparser/_config.py
1
6983
"""Utilities to override default configurations.""" from collections import defaultdict as _defaultdict from typing import Iterable as _Iterable def _plant_trie(strings: _Iterable[str]) -> dict: """Create a Trie out of a list of words and return an atomic regex pattern. The corresponding Regex should match...
gpl-3.0
huanchenz/STX-h-store
third_party/python/boto/ec2/securitygroup.py
11
11648
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011, Eucalyptus Systems, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # w...
gpl-3.0
ryanoberto/homevolution
node.py
1
6518
#!/usr/bin/python """ The MIT License (MIT) Copyright (c) 2014 Leon Jacobs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, cop...
mit
jtyuan/racetrack
src/arch/x86/isa/insts/simd128/integer/compare/compare_and_write_mask.py
91
5729
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
Serag8/Bachelor
google_appengine/lib/django-1.5/django/contrib/redirects/tests.py
215
2436
from django.conf import settings from django.contrib.sites.models import Site from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.test.utils import override_settings from django.utils import six from .middleware import RedirectFallbackMiddleware from .models import Redi...
mit
FeatherCoin/Feathercoin
test/functional/feature_versionbits_warning.py
17
5111
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test version bits warning system. Generate chains with block versions that appear to be signalling unk...
mit
barreeeiroo/appinventor-sources
appinventor/misc/componentcreator/helpers.py
81
5237
import re from shutil import copy class DuplicateError(Exception): pass class NewComponent(): def __init__(self, compName=None, compImgName=None): self.compName = compName self.compImgName = compImgName self.imgFile = None def addImageReference(self): # read original file...
apache-2.0
jalexvig/tensorflow
tensorflow/python/training/session_manager_test.py
22
32764
# 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
codeskyblue/xmind-sdk-python
xmind/core/saver.py
5
1401
#!/usr/bin/env python #-*- coding: utf-8 -*- """ xmind.core.saver ~~~~~~~~~~~~~~~~~ :copyright: :license: """ __author__ = "aiqi@xmind.net <Woody Ai>" import codecs from . import const from .. import utils class WorkbookSaver(object): def __init__(self, workbook): """ Save `WorkbookD...
mit
stack-of-tasks/rbdlpy
tutorial/lib/python2.7/site-packages/OpenGL/GL/NV/texture_expand_normal.py
9
1288
'''OpenGL extension NV.texture_expand_normal This module customises the behaviour of the OpenGL.raw.GL.NV.texture_expand_normal to provide a more Python-friendly API Overview (from the spec) This extension provides a remapping mode where unsigned texture components (in the range [0,1]) can be treated as though ...
lgpl-3.0
faarwa/EngSocP5
zxing/cpp/scons/scons-local-2.0.0.final.0/SCons/Tool/Perforce.py
34
3814
"""SCons.Tool.Perforce.py Tool-specific initialization for Perforce Source Code Management system. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 20...
gpl-3.0
Surbias/surbias.github.io
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/asm.py
292
13314
# -*- coding: utf-8 -*- """ pygments.lexers.asm ~~~~~~~~~~~~~~~~~~~ Lexers for assembly languages. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, DelegatingL...
mit
StephenHamilton/gini
backend/src/gloader/xml/dom/TreeWalker.py
10
6995
######################################################################## # # File Name: TreeWalker.py # # """ Tree Walker from DOM Level 2. Allows multi-directional iteration over nodes. WWW: http://4suite.com/4DOM e-mail: support@4suite.com Copyright (c) 2000 Fourthought Inc, USA. All Rights Res...
mit
vimalkumarvelayudhan/riboplot
riboplot/ribocore.py
2
12920
"""Common functions. """ import pysam import logging import subprocess from contextlib import contextmanager # create logger for the entire program log = logging.getLogger('riboplot') log.setLevel(logging.DEBUG) # create console handler with a higher log level ch = logging.StreamHandler() ch.setLevel(logging.INFO) ...
bsd-3-clause
onitake/ansible
lib/ansible/modules/network/aci/msc_tenant.py
7
5147
#!/usr/bin/python # -*- coding: utf-8 -*- # 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', 'status': ['preview'], ...
gpl-3.0
andrebellafronte/stoq
stoqlib/gui/search/sellablesearch.py
2
16253
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2005-2007 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## 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 Softw...
gpl-2.0
sstone/bitcoin
test/functional/wallet_avoidreuse.py
12
16616
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the avoid_reuse and setwalletflag features.""" from test_framework.test_framework import BitcoinT...
mit
skoppisetty/secret-bugfixes
lib/sqlalchemy/orm/query.py
3
130048
# orm/query.py # Copyright (C) 2005-2012 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 """The Query class and support. Defines the :class:`.Query` class, the central construc...
gpl-3.0
sopier/django
django/conf/locale/fi/formats.py
504
1390
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j. E Y' TIME_FORMAT = 'G.i' DATET...
bsd-3-clause
allisson/mutirao-python-oauth
oauth_example/accounts/tests/test_views.py
1
10982
# -*- coding: utf-8 -*- from django.test import TestCase from django.core.urlresolvers import reverse from django.contrib.auth.models import User from datetime import datetime, timedelta from mock import patch from accounts.models import Account class TestIndexView(TestCase): def setUp(self): self.url ...
mit