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 |
|---|---|---|---|---|---|
hrjn/scikit-learn | examples/applications/plot_model_complexity_influence.py | 323 | 6372 | """
==========================
Model Complexity Influence
==========================
Demonstrate how model complexity influences both prediction accuracy and
computational performance.
The dataset is the Boston Housing dataset (resp. 20 Newsgroups) for
regression (resp. classification).
For each class of models we m... | bsd-3-clause |
rasbt/advent-of-code-2016 | python_code/aoc_01_02.py | 1 | 4237 | import collections
"""
source: http://adventofcode.com/2016/day/1
DESCRIPTION
Santa's sleigh uses a very high-precision clock to guide its movements, and the
clock's oscillator is regulated by stars. Unfortunately, the stars have been
stolen... by the Easter Bunny. To save Christmas, Santa needs you to retrieve
all... | mit |
loic/django | tests/gis_tests/maps/tests.py | 322 | 2099 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from unittest import skipUnless
from django.contrib.gis.geos import HAS_GEOS
from django.test import SimpleTestCase
from django.test.utils import modify_settings, override_settings
from django.utils.encoding import force_text
GOOGLE_MAPS_API_KEY = 'XXXX... | bsd-3-clause |
darren-wang/gl | glance/async/flows/introspect.py | 6 | 3153 | # Copyright 2015 Red Hat, 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... | apache-2.0 |
hiteshchoudhary/Airvengers | AirvengersGUI.py | 1 | 7188 | #!/usr/bin/env python
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++#
# Thanks for opting for GUI version of AirCrack set of tools. This project is in early stage and require your support. #
# Project is ... | gpl-2.0 |
hinerm/ITK | Wrapping/Generators/SwigInterface/pygccxml-1.0.0/pygccxml/parser/etree_scanner.py | 14 | 1665 | # Copyright 2004-2008 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0. (See
# accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
import scanner
import xml.etree.cElementTree as ElementTree
class etree_saxifier_t(object):
def __init__(self, etree, hand... | apache-2.0 |
d53dave/csaopt | csaopt/model/__init__.py | 2 | 3353 | """
This module offers the core CSAOpt modelling component: the :class:`~model.Model` class.
"""
import json
from enum import Enum
from typing import Dict, Any
class Precision(Enum):
"""Enum for available calculation precisions"""
Float32 = 'float32'
Float64 = 'float64'
class RandomDistribution(Enum):
... | mit |
mitsuhiko/pip | pip/_vendor/requests/packages/charade/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
zhanqxun/cv_fish | PIL/GdImageFile.py | 25 | 2182 | #
# The Python Imaging Library.
# $Id$
#
# GD file handling
#
# History:
# 1996-04-12 fl Created
#
# Copyright (c) 1997 by Secret Labs AB.
# Copyright (c) 1996 by Fredrik Lundh.
#
# See the README file for information on usage and redistribution.
#
# NOTE: This format cannot be automatically recognized, so the
# cl... | apache-2.0 |
miguelparaiso/OdooAccessible | addons/account_analytic_plans/__openerp__.py | 264 | 3114 | # -*- 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 |
J4LP/eve-wspace | evewspace/SiteTracker/models.py | 5 | 10670 | # Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your ... | gpl-3.0 |
ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/contrib/admindocs/urls.py | 317 | 1092 | from django.conf.urls import patterns, url
from django.contrib.admindocs import views
urlpatterns = patterns('',
url('^$',
views.doc_index,
name='django-admindocs-docroot'
),
url('^bookmarklets/$',
views.bookmarklets,
name='django-admindocs-bookmarklets'
),
url('^tag... | bsd-3-clause |
funbaker/astropy | astropy/table/tests/test_table.py | 2 | 69207 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import gc
import sys
import copy
from io import StringIO
from collections import OrderedDict
import pytest
import numpy as np
from numpy.testing import assert_allclose
from ...io import fits
from ...tests.helper import (assert_fo... | bsd-3-clause |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/theano/sparse/tests/test_basic.py | 4 | 119562 | from itertools import product
import time
import unittest
from nose.plugins.skip import SkipTest
import numpy
from six.moves import xrange
try:
import scipy.sparse as sp
import scipy.sparse
from scipy.sparse import csr_matrix
except ImportError:
pass # The variable enable_sparse will be used to disabl... | mit |
adedayo/intellij-community | python/lib/Lib/site-packages/django/forms/widgets.py | 73 | 32961 | """
HTML Widget classes
"""
import datetime
from itertools import chain
import time
from urlparse import urljoin
from util import flatatt
import django.utils.copycompat as copy
from django.conf import settings
from django.utils.datastructures import MultiValueDict, MergeDict
from django.utils.html import escape, condi... | apache-2.0 |
twinshadow/ScintillaGL | scintilla/HFacer.py | 22 | 2312 | #!/usr/bin/env python
# HFacer.py - regenerate the Scintilla.h and SciLexer.h files from the Scintilla.iface interface
# definition file.
# The header files are copied to a temporary file apart from the section between a /* ++Autogenerated*/
# comment and a /* --Autogenerated*/ comment which is generated by the printHF... | isc |
awm/dmr5200 | dmr5200.py | 1 | 3719 | # -*- coding: utf-8 -*-
import io
import time
import serial
import select
class Dmr5200(object):
"""
Representation of a connection to a DMR-5200 digital multimeter.
"""
def __init__(self, port, timeout=2):
"""
Opens the serial connection to the meter.
port - The platfor... | bsd-3-clause |
repotvsupertuga/tvsupertuga.repository | script.module.submundo.addon/pkcs7.py | 111 | 1943 | import binascii
import StringIO
class PKCS7Encoder(object):
'''
RFC 2315: PKCS#7 page 21
Some content-encryption algorithms assume the
input length is a multiple of k octets, where k > 1, and
let the application define a method for handling inputs
whose lengths are not a multiple of k octets. F... | gpl-2.0 |
hfp/tensorflow-xsmm | tensorflow/contrib/text/python/ops/skip_gram_ops.py | 76 | 21608 | # 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 |
Vauxoo/account-payment | res_currency_print_on_check/__init__.py | 1 | 1030 | # -*- coding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# Copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
JensTimmerman/radical.pilot | examples/tutorial/coupled_tasks.py | 1 | 8504 | #!/usr/bin/env python
__copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu"
__license__ = "MIT"
import sys
import radical.pilot as rp
""" DESCRIPTION: Tutorial 3: Coupled Tasks
For every task A1 and B1 a C1 is started.
"""
# READ: The RADICAL-Pilot documentation:
# http://radicalpilot.readthedocs.... | mit |
googleapis/python-managed-identities | google/cloud/managedidentities/__init__.py | 1 | 2912 | # -*- 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 |
gxyang/hstore | third_party/cpp/protobuf/python/setup.py | 40 | 4737 | #! /usr/bin/python
#
# See README for usage instructions.
# We must use setuptools, not distutils, because we need to use the
# namespace_packages option for the "google" package.
from ez_setup import use_setuptools
use_setuptools()
from setuptools import setup
from distutils.spawn import find_executable
import sys
i... | gpl-3.0 |
wimac/home | Dropbox/skel/bin/sick-beard/cherrypy/_cpthreadinglocal.py | 36 | 6855 | # This is a backport of Python-2.4's threading.local() implementation
"""Thread-local objects
(Note that this module provides a Python version of thread
threading.local class. Depending on the version of Python you're
using, there may be a faster one available. You should always import
the local class fro... | gpl-2.0 |
trolldbois/python-haystack | test/haystack/test_argparse_utils.py | 1 | 1657 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import unittest
import sys
import argparse
from haystack import argparse_utils
class Test(unittest.TestCase):
def test_readable(self):
"""test the readable helper."""
invalid = '/345678ui0d9t921giv9'
self.assertRaises(argpars... | gpl-3.0 |
mzdaniel/oh-mainline | vendor/packages/Django/tests/modeltests/model_inheritance/models.py | 118 | 3888 | """
XX. Model inheritance
Model inheritance exists in two varieties:
- abstract base classes which are a way of specifying common
information inherited by the subclasses. They don't exist as a separate
model.
- non-abstract base classes (the default), which are models in their own
right with ... | agpl-3.0 |
Entropy512/libsigrokdecode | decoders/z80/__init__.py | 6 | 1318 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2014 Daniel Elstner <daniel.kitta@gmail.com>
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of... | gpl-3.0 |
eengl/pytdlpack | test/test_create_new_grid.py | 1 | 2265 | #!/usr/bin/env python3
# ----------------------------------------------------------------------------------------
# Import Modules
# ----------------------------------------------------------------------------------------
import numpy as np
import setuptools
import sys
platform = setuptools.distutils.util.get_platf... | gpl-3.0 |
Jumpscale/jumpscale_portal8 | apps/gridportal/base/Grid/.macros/page/adminjumpscripts/3_adminjumpscripts.py | 1 | 1480 | def main(j, args, params, tags, tasklet):
def _formatdata(jumpscripts):
aaData = list()
for name, jumpscript in jumpscripts.items():
itemdata = ['<a href=adminjumpscript?name=%s>%s</a>' % (name, name)]
for field in ['organization', 'version', 'descr']: #code
i... | apache-2.0 |
ingokegel/intellij-community | python/helpers/pycharm/buildout_engulfer.py | 85 | 1225 | # Expects two env variables:
# PYCHARM_ENGULF_SCRIPT = which script should be engulfed.
# PYCHARM_PREPEND_SYSPATH = which entries should be added to the beginning of sys.path;
# items must be separated by path separator. May be unset.
#
# Given script is loaded and compiled, then sys.path is prepended as requested.... | apache-2.0 |
CTFd/CTFd | tests/api/v1/users/test_scoring.py | 4 | 1454 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from CTFd.models import Users
from CTFd.utils import set_config
from tests.helpers import (
create_ctfd,
destroy_ctfd,
login_as_user,
register_user,
simulate_user_activity,
)
def test_api_user_place_hidden_if_scores_hidden():
"""/api/v1/users/me s... | apache-2.0 |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | .meteor/local/dev_bundle/python/Lib/colorsys.py | 1066 | 3691 | """Conversion functions between RGB and other color systems.
This modules provides two functions for each color system ABC:
rgb_to_abc(r, g, b) --> a, b, c
abc_to_rgb(a, b, c) --> r, g, b
All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly... | gpl-3.0 |
gauravbose/digital-menu | django/templatetags/static.py | 250 | 4055 | from django import template
from django.utils.encoding import iri_to_uri
from django.utils.six.moves.urllib.parse import urljoin
register = template.Library()
class PrefixNode(template.Node):
def __repr__(self):
return "<PrefixNode for %r>" % self.name
def __init__(self, varname=None, name=None):
... | bsd-3-clause |
kvar/ansible | lib/ansible/plugins/httpapi/fortios.py | 11 | 5606 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
epam/JDI | Python/Test/jdi_uitest_web_examples/main/site/epam/epam_site.py | 3 | 1872 | from JDI.core.interfaces.check_page_types import CheckPageTypes
from JDI.web.selenium.elements.api_interact.find_element_by import By
from JDI.web.selenium.elements.common.button import Button
from JDI.web.selenium.elements.complex.menu import Menu
from JDI.web.selenium.elements.composite.web_site import WebSite
from T... | gpl-3.0 |
RyanDJLee/pyta | nodes/AsyncFunctionDef.py | 1 | 1078 | """
AsyncFunctionDef astroid node
Subclass of FunctionDef astroid node. An async def function definition and used
for async astroid nodes like AsyncFor and AsyncWith.
Attributes:
- name (str)
- The function's name.
- args (Arguments)
- An arguments node. See Arguments.py for more... | gpl-3.0 |
vishnugonela/devstack | tools/outfilter.py | 51 | 2650 | #!/usr/bin/env python
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# 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
#
# Unle... | apache-2.0 |
yd0str/infernal-twin | build/pip/pip/_vendor/distlib/resources.py | 224 | 10615 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import types... | gpl-3.0 |
mjpost/sacreBLEU | sacrebleu/sacrebleu.py | 1 | 17856 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2017--2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.... | apache-2.0 |
zofuthan/edx-platform | openedx/core/djangoapps/user_api/accounts/image_helpers.py | 42 | 5427 | """
Helper functions for the accounts API.
"""
import hashlib
from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
from django.core.files.storage import get_storage_class
from staticfiles.storage import staticfiles_storage
from microsite_configuration import microsite
from student.m... | agpl-3.0 |
Austen-G/BuildingBlocks | closure-library/closure/bin/calcdeps.py | 42 | 18576 | #!/usr/bin/env python
#
# Copyright 2006 The Closure Library 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
... | cc0-1.0 |
Nu3001/external_chromium_org | tools/telemetry/telemetry/unittest/system_stub.py | 35 | 4383 | # 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.
"""Provides stubs for os, sys and subprocess for testing
This test allows one to test code that itself uses os, sys, and subprocess.
"""
import os
impor... | bsd-3-clause |
KevinKazama/game | jeutennis/management/commands/tournoi2.py | 1 | 12445 | from django.core.management.base import BaseCommand, CommandError
from jeutennis.models import table_joueurs, table_match, table_tournoi
from django.utils import timezone
import datetime
import random
import time
from collections import OrderedDict
list_tournoi = []
id_tournoi = []
list_part = []
domicile = []
exterie... | gpl-3.0 |
Supermem/ibis | ibis/__init__.py | 6 | 3678 | # Copyright 2014 Cloudera 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 in writing, so... | apache-2.0 |
mermi/bedrock | tests/functional/test_newsletter.py | 2 | 1276 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
from selenium.common.exceptions import TimeoutException
from ..pages.newsletter import NewsletterPage
@... | mpl-2.0 |
drmrd/ansible | lib/ansible/modules/windows/win_dns_client.py | 52 | 2086 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'core'}
DOCUMENTATI... | gpl-3.0 |
WillGuan105/django | tests/sessions_tests/tests.py | 116 | 30900 | import base64
import os
import shutil
import string
import sys
import tempfile
import unittest
from datetime import timedelta
from django.conf import settings
from django.contrib.sessions.backends.cache import SessionStore as CacheSession
from django.contrib.sessions.backends.cached_db import \
SessionStore as Cac... | bsd-3-clause |
fireeye/flare-wmi | python-cim/samples/dump_keys.py | 1 | 1204 | import logging
from cim.common import LoggingObject
from cim import CIM
from cim import is_index_page_number_valid
logging.basicConfig(level=logging.DEBUG)
g_logger = logging.getLogger("cim.printer")
class Printer(LoggingObject):
def __init__(self, cim):
super(Printer, self).__init__()
self._cim... | apache-2.0 |
DavidNorman/tensorflow | tensorflow/python/keras/premade/wide_deep_test.py | 5 | 13485 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
moorescloud/holideck | examples/tow.py | 3 | 6430 | #/usr/bin/python
#
"""Try to open a filtered search stream
And grab the #qanda tagged tweets
Then spit out the timestamp of the tweet.
Which can then be used as an input to another script. BECAUSE MODADS.
Homepage and documentation: http://dev.moorescloud.com/
Copyright (c) 2012, Mark Pesce.
License: MIT ... | mit |
Safihre/cherrypy | cherrypy/lib/auth_basic.py | 6 | 4421 | # This file is part of CherryPy <http://www.cherrypy.org/>
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab:fileencoding=utf-8
"""HTTP Basic Authentication tool.
This module provides a CherryPy 3.x tool which implements
the server-side of HTTP Basic Access Authentication, as described in
:rfc:`2617`.
Example usage, ... | bsd-3-clause |
invisiblek/python-for-android | python3-alpha/python3-src/Lib/encodings/cp874.py | 272 | 12595 | """ Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,inpu... | apache-2.0 |
fujunwei/chromium-crosswalk | third_party/cython/src/Cython/Compiler/AutoDocTransforms.py | 96 | 8536 | from Cython.Compiler.Visitor import CythonTransform
from Cython.Compiler.StringEncoding import EncodedString
from Cython.Compiler import Options
from Cython.Compiler import PyrexTypes, ExprNodes
class EmbedSignature(CythonTransform):
def __init__(self, context):
super(EmbedSignature, self).__init__(contex... | bsd-3-clause |
WebSpider/headphones | lib/musicbrainzngs/mbxml.py | 11 | 24580 | # This file is part of the musicbrainzngs library
# Copyright (C) Alastair Porter, Adrian Sampson, and others
# This file is distributed under a BSD-2-Clause type license.
# See the COPYING file for more information.
import re
import xml.etree.ElementTree as ET
import logging
from musicbrainzngs import util
try:
... | gpl-3.0 |
CVL-GitHub/karaage | conf/settings.py | 2 | 9073 | # -*- coding: utf-8 -*-
# Globally defined Karaage settings
# These settings will be used for karaage-admin and karaage-registration.
# Some of these values have sensible defaults. Settings that don't have a
# sensible default must be configured manually.
# Other Django settings are also possible, this list is not a... | gpl-3.0 |
dengshaodong/docker-apprtc | src/third_party/oauth2client/client.py | 122 | 44282 | # Copyright (C) 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | bsd-3-clause |
tsgit/invenio | modules/bibknowledge/lib/bibknowledge_dblayer.py | 19 | 15484 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011, 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
## License, or ... | gpl-2.0 |
rgerkin/neuroConstruct | lib/jython/Lib/modjy/modjy_params.py | 109 | 2453 | ###
#
# Copyright Alan Kennedy.
#
# You may contact the copyright holder at this uri:
#
# http://www.xhaus.com/contact/modjy
#
# The licence under which this code is released is the Apache License v2.0.
#
# The terms and conditions of this license are listed in a file contained
# in the distribution that also cont... | gpl-2.0 |
Jgarcia-IAS/SITE | addons/l10n_ar/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
sebgoa/client-python | kubernetes/client/models/v1_horizontal_pod_autoscaler_status.py | 2 | 8064 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | apache-2.0 |
tejo-esperanto/pasportaservo | maps/urls.py | 3 | 1078 | from django.conf.urls import url
from django.utils.text import format_lazy
from django.utils.translation import pgettext_lazy
from .views import (
CountryDataView, EndpointsView, MapStyleView,
MapTypeConfigureView, PublicDataView, WorldMapView,
)
urlpatterns = [
url(r'^endpoints$', EndpointsView.as_view()... | agpl-3.0 |
CO600GOL/Game_of_life | GameEngine/game/data_structures/grid.py | 1 | 1632 | """
This module contains the logic representing the grid on which a game is played. A grid, in this sense, is simply a
collection cells set into rows and columns. The cells can, for the purposes of the project, only be square.
"""
from game.data_structures.cell import Cell
def create_empty_grid():
"""
This fu... | mit |
ianstalk/Flexget | flexget/components/notify/notifiers/cronitor.py | 3 | 2829 | import socket
from loguru import logger
from requests.exceptions import RequestException
from flexget import plugin
from flexget.event import event
from flexget.plugin import PluginWarning
from flexget.utils.requests import Session as RequestSession
requests = RequestSession(max_retries=3)
plugin_name = "cronitor"
... | mit |
WafaaT/spark-tk | python/sparktk/frame/ops/matrix_covariance_matrix.py | 14 | 2672 | # vim: set encoding=utf-8
# Copyright (c) 2016 Intel Corporation
#
# 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 require... | apache-2.0 |
robmcmullen/peppy | peppy/major_modes/groovy.py | 1 | 1612 | # peppy Copyright (c) 2006-2009 Rob McMullen
# Licenced under the GPLv2; see http://peppy.flipturn.org for more info
"""Groovy programming language editing support.
Major mode for editing Groovy files.
Supporting actions and minor modes should go here only if they are uniquely
applicable to this major mode and can't ... | gpl-2.0 |
ademmers/ansible | test/units/module_utils/basic/test_log.py | 120 | 7027 | # -*- coding: utf-8 -*-
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import syslog
from itertools... | gpl-3.0 |
ashemedai/ansible | lib/ansible/modules/notification/pushbullet.py | 70 | 6195 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
SHMEDIALIMITED/tallest-tower | node_modules/grunt/node_modules/gzip-js/node_modules/deflate-js/test/runner.py | 177 | 1688 | #!/usr/bin/env python
import argparse
import deflate
import inflate
from colorama import Fore
testDir = 'test-files'
outDir = 'test-outs'
allPassed = True
parser = argparse.ArgumentParser(description='Process command-line arguments')
parser.add_argument('--test', metavar='path/to/file', type=str, default='both', na... | mit |
CodEnFisH/palantir | hadoop/src/contrib/hod/testing/testRingmasterRPCs.py | 182 | 5759 | #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 |
scottferg/web-console | django/views/defaults.py | 12 | 1706 | from django import http
from django.views.decorators.csrf import requires_csrf_token
from django.template import Context, RequestContext, loader
# This can be called when CsrfViewMiddleware.process_view has not run, therefore
# need @requires_csrf_token in case the template needs {% csrf_token %}.
@requires_cs... | bsd-3-clause |
arokem/nipype | nipype/pipeline/plugins/ipythonx.py | 15 | 2973 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""Parallel workflow execution via IPython controller
"""
import sys
IPython_not_loaded = False
try:
from IPython import __version__ as IPyversion
from IPython.kernel.contexts import ConnectionRef... | bsd-3-clause |
terbolous/SickRage | lib/hachoir_core/log.py | 86 | 4235 | import os, sys, time
import hachoir_core.config as config
from hachoir_core.i18n import _
class Log:
LOG_INFO = 0
LOG_WARN = 1
LOG_ERROR = 2
level_name = {
LOG_WARN: "[warn]",
LOG_ERROR: "[err!]",
LOG_INFO: "[info]"
}
def __init__(self):
self.__buffer = {}... | gpl-3.0 |
tomster/py-transmission | setup.py | 4 | 1401 | from setuptools import setup, find_packages
# see http://peak.telecommunity.com/DevCenter/setuptools and
# http://docs.python.org/dist/meta-data.html#meta-data for setup signature
dependencies = ["BitTorrent-bencode>=5.0.8"]
setup(
name = "TransmissionClient",
version = "0.2rc1",
packages = find_packages()... | mit |
acshi/osf.io | admin/meetings/serializers.py | 4 | 2015 | from website.conferences.model import DEFAULT_FIELD_NAMES
def serialize_meeting(meeting):
is_meeting = True
if hasattr(meeting, 'is_meeting') and meeting.is_meeting is not None:
is_meeting = meeting.is_meeting
return {
'endpoint': meeting.endpoint,
'name': meeting.name,
'inf... | apache-2.0 |
kantai/passe-framework-prototype | django/views/generic/date_based.py | 246 | 14025 | import datetime
import time
from django.template import loader, RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.core.xheaders import populate_xheaders
from django.db.models.fields import DateTimeField
from django.http import Http404, HttpResponse
import warnings
warnings.warn(
'Fu... | bsd-3-clause |
joonro/PyTables | tables/description.py | 1 | 35728 | # -*- coding: utf-8 -*-
########################################################################
#
# License: BSD
# Created: September 21, 2002
# Author: Francesc Alted
#
# $Id$
#
########################################################################
"""Classes for describing columns for ``Table`` objects."""
# Im... | bsd-3-clause |
Cartrdge/thumbor-plugins | thumbor_plugins/optimizers/pngquant.py | 2 | 1448 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
import os
import subprocess
from thumbor.optimizers import BaseOptimizer
from thumbor.utils import logger
class Optimize... | mit |
azaghal/ansible | lib/ansible/plugins/lookup/dict.py | 86 | 2219 | # (c) 2014, Kent R. Spillner <kspillner@acm.org>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup: dict
version_added: "1.5"
... | gpl-3.0 |
ropik/chromium | tools/safely-roll-webkit.py | 9 | 2418 | #!/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.
"""Generate a CL to roll webkit to the specified revision number and post
it to Rietveld so that the CL will land automatically if ... | bsd-3-clause |
nzavagli/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/SQLAlchemy-1.0.6/test/orm/test_instrumentation.py | 31 | 18708 |
from sqlalchemy.testing import assert_raises, assert_raises_message
import sqlalchemy as sa
from sqlalchemy import MetaData, Integer, ForeignKey, util, event
from sqlalchemy.orm import mapper, relationship, create_session, \
attributes, class_mapper, clear_mappers, instrumentation, events
from sqlalchemy.testing.s... | mit |
sometallgit/AutoUploader | Python27/Lib/user.py | 313 | 1627 | """Hook to allow user-specified customization code to run.
As a policy, Python doesn't run user-specified code on startup of
Python programs (interactive sessions execute the script specified in
the PYTHONSTARTUP environment variable if it exists).
However, some programs or sites may find it convenient to allow users... | mit |
lnielsen/invenio | invenio/modules/ranker/registry.py | 4 | 1415 | # -*- coding: utf-8 -*-
#
## This file is part of Invenio.
## Copyright (C) 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your opti... | gpl-2.0 |
40223136/w17test2 | static/Brython3.1.3-20150514-095342/Lib/abc.py | 765 | 8057 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) according to PEP 3119."""
from _weakrefset import WeakSet
def abstractmethod(funcobj):
"""A decorator indicating abstract methods.
Requires that the metaclass is ABCMeta or der... | gpl-3.0 |
tymofij/adofex | transifex/addons/cla/views.py | 1 | 3292 | from django.contrib import messages
from django.contrib.auth.models import User
from django.contrib.auth.decorators import login_required
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import HttpResponse, HttpResponseRedirect
from django.template import RequestContext
from... | gpl-3.0 |
beav/pulp | server/pulp/server/managers/auth/role/cud.py | 1 | 13478 | # -*- coding: utf-8 -*-
#
# Copyright © 2012 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public
# License as published by the Free Software Foundation; either version
# 2 of the License (GPLv2) or (at your option) any later version.
# There is NO WARRANTY for this software, express or impli... | gpl-2.0 |
varunkothamachu/seldon-server | external/predictor/python/docker/vw_train/scripts/vw_train.py | 5 | 1982 | import sys, getopt, argparse
from seldon.vw import *
import json
if __name__ == '__main__':
parser = argparse.ArgumentParser(prog='vw')
parser.add_argument('--client', help='client', required=True)
parser.add_argument('--zkHosts', help='zookeeper')
parser.add_argument('--inputPath', help='input base f... | apache-2.0 |
RackSec/ansible | lib/ansible/modules/utilities/logic/wait_for.py | 11 | 21920 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
#
# 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 Licens... | gpl-3.0 |
mtconley/turntable | test/lib/python2.7/site-packages/scipy/ndimage/morphology.py | 16 | 79457 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | mit |
gfonk/ansible | contrib/inventory/freeipa.py | 95 | 2201 | #!/usr/bin/env python
import argparse
from ipalib import api
import json
def initialize():
'''
This function initializes the FreeIPA/IPA API. This function requires
no arguments. A kerberos key must be present in the users keyring in
order for this to work.
'''
api.bootstrap(context='cli')
... | gpl-3.0 |
ageron/tensorflow | tensorflow/python/kernel_tests/reduction_ops_test_big.py | 30 | 8764 | # 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 |
knehez/edx-platform | common/djangoapps/track/backends/mongodb.py | 41 | 3046 | """MongoDB event tracker backend."""
from __future__ import absolute_import
import logging
import pymongo
from pymongo import MongoClient
from pymongo.errors import PyMongoError
from bson.errors import BSONError
from track.backends import BaseBackend
log = logging.getLogger(__name__)
class MongoBackend(BaseBack... | agpl-3.0 |
yewang15215/django | tests/template_tests/test_nodelist.py | 173 | 3234 | from unittest import TestCase
from django.template import Context, Engine
from django.template.base import TextNode, VariableNode
from django.utils import six
class NodelistTest(TestCase):
@classmethod
def setUpClass(cls):
cls.engine = Engine()
super(NodelistTest, cls).setUpClass()
def ... | bsd-3-clause |
JamesLinEngineer/RKMC | addons/plugin.video.salts/scrapers/hevcbluray_scraper.py | 1 | 4696 | """
SALTS XBMC Addon
Copyright (C) 2014 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
T... | gpl-2.0 |
snasoft/QtCreatorPluginsPack | Bin/3rdParty/vera/bin/lib/multiprocessing/dummy/connection.py | 168 | 2807 | #
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditi... | lgpl-3.0 |
jkankiewicz/kivy | kivy/gesture.py | 23 | 14633 | '''
Gesture recognition
===================
This class allows you to easily create new
gestures and compare them::
from kivy.gesture import Gesture, GestureDatabase
# Create a gesture
g = Gesture()
g.add_stroke(point_list=[(1,1), (3,4), (2,1)])
g.normalize()
# Add it to the database
gdb ... | mit |
qwertyjune/BethSaidaBible | venv/lib/python2.7/site-packages/django/contrib/gis/forms/fields.py | 74 | 4444 | from __future__ import unicode_literals
from django import forms
from django.utils.translation import ugettext_lazy as _
# While this couples the geographic forms to the GEOS library,
# it decouples from database (by not importing SpatialBackend).
from django.contrib.gis.geos import GEOSException, GEOSGeometry
from .... | gpl-3.0 |
mbauskar/frappe | frappe/website/doctype/website_slideshow/website_slideshow.py | 3 | 1134 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.model.document import Document
class WebsiteSlideshow(Document):
def validate(... | mit |
pein0119/shadowsocks | shadowsocks/lru_cache.py | 983 | 4290 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | apache-2.0 |
shirou/ansible | lib/ansible/runner/connection_plugins/libvirt_lxc.py | 45 | 4987 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
lianasyrkett/CodeU-Summer-2017 | build.py | 11 | 5144 | #!/usr/bin/python
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the 'License');
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.