repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
vlegoff/tsunami
src/primaires/connex/contextes/connexion/confirmer_pass.py
1
1972
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 DAVY Guillaume # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this #...
bsd-3-clause
pedrobaeza/OpenUpgrade
addons/mrp_repair/__openerp__.py
259
2554
# -*- 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
jamespcole/home-assistant
homeassistant/components/fritzbox/__init__.py
3
2351
"""Support for AVM Fritz!Box smarthome devices.""" import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import ( CONF_DEVICES, CONF_HOST, CONF_PASSWORD, CONF_USERNAME, EVENT_HOMEASSISTANT_STOP) from homeassistant.helpers import discovery _LOGGE...
apache-2.0
uditagarwal/tastypie
tastypie/authorization.py
32
7631
from __future__ import unicode_literals from tastypie.exceptions import TastypieError, Unauthorized class Authorization(object): """ A base class that provides no permissions checking. """ def __get__(self, instance, owner): """ Makes ``Authorization`` a descriptor of ``ResourceOptions...
bsd-3-clause
f3r/scikit-learn
sklearn/tests/test_metaestimators.py
57
4958
"""Common tests for metaestimators""" import functools import numpy as np from sklearn.base import BaseEstimator from sklearn.externals.six import iterkeys from sklearn.datasets import make_classification from sklearn.utils.testing import assert_true, assert_false, assert_raises from sklearn.pipeline import Pipeline...
bsd-3-clause
Labonneguigue/Machine-Learning
Machine Learning Data Repository /Facebook_metrics/hw1_regression.py
1
1970
import csv import sys import numpy from numpy import genfromtxt from numpy.linalg import inv numpy.set_printoptions(threshold=numpy.nan) Lambda = float(sys.argv[1]) Sigma2 = float(sys.argv[2]) print("Lambda = ") print(Lambda) print("Sigma2 = ") print(Sigma2) X_train = genfromtxt('X_train.csv', delimiter=',') print(...
mit
google/resultstoreui
resultstoresearch/server/resultstoresearch/resultstoresearchapi/target_pb2.py
1
15944
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: target.proto from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection fr...
apache-2.0
nickabattista/IB2d
pyIB2d/Examples/Rayleigh_Taylor_Instability/please_Compute_External_Forcing.py
1
6723
#-------------------------------------------------------------------------------------------------------------------# # # IB2d is an Immersed Boundary Code (IB) for solving fully coupled non-linear # fluid-structure interaction models. This version of the code is based off of # Peskin's Immersed Boundary Method Paper...
gpl-3.0
asoneofus/v350
FADG_4.39A/external/webkit/WebKitTools/pywebsocket/example/echo_client.py
3
7310
#!/usr/bin/env python # # 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...
gpl-2.0
swprojects/Serial-Sequence-Creator
serialfunctions.py
1
1796
import logging import serial import sys import time import serial.tools.list_ports #------------------------------------------------# # serial connection functions #------------------------------------------------# def OpenSerial(port, baudrate, bytesize, stopbits, parity, flowcontrol, timeout): # configure th...
mit
mbox/django
tests/syndication_tests/feeds.py
29
4764
from __future__ import unicode_literals from django.contrib.syndication import views from django.core.exceptions import ObjectDoesNotExist from django.utils import feedgenerator from django.utils.timezone import get_fixed_timezone from .models import Article, Entry class ComplexFeed(views.Feed): def get_object(...
bsd-3-clause
damiencalloway/djtut
mysite/env/lib/python2.7/site-packages/django/conf/locale/nb/formats.py
107
1585
# -*- 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. F Y' TIME_FORMAT = 'H:i' DATET...
mit
runt18/mojo
mojo/devtools/common/android_stack_parser/symbol.py
1
17737
# Copyright (C) 2013 The Android Open Source Project # # 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 ...
bsd-3-clause
alexdglover/shill-isms
venv/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py
3
27048
# postgresql/psycopg2.py # Copyright (C) 2005-2016 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 """ .. dialect:: postgresql+psycopg2 :name: psycopg2 :dbapi: psycopg2...
mit
nop33/indico
indico/web/forms/fields/datetime.py
2
14043
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
gpl-3.0
supermurat/hamsi-manager
SpecialTools/CharacterEncoding.py
1
4773
# This file is part of HamsiManager. # # Copyright (c) 2010 - 2015 Murat Demir <mopened@gmail.com> # # Hamsi Manager is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at yo...
gpl-3.0
gzc/CLRS
C09-Medians-and-Order-Statistics/exercise_code/k-quantile.py
11
1921
#!/usr/bin/env python # coding=utf-8 import math def k_quantiles(items, k): index = median_index(len(items)) if k == 1: return [] elif k % 2: n = len(items) left_index = math.ceil((k // 2) * (n / k)) - 1 right_index = n - left_index - 1 left = select...
mit
srikantbmandal/ansible
lib/ansible/modules/windows/win_dns_client.py
46
2652
#!/usr/bin/python # -*- coding: utf-8 -*- # (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 ...
gpl-3.0
EvolutionzzXDA/ubertale_sprout
scripts/rt-tester/rt-tester.py
11005
5307
#!/usr/bin/python # # rt-mutex tester # # (C) 2006 Thomas Gleixner <tglx@linutronix.de> # # 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. # import os import sys import getopt import sh...
gpl-2.0
liamgh/liamgreenhughes-sl4a-tf101
python/src/Lib/sqlite3/test/py25tests.py
51
2748
#-*- coding: ISO-8859-1 -*- # pysqlite2/test/regression.py: pysqlite regression tests # # Copyright (C) 2007 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages #...
apache-2.0
benvermaercke/pyqtgraph
pyqtgraph/__init__.py
14
16683
# -*- coding: utf-8 -*- """ PyQtGraph - Scientific Graphics and GUI Library for Python www.pyqtgraph.org """ __version__ = '0.9.10' ### import all the goodies and add some helper functions for easy CLI use ## 'Qt' is a local module; it is intended mainly to cover up the differences ## between PyQt4 and PySide. from ...
mit
edxnercel/edx-platform
common/djangoapps/third_party_auth/views.py
48
1586
""" Extra views required for SSO """ from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponseServerError, Http404 from django.shortcuts import redirect from social.apps.django_app.utils import load_strategy, load_backend from .models import SAMLCon...
agpl-3.0
stamhe/zulip
tools/deprecated/finbot/money.py
114
7730
#!/usr/bin/python import datetime import monthdelta def parse_date(date_str): return datetime.datetime.strptime(date_str, "%Y-%m-%d") def unparse_date(date_obj): return date_obj.strftime("%Y-%m-%d") class Company(object): def __init__(self, name): self.name = name self.flows = [] ...
apache-2.0
ricardogsilva/QGIS
python/plugins/MetaSearch/dialogs/newconnectiondialog.py
12
3710
# -*- coding: utf-8 -*- ############################################################################### # # CSW Client # --------------------------------------------------------- # QGIS Catalog Service client. # # Copyright (C) 2010 NextGIS (http://nextgis.org), # Alexander Bruy (alexander.bruy@gmail...
gpl-2.0
apaloczy/ap_tools
utils.py
1
54151
# Description: General-purpose functions for personal use. # Author: André Palóczy # E-mail: paloczy@gmail.com __all__ = ['seasonal_avg', 'seasonal_std', 'deseason', 'blkavg', 'blkavgdir', 'blkavgt', 'blkapply', 'stripmsk', ...
mit
west2554/fofix
src/Mod.py
2
2797
##################################################################### # -*- coding: iso-8859-1 -*- # # # # Frets on Fire # # Copyright (C) 2006 Sami Kyöstilä ...
gpl-2.0
drnextgis/QGIS
python/ext-libs/pygments/lexers/snobol.py
47
2756
# -*- coding: utf-8 -*- """ pygments.lexers.snobol ~~~~~~~~~~~~~~~~~~~~~~ Lexers for the SNOBOL language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups from pygments.token import Text,...
gpl-2.0
guewen/rma
__unported__/crm_rma_lot_mass_return/__openerp__.py
6
1733
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2013 Camptocamp # Copyright 2009-2013 Akretion, # Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, Joel Grand-Guillaume # # This program is free software: you can redistribute it and/o...
agpl-3.0
edmundgentle/schoolscript
SchoolScript/bin/Debug/pythonlib/Lib/test/test_doctest2.py
5
2482
"""A module to test whether doctest recognizes some 2.2 features, like static and class methods. >>> print('yup') # 1 yup We include some (random) encoded (utf-8) text in the text surrounding the example. It should be ignored: ЉЊЈЁЂ """ import sys import unittest from test import support if sys.f...
gpl-2.0
wyhuster/qualitybots
src/client_setup/chrome_manager.py
26
12730
#!/usr/bin/python2.6 # # 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 required...
apache-2.0
dd00/commandergenius
project/jni/python/src/Lib/test/test_decimal.py
48
51609
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
lgpl-2.1
ralstonJ/Angelhack-Rumble
scripts/TwitterStreamTutorial.py
1
1032
#!/usr/bin/env python import tweepy from tweepy import Stream from tweepy import OAuthHandler from tweepy.streaming import StreamListener import time ckey = 'CiQGfooRBKJRSrtaGl7GkQ' csecret = 'G2o2pVeFaYlZdZAQL6NxkE3x7iW0U7kfoUKBTaOg' atoken = '741285805-38CJ8saoV8UJx46L38bFiZMOSocC2XhtubOsot9x' asecret = 'sNJUHNg4Gz...
apache-2.0
nevermoreluo/sakura
sakura/buffer_reader.py
1
1837
import struct class BufferReader(): def __init__(self, buf, endian='<'): self._buffer = buf self._length = len(buf) self._endian = endian self._offset = 0 self._error = False @property def error(self): return self._error def set_endian(...
gpl-3.0
sve-odoo/odoo
addons/mrp/report/bom_structure.py
66
2475
## -*- 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 GN...
agpl-3.0
neumerance/deploy
.venv/lib/python2.7/site-packages/kombu/transport/django/__init__.py
3
1936
"""Kombu transport using the Django database as a message store.""" from __future__ import absolute_import from Queue import Empty from anyjson import loads, dumps from django.conf import settings from django.core import exceptions as errors from kombu.transport import virtual from kombu.exceptions import StdConnec...
apache-2.0
townbull/keystone-dtrust
keystone/tests/test_auth.py
1
37040
# Copyright 2012 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 or agreed to in...
apache-2.0
froch/kubernetes-py
kubernetes_py/models/v1/__init__.py
3
3212
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is subject to the terms and conditions defined in # file 'LICENSE.md', which is part of this source code package. # # from kubernetes_py.models.v1.AttachedVolume import AttachedVolume # from kubernetes_py.models.v1.ComponentCondition import ComponentConditio...
apache-2.0
Leonnash21/flask_heroku
Tools/scripts/gprof2html.py
28
2229
#! /usr/bin/env python3 """Transform gprof(1) output into useful HTML.""" import html import os import re import sys import webbrowser header = """\ <html> <head> <title>gprof output (%s)</title> </head> <body> <pre> """ trailer = """\ </pre> </body> </html> """ def add_escapes(filename): with open(filename)...
mit
x2nie/odoo
addons/stock_picking_wave/wizard/picking_to_wave.py
382
1624
############################################################################## # # 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 Affero General Public L...
agpl-3.0
5y/kivy
kivy/core/spelling/spelling_osxappkit.py
9
2450
''' AppKit Spelling: Implements spelling backend based on OSX's spellchecking features provided by the ApplicationKit. NOTE: Requires pyobjc and setuptools to be installed! `sudo easy_install pyobjc setuptools` Developers shoul...
mit
ArcherCraftStore/ArcherVMPeridot
nodechip/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py
610
1611
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
apache-2.0
pipermerriam/django
tests/raw_query/tests.py
119
12345
from __future__ import unicode_literals from datetime import date from django.db.models.query_utils import InvalidQuery from django.test import TestCase, skipUnlessDBFeature from .models import Author, Book, BookFkAsPk, Coffee, FriendlyAuthor, Reviewer class RawQueryTests(TestCase): @classmethod def setUp...
bsd-3-clause
vanng822/cssutils
src/cssutils/tests/test_csspagerule.py
3
14678
"""Testcases for cssutils.css.CSSPageRule""" import xml.dom import test_cssrule import cssutils class CSSPageRuleTestCase(test_cssrule.CSSRuleTestCase): def setUp(self): super(CSSPageRuleTestCase, self).setUp() cssutils.ser.prefs.useDefaults() self.r = cssutils.css.CSSPageRule() ...
gpl-3.0
miaecle/deepchem
examples/tox21/tox21_KernelSVM.py
6
1174
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun Jul 23 16:02:07 2017 @author: zqwu """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals import numpy as np import deepchem as dc import tempfile from sklearn.svm import SVC # Only for debug...
mit
jagguli/intellij-community
python/lib/Lib/modjy/modjy_impl.py
109
4337
### # # Copyright Alan Kennedy. # # You may contact the copyright holder at this uri: # # http://www.xhaus.com/contact/modjy # # The licence under which this code is released is the Apache License v2.0. # # The terms and conditions of this license are listed in a file contained # in the distribution that also cont...
apache-2.0
odicraig/kodi2odi
addons/plugin.video.roggerstream-3.0.5/mechanize/_beautifulsoup.py
5
41802
"""Beautiful Soup Elixir and Tonic "The Screen-Scraper's Friend" v2.1.1 http://www.crummy.com/software/BeautifulSoup/ Beautiful Soup parses arbitrarily invalid XML- or HTML-like substance into a tree representation. It provides methods and Pythonic idioms that make it easy to search and modify the tree. A w...
gpl-3.0
firerszd/kbengine
kbe/src/lib/python/Lib/idlelib/SearchDialogBase.py
86
7009
'''Define SearchDialogBase used by Search, Replace, and Grep dialogs.''' from tkinter import (Toplevel, Frame, Entry, Label, Button, Checkbutton, Radiobutton) class SearchDialogBase: '''Create most of a 3 or 4 row, 3 column search dialog. The left and wide middle column contain: 1 or...
lgpl-3.0
XiaosongWei/blink-crosswalk
Source/build/scripts/make_style_builder.py
40
3968
#!/usr/bin/env python # Copyright (C) 2013 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 ...
bsd-3-clause
bobisme/odoo
addons/hw_scale/__init__.py
1894
1075
# -*- 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...
agpl-3.0
Distrotech/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/gdal/driver.py
411
2411
# prerequisites imports from ctypes import c_void_p from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import OGRException from django.contrib.gis.gdal.prototypes import ds as capi # For more information, see the OGR C API source code: # http://www.gdal.org/ogr/ogr__api_8h.html # # ...
apache-2.0
ReganDryke/airtime
python_apps/media-monitor/mm2/media/metadata/definitions.py
10
4773
# -*- coding: utf-8 -*- import process as md import re from os.path import normpath from ..monitor.pure import format_length, file_md5, is_airtime_recorded, \ no_extension_basename defs_loaded = False MAX_SIGNED_INT = 2**31-1 def is_defs_loaded(): global defs_loaded return defs_loaded def load_definitio...
agpl-3.0
machtfit/django-database-email-backend
database_email_backend/admin.py
1
5607
#-*- coding: utf-8 -*- from django.http import HttpResponseRedirect from django.contrib import admin from django import forms from django.http import HttpResponse from django.core.urlresolvers import reverse from django.core.mail import message from django.db.models import Count from functools import update_wrapper fro...
mit
2014c2g23/2015cda-w17
static/Brython3.1.1-20150328-091302/Lib/xml/dom/minicompat.py
781
3228
"""Python version compatibility support for minidom.""" # This module should only be imported using "import *". # # The following names are defined: # # NodeList -- lightest possible NodeList implementation # # EmptyNodeList -- lightest possible NodeList that is guaranteed to # remain empty...
gpl-3.0
soumyanishan/azure-linux-extensions
VMEncryption/main/oscrypto/centos_68/encryptstates/SplitRootPartitionState.py
5
11653
#!/usr/bin/env python # # VM Backup extension # # Copyright 2015 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
luvten/flask
flask/wrappers.py
7
7533
# -*- coding: utf-8 -*- """ flask.wrappers ~~~~~~~~~~~~~~ Implements the WSGI wrappers (request and response). :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from werkzeug.wrappers import Request as RequestBase, Response as ResponseBase from werkzeug.exce...
bsd-3-clause
Azure/azure-sdk-for-python
sdk/identity/azure-identity/azure/identity/_credentials/cloud_shell.py
1
2005
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import functools import os from typing import TYPE_CHECKING from azure.core.pipeline.transport import HttpRequest from .. import CredentialUnavailableError from .._con...
mit
dhermes/gcloud-python
datastore/google/cloud/datastore/batch.py
2
12030
# Copyright 2014 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
rynomster/django
django/contrib/messages/storage/base.py
526
6285
from __future__ import unicode_literals from django.conf import settings from django.contrib.messages import constants, utils from django.utils.encoding import force_text, python_2_unicode_compatible LEVEL_TAGS = utils.get_level_tags() @python_2_unicode_compatible class Message(object): """ Represents an ac...
bsd-3-clause
pilou-/ansible
lib/ansible/modules/cloud/azure/azure_rm_resource_facts.py
14
7926
#!/usr/bin/python # # Copyright (c) 2018 Zim Kalinowski, <zikalino@microsoft.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 ANSIBLE_METADATA = {'metadata_version': '1.1', ...
gpl-3.0
damonkohler/sl4a
python/src/Lib/test/test_random.py
56
22119
#!/usr/bin/env python import unittest import random import time import pickle import warnings from math import log, exp, sqrt, pi, fsum as msum from test import test_support class TestBasicOps(unittest.TestCase): # Superclass with tests common to all generators. # Subclasses must arrange for self.gen to retri...
apache-2.0
ntt-sic/neutron
neutron/extensions/vpnaas.py
3
18743
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # (c) Copyright 2013 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...
apache-2.0
lu18887/perhapsgeekblog
perhapsgeek/zinnia/views/entries.py
14
1289
"""Views for Zinnia entries""" from django.views.generic.dates import BaseDateDetailView from zinnia.models.entry import Entry from zinnia.views.mixins.archives import ArchiveMixin from zinnia.views.mixins.entry_preview import EntryPreviewMixin from zinnia.views.mixins.entry_protection import EntryProtectionMixin from...
mit
MarcosCommunity/odoo
openerp/report/render/makohtml2html/__init__.py
381
1084
# -*- 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
hfp/tensorflow-xsmm
tensorflow/python/ops/distributions/distributions.py
42
2050
# 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
KhanSuleyman/pyxley
examples/custom_react/project/helper.py
12
1688
from pyxley.charts import Chart from flask import jsonify, request class NewChart(Chart): def __init__(self, x, y1, y2, data_source, init_params={}, chart_id="new_chart", url="/new_chart/", colors=[]): self.x = x self.y1 = y1 self.y2 = y2 self.options = { "char...
mit
jfrank1500/curso_nodejs
bin/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py
2710
5094
# 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. """Visual Studio user preferences file writer.""" import os import re import socket # for gethostname import gyp.common import gyp.easy_xml as easy_xml #------...
mit
Dhivyap/ansible
lib/ansible/modules/network/check_point/cp_mgmt_application_site_group.py
20
5199
#!/usr/bin/python # -*- coding: utf-8 -*- # # Ansible module to manage Check Point Firewall (c) 2019 # # 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 o...
gpl-3.0
BT-astauder/odoo
addons/board/__init__.py
439
1144
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/nltk/stem/snowball.py
12
150142
# -*- coding: utf-8 -*- # # Natural Language Toolkit: Snowball Stemmer # # Copyright (C) 2001-2012 NLTK Project # Author: Peter Michael Stahl <pemistahl@gmail.com> # Peter Ljunglof <peter.ljunglof@heatherleaf.se> (revisions) # Algorithms: Dr Martin Porter <martin@tartarus.org> # URL: <http://www.nltk.org/> # Fo...
agpl-3.0
starrybeam/samba
third_party/dnspython/dns/rdtypes/IN/NAPTR.py
100
4873
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
idlead/scikit-learn
sklearn/naive_bayes.py
29
28917
# -*- coding: utf-8 -*- """ The :mod:`sklearn.naive_bayes` module implements Naive Bayes algorithms. These are supervised learning methods based on applying Bayes' theorem with strong (naive) feature independence assumptions. """ # Author: Vincent Michel <vincent.michel@inria.fr> # Minor fixes by Fabian Pedre...
bsd-3-clause
ceph/autotest
client/tests/kvm/tests/virtio_console.py
1
49379
""" virtio_console test @copyright: 2010 Red Hat, Inc. """ import array, logging, os, random, re, select, shutil, socket, sys, tempfile import threading, time, traceback from collections import deque from threading import Thread from autotest_lib.client.common_lib import error from autotest_lib.client.bin import util...
gpl-2.0
ahb0327/intellij-community
python/helpers/docutils/io.py
48
14403
# $Id: io.py 6269 2010-03-18 22:27:53Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ I/O classes provide a uniform API for low-level input and output. Subclasses will exist for a variety of input/output mechanisms. """ __docformat__ = 'reStruc...
apache-2.0
pannal/Subliminal.bundle
Contents/Libraries/Shared/bs4/tests/test_htmlparser.py
31
1191
"""Tests to ensure that the html.parser tree builder generates good trees.""" from pdb import set_trace import pickle from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest from bs4.builder import HTMLParserTreeBuilder class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest): @property de...
mit
lsqtongxin/ryu
ryu/tests/unit/app/test_ws_topology.py
43
1517
# Copyright (C) 2013 Stratosphere 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 ...
apache-2.0
silenceli/nova
nova/keymgr/mock_key_mgr.py
8
4444
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
mzdaniel/oh-mainline
vendor/packages/twisted/doc/core/examples/threadedselect/blockingdemo.py
18
2445
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. from twisted.internet import _threadedselect _threadedselect.install() from twisted.internet.defer import Deferred from twisted.python.failure import Failure from twisted.internet import reactor from twisted.python.runtime import seconds from it...
agpl-3.0
Chilledheart/chromium
tools/telemetry/third_party/pyserial/serial/serialjava.py
151
9284
#!jython # # Python Serial Port Extension for Win32, Linux, BSD, Jython # module for serial IO for Jython and JavaComm # see __init__.py # # (C) 2002-2008 Chris Liechti <cliechti@gmx.net> # this is distributed under a free software license, see license.txt from serial.serialutil import * def my_import(name): mod ...
bsd-3-clause
hubrick/graphite-api
graphite_api/_vendor/whisper.py
11
31000
# Copyright 2009-Present The Graphite Development Team # Copyright 2008 Orbitz WorldWide # # 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 # # U...
apache-2.0
cyanna/edx-platform
common/test/acceptance/pages/studio/overview.py
15
23729
""" Course Outline page in Studio. """ import datetime from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from selenium.webdriver.support.ui import Select from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains from .course_p...
agpl-3.0
pol51/django-ajax-filtered-fields
ajax_filtered_fields/forms/fields.py
7
10039
# -*- coding: utf-8 -*- from django import forms from django.forms.util import ValidationError from django.utils.translation import ugettext as _ from ajax_filtered_fields.forms import FilteredSelectMultiple, FilteredSelect from ajax_filtered_fields import utils class AjaxManyToManyField(forms.ModelMultipleChoiceFiel...
mit
wndhydrnt/airflow
airflow/contrib/kubernetes/pod_generator.py
5
9233
# 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
nburn42/tensorflow
tensorflow/examples/adding_an_op/zero_out_op_1.py
190
1053
# 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
certik/yaml-cpp.old-api
test/gmock-1.7.0/gtest/test/gtest_xml_outfiles_test.py
2526
5340
#!/usr/bin/env python # # Copyright 2008, 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...
mit
simplyguru-dot/ansible
lib/ansible/template/safe_eval.py
57
4361
# (c) 2012, 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) any lat...
gpl-3.0
BenKeyFSI/poedit
deps/boost/tools/build/src/tools/common.py
11
32311
# Status: being ported by Steven Watanabe # Base revision: 47174 # # Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and # distribute this software is granted provided this copyright notice appears in # all copies. This software is provided "as is" without express or implied # warranty, an...
mit
kespindler/puffin
tests/test_puffin.py
1
2287
from puf import cli from tests import StreamCaptureTest import re from tempfile import NamedTemporaryFile class TestMain(StreamCaptureTest): def test_main(self): cli.main(['range(3)']) self.assertWasStreamed('0\n1\n2\n') def test_main_initial(self): self.assertRaises(NameError, cli.ma...
mit
gitterHQ/ansible
lib/ansible/inventory/vars_plugins/noop.py
153
1544
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.be> # # 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 Foundat...
gpl-3.0
aeischeid/servo
tests/wpt/web-platform-tests/tools/pytest/doc/en/_themes/flask_theme_support.py
2228
4875
# flasky extensions. flasky pygments style based on tango style from pygments.style import Style from pygments.token import Keyword, Name, Comment, String, Error, \ Number, Operator, Generic, Whitespace, Punctuation, Other, Literal class FlaskyStyle(Style): background_color = "#f8f8f8" default_style = "...
mpl-2.0
carlgao/lenga
images/lenny64-peon/usr/share/python-support/python-sqlalchemy/sqlalchemy/orm/shard.py
4
5254
"""Defines a rudimental 'horizontal sharding' system which allows a Session to distribute queries and persistence operations across multiple databases. For a usage example, see the example ``examples/sharding/attribute_shard.py``. """ from sqlalchemy.orm.session import Session from sqlalchemy.orm.query import Query...
mit
rjgoodin/uwaterloo-igem-2015
models/targeting/init_genome_camv.py
4
5930
from converter_fasta import convert_fasta_to_string from genome_classes import Genome, Domain, Target def init_genome_camv(pseudo_targets): """ Initializes the CaMV genome object for simulation Args: pseudo_targets: list of format [t1, t2, ..., tn] where each is a dict with = {...
mit
girving/tensorflow
tensorflow/contrib/slim/python/slim/data/data_decoder.py
146
2302
# 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
qedi-r/home-assistant
homeassistant/components/command_line/sensor.py
5
6083
"""Allows to configure custom shell commands to turn a value for a sensor.""" import collections from datetime import timedelta import json import logging import shlex import subprocess import voluptuous as vol from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.const import ( CONF_COMM...
apache-2.0
imruahmed/microblog
flask/lib/python2.7/site-packages/coverage/monkey.py
46
1535
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Monkey-patching to make coverage.py work right in some cases.""" import multiprocessing import multiprocessing.process import sys # An attribute that will be s...
bsd-3-clause
FireWRT/OpenWrt-Firefly-Libraries
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/test/test_descrtut.py
75
12052
# This contains most of the executable examples from Guido's descr # tutorial, once at # # http://www.python.org/2.2/descrintro.html # # A few examples left implicit in the writeup were fleshed out, a few were # skipped due to lack of interest (e.g., faking super() by hand isn't # of much interest anymore), and a f...
gpl-2.0
gautamkrishnar/hatter
venv/lib/python2.7/site-packages/flask/testsuite/blueprints.py
563
28089
# -*- coding: utf-8 -*- """ flask.testsuite.blueprints ~~~~~~~~~~~~~~~~~~~~~~~~~~ Blueprints (and currently modules) :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest import warnings from flask.testsuite import FlaskTestCase, emi...
gpl-3.0
waltaskew/tweet-cereal
tweet_cereal/app.py
1
1799
"""Define an app for processing requests to LaTeX up tweets.""" import base64 import os import flask import flask_socketio import eventlet import redis import tweet_cereal.tasks as tasks import tweet_cereal.tweets as tweets JOB_RESULT_POLL_INTERVAL = 1 app = flask.Flask(__name__) socketio = flask_socketio.SocketIO...
bsd-3-clause
Krossom/python-for-android
python-build/python-libs/gdata/build/lib/gdata/docs/__init__.py
263
8993
#!/usr/bin/python # # Copyright 2009 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 b...
apache-2.0
mrcrilly/vs-vlan-db
vsvlandb/forms/vlan.py
1
1069
from vsvlandb.models import Site, Subnet, Impact from flask.ext.wtf import Form from wtforms import TextField, SelectField, BooleanField, IntegerField from wtforms.validators import DataRequired, NumberRange, Optional, Length from wtforms.ext.sqlalchemy.fields import QuerySelectMultipleField, QuerySelectField def a...
mit
CongSmile/tp-qemu
generic/tests/clock_getres.py
9
1491
import logging import os from autotest.client.shared import error from virttest import utils_test from virttest import data_dir @error.context_aware def run(test, params, env): """ Verify if guests using kvm-clock as the time source have a sane clock resolution. :param test: kvm test object. :p...
gpl-2.0