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 |
|---|---|---|---|---|---|
KECB/learn | computer_vision/12_rmv_salt_pepper_median_blur.py | 1 | 1464 | import numpy as np
import cv2
import matplotlib.pyplot as plt
# load in image and add Salt and pepper noise
moon = cv2.imread('images/moon.png', 0)
######################################################## ADD SALT & PEPPER NOISE
# salt and peppering manually (randomly assign coords as either white or black)
rows, col... | mit |
latrop/sdss_downloader | sdss_downloader.py | 1 | 22627 | #! /usr/bin/env python
#
# Author: Sergey Savchenko (savchenko.s.s@gmail.com)
#
from threading import Thread
import subprocess
from math import hypot, log10, sqrt
from time import time, sleep
import urllib.request
import urllib
import sys
import os
import glob
import shutil
import argparse
import bz2
import numpy a... | gpl-3.0 |
ohio813/python-registry | samples/regview.py | 5 | 14041 | #!/usr/bin/python
# This file is part of python-registry.
#
# Copyright 2011 Will Ballenthin <william.ballenthin@mandiant.com>
# while at Mandiant <http://www.mandiant.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance w... | apache-2.0 |
egraba/vbox_openbsd | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/webui/wuibase.py | 2 | 40904 | # -*- coding: utf-8 -*-
# $Id: wuibase.py $
"""
Test Manager Web-UI - Base Classes.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or m... | mit |
sevein/archivematica | src/dashboard/src/components/rights/views.py | 1 | 27795 | # This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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 ... | agpl-3.0 |
brianmckenna/sci-wms | wms/migrations/0003_auto_20150302_1510.py | 2 | 2289 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.conf import settings
from django.db import migrations
def forwards(apps, schema_editor):
resource_path = os.path.join(settings.PROJECT_ROOT, '..', 'wms', 'resources')
Dataset = apps.get_model("wms", "Dataset")
d1 = Dat... | gpl-3.0 |
taedla01/MissionPlanner | Lib/xdrlib.py | 55 | 5794 | """Implements (a subset of) Sun XDR -- eXternal Data Representation.
See: RFC 1014
"""
import struct
try:
from cStringIO import StringIO as _StringIO
except ImportError:
from StringIO import StringIO as _StringIO
__all__ = ["Error", "Packer", "Unpacker", "ConversionError"]
# exceptions
class... | gpl-3.0 |
amunk/metagoofil | hachoir_parser/audio/itunesdb.py | 72 | 20511 | """
iPod iTunesDB parser.
Documentation:
- http://ipodlinux.org/ITunesDB
Author: Romain HERAULT
Creation date: 19 august 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
UInt8, UInt16, UInt32, Int32, UInt64, TimestampMac32,
String, Float32, NullBytes, Enum, RawBytes)
from ... | gpl-2.0 |
hydroffice/hyo_ssp | hydroffice/ssp/drivers/saiv.py | 1 | 6625 | from __future__ import absolute_import, division, print_function, unicode_literals
import datetime as dt
import numpy as np
import logging
log = logging.getLogger(__name__)
from .base_format import BaseFormat, FormatError
from .. import __version__
from ..ssp_dicts import Dicts
class Saiv(BaseFormat):
def __i... | lgpl-3.0 |
khughitt/ete | ete_dev/evol/control.py | 2 | 10378 | #!/usr/bin/python
"""
Parameters for running codeml
"""
__author__ = "Francois-Jose Serra"
__email__ = "francois@barrabin.org"
__licence__ = "GPLv3"
__version__ = "0.0"
PARAMS = {
'seqfile' : 'algn',
'treefile' : 'tree',
'outfile' : 'out',
'noisy' : 0,
'verbose' : 2,
... | gpl-3.0 |
viralpandey/kivy | kivy/core/clipboard/clipboard_nspaste.py | 59 | 1218 | '''
Clipboard OsX: implementation of clipboard using Appkit
'''
__all__ = ('ClipboardNSPaste', )
from kivy.core.clipboard import ClipboardBase
from kivy.utils import platform
if platform != 'macosx':
raise SystemError('Unsupported platform for appkit clipboard.')
try:
from pyobjus import autoclass
from p... | mit |
Chemcy/vnpy | vn.tutorial/tick2trade/vn.trader_t2t/riskManager/uiRmWidget.py | 17 | 5075 | # encoding: UTF-8
'''
风控模块相关的GUI控制组件
'''
from uiBasicWidget import QtGui, QtCore
from eventEngine import *
########################################################################
class RmSpinBox(QtGui.QSpinBox):
"""调整参数用的数值框"""
#----------------------------------------------------------------------
d... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/OpenGL/GL/APPLE/transform_hint.py | 9 | 1674 | '''OpenGL extension APPLE.transform_hint
This module customises the behaviour of the
OpenGL.raw.GL.APPLE.transform_hint to provide a more
Python-friendly API
Overview (from the spec)
The transform_hint extension provides a new target,
TRANSFORM_HINT_APPLE, for the Hint procedure. When the
transform hint is se... | gpl-3.0 |
luistorresm/odoo | addons/l10n_co/wizard/__init__.py | 313 | 1165 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) David Arnold (devCO).
# Author David Arnold (devCO), dar@devco.co
# Co-Authors Juan Pablo Aries (devCO), jpa@devco.co
# Hector Iva... | agpl-3.0 |
google/vogon | third_party/bottle/test/test_config.py | 16 | 1357 | import unittest
from bottle import ConfigDict
class TestConfDict(unittest.TestCase):
def test_write(self):
c = ConfigDict()
c['key'] = 'value'
self.assertEqual(c['key'], 'value')
self.assertTrue('key' in c)
c['key'] = 'value2'
self.assertEqual(c['key'], 'value2')
... | apache-2.0 |
hlzz/dotfiles | graphics/VTK-7.0.0/ThirdParty/Twisted/twisted/application/strports.py | 2 | 3242 | # -*- test-case-name: twisted.test.test_strports -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Construct listening port services from a simple string description.
@see: L{twisted.internet.endpoints.serverFromString}
@see: L{twisted.internet.endpoints.clientFromString}
"""
... | bsd-3-clause |
linjoahow/w17g | static/Brython3.1.3-20150514-095342/Lib/posix.py | 603 | 20904 | """This module provides access to operating system functionality that is
standardized by the C Standard and the POSIX standard (a thinly
disguised Unix interface). Refer to the library manual and
corresponding Unix manual entries for more information on calls."""
import datetime
from browser import window
def _rand... | gpl-3.0 |
blitzmann/Pyfa | gui/builtinMarketBrowser/itemView.py | 1 | 10783 | import wx
from logbook import Logger
from eos.saveddata.module import Module
import gui.builtinMarketBrowser.pfSearchBox as SBox
from gui.builtinMarketBrowser.events import ItemSelected, MAX_RECENTLY_USED_MODULES, RECENTLY_USED_MODULES
from gui.contextMenu import ContextMenu
from gui.display import Display
from gui.ut... | gpl-3.0 |
Shanec132006/Lab4 | lib/jinja2/ext.py | 603 | 25078 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2 import nod... | apache-2.0 |
maelnor/cinder | cinder/tests/fake_flags.py | 1 | 1947 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | apache-2.0 |
drexly/tonginBlobStore | lib/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 |
ultrabug/py3status | py3status/modules/clock.py | 1 | 11062 | """
Display date and time.
This module allows one or more datetimes to be displayed.
All datetimes share the same format_time but can set their own timezones.
Timezones are defined in the `format` using the TZ name in squiggly brackets eg
`{GMT}`, `{Portugal}`, `{Europe/Paris}`, `{America/Argentina/Buenos_Aires}`.
IS... | bsd-3-clause |
espenhgn/nest-simulator | pynest/examples/Potjans_2014/stimulus_params.py | 19 | 2283 | # -*- coding: utf-8 -*-
#
# stimulus_params.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License... | gpl-2.0 |
PulsePod/old-www-do-not-use | lib/python2.7/site-packages/werkzeug/utils.py | 317 | 22676 | # -*- coding: utf-8 -*-
"""
werkzeug.utils
~~~~~~~~~~~~~~
This module implements various utilities for WSGI applications. Most of
them are used by the request and response wrappers but especially for
middleware development it makes sense to use them without the wrappers.
:copyright: (c) 2013 ... | mit |
repotvsupertuga/repo | plugin.video.jami/resources/lib/resolvers/videomega.py | 7 | 2305 | # -*- coding: utf-8 -*-
'''
Specto Add-on
Copyright (C) 2015 lambda
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 l... | gpl-2.0 |
andybarry/ardupilot | Tools/autotest/arduplane.py | 2 | 10433 | # fly ArduPlane in SIL
import util, pexpect, sys, time, math, shutil, os
from common import *
import mavutil, random
# get location of scripts
testdir=os.path.dirname(os.path.realpath(__file__))
HOME_LOCATION='-35.362938,149.165085,585,354'
WIND="0,180,0.2" # speed,direction,variance
homeloc = None
def takeoff(ma... | gpl-3.0 |
lazy404/libstoragemgmt | plugin/ontap/na.py | 2 | 28471 | # Copyright (C) 2012-2014 Red Hat, Inc.
# 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 any later version.
#
# This library is distributed in the h... | lgpl-2.1 |
miconof/headphones | lib/yaml/composer.py | 534 | 4921 |
__all__ = ['Composer', 'ComposerError']
from error import MarkedYAMLError
from events import *
from nodes import *
class ComposerError(MarkedYAMLError):
pass
class Composer(object):
def __init__(self):
self.anchors = {}
def check_node(self):
# Drop the STREAM-START event.
if se... | gpl-3.0 |
ISTweak/android_kernel_toshiba_is11t | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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.
#
# This program i... | gpl-2.0 |
curtisstpierre/django | tests/utils_tests/test_baseconv.py | 326 | 1787 | from unittest import TestCase
from django.utils.baseconv import (
BaseConverter, base2, base16, base36, base56, base62, base64,
)
from django.utils.six.moves import range
class TestBaseConv(TestCase):
def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + list(range(-100, 100))
for converte... | bsd-3-clause |
40223137/w17w17 | static/Brython3.1.0-20150301-090019/Lib/site-packages/pygame/surface.py | 603 | 3844 | from browser import document, html, window
from javascript import console, JSConstructor
from .rect import Rect
#import pygame.rect
canvas_ID=1
_canvas_id=None
class Surface:
def __init__(self, dim=[], depth=16, surf=None):
if surf is None:
self._depth=depth
self._canvas=html.CANVAS(width=... | gpl-3.0 |
Kilhog/odoo | openerp/addons/base/ir/ir_values.py | 228 | 26238 | # -*- 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 GNU... | agpl-3.0 |
pombredanne/xpython | proverb/proverb_test.py | 10 | 2531 | import unittest
from proverb import proverb
class ProverbTest(unittest.TestCase):
def test_a_single_consequence(self):
expected = 'For want of a nail the shoe was lost.\n'\
'And all for the want of a nail.'
self.assertEqual(expected, proverb(['nail', 'shoe']))
def test_sho... | mit |
grahamhayes/pdns | regression-tests.dnsdist/cookiesoption.py | 2 | 1938 | #!/usr/bin/env python2
import dns
import dns.edns
import dns.flags
import dns.message
import dns.query
class CookiesOption(dns.edns.Option):
"""Implementation of draft-ietf-dnsop-cookies-09.
"""
def __init__(self, client, server):
super(CookiesOption, self).__init__(10)
if len(client) !=... | gpl-2.0 |
Superjom/cHasky | python/chasky/node_def_builder.py | 1 | 2057 | import sys
#from graph_def_builder import GraphDefBuilder
from core.framework.attr_value_pb2 import AttrValue
from core.framework.graph_pb2 import NodeDef
from attr_value_builder import AttrValueBuilder
class NodeDefBuilder(object):
def __init__(self, node=None):
self.node_def_ = node if node else NodeDef(... | apache-2.0 |
mop/LTPTextDetector | scripts/pw_analyze/svmdelme.py | 1 | 5600 | import numpy as np
from sklearn.cross_validation import cross_val_score, ShuffleSplit
from sklearn.svm import LinearSVC, SVC
from sklearn.grid_search import GridSearchCV
from sklearn.metrics import precision_recall_fscore_support
import matplotlib.pyplot as plt
data = np.genfromtxt('dists_cleaned.csv', delimiter=','... | gpl-3.0 |
madphysicist/numpy | numpy/linalg/tests/test_linalg.py | 2 | 74348 | """ Test functions for linalg module
"""
import os
import sys
import itertools
import traceback
import textwrap
import subprocess
import pytest
import numpy as np
from numpy import array, single, double, csingle, cdouble, dot, identity, matmul
from numpy import multiply, atleast_2d, inf, asarray
from numpy import lin... | bsd-3-clause |
mrchristine/spark-examples-dbc | src/main/python/pagerank.py | 5 | 3067 | #
# 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 |
Ruide/angr-dev | angr/angr/state_plugins/unicorn_engine.py | 1 | 53139 | import os
import sys
import copy
import struct
import ctypes
import threading
import itertools
import pkg_resources
import logging
from ..sim_options import UNICORN_HANDLE_TRANSMIT_SYSCALL
l = logging.getLogger("angr.state_plugins.unicorn_engine")
try:
import unicorn
except ImportError:
l.warning("Unicorn i... | bsd-2-clause |
jaredly/pyjamas | library/pyjamas/ui/HTML.py | 3 | 1302 | # Copyright 2006 James Tauber and contributors
# Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net>
#
# 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/... | apache-2.0 |
jlcarmic/producthunt_simulator | venv/lib/python2.7/site-packages/scipy/optimize/_trustregion_dogleg.py | 135 | 4449 | """Dog-leg trust-region optimization."""
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem)
__all__ = []
def _minimize_dogleg(fun, x0, args=(), jac=None, hess=None,
*... | mit |
Datera/python-sdk | utils/show_os_volumes.py | 1 | 4523 | #!/usr/bin/env python
from __future__ import (print_function, unicode_literals, division,
absolute_import)
"""
This script will output the Datera AppInstances that are being managed
by an OpenStack Cinder (or Glance) instance.
It does this by retrieving all the AppInstances on the Datera back... | apache-2.0 |
donald-pinckney/EM-Simulator | EM Sim/EM Sim/py_lib/distutils/command/check.py | 75 | 5232 | """distutils.command.check
Implements the Distutils 'check' command.
"""
__revision__ = "$Id$"
from distutils.core import Command
from distutils.errors import DistutilsSetupError
try:
# docutils is installed
from docutils.utils import Reporter
from docutils.parsers.rst import Parser
from docutils imp... | apache-2.0 |
ubuntustudio-kernel/ubuntu-raring-lowlatency | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
SheffieldML/GPy | GPy/models/gp_coregionalized_regression.py | 1 | 1940 | # Copyright (c) 2012 - 2014 the GPy Austhors (see AUTHORS.txt)
# Licensed under the BSD 3-clause license (see LICENSE.txt)
import numpy as np
from ..core import GP
from .. import likelihoods
from .. import kern
from .. import util
class GPCoregionalizedRegression(GP):
"""
Gaussian Process model for heterosced... | bsd-3-clause |
fayf/pyload | module/gui/CoreConfigParser.py | 41 | 5711 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from os.path import exists
from os.path import join
CONF_VERSION = 1
########################################################################
class ConfigParser:
#----------------------------------------------------------------------
def __init_... | gpl-3.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/grizzled/grizzled/test/misc/TestReadOnly.py | 19 | 1623 | #!/usr/bin/python2.4
# $Id: 5a432ced2c81b94f1e4793cbec98258787f6bc92 $
"""
Tester.
"""
# ---------------------------------------------------------------------------
# Imports
# ---------------------------------------------------------------------------
import google3
from grizzled.misc import ReadOnly, ReadOnlyObjec... | bsd-3-clause |
mcflugen/topoflow | topoflow/components/HIS_base.py | 2 | 36501 |
## Copyright (c) 2010-2013, Scott D. Peckham
## July 2010 (created)
#-----------------------------------------------------------------------
# Notes: This file defines a "base class" for HIS Data components
# that retrieve HIS data from a web service using suds.
#-------------------------------------------... | mit |
mzdaniel/oh-mainline | vendor/packages/Django/django/contrib/localflavor/it/forms.py | 273 | 3027 | """
IT-specific Form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import smart_unicode
from django.contrib.localflavor.it.... | agpl-3.0 |
bac/horizon | openstack_dashboard/dashboards/admin/hypervisors/compute/tests.py | 27 | 11116 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | apache-2.0 |
mediafactory/tryton_core_daemon | trytond/backend/fields.py | 1 | 4187 | #This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import datetime
from decimal import Decimal
try:
import hashlib
except ImportError:
hashlib = None
import sha
class Field(object):
@staticmethod
def sql_fo... | gpl-3.0 |
microdee/IronHydra | src/IronHydra/Lib/stat.py | 179 | 1718 | """Constants/functions for interpreting results of os.stat() and os.lstat().
Suggested usage: from stat import *
"""
# Indices for stat struct members in the tuple returned by os.stat()
ST_MODE = 0
ST_INO = 1
ST_DEV = 2
ST_NLINK = 3
ST_UID = 4
ST_GID = 5
ST_SIZE = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9
... | mit |
Mrs-X/Darknet | test/functional/rpc_budget.py | 4 | 5119 | #!/usr/bin/env python3
# Copyright (c) 2019 The PIVX developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC commands for budget proposal creation, submission, and verification."""
from test_framework.test_framework... | mit |
SoftwareMaven/django | django/contrib/sessions/backends/signed_cookies.py | 383 | 2895 | from django.conf import settings
from django.contrib.sessions.backends.base import SessionBase
from django.core import signing
class SessionStore(SessionBase):
def load(self):
"""
We load the data from the key itself instead of fetching from
some external data store. Opposite of _get_sess... | bsd-3-clause |
couchbase/healthchecker | Cheetah/TemplateCmdLineIface.py | 15 | 3311 | # $Id: TemplateCmdLineIface.py,v 1.13 2006/01/10 20:34:35 tavis_rudd Exp $
"""Provides a command line interface to compiled Cheetah template modules.
Meta-Data
================================================================================
Author: Tavis Rudd <tavis@damnsimple.com>
Version: $Revision: 1.13 $
Start Da... | apache-2.0 |
pymedusa/SickRage | ext/boto/elastictranscoder/__init__.py | 22 | 1831 | # Copyright (c) 2013 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | gpl-3.0 |
yfdyh000/olympia | apps/bandwagon/cron.py | 11 | 5510 | from datetime import date, timedelta
import itertools
from django.db import connection, transaction
from django.db.models import Count
import commonware.log
from celery.task.sets import TaskSet
import amo
from amo.celery import task
from amo.utils import chunked, slugify
from bandwagon.models import (Collection, Syn... | bsd-3-clause |
wikimedia/operations-debs-python-diamond | src/collectors/haproxy/test/testhaproxy.py | 34 | 2055 | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from mock import Mock
from mock import patch
from diamond.collector import Collector
from haproxy import ... | mit |
kungfulon/pacman-search | submission_autograder.py | 6 | 9390 | # submission_autograder.py
# ------------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to ... | mit |
HailStorm32/Q.bo_stacks | qbo_webi/src/recorder/recorder.py | 1 | 4591 | #!/usr/bin/env python2.6
# coding: utf-8
#
# Software License Agreement (GPLv2 License)
#
# Copyright (c) 2012 TheCorpora SL
#
# 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 ... | lgpl-2.1 |
atacai/server-tools | users_ldap_mail/users_ldap_model.py | 51 | 2783 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Daniel Reis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Gen... | agpl-3.0 |
hi35xx/hi3518e-buildroot | linux/linux-3.0.y/tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | 1935 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... | gpl-2.0 |
Balannen/LSMASOMM | atom3/Formalisms/CD_classDiagramsV3/graph_CD_Inheritance3.py | 1 | 3661 | """
__graph_CD_Inheritance3.py___________________________________________________________
Automatically generated LINK for entity CD_Inheritance3
DO NOT MODIFY DIRECTLY
_____________________________________________________________________________________
"""
from graphLink import *
from stickylink import *
fr... | gpl-3.0 |
apocquet/django | tests/template_tests/test_unicode.py | 347 | 1431 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import TestCase
from django.template import Context, Engine
from django.template.base import TemplateEncodingError
from django.utils import six
from django.utils.safestring import SafeData
class UnicodeTests(TestCase):
def test_templa... | bsd-3-clause |
skevy/django | tests/regressiontests/forms/localflavor/generic.py | 89 | 4326 | import datetime
from django.contrib.localflavor.generic.forms import DateField, DateTimeField
from utils import LocalFlavorTestCase
class GenericLocalFlavorTests(LocalFlavorTestCase):
def test_GenericDateField(self):
error_invalid = [u'Enter a valid date.']
valid = {
datetime.date(20... | bsd-3-clause |
adedayo/intellij-community | python/helpers/pydev/pydev_runfiles.py | 52 | 30194 | from __future__ import nested_scopes
import fnmatch
import os.path
from pydev_runfiles_coverage import StartCoverageSupport
from pydevd_constants import * #@UnusedWildImport
import re
import time
#=======================================================================================================================
... | apache-2.0 |
leppa/home-assistant | homeassistant/components/ambient_station/binary_sensor.py | 5 | 2345 | """Support for Ambient Weather Station binary sensors."""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.const import ATTR_NAME
from . import (
SENSOR_TYPES,
TYPE_BATT1,
TYPE_BATT2,
TYPE_BATT3,
TYPE_BATT4,
TYPE_BATT5,
TYPE_BATT6,
... | apache-2.0 |
tsabi/Odoo-tsabi-fixes | addons/account/account_invoice.py | 12 | 78556 | # -*- 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 |
Ptival/PeaCoq | ucsd/analysis/plot.py | 1 | 9691 | #!/usr/bin/env python2
from __future__ import print_function
import csv, sys, os.path
from datetime import datetime
from boomslang import *
def usage():
print('Usage: plot.py data.csv')
class Entry:
def __init__(self, usr, ver, stm, ctm, cmd, pay):
self.username = usr
self.version = ver
... | mit |
richardcs/ansible | lib/ansible/utils/module_docs_fragments/manageiq.py | 59 | 1378 | # (c) 2017, Daniel Korn <korndaniel1@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard ManageIQ documentation fragment
DOCUMENTATION = """
options:
manageiq_connection:
required: true
description:
... | gpl-3.0 |
Julian/home-assistant | homeassistant/components/recorder.py | 1 | 15356 | """
homeassistant.components.recorder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Component that records all events and state changes. Allows other components
to query this database.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/recorder/
"""
from contextlib imp... | mit |
gseismic/vnpy | vn.lts/vnltstd/test/lts_data_type.py | 167 | 86932 | # encoding: UTF-8
defineDict = {}
typedefDict = {}
#//////////////////////////////////////////////////////////////////////
#@company shanghai liber information Technology Co.,Ltd
#@file SecurityFtdcUserApiDataType.h
#@brief 定义业务数据类型
#//////////////////////////////////////////////////////////////////////
#/////////... | mit |
elky/django | django/contrib/contenttypes/forms.py | 21 | 3557 | from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.forms import ModelForm, modelformset_factory
from django.forms.models import BaseModelFormSet
class BaseGenericInlineFormSet(BaseModelFormSet):
"""
A formset for generic inline objects to a parent.
"""
... | bsd-3-clause |
meraki-analytics/merakicommons | tests/test_cache.py | 2 | 2104 | import pytest
from merakicommons.cache import lazy_property, Cache
TEST_VALUE_1 = "TEST VALUE_1"
TEST_VALUE_2 = "TEST_VALUE_2"
VALUE_COUNT = 100
class LazyProperty(object):
def __init__(self, value) -> None:
self.property_calls = 0
self.value = value
@lazy_property
def property(self) ->... | mit |
JetBrains/intellij-community | platform/platform-resources/src/launcher.py | 10 | 4104 | #!/usr/bin/env $PYTHON$
# Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import os
import socket
import struct
import sys
import traceback
# See com.intellij.idea.SocketLock for the server side of this interface.
RUN_PATH = u... | apache-2.0 |
abhilashnta/edx-platform | openedx/core/djangoapps/credit/migrations/0001_initial.py | 85 | 8897 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'CreditCourse'
db.create_table('credit_creditcourse', (
... | agpl-3.0 |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/gtk/_gtk/ToolButton.py | 1 | 9124 | # encoding: utf-8
# module gtk._gtk
# from /usr/lib/python2.7/dist-packages/gtk-2.0/gtk/_gtk.so
# by generator 1.135
# no doc
# imports
import atk as __atk
import gio as __gio
import gobject as __gobject
import gobject._gobject as __gobject__gobject
from ToolItem import ToolItem
class ToolButton(ToolItem):
"""
... | gpl-2.0 |
jourdy345/pmtk3 | python/conf.py | 7 | 8205 | # -*- coding: utf-8 -*-
#
# pmtk3-python documentation build configuration file, created by
# sphinx-quickstart on Thu Feb 27 20:20:05 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.
... | mit |
sivaprakashniet/push_pull | p2p/lib/python2.7/site-packages/compressor/parser/default_htmlparser.py | 1 | 3213 | import sys
from django.utils import six
from django.utils.encoding import smart_text
from compressor.exceptions import ParserError
from compressor.parser import ParserBase
# Starting in Python 3.2, the HTMLParser constructor takes a 'strict'
# argument which default to True (which we don't want).
# In Python 3.3, i... | bsd-3-clause |
louietsai/python-for-android | python3-alpha/python3-src/Lib/sqlite3/test/factory.py | 46 | 7816 | #-*- coding: ISO-8859-1 -*-
# pysqlite2/test/factory.py: tests for the various factories in pysqlite
#
# Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liab... | apache-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sympy/tensor/tests/test_indexed.py | 8 | 5183 | from sympy.core import symbols, Integer, Symbol, Tuple, oo
from sympy.tensor.indexed import IndexException
from sympy.utilities.pytest import raises
# import test:
from sympy import IndexedBase, Idx, Indexed
def test_Idx_construction():
i, a, b = symbols('i a b', integer=True)
assert Idx(i) != Idx(i, 1)
a... | agpl-3.0 |
kubeup/archon | vendor/github.com/google/certificate-transparency/python/ct/cert_analysis/algorithm.py | 23 | 4326 | import calendar
import time
from ct.crypto import cert
from ct.crypto.asn1 import oid
from ct.cert_analysis.observation import Observation
class AlgorithmObservation(Observation):
def __init__(self, description, *args, **kwargs):
super(AlgorithmObservation, self).__init__(
"Signature algor... | apache-2.0 |
emptymalei/statisticalphysics | exts/convert.py | 7 | 1219 | from textwrap import fill
import re
s = open("appendix.tex").read()
def repl1(obj):
eq = obj.group(1)
eq = eq.replace("\n", " ")
eq = fill(eq, 100000)
return "\n.. math::\n\n %s\n" % eq
def repl6(obj):
eq = obj.group(1)
eq = eq.replace("\n", " ")
eq = fill(eq, 100000)
return "\n.. mat... | mit |
magopian/olympia | apps/compat/cron.py | 15 | 5678 | import logging
from collections import defaultdict
from django.db.models import Count, Max
import cronjobs
import amo
import amo.search
import amo.utils
from addons.models import Addon
from search.utils import floor_version
from stats.models import UpdateCount
from versions.compare import version_int as vint
from li... | bsd-3-clause |
ntucllab/libact | libact/query_strategies/tests/test_uncertainty_sampling.py | 1 | 3010 | import unittest
import numpy as np
from numpy.testing import assert_array_equal
from libact.base.dataset import Dataset
from libact.models import LogisticRegression, SVM, Perceptron
from libact.query_strategies import UncertaintySampling, QUIRE
from libact.labelers import IdealLabeler
def init_toyexample(X, y):
... | bsd-2-clause |
verifiedpixel/superdesk | server/macros/abstract_populator_test.py | 8 | 2029 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import unit... | agpl-3.0 |
codeofdusk/ProjectMagenta | src/url_shortener/__main__.py | 3 | 1263 | from functools import wraps
import shorteners
def service_selecter (func):
@wraps(func)
def wrapper (*args, **kwargs):
tmp = dict(kwargs)
if 'service' in tmp:
del(tmp['service'])
kwargs['service'] = find_service(kwargs['service'], **tmp) or default_service()
else:
kwargs['service'] = default_service(... | gpl-2.0 |
michaelBenin/django-oscar | tests/functional/customer/order_status_tests.py | 7 | 1230 | import httplib
from django.core.urlresolvers import reverse
from oscar.test.factories import create_order
from oscar.test.testcases import WebTestCase
class TestAnAnonymousUser(WebTestCase):
def test_gets_a_404_when_requesting_an_unknown_order(self):
path = reverse('customer:anon-order', kwargs={'order... | bsd-3-clause |
mchrzanowski/ProjectEuler | src/python/Problem031.py | 1 | 1985 | '''
Created on Jan 13, 2012
@author: mchrzanowski
'''
from time import time
import numpy as np
LIMIT = 300
COINS = (1, 2, 5, 10, 20, 50, 100, 200)
# O(LIMIT * |COINS|)
def dp():
M = np.zeros((LIMIT + 1, len(COINS) + 1), dtype=np.int)
# base cases.
for i in xrange(1, LIMIT + 1):
M[i, 1] = 1 # t... | mit |
shepdelacreme/ansible | lib/ansible/modules/cloud/rackspace/rax_scaling_group.py | 65 | 14430 | #!/usr/bin/python
# 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',
'status': ['preview'],
... | gpl-3.0 |
wow2006/ycmd | cpp/ycm/tests/gmock/gtest/test/gtest_throw_on_failure_test.py | 2917 | 5766 | #!/usr/bin/env python
#
# Copyright 2009, 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... | gpl-3.0 |
HealthCatalystSLC/healthcareai-py | healthcareai/tests/test_trainer_decorator.py | 3 | 1775 | import unittest
from healthcareai.supervised_model_trainer import SupervisedModelTrainer
import healthcareai.datasets as hcai_datasets
import sys
from io import StringIO
class TestTrainerDecorator(unittest.TestCase):
"""Tests for the training decorator.
We will compare a decorated linear regression and a un... | mit |
umitproject/tease-o-matic | django/contrib/comments/forms.py | 245 | 8730 | import time
import datetime
from django import forms
from django.forms.util import ErrorDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from models import Comment
from django.utils.crypto import salted_hmac, constant_time_compare
from django.utils.encoding import force_... | bsd-3-clause |
ikaee/bfr-attendant | facerecognitionlibrary/jni-build/jni/include/tensorflow/models/rnn/ptb/reader.py | 24 | 3992 | # 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 |
vorasagar7/sp17-i524 | project/S17-IR-P001/code/ansible/ansible-node/files/visualization/FinalScript.py | 4 | 15339 | #Import the necessary methods from tweepy library
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import json
import pandas as pd
from textblob import TextBlob
from time import strptime
import numpy as np
import re
import time
import zipcode
import sys, errno
from n... | apache-2.0 |
nemami/synbioinformatica | markdown/inlinepatterns.py | 107 | 12185 | """
INLINE PATTERNS
=============================================================================
Inline patterns such as *emphasis* are handled by means of auxiliary
objects, one per pattern. Pattern objects must be instances of classes
that extend markdown.Pattern. Each pattern object uses a single regular
express... | bsd-2-clause |
googlefonts/glyphsLib | tests/util_test.py | 1 | 1437 | #
# 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... | apache-2.0 |
ebukoz/thrive | erpnext/communication/doctype/call_log/call_log.py | 5 | 3216 | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
from erpnext.crm.doctype.utils import get_scheduled_employ... | gpl-3.0 |
mancoast/CPythonPyc_test | cpython/274_test_md5.py | 194 | 1790 | # Testing md5 module
import warnings
warnings.filterwarnings("ignore", "the md5 module is deprecated.*",
DeprecationWarning)
import unittest
from md5 import md5
from test import test_support
def hexstr(s):
import string
h = string.hexdigits
r = ''
for c in s:
i = ord(c)... | gpl-3.0 |
repotvsupertuga/repo | plugin.video.sportsmix/requests/packages/urllib3/poolmanager.py | 678 | 9406 | import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import LocationValue... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.