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
blaze33/django
tests/regressiontests/aggregation_regress/tests.py
16
39216
from __future__ import absolute_import, unicode_literals import datetime import pickle from decimal import Decimal from operator import attrgetter from django.core.exceptions import FieldError from django.db.models import Count, Max, Avg, Sum, StdDev, Variance, F, Q from django.test import TestCase, Approximate, skip...
bsd-3-clause
arokem/scipy
scipy/sparse/construct.py
1
25970
"""Functions to construct sparse matrices """ from __future__ import division, print_function, absolute_import __docformat__ = "restructuredtext en" __all__ = ['spdiags', 'eye', 'identity', 'kron', 'kronsum', 'hstack', 'vstack', 'bmat', 'rand', 'random', 'diags', 'block_diag'] import numpy as np from .s...
bsd-3-clause
lumig242/Hue-Integration-with-CDAP
desktop/core/ext-py/Django-1.6.10/django/utils/html.py
67
12669
"""HTML utilities suitable for global use.""" from __future__ import unicode_literals import re from django.utils.safestring import SafeData, mark_safe from django.utils.encoding import force_text, force_str from django.utils.functional import allow_lazy from django.utils import six from django.utils.six.moves.urlli...
apache-2.0
arobbins/go
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py
899
2768
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
mit
omaciel/robottelo
tests/foreman/ui/test_dashboard.py
1
22844
"""Test module for Dashboard UI :Requirement: Dashboard :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: Dashboard :TestType: Functional :CaseImportance: High :Upstream: No """ from fauxfactory import ( gen_integer, gen_ipaddr, gen_mac, ) from airgun.session import Session from nail...
gpl-3.0
TravelModellingGroup/TMGToolbox
TMGToolbox/src/XTMF_internal/import_function_batch_file.py
1
2153
''' Copyright 2021 Travel Modelling Group, Department of Civil Engineering, University of Toronto This file is part of the TMG Toolbox. The TMG Toolbox 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-3.0
lukeiwanski/tensorflow
tensorflow/contrib/rnn/python/kernel_tests/fused_rnn_cell_test.py
77
7404
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
revolutionaryG/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/comments.py
148
2030
# Copyright (c) 2009 Google Inc. All rights reserved. # Copyright (c) 2009 Apple 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...
bsd-3-clause
googleapis/google-api-php-client-services
generator/setup.py
2
1827
#!/usr/bin/python2.7 # Copyright 2010 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 requi...
apache-2.0
GitHublong/hue
desktop/core/ext-py/Django-1.6.10/tests/comment_tests/tests/test_comment_form.py
53
3001
from __future__ import absolute_import import time from django.conf import settings from django.contrib.comments.forms import CommentForm from django.contrib.comments.models import Comment from . import CommentTestCase from ..models import Article class CommentFormTests(CommentTestCase): def testInit(self): ...
apache-2.0
ankurankan/scikit-learn
sklearn/cluster/tests/test_birch.py
7
5610
""" Tests for the birch clustering algorithm. """ from scipy import sparse import numpy as np from .common import generate_clustered_data from sklearn.cluster.birch import Birch from sklearn.cluster.hierarchical import AgglomerativeClustering from sklearn.datasets import make_blobs from sklearn.linear_model import El...
bsd-3-clause
aninternetof/bremen
bremenenv/lib/python3.5/site-packages/django/core/checks/security/csrf.py
477
1796
from django.conf import settings from .. import Tags, Warning, register W003 = Warning( "You don't appear to be using Django's built-in " "cross-site request forgery protection via the middleware " "('django.middleware.csrf.CsrfViewMiddleware' is not in your " "MIDDLEWARE_CLASSES). Enabling the middle...
mit
universalcore/springboard
springboard/tools/main.py
1
1122
import argparse from elasticgit.tools import add_command, run from springboard.tools.commands import CloneRepoTool from springboard.tools.commands import CreateIndexTool from springboard.tools.commands import CreateMappingTool from springboard.tools.commands import SyncDataTool from springboard.tools.commands import ...
bsd-2-clause
Luksys5/Paleistuve
Coding/Hamming/writecode.py
2
2908
import math def creatingcode(bits): n=1 zod={} length=len(bits) while((int(math.pow(2,n))-1)<=(length+n)): n=n+1 print "Cia prasideda kodas: ", n sumbins=[] Dbins = [] Cbins=[] mybins=[] newstring='' Ccode = '' last=0 max = 0 for b in range(1,length+n+1): mystr = bin(b)[2:] mystr = ("0"*(n-len(my...
gpl-2.0
dglazer/schemas
tests/utils.py
17
3776
""" Utilities for tests """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import os import shlex import subprocess import sys import tempfile import requests import humanize def log(message): print(message) def getLinesFromLogFile(stream): st...
apache-2.0
dataarts/tailbone
tailbone/proxy/__init__.py
36
2157
# Copyright 2013 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 a...
apache-2.0
intgr/django
tests/datetimes/tests.py
49
6025
import datetime from django.test import TestCase, override_settings from django.utils import timezone from .models import Article, Category, Comment class DateTimesTests(TestCase): def test_related_model_traverse(self): a1 = Article.objects.create( title="First one", pub_date=dat...
bsd-3-clause
raoanirudh/oq-risklib
openquake/commonlib/calculators/scenario_risk.py
1
4850
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2014, GEM Foundation # OpenQuake 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 Free Software Foundation, either version 3 of the Licen...
agpl-3.0
AerysBat/closure-linter
closure_linter/errors.py
11
4390
#!/usr/bin/env python # Copyright 2007 The Closure Linter Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
caisq/tensorflow
tensorflow/contrib/resampler/python/ops/resampler_ops.py
66
2809
# pylint: disable=g-bad-file-header # Copyright 2017 The Sonnet 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...
apache-2.0
tommy-u/chaco
chaco/line_scatterplot_1d.py
1
4007
""" A 1D scatterplot that draws lines across the renderer at the index values """ from __future__ import absolute_import from numpy import empty # Enthought library imports from enable.api import black_color_trait, ColorTrait, LineStyle from traits.api import Any, Bool, Float, Str # local imports from .base_1d_plo...
bsd-3-clause
luismasuelli/arcanelab-ouroboros
sample/support.py
1
2519
from django.core.exceptions import ValidationError from django.test import TestCase from sample.models import Task def dummy_joiner(*args): # This joiner is useless and will raise errors on last join. # Declared only for test (placeholder) purposes return None def dummy_condition_a(*args): # This co...
mit
skg-net/ansible
lib/ansible/module_utils/network/f5/bigiq.py
2
3847
# -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type import time try: from f5.bigiq import ManagementRoot from icontrol...
gpl-3.0
txm/make-good
django/contrib/webdesign/tests.py
379
1054
# -*- coding: utf-8 -*- import unittest from django.contrib.webdesign.lorem_ipsum import * from django.template import loader, Context class WebdesignTest(unittest.TestCase): def test_words(self): self.assertEqual(words(7), u'lorem ipsum dolor sit amet consectetur adipisicing') def test_paragraphs...
bsd-3-clause
broferek/ansible
lib/ansible/modules/cloud/google/gcpubsub_info.py
23
4597
#!/usr/bin/python # Copyright 2016 Google 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', 'status': ['preview'], ...
gpl-3.0
aleGpereira/libcloud
libcloud/storage/drivers/s3.py
13
37200
# 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 use ...
apache-2.0
djkonro/client-python
kubernetes/client/models/v1_user_info.py
2
5228
# coding: utf-8 """ Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.7.4 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re ...
apache-2.0
martinthomson/blame-bridge
blame_bridge/bridge.py
1
7204
import subprocess from sys import stdout, stderr, argv from collections import deque from diffu import parseDiff, writeMergedChunks from blame import blameCursor, defaultBlame, mergeBlames, pickNewest verbose = 0 ignoreCharacters = ' \t\r\n' def ignoreWhitespace(str): return str.translate(None, ignoreCharacters...
mit
baiyunping333/BurpSuite-Plugins
Sqlmap/thirdparty/fcrypt/fcrypt.py
30
26648
# fcrypt.py """Unix crypt(3) password hash algorithm. This is a port to Python of the standard Unix password crypt function. It's a single self-contained source file that works with any version of Python from version 1.5 or higher. The code is based on Eric Young's optimised crypt in C. Python fcrypt is intended fo...
gpl-2.0
h3llrais3r/SickRage
sickbeard/clients/qbittorrent_client.py
3
4639
# coding=utf-8 # Author: Mr_Orange <mr_orange@hotmail.it> # URL: https://sickrage.github.io # # This file is part of SickRage. # # SickRage is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of ...
gpl-3.0
macarthur-lab/seqr
reference_data/management/commands/run_reference_data_database_backup.py
1
1126
import os from django.core.management.base import BaseCommand import datetime import logging logger = logging.getLogger(__name__) class Command(BaseCommand): help = 'Run database backups.' def add_arguments(self, parser): parser.add_argument('--postgres-host', default=os.environ.get('POSTGRES_SERVI...
agpl-3.0
SnakeJenny/TensorFlow
tensorflow/contrib/keras/python/keras/applications/inception_v3_test.py
52
1591
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
scalable-networks/gnuradio-3.7.2.1
gr-filter/examples/fir_filter_fff.py
6
4018
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # ...
gpl-3.0
blue-yonder/bonfire
tests/test_api.py
1
6022
''' Created on 20.04.15 @author = mharder ''' import bonfire.graylog_api as api import arrow import pytest import httpretty def test_message(): ts = arrow.now() m = api.Message({"message": {"message": "Test", "timestamp": ts, "level": 1}}) expected = "[{}] 1: Test".format(ts) assert m.simple_format...
bsd-3-clause
dhenyjarasandy/scrapy
tests/test_utils_request.py
48
3578
from __future__ import print_function import unittest from scrapy.http import Request from scrapy.utils.request import request_fingerprint, _fingerprint_cache, \ request_authenticate, request_httprepr class UtilsRequestTest(unittest.TestCase): def test_request_fingerprint(self): r1 = Request("http://w...
bsd-3-clause
pku9104038/edx-platform
cms/djangoapps/contentstore/views/import_export.py
1
15977
""" These views handle all actions in Studio related to import and exporting of courses """ import logging import os import tarfile import shutil import re from tempfile import mkdtemp from path import path from django.conf import settings from django.http import HttpResponse from django.contrib.auth.decorators import...
agpl-3.0
RackSec/ansible
lib/ansible/inventory/group.py
32
5343
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.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) an...
gpl-3.0
doug-wade/piSubstitutor
piCalculator.py
2
3358
""" Python3 program to calculate Pi using python long integers, binary splitting and the Chudnovsky algorithm See: http://www.craig-wood.com/nick/articles/pi-chudnovsky/ for more info Nick Craig-Wood <nick@craig-wood.com> """ import math from time import time def sqrt(n, one): """ Return the square root of ...
mit
ofreshy/ojo
ojo/services/rar_service.py
1
2314
import logging from ojo.constants import MB from ojo.models.job import JobStage from ojo import services from ojo.services import * from ojo.services.base_service import BaseService RAR_COMMAND = "rar" BASE_RAR_ARGS = ("a", "-m0", "-ep", "-ed", "-df", "-r") def is_installed(): return services.is_installed(RAR_...
mit
tximikel/kuma
kuma/wiki/kumascript.py
10
10140
import base64 from collections import defaultdict import json import hashlib import time from urlparse import urljoin from django.conf import settings from django.contrib.sites.models import Site from constance import config import requests from kuma.core.cache import memcache from .constants import KUMASCRIPT_TIME...
mpl-2.0
helldorado/ansible
lib/ansible/modules/cloud/openstack/os_subnets_facts.py
31
4515
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
kosgroup/odoo
addons/website/wizard/base_language_install.py
53
1287
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models class BaseLanguageInstall(models.TransientModel): _inherit = "base.language.install" website_ids = fields.Many2many('website', string='Websites to translate') @api....
gpl-3.0
pydata/xarray
xarray/tests/test_distributed.py
1
7365
""" isort:skip_file """ import pickle import pytest dask = pytest.importorskip("dask") # isort:skip distributed = pytest.importorskip("distributed") # isort:skip from dask.distributed import Client, Lock from distributed.utils_test import cluster, gen_cluster from distributed.utils_test import loop from distribute...
apache-2.0
direvus/ansible
lib/ansible/modules/network/cloudengine/ce_mtu.py
43
19870
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
gmorell/LambentAether
config_nexturns.py
1
6773
from filters.colors import RGBtoGRBLambentOutputFilter, InvertLambentOutputFilter, PercentageBrightnessReduc50, \ PercentageBrightnessReduc66, PercentageBrightnessReduc75, PercentageBrightnessReduc80, PercentageBrightnessReduc90, \ NeonOutputFilter, PastelOutputFilter, DarkenedOutputFilter from minmax.states im...
lgpl-3.0
Just-D/chromium-1
components/policy/tools/generate_policy_source.py
9
39323
#!/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
pymedusa/SickRage
ext/tornado/platform/interface.py
6
2262
# # Copyright 2011 Facebook # # 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, s...
gpl-3.0
bundgus/python-playground
bokeh-playground/simple.py
1
2413
''' This script is loosely based on the bokeh spectogram example, but is much simpler: https://github.com/bokeh/bokeh/tree/master/examples/embed/spectrogram This creates a simple form for generating polynomials of the form y = x^2. This is done using a form that has a method of GET, allowing you to share the graphs...
mit
swannapa/erpnext
erpnext/maintenance/doctype/maintenance_schedule/maintenance_schedule.py
22
9320
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import add_days, getdate, cint, cstr from frappe import throw, _ from erpnext.utilities.transaction_base import Transa...
gpl-3.0
c-o-m-m-a-n-d-e-r/CouchPotatoServer
libs/suds/transport/https.py
202
3634
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser General Public License as # published by the Free Software Foundation; either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will ...
gpl-3.0
kreischtauf/CSRST
tools/visualizeSim.py
1
4842
#!/usr/bin/python2 import sys component = "xcomp" # xcomp ycomp, magnitude componentString = "X Component" argv = Argv() numFiles = len(argv) print argv DefineScalarExpression("E-Field_xcomp", "array_decompose(<E-Field>,0)") DefineScalarExpression("E-Field_ycomp", "array_decompose(<E-Field>,1)") # DefineScalarExpres...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/jupyter_client/localinterfaces.py
12
7872
"""Utilities for identifying local IP addresses.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import os import re import socket import subprocess from subprocess import Popen, PIPE from warnings import warn LOCAL_IPS = [] PUBLIC_IPS = [] LOCALHOST = '' ...
gpl-3.0
BrutuZ/LegendasTV.bundle
Contents/Libraries/Shared/requests/packages/chardet/euckrfreq.py
3121
45978
######################## 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...
gpl-2.0
tinoshot/python-astm
setup.py
15
2103
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Alexander Shorin # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # from astm.version import __version__ try: from setuptools import setup, find_...
bsd-3-clause
codesparkle/youtube-dl
youtube_dl/extractor/dplay.py
6
6871
# coding: utf-8 from __future__ import unicode_literals import json import re import time from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( USER_AGENTS, int_or_none, update_url_query, ) class DPlayIE(InfoExtractor): _VALID_URL = r'https?://(?P<domain>it\.dp...
unlicense
peguin40/zulip
zerver/views/webhooks/freshdesk.py
13
5884
"""Webhooks for external integrations.""" from __future__ import absolute_import from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.models import get_client, UserProfile from zerver.lib.actions import check_send_message from zerver.lib.response import json...
apache-2.0
adaxi/couchpotato
libs/html5lib/filters/whitespace.py
1730
1142
from __future__ import absolute_import, division, unicode_literals import re from . import _base from ..constants import rcdataElements, spaceCharacters spaceCharacters = "".join(spaceCharacters) SPACES_REGEX = re.compile("[%s]+" % spaceCharacters) class Filter(_base.Filter): spacePreserveElements = frozenset...
gpl-3.0
torrenegra/ekratia
ekratia/referendums/urls.py
3
1409
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf import settings from django.conf.urls import url from django.conf.urls.static import static from .views import ReferendumListView, ReferendumCreateView,\ ReferendumDetailView, ReferendumOpenView, ReferendumVoteView,\ ReferendumPr...
bsd-3-clause
jelly/calibre
src/calibre/gui2/tweak_book/widgets.py
1
43424
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2014, Kovid Goyal <kovid at kovidgoyal.net>' import os, textwrap, unicodedata from itertools import izip from collections...
gpl-3.0
aronasorman/content-curation
contentcuration/contentcuration/view/file_views.py
1
6125
import json import logging import os from django.http import HttpResponse, HttpResponseBadRequest from django.views.decorators.csrf import csrf_exempt from django.conf import settings from django.core.urlresolvers import reverse_lazy from django.core.files import File as DjFile from rest_framework.renderers import JSON...
mit
bastibl/gnuradio
gr-audio/examples/python/multi_tone.py
7
3265
#!/usr/bin/env python # # Copyright 2004,2006,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at ...
gpl-3.0
astrocatalogs/supernovae
tasks/swift.py
1
2598
"""Import tasks related to the Swift TOO page. """ import datetime import os # from astropy.time import Time as astrotime from bs4 import BeautifulSoup from astrocats.catalog.utils import pbar, utf8 from astrocats.catalog.entry import ENTRY from astrocats.supernovae.utils import name_clean def do_swift(catalog): ...
mit
Zhaoyanzhang/-myflasky
venv/lib/python2.7/site-packages/sqlalchemy/orm/strategy_options.py
19
35455
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ """ from .interfaces import MapperOption, PropComparator from .. import util from ..sql.base imp...
mit
WarrenWeckesser/scikits-image
skimage/feature/tests/test_canny.py
19
4525
import unittest import numpy as np from numpy.testing import assert_equal from scipy.ndimage import binary_dilation, binary_erosion import skimage.feature as F from skimage import filters, data from skimage import img_as_float class TestCanny(unittest.TestCase): def test_00_00_zeros(self): '''Test that th...
bsd-3-clause
santoshsahoo/namebench
nb_third_party/jinja2/__init__.py
175
2270
# -*- coding: utf-8 -*- """ jinja2 ~~~~~~ Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment. Nutshell -------- Here a small example of a Jinja2 template:: {% ...
apache-2.0
zubron/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/testdata/handlers/origin_check_wsh.py
499
1916
# Copyright 2009, 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...
mpl-2.0
untom/scikit-learn
examples/classification/plot_lda.py
164
2224
""" ==================================================================== Normal and Shrinkage Linear Discriminant Analysis for classification ==================================================================== Shows how shrinkage improves classification. """ from __future__ import division import numpy as np import...
bsd-3-clause
javaos74/neutron
neutron/db/l3_attrs_db.py
63
3677
# Copyright (c) 2014 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
nortd/bomfu
boilerplate/external/wtforms/ext/csrf/form.py
119
1788
from __future__ import unicode_literals from wtforms.form import Form from wtforms.validators import ValidationError from .fields import CSRFTokenField class SecureForm(Form): """ Form that enables CSRF processing via subclassing hooks. """ csrf_token = CSRFTokenField() def __init__(self, formd...
lgpl-3.0
handspring/bite-project
deps/gdata-python-client/samples/apps/org_unit_sites.py
23
12293
#!/usr/bin/python # # Copyright (C) 2007, 2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
acsone/odoo
addons/hr_timesheet_invoice/__openerp__.py
260
2403
# -*- 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
danalec/dotfiles
sublime/.config/sublime-text-3/Packages/pygments/all/pygments/__init__.py
22
3114
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a ...
mit
briend/mypaint
gui/overlays.py
1
12831
# This file is part of MyPaint. # Copyright (C) 2012-2018 by the MyPaint Development Team # # 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)...
gpl-2.0
jriegel/FreeCAD
src/Tools/fcbt/DistTools.py
31
5051
# shell and operating system import os, sys, re, FileTools verbose = 0 dcount = fcount = 0 maxfileload = 100000 blksize = 1024 * 8 def BuildDistName(): # line seperator ls = os.linesep # path seperator ps = os.pathsep # dir seperator ds = os.sep # Building dist name ...
lgpl-2.1
tiagochiavericosta/edx-platform
common/test/acceptance/tests/studio/test_studio_library_container.py
111
14006
""" Acceptance tests for Library Content in LMS """ import ddt from nose.plugins.attrib import attr import textwrap from .base_studio_test import StudioLibraryTest from ...fixtures.course import CourseFixture from ..helpers import UniqueCourseTest, TestWithSearchIndexMixin from ...pages.studio.library import StudioLib...
agpl-3.0
antoviaque/edx-platform
common/djangoapps/course_modes/helpers.py
57
3230
""" Helper methods for CourseModes. """ from django.utils.translation import ugettext_lazy as _ from course_modes.models import CourseMode from student.helpers import ( VERIFY_STATUS_NEED_TO_VERIFY, VERIFY_STATUS_SUBMITTED, VERIFY_STATUS_APPROVED ) DISPLAY_VERIFIED = "verified" DISPLAY_HONOR = "honor" DIS...
agpl-3.0
lidavidm/sympy
sympy/assumptions/handlers/common.py
2
3072
from sympy.logic.boolalg import conjuncts from sympy.assumptions import Q, ask class AskHandler(object): """Base class that all Ask Handlers must inherit""" pass class CommonHandler(AskHandler): """Defines some useful methods common to most Handlers """ @staticmethod def AlwaysTrue(expr, assump...
bsd-3-clause
arikpoz/mxnet
python/setup.py
11
2793
# pylint: disable=invalid-name, exec-used """Setup mxnet package.""" from __future__ import absolute_import import os import sys # need to use distutils.core for correct placement of cython dll kwargs = {} if "--inplace" in sys.argv: from distutils.core import setup from distutils.extension import Extension els...
apache-2.0
ntt-sic/nova
nova/pci/pci_manager.py
7
12434
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2013 Intel, Inc. # Copyright (c) 2013 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 Li...
apache-2.0
xhteam/external-chromium
build/apply_locales.py
295
1455
#!/usr/bin/env python # Copyright (c) 2009 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. # TODO: remove this script when GYP has for loops import sys import optparse def main(argv): parser = optparse.OptionParser() ...
bsd-3-clause
RafaelRMachado/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py
1891
3300
# Core.py - Python extension for perf script, core functions # # 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. from collections import defaultdict def aut...
gpl-2.0
GladeRom/android_external_chromium_org
native_client_sdk/src/build_tools/update_nacl_manifest.py
43
34323
#!/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. """Script that reads omahaproxy and gsutil to determine version of SDK to put in manifest. """ # pylint is convinced the email mod...
bsd-3-clause
shakamunyi/tensorflow
tensorflow/python/kernel_tests/depthwise_conv_op_test.py
34
21588
# 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
KousikaGanesh/purchaseandInventory
openerp/addons/l10n_be_coda/wizard/__init__.py
439
1098
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it u...
agpl-3.0
jasonwzhy/django
tests/template_tests/syntax_tests/test_comment.py
521
3667
from django.test import SimpleTestCase from ..utils import setup class CommentSyntaxTests(SimpleTestCase): @setup({'comment-syntax01': '{# this is hidden #}hello'}) def test_comment_syntax01(self): output = self.engine.render_to_string('comment-syntax01') self.assertEqual(output, 'hello') ...
bsd-3-clause
EducationAdministrationSystem/EducationSystem
script/movestudents.py
1
1323
#encoding=utf-8 from common.models import SelectCourse,Course,CoursePlan from django.db.models import Q from const.models import AdminSetting from users.models import * teacher = TeacherProfile.objects.get(teacher_name = "李胜铭") admin_setting = AdminSetting.objects.all()[0] school_year = admin_setting.school_year schoo...
agpl-3.0
jlcarmic/producthunt_simulator
venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py
1724
14031
"""Module for supporting the lxml.etree library. The idea here is to use as much of the native library as possible, without using fragile hacks like custom element names that break between releases. The downside of this is that we cannot represent all possible trees; specifically the following are known to cause proble...
mit
abdulhaq-e/django-rest-framework
rest_framework/status.py
110
1982
""" Descriptive HTTP status codes, for code readability. See RFC 2616 - http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html And RFC 6585 - http://tools.ietf.org/html/rfc6585 """ from __future__ import unicode_literals def is_informational(code): return code >= 100 and code <= 199 def is_success(code): r...
bsd-2-clause
backtou/longlab
gnuradio-core/src/lib/filter/generate_gr_freq_xlating_fir_filter_XXX.py
17
1493
#!/bin/env python # -*- python -*- # # Copyright 2003,2004 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (...
gpl-3.0
robertwb/incubator-beam
sdks/python/apache_beam/testing/benchmarks/chicago_taxi/process_tfma.py
5
6265
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
harlequin/sickbeard
lib/hachoir_parser/misc/msoffice_summary.py
90
12537
""" Microsoft Document summaries structures. Documents --------- - Apache POI (HPSF Internals): http://poi.apache.org/hpsf/internals.html """ from lib.hachoir_parser import HachoirParser from lib.hachoir_core.field import (FieldSet, ParserError, RootSeekableFieldSet, SeekableFieldSet, Bit, Bits, NullBits,...
gpl-3.0
twilio/twilio-python
tests/integration/api/v2010/account/recording/add_on_result/test_payload.py
1
8202
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base.exceptions import TwilioException from twilio.http.response import Response class PayloadTestCase(Integrati...
mit
gorindn/ice
examples/org.eclipse.ice.examples.reflectivity/iterateChangeParameterPython.py
5
2147
# **************************************************************************** # Copyright (c) 2015 UT-Battelle, LLC. # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution, and is available a...
epl-1.0
yuxiang-zhou/menpo
menpo/feature/base.py
5
4283
from __future__ import division from functools import wraps import numpy as np from menpo.image import Image, MaskedImage, BooleanImage from menpo.transform import Translation, NonUniformScale def lm_centres_correction(centres): r""" Construct a transform that will correct landmarks for a window iterating...
bsd-3-clause
tuxxy/CloudBot
cloudbot/event.py
16
15299
import asyncio import enum import logging import concurrent.futures logger = logging.getLogger("cloudbot") @enum.unique class EventType(enum.Enum): message = 0 action = 1 # TODO: Do we actually want to have a 'notice' event type? Should the NOTICE command be a 'message' type? notice = 2 join = 3 ...
gpl-3.0
solvo/organilab
src/api/tests.py
1
18464
from rest_framework.test import APIClient from rest_framework.test import APITestCase from rest_framework import status from django.test import TestCase from django.urls import reverse import json from django.contrib.auth.models import User from .utils import list_shelf_dataconfig from laboratory.models import ( ...
gpl-3.0
sandeepdsouza93/TensorFlow-15712
tensorflow/contrib/tensor_forest/hybrid/python/__init__.py
183
1053
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
pombredanne/numba
numba/cuda/tests/cudapy/test_sm.py
6
1080
from numba import cuda, int32 from numba.cuda.testing import unittest import numpy as np class TestSharedMemoryIssue(unittest.TestCase): def test_issue_953_sm_linkage_conflict(self): @cuda.jit(device=True) def inner(): inner_arr = cuda.shared.array(1, dtype=int32) @cuda.jit ...
bsd-2-clause
tadebayo/myedge
myvenv/Lib/site-packages/pip/_vendor/packaging/specifiers.py
1107
28025
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import functools import itertools import re from ._compat impo...
mit
AutorestCI/azure-sdk-for-python
azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/operation_result.py
1
2112
# 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