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 |
|---|---|---|---|---|---|
OpenUpgrade-dev/OpenUpgrade | addons/crm_helpdesk/report/__init__.py | 442 | 1083 | # -*- 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 |
OpenSourcePolicyCenter/PolicyBrain | webapp/apps/register/tests.py | 2 | 2406 | from django.test import TestCase
import pytest
from django.test import Client
from django.core.urlresolvers import reverse
from webapp.apps.register.models import Subscriber
# run this with `py.test --pdb -s -m register`
# actually no. `py.test -q webapp/apps/register/tests.py`
@pytest.mark.register
class Register... | mit |
stormi/tsunami | src/secondaires/crafting/fonctions/a_rang.py | 1 | 3868 | # -*-coding:Utf-8 -*
# Copyright (c) 2015 LE GOFF Vincent
# 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
# lis... | bsd-3-clause |
hfp/libxsmm | samples/deeplearning/sparse_training/fairseq/tests/test_binaries.py | 1 | 40028 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import contextlib
from io import StringIO
import logging
import os
import random
import tempfile
import unittest
import torch
from fairseq i... | bsd-3-clause |
jfhumann/servo | tests/wpt/update_css.py | 116 | 1081 | # 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 os
import sys
here = os.path.split(__file__)[0]
def wpt_path(*args):
return os.path.join(here, *args)
# I... | mpl-2.0 |
bkeiren/cef | tools/check_style.py | 3 | 4018 | # Copyright (c) 2012 The Chromium Embedded Framework Authors.
# Portions copyright (c) 2011 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 os, re, string, sys
from file_util import *
import git_util as git
# scrip... | bsd-3-clause |
cbmoore/statsmodels | docs/source/plots/graphics_gofplots_qqplot.py | 38 | 1911 | # -*- coding: utf-8 -*-
"""
Created on Sun May 06 05:32:15 2012
Author: Josef Perktold
editted by: Paul Hobson (2012-08-19)
"""
from scipy import stats
from matplotlib import pyplot as plt
import statsmodels.api as sm
#example from docstring
data = sm.datasets.longley.load()
data.exog = sm.add_constant(data.exog, pre... | bsd-3-clause |
boyuegame/kbengine | kbe/src/lib/python/Lib/distutils/tests/test_bdist_rpm.py | 71 | 4868 | """Tests for distutils.command.bdist_rpm."""
import unittest
import sys
import os
import tempfile
import shutil
from test.support import run_unittest
from distutils.core import Distribution
from distutils.command.bdist_rpm import bdist_rpm
from distutils.tests import support
from distutils.spawn import find_executabl... | lgpl-3.0 |
2013Commons/hue | desktop/core/ext-py/Django-1.4.5/django/db/models/sql/query.py | 53 | 85934 | """
Create SQL statements for QuerySets.
The code in here encapsulates all of the SQL construction so that QuerySets
themselves do not have to (and could be backed by things other than SQL
databases). The abstraction barrier only works one way: this module has to know
all about the internals of models in order to get ... | apache-2.0 |
ptisserand/ansible | lib/ansible/modules/network/nxos/nxos_udld.py | 16 | 7946 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
peterm-itr/edx-platform | cms/djangoapps/contentstore/features/common.py | 4 | 12232 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
import os
from lettuce import world, step
from nose.tools import assert_true, assert_in # pylint: disable=no-name-in-module
from django.conf import settings
from student.roles import CourseStaffRole, CourseInstructorRole, GlobalStaff
from stu... | agpl-3.0 |
pyocd/pyOCD | pyocd/target/builtin/target_MKE15Z256xxx7.py | 3 | 6018 | # pyOCD debugger
# Copyright (c) 2018-2019 Arm Limited
# Copyright (c) 2017 NXP
# Copyright (c) 2016 Freescale Semiconductor, Inc.
# SPDX-License-Identifier: Apache-2.0
#
# 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... | apache-2.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.4/django/views/generic/create_update.py | 87 | 8928 | from django.forms.models import ModelFormMetaclass, ModelForm
from django.template import RequestContext, loader
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.core.xheaders import populate_xheaders
from django.core.exceptions import ObjectDoesNotExist, ImproperlyConfigured
from django.... | bsd-3-clause |
alexallah/django | django/views/generic/edit.py | 24 | 8343 | from django.core.exceptions import ImproperlyConfigured
from django.forms import models as model_forms
from django.http import HttpResponseRedirect
from django.views.generic.base import ContextMixin, TemplateResponseMixin, View
from django.views.generic.detail import (
BaseDetailView, SingleObjectMixin, SingleObjec... | bsd-3-clause |
gbaty/pyside2 | tests/signals/decorators_test.py | 3 | 2225 | #!/usr/bin/env python
import unittest
from PySide2.QtCore import QObject, Slot, SIGNAL, SLOT
class MyObject(QObject):
def __init__(self, parent=None):
QObject.__init__(self, parent)
self._slotCalledCount = 0
@Slot()
def mySlot(self):
self._slotCalledCount = self._slotCalledCount ... | lgpl-2.1 |
ZihengJiang/mxnet | example/autoencoder/model.py | 27 | 2810 | # 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 |
switchboardOp/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 |
ChronoMonochrome/android_external_chromium_org | tools/telemetry/telemetry/core/backends/chrome/misc_web_contents_backend.py | 24 | 1494 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
from telemetry.core import web_contents
from telemetry.core.backends.chrome import inspector_backend
class MiscWebContentsBackend(object):
"""... | bsd-3-clause |
pbrod/numpy | numpy/distutils/fcompiler/absoft.py | 17 | 5499 |
# http://www.absoft.com/literature/osxuserguide.pdf
# http://www.absoft.com/documentation.html
# Notes:
# - when using -g77 then use -DUNDERSCORE_G77 to compile f2py
# generated extension modules (works for f2py v2.45.241_1936 and up)
import os
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler... | bsd-3-clause |
eusi/MissionPlanerHM | Lib/site-packages/scipy/ndimage/_ni_support.py | 62 | 3326 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | gpl-3.0 |
nikesh-mahalka/nova | nova/openstack/common/cliutils.py | 57 | 7940 | # Copyright 2012 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
#
# Unless required by applicable law or agre... | apache-2.0 |
mitocw/edx-platform | openedx/features/enterprise_support/tests/test_logout.py | 3 | 2724 | """
Tests for logout for enterprise flow
"""
import ddt
import mock
from django.test.utils import override_settings
from django.urls import reverse
from openedx.core.djangolib.testing.utils import CacheIsolationTestCase, skip_unless_lms
from openedx.features.enterprise_support.api import enterprise_enabled
from ope... | agpl-3.0 |
smathot/PyGaze | opensesame_plugins/pygaze_drift_correct/pygaze_drift_correct.py | 3 | 3469 | #-*- coding:utf-8 -*-
"""
This file is part of PyGaze.
PyGaze 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.
PyGaze is distributed in the... | gpl-3.0 |
LeonChambers/bwhglass-server | lib/werkzeug/utils.py | 317 | 22676 | # -*- coding: utf-8 -*-
"""
werkzeug.utils
~~~~~~~~~~~~~~
This module implements various utilities for WSGI applications. Most of
them are used by the request and response wrappers but especially for
middleware development it makes sense to use them without the wrappers.
:copyright: (c) 2013 ... | apache-2.0 |
sumedhasingla/VTK | Filters/General/Testing/Python/warplens.py | 20 | 1517 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create the RenderWindow, Renderer and both Actors
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRen... | bsd-3-clause |
vertexproject/synapse | synapse/tests/test_lib_rstorm.py | 1 | 7127 | import os
import synapse.exc as s_exc
import synapse.common as s_common
import synapse.lib.rstorm as s_rstorm
import synapse.tests.utils as s_test
rst_in = '''
HI
##
.. storm-cortex:: default
.. storm-cortex:: default
.. storm-opts:: {"vars": {"foo": 10, "bar": "baz"}}
.. storm-pre:: [ inet:asn=$foo ]
.. storm:: $l... | apache-2.0 |
jmesteve/openerpseda | openerp/tools/which.py | 456 | 6884 | #!/usr/bin/env python
""" Which - locate a command
* adapted from Brian Curtin's http://bugs.python.org/file15381/shutil_which.patch
* see http://bugs.python.org/issue444582
* uses ``PATHEXT`` on Windows
* searches current directory before ``PATH`` on Windows,
but not before an explicitly passed ... | agpl-3.0 |
fangxingli/hue | desktop/core/ext-py/pycparser-2.14/pycparser/yacctab.py | 35 | 129568 |
# yacctab.py
# This file is automatically generated. Do not edit.
_tabversion = '3.2'
_lr_method = 'LALR'
_lr_signature = '\x11\x82\x05\xfb:\x10\xfeo5\xb4\x11N\xe7S\xb4b'
_lr_action_items = {'VOID':([0,1,2,3,5,6,9,10,11,12,13,14,15,17,18,19,21,22,23,25,26,27,29,31,32,33,35,36,37,38,39,40,42,43,44,45,46,48,49,54... | apache-2.0 |
Elandril/Sick-Beard | cherrypy/process/win32.py | 35 | 6047 | """Windows service. Requires pywin32."""
import os
import win32api
import win32con
import win32event
import win32service
import win32serviceutil
from cherrypy.process import wspbus, plugins
class ConsoleCtrlHandler(plugins.SimplePlugin):
"""A WSPBus plugin for handling Win32 console events (like Ct... | gpl-3.0 |
joshgabriel/MPInterfaces | mpinterfaces/calibrate.py | 1 | 60446 | # coding: utf-8
# Copyright (c) Henniggroup.
# Distributed under the terms of the MIT License.
from __future__ import division, print_function, unicode_literals, \
absolute_import
"""
Calibration module:
This module contains the classes for
1. Calibrate: Base class for specifying the parameters for
calibration a... | mit |
tedder/ansible | lib/ansible/modules/web_infrastructure/sophos_utm/utm_proxy_exception.py | 31 | 7499 | #!/usr/bin/python
# Copyright: (c) 2018, Sebastian Schenzel <sebastian.schenzel@mailbox.org>
# 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':... | gpl-3.0 |
Pexego/odoo | openerp/tools/amount_to_text_en.py | 441 | 5103 | # -*- 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... | agpl-3.0 |
cloudbase/cinder | cinder/tests/unit/volume/drivers/emc/scaleio/test_consistencygroups.py | 6 | 10098 | # Copyright (c) 2013 - 2016 EMC Corporation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | apache-2.0 |
zsiki/ulyxes | pyapi/tcpiface.py | 1 | 4981 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
.. module:: tcpiface.py
:platform: Unix, Windows
:synopsis: Ulyxes - an open source project to drive total stations and
publish observation results. GPL v2.0 license Copyright (C)
2010- Zoltan Siki <siki.zoltan@epito.bme.hu>.
.. moduleauthor:: Bence... | gpl-2.0 |
akosel/servo | components/script/dom/bindings/codegen/parser/tests/test_incomplete_types.py | 276 | 1731 | import WebIDL
def WebIDLTest(parser, harness):
parser.parse("""
interface TestIncompleteTypes {
attribute FooInterface attr1;
FooInterface method1(FooInterface arg);
};
interface FooInterface {
};
""")
results = parser.finish()
harness.ok(True, "T... | mpl-2.0 |
nave91/dbt | dbt/compilation.py | 1 | 7958 | import itertools
import os
import json
from collections import OrderedDict, defaultdict
import sqlparse
import dbt.project
import dbt.utils
import dbt.include
import dbt.tracking
from dbt.utils import get_materialization, NodeType, is_type
from dbt.linker import Linker
import dbt.compat
import dbt.context.runtime
i... | apache-2.0 |
matehall/Python-koan | python 3/koans/about_dice_project.py | 14 | 1958 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
import random
class DiceSet:
def __init__(self):
self._values = None
@property
def values(self):
return self._values
def roll(self, n):
# Needs implementing!
# Tip: random.r... | mit |
rudhir-upretee/Sumo_With_Netsim | docs/tutorial/city_mobil/statistics.py | 6 | 4395 | #!/usr/bin/env python
"""
@file statistics.py
@author Michael Behrisch
@author Daniel Krajzewicz
@date 2008-10-17
@version $Id: statistics.py 12898 2012-10-26 08:58:14Z behrisch $
Collecting statistics for the CityMobil parking lot
SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
Copyright... | gpl-3.0 |
edx/lettuce | tests/integration/lib/Django-1.3/django/core/management/sql.py | 229 | 8259 | import os
import re
from django.conf import settings
from django.core.management.base import CommandError
from django.db import models
from django.db.models import get_models
def sql_create(app, style, connection):
"Returns a list of the CREATE TABLE SQL statements for the given app."
if connection.settings_... | gpl-3.0 |
pgmillon/ansible | lib/ansible/plugins/terminal/enos.py | 101 | 2824 | # (C) 2017 Red Hat Inc.
# Copyright (C) 2017 Lenovo.
#
# GNU General Public License v3.0+
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for ... | gpl-3.0 |
lyapun/django-lean-42cc | django_lean/lean_analytics/tests.py | 4 | 15078 | from __future__ import with_statement
from contextlib import contextmanager
from django.conf import settings
from django.contrib.auth.models import AnonymousUser, User
from django.http import HttpRequest
from django_lean.experiments.models import (AnonymousVisitor, Experiment,
... | bsd-3-clause |
frozstone/concept | utilities/HeurDep.py | 1 | 5042 | from os import listdir, path
from lxml import etree, objectify
from pickle import load
from sys import argv
from StringIO import StringIO
from collections import OrderedDict
import time
from utilities.norm_arxiv import norm_arxiv
from utilities.norm_attribute import norm_attribute
from utilities.norm_mrow ... | mit |
vadimtk/chrome4sdp | tools/telemetry/third_party/gsutilz/third_party/boto/boto/support/exceptions.py | 151 | 1715 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 without restriction, including
# without limitation the rights ... | bsd-3-clause |
4022321818/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/xml/sax/saxutils.py | 730 | 11688 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
import io
from . import handler
from . import xmlreader
def __dict_replace(s, d):
"""Replace substrings of a string using a dictionary."""
for key, val... | agpl-3.0 |
vaquer/ckanext-dkan | ckanext/dkan/harvesters/dkanharvester.py | 1 | 31034 | import json
import urllib
import urllib2
import httplib
import datetime
import socket
import datetime
# from ckanext.harvest.harvesters.ckanharvester import CKANHarvester
from ckanext.harvest.harvesters.base import HarvesterBase
from ckanext.harvest.model import HarvestObject
from ckan.logic import ValidationError, No... | agpl-3.0 |
TeamExodus/external_chromium_org | third_party/cython/src/Cython/Debugger/Tests/test_libpython_in_gdb.py | 110 | 3979 | # -*- coding: UTF-8 -*-
"""
Test libpython.py. This is already partly tested by test_libcython_in_gdb and
Lib/test/test_gdb.py in the Python source. These tests are run in gdb and
called from test_libcython_in_gdb.main()
"""
import os
import sys
import gdb
from Cython.Debugger import libcython
from Cython.Debugger ... | bsd-3-clause |
a-y-u-s-h/QuarkWebsite2017 | quark/lib/python2.7/site-packages/pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | apache-2.0 |
cs243iitg/vehicle-webapp | webapp/vms/views.py | 1 | 12301 | from django.shortcuts import render, render_to_response
from django.http import HttpResponse, HttpResponseRedirect
from django.views import generic
from django.core.context_processors import csrf
from django.views.decorators.csrf import csrf_protect
from django.contrib import auth
from django.contrib import messages
fr... | mit |
jambonrose/DjangoUnleashed-1.8 | blog/migrations/0002_post_data.py | 1 | 4440 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import date
from django.db import migrations, models
POSTS = [
{
"title": "Django 1.0 Release",
"slug": "django-10-released",
"pub_date": date(2008, 9, 3),
"startups": [],
"tags": ["django", "pyt... | bsd-2-clause |
karstenw/nodebox-pyobjc | examples/Extended Application/matplotlib/examples/event_handling/zoom_window.py | 1 | 2014 | """
===========
Zoom Window
===========
This example shows how to connect events in one window, for example, a mouse
press, to another figure window.
If you click on a point in the first window, the z and y limits of the
second will be adjusted so that the center of the zoom in the second
window will be the x,y coord... | mit |
Perferom/android_external_chromium_org | chrome/test/pyautolib/remote_host.py | 80 | 3108 | #!/usr/bin/env python
# Copyright (c) 2011 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 cStringIO
import os
import pickle
import socket
import sys
import pyauto
class RemoteHost(object):
"""Class used as a ho... | bsd-3-clause |
HybridF5/jacket | jacket/storage/keymgr/conf_key_mgr.py | 1 | 4888 | # 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 |
botherder/volatility | volatility/plugins/overlays/windows/win2003_sp2_x64_vtypes.py | 58 | 337862 | ntkrnlmp_types = {
'LIST_ENTRY64' : [ 0x10, {
'Flink' : [ 0x0, ['unsigned long long']],
'Blink' : [ 0x8, ['unsigned long long']],
} ],
'LIST_ENTRY32' : [ 0x8, {
'Flink' : [ 0x0, ['unsigned long']],
'Blink' : [ 0x4, ['unsigned long']],
} ],
'__unnamed_1015' : [ 0x8, {
'LowPart' : [ 0x0, ['unsig... | gpl-2.0 |
mancoast/CPythonPyc_test | cpython/263_test_nis.py | 58 | 1317 | from test import test_support
import unittest
import nis
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
except nis.error, msg:
# NIS is probably not active, so this test isn't useful
if test_support.verbose:
print "... | gpl-3.0 |
numo16/wesnoth | data/tools/terrain2wiki.py | 25 | 3386 | #!/usr/bin/python
# -*- coding:utf-8 -*-
"""
A script to create the "Terrain Table" on the TerrainCodeTableWML wiki page.
Add the output to the wiki whenever a new terrain is added to mainline.
"""
from __future__ import with_statement # For python < 2.6
import os
import sys
import re
try:
import argparse
excep... | gpl-2.0 |
talele08/appengine-mapreduce | python/src/mapreduce/property_range.py | 48 | 12527 | #!/usr/bin/env python
"""A class representing entity property range."""
# pylint: disable=g-bad-name
# pylint: disable=g-import-not-at-top
import datetime
from google.appengine.ext import ndb
from google.appengine.ext import db
from mapreduce import errors
from mapreduce import util
__all__ = [
"should_shard... | apache-2.0 |
telerik/cloudbase-init | cloudbaseinit/tests/plugins/windows/userdataplugins/test_urldownload.py | 1 | 2120 | # Copyright 2013 Mirantis Inc.
# Copyright 2014 Cloudbase Solutions Srl
#
# 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 |
thepiper/standoff | venv/lib/python2.7/site-packages/werkzeug/contrib/profiler.py | 362 | 5151 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.profiler
~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides a simple WSGI profiler middleware for finding
bottlenecks in web application. It uses the :mod:`profile` or
:mod:`cProfile` module to do the profiling and writes the stats to the
stream provide... | gpl-3.0 |
bcb/qutebrowser | tests/unit/misc/test_split.py | 1 | 6937 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
repotvsupertuga/tvsupertuga.repository | instal/script.module.resolveurl/lib/resolveurl/plugins/prostream.py | 2 | 1310 | """
Plugin for ResolveUrl
Copyright (C) 2020 gujal
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 of the License, or
(at your option) any later version.
This program is distributed... | gpl-2.0 |
ppwwyyxx/tensorflow | tensorflow/lite/testing/op_tests/unpack.py | 3 | 2091 | # Copyright 2019 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 |
google-code-export/tvstreamrecord | cherrypy/scaffold/__init__.py | 80 | 1859 | """<MyProject>, a CherryPy application.
Use this as a base for creating new CherryPy applications. When you want
to make a new app, copy and paste this folder to some other location
(maybe site-packages) and rename it to the name of your project,
then tweak as desired.
Even before any tweaking, this should serve a fe... | gpl-3.0 |
tboyce021/home-assistant | homeassistant/components/mcp23017/switch.py | 8 | 2770 | """Support for switch sensor using I2C MCP23017 chip."""
from adafruit_mcp230xx.mcp23017 import MCP23017 # pylint: disable=import-error
import board # pylint: disable=import-error
import busio # pylint: disable=import-error
import digitalio # pylint: disable=import-error
import voluptuous as vol
from homeassistant... | apache-2.0 |
cryptica/slapnet | benchmarks/scalable/LeaderElectionCR79/make_net.py | 1 | 2184 | #!/usr/bin/python3
import sys
import random
def make_net(n,order):
def previous(i):
return (((i-2) % n) + 1)
print('petri net "leader election %i" {' % n)
print(' places {')
for i in range(1,n+1):
print(' ', end='')
for j in range(1,n+1):
print('s%in%i ' % (i,j)... | gpl-3.0 |
Distrotech/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/db/models/manager.py | 505 | 3578 | from django.db.models.manager import Manager
from django.contrib.gis.db.models.query import GeoQuerySet
class GeoManager(Manager):
"Overrides Manager to return Geographic QuerySets."
# This manager should be used for queries on related fields
# so that geometry columns on Oracle and MySQL are selected
... | apache-2.0 |
xinwu/horizon | openstack_dashboard/dashboards/project/networks/views.py | 43 | 5560 | # Copyright 2012 NEC 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
#
# Unless required by applicable law or ag... | apache-2.0 |
kmackenzieii/marauders-map | capture/make_fingerprint.py | 1 | 1582 | import re
import os
import kirk
import numpy as n
import pickle
def trimmean(arr, percent):
n = len(arr)
k = int(round(n*(float(percent)/100)/2))
return n.mean(arr[k+1:n-k])
File = kirk.File
width = kirk.width
height = kirk.height
box_size = kirk.box_size
#Dictionary data structure to hold out parsed data... | mit |
cwu2011/seaborn | seaborn/timeseries.py | 6 | 13239 | """Timeseries plotting functions."""
from __future__ import division
import numpy as np
import pandas as pd
from scipy import stats, interpolate
import matplotlib as mpl
import matplotlib.pyplot as plt
from .external.six import string_types
from . import utils
from . import algorithms as algo
from .palettes import c... | bsd-3-clause |
dllsf/odootest | addons/l10n_be_invoice_bba/invoice.py | 11 | 12783 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
#
# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved.
#
# This program is free software: you can redistribute it and/or modify
# i... | agpl-3.0 |
WillieMaddox/numpy | numpy/linalg/tests/test_regression.py | 78 | 3097 | """ Test functions for linalg module
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy import linalg, arange, float64, array, dot, transpose
from numpy.testing import (
TestCase, run_module_suite, assert_equal, assert_array_equal,
assert_array_almost_equal, asse... | bsd-3-clause |
pcostell/apitools | apitools/base/py/exceptions.py | 8 | 4111 | #!/usr/bin/env python
#
# Copyright 2015 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 o... | apache-2.0 |
akretion/odoo | addons/stock/tests/common.py | 15 | 5095 | # -*- coding: utf-8 -*-
from odoo.tests import common
class TestStockCommon(common.TransactionCase):
def setUp(self):
super(TestStockCommon, self).setUp()
self.ProductObj = self.env['product.product']
self.UomObj = self.env['uom.uom']
self.PartnerObj = self.env['res.partner']
... | agpl-3.0 |
boundary/boundary-plugin-aws-elb | boundary_aws_plugin/cloudwatch_plugin.py | 8 | 4606 | from __future__ import (absolute_import, division, print_function, unicode_literals)
import logging
import datetime
import time
from . import boundary_plugin
from . import status_store
"""
If getting statistics from CloudWatch fails, we will retry up to this number of times before
giving up and aborting the plugin. ... | apache-2.0 |
ryfeus/lambda-packs | Tensorflow/source/tensorflow/python/keras/wrappers/scikit_learn/__init__.py | 73 | 1062 | # 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 |
Lonchadepavo/EstacionCisma | tools/expand_filedir_paths.py | 166 | 3839 | #!/usr/bin/env python
import re, os, sys, fnmatch
# Regex pattern to extract the directory path in a #define FILE_DIR
filedir_pattern = re.compile(r'^#define\s*FILE_DIR\s*"(.*?)"')
# Regex pattern to extract any single quoted piece of text. This can also
# match single quoted strings inside of double quote... | gpl-3.0 |
fishscene/streamlink | src/streamlink/plugins/ustreamtv.py | 3 | 20932 | import re
from collections import namedtuple
from functools import partial
from random import randint
from time import sleep
from streamlink.compat import urlparse, urljoin, range
from streamlink.exceptions import StreamError, PluginError, NoStreamsError
from streamlink.plugin import Plugin, PluginOptions
from stream... | bsd-2-clause |
khara914/cf-phpbuildpack | lib/build_pack_utils/downloads.py | 15 | 4096 | import os
import urllib2
import re
import logging
from subprocess import Popen
from subprocess import PIPE
class Downloader(object):
def __init__(self, config):
self._ctx = config
self._log = logging.getLogger('downloads')
self._init_proxy()
def _init_proxy(self):
handlers = ... | apache-2.0 |
SelenaProject/selena | app/core/modules/weather/weather.py | 1 | 5028 | # !/usr/bin/env python3
import threading
import time
import urllib.request
import json
from .. import modulebase
weather_check_interval = 60 # check every minute
city = 'Kanata,ON'
cur_weather_url = ('http://api.openweathermap.org/data/2.5/weather?q=%s&units=metric') % (city)
forecast_url = ('http://api.openweath... | apache-2.0 |
sunsrising/xnhb | contrib/devtools/fix-copyright-headers.py | 80 | 1348 | #!/usr/bin/env python
'''
Run this script to update all the copyright headers of files
that were changed this year.
For example:
// Copyright (c) 2009-2012 The Bitcoin Core developers
it will change it to
// Copyright (c) 2009-2015 The Bitcoin Core developers
'''
import os
import time
import re
year = time.gmtime(... | mit |
malexzx/grpc | examples/python/multiplex/helloworld_pb2.py | 29 | 6763 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: helloworld.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _re... | bsd-3-clause |
sve-odoo/odoo | addons/website_sale/models/sale_order.py | 26 | 10438 | # -*- coding: utf-8 -*-
import random
from openerp import SUPERUSER_ID
from openerp.osv import osv, orm, fields
from openerp.addons.web.http import request
class payment_transaction(orm.Model):
_inherit = 'payment.transaction'
_columns = {
# link with the sale order
'sale_order_id': fields.m... | agpl-3.0 |
saurabh6790/omnitech-libs | core/doctype/custom_script/custom_script.py | 34 | 1208 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d, dl
def autoname(self):
self.doc.name = self.doc.... | mit |
BenSto/pybikes | pybikes/bysykkel.py | 4 | 1909 | # -*- coding: utf-8 -*-
import json
from .base import BikeShareSystem, BikeShareStation
from . import utils
class BySykkel(BikeShareSystem):
authed = True
meta = {
'system': 'BySykkel',
'company': ['Urban Infrastructure Partner']
}
def __init__(self, tag, meta, feed_url, feed_detai... | lgpl-3.0 |
yourcelf/btb | scanblog/profiles/models.py | 1 | 18215 | import os
import datetime
import itertools
import string
from django.db import models
from django.db.models import Q
from django.contrib.auth.models import User, Group
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.core.urlresolvers import reverse
from django.utils.trans... | agpl-3.0 |
astropy/astropy | astropy/io/ascii/tests/test_html.py | 7 | 22379 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This module tests some of the methods related to the ``HTML``
reader/writer and aims to document its functionality.
Requires `BeautifulSoup <http://www.crummy.com/software/BeautifulSoup/>`_
to be installed.
"""
from io impor... | bsd-3-clause |
idxos/python-clblob | clblob/event.py | 3 | 8978 | # Copyright 2013 craigslist
#
# 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 |
kans/birgo | deps/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/wire_format_test.py | 571 | 10848 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | apache-2.0 |
tempbottle/kbengine | kbe/res/scripts/common/Lib/test/test_urllib2net.py | 60 | 12676 | import unittest
from test import support
from test.test_urllib2 import sanepathname2url
import os
import socket
import urllib.error
import urllib.request
import sys
try:
import ssl
except ImportError:
ssl = None
support.requires("network")
TIMEOUT = 60 # seconds
def _retry_thrice(func, exc, *args, **kwarg... | lgpl-3.0 |
ssaavedra/liquidhaskell | tests/regrtest.py | 8 | 6362 | #!/usr/bin/python
# Copyright (c) 2009 The Regents of the University of California. All rights reserved.
#
# Permission is hereby granted, without written agreement and without
# license or royalty fees, to use, copy, modify, and distribute this
# software and its documentation for any purpose, provided that the
# abov... | bsd-3-clause |
revmischa/boto | boto/s3/__init__.py | 114 | 2836 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# Copyright (c) 2014, Steven Richards <sbrichards@mit.edu>
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation fi... | mit |
girving/tensorflow | tensorflow/python/framework/graph_io.py | 6 | 2539 | # 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 |
zak-k/cis | cis/test/plot_tests/idiff.py | 3 | 2350 | #!/usr/bin/env python
# (C) British Crown Copyright 2010 - 2014, Met Office
#
# This file was heavily influenced by a similar file in the iris package.
"""
Provides "diff-like" comparison of images.
Currently relies on matplotlib for image processing so limited to PNG format.
"""
from __future__ import (absolute_imp... | gpl-3.0 |
macndesign/lettuce_webdriver | lettuce_webdriver/screenshot.py | 4 | 2043 | """Steps and utility functions for taking screenshots."""
import uuid
from lettuce import (
after,
step,
world,
)
import os.path
import json
def set_save_directory(base, source):
"""Sets the root save directory for saving screenshots.
Screenshots will be saved in subdirectories under this di... | mit |
rohitwaghchaure/erpnext-receipher | erpnext/patches/v5_0/update_item_and_description_again.py | 102 | 1661 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.utils import cstr
import re
def execute():
item_details = frappe._dict()
for d in frappe.db.sql("select name, description from `tabItem`", as_dict=1):
descriptio... | agpl-3.0 |
homeworkprod/byceps | byceps/services/ticketing/models/ticket_event.py | 1 | 1337 | """
byceps.services.ticketing.models.ticket_event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2019 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from datetime import datetime
from typing import Any, Dict
from ....database import db, generate_uuid
from ....util.instances... | bsd-3-clause |
sinkuri256/python-for-android | python3-alpha/python3-src/Lib/distutils/tests/test_install_lib.py | 47 | 3460 | """Tests for distutils.command.install_data."""
import sys
import os
import unittest
from distutils.command.install_lib import install_lib
from distutils.extension import Extension
from distutils.tests import support
from distutils.errors import DistutilsOptionError
from test.support import run_unittest
class Install... | apache-2.0 |
jalavik/invenio | invenio/legacy/bibingest/ingestion_package_interface.py | 13 | 17273 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License,... | gpl-2.0 |
iambibhas/django | django/core/mail/backends/filebased.py | 35 | 2765 | """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... | bsd-3-clause |
jfhumann/servo | tests/wpt/css-tests/tools/wptserve/tests/functional/test_server.py | 299 | 1320 | import os
import unittest
import urllib2
import json
import wptserve
from base import TestUsingServer, doc_root
class TestFileHandler(TestUsingServer):
def test_not_handled(self):
with self.assertRaises(urllib2.HTTPError) as cm:
resp = self.request("/not_existing")
self.assertEquals(c... | mpl-2.0 |
fossoult/odoo | addons/portal/mail_mail.py | 320 | 2625 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.