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 |
|---|---|---|---|---|---|
jcpowermac/ansible | lib/ansible/modules/cloud/amazon/route53.py | 20 | 24080 | #!/usr/bin/python
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterf... | gpl-3.0 |
Comunitea/OCB | addons/account/wizard/account_chart.py | 271 | 5191 | # -*- 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 |
fangxingli/hue | desktop/core/ext-py/pysaml2-2.4.0/src/saml2/response.py | 31 | 38757 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import calendar
import logging
from saml2.samlp import STATUS_VERSION_MISMATCH
from saml2.samlp import STATUS_AUTHN_FAILED
from saml2.samlp import STATUS_INVALID_ATTR_NAME_OR_VALUE
from saml2.samlp import STATUS_INVALID_NAMEID_POLICY
from saml2.samlp import STATUS_NO_AUT... | apache-2.0 |
nicolargo/intellij-community | python/lib/Lib/site-packages/django/template/smartif.py | 331 | 6261 | """
Parser and utilities for the smart 'if' tag
"""
import operator
# Using a simple top down parser, as described here:
# http://effbot.org/zone/simple-top-down-parsing.htm.
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (left = lbp, right = rbp)
class TokenBase(object):
"""
Ba... | apache-2.0 |
hmflash/Cura | cura/CuraActions.py | 4 | 5131 | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
from PyQt5.QtCore import QObject, QUrl
from PyQt5.QtGui import QDesktopServices
from UM.FlameProfiler import pyqtSlot
from UM.Event import CallFunctionEvent
from UM.Application import Application
from UM.Math.Vector import... | agpl-3.0 |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_inspect.py | 53 | 19756 | import sys
import types
import unittest
import inspect
import datetime
from test.test_support import TESTFN, run_unittest
from test import inspect_fodder as mod
from test import inspect_fodder2 as mod2
# Functions tested in this suite:
# ismodule, isclass, ismethod, isfunction, istraceback, isframe, iscode,
# isbuil... | apache-2.0 |
kenshay/ImageScript | ProgramData/Android/ADB/platform-tools/systrace/catapult/devil/devil/utils/cmd_helper_test.py | 5 | 9343 | #!/usr/bin/env python
# Copyright 2013 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.
"""Tests for the cmd_helper module."""
import unittest
import subprocess
import time
from devil import devil_env
from devil.utils imp... | gpl-3.0 |
supriyasawant/gstudio | gnowsys-ndf/gnowsys_ndf/ndf/views/forum.py | 2 | 40460 | ''' -- imports from installed packages -- '''
import json
import datetime
''' -- imports from django -- '''
from django.shortcuts import render_to_response, render
from django.template import RequestContext
from django.template import Context
from django.template.defaultfilters import slugify
from django.core.urlresol... | agpl-3.0 |
kevin-coder/tensorflow-fork | tensorflow/python/keras/layers/normalization_test.py | 1 | 22900 | # 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 |
meisamhe/GPLshared | Programming/MPI — AMath 483 583, Spring 2013 1.0 documentation_files/s2.py | 1 | 1744 | import time
import threading
# @include
class SpellCheckService:
w_last = closest_to_last_word = None
lock = threading.Lock()
@staticmethod
def service(req, resp):
w = req.extract_word_to_check_from_request()
result = None
with SpellCheckService.lock:
if w == Spell... | gpl-3.0 |
2mny/mylar | lib/simplejson/tests/test_fail.py | 136 | 3555 | from unittest import TestCase
import simplejson as json
# Fri Dec 30 18:57:26 2005
JSONDOCS = [
# http://json.org/JSON_checker/test/fail1.json
'"A JSON payload should be an object or array, not a string."',
# http://json.org/JSON_checker/test/fail2.json
'["Unclosed array"',
# http://json.org/JSON_... | gpl-3.0 |
Bysmyyr/chromium-crosswalk | tools/telemetry/telemetry/internal/actions/action_runner_unittest.py | 2 | 12090 | # 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 unittest
from telemetry.core import exceptions
from telemetry import decorators
from telemetry.internal.actions import page_action
from telemetry.page... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/279_test__osx_support.py | 44 | 11831 | """
Test suite for _osx_support: shared OS X support functions.
"""
import os
import platform
import shutil
import stat
import sys
import unittest
import test.test_support
import _osx_support
@unittest.skipUnless(sys.platform.startswith("darwin"), "requires OS X")
class Test_OSXSupport(unittest.TestCase):
def ... | gpl-3.0 |
foobacca/djangocms-text-ckeditor | djangocms_text_ckeditor/models.py | 2 | 1437 | from django.db import models
from cms.models import CMSPlugin
from django.utils.html import strip_tags
from django.utils.text import truncate_words
from django.utils.translation import ugettext_lazy as _
from djangocms_text_ckeditor.utils import plugin_tags_to_id_list, replace_plugin_tags
from djangocms_text_ckeditor.h... | bsd-3-clause |
gypsymauro/gestione-cantiere | build/lib.linux-x86_64-2.7/cantiere/admin.py | 1 | 1533 | from django.contrib import admin
# Register your models here.
from .models import Squadra
from .models import StatoSegnalazione
from .models import Segnalazione
from .models import StatoIntervento
from .models import Intervento
from .models import Risorsa
from .models import InterventoRisorsa
from .models import Cost... | gpl-2.0 |
chinmaygarde/mojo | testing/legion/examples/hello_world/controller_test.py | 29 | 2268 | #!/usr/bin/env python
# Copyright 2015 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.
"""A simple host test module.
This module runs on the host machine and is responsible for creating 2
task machines, waiting for them, ... | bsd-3-clause |
willthames/ansible | lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py | 22 | 12063 | #!/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 |
dongjoon-hyun/tensorflow | tensorflow/python/util/future_api.py | 199 | 1367 | # 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 |
jackalchen/linux | scripts/gdb/linux/symbols.py | 588 | 6302 | #
# gdb helper commands and functions for Linux kernel debugging
#
# load kernel and module symbols
#
# 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
import os
import re
from linux import module... | gpl-2.0 |
jose36/plugin.video.live.ProyectoLuzDigital. | servers/vk.py | 67 | 9258 | # -*- coding: iso-8859-1 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para VK Server
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from cor... | gpl-2.0 |
mano3m/CouchPotatoServer | libs/oauthlib/common.py | 112 | 4551 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
"""
oauthlib.common
~~~~~~~~~~~~~~
This module provides data structures and utilities common
to all implementations of OAuth.
"""
import re
import urllib
import urlparse
always_safe = (u'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
u'abcdefghijklmnopqrst... | gpl-3.0 |
keedio/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf/xforms.py | 96 | 1231 | # -*- 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... | apache-2.0 |
381426068/MissionPlanner | Lib/site-packages/numpy/oldnumeric/ufuncs.py | 102 | 1231 | __all__ = ['less', 'cosh', 'arcsinh', 'add', 'ceil', 'arctan2', 'floor_divide',
'fmod', 'hypot', 'logical_and', 'power', 'sinh', 'remainder', 'cos',
'equal', 'arccos', 'less_equal', 'divide', 'bitwise_or',
'bitwise_and', 'logical_xor', 'log', 'subtract', 'invert',
'negative',... | gpl-3.0 |
proxysh/Safejumper-for-Desktop | buildlinux/env32/lib/python2.7/site-packages/Crypto/Hash/MD5.py | 123 | 2863 | # -*- coding: utf-8 -*-
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to e... | gpl-2.0 |
muntasirsyed/intellij-community | python/lib/Lib/encodings/unicode_internal.py | 827 | 1196 | """ Python 'unicode-internal' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is in... | apache-2.0 |
thanatoskira/AndroGuard | androguard/decompiler/decompiler.py | 6 | 9695 | # This file is part of Androguard.
#
# Copyright (C) 2011, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard 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 th... | lgpl-3.0 |
Kazade/NeHe-Website | google_appengine/lib/django-1.5/django/contrib/gis/geos/geometry.py | 103 | 25896 | """
This module contains the 'base' GEOSGeometry object -- all GEOS Geometries
inherit from this object.
"""
from __future__ import unicode_literals
# Python, ctypes and types dependencies.
from ctypes import addressof, byref, c_double
from django.contrib.gis import memoryview
# super-class for mutable list behavio... | bsd-3-clause |
vishrutshah/autorest | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/BodyFile/auto_rest_swagger_bat_file_service/models/error.py | 432 | 1285 | # 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 |
SembeiNorimaki/Bioinformatics | EulerianCycle.py | 1 | 1903 | # Test passed :)
# TODO: split right here before the conditional.
import sys
def handle_input_output():
# handle input
graph = {}
while True:
try:
line = sys.stdin.readline().rstrip('\n')
left, right = line.split(' -> ')
if left in graph.keys():
... | mit |
dano/asyncio-sse | sse/protocol.py | 2 | 1594 | import aiohttp.server
import asyncio
import json
from . import exceptions
__all__ = ['SseServerProtocol', 'Response']
class Response(aiohttp.Response):
def send(self, data, id=None, retry=None, event=None):
assert data
if retry is not None:
self.write('retry: {0}\n'.format(retry).enc... | bsd-3-clause |
kittiu/account-payment | account_payment_return/models/payment_return.py | 1 | 15028 | # Copyright 2011-2012 7 i TRIA <http://www.7itria.cat>
# Copyright 2011-2012 Avanzosc <http://www.avanzosc.com>
# Copyright 2013 Pedro M. Baeza <pedro.baeza@tecnativa.com>
# Copyright 2014 Markus Schneider <markus.schneider@initos.com>
# Copyright 2016 Carlos Dauden <carlos.dauden@tecnativa.com>
# Copyright 2017 Luis M... | agpl-3.0 |
viniciusgama/blog_gae | django/contrib/staticfiles/finders.py | 156 | 9183 | import os
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import default_storage, Storage, FileSystemStorage
from django.utils.datastructures import SortedDict
from django.utils.functional import memoize, LazyObject
from django.utils.importlib impo... | bsd-3-clause |
vadimtk/chrome4sdp | tools/telemetry/third_party/gsutilz/third_party/boto/tests/unit/ec2/autoscale/test_group.py | 90 | 36594 | #!/usr/bin/env python
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without ... | bsd-3-clause |
sodexis/odoo | addons/account_payment/wizard/account_payment_order.py | 338 | 5906 | # -*- 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 |
dpshelio/sunpy | examples/units_and_coordinates/planet_locations.py | 1 | 1252 | """
===================================
Getting the location of the planets
===================================
How to get the position of planetary bodies im the solar system using
`astropy's solar system ephemeris <http://docs.astropy.org/en/stable/coordinates/solarsystem.html#solar-system-ephemerides>`__ informatio... | bsd-2-clause |
kohout/djangocms-getaweb-topstory | djangocms_topstory/south_migrations/0008_auto__chg_field_topstoryitem_object_id.py | 1 | 5765 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'TopStoryItem.object_id'
db.alter_column(u'djangocms_to... | unlicense |
nhicher/ansible | lib/ansible/modules/cloud/vmware/vmware_guest_snapshot_facts.py | 39 | 4970 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# Copyright: (c) 2018, Abhijeet Kasurde <akasurde@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__ = t... | gpl-3.0 |
mattrobenolt/pip | tests/lib/__init__.py | 7 | 17037 | from __future__ import absolute_import
import os
import sys
import re
import textwrap
import site
import scripttest
import virtualenv
from tests.lib.path import Path, curdir, u
DATA_DIR = Path(__file__).folder.folder.join("data").abspath
SRC_DIR = Path(__file__).abspath.folder.folder.folder
pyversion = sys.version... | mit |
BeATz-UnKNoWN/python-for-android | python-build/python-libs/gdata/src/atom/http.py | 136 | 10927 | #!/usr/bin/python
#
# Copyright (C) 2008 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 |
sinuos/shadowsocks | tests/test.py | 1016 | 5029 | #!/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 |
wtgme/labeldoc2vec | gensim/test/test_logentropy_model.py | 18 | 2917 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz>
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
"""
Automated tests for checking transformation algorithms (the models package).
"""
import logging
import unittest
import os
import o... | lgpl-2.1 |
kornicameister/ansible-modules-extras | cloud/openstack/os_keystone_service.py | 45 | 6224 | #!/usr/bin/python
# Copyright 2016 Sam Yaple
#
# 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 option) any later version.
#
# This software is distr... | gpl-3.0 |
manqala/erpnext | erpnext/stock/report/bom_search/bom_search.py | 86 | 1083 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
def execute(filters=None):
data = []
parents = {
"Product Bundle Item": "Product Bundle",
"BOM Explosion Item": "BOM... | gpl-3.0 |
abircse06/youtube-dl | youtube_dl/extractor/jukebox.py | 140 | 2153 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
RegexNotFoundError,
unescapeHTML,
)
class JukeboxIE(InfoExtractor):
_VALID_URL = r'^http://www\.jukebox?\..+?\/.+[,](?P<id>[a-z0-9\-]+)\.html'
_TEST = {
'url': 'http:... | unlicense |
GeraldLoeffler/nupic | tests/swarming/nupic/swarming/experiments/dummyV2/description.py | 32 | 15324 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
espressomd/espresso | testsuite/python/galilei.py | 2 | 3432 | #
# Copyright (C) 2019 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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 vers... | gpl-3.0 |
drawks/ansible | lib/ansible/modules/storage/netapp/na_ontap_nvme_namespace.py | 48 | 6502 | #!/usr/bin/python
# (c) 2019, NetApp, 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',
'status': ['preview'],
... | gpl-3.0 |
armgilles/open-moulinette | caf/scripts/PajeCom.py | 2 | 2407 | # -*- coding: utf-8 -*-
"""
Created on Fri Oct 2 13:47:48 2015
@author: GILLES Armand
"""
import pandas as pd
import glob
df = pd.read_csv('source/PajeCom2009.csv', sep=";")
df.columns = ['Communes', 'Codes_Insee', 'NB_Allocataires_2009',
'ALL_PAJE_2009', 'ALL_PRIM_2009', 'ALL_BASEP_2009',
... | mit |
wangjun/pyload | module/plugins/accounts/QuickshareCz.py | 3 | 1904 | # -*- coding: utf-8 -*-
"""
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.
This program is distributed in... | gpl-3.0 |
CodingCat/gpudb | gpudb.py | 9 | 6224 | #! /usr/bin/python
import sys
import os
import shutil
import pickle
import readline
import re
sys.path.insert(0, "XML2CODE")
import ystree
COMMANDS = ["help","create", "delete", "list", "restore", "load", "translate", "execute", "exit"]
RE_SPACE = re.compile('.*\s+$', re.M)
class cmdCompleter(object):
def _li... | apache-2.0 |
Khan/flask-wtf | tests/__init__.py | 1 | 9854 | from __future__ import with_statement
import re
from flask import Flask, Response, render_template, jsonify
from flaskext.uploads import UploadSet, IMAGES, TEXT, configure_uploads
from flaskext.testing import TestCase as _TestCase
from flaskext.wtf import Form, TextField, FileField, HiddenField, \
SubmitField... | bsd-3-clause |
nazavode/automaton | setup.py | 2 | 1811 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Federico Ficarelli
#
# 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 |
RichardWithnell/net-next-sim | tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
vlinhd11/vlinhd11-android-scripting | python/src/Lib/json/__init__.py | 57 | 12286 | r"""A simple, fast, extensible JSON encoder and decoder
JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
json exposes an API familiar to uses of the standard library
marshal and pickle modules.
Encoding basic Py... | apache-2.0 |
Djimmer/obts | Fuzzer/function_scanner.py | 1 | 6412 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import time
import binascii
import os
import sys
from libmich.formats import *
import gsm_um
import smarter_fuzzer_function_def as fuzzer
import itertools
from random import randint
from math import factorial
import logging
from pythonjsonlogger import jsonlogger... | agpl-3.0 |
jordiclariana/ansible | lib/ansible/modules/cloud/vmware/vmware_guest.py | 1 | 70396 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# This module is also sponsored by E.T.A.I. (www.etai.fr)
#
# 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... | gpl-3.0 |
PLyczkowski/Sticky-Keymap | 2.74/scripts/addons_contrib/space_view3d_cursor_control/history.py | 3 | 9299 | # -*- coding: utf-8 -*-
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# ... | gpl-2.0 |
txemi/ansible | lib/ansible/modules/network/avi/avi_applicationpersistenceprofile.py | 28 | 5571 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 16.3.8
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
gyurisc/stackjobs | clean_data.py | 1 | 1758 | # Ad-hoc fixing of mongo database
from datetime import datetime
import pymongo
client = pymongo.MongoClient('localhost', 27017)
db = client['stackoverflow']
jobs = db['jobs']
# total jobs
total_jobs = jobs.count()
print "Total jobs: %s" % total_jobs
print "=== Fixing Date Stamp ==="
date_stamp = datetime(2016, 6, ... | mit |
darren-wang/gl | glance/api/v1/controller.py | 8 | 3895 | # Copyright 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/LICENSE-2.0
#
# Unless requ... | apache-2.0 |
hhbyyh/spark | python/pyspark/shell.py | 37 | 2333 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
seem-sky/kbengine | kbe/src/lib/python/Lib/ctypes/test/test_funcptr.py | 92 | 3911 | import os, unittest
from ctypes import *
try:
WINFUNCTYPE
except NameError:
# fake to enable this test on Linux
WINFUNCTYPE = CFUNCTYPE
import _ctypes_test
lib = CDLL(_ctypes_test.__file__)
class CFuncPtrTestCase(unittest.TestCase):
def test_basic(self):
X = WINFUNCTYPE(c_int, c_int, c_int)
... | lgpl-3.0 |
nginx/unit | test/test_respawn.py | 1 | 3110 | import re
import subprocess
import time
from unit.applications.lang.python import TestApplicationPython
from unit.option import option
class TestRespawn(TestApplicationPython):
prerequisites = {'modules': {'python': 'any'}}
PATTERN_ROUTER = 'unit: router'
PATTERN_CONTROLLER = 'unit: controller'
def... | apache-2.0 |
cynapse/cynin | src/ubify.coretypes/ubify/coretypes/content/newsitem.py | 5 | 2433 | ###############################################################################
#cyn.in is an open source Collaborative Knowledge Management Appliance that
#enables teams to seamlessly work together on files, documents and content in
#a secure central environment.
#
#cyn.in v2 an open source appliance is distributed ... | gpl-3.0 |
rodo/ansible-tsung | ec2tool.py | 1 | 5117 | #!/usr/bin/env python
import boto.ec2
import jinja2
import sys
import json
import yaml
class Tsing(boto.ec2.instance.Instance):
def shortname(self):
return self.private_dns_name.split('.')[0]
@property
def private_short_name(self):
return self.private_dns_name.split('.')[0]
def get_spe... | gpl-3.0 |
marcuschia/ShaniXBMCWork | plugin.video.ZemTV-shani/pyaes.py | 33 | 17162 | """Simple AES cipher implementation in pure Python following PEP-272 API
Homepage: https://bitbucket.org/intgr/pyaes/
The goal of this module is to be as fast as reasonable in Python while still
being Pythonic and readable/understandable. It is licensed under the permissive
MIT license.
Hopefully the code is... | gpl-2.0 |
bbci/pyff | src/Feedbacks/HexoSpeller/Utils.py | 3 | 3180 | # Utils.py -
# Copyright (C) 2009-2010 Sven Daehne
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This p... | gpl-2.0 |
ktbyers/netmiko | netmiko/cisco/cisco_viptela.py | 1 | 3093 | """Subclass specific to Cisco Viptela."""
from typing import Union, Sequence, TextIO, Any
import re
from netmiko.cisco_base_connection import CiscoSSHConnection
class CiscoViptelaSSH(CiscoSSHConnection):
"""Subclass specific to Cisco Viptela."""
def session_preparation(self) -> None:
"""Prepare the ... | mit |
nemesisdesign/openwisp2 | openwisp_controller/config/controller/views.py | 1 | 14788 | import json
from ipaddress import ip_address
from django.core.exceptions import FieldDoesNotExist, ValidationError
from django.db import transaction
from django.db.models import Q
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from django.views.generic.base im... | gpl-3.0 |
pinax/pinax-blog | pinax/blog/admin.py | 1 | 3056 | from functools import partial as curry
from django.contrib import admin
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from pinax.images.admin import ImageInline
from pinax.images.models import ImageSet
from .conf import settings
from .forms import AdminPostForm
from .model... | mit |
ejegg/citydash | server/shared/request.py | 3 | 2187 | from django.http import JsonResponse, HttpResponse
from django.shortcuts import render_to_response
from django.template.loader import render_to_string
import logging
import json
import re
logger = logging.getLogger("logger")
class ErrorResponse(Exception):
def __init__(self, message, data=None, status=401):
... | mit |
sander76/home-assistant | homeassistant/components/ping/device_tracker.py | 2 | 4963 | """Tracks devices by sending a ICMP echo request (ping)."""
import asyncio
from datetime import timedelta
from functools import partial
import logging
import subprocess
import sys
from icmplib import multiping
import voluptuous as vol
from homeassistant import const, util
from homeassistant.components.device_tracker ... | apache-2.0 |
mxjl620/scikit-learn | sklearn/decomposition/tests/test_sparse_pca.py | 160 | 6028 | # Author: Vlad Niculae
# License: BSD 3 clause
import sys
import numpy as np
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import ass... | bsd-3-clause |
roberthodgen/thought-jot | src/utilities.py | 1 | 2732 | """
The MIT License (MIT)
Copyright (c) 2015 Robert Hodgen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge... | mit |
gregswift/ansible | lib/ansible/plugins/callback/syslog_json.py | 54 | 2725 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import logging
import logging.handlers
import socket
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
"""
logs ansible-playbook a... | gpl-3.0 |
epuzanov/ZenPacks.community.CIMMon | ZenPacks/community/CIMMon/modeler/plugins/community/cim/SNIANetworkPortMap.py | 1 | 3274 | ################################################################################
#
# This program is part of the CIMMon Zenpack for Zenoss.
# Copyright (C) 2012 Egor Puzanov.
#
# This program can be used under the GNU General Public License version 2
# You can find full information here: http://www.zenoss.com/oss
#
###... | gpl-2.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/bs4/diagnose.py | 63 | 6747 | """Diagnostic functions, mainly for use when doing tech support."""
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__license__ = "MIT"
import cProfile
from StringIO import StringIO
from HTMLParser import HTMLParser
import bs4
from bs4 import BeautifulSoup, __vers... | bsd-3-clause |
mixxorz/wagtail | wagtail/core/migrations/0026_group_collection_permission.py | 24 | 1240 | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('auth', '0001_initial'),
('wagtailcore', '0025_collection_initial_data'),
]
operations = [
migrations.CreateModel(
name='GroupCollectionPermission... | bsd-3-clause |
manjunaths/tensorflow | tensorflow/python/util/keyword_args.py | 190 | 1657 | # 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 |
Belgabor/django | django/db/models/manager.py | 306 | 7872 | from django.utils import copycompat as copy
from django.conf import settings
from django.db import router
from django.db.models.query import QuerySet, EmptyQuerySet, insert_query, RawQuerySet
from django.db.models import signals
from django.db.models.fields import FieldDoesNotExist
def ensure_default_manager(sender, ... | bsd-3-clause |
PaulKinlan/cli-caniuse | site/app/scripts/bower_components/jsrepl-build/extern/python/reloop-closured/lib/python2.7/genericpath.py | 246 | 3015 | """
Path operations common to more than one OS
Do not use directly. The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat
__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
'getsize', 'isdir', 'isfile']
# Does a path exist?
#... | apache-2.0 |
sysalexis/kbengine | kbe/src/lib/python/Lib/xml/etree/ElementPath.py | 87 | 9791 | #
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl created
# 2003-05-28 fl added support for // etc
# 2003-08-27 fl fixed parsing of periods in element names
# 2007-09-10 fl new selection engine
# 2007-09-12 fl fix... | lgpl-3.0 |
j-carl/ansible | lib/ansible/plugins/inventory/auto.py | 53 | 2374 | # Copyright (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 = '''
name: auto
plugin_type: inventory
author:
- Matt Davis <@nitzm... | gpl-3.0 |
quokkaproject/quokka-classes | pipelines.py | 1 | 2318 | # coding: utf-8
from flask import request
from quokka.modules.cart.pipelines.base import CartPipeline
from quokka.utils import get_current_user
from .models import CourseSubscription, Subscriber
class SetSubscriber(CartPipeline):
def process(self):
name = request.form.get("name")
email = request... | mit |
jshiv/turntable | test/lib/python2.7/site-packages/numpy/distutils/fcompiler/absoft.py | 229 | 5612 |
# http://www.absoft.com/literature/osxuserguide.pdf
# http://www.absoft.com/documentation.html
# Notes:
# - when using -g77 then use -DUNDERSCORE_G77 to compile f2py
# generated extension modules (works for f2py v2.45.241_1936 and up)
from __future__ import division, absolute_import, print_function
import os
from... | mit |
scality/manila | manila/tests/api/v1/test_security_service.py | 3 | 16794 | # Copyright 2012 NetApp
# 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 applic... | apache-2.0 |
helldorado/ansible | lib/ansible/modules/remote_management/ucs/ucs_uuid_pool.py | 64 | 7272 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
ta2-1/pootle | tests/commands/find_duplicate_emails.py | 8 | 1602 | # -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import pytest
from django.core.management i... | gpl-3.0 |
florianuhlemann/p2pool_cypherfunk | p2pool/util/forest.py | 281 | 13557 | '''
forest data structure
'''
import itertools
from p2pool.util import skiplist, variable
class TrackerSkipList(skiplist.SkipList):
def __init__(self, tracker):
skiplist.SkipList.__init__(self)
self.tracker = tracker
self.tracker.removed.watch_weakref(self, lambda self, item: se... | gpl-3.0 |
insiderr/insiderr-app | ios-patches/basemodules/twisted/internet/utils.py | 31 | 8217 | # -*- test-case-name: twisted.test.test_iutils -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility methods.
"""
from __future__ import division, absolute_import
import sys, warnings
from functools import wraps
from twisted.internet import protocol, defer
from twisted.python impor... | gpl-3.0 |
walshjon/openmc | openmc/region.py | 1 | 18303 | from abc import ABCMeta, abstractmethod
from collections import OrderedDict
from collections.abc import Iterable, MutableSequence
from copy import deepcopy
import numpy as np
from openmc.checkvalue import check_type
class Region(metaclass=ABCMeta):
"""Region of space that can be assigned to a cell.
Region ... | mit |
squilter/ardupilot | Tools/autotest/arduplane.py | 1 | 85180 | #!/usr/bin/env python
# Fly ArduPlane in SITL
from __future__ import print_function
import math
import os
import time
from pymavlink import quaternion
from pymavlink import mavutil
from common import AutoTest
from common import AutoTestTimeoutException
from common import NotAchievedException
from common import Preco... | gpl-3.0 |
JelleZijlstra/cython | Cython/Compiler/Errors.py | 17 | 7277 | #
# Errors
#
from __future__ import absolute_import
try:
from __builtin__ import basestring as any_string_type
except ImportError:
any_string_type = (bytes, str)
import sys
from ..Utils import open_new_file
from . import DebugFlags
from . import Options
class PyrexError(Exception):
pass
class Pyre... | apache-2.0 |
akinaru/ffmpeg-image-sequencer | ffmpeg-appender-test.py | 1 | 3157 | #!/usr/bin/python
#####################################################################################
#####################################################################################
#
# title : ffmpeg-appender-test.py
# authors : Bertrand Martel
# copyrights : Copyright (c) 2015 Bertrand Martel
# li... | mit |
csangani/ReproducingSprout | extract_traces.py | 1 | 1317 | ## Create a network trace from the saturator output
import glob
import os
import sys
INPUT_PATH = 'raw_traces'
OUTPUT_PATH = 'cleaned_traces'
def extract_trace(filePath, targetFilePath):
with open(filePath) as f:
with open(targetFilePath, 'w+') as wf:
firstLine = True
for line in ... | mit |
sjlehtin/django | tests/queries/test_q.py | 25 | 3262 | from django.db.models import F, Q
from django.test import SimpleTestCase
class QTests(SimpleTestCase):
def test_combine_and_empty(self):
q = Q(x=1)
self.assertEqual(q & Q(), q)
self.assertEqual(Q() & q, q)
def test_combine_and_both_empty(self):
self.assertEqual(Q() & Q(), Q())... | bsd-3-clause |
meshulam/sly | deps/shapely/geos.py | 1 | 25191 | """
Proxies for the libgeos_c shared lib, GEOS-specific exceptions, and utilities
"""
import os
import re
import sys
import atexit
import logging
import threading
from ctypes import CDLL, cdll, pointer, c_void_p, c_size_t, c_char_p, string_at
from ctypes.util import find_library
from . import ftools
from .ctypes_decl... | mit |
Event38/MissionPlanner | Lib/ctypes/macholib/dyld.py | 57 | 5510 | ######################################################################
# This file should be kept compatible with Python 2.3, see PEP 291. #
######################################################################
"""
dyld emulation
"""
import os
from framework import framework_info
from dylib import dylib_inf... | gpl-3.0 |
clarkhale/external-storage | iscsi/targetd/vendor/k8s.io/kubernetes/cluster/juju/layers/kubernetes-master/lib/charms/kubernetes/flagmanager.py | 182 | 4599 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes Authors.
#
# 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 appli... | apache-2.0 |
brookehus/msmbuilder | msmbuilder/tests/test_rmsdfeaturizer.py | 9 | 8866 | import warnings
import mdtraj as md
import numpy as np
from msmbuilder.example_datasets import AlanineDipeptide
from msmbuilder.featurizer import Featurizer
from msmbuilder.featurizer import RMSDFeaturizer
class OldRMSDFeaturizer(Featurizer):
"""Featurizer based on RMSD to a series of reference frames.
Par... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.