repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
EmreAtes/spack | var/spack/repos/builtin/packages/py-fparser/package.py | 3 | 2259 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
mith1979/ansible_automation | applied_python/applied_python/lib/python2.7/site-packages/astroid/brain/brain_nose.py | 9 | 2766 | # copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# This file is part of astroid.
#
# astroid 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
#... | apache-2.0 |
DecipherOne/Troglodyte | Trog Build Dependencies/Python26/Lib/bsddb/test/test_lock.py | 33 | 5771 | """
TestCases for testing the locking sub-system.
"""
import time
import unittest
from test_all import db, test_support, verbose, have_threads, \
get_new_environment_path, get_new_database_path
if have_threads :
from threading import Thread
import sys
if sys.version_info[0] < 3 :
from thr... | mit |
maciejkula/scipy | scipy/interpolate/tests/test_polyint.py | 9 | 18758 | from __future__ import division, print_function, absolute_import
import warnings
from numpy.testing import (assert_almost_equal, assert_array_equal,
TestCase, run_module_suite, assert_allclose, assert_equal, assert_)
from scipy.interpolate import (KroghInterpolator, krogh_interpolate,
BarycentricInter... | bsd-3-clause |
drdangersimon/SSP_diffusion | diffuse.py | 1 | 8653 | '''Diffusion mapping by Ann B Lee, March 2009. Last modified, JWR: 3/23/2009 ported to python'''
import numpy as nu
from scipy.cluster.vq import kmeans2
#from scipy.sparse.linalg import svds as svd
from scipy.linalg import svd
def diffuse(D,eps_val,neigen=None,t=None,threshold = 5E-6):
''' diffuse(D,eps_val,t,n... | unlicense |
liangazhou/django-rdp | packages/eclipse/plugins/org.python.pydev_4.4.0.201510052309/pysrc/pydevd_io.py | 52 | 2490 | import pydevd_constants #@UnusedImport -- defines False and True if not there.
IS_PY3K = pydevd_constants.IS_PY3K
class IORedirector:
'''This class works to redirect the write function to many streams
'''
def __init__(self, *args):
self._redirectTo = args
def write(self, s):
for r in... | apache-2.0 |
cgre-aachen/gempy | gempy/plot/_plot.py | 1 | 14507 | """
This file is part of gempy.
gempy 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.
gempy is distributed in the h... | lgpl-3.0 |
talishte/ctigre | env/lib/python2.7/site-packages/django/contrib/auth/tests/urls.py | 105 | 4961 | from django.conf.urls import patterns, url
from django.contrib.auth import context_processors
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth.urls import urlpatterns
from django.contrib.auth.views import password_reset, login
from django.contrib.auth.decorators import login_required
fr... | bsd-2-clause |
40123158/2017springcd_hw | plugin/liquid_tags/audio.py | 277 | 2161 | """
Audio Tag
---------
This implements a Liquid-style audio tag for Pelican,
based on the pelican video plugin [1]_
Syntax
------
{% audio url/to/audio [url/to/audio] [/url/to/audio] %}
Example
-------
{% audio http://example.tld/foo.mp3 http://example.tld/foo.ogg %}
Output
------
<audio controls><source src="http:... | agpl-3.0 |
craynot/django | tests/template_tests/syntax_tests/test_filter_tag.py | 521 | 1795 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class FilterTagTests(SimpleTestCase):
@setup({'filter01': '{% filter upper %}{% endfilter %}'})
def test_filter01(self):
output = self.engine.render_to_string('filter01')
self.ass... | bsd-3-clause |
noseka1/ansible-modules-core | files/unarchive.py | 49 | 13065 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2013, Dylan Martin <dmartin@seattlecentral.edu>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the t... | gpl-3.0 |
Just-D/chromium-1 | tools/site_compare/commands/timeload.py | 189 | 4936 | # 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.
"""SiteCompare command to time page loads
Loads a series of URLs in a series of browsers (and browser versions)
and measures how long the page takes to ... | bsd-3-clause |
Ensighten/Diamond | src/collectors/bind/bind.py | 28 | 5681 | # coding=utf-8
"""
Collects stats from bind 9.5's statistics server
#### Dependencies
* [bind 9.5](http://www.isc.org/software/bind/new-features/9.5)
configured with libxml2 and statistics-channels
"""
import diamond.collector
import sys
import urllib2
if sys.version_info >= (2, 5):
import xml.etree.cEle... | mit |
igemsoftware/SYSU-Software2013 | project/Python27/Lib/sunaudio.py | 286 | 1399 | """Interpret sun audio headers."""
from warnings import warnpy3k
warnpy3k("the sunaudio module has been removed in Python 3.0; "
"use the sunau module instead", stacklevel=2)
del warnpy3k
MAGIC = '.snd'
class error(Exception):
pass
def get_long_be(s):
"""Convert a 4-char value to integer."""
r... | mit |
lsinfo3/onos | tools/test/topos/solar.py | 26 | 3383 | #!/usr/bin/env python
from mininet.cli import CLI
from mininet.net import Mininet
from mininet.node import RemoteController, OVSKernelSwitch
MAC = 12
DPID = 16
class CustomCLI(CLI):
"""Custom CLI to allow us to add our own commands."""
def __init__ (self, net):
"""Init method for our custom CLI."""
... | apache-2.0 |
slisson/intellij-community | plugins/hg4idea/testData/bin/mercurial/wireproto.py | 90 | 22044 | # wireproto.py - generic wire protocol support functions
#
# Copyright 2005-2010 Matt Mackall <mpm@selenic.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import urllib, tempfile, os, sys
from i18n import _
from node import b... | apache-2.0 |
Tusky/box-python-sdk | boxsdk/session/box_session.py | 4 | 14168 | # coding: utf-8
from __future__ import unicode_literals
from boxsdk.exception import BoxAPIException
from boxsdk.util.shared_link import get_shared_link_header
class BoxResponse(object):
"""Represents a response to a Box API request."""
def __init__(self, network_response):
self._network_response =... | apache-2.0 |
spiffytech/offlineimap | offlineimap/ui/UIBase.py | 2 | 16764 | # UI base class
# Copyright (C) 2002 John Goerzen
# <jgoerzen@complete.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
# (at your option) a... | gpl-2.0 |
SAM-IT-SA/odoo | addons/email_template/tests/test_ir_actions.py | 382 | 2587 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2013-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
CEG-FYP-OpenStack/scheduler | nova/api/openstack/compute/keypairs.py | 20 | 12112 | # Copyright 2011 OpenStack Foundation
# 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 requ... | apache-2.0 |
stevielu/viewfinder | backend/db/query_parser.py | 13 | 23543 | # Copyright 2011 Viewfinder Inc. All Rights Reserved.
"""Parses query expressions into hierarchical query trees.
Given a data schema (defined via schema.py), you can create Query objects
and execute them against a database client. For example, with table 'User'
and columns 'given_name' and 'Email', you can run a quer... | apache-2.0 |
espenhgn/nest-simulator | pynest/examples/twoneurons.py | 3 | 1260 | # -*- coding: utf-8 -*-
#
# twoneurons.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 |
ddna1021/spark | python/pyspark/find_spark_home.py | 13 | 2765 | #!/usr/bin/env python
#
# 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 "Li... | apache-2.0 |
ryangallen/django | tests/middleware/test_security.py | 291 | 7781 | from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase
from django.test.utils import override_settings
class SecurityMiddlewareTest(SimpleTestCase):
@property
def middleware(self):
from django.middleware.security import SecurityMiddleware
return SecurityMid... | bsd-3-clause |
alexbrasetvik/Piped | piped/providers/test/test_pipeline_provider.py | 2 | 1416 | # Copyright (c) 2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
from twisted.trial import unittest
from piped import processing
from piped.providers import pipeline_provider
class PipelineProviderTest(unittest.TestCase):
def setUp(self):
self.runtime_environment = proce... | mit |
fsneak/shadowsocks | tests/nose_plugin.py | 1072 | 1164 | #!/usr/bin/env python
#
# Copyright 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 required by applicable law or ... | apache-2.0 |
fastflo/emma | emmalib/widgets/querytab/resulttoolbar/SetRequltFont.py | 1 | 1929 | # -*- coding: utf-8 -*-
# emma
#
# Copyright (C) 2006 Florian Schmidt (flo@fastflo.de)
# 2014 Nickolay Karnaukhov (mr.electronick@gmail.com)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software F... | gpl-2.0 |
gbirke/scrapy | scrapy/contrib/throttle.py | 39 | 2835 | import logging
from scrapy.exceptions import NotConfigured
from scrapy import signals
class AutoThrottle(object):
def __init__(self, crawler):
self.crawler = crawler
if not crawler.settings.getbool('AUTOTHROTTLE_ENABLED'):
raise NotConfigured
self.debug = crawler.settings.get... | bsd-3-clause |
mickele77/FreeCAD | src/Mod/Plot/InitGui.py | 18 | 2920 | #***************************************************************************
#* *
#* Copyright (c) 2011, 2012 *
#* Jose Luis Cercos Pita <jlcercos@gmail.com> *
#* ... | lgpl-2.1 |
AccelAI/accel.ai | flask-aws/lib/python2.7/site-packages/sqlalchemy/ext/instrumentation.py | 56 | 14646 | """Extensible class instrumentation.
The :mod:`sqlalchemy.ext.instrumentation` package provides for alternate
systems of class instrumentation within the ORM. Class instrumentation
refers to how the ORM places attributes on the class which maintain
data and track changes to that data, as well as event hooks installed... | mit |
glennlive/gnuradio-wg-grc | gr-comedi/python/comedi/__init__.py | 47 | 1125 | # Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# G... | gpl-3.0 |
shsingh/ansible | lib/ansible/plugins/doc_fragments/inventory_cache.py | 48 | 1890 | # -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# inventory cache
DOCUMENTATION = r'''
options:
cache:
description:
- Toggle to enable/disable the caching ... | gpl-3.0 |
heytcass/homeassistant-config | deps/google/protobuf/internal/text_format_test.py | 15 | 41879 | #! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions ... | mit |
gymnasium/edx-platform | openedx/core/djangoapps/video_config/forms.py | 14 | 1326 | """
Defines a form for providing validation of HLS Playback course-specific configuration.
"""
import logging
from django import forms
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locator import CourseLocator
from openedx.core.djangoapps.video_config.models import (
CourseHLSPlaybackEnabledFlag,
... | agpl-3.0 |
lukeiwanski/tensorflow-opencl | tensorflow/contrib/linalg/python/ops/linear_operator_util.py | 23 | 3705 | # 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 |
tedder/ansible-modules-core | network/nxos/nxos_bgp_neighbor_af.py | 10 | 39967 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
dsseter/tornado | tornado/test/httpserver_test.py | 68 | 41032 | #!/usr/bin/env python
from __future__ import absolute_import, division, print_function, with_statement
from tornado import netutil
from tornado.escape import json_decode, json_encode, utf8, _unicode, recursive_unicode, native_str
from tornado import gen
from tornado.http1connection import HTTP1Connection
from tornado... | apache-2.0 |
miltonruelas/cursotecnico | branch/oemedical/oemedical_medication_template/__init__.py | 5 | 1163 | # -*- coding: utf-8 -*-
#/#############################################################################
#
# Tech-Receptives Solutions Pvt. Ltd.
# Copyright (C) 2004-TODAY Tech-Receptives(<http://www.techreceptives.com>)
# Special Credit and Thanks to Thymbra Latinoamericana S.A.
#
# This program is free sof... | agpl-3.0 |
TRUFIL/erpnext | erpnext/patches/v7_1/update_missing_salary_component_type.py | 35 | 1330 | from __future__ import unicode_literals
import frappe
from frappe.utils import cstr
'''
Some components do not have type set, try and guess whether they turn up in
earnings or deductions in existing salary slips
'''
def execute():
frappe.reload_doc("accounts", "doctype", "salary_component_account")
for s in frap... | gpl-3.0 |
hackendless/heekscnc | nc/printbot3d.py | 30 | 1456 | ################################################################################
# printbot3d.py
#
# Dan Heeks 18th October 2010
import nc
import iso_modal
import math
################################################################################
class CreatorPrintbot(iso_modal.CreatorIsoModal):
de... | bsd-3-clause |
manuelep/geotip | controllers/appadmin.py | 26 | 25781 | # -*- coding: utf-8 -*-
# ##########################################################
# ## make sure administrator is on localhost
# ###########################################################
import os
import socket
import datetime
import copy
import gluon.contenttype
import gluon.fileutils
try:
import pygraphvi... | mit |
zennobjects/kivy | kivy/__init__.py | 3 | 13999 | '''
Kivy framework
==============
Kivy is an open source library for developing multi-touch applications. It is
completely cross-platform (Linux/OSX/Win) and released under the terms of the
MIT License.
It comes with native support for many multi-touch input devices, a growing
library of multi-touch aware widgets and... | mit |
VinGarcia/kivy | kivy/modules/recorder.py | 44 | 2417 | '''
Recorder module
===============
.. versionadded:: 1.1.0
Create an instance of :class:`~kivy.input.recorder.Recorder`, attach to the
class, and bind some keys to record / play sequences:
- F6: play the last record in a loop
- F7: read the latest recording
- F8: record input events
Configuration
-----... | mit |
escapewindow/signingscript | src/signingscript/vendored/mozbuild/mozbuild/frontend/sandbox.py | 2 | 11437 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
r"""Python sandbox implementation for build files.
This module contains classes for Python sandboxes that execute in a
... | mpl-2.0 |
michaelni/audacity | lib-src/lv2/lv2/plugins/eg01-amp.lv2/waflib/Tools/fc.py | 276 | 4202 | #! /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 re
from waflib import Utils,Task,TaskGen,Logs
from waflib.Tools import ccroot,fc_config,fc_scan
from waflib.TaskGen import feature,before_method,after_method,extension
... | gpl-2.0 |
y12uc231/edx-platform | pavelib/paver_tests/test_prereqs.py | 99 | 1862 | import os
import unittest
from pavelib.prereqs import no_prereq_install
class TestPaverPrereqInstall(unittest.TestCase):
"""
Test the status of the NO_PREREQ_INSTALL variable, its presence and how
paver handles it.
"""
def check_val(self, set_val, expected_val):
"""
Verify that set... | agpl-3.0 |
CTSRD-SOAAP/chromium-42.0.2311.135 | tools/grit/grit/extern/tclib.py | 63 | 16892 | #!/usr/bin/env python
# Copyright (c) 2012 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.
# The tclib module contains tools for aggregating, verifying, and storing
# messages destined for the Translation Console, as well ... | bsd-3-clause |
petewarden/tensorflow | tensorflow/python/tpu/ops/tpu_ops.py | 4 | 23814 | # 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 |
dhomeier/astropy | astropy/io/ascii/ipac.py | 3 | 21000 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""An extensible ASCII table reader and writer.
ipac.py:
Classes to read IPAC table format
:Copyright: Smithsonian Astrophysical Observatory (2011)
:Author: Tom Aldcroft (aldcroft@head.cfa.harvard.edu)
"""
import re
from collections import defaultdic... | bsd-3-clause |
PetrDlouhy/django-su | django_su/tests/test_backends.py | 2 | 2019 | from django.test import TestCase
try:
from django.contrib.auth import get_user_model
User = get_user_model()
except ImportError:
from django.contrib.auth.models import User
class TestSuBackend(TestCase):
def setUp(self):
super(TestSuBackend, self).setUp()
from django_su.backends imp... | mit |
vandenheuvel/tribler | Tribler/Test/Core/test_sqlitecachedbhandler_peers.py | 2 | 3962 | from twisted.internet.defer import inlineCallbacks
from Tribler.Core.CacheDB.SqliteCacheDBHandler import PeerDBHandler
from Tribler.Core.CacheDB.sqlitecachedb import str2bin
from Tribler.Test.Core.test_sqlitecachedbhandler import AbstractDB
from Tribler.dispersy.util import blocking_call_on_reactor_thread
FAKE_PERMI... | lgpl-3.0 |
micmn/shogun | examples/undocumented/python/preprocessor_sortulongstring.py | 5 | 1439 | #!/usr/bin/env python
from tools.load import LoadMatrix
lm=LoadMatrix()
traindna = lm.load_dna('../data/fm_train_dna.dat')
testdna = lm.load_dna('../data/fm_test_dna.dat')
parameter_list = [[traindna,testdna,4,0,False,False],[traindna,testdna,3,0,False,False]]
def preprocessor_sortulongstring (fm_train_dna=traindna,... | gpl-3.0 |
ovnicraft/edx-platform | common/djangoapps/student/management/commands/add_to_group.py | 182 | 1968 | from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import User, Group
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--list',
action='store_true',
de... | agpl-3.0 |
farazrehman/aws-resources | CloudFormation/nash/lib/python2.7/site-packages/troposphere/constants.py | 2 | 6266 | #
# Regions
#
AP_NORTHEAST_1 = 'ap-northeast-1'
AP_NORTHEAST_2 = 'ap-northeast-2'
AP_SOUTHEAST_1 = 'ap-southeast-1'
AP_SOUTHEAST_2 = 'ap-southeast-2'
EU_WEST_1 = 'eu-west-1'
EU_CENTRAL_1 = 'eu-central-1'
SA_EAST_1 = 'sa-east-1'
US_EAST_1 = 'us-east-1'
US_WEST_1 = 'us-west-1'
US_WEST_2 = 'us-west-2'
#
# Availability Z... | gpl-2.0 |
burlog/py-static-callgraph | callgraph/output.py | 2 | 1460 | # -*- coding: utf-8 -*-
#
# LICENCE MIT
#
# DESCRIPTION Callgraph output formats.
#
# AUTHOR Michal Bukovsky <michal.bukovsky@trilogic.cz>
#
def make_graphviz_tree(root):
from graphviz import Digraph
from hashlib import md5
from operator import attrgetter
name = next(iter(root.children))... | mit |
Azulinho/ansible | lib/ansible/plugins/lookup/openshift.py | 6 | 9092 | # -*- coding: utf-8 -*-
# (c) 2017, Kenneth D. Evensen <kevensen@redhat.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
DOCUMENTATION = """
lookup: openshift
version_added... | gpl-3.0 |
walterbender/dimensions | deck.py | 1 | 8343 | # Copyright (c) 2009-14 Walter Bender
# 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.
# You should have received a cop... | gpl-3.0 |
audihsu-qci/ONL | tools/py/vcgen.py | 9 | 2526 | #!/usr/bin/python
############################################################
# <bsn.cl fy=2013 v=onl>
#
# Copyright 2013, 2014 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.0 (the
# "License"); you may not use this file except in compliance
# with the License. You ... | epl-1.0 |
LeetCoinTeam/lc_tactoe | jinja2/testsuite/regression.py | 90 | 7583 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite.regression
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests corner cases and bugs.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import unittest
from jinja2.testsuite import JinjaTestCase
from jinja2 import Template, Enviro... | apache-2.0 |
wimnat/ansible | lib/ansible/plugins/inventory/host_list.py | 29 | 2288 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = r'''
name: host_list
version_added: "2.4"
short_description: Parses a 'h... | gpl-3.0 |
scwuaptx/CTF | 2019-writeup/0ctf/babyheap2019.py | 1 | 2196 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pwn import *
#host = "10.211.55.23"
#port = 8888
host = "111.186.63.20"
port = 10001
context.arch = "amd64"
r = remote(host,port)
def alloc(size):
r.recvuntil(":")
r.sendline("1")
r.recvuntil(":")
r.sendline(str(size))
def update(idx,data):
r... | gpl-2.0 |
kobejean/tensorflow | tensorflow/python/kernel_tests/random/random_crop_test.py | 9 | 2727 | # 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 |
bharaths/CloudBot | plugins/cryptocurrency.py | 2 | 2352 | """
cryptocurrency.py
A plugin that uses the CoinMarketCap JSON API to get values for cryptocurrencies.
Created By:
- Luke Rogers <https://github.com/lukeroge>
Special Thanks:
- https://coinmarketcap-nexuist.rhcloud.com/
License:
GPL v3
"""
from urllib.parse import quote_plus
from datetime import dateti... | gpl-3.0 |
wildtetris/python-social-auth | social/tests/backends/test_podio.py | 81 | 1689 | import json
from social.tests.backends.oauth import OAuth2Test
class PodioOAuth2Test(OAuth2Test):
backend_path = 'social.backends.podio.PodioOAuth2'
user_data_url = 'https://api.podio.com/user/status'
expected_username = 'user_1010101010'
access_token_body = json.dumps({
'token_type': 'bearer... | bsd-3-clause |
has2k1/numpy | numpy/polynomial/tests/test_legendre.py | 123 | 16522 | """Tests for legendre module.
"""
from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.polynomial.legendre as leg
from numpy.polynomial.polynomial import polyval
from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_mod... | bsd-3-clause |
sharjeel/spade-fb | jython-home/Lib/site-packages/simplejson-3.3.1-py2.5.egg/simplejson/tests/test_errors.py | 7 | 1553 | import sys, pickle
from unittest import TestCase
import simplejson as json
from simplejson.compat import u, b
class TestErrors(TestCase):
def test_string_keys_error(self):
data = [{'a': 'A', 'b': (2, 4), 'c': 3.0, ('d',): 'D tuple'}]
self.assertRaises(TypeError, json.dumps, data)
def test_dec... | apache-2.0 |
ChenJunor/hue | desktop/core/ext-py/South-1.0.2/south/modelsinspector.py | 95 | 17501 | """
Like the old south.modelsparser, but using introspection where possible
rather than direct inspection of models.py.
"""
from __future__ import print_function
import datetime
import re
import decimal
from south.utils import get_attribute, auto_through
from south.utils.py3 import text_type
from django.db import m... | apache-2.0 |
superhuahua/xunfengES | celerynode/vuldb/smb/smb_constants.py | 13 | 7531 |
# Values for Command field in SMB message header
SMB_COM_CREATE_DIRECTORY = 0x00
SMB_COM_DELETE_DIRECTORY = 0x01
SMB_COM_CLOSE = 0x04
SMB_COM_DELETE = 0x06
SMB_COM_RENAME = 0x07
SMB_COM_TRANSACTION = 0x25
SMB_COM_ECHO = 0x2B
SMB_COM_OPEN_ANDX = 0x2D
SMB_COM_READ_ANDX = 0x2E
SMB_COM_WRITE_ANDX = 0x2F
SMB_COM_TRANSACTIO... | gpl-3.0 |
DAGr8/kernel_samsung_hltecan | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
buffer/thug | thug/DOM/HTTPSession.py | 1 | 8265 | #!/usr/bin/env python
#
# HTTPSession.py
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANT... | gpl-2.0 |
projectcalico/calico-nova | nova/tests/functional/v3/test_fixed_ips.py | 10 | 3874 | # Copyright 2014 IBM Corp.
#
# 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 t... | apache-2.0 |
simonwydooghe/ansible | test/units/modules/network/dellos6/dellos6_module.py | 52 | 2516 | # (c) 2016 Red Hat Inc.
#
# 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 dis... | gpl-3.0 |
ionux/p2pool | p2pool/bitcoin/script.py | 282 | 2589 | from p2pool.util import math, pack
def reads_nothing(f):
return None, f
def protoPUSH(length):
return lambda f: pack.read(f, length)
def protoPUSHDATA(size_len):
def _(f):
length_str, f = pack.read(f, size_len)
length = math.string_to_natural(length_str[::-1].lstrip(chr(0)))
data, f... | gpl-3.0 |
tanto/geopapurls | geopapurls/urls.py | 1 | 1128 | from django.conf import settings
from django.contrib.auth.decorators import login_required
from django.conf.urls import patterns, include, url
from django.contrib import admin
from django.views.generic import TemplateView
from views import LayersView,MapurlsView,MapurlsHtmlView,MapurlDetailView,SuggestView
admin.autodi... | gpl-2.0 |
shingonoide/odoo | addons/payment_adyen/controllers/main.py | 48 | 2053 | # -*- coding: utf-8 -*-
try:
import simplejson as json
except ImportError:
import json
import logging
import pprint
import werkzeug
from openerp import http, SUPERUSER_ID
from openerp.http import request
_logger = logging.getLogger(__name__)
class AdyenController(http.Controller):
_return_url = '/payme... | agpl-3.0 |
chylli/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/thirdparty/mod_pywebsocket/__init__.py | 129 | 7351 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
jmcarbo/openerp7 | openerp/tests/test_osv.py | 446 | 4722 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010 OpenERP S.A. http://www.openerp.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
ivanmeler/android_kernel_samsung_smdk4412 | 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 |
xinwu/horizon | openstack_dashboard/contrib/sahara/content/data_processing/utils/workflow_helpers.py | 30 | 10029 | # 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 the... | apache-2.0 |
skython/eXe | formless/test/test_formless.py | 14 | 14985 | # Copyright (c) 2004 Divmod.
# See LICENSE for details.
import os
from nevow.testutil import TestCase
import formless
from formless import process as flpr
def process(typed, value):
return flpr(typed, [value])
class Typed(TestCase):
def testString(self):
s = formless.String()
self.assertE... | gpl-2.0 |
fivejjs/GPy | GPy/kern/_src/psi_comp/rbf_psi_comp.py | 4 | 5632 | """
The module for psi-statistics for RBF kernel
"""
import numpy as np
from GPy.util.caching import Cacher
def psicomputations(variance, lengthscale, Z, variational_posterior):
"""
Z - MxQ
mu - NxQ
S - NxQ
gamma - NxQ
"""
# here are the "statistics" for psi0, psi1 and psi2
# Produced ... | bsd-3-clause |
Brainiq7/Ananse | ananse_dl/extractor/heise.py | 176 | 2864 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_iso8601,
)
class HeiseIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?heise\.de/video/artikel/
.+?(?P<id>[0-9]+)\.html(?:$|[?#]... | unlicense |
Carreau/python-prompt-toolkit | examples/shell-example.py | 1 | 4578 | #!/usr/bin/env python
"""
Alternative for a shell (like Bash).
Warning: This is work in progress!
For now we use this to test which functionality/flexibility we need in
'contrib.shell'. APIs can change a lot over there...
"""
import os
from pygments.style import Style
from pygments.token import Token
from prompt_too... | bsd-3-clause |
hernandito/SickRage | lib/sqlalchemy/sql/default_comparator.py | 77 | 12187 | # sql/default_comparator.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Default implementation of SQL comparison operations.
"""
from .. import ... | gpl-3.0 |
MarkTseng/django-farmersale | farmersale-env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py | 982 | 19608 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
Webcampak/cli | webcampak/core/wpakFTPTransfer.py | 1 | 10819 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010-2016 Eurotechnia (support@webcampak.com)
# This file is part of the Webcampak project.
# Webcampak 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, e... | gpl-3.0 |
DNFcode/edx-platform | common/lib/calc/calc/functions.py | 279 | 1521 | """
Provide the mathematical functions that numpy doesn't.
Specifically, the secant/cosecant/cotangents and their inverses and
hyperbolic counterparts
"""
import numpy
# Normal Trig
def sec(arg):
"""
Secant
"""
return 1 / numpy.cos(arg)
def csc(arg):
"""
Cosecant
"""
return 1 / nump... | agpl-3.0 |
gdgphilippines/main | node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 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.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | mit |
docmeth02/CouchPotatoServer | libs/html5lib/trie/datrie.py | 785 | 1166 | from __future__ import absolute_import, division, unicode_literals
from datrie import Trie as DATrie
from six import text_type
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
chars = set()
for key in data.keys():
if not isinstance(key, text_type):
... | gpl-3.0 |
Carpetsmoker/qutebrowser | scripts/dev/ua_fetch.py | 2 | 4180 | #!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 lamarpavel
# Copyright 2015-2017 Alexey Nabrodov (Averrin)
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistrib... | gpl-3.0 |
thegreathippo/crispy | crispy/gui/layers.py | 1 | 3285 | import kvy
import constants
Z_TOP = 10
Z_BOTTOM = -10
class View(kvy.ScatterLayout):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.layers = dict()
for z in range(Z_BOTTOM, Z_TOP + 1):
layer = SpriteLayer(z)
self.layers[z] = layer
self.screen... | mit |
bookwar/python-gpiodev | gpiodev/lcd7.py | 1 | 5445 | from gpiodev import GPIOHandle
import asyncio
'''
LCD7 is a device with four 7-segment LED digits to show. 7 segments
are not enough to show arbitraty letters, but it can be used as clocks
or counter.
Though there are 4x7 = 28 LED segments to switch on and off, it uses
only 12 GPIO pins. 4 pins are used to choose th... | apache-2.0 |
linea-it/dri | api/comment/serializers.py | 1 | 2853 | from rest_framework import serializers
from .models import Position
from .models import Dataset as CommentDataset
from coadd.models import Dataset
from common.models import Filter
class PositionSerializer(serializers.HyperlinkedModelSerializer):
owner = serializers.SerializerMethodField()
pst_dataset = serial... | gpl-3.0 |
zhoulingjun/django | tests/urlpatterns_reverse/erroneous_urls.py | 199 | 1350 | import warnings
from django.conf.urls import url
from django.utils.deprecation import RemovedInDjango110Warning
from . import views
# Test deprecated behavior of passing strings as view to url().
# Some of these can be removed in Django 1.10 as they aren't convertable to
# callables.
with warnings.catch_warnings():
... | bsd-3-clause |
nano-db/NanoCube | test/test_timeserietable.py | 1 | 2023 | from datetime import datetime
from nose.tools import assert_equals
from server.timeserietable import TimeSerieTable
class TestTimeSerieTable(object):
def mock_time(self, hour, min, sec):
return datetime(2005, 7, 12, hour, min, sec)
def test_simple_insert(self):
t = TimeSerieTable(3600)
... | apache-2.0 |
jobsafran/mediadrop | mediadrop/lib/auth/group_based_policy.py | 10 | 1740 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
ivan-fedorov/intellij-community | plugins/hg4idea/testData/bin/hgext/convert/git.py | 90 | 10373 | # git.py - git support for the convert extension
#
# Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import os
import subprocess
from mercurial import util, config
fro... | apache-2.0 |
tudyzhb/yichui | tastypie/utils/validate_jsonp.py | 34 | 6223 | # -*- coding: utf-8 -*-
# Placed into the Public Domain by tav <tav@espians.com>
"""Validate Javascript Identifiers for use as JSON-P callback parameters."""
import re
from unicodedata import category
# ------------------------------------------------------------------------------
# javascript identifier unicode c... | bsd-3-clause |
olivierkes/manuskript | manuskript/ui/highlighters/searchResultHighlighters/plotSearchResultHighlighter.py | 2 | 1174 | #!/usr/bin/env python
# --!-- coding: utf8 --!--
from manuskript.models import references as Ref
from manuskript.functions import mainWindow
from manuskript.enums import Plot
from PyQt5.QtWidgets import QTextEdit, QLineEdit, QListView
from manuskript.ui.highlighters.searchResultHighlighters.abstractSpecificSearchResu... | gpl-3.0 |
ogenstad/ansible | test/units/playbook/test_attribute.py | 119 | 1823 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.