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 |
|---|---|---|---|---|---|
Edraak/edraak-platform | lms/djangoapps/course_api/tests/test_forms.py | 1 | 4312 | """
Tests for Course API forms.
"""
from itertools import product
from urllib import urlencode
import ddt
from django.contrib.auth.models import AnonymousUser
from django.http import QueryDict
from openedx.core.djangoapps.util.test_forms import FormTestMixin
from student.tests.factories import UserFactory
from xmodu... | agpl-3.0 |
aerickson/ansible | lib/ansible/modules/network/panos/panos_security_policy.py | 32 | 16234 | #!/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 |
edx/edx-platform | lms/djangoapps/static_template_view/urls.py | 5 | 2381 | """
URLs for static_template_view app
"""
from django.conf import settings
from django.conf.urls import url
from lms.djangoapps.static_template_view import views
urlpatterns = [
# Semi-static views (these need to be rendered and have the login bar, but don't change)
url(r'^404$', views.render, {'template': ... | agpl-3.0 |
xxshutong/openerp-7.0 | openerp/addons/account/report/account_partner_balance.py | 40 | 12701 | # -*- 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 |
xhteam/git-repo | subcmds/grep.py | 33 | 7918 | #
# Copyright (C) 2009 The Android Open Source Project
#
# 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 la... | apache-2.0 |
aninternetof/bremen | bremenenv/lib/python3.5/site-packages/django/contrib/sites/migrations/0001_initial.py | 378 | 1134 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import django.contrib.sites.models
from django.contrib.sites.models import _simple_domain_name_validator
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.Create... | mit |
sloanyang/android_kernel_huawei_mediapad10fhd | Documentation/target/tcm_mod_builder.py | 3119 | 42754 | #!/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 |
jostep/tensorflow | tensorflow/contrib/keras/python/keras/regularizers.py | 58 | 2778 | # 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 |
tastyproject/tasty | tasty/tastyc/tastyc.py | 1 | 9949 | # -*- coding: utf-8 -*-
"""tastyc configuration module"""
import copy
import sys
import os.path
from ast import *
import gc
from tasty import state
from tasty.exc import TastySyntaxError
from tasty.types import *
from tasty.tastyc import bases
from tasty.tastyc.codegen import to_source
from tasty.tastyc.analyzati... | gpl-3.0 |
liu602348184/django | django/forms/utils.py | 169 | 5975 | from __future__ import unicode_literals
import json
import sys
from django.conf import settings
from django.core.exceptions import ValidationError # backwards compatibility
from django.utils import six, timezone
from django.utils.encoding import force_text, python_2_unicode_compatible
from django.utils.html import e... | bsd-3-clause |
indhub/mxnet | python/mxnet/module/base_module.py | 4 | 47155 | # 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 u... | apache-2.0 |
mitsei/dlkit | dlkit/json_/authorization/searches.py | 1 | 11337 | """JSON implementations of authorization searches."""
# pylint: disable=no-init
# Numerous classes don't require __init__.
# pylint: disable=too-many-public-methods,too-few-public-methods
# Number of methods are defined in specification
# pylint: disable=protected-access
# Access to protected methods allow... | mit |
RuudBurger/CouchPotatoServer | libs/apscheduler/events.py | 144 | 2529 | __all__ = ('EVENT_SCHEDULER_START', 'EVENT_SCHEDULER_SHUTDOWN',
'EVENT_JOBSTORE_ADDED', 'EVENT_JOBSTORE_REMOVED',
'EVENT_JOBSTORE_JOB_ADDED', 'EVENT_JOBSTORE_JOB_REMOVED',
'EVENT_JOB_EXECUTED', 'EVENT_JOB_ERROR', 'EVENT_JOB_MISSED',
'EVENT_ALL', 'SchedulerEvent', 'JobStoreEve... | gpl-3.0 |
chrisguiney/mudpy | mudpy/character/__init__.py | 1 | 1901 | from functools import partial
from .. import races
from .. import classes
from ..magic import SpellBook
class Character(object):
def __init__(self, name, description, equipment, inventory, attributes, level=1, race="Human", base_class="Fighter",
spellbook=None):
"""
@param name... | apache-2.0 |
azunite/chrome_build | third_party/boto/pyami/startup.py | 107 | 2471 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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, modi... | bsd-3-clause |
rob356/SickRage | sickbeard/metadata/mede8er.py | 7 | 17705 | # Author: Nic Wolfe <nic@wolfeden.ca>
# 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 version 3 of the License,... | gpl-3.0 |
yize/grunt-tps | tasks/lib/python/Lib/python2.7/encodings/cp869.py | 593 | 33221 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.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 |
canaltinova/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/config.py | 2 | 7312 | import json
import logging
import os
from collections import defaultdict, Mapping
import sslutils
from localpaths import repo_root
from .utils import get_port
_renamed_props = {
"host": "browser_host",
"bind_hostname": "bind_address",
"external_host": "server_host",
"host_ip": "server_host",
}
d... | mpl-2.0 |
jakobworldpeace/scikit-learn | doc/tutorial/text_analytics/solutions/exercise_02_sentiment.py | 104 | 3139 | """Build a sentiment analysis / polarity model
Sentiment analysis can be casted as a binary text classification problem,
that is fitting a linear classifier on features extracted from the text
of the user messages so as to guess wether the opinion of the author is
positive or negative.
In this examples we will use a ... | bsd-3-clause |
saneyuki/servo | python/servo/util.py | 2 | 6629 | # Copyright 2013 The Servo Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
#... | mpl-2.0 |
UbuntuBudgie/budgie-welcome | scripts/translation-support.py | 3 | 16500 | #! /usr/bin/python3
# -*- coding:utf-8 -*-
#
# Copyright (C) 2016 Robin Thompson (robint99)
#
# edgar-allan is free software: you can redistribute it and/or modify
# it under the temms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... | gpl-2.0 |
kevinkahn/softconsole | screens/specificscreens/weatherscreen.py | 1 | 6148 | from collections import OrderedDict
import debug
import logsupport
from screens import screen
import screens.__screens as screens
from keyspecs import toucharea
from utils import utilities, fonts, hw
from stores import valuestore
from utils.utilfuncs import wc, fmt
from utils.weatherfromatting import CreateWeathBlock
... | apache-2.0 |
zulip/django | tests/test_client_regress/urls.py | 352 | 2521 | from django.conf.urls import include, url
from django.views.generic import RedirectView
from . import views
urlpatterns = [
url(r'', include('test_client.urls')),
url(r'^no_template_view/$', views.no_template_view),
url(r'^staff_only/$', views.staff_only_view),
url(r'^get_view/$', views.get_view),
... | bsd-3-clause |
TotalVerb/territory | territory/recurser.py | 1 | 3793 | # ------------------------------------------------------------------------
#
# This file is part of Territory.
#
# Territory 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 |
liangazhou/django-rdp | packages/Django-1.8.6/django/contrib/staticfiles/storage.py | 103 | 14788 | from __future__ import unicode_literals
import hashlib
import json
import os
import posixpath
import re
from collections import OrderedDict
from django.conf import settings
from django.contrib.staticfiles.utils import check_settings, matches_patterns
from django.core.cache import (
InvalidCacheBackendError, cache... | apache-2.0 |
CERNDocumentServer/invenio | modules/weblinkback/lib/weblinkback_dblayer.py | 1 | 13993 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011, 2012 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
Widiot/simpleblog | venv/lib/python3.5/site-packages/dominate/util.py | 25 | 3902 | '''
Utility classes for creating dynamic html documents
'''
__license__ = '''
This file is part of Dominate.
Dominate is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (a... | mit |
markrawlingson/SickRage | sickbeard/metadata/mede8er.py | 2 | 17319 | # Author: Nic Wolfe <nic@wolfeden.ca>
# 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 version 3 of the License,... | gpl-3.0 |
sghai/robottelo | robottelo/cli/base.py | 4 | 16454 | # -*- encoding: utf-8 -*-
"""Generic base class for cli hammer commands."""
import logging
import re
from robottelo import ssh
from robottelo.cli import hammer
from robottelo.config import settings
class CLIError(Exception):
"""Indicates that a CLI command could not be run."""
class CLIBaseError(Exception):
... | gpl-3.0 |
40023255/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/xml/sax/xmlreader.py | 824 | 12612 | """An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """
from . import handler
from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException
# ===== XMLREADER =====
class XMLReader:
"""Interface for reading an XML document using callbacks.
XMLReade... | gpl-3.0 |
FireLord1/android_kernel_motorola_msm8916 | 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 |
mabels/jmupdf | src/main/cpp/thirdparty/freetype-2.4.10/src/tools/cordic.py | 20 | 1667 | # compute arctangent table for CORDIC computations in fttrigon.c
import sys, math
#units = 64*65536.0 # don't change !!
units = 256
scale = units/math.pi
shrink = 1.0
comma = ""
def calc_val( x ):
global units, shrink
angle = math.atan(x)
shrink = shrink * math.cos(angle)
return an... | gpl-2.0 |
hosseinsadeghi/ultracold-ions | test/test_CoulombAccScaled.py | 2 | 4420 | import uci.CoulombAccScaled as uci
import numpy as np
import pyopencl as cl
import pyopencl.array as cl_array
testCtx = cl.create_some_context(interactive = True)
testQueue = cl.CommandQueue(testCtx)
def test_Constructor():
coulomb_acc = uci.CoulombAccScaled()
def test_ForceOnSingleParticleIsZero():
coulomb_... | mit |
vicky2135/lucious | oscar/lib/python2.7/site-packages/phonenumbers/data/region_SJ.py | 1 | 1936 | """Auto-generated file, do not edit by hand. SJ metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_SJ = PhoneMetadata(id='SJ', country_code=47, international_prefix='00',
general_desc=PhoneNumberDesc(national_number_pattern='0\\d{4}|[45789]\\d{7}', possible_number_p... | bsd-3-clause |
mburakergenc/Malware-Detection-using-Machine-Learning | cuckoo/analyzer/windows/analyzer.py | 1 | 30957 | # Copyright (C) 2010-2013 Claudio Guarnieri.
# Copyright (C) 2014-2016 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import datetime
import os
import sys
import socket
import struct
import pkgutil
import logging
import hash... | mit |
Al3XKOoL/tmp | 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 |
benschmaus/catapult | third_party/gsutil/third_party/boto/boto/cloudtrail/exceptions.py | 127 | 2246 | """
Exceptions that are specific to the cloudtrail module.
"""
from boto.exception import BotoServerError
class InvalidSnsTopicNameException(BotoServerError):
"""
Raised when an invalid SNS topic name is passed to Cloudtrail.
"""
pass
class InvalidS3BucketNameException(BotoServerError):
"""
... | bsd-3-clause |
konstruktoid/ansible-upstream | lib/ansible/plugins/callback/skippy.py | 59 | 1196 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
... | gpl-3.0 |
mhnatiuk/phd_sociology_of_religion | scrapper/build/scrapy/scrapy/contrib/downloadermiddleware/redirect.py | 7 | 4259 | from urlparse import urljoin
from scrapy import log
from scrapy.http import HtmlResponse
from scrapy.utils.response import get_meta_refresh
from scrapy.exceptions import IgnoreRequest, NotConfigured
class BaseRedirectMiddleware(object):
enabled_setting = 'REDIRECT_ENABLED'
def __init__(self, settings):
... | gpl-2.0 |
40223211/2015cd_midterm- | static/Brython3.1.1-20150328-091302/Lib/threading.py | 730 | 45641 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
from time import sleep as _sleep
try:
from time import monotonic as _time
except ImportError:
from time import time as _time
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
# No... | gpl-3.0 |
chris-chris/tensorflow | tensorflow/contrib/linalg/python/ops/linear_operator_tril.py | 7 | 7633 | # 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 |
luca76/QGIS | python/plugins/processing/tests/utilities_test.py | 8 | 2730 | # -*- coding: utf-8 -*-
"""
***************************************************************************
utilities_test.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
************************... | gpl-2.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env64/lib/python2.7/encodings/mac_latin2.py | 647 | 8565 | """ Python Character Mapping Codec generated from 'LATIN2.TXT' with gencodec.py.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,erro... | gpl-2.0 |
lem9/weblate | openshift/wsgi_install.py | 1 | 3249 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright © 2014 Daniel Tschan <tschan@puzzle.ch>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Foun... | gpl-3.0 |
gibsjose/SpectrumSite | Utilities/SteeringGenerator.py | 1 | 3470 | #!/usr/bin/python
import sys
# Input dictionary from KVP file
d = {}
# Defaults dictionary
defaults = {}
# Checks whether the key exists in the input dictionary
def Write(_key, _file):
if _key in d:
if not d[_key].strip():
_file.write("; ")
_file.write(_key + ' = ' + d[_key])
el... | mit |
mclaughlin6464/pearce | bin/mcmc/pearce_mcmc_xigg_emu1_shot.py | 1 | 2151 | from pearce.emulator import OriginalRecipe, ExtraCrispy, SpicyBuffalo
from pearce.inference import run_mcmc_iterator
import numpy as np
from os import path
import cPickle as pickle
#training_file = '/u/ki/swmclau2/des/xi_cosmo_trainer/PearceRedMagicXiCosmoFixedNd.hdf5'
training_file = '/scratch/users/swmclau2/xi_zheng... | mit |
m4rx9/rna-pdb-tools | rna_tools/tools/PyMOL4RNA/libs/show_contacts.py | 1 | 15707 | #!/usr/bin/python
"""
PyMOL plugin that provides show_contacts command and GUI
for highlighting good and bad polar contacts.
Factored out of clustermols by Matthew Baumgartner.
The advantage of this package is it requires many fewer dependencies.
Modified: Marcin Magnus 2020
Source <https://pymolwiki.org/index.p... | mit |
c86j224s/snippet | Python_Pygments/lib/python3.6/site-packages/pygments/lexers/ecl.py | 31 | 5875 | # -*- coding: utf-8 -*-
"""
pygments.lexers.ecl
~~~~~~~~~~~~~~~~~~~
Lexers for the ECL language.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, words
from pygments.... | apache-2.0 |
caronc/nzbget-subliminal | Subliminal/oauthlib/oauth1/rfc5849/endpoints/base.py | 49 | 10388 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth1.rfc5849.endpoints.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for signing and checking OAuth 1.0 RFC 5849 requests.
"""
from __future__ import absolute_import, unicode_literals
import time
from oauthlib.common import... | gpl-3.0 |
ibab/tensorflow | tensorflow/python/training/ftrl.py | 9 | 5634 | # 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 |
wavemind/mlgcb | tests/functional/review_module.py | 16 | 64711 | # Copyright 2013 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 ... | apache-2.0 |
Axelrod-Python/axelrod-evolver | tests/integration/test_cycler_integration.py | 1 | 1543 | import os
import tempfile
import unittest
import axelrod as axl
import axelrod_dojo as axl_dojo
class TestCyclerParams(unittest.TestCase):
def setUp(self):
pass
def test_default_single_opponent_e2e(self):
temp_file = tempfile.NamedTemporaryFile()
# we will set the objective to be
... | mit |
gnieboer/gnuradio | gr-analog/python/analog/qa_pll_freqdet.py | 40 | 6611 | #!/usr/bin/env python
#
# Copyright 2004,2007,2010-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at ... | gpl-3.0 |
airelil/pywinauto | pywinauto/findbestmatch.py | 1 | 20748 | # GUI Application automation and testing library
# Copyright (C) 2006-2018 Mark Mc Mahon and Contributors
# https://github.com/pywinauto/pywinauto/graphs/contributors
# http://pywinauto.readthedocs.io/en/latest/credits.html
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or with... | bsd-3-clause |
patmcb/odoo | openerp/report/render/rml2pdf/utils.py | 381 | 7143 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesse... | agpl-3.0 |
thaumos/ansible | lib/ansible/modules/network/aci/aci_encap_pool.py | 27 | 8605 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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',
'status': ['preview'],
... | gpl-3.0 |
kailoa/hyde | hydeengine/templatetags/affliiates.py | 62 | 4305 | # affiliates.py
from django import template
from django.utils import html
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe
import urllib;
if (not vars().has_key('ITUNES_AFFILIATE_ID')):
ITUNES_AFFILIATE_ID = 'FU9TTuAveps'
if (not vars().has_key('AMAZON_AFFILIAT... | mit |
bopo/tablib | tablib/packages/openpyxl3/reader/workbook.py | 116 | 5961 | # file openpyxl/reader/workbook.py
# Copyright (c) 2010 openpyxl
#
# 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... | mit |
joopert/home-assistant | tests/components/mobile_app/conftest.py | 4 | 1689 | """Tests for mobile_app component."""
# pylint: disable=redefined-outer-name,unused-import
import pytest
from tests.common import mock_device_registry
from homeassistant.setup import async_setup_component
from homeassistant.components.mobile_app.const import DOMAIN
from .const import REGISTER, REGISTER_CLEARTEXT
... | apache-2.0 |
Surbias/surbias.github.io | node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/compiled.py | 94 | 155159 | # -*- coding: utf-8 -*-
"""
pygments.lexers.compiled
~~~~~~~~~~~~~~~~~~~~~~~~
Lexers for compiled languages.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from string import Template
from pygments.lexer import Lexer, Rege... | mit |
RIKILT/CITESspeciesDetect | CheckCriteriaBlastSingleSample.py | 1 | 5204 | #!/usr/bin/env python
# Script which test the different filtering thresholds per barcode
# Returns per barcode the detected species which match the criteria
import sys
import os
### Get the OTU abundance from the file (This is per barcode)
def GetOTUabundance(statFile, pOTU):
# Local variables
f = open(statFile)
... | bsd-3-clause |
carljm/django | django/contrib/gis/gdal/libgdal.py | 64 | 3563 | from __future__ import unicode_literals
import logging
import os
import re
from ctypes import CDLL, CFUNCTYPE, c_char_p, c_int
from ctypes.util import find_library
from django.contrib.gis.gdal.error import GDALException
from django.core.exceptions import ImproperlyConfigured
logger = logging.getLogger('django.contri... | bsd-3-clause |
cybercercher/crits | crits/domains/api.py | 21 | 4555 | from django.core.urlresolvers import reverse
from tastypie import authorization
from tastypie.authentication import MultiAuthentication
from crits.domains.domain import Domain
from crits.domains.handlers import add_new_domain
from crits.core.api import CRITsApiKeyAuthentication, CRITsSessionAuthentication
from crits.c... | mit |
gacarrillor/QGIS | tests/src/python/test_qgsrangeslider.py | 23 | 8739 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsRangeSlider
.. 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.
"""
__a... | gpl-2.0 |
jberci/resolwe | resolwe/flow/views/data.py | 1 | 8515 | """Data viewset."""
from elasticsearch_dsl.query import Q
from django.db import transaction
from django.db.models import Count
from rest_framework import exceptions, mixins, status, viewsets
from rest_framework.decorators import list_route
from rest_framework.response import Response
from resolwe.elastic.composer im... | apache-2.0 |
dsseter/tornado | tornado/test/gen_test.py | 60 | 43781 | from __future__ import absolute_import, division, print_function, with_statement
import contextlib
import datetime
import functools
import sys
import textwrap
import time
import weakref
from tornado.concurrent import return_future, Future
from tornado.escape import url_escape
from tornado.httpclient import AsyncHTTPC... | apache-2.0 |
Guigov1/googletest | test/gtest_uninitialized_test.py | 2901 | 2480 | #!/usr/bin/env python
#
# Copyright 2008, 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 |
westinedu/wrgroups | dbindexer/compiler.py | 61 | 1433 | from .resolver import resolver
from django.utils.importlib import import_module
def __repr__(self):
return '<%s, %s, %s, %s>' % (self.alias, self.col, self.field.name,
self.field.model.__name__)
from django.db.models.sql.where import Constraint
Constraint.__repr__ = __repr__
# TODO: manipulate a copy of ... | bsd-3-clause |
fyfcauc/android_external_chromium-org | third_party/tlslite/tlslite/SharedKeyDB.py | 359 | 1914 | """Class for storing shared keys."""
from utils.cryptomath import *
from utils.compat import *
from mathtls import *
from Session import Session
from BaseDB import BaseDB
class SharedKeyDB(BaseDB):
"""This class represent an in-memory or on-disk database of shared
keys.
A SharedKeyDB can be passed to a s... | bsd-3-clause |
nikhilprathapani/python-for-android | python-build/python-libs/gdata/src/gdata/Crypto/Protocol/AllOrNothing.py | 226 | 10952 | """This file implements all-or-nothing package transformations.
An all-or-nothing package transformation is one in which some text is
transformed into message blocks, such that all blocks must be obtained before
the reverse transformation can be applied. Thus, if any blocks are corrupted
or lost, the original message... | apache-2.0 |
bryanmontesv/incubator-spot | spot-oa/oa/components/reputation/fb/fb.py | 4 | 4776 | #
# 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 |
jimyx17/jimh | lib/requests/packages/chardet/langhebrewmodel.py | 235 | 11340 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | gpl-3.0 |
ai-ku/langvis | jython-2.1/Lib/copy_reg.py | 4 | 1035 | """Helper to provide extensibility for pickle/cPickle.
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""
from types import ClassType as _ClassType
__all__ = ["pickle","constructor"]
dispatch_table = {}
safe_constructors = {}
def ... | mit |
chungjjang80/FRETBursts | fretbursts/utils/examples/matplotlib_figure_mod_toolbar.py | 2 | 1276 | """
Example on how to add widgets the toolbar of a Matplotlib figure using the
QT backend.
No QT application is created, only the toolbar of the native MPL figure is
modified.
"""
from PySide import QtGui, QtCore
import matplotlib
def test():
plot([1,2,3], lw=2)
q = qt4_interface(gcf())
return q # WA... | gpl-2.0 |
simonpatrick/bite-project | deps/gdata-python-client/src/gdata/tlslite/__init__.py | 409 | 1129 | """
TLS Lite is a free python library that implements SSL v3, TLS v1, and
TLS v1.1. TLS Lite supports non-traditional authentication methods
such as SRP, shared keys, and cryptoIDs, in addition to X.509
certificates. TLS Lite is pure python, however it can access OpenSSL,
cryptlib, pycrypto, and GMPY for faster crypt... | apache-2.0 |
tumdum/bittornado | btcompletedir.py | 4 | 1075 | #!/usr/bin/env python
# Written by Bram Cohen
# see LICENSE.txt for license information
from BitTornado import PSYCO
if PSYCO.psyco:
try:
import psyco
assert psyco.__version__ >= 0x010100f0
psyco.full()
except:
pass
from sys import argv, version, exit
assert version >= '2', "I... | mit |
campbe13/openhatch | vendor/packages/Django/django/test/client.py | 83 | 21917 | from __future__ import unicode_literals
import sys
import os
import re
import mimetypes
from copy import copy
from io import BytesIO
try:
from urllib.parse import unquote, urlparse, urlsplit
except ImportError: # Python 2
from urllib import unquote
from urlparse import urlparse, urlsplit
from django.c... | agpl-3.0 |
tashaband/RYU295 | ryu/lib/ovs/bridge.py | 10 | 9148 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2012 Isaku Yamahata <yamahata at private email ne jp>
#
# 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
#
# h... | apache-2.0 |
QuintonJason/qvids | front-end/build/libvpx/test/android/scrape_gtest_log.py | 83 | 1563 | # Copyright (c) 2014 The WebM project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project auth... | mit |
citrix-openstack-build/nova | nova/tests/compute/test_compute_cells.py | 11 | 7181 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Rackspace Hosting
# 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.apach... | apache-2.0 |
astroclark/bhextractor | bin/bhex_scalemassdemo.py | 1 | 4019 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014-2015 James Clark <james.clark@ligo.org>
#
# 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
... | gpl-2.0 |
vileopratama/vitech | src/addons/resource/resource.py | 14 | 36909 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import datetime
from datetime import timedelta
from dateutil import rrule
from dateutil.relativedelta import relativedelta
from openerp.tools import DEFAULT_SERVER_DATE_FORMAT
from operator import itemgetter
from opener... | mit |
zsjohny/jumpserver | apps/assets/models/utils.py | 3 | 2663 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
from django.utils import timezone
from django.core.cache import cache
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from common.utils import validate_ssh_private_key
__all__ = [
'init_model', 'generate_f... | gpl-2.0 |
samzhang111/scikit-learn | sklearn/feature_selection/univariate_selection.py | 5 | 23708 | """Univariate features selection."""
# Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay.
# L. Buitinck, A. Joly
# License: BSD 3 clause
import numpy as np
import warnings
from scipy import special, stats
from scipy.sparse import issparse
from ..base import BaseEstimator
from ..prepr... | bsd-3-clause |
jeremy24/rnn-classifier | letter_tools.py | 1 | 1759 | import glob
import imghdr
import os
import PIL
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
def _is_ascii(s):
return all(ord(c) < 128 for c in s)
def text2png(text, fullpath, color="#FFF", bgcolor="#000",
fontfullpath="assets/fonts/Oswald-Bold.ttf",
fontsize=35, leftpadding=3,... | mit |
kubaszostak/gdal-dragndrop | osgeo/apps/Python27/Lib/site-packages/pkg_resources/_vendor/pyparsing.py | 213 | 229867 | # module pyparsing.py
#
# Copyright (c) 2003-2016 Paul T. McGuire
#
# 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 u... | mit |
mihaisoloi/conpaas | conpaas-director/setup.py | 1 | 2293 | #!/usr/bin/env python
import os
import sys
import shutil
from pwd import getpwnam
from grp import getgrnam
from setuptools import setup
from pkg_resources import Requirement, resource_filename
CPSVERSION = '1.2.0'
CONFDIR = '/etc/cpsdirector'
if not os.geteuid() == 0:
CONFDIR = 'cpsdirectorconf'
long_descript... | bsd-3-clause |
sssilver/angler | rod/rod/handler/lesson.py | 1 | 3347 | import flask
import decimal
import dateutil.parser
import flask.ext.login
import rod
import rod.model.student
import rod.model.lesson
import rod.model.group
import rod.model.company
import rod.model.transaction
import rod.model.schemas
lesson_handler = flask.Blueprint('lesson', __name__)
@lesson_handler.route('/le... | bsd-3-clause |
henry-ngo/VIP | vip_hci/preproc/skysubtraction.py | 1 | 4110 | #! /usr/bin/env python
"""
Module with sky subtraction function.
"""
from __future__ import division
__author__ = 'C. Gomez @ ULg'
__all__ = ['cube_subtract_sky_pca']
import numpy as np
def cube_subtract_sky_pca(sci_cube, sky_cube, mask, ref_cube=None, ncomp=2):
""" PCA based sky subtraction.
Parameters
... | mit |
ubic135/odoo-design | addons/stock_dropshipping/wizard/__init__.py | 313 | 1077 | # -*- 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 |
Antiun/yelizariev-saas | saas_utils/connector.py | 13 | 1300 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010, 2014 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | lgpl-3.0 |
Dfelker/ansible | lib/ansible/cli/doc.py | 44 | 11261 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# 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 i... | gpl-3.0 |
dangwy/lantern | src/github.com/getlantern/flashlight/genconfig/cfg2redis.py | 113 | 3062 | #!/usr/bin/env python
import hashlib
import os
import sys
try:
import redis
except ImportError:
print "This requires redis-py. Try something like"
print " pip install hiredis ; pip install redis"
sys.exit(1)
try:
import yaml
except ImportError:
print "This requires PyYaml. Try something l... | apache-2.0 |
WingGao/bson | bson/tests/test_object.py | 2 | 1383 | #!/usr/bin/env python
from unittest import TestCase
from bson import BSONCoding, dumps, loads, import_class
class TestData(BSONCoding):
def __init__(self, *args):
self.args = list(args)
self.nested = None
def bson_encode(self):
return {"args" : self.args, "nested" : self.nested}
... | bsd-3-clause |
tiborsimko/invenio-oauthclient | tests/conftest.py | 1 | 10459 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Pytest configuration."""
from __future__ import absolute_import, print_function
... | mit |
darkleons/lama | addons/gamification/wizard/update_goal.py | 386 | 1848 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
fdroid/gp-peak-kernel | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
geimer/easybuild-easyblocks | easybuild/easyblocks/__init__.py | 2 | 2720 | # #
# Copyright 2009-2014 Ghent University
# Copyright 2009-2014 Stijn De Weirdt
# Copyright 2010 Dries Verdegem
# Copyright 2010-2014 Kenneth Hoste
# Copyright 2011 Pieter De Baets
# Copyright 2011-2014 Jens Timmerman
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://... | gpl-2.0 |
lkhomenk/integration_tests | cfme/tests/perf/workloads/test_capacity_and_utilization.py | 8 | 3294 | """Runs Capacity and Utilization Workload."""
from cfme.utils import conf
from cfme.utils.grafana import get_scenario_dashboard_urls
from cfme.utils.log import logger
from cfme.utils.providers import get_crud
from cfme.utils.smem_memory_monitor import add_workload_quantifiers, SmemMemoryMonitor
from cfme.utils.workloa... | gpl-2.0 |
jlguardi/yowsup | yowsup/registration/regrequest.py | 16 | 2601 | '''
Copyright (c) <2012> Tarek Galal <tare2.galal@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,
merg... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.