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 |
|---|---|---|---|---|---|
alistairlow/tensorflow | tensorflow/python/framework/dtypes_test.py | 10 | 14160 | # 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 |
basicthinker/Sexain-MemController | gem5-stable/src/dev/BadDevice.py | 69 | 1789 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... | apache-2.0 |
isolver/MarkWrite | distribution/MarkWrite/runapp.py | 2 | 1605 | # -*- coding: utf-8 -*-
from __future__ import division
#
# This file is part of the open-source MarkWrite application.
#
# 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 ... | gpl-3.0 |
kmmartins/xbmc | lib/libUPnP/Neptune/Extras/Tools/Logging/NeptuneLogConsole.py | 265 | 2923 | #!/usr/bin/env python
from socket import *
from optparse import OptionParser
UDP_ADDR = "0.0.0.0"
UDP_PORT = 7724
BUFFER_SIZE = 65536
#HEADER_KEYS = ['Logger', 'Level', 'Source-File', 'Source-Function', 'Source-Line', 'TimeStamp']
HEADER_KEYS = {
'mini': ('Level'),
'standard': ('Logger', 'Level', 'Source-Func... | gpl-2.0 |
imgmix/django-registration | registration/backends/simple/urls.py | 18 | 1601 | """
URLconf for registration and activation, using django-registration's
one-step backend.
If the default behavior of these views is acceptable to you, simply
use a line like this in your root URLconf to set up the default URLs
for registration::
(r'^accounts/', include('registration.backends.simple.urls')),
Thi... | bsd-3-clause |
ThoriumGroup/thorium | setup.py | 1 | 7980 | #!/usr/bin/env python
"""
setup.py
========
This is a generic as possible setup.py template. The goal is to retrieve almost
all of the information from the main module file, rather than relying on values
explicitly entered here.
## Usage
This setup.py script needs to modified in the following ways:
- `MAIN_FILE` n... | mit |
Ironarcher/casso-backend | lib/flask/module.py | 850 | 1363 | # -*- coding: utf-8 -*-
"""
flask.module
~~~~~~~~~~~~
Implements a class that represents module blueprints.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
from .blueprints import Blueprint
def blueprint_is_module(bp):
"""Used to figure ou... | apache-2.0 |
geekboxzone/lollipop_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/layout_tests/port/config.py | 68 | 2993 | # Copyright (C) 2010 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 |
vadimtk/chrome4sdp | build/android/gyp/util/build_device.py | 2 | 3283 | # 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 simple device interface for build steps.
"""
import logging
import os
import re
import sys
from util import build_utils
BUILD_ANDROID_DIR = os.path... | bsd-3-clause |
Fudan-University/sakai | reference/library/src/webapp/editor/FCKeditor/editor/filemanager/connectors/py/connector.py | 126 | 4239 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
h... | apache-2.0 |
ChakshuGautam/coursera-dl | coursera/test/test_parsing.py | 15 | 3627 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test functionality of coursera module.
"""
import json
import os.path
import pytest
from six import iteritems
from mock import patch, Mock, mock_open
from coursera import coursera_dl
# JSon Handling
@pytest.fixture
def get_page(monkeypatch):
monkeypatch.setat... | lgpl-3.0 |
paulscherrerinstitute/snapshot | snapshot/gui/snapshot_gui.py | 1 | 15841 | #!/usr/bin/env python
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
import datetime
import json
import os
import sys
from PyQt5 import QtCore
from PyQt5.QtCore import Qt, QTime... | gpl-3.0 |
bzloink/psi4 | conda/_conda_vers.py | 3 | 1480 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2017 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
sslattery/Chimera | doc/spn/fuel_assembly/sp3/fs_azilut02.py | 1 | 16598 | ###############################################################################
## fs.py
## 9te [angband.ornl.gov]
## Wed Jan 12 10:37:50 2011
###############################################################################
## Copyright (C) 2008 Oak Ridge National Laboratory, UT-Battelle, LLC.
##------------------------... | bsd-3-clause |
hejunbok/paparazzi | sw/ground_segment/python/udp_link/udp_link.py | 21 | 8628 | #!/usr/bin/env python
from ivy.std_api import *
import socket
import struct
import os
import logging
import sys
import threading
import time
sys.path.append(os.getenv("PAPARAZZI_HOME") + "/sw/lib/python")
import messages_xml_map
PING_PERIOD = 5.0
STATUS_PERIOD = 1.0
STX = 0x99
STX_TS = 0x98
DATALINK_PORT = 4243
D... | gpl-2.0 |
gurneyalex/odoo | addons/website/tests/test_qweb.py | 3 | 6800 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from odoo import http, tools
from odoo.addons.website.tools import MockRequest
from odoo.modules.module import get_module_resource
from odoo.tests.common import TransactionCase
class TestQweb(TransactionCase... | agpl-3.0 |
jjmleiro/hue | desktop/core/ext-py/Django-1.6.10/django/forms/extras/widgets.py | 117 | 4978 | """
Extra HTML Widget classes
"""
from __future__ import unicode_literals
import datetime
import re
from django.forms.widgets import Widget, Select
from django.utils import datetime_safe
from django.utils.dates import MONTHS
from django.utils.encoding import force_str
from django.utils.safestring import mark_safe
fro... | apache-2.0 |
camptocamp/odoo | addons/account/project/wizard/account_analytic_journal_report.py | 378 | 3164 | # -*- 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 |
HailStorm32/Q.bo_stacks | qbo_arduqbo/src/qbo_arduqbo/srv/_TorqueEnable.py | 1 | 6300 | """autogenerated by genpy from qbo_arduqbo/TorqueEnableRequest.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
class TorqueEnableRequest(genpy.Message):
_md5sum = "e44dc96db32bd58b5a896c2c5bf316d0"
_type = "qbo_arduqbo/TorqueEnableRequest"
_has... | lgpl-2.1 |
priyaganti/rockstor-core | src/rockstor/smart_manager/views/detail_views.py | 2 | 2971 | """
Copyright (c) 2012-2013 RockStor, Inc. <http://rockstor.com>
This file is part of RockStor.
RockStor is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
by the Free Software Foundation; either version 2 of the License,
or (at your option) any la... | gpl-3.0 |
HydrelioxGitHub/home-assistant | homeassistant/components/intent_script/__init__.py | 14 | 2945 | """Handle intents with scripts."""
import copy
import logging
import voluptuous as vol
from homeassistant.helpers import (
intent, template, script, config_validation as cv)
DOMAIN = 'intent_script'
CONF_INTENTS = 'intents'
CONF_SPEECH = 'speech'
CONF_ACTION = 'action'
CONF_CARD = 'card'
CONF_TYPE = 'type'
CON... | apache-2.0 |
Jollytown/Garuda | server/garuda/lib/python2.7/site-packages/pip/download.py | 61 | 30557 | from __future__ import absolute_import
import cgi
import email.utils
import hashlib
import getpass
import json
import logging
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves.urllib i... | mit |
MwanzanFelipe/rockletonfortune | lib/django/conf/urls/__init__.py | 264 | 4592 | import warnings
from importlib import import_module
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import (
LocaleRegexURLResolver, RegexURLPattern, RegexURLResolver,
)
from django.utils import six
from django.utils.deprecation import (
RemovedInDjango20Warning, RemovedIn... | bsd-3-clause |
Mariaanisimova/pythonintask | INBa/2015/Shemenev_A_V/task_100_30.py | 1 | 3036 | #Задача №10, Вариант 30
#Напишите программу "Генератор персонажей" для игры.Пользователю должно быть предоставлено 30 пунктов,
#которые можно распределить между четырьмя характеристиками: Сила, Здоровье, Мудрость и Ловкость.
#Надо сделать так, чтобы пользователь мог не только брать эти пункты из общего "пула", но ... | apache-2.0 |
SangramChavan/Ubuntu-16.04-new-installation | GreenHat.py | 5 | 1211 | # Copyright (c) 2015 Angus H. (4148)
# Distributed under the GNU General Public License v3.0 (GPLv3).
from datetime import date, timedelta
from random import randint
from time import sleep
import sys
import subprocess
import os
# returns a date string for the date that is N days before STARTDATE
def get_date_string(n... | mit |
jereze/scikit-learn | examples/cluster/plot_feature_agglomeration_vs_univariate_selection.py | 218 | 3893 | """
==============================================
Feature agglomeration vs. univariate selection
==============================================
This example compares 2 dimensionality reduction strategies:
- univariate feature selection with Anova
- feature agglomeration with Ward hierarchical clustering
Both metho... | bsd-3-clause |
kanpol/eli | 2012/plugins_python/htmlize/core.py | 13 | 2324 | #-------------------------------------------------------------------------------
# htmlize: htmlize/core.py
#
# The core functionality of htmlize.
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#-------------------------------------------------------------------------------
from collections im... | unlicense |
jeremiedecock/snippets | python/matplotlib/hist_logscale_x.py | 1 | 1804 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Make a histogram using a logarithmic scale on X axis
See:
- http://stackoverflow.com/questions/6855710/how-to-have-logarithmic-bins-in-a-python-histogram
"""
import numpy as np
import matplotlib.pyplot as plt
# SETUP ###############################################... | mit |
kekivelez/DjangoSkeleton | tcshealth/users/views.py | 1 | 7243 | from django.shortcuts import render
# Create your views here.
import uuid
from rest_framework import status
from rest_framework.response import Response
from rest_framework import generics
from rest_framework import serializers as DRFserializers
from rest_framework import permissions
from rest_framework import rendere... | gpl-2.0 |
terryyin/linkchecker | third_party/dnspython/dns/rdtypes/ANY/NSEC.py | 100 | 4812 | # Copyright (C) 2004-2007, 2009-2011 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 "... | gpl-2.0 |
purushothamc/myibitsolutions | strings/justified_text.py | 1 | 1674 | def fullJustify(strings_list, number):
result = []
if not strings_list or number <= 0:
return result
current_length, idx, firstWord = 0, 0, True
for word in strings_list:
if firstWord:
result.append(word)
current_length += len(result[-1])
firstWord = F... | gpl-3.0 |
lesh1k/beatport-verifier | venv/lib/python2.7/site-packages/wheel/pep425tags.py | 220 | 2861 | """Generate and work with PEP 425 Compatibility Tags."""
import sys
try:
import sysconfig
except ImportError: # pragma nocover
# Python < 2.7
import distutils.sysconfig as sysconfig
import distutils.util
def get_abbr_impl():
"""Return abbreviated implementation name."""
if hasattr(sys, 'pypy_ve... | cc0-1.0 |
cjerdonek/pip | pip/exceptions.py | 123 | 1125 | """Exceptions used throughout package"""
from __future__ import absolute_import
class PipError(Exception):
"""Base pip exception"""
class InstallationError(PipError):
"""General exception during installation"""
class UninstallationError(PipError):
"""General exception during uninstallation"""
class ... | mit |
daodaoliang/bokeh | bokeh/charts/builder/tests/test_line_builder.py | 33 | 2376 | """ This is the Bokeh charts testing interface.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2014, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with thi... | bsd-3-clause |
opencord/voltha | voltha/adapters/adtran_olt/test/codec/test_olt_state.py | 1 | 4156 | # Copyright 2017-present Adtran, 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 writ... | apache-2.0 |
MRigal/django | django/contrib/contenttypes/migrations/0001_initial.py | 585 | 1227 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.contenttypes.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='ContentType',
fields=... | bsd-3-clause |
marinho/geraldo | site/newsite/site-geraldo/django/contrib/localflavor/is_/is_postalcodes.py | 438 | 4913 | # -*- coding: utf-8 -*-
IS_POSTALCODES = (
('101', u'101 Reykjavík'),
('103', u'103 Reykjavík'),
('104', u'104 Reykjavík'),
('105', u'105 Reykjavík'),
('107', u'107 Reykjavík'),
('108', u'108 Reykjavík'),
('109', u'109 Reykjavík'),
('110', u'110 Reykjavík'),
('111', u'111 Reykjavík'... | lgpl-3.0 |
pypot/scikit-learn | examples/decomposition/plot_pca_vs_lda.py | 182 | 1743 | """
=======================================================
Comparison of LDA and PCA 2D projection of Iris dataset
=======================================================
The Iris dataset represents 3 kind of Iris flowers (Setosa, Versicolour
and Virginica) with 4 attributes: sepal length, sepal width, petal length
a... | bsd-3-clause |
phlax/translate | translate/convert/factory.py | 3 | 7615 | # -*- coding: utf-8 -*-
#
# Copyright 2010 Zuza Software Foundation
#
# This file is part of the Translate Toolkit.
#
# 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 Lice... | gpl-2.0 |
Thraxis/pymedusa | tests/issue_submitter_tests.py | 1 | 2025 | # coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 vers... | gpl-3.0 |
jimdial/azure-quickstart-templates | splunk-on-ubuntu/scripts/config.py | 119 | 1408 | # The MIT License (MIT)
#
# Copyright (c) 2016 Microsoft. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | mit |
jonashaag/django-nonrel-nohistory | django/contrib/sessions/models.py | 231 | 2034 | import base64
import cPickle as pickle
from django.db import models
from django.utils.translation import ugettext_lazy as _
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
Returns the given session dictionary pickled and encoded as a string.
"""
return Se... | bsd-3-clause |
sparkslabs/kamaelia_ | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Apps/JMB/WSGI/_WSGIHandler.py | 3 | 15264 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | apache-2.0 |
riklaunim/django-custom-multisite | setup.py | 1 | 4043 | from distutils.core import setup
from distutils.command.install_data import install_data
from distutils.command.install import INSTALL_SCHEMES
import os
import sys
class osx_install_data(install_data):
# On MacOS, the platform-specific lib dir is /System/Library/Framework/Python/.../
# which is wrong. Python 2... | bsd-3-clause |
wakatime/wakadump | setup.py | 1 | 1515 | from setuptools import setup
about = {}
with open('wakadump/__about__.py') as f:
exec(f.read(), about)
packages = [
about['__title__'],
]
install_requires = [x.strip() for x in open('requirements.txt').readlines()]
setup(
name=about['__title__'],
version=about['__version__'],
license=about['__... | bsd-3-clause |
Autodesk/molecular-design-toolkit | moldesign/integrators/verlet.py | 1 | 2603 | from __future__ import print_function, absolute_import, division
from future.builtins import *
from future import standard_library
standard_library.install_aliases()
# Copyright 2017 Autodesk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | apache-2.0 |
sajeeshcs/nested_projects_keystone | keystone/tests/mapping_fixtures.py | 6 | 12218 | # 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 |
sktjdgns1189/android_kernel_pantech_ef63l | scripts/build-all.py | 24 | 10334 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... | gpl-2.0 |
mgohde/nudge-tools | tools/dbtool.py | 1 | 4655 | #!/usr/bin/python
import os
import sys
# Because of course Python has XML parsing built in.
import xml.etree.ElementTree as ET
# dbtool.py -- Quick and dirty tool to insert XML formatted storylines into the database.
def nodesearch(nodename, node):
for n in node:
if n.tag==nodename:
return n
... | gpl-2.0 |
elgambitero/FreeCAD_sf_master | src/Mod/Path/InitGui.py | 16 | 6342 | #***************************************************************************
#* (c) Yorik van Havre (yorik@uncreated.net) 2014 *
#* *
#* This file is part of the FreeCAD CAx development system. *
#* ... | lgpl-2.1 |
percy-g2/Novathor_xperia_u8500 | 6.2.A.1.100/external/webkit/Tools/Scripts/webkitpy/common/system/ospath_unittest.py | 15 | 2518 | # Copyright (C) 2010 Chris Jerdonek (cjerdonek@webkit.org)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and... | gpl-2.0 |
haxwithaxe/qutebrowser | qutebrowser/browser/history.py | 2 | 7443 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2016 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | gpl-3.0 |
parinporecha/backend_gtgonline | GTG/tests/test_urlregex.py | 1 | 1375 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2012 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | gpl-3.0 |
Nolski/airmozilla | airmozilla/manage/forms.py | 1 | 29803 | import re
import datetime
from collections import defaultdict
import dateutil.parser
import pytz
from django import forms
from django.db.models import Count
from django.conf import settings
from django.contrib.auth.models import User, Group
from django.utils.timezone import utc
from django.utils.safestring import mar... | bsd-3-clause |
catapult-project/catapult | third_party/google-endpoints/future/types/newlist.py | 82 | 2284 | """
A list subclass for Python 2 that behaves like Python 3's list.
The primary difference is that lists have a .copy() method in Py3.
Example use:
>>> from builtins import list
>>> l1 = list() # instead of {} for an empty list
>>> l1.append('hello')
>>> l2 = l1.copy()
"""
import sys
import copy
from future.ut... | bsd-3-clause |
michaelhowden/eden | controllers/vulnerability.py | 6 | 86050 | # -*- coding: utf-8 -*-
"""
Sahana Eden Vulnerability Controller
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# @ToDo: deployment_setting
#countries = ["TL", "VN"]
countries = ["VN"]
#DEBUG = True
#s... | mit |
uruz/django-rest-framework | runtests.py | 63 | 3080 | #! /usr/bin/env python
from __future__ import print_function
import os
import subprocess
import sys
import pytest
PYTEST_ARGS = {
'default': ['tests', '--tb=short', '-s'],
'fast': ['tests', '--tb=short', '-q', '-s'],
}
FLAKE8_ARGS = ['rest_framework', 'tests', '--ignore=E501']
ISORT_ARGS = ['--recursive', ... | bsd-2-clause |
hyperized/ansible | lib/ansible/module_utils/network/frr/providers/module.py | 20 | 2106 | #
# (c) 2019, Ansible by Red Hat, inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.connection import Connection
from ansible.module_utils.network.frr.providers import providers
from ansible.m... | gpl-3.0 |
CydarLtd/ansible | lib/ansible/modules/network/panos/panos_interface.py | 78 | 5736 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
MonicaHsu/truvaluation | venv/lib/python2.7/site-packages/gunicorn/util.py | 24 | 15402 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import fcntl
import io
import os
import pkg_resources
import random
import resource
import socket
import sys
import textwrap
import time
import traceback
import inspect
import errno
import wa... | mit |
marissazhou/django | django/template/backends/dummy.py | 480 | 2037 | # Since this package contains a "django" module, this is required on Python 2.
from __future__ import absolute_import
import errno
import io
import string
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import Origin, TemplateDoesNotExist
from django.utils... | bsd-3-clause |
izhukov/ansible | v2/ansible/plugins/inventory/__init__.py | 8 | 2702 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
mdg/pygrate | test/migration_test.py | 1 | 5291 | import unittest
import os.path
import types
from pygration.migration import VersionNumber, Loader
import pygration
@pygration.step_class
class TestStep(object):
ADD_FILE = 'add.sql'
class StepTest(unittest.TestCase):
def test_class_decorator(self):
self.assertEqual("test.migration_test", TestStep.ve... | apache-2.0 |
guerrerocarlos/odoo | openerp/tools/import_email.py | 337 | 6376 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
iuliat/nova | nova/objects/host_mapping.py | 29 | 5690 | # 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 |
ThePirateWhoSmellsOfSunflowers/Empire | lib/modules/powershell/situational_awareness/network/smbscanner.py | 10 | 5259 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-SMBScanner',
'Author': ['@obscuresec', '@harmj0y'],
'Description': ('Tests a username/password combination across a number of machines.'),
... | bsd-3-clause |
gram526/VTK | Rendering/Annotation/Testing/Python/bore.py | 20 | 2855 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# Create arc plots
# get the interactor ui
camera = vtk.vtkCamera()
# read the bore
bore = vtk.vtkPolyDataReader()
bore.SetFileName("" + str(VTK_DATA_ROOT) + "/Data/bore.vtk")
tuber =... | bsd-3-clause |
40223136/w17test2 | static/Brython3.1.3-20150514-095342/Lib/unittest/case.py | 743 | 48873 | """Test case implementation"""
import sys
import functools
import difflib
import pprint
import re
import warnings
import collections
from . import result
from .util import (strclass, safe_repr, _count_diff_all_purpose,
_count_diff_hashable)
__unittest = True
DIFF_OMITTED = ('\nDiff is %s charact... | gpl-3.0 |
jtyuan/racetrack | src/arch/x86/isa/insts/general_purpose/flags/set_and_clear.py | 91 | 2816 | # Copyright (c) 2007-2008 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware imp... | bsd-3-clause |
ianmiell/OLD-shutitdist | inetutils/inetutils.py | 1 | 1466 | """ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class inetutils(ShutItModule):
def is_installed(self, shutit):
return shutit.file_exists('/root/shutit_build/module_record/' + self.module_id + '/built')
def build(self, shutit):
shutit.send('mkdir -p /tmp/build/inetutils')
... | gpl-2.0 |
JackKelly/neuralnilm_prototype | scripts/experiment029.py | 2 | 3262 | from __future__ import division
import matplotlib.pyplot as plt
import numpy as np
import theano
import theano.tensor as T
import lasagne
from gen_data_029 import gen_data, N_BATCH, LENGTH
theano.config.compute_test_value = 'raise'
# Number of units in the hidden (recurrent) layer
N_HIDDEN = 5
# SGD learning rate
LEA... | mit |
Unow/edx-platform | common/lib/capa/capa/tests/test_correctmap.py | 61 | 5833 | """
Tests to verify that CorrectMap behaves correctly
"""
import unittest
from capa.correctmap import CorrectMap
import datetime
class CorrectMapTest(unittest.TestCase):
"""
Tests to verify that CorrectMap behaves correctly
"""
def setUp(self):
self.cmap = CorrectMap()
def test_set_inpu... | agpl-3.0 |
zmr/namsel | accuracy_test.py | 1 | 2139 | #encoding: utf-8
import cPickle as pickle
from classify import load_cls, label_chars
from cv2 import GaussianBlur
from feature_extraction import get_zernike_moments, get_hu_moments, \
extract_features, normalize_and_extract_features
from functools import partial
import glob
from multiprocessing.pool import Pool
im... | mit |
cdrooom/odoo | addons/account_payment/wizard/account_payment_order.py | 8 | 5838 | # -*- 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 |
jseabold/scipy | scipy/sparse/csc.py | 58 | 6330 | """Compressed Sparse Column matrix format"""
from __future__ import division, print_function, absolute_import
__docformat__ = "restructuredtext en"
__all__ = ['csc_matrix', 'isspmatrix_csc']
import numpy as np
from scipy._lib.six import xrange
from ._sparsetools import csc_tocsr
from . import _sparsetools
from .sp... | bsd-3-clause |
ktan2020/legacy-automation | win/Lib/test/test_os.py | 7 | 32181 | # As a test suite for the os module, this is woefully inadequate, but this
# does add tests for a few functions which have been determined to be more
# portable than they had been thought to be.
import os
import errno
import unittest
import warnings
import sys
import signal
import subprocess
import time
fr... | mit |
bruderstein/PythonScript | PythonLib/full/unittest/test/testmock/testmock.py | 1 | 71837 | import copy
import re
import sys
import tempfile
from test.support import ALWAYS_EQ
import unittest
from unittest.test.testmock.support import is_instance
from unittest import mock
from unittest.mock import (
call, DEFAULT, patch, sentinel,
MagicMock, Mock, NonCallableMock,
NonCallableMagicMock, AsyncMock,... | gpl-2.0 |
h3biomed/ansible | test/units/modules/network/fortimanager/test_fmgr_ha.py | 38 | 7774 | # Copyright 2018 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
GuilhermeGSousa/ardupilot | Tools/scripts/build_examples.py | 74 | 1075 | #!/usr/bin/env python
# useful script to test the build of all example code
# This helps when doing large merges
# Peter Barker, June 2016
# based on build_examples.sh, Andrew Tridgell, November 2012
import os
import sys
import optparse
sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), '.... | gpl-3.0 |
TheTacoScott/GoAtThrottleUp | ServerRelay/cherrypy/lib/gctools.py | 40 | 7396 | import gc
import inspect
import os
import sys
import time
try:
import objgraph
except ImportError:
objgraph = None
import cherrypy
from cherrypy import _cprequest, _cpwsgi
from cherrypy.process.plugins import SimplePlugin
class ReferrerTree(object):
"""An object which gathers all referrers of an object ... | mit |
moijes12/oh-mainline | vendor/packages/kombu/kombu/transport/django/__init__.py | 20 | 2175 | """Kombu transport using the Django database as a message store."""
from __future__ import absolute_import
from anyjson import loads, dumps
from django.conf import settings
from django.core import exceptions as errors
from kombu.five import Empty
from kombu.transport import virtual
from kombu.utils.encoding import b... | agpl-3.0 |
fangxingli/hue | apps/oozie/src/oozie/migrations/0023_auto__add_field_node_data__add_field_job_data.py | 37 | 26876 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Node.data'
db.add_column('oozie_node', 'data',
self.gf('django.db.mode... | apache-2.0 |
jbassen/edx-platform | lms/djangoapps/ccx/tests/test_models.py | 45 | 8622 | """
tests for the models
"""
from datetime import datetime, timedelta
from django.utils.timezone import UTC
from mock import patch
from nose.plugins.attrib import attr
from student.roles import CourseCcxCoachRole # pylint: disable=import-error
from student.tests.factories import ( # pylint: disable=import-error
A... | agpl-3.0 |
poulpito/Flexget | flexget/utils/log.py | 9 | 2557 | """Logging utilities"""
from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import logging
import hashlib
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, DateTime, Index
from flexge... | mit |
iglpdc/nipype | nipype/interfaces/semtools/diffusion/tests/test_auto_gtractResampleCodeImage.py | 12 | 1372 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from .....testing import assert_equal
from ..gtract import gtractResampleCodeImage
def test_gtractResampleCodeImage_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(noh... | bsd-3-clause |
rosswhitfield/mantid | scripts/BilbyCustomFunctions_Reduction.py | 3 | 17128 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
ccnmtl/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/model_formsets_regress/tests.py | 51 | 15361 | from django import forms
from django.forms.formsets import BaseFormSet, DELETION_FIELD_NAME
from django.forms.util import ErrorDict, ErrorList
from django.forms.models import modelform_factory, inlineformset_factory, modelformset_factory, BaseModelFormSet
from django.test import TestCase
from models import User, UserS... | gpl-3.0 |
BehavioralInsightsTeam/edx-platform | lms/djangoapps/courseware/features/problems.py | 23 | 6532 | '''
Steps for problem.feature lettuce tests
'''
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import step, world
from common import i_am_registered_for_the_course, visit_scenario_item
from problems_setup import PROBLEM_DICT, add_problem_to_course, answer_problem, problem_has... | agpl-3.0 |
vladimir-smirnov-sociomantic/graphite-api | tests/test_attime.py | 11 | 1100 | import datetime
import time
from graphite_api.render.attime import parseATTime
from . import TestCase
class AtTestCase(TestCase):
def test_parse(self):
for value in [
str(int(time.time())),
'20140319',
'20130319+1y',
'20130319+1mon',
'20130319+... | apache-2.0 |
xfournet/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_xrange.py | 326 | 2699 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes xrange(...) into range(...)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name, Call, consuming_calls
from .. import patcomp
class FixXrange(fixer_base.BaseFix):
BM_... | apache-2.0 |
halberom/ansible | hacking/metadata-tool.py | 20 | 21240 | #!/usr/bin/env python
import ast
import csv
import os
import sys
from collections import defaultdict
from distutils.version import StrictVersion
from pprint import pformat, pprint
import yaml
from ansible.module_utils._text import to_text
from ansible.plugins import module_loader
# There's a few files that are not... | gpl-3.0 |
PGer/incubator-hawq | tools/sbin/gpsegstop.py | 9 | 5806 | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
#
# Internal Use Function.
#
#
#
# THIS IMPORT MUST COME FIRST
#
# import mainUtils FIRST to get python version check
from gppylib.mainUtils import *
import os, sys, time, signal
from optparse import Option, OptionGroup, OptionParser,... | apache-2.0 |
CollabQ/CollabQ | vendor/django/db/models/sql/subqueries.py | 7 | 17710 | """
Query subclasses which provide extra functionality beyond simple data retrieval.
"""
from django.core.exceptions import FieldError
from django.db.models.sql.constants import *
from django.db.models.sql.datastructures import Date
from django.db.models.sql.expressions import SQLEvaluator
from django.db.models.sql.qu... | apache-2.0 |
VinceZK/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/commit.py | 124 | 5399 | # Copyright (C) 2010 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 th... | bsd-3-clause |
tensorflow/probability | tensorflow_probability/python/vi/optimization.py | 1 | 14806 | # Copyright 2018 The TensorFlow Probability 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 applicable law o... | apache-2.0 |
aver803bath5/igene_bot | bot.py | 1 | 1802 | # -*- coding: utf-8 -*-
from telegram.ext import Updater
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler,
ConversationHandler)
from bs4 import BeautifulSoup
from configparser import ConfigParser
from models import *
import logging
import re
import requ... | mit |
uxebu/tddbin-backend | src/tddbin/settings.py | 1 | 3937 | """
Django settings for tddbin project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | mit |
WoodNeck/tataru | cogs/sound.py | 1 | 7698 | import os
import asyncio
import logging
from discord import opus, ClientException
from discord.ext import commands
from discord.opus import OpusNotLoaded
from cogs.utils.music import Music
from cogs.utils.music_type import MusicType
from cogs.utils.music_player import MusicPlayer
OPUS_LIBS = ['libopus-0.x86.dll', 'lib... | mit |
gskachkov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/newstringio.py | 132 | 1757 | # Copyright (C) 2010 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 |
ronaldhan/python-data | sqlite2mysql_test.py | 1 | 3652 | # -*- coding: utf-8 -*-
import sqlite3 as lite
import MySQLdb
import python_mysql as mydb
try:
dbPath="C:/Program Files (x86)/火车采集器V8/Data"
fileName="/5/SpiderResult.db3"
tableName='yhxxl'
conn=lite.connect(dbPath+fileName)
conn.row_factory=lite.Row
cur=conn.cursor()
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.