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 |
|---|---|---|---|---|---|
sileht/deb-openstack-nova | nova/volume/nexenta/jsonrpc.py | 6 | 3208 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Nexenta Systems, 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.apa... | apache-2.0 |
GoIncremental/gi-ansible | inventory/digital_ocean.py | 1 | 19937 | #!/usr/bin/env python
'''
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
d... | apache-2.0 |
liang42hao/bokeh | bokeh/models/axes.py | 10 | 6000 | """ Guide renderers for various kinds of axes that can be added to
Bokeh plots
"""
from __future__ import absolute_import
from ..properties import abstract
from ..properties import Int, Float, String, Enum, Bool, Datetime, Auto, Instance, Tuple, Either, Include
from ..mixins import LineProps, TextProps
from ..enums i... | bsd-3-clause |
yveskaufmann/Naive-Bayes | NaiveBayes/BagOfWords.py | 1 | 1801 | class BagOfWords(object):
"""
Implementing a bag of words, words corresponding with their frequency of usages in a "document"
for usage by the Document class, DocumentClass class and the Pool class.
"""
def __init__(self):
self.__number_of_words = 0
self.__bag_of_words = {}
de... | mit |
losnikitos/googleads-python-lib | examples/dfa/v1_20/get_placement_strategies.py | 4 | 1958 | #!/usr/bin/python
#
# Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
slvnperron/luigi | test/set_task_name_test.py | 73 | 1263 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
sestrella/ansible | lib/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.py | 38 | 23040 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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 |
mavit/ansible-modules-extras | system/osx_defaults.py | 15 | 14081 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, GeekChimp - Franck Nijhof <franck@geekchimp.com>
#
# 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 you... | gpl-3.0 |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.2/django/template/loaders/app_directories.py | 65 | 2766 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.utils.... | mit |
michhar/flask-webapp-aml | env1/Lib/site-packages/werkzeug/contrib/fixers.py | 259 | 10183 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.fixers
~~~~~~~~~~~~~~~~~~~~~~~
.. versionadded:: 0.5
This module includes various helpers that fix bugs in web servers. They may
be necessary for some versions of a buggy web server but not others. We try
to stay updated with the status of the bug... | mit |
dkubiak789/odoo | addons/hr_payroll/report/report_contribution_register.py | 377 | 3380 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
nyuszika7h/youtube-dl | youtube_dl/extractor/digiteka.py | 64 | 3509 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import int_or_none
class DigitekaIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?(?:digiteka\.net|ultimedia\.com)/
(?:
deliver/
(?P<embed_type>
... | unlicense |
lmazuel/azure-sdk-for-python | azure-mgmt-consumption/azure/mgmt/consumption/models/__init__.py | 1 | 2327 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
Godiyos/python-for-android | python-modules/twisted/twisted/internet/gtk2reactor.py | 56 | 13401 | # -*- test-case-name: twisted.internet.test -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module provides support for Twisted to interact with the glib/gtk2
mainloop.
In order to use this support, simply do the following::
| from twisted.internet import gtk2reac... | apache-2.0 |
xR86/ml-stuff | labs-AI/hw-lab5/pawn_chess.py | 1 | 14528 | # /usr/bin/python
'''
Based on
Representing a chess set in Python
Part 2
Brendan Scott
https://python4kids.brendanscott.com/2013/04/28/a-different-view-on-our-chess-model/
'''
import Tkinter as tk
from Tkinter import PhotoImage
import os.path
import os
# column_reference = "1 2 3 4 5 6 7 8".split(" ")
column_refere... | mit |
alexjc/pylearn2 | pylearn2/optimization/linear_cg.py | 49 | 2914 | """
.. todo::
WRITEME
"""
import theano
from theano import tensor
from theano.ifelse import ifelse
def linear_cg(fn, params, tol=1e-3, max_iters=1000, floatX=None):
"""
Minimizes a POSITIVE DEFINITE quadratic function via linear conjugate
gradient using the R operator to avoid explicitly representing ... | bsd-3-clause |
dsroche/flint2 | build.vc14/build_tests/_msvccompiler.py | 2 | 21781 | """distutils._msvccompiler
Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.
The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
"""
# Written by Perry Stoll
# ... | lgpl-2.1 |
encbladexp/ansible | test/units/module_utils/basic/test_sanitize_keys.py | 35 | 2615 | # -*- coding: utf-8 -*-
# (c) 2020, Red Hat
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import pytest
from ansible.module_utils.basic import sanitize_... | gpl-3.0 |
dezynetechnologies/odoo | addons/hr_evaluation/report/hr_evaluation_report.py | 313 | 4181 | # -*- 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 |
waseem18/oh-mainline | mysite/missions/tar/forms.py | 15 | 1112 | # This file is part of OpenHatch.
# Copyright (C) 2010 Jack Grigg
# Copyright (C) 2010 John Stumpo
# Copyright (C) 2010, 2011 OpenHatch, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundat... | agpl-3.0 |
Azure/azure-sdk-for-python | sdk/edgegateway/azure-mgmt-edgegateway/azure/mgmt/edgegateway/models/arm_base_model.py | 1 | 1384 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
sgerhart/ansible | lib/ansible/plugins/action/sros.py | 21 | 3325 | #
# (c) 2016 Red Hat Inc.
#
# 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 d... | mit |
mirror/wget | testenv/Test--rejected-log.py | 11 | 2899 | #!/usr/bin/env python3
from sys import exit
from test.http_test import HTTPTest
from misc.wget_file import WgetFile
"""
This test executed Wget in recursive mode with a rejected log outputted.
"""
############# File Definitions ###############################################
mainpage = """
<html>
<head>
<title>M... | gpl-3.0 |
deathping1994/sendmail-api | venv/lib/python2.7/site-packages/pip/locations.py | 184 | 6644 | """Locations where we look for configs, install stuff, etc"""
from __future__ import absolute_import
import getpass
import os
import os.path
import site
import sys
from distutils import sysconfig
from distutils.command.install import install, SCHEME_KEYS # noqa
from pip.compat import WINDOWS
from pip.utils import a... | apache-2.0 |
kivatu/kivy-bak | kivy/uix/popup.py | 8 | 6347 | '''
Popup
=====
.. versionadded:: 1.0.7
.. image:: images/popup.jpg
:align: right
The :class:`Popup` widget is used to create modal popups. By default, the popup
will cover the whole "parent" window. When you are creating a popup, you
must at least set a :attr:`Popup.title` and :attr:`Popup.content`.
Remember t... | mit |
kenshay/ImageScripter | Script_Runner/PYTHON/Lib/distutils/command/build_scripts.py | 53 | 6232 | """distutils.command.build_scripts
Implements the Distutils 'build_scripts' command."""
import os, re
from stat import ST_MODE
from distutils import sysconfig
from distutils.core import Command
from distutils.dep_util import newer
from distutils.util import convert_path, Mixin2to3
from distutils import log
import tok... | gpl-3.0 |
IGITUGraz/scoop | examples/object.py | 5 | 1424 | #
# This file is part of Scalable COncurrent Operations in Python (SCOOP).
#
# SCOOP is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of
# the License, or (at your option)... | lgpl-3.0 |
lightd22/smartDraft | src/data/database_ops.py | 1 | 15164 | import sqlite3
import re
from .champion_info import champion_id_from_name,champion_name_from_id, convert_champion_alias, AliasException
regionsDict = {"NA_LCS":"NA", "EU_LCS":"EU", "LCK":"LCK", "LPL":"LPL",
"LMS":"LMS", "International":"INTL", "NA_ACA": "NA_ACA", "KR_CHAL":"KR_CHAL", "LDL":"LDL"}
inter... | apache-2.0 |
mikalstill/nova | nova/conf/cinder.py | 1 | 4043 | # Copyright (c) 2016 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 |
zofuthan/edx-platform | openedx/core/djangoapps/user_api/accounts/serializers.py | 37 | 10047 | from rest_framework import serializers
from django.contrib.auth.models import User
from django.conf import settings
from django.core.urlresolvers import reverse
from openedx.core.djangoapps.user_api.accounts import NAME_MIN_LENGTH
from openedx.core.djangoapps.user_api.serializers import ReadOnlyFieldsSerializerMixin
f... | agpl-3.0 |
poulpito/Flexget | flexget/tests/test_feed_control.py | 13 | 2291 | from __future__ import unicode_literals, division, absolute_import
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
import pytest
class TestOnlyTask(object):
"""
Test --task option
"""
config = """
tasks:
test:
mock:
- {t... | mit |
Xeralux/tensorflow | tensorflow/user_ops/invalid_op_test.py | 146 | 1217 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
wbchen99/bitcoin-hnote0 | contrib/seeds/generate-seeds.py | 71 | 4378 | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the directory tha... | mit |
FedoraScientific/salome-paravis | test/VisuPrs/Plot3D/E3.py | 1 | 1493 | # Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library ... | lgpl-2.1 |
hsaputra/tensorflow | tensorflow/python/data/kernel_tests/shard_dataset_op_test.py | 42 | 4218 | # 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 |
Giftingnation/GN-Oscar-Custom | oscar/apps/order/migrations/0008_auto__add_field_orderdiscount_category.py | 16 | 33182 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'OrderDiscount.category'
... | bsd-3-clause |
agiliq/nginx-python-buildpack | vendor/pip-1.5.4/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## 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 |
moijes12/oh-mainline | vendor/packages/oauthlib/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py | 71 | 11201 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
from ..tokens import BearerToken
from ..grant_types import AuthorizationCodeG... | agpl-3.0 |
popazerty/blackhole-vuplus | lib/python/Components/Converter/BhExtraInfo.py | 12 | 12707 | # shamelessly copied from pliExpertInfo (Vali, Mirakels, Littlesat)
from enigma import iServiceInformation, iPlayableService
from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.config import config
from Tools.Transponder import ConvertToHumanReadable, getChannelNu... | gpl-2.0 |
alanaberdeen/coupled-minimum-cost-flow-track | cmcft/tools/params/c_cost.py | 1 | 2405 | # c_cost.py
# Cost vector for edges in coupled matrix
import numpy as np
__all__ = ["c_cost"]
def c_cost(g, a_coup, a_vertices):
# TODO: think this function is slow. Check for performance increases.
# c_cost
# creates vector of costs for edges
#
# Inputs: g - graph structure
# ... | mit |
QijunPan/ansible | lib/ansible/modules/network/basics/uri.py | 7 | 17956 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Romeo Theriault <romeot () hawaii.edu>
#
# 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 th... | gpl-3.0 |
RafRaf/django-post_office | post_office/tests/test_cache.py | 12 | 1437 | from django.conf import settings
from django.test import TestCase
from post_office import cache
from ..settings import get_cache_backend
class CacheTest(TestCase):
def test_get_backend_settings(self):
"""Test basic get backend function and its settings"""
# Sanity check
self.assertTrue('... | mit |
stylight/python-fastbill | tests/test_api.py | 1 | 6430 | #!/usr/bin/env python
# encoding: utf-8
import datetime
import decimal
import httpretty
import json
import unittest
# Set the endpoint to http because some library combination
# leads to a SSLError when running the test with httpretty.
api_endpoint = "http://automatic.fastbill.com/api/1.0/api.php"
api_email = "fastb... | mit |
wenfengliaoshuzhai/linux | tools/perf/util/setup.py | 766 | 1540 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... | gpl-2.0 |
varigit/VAR-SOM-AMx3-Kernel-4-1 | scripts/gdb/linux/tasks.py | 367 | 2552 | #
# gdb helper commands and functions for Linux kernel debugging
#
# task & thread tools
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
task_type = utils.CachedType(... | gpl-2.0 |
godfreyy/scrapy | tests/test_downloadermiddleware_decompression.py | 133 | 1851 | from unittest import TestCase, main
from scrapy.http import Response, XmlResponse
from scrapy.downloadermiddlewares.decompression import DecompressionMiddleware
from scrapy.spiders import Spider
from tests import get_testdata
from scrapy.utils.test import assert_samelines
def _test_data(formats):
uncompressed_bod... | bsd-3-clause |
pedro2d10/SickRage-FR | tests/sickrage_tests/show/history_tests.py | 4 | 2948 | # coding=utf-8
# This file is part of SickRage.
#
# URL: https://SickRage.GitHub.io
# Git: https://github.com/SickRage/SickRage.git
#
# 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... | gpl-3.0 |
Mistobaan/tensorflow | tensorflow/contrib/timeseries/python/timeseries/estimators.py | 23 | 19315 | # 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 |
rubencabrera/LazyLibrarian | cherrypy/test/test_routes.py | 42 | 2411 | import os
curdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
import cherrypy
from cherrypy.test import helper
import nose
class RoutesDispatchTest(helper.CPWebCase):
def setup_server():
try:
import routes
except ImportError:
raise nose.SkipTest('Install routes... | gpl-3.0 |
itoed/anaconda | pyanaconda/startup_utils.py | 18 | 3303 | #
# startup.py - code used during early startup with minimal dependencies
#
# Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) an... | gpl-2.0 |
xen0l/ansible | lib/ansible/modules/remote_management/manageiq/manageiq_provider.py | 53 | 35689 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, Daniel Korn <korndaniel1@gmail.com>
# (c) 2017, Yaacov Zamir <yzamir@redhat.com>
# 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
ANS... | gpl-3.0 |
ofgulban/scikit-image | doc/examples/edges/plot_marching_cubes.py | 2 | 2078 | """
==============
Marching Cubes
==============
Marching cubes is an algorithm to extract a 2D surface mesh from a 3D volume.
This can be conceptualized as a 3D generalization of isolines on topographical
or weather maps. It works by iterating across the volume, looking for regions
which cross the level of interest. ... | bsd-3-clause |
yasir1brahim/OLiMS | lims/content/bikaschema.py | 2 | 2392 | from dependencies.dependency import BaseSchema
from dependencies.folder import ATFolderSchema
BikaSchema = BaseSchema.copy()
# BikaSchema['id'].widget.visible = False
# BikaSchema['description'].widget.visible = False
# BikaSchema['description'].schemata = 'default'
# BikaSchema['description'].default_content_type = ... | agpl-3.0 |
steffgrez/fast-jsonrpc2 | fast_jsonrpc2/resolver.py | 1 | 2183 | """
from fast_jsonrpc import JSONRPCResolver
def foo(msg)
return 'foobar ' + str(msg)
router = {'foo': foo}
resolver = JSONRPCResolver(router)
json_request = {"jsonrpc": "2.0", "method": "foo", "params": ["toto"], "id": 1}
json_response = resolver.handle(json_request)
print json_response
-> {"jsonrpc": "2.0", "... | mit |
pwnieexpress/raspberry_pwn | src/pentest/sqlmap/extra/shutils/regressiontest.py | 7 | 5543 | #!/usr/bin/env python
# Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/)
# See the file 'doc/COPYING' for copying permission
import codecs
import inspect
import os
import re
import smtplib
import subprocess
import sys
import time
import traceback
from email.mime.multipart import MIMEMultipart
from emai... | gpl-3.0 |
ninemoreminutes/django-datatables | test_project/settings.py | 1 | 2955 | # Python
import os
import sys
# Django
from django.conf import global_settings
# Update this module's local settings from the global settings module.
this_module = sys.modules[__name__]
for setting in dir(global_settings):
if setting == setting.upper():
setattr(this_module, setting, getattr(global_setting... | bsd-3-clause |
anistark/mozillians | vendor-local/lib/python/tablib/packages/odf3/number.py | 56 | 3137 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | bsd-3-clause |
greguu/linux-4.9-rc3-c3x00 | tools/perf/python/twatch.py | 625 | 2726 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
aestrivex/mne-python | mne/io/matrix.py | 21 | 4495 | # Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
#
# License: BSD (3-clause)
from .constants import FIFF
from .tag import find_tag, has_tag
from .write import (write_int, start_block, end_block, write_float_matrix,
write_n... | bsd-3-clause |
arista-eosplus/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_role.py | 36 | 6840 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
#
# 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 opti... | gpl-3.0 |
wmbutler/courtlistener | alert/opinion_page/sitemap.py | 2 | 2353 | from django.conf import settings
from django.http import HttpResponse
from django.template import loader
from django.utils.encoding import smart_str
from alert.lib import sunburnt
from alert.sitemap import items_per_sitemap
def opinion_sitemap_maker(request):
conn = sunburnt.SolrInterface(settings.SOLR_OPINION_U... | agpl-3.0 |
tonyseek/shadowsocks | shadowsocks/manager.py | 925 | 9692 | #!/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 |
mSenyor/kivy | kivy/uix/label.py | 20 | 26186 | '''Label
=====
The :class:`Label` widget is for rendering text. It supports ascii and unicode
strings::
# hello world text
l = Label(text='Hello world')
# unicode text; can only display glyphs that are available in the font
l = Label(text=u'Hello world ' + unichr(2764))
# multiline text
l = ... | mit |
raincoatrun/data | bob-ross/cluster-paintings.py | 40 | 1834 | """
Clusters Bob Ross paintings by features.
By Walter Hickey <walter.hickey@fivethirtyeight.com>
See http://fivethirtyeight.com/features/a-statistical-analysis-of-the-work-of-bob-ross/
"""
import numpy as np
from scipy.cluster.vq import vq, kmeans, whiten
import math
import csv
def main():
# load data into ve... | mit |
saimn/astropy | astropy/io/ascii/tests/test_rst.py | 8 | 4954 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import StringIO
from astropy.io import ascii
from .common import (assert_equal, assert_almost_equal)
def assert_equal_splitlines(arg1, arg2):
assert_equal(arg1.splitlines(), arg2.splitlines())
def test_read_normal():
"""Normal SimpleR... | bsd-3-clause |
valkjsaaa/sl4a | python/gdata/samples/blogger/BloggerExample.py | 128 | 9636 | #!/usr/bin/python
#
# Copyright (C) 2009 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 ... | apache-2.0 |
StefanRijnhart/odoo | addons/analytic/wizard/account_analytic_cost_ledger_for_journal_report.py | 378 | 2209 | # -*- 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 |
gonboy/sl4a | python/src/Tools/pybench/Imports.py | 45 | 2947 | from pybench import Test
# First imports:
import os
import package.submodule
class SecondImport(Test):
version = 2.0
operations = 5 * 5
rounds = 40000
def test(self):
for i in xrange(self.rounds):
import os
import os
import os
import os
... | apache-2.0 |
dan-blanchard/conda-build | versioneer.py | 39 | 40346 |
# Version: 0.14
"""
The Versioneer
==============
* like a rocketeer, but for versions!
* https://github.com/warner/python-versioneer
* Brian Warner
* License: Public Domain
* Compatible With: python2.6, 2.7, 3.2, 3.3, 3.4, and pypy
* [![Latest Version]
(https://pypip.in/version/versioneer/badge.svg?style=flat)
](ht... | bsd-3-clause |
sfu-fas/coursys | faculty/event_types/career.py | 1 | 27177 | import fractions
import itertools
from django import forms
from django.utils.safestring import mark_safe
from django.http import HttpResponse
from faculty.event_types import fields, search
from faculty.event_types.base import BaseEntryForm
from faculty.event_types.base import CareerEventHandlerBase
from faculty.event... | gpl-3.0 |
rajendrakrp/GeoMicroFormat | django/template/loaders/cached.py | 229 | 2469 | """
Wrapper class that takes a list of template loaders as an argument and attempts
to load templates from them in order, caching the result.
"""
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader, get_template_fro... | bsd-3-clause |
iulian787/spack | var/spack/repos/builtin/packages/netlib-lapack/package.py | 5 | 8467 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class NetlibLapack(CMakePackage):
"""LAPACK version 3.X is a comprehensive FORTRAN library that ... | lgpl-2.1 |
eeshangarg/oh-mainline | vendor/packages/twisted/twisted/names/client.py | 19 | 29970 | # -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Asynchronous client DNS
The functions exposed in this module can be used for asynchronous name
resolution and dns queries.
If you need to create a resolver with specific requirements, s... | agpl-3.0 |
marcelovilaca/DIRAC | Interfaces/scripts/dirac-wms-job-peek.py | 6 | 1198 | #!/usr/bin/env python
########################################################################
# $HeadURL$
# File : dirac-wms-job-delete
# Author : Stuart Paterson
########################################################################
"""
Peek StdOut of the given DIRAC job
"""
__RCSID__ = "$Id$"
import DIRAC
fr... | gpl-3.0 |
xodus7/tensorflow | tensorflow/contrib/factorization/python/kernel_tests/masked_matmul_benchmark.py | 136 | 5711 | # 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 |
istresearch/readthedocs.org | readthedocs/payments/forms.py | 4 | 6598 | """Payment forms"""
import logging
from stripe.resource import Customer, Charge
from stripe.error import InvalidRequestError
from django import forms
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from .utils import stripe
log = logging.getLogger(__name__)
class StripeRes... | mit |
lmorchard/gitshipped | vendor-local/lib/python/requests/packages/urllib3/packages/ordered_dict.py | 1093 | 8936 | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_ide... | bsd-3-clause |
Nu3001/external_chromium_org | tools/checkperms/checkperms.py | 34 | 13745 | #!/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.
"""Makes sure files have the right permissions.
Some developers have broken SCM configurations that flip the svn:executable
permis... | bsd-3-clause |
chyeh727/django | django/contrib/gis/db/models/proxy.py | 306 | 3034 | """
The SpatialProxy object allows for lazy-geometries and lazy-rasters. The proxy
uses Python descriptors for instantiating and setting Geometry or Raster
objects corresponding to geographic model fields.
Thanks to Robert Coup for providing this functionality (see #4322).
"""
from django.utils import six
class Spat... | bsd-3-clause |
nsiregar/moee | user.py | 10 | 7786 | import urllib
import hashlib
import re
import datetime
from werkzeug.security import check_password_hash, generate_password_hash
from flask import session
class User:
def __init__(self, default_config):
self.collection = default_config['USERS_COLLECTION']
self.username = None
self.email =... | mit |
postvakje/sympy | sympy/plotting/plot.py | 7 | 65097 | """Plotting module for Sympy.
A plot is represented by the ``Plot`` class that contains a reference to the
backend and a list of the data series to be plotted. The data series are
instances of classes meant to simplify getting points and meshes from sympy
expressions. ``plot_backends`` is a dictionary with all the bac... | bsd-3-clause |
ulif/pulp | common/pulp/common/error_codes.py | 1 | 9417 | from collections import namedtuple
from gettext import gettext as _
Error = namedtuple('Error', ['code', 'message', 'required_fields'])
"""
The error named tuple has 4 components:
code: The 7 character uniquely identifying code for this error, 3 A-Z identifying the module
followed by 4 numeric characters for th... | gpl-2.0 |
astorije/ansible-modules-extras | cloud/centurylink/clc_modify_server.py | 49 | 35279 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | gpl-3.0 |
stuart-stanley/RackHD | test/tests/api/v2_0/nodes_tests.py | 1 | 20157 | from config.api2_0_config import config
from config.amqp import *
from modules.logger import Log
from modules.amqp import AMQPWorker
from modules.worker import WorkerThread, WorkerTasks
from on_http_api2_0 import ApiApi as Api
from on_http_api2_0 import rest
from datetime import datetime
from proboscis.asserts import a... | apache-2.0 |
Alwnikrotikz/sqlalchemy-migrate | migrate/tests/versioning/test_genmodel.py | 5 | 8444 | # -*- coding: utf-8 -*-
import os
import sqlalchemy
from sqlalchemy import *
from nose.tools import eq_
from migrate.versioning import genmodel, schemadiff
from migrate.changeset import schema
from migrate.tests import fixture
class TestSchemaDiff(fixture.DB):
table_name = 'tmp_schemadiff'
level = fixture... | mit |
QuincyWork/AllCodes | Python/Codes/Practice/LeetCode/211 Add and Search Word - Data structure design.py | 1 | 1913 |
# define const variable
_MAX_LETTER_SIZE = 27;
_STRING_END_TAG = '#';
class TireNode(object):
def __init__(self,x):
self.value = x
self.childNodes = {}
class WordDictionary(object):
def __init__(self):
"""
Initialize your data structure here.
"""
self.root =... | mit |
GodBlessPP/w16b_test | static/Brython3.1.3-20150514-095342/Lib/getopt.py | 845 | 7488 | """Parser for command line options.
This module helps scripts to parse the command line arguments in
sys.argv. It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--'). Long options similar to those supported by GNU software
may be used as ... | agpl-3.0 |
alianmohammad/pd-gem5-latest | src/mem/slicc/symbols/__init__.py | 82 | 2036 | # Copyright (c) 2009 The Hewlett-Packard Development Company
# 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... | bsd-3-clause |
thorwhalen/ut | stats/util.py | 1 | 2022 | __author__ = 'thor'
from numpy import zeros, argmin, array, unique, where
from scipy.spatial.distance import cdist
def _df_picker(df, x_cols, y_col):
return df[x_cols].as_matrix(), df[[y_col]].as_matrix()
def df_picker_data_prep(x_cols, y_col):
return lambda df: _df_picker(df, x_cols, y_col)
def binomial... | mit |
greyshell/linuxJuicer | badchar-detection-automated/badchar-detection-HPNNM-B.07.53.py | 1 | 8764 | #!/usr/bin/env python
# Description: Identify good and bad chars in HPNNM-B.07.53
# author: greyshell
# Script requirements: python 2.7 x86, pydbg 32bit binary, python wmi, pywin32
# Copy pydbg inside C:\Python27\Lib\site-packages\
# Copy pydasm.pyd inside C:\Python27\Lib\site-packages\pydbg\
import os
import socket... | mit |
aerophile/django | django/core/management/commands/test.py | 267 | 3933 | import logging
import os
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from django.test.utils import get_runner
class Command(BaseCommand):
help = 'Discover and run tests in the specified modules or the current directory.'
requires_system_checks = False
... | bsd-3-clause |
MarxDimitri/schmankerl | schmankerlapp/models.py | 1 | 1505 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Restaurant(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='restaurant')
name = models.CharField(max_length=500)
phone = models.CharField(max_length=500)
add... | apache-2.0 |
Fokko/incubator-airflow | airflow/ti_deps/deps/trigger_rule_dep.py | 1 | 9884 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
w1ll1am23/home-assistant | homeassistant/components/tellstick/sensor.py | 5 | 5224 | """Support for Tellstick sensors."""
from collections import namedtuple
import logging
from tellcore import telldus
import tellcore.constants as tellcore_constants
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
CONF_ID,
CONF... | apache-2.0 |
papouso/odoo | addons/crm/wizard/crm_phonecall_to_phonecall.py | 337 | 4535 | # -*- 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 |
julien78910/CouchPotatoServer | libs/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... | gpl-3.0 |
pathompongoo/ThGovJobApp | env/lib/python2.7/site-packages/sqlalchemy/testing/profiling.py | 58 | 8241 | # testing/profiling.py
# Copyright (C) 2005-2015 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
"""Profiling support for unit and performance tests.
These are special purpose... | gpl-3.0 |
azumimuo/family-xbmc-addon | script.mrknow.urlresolver/lib/urlresolver9/plugins/filehoot.py | 4 | 1629 | """
urlresolver XBMC Addon
Copyright (C) 2015 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.
... | gpl-2.0 |
nexdatas/configserver | test/NXSConfigServer_test.py | 1 | 4015 | #!/usr/bin/env python
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2012-2017 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the ... | gpl-3.0 |
simonwydooghe/ansible | test/units/cli/galaxy/test_display_collection.py | 29 | 1384 | # -*- coding: utf-8 -*-
# Copyright (c) 2020 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 pytest
from ansible.cli.galaxy import _display_collection
@pytest.fi... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.