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
tinchoss/Python_Android
python/src/Lib/test/test_trace.py
51
22301
# Testing the line trace facility. from test import test_support import unittest import sys import difflib import gc # A very basic example. If this fails, we're in deep trouble. def basic(): return 1 basic.events = [(0, 'call'), (1, 'line'), (1, 'return')] # Many of the tests b...
apache-2.0
e-gun/HipparchiaServer
server/authentication/authenticationwrapper.py
1
2771
# -*- coding: utf-8 -*- """ HipparchiaServer: an interface to a database of Greek and Latin texts Copyright: E Gunderson 2016-21 License: GNU GENERAL PUBLIC LICENSE 3 (see LICENSE in the top level directory of the distribution) """ import json from flask import session from server import hipparchia def require...
gpl-3.0
wikimedia/operations-debs-python-diamond
src/collectors/nginx/nginx.py
13
3390
# coding=utf-8 """ Collect statistics from Nginx #### Dependencies * urllib2 #### Usage To enable the nginx status page to work with defaults, add a file to /etc/nginx/sites-enabled/ (on Ubuntu) with the following content: <pre> server { listen 127.0.0.1:8080; server_name localhost; location /...
mit
suvit/speedydeploy
speedydeploy/project/celery.py
1
3981
# -*- coding: utf-8 -*- from __future__ import with_statement import os import sys from fabric import api as fab from fabric.contrib import files as fab_files from fabric.contrib.files import exists from fab_deploy.utils import run_as from ..base import _, Daemon from ..deployment import command from ..utils import ...
mit
perezg/infoxchange
BASE/lib/python2.7/site-packages/pip/cmdoptions.py
5
5280
"""shared options and groups""" from optparse import make_option, OptionGroup from pip.locations import build_prefix def make_option_group(group, parser): """ Return an OptionGroup object group -- assumed to be dict with 'name' and 'options' keys parser -- an optparse Parser """ option_group ...
apache-2.0
nerdvegas/rez
src/rezgui/widgets/ContextResolveTimeLabel.py
1
1849
from Qt import QtCore, QtWidgets from rezgui.models.ContextModel import ContextModel from rezgui.mixins.ContextViewMixin import ContextViewMixin from rez.utils.formatting import readable_time_duration import time class ContextResolveTimeLabel(QtWidgets.QLabel, ContextViewMixin): def __init__(self, context_model=N...
lgpl-3.0
markmandel/scudcloud
scudcloud-1.0/lib/notifier.py
10
1075
from dbus.exceptions import DBusException try: from gi.repository import Notify except ImportError: import notify2 Notify = None class Notifier(object): def __init__(self, app_name, icon): self.icon = icon try: if Notify is not None: Notify.init(app_name) ...
mit
M4rtinK/pyside-bb10
tests/QtCore/qenum_test.py
6
1234
#!/usr/bin/python '''Test cases for QEnum and QFlags''' import unittest from PySide.QtCore import * class TestEnum(unittest.TestCase): def testToInt(self): self.assertEqual(QIODevice.NotOpen, 0) self.assertEqual(QIODevice.ReadOnly, 1) self.assertEqual(QIODevice.WriteOnly, 2) self...
lgpl-2.1
Comunitea/OCB
addons/l10n_us/__openerp__.py
341
1763
# -*- 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
CTJChen/ctc_astropylib
XD/extreme_deconvolution_TEMPLATE.py
4
20368
import os, os.path, platform import ctypes import ctypes.util import numpy as nu from numpy.ctypeslib import ndpointer #Find and load the library _lib = None if platform.system()=='Darwin': _libraryname= 'libextremedeconvolution.dylib' else: _libraryname= 'libextremedeconvolution.so' _libname = ctypes.util.find...
apache-2.0
mmnelemane/nova
nova/virt/hyperv/pathutils.py
24
11183
# Copyright 2013 Cloudbase Solutions Srl # 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 r...
apache-2.0
40223114/w16b_test
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/draw.py
603
6456
from javascript import console from browser import timer import math class Queue: def __init__(self): self._list=[] def empty(self): return len(self._list) == 0 def put(self, element): self._list.append(element) def get(self): if len(self._list) == 0: raise BaseError ...
agpl-3.0
zepto/musio
musio/id3_util.py
1
3403
#!/usr/bin/env python # vim: sw=4:ts=4:sts=4:fdm=indent:fdl=0: # -*- coding: UTF8 -*- # # A module to read id3 tags from files. # Copyright (C) 2014 Josiah Gordon <josiahg@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publis...
gpl-3.0
variar/klogg
3rdparty/sentry/external/crashpad/third_party/mini_chromium/mini_chromium/build/find_mac_sdk.py
5
6237
#!/usr/bin/env python # coding: utf-8 # Copyright 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. from __future__ import print_function import argparse import distutils.version import os import re import subprocess ...
gpl-3.0
FrankBian/kuma
kuma/users/providers/github/views.py
10
1715
import requests from allauth.account.utils import get_next_redirect_url from allauth.socialaccount.providers.oauth2.views import (OAuth2LoginView, OAuth2CallbackView) from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter from kuma.core.u...
mpl-2.0
dgarciam/Sick-Beard
lib/hachoir_parser/container/action_script.py
90
11980
""" SWF (Macromedia/Adobe Flash) file parser. Documentation: - Alexis' SWF Reference: http://www.m2osw.com/swf_alexref.html Author: Sebastien Ponce Creation date: 26 April 2008 """ from lib.hachoir_core.field import (FieldSet, ParserError, Bit, Bits, UInt8, UInt32, Int16, UInt16, Float32, CString, RawBy...
gpl-3.0
amarant/servo
tests/wpt/update/fetchlogs.py
222
3183
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import cStringIO import gzip import json import os import requests import urlparse treeherder_base = "h...
mpl-2.0
followloda/PornGuys
FlaskServer/venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py
2755
9226
######################## 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-3.0
jbzdak/edx-platform
common/lib/xmodule/xmodule/modulestore/xml.py
26
42247
import hashlib import itertools import json import logging import os import re import sys import glob from collections import defaultdict from cStringIO import StringIO from fs.osfs import OSFS from importlib import import_module from lxml import etree from path import Path as path from contextlib import contextmanage...
agpl-3.0
iulian787/spack
var/spack/repos/builtin/packages/py-httpbin/package.py
5
1099
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class PyHttpbin(PythonPackage): """HTTP Request and Response Service""" homepage = "https:/...
lgpl-2.1
teochenglim/ansible-modules-extras
system/make.py
4
4575
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Linus Unnebäck <linus@folkdatorn.se> # # This file is part of Ansible # # This module 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
yeming233/horizon
openstack_dashboard/dashboards/admin/routers/views.py
2
5785
# Copyright 2012, Nachi Ueno, NTT MCL, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
cloudbase/cinder
cinder/scheduler/base_filter.py
7
5556
# Copyright (c) 2011-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.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
zerkrx/zerkbox
cogs/audio.py
6
81420
import discord from discord.ext import commands import threading import os from random import shuffle, choice from cogs.utils.dataIO import dataIO from cogs.utils import checks from cogs.utils.chat_formatting import pagify from urllib.parse import urlparse from __main__ import send_cmd_help, settings from json import J...
gpl-3.0
ademuk/django-oscar
tests/functional/customer/profile_tests.py
44
7937
from mock import patch from decimal import Decimal as D from django.core.urlresolvers import reverse from oscar.test.factories import create_product, create_order from oscar.test.testcases import WebTestCase from oscar.core.compat import get_user_model from oscar.apps.basket.models import Basket from oscar.apps.partn...
bsd-3-clause
OmarIthawi/edx-platform
common/djangoapps/user_api/tests/test_profile_api.py
4
4880
# -*- coding: utf-8 -*- """ Tests for the profile API. """ from django.test import TestCase import ddt from nose.tools import raises from dateutil.parser import parse as parse_datetime from user_api.api import account as account_api from user_api.api import profile as profile_api from user_api.models import UserProfi...
agpl-3.0
837468220/python-for-android
python3-alpha/extra_modules/gdata/tlslite/Session.py
48
4736
"""Class representing a TLS session.""" from .utils.compat import * from .mathtls import * from .constants import * class Session: """ This class represents a TLS session. TLS distinguishes between connections and sessions. A new handshake creates both a connection and a session. Data is transm...
apache-2.0
abhiii5459/sympy
sympy/printing/tests/test_str.py
9
22861
from __future__ import division from sympy import (Abs, Catalan, cos, Derivative, E, EulerGamma, exp, factorial, factorial2, Function, GoldenRatio, I, Integer, Integral, Interval, Lambda, Limit, Matrix, nan, O, oo, pi, Rational, Float, Rel, S, sin, SparseMatrix, sqrt, summation, Sum, Symbol, symbols, Wild,...
bsd-3-clause
yesbox/ansible
test/units/executor/test_playbook_executor.py
33
3815
# (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
havard024/prego
venv/lib/python2.7/site-packages/django/core/mail/backends/filebased.py
145
2522
"""Email backend that writes messages to a file.""" import datetime import os from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.mail.backends.console import EmailBackend as ConsoleEmailBackend from django.utils import six class EmailBackend(ConsoleEmailBackend)...
mit
etibger/pdf2xlsx
pdf2xlsx/order_detail_xlsx_parse.py
1
4751
# -*- coding: utf-8 -*- """ Read the Order details xlsx and extract data from it to the Order classes """ from openpyxl import load_workbook, Workbook from collections import OrderedDict from itertools import repeat ORDER_START_TOKEN = 'Line Item:' SIZE_BEGIN_TOKEN = 'Size' SIZE_END_TOKEN = 'Total Qty:' class State...
mit
open-synergy/sale-workflow
sale_order_type/models/account_invoice.py
6
2333
# -*- encoding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in root directory ############################################################################## from openerp import api, models, fields class AccountI...
agpl-3.0
MrNuggles/HeyBoet-Telegram-Bot
temboo/Library/PayPal/Payments/VerifyCreditCardPayment.py
5
5434
# -*- coding: utf-8 -*- ############################################################################### # # VerifyCreditCardPayment # Verifies that a credit card payment from the PayPal REST API has been completed successfully. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Ap...
gpl-3.0
CantemoInternal/pyxb
tests/bugs/test-200908041708.py
5
1624
# -*- coding: utf-8 -*- import logging if __name__ == '__main__': logging.basicConfig() _log = logging.getLogger(__name__) import pyxb.binding.generate import pyxb.binding.datatypes as xs import pyxb.binding.basis import pyxb.utils.domutils import os.path xsd='''<?xml version="1.0" encoding="UTF-8"?> <xs:schema xm...
apache-2.0
manasapte/pants
contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/print_statements.py
18
1221
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import ast import re...
apache-2.0
ridfrustum/lettuce
tests/integration/lib/Django-1.3/django/core/mail/__init__.py
229
5072
""" Tools for sending email. """ from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module # Imported for backwards compatibility, and for the sake # of a cleaner namespace. These symbols used to be in # django/core/mail.py before the int...
gpl-3.0
sgrepo/flask
flask/helpers.py
776
33793
# -*- coding: utf-8 -*- """ flask.helpers ~~~~~~~~~~~~~ Implements various helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys import pkgutil import posixpath import mimetypes from time import time from zlib import adler32 from th...
bsd-3-clause
jbalogh/zamboni
apps/stats/utils.py
1
7195
from decimal import Decimal from .db import StatsDict class DictKey(object): """A simple wrapper used to prevent collisions with string dictionary keys. Used by ``unknown_gen``. """ def __init__(self, name): self.name = name def __str__(self): return str(self.name) def csv_pr...
bsd-3-clause
DESHRAJ/fjord
vendor/packages/translate-toolkit/translate/convert/test_php2po.py
4
6500
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.convert import php2po from translate.convert import test_convert from translate.misc import wStringIO from translate.storage import po from translate.storage import php class TestPhp2PO: def php2po(self, phpsource, phptemplate=None): """helper...
bsd-3-clause
immerrr/numpy
numpy/lib/tests/test_ufunclike.py
6
1992
from __future__ import division, absolute_import, print_function from numpy.testing import * import numpy.core as nx import numpy.lib.ufunclike as ufl from numpy.testing.decorators import deprecated class TestUfunclike(TestCase): def test_isposinf(self): a = nx.array([nx.inf, -nx.inf, nx.nan, 0.0, 3.0, ...
bsd-3-clause
NGSchool2016/ngschool2016-materials
src/SPAdes-3.9.0-Linux/share/spades/pyyaml3/serializer.py
293
4165
__all__ = ['Serializer', 'SerializerError'] from .error import YAMLError from .events import * from .nodes import * class SerializerError(YAMLError): pass class Serializer: ANCHOR_TEMPLATE = 'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=None, ta...
gpl-3.0
pedrobaeza/odoo
addons/im/im.py
40
17455
# -*- 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
dash-dash/AutobahnPython
examples/twisted/websocket/echo_variants/client_reconnecting.py
2
3249
############################################################################### # # The MIT License (MIT) # # Copyright (c) Tavendo GmbH # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software with...
mit
carlgao/lenga
images/lenny64-peon/usr/share/python-support/python-django/django/db/models/query_utils.py
65
9400
""" Various data structures used in query construction. Factored out from django.db.models.query to avoid making the main module very large and/or so that they can be used by other modules without getting into circular import difficulties. """ import weakref from django.utils.copycompat import deepcopy from django.u...
mit
interlegis/sapl
sapl/lexml/views.py
1
1290
from django.http import HttpResponse from django.shortcuts import render from sapl.crud.base import CrudAux, Crud from sapl.lexml.OAIServer import OAIServerFactory, get_config from sapl.rules import RP_DETAIL, RP_LIST from .models import LexmlProvedor, LexmlPublicador from .forms import LexmlProvedorForm LexmlPubli...
gpl-3.0
iModels/ffci
github/tests/Framework.py
1
11915
# -*- coding: utf-8 -*- # ########################## Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
mit
pyload/pyload
src/pyload/plugins/accounts/ExtmatrixCom.py
1
3094
# -*- coding: utf-8 -*- import re import time import urllib.parse from pyload.core.datatypes.pyfile import PyFile from ..base.account import BaseAccount from ..base.captcha import BaseCaptcha class ExtmatrixCom(BaseAccount): __name__ = "ExtmatrixCom" __type__ = "account" __version__ = "0.01" __stat...
agpl-3.0
Lana-Pa/Mantis-training
fixture/project.py
1
3033
from model.project import Project from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time class ProjectHelper: def __init__(self, app): self.app = app def open_projects(self): ...
apache-2.0
quoclieu/codebrew17-starving
env/lib/python3.5/site-packages/setuptools/command/install_lib.py
104
3839
import os import imp from itertools import product, starmap import distutils.command.install_lib as orig class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" def run(self): self.build() outfiles = self.install() if outfiles is not None: ...
mit
Nikea/VisTrails
contrib/NumSciPy/ArrayInterpolate.py
6
5820
import core.modules import core.modules.module_registry from core.modules.vistrails_module import Module, ModuleError import scipy import scipy.interpolate import scipy.ndimage import vtk from Array import * from Matrix import * class ArrayInterpModule(object): my_namespace = 'scipy|interpolation' class RBFIn...
bsd-3-clause
noahbenson/neuropythy
neuropythy/geometry/__init__.py
1
2332
#################################################################################################### # neuropythy/geometry/__init__.py # This file defines common rotation functions that are useful with cortical mesh spheres, such as # those produced with FreeSurfer. ''' The neuropythy.geometry package contains a numbe...
agpl-3.0
vitorio/ocropodium
ocradmin/projects/models.py
1
2502
""" Object representing an OCR project, used to group files, batches, and presets. """ import datetime from django.db import models from django.contrib.auth.models import User from tagging import fields as taggingfields import autoslug from ocradmin.core import utils as ocrutils from ocradmin.storage import registry...
apache-2.0
noelbk/neutron-juniper
neutron/tests/unit/agent/linux/test_polling.py
17
4523
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #...
apache-2.0
mathom/kombu
kombu/tests/transport/virtual/test_exchange.py
2
4864
from __future__ import absolute_import from kombu import Connection from kombu.transport.virtual import exchange from kombu.tests.mocks import Transport from kombu.tests.utils import TestCase from kombu.tests.utils import Mock class ExchangeCase(TestCase): type = None def setUp(self): if self.type:...
bsd-3-clause
virneo/nupic
examples/prediction/experiments/dutyCycle/bSDRSameDC/description.py
50
1578
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
maxrothman/aws-alfred-workflow
venv/lib/python2.7/site-packages/botocore/vendored/requests/packages/chardet/jisfreq.py
3131
47315
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
guiquanz/Dato-Core
src/unity/python/graphlab_psutil/_pslinux.py
26
43171
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Linux platform implementation.""" from __future__ import division import base64 import errno import os import re import socket ...
agpl-3.0
andyzsf/edx
cms/djangoapps/contentstore/views/item.py
2
41663
"""Views for items (modules).""" from __future__ import absolute_import import hashlib import logging from uuid import uuid4 from datetime import datetime from pytz import UTC import json from collections import OrderedDict from functools import partial from static_replace import replace_static_urls from xmodule_modi...
agpl-3.0
pfctdayelise/pytest
src/_pytest/logging.py
2
21798
""" Access and control log capturing. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging import re from contextlib import contextmanager import py import six import pytest from _pytest.compat import dummy_context_manager from _pytest.config...
mit
benjyw/pants
tests/python/pants_test/pantsd/test_lock.py
4
3186
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os import shutil import tempfile import unittest from multiprocessing import Manager, Process from threading import Thread from pants.pantsd.lock import OwnerPrintingInterProcessFi...
apache-2.0
bsmrstu-warriors/Moytri---The-Drone-Aider
Lib/site-packages/numpy/oldnumeric/tests/test_oldnumeric.py
99
3173
import unittest from numpy.testing import * from numpy import array from numpy.oldnumeric import * from numpy.core.numeric import float32, float64, complex64, complex128, int8, \ int16, int32, int64, uint, uint8, uint16, uint32, uint64 class test_oldtypes(unittest.TestCase): def test_oldtypes(self, level...
gpl-3.0
INM-6/Python-Module-of-the-Week
session20_NEST/snakemake/scripts/plotPhaseDiagram.py
1
1399
import os import argparse import numpy as np import matplotlib.pyplot as plt # parse command line parameters parser = argparse.ArgumentParser(description='Plot phase diagram.') parser.add_argument('spikefiles', type=str, nargs='+', help='input files') parser.add_argument('plotfile', type=str, help='output file') args...
mit
andresgz/django
tests/model_fields/models.py
210
12155
import os import tempfile import uuid from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.core.files.storage import FileSystemStorage from django.db import models from django.db.models.fields.files import Imag...
bsd-3-clause
catapult-project/catapult-csm
telemetry/telemetry/benchmark_runner_unittest.py
2
5120
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from telemetry import benchmark from telemetry import benchmark_runner from telemetry.testing import stream import mock class BenchmarkFoo...
bsd-3-clause
bakhtout/odoo-educ
addons/crm/sales_team.py
321
5053
# -*- coding: utf-8 -*- import calendar from datetime import date from dateutil import relativedelta import json from openerp import tools from openerp.osv import fields, osv class crm_case_section(osv.Model): _inherit = 'crm.case.section' _inherits = {'mail.alias': 'alias_id'} def _get_opportunities_d...
agpl-3.0
joshmoore/bioformats
components/xsd-fu/python/generateDS/Demos/Xmlbehavior/xmlbehavior_sub.py
33
4673
#!/usr/bin/env python # # Generated Tue Jun 29 16:14:16 2004 by generateDS.py. # import sys from xml.dom import minidom from xml.sax import handler, make_parser import xmlbehavior as supermod class xml_behaviorSub(supermod.xml_behavior): def __init__(self, base_impl_url='', behaviors=None): supermod.xml...
gpl-2.0
40223245/2015cdb_g6-team1
static/Brython3.1.1-20150328-091302/Lib/_threading_local.py
923
7410
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
gpl-3.0
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/response.py
515
2165
from __future__ import absolute_import from ..packages.six.moves import http_client as httplib from ..exceptions import HeaderParsingError def is_fp_closed(obj): """ Checks whether a given file-like object is closed. :param obj: The file-like object to check. """ try: # Check vi...
gpl-3.0
parag2489/Image-Quality
testtest.py
1
2211
from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility from keras.datasets import mnist from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.convolutional import Convolution2D, MaxPooling2D from keras.utils...
mit
6112/servo
tests/wpt/web-platform-tests/tools/html5lib/html5lib/tests/support.py
450
5496
from __future__ import absolute_import, division, unicode_literals import os import sys import codecs import glob import xml.sax.handler base_path = os.path.split(__file__)[0] test_dir = os.path.join(base_path, 'testdata') sys.path.insert(0, os.path.abspath(os.path.join(base_path, ...
mpl-2.0
bennyrowland/suspect
suspect/mrsdata.py
1
6153
import numpy class MRSData(numpy.ndarray): """ numpy.ndarray subclass with additional metadata like sampling rate and echo time. """ def __new__(cls, input_array, dt, f0, te=30, ppm0=4.7, voxel_dimensions=(10, 10, 10), transform=None, metadata=None): # Input array is an already formed nda...
mit
marcore/edx-platform
common/djangoapps/third_party_auth/tests/specs/test_azuread.py
15
1631
"""Integration tests for Azure Active Directory / Microsoft Account provider.""" from third_party_auth.tests.specs import base # pylint: disable=test-inherits-tests class AzureADOauth2IntegrationTest(base.Oauth2IntegrationTest): """Integration tests for Azure Active Directory / Microsoft Account provider.""" ...
agpl-3.0
bearstech/ansible
lib/ansible/plugins/action/iosxr.py
12
4069
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
ClearCorp/account-financial-tools
account_multicompany_usability/models/product.py
1
4798
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import api, fields, models # from ope...
agpl-3.0
chrys87/orca-beep
src/orca/settings_manager.py
1
21060
# Orca # # Copyright 2010 Consorcio Fernando de los Rios. # Author: Javier Hernandez Antunez <jhernandez@emergya.es> # Author: Alejandro Leiva <aleiva@emergya.es> # # 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 ...
lgpl-2.1
lthurlow/Network-Grapher
proj/external/networkx-1.7/build/lib.linux-i686-2.7/networkx/algorithms/shortest_paths/weighted.py
12
23144
# -*- coding: utf-8 -*- """ Shortest path algorithms for weighed graphs. """ __author__ = """\n""".join(['Aric Hagberg <hagberg@lanl.gov>', 'Loïc Séguin-C. <loicseguin@gmail.com>', 'Dan Schult <dschult@colgate.edu>']) # Copyright (C) 2004-2011 by # Aric Hagb...
mit
mgit-at/ansible
lib/ansible/parsing/ajson.py
48
2435
# Copyright: (c) 2018, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import json from datetime import date, datetime from ansible.modu...
gpl-3.0
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/django/core/management/commands/migrate.py
36
17808
# -*- coding: utf-8 -*- from __future__ import unicode_literals import itertools import time import traceback import warnings from collections import OrderedDict from importlib import import_module from django.apps import apps from django.core.management import call_command from django.core.management.base import Bas...
bsd-3-clause
tedelhourani/ansible
contrib/inventory/nova.py
109
7029
#!/usr/bin/env python # (c) 2012, Marco Vito Moscaritolo <marco@agavee.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 # ...
gpl-3.0
ImageEngine/gaffer
python/GafferSceneUITest/TransformToolTest.py
3
11154
########################################################################## # # Copyright (c) 2019, Cinesite VFX Ltd. 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 ...
bsd-3-clause
sumedhasingla/VTK
Examples/Modelling/Python/reconstructSurface.py
13
2608
#!/usr/bin/env python # This example shows how to construct a surface from a point cloud. # First we generate a volume using the # vtkSurfaceReconstructionFilter. The volume values are a distance # field. Once this is generated, the volume is countoured at a # distance value of 0.0. import os import string import vtk...
bsd-3-clause
larsbergstrom/servo
tests/wpt/web-platform-tests/content-security-policy/support/report.py
38
2129
import time import json import re def retrieve_from_stash(request, key, timeout, default_value): t0 = time.time() while time.time() - t0 < timeout: time.sleep(0.5) value = request.server.stash.take(key=key) if value is not None: return value return default_value def main(request, response): ...
mpl-2.0
Pablo126/SSBW
Entrega1/lib/python3.5/site-packages/pip/_vendor/requests/packages/chardet/universaldetector.py
1776
6840
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
gpl-3.0
maurossi/deqp
scripts/src_util/common.py
5
3023
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # drawElements Quality Program utilities # -------------------------------------- # # Copyright 2015 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use t...
apache-2.0
ftCommunity/ft-TXT
board/knobloch/TXT/board-support/ti-linux/tools/perf/scripts/python/net_dropmonitor.py
2669
1738
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
ewdurbin/sentry
src/sentry/migrations/0167_auto__add_field_authprovider_flags.py
34
36931
# -*- 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): # Adding field 'AuthProvider.flags' db.add_column('sentry_authprovider', ...
bsd-3-clause
googlei18n/glyphsLib
tests/builder/features_test.py
1
12654
# coding=UTF-8 # # Copyright 2016 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 ap...
apache-2.0
jimbydamonk/ansible-modules-core
windows/win_msi.py
16
1878
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Matt Martz <matt@sivel.net>, and others # # 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 t...
gpl-3.0
lumig242/Hue-Integration-with-CDAP
apps/jobsub/src/jobsub/migrations/0001_initial.py
39
6539
# encoding: utf-8 # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may no...
apache-2.0
gersonkurz/eftepede
eftepede_authorizer.py
1
2749
#! -*- Encoding: Latin-1 -*- import os import threading import logging import logging.handlers import eftepede_globals import pyftpdlib.authorizers import eftepede_password class Authorizer(pyftpdlib.authorizers.DummyAuthorizer): def __init__(self, config, logger): pyftpdlib.authorizers.D...
apache-2.0
amith01994/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/cl/forms.py
110
3188
""" Chile specific form helpers. """ from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import RegexField, Select from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import smart_unicode class CLRegionSelect(Select): ""...
apache-2.0
Simversity/benchPress
api/siminar_signup.py
1
2397
import unittest import settings from core.runners import TrashSiminar from core.decorators import authorize from simtools.timezone import system_now class SubscribeUser(TrashSiminar): @authorize(settings.INSTRUCTOR_EMAIL, settings.INSTRUCTOR_PASSWORD) def test11_create_payment_card(): pass @autho...
gpl-2.0
onitake/ansible
lib/ansible/modules/cloud/amazon/ec2_vpc_nat_gateway_facts.py
44
4573
#!/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
lukeiwanski/tensorflow
tensorflow/contrib/distributions/python/ops/bijectors/chain.py
32
11684
# 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
codilime/contrail-controller
src/dns/scripts/add_virtual_dns.py
12
5261
#!/usr/bin/python # #Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import sys import argparse import ConfigParser from provision_dns import DnsProvisioner from requests.exceptions import ConnectionError class AddVirtualDns(object): def __init__(self, args_str = None): self._args = None...
apache-2.0
RO-ny9/python-for-android
python-build/python-libs/gdata/build/lib/gdata/apps/emailsettings/service.py
143
8840
#!/usr/bin/python # # Copyright (C) 2008 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 law...
apache-2.0
cbrentharris/8700-Project
CarFinder/settings.py
1
2078
""" Django settings for CarFinder project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) ...
mit
jorge2703/scikit-learn
sklearn/covariance/outlier_detection.py
208
6917
""" Class for outlier detection. This class provides a framework for outlier detection. It consists in several methods that can be added to a covariance estimator in order to assess the outlying-ness of the observations of a data set. Such a "outlier detector" object is proposed constructed from a robust covariance es...
bsd-3-clause
Josh-Darling/taipan
file_search.py
1
3851
#!/usr/bin/env python3.3 # -*- coding: UTF-8 -*- # enable debugging import re from os import listdir from os.path import isfile, join class FileSearch: """This object does the following: 1. looks into a specified folder 2.returns a list of all files. 3. excludes '~' files 4. evaluates the type of...
artistic-2.0
sunu/oh-missions-oppia-beta
core/controllers/base.py
2
16831
# Copyright 2014 The Oppia 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 applicable ...
apache-2.0