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 |
|---|---|---|---|---|---|
PrismTech/opensplice | build/scripts/overnight/python/DBMSConnect.py | 2 | 12435 | import sys
import os
import json
import shutil
import subprocess
import fileinput
import platform
import time
from shutil import copy
import example_logparser
from example_exceptions import LogCheckFail
from Example import Example
from Example import ExeThread
import pdb
"""
Class specific to the DBMSConnect exampl... | gpl-3.0 |
MakeHer/edx-platform | cms/djangoapps/contentstore/views/tests/test_course_index.py | 25 | 36973 | """
Unit tests for getting the list of courses and the course outline.
"""
import ddt
import json
import lxml
import datetime
import mock
import pytz
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.test.utils import override_settings
from django.utils.translation import... | agpl-3.0 |
robbiet480/home-assistant | homeassistant/components/xs1/__init__.py | 8 | 2700 | """Support for the EZcontrol XS1 gateway."""
import asyncio
import logging
import voluptuous as vol
import xs1_api_client
from homeassistant.const import (
CONF_HOST,
CONF_PASSWORD,
CONF_PORT,
CONF_SSL,
CONF_USERNAME,
)
from homeassistant.helpers import discovery
import homeassistant.helpers.confi... | apache-2.0 |
hendradarwin/VTK | Filters/General/Testing/Python/clipImage.py | 20 | 1534 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create pipeline
#
v16 = vtk.vtkVolume16Reader()
v16.SetDataDimensions(64,64)
v16.GetOutput().SetOrigin(0.0,0.0,0.0)
v16.SetDataByteOrderToLittleEndian()
v16.SetFilePrefix("" + str(V... | bsd-3-clause |
dhruv13J/scikit-learn | sklearn/decomposition/nmf.py | 15 | 19103 | """ Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck <L.J.Buitinck@uva.nl>
# Author: Chih-Jen Lin, National Taiwan University (original projected gradient
# NMF implementation)
# Author: Anthony Di Franco (original Python and NumPy port)
# License: BSD 3 clause
from __future__ ... | bsd-3-clause |
toinbis/369old | src/web369/conf/base.py | 1 | 2325 | from pkg_resources import resource_filename
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'web369',
'USER': 'root',
'PASSWORD': '',
}
}... | bsd-3-clause |
ZhangXinNan/tensorflow | tensorflow/python/ops/parallel_for/pfor.py | 2 | 101653 | # Copyright 2018 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 |
danviv/trading-with-python | cookbook/reconstructVXX/reconstructVXX.py | 77 | 3574 | # -*- coding: utf-8 -*-
"""
Reconstructing VXX from futures data
author: Jev Kuznetsov
License : BSD
"""
from __future__ import division
from pandas import *
import numpy as np
import os
class Future(object):
""" vix future class, used to keep data structures simple """
def __init__(self,serie... | bsd-3-clause |
plaes/numpy | doc/source/conf.py | 6 | 8773 | # -*- coding: utf-8 -*-
import sys, os, re
# Check Sphinx version
import sphinx
if sphinx.__version__ < "0.5":
raise RuntimeError("Sphinx 0.5.dev or newer required")
# -----------------------------------------------------------------------------
# General configuration
# -----------------------------------------... | bsd-3-clause |
smallyear/linuxLearn | salt/salt/client/ssh/state.py | 1 | 6047 | # -*- coding: utf-8 -*-
'''
Create ssh executor system
'''
from __future__ import absolute_import
# Import python libs
import os
import tarfile
import tempfile
import json
import shutil
from contextlib import closing
# Import salt libs
import salt.client.ssh.shell
import salt.client.ssh
import salt.utils
import salt.u... | apache-2.0 |
doganov/edx-platform | common/djangoapps/enrollment/data.py | 41 | 9880 | """
Data Aggregation Layer of the Enrollment API. Collects all enrollment specific data into a single
source to be used throughout the API.
"""
import logging
from django.contrib.auth.models import User
from opaque_keys.edx.keys import CourseKey
from enrollment.errors import (
CourseEnrollmentClosedError, CourseE... | agpl-3.0 |
xodus7/tensorflow | tensorflow/java/maven/tensorflow-android/update.py | 27 | 3972 | # 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 appl... | apache-2.0 |
marcoarruda/MissionPlanner | Lib/site-packages/scipy/fftpack/benchmarks/bench_basic.py | 63 | 7559 | """ Test functions for fftpack.basic module
"""
import sys
from numpy.testing import *
from scipy.fftpack import ifft, fft, fftn, irfft, rfft
from numpy import arange, asarray, zeros, dot, exp, pi, double, cdouble
import numpy.fft
from numpy.random import rand
def random(size):
return rand(*size)
def direct_dft(... | gpl-3.0 |
cbeck88/fifengine | engine/python/fife/extensions/cegui/ceguibasicapplication.py | 2 | 4813 | # -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | lgpl-2.1 |
shuangshuangwang/spark | examples/src/main/python/mllib/gradient_boosting_classification_example.py | 27 | 2446 | #
# 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 |
rapidpro/chatpro | chatpro/rooms/models.py | 1 | 2494 | from __future__ import absolute_import, unicode_literals
from chatpro.profiles.tasks import sync_org_contacts
from dash.orgs.models import Org
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
class Room(models.Model):
"""
Corresp... | bsd-3-clause |
sbalde/edxplatform | common/djangoapps/third_party_auth/tests/specs/test_testshib.py | 24 | 12276 | """
Third_party_auth integration tests using a mock version of the TestShib provider
"""
import json
import unittest
import httpretty
from mock import patch
from django.core.urlresolvers import reverse
from openedx.core.lib.json_utils import EscapedEdxJSONEncoder
from student.tests.factories import UserFactory
from... | agpl-3.0 |
JoKnopp/wp-import | test/test_postgresql.py | 1 | 4427 | # -*- coding: UTF-8 -*-
# © Copyright 2009 Wolodja Wentland. All Rights Reserved.
# This file is part of wp-import.
#
# wp-import 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 Licen... | gpl-3.0 |
simonfork/aquaria | ExternalLibs/freetype2/src/tools/glnames.py | 259 | 103407 | #!/usr/bin/env python
#
#
# FreeType 2 glyph name builder
#
# Copyright 1996-2000, 2003, 2005, 2007, 2008 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.... | gpl-2.0 |
ep1cman/workload-automation | wlauto/instrumentation/daq/__init__.py | 2 | 20324 | # Copyright 2013-2015 ARM Limited
#
# 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 w... | apache-2.0 |
danielchalef/gensim | gensim/corpora/bleicorpus.py | 68 | 4496 | #!/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
"""
Blei's LDA-C format.
"""
from __future__ import with_statement
from os import path
import logging
from gensim import interfaces,... | gpl-3.0 |
40223220/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/draw.py | 603 | 6456 | from javascript import console
from browser import timer
import math
class Queue:
def __init__(self):
self._list=[]
def empty(self):
return len(self._list) == 0
def put(self, element):
self._list.append(element)
def get(self):
if len(self._list) == 0:
raise BaseError
... | gpl-3.0 |
BadDNA/anolis | web/env/lib/python2.6/site-packages/pip-0.7.2-py2.6.egg/pip/locations.py | 3 | 1508 | """Locations where we look for configs, install stuff, etc"""
import sys
import os
from distutils import sysconfig
if getattr(sys, 'real_prefix', None):
## FIXME: is build/ a good name?
build_prefix = os.path.join(sys.prefix, 'build')
src_prefix = os.path.join(sys.prefix, 'src')
else:
## FIXME: this i... | bsd-3-clause |
bgris/ODL_bgris | lib/python3.5/site-packages/qtconsole/mainwindow.py | 7 | 31388 | """The Qt MainWindow for the QtConsole
This is a tabbed pseudo-terminal of Jupyter sessions, with a menu bar for
common actions.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import sys
import webbrowser
from threading import Thread
from qtconsole.qt import... | gpl-3.0 |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/django/contrib/contenttypes/tests/tests.py | 12 | 10973 | from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.views import shortcut
from django.contrib.sites.shortcuts import get_current_site
from django.core.management import call_command
from django.http import HttpRequest, Http404
from django.... | mit |
koichi626/hadoop-gpu | hadoop-gpu-0.20.1/build/contrib/hod/testing/testModule.py | 182 | 2187 | #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 thi... | apache-2.0 |
sonnyhu/numpy | numpy/lib/info.py | 61 | 6353 | """
Basic functions used by several sub-packages and
useful to have in the main name-space.
Type Handling
-------------
================ ===================
iscomplexobj Test for complex object, scalar result
isrealobj Test for real object, scalar result
iscomplex Test for complex elements, array res... | bsd-3-clause |
fillycheezstake/MissionPlanner | ExtLibs/Mavlink/mavgen.py | 34 | 3007 | #!/usr/bin/env python
'''
parse a MAVLink protocol XML file and generate a python implementation
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
def mavgen(opts, args) :
"""Generate mavlink message formatters and parsers (C and Python ) using options
and args where args ... | gpl-3.0 |
SebastianLloret/Clever-Bot | libpasteurize/fixes/fix_kwargs.py | 61 | 6008 | u"""
Fixer for Python 3 function parameter syntax
This fixer is rather sensitive to incorrect py3k syntax.
"""
# Note: "relevant" parameters are parameters following the first STAR in the list.
from lib2to3 import fixer_base
from lib2to3.fixer_util import token, String, Newline, Comma, Name
from libfuturize.fixer_uti... | gpl-3.0 |
jazkarta/edx-platform | common/lib/xmodule/xmodule/vertical_block.py | 56 | 5689 | """
VerticalBlock - an XBlock which renders its children in a column.
"""
import logging
from copy import copy
from lxml import etree
from xblock.core import XBlock
from xblock.fragment import Fragment
from xmodule.mako_module import MakoTemplateBlockBase
from xmodule.progress import Progress
from xmodule.seq_module im... | agpl-3.0 |
jonathonwalz/ansible | lib/ansible/modules/storage/zfs/zpool_facts.py | 69 | 6653 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.com>
#
# 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 L... | gpl-3.0 |
zzicewind/nova | nova/tests/unit/objects/test_virt_cpu_topology.py | 94 | 1397 | # 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
# d... | apache-2.0 |
ChristianKniep/QNIB | serverfiles/usr/local/lib/networkx-1.6/build/lib/networkx/algorithms/tests/test_product.py | 3 | 10011 | import networkx as nx
from networkx import tensor_product,cartesian_product,lexicographic_product,strong_product
from nose.tools import assert_raises, assert_true, assert_equal
def test_tensor_product_raises():
G = nx.DiGraph()
H = nx.Graph()
assert_raises(nx.NetworkXError,tensor_product,G,H)
def test_ten... | gpl-2.0 |
tafaRU/odoo | addons/l10n_multilang/__init__.py | 438 | 1082 | # -*- 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 |
shiora/The-Perfect-Pokemon-Team-Balancer | libs/env/Lib/site-packages/whoosh/lang/porter2.py | 117 | 8314 | """An implementation of the Porter2 stemming algorithm.
See http://snowball.tartarus.org/algorithms/english/stemmer.html
Adapted from pyporter2 by Michael Dirolf.
This algorithm is more correct but (at least in this implementation)
several times slower than the original porter algorithm as implemented
in stemming.por... | gpl-2.0 |
nxnfufunezn/servo | tests/wpt/harness/wptrunner/wptmanifest/tests/test_static.py | 139 | 2863 | # 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 unittest
from cStringIO import StringIO
from ..backends import static
# There aren't many tests here because i... | mpl-2.0 |
Azure/azure-sdk-for-python | sdk/databoxedge/azure-mgmt-databoxedge/tests/test_cli_mgmt_databoxedge.py | 1 | 16519 | # 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.
#----------------------------------------------------------------------... | mit |
dmacvicar/spacewalk | client/solaris/smartpm/smart/channels/rpm_md_info.py | 6 | 1125 | #
# Copyright (c) 2004 Conectiva, Inc.
#
# Written by Gustavo Niemeyer <niemeyer@conectiva.com>
#
# This file is part of Smart Package Manager.
#
# Smart Package Manager 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 Fou... | gpl-2.0 |
nicolargo/intellij-community | python/helpers/docutils/parsers/rst/languages/sv.py | 57 | 3988 | # $Id: sv.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: Adam Chodorowski <chodorowski@users.sourceforge.net>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# read <http://docutils.sf.net/docs/howto/i18n.html>. Two files mu... | apache-2.0 |
MrLoick/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/integration/POP3_TLS.py | 271 | 5466 | """TLS Lite + poplib."""
import socket
from poplib import POP3
from gdata.tlslite.TLSConnection import TLSConnection
from gdata.tlslite.integration.ClientHelper import ClientHelper
# POP TLS PORT
POP3_TLS_PORT = 995
class POP3_TLS(POP3, ClientHelper):
"""This class extends L{poplib.POP3} with TLS support."""
... | apache-2.0 |
hkemmel/tal | affichage.py | 1 | 2209 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 25 14:34:25 2017
@author: manfred.madelaine
"""
import time
def affStart():
msg1 = "*** Binvenue dans i-Opinion ou Opinion Way ***"
msg2 = "Le logiciel d'analyse et de classification des revues cinématographiques !"
listMsg = []
listMsg.append("")
... | gpl-3.0 |
wangyikai/linux | tools/perf/scripts/python/net_dropmonitor.py | 1812 | 1749 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
LuizGsa21/p4-conference-central | models.py | 1 | 7226 | #!/usr/bin/env python
"""models.py
Udacity conference server-side Python App Engine data & ProtoRPC models
$Id: models.py,v 1.1 2014/05/24 22:01:10 wesc Exp $
created/forked from conferences.py by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import httplib
import endpoints
from protor... | apache-2.0 |
tequa/ammisoft | ammimain/WinPython-64bit-2.7.13.1Zero/python-2.7.13.amd64/Lib/site-packages/matplotlib/axis.py | 4 | 85084 | """
Classes for the ticks and x and y axis
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from matplotlib import rcParams
import matplotlib.artist as artist
from matplotlib.artist import allow_rasterization
import matplotlib.cbook as cbook
i... | bsd-3-clause |
brettwooldridge/buck | third-party/py/pywatchman/pywatchman/encoding.py | 29 | 2957 | # Copyright 2016-present Facebook, 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 of conditions a... | apache-2.0 |
gratteur/zim-desktop | zim/config/manager.py | 5 | 10560 | # -*- coding: utf-8 -*-
# Copyright 2013 Jaap Karssenberg <jaap.karssenberg@gmail.com>
from __future__ import with_statement
from weakref import WeakValueDictionary
from . import basedirs
from .dicts import INIConfigFile
from zim.fs import FileNotFoundError
from zim.signals import ConnectorMixin, SignalEmitter, ... | gpl-2.0 |
PyBossa/pybossa | pybossa/default_settings.py | 1 | 4813 | # -*- coding: utf8 -*-
# This file is part of PYBOSSA.
#
# Copyright (C) 2015 Scifabric LTD.
#
# PYBOSSA 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 your op... | agpl-3.0 |
computersalat/ansible | test/support/integration/plugins/modules/postgresql_query.py | 53 | 10477 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Felix Archambault
# Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru>
# 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)... | gpl-3.0 |
Naoto-Imamachi/MIRAGE | scripts/module/preparation/phastcons_score_list.py | 1 | 3683 | #!usr/bin/env python
import sys
import re
import shelve
from parameter.common_parameters import common_parameters
import utils.setting_utils as utils
utils.now_time("phastcons_score_list script starting...")
p = utils.Bunch(common_parameters)
def main():
utils.now_time("Input_file: " + p.phastcons_sc... | mit |
guewen/odoo | addons/project_issue/res_config.py | 441 | 1492 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
matthiasdiener/spack | var/spack/repos/builtin/packages/paml/package.py | 5 | 2221 | ##############################################################################
# Copyright (c) 2013-2018, 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 |
nyasara/azuremono-docker | IronPython-2.7.4/Lib/encodings/cp861.py | 93 | 35587 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors=... | mit |
alrusdi/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/templates/unicode.py | 39 | 1290 | # -*- coding: utf-8 -*-
from unittest import TestCase
from django.template import Template, TemplateEncodingError, Context
from django.utils.safestring import SafeData
class UnicodeTests(TestCase):
def test_template(self):
# Templates can be created from unicode strings.
t1 = Template(u'ŠĐĆŽćžšđ ... | gpl-3.0 |
HarborYuan/cashier | env/Lib/site-packages/wheel/signatures/__init__.py | 70 | 3766 | """
Create and verify jws-js format Ed25519 signatures.
"""
import json
from ..util import urlsafe_b64decode, urlsafe_b64encode, native, binary
__all__ = ['sign', 'verify']
ed25519ll = None
ALG = "Ed25519"
def get_ed25519ll():
"""Lazy import-and-test of ed25519 module"""
global ed25519ll
if not ed255... | mit |
DerekK88/PICwriter | picwriter/components/stripslotconverter.py | 1 | 9317 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import numpy as np
import gdspy
import picwriter.toolkit as tk
class StripSlotConverter(tk.Component):
"""Strip-to-Slot Side Converter Cell class. Adiabatically transforms a strip to a slot waveguide mode,... | mit |
EricForgy/JuliaBox | container/interactive/IJulia/tornado/src/gdrivesync.py | 4 | 9487 | import base64
import shutil
import os
import hashlib
import time
import datetime
import pytz
import isodate
from oauth2client.client import OAuth2Credentials
from oauth2client import GOOGLE_REVOKE_URI, GOOGLE_TOKEN_URI, GOOGLE_AUTH_URI
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
class G... | mit |
dzamie/weasyl | weasyl/blocktag.py | 1 | 4024 | # blocktag.py
from error import PostgresError
import define as d
import profile
import searchtag
from libweasyl import ratings
from weasyl.cache import region
# For blocked tags, `rating` refers to the lowest rating for which that tag is
# blocked; for example, (X, Y, 10) would block tag Y for all ratings, whereas... | apache-2.0 |
phihag/youtube-dl | youtube_dl/extractor/primesharetv.py | 73 | 1853 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
sanitized_Request,
urlencode_postdata,
)
class PrimeShareTVIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?primeshare\.tv/download/(?P<id>[\da-zA-Z]+)'
_TEST = {
'url': 'h... | unlicense |
atruberg/django-custom | django/contrib/admin/templatetags/log.py | 114 | 2125 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | bsd-3-clause |
henrytao-me/openerp.positionq | openerp/addons/pad_project/__openerp__.py | 119 | 1478 | # -*- 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 |
guewen/OpenUpgrade | openerp/service/server.py | 32 | 35650 | #-----------------------------------------------------------
# Threaded, Gevent and Prefork Servers
#-----------------------------------------------------------
import datetime
import errno
import logging
import os
import os.path
import platform
import psutil
import random
if os.name == 'posix':
import resource
els... | agpl-3.0 |
MoamerEncsConcordiaCa/tensorflow | tensorflow/python/ops/spectral_ops.py | 38 | 4414 | # 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 |
ryfeus/lambda-packs | Tensorflow_LightGBM_Scipy_nightly/source/scipy/stats/_binned_statistic.py | 10 | 25912 | from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.six import callable, xrange
from scipy._lib._numpy_compat import suppress_warnings
from collections import namedtuple
__all__ = ['binned_statistic',
'binned_statistic_2d',
'binned_statistic_dd']
... | mit |
kenshay/ImageScript | ProgramData/SystemFiles/Python/Lib/idlelib/IdleHistory.py | 122 | 4052 | "Implement Idle Shell history mechanism with History class"
from idlelib.configHandler import idleConf
class History:
''' Implement Idle Shell history mechanism.
store - Store source statement (called from PyShell.resetoutput).
fetch - Fetch stored statement matching prefix already entered.
history_n... | gpl-3.0 |
HesselTjeerdsma/Cyber-Physical-Pacman-Game | Algor/flask/lib/python2.7/site-packages/flask/blueprints.py | 169 | 16872 | # -*- coding: utf-8 -*-
"""
flask.blueprints
~~~~~~~~~~~~~~~~
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrap... | apache-2.0 |
cloudbase/nova-virtualbox | nova/virt/ironic/patcher.py | 7 | 7408 | # coding=utf-8
#
# Copyright 2014 Hewlett-Packard Development Company, L.P.
# Copyright 2014 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
#
# ... | apache-2.0 |
KyleJamesWalker/ansible | lib/ansible/modules/cloud/openstack/_quantum_subnet.py | 12 | 10250 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | gpl-3.0 |
IronLanguages/ironpython3 | Src/StdLib/Lib/email/encoders.py | 146 | 1786 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Encodings and related functions."""
__all__ = [
'encode_7or8bit',
'encode_base64',
'encode_noop',
'encode_quopri',
]
from base64 import encodebytes as _bencode
from quopri import encode... | apache-2.0 |
YehudaItkin/virt-test | virttest/staging/backports/__init__.py | 23 | 3497 | """
This module contains backported functions that are not present in Python 2.4
but are standard in more recent versions.
"""
import re
import sys
# Import backported modules
import simplejson
import collections
import itertools
if not hasattr(itertools, 'product'):
import _itertools
itertools.product = _ite... | gpl-2.0 |
EndyKaufman/django-postgres-angularjs-blog | app/manager/migrations/0006_properties.py | 1 | 1170 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-04-24 14:05
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):
dependencies = [
migrations.swappable_dependency... | mit |
interfect/cjdns | node_build/dependencies/libuv/build/gyp/pylib/gyp/input.py | 292 | 114315 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | gpl-3.0 |
Andy-Amoy/shadowsocks | shadowsocks/asyncdns.py | 655 | 17416 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | apache-2.0 |
robinro/ansible-modules-extras | network/f5/bigip_sys_db.py | 23 | 5861 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2016 F5 Networks 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
# ... | gpl-3.0 |
bert9bert/statsmodels | statsmodels/tsa/statespace/kalman_filter.py | 2 | 86079 | """
State Space Representation and Kalman Filter
Author: Chad Fulton
License: Simplified-BSD
"""
from __future__ import division, absolute_import, print_function
from warnings import warn
import numpy as np
from .representation import OptionWrapper, Representation, FrozenRepresentation
from .tools import (validate_v... | bsd-3-clause |
rjw57/cubbie | migrations/versions/316bb58e84f_add_user_identities.py | 1 | 1110 | """add user_identities
Revision ID: 316bb58e84f
Revises: 38c8ec357e0
Create Date: 2015-03-11 01:40:12.157458
"""
# revision identifiers, used by Alembic.
revision = '316bb58e84f'
down_revision = '38c8ec357e0'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic ... | mit |
njl/pycon | symposion/schedule/tests/factories.py | 3 | 1750 | import datetime
import factory
import factory.fuzzy
from pycon.tests.factories import PyConTutorialProposalFactory
from symposion.conference.models import Section
from symposion.conference.tests.factories import SectionFactory
from symposion.speakers.tests.factories import SpeakerFactory
from ..models import Presenta... | bsd-3-clause |
cwgreene/Nanostructure-Simulator | utils/plot_trajectories.py | 1 | 1140 | import os
import sys
import re
import pylab
def parse_trajectory_line(line):
trajectory = []
for x,y in re.findall("\(([0-9.]+), ([0-9.]+)\)",line):
trajectory.append((float(x),float(y)))
return trajectory
def generate_trajectories(file):
#get rid fo two first lines
file.readline()
file.readline()
#parse eac... | mit |
guymakam/Kodi-Israel | plugin.video.israelive/resources/lib/livestreamer/requests/packages/chardet/big5prober.py | 2931 | 1684 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-2.0 |
danieljaouen/ansible | lib/ansible/plugins/inventory/auto.py | 25 | 2196 | # Copyright (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
name: auto
plugin_type: inventory
author:
- Matt Davis <@nitzm... | gpl-3.0 |
jonathansick/androcmd | scripts/phat_baseline_test.py | 1 | 3612 | #!/usr/bin/env python
# encoding: utf-8
"""
Grid computation of dust attenuation for old vs. young stellar populations.
2015-05-12 - Created by Jonathan Sick
"""
import argparse
from androcmd.phatpipeline import PhatCatalog
from androcmd.baselineexp import SolarZPipeline, ThreeZPipeline
def main():
args = pars... | mit |
vlinhd11/vlinhd11-android-scripting | python/gdata/tests/gdata_tests/codesearch_test.py | 133 | 1930 | #!/usr/bin/python
#
# Copyright (C) 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/scipy/stats/_stats_mstats_common.py | 12 | 8157 | from collections import namedtuple
import numpy as np
from . import distributions
__all__ = ['_find_repeats', 'linregress', 'theilslopes']
def linregress(x, y=None):
"""
Calculate a linear least-squares regression for two sets of measurements.
Parameters
----------
x, y : array_like
T... | mit |
lhellebr/spacewalk | backend/server/rhnLib.py | 1 | 8211 | #
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | gpl-2.0 |
h4ck3rm1k3/MapNickAutotools | scons/scons-local-1.2.0/SCons/Tool/suncc.py | 12 | 1857 | """SCons.Tool.suncc
Tool-specific initialization for Sun Solaris (Forte) CC and cc.
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 The SCons F... | lgpl-2.1 |
SabunMacTavish/CTF-Platform | api/autogenerators/rtfm.py | 2 | 1943 | __author__ = "Collin Petty"
__copyright__ = "Carnegie Mellon University"
__license__ = "MIT"
__maintainer__ = ["Collin Petty", "Peter Chapman"]
__credits__ = ["David Brumely", "Collin Petty", "Peter Chapman"]
__email__ = ["collin@cmu.edu", "peter@cmu.edu"]
__status__ = "Production"
import tempfile
import os
import rand... | mit |
esthermm/odoomrp-wip | stock_quant_valuation/models/stock_quant.py | 8 | 1040 | # -*- coding: utf-8 -*-
# (c) 2016 Ainara Galdona - AvanzOSC
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
from openerp import fields, api, models
from openerp.addons import decimal_precision as dp
class StockQuant(models.Model):
_inherit = 'stock.quant'
@api.multi
@api.depends("prod... | agpl-3.0 |
jy723/ardupilot | mk/PX4/Tools/genmsg/src/genmsg/names.py | 215 | 5223 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, 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... | gpl-3.0 |
INM-6/nest-git-migration | topology/examples/conncomp.py | 13 | 4213 | # -*- coding: utf-8 -*-
#
# conncomp.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# ... | gpl-2.0 |
geomagpy/magpy | magpy/lib/format_dtu.py | 3 | 5567 | """
MagPy
Auxiliary input filter - WIC/WIK
Written by Roman Leonhardt June 2012
- contains test and read function, toDo: write function
"""
from __future__ import print_function
from magpy.stream import *
def isDTU1(filename):
"""
Checks whether a file is ASCII DTU (type1) format used within the DTU's FGE net... | bsd-3-clause |
m-r-hunt/invaders | enemies.py | 1 | 6646 | # Invaders
# Copyright (C) 2013 Maximilian Hunt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is ... | gpl-2.0 |
MERegistro/meregistro | django/contrib/admin/templatetags/admin_list.py | 43 | 12835 | import datetime
from django.conf import settings
from django.contrib.admin.util import lookup_field, display_for_field, label_for_field
from django.contrib.admin.views.main import ALL_VAR, EMPTY_CHANGELIST_VALUE
from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR
from django.cor... | bsd-3-clause |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/sklearn/datasets/tests/test_samples_generator.py | 3 | 7262 | import numpy as np
from numpy.testing import assert_equal, assert_approx_equal, \
assert_array_almost_equal
from nose.tools import assert_true
from sklearn.utils.testing import assert_less
from .. import make_classification
from .. import make_multilabel_classification
from .. import make_ha... | agpl-3.0 |
CalvinHsu1223/LinuxCNC-EtherCAT-HAL-Driver | configs/sim/gscreen_custom/gscreen_handler.py | 25 | 4194 | # This is a handler file for using Gscreen's infrastructure
# to load a completely custom glade screen
# The only things that really matters is that it's saved as a GTK builder project,
# the toplevel window is caller window1 (The default name) and you connect a destroy
# window signal else you can't close down linuxcn... | gpl-2.0 |
bowang/tensorflow | tensorflow/compiler/tests/ternary_ops_test.py | 101 | 4286 | # 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 |
thaihungle/deepexp | rare-mann/mimic_gen.py | 1 | 5981 | import numpy as np
import os
import random
import pickle
class MimicDataLoader(object):
def __init__(self, data_folder, batch_size=1, max_sequence=10, max_iter=None, split = 0.75, train_keep=1):
super(MimicDataLoader, self).__init__()
self.data_folder = data_folder
self.batch_size = batch... | mit |
persandstrom/home-assistant | homeassistant/components/device_tracker/luci.py | 4 | 5240 | """
Support for OpenWRT (luci) routers.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/device_tracker.luci/
"""
import json
import logging
import re
import requests
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from home... | apache-2.0 |
abadger/ansible-modules-core | network/nxos/nxos_vxlan_vtep_vni.py | 19 | 19617 | #!/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 |
ukanga/SickRage | lib/html5lib/sanitizer.py | 805 | 16428 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... | gpl-3.0 |
openprocurement/restkit | restkit/filters.py | 2 | 3801 | # -*- coding: utf-8 -
#
# This file is part of restkit released under the MIT license.
# See the NOTICE for more information.
import base64
import re
try:
from urlparse import parse_qsl
except ImportError:
from cgi import parse_qsl
from urlparse import urlunparse
from restkit.oauth2 import Request, Signature... | apache-2.0 |
DxCx/nzbToMedia | libs/beets/ui/commands.py | 4 | 50834 | # This file is part of beets.
# Copyright 2014, Adrian Sampson.
#
# 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, ... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.