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 |
|---|---|---|---|---|---|
jorik041/scikit-learn | examples/svm/plot_svm_regression.py | 249 | 1451 | """
===================================================================
Support Vector Regression (SVR) using linear and non-linear kernels
===================================================================
Toy example of 1D regression using linear, polynomial and RBF kernels.
"""
print(__doc__)
import numpy as np
... | bsd-3-clause |
adamchainz/ansible | lib/ansible/modules/cloud/cloudstack/cs_portforward.py | 51 | 14301 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
christophlsa/odoo | openerp/report/misc.py | 458 | 1425 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/Cookie.py | 59 | 25449 | #!/usr/bin/env python
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# 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 ... | apache-2.0 |
petrutlucian94/nova | plugins/xenserver/networking/etc/xensource/scripts/vif_rules.py | 113 | 4858 | #!/usr/bin/env python
# Copyright 2010-2011 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/LIC... | apache-2.0 |
pyokagan/gyp | test/cxxflags/gyptest-cxxflags.py | 128 | 1034 | #!/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.
"""
Verifies the use of the environment during regeneration when the gyp file
changes, specifically via build of an executable with C++ flag... | bsd-3-clause |
epam-mooc/edx-platform | cms/djangoapps/contentstore/features/course-settings.py | 13 | 7232 | # pylint: disable=C0111
# pylint: disable=W0621
from lettuce import world, step
from terrain.steps import reload_the_page
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror, upload_file
from django.conf import settings
from nose.tools import assert_true, assert_false, assert_equal ... | agpl-3.0 |
zulumarketing/html2pdf | xhtml2pdf/w3c/cssDOMElementInterface.py | 1 | 4314 | #!/usr/bin/env python
##~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##~ Copyright (C) 2002-2004 TechGame Networks, LLC.
##~
##~ This library is free software; you can redistribute it and/or
##~ modify it under the terms of the BSD style License as found in the
##~ LICENSE file included with this distribution.... | apache-2.0 |
RandallDW/Aruba_plugin | plugins/org.python.pydev/pysrc/_pydevd_bundle/pydevd_utils.py | 1 | 7871 | from __future__ import nested_scopes
import traceback
import os
try:
from urllib import quote
except:
from urllib.parse import quote # @UnresolvedImport
import inspect
from _pydevd_bundle.pydevd_constants import IS_PY3K
import sys
from _pydev_bundle import pydev_log
def save_main_module(file, module_name):
... | epl-1.0 |
girving/tensorflow | tensorflow/contrib/gan/python/eval/python/sliced_wasserstein.py | 43 | 1211 | # 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 |
pbjr23/django-projects | mysite/settings.py | 1 | 1989 | """
Django settings for mysite project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | gpl-2.0 |
sdecoder/CMDS-HDFS | common/build/contrib/hod/testing/helper.py | 182 | 1122 | #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 use thi... | apache-2.0 |
w495/scrapy | scrapy/utils/trackref.py | 120 | 2081 | """This module provides some functions and classes to record and report
references to live object instances.
If you want live objects for a particular class to be tracked, you only have to
subclass from object_ref (instead of object).
About performance: This library has a minimal performance impact when enabled,
and ... | bsd-3-clause |
pevzi/django-debug-toolbar | tests/panels/test_logging.py | 4 | 2678 | # coding: utf-8
from __future__ import absolute_import, unicode_literals
import logging
from debug_toolbar.panels.logging import (
MESSAGE_IF_STRING_REPRESENTATION_INVALID, collector,
)
from ..base import BaseTestCase
class LoggingPanelTestCase(BaseTestCase):
def setUp(self):
super(LoggingPanelTe... | bsd-3-clause |
CloudWareChile/OpenChile | openerp/addons/multi_company/__init__.py | 886 | 1054 | # -*- 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... | agpl-3.0 |
elijah513/scrapy | tests/test_http_cookies.py | 94 | 2499 | from six.moves.urllib.parse import urlparse
from unittest import TestCase
from scrapy.http import Request, Response
from scrapy.http.cookies import WrappedRequest, WrappedResponse
class WrappedRequestTest(TestCase):
def setUp(self):
self.request = Request("http://www.example.com/page.html",
... | bsd-3-clause |
google/contentbox | third_party/django/contrib/auth/__init__.py | 97 | 5361 | import re
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.utils.module_loading import import_by_path
from django.middleware.csrf import rotate_token
from .signals import user_logged_in, user_logged_out, user_login_failed
SESSION_KEY = '_auth_user... | apache-2.0 |
joergdietrich/astropy | astropy/config/paths.py | 3 | 10745 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
""" This module contains functions to determine where configuration and
data/cache files used by Astropy should be placed.
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from ..extern impor... | bsd-3-clause |
kevin1024/vcrpy | vcr/stubs/httpx_stubs.py | 1 | 5330 | import functools
import logging
from unittest.mock import patch, MagicMock
import httpx
from vcr.request import Request as VcrRequest
from vcr.errors import CannotOverwriteExistingCassetteException
_logger = logging.getLogger(__name__)
def _transform_headers(httpx_reponse):
"""
Some headers can appear mult... | mit |
40223247/2015cd_midterm2 | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/event.py | 603 | 19086 | #!/usr/bin/env python
'''Pygame module for interacting with events and queues.
Pygame handles all it's event messaging through an event queue. The routines
in this module help you manage that event queue. The input queue is heavily
dependent on the pygame display module. If the display has not been
initialized and a ... | gpl-3.0 |
radicalbit/ambari | ambari-server/src/main/resources/stacks/HDP/2.0.6.GlusterFS/services/YARN/package/scripts/params.py | 1 | 6959 | """
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 use this ... | apache-2.0 |
Jeff-Tian/mybnb | Python27/Lib/test/buffer_tests.py | 12 | 10782 | # Tests that work for both bytes and buffer objects.
# See PEP 3137.
import struct
import sys
class MixinBytesBufferCommonTests(object):
"""Tests that work for both bytes and buffer objects.
See PEP 3137.
"""
def marshal(self, x):
"""Convert x into the appropriate type for these t... | apache-2.0 |
sboosali/commands-frontends-dragon13 | NatLink/SampleMacros/natspeak_sample6.py | 1 | 1733 | #
# Python Macro Language for Dragon NaturallySpeaking
# (c) Copyright 1999 by Joel Gould
# Portions (c) Copyright 1999 by Dragon Systems, Inc.
#
# This sample macro file was created for my talk to the Boston Voice Users
# group on November 9, 1999. It is explained in my PowerPoint slides.
#
# natspeak_sample6.py
... | mit |
junbochen/pylearn2 | pylearn2/config/yaml_parse.py | 37 | 16430 | """Support code for YAML parsing of experiment descriptions."""
import yaml
from pylearn2.utils import serial
from pylearn2.utils.exc import reraise_as
from pylearn2.utils.string_utils import preprocess
from pylearn2.utils.call_check import checked_call
from pylearn2.utils.string_utils import match
from collections imp... | bsd-3-clause |
maestrano/openerp | openerp/tests/test_ir_filters.py | 63 | 10677 | # -*- coding: utf-8 -*-
import functools
from openerp import exceptions
from . import common
class Fixtures(object):
def __init__(self, *args):
self.fixtures = args
def __call__(self, fn):
@functools.wraps(fn)
def wrapper(case):
for model, vars in self.fixtures:
... | agpl-3.0 |
OneBitSoftware/jwtSample | src/Spa/env1/Lib/site-packages/gunicorn/management/commands/run_gunicorn.py | 38 | 3258 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
from gunicorn.app.djangoapp import DjangoApplicationCommand
from gunicorn.config import mak... | mit |
keedio/hue | desktop/core/ext-py/Django-1.6.10/django/core/management/base.py | 104 | 15912 | """
Base classes for writing management commands (named commands which can
be executed through ``django-admin.py`` or ``manage.py``).
"""
from __future__ import unicode_literals
import os
import sys
from optparse import make_option, OptionParser
import django
from django.core.exceptions import ImproperlyConfigured
... | apache-2.0 |
wiki2014/Learning-Summary | alps/build/tools/releasetools/test_rangelib.py | 1 | 5541 | #
# Copyright (C) 2015 The Android Open Source Project
#
# 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 la... | gpl-3.0 |
CythonAI/1.1.0-0001 | src/feed_scanner.py | 4 | 3087 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import time
from likers_graber_protocol import likers_graber_protocol
from new_auto_mod_unfollow2 import new_auto_mod_unfollow2
from recent_feed import get_media_id_recent_feed
from user_feed import get_media_id_user_feed
def feed_scanner(self):
#This i... | gpl-3.0 |
dntt1/youtube-dl | youtube_dl/extractor/tf1.py | 59 | 2239 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TF1IE(InfoExtractor):
"""TF1 uses the wat.tv player."""
_VALID_URL = r'https?://(?:(?:videos|www|lci)\.tf1|(?:www\.)?(?:tfou|ushuaiatv|histoire|tvbreizh))\.fr/(?:[^/]+/)*(?P<id>[^/?#.]+)'
_TESTS = [{
'... | unlicense |
softelnet/sponge | sponge-remote-api-integration-tests/examples/remote-api-server/remote_api_security.py | 1 | 1483 | """
Sponge Knowledge Base
Remote API security
"""
from org.openksavi.sponge.remoteapi.server.security import User
# Simple access configuration: role -> knowledge base names regexps.
ROLES_TO_KB = { "admin":[".*"], "guest":["example"], "anonymous":["example"]}
# Simple access configuration: role -> event names regexp... | apache-2.0 |
bratsche/Neutron-Drive | google_appengine/lib/django_1_2/tests/modeltests/ordering/tests.py | 92 | 4309 | from datetime import datetime
from operator import attrgetter
from django.test import TestCase
from models import Article
class OrderingTests(TestCase):
def test_basic(self):
a1 = Article.objects.create(
headline="Article 1", pub_date=datetime(2005, 7, 26)
)
a2 = Article.obje... | bsd-3-clause |
tgetzoya/project-euler-python | problems/pe11.py | 1 | 4396 | # In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
#
# 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
# 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
# 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
# 52 70 95 23 04 60 11 42 69 24 68 56 01 32 5... | bsd-2-clause |
evilhero/mylar | lib/requests/packages/chardet/langthaimodel.py | 2930 | 11275 | ######################## 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... | gpl-3.0 |
savoirfairelinux/OpenUpgrade | addons/website_blog/__init__.py | 373 | 1036 | # -*- 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 |
maxandersen/jenkins-job-builder | jenkins_jobs/modules/publishers.py | 1 | 186200 | # Copyright 2012 Hewlett-Packard Development Company, L.P.
# Copyright 2012 Varnish Software AS
# Copyright 2013-2014 Antoine "hashar" Musso
# Copyright 2013-2014 Wikimedia Foundation Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... | apache-2.0 |
ryanahall/django | tests/model_inheritance_regress/models.py | 150 | 5750 | from __future__ import unicode_literals
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Place(models.Model):
name = models.CharField(max_length=50)
address = models.CharField(max_length=80)
class Meta:
... | bsd-3-clause |
Triv90/Nova | nova/tests/fake_instance_actions.py | 13 | 3211 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2013 OpenStack Foundation
#
# 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/LICE... | apache-2.0 |
hfp/tensorflow-xsmm | tensorflow/python/saved_model/builder.py | 37 | 1183 | # 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 |
skyostil/tracy | src/generator/Cheetah/Utils/Misc.py | 1 | 2886 | #!/usr/bin/env python
# $Id: Misc.py,v 1.1 2006-09-06 09:50:10 skyostil Exp $
"""Miscellaneous functions/objects used by Cheetah but also useful standalone.
Meta-Data
================================================================================
Author: Mike Orr <iron@mso.oz.net>
License: This software is rel... | mit |
byterom/android_external_chromium_org | tools/telemetry/telemetry/timeline/counter_unittest.py | 53 | 1909 | # 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.
import types
import unittest
from telemetry.timeline import counter as counter_module
class FakeProcess(object):
pass
class CounterIterEventsInThisCon... | bsd-3-clause |
pra85/calibre | src/calibre/library/server/xml.py | 5 | 5703 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import __builtin__
import cherrypy
from lxml.builder import ElementMaker
from lxml import etree
from calibre.library.serv... | gpl-3.0 |
romain-dartigues/ansible | lib/ansible/module_utils/aws/elbv2.py | 23 | 29133 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Ansible imports
from ansible.module_utils.ec2 import camel_dict_to_snake_dict, get_ec2_security_group_ids_from_names, \
ansible_dict_to_boto3_tag_list, boto3_tag_list_to_ansible_dict,... | gpl-3.0 |
nelango/ViralityAnalysis | model/lib/pandas/tests/test_msgpack/test_extension.py | 9 | 2254 | from __future__ import print_function
import array
import pandas.msgpack as msgpack
from pandas.msgpack import ExtType
def test_pack_ext_type():
def p(s):
packer = msgpack.Packer()
packer.pack_ext_type(0x42, s)
return packer.bytes()
assert p(b'A') == b'\xd4\x42A' # fixe... | mit |
orgito/ansible | test/units/plugins/lookup/test_aws_ssm.py | 54 | 6480 | #
# (c) 2017 Michael De La Rue
#
# 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... | gpl-3.0 |
mmauroy/SickRage | sickbeard/providers/nextgen.py | 3 | 12149 | # Author: seedboy
# URL: https://github.com/seedboy
#
# This file is part of SickRage.
#
# SickRage 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 la... | gpl-3.0 |
BillKeenan/lets-encrypt-preview | acme/acme/crypto_util_test.py | 12 | 3544 | """Tests for acme.crypto_util."""
import socket
import threading
import time
import unittest
from six.moves import socketserver # pylint: disable=import-error
from acme import errors
from acme import jose
from acme import test_util
class SSLSocketAndProbeSNITest(unittest.TestCase):
"""Tests for acme.crypto_uti... | apache-2.0 |
manuelli/director | src/python/director/raycastdriver.py | 5 | 1123 | import drc as lcmdrc
import bot_core as lcmbotcore
from director import lcmUtils
from director import affordanceurdf
class RaycastDriver(object):
def __init__(self, request_channel='TERRAIN_RAYCAST_REQUEST'):
self.request_channel = request_channel
def requestRaycast(self, affordances, lb=[-2,-2], ub=... | bsd-3-clause |
noironetworks/group-based-policy | gbpservice/contrib/tests/unit/nfp/configurator/agents/test_generic_config.py | 1 | 12961 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
Quihico/repository.spartacus | temp/script.module.python.koding.aio/lib/koding/web.py | 1 | 12658 | # -*- coding: utf-8 -*-
# script.module.python.koding.aio
# Python Koding AIO (c) by whufclee (info@totalrevolution.tv)
# Python Koding AIO is licensed under a
# Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.
# You should have received a copy of the license along with this
# work... | gpl-2.0 |
Gustry/inasafe | safe/utilities/profiling.py | 2 | 3345 | # coding=utf-8
"""This module contains logic for performance profiling.
This code was taken from http://stackoverflow.com/a/3620972
"""
import time
import inspect
from functools import wraps
from safe.utilities.memory_checker import get_free_memory
from safe.utilities.settings import setting
__copyright__ = "Vadi... | gpl-3.0 |
Big-B702/python-for-android | python3-alpha/python3-src/Lib/html/parser.py | 45 | 16340 | """A parser for HTML and XHTML."""
# This file is based on sgmllib.py, but the API is slightly different.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDAT... | apache-2.0 |
oskar456/youtube-dl | youtube_dl/extractor/safari.py | 6 | 6969 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,
std_headers,
urlencode_postdata,
update_url_query,
)
class SafariBaseIE(InfoExtractor):
_LOGIN_URL = 'https://www.safaribooksonline.co... | unlicense |
Johnzero/erp | openerp/addons/edi/controllers/main.py | 9 | 3764 | import json
import textwrap
import simplejson
import werkzeug.wrappers
try:
# embedded
import openerp.addons.web.common.http as openerpweb
import openerp.addons.web.controllers.main as webmain
except ImportError:
# standalone
import web.common.http as openerpweb
import web.controllers.main as ... | agpl-3.0 |
Nepherhotep/django | tests/middleware/test_security.py | 291 | 7781 | from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase
from django.test.utils import override_settings
class SecurityMiddlewareTest(SimpleTestCase):
@property
def middleware(self):
from django.middleware.security import SecurityMiddleware
return SecurityMid... | bsd-3-clause |
DavidLP/home-assistant | homeassistant/components/worldtidesinfo/sensor.py | 7 | 4085 | """Support for the worldtides.info API."""
from datetime import timedelta
import logging
import time
import requests
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION, CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_NAME)
impo... | apache-2.0 |
5GExchange/escape | pox/pox/messenger/__init__.py | 5 | 20137 | # Copyright 2011,2012 James McCauley
#
# 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 ... | apache-2.0 |
dhanunjaya/neutron | neutron/tests/unit/hacking/test_checks.py | 24 | 6380 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
aspose-slides/Aspose.Slides-for-Java | Plugins/Aspose-Slides-Java-for-Python/WorkingWithSlidesInPresentation/__init__.py | 2 | 21809 | __author__ = 'fahadadeel'
import jpype
class AccessSlides:
def __init__(self, dataDir):
print "init func"
self.dataDir = dataDir
self.Presentation=jpype.JClass("com.aspose.slides.Presentation")
self.SaveFormat=jpype.JClass("com.aspose.slides.SaveFormat")
def ma... | mit |
catapult-project/catapult | tracing/tracing/extras/symbolizer/symbolize_trace_macho_reader.py | 4 | 1048 | # Copyright 2017 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.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
import subprocess
from six.moves impor... | bsd-3-clause |
ricco386/broadcaster | RPi.Relay/setup.py | 1 | 1416 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# This software is licensed as described in the README.rst and LICENSE
# files, which you should have received as part of this distribution.
import setuptools
# noinspection PyPep8Naming
from raspi_mc import __version__ as VERSION
DEPS = ['RPi.Sensor>=0.5.2']
CLASSIFIERS =... | bsd-3-clause |
pyprism/Hiren-Vault | password/migrations/0010_auto_20170129_0026.py | 2 | 2626 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-28 18:26
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('taggit'... | mit |
OpenQbo/qbo_webi | src/teleoperation/sip2rtmp/rtmplite/rtmp.py | 4 | 65395 | # Copyright (c) 2007-2009, Mamta Singh. All rights reserved. see README for details.
# Copyright (c) 2010-2011, Kundan Singh.
'''
This is a simple implementation of a Flash RTMP server to accept connections and stream requests. The module is organized as follows:
1. The FlashServer class is the main class to provide t... | gpl-2.0 |
hryamzik/ansible | lib/ansible/modules/network/netvisor/pn_cluster.py | 43 | 9501 | #!/usr/bin/python
""" PN CLI cluster-create/cluster-delete """
#
# 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 optio... | gpl-3.0 |
seansu4you87/kupo | projects/molt/venv/lib/python2.7/site-packages/wheel/test/test_ranking.py | 565 | 1496 | import unittest
from wheel.pep425tags import get_supported
from wheel.install import WheelFile
WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl"
def make_wheel(name, ver, pyver, abi, arch):
name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi,
arch=arch)
return WheelFile(name... | mit |
bluesea/zulip | zerver/decorator.py | 115 | 23508 | from __future__ import absolute_import
from django.http import HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.views.decorators.csrf import csrf_exempt
from django.http import QueryDict, HttpResponseNotAllowed
from django.http.multipartparser import MultiPartParser
from zerve... | apache-2.0 |
dgvncsz0f/pingpong | tests/transport/test_system.py | 1 | 2079 | # -*- coding: utf-8 -*-
# Copyright (c) 2011, Diego Souza
# 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... | gpl-3.0 |
oseemann/cvsreview | app/vclib/compat.py | 2 | 4707 | # -*-python-*-
#
# Copyright (C) 1999-2006 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit h... | gpl-3.0 |
iw3hxn/LibrERP | report_aeroo/wizard/remove_print_button.py | 3 | 3640 | ##############################################################################
#
# Copyright (c) 2008-2012 Alistek Ltd (http://www.alistek.com) All Rights Reserved.
# General contacts <info@alistek.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take th... | agpl-3.0 |
Jmainguy/ansible-modules-core | cloud/openstack/os_ironic_node.py | 68 | 13498 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2015, Hewlett-Packard Development Company, L.P.
#
# This module 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 optio... | gpl-3.0 |
bob123bob/Sick-Beard | cherrypy/_cprequest.py | 39 | 38091 |
from Cookie import SimpleCookie, CookieError
import os
import sys
import time
import types
import warnings
import cherrypy
from cherrypy import _cpreqbody, _cpconfig
from cherrypy._cperror import format_exc, bare_error
from cherrypy.lib import httputil, file_generator
class Hook(object):
"""A callback and its m... | gpl-3.0 |
Semi-global/edx-platform | common/djangoapps/util/tests/test_memcache.py | 84 | 3681 | """
Tests for memcache in util app
"""
from django.test import TestCase
from django.core.cache import get_cache
from util.memcache import safe_key
class MemcacheTest(TestCase):
"""
Test memcache key cleanup
"""
# Test whitespace, control characters, and some non-ASCII UTF-16
UNICODE_CHAR_CODES =... | agpl-3.0 |
matthagy/physmath | physmath/test.py | 1 | 1856 |
from reload import fixup
fixup(0)
from physmath.units import parse_unit as pu
from physmath.physnum import parse_physical_number as ppn
from physmath.convert import convert, convert_factor
from physmath.annotator import annotator
from physmath import layout
import browsemath.client
reload(browsemath.client)
from bro... | apache-2.0 |
kwyoung11/ciml | labs/lab6-NaiveBayes/binary.py | 14 | 2673 | """
This defines an abstract class for binary classification. It supports
both online algorithms (like perceptron) and batch algorithm (like
gradient descent).
"""
import util
from numpy import *
class BinaryClassifier:
"""
Our abstract class.
If you implement this class, you must do one of the follow... | gpl-2.0 |
nitzanm/boundary-plugin-aws-rds-python | boundary_aws_plugin/cloudwatch_metrics.py | 5 | 8218 | from __future__ import (absolute_import, division, print_function, unicode_literals)
import boto
import boto.ec2.cloudwatch
import datetime
import logging
import abc
__version__ = '1.1.0'
class CloudwatchMetrics(object):
__metaclass__ = abc.ABCMeta
def __init__(self, access_key_id, secret_access_key, cloudw... | apache-2.0 |
chris48s/UK-Polling-Stations | polling_stations/apps/data_collection/views.py | 1 | 1334 | from datetime import datetime
from django.conf import settings
from django.db.models import Case, IntegerField, Q, Value, When
from django.shortcuts import get_object_or_404, render
from django.views.generic import ListView, TemplateView
from .models import DataQuality
class LeagueTable(ListView):
model = DataQua... | bsd-3-clause |
caorong/mysql-connector-python | tests/test_constants.py | 13 | 17686 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2014, 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... | gpl-2.0 |
ceb8/astroquery | astroquery/open_exoplanet_catalogue/utils.py | 2 | 8998 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
class Number:
""" Number class for values containing errors. Math operations use
the value given. Checking for no 'value' must use "==". Numbers with
upper or lower limits as assumed to have no value.
Examples
--------
>>> num =... | bsd-3-clause |
jinankjain/zamboni | scripts/monitors/check_wsgi.py | 8 | 1259 | #!/usr/bin/python2.6
"""Makes sure mod_wsgi has been restarted after the last code push i.e,
mod_wsgi is fresher than the mtime on all *.py files in the application dir.
"""
from datetime import datetime
from optparse import OptionParser
import os
from subprocess import PIPE, Popen
import urllib2
def check_modwsgi(... | bsd-3-clause |
NicoVarg99/daf-recipes | ckan/ckan/ckanext-dcatapit/ckanext/dcatapit/dcat/profiles.py | 1 | 31302 |
import ast
import logging
import datetime
from pylons import config
from rdflib.namespace import Namespace, RDF, SKOS
from rdflib import URIRef, BNode, Literal
import ckan.logic as logic
from ckanext.dcat.profiles import RDFProfile, DCAT, LOCN, VCARD, DCT, FOAF, ADMS
from ckanext.dcat.utils import catalog_uri, dat... | gpl-3.0 |
Smana/setup-kubernetes | library/kpm.py | 16 | 3305 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import kpm.deploy
from ansible.module_utils.basic import *
DOCUMENTATION = """
---
module: kpm
short_description: Application deployment on kubernetes with kpm registry
description:
- Create, remove, and update resources within a Kubernetes Cluster
version_added: "2.0"
opti... | apache-2.0 |
msebire/intellij-community | python/helpers/py3only/docutils/io.py | 44 | 17042 | # $Id: io.py 7596 2013-01-25 13:42:17Z milde $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
I/O classes provide a uniform API for low-level input and output. Subclasses
exist for a variety of input/output mechanisms.
"""
__docformat__ = 'reStructured... | apache-2.0 |
mikewiebe-ansible/ansible | lib/ansible/modules/network/nxos/nxos_feature.py | 94 | 8046 | #!/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 |
nikesh-mahalka/cinder | cinder/tests/unit/targets/test_base_iscsi_driver.py | 19 | 6798 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
slaveofcode/rajaongkir | rajaongkir/api.py | 1 | 6138 | from __future__ import unicode_literals
import requests
import json
from json.encoder import JSONEncoder
JNE = 'jne'
POS = 'pos'
TIKI = 'tiki'
ALL_COURIER = 'all'
class ApiRequest(object):
"""Basic Api request with using requests library
"""
json_encoder_class = JSONEncoder
def __init__(self, endpo... | mit |
diegonc/client175 | covers.py | 3 | 7145 | #!/usr/bin/env python
#
# covers.py
#
# Copyright 2009 Chris Seickel
#
# 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
# (... | gpl-3.0 |
ahmedbodi/terracoin | contrib/testgen/gen_base58_test_vectors.py | 1000 | 4343 | #!/usr/bin/env python
'''
Generate valid and invalid base58 address and private key test vectors.
Usage:
gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json
gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json
'''
# 2012 Wladimir J. van der Laan
# R... | mit |
suziesparkle/wagtail | wagtail/wagtailsearch/models.py | 5 | 3229 | from django.db import models
from django.utils import timezone
from indexed import Indexed
import datetime
import string
class Query(models.Model):
query_string = models.CharField(max_length=255, unique=True)
def save(self, *args, **kwargs):
# Normalise query string
self.query_string = self.... | bsd-3-clause |
Julius2342/pyvlx | test/frame_set_node_name_req_test.py | 1 | 1465 | """Unit tests for FrameSetNodeNameRequest."""
import unittest
from pyvlx.api.frame_creation import frame_from_raw
from pyvlx.api.frames import FrameSetNodeNameRequest
class TestFrameSetNodeNameRequest(unittest.TestCase):
"""Test class FrameSetNodeNameRequest."""
# pylint: disable=too-many-public-methods,inv... | lgpl-3.0 |
cainmatt/django | tests/template_tests/filter_tests/test_slugify.py | 324 | 1430 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.template.defaultfilters import slugify
from django.test import SimpleTestCase
from django.utils.safestring import mark_safe
from ..utils import setup
class SlugifyTests(SimpleTestCase):
"""
Running slugify on a pre-escaped string le... | bsd-3-clause |
chr15m/PodSixNet | examples/LagTimeServer.py | 1 | 1743 | from __future__ import print_function
from time import sleep, localtime
from weakref import WeakKeyDictionary
from time import time
import sys
from PodSixNet.Server import Server
from PodSixNet.Channel import Channel
class LagTimeChannel(Channel):
"""
This is the server representation of a single connected c... | lgpl-3.0 |
superwebium/pybbb | checksumUrl.py | 1 | 1052 | #creer l'url avec son checksum
import hashlib
def checksumUrl(queryString,action,secret):
#1. Create the entire query string for your API call without the checksum parameter "name=Test+Meeting&meetingID=abc123&attendeePW=111222&moderatorPW=333444"
#2. Prepend the call name to your string "createname=Test+Meeting&me... | mit |
dav1x/ansible | lib/ansible/modules/system/user.py | 10 | 76166 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Stephen Fromm <sfromm@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 Lice... | gpl-3.0 |
bchappet/dnfpy | src/dnfpyUtils/stats/clusterMap.py | 1 | 7473 | from dnfpy.core.map2D import Map2D
import numpy as np
from sklearn.cluster import DBSCAN
import scipy.spatial.distance as dist
from dnfpyUtils.stats.statistic import Statistic
class ClusterMap(Statistic):
"""
Params:
"continuity" : float if different of 0.0, we assume that the cluster are continuous
... | gpl-2.0 |
nkgilley/home-assistant | homeassistant/components/myq/binary_sensor.py | 6 | 2948 | """Support for MyQ gateways."""
import logging
from pymyq.const import (
DEVICE_FAMILY as MYQ_DEVICE_FAMILY,
DEVICE_FAMILY_GATEWAY as MYQ_DEVICE_FAMILY_GATEWAY,
DEVICE_STATE as MYQ_DEVICE_STATE,
DEVICE_STATE_ONLINE as MYQ_DEVICE_STATE_ONLINE,
KNOWN_MODELS,
MANUFACTURER,
)
from homeassistant.co... | apache-2.0 |
heracek/django-nonrel | django/contrib/gis/gdal/feature.py | 321 | 3998 | # The GDAL C library, OGR exception, and the Field object
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.error import OGRException, OGRIndexError
from django.contrib.gis.gdal.field import Field
from django.contrib.gis.gdal.geometries import OGRGeometry, OGRGeomType
from django.contrib.gi... | bsd-3-clause |
wayward710/django-oidc-provider | oidc_provider/models.py | 1 | 2568 | import json
from django.db import models
from django.utils import timezone
from django.conf import settings
class Client(models.Model):
RESPONSE_TYPE_CHOICES = [
('code', 'code (Authorization Code Flow)'),
('id_token', 'id_token (Implicit Flow)'),
('id_token token', 'id_token token (Impl... | mit |
tadgh/ArgoRevisit | third_party/nltk/classify/megam.py | 4 | 5817 | # Natural Language Toolkit: Interface to Megam Classifier
#
# Copyright (C) 2001-2011 NLTK Project
# Author: Edward Loper <edloper@gradient.cis.upenn.edu>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
#
# $Id: naivebayes.py 2063 2004-07-17 21:02:24Z edloper $
"""
A set of functions used to i... | apache-2.0 |
FrancoCotter/ReactTimerAPP | node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py | 2779 | 1665 | # Copyright (c) 2011 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.
"""gypsh output module
gypsh is a GYP shell. It's not really a generator per se. All it does is
fire up an interactive Python session with a few local variables... | mit |
vinicius-alves/InternetBanking | env/lib/python3.4/site-packages/django/contrib/admin/actions.py | 66 | 3365 | """
Built-in, globally-available admin actions.
"""
from django.contrib import messages
from django.contrib.admin import helpers
from django.contrib.admin.utils import get_deleted_objects, model_ngettext
from django.core.exceptions import PermissionDenied
from django.db import router
from django.template.response impo... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.