repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
thechampanurag/PyUserInput | tests/test_unix.py | 6 | 2460 | '''
Tested on linux.
install: Xvfb, Xephyr, PyVirtualDisplay, nose
on Ubuntu:
sudo apt-get install python-nose
sudo apt-get install xvfb
sudo apt-get install xserver-xephyr
sudo apt-get install python-setuptools
sudo easy_install PyVirtualDisplay
to start:
nosetests -v
'''
from nose.tool... | gpl-3.0 |
wasit7/cs426 | code/week13_bokeh/a_controller.py | 1 | 1588 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 22 14:45:42 2015
@author: Wasit
"""
#sequential
import time
import numpy as np
from six.moves import zip
from bokeh.plotting import *
def part(n=20, m=3):
base = n//m;
extra = n-m*(n//m)
x=np.ones(m,dtype=np.int32)*base
x[0:extra]=base+1
y = [0]
c... | mit |
fengxiaoiie/volatility | volatility/plugins/linux/check_syscall.py | 8 | 10890 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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. You may not use, modify or
# distribu... | gpl-2.0 |
amikey/portia | slyd/slyd/projectspec.py | 2 | 8614 | from __future__ import absolute_import
import json, re, shutil, errno, os
import slyd.errors
from os.path import join, splitext
from twisted.web.resource import NoResource, ForbiddenResource
from jsonschema.exceptions import ValidationError
from .resource import SlydJsonResource
from .html import html4annotation
from... | bsd-3-clause |
mganeva/mantid | Testing/SystemTests/tests/analysis/SANS2DSearchCentreGUI.py | 1 | 1510 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source
# & Institut Laue - Langevin
# SPDX - License - Identifier: GPL - 3.0 +
#pylint: disable=invalid-name
from __future_... | gpl-3.0 |
idjaw/cliff | cliff/command.py | 3 | 1375 |
import abc
import argparse
import inspect
import six
@six.add_metaclass(abc.ABCMeta)
class Command(object):
"""Base class for command plugins.
:param app: Application instance invoking the command.
:paramtype app: cliff.app.App
"""
deprecated = False
def __init__(self, app, app_args, cmd_... | apache-2.0 |
jrmyp/attelo | attelo/learning/local.py | 3 | 6625 | """
Local classifiers
"""
import numpy as np
from attelo.table import (DataPack,
for_labelling)
from .interface import (AttachClassifier,
LabelClassifier)
from .util import (relabel)
# pylint: disable=too-few-public-methods
class SklearnClassifier(object):
'''
... | gpl-3.0 |
nive-cms/nive | nive/adminview/view.py | 1 | 13829 | #----------------------------------------------------------------------
# Copyright 2012, 2013 Arndt Droullier, Nive GmbH. All rights reserved.
#
# 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, ... | gpl-3.0 |
ChainsAutomation/chains | lib/chains/commandline/commands/AmqpSendmany.py | 1 | 1073 | from __future__ import absolute_import
from __future__ import print_function
from chains.commandline.commands import Command
import time
import sys
from six.moves import range
class CommandAmqpSendmany(Command):
def main(self, number=1000, dotEvery=10, numEvery=100):
""" Flood message bus with events """
... | gpl-2.0 |
pacoqueen/cican | utils/gmapcatcher/gmapcatcher/pyGPSD/nmea/nmea_playback.py | 3 | 3770 | #!/usr/bin/env python
#
# NMEA Toolkit Playback tool
# Copyright (C) 2008 Tim Savage
#
# This file is part of the NMEA Toolkit.
#
# The NMEA Toolkit 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 versi... | gpl-3.0 |
addition-it-solutions/project-all | addons/account_accountant/__openerp__.py | 8 | 1812 | # -*- 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 |
weylin/CloudBot | plugins/urban.py | 2 | 2529 | import random
import requests
from cloudbot import hook
from cloudbot.util import formatting
base_url = 'http://api.urbandictionary.com/v0'
define_url = base_url + "/define"
random_url = base_url + "/random"
@hook.command("urban", "u", autohelp=False)
def urban(text, reply):
"""<phrase> [id] - Looks up <phrase... | gpl-3.0 |
ssbarnea/ansible | test/units/plugins/strategy/test_strategy.py | 36 | 21216 | # (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 |
Ayub-Khan/edx-platform | openedx/core/lib/block_cache/tests/test_utils.py | 33 | 6944 | """
Common utilities for tests in block_cache module
"""
# pylint: disable=protected-access
from ..transformer import BlockStructureTransformer
class MockXBlock(object):
"""
A mock XBlock to be used in unit tests, thereby decoupling the
implementation of the block cache framework from the xBlock
imple... | agpl-3.0 |
rghe/ansible | lib/ansible/modules/packaging/os/macports.py | 5 | 7016 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Jimmy Tang <jcftang@gmail.com>
# Based on okpg (Patrick Pelletier <pp.pelletier@gmail.com>), pacman
# (Afterburn) and pkgin (Shaun Zinck) modules
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ... | gpl-3.0 |
hungtt57/matchmaker | lib/python2.7/site-packages/django/contrib/gis/geos/point.py | 103 | 4401 | from ctypes import c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.utils import six
from django.utils.six.moves import range
class Point(GEOSGeometry):
_minlength = 2
_m... | mit |
msebire/intellij-community | python/lib/Lib/mutex.py | 99 | 1749 | """Mutual exclusion -- for use with module sched
A mutex has two pieces of state -- a 'locked' bit and a queue.
When the mutex is not locked, the queue is empty.
Otherwise, the queue contains 0 or more (function, argument) pairs
representing functions (or methods) waiting to acquire the lock.
When the mutex is unlocke... | apache-2.0 |
Eseoghene/bite-project | deps/mrtaskman/common/split_stream.py | 16 | 2760 | #!/usr/bin/python
# 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
# di... | apache-2.0 |
apache/climate | ocw/esgf/download.py | 5 | 3135 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
ColOfAbRiX/ansible | lib/ansible/modules/monitoring/librato_annotation.py | 23 | 5668 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (C) Seth Edwards, 2014
#
# 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 ... | gpl-3.0 |
moccu/django-markymark | markymark/widgets.py | 1 | 1531 | from django import forms
from django.conf import settings
from markymark.renderer import initialize_renderer
class MarkdownTextarea(forms.Textarea):
"""
Extended forms Textarea which enables the javascript markdown editor.
"""
def __init__(self, *args, **kwargs):
"""
Sets the require... | mit |
jake1036/spider | scrapy/selector/lxmlsel.py | 175 | 1340 | """
XPath selectors based on lxml
"""
from scrapy.utils.deprecate import create_deprecated_class
from .unified import Selector, SelectorList
__all__ = ['HtmlXPathSelector', 'XmlXPathSelector', 'XPathSelector',
'XPathSelectorList']
def _xpathselector_css(self, *a, **kw):
raise RuntimeError('.css() meth... | bsd-3-clause |
Hellowlol/PyTunes | libs/mutagen/wavpack.py | 16 | 1752 | # A WavPack reader/tagger
#
# Copyright 2006 Joe Wreschnig
#
# 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.
"""WavPack reading and writing.
WavPack is a lossless format that uses AP... | gpl-3.0 |
Nepherhotep/django | django/core/management/commands/sendtestemail.py | 349 | 1449 | import socket
from django.core.mail import mail_admins, mail_managers, send_mail
from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = "Sends a test email to the email addresses specified as arguments."
missing_args_message = "You must specif... | bsd-3-clause |
wwj718/edx-platform | lms/djangoapps/bulk_email/migrations/0001_initial.py | 49 | 2975 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
import xmodule_django.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations ... | agpl-3.0 |
sverrirab/kosningar | kosningar2016.py | 1 | 2895 | import itertools
MAJORITY = 32 # out of 63
RESULTS = {'A': 4, 'C': 7, 'B': 8, 'D': 21, 'P': 10, 'S': 3, 'V': 10}
ALL = "".join(sorted(RESULTS.keys()))
def normalize(t):
"""
Get a sorted list of party letters for inserting into set/hash.
:param t: set of letters
:return: string with sorted letters
... | mit |
jmighion/ansible | lib/ansible/modules/network/cloudengine/ce_mtu.py | 27 | 20059 | #!/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 |
dmccloskey/SBaaS_thermodynamics | SBaaS_thermodynamics/stage03_quantification_dG_f_postgresql_models.py | 1 | 7971 | #SBaaS base
from SBaaS_base.postgresql_orm_base import *
class data_stage03_quantification_dG0_f(Base):
__tablename__ = 'data_stage03_quantification_dG0_f'
id = Column(Integer, Sequence('data_stage03_quantification_dG0_f_id_seq'), primary_key=True)
reference_id = Column(String(100))
met_name = Column(St... | mit |
zstackio/zstack-woodpecker | integrationtest/vm/multihosts/zwatch/test_alarm_change_state.py | 2 | 4233 | '''
test change alarm state to see if it will send alarm email.
@author: Ronghao.zhou
'''
import time as time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.operations.zwatch_operations as zwt_ops
import os
test_stub = test_lib.lib_get_test_stub()
... | apache-2.0 |
yapdns/yapdns-client | vendor/github.com/elastic/beats/packetbeat/tests/system/test_0018_pgsql_long_result.py | 10 | 2782 | from packetbeat import BaseTest
"""
Tests for trimming long results in pgsql.
"""
class Test(BaseTest):
def test_default_settings(self):
"""
Should store the entire rows but only
10 rows with default settings.
"""
self.render_config_template(
pgsql_ports=[5432... | mit |
maheshp/novatest | nova/tests/fakeguestfs.py | 9 | 4276 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2012 Red Hat, 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
... | apache-2.0 |
Zord13appdesa/python-for-android | python-modules/twisted/twisted/internet/test/test_endpoints.py | 49 | 41233 | # Copyright (c) 2007-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test the C{I...Endpoint} implementations that wrap the L{IReactorTCP},
L{IReactorSSL}, and L{IReactorUNIX} interfaces found in
L{twisted.internet.endpoints}.
"""
from errno import EPERM
from zope.interface import implements
from twi... | apache-2.0 |
yufengg/tensorflow | tensorflow/contrib/learn/python/learn/datasets/mnist.py | 27 | 9489 | # 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 |
drewsonne/aws-autodiscovery-templater | awsautodiscoverytemplater/__init__.py | 1 | 2339 | import argparse
from awsauthhelper import AWSArgumentParser
from awsautodiscoverytemplater.command import TemplateCommand
__author__ = 'drews'
def parse_cli_args_into():
"""
Creates the cli argparser for application specifics and AWS credentials.
:return: A dict of values from the cli arguments
:rtyp... | gpl-2.0 |
avanov/django | django/core/checks/model_checks.py | 525 | 2390 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import types
from django.apps import apps
from django.core.checks import Error, Tags, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
errors = []
for model in apps.get_models():
if app_co... | bsd-3-clause |
AlphaStaxLLC/elastalert | tests/config_test.py | 5 | 6673 | # -*- coding: utf-8 -*-
import copy
import datetime
import mock
import pytest
import elastalert.alerts
import elastalert.ruletypes
from elastalert.config import get_file_paths
from elastalert.config import load_configuration
from elastalert.config import load_options
from elastalert.config import load_rules
from elas... | apache-2.0 |
SamiHiltunen/invenio-unapi | requirements.py | 148 | 5904 | #!/usr/bin/env python2
#
# -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2015 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (... | gpl-2.0 |
3L3N4/theHarvester | discovery/linkedinsearch.py | 22 | 1197 | import string
import requests
import sys
import myparser
import re
class search_linkedin:
def __init__(self, word, limit):
self.word = word.replace(' ', '%20')
self.results = ""
self.totalresults = ""
self.server = "www.google.com"
self.userAgent = "(Mozilla/5.0 (Windows; ... | gpl-2.0 |
google-research/google-research | ncsnv3/models/ddpm.py | 1 | 4027 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# 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 applicab... | apache-2.0 |
Lujeni/ansible | lib/ansible/modules/network/netvisor/pn_snmp_trap_sink.py | 35 | 6215 | #!/usr/bin/python
# Copyright: (c) 2018, Pluribus Networks
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['... | gpl-3.0 |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/python/summary/event_multiplexer.py | 4 | 12562 | # 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... | mit |
box/box-python-sdk | boxsdk/object/group.py | 1 | 3892 | # coding: utf-8
from __future__ import unicode_literals, absolute_import
import json
from boxsdk.util.text_enum import TextEnum
from .base_object import BaseObject
from ..pagination.limit_offset_based_object_collection import LimitOffsetBasedObjectCollection
from ..util.api_call_decorator import api_call
from ..util.... | apache-2.0 |
wkentaro/chainer | chainer/links/connection/inception.py | 5 | 3601 | from chainer.functions.activation import relu
from chainer.functions.array import concat
from chainer.functions.pooling import max_pooling_nd
from chainer import link
from chainer.links.connection import convolution_2d
class Inception(link.Chain):
"""Inception module of GoogLeNet.
It applies four different ... | mit |
passy/rdreiflask | rdrei/application.py | 1 | 1163 | # -*- coding: utf-8 -*-
"""
application
~~~~~~~~~~~
Main entry point for for rdrei.net.
:copyright: 2010, Pascal Hartig <phartig@rdrei.net>
:license: GPL v3, see doc/LICENSE for more details.
"""
from flask import Flask, g, session
from rdrei import settings, __version__
app = Flask('rdrei')
app.config.from_object(... | gpl-3.0 |
mayankcu/Django-social | venv/Lib/site-packages/psycopg2/tests/test_psycopg2_dbapi20.py | 71 | 1932 | #!/usr/bin/env python
# test_psycopg2_dbapi20.py - DB API conformance test for psycopg2
#
# Copyright (C) 2006-2011 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 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 Softwa... | bsd-3-clause |
chhao91/pysal | pysal/esda/tests/test_mixture_smoothing.py | 20 | 1717 | import unittest
import numpy as np
import pysal
from pysal.esda import mixture_smoothing as m_s
class MS_Tester(unittest.TestCase):
"""Mixture_Smoothing Unit Tests"""
def setUp(self):
self.e = np.array([10, 5, 12, 20])
self.b = np.array([100, 150, 80, 200])
def test_NP_Mixture_Smoother(se... | bsd-3-clause |
ghm1/ardupilotIRLock | Tools/LogAnalyzer/tests/TestVibration.py | 261 | 3069 | from LogAnalyzer import Test,TestResult
import DataflashLog
import numpy
class TestVibration(Test):
'''test for accelerometer vibration (accX/accY/accZ) within recommendations'''
def __init__(self):
Test.__init__(self)
self.name = "Vibration"
def run(self, logdata, verbose):
se... | gpl-3.0 |
sotdjin/glibglab | migrations/env.py | 557 | 2883 | from __future__ import with_statement
from alembic import context
from sqlalchemy import engine_from_config, pool
from logging.config import fileConfig
import logging
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config ... | mit |
CEG-FYP-OpenStack/scheduler | nova/api/openstack/compute/server_password.py | 33 | 2526 | # Copyright (c) 2012 Nebula, 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 |
AutorestCI/azure-sdk-for-python | azure-mgmt-datafactory/azure/mgmt/datafactory/models/azure_ml_update_resource_activity.py | 2 | 3894 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
noroutine/ansible | lib/ansible/modules/cloud/webfaction/webfaction_db.py | 15 | 5896 | #!/usr/bin/python
#
# (c) Quentin Stafford-Fraser 2015, with contributions gratefully acknowledged from:
# * Andy Baker
# * Federico Tarantini
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#
# Create a webfaction database using Ansible and the Webfaction API
fro... | gpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/contrib/auth/admin.py | 56 | 8750 | from django.conf import settings
from django.conf.urls import url
from django.contrib import admin, messages
from django.contrib.admin.options import IS_POPUP_VAR
from django.contrib.admin.utils import unquote
from django.contrib.auth import update_session_auth_hash
from django.contrib.auth.forms import (
AdminPass... | bsd-3-clause |
safwanrahman/kitsune | kitsune/wiki/migrations/0002_auto_20150430_1304.py | 20 | 6062 | # -*- coding: utf-8 -*-
"""
Update list of locale choices in the `document.locale` and `locale.locale` fields.
"""
from __future__ import unicode_literals
from django.db import models, migrations
import kitsune.sumo.models
class Migration(migrations.Migration):
dependencies = [
('wiki', '0001_initial')... | bsd-3-clause |
ksachs/invenio | modules/bibformat/lib/bibformat_xslt_engine.py | 18 | 23460 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## Licens... | gpl-2.0 |
Menooker/gem5_pcm | src/python/m5/ticks.py | 57 | 3499 | # Copyright (c) 2007 The Regents of The University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list ... | bsd-3-clause |
aam-at/tensorflow | tensorflow/python/ops/linalg/sparse/conjugate_gradient.py | 14 | 5781 | # Copyright 2019 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 |
damdam-s/sale-workflow | __unported__/pricelist_share_companies/company.py | 37 | 1994 | # -*- coding: utf-8 -*-
#
#
# Author: Guewen Baconnier
# Copyright 2011 Camptocamp SA
#
# This program 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... | agpl-3.0 |
optima-ict/odoo | addons/website_blog/controllers/main.py | 15 | 16675 | # -*- coding: utf-8 -*-
import datetime
import json
import werkzeug
from openerp import tools
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug, unslug
from openerp.exceptions import UserError
from openerp.osv.orm import browse_recor... | agpl-3.0 |
glneo/gnuradio-davisaf | gr-vocoder/examples/gsm_audio_loopback.py | 10 | 1443 | #!/usr/bin/env python
#
# Copyright 2005,2007,2011 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 |
hellhovnd/django | tests/template_tests/unicode.py | 110 | 1369 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template import Template, TemplateEncodingError, Context
from django.utils.safestring import SafeData
from django.utils import six
from django.utils.unittest import TestCase
class UnicodeTests(TestCase):
def test_template(self):
... | bsd-3-clause |
FRBs/FRB | frb/surveys/surveycoord.py | 2 | 3455 | """ Parent class for surveying at a given coordinate"""
from abc import ABCMeta
import os
from frb.surveys import images
from frb.surveys import survey_io
class SurveyCoord(object):
"""
Parent class of surveying around an input coordinate
See the children for specific methods
Args:
coord (... | bsd-3-clause |
noironetworks/nova | nova/api/openstack/extensions.py | 14 | 17420 | # Copyright 2011 OpenStack Foundation
# Copyright 2011 Justin Santa Barbara
# 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/l... | apache-2.0 |
ufcg-lsd/python-hpOneView | examples/scripts/get-san-providers.py | 1 | 3990 | #!/usr/bin/env python
###
# (C) Copyright (2012-2015) Hewlett Packard Enterprise Development LP
#
# 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 limita... | mit |
ajnirp/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/constants.py | 963 | 87346 | from __future__ import absolute_import, division, unicode_literals
import string
import gettext
_ = gettext.gettext
EOF = None
E = {
"null-character":
_("Null character in input stream, replaced with U+FFFD."),
"invalid-codepoint":
_("Invalid codepoint in stream."),
"incorrectly-placed-so... | mpl-2.0 |
hjoliver/cylc | cylc/flow/prerequisite.py | 1 | 11201 | # THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
#
# 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 Licen... | gpl-3.0 |
edulramirez/nova | nova/tests/unit/api/openstack/compute/test_block_device_mapping_v1.py | 18 | 15815 | # Copyright (c) 2014 IBM Corp.
# 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... | apache-2.0 |
uqlibrary/fez | public/js/fckeditor/editor/filemanager/connectors/py/fckcommands.py | 131 | 6537 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 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-2.0 |
maqqr/psycho-bongo-fight | load_lib.py | 1 | 1434 | # Downloads proprietary bass2.4 audio library
import os
os.mkdir("lib_dl_temporary")
import platform
from urllib2 import urlopen, URLError, HTTPError
import zipfile
def dlfile(url):
# Open the url
try:
f = urlopen(url)
print "downloading " + url
# Open our local file for writing
... | mit |
catroot/rethinkdb | scripts/generate_join_macros.py | 46 | 4836 | #!/usr/bin/env python
# Copyright 2010-2013 RethinkDB, all rights reserved.
"""This script is used to generate the RDB_MAKE_SEMILATTICE_JOINABLE_*() macro
definitions.
This script is meant to be run as follows (assuming you are in the
"rethinkdb/src" directory):
$ ../scripts/generate_join_macros.py > rpc/semilattice... | agpl-3.0 |
b29308188/cs512project | network-embedding/tense-benchmarks/base-line/transD.py | 1 | 9322 | #coding:utf-8
import numpy as np
import tensorflow as tf
import os
import time
import datetime
import ctypes
from utils import *
from config import *
modelName = 'transD-general'
ll = ctypes.cdll.LoadLibrary
lib = ll("./init.so")
deg = 2
class TransDModel(object):
def calc(self, e, t, r):
return e ... | mit |
vladnicoara/SDLive-Blog | plugins/frontline-inlet/setup.py | 2 | 1184 | '''
Created on April 24, 2013
@package: frontline inlet
@copyright: 2013 Sourcefabric o.p.s.
@license: http://www.gnu.org/licenses/gpl-3.0.txt
@author: Martin Saturka
'''
# --------------------------------------------------------------------
from setuptools import setup, find_packages
# ----------------------------... | agpl-3.0 |
sberbank-ai/holdem-challenge | PyPokerEngine/tests/pypokerengine/engine/sidepot_test.py | 2 | 3817 | from tests.base_unittest import BaseUnitTest
from pypokerengine.engine.player import Player
from pypokerengine.engine.pay_info import PayInfo
from pypokerengine.engine.game_evaluator import GameEvaluator
class SidepotTest(BaseUnitTest):
""" A: $50, B: $20(ALLIN), C: $30(ALLIN) """
def test_case1(self):
playe... | mit |
maas/maas | src/maascli/__init__.py | 1 | 1649 | # Copyright 2012-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""The MAAS command-line interface."""
import os
import sys
from maascli.parser import get_deepest_subparser, prepare_parser
def snap_setup():
if "SNAP" in os.environ... | agpl-3.0 |
glennlive/gnuradio-wg-grc | gr-blocks/python/blocks/qa_boolean_operators.py | 57 | 7304 | #!/usr/bin/env python
#
# Copyright 2004,2007,2008,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or... | gpl-3.0 |
Comunitea/OCB | addons/base_geolocalize/models/res_partner.py | 239 | 3743 | # -*- 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 |
sharoonthomas/nereid | nereid/config.py | 10 | 1089 | # This file is part of Tryton & Nereid. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
import imp
from flask.config import ConfigAttribute, Config as ConfigBase # noqa
class Config(ConfigBase):
"Configuration without the root_path"
def __init... | gpl-3.0 |
sebalix/OpenUpgrade | addons/account_budget/account_budget.py | 77 | 9219 | # -*- 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 |
abdesslem/balbuzard | plugins/trans_sample_plugin.py | 1 | 7589 | # This is a sample transform plugin script for bbcrack
# All transform plugin scripts need to be named trans*.py, in the plugins folder
# Each plugin script should add Transform objects.
# First define a new Transform class, inheriting either from Transform_char or
# Transform_string:
# - Transform_char: for... | gpl-2.0 |
huntxu/fuel-web | nailgun/nailgun/test/unit/test_cluster_validator.py | 3 | 8355 | # -*- coding: utf-8 -*-
# Copyright 2013 Mirantis, 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 requir... | apache-2.0 |
FedoraScientific/salome-paravis | test/VisuPrs/Plot3D/F5.py | 1 | 1491 | # Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# 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 version.
#
# This library ... | lgpl-2.1 |
hellodata/hellodate | 2/site-packages/django/contrib/gis/tests/geogapp/tests.py | 76 | 4342 | """
Tests for geography support in PostGIS 1.5+
"""
from __future__ import unicode_literals
import os
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.geos import HAS_GEOS
from django.contrib.gis.measure import D
from django.contrib.gis.tests.utils import postgis
fr... | lgpl-3.0 |
yyt030/pyzmq | examples/device/client.py | 11 | 1140 | """A client for the device based server."""
#
# Copyright (c) 2010 Brian E. Granger and Eugene Chernyshov
#
# This file is part of pyzmq.
#
# pyzmq is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Fo... | bsd-3-clause |
LTD-Beget/percona-server | mysql-test/suite/tokudb/t/fast_upsert_int.py | 73 | 1972 | #!/usr/bin/env python
import sys
def main():
print "# generated by tokudb_upsert_int.py"
print "source include/have_tokudb.inc;"
print "source include/have_innodb.inc;"
print "set default_storage_engine='tokudb';"
print "disable_warnings;"
print "drop table if exists tt, ti;"
print "enable... | gpl-2.0 |
repotvsupertuga/repo | plugin.video.jami/resources/lib/libraries/f4mproxy/utils/python_rc4.py | 207 | 1073 | # Author: Trevor Perrin
# See the LICENSE file for legal information regarding use of this file.
"""Pure-Python RC4 implementation."""
from .rc4 import RC4
from .cryptomath import *
def new(key):
return Python_RC4(key)
class Python_RC4(RC4):
def __init__(self, keyBytes):
RC4.__init__(self, keyBytes,... | gpl-2.0 |
frewsxcv/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Platform/sunos.py | 19 | 1927 | """engine.SCons.Platform.sunos
Platform-specific initialization for Sun systems.
There normally shouldn't be any need to import this module directly. It
will usually be imported through the generic SCons.Platform.Platform()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009... | apache-2.0 |
tobias47n9e/social-core | social_core/backends/coinbase.py | 4 | 1265 | """
Coinbase OAuth2 backend, docs at:
https://python-social-auth.readthedocs.io/en/latest/backends/coinbase.html
"""
from .oauth import BaseOAuth2
class CoinbaseOAuth2(BaseOAuth2):
name = 'coinbase'
SCOPE_SEPARATOR = '+'
DEFAULT_SCOPE = ['user', 'balance']
AUTHORIZATION_URL = 'https://coinbase.com... | bsd-3-clause |
gigglesninja/senior-design | MissionPlanner/Lib/encodings/cp875.py | 593 | 13110 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input... | gpl-2.0 |
supergentle/migueltutorial | flask/lib/python2.7/site-packages/whoosh/lang/snowball/bases.py | 96 | 4874 | # Base classes
class _ScandinavianStemmer(object):
"""
This subclass encapsulates a method for defining the string region R1.
It is used by the Danish, Norwegian, and Swedish stemmer.
"""
def _r1_scandinavian(self, word, vowels):
"""
Return the region R1 that is used by the Scan... | bsd-3-clause |
mhnatiuk/phd_sociology_of_religion | scrapper/build/cryptography/tests/hazmat/primitives/fixtures_rsa.py | 9 | 25044 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography.hazmat.primitives.asymmetric.rsa import (
RSAPrivat... | gpl-2.0 |
grani/grpc | src/python/grpcio_tests/tests/unit/_channel_connectivity_test.py | 23 | 7057 | # Copyright 2015, 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 |
mbkumar/pymatgen | pymatgen/io/babel.py | 2 | 13465 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
OpenBabel interface module, which opens up access to the hundreds of file
formats supported by OpenBabel. Requires openbabel with python bindings to be
installed. Please consult the
`openbabel documentation... | mit |
rghe/ansible | lib/ansible/playbook/taggable.py | 39 | 3259 | # (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 |
olasitarska/django | tests/utils_tests/test_html.py | 23 | 8306 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from datetime import datetime
import os
from unittest import TestCase
import warnings
from django.utils import html, safestring
from django.utils._os import upath
from django.utils.encoding import force_text
class TestUtilsHtml(TestCase):
def chec... | bsd-3-clause |
tsdgeos/snapcraft | snapcraft/tests/test_deltas.py | 5 | 5951 | # -*- mode:python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
FodT/t1-python | tests/test_t1types.py | 3 | 1876 | import unittest
from terminalone import t1types
class TestT1Types(unittest.TestCase):
def test_strpt(self):
date_one = '2016-11-07T09:07:57'
date_two = '2016-11-07T09:07:57+1000'
date_three = '2016-11-07T09:07:57+01:00'
dt_one = t1types.strpt(date_one)
dt_two = t1types.str... | apache-2.0 |
dhenrygithub/QGIS | tests/src/python/test_qgsdelimitedtextprovider.py | 2 | 30384 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsDelimitedTextProvider.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later versi... | gpl-2.0 |
yiqingj/airflow | airflow/contrib/auth/backends/kerberos_auth.py | 7 | 4505 | # -*- coding: utf-8 -*-
#
# 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
... | apache-2.0 |
pigeonflight/strider-plone | docker/appengine/lib/django-1.4/django/core/servers/basehttp.py | 76 | 8894 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
import o... | mit |
emillion/zimsoap | tests/test_zimbra_admin.py | 3 | 28111 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
""" Integration tests against zimbraAdmin SOAP webservice
It has to be tested against a zimbra server (see README.md)
"""
import unittest
import random
from zimsoap.client import (
DomainHasNoPreAuthKey, ZimbraAccountClient, Zi... | apache-2.0 |
zcmarkyoung/node-gyp | gyp/pylib/gyp/MSVSUserFile.py | 2710 | 5094 | # 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 user preferences file writer."""
import os
import re
import socket # for gethostname
import gyp.common
import gyp.easy_xml as easy_xml
#------... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.