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 |
|---|---|---|---|---|---|
django-wodnas/django-tinymce | tinymce/widgets.py | 6 | 4860 | # Copyright (c) 2008 Joost Cassee
# Licensed under the terms of the MIT License (see LICENSE.txt)
"""
This TinyMCE widget was copied and extended from this code by John D'Agostino:
http://code.djangoproject.com/wiki/CustomWidgetsTinyMCE
"""
from django import forms
from django.conf import settings
from django.contrib... | mit |
hoh/Billabong | billabong/check.py | 1 | 2931 | # Copyright (c) 2015 "Hugo Herter http://hugoherter.com"
#
# This file is part of Billabong.
#
# Intercom 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 Foundation, either version 3 of the
# License, or (at your o... | agpl-3.0 |
valkjsaaa/sl4a | python/xmpppy/doc/examples/commandsbot.py | 87 | 7937 | #!/usr/bin/python
""" The example of using xmpppy's Ad-Hoc Commands (JEP-0050) implementation.
"""
import xmpp
from xmpp.protocol import *
options = {
'JID': 'circles@example.com',
'Password': '********',
}
class TestCommand(xmpp.commands.Command_Handler_Prototype):
""" Example class. You should read source if you... | apache-2.0 |
mat12/mytest | lib/python/Components/ChoiceList.py | 7 | 2176 | from MenuList import MenuList
from Tools.Directories import SCOPE_ACTIVE_SKIN, resolveFilename
from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, gFont, getDesktop
from Tools.LoadPixmap import LoadPixmap
from Tools.Directories import fileExists
import skin
def ChoiceEntryComponent(key="", text=None):
scre... | gpl-2.0 |
Gheehnest/three.js | utils/exporters/blender/addons/io_three/exporter/api/material.py | 55 | 8333 | from bpy import data, types
from .. import constants, logger
from .constants import MULTIPLY, WIRE, IMAGE
def _material(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
"""
if isinstance(... | mit |
ferrants/ansible | test/units/parsing/test_splitter.py | 204 | 4425 | # coding: utf-8
# (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 terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
admire93/youtube-dl | youtube_dl/extractor/sharesix.py | 128 | 2692 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
parse_duration,
)
class ShareSixIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?sharesix\.com/(?:f/)?(?P... | unlicense |
elsonrodriguez/madhatter | cobbler/modules/sync_post_restart_services.py | 6 | 2421 | import distutils.sysconfig
import sys
import os
import traceback
import cexceptions
import os
import sys
import xmlrpclib
import cobbler.module_loader as module_loader
import cobbler.utils as utils
plib = distutils.sysconfig.get_python_lib()
mod_path="%s/cobbler" % plib
sys.path.insert(0, mod_path)
def register():
... | gpl-2.0 |
caphrim007/ansible | lib/ansible/module_utils/network/f5/bigiq.py | 15 | 6723 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import time
try:
from f5.bigiq import ManagementRoot
fro... | gpl-3.0 |
alex/pip | pip/index.py | 3 | 38101 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... | mit |
faroit/mir_eval | tests/test_sonify.py | 1 | 3340 | """ Unit tests for sonification methods """
import mir_eval
import numpy as np
import scipy
def test_clicks():
# Test output length for a variety of parameter settings
for times in [np.array([1.]), np.arange(10)*1.]:
for fs in [8000, 44100]:
click_signal = mir_eval.sonify.clicks(times, fs... | mit |
crakensio/django_training | lib/python2.7/site-packages/django/contrib/auth/tests/test_auth_backends.py | 97 | 19207 | from __future__ import unicode_literals
from datetime import date
from django.conf import settings
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User, Group, Permission, AnonymousUser
from django.contrib.auth.tests.utils import skipIfCustomUser
from django.contrib.auth.te... | cc0-1.0 |
kunaltyagi/nsiqcppstyle | nsiqcppstyle.py | 1 | 2624 | #!/usr/bin/env python
#
# Copyright (c) 2009 NHN 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 l... | gpl-2.0 |
dmsurti/mayavi | mayavi/sources/chaco_reader.py | 3 | 2647 | """A Chaco file reader.
"""
# Author: Suyog Dutt Jain <suyog.jain@aero.iitb.ac.in>
# Copyright (c) 2009, Enthought, Inc.
# License: BSD Style.
# Enthought library imports.
from traits.api import Instance, Str
from traitsui.api import View, Group, Item
from tvtk.api import tvtk
# Local imports.
from mayavi.core.source... | bsd-3-clause |
ZaraSeries/repo | script.module.urlresolver/lib/urlresolver/plugins/streaminto.py | 3 | 2808 | """
urlresolver XBMC Addon
Copyright (C) 2011 t0mm0
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.
... | gpl-2.0 |
arunlodhi/pymc3 | pymc3/interactive_sampling.py | 10 | 4699 | try:
__IPYTHON__
import IPython
import ipywidgets as widgets
from IPython.core import display
from traitlets import Unicode, Integer, Float
import json
from numpy.random import seed
import time
from .backends.base import MultiTrace
from .sampling import _iter_sample
except (NameE... | apache-2.0 |
dnozay/lettuce | tests/integration/lib/Django-1.3/django/core/servers/fastcgi.py | 289 | 6402 | """
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalo... | gpl-3.0 |
gdgellatly/OCB1 | addons/delivery/partner.py | 57 | 1474 | # -*- 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 |
swilcox/pinax-blog | pinax/blog/admin.py | 3 | 2677 | from django.contrib import admin
from django.utils import timezone
from django.utils.functional import curry
from django.utils.translation import ugettext_lazy as _
from .forms import AdminPostForm
from .models import Post, Image, ReviewComment, Section
from .utils import can_tweet
class ImageInline(admin.TabularInl... | mit |
gengjiawen/AndroidHelper | aar_util/aar_util.py | 1 | 1841 | import os
import shutil
import tempfile
import zipfile
from utils.file_util import get_files_by_re, gen_new_file_extension
def get_aar_files(proj_dir, des_dir):
rel_aar_dir = r"build\outputs\aar"
aar_dirs = [os.path.join(proj_dir, i) for i in os.listdir(proj_dir) if os.path.isdir(os.path.join(proj_dir, i))]
... | mit |
SysTheron/adhocracy | src/adhocracy/websetup.py | 2 | 1955 | """Setup the adhocracy application"""
import logging
import os
import os.path
import pylons
import pylons.test
from pylons import config
import migrate.versioning.api as migrateapi
try:
from migrate.versioning.exceptions import DatabaseAlreadyControlledError
from migrate.versioning.exceptions import DatabaseN... | agpl-3.0 |
JFriel/honours_project | venv/lib/python2.7/site-packages/numpy/fft/tests/test_helper.py | 117 | 2556 | #!/usr/bin/env python
"""Test functions for fftpack.helper module
Copied from fftpack.helper by Pearu Peterson, October 2005
"""
from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_array_almost_equal
from numpy import fft
fr... | gpl-3.0 |
slundberg/Mocha.jl | docs/conf.py | 23 | 8570 | # -*- coding: utf-8 -*-
#
# Mocha documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 13 00:43:40 2014.
#
# 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 file.
#
# All... | mit |
waymarkedtrails/waymarked-trails-site | db/tables/route_nodes.py | 2 | 3914 | # This file is part of the Waymarked Trails Map Project
# Copyright (C) 2015 Sarah Hoffmann
#
# This 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 any later version.
#
#... | gpl-3.0 |
Yawning/or-applet | orapplet/status_icon.py | 1 | 12289 | #!/usr/bin/env python2
# This file is part of or-applet.
#
# or-applet 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.
#
# or-applet i... | gpl-3.0 |
deadblue/baidupan_shell | pyasn1/type/univ.py | 185 | 39731 | # ASN.1 "universal" data types
import operator, sys
from pyasn1.type import base, tag, constraint, namedtype, namedval, tagmap
from pyasn1.codec.ber import eoo
from pyasn1.compat import octets
from pyasn1 import error
# "Simple" ASN.1 types (yet incomplete)
class Integer(base.AbstractSimpleAsn1Item):
tagSet = bas... | gpl-2.0 |
liyu1990/sklearn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
barthisrael/OmniDB | OmniDB/OmniDB_app/include/paramiko/kex_gex.py | 7 | 10302 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 (a... | mit |
numerigraphe/odoo | addons/project/report/project_report.py | 279 | 5789 | # -*- 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 |
liavkoren/djangoDev | django/db/backends/schema.py | 2 | 38689 | import hashlib
import operator
from django.db.backends.creation import BaseDatabaseCreation
from django.db.backends.utils import truncate_name
from django.db.models.fields.related import ManyToManyField
from django.db.transaction import atomic
from django.utils.encoding import force_bytes
from django.utils.log import ... | bsd-3-clause |
rmfranciacastillo/freecodecamp_projects | weather/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py | 2736 | 6387 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... | apache-2.0 |
tvenkat/askbot-devel | askbot/management/commands/add_admin.py | 13 | 1434 | from django.core.management.base import NoArgsCommand
from django.contrib.auth.models import User
from django.db.models.signals import pre_save, post_save
import sys
class Command(NoArgsCommand):
def get_user(self, uid_str):
try:
uid = int(uid_str)
return User.objects.get(id=uid)
... | gpl-3.0 |
cmusatyalab/django-s3 | django_s3/forms.py | 1 | 1062 | #
# Copyright (C) 2012 Carnegie Mellon University
#
# 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 AN... | gpl-2.0 |
rigmar/idapython | examples/ex_patch.py | 18 | 1139 | # -------------------------------------------------------------------------
# This is an example illustrating how to visit all patched bytes in Python
# (c) Hex-Rays
import idaapi
# -------------------------------------------------------------------------
class patched_bytes_visitor(object):
def __init__(self):
... | bsd-3-clause |
cirrax/openstack-nagios-plugins | openstacknagios/nova/Services.py | 1 | 4298 | #
# Copyright (C) 2014 Cirrax GmbH http://www.cirrax.com
# Benedikt Trefzer <benedikt.trefzer@cirrax.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 Foundation, either version 3 of t... | gpl-3.0 |
studio666/gnuradio | grc/base/Connection.py | 17 | 5254 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
Ichag/odoo | openerp/addons/base/__init__.py | 379 | 1134 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
IndigoTiger/ezzybot | ezzybot/util/bucket.py | 5 | 1252 | from time import time
class TokenBucket(object):
"""An implementation of the token bucket algorithm.
>>> bucket = TokenBucket(80, 0.5)
>>> print bucket.consume(10)
True
>>> print bucket.consume(90)
False
"""
def __init__(self, tokens, fill_rate):
"""tokens is the total tokens... | gpl-3.0 |
sauloal/linuxscripts | apache/var/www/html/saulo/torrent/html/bin/clients/mainline/BTL/yielddefer25.py | 11 | 6035 | # yielddefer is an async programming mechanism with a blocking look-alike syntax
#
# The contents of this file are subject to the Python Software Foundation
# License Version 2.3 (the License). You may not copy or use this file, in
# either source code or executable form, except in compliance with the License.
# You m... | mit |
wsdream/CARP | CARP/src/evaluator.py | 1 | 5610 | ########################################################
# evaluator.py
# Author: Jamie Zhu <jimzhu@GitHub>
# Created: 2014/2/6
# Last updated: 2014/11/03
########################################################
import numpy as np
from numpy import linalg as LA
import time, sys
import random
import core
from utilitie... | mit |
bhargav2408/python-for-android | python-modules/twisted/twisted/conch/ssh/service.py | 61 | 1418 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
The parent class for all the SSH services. Currently implemented services
are ssh-userauth and ssh-connection.
Maintainer: Paul Swartz
"""
from twisted.python import log
class SSHService(log.Logger):
name = None # this is th... | apache-2.0 |
manojgudi/sandhi | modules/gr36/gnuradio-core/src/python/gnuradio/gr/qa_kludged_imports.py | 18 | 1325 | #!/usr/bin/env python
#
# Copyright 2005,2008,2010 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 ... | gpl-3.0 |
jarathomas/openVA-Pipeline | pipeline.py | 1 | 49777 | #-------------------------------------------------------------------------------------------------------------------------------------------#
# openVA Pipeline: pipeline.py -- Software for processing Verbal Autopsy data with automated cause of death assignment. #
# Copyright (C) 2018 Jason Thomas,... | gpl-3.0 |
gfyoung/pandas | pandas/tests/frame/indexing/test_getitem.py | 2 | 5364 | import numpy as np
import pytest
from pandas import (
Categorical,
CategoricalDtype,
CategoricalIndex,
DataFrame,
MultiIndex,
Series,
Timestamp,
get_dummies,
period_range,
)
import pandas._testing as tm
from pandas.core.arrays import SparseArray
class TestGetitem:
def test_get... | bsd-3-clause |
koobonil/Boss2D | Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/training/server_lib_same_variables_no_clear_test.py | 125 | 2159 | # 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... | mit |
nilsgrabbert/spark | examples/src/main/python/streaming/hdfs_wordcount.py | 85 | 1865 | #
# 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 |
ddrmanxbxfr/servo | tests/wpt/css-tests/tools/py/testing/code/test_code.py | 216 | 4212 | import py
import sys
def test_ne():
code1 = py.code.Code(compile('foo = "bar"', '', 'exec'))
assert code1 == code1
code2 = py.code.Code(compile('foo = "baz"', '', 'exec'))
assert code2 != code1
def test_code_gives_back_name_for_not_existing_file():
name = 'abc-123'
co_code = compile("pass\n", ... | mpl-2.0 |
dralves/nixysa | third_party/ply-3.1/test/lex_hedit.py | 174 | 1141 | # -----------------------------------------------------------------------------
# hedit.py
#
# Paring of Fortran H Edit descriptions (Contributed by Pearu Peterson)
#
# These tokens can't be easily tokenized because they are of the following
# form:
#
# nHc1...cn
#
# where n is a positive integer and c1 ... cn are ch... | apache-2.0 |
franck-talbart/codelet_tuning_infrastructure | cts/plugins/plugin_config.py | 1 | 12594 | #!/usr/bin/python
#************************************************************************
# Codelet Tuning Infrastructure
# Copyright (C) 2010-2015 Intel Corporation, CEA, GENCI, and UVSQ
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... | gpl-3.0 |
abhikeshav/ydk-py | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_ip_pfilter_oper.py | 1 | 21114 | """ Cisco_IOS_XR_ip_pfilter_oper
This module contains a collection of YANG definitions
for Cisco IOS\-XR ip\-pfilter package operational data.
This module contains definitions
for the following management objects\:
pfilter\-ma\: Root class of PfilterMa Oper schema
Copyright (c) 2013\-2015 by Cisco Systems, Inc.
A... | apache-2.0 |
abligh/xen-4.2-live-migrate | tools/python/xen/xend/xenstore/tests/stress_xs.py | 49 | 2700 | # This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied war... | gpl-2.0 |
MLnick/spark | examples/src/main/python/mllib/logistic_regression_with_lbfgs_example.py | 106 | 2082 | #
# 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 |
yaukwankiu/armor | __init__pre_20140313.py | 1 | 2017 | """
I am completely rewriting this framework which was formerly known as weatherPattern. Yau Kwan Kiu, 802 CERB, NTU, 23-1-2013.
== Requirements ==
* python 2.7 or similar (python 2.5 will probably be okay, no python 3 please)
* numpy and scipy
* no sympy needed yet
* no opencv yet
== What's this? ==
ARMOR = Adjustm... | cc0-1.0 |
boltnev/iktomi | tests/db/sqla/__init__.py | 4 | 2080 | import unittest
from sqlalchemy.exc import UnboundExecutionError
from sqlalchemy.orm import sessionmaker
from sqlalchemy import func
from iktomi.db.sqla import multidb_binds
from . import multidb_models
from .multidb_models import db1, db2
class MultidbTest(unittest.TestCase):
def setUp(self):
binds = mu... | mit |
Xowap/ansible | lib/ansible/plugins/callback/oneline.py | 144 | 3487 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
Voluntarynet/BitmessageKit | BitmessageKit/Vendor/static-python/Lib/traceback.py | 67 | 11255 | """Extract, format and print information about Python stack traces."""
import linecache
import sys
import types
__all__ = ['extract_stack', 'extract_tb', 'format_exception',
'format_exception_only', 'format_list', 'format_stack',
'format_tb', 'print_exc', 'format_exc', 'print_exception',
... | mit |
deepsrijit1105/edx-platform | openedx/core/djangoapps/credit/admin.py | 27 | 2460 | """
Django admin page for credit eligibility
"""
from ratelimitbackend import admin
from openedx.core.djangoapps.credit.models import (
CreditConfig, CreditCourse, CreditProvider, CreditEligibility, CreditRequest, CreditRequirement,
CreditRequirementStatus
)
class CreditCourseAdmin(admin.ModelAdmin):
"""... | agpl-3.0 |
statgen/encore | encore/tests/api_tests.py | 1 | 1036 | import pytest
import flask_login
from encore import create_app
from encore.user import User
@pytest.fixture(scope="module")
def app(request):
app = create_app()
ctx = app.app_context()
ctx.push()
request.addfinalizer(ctx.pop)
return app
@pytest.fixture(scope="module")
def test_client(request, app)... | agpl-3.0 |
williamfeng323/py-web | flask/lib/python3.6/site-packages/psycopg2/psycopg1.py | 8 | 3339 | """psycopg 1.1.x compatibility module
This module uses the new style connection and cursor types to build a psycopg
1.1.1.x compatibility layer. It should be considered a temporary hack to run
old code while porting to psycopg 2. Import it as follows::
from psycopg2 import psycopg1 as psycopg
"""
# psycopg/psycop... | mit |
aeron15/ruffus | ruffus/test/test_transform_with_no_re_matches.py | 5 | 3227 | #!/usr/bin/env python
from __future__ import print_function
"""
test_transform_with_no_re_matches.py
test messages with no regular expression matches
"""
#88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
# options
#888888888888888888888888888888888888888888... | mit |
jaingaurav/Diamond | src/collectors/cephstats/cephstats.py | 26 | 1581 | # coding=utf-8
"""
Get ceph status from one node
"""
import subprocess
import re
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),
'ceph'))
from ceph import CephCollector
patternchk = re.compile(r'\bclient io .*')
numberchk = re.compile(r... | mit |
tersmitten/ansible | lib/ansible/plugins/shell/powershell.py | 30 | 12111 | # Copyright (c) 2014, Chris Church <chris@ninemoreminutes.com>
# 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 = '''
name: powershell
p... | gpl-3.0 |
Kovath/league-announcer | log_analyzer.py | 1 | 1527 | #!/usr/bin/env python
# LOG ANALYZER
# by Kevin Yang
#
# Assumes VERY MUCH THIS FORMAT:
# [<time>] <event> -> <data>
import sys, re
import numpy as np
def find_outliers(array, mean = None, std = None, m = 6):
if mean == None:
mean = np.mean(array)
if std == None:
std = np.std(array)
return array[abs(array - ... | mit |
40123148/40123148 | static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_case.py | 738 | 51689 | import difflib
import pprint
import pickle
import re
import sys
import warnings
import weakref
import inspect
from copy import deepcopy
from test import support
import unittest
from .support import (
TestEquality, TestHashing, LoggingResult,
ResultWithNoStartTestRunStopTestRun
)
class Test(object):
"Ke... | lgpl-3.0 |
gangadharkadam/v5_frappe | frappe/utils/data.py | 4 | 17064 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
# IMPORTANT: only import safe functions as this module will be included in jinja environment
import frappe
import operator
import re, urllib, datetime, math
import babel.dates... | mit |
cloudify-cosmo/cloudify-diamond-plugin | diamond_agent/tests/test_single_node.py | 1 | 7362 | import os
import time
import tempfile
import pickle as cPickle
import mock
from testtools import TestCase
from cloudify.workflows import local
from cloudify.decorators import operation
from diamond_agent import tasks
from diamond_agent.tests import IGNORED_LOCAL_WORKFLOW_MODULES
class TestSingleNode(TestCase):
... | apache-2.0 |
varunagrawal/azure-services | varunagrawal/site-packages/django/contrib/admindocs/views.py | 77 | 15064 | import inspect
import os
import re
from django import template
from django.template import RequestContext
from django.conf import settings
from django.contrib.admin.views.decorators import staff_member_required
from django.db import models
from django.shortcuts import render_to_response
from django.core.exceptions imp... | gpl-2.0 |
lasote/conan | conans/test/integration/profile_test.py | 1 | 16563 | import unittest
from conans.client import tools
from conans.test.utils.tools import TestClient
from conans.test.utils.cpp_test_files import cpp_hello_conan_files
from conans.util.files import save, load
import os
from conans.paths import CONANFILE
from collections import OrderedDict
from conans.test.utils.test_files i... | mit |
luofei98/qgis | python/plugins/processing/algs/otb/maintenance/OTBTester.py | 4 | 16871 | # -*- coding: utf-8 -*-
"""
***************************************************************************
OTBTester.py
---------------------
Copyright : (C) 2013 by CS Systemes d'information (CS SI)
Email : otb at c-s dot fr (CS SI)
Contributors : Julien Malik (CS SI... | gpl-2.0 |
aewallin/opencamlib | examples/python/old/kdtree_tst.py | 1 | 5359 | import ocl as cam
import camvtk
import time
import vtk
import datetime
if __name__ == "__main__":
myscreen = camvtk.VTKScreen()
myscreen.setAmbient(1,1,1)
#stl = camvtk.STLSurf(filename="demo.stl")
stl = camvtk.STLSurf(filename="demo2.stl")
print("STL surface read")
myscreen.addActor(stl... | lgpl-2.1 |
axelkennedal/dissen | dissenEnv/lib/python3.5/site-packages/django/forms/fields.py | 35 | 47161 | """
Field classes.
"""
from __future__ import unicode_literals
import copy
import datetime
import os
import re
import sys
import uuid
import warnings
from decimal import Decimal, DecimalException
from io import BytesIO
from django.core import validators
from django.core.exceptions import ValidationError
# Provide th... | mit |
hmendozap/master-arbeit-projects | autosk_dev_test/component/LinReg.py | 1 | 8756 | import numpy as np
import scipy.sparse as sp
from HPOlibConfigSpace.configuration_space import ConfigurationSpace
from HPOlibConfigSpace.conditions import EqualsCondition, InCondition
from HPOlibConfigSpace.hyperparameters import UniformFloatHyperparameter, \
UniformIntegerHyperparameter, CategoricalHyperparameter... | mit |
idnael/ctxsearch | ctxsearch/_termi/_termi_encoding.py | 1 | 4460 | #!/usr/bin/python
# TerminatorEncoding - charset encoding classes
# Copyright (C) 2006-2008 chantra@debuntu.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, version 2 only.
#
# T... | gpl-2.0 |
kbrose/project_euler | p90-99/p91.py | 1 | 1360 | grid_size = 50 # assumes a square grid
counter = 3 * (grid_size * grid_size) # all cases that won't be covered
def gcd(a,b):
while (b != 0) and (a != b) and (a != 0):
if b < a:
a = a - b
else:
b = b - a
if a > 0:
return a
return b
end = grid_size+1
def my_a... | unlicense |
LIMXTEC/BitSend | qa/rpc-tests/mempool_reorg.py | 3 | 4514 | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitsend Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test re-org scenarios with a mempool that contains transactions
# that spend (directly or indirectly)... | mit |
piru/letsencrypt | letsencrypt/tests/display/enhancements_test.py | 53 | 1703 | """Module for enhancement UI."""
import logging
import unittest
import mock
from letsencrypt import errors
from letsencrypt.display import util as display_util
class AskTest(unittest.TestCase):
"""Test the ask method."""
def setUp(self):
logging.disable(logging.CRITICAL)
def tearDown(self):
... | apache-2.0 |
canwe/NewsBlur | apps/rss_feeds/migrations/0046_remove_feedhistory.py | 18 | 5828 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting model 'FeedUpdateHistory'
db.delete_table('rss_feeds_feedupdatehistory')
def backwards(se... | mit |
sumeetsk/NEXT-1 | next/assistant/pijemont/verifier.py | 3 | 7768 | import yaml, json
import random
import traceback
import sys
import os
import next.utils as utils
DICT = {'dict','dictionary','map'}
LIST = {'list'}
TUPLE = {'tuple'}
ONEOF = {'oneof'}
NUM = {'num','number','float'}
STRING = {'str','string','multiline'}
ANY = {'any','stuff'}
FILE = {'file'}
BOOL = {'boolean','bool'}
... | apache-2.0 |
nachtmaar/androlyze | androlyze/util/Util.py | 1 | 8887 |
# encoding: utf-8
__author__ = "Nils Tobias Schmidt"
__email__ = "schmidt89 at informatik.uni-marburg.de"
'''
Utility module
'''
from Queue import Empty
import itertools
from os.path import splitext
import re
import sys
import time
import traceback
from androlyze.log.Log import log
def sha256(data):
'''
... | mit |
wdurhamh/statsmodels | statsmodels/genmod/families/links.py | 35 | 20123 | '''
Defines the link functions to be used with GLM and GEE families.
'''
import numpy as np
import scipy.stats
FLOAT_EPS = np.finfo(float).eps
class Link(object):
"""
A generic link function for one-parameter exponential family.
`Link` does nothing, but lays out the methods expected of any subclass.
... | bsd-3-clause |
mottosso/mindbender-setup | bin/windows/python36/Lib/os.py | 22 | 37442 | r"""OS routines for NT or Posix depending on what system we're on.
This exports:
- all functions from posix or nt, e.g. unlink, stat, etc.
- os.path is either posixpath or ntpath
- os.name is either 'posix' or 'nt'
- os.curdir is a string representing the current directory (always '.')
- os.pardir is a strin... | mit |
chrischabot/opensocial-python-client | tests/opensocial_tests/oauth_test.py | 4 | 1242 | #!/usr/bin/python
#
# Copyright (C) 2007, 2008 Google 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 applicabl... | apache-2.0 |
spreg-git/pysal | pysal/spreg/error_sp_hom_regimes.py | 4 | 70548 | '''
Hom family of models with regimes.
'''
__author__ = "Luc Anselin luc.anselin@asu.edu, Pedro V. Amaral pedro.amaral@asu.edu, Daniel Arribas-Bel darribas@asu.edu"
from scipy import sparse as SP
import numpy as np
import multiprocessing as mp
from numpy import linalg as la
from pysal import lag_spatial
from utils i... | bsd-3-clause |
fxia22/ASM_xf | PythonD/lib/python2.4/distutils/log.py | 7 | 1424 | """A simple log mechanism styled after PEP 282."""
# This module should be kept compatible with Python 2.1.
# The class here is styled after PEP 282 so that it could later be
# replaced with a standard Python logging implementation.
DEBUG = 1
INFO = 2
WARN = 3
ERROR = 4
FATAL = 5
import sys
class Log:
def __i... | gpl-2.0 |
manikTharaka/al-go-rithms | cryptography/ElGamal/Python/ElGamal.py | 2 | 1960 | from algo import mod_inv
from random import randrange, randint
from ecurves import *
def elgalmal_encrypt(M,k,a,p):
'''
Input:
M - menssage
k - recipient private key
a - generator
p - prime
Output (c1,c2) [Encrypted]
'''
s = randrange... | mit |
dongguangming/youtube-dl | youtube_dl/extractor/kuwo.py | 22 | 11149 | # coding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..utils import (
get_element_by_id,
clean_html,
ExtractorError,
remove_start,
)
class KuwoBaseIE(InfoExtractor):
_FORMATS = [
{'format': 'ape', 'ext': 'ape', 'prefere... | unlicense |
ericzundel/pants | tests/python/pants_test/base/test_worker_pool.py | 33 | 1085 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import threading
imp... | apache-2.0 |
jjas0nn/solvem | tensorflow/lib/python2.7/site-packages/tensorflow/contrib/distributions/python/ops/laplace.py | 11 | 6785 | # 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... | mit |
pravsripad/mne-python | mne/__init__.py | 4 | 5932 | """MNE software for MEG and EEG data analysis."""
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
#
# Generic release markers:
# X.Y
# X.Y.Z # For bugfix releases
#
# Admissible pre-release markers:
# X.YaN # Alpha release
# X.YbN # Beta release
# X.YrcN # Rele... | bsd-3-clause |
Radium-Devices/Radium_shamu | scripts/build-all.py | 236 | 11419 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# ... | gpl-2.0 |
jeroenseegers/git-history | setup.py | 1 | 1125 | import os
from setuptools import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
setup(
name='git-history',
version='0.0.1',
description='Keep a history of all your git commands.',
long_... | mit |
jelugbo/tundex | lms/djangoapps/courseware/features/problems.py | 6 | 5985 | '''
Steps for problem.feature lettuce tests
'''
# pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from common import i_am_registered_for_the_course, visit_scenario_item
from problems_setup import PROBLEM_DICT, answer_problem, problem_has_answer, add_problem_to_course
def _view_problem(... | agpl-3.0 |
codeforamerica/Change-By-Us | framework/page.py | 4 | 3570 | """
:copyright: (c) 2011 Local Projects, all rights reserved
:license: Affero GNU GPL v3, see LICENSE for more details.
"""
import cgi, os
import framework.filters as filters
from lib import jinja2
from framework.config import *
from framework.log import log
log.info("_________________________________________... | agpl-3.0 |
googleads/google-ads-python | google/ads/googleads/v8/errors/types/reach_plan_error.py | 1 | 1178 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 |
zengenti/ansible | lib/ansible/modules/network/cumulus/_cl_license.py | 11 | 4949 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
NirBenTalLab/proorigami-cde-package | cde-root/usr/lib64/python2.4/site-packages/numpy/ctypeslib.py | 2 | 12373 | """
============================
``ctypes`` Utility Functions
============================
See Also
---------
load_library : Load a C library.
ndpointer : Array restype/argtype with verification.
as_ctypes : Create a ctypes array from an ndarray.
as_array : Create an ndarray from a ctypes array.
References
----------... | mit |
jackjennings/Mechanic | src/lib/site-packages/requests/packages/urllib3/util/ssl_.py | 4 | 12101 | from __future__ import absolute_import
import errno
import warnings
import hmac
from binascii import hexlify, unhexlify
from hashlib import md5, sha1, sha256
from ..exceptions import SSLError, InsecurePlatformWarning, SNIMissingWarning
SSLContext = None
HAS_SNI = False
IS_PYOPENSSL = False
# Maps the length of a d... | mit |
3dfxsoftware/cbss-addons | account_analytic_analysis/account_analytic_analysis.py | 1 | 46100 | # -*- 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... | gpl-2.0 |
mhrivnak/pulp | server/test/unit/plugins/test_loader.py | 15 | 11811 | import atexit
import os
import shutil
import string
import sys
import tempfile
import traceback
import mock
from .. import base
from pulp.plugins.cataloger import Cataloger
from pulp.plugins.distributor import Distributor
from pulp.plugins.importer import Importer
from pulp.plugins.loader import exceptions, loading, ... | gpl-2.0 |
jeffrey4l/nova | nova/tests/unit/fake_volume.py | 9 | 10049 | # 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.