repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
framon/samba | lib/dnspython/dns/rdtypes/IN/DHCID.py | 100 | 2124 | # Copyright (C) 2006, 2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | gpl-3.0 |
nash-x/hws | cinder/volume/drivers/huawei/ssh_common.py | 2 | 70750 | # Copyright (c) 2013 Huawei Technologies Co., Ltd.
# Copyright (c) 2012 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:/... | apache-2.0 |
flwh/KK_mt6589_iq451 | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/mimetools.py | 334 | 7168 | """Various tools used by MIME-reading or MIME-writing programs."""
import os
import sys
import tempfile
from warnings import filterwarnings, catch_warnings
with catch_warnings():
if sys.py3kwarning:
filterwarnings("ignore", ".*rfc822 has been removed", DeprecationWarning)
import rfc822
from warnings ... | gpl-2.0 |
listamilton/supermilton.repository | plugin.video.SportsDevil/lib/customModulesManager.py | 25 | 5505 | # -*- coding: utf-8 -*-
import urllib
import os
import zipfile
from utils import xbmcUtils, fileUtils
class CustomModulesManager:
def __init__(self, customModulesFolder, customModulesRepo):
self._customModulesFolder = customModulesFolder
if not os.path.exists(self._customModulesFol... | gpl-2.0 |
Bioeden/dbMayaTextureToolkit | mttCmd.py | 1 | 8286 | # Python import
import os
# Qt import
from PySide.QtGui import QMessageBox
# Maya import
from maya import cmds
# custom import
from mttConfig import WINDOW_TITLE, MTTSettings, WS_KEY
def mtt_log(msg, add_tag=None, msg_type=None, verbose=True):
""" Format output message '[TAG][add_tag] Message content'
:param... | mit |
memtoko/django | django/contrib/auth/tokens.py | 103 | 2667 | from datetime import date
from django.conf import settings
from django.utils import six
from django.utils.crypto import constant_time_compare, salted_hmac
from django.utils.http import base36_to_int, int_to_base36
class PasswordResetTokenGenerator(object):
"""
Strategy object used to generate and check token... | bsd-3-clause |
mahak/cinder | cinder/volume/drivers/netapp/dataontap/utils/capabilities.py | 2 | 14964 | # Copyright (c) 2016 Clinton Knight. All rights reserved.
# Copyright (c) 2017 Jose Porrua. 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://... | apache-2.0 |
devdattakulkarni/test-solum | solum/objects/assembly.py | 1 | 1297 | # Copyright 2014 - Rackspace
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
PaloAltoNetworks/minemeld-core | minemeld/run/cacert_merge.py | 1 | 4292 | # Copyright 2015-2017 Palo Alto Networks, 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... | apache-2.0 |
AKSW/LODStats_WWW | rdfstats/controllers/properties.py | 1 | 5834 | """
Copyright 2012 Jan Demter <jan@demter.de>
This file is part of LODStatsWWW.
LODStats 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.
L... | gpl-3.0 |
jeanlinux/calibre | src/cherrypy/wsgiserver/wsgiserver3.py | 82 | 78074 | """A high-speed, production ready, thread pooled, generic HTTP server.
Simplest example on how to use this module directly
(without using CherryPy's application machinery)::
from cherrypy import wsgiserver
def my_crazy_app(environ, start_response):
status = '200 OK'
response_headers = [('... | gpl-3.0 |
tommasoberlose/p2p_kazaa | Package.py | 1 | 3314 | import Constant as const
import Function as func
# PKT SN
def request_sn(ip, port):
pk_id = func.random_pktid(const.LENGTH_PKTID)
port = func.format_string(port, const.LENGTH_PORT, "0")
step = func.format_string(const.TTL_SN, const.LENGTH_TTL, "0")
pack = bytes(const.CODE_SN, "ascii") + bytes(pk_id, "ascii") + by... | mit |
develersrl/shorturl | shorturl/views.py | 1 | 2349 | # -*- coding: UTF-8 -*-
# Copyright (c) 2010 David Mugnai <dvd@develer.com>
# Copyright (c) 2010 Develer s.r.l.
#
# 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, includ... | mit |
malayaleecoder/servo | tests/wpt/css-tests/css-fonts-3_dev/xhtml1/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
tobspr/panda3d | direct/src/tkwidgets/Tree.py | 2 | 17770 | """Undocumented Module"""
__all__ = ['TreeNode', 'TreeItem']
# ADAPTED FROM IDLE TreeWidget.py
# XXX TO DO:
# - popup menu
# - support partial or total redisplay
# - key bindings (instead of quick-n-dirty bindings on Canvas):
# - up/down arrow keys to move focus around
# - ditto for page up/down, home/end
# - l... | bsd-3-clause |
zycdragonball/tensorflow | tensorflow/python/util/tf_contextlib.py | 154 | 1377 | # 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 |
anurag03/integration_tests | cfme/utils/smem_memory_monitor.py | 2 | 67384 | """Monitor Memory on a CFME/Miq appliance and builds report&graphs displaying usage per process."""
import json
import time
import traceback
from collections import OrderedDict
from datetime import datetime
from threading import Thread
import os
import six
import yaml
from yaycl import AttrDict
from cfme.utils.conf i... | gpl-2.0 |
lxybox1/MissionPlanner | Lib/distutils/command/bdist_rpm.py | 53 | 20983 | """distutils.command.bdist_rpm
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""
__revision__ = "$Id$"
import sys
import os
import string
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.file_util import write_file
from dis... | gpl-3.0 |
kennedyshead/home-assistant | homeassistant/components/tcp/binary_sensor.py | 2 | 1138 | """Provides a binary sensor which gets its values from a TCP socket."""
from __future__ import annotations
from typing import Any, Final
from homeassistant.components.binary_sensor import (
PLATFORM_SCHEMA as PARENT_PLATFORM_SCHEMA,
BinarySensorEntity,
)
from homeassistant.core import HomeAssistant
from homea... | apache-2.0 |
RafaelCosman/pybrain | pybrain/rl/agents/agent.py | 31 | 1153 | __author__ = 'Tom Schaul, tom@idsia.ch'
from pybrain.utilities import abstractMethod, Named
class Agent(Named):
""" An agent is an entity capable of producing actions, based on previous observations.
Generally it will also learn from experience. It can interact directly with a Task.
"""
def integ... | bsd-3-clause |
a365541453/django | django/blog/kvm_part/admin.py | 1 | 1182 | # coding=utf-8
from django.contrib import admin
from kvm_part.models import kvm_article
# Register your models here.
from django import forms
from django.forms import fields
# Register your models here.
#form是用来控制显示的,这段代码是用来修改form的默认显示
class FlatPageForm(forms.ModelForm):
class Meta:
model = kvm_article
exclud... | gpl-3.0 |
shingonoide/odoo | addons/website_forum/models/forum.py | 233 | 38491 | # -*- coding: utf-8 -*-
from datetime import datetime
import uuid
from werkzeug.exceptions import Forbidden
import logging
import openerp
from openerp import api, tools
from openerp import SUPERUSER_ID
from openerp.addons.website.models.website import slug
from openerp.exceptions import Warning
from openerp.osv impo... | agpl-3.0 |
Gitlab11/odoo | addons/hr_timesheet_invoice/wizard/hr_timesheet_analytic_profit.py | 337 | 3122 | # -*- 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 |
hbrunn/OCB | addons/email_template/__init__.py | 381 | 1144 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2009 Sharoon Thomas
# Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
argeweb/start | argeweb/libs/requests/packages/chardet/mbcharsetprober.py | 2924 | 3268 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
DMLoy/ECommerceBasic | lib/python2.7/site-packages/pip/vendor/html5lib/treebuilders/etree_lxml.py | 1724 | 14031 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | mit |
heilaaks/snippy | tests/test_ut_config.py | 1 | 17105 | # -*- coding: utf-8 -*-
#
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# snippy - software development and maintenance notes manager.
# Copyright 2017-2020 Heikki J. Laaksonen <laaksonen.heikki.j@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... | agpl-3.0 |
caidongyun/Dato-Core | src/unity/python/graphlab/meta/scripts/depyc.py | 13 | 3674 | '''
Decompile python byte encoded modules code.
Created on Jul 19, 2011
@author: sean
'''
from __future__ import print_function
from argparse import ArgumentParser, FileType
import sys
import ast
from graphlab.meta.asttools import print_ast, python_source
from graphlab.meta.bytecodetools.pyc_file import extract
... | agpl-3.0 |
cogeorg/black_rhino | examples/firesales_simple/networkx/utils/misc.py | 22 | 4148 | """
Miscellaneous Helpers for NetworkX.
These are not imported into the base networkx namespace but
can be accessed, for example, as
>>> import networkx
>>> networkx.utils.is_string_like('spam')
True
"""
# Copyright (C) 2004-2011 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pi... | gpl-3.0 |
watonyweng/nova | nova/tests/functional/test_servers.py | 31 | 19364 | # Copyright 2011 Justin Santa Barbara
# 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 |
tkarna/cofs | examples/columbia_plume/atm_forcing.py | 2 | 4310 | r"""
Wind stress from WRF/NAM atmospheric model
"""
from firedrake import *
import numpy as np
import scipy.interpolate
import thetis.timezone as timezone
import thetis.coordsys as coordsys
from thetis.log import *
import datetime
import netCDF4
from thetis.forcing import *
from thetis.utility import get_functionspace... | mit |
attn1/cm-kernel-vivo-2.6.35 | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | 1744 | # system call counts, by pid
# (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(... | gpl-2.0 |
cp-george/pjproject | pjsip-apps/src/python/samples/registration.py | 60 | 2047 | # $Id: registration.py 2171 2008-07-24 09:01:33Z bennylp $
#
# SIP account and registration sample. In this sample, the program
# will block to wait until registration is complete
#
# Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
#
# This program is free software; you can redistribute it and/or modify
# it ... | gpl-2.0 |
orgito/ansible | test/units/module_utils/basic/test_run_command.py | 86 | 7863 | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Ansible Project
# 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)
__metaclass__ = type
import errno
from itertools import product
from io import Byt... | gpl-3.0 |
CloudWareChile/OpenChile | openerp/addons/account_budget/report/crossovered_budget_report.py | 9 | 8506 | # -*- 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 |
zlsun/XX-Net | code/default/python27/1.0/lib/email/mime/multipart.py | 480 | 1573 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Base class for MIME multipart/* type messages."""
__all__ = ['MIMEMultipart']
from email.mime.base import MIMEBase
class MIMEMultipart(MIMEBase):
"""Base class for MIME multipart/* type messages."""... | bsd-2-clause |
debugger06/MiroX | osx/build/bdist.macosx-10.5-fat/lib.macosx-10.5-fat-2.7/miro/folder.py | 3 | 7856 | # Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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; eithe... | gpl-2.0 |
toko926/sakerakuintweb | node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py | 1407 | 47697 | # 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.
"""
This module helps emulate Visual Studio 2008 behavior on top of other
build systems, primarily ninja.
"""
import os
import re
import subprocess
import sys
fr... | mit |
jianajavier/pnc-cli | pnc_cli/swagger_client/models/build_environment_rest.py | 1 | 7888 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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 |
rosjat/python-scsi | pyscsi/pyscsi/scsi_cdb_movemedium.py | 1 | 1490 | # coding: utf-8
# Copyright (C) 2014 by Ronnie Sahlberg<ronniesahlberg@gmail.com>
# SPDX-FileCopyrightText: 2014 The python-scsi Authors
#
# SPDX-License-Identifier: LGPL-2.1-or-later
from pyscsi.pyscsi.scsi_command import SCSICommand
#
# SCSI MoveMedium command and definitions
#
class MoveMedium(SCSICommand):
... | lgpl-2.1 |
openhatch/oh-mainline | vendor/packages/docutils/test/test_parsers/test_rst/test_directives/test_meta.py | 19 | 6072 | #! /usr/bin/env python
# $Id: test_meta.py 4667 2006-07-12 21:40:56Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for html meta directives.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.ParserT... | agpl-3.0 |
MrNuggles/HeyBoet-Telegram-Bot | temboo/Library/LastFm/Album/GetTopTags.py | 5 | 4031 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetTopTags
# Retrieves a list of the top tags for an album on Last.fm, ordered by popularity.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0... | gpl-3.0 |
cjwinty/p2pool-dimecoin | nattraverso/pynupnp/soap.py | 288 | 3547 | """
This module is a SOAP client using twisted's deferreds.
It uses the SOAPpy package.
@author: Raphael Slinckx
@copyright: Copyright 2005
@license: LGPL
@contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>}
@version: 0.1.0
"""
__revision__ = "$id"
import SOAPpy, logging
from SOAPpy.Config import Config
from... | gpl-3.0 |
joelddiaz/openshift-tools | openshift/installer/vendored/openshift-ansible-3.6.173.0.59/roles/openshift_logging/library/openshift_logging_facts.py | 3 | 14332 | '''
---
module: openshift_logging_facts
version_added: ""
short_description: Gather facts about the OpenShift logging stack
description:
- Determine the current facts about the OpenShift logging stack (e.g. cluster size)
options:
author: Red Hat, Inc
'''
import copy
import json
# pylint: disable=redefined-builtin, ... | apache-2.0 |
Michal-Fularz/decision_tree | decision_trees/vhdl_generators/VHDLCreator.py | 2 | 4873 | import abc
class VHDLCreator:
__metaclass__ = abc.ABCMeta
def __init__(self, filename: str, entity_name: str, number_of_features: int, number_of_bits_per_feature: int):
self.current_indent = 0
self.filename = filename
self.FILE_EXTENSION = ".vhd"
self.TESTBENCH_PREFIX = "tb_... | mit |
prampey/servo | tests/wpt/harness/wptrunner/executors/pytestrunner/fixtures.py | 58 | 4350 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import pytest
import webdriver
import contextlib
import httplib
"""pytest fixtures for use in Python-based WPT tests.... | mpl-2.0 |
vikatory/kbengine | kbe/res/scripts/common/Lib/encodings/euc_kr.py | 816 | 1027 | #
# euc_kr.py: Python Unicode Codec for EUC_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_kr, codecs
import _multibytecodec as mbc
codec = _codecs_kr.getcodec('euc_kr')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.MultibyteIncrem... | lgpl-3.0 |
pepeportela/edx-platform | lms/djangoapps/shoppingcart/exceptions.py | 191 | 1043 | """
Exceptions for the shoppingcart app
"""
# (Exception Class Names are sort of self-explanatory, so skipping docstring requirement)
# pylint: disable=missing-docstring
class PaymentException(Exception):
pass
class PurchasedCallbackException(PaymentException):
pass
class InvalidCartItem(PaymentException)... | agpl-3.0 |
srinathv/vispy | vispy/app/tests/test_qt.py | 18 | 1294 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from os import path as op
import warnings
from vispy.testing import requires_application
@requires_application('pyqt4', has=['uic'])
def test_qt_designer():
"""Embed Ca... | bsd-3-clause |
amazinger2013/OpenSesame | libqtopensesame/items/qtautoplugin.py | 2 | 4983 | #-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distri... | gpl-3.0 |
pompiduskus/scikit-learn | examples/manifold/plot_swissroll.py | 330 | 1446 | """
===================================
Swiss Roll reduction with LLE
===================================
An illustration of Swiss Roll reduction
with locally linear embedding
"""
# Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr>
# License: BSD 3 clause (C) INRIA 2011
print(__doc__)
import matplotlib.pyplot... | bsd-3-clause |
daniel-afana/Bids | bids_app/models.py | 1 | 1448 | from django.db import models
from django.contrib.postgres.fields import ArrayField
from django.core.exceptions import ValidationError
class Channel(models.Model):
name = models.CharField(max_length=50)
slug = models.CharField(max_length=50)
BID_TYPES_CHOICES = (
("CPC", "CPC"),
("CPM", "... | mit |
broadinstitute/pywdl | wdl/parser.py | 1 | 156064 |
# This file was generated by Hermes Parser Generator on Mon Jan 25 15:41:22 2016
#
# Hermes command: hermes generate grammar.hgr --name=wdl --directory=wdl --header
# Run from: .. (relative to this file)
# Hermes version: hermes-parser 2.0rc5
#
# !!! DO NOT CHANGE THIS FILE DIRECTLY !!!
#
# If you wish to change so... | apache-2.0 |
Eric89GXL/scipy | scipy/spatial/_spherical_voronoi.py | 3 | 12556 | """
Spherical Voronoi Code
.. versionadded:: 0.18.0
"""
#
# Copyright (C) Tyler Reddy, Ross Hemsley, Edd Edmondson,
# Nikolai Nowaczyk, Joe Pitt-Francis, 2015.
#
# Distributed under the same BSD license as SciPy.
#
import numpy as np
import scipy
import itertools
from . import _voronoi
from scipy.spa... | bsd-3-clause |
canglade/NLP | appengine/standard/app_identity/asserting/main.py | 8 | 2002 | # Copyright 2015 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
lokeshjindal15/pd-gem5 | tests/quick/se/30.eio-mp/test.py | 50 | 1802 | # Copyright (c) 2006 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
fernandog/Medusa | medusa/event_queue.py | 1 | 1742 | # coding=utf-8
from __future__ import unicode_literals
import logging
import threading
import traceback
from builtins import object
from medusa.helper.exceptions import ex
from six.moves.queue import Empty, Queue
log = logging.getLogger(__name__)
class Event(object):
def __init__(self, event_type):
s... | gpl-3.0 |
nskrypnik/kivy3 | kivy3/objects/mesh.py | 2 | 2870 | """
The MIT License (MIT)
Copyright (c) 2013 Niko Skrypnik
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 |
cprov/snapcraft | snapcraft/internal/project_loader/errors.py | 1 | 5910 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2017 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... | gpl-3.0 |
lukleh/TwistedBot | libs/twisted/internet/udp.py | 8 | 11644 | # -*- test-case-name: twisted.test.test_udp -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Various asynchronous UDP classes.
Please do not use this module directly.
@var _sockErrReadIgnore: list of symbolic error constants (from the C{errno}
module) representing socket errors whe... | mit |
bak1an/django | django/db/models/fields/__init__.py | 2 | 84735 | import collections
import copy
import datetime
import decimal
import itertools
import uuid
import warnings
from base64 import b64decode, b64encode
from functools import total_ordering
from django import forms
from django.apps import apps
from django.conf import settings
from django.core import checks, exceptions, vali... | bsd-3-clause |
manderson23/NewsBlur | vendor/appdotnet.py | 19 | 9191 | import json
import requests
# To add
# - Identity Delegation
# - Streams (in dev by app.net)
# - Filters (in dev by app.net)
class Appdotnet:
''' Once access has been given, you don't have to pass through the
client_id, client_secret, redirect_uri, or scope. These are just
to get the authentication token.... | mit |
p4datasystems/CarnotKEdist | dist/Lib/flask/config.py | 781 | 6234 | # -*- coding: utf-8 -*-
"""
flask.config
~~~~~~~~~~~~
Implements the configuration related objects.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import imp
import os
import errno
from werkzeug.utils import import_string
from ._compat import string_type... | apache-2.0 |
takluyver/readthedocs.org | readthedocs/betterversion/better.py | 11 | 2333 | from distlib.version import AdaptiveVersion
from collections import defaultdict
class BetterVersion(AdaptiveVersion):
@property
def major_version(self):
return self._parts[0][0]
@property
def minor_version(self):
# catch index error, maybe?
try:
return self._parts... | mit |
h3biomed/ansible | lib/ansible/modules/cloud/amazon/rds_subnet_group.py | 3 | 6279 | #!/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 |
tornadozou/tensorflow | tensorflow/compiler/tests/dynamic_stitch_test.py | 123 | 3401 | # 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 |
jcrist/blaze | blaze/compute/tests/test_comprehensive.py | 11 | 4570 | from __future__ import absolute_import, division, print_function
import numpy as np
from pandas import DataFrame
import numpy as np
from odo import resource, into
from datashape.predicates import isscalar, iscollection, isrecord
from blaze.expr import symbol, by
from blaze.interactive import Data
from blaze.compute im... | bsd-3-clause |
a-doumoulakis/tensorflow | tensorflow/python/ops/standard_ops.py | 49 | 11225 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
axbaretto/beam | sdks/python/.tox/docs/lib/python2.7/site-packages/pbr/hooks/base.py | 101 | 1038 | # Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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
#
# Unles... | apache-2.0 |
bdh1011/wau | venv/lib/python2.7/site-packages/cryptography/hazmat/backends/commoncrypto/ciphers.py | 58 | 7946 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from cryptography import utils
from cryptography.exceptions import (
... | mit |
javierag/samba | lib/subunit/python/subunit/filters.py | 12 | 4814 | # subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2009 Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source... | gpl-3.0 |
gthuang/aws-sam-local | vendor/github.com/awslabs/goformation/test-resources/sam/encryption_proxy/decryption.py | 4 | 1212 | import boto3
import json
import base64
kms = boto3.client('kms')
bad_request = {
'statusCode': 400,
'headers': {
'Content-Type': 'application/json'
},
'body': json.dumps({'error': 'Invalid argument'})
}
def decrypt(message):
'''decrypt leverages KMS decrypt and base64-encode decrypted blo... | apache-2.0 |
DaniilLeksin/theblog | env/lib/python2.7/site-packages/django/conf/locale/nl/formats.py | 57 | 4460 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j F Y' # '20 ja... | gpl-2.0 |
sokolic/miniSASS | minisass_registration/backends/__init__.py | 2 | 1884 | from django.core.mail import send_mail
from registration.backends.default import DefaultBackend
from minisass_registration.forms import miniSASSregistrationForm
from minisass_registration.models import UserProfile, Lookup
class miniSASSbackend(DefaultBackend):
""" This class uses a custom registration form that ... | gpl-3.0 |
scifiswapnil/Project-LoCatr | lib/python2.7/site-packages/pip/_vendor/html5lib/filters/whitespace.py | 353 | 1139 | from __future__ import absolute_import, division, unicode_literals
import re
from . import base
from ..constants import rcdataElements, spaceCharacters
spaceCharacters = "".join(spaceCharacters)
SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
class Filter(base.Filter):
spacePreserveElements = frozenset([... | mit |
iambibhas/django | tests/many_to_one_null/tests.py | 42 | 5234 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Car, Driver, Reporter
class ManyToOneNullTests(TestCase):
def setUp(self):
# Create a Reporter.
self.r = Reporter(name='John Smith')
self.r.save()
# Create an Article.
se... | bsd-3-clause |
Klaudit/livestreamer | src/livestreamer/stream/hls.py | 22 | 11619 | from collections import defaultdict, namedtuple
try:
from Crypto.Cipher import AES
import struct
def num_to_iv(n):
return struct.pack(">8xq", n)
CAN_DECRYPT = True
except ImportError:
CAN_DECRYPT = False
from . import hls_playlist
from .http import HTTPStream
from .segmented import (Segm... | bsd-2-clause |
ismailsunni/geonode | geonode/layers/models.py | 1 | 16697 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... | gpl-3.0 |
mrkm4ntr/incubator-airflow | airflow/providers/amazon/aws/sensors/cloud_formation.py | 2 | 3844 | #
# 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... | apache-2.0 |
jef-n/QGIS | python/core/additions/qgsfeature.py | 56 | 1194 | # -*- coding: utf-8 -*-
"""
***************************************************************************
qgsfeature.py
---------------------
Date : May 2018
Copyright : (C) 2018 by Denis Rouzaud
Email : denis@opengis.ch
**************************************... | gpl-2.0 |
indictranstech/omnitech-frappe | frappe/tests/test_email.py | 37 | 3558 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import unittest, frappe
from frappe.test_runner import make_test_records
make_test_records("User")
make_test_records("Email Account")
class TestEmail(unittest.TestCase):
def s... | mit |
mhrivnak/pulp | server/test/unit/server/db/migrations/test_migration_0010.py | 5 | 2025 | import unittest
import mock
from pulp.server.db.migrate.models import MigrationModule
MIGRATION = 'pulp.server.db.migrations.0010_utc_timestamps'
class TestMigration(unittest.TestCase):
@mock.patch('pulp.server.db.migrations.0010_utc_timestamps.connection')
def test_time_to_utc_on_collection(self, mock_co... | gpl-2.0 |
TomasTomecek/sen | sen/util.py | 1 | 8152 | import os
import logging
import functools
import traceback
import time
from datetime import datetime
from docker.errors import APIError
from sen.constants import PROJECT_NAME, LOG_FILE_NAME
logger = logging.getLogger(__name__)
def _ensure_unicode(s):
try:
return s.decode("utf-8")
except AttributeE... | mit |
Bakterija/sshare | src/app_manager.py | 1 | 11511 | from flask_login import UserMixin
from flask import redirect
from threading import Thread
from hashlib import sha512
from time import time
import app_globals
TIME0 = time()
from utils import dround
from logs import Logger
from copy import copy
import traceback
import platform
import shutil
import random
import utils
im... | mit |
aboutsajjad/Bridge | app_packages/youtube_dl/extractor/audimedia.py | 67 | 3924 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
sanitized_Request,
)
class AudiMediaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?audi-mediacenter\.com/(?:en|de)/audimediatv/(?P<id>[^/?#]+)'
_TEST =... | mit |
achamberland/react-view-cube | node_modules/sassify/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py | 395 | 12634 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
impor... | mit |
verejnedigital/verejne.digital | prepojenia/test.py | 1 | 4406 | """Unit tests for server prepojenia.
Run all unit test from command line as:
python test.py
To run an individual unit test only, run (for example):
python test.py TestHandlers.test_subgraph
"""
import json
import unittest
import webapp2
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dir... | apache-2.0 |
Cinntax/home-assistant | tests/components/google_assistant/test_trait.py | 1 | 54361 | """Tests for the Google Assistant traits."""
from unittest.mock import patch, Mock
import logging
import pytest
from homeassistant.components import (
binary_sensor,
camera,
cover,
fan,
input_boolean,
light,
lock,
media_player,
scene,
script,
sensor,
switch,
vacuum,
... | apache-2.0 |
guorendong/iridium-browser-ubuntu | third_party/yasm/source/patched-yasm/Mkfiles/vc9/vc98_swap.py | 26 | 1526 |
# Convert between Visual Studio 2008 and 2005 Project Files
# (with thanks to Tommi Vainikainen)
l05 = "# Visual Studio 2005\n"
l08 = "# Visual Studio 2008\n"
l09 = "Microsoft Visual Studio Solution File, Format Version 9.00\n"
l10 = "Microsoft Visual Studio Solution File, Format Version 10.00\n"
import os,... | bsd-3-clause |
hep-gc/cloudscheduler | web_frontend/cloudscheduler/csv2/alias_views.py | 1 | 12238 | from django.conf import settings
config = settings.CSV2_CONFIG
from django.core.exceptions import PermissionDenied
from django.contrib.auth import update_session_auth_hash
from cloudscheduler.lib.view_utils import \
diff_lists, \
lno, \
qt, \
render, \
set_user_groups, \
validate_by_filtered_t... | apache-2.0 |
google-research/google-research | ravens/ravens/tasks/sweeping_piles.py | 1 | 2058 | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | apache-2.0 |
sochotnicky/lyntin | sandbox/leantin/tkui.py | 1 | 10537 | #######################################################################
# This file is part of Lyntin.
# copyright (c) Free Software Foundation 1999 - 2002
#
# Lyntin is distributed under the GNU General Public License license. See the
# file LICENSE for distribution details.
# $Id: tkui.py,v 1.3 2004/05/04 05:02:04 o... | gpl-3.0 |
liggitt/kubernetes | hack/boilerplate/boilerplate_test.py | 136 | 1370 | #!/usr/bin/env python
# Copyright 2016 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 |
x1101/nikola | nikola/plugins/compile/ipynb.py | 1 | 6776 | # -*- coding: utf-8 -*-
# Copyright © 2013-2016 Damián Avila, Chris Warrick and others.
# 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
#... | mit |
jaykwon/pyjnius | setup.py | 4 | 4871 | from distutils.core import setup, Extension
from os import environ
from os.path import dirname, join, exists
import sys
from platform import architecture
files = [
'jni.pxi',
'jnius_conversion.pxi',
'jnius_export_class.pxi',
'jnius_export_func.pxi',
'jnius_jvm_android.pxi',
'jnius_jvm_desktop.p... | mit |
idncom/odoo | addons/document/test_cindex.py | 444 | 1553 | #!/usr/bin/python
import sys
import os
import glob
import time
import logging
from optparse import OptionParser
logging.basicConfig(level=logging.DEBUG)
parser = OptionParser()
parser.add_option("-q", "--quiet",
action="store_false", dest="verbose", default=True,
help="don't prin... | agpl-3.0 |
seppius-xbmc-repo/ru | script.module.elementtree/lib/elementtree/HTMLTreeBuilder.py | 12 | 8056 | #
# ElementTree
# $Id: HTMLTreeBuilder.py 3225 2007-08-27 21:32:08Z fredrik $
#
# a simple tree builder, for HTML input
#
# history:
# 2002-04-06 fl created
# 2002-04-07 fl ignore IMG and HR end tags
# 2002-04-07 fl added support for 1.5.2 and later
# 2003-04-13 fl added HTMLTreeBuilder alias
# 2004-... | gpl-2.0 |
b-me/django | django/utils/translation/trans_real.py | 59 | 27824 | """Translation helper functions."""
from __future__ import unicode_literals
import gettext as gettext_module
import os
import re
import sys
import warnings
from collections import OrderedDict
from threading import local
from django.apps import apps
from django.conf import settings
from django.conf.locale import LANG_... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2021_01_01/models/_models_py3.py | 1 | 98421 | # 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 may ... | mit |
CeltonMcGrath/TACTIC | src/pyasm/deprecated/flash/widget/flash_context.py | 6 | 1206 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.