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
criteo-forks/carbon
lib/carbon/regexlist.py
5
1537
import re import os.path from carbon import log from twisted.internet.task import LoopingCall class RegexList: """ Maintain a list of regex for matching whitelist and blacklist """ def __init__(self): self.regex_list = [] self.list_file = None self.read_task = LoopingCall(self.read_list) self.rul...
apache-2.0
dwavesystems/dimod
dimod/sampleset.py
1
63014
# Copyright 2018 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
upconsulting/IsisCB
isiscb/isisdata/migrations/0076_auto_20180601_1948.py
1
7720
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-06-01 19:48 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depend...
mit
bgxavier/neutron
neutron/tests/unit/services/metering/drivers/test_iptables.py
34
21296
# 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
350dotorg/Django
tests/modeltests/fixtures_model_package/tests.py
95
2540
from django.core import management from django.test import TestCase from models import Article class SampleTestCase(TestCase): fixtures = ['fixture1.json', 'fixture2.json'] def testClassFixtures(self): "Test cases can load fixture objects into models defined in packages" self.assertEqual(Art...
bsd-3-clause
sudkannan/xen-hv
dist/install/usr/lib64/python2.6/site-packages/xen/xend/server/netif2.py
43
5574
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
witcxc/scipy
scipy/io/tests/test_wavfile.py
70
3451
from __future__ import division, print_function, absolute_import import os import tempfile import warnings from io import BytesIO import numpy as np from numpy.testing import (assert_equal, assert_, assert_raises, assert_array_equal, run_module_suite) from scipy.io import wavfile def datafile(fn): return o...
bsd-3-clause
jobscry/vz-wiki
vz_wiki/admin.py
1
1672
from django.contrib import admin from models import WikiPage, Revision, Comparison def latest_revision_display(obj): latest_revision = obj.latest_revision() if latest_revision is None: return '0' return u'%s' % latest_revision.number latest_revision_display.short_description = 'Version' def who_...
mit
xSAVIKx/PRESENT-cipher
gmac/util/galue_fields.py
1
3561
# Author: Joao H de A Franco (jhafranco@acm.org) # # Description: Binary finite field multiplication in Python 3 # # Date: 2012-02-16 # # License: Attribution-NonCommercial-ShareAlike 3.0 Unported # (CC BY-NC-SA 3.0) # =========================================================== from functools import reduce # ...
apache-2.0
j2sol/giftwrap
giftwrap/tests/test_builder.py
2
1386
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2015, Craig Tracey # 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/l...
apache-2.0
jdubs/cloud-custodian
tests/test_waf.py
7
1232
# Copyright 2016-2017 Capital One Services, LLC # # 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 ...
apache-2.0
kmarius/qutebrowser
qutebrowser/browser/webkit/rfc6266.py
5
9768
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2014-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gpl-3.0
ayoubg/gem5-graphics
gem5/src/mem/AddrMapper.py
69
3530
# Copyright (c) 2012 ARM Limited # 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 implementation of the functionality ...
bsd-3-clause
JonathanStein/odoo
addons/account_check_writing/account.py
379
2032
# -*- 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
AndroidOpenDevelopment/android_external_chromium_org
tools/telemetry/telemetry/core/platform/profiler/vtune_profiler.py
10
5198
# 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 logging import os import subprocess import sys import tempfile from telemetry.core.platform import profiler from telemetry.core.platform.profiler imp...
bsd-3-clause
ramcn/demo3
venv/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/langbulgarianmodel.py
2965
12784
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
Blackburn29/PsycoKernel
Documentation/networking/cxacru-cf.py
14668
1626
#!/usr/bin/env python # Copyright 2009 Simon Arlott # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # This program i...
gpl-2.0
caneruguz/osf.io
addons/bitbucket/utils.py
16
1532
import urllib import httplib as http from framework.exceptions import HTTPError from addons.bitbucket.api import BitbucketClient def get_path(kwargs, required=True): path = kwargs.get('path') if path: return urllib.unquote_plus(path) elif required: raise HTTPError(http.BAD_REQUEST) def...
apache-2.0
epssy/hue
desktop/core/ext-py/pysaml2-2.4.0/src/saml2/client.py
31
19047
# !/usr/bin/env python # -*- coding: utf-8 -*- # """Contains classes and functions that a SAML2.0 Service Provider (SP) may use to conclude its tasks. """ from saml2.request import LogoutRequest import saml2 from saml2 import saml, SAMLError from saml2 import BINDING_HTTP_REDIRECT from saml2 import BINDING_HTTP_POST ...
apache-2.0
penguintutor/networking-quiz
src/quizapp.py
1
12224
# This uses the dev branch of guizero which needs to be linked to the appropriate # directory - in future this will use the normal production version of guizero from guizero.build.lib.guizero import App, Text, PushButton, info, MenuBar, Picture, yesno import quizdetails # For testing the gui without the arduino comme...
gpl-3.0
olasitarska/django
django/utils/crypto.py
32
6880
""" Django's standard crypto functions and utilities. """ from __future__ import unicode_literals import hmac import struct import hashlib import binascii import time # Use the system PRNG if possible import random try: random = random.SystemRandom() using_sysrandom = True except NotImplementedError: impo...
bsd-3-clause
learningsociety/deepmodels
deepmodels/core/models/common.py
2
9770
"""Shared definition of deep models. Provide an organized structure for deep networks. We will use existing slim model library so will not reimplement them here. """ import os import numpy as np import tensorflow as tf from deepmodels.tf.core import commons from deepmodels.shared import data_manager # this is comm...
mit
cellular-nanoscience/pyotic
pyoti/modification/modification.py
1
26859
# -*- coding: utf-8 -*- """ Created on Fri Feb 12 14:22:31 2016 @author: Tobias Jachowski """ import collections import matplotlib.pyplot as plt import numpy as np from abc import ABCMeta, abstractmethod from .. import gui from .. import helpers as hp from .. import traces as tc from ..evaluate import signal as sn fr...
apache-2.0
amjad-twalo/icsisumm
tac09/preprocess/util.py
17
3062
import treenode from globals import * import re, cPickle, os, gzip def save_pickle(data, path): o = gzip.open(path, 'wb') cPickle.dump(data, o) o.close() def load_pickle(path): i = gzip.open(path, 'rb') data = cPickle.load(i) i.close() return data def flushFile(fh): """ flush file h...
gpl-3.0
MiniPlayer/log-island
logisland-plugins/logisland-scripting-processors-plugin/src/main/resources/nltk/help.py
7
1649
# Natural Language Toolkit (NLTK) Help # # Copyright (C) 2001-2016 NLTK Project # Authors: Steven Bird <stevenbird1@gmail.com> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ Provide structured access to documentation. """ from __future__ import print_function import re from textwrap import w...
apache-2.0
dougbenjamin/panda-harvester
pandaharvester/harvestermisc/apfmon.py
1
16445
""" API described here: http://apfmon.lancs.ac.uk/help """ import requests import json import time import traceback from pandaharvester.harvesterconfig import harvester_config from pandaharvester.harvestercore import core_utils from pandaharvester import panda_pkg_info from pandaharvester.harvestermisc import generic...
apache-2.0
wwj718/edx-platform
lms/djangoapps/verify_student/tests/test_services.py
33
8129
""" Tests of re-verification service. """ import ddt from opaque_keys.edx.keys import CourseKey from course_modes.models import CourseMode from course_modes.tests.factories import CourseModeFactory from student.models import CourseEnrollment from student.tests.factories import UserFactory from lms.djangoapps.verify_...
agpl-3.0
ajtowns/bitcoin
test/functional/wallet_keypool_topup.py
11
4447
#!/usr/bin/env python3 # Copyright (c) 2017-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 HD Wallet keypool restore function. Two nodes. Node1 is under test. Node0 is providing transactio...
mit
MER-GROUP/intellij-community
python/lib/Lib/encodings/mac_greek.py
593
13977
""" Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.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,err...
apache-2.0
omnirom/android_kernel_htc_flounder
scripts/tracing/dma-api/trace.py
96
12420
"""Main program and stuff""" #from pprint import pprint from sys import stdin import os.path import re from argparse import ArgumentParser import cPickle as pickle from collections import namedtuple from plotting import plotseries, disp_pic import smmu class TracelineParser(object): """Parse the needed informatio...
gpl-2.0
willingc/gentledocs
config/settings/common.py
1
8186
# -*- coding: utf-8 -*- """ Django settings for Gentle Docs project. For more information on this file, see https://docs.djangoproject.com/en/dev/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/dev/ref/settings/ """ from __future__ import absolute_import, unicode...
bsd-3-clause
kipe/miplant
miplant/miplant.py
1
4030
# -*- encoding: utf-8 -*- from bluepy import btle import logging from math import isnan class MiPlant(object): def __init__(self, address, interface_index=0): ''' Initializes the MiPlant -object. Parameters ---------- address : string The MAC-address of the dev...
mit
rvalyi/geraldo
site/newsite/site-geraldo/gae_wiki/templatetags/wiki_tags.py
9
1811
import re from google.appengine.ext import db from django.template import Library from django.utils.safestring import mark_safe from gae_wiki.models import Wiki register = Library() exp = re.compile('(\[%[ ]+wiki:(all|recent)\((.*?)\):([\d]+)[ ]+%\])') @register.filter def parse_wiki(text): chamadas = exp.find...
lgpl-3.0
bbozhev/flask-test
flask/lib/python2.7/site-packages/markupsafe/__init__.py
701
10338
# -*- coding: utf-8 -*- """ markupsafe ~~~~~~~~~~ Implements a Markup string. :copyright: (c) 2010 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import string from collections import Mapping from markupsafe._compat import text_type, string_types, int_types, \ u...
mit
alsrgv/tensorflow
tensorflow/contrib/seq2seq/python/kernel_tests/beam_search_decoder_test.py
4
27185
# 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
Vagab0nd/SiCKRAGE
lib3/sqlalchemy/sql/annotation.py
4
6725
# sql/annotation.py # Copyright (C) 2005-2020 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 :class:`.Annotated` class and related routines; creates hash-equivalent cop...
gpl-3.0
varunarya10/paramiko
tests/test_sftp.py
21
29685
# Copyright (C) 2003-2009 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 (a...
lgpl-2.1
wolverineav/neutron
neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/openflow/ovs_ofctl/test_br_phys.py
32
3654
# Copyright (C) 2014,2015 VA Linux Systems Japan K.K. # Copyright (C) 2014,2015 YAMAMOTO Takashi <yamamoto at valinux co jp> # 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 t...
apache-2.0
israeleriston/scientific-week
backend/venv/lib/python3.5/site-packages/sqlalchemy/sql/dml.py
32
33439
# sql/dml.py # Copyright (C) 2009-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 """ Provide :class:`.Insert`, :class:`.Update` and :class:`.Delete`. """ from .base impo...
mit
monikagrabowska/osf.io
kinto/kinto/core/errors.py
1
7950
import six from pyramid import httpexceptions from enum import Enum from kinto.core.logs import logger from kinto.core.utils import json, reapply_cors, encode_header class ERRORS(Enum): """Predefined errors as specified by the API. +-------------+-------+------------------------------------------------+ ...
apache-2.0
mrknow/filmkodi
plugin.video.mrknow/mylib/third_party/pep8/lib2to3/lib2to3/main.py
250
11605
""" Main program for 2to3. """ from __future__ import with_statement import sys import os import difflib import logging import shutil import optparse from . import refactor def diff_texts(a, b, filename): """Return a unified diff of two strings.""" a = a.splitlines() b = b.splitlines() return diffl...
apache-2.0
NeuroDataDesign/seelviz
Flask/env/lib/python2.7/site-packages/pip/_vendor/pyparsing.py
75
158096
# module pyparsing.py # # Copyright (c) 2003-2015 Paul T. McGuire # # 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...
apache-2.0
Ensighten/ansible
lib/ansible/playbook/role/definition.py
7
6783
# (c) 2014 Michael DeHaan, <michael@ansible.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
gpl-3.0
dushu1203/chromium.src
third_party/pycoverage/coverage/config.py
209
7099
"""Config file for coverage.py""" import os, re, sys from coverage.backward import string_class, iitems # In py3, # ConfigParser was renamed to the more-standard configparser try: import configparser # pylint: disable=F0401 except ImportError: import ConfigParser as configparser ...
bsd-3-clause
jepler/linuxcnc-mirror
lib/python/gladevcp/offsetwidget.py
8
6515
#!/usr/bin/env python # GladeVcp Widget - DRO label widget # This widgets displays linuxcnc axis position information. # # Copyright (c) 2012 Chris Morley # # 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 F...
lgpl-2.1
cuongnv23/ansible
test/units/mock/yaml_helper.py
209
5267
import io import yaml from ansible.module_utils.six import PY3 from ansible.parsing.yaml.loader import AnsibleLoader from ansible.parsing.yaml.dumper import AnsibleDumper class YamlTestUtils(object): """Mixin class to combine with a unittest.TestCase subclass.""" def _loader(self, stream): """Vault r...
gpl-3.0
ShassAro/ShassAro
DockerAdmin/dockerVirtualEnv/lib/python2.7/site-packages/django/utils/dates.py
115
2296
"Commonly-used date structures" from django.utils.translation import ugettext_lazy as _, pgettext_lazy WEEKDAYS = { 0: _('Monday'), 1: _('Tuesday'), 2: _('Wednesday'), 3: _('Thursday'), 4: _('Friday'), 5: _('Saturday'), 6: _('Sunday') } WEEKDAYS_ABBR = { 0: _('Mon'), 1: _('Tue'), 2: _('Wed'), 3: _('Thu'),...
gpl-2.0
yelongyu/chihu
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/gb2312prober.py
2994
1681
######################## 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...
gpl-3.0
telwertowski/Books-Mac-OS-X
Versions/Books_3.0b4/Amazon (CA).plugin/Contents/Resources/amazonScript.py
6
4826
#!/usr/bin/python from amazon import Bag from xml.dom.minidom import Document, parse from difflib import SequenceMatcher from string import replace import amazon import sys searchLocale = "ca" fieldMap = { "Asin" : "ASIN", "BrowseList" : "Genres", "Authors" : "Authors", "ImageUrlLarge" : "CoverImageURL", "Im...
mit
dknlght/dkodi
src/plugin.video.Mega_Khmer_Addon/resources/lib/BeautifulSoup.py
218
79567
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
gpl-2.0
Jank1310/googlemock-mirror
gtest/test/gtest_filter_unittest.py
2826
21261
#!/usr/bin/env python # # Copyright 2005 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of...
bsd-3-clause
rajsadho/django
tests/admin_changelist/tests.py
29
37484
from __future__ import unicode_literals import datetime from django.contrib import admin from django.contrib.admin.models import LogEntry from django.contrib.admin.options import IncorrectLookupParameters from django.contrib.admin.templatetags.admin_list import pagination from django.contrib.admin.tests import AdminS...
bsd-3-clause
edelvalle/SublimeJEDI
dependencies/jedi/__main__.py
28
1427
import sys from os.path import join, dirname, abspath, isdir def _start_linter(): """ This is a pre-alpha API. You're not supposed to use it at all, except for testing. It will very likely change. """ import jedi if '--debug' in sys.argv: jedi.set_debug_function() for path in sys...
mit
anilthanki/tgac-galaxytools
tools/t_coffee/filter_by_fasta_ids.py
3
1706
#!/usr/bin/env python """ A script to build specific fasta databases """ from __future__ import print_function import collections import sys Sequence = collections.namedtuple('Sequence', ['header', 'sequence']) def FASTAReader_gen(fasta_filename): with open(fasta_filename) as fasta_file: line = fasta_fi...
mit
quornian/rust
src/etc/gdb_rust_pretty_printing.py
5
6954
# Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or ht...
apache-2.0
darkryder/django
django/core/files/utils.py
73
1880
class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(la...
bsd-3-clause
apophys/freeipa
ipatests/test_ipapython/test_session_storage.py
1
1069
# # Copyright (C) 2017 FreeIPA Contributors see COPYING for license # """ Test the `session_storage.py` module. """ import pytest from ipapython import session_storage @pytest.mark.skip_ipaclient_unittest @pytest.mark.needs_ipaapi class test_session_storage(object): """ Test the session storage interface ...
gpl-3.0
henriquespedro/GFOSS_OA
tools/BeautifulSoup.py
307
69566
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses a (possibly invalid) XML or HTML document into a tree representation. It provides methods and Pythonic idioms that make it easy to navigate, search, and modify the tree. A well-formed X...
gpl-2.0
elventear/ansible-modules-core
cloud/google/gc_storage.py
25
16994
#!/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
anbangleo/NlsdeWeb
Python-3.6.0/Lib/encodings/mbcs.py
860
1211
""" Python 'mbcs' Codec for Windows Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py, which was written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """ # Import them explicitly to cause an ImportError # on non-Windows systems from codecs import mbcs...
mit
MER-GROUP/intellij-community
python/lib/Lib/site-packages/django/contrib/sessions/backends/file.py
91
5318
import errno import os import tempfile from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured class SessionStore(SessionBase): """ Implements a file based session store. """ ...
apache-2.0
CKehl/pylearn2
pylearn2/utils/__init__.py
39
16734
""" .. todo:: WRITEME """ import logging import warnings from .general import is_iterable, contains_nan, contains_inf, isfinite import theano from theano.compat.six.moves import input, zip as izip # Delay import of pylearn2.config.yaml_parse and pylearn2.datasets.control # to avoid circular imports yaml_parse = N...
bsd-3-clause
fzheng/codejam
lib/python2.7/site-packages/sphinx/websupport/search/xapiansearch.py
2
2581
# -*- coding: utf-8 -*- """ sphinx.websupport.search.xapiansearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Xapian search adapter. :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import xapian from sphinx.util.osutil import ensuredir from ...
mit
moto-timo/ironpython3
Src/StdLib/Lib/importlib/__init__.py
100
5156
"""A pure Python implementation of import.""" __all__ = ['__import__', 'import_module', 'invalidate_caches', 'reload'] # Bootstrap help ##################################################### # Until bootstrapping is complete, DO NOT import any modules that attempt # to import importlib._bootstrap (directly or indirect...
apache-2.0
natukikazemizo/sedna
Sedna/src/python/recasting/grep_object.py
1
5780
#!BPY # -*- coding: UTF-8 -*- # Set IK Limits # # 2016.01.17 Natukikazemizo import bpy import math import re # Using Regular expression #"[0]" 1文字が0 #"[0-9]" 1文字が0,1,2,3,4,5,6,7,8,9のいずれか #"[02468]" 1文字が偶数 #"[BCD]" 1文字がB,C,Dのいずれか #"[B-D]" 1文字がB,C,Dのいずれか #"[0-2A-C]" 1文字が0,1,2,A,B,Cのいずれか #"[^12]" 1文字が1,2以外 #"\w" 1文字が英数字 ...
mit
q40223241/2015cdb_g3_40223241
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_program.py
738
10833
import io import os import sys import unittest class Test_TestProgram(unittest.TestCase): def test_discovery_from_dotted_path(self): loader = unittest.TestLoader() tests = [self] expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) self.wasRun = False ...
gpl-3.0
indera/barebones-flask-app
app/models/user_role_entity.py
2
1127
""" ORM for UserRole table """ from app.main import db from app.crud_mixin import CRUDMixin class UserRoleEntity(db.Model, CRUDMixin): """ Stores the user-role mapping """ __tablename__ = 'UserRole' id = db.Column("urID", db.Integer, primary_key=True) user_id = db.Column("usrID", db.Integer, db.Fore...
bsd-3-clause
rancherio/rancher
tests/validation/tests/common.py
2
1082
import os import random import time CATTLE_TEST_URL = os.environ.get('CATTLE_TEST_URL', "") ADMIN_TOKEN = os.environ.get('ADMIN_TOKEN', "None") USER_TOKEN = os.environ.get('USER_TOKEN', "None") CLUSTER_NAME = os.environ.get("RANCHER_CLUSTER_NAME", "") DEFAULT_TIMEOUT = 120 def random_int(start, end): return rand...
apache-2.0
702nADOS/sumo
tools/contributed/sumopy/coremodules/network/network.py
1
164969
# size limit at 1280x1280 # http://maps.googleapis.com/maps/api/staticmap?size=500x500&path=color:0x000000|weight:10|44.35789,11.3093|44.4378,11.3935&format=GIF&maptype=satellite&scale=2 import os import sys import subprocess import platform from xml.sax import saxutils, parse, handler if __name__ == '__main__': ...
gpl-3.0
18padx08/PPTex
PPTexEnv_x86_64/lib/python2.7/site-packages/scipy/signal/tests/test_signaltools.py
7
44284
from __future__ import division, print_function, absolute_import from decimal import Decimal from numpy.testing import ( TestCase, run_module_suite, assert_equal, assert_almost_equal, assert_array_equal, assert_array_almost_equal, assert_raises, assert_allclose, assert_, dec) import scipy.signal as signa...
mit
fatherlinux/atomic-reactor
tests/plugins/test_import_image.py
1
5039
""" Copyright (c) 2015 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import unicode_literals import json import os from atomic_reactor.core import DockerTasker from atomic_reactor.inner import...
bsd-3-clause
jmerkow/VTK
ThirdParty/Twisted/twisted/test/test_sip.py
39
34356
# -*- test-case-name: twisted.test.test_sip -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """Session Initialization Protocol tests.""" from twisted.trial import unittest, util from twisted.protocols import sip from twisted.internet import defer, reactor, utils from twisted.python.versio...
bsd-3-clause
loveshell/wfuzz
plugins/iterations.py
10
2391
from externals.moduleman.plugin import moduleman_plugin import itertools class piterator_void: text="void" def count(self): return self.__count def __init__(self, *i): self._dic = i self.__count = max(map(lambda x:x.count(), i)) self.it = self._dic[0] def next(self): return (self.it.next(),) ...
gpl-2.0
chuckchen/spark
python/pyspark/files.py
46
1891
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
firemark/grazyna
grazyna/tests/test_request.py
1
2043
from grazyna.request import RequestBot from grazyna.test_mocks.sender import SayMessage, Message from grazyna.irc.models import User def make_bot(protocol, **kwargs): return RequestBot(protocol, user=User('socek!a@b'), chan='#czarnobyl', **kwargs) def test_init(protocol): bot = RequestBot(protocol) asse...
gpl-2.0
dimtruck/magnum
magnum/tests/functional/common/manager.py
2
2337
# 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 Li...
apache-2.0
CoolCloud/taiga-back
taiga/projects/issues/api.py
6
11958
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be> # Copyright (C) 2014 Jesús Espino <jespinog@gmail.com> # Copyright (C) 2014 David Barragán <bameda@dbarragan.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the F...
agpl-3.0
TheMOOCAgency/edx-platform
common/djangoapps/terrain/browser.py
4
10329
""" Browser set up for acceptance tests. """ # pylint: disable=no-member # pylint: disable=unused-argument from lettuce import before, after, world from splinter.browser import Browser from logging import getLogger from django.core.management import call_command from django.conf import settings from selenium.common.e...
agpl-3.0
ejpbruel/servo
ports/geckolib/binding_tools/regen_atoms.py
7
6142
#!/usr/bin/env python # 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/. import re import os def gnu_symbolify(source, ident): return "_ZN" + str(len(source.CLASS))...
mpl-2.0
lammps/lammps
python/examples/pylammps/elastic/elastic.py
7
14047
from argparse import ArgumentParser from lammps import PyLammps def potential(lmp, args): """ set up potential and minimization """ ff_string = ' ' ff_string = ff_string.join(args.elements) # merge all element string to one string lmp.kim("interactions", ff_string) # Setup neighbor style lmp....
gpl-2.0
surhudm/scipy
benchmarks/benchmarks/go_benchmark_functions/go_funcs_E.py
35
9862
# -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import from numpy import abs, asarray, cos, exp, arange, pi, sin, sqrt, sum from .go_benchmark import Benchmark class Easom(Benchmark): r""" Easom objective function. This class defines the Easom [1]_ global optimization ...
bsd-3-clause
eneldoserrata/marcos_openerp
addons/report_geraldo/lib/geraldo/site/newsite/django_1_0/django/views/generic/list_detail.py
34
5423
from django.template import loader, RequestContext from django.http import Http404, HttpResponse from django.core.xheaders import populate_xheaders from django.core.paginator import Paginator, InvalidPage from django.core.exceptions import ObjectDoesNotExist def object_list(request, queryset, paginate_by=None, page=No...
agpl-3.0
jrshust/spark
examples/src/main/python/mllib/k_means_example.py
123
2028
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
OGKevin/ComBunqWebApp
apiwrapper/endpoints/payment.py
2
1819
from apiwrapper.endpoints.endpoint import Endpoint from apiwrapper.endpoints.monetary_account import MonetaryAccount class Payment(Endpoint): __endpoint_payment = "payment" __endpoint_payment_batch = "payment-batch" __endpoint_payment_response = "request-response" __endpoint_payment_chat = "chat" ...
mit
bmanojlovic/ansible
lib/ansible/modules/packaging/language/pear.py
25
7370
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2012, Afterburn <http://github.com/afterburn> # (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com> # (c) 2015, Jonathan Lestrelin <jonathan.lestrelin@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # i...
gpl-3.0
citrix-openstack/nodepool
nodepool/provider_manager.py
1
22543
#!/usr/bin/env python # Copyright (C) 2011-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 ...
apache-2.0
naphthalene/fabric-bolt
fabric_bolt/projects/migrations/0019_auto__del_field_configuration_date_type__add_field_configuration_data_.py
18
9592
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Configuration.date_type' db.delete_column(u'projects_configuration', 'date_type') ...
mit
a10networks/acos-client
acos_client/v30/slb/virtual_server.py
1
5582
# Copyright 2014-2016, A10 Networks. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
mollstam/UnrealPy
UnrealPyEmbed/Source/Python/Lib/python27/sqlite3/test/dbapi.py
36
30350
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/dbapi.py: tests for DB-API compliance # # Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages...
mit
marcos-pereira/unb-pvc-project-cars
haarcascade_training/tools/imageclipper/haartrainingformat.py
6
1177
#!/usr/bin/python import os import re import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument("--clipdir", metavar = "CLIPDIR", help = "Path to a directory containing the clipped images " "in the format default imageclipper output format: " "<imgout_format = %%d/image...
mit
tumluliu/tracks-rest-api
tracksdb.py
1
3636
""" ORM definitions for mapping tracks data stored in PostgreSQL database """ from sqlalchemy import create_engine, Column, Integer, Float, String from sqlalchemy.dialects.postgresql import INTERVAL, TIMESTAMP from sqlalchemy.orm import sessionmaker, scoped_session from sqlalchemy.ext.declarative import declarative_ba...
mit
fabiking/plugin.video.fabiking
resources/tools/epg_formulatv.py
1
24493
# -*- coding: utf-8 -*- #------------------------------------------------------------ # PalcoTV EPG FórmulaTV.com # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) #------------------------------------------------------------ # Gracias a la librería plugintools de Jesús (www.mimediacenter.info) #---------------...
gpl-2.0
nmrao/robotframework
src/robot/utils/unic.py
12
2216
# Copyright 2008-2015 Nokia Solutions and Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
jherico/qtwebkit
Tools/Scripts/webkitpy/common/find_files_unittest.py
124
2677
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
lgpl-3.0
j00bar/django-widgy
widgy/contrib/urlconf_include/tests.py
1
5207
import imp import django from django.test import TestCase from django.test.client import RequestFactory from django.utils.decorators import decorator_from_middleware from django.http import HttpResponse, HttpResponseNotFound from django.core import urlresolvers from django.contrib.auth.models import AnonymousUser from...
apache-2.0
raulperula/python_tutorials
tutorial-pygame/src/example18.py
1
2277
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.utils.termcolors import background __author__ = "Raul Perula-Martinez" __date__ = "2015-01" __version__ = "$ Revision: 1.0 $" import pygame class Player(pygame.sprite.Sprite): def __init__(self, image): self.image = image self.rect = sel...
gpl-3.0
lintzc/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/lib/uao_udf.py
6
1083
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the 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 ...
apache-2.0
danegolfs/customCab
node_modules/node-gyp/gyp/pylib/gyp/generator/android.py
960
45344
# 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. # Notes: # # This generates makefiles suitable for inclusion into the Android build system # via an Android.mk file. It is based on make.py, the standard makefile ...
mit
pegah1/hazfeharznname
stemming-1.0/stemming/lovins.py
17
12644
"""This module implements the Lovins stemming algorithm. Use the ``stem()`` function:: stemmed_word = stem(word) """ from collections import defaultdict # Conditions def A(base): # A No restrictions on stem return True def B(base): # B Minimum stem length = 3 return len(base) > 2 def C(bas...
gpl-2.0
IGITUGraz/scoop
examples/callback.py
5
1308
# # This file is part of Scalable COncurrent Operations in Python (SCOOP). # # SCOOP 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)...
lgpl-3.0