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 |
|---|---|---|---|---|---|
benjaminrigaud/django | django/contrib/formtools/preview.py | 103 | 5753 | """
Formtools Preview application.
"""
from django.http import Http404
from django.shortcuts import render_to_response
from django.template.context import RequestContext
from django.utils.crypto import constant_time_compare
from django.contrib.formtools.utils import form_hmac
AUTO_ID = 'formtools_%s' # Each form her... | bsd-3-clause |
mariopro/youtube-dl | youtube_dl/extractor/youtube.py | 8 | 89391 | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
import os.path
import re
import time
import traceback
from .common import InfoExtractor, SearchInfoExtractor
from ..jsinterp import JSInterpreter
from ..swfinterp import SWFInterpreter
from ..compat import (
compat_chr,
com... | unlicense |
google-research/ssl_detection | third_party/tensorpack/tensorpack/tfutils/export.py | 1 | 6395 | # -*- coding: utf-8 -*-
# File: export.py
"""
A collection of functions to ease the process of exporting
a model for production.
"""
import tensorflow as tf
from tensorflow.python.framework import graph_util
from tensorflow.python.platform import gfile
from tensorflow.python.tools import optimize_for_inference_lib
... | apache-2.0 |
akbargumbira/inasafe | safe/gui/tools/rectangle_map_tool.py | 3 | 5016 | # coding=utf-8
"""Map tool implementation for selecting rectangles.
Based on work by Guisepe Sucameli, 2010. Updated for coding compliance etc.
by Tim Sutton, Oct 2014.
.. versionadded:: 2.2.0
"""
from qgis.core import QgsPoint, QgsRectangle, QGis
# pylint: disable=no-name-in-module
from qgis.gui import QgsRubberBa... | gpl-3.0 |
muravjov/ansible-modules-core | files/acl.py | 38 | 9767 | #!/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 |
ShashaQin/frappe | frappe/tests/__init__.py | 70 | 1107 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
def insert_test_data(doctype, sort_fn=None):
import frappe.model
data = get_test_doclist(doctype)
if sort_fn:
data = sorted(data, key=sort_fn)
for doclist in data:
frapp... | mit |
suncycheng/intellij-community | python/lib/Lib/site-packages/django/views/generic/edit.py | 73 | 7509 | from django.forms import models as model_forms
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseRedirect
from django.views.generic.base import TemplateResponseMixin, View
from django.views.generic.detail import (SingleObjectMixin,
SingleObjectTemplateRe... | apache-2.0 |
kefin/django-garage | garage/tests/slugify/tests.py | 1 | 8824 | # -*- coding: utf-8 -*-
"""
tests.slugify.tests
Tests for garage.slugify
* created: 2014-08-24 Kevin Chan <kefin@makedostudio.com>
* updated: 2015-02-23 kchan
"""
from __future__ import (absolute_import, unicode_literals)
from mock import Mock, patch, call
try:
from django.test import override_settings
except ... | bsd-3-clause |
tiagocoutinho/qarbon | qarbon/color.py | 2 | 3706 | # ----------------------------------------------------------------------------
# This file is part of qarbon (http://qarbon.rtfd.org/)
#
# Copyright (c) 2013 European Synchrotron Radiation Facility, Grenoble, France
#
# Distributed under the terms of the GNU Lesser General Public License,
# either version 3 of the Lice... | lgpl-3.0 |
nopjmp/SickRage | lib/mako/codegen.py | 61 | 48384 | # mako/codegen.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides functionality for rendering a parsetree constructing into module
source code."""
impo... | gpl-3.0 |
mcolom/ipolDevel | tools/migrations/demoinfo_db_migration.py | 1 | 4289 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public Licence (GPL)
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# v... | agpl-3.0 |
frodrigo/osmose-backend | plugins/TagFix_Deprecated.py | 4 | 7672 | #-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frederic Rodrigo 2012 ##
## ... | gpl-3.0 |
OSEHRA/VistA | Scripts/GitUtils.py | 1 | 9780 | #---------------------------------------------------------------------------
# Copyright 2013-2019 The Open Source Electronic Health Record Alliance
#
# 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 Licen... | apache-2.0 |
inessadl/kinect-2-libras | Kinect2Libras/KinectFingerTracking/Lib/distutils/sysconfig.py | 41 | 21356 | """Provide access to Python's configuration information. The specific
configuration variables available depend heavily on the platform and
configuration. The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys(). Additional convenience functions are a... | apache-2.0 |
cesargtz/YecoraOdoo | addons/l10n_in_hr_payroll/report/report_hr_yearly_salary_detail.py | 374 | 6855 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under th... | agpl-3.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_11_01/aio/operations/_load_balancer_backend_address_pools_operations.py | 1 | 8800 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
bcaligari/mbox_defiler | filededup.py | 1 | 4945 | #!/usr/bin/env python3
# Copyright (c) 2017 Brendon Caligari <caligari@cypraea.co.uk>
# This file is released under GPL v3.0
import logging
import pathlib
import unfile
import json
class FileDedup(object):
"""Dedup existing files in a directory and add more unique files.
The directory is first scanned and d... | gpl-3.0 |
hack4impact/legal-checkup | app/api/forms.py | 1 | 1404 | from flask_wtf import Form
from wtforms.fields import (
BooleanField,
FieldList,
FormField,
SelectField,
SelectMultipleField,
SubmitField,
TextAreaField,
TextField
)
from wtforms.validators import InputRequired, Length
class ParameterForm(Form):
param_name = TextField('Parameter Nam... | mit |
edonyM/emthesis | code/3point2plane.py | 1 | 3545 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------... | mit |
ArcherCraftStore/ArcherVMPeridot | Python/Lib/site-packages/tornado/test/stack_context_test.py | 9 | 11717 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado import gen
from tornado.log import app_log
from tornado.stack_context import (StackContext, wrap, NullContext, StackContextInconsistentError,
ExceptionStackContext, run... | apache-2.0 |
Juniper/tempest | tempest/lib/common/fixed_network.py | 2 | 5178 | # 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 |
hai046/MSS | shadowsocks/local.py | 1015 | 2248 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
unsiloai/syntaxnet-ops-hack | tensorflow/examples/label_image/label_image.py | 43 | 4812 | # 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 |
glmcdona/meddle | examples/base/Lib/getpass.py | 233 | 5563 | """Utilities to get a password and/or the current user name.
getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.
GetPassWarning - This UserWarning is issued when getpass() cannot prevent
echoing of the passw... | mit |
rduivenvoorde/QGIS | tests/src/python/test_qgsaggregatecalculator.py | 13 | 22276 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsAggregateCalculator.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version... | gpl-2.0 |
openssbd/OpenSSBD | SSBD/BDML/views.py | 1 | 39099 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.http import HttpResponse
from django.core.urlresolvers import reverse
from django.core import serializers
fr... | gpl-3.0 |
cpennington/edx-platform | openedx/core/djangoapps/heartbeat/tests/test_heartbeat.py | 4 | 1526 | """
Test the heartbeat
"""
import json
from django.db.utils import DatabaseError
from django.test.client import Client
from django.urls import reverse
from mock import patch
from xmodule.exceptions import HeartbeatFailure
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
class HeartbeatTestCa... | agpl-3.0 |
nugget/home-assistant | homeassistant/components/switch/demo.py | 8 | 1976 | """
Demo platform that has two fake switches.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
from homeassistant.components.switch import SwitchDevice
from homeassistant.const import DEVICE_DEFAULT_NAME
def setup_platform(hass, config, add_entiti... | apache-2.0 |
cyrixhero/scrapy | scrapy/commands/bench.py | 151 | 1640 | import sys
import time
import subprocess
from six.moves.urllib.parse import urlencode
import scrapy
from scrapy.commands import ScrapyCommand
from scrapy.linkextractors import LinkExtractor
class Command(ScrapyCommand):
default_settings = {
'LOG_LEVEL': 'INFO',
'LOGSTATS_INTERVAL': 1,
'... | bsd-3-clause |
yakovenkodenis/rethinkdb | external/v8_3.30.33.16/build/gyp/test/win/gyptest-cl-warning-level.py | 344 | 1394 | #!/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.
"""
Make sure warning level is extracted properly.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(for... | agpl-3.0 |
hyperized/ansible | test/units/modules/network/fortios/test_fortios_system_autoupdate_schedule.py | 21 | 6296 | # Copyright 2019 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 |
sahiljain/catapult | third_party/gsutil/third_party/boto/tests/unit/ec2/test_address.py | 109 | 5950 | from tests.compat import mock, unittest
from boto.ec2.address import Address
class AddressTest(unittest.TestCase):
def setUp(self):
self.address = Address()
self.address.connection = mock.Mock()
self.address.public_ip = "192.168.1.1"
def check_that_attribute_has_been_set(self, name, ... | bsd-3-clause |
2uller/LotF | App/Lib/site-packages/numpy/core/tests/test_numeric.py | 5 | 53896 | import sys
import platform
from decimal import Decimal
import numpy as np
from numpy.core import *
from numpy.random import rand, randint, randn
from numpy.testing import *
from numpy.core.multiarray import dot as dot_
class Vec(object):
def __init__(self,sequence=None):
if sequence is None:
... | gpl-2.0 |
UIKit0/friture | friture/octavespectrum.py | 1 | 9254 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Timoth?Lecomte
# This file is part of Friture.
#
# Friture is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# Friture is distribu... | gpl-3.0 |
artekw/mqtt-panel | display.py | 1 | 2265 | import datetime
import time
from ht1632cpy import HT1632C
import settings
from lightsensor import getLight
interface = HT1632C(2, 0)
interface.pwm(settings.read('settings', 'matrix', 'default_brightness'))
def dimmer():
dimmer_brightness = settings.read('settings', 'matrix', 'dimmer_brightness')
default_br... | mit |
mikewiebe-ansible/ansible | lib/ansible/modules/network/f5/bigip_monitor_https.py | 25 | 23041 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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.1',
... | gpl-3.0 |
syfares/Transfercoin | share/seeds/generate-seeds.py | 128 | 4187 | #!/usr/bin/python
# Copyright (c) 2014 Wladmir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory ... | mit |
infobloxopen/neutron | neutron/tests/unit/plugins/ml2/drivers/cisco/apic/test_apic_sync.py | 30 | 3419 | # Copyright (c) 2014 Cisco Systems
# 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 require... | apache-2.0 |
fevxie/odoo | addons/project/report/__init__.py | 444 | 1069 | # -*- 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 |
younggi-hong/linux-imx-ranix | 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 |
krieger-od/nwjs_chromium.src | tools/find_depot_tools.py | 63 | 1415 | # Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Small utility function to find depot_tools and add it to the python path.
Will throw an ImportError exception if depot_tools can't be found since it
i... | bsd-3-clause |
wagnerand/addons-server | src/olympia/addons/migrations/0030_auto_20210118_1527.py | 4 | 1764 | # Generated by Django 2.2.17 on 2021-01-18 15:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('addons', '0029_delete_appsupport'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='addons',
... | bsd-3-clause |
seung-lab/znn-release | python/emirt/label2omni/label2omni.py | 2 | 1735 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 19 18:45:44 2015
@author: jingpeng
"""
import h5py
import emirt
import numpy as np
import os
#%% raw data
def chann(infname, outfname):
# check file
if os.path.exists(outfname):
os.remove( outfname )
chan = emirt.emio.imread(infname)
... | gpl-3.0 |
gibiansky/tensorflow | tensorflow/python/kernel_tests/summary_audio_op_test.py | 134 | 2594 | # 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 |
saisrisathya/whatsapps | build/lib/yowsup/layers/protocol_groups/protocolentities/iq_groups_participants_add.py | 61 | 1089 | from yowsup.structs import ProtocolEntity, ProtocolTreeNode
from .iq_groups_participants import ParticipantsGroupsIqProtocolEntity
class AddParticipantsIqProtocolEntity(ParticipantsGroupsIqProtocolEntity):
'''
<iq type="set" id="{{id}}" xmlns="w:g2", to="{{group_jid}}">
<add>
<participant j... | gpl-3.0 |
potatolondon/django-nonrel-1-4 | django/contrib/localflavor/gb/forms.py | 89 | 1976 | """
GB-specific Form helpers
"""
from __future__ import absolute_import
import re
from django.contrib.localflavor.gb.gb_regions import GB_NATIONS_CHOICES, GB_REGION_CHOICES
from django.forms.fields import CharField, Select
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as... | bsd-3-clause |
Slko/Slot | slot/handlers/text_generation.py | 1 | 2447 | import asyncio
import random
from slot import requires
from slot.handlers import BaseHandler, MessageHandled, command, unhandled_messages
class PoemHandler(BaseHandler):
def generate_poem(self, start=None):
textgen = self.bot.extensions["textgen"]
rhyme = self.bot.extensions["rhyme"]
line... | bsd-3-clause |
MarishaYasko/interactive-stories-stands | InteractiveStands/Lib/encodings/cp855.py | 272 | 33850 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | mit |
daavery/audacity | lib-src/lv2/sord/waflib/Tools/flex.py | 314 | 1057 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import waflib.TaskGen,os,re
def decide_ext(self,node):
if'cxx'in self.features:
return['.lex.cc']
return['.lex.c']
def flexfun(tsk):
env=tsk.env
bld=tsk.generator.bld
w... | gpl-2.0 |
Frodox/buildbot | worker/buildbot_worker/base.py | 2 | 14691 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
pgmillon/ansible | lib/ansible/modules/notification/mqtt.py | 10 | 7615 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 2014, Jan-Piet Mens <jpmens () gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '... | gpl-3.0 |
harisibrahimkv/django | tests/test_runner/test_parallel.py | 42 | 2607 | import unittest
from django.test import SimpleTestCase
from django.test.runner import RemoteTestResult
try:
import tblib
except ImportError:
tblib = None
class ExceptionThatFailsUnpickling(Exception):
"""
After pickling, this class fails unpickling with an error about incorrect
arguments passed ... | bsd-3-clause |
PulsePod/old-www-do-not-use | lib/python2.7/site-packages/pip/vendor/html5lib/treewalkers/lxmletree.py | 80 | 6214 | from __future__ import absolute_import, division, unicode_literals
from pip.vendor.six import text_type
from lxml import etree
from ..treebuilders.etree import tag_regexp
from gettext import gettext
_ = gettext
from . import _base
from .. import ihatexml
def ensure_str(s):
if s is None:
return None
... | mit |
googlecreativelab/three.js | utils/exporters/blender/addons/io_three/logger.py | 121 | 1589 | import os
import logging
import tempfile
from . import constants
LOG_FILE = None
LOGGER = None
LEVELS = {
constants.DEBUG: logging.DEBUG,
constants.INFO: logging.INFO,
constants.WARNING: logging.WARNING,
constants.ERROR: logging.ERROR,
constants.CRITICAL: logging.CRITICAL
}
def init(filename, l... | mit |
fhqgfss/MoHa | moha/posthf/cc/ccsd.py | 1 | 9945 | import numpy as np
def spinfock(eorbitals):
"""
"""
if type(eorbitals) is np.ndarray:
dim = 2*len(eorbitals)
fs = np.zeros(dim)
for i in range(0,dim):
fs[i] = eorbitals[i//2]
fs = np.diag(fs) # put MO energies in diagonal array
elif type(eorbitals) is dict:
... | mit |
disruptek/boto | boto/directconnect/exceptions.py | 22 | 1238 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
abusse/cinder | cinder/brick/executor.py | 11 | 1241 | # (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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 re... | apache-2.0 |
yuwenchao/yuwenchao.github.io | talkmap.py | 205 | 1188 |
# # Leaflet cluster map of talk locations
#
# (c) 2016-2017 R. Stuart Geiger, released under the MIT license
#
# Run this from the _talks/ directory, which contains .md files of all your talks.
# This scrapes the location YAML field from each .md file, geolocates it with
# geopy/Nominatim, and uses the getorg librar... | mit |
yolanother/ubuntumobidev_ubiquity | autopilot/ubiquity_autopilot_tests/configs/custom_install.py | 4 | 1131 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
#
# Copyright (C) 2013
#
# Author: Daniel Chapman daniel@chapman-mail.com
#
# This program 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 ... | gpl-3.0 |
VelocityRa/scummvm | gui/themes/scummtheme.py | 26 | 3309 | #!/usr/bin/env python
# encoding: utf-8
import sys
import re
import os
import zipfile
THEME_FILE_EXTENSIONS = ('.stx', '.bmp', '.fcc', '.ttf', '.png')
def buildTheme(themeName):
if not os.path.isdir(themeName) or not os.path.isfile(os.path.join(themeName, "THEMERC")):
print ("Invalid theme name: " + themeName)
r... | gpl-2.0 |
YanTangZhai/tf | tensorflow/python/training/saver_test.py | 3 | 22516 | # Copyright 2015 Google 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 applicable law or a... | apache-2.0 |
lociii/django-simple-menu | menu/tests/test_menu.py | 4 | 3351 | import unittest
from django.conf import settings
from django.template import Template, Context
from django.test import TestCase
from django.test.client import RequestFactory
from menu import Menu, MenuItem
class MenuTests(TestCase):
def setUp(self):
kids2 = [
MenuItem("kids2-1", "/parent2/kid... | bsd-3-clause |
imperodesign/paas-tools | deis/prd/controller/api/tests/test_key.py | 2 | 7020 | # -*- coding: utf-8 -*-
"""
Unit tests for the Deis api app.
Run the tests with "./manage.py test api"
"""
from __future__ import unicode_literals
import json
from django.contrib.auth.models import User
from django.test import TestCase
from rest_framework.authtoken.models import Token
from api.models import Key
fr... | mit |
yoni206/ducking-octo-wallhack | project/target/node-modules/webjars/npm/node_modules/node-gyp/gyp/tools/pretty_vcproj.py | 2637 | 9586 | #!/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.
"""Make the format of a vcproj really pretty.
This script normalize and sort an xml. It also fetches all the properties
inside linked... | mit |
stxnext-kindergarten/presence-analyzer-dczuba | src/presence_analyzer/tests.py | 1 | 15917 | # -*- coding: utf-8 -*-
"""
Presence analyzer unit tests.
"""
import os.path
import json
import datetime
import unittest
from mock import patch
from random import randint
from presence_analyzer import main, views, utils, decorators, helpers
CURRENT_PATH = os.path.dirname(__file__)
TEST_DATA_CSV = os.path.join(
CU... | mit |
dennerlager/sepibrews | sepibrews/statemachine.py | 1 | 2712 | import logging
import logging.handlers
from multiprocessing import Queue
from execution_engine import ExecutionEngine
class StateMachine():
def __init__(self, brewView, tempControllerAddress, interfaceLock):
self.brewView = brewView
self.tempControllerAddress = tempControllerAddress
self.qT... | gpl-3.0 |
bkiefer/openccg | src/ccg2xml/ccg_editor.py | 3 | 52586 | #!/usr/bin/python
# Author: Ben Wing <ben@666.com>
# Date: April 2006
#############################################################################
# #
# ccg_editor.ply #
# ... | lgpl-2.1 |
tcwicklund/django | tests/dates/tests.py | 293 | 3733 | from __future__ import unicode_literals
import datetime
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import Article, Category, Comment
class DatesTests(TestCase):
def test_related_model_traverse(self):
a1 = Article.objects.crea... | bsd-3-clause |
silkyar/570_Big_Little | build/ARM/python/m5/internal/param_BaseGarnetNetwork.py | 1 | 4646 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 1.3.40
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import d... | bsd-3-clause |
scripteed/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/wire_format_test.py | 571 | 10848 | #! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# http://code.google.com/p/protobuf/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# ... | gpl-3.0 |
renyi533/tensorflow | tensorflow/python/autograph/converters/logical_expressions.py | 2 | 4499 | # 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 |
russel1237/scikit-learn | sklearn/gaussian_process/regression_models.py | 259 | 2166 | # -*- coding: utf-8 -*-
# Author: Vincent Dubourg <vincent.dubourg@gmail.com>
# (mostly translation, see implementation details)
# Licence: BSD 3 clause
"""
The built-in regression models submodule for the gaussian_process module.
"""
import numpy as np
def constant(x):
"""
Zero order polynomial (... | bsd-3-clause |
avanov/django | django/core/management/commands/check.py | 316 | 1892 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import apps
from django.core import checks
from django.core.checks.registry import registry
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = "Checks the entire Django project for p... | bsd-3-clause |
pswaminathan/t1-python | terminalone/models/placementslot.py | 1 | 3030 | # -*- coding: utf-8 -*-
"""Provides placement_slot object."""
from __future__ import absolute_import
from datetime import datetime
from .. import t1types
from ..entity import Entity
from ..vendor import six
def update_low_priority(original, candidate):
for item, value in six.iteritems(candidate):
if item... | apache-2.0 |
wooga/airflow | airflow/www/decorators.py | 5 | 4577 | #
# 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 |
normtown/SickRage | lib/rtorrent/group.py | 179 | 3116 | # Copyright (c) 2013 Dean Gardiner, <gardiner91@gmail.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify,... | gpl-3.0 |
community-ssu/telepathy-gabble | tests/twisted/test-fallback-socks5-proxy.py | 1 | 13474 |
import socket
from gabbletest import (
exec_test, elem, elem_iq, sync_stream, make_presence, send_error_reply,
make_result_iq, sync_stream)
from servicetest import (
EventPattern, call_async, assertEquals, assertLength,
assertDoesNotContain)
from caps_helper import send_disco_reply
from bytestream imp... | lgpl-2.1 |
madprime/django_celery_fileprocess_example | django_celery_fileprocess_example/settings.py | 1 | 2311 | """
Django settings for django_celery_fileprocess_example project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.p... | apache-2.0 |
philippze/django-cms | cms/south_migrations/0008_redirects.py | 1680 | 20032 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()
user_orm_label... | bsd-3-clause |
abadger/ansible | lib/ansible/module_utils/common/collections.py | 15 | 3868 | # Copyright: (c) 2018, Sviatoslav Sydorenko <ssydoren@redhat.com>
# Copyright: (c) 2018, Ansible Project
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
"""Collection of low-level utility functions."""
from __future__ import absolute_import, division, print_fu... | gpl-3.0 |
lgeiger/ide-python | lib/debugger/VendorLib/vs-py-debugger/pythonFiles/experimental/ptvsd/ptvsd/_vendored/pydevd/pydev_ipython/matplotlibtools.py | 8 | 5428 |
import sys
backends = {'tk': 'TkAgg',
'gtk': 'GTKAgg',
'wx': 'WXAgg',
'qt': 'Qt4Agg', # qt3 not supported
'qt4': 'Qt4Agg',
'qt5': 'Qt5Agg',
'osx': 'MacOSX'}
# We also need a reverse backends2guis mapping that will properly choose which
# GUI sup... | mit |
mcollins12321/anita | venv/lib/python2.7/site-packages/pip/cmdoptions.py | 136 | 15878 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them
globally. One reason being that options with action='append' can carry state
between parses. pip parses general options twice internally, and shouldn't
pass on state. To be consistent, all options will follow this de... | mit |
zorojean/scikit-learn | sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py | 221 | 5517 | """
Testing for the gradient boosting loss functions and initial estimators.
"""
import numpy as np
from numpy.testing import assert_array_equal
from numpy.testing import assert_almost_equal
from numpy.testing import assert_equal
from nose.tools import assert_raises
from sklearn.utils import check_random_state
from ... | bsd-3-clause |
takis/odoo | addons/l10n_ch/__openerp__.py | 260 | 2575 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Financial contributors: Hasa SA, Open Net SA,
# Prisme Solutions Informatique SA, Quod SA
#
# Translation contributors: brain-te... | agpl-3.0 |
bbc/kamaelia | Sketches/AB/Bookmarks-Dev/SocialBookmarks/PureFilter.py | 15 | 1238 | #!/usr/bin/python
import Axon
class PureFilter(Axon.Component.component):
def __init__(self, filterfunc=None,**argd):
super(PureFilter, self).__init__(**argd)
if filterfunc is None:
self.filterfunc = self.filtertest
else:
self.filterfunc = filterfunc
def filtert... | apache-2.0 |
jeffrey4l/nova | nova/virt/vmwareapi/ds_util.py | 23 | 16718 | # Copyright (c) 2014 VMware, 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 a... | apache-2.0 |
indrekots/python_koans | python3/koans/about_scope.py | 107 | 3445 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from runner.koan import *
from . import jims
from . import joes
counter = 0 # Global
class AboutScope(Koan):
#
# NOTE:
# Look in jims.py and joes.py to see definitions of Dog used
# for this set of tests
#
def test_dog_is_not_available_in_th... | mit |
nanjj/softlayer-python | SoftLayer/managers/dns.py | 2 | 5234 | """
SoftLayer.dns
~~~~~~~~~~~~~
DNS Manager/helpers
:license: MIT, see LICENSE for more details.
"""
import time
from SoftLayer import utils
class DNSManager(utils.IdentifierMixin, object):
"""Manage SoftLayer DNS.
See product information here: http://www.softlayer.com/DOMAIN-SERVICES
... | mit |
titom1986/CouchPotatoServer | couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/veehd.py | 15 | 2284 | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..utils import (
compat_urlparse,
get_element_by_id,
clean_html,
)
class VeeHDIE(InfoExtractor):
_VALID_URL = r'https?://veehd\.com/video/(?P<id>\d+)'
_TEST = {
'url': 'http://veehd.com/... | gpl-3.0 |
bdorney/CMS_GEM_Analysis_Framework | python/reparam1DObs2Gain.py | 1 | 3162 | import sys, os
from ROOT import gROOT, TClass, TFile, TH1F, TIter, TKey
if __name__ == "__main__":
#Import Options
from AnalysisOptions import *
from Utilities import getall, PARAMS_GAIN
#Specific Options
parser.add_option("--ident", type="string", dest="strIdent",
help="Substring within ... | gpl-3.0 |
HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/mpl_toolkits/axisartist/grid_helper_curvelinear.py | 18 | 26105 | """
An experimental support for curvilinear grid.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from six.moves import zip
from itertools import chain
from .grid_finder import GridFinder
from .axislines import AxisArtistHelper, GridHelperB... | gpl-2.0 |
hdinsight/hue | desktop/core/ext-py/django-openid-auth-0.5/django_openid_auth/urls.py | 44 | 1696 | # django-openid-auth - OpenID integration for django.contrib.auth
#
# Copyright (C) 2007 Simon Willison
# Copyright (C) 2008-2013 Canonical Ltd.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions o... | apache-2.0 |
DimensionDataCBUSydney/mist.io | src/mist/io/hub/shell.py | 6 | 5645 | import sys
import logging
import gevent
import gevent.socket
import mist.io.exceptions
import mist.io.model
import mist.io.shell
import mist.io.hub.main
log = logging.getLogger(__name__)
class ShellHubWorker(mist.io.hub.main.HubWorker):
def __init__(self, *args, **kwargs):
super(ShellHubWorker, self... | agpl-3.0 |
txomon/SpockBot | spock/plugins/helpers/entities.py | 1 | 6342 | """
An entity tracker
"""
import logging
from spock.plugins.base import PluginBase
from spock.utils import Info, pl_announce
logger = logging.getLogger('spock')
class MCEntity(Info):
eid = 0
status = 0
nbt = None
class ClientPlayerEntity(MCEntity):
metadata = None
class MovementEntity(MCEntity):... | mit |
drawks/ansible | test/sanity/code-smell/no-illegal-filenames.py | 52 | 2022 | #!/usr/bin/env python
# a script to check for illegal filenames on various Operating Systems. The
# main rules are derived from restrictions on Windows
# https://msdn.microsoft.com/en-us/library/aa365247#naming_conventions
import os
import re
import struct
from ansible.module_utils.basic import to_bytes
ILLEGAL_CHA... | gpl-3.0 |
mrMuffins/dogepartyd | lib/util.py | 4 | 31807 | import time
import decimal
import sys
import json
import logging
import apsw
import collections
import inspect
import requests
from datetime import datetime
from dateutil.tz import tzlocal
from operator import itemgetter
import fractions
import warnings
from . import (config, exceptions)
D = decimal.Decimal
b26_digit... | mit |
erkanay/django | tests/view_tests/models.py | 160 | 1313 | """
Regression tests for Django built-in views.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
def get_absolute_ur... | bsd-3-clause |
irinabov/debian-qpid-python | qpid_tests/broker_0_10/msg_groups.py | 3 | 42893 | #
# 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 |
alexbuyval/ardupilot | Tools/scripts/add_git_hashes.py | 216 | 1614 | #!/usr/bin/env python
'''
Add git hashes to .px4 file for PX4/Pixhawk build
Written by Jon Challinger January 2015
'''
import json
import sys
import os
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('input_file')
parser.add_argument('output_file')
parser.add_argument('--ard... | gpl-3.0 |
ohduran/CrowdFinanceInfographic | tests/test_basic.py | 1 | 2207 | """Test cases for the project."""
import sys
import unittest
# Import modules from sample
sys.path.insert(0, 'sample')
import core
import helpers
# Set up the data that we are using in tests.
data = helpers.open_json_as_dict('jsons/bigsample.json')
class BasicTest(unittest.TestCase):
"""Basic Test functionality... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.