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 |
|---|---|---|---|---|---|
MrLoick/python-for-android | python-modules/twisted/twisted/topfiles/setup.py | 49 | 3178 | #!/usr/bin/env python
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Distutils installer for Twisted.
"""
import os, sys
if sys.version_info < (2,3):
print >>sys.stderr, "You must use at least Python 2.3 for Twisted"
sys.exit(3)
if os.path.exists('twisted'):
sys.pa... | apache-2.0 |
toontownfunserver/Panda3D-1.9.0 | python/Lib/site-packages/pip/_vendor/requests/sessions.py | 220 | 19430 | # -*- coding: utf-8 -*-
"""
requests.session
~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
from collections import Mapping
from datetime import datetime
from .compat import cookielib, OrderedDict, urljoin, urlparse, buil... | bsd-3-clause |
flh/odoo | openerp/tools/lru.py | 204 | 2946 | # -*- coding: utf-8 -*-
# taken from http://code.activestate.com/recipes/252524-length-limited-o1-lru-cache-implementation/
import threading
from func import synchronized
__all__ = ['LRU']
class LRUNode(object):
__slots__ = ['prev', 'next', 'me']
def __init__(self, prev, me):
self.prev = prev
... | agpl-3.0 |
dpiers/coderang-meteor | public/jsrepl/extern/python/closured/lib/python2.7/io.py | 191 | 3624 | """The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.
At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; impl... | mit |
mmottahedi/neuralnilm | neuralnilm/layers.py | 4 | 1222 | from __future__ import print_function, division
from lasagne.layers import (LSTMLayer, RecurrentLayer, ElemwiseSumLayer,
ConcatLayer)
def BLSTMLayer(*args, **kwargs):
"""Configures forward and backwards LSTM layers to create a
bidirectional LSTM.
"""
return BidirectionalLay... | apache-2.0 |
roddds/django-ajax-filtered-fields | ajax_filtered_fields/utils.py | 11 | 1741 | # -*- coding: utf-8 -*-
# request helpers
def _cleanValue(value):
mapping = {
"True": True,
"False": False,
"None": None,
}
return mapping.get(value, value)
def lookupToString(lookup_dict):
"""
Convert the lookup dict into a string.
e.g.:
{"field1": "a", "f... | mit |
person142/scipy | doc/postprocess.py | 22 | 1262 | #!/usr/bin/env python
"""
%prog MODE FILES...
Post-processes HTML and Latex files output by Sphinx.
MODE is either 'html' or 'tex'.
"""
import sys
import re, optparse
def main():
p = optparse.OptionParser(__doc__)
options, args = p.parse_args()
if len(args) < 1:
p.error('no mode given')
mod... | bsd-3-clause |
40223229/CDB_Final2 | static/Brython3.1.1-20150328-091302/Lib/formatter.py | 751 | 14930 | """Generic output formatting.
Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor an... | gpl-3.0 |
writefaruq/lionface-app | django/db/backends/oracle/base.py | 9 | 29471 | """
Oracle database backend for Django.
Requires cx_Oracle: http://cx-oracle.sourceforge.net/
"""
import datetime
import os
import sys
import time
from decimal import Decimal
# Oracle takes client-side character set encoding from the environment.
os.environ['NLS_LANG'] = '.UTF8'
# This prevents unico... | bsd-3-clause |
sriprasanna/django-1.3.1 | django/utils/tzinfo.py | 313 | 2511 | "Implementation of tzinfo classes for use with datetime.datetime."
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING
class FixedOffset(tzinfo):
"Fixed offset in minutes east from UTC."
def __init__(self, offset):
if i... | bsd-3-clause |
consultit/Ely | ely/direct/data_structures_and_algorithms/ch12/decorated_merge_sort.py | 1 | 1681 | # Copyright 2013, Michael H. Goldwasser
#
# Developed for use with the book:
#
# Data Structures and Algorithms in Python
# Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser
# John Wiley & Sons, 2013
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | lgpl-3.0 |
svn2github/audacity | lib-src/lv2/lv2/waflib/Tools/gxx.py | 70 | 2802 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys
from waflib import Configure,Options,Utils
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_gxx(conf):
cxx=conf.find_program(... | gpl-2.0 |
rplevka/robottelo | tests/foreman/sys/test_rename.py | 1 | 10708 | """Test class for ``katello-change-hostname``
:Requirement: katello-change-hostname
:CaseAutomation: Automated
:CaseLevel: System
:CaseComponent: satellite-change-hostname
:Assignee: pondrejk
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import pytest
from fauxfactory import gen_string
from nai... | gpl-3.0 |
ocampocj/cloud-custodian | tests/test_workspaces.py | 5 | 2827 | # Copyright 2019 Capital One Services, 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 agreed to in... | apache-2.0 |
luhanhan/horizon | openstack_dashboard/dashboards/project/instances/utils.py | 24 | 5316 | # 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, software
# distributed under t... | apache-2.0 |
skyddv/neutron | neutron/tests/api/admin/test_extension_driver_port_security_admin.py | 34 | 1392 | # Copyright 2015 Cisco Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required... | apache-2.0 |
sebalix/OpenUpgrade | addons/stock_dropshipping/__openerp__.py | 260 | 2037 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
kalhartt/dnestpy | examples/example_uistring.py | 1 | 1067 | #!/usr/bin/python2.7
import sqlalchemy as sqla
import codecs, re
uistring = '/mnt/500G/Games/dragonnest/extract/resource/uistring/uistring.xml'
message_re = re.compile(r'<message mid="(\d+)"><!\[CDATA\[(.+)\]\]></message>', re.UNICODE|re.DOTALL)
def readlines(f, bufsize):
buf = u''
data = True
while data:... | gpl-2.0 |
rjw57/edpcmentoring | edpcmentoring/mentoring/migrations/0001_initial.py | 2 | 1920 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-04-25 19:11
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migration... | mit |
nealtodd/wagtail | wagtail/admin/menu.py | 3 | 4295 | from django.forms import Media, MediaDefiningClass
from django.forms.utils import flatatt
from django.template.loader import render_to_string
from django.utils.safestring import mark_safe
from django.utils.text import slugify
from wagtail.core import hooks
class MenuItem(metaclass=MediaDefiningClass):
template =... | bsd-3-clause |
2ndQuadrant/ansible | lib/ansible/modules/cloud/amazon/ecs_attribute.py | 39 | 10406 | #!/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': ['preview'],
... | gpl-3.0 |
joosthoeks/jhBacktest | jhbacktest/strategy/strategy.py | 1 | 22478 | from jhbacktest.data import *
import jhbacktest.stats as jhstats
from tabulate import tabulate
import termcolor as tc
class Strategy(object):
def __init__(self, df, slippage=0):
self.__df = df
__data = Data()
self.__df_np = __data.df2numpy(self.__df)
self.__df_index = -1
... | gpl-3.0 |
tosaka2/tacotron | models/tacotron.py | 1 | 4014 | from util import textinput
from util.infolog import log
import chainer
from chainer import Variable
import chainer.functions as F
import chainer.links as L
import numpy as np
from .modules import get_encoder_cbhg, get_decoder_cbhg, PreNet, Attention
from hparams import hparams as hp
def sequence_embed(embed, xs):
... | mit |
huntxu/neutron | neutron/tests/unit/common/test_rpc.py | 1 | 19542 | # Copyright 2015 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 req... | apache-2.0 |
nitinitprof/odoo | addons/google_drive/google_drive.py | 98 | 14693 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2012 OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General... | agpl-3.0 |
MaxIV-KitsControls/tango-facadedevice | facadedevice/device.py | 1 | 12477 | """Provide the facade device class and metaclass."""
# Imports
import time
import collections
# Graph imports
from facadedevice.graph import triplet, Graph, INVALID
# Exception imports
from facadedevice.exception import to_dev_failed, context
# Utils imports
from facadedevice.utils import EnhancedDevice, aggregate_... | gpl-3.0 |
palrogg/foundations-homework | Data_and_databases/Homework6_api.py | 1 | 1394 | from flask import Flask, request, jsonify
import pg8000, decimal
import json
app = Flask(__name__)
def get_data(_type, _sort):
conn = pg8000.connect(user="paul", database="mondial")
cursor = conn.cursor()
sort_result = ''
if _sort == 'name':
sort_result = 'ORDER BY name'
elif _sort in ('a... | mit |
ujenmr/ansible | lib/ansible/modules/windows/win_rds_settings.py | 10 | 1773 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Kevin Subileau (@ksubileau)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'commu... | gpl-3.0 |
ShawnLeee/chisel | fblldbbase.py | 10 | 2834 | #!/usr/bin/python
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
import lldb
... | bsd-3-clause |
ajfriend/cvxpy | cvxpy/lin_ops/lin_utils.py | 4 | 15428 | """
Copyright 2013 Steven Diamond
This file is part of CVXPY.
CVXPY 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.
CVXPY is distributed i... | gpl-3.0 |
fedya/ajenti | plugins/supervisor/widget.py | 17 | 1710 | from ajenti.ui import *
from ajenti import apis
from ajenti.com import implements, Plugin
from ajenti.api import *
from client import SVClient
class SVWidget(Plugin):
implements(apis.dashboard.IWidget)
icon = '/dl/supervisor/icon.png'
name = 'Supervisor process'
title = None
style = 'linear'
... | lgpl-3.0 |
rvalieris/bioconda-recipes | recipes/peptide-shaker/1.16.16/peptide-shaker.py | 45 | 3272 | #!/usr/bin/env python
#
# Wrapper script for Java Conda packages that ensures that the java runtime
# is invoked with the right options. Adapted from the bash script (http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in/246128#246128).
#
# Program Parameters
#
import os
import s... | mit |
RockySteveJobs/python-for-android | python-modules/twisted/twisted/internet/test/test_inotify.py | 56 | 13903 | # Copyright (c) 2008-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for the inotify wrapper in L{twisted.internet.inotify}.
"""
from twisted.internet import defer, reactor
from twisted.python import filepath, runtime
from twisted.trial import unittest
try:
from twisted.python import _inot... | apache-2.0 |
skelneko/-CuriousActorCritic | Environment.py | 1 | 2876 | from Config import Config
import gym
import PIL
from collections import deque
import numpy as np
class Environment(object):
def __init__(self, game="MsPacman-v0"):
self.screen_h = Config.SCREEN_H
self.screen_w = Config.SCREEN_W
self.screen_shape = Config.SCREEN_SHAPE
self.frame_pe... | gpl-3.0 |
ntymtsiv/tempest | tempest/stress/actions/volume_create_delete.py | 10 | 1452 | # 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, software
# di... | apache-2.0 |
ottobackwards/incubator-metron | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/enrichment_master.py | 9 | 4574 | """
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this ... | apache-2.0 |
nghia-huynh/gem5-stable | configs/example/ruby_network_test.py | 15 | 5412 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2010 Advanced Micro Devices, 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 co... | bsd-3-clause |
mscherer/ansible-modules-core | network/sros/sros_command.py | 5 | 7754 | #!/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 |
liulion/mayavi | mayavi/tests/test_ipw_multiple_scalars.py | 5 | 3080 | import unittest
from numpy import zeros, random
from tvtk.api import tvtk
from tvtk.common import is_old_pipeline
from mayavi.sources.vtk_data_source import VTKDataSource
from mayavi.core.null_engine import NullEngine
from mayavi.modules.image_plane_widget import ImagePlaneWidget
class TestIPWMultipleScalars(unittest... | bsd-3-clause |
cawka/ns-3-dev-ndnSIM | src/point-to-point/bindings/modulegen__gcc_LP64.py | 12 | 362984 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
stannynuytkens/youtube-dl | youtube_dl/extractor/teamcoco.py | 8 | 6785 | # coding: utf-8
from __future__ import unicode_literals
import json
from .turner import TurnerBaseIE
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
mimetype2ext,
parse_duration,
parse_iso8601,
qualities,
)
class TeamcocoIE(TurnerBaseIE):
_VALID_URL = r'https?://tea... | unlicense |
Elchi3/kuma | kuma/core/tests/test_settings.py | 2 | 1096 | """Check that settings are consistent."""
import pytest
from django.conf import settings
def test_accepted_locales():
"""Check for a consistent ACCEPTED_LOCALES."""
assert len(settings.ACCEPTED_LOCALES) == len(set(settings.ACCEPTED_LOCALES))
assert settings.ACCEPTED_LOCALES[0] == settings.LANGUAGE_CODE
... | mpl-2.0 |
shawnchin/checkfort | checkfort/files.py | 1 | 2041 | import os
import re
import sys
from checkfort.exceptions import *
from checkfort.logging import p_warn, p_verbose
default_extensions = ("h", "f", "F",
"f90", "F90", "f95", "F95",
"f03", "F03", "f08", "F08", "h",)
class InputFileReader(object):
def __init__(self, input_... | bsd-3-clause |
TheTimmy/spack | var/spack/repos/builtin/packages/fontconfig/package.py | 3 | 2569 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
Akrog/cinder | cinder/api/views/availability_zones.py | 57 | 1083 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
Yong-Lee/decode-Django | Django-1.5.1/tests/modeltests/reserved_names/tests.py | 91 | 1713 | from __future__ import absolute_import
import datetime
from django.test import TestCase
from .models import Thing
class ReservedNameTests(TestCase):
def generate(self):
day1 = datetime.date(2005, 1, 1)
t = Thing.objects.create(when='a', join='b', like='c', drop='d',
alter='e', havin... | gpl-2.0 |
stankovski/AutoRest | AutoRest/Generators/Python/Azure.Python.Tests/AcceptanceTests/paging_tests.py | 5 | 6423 | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""),... | mit |
jamesmarva/docker-py | docker/utils/utils.py | 3 | 24037 | # Copyright 2013 dotCloud 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 t... | apache-2.0 |
phgupta/Building-Analytics | building-analytics/TS_Util_Clean_Data.py | 1 | 15125 | # -*- coding: utf-8 -*-
"""
@author : Armando Casillas <armcasillas@ucdavis.edu>
@author : Marco Pritoni <marco.pritoni@gmail.com>
Created on Wed Jul 26 2017
Update Aug 08 2017
"""
from __future__ import division
import pandas as pd
import os
import sys
import requests as req
import json
import numpy as np
import dat... | mit |
FlipperPA/wagtail | wagtail/admin/tests/test_privacy.py | 7 | 15574 | from django.contrib.auth.models import Group
from django.test import TestCase
from django.urls import reverse
from wagtail.core.models import Page, PageViewRestriction
from wagtail.tests.testapp.models import SimplePage
from wagtail.tests.utils import WagtailTestUtils
class TestSetPrivacyView(TestCase, WagtailTestUt... | bsd-3-clause |
rishirajsinghjhelumi/Entity-Mining | tmdb3/tmdb_auth.py | 34 | 4270 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------
# Name: tmdb_auth.py
# Python Library
# Author: Raymond Wagner
# Purpose: Provide authentication and session services for
# calls against the TMDB v3 API
#-----------------------
from datetime import datetime as _pydatetime, \
... | gpl-2.0 |
FireBladeNooT/Medusa_1_6 | lib/sqlalchemy/testing/suite/test_sequence.py | 89 | 3831 | from .. import fixtures, config
from ..config import requirements
from ..assertions import eq_
from ... import testing
from ... import Integer, String, Sequence, schema
from ..schema import Table, Column
class SequenceTest(fixtures.TablesTest):
__requires__ = ('sequences',)
__backend__ = True
run_creat... | gpl-3.0 |
linjoahow/W16_test1 | static/Brython3.1.1-20150328-091302/Lib/_dummy_thread.py | 742 | 4769 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | gpl-3.0 |
tlakshman26/cinder-https-changes | cinder/tests/unit/test_glusterfs.py | 5 | 76158 | # Copyright (c) 2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 |
kbidarkar/robottelo | robottelo/ui/settings.py | 4 | 2207 | # -*- encoding: utf-8 -*-
"""Implements Settings UI"""
from robottelo.ui.base import Base, UINoSuchElementError
from robottelo.ui.locators import locators
from robottelo.ui.navigator import Navigator
class Settings(Base):
"""Implements the Update function to edit/update settings"""
def navigate_to_entity(se... | gpl-3.0 |
tenvick/hugula | Client/tools/site-packages/convertImage.py | 8 | 2096 | #-------------------------------------------------------------------------------
# Name: convertImage
# Purpose:
#
# Author: Deqiang.li
#
# Created: 14/11/2012
# Copyright: (c) Deqiang.li 2012
# Licence: <your licence>
#------------------------------------------------------------------------------... | mit |
bharatmooc/configuration-1 | util/vpc-tools/vpc-tools.py | 1 | 4340 | """VPC Tools.
Usage:
vpc-tools.py ssh-config (vpc <vpc_id> | stack-name <stack_name>) identity-file <identity_file> user <user> [(config-file <config_file>)] [(strict-host-check <strict_host_check>)]
vpc-tools.py (-h --help)
vpc-tools.py (-v --version)
Options:
-h --help Show this screen.
-v... | agpl-3.0 |
orgito/ansible | contrib/inventory/cloudforms.py | 42 | 19244 | #!/usr/bin/env python
# vim: set fileencoding=utf-8 :
#
# Copyright (C) 2016 Guido Günther <agx@sigxcpu.org>
#
# This script 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 |
Jnrolfe/pychess | lib/pychess/Players/PyChess.py | 20 | 7612 | from __future__ import print_function
#!/usr/bin/pypy -u
if __name__ == "__main__":
print("feature done=0")
import gettext
import os
import random
import sys
from time import time
this_dir = os.path.dirname(os.path.abspath(__file__))
if os.path.join(this_dir, "../..") not in sys.path:
sys.path = [os.path.joi... | gpl-3.0 |
kreatorkodi/repository.torrentbr | script.module.urlresolver/lib/urlresolver/plugins/kingfiles.py | 5 | 1984 | """
grifthost urlresolver plugin
Copyright (C) 2015 tknorris
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is d... | gpl-2.0 |
CapOM/ChromiumGStreamerBackend | native_client_sdk/src/build_tools/sdk_tools/download.py | 128 | 2697 | # 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.
import hashlib
import os
import sys
# when pylint runs the third_party module is the one from depot_tools
# pylint: disable=E0611
from third_party import... | bsd-3-clause |
kyroskoh/phantomjs | src/qt/qtwebkit/Tools/BuildSlaveSupport/build.webkit.org-config/wkbuild.py | 117 | 5624 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
superdesk/superdesk-ntb | server/ntb/publish/ntb_publish_service.py | 3 | 1320 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2016 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superde... | agpl-3.0 |
btovar/autopyfactory | autopyfactory/plugins/factory/monitor/Dummy.py | 4 | 1656 |
import logging
from autopyfactory.interfaces import MonitorInterface
class Dummy(MonitorInterface):
def __init__(self, apfqueue, config, section):
self.log = logging.getLogger("autopyfactory.monitor")
self.log.debug("Dummy monitor initialized.")
def registerFactory(self, apfqueue):
... | apache-2.0 |
homme/ansible | contrib/inventory/freeipa.py | 95 | 2201 | #!/usr/bin/env python
import argparse
from ipalib import api
import json
def initialize():
'''
This function initializes the FreeIPA/IPA API. This function requires
no arguments. A kerberos key must be present in the users keyring in
order for this to work.
'''
api.bootstrap(context='cli')
... | gpl-3.0 |
samnjugu/python-gmail | Tools.py | 1 | 3354 | #!/usr/bin/python
import smtplib, imaplib, email, email.header
# Utility class to handle IMAP and SMTP
# IMAP is used to fetch emails while SMTP is used to send emails
class Gmail(object):
def __init__(self, email, password):
self.server = 'smtp.gmail.com'
self.port = 587
session = smtpli... | gpl-2.0 |
stanlee321/pysolper | latrop/lib/dist/tipfy/json.py | 9 | 2682 | # -*- coding: utf-8 -*-
"""
tipfy.json
~~~~~~~~~~
JSON encoder/decoder.
:copyright: 2011 by tipfy.org.
:license: BSD, see LICENSE.txt for more details.
"""
from __future__ import absolute_import
import base64
try:
# Preference for installed library with updated fixes.
import simplejson a... | apache-2.0 |
dvliman/jaikuengine | .google_appengine/lib/django-1.5/django/core/mail/backends/smtp.py | 130 | 4312 | """SMTP email backend class."""
import smtplib
import ssl
import threading
from django.conf import settings
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.utils import DNS_NAME
from django.core.mail.message import sanitize_address
from django.utils.encoding import force_bytes
class... | apache-2.0 |
jantman/awslimitchecker | awslimitchecker/tests/test_connectable.py | 1 | 13876 | """
awslimitchecker/tests/test_connectable.py
The latest version of this package is available at:
<https://github.com/jantman/awslimitchecker>
################################################################################
Copyright 2015-2018 Jason Antman <jason@jasonantman.com>
This file is part of awslimitche... | agpl-3.0 |
aktech/sympy | sympy/physics/mechanics/rigidbody.py | 12 | 12493 | # -*- encoding: utf-8 -*-
from __future__ import print_function, division
__all__ = ['RigidBody']
from sympy import sympify
from sympy.physics.vector import Point, ReferenceFrame, Dyadic
from sympy.utilities.exceptions import SymPyDeprecationWarning
class RigidBody(object):
"""An idealized rigid body.
This... | bsd-3-clause |
cjaymes/pyscap | src/scap/model/oval_5/defs/windows/MetabaseObjectElement.py | 1 | 1144 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | gpl-3.0 |
osroom/osroom | apps/core/logger/logger_server.py | 1 | 4431 | #!/usr/bin/env python
# -*-coding:utf-8-*-
# @Time : 2017/11/1 ~ 2019/9/1
# @Author : Allen Woo
import json
import os
import socket
import time
import logging
from logging.handlers import TimedRotatingFileHandler
from apps.configs.sys_config import LOG_PATH, SOCKET_PORT
from apps.utils.osr_async.osr_async import async... | bsd-2-clause |
trudikampfschaf/flask-microblog | flask/lib/python2.7/site-packages/sqlalchemy/sql/visitors.py | 17 | 9433 | # sql/visitors.py
# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Visitor/traversal interface and library functions.
SQLAlchemy schema and expressio... | bsd-3-clause |
HyperBaton/ansible | lib/ansible/modules/cloud/linode/linode.py | 37 | 25239 | #!/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': ['preview'],
... | gpl-3.0 |
calcoin/calcoin | share/demurrage_parameters_arithmetic.py | 41 | 1472 | #!/usr/bin/env python
from __future__ import division
try:
from gmpy2 import mpq as Fraction
except ImportError:
from fractions import Fraction
TOTAL_SUPPLY = 10**16 - 1
EQ_HEIGHT = 161280
TITHE_RATIO = Fraction(4,5)
TITHE_AMOUNT = TOTAL_SUPPLY * TITHE_RATIO / EQ_HEIGHT
DEMURRAGE_RATE = 2**20
de... | mit |
throwable-one/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/admin_validation/models.py | 43 | 1108 | """
Tests of ModelAdmin validation logic.
"""
from django.db import models
class Album(models.Model):
title = models.CharField(max_length=150)
class Song(models.Model):
title = models.CharField(max_length=150)
album = models.ForeignKey(Album)
original_release = models.DateField(editable=False)
... | gpl-3.0 |
nicobustillos/odoo | addons/sale_analytic_plans/__init__.py | 443 | 1208 | # -*- 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 |
mbauskar/tele-erpnext | erpnext/shopping_cart/test_shopping_cart.py | 31 | 6992 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from erpnext.shopping_cart import get_quotation, set_item_in_cart
class TestShoppingCart(unittest.TestCase):
"""
Note:... | agpl-3.0 |
MartinSavc/scikit-learn | sklearn/kernel_approximation.py | 258 | 17973 | """
The :mod:`sklearn.kernel_approximation` module implements several
approximate kernel feature maps base on Fourier transforms.
"""
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import svd
from .base im... | bsd-3-clause |
ilzxc/m158a-node_python_odot | python/python3/pyosc/OSC.py | 10 | 89924 | #!/usr/bin/python
"""
This module contains an OpenSoundControl implementation (in Pure Python), based
(somewhat) on the good old 'SimpleOSC' implementation by Daniel Holth & Clinton
McChesney.
This implementation is intended to still be 'simple' to the user, but much more
complete (with OSCServer & OSCClient classes) ... | bsd-2-clause |
baoboa/pyqt5 | examples/itemviews/frozencolumn/frozencolumn.py | 1 | 7103 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2017 Hans-Peter Jansen <hpj@urpla.net>
## Copyright (C) 2016 The Qt Company Ltd.
##
## This file is part of the examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## Commercial License Usage
##... | gpl-3.0 |
vertigo235/Sick-Beard-XEM | lib/hachoir_parser/misc/ole2.py | 90 | 14227 | """
Microsoft Office documents parser.
Informations:
* wordole.c of AntiWord program (v0.35)
Copyright (C) 1998-2003 A.J. van Os
Released under GNU GPL
http://www.winfield.demon.nl/
* File gsf-infile-msole.c of libgsf library (v1.14.0)
Copyright (C) 2002-2004 Jody Goldberg (jody@gnome.org)
Released under GNU... | gpl-3.0 |
MarcusTan/yncn-grid | venv/lib/python2.7/site-packages/werkzeug/contrib/sessions.py | 295 | 12450 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.sessions
~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains some helper classes that help one to add session
support to a python WSGI application. For full client-side session
storage see :mod:`~werkzeug.contrib.securecookie` which implements a
secure,... | mit |
olhoneles/olhoneles | montanha/forms.py | 1 | 1722 | # -*- coding: utf-8 -*-
#
# Copyright (©) 2013 Marcelo Jorge Vieira <metal@alucinados.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at ... | agpl-3.0 |
ztemt/NX510J_5.1_kernel | tools/perf/scripts/python/netdev-times.py | 11271 | 15048 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
qskycolor/viewfinder | backend/op/remove_contacts_op.py | 13 | 7230 | # Copyright 2013 Viewfinder Inc. All Rights Reserved.
"""Viewfinder RemoveContactsOperation.
This operation removes contacts.
"""
__authors__ = ['mike@emailscrubbed.com (Mike Purtell)']
from tornado import gen
from viewfinder.backend.base.exceptions import InvalidRequestError
from viewfinder.backend.db.contact imp... | apache-2.0 |
ksmit799/Toontown-Source | toontown/hood/BossbotHQ.py | 2 | 1699 | import CogHood
from toontown.toonbase import ToontownGlobals
from toontown.coghq import BossbotCogHQLoader
from toontown.hood import ZoneUtil
class BossbotHQ(CogHood.CogHood):
def __init__(self, parentFSM, doneEvent, dnaStore, hoodId):
CogHood.CogHood.__init__(self, parentFSM, doneEvent, dnaStore, hoodId)... | mit |
jiteshjha/remote-screen-control | pyxhook.py | 1 | 15967 | #!/usr/bin/python
#
# pyxhook -- an extension to emulate some of the PyHook library on linux.
#
# Copyright (C) 2008 Tim Alexander <dragonfyre13@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... | mit |
Limags/MissionPlanner | Lib/email/generator.py | 53 | 14294 | # Copyright (C) 2001-2010 Python Software Foundation
# Contact: email-sig@python.org
"""Classes to generate plain text from a message object tree."""
__all__ = ['Generator', 'DecodedGenerator']
import re
import sys
import time
import random
import warnings
from cStringIO import StringIO
from email.hea... | gpl-3.0 |
signed/intellij-community | plugins/hg4idea/testData/bin/hgext/interhg.py | 93 | 2836 | # interhg.py - interhg
#
# Copyright 2007 OHASHI Hideya <ohachige@gmail.com>
#
# Contributor(s):
# Edward Lee <edward.lee@engineering.uiuc.edu>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''expand expressions into changelog... | apache-2.0 |
40223249-1/-w16b_test | static/Brython3.1.3-20150514-095342/Lib/unittest/test/test_assertions.py | 738 | 15398 | import datetime
import warnings
import unittest
from itertools import product
class Test_Assertions(unittest.TestCase):
def test_AlmostEqual(self):
self.assertAlmostEqual(1.00000001, 1.0)
self.assertNotAlmostEqual(1.0000001, 1.0)
self.assertRaises(self.failureException,
... | agpl-3.0 |
f4exb/zfs-mania | zfile.py | 1 | 4902 | #!/usr/bin/env python
"""
Find details about a directory or plain file in a ZFS dataset using zdb utility
"""
import sys, os, traceback
import re
from optparse import OptionParser
# ======================================================================
class Error(Exception):
"""Base class for exceptions in this... | mit |
dmachaty/linux-bananapro | tools/perf/scripts/python/export-to-postgresql.py | 238 | 25591 | # export-to-postgresql.py: export perf data to a postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# Thi... | gpl-2.0 |
40223231/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/browser/local_storage.py | 617 | 2786 | # local storage in browser
import sys
from javascript import JSObject
class __UnProvided():
pass
class LocalStorage():
storage_type = "local_storage"
def __init__(self):
if not sys.has_local_storage:
raise EnvironmentError("LocalStorage not available")
self.store = JSObject(__... | gpl-3.0 |
luser/socorro | socorro/external/fs/fs_new_crash_source.py | 2 | 1974 | # 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/.
from configman import Namespace, RequiredConfig
from configman.converters import class_converter
from functools import ... | mpl-2.0 |
staticfloat/julia-buildbot | master/coverage.py | 1 | 7918 | ###############################################################################
# Define everything needed to do per-commit coverage testing on Linux
###############################################################################
import os
run_coverage_cmd = """
using Pkg
Pkg.activate("CoverageBase")
using CoverageBas... | mit |
anorfleet/turntable | test/lib/python2.7/site-packages/scipy/ndimage/interpolation.py | 12 | 26930 | # Copyright (C) 2003-2005 Peter J. Verveer
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following d... | mit |
SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/pyqtgraph/flowchart/Terminal.py | 23 | 20786 | # -*- coding: utf-8 -*-
from ..Qt import QtCore, QtGui
import weakref
from ..graphicsItems.GraphicsObject import GraphicsObject
from .. import functions as fn
from ..Point import Point
class Terminal(object):
def __init__(self, node, name, io, optional=False, multi=False, pos=None, renamable=False, removable=Fals... | gpl-3.0 |
gohin/django | django/contrib/gis/db/backends/base/models.py | 434 | 7111 | import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class SpatialRefSysMixin(object):
"""
The SpatialRefSysMixin is a class used by the database-dependent
SpatialRefSys objects to reduce redu... | bsd-3-clause |
gaurav38/QosRouting | pox/misc/gephi_topo.py | 7 | 6338 | # Copyright 2013 James McCauley
#
# 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 writi... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.