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 |
|---|---|---|---|---|---|
drongo-framework/drongo-wing-auth | wing_auth/views.py | 1 | 1681 | from drongo_utils.helpers import URLHelper
from wing_jinja2 import Jinja2
url = URLHelper.url
template = Jinja2.template
class AuthViews(object):
def __init__(self, app, module, base_url):
self.app = app
self.module = module
self.base_url = base_url
URLHelper.mount(app, self, b... | mit |
danilito19/django | tests/validation/test_picklable.py | 576 | 2010 | import pickle
from unittest import TestCase
from django.core.exceptions import ValidationError
class PickableValidationErrorTestCase(TestCase):
def test_validationerror_is_picklable(self):
original = ValidationError('a', code='something')
unpickled = pickle.loads(pickle.dumps(original))
... | bsd-3-clause |
malaonline/Server | server/app/migrations/0064_auto_20160201_1843.py | 1 | 1150 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-01 10:43
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('app', '0063_auto_20160201_1830'),
]
operations = [
... | mit |
ankitrgadiya/cs50 | project/miki/miki/edit.py | 1 | 2137 | import os
from flask import (
Blueprint, flash, g, redirect, render_template, request, url_for,
current_app, Markup
)
from markdown import markdown
from werkzeug.exceptions import abort
from miki.auth import login_required
from miki.db import connect
bp = Blueprint('edit', __name__)
@bp.app_template_filt... | gpl-3.0 |
erh3cq/hyperspy | hyperspy/tests/io/test_io.py | 1 | 6593 | # -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
NeovaHealth/odoo | openerp/addons/base/__openerp__.py | 336 | 3703 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
nlu90/heron | heron/common/src/python/utils/log.py | 5 | 3588 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# 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... | apache-2.0 |
awanke/bokeh | examples/glyphs/iris.py | 44 | 1664 | from __future__ import print_function
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.embed import file_html
from bokeh.models.glyphs import Circle
from bokeh.models import (
Plot, DataRange1d, LinearAxis, Grid, ColumnDataSource, PanTool, WheelZoomTool
)
from bokeh.resources import... | bsd-3-clause |
lidan-fnst/samba | source4/dsdb/tests/python/sort.py | 9 | 15176 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Originally based on ./sam.py
from unicodedata import normalize
import locale
locale.setlocale(locale.LC_ALL, ('en_US', 'UTF-8'))
import optparse
import sys
import os
import re
sys.path.insert(0, "bin/python")
import samba
from samba.tests.subunitrun import SubunitOption... | gpl-3.0 |
steventimberman/masterDebater | venv/lib/python2.7/site-packages/django/db/models/fields/files.py | 34 | 19740 | import datetime
import os
import posixpath
import warnings
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.models import signals
from django.db.models.fiel... | mit |
3dfxmadscientist/CBSS | addons/account_budget/wizard/account_budget_analytic.py | 53 | 2051 | # -*- 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 |
ericzolf/ansible | test/lib/ansible_test/_data/sanity/code-smell/shebang.py | 44 | 4297 | #!/usr/bin/env python
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import re
import stat
import sys
def main():
standard_shebangs = set([
b'#!/bin/bash -eu',
b'#!/bin/bash -eux',
b'#!/bin/sh',
b'#!/usr/bin/env bash',
b'#... | gpl-3.0 |
837468220/python-for-android | python3-alpha/python3-src/Lib/encodings/cp737.py | 272 | 34681 | """ Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict... | apache-2.0 |
fredericlepied/ansible | lib/ansible/modules/windows/win_msg.py | 22 | 3527 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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, eith... | gpl-3.0 |
googlearchive/big-rig | app/src/thirdparty/telemetry/internal/util/classes_unittest.py | 29 | 1308 | # Copyright 2014 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.internal.util import classes
class ClassWithoutInitDefOne: # pylint: disable=old-style-class, no-init
pass
class ClassW... | apache-2.0 |
doduytrung/odoo-8.0 | addons/analytic/analytic.py | 110 | 18041 | # -*- 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 |
william-richard/moto | moto/dynamodb2/exceptions.py | 1 | 5931 | class InvalidIndexNameError(ValueError):
pass
class MockValidationException(ValueError):
def __init__(self, message):
self.exception_msg = message
class InvalidUpdateExpressionInvalidDocumentPath(MockValidationException):
invalid_update_expression_msg = (
"The document path provided in t... | apache-2.0 |
shishaochen/TensorFlow-0.8-Win | third_party/grpc/third_party/protobuf/python/google/protobuf/internal/text_format_test.py | 13 | 46397 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | apache-2.0 |
ShownX/incubator-mxnet | python/mxnet/module/sequential_module.py | 38 | 17331 | # 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 |
gurko-va/p2pool-dash-poiuty | wstools/XMLSchema.py | 289 | 109858 | # Copyright (c) 2003, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory (subject to receipt of
# any required approvals from the U.S. Dept. of Energy). All rights
# reserved.
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is ... | gpl-3.0 |
tuffery/Frog2 | frowns/smiles_parsers/BuildMatcher.py | 2 | 19226 | """
SMARTS Primitives taken from daylight's web site
http://www.daylight.com
SMARTS Atomic primitives
Symbol Symbol name Atomic property Default
requirements
====== =========== ============ =========== ... | gpl-3.0 |
yeming233/horizon | openstack_dashboard/utils/settings.py | 2 | 14525 | # 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
# d... | apache-2.0 |
TRESCLOUD/odoopub | addons/stock_account/wizard/stock_invoice_onshipping.py | 120 | 6111 | # -*- 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 |
blindroot/django | tests/introspection/models.py | 26 | 1794 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class City(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=50)
def __str__(self):
return se... | bsd-3-clause |
AuyaJackie/odoo | addons/mail/res_users.py | 314 | 10337 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
abhinavp13/IITBX-edx-platform-dev | lms/djangoapps/static_template_view/views.py | 15 | 2168 | # View for semi-static templatized content.
#
# List of valid templates is explicitly managed for (short-term)
# security reasons.
from mitxmako.shortcuts import render_to_response, render_to_string
from mako.exceptions import TopLevelLookupException
from django.shortcuts import redirect
from django.conf import settin... | agpl-3.0 |
akazakov/ansible-modules-core | web_infrastructure/htpasswd.py | 11 | 8773 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Nimbis Services, 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
# (... | gpl-3.0 |
tisnik/fabric8-analytics-common | vscode-visual-tests/features/src/gui.py | 1 | 4392 | # vim: set fileencoding=utf-8
"""Common functions for GUI-related tests."""
from PIL import Image
from os import path
from src.litava import locate_on_screen_using_litava
TYPING_INTERVAL = 0.25
DIRECTORY_WITH_REGIONS = "regions"
OUTPUT_DIRECTORY = "."
def perform_move_mouse_cursor(context, x=0, y=0):
"""Move... | apache-2.0 |
Nexedi/neoppod | neo/tests/testNodes.py | 1 | 9767 | #
# Copyright (C) 2009-2019 Nexedi SA
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed... | gpl-2.0 |
ashemedai/ansible | lib/ansible/module_utils/openstack.py | 57 | 4600 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
jeremiedecock/snippets | python/pyqt/pyqt5/widget_QTableView_delegate_on_edit_using_spinbox_widget.py | 1 | 4158 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Ref:
# - http://doc.qt.io/qt-5/modelview.html#3-4-delegates
# - http://doc.qt.io/qt-5/model-view-programming.html#delegate-classes
# - http://doc.qt.io/qt-5/qabstractitemdelegate.html#details
# - http://doc.qt.io/qt-5/qitemdelegate.html#details
# - http://doc.qt.io/qt-5... | mit |
mhugent/Quantum-GIS | python/plugins/processing/algs/gdal/tri.py | 2 | 2766 | # -*- coding: utf-8 -*-
"""
***************************************************************************
tri.py
---------------------
Date : October 2013
Copyright : (C) 2013 by Alexander Bruy
Email : alexander dot bruy at gmail dot com
*********************... | gpl-2.0 |
rahuldan/sympy | sympy/functions/special/tests/test_bessel.py | 36 | 22192 | from itertools import product
from sympy import (jn, yn, symbols, Symbol, sin, cos, pi, S, jn_zeros, besselj,
bessely, besseli, besselk, hankel1, hankel2, hn1, hn2,
expand_func, sqrt, sinh, cosh, diff, series, gamma, hyper,
Abs, I, O, oo, conjugate)
from sympy.f... | bsd-3-clause |
belbio/bel_api | sphinx/source/conf.py | 1 | 6092 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# BEL.bio API documentation build configuration file, created by
# sphinx-quickstart on Mon Dec 11 15:42:18 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
... | apache-2.0 |
gelab/mainr | tests/test_mysqlx_errorcode.py | 3 | 2344 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptions to ... | gpl-2.0 |
wangyum/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/affine_test.py | 6 | 31346 | # 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 |
DeFropi/deluge-extractor | simpleextractor/common.py | 2 | 1624 | #
# common.py
#
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2015 Chris Yereaztian <chris.yereaztian@gmail.com>
#
# Deluge is free software.
#
# You may 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 |
krintoxi/NoobSec-Toolkit | NoobSecToolkit - MAC OSX/tools/sqli/tamper/space2morehash.py | 10 | 2188 | #!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import re
import random
import string
from lib.core.common import singleTimeWarnMessage
from lib.core.data import kb
from lib.core.enums import DBMS
from lib.core.e... | gpl-2.0 |
homme/ansible | lib/ansible/plugins/lookup/together.py | 103 | 1781 | # (c) 2013, Bradley Young <young.bradley@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 later... | gpl-3.0 |
KangDroid/Marlin | buildroot/share/PlatformIO/scripts/lerdge.py | 6 | 1438 | import os,sys
Import("env")
from SCons.Script import DefaultEnvironment
board = DefaultEnvironment().BoardConfig()
custom_ld_script = os.path.abspath("buildroot/share/PlatformIO/ldscripts/lerdge.ld")
for i, flag in enumerate(env["LINKFLAGS"]):
if "-Wl,-T" in flag:
env["LINKFLAGS"][i] = "-Wl,-T" + custom_l... | gpl-3.0 |
hkhamm/django_rest_tutorial_2 | env/lib/python2.7/site-packages/django/contrib/flatpages/tests/test_views.py | 207 | 5659 | import os
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.flatpages.models import FlatPage
from django.test import TestCase
from django.test.utils import override_settings
@override_settings(
LOGIN_URL='/... | mit |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_08_01/models/patch_route_filter.py | 1 | 2686 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
googleads/google-ads-python | google/ads/googleads/v6/services/services/carrier_constant_service/client.py | 1 | 17815 | # -*- coding: utf-8 -*-
# Copyright 2020 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 o... | apache-2.0 |
Britefury/scikit-image | skimage/segmentation/tests/test_random_walker.py | 31 | 11916 | import numpy as np
from skimage.segmentation import random_walker
from skimage.transform import resize
from skimage._shared._warnings import expected_warnings
PYAMG_EXPECTED_WARNING = 'pyamg|\A\Z'
def make_2d_syntheticdata(lx, ly=None):
if ly is None:
ly = lx
np.random.seed(1234)
data = np.zeros(... | bsd-3-clause |
ftomassetti/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/psapi.py | 102 | 13762 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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... | apache-2.0 |
pavels/pootle | pootle/apps/virtualfolder/migrations/0002_set_unit_priorities.py | 2 | 1396 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
def forwards(apps, schema_editor):
Unit = apps.get_model("pootle_store", "Unit")
VirtualFolder = apps.get_model("virtualfolder", "VirtualFolder")
db_alias = schema_editor.connection.alias
# firs... | gpl-3.0 |
chocopoche/mangopay2-python-sdk | tests/test_disputes.py | 1 | 12287 | import base64
import os
import time
import unittest
from mangopay.resources import Dispute, PayIn, DisputeDocument, SettlementTransfer, DisputeDocumentPage
from mangopay.utils import Money
from tests.test_base import BaseTestLive
# Comment following line to run DisputeTest
@unittest.skip('Skip dispute tests because ... | mit |
bazzinotti/mitmproxy | test/tservers.py | 2 | 8549 | import os.path
import threading
import shutil
import tempfile
import flask
import mock
from libmproxy.proxy.config import ProxyConfig
from libmproxy.proxy.server import ProxyServer
import libpathod.test
import libpathod.pathoc
from libmproxy import flow, controller
from libmproxy.cmdline import APP_HOST, APP_PORT
impo... | mit |
kldoc/android_kernel_lge_mako | 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 |
mortada/tensorflow | tensorflow/python/summary/writer/writer_test.py | 28 | 14223 | # 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 |
Endika/django | django/core/cache/backends/filebased.py | 72 | 5429 | "File-based cache backend"
import errno
import glob
import hashlib
import io
import os
import random
import tempfile
import time
import zlib
from django.core.cache.backends.base import DEFAULT_TIMEOUT, BaseCache
from django.core.files.move import file_move_safe
from django.utils.encoding import force_bytes
try:
f... | bsd-3-clause |
louietsai/python-for-android | python3-alpha/extra_modules/atom/service.py | 47 | 28950 | #!/usr/bin/python
#
# Copyright (C) 2006, 2007, 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 app... | apache-2.0 |
janezhango/BigDataMachineLearning | py/testdir_multi_jvm/test_GBM_cancel_model_reuse.py | 2 | 5261 | import unittest, time, sys, random
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd,h2o_hosts, h2o_browse as h2b, h2o_import as h2i, h2o_hosts, h2o_jobs, h2o_gbm
print "reuse the model key that you just cancelled"
DELETE_KEYS = True
# FIX need to get exec workin
DO_CLASSIFICATION = False
class Basic(unittest.Tes... | apache-2.0 |
tiagocardosos/stoq | data/sql/patch-03-24.py | 4 | 1840 | # XXX
# Some tables (like branch) are weak referenced by parameters.
# Changing the id would break the parameter
#: Gets all foreign key references.
#: The ref_table is the referenced table. The other 3 columns are the constraint
#: name, the table that references ref_table, and the column that has the
#: reference to... | gpl-2.0 |
Aalto-LeTech/a-plus | shibboleth_login/auth_backend.py | 1 | 6416 | import logging
import urllib.parse
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.shortcuts import redirect
from .apps import app_settings, env_settings
from .parser import Parser
logger = logging.getLogger('aplus.shibboleth')
class ShibbolethAuthB... | gpl-3.0 |
Komodo/macros | Reflow_tower.py | 1 | 1901 | # This macro is to reorder selected lines, so that the shortest will be
# pushed to top, the longest will go to bottom (look like a tower).
#
# The macro is useful to reorder Python's "import" lines.
#
# Author: Nguyễn Hồng Quân (ng.hong.quan@gmail.com)
import eollib
from xpcom import components
viewSvc = components.... | mpl-2.0 |
BonexGu/Blik2D-SDK | Blik2D/addon/tensorflow-1.2.1_for_blik/tensorflow/contrib/crf/python/ops/crf.py | 26 | 12052 | # 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... | mit |
forbast/trivia | python/trivia.py | 24 | 6285 | #!/usr/bin/env python
class Game:
def __init__(self):
self.players = []
self.places = [0] * 6
self.purses = [0] * 6
self.in_penalty_box = [0] * 6
self.pop_questions = []
self.science_questions = []
self.sports_questions = []
self.rock_questio... | gpl-3.0 |
faegi/mapproxy | mapproxy/test/unit/test_ogr_reader.py | 7 | 1568 | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... | apache-2.0 |
kiyoto/statsmodels | statsmodels/sandbox/panel/mixed.py | 31 | 21019 | """
Mixed effects models
Author: Jonathan Taylor
Author: Josef Perktold
License: BSD-3
Notes
------
It's pretty slow if the model is misspecified, in my first example convergence
in loglike is not reached within 2000 iterations. Added stop criteria based
on convergence of parameters instead.
With correctly specifi... | bsd-3-clause |
381426068/MissionPlanner | Lib/site-packages/scipy/signal/tests/test_ltisys.py | 59 | 7793 |
import warnings
import numpy as np
from numpy.testing import assert_almost_equal, assert_equal, run_module_suite
from scipy.signal.ltisys import ss2tf, lsim2, impulse2, step2, lti
from scipy.signal.filter_design import BadCoefficients
class TestSS2TF:
def tst_matrix_shapes(self, p, q, r):
ss2tf(np.zeros... | gpl-3.0 |
scieloorg/packtools | tests/test_schematron_1_1.py | 2 | 209697 | # coding: utf-8
from __future__ import unicode_literals
import unittest
import io
from lxml import isoschematron, etree
from packtools.catalogs import SCHEMAS
SCH = etree.parse(SCHEMAS['sps-1.1'])
def TestPhase(phase_name, cache):
"""Factory of parsed Schematron phases.
:param phase_name: the phase name
... | bsd-2-clause |
wuguanghai45/snpm | node_modules/node-gyp/gyp/tools/graphviz.py | 2679 | 2878 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Using the JSON dumped by the dump-dependency-json generator,
generate input suitable for graphviz to render a dependency graph of
targets... | mit |
SnappleCap/oh-mainline | vendor/packages/python-openid/openid/test/storetest.py | 77 | 13015 | from openid.association import Association
from openid.cryptutil import randomString
from openid.store.nonce import mkNonce, split
import unittest
import string
import time
import socket
import random
import os
db_host = 'dbtest'
allowed_handle = []
for c in string.printable:
if c not in string.whitespace:
... | agpl-3.0 |
rowemoore/odoo | addons/mass_mailing/models/mass_mailing_report.py | 364 | 2244 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from openerp import tools
class MassMailingReport(osv.Model):
_name = 'mail.statistics.report'
_auto = False
_description = 'Mass Mailing Statistics'
_columns = {
'scheduled_date': fields.datetime('Scheduled Date', readonly=True),
... | agpl-3.0 |
marwoodandrew/superdesk-core | content_api/assets/service.py | 7 | 2490 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014, 2015 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from b... | agpl-3.0 |
benfinkelcbt/CPD200 | CPD200-Lab13-Python/simplejson/tests/test_namedtuple.py | 147 | 4004 | from __future__ import absolute_import
import unittest
import simplejson as json
from simplejson.compat import StringIO
try:
from collections import namedtuple
except ImportError:
class Value(tuple):
def __new__(cls, *args):
return tuple.__new__(cls, args)
def _asdict(self):
... | gpl-3.0 |
vyatta/linux-vyatta | debian/lib/python/debian_linux/gencontrol.py | 6 | 10463 | from config import *
from debian import *
from utils import *
class PackagesList(SortedDict):
def append(self, package):
self[package['Package']] = package
def extend(self, packages):
for package in packages:
self[package['Package']] = package
class MakeFlags(dict):
def __repr... | gpl-2.0 |
parisa1727/Sentiment-Detection-API-Python-Example | mashape/exception/exception_messages.py | 2 | 1405 | #
# Mashape Python Client library.
# Copyright (C) 2011 Mashape, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ve... | agpl-3.0 |
twobob/buildroot-kindle | output/build/host-python-2.7.2/Lib/stringold.py | 293 | 12449 | # module 'string' -- A collection of string operations
# Warning: most of the code you see here isn't normally used nowadays. With
# Python 1.6, many of these functions are implemented as methods on the
# standard string object. They used to be implemented by a built-in module
# called strop, but strop is now obsolet... | gpl-2.0 |
1tush/sentry | src/sentry/migrations/0006_auto.py | 36 | 3873 | # encoding: 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):
pass
def backwards(self, orm):
pass
models = {
'sentry.filtervalue': {
'Meta': {'uniq... | bsd-3-clause |
scs/uclinux | user/python/python-2.4.4/Lib/lib-old/cmp.py | 14 | 1975 | """Efficiently compare files, boolean outcome only (equal / not equal).
Tricks (used in this order):
- Files with identical type, size & mtime are assumed to be clones
- Files with different type or size cannot be identical
- We keep a cache of outcomes of earlier comparisons
- We don't fork a process ... | gpl-2.0 |
fiji-flo/servo | tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/wptmanifest/backends/conditional.py | 20 | 10484 | import operator
from ..node import NodeVisitor, DataNode, ConditionalNode, KeyValueNode, ListNode, ValueNode
from ..parser import parse
class ConditionalValue(object):
def __init__(self, node, condition_func):
self.node = node
self.condition_func = condition_func
if isinstance(node, Condi... | mpl-2.0 |
joelpinheiro/safebox-smartcard-auth | Server/veserver/lib/python2.7/site-packages/cherrypy/lib/gctools.py | 58 | 7362 | import gc
import inspect
import os
import sys
import time
try:
import objgraph
except ImportError:
objgraph = None
import cherrypy
from cherrypy import _cprequest, _cpwsgi
from cherrypy.process.plugins import SimplePlugin
class ReferrerTree(object):
"""An object which gathers all referrers of an object... | gpl-2.0 |
alisheykhi/SocialPDA | graph_util.py | 1 | 8934 | import re,collections,operator
import networkx as nx
from privacy_level import privacy_level_generator
from numpy.random import zipf
from math import ceil
class ReadGraph():
extension = []
G = nx.Graph()
properties = {}
nodes = []
edges = []
privacy_level = []
sorted_degree_sequence = []
... | apache-2.0 |
jmachuca77/ardupilot | libraries/AP_HAL_ChibiOS/hwdef/scripts/convert_uart_order.py | 21 | 1096 | #!/usr/bin/env python
'''
convert UART_ORDER in a hwdef.dat into a SERIAL_ORDER
'''
import sys, shlex
def convert_file(fname):
lines = open(fname, 'r').readlines()
for i in range(len(lines)):
if lines[i].startswith('SERIAL_ORDER'):
print("Already has SERIAL_ORDER: %s" % fname)
... | gpl-3.0 |
iansf/engine | build/android/pylib/remote/device/remote_device_test_run.py | 33 | 12142 | # Copyright 2014 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.
"""Run specific test on specific environment."""
import json
import logging
import os
import sys
import tempfile
import time
import zipfile
from pylib impo... | bsd-3-clause |
danijar/invoicepad | invoicepad/invoicepad/settings.py | 2 | 2323 | """
Django settings for invoicepad project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)... | gpl-3.0 |
ELNOGAL/CMNT_00040_2016_ELN_addons | sales_app/models/table_pricelist_prices.py | 2 | 7615 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015-2018 Coimunitea Servicios Tecnológicos All Rights Reserved
# $Javier Colmenero Fernández$ <javier@comunitea.com>
#
# This program is free software: you can redistribute it and/or modify... | agpl-3.0 |
ppiotr/Invenio | modules/bibcatalog/lib/bibcatalog_system_rt.py | 6 | 17914 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011, 2012 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 ... | gpl-2.0 |
chujieyang/ice | python/test/Ice/slicing/exceptions/run.py | 3 | 1471 | #!/usr/bin/env python
# **********************************************************************
#
# Copyright (c) 2003-2015 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# *************************************... | gpl-2.0 |
MalloyPower/parsing-python | front-end/testsuite-python-lib/Python-2.6/Lib/socket.py | 9 | 17974 | # Wrapper module for _socket, providing some additional facilities
# implemented in Python.
"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available a... | mit |
EvanK/ansible | lib/ansible/modules/network/files/net_put.py | 47 | 2486 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
neske/aurora-p2pool | nattraverso/pynupnp/upnp.py | 283 | 18985 | """
This module is the heart of the upnp support. Device discover, ip discovery
and port mappings are implemented here.
@author: Raphael Slinckx
@author: Anthony Baxter
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
impor... | gpl-3.0 |
ElDeveloper/scikit-learn | doc/sphinxext/numpy_ext/docscrape_sphinx.py | 408 | 8061 | import re
import inspect
import textwrap
import pydoc
from .docscrape import NumpyDocString
from .docscrape import FunctionDoc
from .docscrape import ClassDoc
class SphinxDocString(NumpyDocString):
def __init__(self, docstring, config=None):
config = {} if config is None else config
self.use_plots... | bsd-3-clause |
aringh/odl | odl/solvers/nonsmooth/forward_backward.py | 1 | 6886 | # Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# 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 https://mozilla.org/MPL/2.0/.
"""Optimization methods based on a forward-b... | mpl-2.0 |
jmartu/testing | venv/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py | 327 | 117170 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import with_metaclass, viewkeys, PY3
import types
try:
from collections import OrderedDict
except ImportError:
from pip._vendor.ordereddict import OrderedDict
from . import _inputstream
from . import _tokenizer
from . im... | mit |
postvakje/sympy | sympy/tensor/tensor.py | 12 | 132918 | """
This module defines tensors with abstract index notation.
The abstract index notation has been first formalized by Penrose.
Tensor indices are formal objects, with a tensor type; there is no
notion of index range, it is only possible to assign the dimension,
used to trace the Kronecker delta; the dimension can be... | bsd-3-clause |
Yong-Lee/decode-Django | Django-1.5.1/django/contrib/admin/filters.py | 105 | 16058 | """
This encapsulates the logic for displaying filters in the Django admin.
Filters are specified in models with the "list_filter" option.
Each filter subclass knows how to display a filter for a field that passes a
certain test -- e.g. being a DateField or ForeignKey.
"""
import datetime
from django.db import models... | gpl-2.0 |
happy5214/pywikibot-core | pywikibot/comms/threadedhttp.py | 1 | 5773 | # -*- coding: utf-8 -*-
"""Http backend layer, formerly providing a httplib2 wrapper."""
from __future__ import absolute_import, unicode_literals
# (C) Pywikibot team, 2007-2015
__version__ = '$Id$'
__docformat__ = 'epytext'
# standard python libraries
import codecs
import sys
if sys.version_info[0] > 2:
from ur... | mit |
milafrerichs/geonode | geonode/maps/search_indexes.py | 20 | 4957 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... | gpl-3.0 |
shaunokeefe/hoponit | hoponit/harvest/management/commands/api.py | 1 | 1352 | from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from harvest import untappd
class Command(BaseCommand):
args = '<poll_id poll_id ...>'
help = 'Closes the specified poll for voting'
def handle(self, *args, **options):
cmd = args[0]
u = un... | mit |
andela-ooshodi/codango-debug | codango/resources/tests/test_routes.py | 1 | 3625 | from django.test import Client, TestCase
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from resources.models import Resource
from django.test.utils import setup_test_environment
setup_test_environment()
class CommunityViewTest(TestCase):
def setUp(self):
self.c... | mit |
eckucukoglu/arm-linux-gnueabihf | lib/python2.7/email/errors.py | 468 | 1628 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""email package exception classes."""
class MessageError(Exception):
"""Base class for errors in the email package."""
class MessageParseError(MessageError):
"""Base class for message parsing erro... | gpl-2.0 |
shubhdev/openedx | common/djangoapps/track/migrations/0001_initial.py | 189 | 2527 | # -*- 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 model 'TrackingLog'
db.create_table('track_trackinglog', (
('id', self.gf('django.db.mo... | agpl-3.0 |
arista-eosplus/ansible-modules-extras | system/crypttab.py | 67 | 11330 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Steve <yo@groks.org>
#
# 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
# (a... | gpl-3.0 |
jmighion/ansible | lib/ansible/utils/module_docs_fragments/auth_basic.py | 152 | 1297 | # 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 |
saydulk/django | django/db/migrations/operations/models.py | 290 | 21735 | from __future__ import unicode_literals
from django.db import models
from django.db.migrations.operations.base import Operation
from django.db.migrations.state import ModelState
from django.db.models.options import normalize_together
from django.utils import six
from django.utils.functional import cached_property
cl... | bsd-3-clause |
MDAnalysis/mdanalysis | testsuite/MDAnalysisTests/coordinates/test_xdr.py | 1 | 29773 | # -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8
#
# MDAnalysis --- https://www.mdanalysis.org
# Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors
# (see the file AUTHORS for the full list of names)
#... | gpl-2.0 |
Garrett-R/scikit-learn | examples/bicluster/plot_spectral_biclustering.py | 403 | 2011 | """
=============================================
A demo of the Spectral Biclustering algorithm
=============================================
This example demonstrates how to generate a checkerboard dataset and
bicluster it using the Spectral Biclustering algorithm.
The data is generated with the ``make_checkerboard`... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.