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 |
|---|---|---|---|---|---|
justajeffy/arsenalsuite | python/pythondotnet/pythonnet/src/tests/test_class.py | 10 | 7151 | # ===========================================================================
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE D... | gpl-2.0 |
Kapeli/PopClip-Extensions | source/OneNote/requests/cookies.py | 204 | 16791 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import time
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
# grr, pyflakes: this fixes... | mit |
MariosPanag/coala | tests/processes/ProcessingTest.py | 11 | 30078 | import copy
import multiprocessing
import os
import platform
import queue
import re
import subprocess
import sys
import unittest
from pyprint.ConsolePrinter import ConsolePrinter
from coalib.bears.Bear import Bear
from coalib.output.printers.LogPrinter import LogPrinter
from coalib.processes.CONTROL_ELEMENT import CO... | agpl-3.0 |
daniponi/django | tests/messages_tests/base.py | 7 | 14098 | from django import http
from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.contrib.messages.storage.ba... | bsd-3-clause |
kazitanvirahsan/django-registration | docs/conf.py | 21 | 6469 | # -*- coding: utf-8 -*-
#
# django-registration documentation build configuration file, created by
# sphinx-quickstart on Mon Jun 22 02:57:42 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated f... | bsd-3-clause |
valdur55/py3status | py3status/modules/check_tcp.py | 2 | 1816 | """
Display status of a TCP port on a given host.
Configuration parameters:
cache_timeout: refresh interval for this module (default 10)
format: display format for this module (default '{host}:{port} {state}')
host: name of host to check for (default 'localhost')
icon_off: show this when unavailable (d... | bsd-3-clause |
akvo/django-tastypie | tastypie/serializers.py | 34 | 19714 | from __future__ import unicode_literals
import datetime
import re
import django
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.encoding import force_text, smart_bytes
from django.core.serializers import json as djangojson
from tas... | bsd-3-clause |
ralsina/pdfrw | examples/poster.py | 6 | 1464 | #!/usr/bin/env python
'''
usage: poster.py my.pdf
Shows how to change the size on a PDF.
Motivation:
My daughter needed to create a 48" x 36" poster, but her Mac version of Powerpoint
only wanted to output 8.5" x 11" for some reason.
'''
import sys
import os
import find_pdfrw
from pdfrw import PdfReader, PdfWr... | mit |
arch1tect0r/root | interpreter/llvm/src/tools/clang/bindings/python/examples/cindex/cindex-dump.py | 85 | 2733 | #!/usr/bin/env python
#===- cindex-dump.py - cindex/Python Source Dump -------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===---------------------------------------... | lgpl-2.1 |
npalermo10/auto_choice_assay_train-test | venv/lib/python2.7/site-packages/serial/tools/list_ports.py | 11 | 3135 | #!/usr/bin/env python
#
# Serial port enumeration. Console tool and backend selection.
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C) 2011-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
"""\
This module will provide a function called comports that retu... | gpl-3.0 |
daoluan/decode-Django | Django-1.5.1/django/test/simple.py | 29 | 13725 | import unittest as real_unittest
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models import get_app, get_apps
from django.test import _doctest as doctest
from django.test.utils import setup_test_environment, teardown_test_environment
from django.test.testcases... | gpl-2.0 |
qimmer/mta13341 | libfreenect-master/wrappers/python/demo_mp_async.py | 6 | 1033 | #!/usr/bin/env python
import freenect
import matplotlib.pyplot as mp
import signal
import frame_convert
mp.ion()
image_rgb = None
image_depth = None
keep_running = True
def display_depth(dev, data, timestamp):
global image_depth
data = frame_convert.pretty_depth(data)
mp.gray()
mp.figure(1)
if im... | mit |
rbprogrammer/advanced_python_topics | course-material/py3/solutions/06 Metaprogramming/Shapes/Solution.e/shapetst.py | 1 | 2071 | #!/usr/local/bin/python3
"""
Test harness to exercise the shape hierarchy
"""
from shape import *
def test_b():
print("\nTest b")
# Create derived-class object.
# Circle constructor arguments are: (centreX, centreY, radius)
pshape = Circle(10,10,10)
# The expected output ... | apache-2.0 |
amoose136/maratus | detectevent.py | 1 | 3686 | #!/usr/bin/env python
from __future__ import print_function
"""PyAudio Example: Play a wave file."""
import pyaudio
import wave
import sys
from pdb import set_trace as br
import numpy as np
from collections import deque
import cv2
import time
def record_audio():
CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 1
... | apache-2.0 |
getredash/redash | redash/authentication/ldap_auth.py | 3 | 2936 | import logging
import sys
from redash import settings
from flask import flash, redirect, render_template, request, url_for, Blueprint
from flask_login import current_user
try:
from ldap3 import Server, Connection
except ImportError:
if settings.LDAP_LOGIN_ENABLED:
sys.exit(
"The ldap3 lib... | bsd-2-clause |
philippjfr/bokeh | setup.py | 2 | 5418 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2017, Anaconda, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#---------------------------------------------------... | bsd-3-clause |
anugrah-saxena/pycroscopy | pycroscopy/analysis/utils/tree.py | 1 | 6992 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 31 17:03:29 2016
@author: Suhas Somnath
"""
from __future__ import division, print_function, absolute_import, unicode_literals
import numpy as np
# TODO: Test and debug node and clusterTree classes for agglomerative clustering etc
class Node(object):
"""
Basic ... | mit |
washort/zamboni | mkt/access/migrations/0001_initial.py | 13 | 1814 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | bsd-3-clause |
beagles/neutron_hacking | neutron/tests/unit/test_extension_firewall.py | 11 | 20691 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 Big Switch Networks, 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.... | apache-2.0 |
dongjoon-hyun/tensorflow | tensorflow/python/ops/lookup_ops.py | 2 | 49459 | # 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 |
shr-project/opkg | tests/regress/opk.py | 3 | 2877 | import tarfile, os
import cfg
class Opk:
valid_control_fields = ["Package", "Version", "Depends", "Provides",\
"Replaces", "Conflicts", "Suggests", "Recommends",\
"Section", "Architecture", "Maintainer", "MD5Sum",\
"Size", "InstalledSize", "Filename", "Source",\
"Description", "OE", "Homepage", "Priority"... | gpl-2.0 |
rouge8/pex | pex/testing.py | 13 | 7806 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import contextlib
import os
import random
import subprocess
import sys
import tempfile
import zipfile
from collections import namedtuple
from textwrap import dedent
from .bin.pex import l... | apache-2.0 |
slisson/intellij-community | python/helpers/docutils/readers/doctree.py | 246 | 1607 | # $Id: doctree.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Martin Blais <blais@furius.ca>
# Copyright: This module has been placed in the public domain.
"""Reader for existing document trees."""
from docutils import readers, utils, transforms
class Reader(readers.ReReader):
"""
Adapt the Reader API fo... | apache-2.0 |
dmitriiabramov/react | scripts/bench/measure.py | 20 | 4681 | #!/usr/bin/env python
# Copyright 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import... | bsd-3-clause |
F5Networks/f5-common-python | f5/bigip/tm/auth/remote_user.py | 1 | 1086 | # coding=utf-8
#
# Copyright 2017 F5 Networks 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 |
caphrim007/ansible | lib/ansible/galaxy/login.py | 104 | 4619 | ########################################################################
#
# (C) 2015, Chris Houseknecht <chouse@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Fo... | gpl-3.0 |
FR4NK-W/osourced-scion | python/test/lib/sibra/ext/sof_test.py | 3 | 3422 | # Copyright 2016 ETH Zurich
#
# 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, sof... | apache-2.0 |
rs2/bokeh | bokeh/models/tests/test_formatters.py | 6 | 2350 | from textwrap import dedent
import pytest
from bokeh.models import FuncTickFormatter, Slider
flexx = pytest.importorskip("flexx")
def test_functickformatter_from_py_func_no_args():
def convert_to_minutes():
return tick * 60 # noqa
formatter = FuncTickFormatter.from_py_func(convert_to_minutes)
... | bsd-3-clause |
daniaki/Enrich2 | enrich2/tests/test_selection_valueerrors.py | 1 | 1835 | # Copyright 2016-2017 Alan F Rubin
#
# This file is part of Enrich2.
#
# Enrich2 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.
... | gpl-3.0 |
rapidhere/rpbtman_autosign | pytz/zoneinfo/America/Indiana/Vevay.py | 9 | 3701 | '''tzinfo timezone information for America/Indiana/Vevay.'''
from pytz.tzinfo import DstTzInfo
from pytz.tzinfo import memorized_datetime as d
from pytz.tzinfo import memorized_ttinfo as i
class Vevay(DstTzInfo):
'''America/Indiana/Vevay timezone definition. See datetime.tzinfo for details'''
zone = 'America/... | gpl-3.0 |
yephper/django | tests/defer_regress/models.py | 1 | 2798 | """
Regression tests for defer() / only() behavior.
"""
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Item(models.Model):
name = models.CharField(max_length=15)
text = models.TextField(default="xyzzy")
value = mod... | bsd-3-clause |
arborh/tensorflow | tensorflow/python/framework/test_util_test.py | 4 | 30090 | # 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 |
clayz/crazy-quiz-web | lib/oauthlib/oauth2/rfc6749/endpoints/token.py | 71 | 3673 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
import logging
from oauthlib.common import Request
from .base import BaseEn... | apache-2.0 |
TechBK/horizon-dev | openstack_dashboard/dashboards/admin/aggregates/urls.py | 46 | 1252 | # 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 |
ykim362/mxnet | tests/python/train/test_bucketing.py | 36 | 4868 | # 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 |
Comunitea/CMNT_00040_2016_ELN_addons | mrp_stock_forecast/__openerp__.py | 2 | 1649 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
conwin/node-gyp | gyp/test/builddir/gyptest-default.py | 74 | 2670 | #!/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.
"""
Verify the settings that cause a set of programs to be created in
a specific build directory, and that no intermediate built files
get c... | mit |
freinque/walksafr | mainapp/models.py | 1 | 5525 | # This is an auto-generated Django model module.
# You'll have to do the following manually to clean this up:
# * Rearrange models' order
# * Make sure each model has one field with primary_key=True
# * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table
# Feel free ... | gpl-2.0 |
saurabh3949/mxnet | tests/nightly/compilation_warnings/process_output.py | 9 | 2164 | # 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 |
azunite/wireshark_1023 | tools/dftestlib/time_relative.py | 40 | 1244 | # Copyright (c) 2013 by Gilbert Ramirez <gram@alumni.rice.edu>
#
# 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.
#
# Th... | gpl-2.0 |
niboshi/chainer | tests/chainer_tests/distributions_tests/test_beta.py | 8 | 1105 | import numpy
from chainer import distributions
from chainer import testing
@testing.parameterize(*testing.product({
'shape': [(2, 3), ()],
'is_variable': [True, False],
'sample_shape': [(3, 2), ()],
}))
@testing.fix_random()
@testing.with_requires('scipy')
class TestBeta(testing.distribution_unittest):
... | mit |
kidaa30/spacewalk | scripts/ncsu-rhntools/oldSystems.py | 11 | 4028 | #!/usr/bin/python
# oldSystems.py - Find and possibly remove inactive systems from RHN
# Copyright (C) 2007 NC State University
# Written by Jack Neely <jjneely@ncsu.edu>
#
# 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
# th... | gpl-2.0 |
daspecster/google-cloud-python | spanner/google/cloud/spanner/streamed.py | 1 | 8653 | # Copyright 2016 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 |
ajoaoff/django | tests/admin_filters/models.py | 98 | 2149 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.encoding import python_2_unicode_compa... | bsd-3-clause |
kingvuplus/ts-gui-3 | lib/python/Plugins/Extensions/DVDBurn/DVDTitle.py | 24 | 6506 | from Components.config import config, ConfigSubsection, ConfigSubList, ConfigInteger, ConfigText, ConfigSelection, getConfigListEntry, ConfigSequence, ConfigYesNo
import TitleCutter
class ConfigFixedText(ConfigText):
def __init__(self, text, visible_width=60):
ConfigText.__init__(self, default = text, fixed_size = ... | gpl-2.0 |
ademmers/ansible | test/integration/targets/module_precedence/multiple_roles/bar/library/ping.py | 35 | 2234 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2016, 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 terms of the GNU General Public License as published by... | gpl-3.0 |
newrocknj/horizon | openstack_dashboard/dashboards/admin/hypervisors/tables.py | 32 | 3125 | # Copyright 2013 B1 Systems GmbH
#
# 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 ag... | apache-2.0 |
wehkamp/ansible-modules-core | system/setup.py | 64 | 5222 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... | gpl-3.0 |
halberom/ansible | lib/ansible/plugins/lookup/file.py | 131 | 1954 | # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any lat... | gpl-3.0 |
detrout/debian-statsmodels | statsmodels/examples/ex_feasible_gls_het_0.py | 34 | 6454 | # -*- coding: utf-8 -*-
"""Examples for linear model with heteroscedasticity estimated by feasible GLS
These are examples to check the results during developement.
The assumptions:
We have a linear model y = X*beta where the variance of an observation depends
on some explanatory variable Z (`exog_var`).
linear_model... | bsd-3-clause |
mrshu/iepy | iepy/instantiation/iepy_runner.py | 1 | 6152 | """
Run IEPY active-learning extractor
Usage:
iepy_runner.py [options] <relation_name> <output>
iepy_runner.py [options] --db-store <relation_name>
iepy_runner.py -h | --help | --version
Options:
--store-extractor=<extractor_output> Stores the trained classifier
--trained-extractor=<extractor_path> ... | bsd-3-clause |
lctseng/NCTU-SDN-Project | openvswitch-2.3.0/python/ovstest/tests.py | 6 | 9327 | import math
import time
import ovstest.util as util
DEFAULT_TEST_BRIDGE = "ovstestbr0"
DEFAULT_TEST_PORT = "ovstestport0"
DEFAULT_TEST_TUN = "ovstestport1"
NO_HANDLE = -1
def do_udp_tests(receiver, sender, tbwidth, duration, port_sizes):
"""Schedule UDP tests between receiver and sender"""
server1 = util.rp... | apache-2.0 |
varunarya10/nova_test_latest | nova/api/metadata/base.py | 20 | 20244 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | apache-2.0 |
gavinelliott/churchill | node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | 1509 | 17165 | # 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.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import gyp
import glob
class VisualStudi... | mit |
AlexBoogaard/Sick-Beard-Torrent-Edition | lib/unidecode/x08b.py | 252 | 4643 | data = (
'Mou ', # 0x00
'Ye ', # 0x01
'Wei ', # 0x02
'[?] ', # 0x03
'Teng ', # 0x04
'Zou ', # 0x05
'Shan ', # 0x06
'Jian ', # 0x07
'Bo ', # 0x08
'Ku ', # 0x09
'Huang ', # 0x0a
'Huo ', # 0x0b
'Ge ', # 0x0c
'Ying ', # 0x0d
'Mi ', # 0x0e
'Xiao ', # 0x0f
'Mi ', # 0x10
'Xi ... | gpl-3.0 |
Maratyszcza/ninja-pypi | misc/ninja_syntax_test.py | 11 | 6604 | #!/usr/bin/env python
# Copyright 2011 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... | apache-2.0 |
quamilek/django | django/views/decorators/csrf.py | 586 | 2202 | from functools import wraps
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.utils.decorators import available_attrs, decorator_from_middleware
csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds... | bsd-3-clause |
jostep/tensorflow | tensorflow/contrib/cluster_resolver/python/training/gce_cluster_resolver.py | 41 | 5116 | # 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 applicable ... | apache-2.0 |
lindzey/pelican-plugins | asciidoc_reader/asciidoc_reader.py | 24 | 1918 | # -*- coding: utf-8 -*-
"""
AsciiDoc Reader
===============
This plugin allows you to use AsciiDoc to write your posts.
File extension should be ``.asc``, ``.adoc``, or ``asciidoc``.
"""
from pelican.readers import BaseReader
from pelican.utils import pelican_open
from pelican import signals
try:
# asciidocapi ... | agpl-3.0 |
SecsAndCyber/wincrypt.py | WinCrypto/crypt32.py | 1 | 3284 | from WinCrypto.crypt_structs import *
from ctypes import *
from struct import unpack, pack
import binascii
"""
WINCRYPT32API
BOOL
WINAPI
CryptQueryObject(
_In_ DWORD dwObjectType,
_In_ const void *pvObject,
_In_ DWORD dwExpectedContentTypeFlags,
_In_ ... | mit |
rmrice/cool-as-a-cucumber | node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py | 1534 | 3426 | # 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.
import collections
import os
import gyp
import gyp.common
import gyp.msvs_emulation
import json
import sys
generator_supports_multiple_toolsets = True
generator_... | mit |
rwillmer/django | tests/template_tests/syntax_tests/test_comment.py | 521 | 3667 | from django.test import SimpleTestCase
from ..utils import setup
class CommentSyntaxTests(SimpleTestCase):
@setup({'comment-syntax01': '{# this is hidden #}hello'})
def test_comment_syntax01(self):
output = self.engine.render_to_string('comment-syntax01')
self.assertEqual(output, 'hello')
... | bsd-3-clause |
Learningtribes/edx-platform | pavelib/paver_tests/test_safecommit.py | 27 | 1391 | """
Tests for paver safecommit quality tasks
"""
from mock import patch
import pavelib.quality
from paver.easy import call_task
from .utils import PaverTestCase
class PaverSafeCommitTest(PaverTestCase):
"""
Test run_safecommit_report with a mocked environment in order to pass in
opts.
"""
def ... | agpl-3.0 |
newswangerd/ansible | lib/ansible/plugins/inventory/__init__.py | 9 | 20585 | # (c) 2017, 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 d... | gpl-3.0 |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/samba/dcerpc/initshutdown.py | 1 | 2913 | # encoding: utf-8
# module samba.dcerpc.initshutdown
# from /usr/lib/python2.7/dist-packages/samba/dcerpc/initshutdown.so
# by generator 1.135
""" initshutdown DCE/RPC """
# imports
import dcerpc as __dcerpc
# Variables with simple values
SHTDN_REASON_FLAG_PLANNED = 2147483648
SHTDN_REASON_FLAG_USER_DEFINED = 1073... | gpl-2.0 |
MTG/gaia | src/bindings/pygaia/scripts/collections/validate_all_collections.py | 1 | 1300 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2013 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Gaia
#
# Gaia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Fou... | agpl-3.0 |
MziRintu/kitsune | kitsune/sumo/tests/test_templates.py | 13 | 3924 | from django.conf import settings
from django.test.client import RequestFactory
from django.utils import translation
import jingo
import mock
from nose.tools import eq_
from pyquery import PyQuery as pq
from kitsune.sumo.tests import LocalizingClient, TestCase
from kitsune.sumo.urlresolvers import reverse
def setup(... | bsd-3-clause |
Pallokala/ansible-modules-core | cloud/docker/docker.py | 9 | 59482 | #!/usr/bin/python
# (c) 2013, Cove Schneider
# (c) 2014, Joshua Conner <joshua.conner@gmail.com>
# (c) 2014, Pavel Antonov <antonov@adwz.ru>
#
# 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... | gpl-3.0 |
SaranyaKarthikeyan/boto | boto/services/sonofmmm.py | 170 | 3498 | # 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... | mit |
geekboxzone/lollipop_external_chromium_org_third_party_webrtc | build/extra_gitignore.py | 40 | 1443 | #!/usr/bin/env python
# Copyright (c) 2012 The WebRTC 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 c... | bsd-3-clause |
dlu-ch/dlb | test/dlb_contrib/test_clike.py | 1 | 11229 | # SPDX-License-Identifier: LGPL-3.0-or-later
# dlb - a Pythonic build tool
# Copyright (C) 2020 Daniel Lutz <dlu-ch@users.noreply.github.com>
import testenv # also sets up module search paths
import dlb.fs
import dlb_contrib.clike
import os
import textwrap
import unittest
class RegexTest(unittest.TestCase):
de... | gpl-3.0 |
nrhine1/scikit-learn | examples/applications/plot_stock_market.py | 227 | 8284 | """
=======================================
Visualizing the stock market structure
=======================================
This example employs several unsupervised learning techniques to extract
the stock market structure from variations in historical quotes.
The quantity that we use is the daily variation in quote ... | bsd-3-clause |
worldforge/atlas-cpp | src/Atlas-Python/tests/test_server.py | 1 | 3383 | #test TCP/IP server
#Copyright 2002 by AIR-IX SUUNNITTELU/Ahiplan Oy
#This library 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 2.1 of the License, or (at your option) any later versi... | lgpl-2.1 |
abridgett/boto | tests/unit/emr/test_instance_group_args.py | 112 | 2056 | #!/usr/bin/env python
# Author: Charlie Schluting <charlie@schluting.com>
#
# Test to ensure initalization of InstanceGroup object emits appropriate errors
# if bidprice is not specified, but allows float, int, Decimal.
from decimal import Decimal
from tests.compat import unittest
from boto.emr.instance_group import ... | mit |
SuporteCTRL/suitesaber | htdocs/site/site/bvs-mod/FCKeditor/editor/filemanager/connectors/py/upload.py | 44 | 3123 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2009 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http:... | gpl-3.0 |
CyanogenMod/android_kernel_oneplus_msm8974 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
40223210/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/_imp.py | 625 | 2115 | """(Extremely) low-level import machinery bits as used by importlib and imp."""
class __loader__(object):pass
def _fix_co_filename(*args,**kw):
raise NotImplementedError("%s:not implemented" % ('_imp.py:_fix_co_filename'))
def acquire_lock(*args,**kw):
"""acquire_lock() -> None Acquires the interpreter's... | gpl-3.0 |
cchurch/ansible | lib/ansible/modules/network/meraki/meraki_admin.py | 5 | 17464 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net>
# 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 = {
... | gpl-3.0 |
knowmetools/km-api | km_api/know_me/signals.py | 1 | 2117 | import logging
from django.db.models.signals import post_save
from django.dispatch import receiver
from rest_email_auth.models import EmailAddress
from rest_email_auth.signals import user_registered
from know_me import models
logger = logging.getLogger(__name__)
@receiver(user_registered)
def create_km_user(user... | apache-2.0 |
projectcalico/calico-nova | nova/tests/unit/scheduler/test_scheduler_utils.py | 4 | 16257 | # Copyright (c) 2013 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.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
printedheart/h2o-3 | py2/testdir_single_jvm/test_quant_cmp_uniform.py | 20 | 8751 | import unittest, time, sys, random, math, getpass
sys.path.extend(['.','..','../..','py'])
import h2o2 as h2o
import h2o_cmd, h2o_import as h2i, h2o_util
import h2o_print as h2p, h2o_exec as h2e, h2o_summ
from h2o_test import dump_json, verboseprint, OutputObj
# have to match the csv file?
# dtype=['string', 'float');... | apache-2.0 |
Xero-Hige/PythonTDA | TP1/influence.py | 1 | 1916 | from graph import Graph
from collections import deque
def Brand1(fb_graph):
influence = {}
for vertex in fb_graph.vertex:
influence[vertex] = 0
for s in fb_graph.vertex:
stack = deque()
P = {}
o = {}
d = {}
sigma = {}
for vertex in fb_graph.vertex:
P[vertex] = []
o[vertex] = 0
d[vertex] = -1
... | gpl-3.0 |
behzadnouri/scipy | scipy/weave/examples/fibonacci.py | 100 | 3980 | # Typical run:
# C:\home\eric\wrk\scipy\weave\examples>python fibonacci.py
# Recursively computing the first 30 fibonacci numbers:
# speed in python: 4.31599998474
# speed in c: 0.0499999523163
# speed up: 86.32
# Looping to compute the first 30 fibonacci numbers:
# speed in python: 0.000520999908447
# speed in c:... | bsd-3-clause |
Matt-Deacalion/django | tests/template_tests/filter_tests/test_length_is.py | 360 | 3204 | from django.template.defaultfilters import length_is
from django.test import SimpleTestCase
from ..utils import setup
class LengthIsTests(SimpleTestCase):
@setup({'length_is01': '{% if some_list|length_is:"4" %}Four{% endif %}'})
def test_length_is01(self):
output = self.engine.render_to_string('len... | bsd-3-clause |
boompieman/iim_project | project_python2/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/exceptions.py | 196 | 5440 | from __future__ import absolute_import
# Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(se... | gpl-3.0 |
faustinoaq/chat | main.py | 2 | 5367 | """
Open Chat by @faustinoaq
This app use Web.py micro web framework
and SQLAlchemy ORM
"""
import web # Web.py framework
import json # Used for generate JSON documents
import time # Used for generate timestamps
from db import db # Get the database queries
from random import randrange # Use... | mit |
felliott/osf.io | osf/migrations/0106_set_preprint_identifier_category.py | 16 | 1415 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-05-29 19:46
from __future__ import unicode_literals
from django.db import migrations, models
from django.contrib.contenttypes.models import ContentType
def set_preprint_identifier_catetory_to_legacy(apps, *args, **kwargs):
PreprintService = apps.get... | apache-2.0 |
SrNetoChan/Quantum-GIS | python/plugins/db_manager/db_plugins/postgis/sql_dictionary.py | 30 | 16054 | # -*- coding: utf-8 -*-
"""
***************************************************************************
sql_dictionary.py
---------------------
Date : April 2012
Copyright : (C) 2012 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
************... | gpl-2.0 |
mmbtba/odoo | addons/website_membership/models/membership.py | 221 | 1642 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
bdang2012/taiga-back-casting | taiga/base/api/views.py | 1 | 16558 | # Copyright (C) 2014-2015 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014-2015 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014-2015 David Barragán <bameda@dbarragan.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | agpl-3.0 |
glennw/servo | tests/wpt/web-platform-tests/old-tests/webdriver/windows/window_manipulation.py | 142 | 1556 | # -*- mode: python; fill-column: 100; comment-column: 100; -*-
import os
import sys
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
from selenium.common import exceptions
class WindowingTest(base_test.WebDriverBaseTest):
def test_maximize(self):
#sel... | mpl-2.0 |
awanke/bokeh | examples/glyphs/calendars.py | 45 | 3431 | from __future__ import absolute_import, print_function
from calendar import Calendar, day_abbr as day_abbrs, month_name as month_names
from bokeh.models import GridPlot, Plot, ColumnDataSource, FactorRange, CategoricalAxis, HoverTool
from bokeh.models.glyphs import Text, Rect
from bokeh.document import Document
from ... | bsd-3-clause |
wdzhou/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/PoldiDataAnalysis.py | 3 | 13806 | # pylint: disable=no-init,invalid-name,attribute-defined-outside-init,too-many-instance-attributes
from __future__ import (absolute_import, division, print_function)
from mantid.simpleapi import *
from mantid.api import *
from mantid.kernel import *
class PoldiDataAnalysis(PythonAlgorithm):
"""
This workflow... | gpl-3.0 |
appliedx/edx-platform | lms/djangoapps/verify_student/tests/test_models.py | 33 | 33741 | # -*- coding: utf-8 -*-
from datetime import timedelta, datetime
import ddt
import json
import requests.exceptions
import pytz
from django.conf import settings
from django.db.utils import IntegrityError
from django.test import TestCase
from mock import patch
from nose.tools import assert_is_none, assert_equals, assert... | agpl-3.0 |
HellerCommaA/flask-angular | lib/python2.7/site-packages/sqlalchemy/connectors/zxJDBC.py | 18 | 1882 | # connectors/zxJDBC.py
# Copyright (C) 2005-2013 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
import sys
from . import Connector
class ZxJDBCConnector(Connector):
driver... | mit |
x007007007/supervisor-monitor | versioneer.py | 386 | 68611 |
# Version: 0.18
"""The Versioneer - like a rocketeer, but for versions.
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6, and pypy
* [![Latest Version]
... | mit |
wilvk/ansible | lib/ansible/modules/cloud/amazon/ec2_lc_facts.py | 20 | 7274 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
akhilaananthram/nupic | examples/opf/experiments/spatial_classification/base/description.py | 32 | 14783 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
grhawk/ASE | tools/ase/calculators/emt.py | 2 | 7399 | """Effective medium theory potential."""
from math import sqrt, exp, log
import numpy as np
from ase.data import chemical_symbols
from ase.units import Bohr
from ase.calculators.neighborlist import NeighborList
from ase.calculators.calculator import Calculator
parameters = {
# E0 s0 V0 eta2 ... | gpl-2.0 |
charbeljc/OCB | addons/hr/res_config.py | 377 | 3452 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.