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 |
|---|---|---|---|---|---|
tya/jenkins-job-builder | jenkins_jobs/cmd.py | 9 | 13065 | #!/usr/bin/env python
# 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 applicabl... | apache-2.0 |
mbohlool/client-python | kubernetes/test/test_policy_v1beta1_api.py | 1 | 2822 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.8.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
im... | apache-2.0 |
AsgerPetersen/QGIS | python/plugins/processing/algs/grass7/ext/r_li_richness.py | 2 | 1283 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_richness.py
----------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**************************... | gpl-2.0 |
ryfeus/lambda-packs | Tensorflow_OpenCV_Nightly/source/tensorflow/contrib/keras/python/keras/layers/normalization.py | 28 | 6200 | # 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... | mit |
arantebillywilson/python-snippets | py2/htp/ch06/fig06_09.py | 2 | 1246 | #!/usr/bin/python
#
# fig06_09.py
# Demonstrates post method in an XHTML form.
#
# Author: Billy Wilson Arante
# Created: 2016/08/29 EST (America/New York)
#
# Attribution: Python How to Program, 1st Ed. by Deitel & Deitel
#
import cgi
def print_header(title):
"""Prints a simple header"""
print """Content-t... | mit |
karlito40/servo | python/servo/command_base.py | 10 | 13598 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
koder-ua/nailgun-fcert | fuel_upgrade_system/fuel_upgrade/fuel_upgrade/tests/test_checker_manager.py | 7 | 2856 | # -*- coding: utf-8 -*-
# Copyright 2014 Mirantis, 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 requi... | apache-2.0 |
allenlavoie/tensorflow | tensorflow/contrib/learn/python/learn/utils/saved_model_export_utils.py | 3 | 34967 | # 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 |
bijaydev/Implementation-of-Explicit-congestion-notification-ECN-in-TCP-over-wireless-network-in-ns-3 | src/antenna/bindings/modulegen__gcc_ILP32.py | 38 | 97360 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
ric2b/Vivaldi-browser | chromium/third_party/blink/web_tests/external/wpt/tools/wptrunner/wptrunner/browsers/chrome_ios.py | 5 | 2834 | from .base import Browser, ExecutorBrowser, require_arg
from .base import get_timeout_multiplier # noqa: F401
from ..webdriver_server import CWTChromeDriverServer
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
... | bsd-3-clause |
ResolveWang/WeiboSpider | db/dao.py | 1 | 7194 | from sqlalchemy import text
from sqlalchemy.exc import IntegrityError as SqlalchemyIntegrityError
from pymysql.err import IntegrityError as PymysqlIntegrityError
from sqlalchemy.exc import InvalidRequestError
from .basic import db_session
from .models import (
LoginInfo, KeywordsWbdata, KeyWords, SeedIds, UserRela... | mit |
4shadoww/usploit | core/lib/requests/packages/chardet/mbcssm.py | 1783 | 19590 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
taaviteska/django | tests/staticfiles_tests/test_forms.py | 47 | 1551 | from urllib.parse import urljoin
from django.contrib.staticfiles import storage
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.forms import Media
from django.test import SimpleTestCase, override_settings
class StaticTestStorage(storage.StaticFilesStorage):
def url(self, name):... | bsd-3-clause |
hidekb/espressopp | contrib/mpi4py/mpi4py-2.0.0/test/test_io.py | 8 | 15283 | from mpi4py import MPI
import mpiunittest as unittest
import arrayimpl
import os, tempfile
class BaseTestIO(object):
COMM = MPI.COMM_NULL
FILE = MPI.FILE_NULL
prefix = 'mpi4py-'
def setUp(self):
comm = self.COMM
fname = None
if comm.Get_rank() == 0:
fd, fname = te... | gpl-3.0 |
jerome-nexedi/dream | dream/simulation/ExcelHandler.py | 2 | 2776 | # ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM 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 Founda... | gpl-3.0 |
karstenw/nodebox-pyobjc | examples/Extended Application/sklearn/examples/ensemble/plot_random_forest_regression_multioutput.py | 1 | 3492 | """
============================================================
Comparing random forests and the multi-output meta estimator
============================================================
An example to compare multi-output regression with random forest and
the :ref:`multioutput.MultiOutputRegressor <multiclass>` meta-e... | mit |
korrosivesec/crits | crits/emails/handlers.py | 1 | 65619 | from __future__ import absolute_import
import datetime
import email as eml
from email.parser import Parser
from email.utils import parseaddr, getaddresses, mktime_tz, parsedate_tz
import hashlib
import json
import magic
import re
import yaml
import io
import sys
import olefile
from dateutil.parser import parse as dat... | mit |
cbertinato/pandas | pandas/tests/test_downstream.py | 1 | 4179 | """
Testing that we work in the downstream packages
"""
import importlib
import subprocess
import sys
import numpy as np # noqa
import pytest
from pandas.compat import PY36
from pandas import DataFrame
from pandas.util import testing as tm
def import_module(name):
# we *only* want to skip if the module is tru... | bsd-3-clause |
Ms2ger/servo | tests/wpt/web-platform-tests/tools/pywebsocket/src/mod_pywebsocket/handshake/__init__.py | 658 | 4406 | # Copyright 2011, 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 f... | mpl-2.0 |
danieljaouen/ansible | lib/ansible/module_utils/api.py | 103 | 4446 | # 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 |
CulturePlex/pybossa | pybossa/api/user.py | 4 | 3168 | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2014 SF Isle of Man Limited
#
# PyBossa 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... | agpl-3.0 |
tomsilver/nupic | nupic/regions/AnomalyRegion.py | 1 | 2946 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditions apply:
#
# This pro... | gpl-3.0 |
ahelsing/geni-tools | src/omni_unittest.py | 3 | 56544 | #!/usr/bin/env python
#----------------------------------------------------------------------
# Copyright (c) 2011-2016 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without ... | mit |
iurisilvio/cabot | cabot/rest_urls.py | 3 | 4123 | from django.db import models as model_fields
from django.conf.urls import url, include
from django.contrib.auth import models as django_models
from polymorphic import PolymorphicModel
from cabot.cabotapp import models, alert
from rest_framework import routers, serializers, viewsets, mixins
import logging
logger = logg... | mit |
qedi-r/home-assistant | homeassistant/components/system_log/__init__.py | 3 | 7488 | """Support for system log."""
from collections import OrderedDict
import logging
import re
import traceback
import voluptuous as vol
from homeassistant import __path__ as HOMEASSISTANT_PATH
from homeassistant.components.http import HomeAssistantView
import homeassistant.helpers.config_validation as cv
from homeassist... | apache-2.0 |
gerrive/horizon | openstack_dashboard/api/rest/nova.py | 6 | 17795 | # Copyright 2014, Rackspace, US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | apache-2.0 |
kartikp1995/gnuradio | gr-digital/python/digital/__init__.py | 54 | 1763 | # Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# any later version... | gpl-3.0 |
betzw/mbed-os | UNITTESTS/unit_test/new.py | 27 | 4970 | """
Copyright (c) 2018, Arm Limited
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 a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable... | apache-2.0 |
grayark/osquery | tools/tests/stress.py | 28 | 1911 | #!/usr/bin/env python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from... | bsd-3-clause |
Gagnavarslan/djangosaml2 | djangosaml2/tests/attribute-maps/basic.py | 112 | 22565 |
MAP = {
"identifier": "urn:oasis:names:tc:SAML:2.0:attrname-format:basic",
"fro": {
'urn:mace:dir:attribute-def:aRecord': 'aRecord',
'urn:mace:dir:attribute-def:aliasedEntryName': 'aliasedEntryName',
'urn:mace:dir:attribute-def:aliasedObjectName': 'aliasedObjectName',
'urn:mace:... | apache-2.0 |
ran5515/DeepDecision | tensorflow/contrib/signal/python/ops/reconstruction_ops.py | 5 | 6138 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
rrice2004/LanSkorpian | LanSkorpian.py | 1 | 3034 | ## LANSKORPIAN - Personal home network scanner
## Copyright (C) Robert Rice <mindseyes@gmail.com>
## This program is published under a MIT license
print "\n"
print ("-" * 60)
print " LANSKORPIAN Personal Home Port Scanner"
print ("-" * 60)
print "\n"
# Import modules
import subprocess
import ipad... | mit |
mozilla/stoneridge | python/src/Lib/email/mime/multipart.py | 480 | 1573 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME multipart/* type messages."""
__all__ = ['MIMEMultipart']
from email.mime.base import MIMEBase
class MIMEMultipart(MIMEBase):
"""Base class for MIME multipart/* type messages."""... | mpl-2.0 |
dxmahata/InformativeTweetCollection | pymongo/uri_parser.py | 19 | 10933 | # Copyright 2011-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you
# may not use this file except in compliance with the License. You
# may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
jesramirez/odoo | addons/membership/wizard/__init__.py | 432 | 1071 | # -*- 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 |
taichatha/youtube-dl | youtube_dl/extractor/karrierevideos.py | 115 | 3200 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
fix_xml_ampersands,
float_or_none,
xpath_with_ns,
xpath_text,
)
class KarriereVideosIE(InfoExtractor):
_VALID_URL = r'http://(?:www\.)?karrierevideo... | unlicense |
shitolepriya/Saloon_erp | erpnext/buying/doctype/supplier/supplier.py | 1 | 4173 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
import frappe.defaults
from frappe import msgprint, _
from frappe.model.naming import make_autoname
from erpnext.utilities.address_and_con... | agpl-3.0 |
Horace1117/MKTCloud | openstack_dashboard/dashboards/project/access_and_security/floating_ips/tests.py | 7 | 8597 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
# Copyright (c) 2012 X.commerce, a business unit of eBay Inc.
#
# Licensed under th... | apache-2.0 |
trdean/grEME | gr-wxgui/python/wxgui/powermate.py | 76 | 15224 | #!/usr/bin/env python
#
# Copyright 2005 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
sanyaade-teachings/googletest | scripts/upload.py | 2511 | 51024 | #!/usr/bin/env python
#
# Copyright 2007 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... | bsd-3-clause |
jmesteve/saas3 | openerp/addons/auth_openid/controllers/__init__.py | 443 | 1033 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | agpl-3.0 |
kublaj/the-maker | sandboxProjectConvert_spec.py | 1 | 4768 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unittest
import os
import shutil
from makerUpdateSandboxedProjects import UpdateSandboxedProjects as theUpdater
import makerUpdateSandboxedProjects
import sys
from makerUtilities import writeDataToFile, readDataFromFile
import wx
class MakerTest(unittest.TestCase):
... | gpl-3.0 |
pierreg/tensorflow | tensorflow/contrib/learn/python/learn/estimators/logistic_regressor.py | 8 | 6060 | # 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 |
hpcleuven/easybuild-framework | test/framework/utilities.py | 2 | 19606 | ##
# Copyright 2012-2016 Ghent University
#
# This file is part of EasyBuild,
# 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://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
JPJPJPOPOP/zulip | zerver/tests/test_export.py | 10 | 10497 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from django.conf import settings
from django.test import TestCase
import os
import shutil
import ujson
from mock import patch, MagicMock
from six.moves import range
from typing import Any, Dict, List, Set
from zerve... | apache-2.0 |
lneuhaus/pyrpl | pyrpl/memory.py | 1 | 26126 | ###############################################################################
# pyrpl - DSP servo controller for quantum optics with the RedPitaya
# Copyright (C) 2014-2016 Leonhard Neuhaus (neuhaus@spectro.jussieu.fr)
#
# This program is free software: you can redistribute it and/or modify
# it under t... | gpl-3.0 |
zerc/django | tests/utils_tests/test_decorators.py | 319 | 4870 | from django.http import HttpResponse
from django.template import engines
from django.template.response import TemplateResponse
from django.test import RequestFactory, SimpleTestCase
from django.utils.decorators import classproperty, decorator_from_middleware
class ProcessViewMiddleware(object):
def process_view(s... | bsd-3-clause |
Bloodyaugust/pongsugarlabcpp | lib/boost/libs/python/test/test_pointer_adoption.py | 12 | 1801 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
>>> from test_pointer_adoption_ext import *
>>> num_a_instances()
0
>>> a = create('dynamically allocated')
>>> num_a_in... | gpl-2.0 |
acarmel/CouchPotatoServer | libs/suds/resolver.py | 205 | 15814 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 in the hope that it will ... | gpl-3.0 |
Reagankm/KnockKnock | venv/lib/python3.4/site-packages/matplotlib/testing/image_util.py | 11 | 3765 | # This module contains some functionality from the Python Imaging
# Library, that has been ported to use Numpy arrays rather than PIL
# Image objects.
# The Python Imaging Library is
# Copyright (c) 1997-2009 by Secret Labs AB
# Copyright (c) 1995-2009 by Fredrik Lundh
# By obtaining, using, and/or copying this sof... | gpl-2.0 |
alec-heif/MIT-Thesis | spark-bin/python/pyspark/streaming/flume.py | 58 | 5907 | #
# 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 us... | mit |
chenss/ChatRoom | 14.5 已经能运行(虽然有很多Warning)的Django-nonrel框架/django/utils/_threading_local.py | 343 | 6655 | """Thread-local objects
(Note that this module provides a Python version of thread
threading.local class. Depending on the version of Python you're
using, there may be a faster one available. You should always import
the local class from threading.)
Thread-local objects support the management of thread-local dat... | gpl-2.0 |
SigPloiter/SigPloit | gtp/attacks/dos/massive_dos.py | 1 | 5715 | #!/usr/bin/env python
# encoding: utf-8
# massive_dos.py
#
# Copyright 2018 Rosalia d'Alessandro
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#... | mit |
yongtang/tensorflow | tensorflow/lite/testing/op_tests/fully_connected.py | 10 | 5238 | # 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 |
Dfelker/ansible | lib/ansible/plugins/connections/funcd.py | 140 | 3605 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.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 Gene... | gpl-3.0 |
computersalat/ansible | lib/ansible/galaxy/login.py | 27 | 4922 | ########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@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 Fo... | gpl-3.0 |
bkbilly/AlarmPI | alarmcode/logs.py | 1 | 8304 | #!/usr/bin/env python
import re
import threading
import time
from datetime import datetime
import pytz
import logging
logging = logging.getLogger('alarmpi')
class Logs():
def __init__(self, wd, logfile, timezone):
self.wd = wd
self.logfile = logfile
try:
self.mytimezone = py... | mit |
weichweich/Pi-Timeswitch | Flask-Server/timeswitch/switch/schema.py | 1 | 2441 | import logging
import time
from flask import request
from flask_restful import Resource
from marshmallow import ValidationError, post_load, validates_schema
from marshmallow_jsonapi import Schema, fields
from timeswitch.switch.model import (Pin, Sequence, is_absolute_time,
is_rela... | mit |
aam-at/tensorflow | tensorflow/python/keras/utils/data_utils.py | 5 | 28401 | # Lint as python3
# Copyright 2018 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 |
srickardti/openthread | tools/harness-automation/cases_R140/commissioner_8_3_1.py | 18 | 1889 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# 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
# notic... | bsd-3-clause |
GNOME/orca | test/keystrokes/firefox/line_nav_roledescriptions.py | 1 | 2374 | #!/usr/bin/python
from macaroon.playback import *
import utils
sequence = MacroSequence()
#sequence.append(WaitForDocLoad())
sequence.append(PauseAction(5000))
# Work around some new quirk in Gecko that causes this test to fail if
# run via the test harness rather than manually.
sequence.append(KeyComboAction("<Con... | lgpl-2.1 |
gfreed/android_external_chromium-org | build/android/gyp/get_device_configuration.py | 52 | 2315 | #!/usr/bin/env python
#
# 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.
"""Gets and writes the configurations of the attached devices.
This configuration is used by later build steps to determine which de... | bsd-3-clause |
Stanford-Online/edx-platform | common/lib/xmodule/xmodule/tests/test_vertical.py | 11 | 6159 | """
Tests for vertical module.
"""
# pylint: disable=protected-access
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import namedtuple
import json
import ddt
from fs.memoryfs import MemoryFS
from mock import Mock, patch
import six
from . import get_test_system
fr... | agpl-3.0 |
bowang/tensorflow | tensorflow/python/framework/ops_test.py | 5 | 73072 | # 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 |
cmcqueen/cobs-python | python3/cobs/cobs/_cobs_py.py | 1 | 2890 | """
Consistent Overhead Byte Stuffing (COBS)
This version is for Python 3.x.
"""
class DecodeError(Exception):
pass
def _get_buffer_view(in_bytes):
mv = memoryview(in_bytes)
if mv.ndim > 1 or mv.itemsize > 1:
raise BufferError('object must be a single-dimension buffer of bytes.')
try:
... | mit |
oxo42/snmpmod | snmpmod/bin/SnmpStanza.py | 2 | 5786 | import logging
import sys
import xml.dom.minidom
from pysnmp.entity.rfc3413.oneliner import cmdgen
from snmputils import print_validation_error, splunk_escape
__author__ = 'John Oxley'
class SnmpStanza:
"""
A class to represent a SNMP stanza in inputs.conf
"""
def __init__(self):
self.conf... | apache-2.0 |
mistercrunch/airflow | airflow/providers/amazon/aws/hooks/dynamodb.py | 7 | 2345 | #
# 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... | apache-2.0 |
when30/namebench | nb_third_party/dns/version.py | 215 | 1267 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
4rado/RepositoryForProject | Lib/distutils/dist.py | 75 | 49994 | """distutils.dist
Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
"""
__revision__ = "$Id$"
import sys, os, re
from email import message_from_file
try:
import warnings
except ImportError:
warnings = None
from distutils.errors import (DistutilsOpt... | gpl-3.0 |
bgreenlee/sublime-github | lib/requests/utils.py | 58 | 16299 | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import os
import platform
import re
import sys
from netrc import netrc, NetrcParseError
from ... | mit |
kiddinn/plaso | plaso/analysis/viper.py | 1 | 6045 | # -*- coding: utf-8 -*-
"""Analysis plugin to look up files in Viper and tag events."""
from plaso.analysis import hash_tagging
from plaso.analysis import logger
from plaso.analysis import manager
from plaso.containers import events
from plaso.lib import errors
class ViperAnalyzer(hash_tagging.HTTPHashAnalyzer):
"... | apache-2.0 |
ludoT/PFCLS | node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | 1970 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... | gpl-3.0 |
VitalPet/odoo | addons/purchase/wizard/purchase_order_group.py | 56 | 3861 | # -*- 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 |
timokoola/lambdabot | requests/api.py | 188 | 5419 | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... | gpl-2.0 |
dya2/python-for-android | python-build/python-libs/gdata/build/lib/gdata/apps/emailsettings/service.py | 143 | 8840 | #!/usr/bin/python
#
# Copyright (C) 2008 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
mabotech/mabo.io | py/opcda/backup/monitor.py | 1 | 10535 |
"""
import logging
import logging.handlers
import logging.config
logging.config.fileConfig('logging.ini')
log = logging.getLogger(__file__)
"""
import os, sys
import subprocess
import traceback
from singleton import Singleton
import simplejson
from apscheduler import events
from apscheduler.scheduler import... | mit |
thomasgilgenast/spqr-nonrel | django/conf/locale/ka/formats.py | 329 | 1888 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i:s a'
DATETIME_FORMAT = 'j F, Y h:i:s a'
YEA... | bsd-3-clause |
nickmoline/feedsanitizer | django/middleware/transaction.py | 447 | 1090 | from django.db import transaction
class TransactionMiddleware(object):
"""
Transaction middleware. If this is enabled, each view function will be run
with commit_on_response activated - that way a save() doesn't do a direct
commit, the commit is done when a successful response is created. If an
exc... | mit |
Azure/azure-linux-extensions | DSC/azure/servicemanagement/servicemanagementservice.py | 47 | 81076 | #-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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.apac... | apache-2.0 |
pschmitt/home-assistant | homeassistant/components/litejet/switch.py | 15 | 2081 | """Support for LiteJet switch."""
import logging
from homeassistant.components import litejet
from homeassistant.components.switch import SwitchEntity
ATTR_NUMBER = "number"
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the LiteJet switch p... | apache-2.0 |
varunarya10/boto | tests/integration/ec2/cloudwatch/test_cert_verification.py | 114 | 1597 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 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 withou... | mit |
squadran2003/PYTHON-DIRECTORY-WATCHER | lib/python3.5/site-packages/pip/_vendor/requests/packages/urllib3/fields.py | 1007 | 5833 | import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
:param default:
If no "Cont... | mit |
tengqm/senlin | senlin/tests/engine/test_policy_types.py | 1 | 2469 | # 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 |
gregdetre/abracadjabra | abracadjabra/views.py | 1 | 3115 | from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.models import User
from django.db.models import Sum, Count
from django.http import Http404
from django.shortcuts import get_object_or_404, render_to_response
from django.template import RequestContext
from exceptions impor... | mit |
jgravois/ArcREST | src/arcrest/agol/layer.py | 1 | 54466 | """
.. module:: layer
:platform: Windows, Linux
:synopsis: Class that contians feature service layer information.
.. moduleauthor:: Esri
"""
from .._abstract import abstract
from ..security import security
import types
from ..common import filters
from ..common.geometry import SpatialReference
from ..common.g... | apache-2.0 |
jacenkow/inspire-next | tests/unit/utils/test_utils_cv_latex_html_text.py | 2 | 13608 | # -*- coding: utf-8 -*-
#
# This file is part of INSPIRE.
# Copyright (C) 2016 CERN.
#
# INSPIRE 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-2.0 |
drxaero/calibre | src/calibre/devices/mtp/windows/driver.py | 14 | 17040 | #!/usr/bin/env python2
# 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 |
rodorad/spark-tk | integration-tests/tests/test_frame_append.py | 14 | 2187 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel 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 require... | apache-2.0 |
todbertuzzi/qdu-theme | 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 |
highweb-project/highweb-webcl-html5spec | third_party/protobuf/python/google/protobuf/internal/decoder.py | 223 | 26136 | # 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:
#
# * Redistributions o... | bsd-3-clause |
alphacsc/alphacsc | alphacsc/other/swm.py | 1 | 5148 | """
Code adopted from Voytek Lab package neurodsp:
https://github.com/voytekresearch/neurodsp/blob/master/neurodsp/shape/swm.py
The sliding window matching algorithm identifies the waveform shape of
neural oscillations using correlations.
"""
# Authors: Scott Cole
# Mainak Jas <mainak.jas@telecom-paristech.f... | bsd-3-clause |
Peter-Liang/CodeWars-Python | solutions/Conway_s_Game_of_Life_Unlimited_Edition.py | 1 | 1775 | """
Conway's Game of Life - Unlimited Edition
http://www.codewars.com/kata/52423db9add6f6fc39000354/train/python
"""
from copy import deepcopy
def get_generation(cells, generations):
origin = deepcopy(cells)
if generations == 0:
return origin
if generations > 1:
origin = get_generation(or... | mit |
Mercy-Nekesa/sokoapp | sokoapp/tracking/utils.py | 1 | 5688 | import re
headers = ('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED',
'HTTP_X_CLUSTERED_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED',
'REMOTE_ADDR')
# Back ported from Django trunk
# This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/
# L... | mit |
tmenjo/cinder-2015.1.0 | cinder/openstack/common/eventlet_backdoor.py | 5 | 4858 | # Copyright (c) 2012 OpenStack Foundation.
# Administrator of the National Aeronautics and Space Administration.
# 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 a... | apache-2.0 |
Fafou/Sick-Beard | lib/hachoir_parser/program/exe_res.py | 90 | 15312 | """
Parser for resource of Microsoft Windows Portable Executable (PE).
Documentation:
- Wine project
VS_FIXEDFILEINFO structure, file include/winver.h
Author: Victor Stinner
Creation date: 2007-01-19
"""
from lib.hachoir_core.field import (FieldSet, ParserError, Enum,
Bit, Bits, SeekableFieldSet,
UInt16, U... | gpl-3.0 |
pymor/dune-hdd | examples/linearparabolic/morepas3__prepare.py | 1 | 23451 | #!/usr/bin/env python2
#
# This file is part of the dune-hdd project:
# https://github.com/pymor/dune-hdd
# Copyright Holders: Felix Schindler
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
from __future__ import division, print_function
import numpy as np
from functools import parti... | bsd-2-clause |
wateraccounting/wa | Collect/MOD9/DataAccess.py | 1 | 12824 | # -*- coding: utf-8 -*-
"""
Authors: Tim Hessels
UNESCO-IHE 2016
Contact: t.hessels@unesco-ihe.org
Repository: https://github.com/wateraccounting/wa
Module: Collect/MOD9
"""
# import general python modules
import os
import numpy as np
import pandas as pd
import gdal
import urllib
import urllib2
from bs4 impor... | apache-2.0 |
Stanford-Online/edx-platform | common/test/acceptance/fixtures/xqueue.py | 24 | 1434 | """
Fixture to configure XQueue response.
"""
import json
import requests
from common.test.acceptance.fixtures import XQUEUE_STUB_URL
class XQueueResponseFixtureError(Exception):
"""
Error occurred while configuring the stub XQueue.
"""
pass
class XQueueResponseFixture(object):
"""
Config... | agpl-3.0 |
craynot/django | django/contrib/gis/geos/prepared.py | 328 | 2445 | from .base import GEOSBase
from .error import GEOSException
from .libgeos import geos_version_info
from .prototypes import prepared as capi
class PreparedGeometry(GEOSBase):
"""
A geometry that is prepared for performing certain operations.
At the moment this includes the contains covers, and intersects
... | bsd-3-clause |
Stbot/PyCrypt | first writes/b64cy.py | 1 | 2516 | ###############################################################################
import b64_mod
from binascii import unhexlify
###############################################################################
def decode(bstring,flag = 0):
"""Decode, when flag is set to 0 or not set takes a Base64 strig and converts i... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.