repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
chipx86/reviewboard
reviewboard/reviews/tests/test_review.py
2
22062
from __future__ import unicode_literals from datetime import datetime, timedelta import logging from django.contrib.auth.models import AnonymousUser, User from django.utils import timezone from djblets.testing.decorators import add_fixtures from djblets.util.dates import get_tz_aware_utcnow from kgb import SpyAgency,...
mit
Nik0l/UTemPro
Features.py
1
6725
#Script to extract features. __author__ = 'nb254' # features used in the predictions # UserId = {'name': "UserId", 'x_from': 0, 'x_to': 1500000, 'title': "User's Id"} U_QUESTIONS = {'name': "U_QUESTIONS",'x_from': 0, 'x_to': 1500000, 'title': "Number of questions"} U_ANSWERS = {'name': "U_ANSWERS",'x...
mit
tjsavage/sfcsdatabase
django/contrib/gis/geos/polygon.py
321
6506
from ctypes import c_uint, byref from django.contrib.gis.geos.error import GEOSIndexError from django.contrib.gis.geos.geometry import GEOSGeometry from django.contrib.gis.geos.libgeos import get_pointer_arr, GEOM_PTR from django.contrib.gis.geos.linestring import LinearRing from django.contrib.gis.geos import prototyp...
bsd-3-clause
adamcharnock/django-image
example/settings.py
1
2662
""" Django settings for example project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build path...
mit
lmoustakas/DNestPy
Model.py
2
1065
import copy import numpy as np import numpy.random as rng class Model: """ Abstract class that usable Models should inherit """ def __init__(self): """ Set the logLikelihood+tieBreaker tuple to nothing """ self.logL = [None, None] def fromPrior(self): """ Draw the parameters from the prior """ se...
gpl-3.0
oostenveld/eegsynth-matlab
module/quantizer/quantizer.py
2
7108
#!/usr/bin/env python # Quantizer does chromatic quantification of Redis values for musical interfaces # # This software is part of the EEGsynth project, see <https://github.com/eegsynth/eegsynth>. # # Copyright (C) 2017-2020 EEGsynth project # # This program is free software: you can redistribute it and/or modify # i...
gpl-2.0
mccheung/kbengine
kbe/res/scripts/common/Lib/site-packages/pip/_vendor/requests/packages/urllib3/fields.py
294
5976
# urllib3/fields.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import email.utils import mimetypes from .packages import six def guess_content_type(filename...
lgpl-3.0
josephbisch/the-blue-alliance
tests/test_notification_base.py
7
1200
import unittest2 import json from google.appengine.ext import ndb from google.appengine.ext import testbed from consts.client_type import ClientType from consts.notification_type import NotificationType from notifications.ping import PingNotification class TestBaseNotification(unittest2.TestCase): def setUp(sel...
mit
SrNetoChan/QGIS
tests/src/python/test_qgslayouthtml.py
45
4694
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutItemHtml. .. 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
scality/cinder
cinder/tests/unit/volume/drivers/netapp/dataontap/client/fakes.py
4
6370
# Copyright (c) - 2015, Tom Barron. 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 require...
apache-2.0
cmos3511/cmos_linux
python/op/op/core/proj_repo.py
1
3884
""" Author: Guanyu Yi @ OnePiece Platform Group Email: guanyu_yi@alchip.com Description: base class for processing projects from code repo """ import os import git import requests from utils import pcom from utils import settings LOG = pcom.gen_logger(__name__) class ProjRepo(): """base calss of projects from co...
gpl-3.0
ChromiumWebApps/chromium
tools/cygprofile/symbolize.py
57
8785
#!/usr/bin/python # Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Symbolize log file produced by cypgofile instrumentation. Given a log file and the binary being profiled (e.g. executable, shared libra...
bsd-3-clause
xzturn/caffe2
scripts/get_python_cmake_flags.py
5
1130
## @package get_python_cmake_flags # Module scripts.get_python_cmake_flags ############################################################################## # Use this script to find your preferred python installation. ############################################################################## # # You can use the follo...
apache-2.0
talhajaved/nyuadmarket
flask/lib/python2.7/site-packages/migrate/versioning/schema.py
78
7688
""" Database schema version management. """ import sys import logging import six from sqlalchemy import (Table, Column, MetaData, String, Text, Integer, create_engine) from sqlalchemy.sql import and_ from sqlalchemy import exc as sa_exceptions from sqlalchemy.sql import bindparam from migrate import exceptions...
mit
diofant/diofant
diofant/tests/core/test_logic.py
2
4762
import itertools import pytest from diofant.core.logic import (And, Logic, Not, Or, _fuzzy_group, fuzzy_and, fuzzy_not, fuzzy_or) __all__ = () T = True F = False U = None def test_fuzzy_group(): v = [T, F, U] for i in itertools.product(*[v]*3): assert _fuzzy_group(...
bsd-3-clause
PennartLoettring/Poettrix
rootfs/usr/share/glib-2.0/codegen/dbustypes.py
33
17493
# -*- Mode: Python -*- # GDBus - GLib D-Bus Library # # Copyright (C) 2008-2011 Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at ...
gpl-2.0
nylas/caldav
caldav/elements/cdav.py
2
2907
#!/usr/bin/env python # -*- encoding: utf-8 -*- from caldav.lib.namespace import ns from base import BaseElement, NamedBaseElement, ValuedBaseElement ## Operations class CalendarQuery(BaseElement): tag = ns("C", "calendar-query") class Mkcalendar(BaseElement): tag = ns("D", "mkcalendar") ## Filters class F...
gpl-3.0
utkbansal/kuma
vendor/packages/pygments/lexers/basic.py
72
20306
# -*- coding: utf-8 -*- """ pygments.lexers.basic ~~~~~~~~~~~~~~~~~~~~~ Lexers for BASIC like languages (other than VB.net). :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, d...
mpl-2.0
mostateresnet/django-resnet-survey
survey/urls.py
1
2239
try: from django.conf.urls import patterns, url, include except ImportError: from django.conf.urls.defaults import patterns, url, include from django.contrib.auth.decorators import login_required from django.views.decorators.csrf import ensure_csrf_cookie from survey.views import * # pylint: disable-msg=C0103,...
mit
JioCloud/python-novaclient
novaclient/v1_1/limits.py
11
3092
# Copyright 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
qrkourier/ansible
test/units/modules/cloud/amazon/test_data_pipeline.py
25
10698
# (c) 2017 Red Hat Inc. # # 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 dis...
gpl-3.0
appsembler/edx-platform
cms/djangoapps/contentstore/views/tests/test_helpers.py
25
4131
""" Unit tests for helpers.py. """ from django.utils import http from contentstore.tests.utils import CourseTestCase from contentstore.views.helpers import xblock_studio_url, xblock_type_display_name from xmodule.modulestore.tests.factories import ItemFactory, LibraryFactory class HelpersTestCase(CourseTestCase): ...
agpl-3.0
futurulus/scipy
scipy/sparse/linalg/eigen/lobpcg/lobpcg.py
83
19348
""" Pure SciPy implementation of Locally Optimal Block Preconditioned Conjugate Gradient Method (LOBPCG), see http://www-math.cudenver.edu/~aknyazev/software/BLOPEX/ License: BSD Authors: Robert Cimrman, Andrew Knyazev Examples in tests directory contributed by Nils Wagner. """ from __future__ import division, prin...
bsd-3-clause
roxyboy/scikit-learn
sklearn/linear_model/logistic.py
105
56686
""" Logistic Regression """ # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # Fabian Pedregosa <f@bianp.net> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Manoj Kumar <manojkumarsivaraj334@gmail.com> # Lars Buitinck # Simon Wu <s8wu@uwaterloo.ca> imp...
bsd-3-clause
Britefury/scikit-image
skimage/future/graph/graph_cut.py
19
9309
try: import networkx as nx except ImportError: import warnings warnings.warn('RAGs require networkx') import numpy as np from . import _ncut from . import _ncut_cy from scipy.sparse import linalg def cut_threshold(labels, rag, thresh, in_place=True): """Combine regions separated by weight less than th...
bsd-3-clause
syseleven/vim-config
.vim/bundle/jedi-vim/jedi/test/test_api/test_api.py
10
3545
""" Test all things related to the ``jedi.api`` module. """ from textwrap import dedent from jedi import api from pytest import raises def test_preload_modules(): def check_loaded(*modules): # +1 for None module (currently used) assert len(parser_cache) == len(modules) + 1 for i in modul...
apache-2.0
TimBizeps/BachelorAP
V503_Millikan Versuch/matrix2latex/src_python/fixEngineeringNotation.py
3
1220
"""This file is part of matrix2latex. matrix2latex 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. matrix2latex is distributed in the hope ...
gpl-3.0
ghchinoy/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/moving_stats_test.py
23
5119
# 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
seppi91/CouchPotatoServer
libs/subliminal/language.py
107
54658
# -*- coding: utf-8 -*- # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # # This file is part of subliminal. # # subliminal 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...
gpl-3.0
SUSE/ceph-deploy-to-be-deleted
ceph_deploy/util/templates.py
6
2151
ceph_repo = """ [ceph] name=Ceph packages for $basearch baseurl={repo_url}/$basearch enabled=1 gpgcheck=1 priority=1 type=rpm-md gpgkey={gpg_url} [ceph-noarch] name=Ceph noarch packages baseurl={repo_url}/noarch enabled=1 gpgcheck=1 priority=1 type=rpm-md gpgkey={gpg_url} [ceph-source] name=Ceph source packages bas...
mit
nwswanson/checkin
server/vendor/falcon/routing/util.py
2
4912
# Copyright 2013 by Rackspace Hosting, 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 t...
mit
wakatime/komodo-wakatime
components/wakatime/packages/pygments/regexopt.py
31
3094
# -*- coding: utf-8 -*- """ pygments.regexopt ~~~~~~~~~~~~~~~~~ An algorithm that generates optimized regexes for matching long lists of literal strings. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from re import esc...
bsd-3-clause
mtheobaldo/crm
src/CRM/migrations/0001_initial.py
1
6394
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.Create...
mit
mrunge/openstack_horizon
openstack_horizon/test/api_tests/fwaas_tests.py
1
15559
# Copyright 2013, Big Switch Networks, 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 applic...
apache-2.0
kevinmel2000/sl4a
python/src/Lib/re.py
56
12966
# # Secret Labs' Regular Expression Engine # # re-compatible interface for the sre matching engine # # Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved. # # This version of the SRE library can be redistributed under CNRI's # Python 1.6 license. For any other use, please contact Secret Labs # AB (info@py...
apache-2.0
winndows/cinder
cinder/volume/drivers/netapp/dataontap/nfs_base.py
3
41400
# Copyright (c) 2012 NetApp, Inc. All rights reserved. # Copyright (c) 2014 Ben Swartzlander. All rights reserved. # Copyright (c) 2014 Navneet Singh. All rights reserved. # Copyright (c) 2014 Clinton Knight. All rights reserved. # Copyright (c) 2014 Alex Meade. All rights reserved. # Copyright (c) 2014 Bob Callaw...
apache-2.0
openmv/openmv
scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_test.py
2
2392
# Image Drawing Alpha Table Test # # This script tests the performance and quality of the draw_image() # method which can perform nearest neighbor, bilinear, bicubic, and # area scaling along with color channel extraction, alpha blending, # color palette application, and alpha palette application. import sensor, image...
mit
thinkopensolutions/tkobr-addons
unported/tko_point_of_sale_discount_cards/point_of_sale.py
2
3440
import logging from openerp import fields, models, api _logger = logging.getLogger(__name__) _card_type = [('p', 'Percentage'), ('fi', 'Fixed')] class pos_discount_cards(models.Model): _name = 'pos.discount.cards' name = fields.Char('Name', required=True) type = fields.Selection(_card_type, string='Typ...
agpl-3.0
12yujim/pymtl
accel/mvmult/MatrixVecLaneFL_test.py
7
8700
#============================================================================== # MatrixVecLaneFL_test #============================================================================== import pytest from pymtl import * from pclib.ifcs import mem_msgs from pclib.test import TestSource, TestMemory from MatrixVe...
bsd-3-clause
leoc/home-assistant
homeassistant/components/lock/demo.py
18
1359
""" Demo lock platform that has two fake locks. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ from homeassistant.components.lock import LockDevice from homeassistant.const import (STATE_LOCKED, STATE_UNLOCKED) # pylint: disable=unused-argument ...
mit
benjamindeleener/odoo
addons/l10n_cn_standard/__openerp__.py
23
1035
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. # Copyright (C) 2008-2008 凯源吕鑫 lvxin@gmail.com <basic chart data> # 维智众源 oldrev@gmail.com <states data> # Copyright (C) 2012-2012 南京盈通 ccdos@intoerp.com <small business chart> # Copyright (C)...
gpl-3.0
BlindHunter/django
tests/gis_tests/geoapp/test_sitemaps.py
123
2631
from __future__ import unicode_literals import zipfile from io import BytesIO from xml.dom import minidom from django.conf import settings from django.contrib.sites.models import Site from django.test import ( TestCase, modify_settings, override_settings, skipUnlessDBFeature, ) from .models import City, Country ...
bsd-3-clause
silly-wacky-3-town-toon/SOURCE-COD
Panda3D-1.10.0/python/Lib/test/crashers/loosing_mro_ref.py
151
1079
""" There is a way to put keys of any type in a type's dictionary. I think this allows various kinds of crashes, but so far I have only found a convoluted attack of _PyType_Lookup(), which uses the mro of the type without holding a strong reference to it. Probably works with super.__getattribute__() too, which uses th...
apache-2.0
schmidtc/pysal
pysal/esda/getisord.py
4
12706
""" Getis and Ord G statistic for spatial autocorrelation """ __author__ = "Sergio J. Rey <srey@asu.edu>, Myunghwa Hwang <mhwang4@gmail.com> " __all__ = ['G', 'G_Local'] from pysal.common import np, stats, math from pysal.weights.spatial_lag import lag_spatial as slag PERMUTATIONS = 999 class G: """ Global ...
bsd-3-clause
fhaoquan/kbengine
kbe/res/scripts/common/Lib/ctypes/__init__.py
77
17020
"""create and manipulate C data types in Python""" import os as _os, sys as _sys __version__ = "1.1.0" from _ctypes import Union, Structure, Array from _ctypes import _Pointer from _ctypes import CFuncPtr as _CFuncPtr from _ctypes import __version__ as _ctypes_version from _ctypes import RTLD_LOCAL, RTLD_GLOBAL from...
lgpl-3.0
zrax/moul-scripts
Python/xIniDisplay.py
6
5967
# -*- coding: utf-8 -*- """ *==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, 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...
gpl-3.0
mikedh/trimesh
tests/test_proximity.py
1
9751
try: from . import generic as g except BaseException: import generic as g class NearestTest(g.unittest.TestCase): def test_naive(self): """ Test the naive nearest point function """ # generate a unit sphere mesh sphere = g.trimesh.primitives.Sphere(subdivisions=4)...
mit
boneill42/cassandra
pylib/cqlshlib/test/cassconnect.py
40
4917
# 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
hsum/sqlalchemy
test/ext/test_orderinglist.py
28
13704
from sqlalchemy import Integer, ForeignKey, String, MetaData from sqlalchemy.orm import relationship, mapper, create_session from sqlalchemy.ext.orderinglist import ordering_list from sqlalchemy.testing import eq_ from sqlalchemy.testing import fixtures from sqlalchemy import testing from sqlalchemy.testing.schema impo...
mit
poiesisconsulting/openerp-restaurant
poi_pos_table_designer/wizard/table_assigner.py
3
2708
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2011-2013 Serpent Consulting Services Pvt. Ltd. (<http://serpentcs.com>). # # This progr...
agpl-3.0
MattCrystal/HTCOneLinaro
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
pexip/meson
mesonbuild/compilers/rust.py
2
4156
# Copyright 2012-2017 The Meson development team # 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 agree...
apache-2.0
openhdf/enigma2-wetek
lib/python/Components/SystemInfo.py
1
3325
from os import path from enigma import eDVBResourceManager, Misc_Options from Tools.Directories import fileExists, fileCheck, resolveFilename, SCOPE_SKIN from Tools.HardwareInfo import HardwareInfo from boxbranding import getBoxType, getMachineBuild, getBrandOEM SystemInfo = { } #FIXMEE... def getNumVideoDecoders(): ...
gpl-2.0
zzeleznick/zDjango
venv/lib/python2.7/site-packages/setuptools/command/build_py.py
207
8440
import os import sys import fnmatch import textwrap from distutils.command.build_py import build_py as _build_py from distutils.util import convert_path from glob import glob try: from setuptools.lib2to3_ex import Mixin2to3 except ImportError: class Mixin2to3: def run_2to3(self, files, doctests=True): ...
mit
marcelotoledo5000/kubernetes
cluster/juju/charms/trusty/kubernetes-master/unit_tests/kubernetes_installer_test.py
213
4910
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
bcl/blivet
tests/formats_test/labeling_test.py
6
3970
import unittest from tests import loopbackedtestcase from blivet.formats import device_formats import blivet.formats.fs as fs import blivet.formats.swap as swap from . import fslabeling class InitializationTestCase(unittest.TestCase): """Test FS object initialization.""" def testLabels(self): """Ini...
gpl-2.0
yceruto/django
django/utils/html_parser.py
6
4555
from django.utils.six.moves import html_parser as _html_parser import re import sys current_version = sys.version_info use_workaround = ( (current_version < (2, 7, 3)) or (current_version >= (3, 0) and current_version < (3, 2, 3)) ) HTMLParseError = _html_parser.HTMLParseError if not use_workaround: HTM...
bsd-3-clause
Pakoach/Sick-Beard-Animes
sickbeard/webserveInit.py
43
6433
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
nhicher/ansible
lib/ansible/modules/network/ios/ios_ping.py
81
5865
#!/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
lightwang1/beets
beetsplug/scrub.py
25
5220
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # 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, copy, ...
mit
babyliynfg/cross
tools/project-creator/Python2.6.6/Lib/test/test_univnewlines.py
1
3896
# Tests universal newline support for both reading and parsing files. import unittest import os import sys from test import test_support if not hasattr(sys.stdin, 'newlines'): raise test_support.TestSkipped, \ "This Python does not have universal newline support" FATX = 'x' * (2**14) DATA_TEM...
mit
samba-team/samba
third_party/waf/waflib/Tools/bison.py
55
1187
#!/usr/bin/env python # encoding: utf-8 # John O'Meara, 2006 # Thomas Nagy 2009-2018 (ita) """ The **bison** program is a code generator which creates C or C++ files. The generated files are compiled into object files. """ from waflib import Task from waflib.TaskGen import extension class bison(Task.Task): """Compi...
gpl-3.0
bussiere/ZeroNet
src/lib/pybitcointools/bitcoin/transaction.py
20
15550
#!/usr/bin/python import binascii, re, json, copy, sys from .main import * from _functools import reduce ### Hex to bin converter and vice versa for objects def json_is_base(obj, base): if not is_python2 and isinstance(obj, bytes): return False alpha = get_code_string(base) if isinstance(obj...
gpl-2.0
skeuomorf/cryptography
src/cryptography/hazmat/backends/openssl/ec.py
7
9256
# 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 from cryptography import utils from cryptography.exceptions import ( ...
bsd-3-clause
belmiromoreira/nova
nova/tests/functional/v3/test_quota_classes.py
33
2212
# Copyright 2012 Nebula, Inc. # Copyright 2013 IBM Corp. # # 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...
apache-2.0
Maccimo/intellij-community
plugins/hg4idea/testData/bin/hgext/inotify/server.py
90
14406
# server.py - common entry point for inotify status server # # Copyright 2009 Nicolas Dumazet <nicdumz@gmail.com> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from mercurial.i18n import _ from mercurial import cmdutil, posix, o...
apache-2.0
hexlism/css_platform
sleepyenv/lib/python2.7/site-packages/boto-2.38.0-py2.7.egg/boto/cloudsearch/domain.py
153
15607
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
apache-2.0
mitar/django
tests/regressiontests/generic_views/models.py
14
1106
from django.db import models class Artist(models.Model): name = models.CharField(max_length=100) class Meta: ordering = ['name'] verbose_name = 'professional artist' verbose_name_plural = 'professional artists' def __unicode__(self): return self.name @models.permalin...
bsd-3-clause
mitar/django
tests/regressiontests/localflavor/mk/tests.py
33
11431
from __future__ import absolute_import from django.contrib.localflavor.mk.forms import ( MKIdentityCardNumberField, MKMunicipalitySelect, UMCNField) from django.test import SimpleTestCase from .forms import MKPersonForm class MKLocalFlavorTests(SimpleTestCase): def setUp(self): self.form = MKPerson...
bsd-3-clause
dalejung/trtools
trtools/io/tests/test_filecache.py
1
1754
from unittest import TestCase from io import StringIO from trtools.util.tempdir import TemporaryDirectory import trtools.io.filecache as fc class TestFileCache(TestCase): def __init__(self, *args, **kwargs): TestCase.__init__(self, *args, **kwargs) def runTest(self): pass def setUp(self...
mit
irwinlove/django
django/db/models/sql/where.py
439
8054
""" Code to manage the creation and SQL rendering of 'where' constraints. """ from django.db.models.sql.datastructures import EmptyResultSet from django.utils import tree from django.utils.functional import cached_property # Connection types AND = 'AND' OR = 'OR' class WhereNode(tree.Node): """ Used to repr...
bsd-3-clause
ericrasmussen/pyramid_redis_sessions
pyramid_redis_sessions/session.py
1
8483
# -*- coding: utf-8 -*- import binascii import os from pyramid.compat import text_ from pyramid.decorator import reify from pyramid.interfaces import ISession from zope.interface import implementer from .compat import cPickle from .util import ( persist, refresh, to_unicode, ) class _SessionState(o...
bsd-2-clause
Thoshh/wapad
lib/python2.7/site-packages/django/core/management/commands/testserver.py
200
2074
from django.core.management import call_command from django.core.management.base import BaseCommand from django.db import connection class Command(BaseCommand): help = 'Runs a development server with data from the given fixture(s).' requires_system_checks = False def add_arguments(self, parser): ...
mit
johankaito/fufuka
microblog/old-flask/lib/python2.7/site-packages/wheel/archive.py
239
1559
""" Archive tools for wheel. """ import logging import os.path import zipfile log = logging.getLogger("wheel") def archive_wheelfile(base_name, base_dir): '''Archive all files under `base_dir` in a whl file and name it like `base_name`. ''' olddir = os.path.abspath(os.curdir) base_name = os.path...
apache-2.0
el-ethan/kivy
kivy/core/text/__init__.py
2
28172
''' Text ==== An abstraction of text creation. Depending of the selected backend, the accuracy of text rendering may vary. .. versionchanged:: 1.5.0 :attr:`LabelBase.line_height` added. .. versionchanged:: 1.0.7 The :class:`LabelBase` does not generate any texture if the text has a width <= 1. This is t...
mit
jneves/python-social-auth
social/apps/django_app/me/models.py
77
2124
""" MongoEngine Django models for Social Auth. Requires MongoEngine 0.8.6 or higher. """ from django.conf import settings from mongoengine import Document, ReferenceField from mongoengine.queryset import OperationError from social.utils import setting_name, module_member from social.storage.django_orm import BaseDjan...
bsd-3-clause
istio/distroless
experimental/python2.7/generate_ldconfig_cache.py
2
1898
#!/usr/bin/env python ''' Generates ld.so.cache from a container image that contains ldconfig. ''' import os import re import shutil import subprocess import sys import tempfile CONTAINER_IMAGE_PATH = 'experimental/python2.7/python27_{}_debian9' EXECUTABLE_SUFFIX = '.executable' def main(): if len(sys.argv) !=...
apache-2.0
xuzhao1211/OnlineExam
misago/conf/tests/test_settings.py
8
4439
from django.apps import apps from django.conf import settings as dj_settings from django.test import TestCase from misago.core import threadstore from misago.core.cache import cache from misago.conf.gateway import settings as gateway from misago.conf.dbsettings import db_settings from misago.conf.migrationutils impor...
gpl-2.0
maestro-hybrid-cloud/heat
contrib/rackspace/heat_keystoneclient_v2/tests/test_client.py
13
11199
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
apache-2.0
manran/django-allauth
allauth/account/migrations/0001_initial.py
69
2215
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import django.utils.timezone from django.conf import settings UNIQUE_EMAIL = getattr(settings, 'ACCOUNT_UNIQUE_EMAIL', True) class Migration(migrations.Migration): dependencies = [ migrations.swappa...
mit
Orav/kbengine
kbe/src/lib/python/Lib/encodings/cp775.py
37
35173
""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,input,e...
lgpl-3.0
bt3gl/Neat-Problems-in-Python-and-Flask
Version-Control/src/test_system_operations.py
1
2639
#!/usr/bin/env python __author__ = "Mari Wahl" __email__ = "marina.w4hl@gmail.com" __description__ = "Custom test class to test system_operations.py" import os import system_operations from constants import * class TestClass: def test_bootstrap(self): system_operations.writing_file(SOURCE, 'a', "...
mit
jgronefe/AliPhysics
PWGMM/MC/aligenqa/aligenqa/utils.py
37
7697
import os import random import string import subprocess import re from rootpy import asrootpy from rootpy.plotting import Graph def gen_random_name(): """Generate a random name for temp hists""" return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(25)) def get_est_dirs(sums, co...
bsd-3-clause
mikalstill/nova
nova/tests/unit/objects/test_dns_domain.py
2
3021
# Copyright (C) 2014, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
40023247/W17test
static/Brython3.1.1-20150328-091302/Lib/xml/sax/_exceptions.py
625
4885
"""Different kinds of SAX Exceptions""" #in brython the 4 lines below causes an $globals['Exception'] error #import sys #if sys.platform[:4] == "java": # from java.lang import Exception #del sys # ===== SAXEXCEPTION ===== class SAXException(Exception): """Encapsulate an XML error or warning. This class can con...
agpl-3.0
vwrobel/cvtools
cvtools/objects/objects.py
1
7688
import importlib import cv2 import numpy as np from tqdm import tqdm from copy import copy import os.path class Vid: def __init__(self, filepath, orig=True): self.filepath = filepath self.name = os.path.splitext(os.path.basename(filepath))[0] self.orig = orig self.cap = None ...
mit
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.3.0/Lib/distutils/command/build_py.py
7
17154
"""distutils.command.build_py Implements the Distutils 'build_py' command.""" import os import imp import sys from glob import glob from distutils.core import Command from distutils.errors import * from distutils.util import convert_path, Mixin2to3 from distutils import log class build_py (Command): descriptio...
mit
jackrzhang/zulip
zerver/webhooks/heroku/tests.py
2
1359
# -*- coding: utf-8 -*- from zerver.lib.test_classes import WebhookTestCase class HerokuHookTests(WebhookTestCase): STREAM_NAME = 'heroku' URL_TEMPLATE = u"/api/v1/external/heroku?stream={stream}&api_key={api_key}" def test_deployment(self) -> None: expected_topic = "sample-project" expec...
apache-2.0
delhivery/django
tests/gis_tests/geo3d/tests.py
199
17484
from __future__ import unicode_literals import os import re from unittest import skipUnless from django.contrib.gis.db.models import Extent3D, Union from django.contrib.gis.db.models.functions import ( AsGeoJSON, AsKML, Length, Perimeter, Scale, Translate, ) from django.contrib.gis.gdal import HAS_GDAL from djang...
bsd-3-clause
ryfeus/lambda-packs
Tensorflow/source/tensorboard/plugins/debugger/constants.py
7
2023
# 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...
mit
medialab/ANTA
application/pys/sentencesTokenizer.py
2
1524
#!/usr/bin/python # -*- coding: utf-8 -*- ######################################## import sys import nltk.data import json import codecs ######################################## def giveJson(dict): return json.dumps(dict, indent=4) ######################################## def tokenize(inPathFile, lang): """ get a...
lgpl-3.0
hachreak/zenodo
zenodo/modules/records/permissions.py
4
12006
# -*- coding: utf-8 -*- # # This file is part of Zenodo. # Copyright (C) 2016 CERN. # # Zenodo 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 v...
gpl-2.0
Kleptobismol/scikit-bio
skbio/stats/ordination/_base.py
1
18694
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause
aabbox/kbengine
kbe/src/lib/python/Lib/_bootlocale.py
168
1301
"""A minimal subset of the locale module used at interpreter startup (imported by the _io module), in order to reduce startup time. Don't import directly from third-party code; use the `locale` module instead! """ import sys import _locale if sys.platform.startswith("win"): def getpreferredencoding(do_setlocale=...
lgpl-3.0
vanpact/scipy
scipy/weave/examples/vq.py
100
9312
""" """ from __future__ import absolute_import, print_function # C:\home\ej\wrk\scipy\weave\examples>python vq.py # vq with 1000 observation, 10 features and 30 codes fo 100 iterations # speed in python: 0.150119999647 # [25 29] [ 2.49147266 3.83021032] # speed in standard c: 0.00710999965668 # [25 29] [ 2.49147266...
bsd-3-clause
will-moore/openmicroscopy
sql/misc/enums.py
15
2208
#!/usr/bin/env python # -*- coding: utf-8 -*- # Calculated via: # grep enum components/model/resources/mappings/* | grep "id=" | perl -pe # 's/^.*?\".*[.](.*?)\".*?$/$1/' | sort >> sql/misc/enums.py ENUMS = """ AcquisitionMode ArcType Binning ContrastMethod Correction DetectorType DimensionOrder EventType EventType Ex...
gpl-2.0
farhaanbukhsh/nuancier
nuancier/admin.py
4
13849
# -*- coding: utf-8 -*- # # Copyright © 2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed in t...
gpl-2.0
mabelcalim/tide-app
kivy/test8/.buildozer/venv/lib/python2.7/encodings/euc_jis_2004.py
816
1051
# # euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_jp, codecs import _multibytecodec as mbc codec = _codecs_jp.getcodec('euc_jis_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class IncrementalEncoder(m...
gpl-3.0
wahlmanj/OpenPlex3
update/OSX/icon/ios7/DNSServer.py
4
16525
#!/usr/bin/env python """ Source: http://code.google.com/p/minidns/source/browse/minidns """ """ Header 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | ID | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |QR| Opcode ...
bsd-3-clause
globau/servo
tests/wpt/web-platform-tests/service-workers/service-worker/resources/service-worker-csp-worker.py
62
5024
bodyDefault = ''' importScripts('worker-testharness.js'); importScripts('test-helpers.sub.js'); importScripts('/common/get-host-info.sub.js'); var host_info = get_host_info(); test(function() { var import_script_failed = false; try { importScripts(host_info.HTTPS_REMOTE_ORIGIN + base_path() + 'e...
mpl-2.0