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 |
|---|---|---|---|---|---|
greyhwndz/rethinkdb | external/v8_3.30.33.16/testing/gtest/scripts/pump.py | 2471 | 23673 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | agpl-3.0 |
jmerkow/VTK | Imaging/Core/Testing/Python/ResliceWrapOblique.py | 20 | 3383 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# this script tests vtkImageReslice with different interpolation modes,
# with the wrap-pad feature turned on and with a rotation
# Image pipeline
reader = vtk.vtkImageReader()
reader... | bsd-3-clause |
shownomercy/django | tests/custom_methods/models.py | 343 | 1265 | """
Giving models custom methods
Any method you add to a model will be available to instances.
"""
import datetime
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Article(models.Model):
headline = models.CharField(max_length=100)
... | bsd-3-clause |
Bert6623/Gedcom.Net | MyWSAT/MyWSAT35/js/fckeditor/editor/filemanager/connectors/py/fckutil.py | 54 | 4235 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2008 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... | gpl-2.0 |
eharney/cinder | cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py | 1 | 289881 | # Copyright (c) 2017 Dell Inc. or its subsidiaries.
# 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
#
# ... | apache-2.0 |
RiskSense-Ops/CVE-2016-6366 | extrabacon-2.0/scapy/layers/netflow.py | 4 | 1557 | ## This file is part of Scapy
## See http://www.secdev.org/projects/scapy for more informations
## Copyright (C) Philippe Biondi <phil@secdev.org>
## This program is published under a GPLv2 license
from scapy.fields import *
from scapy.packet import *
# Cisco Netflow Protocol version 1
class NetflowHeader(Packet):
... | mit |
willthames/ansible | test/units/modules/cloud/amazon/test_lambda.py | 42 | 11634 | #
# (c) 2017 Michael De La Rue
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible... | gpl-3.0 |
deKupini/erp | addons/warning/warning.py | 3 | 11848 | # -*- 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 |
cloudmesh/cmd3light | setup.py | 1 | 6580 | #!/usr/bin/env python
# ----------------------------------------------------------------------- #
# Copyright 2008-2010, Gregor von Laszewski #
# Copyright 2010-2013, Indiana University #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); ... | apache-2.0 |
zerobatu/edx-platform | lms/djangoapps/courseware/tests/test_group_access.py | 77 | 18063 | """
This module defines tests for courseware.access that are specific to group
access control rules.
"""
import ddt
from nose.plugins.attrib import attr
from stevedore.extension import Extension, ExtensionManager
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.fac... | agpl-3.0 |
teeple/pns_server | work/install/Python-2.7.4/Lib/lib2to3/fixes/fix_throw.py | 327 | 1586 | """Fixer for generator.throw(E, V, T).
g.throw(E) -> g.throw(E)
g.throw(E, V) -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))
g.throw("foo"[, V[, T]]) will warn about string exceptions."""
# Author: Collin Winter
# Local imports
from .. import pytree
from ..pgen2 import token
from .. im... | gpl-2.0 |
dlazz/ansible | lib/ansible/modules/monitoring/sensu_client.py | 52 | 8977 | #!/usr/bin/python
# (c) 2017, Red Hat 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 |
Jawoll/automatchthreads | modules/obsolete/match_thread.py | 1 | 2766 | from threading import Thread
from config import data as config
from modules.overgg import Overgg
from modules.pasta import Pasta
from modules.reddit import Reddit
import time
class MatchThread(Thread):
def __init__(self, url, reddit_title):
self.url = url
self.reddit_title = reddit_title
se... | mit |
nfletton/django-oscar | src/oscar/apps/dashboard/partners/views.py | 15 | 10610 | from django.contrib import messages
from django.contrib.auth.models import Permission
from django.core.urlresolvers import reverse_lazy, reverse
from django.shortcuts import get_object_or_404, redirect
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
from djang... | bsd-3-clause |
jakirkham/bokeh | sphinx/source/docs/user_guide/examples/interaction_callbacks_for_selections_lasso_mean.py | 5 | 1163 | from random import random
from bokeh.models import CustomJS, ColumnDataSource
from bokeh.plotting import figure, output_file, show
output_file("callback.html")
x = [random() for x in range(500)]
y = [random() for y in range(500)]
color = ["navy"] * len(x)
s = ColumnDataSource(data=dict(x=x, y=y, color=color))
p = fi... | bsd-3-clause |
hbrunn/OpenUpgrade | addons/sale_mrp/sale_mrp.py | 61 | 4738 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
tboyce1/home-assistant | tests/components/notify/test_pushbullet.py | 9 | 10430 | """The tests for the pushbullet notification platform."""
import json
import unittest
from unittest.mock import patch
from pushbullet import PushBullet
import requests_mock
from homeassistant.setup import setup_component
import homeassistant.components.notify as notify
from tests.common import (
assert_setup_comp... | apache-2.0 |
ruiliLaMeilleure/11ad-backhaul | src/core/examples/sample-simulator.py | 85 | 2094 | # -*- Mode:Python; -*-
# /*
# * Copyright (c) 2010 INRIA
# *
# * This program is free software; you can redistribute it and/or modify
# * it under the terms of the GNU General Public License version 2 as
# * published by the Free Software Foundation;
# *
# * This program is distributed in the hope that it will b... | gpl-2.0 |
andrejb/bitmask_client | src/leap/bitmask/services/eip/windowsvpnlauncher.py | 4 | 2426 | # -*- coding: utf-8 -*-
# windowsvpnlauncher.py
# Copyright (C) 2013 LEAP
#
# 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 versi... | gpl-3.0 |
webOS-ports/qtwebkit | Tools/Scripts/webkitpy/w3c/test_importer_unittest.py | 115 | 3011 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
#
# 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 n... | gpl-2.0 |
Salmista-94/Ninja_3.0_PyQt5 | ninja_ide/gui/tools_dock/plugin_preferences.py | 1 | 2404 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... | gpl-3.0 |
Kreiswolke/gensim | gensim/models/rpmodel.py | 14 | 4006 | #!/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
import logging
import numpy as np
from gensim import interfaces, matutils, utils
logger = logging.getLogger('gensim.models.rpmodel'... | lgpl-2.1 |
jezdez/kuma | vendor/packages/pygments/styles/borland.py | 135 | 1562 | # -*- coding: utf-8 -*-
"""
pygments.styles.borland
~~~~~~~~~~~~~~~~~~~~~~~
Style similar to the style used in the Borland IDEs.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token impo... | mpl-2.0 |
OndrejIT/pyload | module/lib/jinja2/_markupsafe/_native.py | 186 | 1148 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from jinja2._markupsafe import Markup
def escape(s):
"""Convert the characters... | gpl-3.0 |
twitter/pig | test/e2e/pig/udfs/python/stringutil.py | 36 | 1395 | #!/usr/bin/python
############################################################################
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional informati... | apache-2.0 |
2014c2g4/2015cda0623 | static/Brython3.1.3-20150514-095342/Lib/unittest/test/testmock/testcallable.py | 739 | 4234 | # Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
import unittest
from unittest.test.testmock.support import is_instance, X, SomeClass
from unittest.mock import (
Mock, MagicMock, NonCallableMagicMock,
NonCallableM... | gpl-3.0 |
yarikoptic/NiPy-OLD | nipy/neurospin/viz/activation_maps.py | 1 | 25526 | #!/usr/bin/env python
"""
Functions to do automatic visualization of activation-like maps.
For 2D-only visualization, only matplotlib is required.
For 3D visualization, Mayavi, version 3.0 or greater, is required.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# License: BSD
# Standard libr... | bsd-3-clause |
loco-odoo/localizacion_co | openerp/addons-extra/odoo-pruebas/odoo-server/addons/calendar/controllers/main.py | 329 | 3390 | import simplejson
import openerp
import openerp.http as http
from openerp.http import request
import openerp.addons.web.controllers.main as webmain
import json
class meeting_invitation(http.Controller):
@http.route('/calendar/meeting/accept', type='http', auth="calendar")
def accept(self, db, token, action, ... | agpl-3.0 |
pztrick/django-allauth | allauth/socialaccount/providers/pinterest/provider.py | 10 | 1041 | from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
class PinterestAccount(ProviderAccount):
def get_profile_url(self):
return self.account.extra_data.get('url')
def to_str(self):
dflt = super(PinterestAc... | mit |
mitocw/edx-platform | openedx/core/djangoapps/cache_toolbox/middleware.py | 4 | 6000 | """
Cache-backed ``AuthenticationMiddleware``
-----------------------------------------
``CacheBackedAuthenticationMiddleware`` is an
``django.contrib.auth.middleware.AuthenticationMiddleware`` replacement to
avoid querying the database for a ``User`` instance in each request.
Whilst the built-in ``AuthenticationMidd... | agpl-3.0 |
svebk/DeepSentiBank_memex | workflows/transform-ht-images-table-to-transition/transform-ht-images-table-to-transition.py | 1 | 5269 | import json
from datetime import datetime
import happybase
from pyspark import SparkContext, SparkConf
TTransportException = happybase._thriftpy.transport.TTransportException
def get_create_table(table_name, conn, families={'info': dict()}):
try:
# what exception would be raised if table does not exist, a... | bsd-2-clause |
retomerz/intellij-community | python/lib/Lib/linecache.py | 99 | 4070 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globals=None):
li... | apache-2.0 |
naslanidis/ansible | lib/ansible/modules/packaging/os/homebrew.py | 25 | 28245 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Andrew Dunham <andrew@du.nham.ca>
# (c) 2013, Daniel Jaouen <dcj24@cornell.edu>
# (c) 2015, Indrajit Raychaudhuri <irc+code@indrajit.com>
#
# Based on macports (Jimmy Tang <jcftang@gmail.com>)
#
# This module is free software: you can redistribute it and/or modify
... | gpl-3.0 |
joshuaburkhart/psshim | test/test.py | 73 | 12611 | #!/usr/bin/python
# Copyright (c) 2009, Andrew McNabb
# Copyright (c) 2003-2008, Brent N. Chun
import os
import sys
import shutil
import tempfile
import time
import unittest
basedir, bin = os.path.split(os.path.dirname(os.path.abspath(sys.argv[0])))
sys.path.append("%s" % basedir)
if os.getenv("TEST_HOSTS") is Non... | bsd-3-clause |
Azure/azure-linux-extensions | VMEncryption/test/console_logger.py | 4 | 1347 | #!/usr/bin/env python
#
# *********************************************************
# Copyright (c) Microsoft. All rights reserved.
#
# Apache 2.0 License
#
# You may obtain a copy of the License at
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# dis... | apache-2.0 |
fzimmermann89/pyload | module/plugins/crypter/SexuriaCom.py | 1 | 5089 | # -*- coding: utf-8 -*-
import re
from module.plugins.internal.Crypter import Crypter, create_getInfo
class SexuriaCom(Crypter):
__name__ = "SexuriaCom"
__type__ = "crypter"
__version__ = "0.11"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?sexuria\.com/(v1/)?(Pornos_Kostenlos_... | gpl-3.0 |
Foxfanmedium/python_training | OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/prompt_toolkit/terminal/win32_output.py | 15 | 19610 | from __future__ import unicode_literals
from ctypes import windll, byref, ArgumentError, c_char, c_long, c_ulong, c_uint, pointer
from ctypes.wintypes import DWORD
from prompt_toolkit.renderer import Output
from prompt_toolkit.styles import ANSI_COLOR_NAMES
from prompt_toolkit.win32_types import CONSOLE_SCREEN_BUFFER... | apache-2.0 |
minesense/VisTrails | vistrails/core/modules/source_configure.py | 2 | 2305 | # pragma: no testimport
###############################################################################
##
## Copyright (C) 2014-2016, New York University.
## Copyright (C) 2011-2014, NYU-Poly.
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is p... | bsd-3-clause |
buguelos/odoo | addons/auth_oauth/res_users.py | 157 | 4897 | import logging
import werkzeug.urls
import urlparse
import urllib2
import simplejson
import openerp
from openerp.addons.auth_signup.res_users import SignupError
from openerp.osv import osv, fields
from openerp import SUPERUSER_ID
_logger = logging.getLogger(__name__)
class res_users(osv.Model):
_inherit = 'res.... | agpl-3.0 |
2uller/LotF | App/Lib/site-packages/scipy/sparse/sparsetools/csc.py | 5 | 20059 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.4
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import ... | gpl-2.0 |
wzbozon/statsmodels | docs/sphinxext/numpy_ext/docscrape.py | 42 | 15178 | """Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from StringIO import StringIO
from warnings import warn
class Reader(object):
"""A line-based string reader.
"""
def __init__(self, data):
"""
Parameters
-----... | bsd-3-clause |
ptdtan/Ragout | ragout_api.py | 1 | 10365 |
"""
Ragout API interface for ancestral genome reconstruction
"""
import os
import sys
import shutil
import logging
import argparse
from collections import namedtuple
from copy import deepcopy
ragout_root = os.path.dirname(os.path.realpath(__file__))
lib_absolute = os.path.join(ragout_root, "lib")
sys.path.insert(0, l... | gpl-3.0 |
yashodhank/erpnext | erpnext/accounts/party_status.py | 6 | 2104 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import evaluate_filters
from frappe.desk.notifications import get_filters_for
# NOTE: if you change this also update ... | agpl-3.0 |
ilpianista/ansible | test/support/integration/plugins/modules/x509_crl_info.py | 36 | 9308 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, Felix Fontein <felix@fontein.de>
# 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': ... | gpl-3.0 |
googleads/google-ads-python | google/ads/googleads/v8/errors/types/resource_count_limit_exceeded_error.py | 1 | 1486 | # -*- 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 |
carnell69/kuma | vendor/packages/babel/messages/plurals.py | 151 | 6696 | # -*- coding: utf-8 -*-
"""
babel.messages.plurals
~~~~~~~~~~~~~~~~~~~~~~
Plural form definitions.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
from babel.core import default_locale, Locale
from operator import itemgetter
# XXX: remove this file, dupl... | mpl-2.0 |
PiotrekRutecki/perfkit | perfkitbenchmarker/benchmarks/aerospike_benchmark.py | 3 | 7578 | # 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 by applicable law or agr... | apache-2.0 |
ClearCorp-dev/odoo-clearcorp | TODO-9.0/project_event/__init__.py | 3 | 1143 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... | agpl-3.0 |
pkats15/hdt_analyzer | django_test/django_venv/Lib/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py | 678 | 9406 | import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_scheme
from .exceptions import LocationValue... | mit |
BackupGGCode/python-for-android | python3-alpha/extra_modules/pyxmpp2/settings.py | 46 | 15767 | #
# (C) Copyright 2011 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful... | apache-2.0 |
RyokoAkizuki/mtasa-blue | vendor/google-breakpad/src/tools/python/tests/filter_syms_unittest.py | 100 | 4454 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this lis... | gpl-3.0 |
dushu1203/chromium.src | ppapi/generators/idl_parser.py | 54 | 39722 | #!/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.
""" Parser for PPAPI IDL """
#
# IDL Parser
#
# The parser is uses the PLY yacc library to build a set of parsing rules based
# on... | bsd-3-clause |
LivingOn/xbmc-plugin.image.nachtschicht-bhv | addon.py | 1 | 2657 | # -*- coding=utf8 -*-
#******************************************************************************
# addon.py
#------------------------------------------------------------------------------
#
# Copyright (c) 2013 LivingOn <LivingOn@xmail.net>
#
# This program is free software; you can redistribute it and/or modify
#... | gpl-2.0 |
whereismyjetpack/ansible | lib/ansible/modules/cloud/vmware/vmware_maintenancemode.py | 48 | 5999 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, VMware, 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 o... | gpl-3.0 |
barachka/odoo | addons/web/doc/_themes/flask_theme_support.py | 2228 | 4875 | # flasky extensions. flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic, Whitespace, Punctuation, Other, Literal
class FlaskyStyle(Style):
background_color = "#f8f8f8"
default_style = "... | agpl-3.0 |
dgomezunican/network-coding-ns3 | ns-3.13/src/tap-bridge/examples/tap-wifi-virtual-machine.py | 137 | 4041 | # -*- Mode: Python; -*-
#
# Copyright 2010 University of Washington
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
# This program is distributed in the hope that it will be usefu... | gpl-2.0 |
qedi-r/home-assistant | homeassistant/components/freedns/__init__.py | 4 | 2725 | """Integrate with FreeDNS Dynamic DNS service at freedns.afraid.org."""
import asyncio
import logging
from datetime import timedelta
import aiohttp
import async_timeout
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_SCAN_INTERVAL, ... | apache-2.0 |
hnoerdli/hussa | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py | 1361 | 45045 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... | mit |
glwu/python-for-android | python-modules/twisted/twisted/internet/_threadedselect.py | 61 | 12478 | # -*- test-case-name: twisted.test.test_internet -*-
# $Id: default.py,v 1.90 2004/01/06 22:35:22 warner Exp $
#
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import generators
"""
Threaded select reactor
Maintainer: Bob Ippolito
The threadedselectreactor is a sp... | apache-2.0 |
pzhaoyang/git | contrib/fast-import/import-zips.py | 401 | 2241 | #!/usr/bin/env python
## zip archive frontend for git-fast-import
##
## For example:
##
## mkdir project; cd project; git init
## python import-zips.py *.zip
## git log --stat import-zips
from os import popen, path
from sys import argv, exit, hexversion, stderr
from time import mktime
from zipfile import ZipFile
... | gpl-2.0 |
jalavik/invenio | invenio/legacy/webcomment/adminlib.py | 13 | 30121 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2005, 2006, 2007, 2008, 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 th... | gpl-2.0 |
geodynamics/pylith | pylith/friction/obsolete/RateStateAgeing.py | 1 | 3306 | #!/usr/bin/env python
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University of Chicago
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://ge... | mit |
tarzan0820/odoo | addons/account_analytic_plans/wizard/__init__.py | 445 | 1117 | # -*- 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 |
NullNoname/dolphin | Externals/scons-local/scons-local-2.0.1/SCons/Tool/dvipdf.py | 61 | 4096 | """SCons.Tool.dvipdf
Tool-specific initialization for dvipdf.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation... | gpl-2.0 |
alanswanson/webserver | admin/plugins/fullpath.py | 5 | 4084 | # Cheroke Admin
#
# Authors:
# Alvaro Lopez Ortega <alvaro@alobbs.com>
#
# Copyright (C) 2001-2014 Alvaro Lopez Ortega
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License as published by the Free Software Foundation.
#
# Thi... | gpl-2.0 |
mikitex70/pelican-plugins | random_article/random_article.py | 76 | 2010 | # -*- coding: utf-8 -*-
"""
Random Article Plugin For Pelican
========================
This plugin generates a html file which redirect to a random article
using javascript's window.location. The generated html file is
saved at SITEURL.
"""
from __future__ import unicode_literals
import os.path
from logging import... | agpl-3.0 |
apporc/nova | nova/compute/rpcapi.py | 1 | 45182 | # Copyright 2013 Red Hat, Inc.
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... | apache-2.0 |
xpansa/server-tools | auth_admin_passkey/__init__.py | 61 | 1054 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Admin Passkey module for OpenERP
# Copyright (C) 2013-2014 GRAP (http://www.grap.coop)
# @author Sylvain LE GAL (https://twitter.com/legalsylvain)
#
# This program is free software: you can redistrib... | agpl-3.0 |
tklaus/ansible | contrib/inventory/zone.py | 138 | 1466 | #!/usr/bin/env python
# (c) 2015, Dagobert Michelsen <dam@baltic-online.de>
#
# 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
# ... | gpl-3.0 |
guettli/django | tests/middleware_exceptions/test_legacy.py | 12 | 44305 | import sys
from django.core.signals import got_request_exception
from django.http import HttpResponse
from django.template import engines
from django.template.response import TemplateResponse
from django.test import SimpleTestCase, override_settings
from django.test.utils import ignore_warnings
from django.utils.depre... | bsd-3-clause |
SkierPGP/Skier | db.py | 1 | 3077 | import datetime
from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy.dialects.postgresql import ARRAY
from app import app
db = SQLAlchemy(app)
class Key(db.Model):
"""
The model for a PGP key.
"""
id = db.Column(db.Integer, primary_key=True)
uid = db.relationship("UID", backref="key")
... | agpl-3.0 |
ndokter/dsmr_parser | dsmr_parser/clients/filereader.py | 1 | 6256 | import logging
import fileinput
import tailer
from dsmr_parser.clients.telegram_buffer import TelegramBuffer
from dsmr_parser.exceptions import ParseError, InvalidChecksumError
from dsmr_parser.objects import Telegram
from dsmr_parser.parsers import TelegramParser
logger = logging.getLogger(__name__)
class FileRead... | mit |
rednaxelafx/apache-spark | examples/src/main/python/sql/streaming/structured_network_wordcount.py | 27 | 2500 | #
# 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 |
sencha/chromium-spacewalk | tools/binary_size/PRESUBMIT.py | 52 | 1112 | # 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.
"""binary_size presubmit script
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built i... | bsd-3-clause |
ycaihua/kbengine | kbe/res/scripts/common/Lib/distutils/command/register.py | 95 | 11708 | """distutils.command.register
Implements the Distutils 'register' command (register with the repository).
"""
# created 2002/10/21, Richard Jones
import os, string, getpass
import io
import urllib.parse, urllib.request
from warnings import warn
from distutils.core import PyPIRCCommand
from distutils.errors import *... | lgpl-3.0 |
andymason/istheansweryes | lib/flask/app.py | 345 | 76786 | # -*- coding: utf-8 -*-
"""
flask.app
~~~~~~~~~
This module implements the central WSGI application object.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from threading import Lock
from datetime import timedelta
from itertools import... | apache-2.0 |
palladius/gcloud | packages/gsutil/boto/boto/mws/connection.py | 14 | 34293 | # Copyright (c) 2012 Andy Davidoff http://www.disruptek.com/
#
# 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, mod... | gpl-3.0 |
bhtucker/impyla | examples/census/categ-models/model_1500.py | 2 | 206467 | def predict_income(impala_function_context, age, workclass, final_weight, education, education_num, marital_status, occupation, relationship, race, sex, hours_per_week, native_country, income):
""" Predictor for income from model/53603192ffa04466fd000977
https://archive.ics.uci.edu/ml/machine-learning-data... | apache-2.0 |
anshitag/Job-Cred-Meter | Python Files/datacollection.py | 1 | 3030 | import requests
import json
access_token='EAAMcWZCJ7Ui4BALHXjXKkizZANG5AhQZAL9buUS5KR6fX8YurTosJLmxTfP4WoZBiP8DFe8eqbJ2NplRPGLsve2xYIwwsbERTnX5pvsiRIvJ0So1TZAHmOHlUPVnzZCBjPdZBhkm8CBnYTV0eNjAwQiBVkroQGnaqgZD'
outfile=open("list.csv","w")
def text_cleaning(text):
text = text.encode('ascii', 'ignore').... | mit |
ghber/My-Django-Nonrel | djangotoolbox/utils.py | 109 | 2725 | def make_tls_property(default=None):
"""Creates a class-wide instance property with a thread-specific value."""
class TLSProperty(object):
def __init__(self):
from threading import local
self.local = local()
def __get__(self, instance, cls):
if not instance:
... | bsd-3-clause |
nexiles/odoo | openerp/addons/base/ir/ir_http.py | 20 | 6730 | #----------------------------------------------------------
# ir_http modular http routing
#----------------------------------------------------------
import logging
import re
import sys
import werkzeug.exceptions
import werkzeug.routing
import werkzeug.urls
import werkzeug.utils
import openerp
import openerp.excepti... | agpl-3.0 |
gitenberg-dev/pg-epubmaker | epubmaker/writers/RSTWriter.py | 1 | 1259 | #!/usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*- coding: iso-8859-1 -*-
"""
RSTWriter.py
Copyright 2009 by Marcello Perathoner
Distributable under the GNU General Public License Version 3 or newer.
Build an RST file. This is just the master RST with the PG license mixed in.
"""
from __future_... | gpl-3.0 |
thomas-young-2013/wherehowsX | metadata-etl/src/main/resources/jython/requests/cookies.py | 164 | 17564 | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import copy
import time
import calendar
import collections
from .compat import cookielib, urlparse, urlunparse, Morsel
try:
import threading
... | apache-2.0 |
JacobJacob/pyew | vstruct/defs/gif.py | 25 | 2407 |
import vstruct
from vstruct.primitives import *
GIF_F_HAS_CMAP = 0x80
GIF_F_BPP_MASK = 0x07
GIF_IMG_SEP = ','
class GIF_FILE_HEADER(vstruct.VStruct):
def __init__(self):
vstruct.VStruct.__init__(self)
self.magic = v_bytes(size=6)
self.width = v_uint16()
self.heig... | gpl-2.0 |
AICP/external_chromium_org | tools/perf/metrics/v8_object_stats.py | 12 | 8250 | # 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.
import json
import logging
from metrics import Metric
_COUNTER_NAMES = [
'V8.OsMemoryAllocated',
'V8.MemoryNewSpaceBytesAvailable',
'V8.MemoryN... | bsd-3-clause |
Yukinoshita47/Yuki-Chan-The-Auto-Pentest | Module/metagoofil/hachoir_metadata/audio.py | 85 | 15467 | from hachoir_metadata.metadata import (registerExtractor,
Metadata, RootMetadata, MultipleMetadata)
from hachoir_parser.audio import AuFile, MpegAudioFile, RealAudioFile, AiffFile, FlacParser
from hachoir_parser.container import OggFile, RealMediaFile
from hachoir_core.i18n import _
from hachoir_core.tools import m... | mit |
j5shi/Thruster | pylibs/test/test_dbm.py | 13 | 1308 | from test import test_support
import unittest
dbm = test_support.import_module('dbm')
class DbmTestCase(unittest.TestCase):
def setUp(self):
self.filename = test_support.TESTFN
self.d = dbm.open(self.filename, 'c')
self.d.close()
def tearDown(self):
for suffix in [... | gpl-2.0 |
fbradyirl/home-assistant | tests/conftest.py | 2 | 5334 | """Set up some common test helper things."""
import asyncio
import functools
import logging
import os
from unittest.mock import patch
import pytest
import requests_mock as _requests_mock
from homeassistant import util
from homeassistant.util import location
from homeassistant.auth.const import GROUP_ID_ADMIN, GROUP_I... | apache-2.0 |
aurofable/medhack-server | venv/lib/python2.7/site-packages/werkzeug/testsuite/debug.py | 74 | 7476 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.debug
~~~~~~~~~~~~~~~~~~~~~~~~
Tests some debug utilities.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
import sys
import re
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.de... | mit |
syci/partner-contact | base_location/models/company.py | 30 | 1572 | # -*- coding: utf-8 -*-
#
#
# Author: Nicolas Bessi. Copyright Camptocamp SA
# Contributor: Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
# Ignacio Ibeas <ignacio@acysos.com>
# Alejandro Santana <alejandrosantana@anubia.es>
#
# This program is free software: you can redist... | agpl-3.0 |
chjw8016/GreenOdoo7-haibao | openerp/addons/procurement/company.py | 56 | 1531 | # -*- 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... | mit |
mbrochh/django-filer | filer/migrations/0005_auto__add_field_file_sha1__chg_field_file_file.py | 68 | 10525 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'File.sha1'
db.add_column('filer_file', 'sha1', self.gf('django.db.models.fields.CharField'... | bsd-3-clause |
DerKnob/scummvm-for-sally | tools/agi-palex.py | 2 | 6936 | #!/usr/bin/python
# Amiga AGI game palette extractor.
# Extracts palette from an Amiga AGI game's executable file.
# Initial version written during summer of 2007 by Buddha^.
# Somewhat optimized. Adding the preliminary palette test helped speed a lot.
# FIXME: Doesn't report anything about not found files when so... | gpl-2.0 |
fintura/pyPaaS | pypaas/checkout.py | 1 | 3420 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import copy
import shutil
import os.path
import datetime
import subprocess
from configparser import ConfigParser
from . import options
class Checkout(object):
def __init__(self, branch, commit, name):
self.branch, self.commit, self.name ... | mit |
coderbone/SickRage | lib/pyasn1/type/tagmap.py | 200 | 1772 | from pyasn1 import error
class TagMap:
def __init__(self, posMap={}, negMap={}, defType=None):
self.__posMap = posMap.copy()
self.__negMap = negMap.copy()
self.__defType = defType
def __contains__(self, tagSet):
return tagSet in self.__posMap or \
self.__... | gpl-3.0 |
JakobGM/robotarm-optimization | tests/test_robot_arm.py | 1 | 1781 | import unittest
import numpy as np
from numpy import pi
from robot_arm import RobotArm
class TestRobotArm(unittest.TestCase):
def setUp(self):
self.lengths = (3, 2, 2,)
self.destinations = (
(5, 4, 6, 4, 5),
(0, 2, 0.5, -2, -1),
)
self.theta = (pi, pi / 2, ... | mit |
ekamioka/gpss-research | experiments/2014-04-17-class-liver-brackets.py | 4 | 1443 | Experiment(description='Classification experiment',
data_dir='../data/add-class/r_liver',
max_depth=10,
random_order=False,
k=1,
debug=False,
local_computation=False,
n_rand=9,
sd=2,
jitter_sd=0.1,
max_jobs... | mit |
bobwalker99/Pydev | plugins/org.python.pydev.jython/Lib/_rawffi.py | 110 | 1501 | import com.sun.jna as jna
def get_libc():
return CDLL("c")
typecode_map = {'h': 2, 'H': 2}
class Array(object):
def __init__(self, typecode):
self.typecode = typecode
self.itemsize = typecode_map[typecode]
def __call__(self, size, autofree=False):
if not autofree:
rai... | epl-1.0 |
taxigps/xbmc-addons-chinese | plugin.video.youku/default.py | 1 | 28143 | # -*- coding: utf-8 -*-
import xbmc, xbmcgui, xbmcplugin, xbmcaddon, urllib2, urllib, re, string, sys, os, gzip, StringIO, math, urlparse
import base64, time, cookielib
import simplejson
# Plugin constants
__addon__ = xbmcaddon.Addon()
__addonname__ = __addon__.getAddonInfo('name')
__profile__ = xbmc.translate... | gpl-2.0 |
liberorbis/libernext | apps/erpnext/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py | 24 | 7347 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest, frappe
from frappe.utils import flt
class TestJournalVoucher(unittest.TestCase):
def test_journal_voucher_with_against_jv(self):
... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.