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 |
|---|---|---|---|---|---|
carljm/django | django/forms/forms.py | 15 | 20129 | """
Form classes
"""
from __future__ import unicode_literals
import copy
from collections import OrderedDict
from django.core.exceptions import NON_FIELD_ERRORS, ValidationError
# BoundField is imported for backwards compatibility in Django 1.9
from django.forms.boundfield import BoundField # NOQA
from django.forms... | bsd-3-clause |
dyoung418/tensorflow | tensorflow/contrib/nn/python/ops/scaled_softplus_test.py | 66 | 3039 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
StevenBlack/phantomjs | src/qt/qtwebkit/Tools/CygwinDownloader/cygwin-downloader.py | 120 | 5513 | #!/usr/bin/env python
import os, random, sys, time, urllib
#
# Options
#
dry_run = len(sys.argv) > 1 and "--dry-run" in set(sys.argv[1:])
quiet = len(sys.argv) > 1 and "--quiet" in set(sys.argv[1:])
#
# Functions and constants
#
def download_progress_hook(block_count, block_size, total_blocks):
if quiet or... | bsd-3-clause |
camny125/grit-i18n | grit/format/c_format_unittest.py | 61 | 1968 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittest for c_format.py.
"""
import os
import sys
if __name__ == '__main__':
sys.path.append(os.path.join(os.path.dirname(__... | bsd-2-clause |
vdt/SimpleCV | SimpleCV/Features/BOFFeatureExtractor.py | 11 | 12465 | from SimpleCV.base import *
from SimpleCV.ImageClass import Image
from SimpleCV.Features.FeatureExtractorBase import *
class BOFFeatureExtractor(object):
"""
For a discussion of bag of features please see:
http://en.wikipedia.org/wiki/Bag_of_words_model_in_computer_vision
Initialize the bag of feature... | bsd-3-clause |
mercycorps/tola-activity | htdocs/indicators/test.py | 1 | 2312 | from django.test import TestCase
from django.test import RequestFactory
from django.test import Client
from indicators.models import Indicator, IndicatorType, Objective, DisaggregationType, ReportingFrequency, CollectedData
from activitydb.models import Program, Sector
from django.contrib.auth.models import User
clas... | gpl-2.0 |
wolfram74/numerical_methods_iserles_notes | venv/lib/python2.7/site-packages/zmq/ssh/forward.py | 53 | 3549 | #
# This file is adapted from a paramiko demo, and thus licensed under LGPL 2.1.
# Original Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
# Edits Copyright (C) 2010 The IPython Team
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Publ... | mit |
abhishekkrthakur/scikit-learn | sklearn/metrics/cluster/supervised.py | 21 | 26876 | """Utilities to evaluate the clustering performance of models
Functions named as *_score return a scalar value to maximize: the higher the
better.
"""
# Authors: Olivier Grisel <olivier.grisel@ensta.org>
# Wei LI <kuantkid@gmail.com>
# Diego Molla <dmolla-aliod@gmail.com>
# License: BSD 3 clause
fr... | bsd-3-clause |
nitinitprof/odoo | addons/event/res_partner.py | 329 | 1228 | # -*- 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 |
alexlo03/ansible | lib/ansible/playbook/conditional.py | 8 | 10089 | # (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 |
hyller/CodeLibrary | python-cookbook-master/src/11/passing_a_socket_file_descriptor_between_processes/worker.py | 5 | 1128 | # worker.py
import socket
import struct
def recv_fd(sock):
'''
Receive a single file descriptor
'''
msg, ancdata, flags, addr = sock.recvmsg(1,
socket.CMSG_LEN(struct.calcsize('i')))
cmsg_level, cmsg_type, cmsg_data = ancdata[0]
assert cmsg_level ==... | unlicense |
fossdevil/Assignments | Machine Learning/Assignment3Final/ML4.py | 1 | 3746 | import numpy as np
import scipy
import matplotlib.pyplot as plt
import random
# N points in d dimensions
def generatePoints(n,d):
points = []
for i in range(0,n):
point = np.random.normal(0,1,d);
p = point**2;
den = np.sqrt(sum(p));
point = list(point/den);
points.append... | mit |
pravsripad/mne-python | mne/stats/_adjacency.py | 4 | 3657 | # -*- coding: utf-8 -*-
# Authors: Eric Larson <larson.eric.d@gmail.com>
#
# License: Simplified BSD
import numpy as np
from ..utils import _validate_type, _check_option
from ..utils.check import int_like
def combine_adjacency(*structure):
"""Create a sparse binary adjacency/neighbors matrix.
Parameters
... | bsd-3-clause |
santosfamilyfoundation/SantosGUI | application/utils/patch_multiprocess.py | 1 | 1225 |
import os
import sys
import multiprocess.forking as forking
def patch_multiprocess():
if sys.platform.startswith('win'):
# First define a modified version of Popen.
class _Popen(forking.Popen):
def __init__(self, *args, **kw):
if hasattr(sys, 'frozen'):
... | mit |
xiangel/hue | apps/zookeeper/setup.py | 38 | 1178 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
scripnichenko/nova | nova/api/openstack/compute/floating_ips.py | 16 | 12822 | # Copyright 2011 OpenStack Foundation
# Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 Grid Dynamics
# Copyright 2011 Eldar Nugaev, Kirill Shileev, Ilya Alekseyev
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with... | apache-2.0 |
NMGRL/pychron | pychron/furnace/tasks/nmgrl/panes.py | 2 | 12428 | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | apache-2.0 |
tempbottle/h-store | third_party/python/boto/s3/bucketlistresultset.py | 11 | 5787 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | gpl-3.0 |
tiagochiavericosta/edx-platform | common/djangoapps/service_status/test.py | 132 | 1427 | """Test for async task service status"""
from django.utils import unittest
from django.test.client import Client
from django.core.urlresolvers import reverse
import json
class CeleryConfigTest(unittest.TestCase):
"""
Test that we can get a response from Celery
"""
def setUp(self):
"""
... | agpl-3.0 |
nelmiux/CarnotKE | jyhton/lib-python/2.7/test/test_logging.py | 7 | 60266 | #!/usr/bin/env python
#
# Copyright 2001-2012 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... | apache-2.0 |
wangyou/XX-Net | code/default/python27/1.0/lib/win32/systray/win32_adapter.py | 6 | 6689 | import ctypes
RegisterWindowMessage = ctypes.windll.user32.RegisterWindowMessageA
LoadCursor = ctypes.windll.user32.LoadCursorA
LoadIcon = ctypes.windll.user32.LoadIconA
LoadImage = ctypes.windll.user32.LoadImageA
RegisterClass = ctypes.windll.user32.RegisterClassA
CreateWindowEx = ctypes.windll.user32.CreateWi... | bsd-2-clause |
qma/pants | tests/python/pants_test/build_graph/test_build_file_parser.py | 5 | 12566 | # coding=utf-8
# Copyright 2014 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 os
from colle... | apache-2.0 |
olituks/sentinella | frontend/library/web2py/applications/welcome/models/menu.py | 30 | 6204 | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## Customize your APP title, subtitle and menus here
#########################################################################
response.logo... | lgpl-2.1 |
40123210/w17b_exam | static/Brython3.1.1-20150328-091302/Lib/multiprocessing/pool.py | 694 | 23263 | #
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = ['Pool']
#
# Imports
#
import threading
import queue
import itertools
import collections
import time
from multiprocessing ... | agpl-3.0 |
4383/street-workout-database | sport/web/commons/templatetags/common_tags.py | 1 | 3392 | __author__ = 'herve.beraud'
from datetime import datetime, timedelta
from django import template
from django.core.exceptions import ObjectDoesNotExist
from django.conf import settings
from django.utils.timesince import timesince
from community.models import InformationMessage
from exercises.models import Category
fr... | gpl-2.0 |
dydek/django | django/contrib/gis/geos/prototypes/predicates.py | 8 | 1540 | """
This module houses the GEOS ctypes prototype functions for the
unary and binary predicate operations on geometries.
"""
from ctypes import c_char, c_char_p, c_double
from django.contrib.gis.geos.libgeos import GEOM_PTR, GEOSFuncFactory
from django.contrib.gis.geos.prototypes.errcheck import check_predicate
# #... | bsd-3-clause |
openprocurement/openprocurement.auctions.dgf | openprocurement/auctions/dgf/views/other/question.py | 1 | 3280 | # -*- coding: utf-8 -*-
from openprocurement.auctions.core.utils import (
apply_patch,
context_unpack,
get_now,
json_view,
opresource,
save_auction,
)
from openprocurement.auctions.core.validation import (
validate_question_data,
validate_patch_question_data,
)
from openprocurement.aucti... | apache-2.0 |
PXke/invenio | invenio/legacy/bibcirculation/utils.py | 4 | 30918 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013 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
## ... | gpl-2.0 |
adit-chandra/tensorflow | tensorflow/python/ops/confusion_matrix.py | 9 | 10906 | # 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 |
tonybaloney/st2contrib | packs/mmonit/actions/update_host.py | 12 | 1299 | from lib.mmonit import MmonitBaseAction
class MmonitUpdateHost(MmonitBaseAction):
def run(self, host_id, hostname, keepname=None, description=None, status=None, ipaddrout=None,
portout=None, sslout=None, monituser=None, monitpassword=None, skew=None):
self.login()
data = {"id": host_id... | apache-2.0 |
mgahsan/QuantEcon.py | examples/calibrations/BGP.py | 6 | 1334 | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 18 15:32:07 2015
@author: dgevans
"""
import numpy as np
class baseline(object):
beta = 0.9
psi = 0.69
Pi = 0.5 *np.ones((2,2))
G = np.array([0.1,0.2])
Theta = np.ones(2)
transfers = False
#derivatives of utiltiy funct... | bsd-3-clause |
Rudloff/youtube-dl | youtube_dl/extractor/radiode.py | 150 | 1819 | from __future__ import unicode_literals
from .common import InfoExtractor
class RadioDeIE(InfoExtractor):
IE_NAME = 'radio.de'
_VALID_URL = r'https?://(?P<id>.+?)\.(?:radio\.(?:de|at|fr|pt|es|pl|it)|rad\.io)'
_TEST = {
'url': 'http://ndr2.radio.de/',
'info_dict': {
'id': 'ndr2... | unlicense |
nikesh-mahalka/nova | nova/api/openstack/compute/legacy_v2/contrib/extended_ips.py | 79 | 3098 | # Copyright 2013 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
kennedyshead/home-assistant | homeassistant/components/sharkiq/__init__.py | 2 | 3047 | """Shark IQ Integration."""
import asyncio
from contextlib import suppress
import async_timeout
from sharkiqpy import (
AylaApi,
SharkIqAuthError,
SharkIqAuthExpiringError,
SharkIqNotAuthedError,
get_ayla_api,
)
from homeassistant import exceptions
from homeassistant.const import CONF_PASSWORD, C... | apache-2.0 |
jturney/psi4 | psi4/driver/procrouting/wrappers_cfour.py | 7 | 36345 | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2021 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... | lgpl-3.0 |
gurneyalex/stock-logistics-warehouse | __unported__/stock_orderpoint_creator/stock_orderpoint_creator/wizard/orderpoint_creator.py | 23 | 2960 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher (Camptocamp)
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public Licens... | agpl-3.0 |
karelin/polymode | tests/old/test_sweaction.py | 5 | 2168 | #Unit test for VWE_Action
from __future__ import division
from numpy import *
from numpy.testing import *
#--------------------------------------------------------------------------
#Remove main ABCSolver pathname & add path one up in directory to PATH
import sys,os
#sys.path.append(os.path.split(os.path.abspath(os.... | gpl-3.0 |
JoonghyunCho/crosswalk-tizen | tools/gyp/pylib/gyp/MSVSSettings_test.py | 778 | 65880 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the MSVSSettings.py file."""
import StringIO
import unittest
import gyp.MSVSSettings as MSVSSettings
class TestSequence... | apache-2.0 |
VictorLowther/swift | test/unit/obj/test_expirer.py | 4 | 16349 | # Copyright (c) 2011 OpenStack, 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 agreed to in wr... | apache-2.0 |
switchkiller/ProjDjanko | lib/python2.7/site-packages/django/contrib/admin/__init__.py | 160 | 1237 | # ACTION_CHECKBOX_NAME is unused, but should stay since its import from here
# has been referenced in documentation.
from django.contrib.admin.decorators import register
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.admin.options import (HORIZONTAL, VERTICAL,
ModelAdmin, StackedI... | gpl-2.0 |
SmartInfrastructures/neutron | neutron/services/firewall/agents/firewall_agent_api.py | 46 | 2517 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
FHannes/intellij-community | python/lib/Lib/site-packages/django/utils/tzinfo.py | 313 | 2511 | "Implementation of tzinfo classes for use with datetime.datetime."
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING
class FixedOffset(tzinfo):
"Fixed offset in minutes east from UTC."
def __init__(self, offset):
if i... | apache-2.0 |
tommy-u/chaco | chaco/multi_line_plot.py | 1 | 16640 | """ Defines the MultiLinePlot class.
"""
from __future__ import with_statement
# Standard library imports
import warnings
from math import ceil, floor
# Major library imports
import numpy as np
from numpy import argsort, array, invert, isnan, take, transpose
# Enthought library imports
from enable.api import black_... | bsd-3-clause |
mrkm4ntr/incubator-airflow | tests/providers/google/cloud/operators/test_dlp.py | 8 | 27989 | #
# 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 |
oceanobservatories/mi-dataset | mi/dataset/driver/velpt_j/cspp/velpt_j_cspp_recovered_driver.py | 7 | 1875 | #!/usr/bin/env python
"""
@package mi.dataset.driver.velpt_j.cspp
@file mi/dataset/driver/velpt_j/cspp/velpt_j_cspp_recovered_driver.py
@author Emily Hahn
@brief Driver for the recovered velpt series j instrument through cspp
"""
from mi.dataset.dataset_parser import DataSetDriverConfigKeys
from mi.dataset.dataset_dr... | bsd-2-clause |
grinich/bleach | bleach/tests/test_links.py | 10 | 14873 | import urllib
from html5lib.tokenizer import HTMLTokenizer
from nose.tools import eq_
from bleach import linkify, url_re, DEFAULT_CALLBACKS as DC
def test_url_re():
def no_match(s):
match = url_re.search(s)
if match:
assert not match, 'matched %s' % s[slice(*match.span())]
yiel... | bsd-3-clause |
iuliat/nova | nova/api/openstack/compute/plugins/v3/flavor_rxtx.py | 36 | 2096 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 |
civisanalytics/ansible | lib/ansible/modules/cloud/amazon/ec2_ami_find.py | 5 | 13983 | #!/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 |
AlexDoul/PyQt4 | examples/itemviews/stardelegate.py | 9 | 8877 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2010 Hans-Peter Jansen <hpj@urpla.net>.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_... | gpl-2.0 |
glove747/liberty-neutron | neutron/extensions/metering.py | 21 | 6632 | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 |
Isabek/python-koans | python3/koans/about_attribute_access.py | 104 | 6531 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Partially based on AboutMessagePassing in the Ruby Koans
#
from runner.koan import *
class AboutAttributeAccess(Koan):
class TypicalObject:
pass
def test_calling_undefined_functions_normally_results_in_errors(self):
typical = self.TypicalObj... | mit |
Turlough/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/tex.py | 19 | 25091 | """SCons.Tool.tex
Tool-specific initialization for TeX.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permiss... | apache-2.0 |
wimnat/ansible | test/support/integration/plugins/modules/ec2_group.py | 49 | 57129 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This file is part of Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
pylover/network-interfaces | network_interfaces/stanza.py | 1 | 4473 | # -*- coding: utf-8 -*-
import re
from .helpers import clean_list, list_hash
__author__ = 'vahid'
class Stanza(object):
_type = None
_filename = None
_headers = None
def __init__(self, filename, *headers):
self._filename = filename
self._headers = list(headers)
def __repr__(sel... | gpl-3.0 |
Venturi/cms | env/lib/python2.7/site-packages/unidecode/x0d2.py | 253 | 4724 | data = (
'toels', # 0x00
'toelt', # 0x01
'toelp', # 0x02
'toelh', # 0x03
'toem', # 0x04
'toeb', # 0x05
'toebs', # 0x06
'toes', # 0x07
'toess', # 0x08
'toeng', # 0x09
'toej', # 0x0a
'toec', # 0x0b
'toek', # 0x0c
'toet', # 0x0d
'toep', # 0x0e
'toeh', # 0x0f
'tyo', # 0x10... | gpl-2.0 |
realsaiko/odoo | addons/account_asset/account_asset.py | 32 | 28996 | # -*- encoding: 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 G... | agpl-3.0 |
peter-scholtens/geany | tests/ctags/simple.py | 85 | 1037 | """A long string
literal
"""
from bsddb import btopen
# Public global constants
VERSION = '1.2.0'
# Flags for list() and children()
ALL = 0xff
KEY = 0x01
TREEID = 0x02
INDENT = 0x04
DATA = 0x08 # Used by dbtreedata
class one:
x = lambda x: x
y = 0
def __init__(self, filename, pathsep='', treegap... | gpl-2.0 |
CWVanderReyden/originalMyHomeNet | Lib/encodings/iso2022_jp_ext.py | 816 | 1069 | #
# iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_iso2022, codecs
import _multibytecodec as mbc
codec = _codecs_iso2022.getcodec('iso2022_jp_ext')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class Incr... | gpl-3.0 |
hhuang05/ardupilot | mk/VRBRAIN/Tools/genmsg/src/genmsg/deps.py | 51 | 4087 | # Software License Agreement (BSD License)
#
# Copyright (c) 2011, Willow Garage, 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 t... | gpl-3.0 |
regardscitoyens/twitter-parlementaires | download_twitter.py | 1 | 1413 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, os, json
from twitter import Twitter, OAuth
from twitterconfig import KEY, SECRET, OAUTH_TOKEN, OAUTH_SECRET
if len(sys.argv) < 3:
sys.stderr.write("Please input both Twitter list's owner_screen_name and slug\n")
exit(1)
LIST_USER, LIST_ID = sys.argv[... | agpl-3.0 |
i5o/openshot-sugar | openshot/openshot/windows/TreeFiles.py | 3 | 5436 | # OpenShot Video Editor is a program that creates, modifies, and edits video files.
# Copyright (C) 2009 Jonathan Thomas
#
# This file is part of OpenShot Video Editor (http://launchpad.net/openshot/).
#
# OpenShot Video Editor is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | gpl-3.0 |
phobson/statsmodels | statsmodels/sandbox/distributions/try_max.py | 34 | 2428 | '''
adjusted from Denis on pystatsmodels mailing list
there might still be problems with loc and scale,
'''
from __future__ import division
import numpy as np
from scipy import stats
__date__ = "2010-12-29 dec"
class MaxDist(stats.rv_continuous):
""" max of n of scipy.stats normal expon ...
Example:
... | bsd-3-clause |
Klaudit/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/abstractstep.py | 129 | 3437 | # Copyright (C) 2010 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 th... | bsd-3-clause |
mzdaniel/oh-mainline | vendor/packages/Django/django/core/management/commands/shell.py | 230 | 3263 | import os
from django.core.management.base import NoArgsCommand
from optparse import make_option
class Command(NoArgsCommand):
option_list = NoArgsCommand.option_list + (
make_option('--plain', action='store_true', dest='plain',
help='Tells Django to use plain Python, not IPython.'),
)
... | agpl-3.0 |
ELNOGAL/CMNT_00040_2016_ELN_addons | eln_sale/models/sale_shop.py | 2 | 2786 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2012 Pexego Sistemas Informáticos All Rights Reserved
# $Marta Vázquez Rodríguez$ <marta@pexego.es>
#
# This program is free software: you can redistribute it and/or modify
# it unde... | agpl-3.0 |
anitagraser/processing_pysal | ext-libs/pysal/spreg/twosls_sp_regimes.py | 4 | 33806 | '''
Spatial Two Stages Least Squares with Regimes
'''
__author__ = "Luc Anselin luc.anselin@asu.edu, Pedro V. Amaral pedro.amaral@asu.edu, David C. Folch david.folch@asu.edu"
import numpy as np
import pysal
import regimes as REGI
import user_output as USER
import summary_output as SUMMARY
import multiprocessing as mp... | gpl-2.0 |
KellyChan/python-examples | python/aldebaran/hana/hana/motion/cartesian/motion_hulaHoop.py | 3 | 2824 | # -*- encoding: UTF-8 -*-
import sys
import motion
import almath
from naoqi import ALProxy
def StiffnessOn(proxy):
# We use the "Body" name to signify the collection of all joints
pNames = "Body"
pStiffnessLists = 1.0
pTimeLists = 1.0
proxy.stiffnessInterpolation(pNames, pStiffnessLists, pTimeLi... | mit |
HoracioAlvarado/fwd | venv/Lib/site-packages/sqlalchemy/testing/util.py | 55 | 7544 | # testing/util.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from ..util import jython, pypy, defaultdict, decorator, py2k
import decimal
import ... | mit |
adrset/kernel | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
avrem/ardupilot | Tools/autotest/ardusub.py | 4 | 6516 | #!/usr/bin/env python
# Dive ArduSub in SITL
from __future__ import print_function
import os
from pymavlink import mavutil
from common import AutoTest
from common import NotAchievedException
# get location of scripts
testdir = os.path.dirname(os.path.realpath(__file__))
SITL_START_LOCATION = mavutil.location(33.81... | gpl-3.0 |
googleads/google-ads-python | google/ads/googleads/v7/services/services/webpage_view_service/transports/__init__.py | 2 | 1051 | # -*- 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 |
h2oai/h2o-3 | h2o-py/tests/testdir_apis/H2O_Module/pyunit_h2oset_timezone_DEPRECATED.py | 4 | 1041 | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
from tests import pyunit_utils
import h2o
import random
def h2oset_timezone():
"""
Python API test: h2o.set_timezone(value)
Deprecated, set h2o.cluster().timezone instead.
Copy from pyunit_get_set_list_timezones.py
"""... | apache-2.0 |
barnacles10/ChopSuey | tools/perf/scripts/python/failed-syscalls-by-pid.py | 944 | 1869 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
colin2328/asciiclass | labs/lab3/worldcup_wrangler.py | 1 | 14912 | from wrangler import dw
import sys
if(len(sys.argv) < 3):
sys.exit('Error: Please include an input and output file. Example python script.py input.csv output.csv')
w = dw.DataWrangler()
# Split data repeatedly on newline into rows
w.add(dw.Split(column=["data"],
table=0,
status="act... | mit |
txemi/ansible | lib/ansible/modules/network/nxos/nxos_smu.py | 21 | 6168 | #!/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 |
jordiclariana/ansible | lib/ansible/modules/notification/rocketchat.py | 19 | 8608 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Deepak Kothandan <deepak.kothandan@outlook.com>
# (c) 2015, Stefan Berggren <nsg@nsg.cc>
# (c) 2014, Ramon de la Fuente <ramon@delafuente.nl>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms o... | gpl-3.0 |
luisfdez/pywinrm | winrm/tests/kerberos/test_cffi_mini.py | 4 | 8021 | import os
from cffi import FFI
ffi = FFI()
ffi.cdef("""
// Original source could be found here:
// https://github.com/krb5/krb5/blob/master/src/lib/gssapi/generic/gssapi.hin
typedef uint32_t gss_uint32;
typedef gss_uint32 OM_uint32;
typedef struct gss_OID_desc_struct {
OM_uint32 length;
void *el... | mit |
andrmuel/gr-dab | python/qa/qa_ofdm_move_and_insert_zero.py | 1 | 1294 | #!/usr/bin/env python
from gnuradio import gr, gr_unittest, blocks
import grdab
class qa_ofdm_move_and_insert_zero(gr_unittest.TestCase):
"""
@brief QA for the block that moves the signal to the middle of the band and inserts the zero carrier in the middle.
This class implements a test bench to verify the corresp... | gpl-3.0 |
eonpatapon/nova | nova/tests/unit/virt/disk/vfs/test_guestfs.py | 47 | 11421 | # Copyright (C) 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
#
# Unless required by applicable law ... | apache-2.0 |
senser/xmppBot | ZenPacks/community/xmppBot/Jabber/plugins/setjid.py | 1 | 4107 | """Check if the sender is a valid zenoss admin. For access control"""
from Jabber.Plugins import Plugin
from Jabber.ZenAdapter import ZenAdapter
from Jabber.Options import Options
from optparse import OptionError
import transaction
class SetJid(Plugin):
name = 'mapuser'
capabilities = ['setjid', 'mapuser', ... | gpl-2.0 |
laurentiush/bioformats | components/autogen/src/gen-meta-support.py | 7 | 4779 | #!/usr/bin/env bash
###
# #%L
# Bio-Formats autogen package for programmatically generating source code.
# %%
# Copyright (C) 2007 - 2015 Open Microscopy Environment:
# - Board of Regents of the University of Wisconsin-Madison
# - Glencoe Software, Inc.
# - University of Dundee
# %%
# This program is free softwa... | gpl-2.0 |
Bysmyyr/chromium-crosswalk | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/single_test_runner.py | 6 | 24521 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
ojengwa/oh-mainline | vendor/packages/zope.interface/src/zope/interface/common/interfaces.py | 22 | 4219 | ##############################################################################
#
# Copyright (c) 2003 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | agpl-3.0 |
sshwsfc/django-xadmin | xadmin/migrations/0001_initial.py | 17 | 2846 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-20 13:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | bsd-3-clause |
inovtec-solutions/OpenERP | openerp/addons/event/event.py | 18 | 23687 | # -*- 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 |
shashisp/blumix-webpy | app/applications/welcome/controllers/default.py | 1 | 1858 | # -*- coding: utf-8 -*-
# this file is released under public domain and you can use without limitations
#########################################################################
## This is a sample controller
## - index is the default action of any application
## - user is required for authentication and authorization... | mit |
lrowe/splinter | tests/test_webdriver_phantomjs.py | 1 | 2438 | import unittest
from splinter import Browser
from .fake_webapp import EXAMPLE_APP
from .base import WebDriverTests
class PhantomJSBrowserTest(WebDriverTests, unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.browser = Browser("phantomjs")
@classmethod
def tearDownClass(cls):
... | bsd-3-clause |
LIS/lis-tempest | tempest/lib/services/compute/keypairs_client.py | 2 | 2114 | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
fbradyirl/home-assistant | homeassistant/components/github/sensor.py | 2 | 7295 | """Support for GitHub."""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_NAME,
CONF_ACCESS_TOKEN,
CONF_NAME,
CONF_PATH,
CONF_URL,
)
import homeassistant.helpers.config_validati... | apache-2.0 |
lukesanantonio/gen | gen.py | 2 | 14437 | # Gen v0.1
# A generic, JSON-based asset pipeline for heterogeneous setups and
# unusual configurations.
#
# This is free and unencumbered software released into the public domain.
# For more information, please refer to <http://unlicense.org/>
import os
import shutil
import json
import subprocess
import jinja2
import... | unlicense |
daymer/xWIKI_Karma | CustomModules/mysql-connector-python-2.1.7/lib/cpy_distutils.py | 1 | 24414 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | apache-2.0 |
natefoo/pip | pip/_vendor/requests/packages/chardet/euctwfreq.py | 3133 | 34872 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
PeterWangIntel/chromium-crosswalk | build/android/pylib/utils/parallelizer.py | 51 | 7129 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Wrapper that allows method execution in parallel.
This class wraps a list of objects of the same type, emulates their
interface, and executes any functi... | bsd-3-clause |
axbaretto/beam | sdks/python/.tox/docs/lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py | 353 | 1139 | from __future__ import absolute_import, division, unicode_literals
import re
from . import base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(base.Filter):
spacePreserveElements = frozenset([... | apache-2.0 |
ric03uec/boto | boto/sdb/db/manager/sdbmanager.py | 17 | 27150 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction,... | mit |
thorwhalen/ut | ml/skwrap/feature_extraction/dict_vectorizer.py | 1 | 7588 |
__author__ = 'thor'
from sklearn.feature_extraction import DictVectorizer
from sklearn.externals import six
import numpy as np
from pandas import DataFrame
from collections import Counter
class IterDictVectorizer(DictVectorizer):
"""Transforms lists of feature-value mappings or rows of a dataframe to vectors... | mit |
brandond/ansible | lib/ansible/modules/network/fortios/fortios_firewall_ippool6.py | 24 | 8050 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2018 Fortinet, Inc.
#
# 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 Lic... | gpl-3.0 |
microcom/odoo | addons/base_gengo/controller/gengo_callback.py | 18 | 2338 | # -*- coding: utf-8 -*-
import openerp
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from werkzeug.wrappers import BaseResponse as Response
import json
class website_gengo(http.Controller):
def get_gengo_key(self, cr):
icp = request.re... | agpl-3.0 |
CYBERBUGJR/Diamond | src/collectors/udp/test/testudp.py | 30 | 2265 | #!/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
try:
from cStringIO import StringIO
except ImportError:
... | mit |
bmbove/omxremote | cherrypy/_cpchecker.py | 41 | 14499 | import os
import warnings
import cherrypy
from cherrypy._cpcompat import iteritems, copykeys, builtins
class Checker(object):
"""A checker for CherryPy sites and their mounted applications.
When this object is called at engine startup, it executes each
of its own methods whose names start with ``check_`... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.