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 |
|---|---|---|---|---|---|
alu042/edx-platform | common/lib/xmodule/xmodule/lti_2_util.py | 44 | 16145 | # pylint: disable=attribute-defined-outside-init
"""
A mixin class for LTI 2.0 functionality. This is really just done to refactor the code to
keep the LTIModule class from getting too big
"""
import json
import re
import mock
import urllib
import hashlib
import base64
import logging
from webob import Response
from x... | agpl-3.0 |
UndeadBaneGitHub/spark | dev/pip-sanity-check.py | 80 | 1384 | #
# 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... | apache-2.0 |
justyns/home-assistant | tests/util/test_color.py | 4 | 2244 | """Test Home Assistant color util methods."""
import unittest
import homeassistant.util.color as color_util
class TestColorUtil(unittest.TestCase):
"""Test color util methods."""
# pylint: disable=invalid-name
def test_color_RGB_to_xy(self):
"""Test color_RGB_to_xy."""
self.assertEqual((0... | mit |
Novasoft-India/OperERP-AM-Motors | openerp/addons/account_report_company/report/account_invoice_report.py | 52 | 1643 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
jeacaveo/schmebulock | items/serializers.py | 1 | 10351 | """ Serializers of items app. """
from cities import models as city_models
from djmoney import settings as djmoney_settings
from measurement.measures import Volume, Weight
from rest_framework import serializers
from .models import Brand, Item, Location, Order, Purchase, Store
DEFAULT_FIELDS = ["id", "created_by", "m... | gpl-3.0 |
larsbergstrom/servo | tests/wpt/web-platform-tests/2dcontext/tools/specextract.py | 49 | 2704 | import html5lib
import html5lib.treebuilders.dom
import re
# Expected use:
# curl --compressed https://html.spec.whatwg.org/multipage/canvas.html >current-work
# python specextract.py
#
# Generates current-work-canvas.xhtml, for use by gentest.py to create the annotated spec document
def extract():
parser = h... | mpl-2.0 |
snahelou/awx | awx/main/tests/functional/api/test_fact_versions.py | 1 | 10107 | # Python
import mock
import pytest
from datetime import timedelta
import urlparse
import urllib
# AWX
from awx.api.versioning import reverse
from awx.main.models.fact import Fact
from awx.main.utils import timestamp_apiformat
# Django
from django.utils import timezone
def mock_feature_enabled(feature):
return T... | apache-2.0 |
sumedh123/debatify | venv/lib/python2.7/site-packages/PIL/ExifTags.py | 46 | 8837 | #
# The Python Imaging Library.
# $Id$
#
# EXIF tags
#
# Copyright (c) 2003 by Secret Labs AB
#
# See the README file for information on usage and redistribution.
#
##
# This module provides constants and clear-text names for various
# well-known EXIF tags.
##
##
# Maps EXIF tags to tag names.
TAGS = {
# possib... | mit |
ScottBuchanan/eden | modules/s3db/vehicle.py | 16 | 10778 | # -*- coding: utf-8 -*-
""" Sahana Eden Vehicle Model
@copyright: 2009-2015 (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 the Software witho... | mit |
harshita-gupta/Harvard-FRSEM-Catalog-2016-17 | flask/lib/python2.7/site-packages/sqlalchemy/schema.py | 28 | 1200 | # schema.py
# Copyright (C) 2005-2016 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
"""Compatibility namespace for sqlalchemy.sql.schema and related.
"""
from .sql.base imp... | mit |
Sri0405/pattern | pattern/server/cherrypy/cherrypy/wsgiserver/ssl_pyopenssl.py | 21 | 9381 | """A library for integrating pyOpenSSL with CherryPy.
The OpenSSL module must be importable for SSL functionality.
You can obtain it from http://pyopenssl.sourceforge.net/
To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of
SSLAdapter. There are two ways to use SSL:
Method One
----------
* ``s... | bsd-3-clause |
sysadmin75/ansible | test/lib/ansible_test/_internal/cloud/vcenter.py | 11 | 8644 | """VMware vCenter plugin for integration tests."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from . import (
CloudProvider,
CloudEnvironment,
CloudEnvironmentConfig,
)
from ..util import (
find_executable,
display,
ConfigParser,
Appl... | gpl-3.0 |
scue/lenovo_k860i_kernel | tools/perf/python/twatch.py | 3213 | 1338 | #! /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 |
un33k/robotframework | src/robot/output/debugfile.py | 22 | 3702 | # Copyright 2008-2015 Nokia Solutions and Networks
#
# 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 l... | apache-2.0 |
mclevey/seaborn | seaborn/tests/test_linearmodels.py | 18 | 19157 | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import nose.tools as nt
import numpy.testing as npt
import pandas.util.testing as pdt
from numpy.testing.decorators import skipif
from nose import SkipTest
try:
import statsmodels.regression.linear_model as smlm
_n... | bsd-3-clause |
AndroidMarv/pyalienfx | usb/backend/__init__.py | 13 | 15692 | # Copyright (C) 2009-2011 Wander Lairson Costa
#
# The following terms apply to all files associated
# with the software unless explicitly disclaimed in individual files.
#
# The authors hereby grant permission to use, copy, modify, distribute,
# and license this software and its documentation for any purpose, provi... | gpl-3.0 |
garbas/mozilla-releng-services | src/shipit_bot_uplift/shipit_bot_uplift/sync.py | 1 | 14171 | # -*- coding: utf-8 -*-
# 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 itertools
import os
from shipit_bot_uplift.helpers import compute_dict_hash
from shipit_... | mpl-2.0 |
nke001/attention-lvcsr | libs/Theano/theano/compile/tests/test_profiling.py | 3 | 3349 | """
Test of memory profiling
"""
import unittest
import numpy
import theano
from six.moves import StringIO
import theano.tensor as T
from theano.ifelse import ifelse
class Test_profiling(unittest.TestCase):
"""
Test of Theano profiling with min_peak_memory=True
"""
def test_profiling(self):
... | mit |
deepmind/dm_construction | dm_construction/_environment_factory.py | 1 | 2899 | #!/usr/bin/python
#
# Copyright 2020 DeepMind Technologies Limited
#
# 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 a... | apache-2.0 |
shepdelacreme/ansible | lib/ansible/modules/network/cloudengine/ce_evpn_bgp.py | 43 | 26926 | #!/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 |
summernote/django-summernote | django_summernote/admin.py | 1 | 1372 | from django.contrib import admin
from django.contrib.admin.options import InlineModelAdmin
from django.db import models
from django_summernote.forms import AttachmentAdminForm
from django_summernote.utils import get_attachment_model, get_config
from django_summernote.widgets import SummernoteWidget, SummernoteInplaceW... | mit |
errordeveloper/fe-devel | Native/ThirdParty/Private/Python/closure_linter/javascriptlintrules.py | 4 | 19602 | #!/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
#... | agpl-3.0 |
unor/schemaorg | lib/rdflib_jsonld/util.py | 6 | 1299 | try:
import json
assert json # workaround for pyflakes issue #13
except ImportError:
import simplejson as json
from rdflib.py3compat import PY3
from os import sep
from os.path import normpath
if PY3:
from urllib.parse import urljoin, urlsplit, urlunsplit
else:
from urlparse import urljoin, urlspl... | apache-2.0 |
clemos/haxe-sublime-bundle | elementtree/SimpleXMLWriter.py | 103 | 8616 | #
# SimpleXMLWriter
# $Id: SimpleXMLWriter.py 2312 2005-03-02 18:13:39Z fredrik $
#
# a simple XML writer
#
# history:
# 2001-12-28 fl created
# 2002-11-25 fl fixed attribute encoding
# 2002-12-02 fl minor fixes for 1.5.2
# 2004-06-17 fl added pythondoc markup
# 2004-07-23 fl added flush method (from Jay Grav... | apache-2.0 |
googleapis/python-aiplatform | google/cloud/aiplatform/v1beta1/schema/predict/prediction/__init__.py | 1 | 2707 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
gkotton/neutron | neutron/plugins/openvswitch/common/constants.py | 7 | 2460 | # 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 |
mne-tools/mne-python | logo/generate_mne_logos.py | 13 | 7174 | # -*- coding: utf-8 -*-
"""
===============================================================================
Script 'mne logo'
===============================================================================
This script makes the logo for MNE.
"""
# @author: drmccloy
# Created on Mon Jul 20 11:28:16 2015
# License: BSD ... | bsd-3-clause |
theheros/kbengine | kbe/src/lib/python/Lib/test/test_bz2.py | 50 | 16089 | #!/usr/bin/env python3
from test import support
from test.support import TESTFN
import unittest
from io import BytesIO
import os
import subprocess
import sys
try:
import threading
except ImportError:
threading = None
# Skip tests if the bz2 module doesn't exist.
bz2 = support.import_module('bz2')
from bz2 im... | lgpl-3.0 |
AOSPU/external_chromium_org | content/test/gpu/gpu_tests/cloud_storage_test_base.py | 8 | 10867 | # 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.
"""Base classes for a test and validator which upload results
(reference images, error images) to cloud storage."""
import os
import re
import tempfile
fro... | bsd-3-clause |
webmasterraj/FogOrNot | flask/lib/python2.7/site-packages/jinja2/visitor.py | 1401 | 3316 | # -*- coding: utf-8 -*-
"""
jinja2.visitor
~~~~~~~~~~~~~~
This module implements a visitor for the nodes.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2.nodes import Node
class NodeVisitor(object):
"""Walks the abstract syntax tree and call visitor functions for every... | gpl-2.0 |
janelia-idf/fly-sorter | animatics_device/src/animatics_device/animatics_device.py | 1 | 40679 | from __future__ import print_function, division
import serial
import time
import atexit
import json
import operator
from functools import partial
import threading
from serial_device import SerialDevice, findSerialDevicePorts, WriteFrequencyError
DEBUG = True
MOTOR_ADDRESS_OFFSET = 128
MOTOR_ADDRESS_MAX = 120
MOTOR_C... | bsd-3-clause |
eunchong/build | third_party/sqlalchemy_0_7_1/sqlalchemy/orm/session.py | 4 | 66059 | # orm/session.py
# Copyright (C) 2005-2011 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
"""Provides the Session class and related utilities."""
import weakref
from itertools ... | bsd-3-clause |
Plain-Andy-legacy/android_external_chromium_org | tools/chrome_proxy/integration_tests/chrome_proxy_benchmark.py | 25 | 3524 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from integration_tests import chrome_proxy_measurements as measurements
from integration_tests import chrome_proxy_pagesets as pagesets
from telemetry import... | bsd-3-clause |
hernandito/SickRage | lib/dateutil/easter.py | 202 | 2611 | # -*- coding: utf-8 -*-
"""
This module offers a generic easter computing method for any given year, using
Western, Orthodox or Julian algorithms.
"""
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year,... | gpl-3.0 |
isralopez/geonode | geonode/upload/tests/integration.py | 3 | 23179 | #########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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
#... | gpl-3.0 |
pymedusa/Medusa | lib/pkg_resources/_vendor/packaging/version.py | 1151 | 11556 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... | gpl-3.0 |
snnn/tensorflow | tensorflow/python/feature_column/feature_column_v2_test.py | 3 | 211038 | # 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 |
hynnet/openwrt-mt7620 | staging_dir/host/lib/python2.7/distutils/command/build.py | 250 | 5437 | """distutils.command.build
Implements the Distutils 'build' command."""
__revision__ = "$Id$"
import sys, os
from distutils.util import get_platform
from distutils.core import Command
from distutils.errors import DistutilsOptionError
def show_compilers():
from distutils.ccompiler import show_compilers
show... | gpl-2.0 |
bgrant0607/kubernetes | cluster/juju/layers/kubeapi-load-balancer/reactive/load_balancer.py | 137 | 5613 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
raden/cempaka-kernel | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
yasoob/youtube-dl-GUI | UI/BatchAddUrls.py | 1 | 2226 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'resources\batch_add.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_BatchAdd(object):
def setupUi(self, BatchAdd):
B... | mit |
wemanuel/smry | server-auth/ls/google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/ec2/test_connection.py | 100 | 9106 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2009, Eucalyptus Systems, Inc.
# 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 res... | apache-2.0 |
shanew/electrum | plugins/trezor.py | 1 | 24092 | from binascii import unhexlify
from struct import pack
from sys import stderr
from time import sleep
import unicodedata
import threading
import re
from PyQt4.Qt import QMessageBox, QDialog, QVBoxLayout, QLabel, QThread, SIGNAL, QGridLayout, QInputDialog, QPushButton
import PyQt4.QtCore as QtCore
import electrum
from ... | gpl-3.0 |
palerdot/calibre | src/calibre/ebooks/metadata/pml.py | 24 | 3021 | # -*- coding: utf-8 -*-
__license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
'''
Read meta information from TXT files
'''
import os
import glob
import re
from calibre.ebooks.metadata import MetaInformation
from calibre.ptempfile import Temporar... | gpl-3.0 |
neuront/redis-ctl | config.py | 1 | 1819 | import os
import logging
import tempfile
SERVER_PORT = int(os.getenv('SERVER_PORT', 5000))
MYSQL_HOST = os.getenv('MYSQL_HOST', 'localhost')
MYSQL_PORT = int(os.getenv('MYSQL_PORT', '3306'))
MYSQL_USERNAME = os.getenv('MYSQL_USERNAME', 'root')
MYSQL_PASSWORD = os.getenv('MYSQL_PASSWORD', '')
MYSQL_DATABASE = os.geten... | mit |
jsakamoto/selenium | py/selenium/webdriver/common/alert.py | 23 | 3099 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
piensa/geonode | geonode/layers/migrations/24_initial.py | 14 | 8043 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import datetime
from django.conf import settings
import django.core.files.storage
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | gpl-3.0 |
cpaxton/predicator | predicator_occupancy_module/src/predicator_occupancy_module/snapshot.py | 2 | 8609 | #!/usr/bin/python
"""
This contains two methods of having the user input a bounding box
--Usage--
Ensure the Kinect is running with ROS.
roslaunch openni_launch openni.launch depth_registration:=true
Run this program
rosrun predicator_occupancy_analyzer pick_volume
--Output--
A volume is sent to the ROS param... | bsd-2-clause |
sekikn/incubator-airflow | tests/providers/exasol/operators/test_exasol.py | 10 | 1935 | #
# 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 |
noironetworks/networking-cisco | networking_cisco/tests/unit/ml2_drivers/nexus/test_cisco_config.py | 1 | 5032 | # Copyright (c) 2014-2016 Cisco Systems, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | apache-2.0 |
vicnet/weboob | modules/fortuneo/pages/login.py | 1 | 1422 | # -*- coding: utf-8 -*-
# Copyright(C) 2012 Gilles-Alexandre Quenot
#
# This file is part of a weboob module.
#
# This weboob module 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 ... | lgpl-3.0 |
tynn/numpy | numpy/distutils/__init__.py | 11 | 1120 | from __future__ import division, absolute_import, print_function
import sys
from .__version__ import version as __version__
# Must import local ccompiler ASAP in order to get
# customized CCompiler.spawn effective.
from . import ccompiler
from . import unixccompiler
from .info import __doc__
from .npy_pkg_config imp... | bsd-3-clause |
adi1133/POSTMan-Chrome-Extension | tests/selenium/pmtests/postman_tests_environments.py | 100 | 6878 | from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support.select import Select
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
import selenium.webdriver.chrome.service as service
import inspect
... | apache-2.0 |
defionscode/ansible-modules-core | network/cumulus/cl_bridge.py | 8 | 13178 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
mudbungie/NetExplorer | env/lib/python3.4/site-packages/bulbs/tests/graph_tests.py | 3 | 1389 | import unittest
from bulbs.config import Config
from bulbs.property import String
from bulbs.element import VertexProxy, EdgeProxy
from bulbs.model import Node, NodeProxy, Relationship, RelationshipProxy
from bulbs.base.client import Client
from .testcase import BulbsTestCase
# Test Models
class User(Node):
e... | mit |
mortada/pelican-plugins | libravatar/test_libravatar.py | 52 | 3409 | """Unit testing suite for the Libravatar Plugin"""
## Copyright (C) 2015 Rafael Laboissiere <rafael@laboissiere.net>
##
## This program is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Affero Public License as published by
## the Free Software Foundation, either version... | agpl-3.0 |
40223114/w16- | static/Brython3.1.1-20150328-091302/Lib/xml/sax/__init__.py | 637 | 3505 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | gpl-3.0 |
balle/airxploit | src/airxploit/core/aircontroller.py | 1 | 3006 | '''
Created on 31.07.2010
@author: basti
'''
from time import sleep
from airxploit.scanner.bluetooth import BluetoothScanner
from airxploit.scanner.wlan import WlanScanner
from airxploit.core.target import Wlan, Bluetooth
import airxploit.fuckup
import airxploit.discovery
from airxploit.core.plugincontroller import P... | gpl-2.0 |
isis-ammo/ammo-gateway | AndroidGatewayPlugin/Testdriver/ManyConnectors.py | 1 | 2291 | from ammo import AndroidConnector
from ammo import AmmoMessages_pb2
import uuid
import sys
import time
import datetime
import math
import optparse
from twisted.internet import reactor
latencies = []
def onDataReceived(connector, msg):
receivedTime = time.time()
if msg.type == AmmoMessages_pb2.MessageWrapper.DA... | mit |
DepthDeluxe/ansible | lib/ansible/modules/cloud/google/gce_tag.py | 64 | 8107 | #!/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 distributed... | gpl-3.0 |
malderete/ninja-ide | ninja_ide/gui/dialogs/preferences/preferences_editor_general.py | 6 | 11019 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | gpl-3.0 |
Azure/azure-sdk-for-python | sdk/translation/azure-ai-translation-document/azure/ai/translation/document/aio/_async_polling.py | 1 | 5063 | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from typing import Any, Tuple, TypeVar
from azure.core.polling import AsyncLROPoller
from azure.core.polling.base_polling import (
OperationFailed,
... | mit |
vmendez/DIRAC | FrameworkSystem/scripts/dirac-sys-sendmail.py | 8 | 2551 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-sys-sendmail
# Author : Matvey Sapunov
########################################################################
"""
Utility to send an e-mail using DIRAC notification service.
Arguments:
... | gpl-3.0 |
whitepyro/debian_server_setup | lib/requests/compat.py | 571 | 2556 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.x
is_py31 =... | gpl-3.0 |
jcftang/ansible | lib/ansible/modules/network/vyos/vyos_facts.py | 29 | 9161 | #!/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 |
tiagofrepereira2012/tensorflow | tensorflow/tools/api/lib/python_object_to_proto_visitor.py | 44 | 6323 | # 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 |
newerthcom/savagerebirth | libs/python-2.72/Tools/scripts/objgraph.py | 96 | 6018 | #! /usr/bin/env python
# objgraph
#
# Read "nm -o" input (on IRIX: "nm -Bo") of a set of libraries or modules
# and print various interesting listings, such as:
#
# - which names are used but not defined in the set (and used where),
# - which names are defined in the set (and where),
# - which modules use which other ... | gpl-2.0 |
DCSaunders/tensorflow | tensorflow/python/training/optimizer.py | 8 | 21081 | # 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 |
thune-xiaobai/android_kernel_huawei_D1_P1 | scripts/tracing/draw_functrace.py | 14676 | 3560 | #!/usr/bin/python
"""
Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com>
Licensed under the terms of the GNU GPL License version 2
This script parses a trace provided by the function tracer in
kernel/trace/trace_functions.c
The resulted trace is processed into a tree to produce a more human
view of the call ... | gpl-2.0 |
rhdedgar/openshift-tools | openshift/installer/vendored/openshift-ansible-3.6.173/roles/lib_openshift/src/class/oc_adm_ca_server_cert.py | 31 | 6137 | # pylint: skip-file
# flake8: noqa
class CAServerCertConfig(OpenShiftCLIConfig):
''' CAServerCertConfig is a DTO for the oc adm ca command '''
def __init__(self, kubeconfig, verbose, ca_options):
super(CAServerCertConfig, self).__init__('ca', None, kubeconfig, ca_options)
self.kubeconfig = kube... | apache-2.0 |
w1ll1am23/home-assistant | homeassistant/components/iaqualink/light.py | 12 | 2784 | """Support for Aqualink pool lights."""
from iaqualink import AqualinkLightEffect
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_EFFECT,
DOMAIN,
SUPPORT_BRIGHTNESS,
SUPPORT_EFFECT,
LightEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers... | apache-2.0 |
theiviaxx/frog-angular | frog/tests.py | 2 | 1158 | import json
from django.test import TestCase
from django.contrib.auth.models import User
def setUp():
User.objects.create_user(
first_name='brett', email='theiviaxx@gmail.com', password='top_secret')
class FrogTestCase(TestCase):
fixtures = ['test_data.json']
def test_filter(self):
res =... | mit |
steedos/odoo7 | openerp/addons/point_of_sale/report/pos_invoice.py | 61 | 2292 | # -*- 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 |
kutenai/django | django/core/management/commands/migrate.py | 8 | 14663 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.checks import Tags, run_checks
from django.core.management.base import BaseCommand, CommandError
from django.core.management... | bsd-3-clause |
yongshengwang/builthue | apps/security/src/security/views.py | 26 | 1642 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
munhanha/mtg-random | django/core/validators.py | 97 | 7266 | import re
import urllib2
import urlparse
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
# These values, if given to validate(), will trigger the self.required check.
EMPTY_VALUES = (None, '', [], (), {})
try:
... | bsd-3-clause |
jef-n/QGIS | python/PyQt/PyQt5/uic/pyuic.py | 45 | 1079 | # -*- coding: utf-8 -*-
"""
***************************************************************************
pyuic.py
---------------------
Date : March 2016
Copyright : (C) 2016 by Juergen E. Fischer
Email : jef at norbit dot de
********************************... | gpl-2.0 |
torufuru/oolhackathon | ryu/services/protocols/bgp/operator/commands/show/__init__.py | 51 | 2033 | from ryu.services.protocols.bgp.operator.command import Command
from ryu.services.protocols.bgp.operator.command import CommandsResponse
from ryu.services.protocols.bgp.operator.command import STATUS_OK
from ryu.services.protocols.bgp.operator.command import STATUS_ERROR
from ryu.services.protocols.bgp.operator.command... | apache-2.0 |
brunotougeiro/python | venv/Lib/os.py | 4 | 37525 | r"""OS routines for NT or Posix depending on what system we're on.
This exports:
- all functions from posix or nt, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix' or 'nt'
- os.curdir is a string representing the current directory (always '.')
- os.pardir is a strin... | gpl-2.0 |
NeftaliYagua/gae-init | main/auth/github.py | 12 | 1506 | # coding: utf-8
import flask
import auth
import config
import model
import util
from main import app
github_config = dict(
access_token_method='POST',
access_token_url='https://github.com/login/oauth/access_token',
authorize_url='https://github.com/login/oauth/authorize',
base_url='https://api.gith... | mit |
MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/pygments/lexers/d.py | 47 | 9530 | # -*- coding: utf-8 -*-
"""
pygments.lexers.d
~~~~~~~~~~~~~~~~~
Lexers for D languages.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.lexer import RegexLexer, include, words
from pygments.token import Text, Comment, Ke... | mit |
ehashman/oh-mainline | vendor/packages/Django/tests/regressiontests/decorators/tests.py | 48 | 9040 | import warnings
from functools import wraps
from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required, permission_required, user_passes_test
from django.http import HttpResponse, HttpRequest, HttpResponseNotAllowed
from django.middleware.clickjack... | agpl-3.0 |
lucienfostier/gaffer | python/GafferSceneUI/EditScopeUI.py | 1 | 4582 | ##########################################################################
#
# Copyright (c) 2019, Cinesite VFX Ltd. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions ... | bsd-3-clause |
edry/edx-platform | openedx/core/djangoapps/user_api/accounts/views.py | 38 | 8085 | """
NOTE: this API is WIP and has not yet been approved. Do not use this API without talking to Christina or Andy.
For more information, see:
https://openedx.atlassian.net/wiki/display/TNL/User+API
"""
from django.db import transaction
from rest_framework.views import APIView
from rest_framework.response import Respon... | agpl-3.0 |
HydrelioxGitHub/home-assistant | homeassistant/components/sensor/mqtt_room.py | 3 | 5135 | """
Support for MQTT room presence detection.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mqtt_room/
"""
import logging
import json
from datetime import timedelta
import voluptuous as vol
from homeassistant.components import mqtt
import homea... | apache-2.0 |
p0psicles/SickRage | lib/imdb/parser/http/searchCompanyParser.py | 76 | 2929 | """
parser.http.searchCompanyParser module (imdb package).
This module provides the HTMLSearchCompanyParser class (and the
search_company_parser instance), used to parse the results of a search
for a given company.
E.g., when searching for the name "Columbia Pictures", the parsed page would be:
http://akas.imdb.co... | gpl-3.0 |
iguzu/gae-django | tests/modeltests/custom_pk/fields.py | 14 | 1452 | import random
import string
from django.db import models
class MyWrapper(object):
def __init__(self, value):
self.value = value
def __repr__(self):
return "<%s: %s>" % (self.__class__.__name__, self.value)
def __unicode__(self):
return self.value
def __eq__(self, other):
... | bsd-3-clause |
tszym/ansible | lib/ansible/modules/notification/typetalk.py | 8 | 3392 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.0',
... | gpl-3.0 |
wakiyamap/electrum-mona | electrum_mona/tests/test_wallet_vertical.py | 1 | 362987 | import unittest
from unittest import mock
import shutil
import tempfile
from typing import Sequence
import asyncio
import copy
from electrum_mona import storage, bitcoin, keystore, bip32, slip39, wallet
from electrum_mona import Transaction
from electrum_mona import SimpleConfig
from electrum_mona.address_synchronizer... | mit |
JQIamo/artiq | artiq/compiler/validators/local_access.py | 2 | 8256 | """
:class:`LocalAccessValidator` verifies that local variables
are not accessed before being used.
"""
from functools import reduce
from pythonparser import diagnostic
from .. import ir, analyses
def is_special_variable(name):
return "$" in name
class LocalAccessValidator:
def __init__(self, engine):
... | lgpl-3.0 |
wdxzzia/autokey | setup.py | 46 | 2758 | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# 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 pr... | gpl-3.0 |
hrashk/sympy | sympy/physics/quantum/tests/test_density.py | 25 | 9696 | from sympy import pprint, latex, symbols, S, log
from sympy.matrices import Matrix
from sympy.core.trace import Tr
from sympy.external import import_module
from sympy.physics.quantum.density import Density, entropy, fidelity
from sympy.physics.quantum.state import Ket, Bra, TimeDepKet
from sympy.physics.quantum.qubit i... | bsd-3-clause |
dhozac/napkin | master/napkin-master.py | 1 | 12404 | #!/usr/bin/python -tt
# vim:set ts=4 sw=4 expandtab:
#
# napkin - processes reports from agents
# Copyright (C) 2011 Daniel Hokka Zakrisson <daniel@hozac.com>
#
# 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 Soft... | gpl-3.0 |
ftomassetti/intellij-community | python/lib/Lib/site-packages/django/contrib/contenttypes/models.py | 307 | 4052 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
class ContentTypeManager(models.Manager):
# Cache to avoid re-looking up ContentType objects all over the place.
# This cache is shared by all the get_for_* methods.
_cache ... | apache-2.0 |
ftomassetti/intellij-community | python/lib/Lib/quopri.py | 424 | 6969 | #! /usr/bin/env python
"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""
# (Dec 1991 version).
__all__ = ["encode", "decode", "encodestring", "decodestring"]
ESCAPE = '='
MAXLINESIZE = 76
HEX = '0123456789ABCDEF'
EMPTYSTRING = ''
try:
from binascii import a2b_qp, b2a_qp
except Impo... | apache-2.0 |
LLNL/spack | var/spack/repos/builtin/packages/r-rspectra/package.py | 5 | 1463 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRspectra(RPackage):
"""R interface to the 'Spectra' library <https://spectralib.org/> for... | lgpl-2.1 |
podemos-info/odoo | addons/account/wizard/account_invoice_refund.py | 8 | 12871 | # -*- 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 |
Zlash65/erpnext | erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py | 9 | 6199 | # 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
from frappe.utils import flt, getdate, nowdate
from frappe import _
def execute(filters=None):
if not filters: filters = {}
columns = ... | gpl-3.0 |
ted-gould/nova | nova/conductor/tasks/base.py | 56 | 1639 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
APCVSRepo/sdl_implementation_reference | src/3rd_party-static/gmock-1.7.0/gtest/test/gtest_list_tests_unittest.py | 1898 | 6515 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.