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 |
|---|---|---|---|---|---|
skritchz/android_kernel_motorola_surnia | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
SOKP/external_chromium_org | tools/telemetry/telemetry/core/platform/profiler/netlog_profiler.py | 48 | 1557 | # 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 tempfile
from telemetry.core.platform import profiler
class NetLogProfiler(profiler.Profiler):
_NET_LOG_ARG = '--log-net-log='
@classmethod
... | bsd-3-clause |
shahar-stratoscale/nova | doc/source/conf.py | 1 | 9654 | # -*- coding: utf-8 -*-
#
# nova documentation build configuration file, created by
# sphinx-quickstart on Sat May 1 15:17:47 2010.
#
# 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
# autogenerated file.
#
# All ... | apache-2.0 |
GongYiLiao/Python_Daily | 2013/Dec/29/test_pyopencl.py | 1 | 1540 | """ ============================================================================
File name:
test_pyopencl.py
Author:
gong-yi@GongTop0
Created on:
2013/12/29 20:45:43
Purpose:
To show
Copyright:
BSD / Apache
------------------... | mit |
jbfuzier/dionaea | modules/python/scripts/tftp.py | 11 | 42174 | #********************************************************************************
#* Dionaea
#* - catches bugs -
#*
#*
#*
#* Copyright (C) 2009 Paul Baecher & Markus Koetter
#* Copyright (c) 2006-2009 Michael P. Soulier
#*
#* This program is free software; you c... | gpl-2.0 |
nicoboss/Floatmotion | OpenGL/raw/GL/VERSION/GL_1_2.py | 9 | 3758 | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | agpl-3.0 |
Theer108/invenio | invenio/modules/textminer/testsuite/test_textminer_references_api.py | 19 | 1302 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2010, 2011, 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your optio... | gpl-2.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.4/tests/regressiontests/comment_tests/tests/comment_form_tests.py | 97 | 3007 | from __future__ import absolute_import
import time
from django.conf import settings
from django.contrib.comments.forms import CommentForm
from django.contrib.comments.models import Comment
from . import CommentTestCase
from ..models import Article
class CommentFormTests(CommentTestCase):
def testInit(self):
... | bsd-3-clause |
sserrot/champion_relationships | venv/Lib/site-packages/parso/cache.py | 2 | 8668 | import time
import os
import sys
import hashlib
import gc
import shutil
import platform
import errno
import logging
import warnings
try:
import cPickle as pickle
except:
import pickle
from parso._compatibility import FileNotFoundError, PermissionError, scandir
from parso.file_io import FileIO
LOG = logging.g... | mit |
molobrakos/home-assistant | homeassistant/components/deconz/climate.py | 5 | 3402 | """Support for deCONZ climate devices."""
from homeassistant.components.climate import ClimateDevice
from homeassistant.components.climate.const import (
SUPPORT_ON_OFF, SUPPORT_TARGET_TEMPERATURE)
from homeassistant.const import (
ATTR_BATTERY_LEVEL, ATTR_TEMPERATURE, TEMP_CELSIUS)
from homeassistant.core impo... | apache-2.0 |
Jeff-Tian/mybnb | Python27/Lib/site-packages/setuptools/site-patch.py | 720 | 2389 | def __boot():
import sys
import os
PYTHONPATH = os.environ.get('PYTHONPATH')
if PYTHONPATH is None or (sys.platform=='win32' and not PYTHONPATH):
PYTHONPATH = []
else:
PYTHONPATH = PYTHONPATH.split(os.pathsep)
pic = getattr(sys,'path_importer_cache',{})
stdpath = sys.path[le... | apache-2.0 |
overtherain/scriptfile | software/googleAppEngine/lib/django_1_3/django/contrib/admindocs/urls.py | 336 | 1089 | from django.conf.urls.defaults import *
from django.contrib.admindocs import views
urlpatterns = patterns('',
url('^$',
views.doc_index,
name='django-admindocs-docroot'
),
url('^bookmarklets/$',
views.bookmarklets,
name='django-admindocs-bookmarklets'
),
url('^tags/$... | mit |
PerceptumNL/ReadMore | readmore/content/migrations/0002_auto__chg_field_category_image.py | 1 | 4637 | # -*- 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 M2M table for field categories on 'Article'
m2m_table_name = db.... | agpl-3.0 |
LandRegistry/casework-frontend-alpha | migrations/versions/4a0b77571480_.py | 1 | 1499 | """empty message
Revision ID: 4a0b77571480
Revises: None
Create Date: 2014-07-28 14:50:21.815680
"""
# revision identifiers, used by Alembic.
revision = '4a0b77571480'
down_revision = None
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - please adjust! ###... | mit |
stackforge/senlin | senlin/tests/unit/profiles/test_nova_server.py | 1 | 82391 | # 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
# distributed unde... | apache-2.0 |
nigelsmall/jsonstream | test/util/ordereddict.py | 8 | 4093 | # Copyright (c) 2009 Raymond Hettinger
#
# 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 to use, copy, modify, merge,
# publish,... | apache-2.0 |
MSEMJEJME/Get-Dumped | renpy/display/screen.py | 1 | 16961 | # Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
#
# 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 to use, copy, modify, m... | gpl-2.0 |
tkruse/jhbuild | jhbuild/commands/goalreport.py | 5 | 28063 | # jhbuild - a build script for GNOME 2.x
# Copyright (C) 2009 Frederic Peters
#
# goalreport.py: report GNOME modules status wrt various goals
#
# 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... | gpl-2.0 |
ic-labs/django-icekit | icekit/plugins/page_anchor/tests.py | 1 | 2333 | from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.contrib.auth import get_user_model
from django_dynamic_fixture import G
from django_webtest import WebTest
from icekit.models import Layout
from icekit.page_types.layout_page.models import LayoutPage
fro... | mit |
goldsborough/.emacs | .emacs.d/.python-environments/default/lib/python3.5/site-packages/setuptools/sandbox.py | 109 | 14210 | import os
import sys
import tempfile
import operator
import functools
import itertools
import re
import contextlib
import pickle
from setuptools.extern import six
from setuptools.extern.six.moves import builtins, map
import pkg_resources
if sys.platform.startswith('java'):
import org.python.modules.posix.PosixMo... | mit |
XiaosongWei/chromium-crosswalk | tools/telemetry/telemetry/internal/browser/browser_credentials.py | 9 | 5610 | # 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.
import json
import logging
import os
from telemetry.core import util
from telemetry.internal.backends import codepen_credentials_backend
from telemetry.inte... | bsd-3-clause |
GaZ3ll3/scikit-image | doc/release/contribs.py | 24 | 1448 | #!/usr/bin/env python
import subprocess
import sys
import string
import shlex
if len(sys.argv) != 2:
print("Usage: ./contributors.py tag-of-previous-release")
sys.exit(-1)
tag = sys.argv[1]
def call(cmd):
return subprocess.check_output(shlex.split(cmd), universal_newlines=True).split('\n')
tag_date = ca... | bsd-3-clause |
sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/pandas/core/series.py | 1 | 89595 | """
Data structure for 1-dimensional cross-sectional and time series data
"""
from __future__ import division
# pylint: disable=E1101,E1103
# pylint: disable=W0703,W0622,W0613,W0201
import types
import warnings
from numpy import nan, ndarray
import numpy as np
import numpy.ma as ma
from pandas.core.common import (i... | mit |
muchbeli/bitcoin-abe | Abe/Chain/Bitcoin.py | 29 | 1035 | # Copyright(C) 2014 by Abe developers.
# 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 version.
#
# This program is dist... | agpl-3.0 |
inetCatapult/troposphere | examples/DynamoDB_Table_With_GSI_And_NonKeyAttributes_Projection.py | 22 | 4390 | #!/usr/bin/python
from troposphere import Template, Ref, Output, Parameter
from troposphere.dynamodb import (Key, AttributeDefinition,
ProvisionedThroughput, Projection)
from troposphere.dynamodb import Table, GlobalSecondaryIndex
template = Template()
template.add_description("Crea... | bsd-2-clause |
ChameleonCloud/horizon | openstack_dashboard/dashboards/admin/group_types/tables.py | 2 | 4390 | # 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
# distributed under t... | apache-2.0 |
jpetto/olympia | src/olympia/stats/management/commands/update_theme_popularity_movers.py | 7 | 3459 | import datetime
from django.core.management.base import BaseCommand
from django.db import connection
import commonware.log
from olympia.stats.models import (
ThemeUpdateCount, ThemeUpdateCountBulk, ThemeUserCount)
log = commonware.log.getLogger('adi.themepopularitymovers')
class Command(BaseCommand):
"""... | bsd-3-clause |
chebee7i/palettable | palettable/cubehelix/test/test_cubehelix.py | 3 | 3964 | # coding: utf-8
try:
import pytest
except ImportError:
raise ImportError('Tests require pytest >= 2.2.')
from ... import cubehelix
HAVE_NPY = cubehelix.cubehelix.HAVE_NPY
def test_print_maps(capsys):
# just make sure there are no errors
cubehelix.print_maps()
out, err = capsys.readouterr()
... | mit |
raymondnijssen/QGIS | python/plugins/processing/gui/CheckboxesPanel.py | 13 | 3950 | # -*- coding: utf-8 -*-
"""
***************************************************************************
CheckBoxesPanel.py
---------------------
Date : January 2015
Copyright : (C) 2015 by Arnaud Morvan
Email : arnaud dot morvan at camptocamp dot com
Co... | gpl-2.0 |
DaveA50/lbry | lbrynet/reflector/server/server.py | 1 | 5842 | import logging
from twisted.python import failure
from twisted.internet import error, defer
from twisted.internet.protocol import Protocol, ServerFactory
import json
from lbrynet.core.utils import is_valid_blobhash
log = logging.getLogger(__name__)
class ReflectorServer(Protocol):
def connectionMade(self):
... | mit |
LIAMF-USP/word2vec-TF | src/basic_experiment/experiments5_to_8.py | 1 | 2985 | """
EXPERIMENT 5, 6, 7, & 8
Experiment with the models gensim, and the official tensorflow implementation
with different window sizes.
We use both a corpus in portuguese as a corpus in english
with and without preprocessing.
"""
import os
from train_functions import train_both_models_with_different_window_sizes
impor... | mit |
MinFu/youtube-dl | test/test_aes.py | 124 | 2032 | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from youtube_dl.aes import aes_decrypt, aes_encrypt, aes_cbc_decrypt, aes_decrypt_text
from youtube_dl.utils impo... | unlicense |
mkl-/scioncc | src/pyon/datastore/test/test_id_factory.py | 4 | 1063 | from pyon.util.int_test import IonIntegrationTestCase
from pyon.datastore.id_factory import IDFactory, SaltedTimeIDFactory
from nose.plugins.attrib import attr
@attr('UNIT', group='datastore')
class GeneratorTest(IonIntegrationTestCase):
def test_length(self):
subject = SaltedTimeIDFactory()
id = ... | bsd-2-clause |
BBVA/chaos-monkey-engine | test/unit/chaosmonkey/api/plans_blueprint_test.py | 1 | 2367 | from datetime import datetime, timedelta
from flask import url_for, json
from chaosmonkey.api.hal import Document
import test.attacks.attack1 as attack1_module
import test.planners.planner1 as planner1_module
valid_request_body = {
"name": "Test Planner",
"attack": {
"ref": "test.attacks.attack1:Attack... | apache-2.0 |
Galexrt/zulip | zerver/webhooks/taiga/view.py | 2 | 13294 | """Taiga integration for Zulip.
Tips for notification output:
*Emojis*: most of the events have specific emojis e.g.
- :notebook: - change of subject/name/description
- :chart_with_upwards_trend: - change of status
etc. If no there's no meaningful emoji for certain event, the defaults are used:
- :thought_balloon: - ... | apache-2.0 |
asimshankar/tensorflow | tensorflow/contrib/learn/python/learn/preprocessing/tests/categorical_test.py | 137 | 2219 | # encoding: utf-8
# 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 r... | apache-2.0 |
bgxavier/neutron | neutron/api/v2/router.py | 8 | 5082 | # Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
Debian/dput-ng | dput/hooks/distro_info_checks.py | 1 | 6966 | # -*- coding: utf-8 -*-
# vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
# Copyright (c) 2013 dput authors
#
# 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... | gpl-2.0 |
mrb/letsencrypt | letsencrypt/tests/colored_logging_test.py | 23 | 1197 | """Tests for letsencrypt.colored_logging."""
import logging
import StringIO
import unittest
from letsencrypt import le_util
class StreamHandlerTest(unittest.TestCase):
"""Tests for letsencrypt.colored_logging."""
def setUp(self):
from letsencrypt import colored_logging
self.stream = StringI... | apache-2.0 |
sander76/home-assistant | homeassistant/components/garmin_connect/config_flow.py | 3 | 2409 | """Config flow for Garmin Connect integration."""
import logging
from garminconnect import (
Garmin,
GarminConnectAuthenticationError,
GarminConnectConnectionError,
GarminConnectTooManyRequestsError,
)
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CO... | apache-2.0 |
zachcp/qiime | scripts/unweight_fasta.py | 15 | 2216 | #!/usr/bin/env python
# File created on 20 Jun 2011
from __future__ import division
__author__ = "Justin Kuczynski"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Justin Kuczynski"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Justin Kuczynski"
__email__ = "justinak@gmail.com"
... | gpl-2.0 |
nwjs/chromium.src | tools/perf/generate_legacy_perf_dashboard_json.py | 5 | 9577 | #!/usr/bin/env vpython
# Copyright 2016 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.
""" Generates legacy perf dashboard json from non-telemetry based perf tests.
Taken from chromium/build/scripts/slave/performance_log_... | bsd-3-clause |
sridhar912/tsr-py-faster-rcnn | caffe-fast-rcnn/examples/pycaffe/layers/pyloss.py | 38 | 1223 | import caffe
import numpy as np
class EuclideanLossLayer(caffe.Layer):
"""
Compute the Euclidean Loss in the same manner as the C++ EuclideanLossLayer
to demonstrate the class interface for developing layers in Python.
"""
def setup(self, bottom, top):
# check input pair
if len(bo... | mit |
ajdawson/iris | lib/iris/fileformats/grib/_save_rules.py | 4 | 42383 | # (C) British Crown Copyright 2010 - 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any l... | gpl-3.0 |
maartenq/ansible | test/sanity/code-smell/shebang.py | 9 | 3132 | #!/usr/bin/env python
import os
import stat
import sys
def main():
allowed = set([
b'#!/bin/bash -eu',
b'#!/bin/bash -eux',
b'#!/bin/bash',
b'#!/bin/sh',
b'#!/usr/bin/env bash',
b'#!/usr/bin/env fish',
b'#!/usr/bin/env pwsh',
b'#!/usr/bin/env python... | gpl-3.0 |
sss/calibre-at-bzr | src/calibre/gui2/viewer/table_popup.py | 7 | 2960 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid at kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
... | gpl-3.0 |
Patrikkk/TShock | scripts/gpltext.py | 4 | 2626 | ''' TShock, a server mod for Terraria
Copyright (C) 2011-2019 Pryaxis & TShock Contributors
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 la... | gpl-3.0 |
cloakedcode/CouchPotatoServer | libs/sqlalchemy/util/langhelpers.py | 17 | 28261 | # util/langhelpers.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Routines to help with the creation, loading and introspection of
modules, class... | gpl-3.0 |
yiakwy/numpy | numpy/core/code_generators/generate_umath.py | 57 | 31090 | from __future__ import division, print_function
import os
import re
import struct
import sys
import textwrap
sys.path.insert(0, os.path.dirname(__file__))
import ufunc_docstrings as docstrings
sys.path.pop(0)
Zero = "PyUFunc_Zero"
One = "PyUFunc_One"
None_ = "PyUFunc_None"
ReorderableNone = "PyUFunc_ReorderableNone"... | bsd-3-clause |
danakj/chromium | third_party/cython/src/Cython/Compiler/Nodes.py | 86 | 331600 | #
# Parse tree nodes
#
import cython
cython.declare(sys=object, os=object, copy=object,
Builtin=object, error=object, warning=object, Naming=object, PyrexTypes=object,
py_object_type=object, ModuleScope=object, LocalScope=object, ClosureScope=object,
StructOrUnionScope=ob... | bsd-3-clause |
carlos-lopez-garces/mapnik-trunk | scons/scons-local-1.2.0/SCons/Tool/packaging/__init__.py | 12 | 10691 | """SCons.Tool.Packaging
SCons Packaging Tool.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 The SCons Foundation
#
# 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 wit... | lgpl-2.1 |
1013553207/django | tests/admin_views/customadmin.py | 379 | 2366 | """
A second, custom AdminSite -- see tests.CustomAdminSiteTests.
"""
from __future__ import unicode_literals
from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from django.http import HttpResponse
from . import... | bsd-3-clause |
NiekB4/2016_Group07_Transit-BuiltEnvironment | PTStopCalc/utility_functions.py | 6 | 32334 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
SpatialDecision
A QGIS plugin
This is a SDSS template for the GEO1005 course
-------------------
begin : 2015-11-02
git... | gpl-2.0 |
Matt-Deacalion/django | tests/gis_tests/gdal_tests/test_envelope.py | 335 | 3667 | import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
if HAS_GDAL:
from django.contrib.gis.gdal import Envelope, GDALException
class TestPoint(object):
def __init__(self, x, y):
self.x = x
self.y = y
@skipUnless(HAS_GDAL, "GDAL is required")
class Env... | bsd-3-clause |
lemarcudal/sha_thedivision | test/Lib/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py | 152 | 2854 | """
urllib3 - Thread-safe connection pooling and re-using.
"""
from __future__ import absolute_import
import warnings
from .connectionpool import (
HTTPConnectionPool,
HTTPSConnectionPool,
connection_from_url
)
from . import exceptions
from .filepost import encode_multipart_formdata
from .poolmanager imp... | apache-2.0 |
rswyatt/kittypooclub | node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | 1804 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... | gpl-2.0 |
fdibaldassarre/mload | src/Interface/Gtk/ShowLatestWindow.py | 1 | 5180 | #!/usr/bin/env python3
from gi.repository import Gtk
from gi.repository import Pango
from datetime import datetime
from datetime import timedelta
DATE_FORMAT = '%d %B %Y'
DATE_FORMAT_ORDER = '%Y %m %d'
MAX_LABEL_SIZE = 30
class ShowLatestWindow(Gtk.Window):
def __init__(self, interface):
self.interface =... | gpl-3.0 |
pidydx/grr | grr/gui/plugins/artifact_view_test.py | 2 | 5689 | #!/usr/bin/env python
# -*- mode: python; encoding: utf-8 -*-
"""Test the artifact rendering interface."""
import os
from grr.gui import gui_test_lib
from grr.gui import runtests_test
from grr.lib import artifact
from grr.lib import artifact_registry
from grr.lib import config_lib
from grr.lib import flags
from grr.... | apache-2.0 |
nvoron23/avos | openstack_dashboard/dashboards/project/data_processing/clusters/workflows/scale.py | 32 | 6747 | # 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
# distributed under the... | apache-2.0 |
albertoconnor/website | newsletter/migrations/0001_initial.py | 2 | 2249 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.db.models.deletion
import modelcluster.fields
import wagtail.wagtailcore.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0001_squashed_0016_change_page_u... | mit |
gonzolino/heat | heat/engine/clients/os/designate.py | 4 | 3712 | #
# 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
# ... | apache-2.0 |
hashmaparraylist/shadowsocks | shadowsocks/crypto/util.py | 1032 | 4287 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 ... | apache-2.0 |
keishi/chromium | third_party/closure_linter/closure_linter/not_strict_test.py | 142 | 2332 | #!/usr/bin/env python
#
# Copyright 2011 The Closure Linter 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
#... | bsd-3-clause |
catapult-project/catapult-csm | third_party/html5lib-python/html5lib/tests/test_treeadapters.py | 451 | 1852 | from __future__ import absolute_import, division, unicode_literals
from . import support # flake8: noqa
import html5lib
from html5lib.treeadapters import sax
from html5lib.treewalkers import getTreeWalker
def test_to_sax():
handler = support.TracingSaxHandler()
tree = html5lib.parse("""<html xml:lang="en">... | bsd-3-clause |
mchristopher/PokemonGo-DesktopMap | app/pywin/Lib/cmd.py | 145 | 15026 | """A generic class to build line-oriented command interpreters.
Interpreters constructed with this class obey the following conventions:
1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
of characters in the identchars member.
3. A ... | mit |
dslomov/intellij-community | python/helpers/pydev/_pydev_imports_tipper.py | 52 | 12642 | import os.path
import inspect
import sys
from _pydev_tipper_common import DoFind
try:
xrange
except:
xrange = range
#completion types.
TYPE_IMPORT = '0'
TYPE_CLASS = '1'
TYPE_FUNCTION = '2'
TYPE_ATTR = '3'
TYPE_BUILTIN = '4'
TYPE_PARAM = '5'
def _imp(name, log=None):
try:
return __import__(name)... | apache-2.0 |
ifduyue/django | tests/staticfiles_tests/cases.py | 39 | 4395 | import codecs
import os
import shutil
import tempfile
from django.conf import settings
from django.core.management import call_command
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from .settings import TEST_SETTINGS
class BaseStaticFilesMixin:
"""
T... | bsd-3-clause |
Gadal/sympy | sympy/concrete/tests/test_delta.py | 87 | 23654 | from sympy.concrete import Sum
from sympy.concrete.delta import deltaproduct as dp, deltasummation as ds
from sympy.core import Eq, S, symbols, oo
from sympy.functions import KroneckerDelta as KD, Piecewise, piecewise_fold
from sympy.logic import And
i, j, k, l, m = symbols("i j k l m", integer=True, finite=True)
x, y... | bsd-3-clause |
craftytrickster/servo | tests/heartbeats/characterize_android.py | 139 | 4036 | #!/usr/bin/env python
# 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 sys
import os
from os import path
import time
import datetime
import argparse
import subpr... | mpl-2.0 |
JCA-Developpement/Odoo | addons/procurement/procurement.py | 44 | 15869 | # -*- 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 |
takaaptech/sky_engine | mojo/public/tools/bindings/pylib/mojom/generate/pack_tests.py | 69 | 6000 | # 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 sys
import module as mojom
import pack
import test_support
EXPECT_EQ = test_support.EXPECT_EQ
EXPECT_TRUE = test_support.EXPECT_TRUE
RunTest = test... | bsd-3-clause |
scootergrisen/virtaal | virtaal/controllers/unitcontroller.py | 4 | 10360 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2008-2011 Zuza Software Foundation
#
# This file is part of Virtaal.
#
# 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 ... | gpl-2.0 |
malvikasharan/APRICOT | apricotlib/apricot_visualization.py | 1 | 22211 | #!/usr/bin/env python
# Description = Visualizes different output data from APRICOT analysis
from collections import defaultdict
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os
import sys
try:
import subprocess
except ImportError:
print('Python package subprocess is missing. ... | isc |
SurfasJones/icecream-info | icecream/lib/python2.7/site-packages/django/contrib/gis/db/models/sql/query.py | 209 | 5406 | from django.db import connections
from django.db.models.query import sql
from django.contrib.gis.db.models.fields import GeometryField
from django.contrib.gis.db.models.sql import aggregates as gis_aggregates
from django.contrib.gis.db.models.sql.conversion import AreaField, DistanceField, GeomField
from django.contri... | mit |
HuimingCheng/AutoGrading | learning/web_Haotian/venv/Lib/site-packages/flask/exthook.py | 128 | 5762 | # -*- coding: utf-8 -*-
"""
flask.exthook
~~~~~~~~~~~~~
Redirect imports for extensions. This module basically makes it possible
for us to transition from flaskext.foo to flask_foo without having to
force all extensions to upgrade at the same time.
When a user does ``from flask.ext.foo import... | mit |
jm-begon/scikit-learn | sklearn/datasets/base.py | 196 | 18554 | """
Base IO code for all datasets
"""
# Copyright (c) 2007 David Cournapeau <cournape@gmail.com>
# 2010 Fabian Pedregosa <fabian.pedregosa@inria.fr>
# 2010 Olivier Grisel <olivier.grisel@ensta.org>
# License: BSD 3 clause
import os
import csv
import shutil
from os import environ
from os.pa... | bsd-3-clause |
Shrhawk/edx-platform | common/djangoapps/external_auth/tests/test_shib.py | 38 | 30207 | # -*- coding: utf-8 -*-
"""
Tests for Shibboleth Authentication
@jbau
"""
import unittest
from ddt import ddt, data
from django.conf import settings
from django.http import HttpResponseRedirect
from django.test import TestCase
from django.test.client import RequestFactory, Client as DjangoTestClient
from django.test.u... | agpl-3.0 |
TheCoSMoCompany/biopredyn | Prototype/src/libsbml-5.10.0/src/bindings/python/test/sbml/TestUnit_newSetters.py | 1 | 4337 | #
# @file TestUnit_newSetters.py
# @brief Unit unit tests for new set function API
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by conv... | bsd-3-clause |
anderson7ru/bienestarues | citasmedicasapp/models.py | 1 | 2389 | # -*- coding: utf-8 -*-
from django.db import models
from django.conf import settings
from django.utils import timezone
# apps internas y externas
from datospersonalesapp.models import Paciente
from empleadosapp.models import Empleado, Doctor
ESTADO_ELECCIONES = (
('N','Normal'),
('C','Cancelado'),
('R','... | mit |
HSAnet/glimpse_client | 3rdparty/breakpad/src/tools/gyp/test/defines/gyptest-defines-env.py | 501 | 1874 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies build of an executable with C++ define specified by a gyp define.
"""
import os
import TestGyp
test = TestGyp.TestGyp()
# Wi... | bsd-3-clause |
neurord/pysb | pysb/examples/bax_pore.py | 4 | 2561 | """A version of BAX pore assembly where the subunits dimerize and then
tetramerize instead of assembling sequentially (contrast with
bax_pore_sequential.py). Inhibition of pore formation by Mcl-1 is also
implemented.
"""
from pysb import *
Model()
# Each BAX-BAX bond must always involve a t1 site on one monomer and ... | bsd-2-clause |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/site-packages/IPython/core/magics/code.py | 8 | 27573 | """Implementation of code management magic functions.
"""
from __future__ import print_function
from __future__ import absolute_import
#-----------------------------------------------------------------------------
# Copyright (c) 2012 The IPython Development Team.
#
# Distributed under the terms of the Modified BSD L... | gpl-3.0 |
android-ia/platform_external_chromium_org | build/android/pylib/utils/timeout_retry.py | 47 | 1566 | # 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.
"""A utility to run functions with timeouts and retries."""
# pylint: disable=W0702
import threading
from pylib.utils import reraiser_thread
from pylib.uti... | bsd-3-clause |
cvvnx1/nagweb | www/static/metronic1.4/admin/template_content/assets/plugins/jquery-file-upload/server/gae-python/main.py | 223 | 5173 | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example 2.0
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from __future__ import with_statement
from google.appeng... | gpl-2.0 |
ehashman/oh-mainline | vendor/packages/celery/celery/events/__init__.py | 18 | 8485 | # -*- coding: utf-8 -*-
"""
celery.events
~~~~~~~~~~~~~
Events are messages sent for actions happening
in the worker (and clients if :setting:`CELERY_SEND_TASK_SENT_EVENT`
is enabled), used for monitoring purposes.
:copyright: (c) 2009 - 2011 by Ask Solem.
:license: BSD, see LICENSE for mo... | agpl-3.0 |
mancoast/CPythonPyc_test | fail/310_seq_tests.py | 7 | 13603 | """
Tests common to tuple, list and UserList.UserList
"""
import unittest
import sys
# Various iterables
# This is used for checking the constructor (here and in test_deque.py)
def iterfunc(seqn):
'Regular generator'
for i in seqn:
yield i
class Sequence:
'Sequence using __getitem__'
def __in... | gpl-3.0 |
molden/hanythingondemand | hod/node/node.py | 1 | 8124 | # #
# Copyright 2009-2015 Ghent University
#
# This file is part of hanythingondemand
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en),
# the Hercules foundat... | gpl-2.0 |
repotvsupertuga/tvsupertuga.repository | script.module.schism.common/lib/requests/packages/urllib3/request.py | 290 | 5946 | from __future__ import absolute_import
from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.con... | gpl-2.0 |
alikins/ansible | lib/ansible/plugins/action/onyx_config.py | 16 | 4123 | #
# (c) 2017, Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is... | gpl-3.0 |
zstyblik/infernal-twin | build/pip/pip/_vendor/requests/packages/chardet/mbcsgroupprober.py | 2769 | 1967 | ######################## 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 |
khkaminska/djangoproject.com | docs/search.py | 8 | 7056 | # -*- coding: utf-8 -*-
from django.core.paginator import EmptyPage, Page, PageNotAnInteger, Paginator
from django.utils.html import strip_tags
from django.utils.text import unescape_entities
from elasticsearch.helpers import streaming_bulk
from elasticsearch_dsl import DocType, Long, Nested, Object, String, analysis
f... | bsd-3-clause |
google/gazoo-device | examples/device_tests/unittest_example_test.py | 1 | 3386 | """Example reboot device test with GDM + unittest.
Usage:
python3 unittest_example_test.py -d somedevice-1234
See README.md for more details.
"""
import argparse
import logging
import sys
from typing import List, Tuple
import unittest
import gazoo_device
# If using a device controller from an extension package:
#... | apache-2.0 |
sestrella/ansible | test/units/module_utils/network/ftd/test_common.py | 27 | 11620 | # Copyright (c) 2018 Cisco and/or its affiliates.
#
# 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 v... | gpl-3.0 |
ChengyuSong/xen-arm | tools/python/xen/xend/XendAPIStore.py | 44 | 2431 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
cgstudiomap/cgstudiomap | main/parts/odoo/addons/mass_mailing/wizard/test_mailing.py | 140 | 2095 | # -*- coding: utf-8 -*-
from openerp import tools
from openerp.osv import osv, fields
class TestMassMailing(osv.TransientModel):
_name = 'mail.mass_mailing.test'
_description = 'Sample Mail Wizard'
_columns = {
'email_to': fields.char('Recipients', required=True,
help='Comma-separate... | agpl-3.0 |
aerickson/ansible | lib/ansible/plugins/action/nxos_template.py | 59 | 3804 | #
# Copyright 2015 Peter Sprygada <psprygada@ansible.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... | gpl-3.0 |
Lochlan/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/profiler.py | 182 | 9421 | # Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
schlos/eden | modules/s3db/dvr.py | 2 | 11017 | # -*- coding: utf-8 -*-
""" Sahana Eden Disaster Victim Registration Model
@copyright: 2012-15 (c) Sahana Software Foundation
@license: MIT
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... | mit |
renanalencar/hermes | stops/migrations/0005_auto_20150726_1537.py | 1 | 19308 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('stops', '0004_auto_20150725_1628'),
]
operations = [
migrations.AlterField(
model_name='stop',
name=... | mit |
lbybee/kaggle_contests | titanic/.ropeproject/config.py | 387 | 3461 | # The default ``config.py``
def set_prefs(prefs):
"""This function is called before opening the project"""
# Specify which files and folders to ignore in the project.
# Changes to ignored resources are not added to the history and
# VCSs. Also they are not returned in `Project.get_files()`.
# No... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.