repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
azureplus/hue
desktop/core/ext-py/Pygments-1.3.1/pygments/lexers/web.py
55
65704
# -*- coding: utf-8 -*- """ pygments.lexers.web ~~~~~~~~~~~~~~~~~~~ Lexers for web-related languages and markup. :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, ExtendedRegexLexer, byg...
apache-2.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/docutils/parsers/rst/directives/html.py
128
3098
# $Id: html.py 7320 2012-01-19 22:33:02Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Directives for typically HTML-specific constructs. """ __docformat__ = 'reStructuredText' import sys from docutils import nodes, utils from docutils.parsers...
bsd-3-clause
nitin-cherian/Webapps
TalkPython/P4E/.env/lib/python3.5/site-packages/pip/compat/dictconfig.py
921
23096
# This is a copy of the Python logging.config.dictconfig module, # reproduced with permission. It is provided here for backwards # compatibility for Python versions prior to 2.7. # # Copyright 2009-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # docu...
mit
TheAlgorithms/Python
machine_learning/astar.py
1
4199
""" The A* algorithm combines features of uniform-cost search and pure heuristic search to efficiently compute optimal solutions. A* algorithm is a best-first search algorithm in which the cost associated with a node is f(n) = g(n) + h(n), where g(n) is the cost of the path from the initial state to node n and h(n) is ...
mit
DazWorrall/ansible
lib/ansible/modules/network/fortios/fortios_ipv4_policy.py
19
10693
#!/usr/bin/python # # Ansible module to manage IPv4 policy objects in fortigate devices # (c) 2017, Benjamin Jolivot <bjolivot@gmail.com> # 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 ...
gpl-3.0
farodin91/servo
tests/wpt/web-platform-tests/old-tests/webdriver/command_contexts/window_handle_test.py
141
1067
import os import sys import random import unittest sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../.."))) import base_test repo_root = os.path.abspath(os.path.join(__file__, "../../..")) sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver")) from webdriver import exceptions class WindowHan...
mpl-2.0
mtreinish/pycmus
doc/source/conf.py
1
2505
# -*- coding: utf-8 -*- # 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...
gpl-3.0
tianzhidao28/pyspider
pyspider/scheduler/scheduler.py
53
33344
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-07 17:05:11 import os import json import time import logging import itertools from six.moves import queue as Queue from collections import deque ...
apache-2.0
Akrog/cinder
cinder/brick/initiator/linuxfc.py
5
4883
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
apache-2.0
VitalPet/bank-statement-reconcile
base_transaction_id/account_bank_statement.py
15
2640
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
fuziontech/sentry
src/sentry/web/frontend/create_project.py
3
3176
from __future__ import absolute_import from django import forms from django.contrib import messages from django.core.urlresolvers import reverse from sentry.models import ( OrganizationMember, OrganizationMemberType, Project, Team ) from sentry.web.forms.add_project import AddProjectForm from sentry.web.frontend....
bsd-3-clause
josircg/raizcidadanista
raizcidadanista/poweradmin/filters.py
1
4559
# coding: utf-8 from django.contrib.admin.util import reverse_field_path, get_limit_choices_to_from_path try: from django.contrib.admin.filterspecs import FilterSpec, AllValuesFilterSpec filterspec = True except ImportError: from django.contrib.admin.filters import RelatedFieldListFilter, AllValuesFieldLis...
gpl-3.0
TalShafir/ansible
lib/ansible/modules/network/onyx/onyx_config.py
43
8174
#!/usr/bin/python # # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
MartinHjelmare/home-assistant
homeassistant/components/homekit/const.py
3
5069
"""Constants used be the HomeKit component.""" # #### Misc #### DEBOUNCE_TIMEOUT = 0.5 DOMAIN = 'homekit' HOMEKIT_FILE = '.homekit.state' HOMEKIT_NOTIFY_ID = 4663548 # #### Attributes #### ATTR_DISPLAY_NAME = 'display_name' ATTR_VALUE = 'value' # #### Config #### CONF_AUTO_START = 'auto_start' CONF_ENTITY_CONFIG = 'e...
apache-2.0
Bismarrck/tensorflow
tensorflow/contrib/bayesflow/__init__.py
19
1292
# 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
cmheisel/kardboard
kardboard/models/statelog.py
1
3683
from mongoengine import signals from kardboard.app import app from kardboard.util import now, delta_in_hours from kardboard.models.kard import Kard class StateLog(app.db.Document): card = app.db.ReferenceField( 'Kard', reverse_delete_rule=app.db.CASCADE, required=True, dbref=False...
mit
damdam-s/OpenUpgrade
addons/hr_payroll/report/report_payslip_details.py
322
5027
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # it ...
agpl-3.0
sbuss/TigerShark
tests/run_tests.py
1
2870
#!/usr/bin/env python """Test Driver runs all discoverable unit tests. Synopsis ======== :samp:`python -m test.run_tests` Description =========== Traverses the directory structure looking for test modules. All Django tests are descendants of the :mod:`web` subdirectory. All POP and WS tests are descenda...
bsd-3-clause
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/27NodeBrick/cantilever_irregular_element_with_divisions/shape3/NumberOfDivision1/horizontal_load/compare_essi_version.py
409
1085
#!/usr/bin/python import h5py import sys import numpy as np import os # automatically find the script directory. # script_dir=sys.argv[1] cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own command line color function # ...
cc0-1.0
ChanduERP/odoo
openerp/__init__.py
235
3586
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 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
sparkslabs/kamaelia
Sketches/PO/testingMulticore/tests/test_Multicore.py
3
3988
#!/usr/bin/env python # -*- coding: utf-8 -*- #-*-*- encoding: utf-8 -*-*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licens...
apache-2.0
kingmotley/SickRage
lib/ndg/httpsclient/ssl_socket.py
66
9791
"""PyOpenSSL utilities including HTTPSSocket class which wraps PyOpenSSL SSL connection into a httplib-like interface suitable for use with urllib2 """ __author__ = "P J Kershaw" __date__ = "21/12/10" __copyright__ = "(C) 2012 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-leve...
gpl-3.0
efortuna/AndroidSDKClone
ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/test/test_os.py
16
32980
# As a test suite for the os module, this is woefully inadequate, but this # does add tests for a few functions which have been determined to be more # portable than they had been thought to be. import os import errno import unittest import warnings import sys import signal import subprocess import time from test imp...
apache-2.0
flyingfish007/tempest
tempest/services/identity/v3/json/region_client.py
8
2967
# Copyright 2014 Hewlett-Packard Development Company, L.P # 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....
apache-2.0
wkentaro/utmech-soft2
13_140714/mdp.py
8
5850
"""Markov Decision Processes (Chapter 17) First we define an MDP, and the special case of a GridMDP, in which states are laid out in a 2-dimensional grid. We also represent a policy as a dictionary of {state:action} pairs, and a Utility function as a dictionary of {state:number} pairs. We then define the value_itera...
mit
moliware/dicts
dicts/sorteddict.py
1
2128
# -*- coding: utf-8 -*- """ dict.sorteddict ~~~~~~~~~~~~~~~ Dictionaries that are sorted when they are iterated :copyright: (c) 2011 by Miguel Olivares <miguel@moliware.com>. :license: LGPL, see LICENSE for more details. """ from dict import Dict class SortedDict(Dict): """ Dictionary that ...
lgpl-3.0
Azulinho/ansible
lib/ansible/modules/network/cloudengine/ce_aaa_server_host.py
6
106192
#!/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
ESS-LLP/erpnext
erpnext/hr/doctype/employee_tax_exemption_declaration/employee_tax_exemption_declaration.py
6
1364
# -*- coding: utf-8 -*- # Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ from erpnext.hr.utils import validate_tax_declaration, cal...
gpl-3.0
bpinsard/dcmstack
src/dcmstack/dcmstack_cli.py
1
15400
""" Command line interface to dcmstack. @author: moloney """ import os, sys, argparse, string from glob import glob import dicom from . import dcmstack from .dcmstack import (parse_and_group, stack_group, DicomOrdering, default_group_keys) from .dcmmeta import NiftiWrapper from . import extract ...
mit
nghia-huynh/gem5-stable
util/streamline/m5stats2streamline.py
37
42084
#!/usr/bin/env python # Copyright (c) 2012, 2014 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 implemen...
bsd-3-clause
motion2015/edx-platform
common/test/acceptance/pages/lms/discovery.py
126
1303
""" Course discovery page. """ from . import BASE_URL from bok_choy.page_object import PageObject class CourseDiscoveryPage(PageObject): """ Find courses page (main page of the LMS). """ url = BASE_URL + "/courses" form = "#discovery-form" def is_browser_on_page(self): """ L...
agpl-3.0
smart-developerr/my-first-blog
Lib/site-packages/django/contrib/flatpages/templatetags/flatpages.py
117
3630
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.contrib.sites.shortcuts import get_current_site register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): sel...
gpl-3.0
0k/odoo
addons/report_webkit/convert.py
322
2581
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Nicolas Bessi (Camptocamp) # # WARNING: This program as such is intended to be used by professional # programmers who ...
agpl-3.0
hmoco/osf.io
scripts/fix_embargo_approved_logs.py
24
1458
""" Update existing "embargo_approved_no_user" logs to link to registered project instead of the registration. """ from copy import deepcopy import logging import sys from modularodm import Q from framework.transactions.context import TokuTransaction from website.models import Node, NodeLog from website.app import i...
apache-2.0
vlinhd11/vlinhd11-android-scripting
python-build/python-libs/gdata/src/gdata/tlslite/FileObject.py
359
6807
"""Class returned by TLSConnection.makefile().""" class FileObject: """This class provides a file object interface to a L{tlslite.TLSConnection.TLSConnection}. Call makefile() on a TLSConnection to create a FileObject instance. This class was copied, with minor modifications, from the _fileobject...
apache-2.0
Forever-Young/django-templates-macros
setup.py
3
1285
#!/usr/bin/env python from os.path import abspath, dirname, join from setuptools import setup, find_packages def read_relative_file(filename): """Returns contents of the given file, which path is supposed relative to this module.""" with open(join(dirname(abspath(__file__)), filename)) as f: retu...
mit
Yuriy-Leonov/nova
nova/tests/compute/test_resource_tracker.py
8
38724
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 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.a...
apache-2.0
gmr/mikkoo
setup.py
1
1650
from setuptools import setup from mikkoo import __version__ classifiers = ['Development Status :: 5 - Production/Stable', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Lang...
bsd-3-clause
h2oai/h2o-3
h2o-py/tests/testdir_algos/automl/pyunit_automl_concurrent_runs.py
2
1630
from concurrent.futures import ThreadPoolExecutor, wait from functools import partial from itertools import chain import os import sys from h2o.job import H2OJob sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils as pu from h2o.automl import H2OAutoML def flatten(it): ret...
apache-2.0
RedHatInsights/insights-core
insights/combiners/tests/test_nfs_exports.py
1
4681
from insights.parsers.nfs_exports import NFSExports, NFSExportsD from insights.parsers.tests.test_nfs_exports import EXPORTS from insights.combiners import nfs_exports from insights.tests import context_wrap from doctest import testmod EXPORTS_D_EXTRAS = """ /mnt/work *(rw,sync) /mnt/backup 10.0.0.0/24(rw,s...
apache-2.0
skraghu/softlayer-python
SoftLayer/CLI/image/detail.py
5
2327
"""Get details for an image.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer.CLI import image as image_mod from SoftLayer import utils @click.command() @click.a...
mit
rebolinho/liveit.repository
script.video.F4mProxy/lib/f4mUtils/cipherfactory.py
8
3035
# Author: Trevor Perrin # See the LICENSE file for legal information regarding use of this file. """Factory functions for symmetric cryptography.""" import os from tlslite.utils import python_aes from tlslite.utils import python_rc4 from tlslite.utils import cryptomath tripleDESPresent = False if cr...
gpl-2.0
lordnord/soundwork
soundwork/waveforms.py
1
1209
from __future__ import division import math import random def sine(freq): def wrapped(file, pos): w = (2 * math.pi * freq) / file.getframerate() res = math.sin(pos * w) * file.amplit(100) return int(res) return wrapped def square(freq): def wrapped(file, pos): w = (2 * math...
lgpl-3.0
codekaki/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/Fields.py
384
12340
######################################################################### # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gene...
agpl-3.0
jkburges/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/ircbot_unittest.py
117
9907
# Copyright (c) 2010 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 ...
bsd-3-clause
aruizramon/alec_erpnext
erpnext/stock/doctype/item_attribute/item_attribute.py
35
1928
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document from frappe import _ class ItemAttributeIncrementError(frappe.ValidationError): pass ...
agpl-3.0
nitin-cherian/Webapps
SimpleIsBetterThanComplex.com/myproject/.env/lib/python3.5/site-packages/django/contrib/staticfiles/storage.py
43
19727
from __future__ import unicode_literals import hashlib import json import os import posixpath import re from collections import OrderedDict from django.conf import settings from django.contrib.staticfiles.utils import check_settings, matches_patterns from django.core.cache import ( InvalidCacheBackendError, cache...
mit
cytec/SickRage
lib/tornado/wsgi.py
18
13430
#!/usr/bin/env python # # Copyright 2009 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 a...
gpl-3.0
orgito/ansible
lib/ansible/module_utils/facts/hardware/sunos.py
21
9980
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...
gpl-3.0
TAlonglong/trollduction-test
examples/make_aqua_messages.py
2
1639
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014 Adam.Dybbroe # Author(s): # Adam.Dybbroe <a000680@c14526.ad.smhi.se> # 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, eith...
gpl-3.0
appliedx/edx-platform
common/djangoapps/student/migrations/0016_auto__add_field_courseenrollment_date__chg_field_userprofile_country.py
188
10960
# -*- 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): # Adding field 'CourseEnrollment.date' db.add_column('student_courseenrollment', 'date', ...
agpl-3.0
sam-m888/gprime
gprime/plugins/textreport/recordsreport.py
1
13288
# encoding:utf-8 # # gPrime - A web-based genealogy program - Records plugin # # Copyright (C) 2008-2011 Reinhard Müller # Copyright (C) 2010 Jakim Friant # Copyright (C) 2012 Brian G. Matherly # Copyright (C) 2013-2016 Paul Franklin # # This program is free software; you can redistribute it and/or modify # i...
gpl-2.0
lcpt/xc
python_modules/import_export/sciaXML/ProjectProperties.py
1
2583
# -*- coding: utf-8 -*- #Based on sXML-master projet on gitHub __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2015 LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" import NodeProperties as ncd import MaterialProperties as mp import EPPlaneProperties as eppp import Nod...
gpl-3.0
pedropenna/.emacs.d
elpa/floobits-20160804.1135/floo/common/ignore.py
2
7830
import os import errno import fnmatch import stat import subprocess try: from . import msg, utils from .exc_fmt import str_e assert msg and str_e and utils except ImportError: import msg from exc_fmt import str_e IGNORE_FILES = ['.gitignore', '.hgignore', '.flooignore'] HIDDEN_WHITELIST = ['.floo'...
gpl-3.0
0jpq0/kbengine
kbe/res/scripts/common/Lib/encodings/koi8_u.py
272
13762
""" Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='stri...
lgpl-3.0
igorcompuff/ns-3.26
src/tap-bridge/examples/tap-csma-virtual-machine.py
46
3052
# -*- Mode: Python; -*- # # Copyright 2010 University of Washington # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation; # # This program is distributed in the hope that it will be usefu...
gpl-2.0
darktears/chromium-crosswalk
tools/idl_parser/idl_ppapi_lexer.py
81
2012
#!/usr/bin/env python # Copyright (c) 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. """ Lexer for PPAPI IDL The lexer uses the PLY library to build a tokenizer which understands both WebIDL and Pepper tokens. WebI...
bsd-3-clause
ccoss/fas
fas/safasprovider.py
3
16982
# -*- coding: utf-8 -*- # # Copyright © 2007-2008 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. This program is distributed in the hope that it # will be useful, bu...
gpl-2.0
kerr-huang/SL4A
python/gdata/src/gdata/tlslite/VerifierDB.py
359
3104
"""Class for storing SRP password verifiers.""" from utils.cryptomath import * from utils.compat import * import mathtls from BaseDB import BaseDB class VerifierDB(BaseDB): """This class represent an in-memory or on-disk database of SRP password verifiers. A VerifierDB can be passed to a server handshake...
apache-2.0
seocam/django
tests/save_delete_hooks/models.py
409
1030
""" Adding hooks before/after saving and deleting To execute arbitrary code around ``save()`` and ``delete()``, just subclass the methods. """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Person(...
bsd-3-clause
Yarrick13/hwasp
tests/sat/Models/c170.v50.dimacs.test.py
5
2141
input = """ c num blocks = 1 c num vars = 50 c minblockids[0] = 1 c maxblockids[0] = 50 p cnf 50 170 30 -37 23 0 -20 16 -12 0 -25 -1 40 0 27 35 -2 0 11 -17 -25 0 -38 6 47 0 -17 -3 -36 0 46 -29 5 0 -1 6 23 0 19 5 25 0 -4 -35 -33 0 28 -6 49 0 -39 1 42 0 -2 7 -50 0 37 16 -34 0 -34 -20 37 0 41 4 10 0 12 -17 -8 0 34 -15 17 ...
apache-2.0
sonnyhu/scikit-learn
examples/covariance/plot_sparse_cov.py
300
5078
""" ====================================== Sparse inverse covariance estimation ====================================== Using the GraphLasso estimator to learn a covariance and sparse precision from a small number of samples. To estimate a probabilistic model (e.g. a Gaussian model), estimating the precision matrix, t...
bsd-3-clause
NullSoldier/django
django/contrib/flatpages/forms.py
357
2024
from django import forms from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.utils.translation import ugettext, ugettext_lazy as _ class FlatpageForm(forms.ModelForm): url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$', help_text=_("E...
bsd-3-clause
vfulco/ansible
v1/tests/TestInventory.py
82
19689
import os import unittest from nose.tools import raises from ansible import errors from ansible.inventory import Inventory class TestInventory(unittest.TestCase): def setUp(self): self.cwd = os.getcwd() self.test_dir = os.path.join(self.cwd, 'inventory_test_data') self.inventory_file ...
gpl-3.0
damonkohler/sl4a
python-build/python-libs/gdata/src/gdata/data.py
133
35748
#!/usr/bin/env python # # Copyright (C) 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 applicable ...
apache-2.0
sassoftware/mint
mint/django_rest/rbuilder/rbac/testsxml.py
1
20641
# # Copyright (c) SAS Institute Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in w...
apache-2.0
benoitsteiner/tensorflow
tensorflow/contrib/metrics/python/ops/histogram_ops.py
159
10459
# 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
kutenai/django
django/contrib/gis/db/backends/oracle/adapter.py
273
1866
from cx_Oracle import CLOB from django.contrib.gis.db.backends.base.adapter import WKTAdapter from django.contrib.gis.geos import GeometryCollection, Polygon from django.utils.six.moves import range class OracleSpatialAdapter(WKTAdapter): input_size = CLOB def __init__(self, geom): """ Oracl...
bsd-3-clause
unnikrishnankgs/va
venv/lib/python3.5/site-packages/matplotlib/tests/test_skew.py
5
7259
""" Testing that skewed axes properly work """ from __future__ import (absolute_import, division, print_function, unicode_literals) import itertools import matplotlib.pyplot as plt from matplotlib.testing.decorators import image_comparison from matplotlib.axes import Axes import matplotlib.tr...
bsd-2-clause
nyaruka/django-hamlpy
hamlpy/parser/utils.py
1
1331
from enum import Enum from .core import Stream DJANGO_TAG_OPEN = "{%" DJANGO_TAG_CLOSE = "%}" DJANGO_EXP_OPEN = "{{" DJANGO_EXP_CLOSE = "}}" HTML_CHARS = {"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;"} class EscapeState(Enum): normal = 0 in_tag = 1 in_exp = 2 def html_escape(text...
mit
trishnaguha/ansible
lib/ansible/modules/network/avi/avi_api_session.py
21
8328
#!/usr/bin/python """ # Created on Aug 12, 2016 # # @author: Gaurav Rastogi (grastogi@avinetworks.com) GitHub ID: grastogi23 # # module_check: not supported # # Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # "...
gpl-3.0
openjck/kuma
kuma/attachments/models.py
1
5498
from datetime import datetime from django.conf import settings from django.db import models from django.template.loader import select_template from .utils import attachment_upload_to, full_attachment_url class Attachment(models.Model): """ An attachment which can be inserted into one or more wiki documents....
mpl-2.0
agriffis/django-allauth
allauth/socialaccount/providers/stackexchange/provider.py
75
1254
from allauth.socialaccount import providers from allauth.socialaccount.providers.base import ProviderAccount from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider class StackExchangeAccount(ProviderAccount): def get_profile_url(self): return self.account.extra_data.get('html_url') ...
mit
leiferikb/bitpop
depot_tools/fetch.py
5
9541
#!/usr/bin/env python # Copyright (c) 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. """ Tool to perform checkouts in one easy command line! Usage: fetch <recipe> [--property=value [--property2=value2 ...]] This ...
gpl-3.0
Cactuslegs/audacity-of-nope
lib-src/lv2/lilv/waflib/Tools/ruby.py
316
3925
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os from waflib import Task,Options,Utils from waflib.TaskGen import before_method,feature,after_method,Task,extension from waflib.Configure import conf @feature('rubyex...
gpl-2.0
talbrecht/pism_pik
examples/preprocessing/PISMNC.py
2
5358
#!/usr/bin/env python try: import netCDF4 as netCDF except: print "netCDF4 is not installed!" sys.exit(1) class PISMDataset(netCDF.Dataset): def create_time(self, use_bounds=False, length=None, units=None): self.createDimension('time', size=length) t_var = self.createVariable('time',...
gpl-3.0
markoshorro/gem5
ext/ply/example/calcdebug/calc.py
165
2306
# ----------------------------------------------------------------------------- # calc.py # # This example shows how to run the parser in a debugging mode # with output routed to a logging object. # ----------------------------------------------------------------------------- import sys sys.path.insert(0,"../..") if ...
bsd-3-clause
dougwig/x-neutron-fwaas
neutron_fwaas/tests/unit/services/firewall/agents/l3reference/test_firewall_l3_agent.py
1
16208
# 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
apache-2.0
georgid/sms-tools
lectures/5-Sinusoidal-model/plots-code/spectral-peaks-interpolation.py
2
1234
import numpy as np import matplotlib.pyplot as plt from scipy.signal import hamming, triang, blackmanharris from scipy.fftpack import fft, ifft import math import sys, os, functools, time sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../../software/models/')) import dftModel as DFT impo...
agpl-3.0
prasen-ftech/pywinauto
pywinauto/controls/menuwrapper.py
16
16839
# GUI Application automation and testing library # Copyright (C) 2006 Mark Mc Mahon # # 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.1 # of the License, or (at you...
lgpl-2.1
dfalt974/SickRage
lib/future/tests/base.py
36
19734
from __future__ import print_function, absolute_import import os import tempfile import unittest import sys import re import warnings import io from textwrap import dedent from future.utils import bind_method, PY26, PY3, PY2, PY27 from future.moves.subprocess import check_output, STDOUT, CalledProcessError if PY26: ...
gpl-3.0
JulienMcJay/eclock
windows/Python27/Lib/site-packages/plyer/platforms/android/gps.py
5
2916
''' Android GPS ----------- ''' from plyer.facades import GPS from plyer.platforms.android import activity from jnius import autoclass, java_method, PythonJavaClass Looper = autoclass('android.os.Looper') LocationManager = autoclass('android.location.LocationManager') Context = autoclass('android.content.Context') ...
gpl-2.0
virtuallysafe/kodi
lib/gtest/test/gtest_list_tests_unittest.py
1068
5415
#!/usr/bin/env python # # Copyright 2006, 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...
gpl-2.0
newmediamedicine/indivo_server_1_0
indivo/models/fact_objects/immunization.py
1
1164
""" Indivo Models for Immunizations """ from fact import Fact from django.db import models from django.conf import settings class Immunization(Fact): date_administered = models.DateTimeField(null=True) administered_by = models.CharField(max_length=40, null=True) vaccine_type = models.CharField(max_lengt...
gpl-3.0
kcartier/tensorflow-toe-in-the-water
tensorflow/python/training/input_test.py
2
18498
"""Tests for training.input.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import itertools import tensorflow.python.platform import numpy as np from six.moves import xrange # pylint: disable=redefined-builtin import tensorflow as tf class...
apache-2.0
epandurski/django
django/contrib/gis/utils/ogrinfo.py
564
1984
""" This module includes some utility functions for inspecting the layout of a GDAL data source -- the functionality is analogous to the output produced by the `ogrinfo` utility. """ from django.contrib.gis.gdal import DataSource from django.contrib.gis.gdal.geometries import GEO_CLASSES def ogrinfo(data_source, num...
bsd-3-clause
DANCEcollaborative/forum-xblock
XBlock Integration Files/xdjangobb/xblock/lib/python2.7/site-packages/pip/_vendor/html5lib/sanitizer.py
283
17660
from __future__ import absolute_import, division, unicode_literals import re from xml.sax.saxutils import escape, unescape from six.moves import urllib_parse as urlparse from .tokenizer import HTMLTokenizer from .constants import tokenTypes content_type_rgx = re.compile(r''' ^ ...
mit
mwalton/artificial-olfaction
python/plots.py
1
1079
import matplotlib.pyplot as plt #from Image import NEAREST #from matplotlib.cm import cmap_d import numpy as np #import pylab as pl def accuracy(target, prediction, label="Classifier", c=np.zeros((0,0))): correct = (target == prediction) correct = np.array((correct, correct)) compare = np.array((target, p...
mit
pronix/spark
examples/src/main/python/ml/simple_params_example.py
6
4123
# # 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
pyfisch/servo
tests/wpt/web-platform-tests/mathml/tools/use-typo-lineheight.py
101
1404
#!/usr/bin/python from __future__ import print_function from utils.misc import MathMLAssociationCopyright import fontforge font = fontforge.font() font.em = 1000 typoLineHeight = 2300 winHeight = 5000 name = "font-lineheight%d-typolineheight%d" % (winHeight, typoLineHeight) font.fontname = name font.familyname = name...
mpl-2.0
1flow/1flow
oneflow/core/migrations/0011_auto__del_field_mailaccount_date_test__add_field_mailaccount_date_last.py
2
9154
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'MailAccount.date_test' db.delete_column(u'core_mailacco...
agpl-3.0
yexihu/volatility
volatility/plugins/gui/clipboard.py
46
5646
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org> # # This file is part of Volatility. # # Volatility is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the F...
gpl-2.0
GaussDing/django
django/conf/locale/en_AU/formats.py
504
2117
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'j M Y' # '25 Oc...
bsd-3-clause
mattja/nsim
nsim/analyses1/_cwtmorlet.py
1
2426
import numpy as np from scipy.signal import wavelets, convolve def cwtmorlet(points, width): """complex morlet wavelet function compatible with scipy.signal.cwt Parameters: points: int Number of points in `vector`. width: scalar Width parameter of wavele...
gpl-3.0
snnn/tensorflow
tensorflow/python/kernel_tests/accumulate_n_eager_test.py
38
2519
# 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
laplaceliu/readthedocs.org
readthedocs/rtd_tests/tests/test_sync_versions.py
34
11004
import json from django.test import TestCase from readthedocs.builds.models import Version from readthedocs.builds.constants import STABLE from readthedocs.projects.models import Project class TestSyncVersions(TestCase): fixtures = ["eric", "test_data"] def setUp(self): self.client.login(username='...
mit
matrumz/RPi_Custom_Files
Printing/hplip-3.15.2/pkservice.py
1
3222
#!/usr/bin/env python # -*- coding: utf-8 -*- # # (c) Copyright 2003-2009 Hewlett-Packard Development Company, L.P. # # 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 Lice...
gpl-2.0
TeamHackDroid/samsung-kernel-msm7x30
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
gannetson/sportschooldeopenlucht
env/lib/python2.7/site-packages/PIL/ImageFile.py
2
15289
# # The Python Imaging Library. # $Id$ # # base class for image file handlers # # history: # 1995-09-09 fl Created # 1996-03-11 fl Fixed load mechanism. # 1996-04-15 fl Added pcx/xbm decoders. # 1996-04-30 fl Added encoders. # 1996-12-14 fl Added load helpers # 1997-01-11 fl Use encode_to_file where possibl...
bsd-3-clause
jmartinm/invenio-master
modules/bibcirculation/web/admin/bibcirculationadmin.py
25
43152
## This file is part of Invenio. ## Copyright (C) 2008, 2009, 2010, 2011 CERN. ## ## Invenio 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 ...
gpl-2.0