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 |
|---|---|---|---|---|---|
pra85/calibre | src/calibre/gui2/library/views.py | 3 | 44348 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import os, itertools, operator
from functools import partial
from future_builtins import map
from collections import Ordere... | gpl-3.0 |
lesh1k/beatport-verifier | v 1/BP_top100_v_1.1.0.py | 1 | 3528 | #This program is supposed to fetch the top 100 list from Beatport and compare it to the previously
#saved list, then present the difference, hence the new entries.
#Dependencies. It is written in Python 2.7 on Windows and it uses BeautifulSoup4
####Version log##################
#######################################... | cc0-1.0 |
jingzhehu/udacity_mlnd | P4_Training_a_Smartcab_to_Drive/smartcab/simulator.py | 1 | 8851 | import os
import time
import random
import importlib
class Simulator(object):
"""Simulates agents in a dynamic smartcab environment.
Uses PyGame to display GUI, if available.
"""
colors = {
'black' : ( 0, 0, 0),
'white' : (255, 255, 255),
'red' : (255, 0, 0),
... | mit |
cmlasu/smm_gem5 | src/arch/x86/isa/insts/simd64/integer/logical/__init__.py | 91 | 2347 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
ctwiz/stardust | qa/rpc-tests/test_framework/key.py | 1 | 7367 | # Copyright (c) 2011 Sam Rushing
#
# key.py - OpenSSL wrapper
#
# This file is modified from python-stardustlib.
#
"""ECC secp256k1 crypto routines
WARNING: This module does not mlock() secrets; your private keys may end up on
disk in swap! Use with caution!
"""
import ctypes
import ctypes.util
import hashlib
import... | mit |
midma101/AndIWasJustGoingToBed | .venv/lib/python2.7/site-packages/pip/utils/appdirs.py | 311 | 9173 | """
This code was taken from https://github.com/ActiveState/appdirs and modified
to suite our purposes.
"""
from __future__ import absolute_import
import os
import sys
from pip.compat import WINDOWS
def user_cache_dir(appname):
r"""
Return full path to the user-specific cache dir for this application.
... | mit |
halvertoluke/edx-platform | lms/djangoapps/static_template_view/views.py | 102 | 2181 | # View for semi-static templatized content.
#
# List of valid templates is explicitly managed for (short-term)
# security reasons.
from edxmako.shortcuts import render_to_response, render_to_string
from mako.exceptions import TopLevelLookupException
from django.shortcuts import redirect
from django.conf import setting... | agpl-3.0 |
asrie/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/layouttestresultsreader_unittest.py | 124 | 6488 | # Copyright (c) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
rspavel/spack | var/spack/repos/builtin/packages/protobuf/package.py | 3 | 5683 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack import *
import spack.util.web
class Protobuf(Package):
"""Google's data interchange format.""... | lgpl-2.1 |
TridevGuha/django | django/contrib/contenttypes/forms.py | 376 | 3849 | from __future__ import unicode_literals
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.forms import ModelForm, modelformset_factory
from django.forms.models import BaseModelFormSet
class BaseGenericInlineFormSet(BaseModelFormSet):
"""
A formset for generic... | bsd-3-clause |
mgraupe/acq4 | acq4/pyqtgraph/flowchart/FlowchartGraphicsView.py | 23 | 1364 | # -*- coding: utf-8 -*-
from ..Qt import QtGui, QtCore
from ..widgets.GraphicsView import GraphicsView
from ..GraphicsScene import GraphicsScene
from ..graphicsItems.ViewBox import ViewBox
class FlowchartGraphicsView(GraphicsView):
sigHoverOver = QtCore.Signal(object)
sigClicked = QtCore.Signal(object)
... | mit |
openstack/oslo.versionedobjects | oslo_versionedobjects/base.py | 1 | 51253 | # Copyright 2013 IBM Corp.
#
# 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 agree... | apache-2.0 |
kajgan/stbgui | lib/python/Components/ServiceEventTracker.py | 124 | 4175 | InfoBarCount = 0
class InfoBarBase:
onInfoBarOpened = [ ]
onInfoBarClosed = [ ]
@staticmethod
def connectInfoBarOpened(fnc):
if not fnc in InfoBarBase.onInfoBarOpened:
InfoBarBase.onInfoBarOpened.append(fnc)
@staticmethod
def disconnectInfoBarOpened(fnc):
if fnc in InfoBarBase.onInfoBarOpened:
InfoB... | gpl-2.0 |
veger/ansible | lib/ansible/modules/files/synchronize.py | 3 | 22176 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012-2013, Timothy Appnel <tim@appnel.com>
# 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__ = typ... | gpl-3.0 |
internap/netman | tests/core/objects/flow_control_switch_test.py | 4 | 17625 | # Copyright 2015 Internap.
#
# 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, so... | apache-2.0 |
chdecultot/frappe | frappe/website/render.py | 2 | 8753 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
import frappe.sessions
from frappe.utils import cstr
import os, mimetypes, json
import six
from six import iteritems
from werkzeug.wrappers imp... | mit |
ruleant/buildtime-trend | buildtimetrend/collection.py | 1 | 2160 | # vim: set expandtab sw=4 ts=4:
'''
Dictionary based collection class.
Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
This file is part of buildtime-trend
<https://github.com/ruleant/buildtime-trend/>
This program is free software: you can redistribute it and/or modify
it under the terms of t... | gpl-3.0 |
tntnatbry/tensorflow | tensorflow/compiler/tests/clustering_test.py | 123 | 3878 | # 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 |
NoctuaNivalis/qutebrowser | qutebrowser/utils/error.py | 4 | 2462 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
Edraak/edraak-platform | openedx/core/djangoapps/certificates/api.py | 11 | 3466 | """
The public API for certificates.
"""
import logging
from datetime import datetime
from pytz import UTC
from lms.djangoapps.certificates.models import CertificateWhitelist
from openedx.core.djangoapps.certificates.config import waffle
from student.models import CourseEnrollment
log = logging.getLogger(__name__)
... | agpl-3.0 |
rimsleur/QSLime | debugger/DebugDataProvider.py | 2 | 2104 | # coding: utf8
"""
Данные для отладчика
"""
import json
from PyQt4 import QtGui
class DebugDataProvider ():
@classmethod
def __init__ (cls, main_window):
cls.STEP_TYPE_STEP_OVER = 1
cls.STEP_TYPE_STEP_INTO_PROCEDURE = 2
cls.STEP_TYPE_STEP_INTO_MODULE = 3
cls.STEP_TYPE_STEP_OUT_PROCEDURE = 4
cls.STEP_TYPE... | gpl-2.0 |
henkhaus/wow | testing/plotter.py | 1 | 1278 | from pymongo import MongoClient
from matplotlib import pyplot as plt
import os
from datetime import datetime, date, time, timedelta
client = MongoClient()
# using wowtest.auctiondata
db = client.wowtest
posts = db.auctiondata
auctions = posts.find().limit(10)
#time.time() into datetime --->
#datetime.datetime.fromti... | apache-2.0 |
davy39/eric | Graphics/UMLDialog.py | 1 | 14316 | # -*- coding: utf-8 -*-
# Copyright (c) 2007 - 2014 Detlev Offenbach <detlev@die-offenbachs.de>
#
"""
Module implementing a dialog showing UML like diagrams.
"""
from __future__ import unicode_literals
from PyQt5.QtCore import pyqtSlot, Qt, QFileInfo
from PyQt5.QtWidgets import QAction, QToolBar, QGraphicsScene
fr... | gpl-3.0 |
bwrsandman/OpenUpgrade | addons/stock_picking_wave/stock_picking_wave.py | 272 | 3494 | # -*- coding: utf-8 -*-
from openerp.osv import fields, osv
from openerp.tools.translate import _
class stock_picking_wave(osv.osv):
_name = "stock.picking.wave"
_description = "Picking Wave"
_order = "name desc"
_columns = {
'name': fields.char('Picking Wave Name', required=True, help='Name of... | agpl-3.0 |
mhaessig/servo | tests/wpt/css-tests/tools/py/py/_code/_assertionnew.py | 217 | 12384 | """
Find intermediate evalutation results in assert statements through builtin AST.
This should replace _assertionold.py eventually.
"""
import sys
import ast
import py
from py._code.assertion import _format_explanation, BuiltinAssertionError
if sys.platform.startswith("java") and sys.version_info < (2, 5, 2):
... | mpl-2.0 |
kylefrost/budget | main.py | 1 | 1783 | from flask import Flask, render_template, request, redirect
from sql import select
# Create Flask app
app = Flask(__name__)
# API Blueprint
from api import api
app.register_blueprint(api, url_prefix="/api")
# Load Index page
@app.route("/")
def index():
return render_template("index.html")
# ... | gpl-3.0 |
kangkot/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32/Demos/win32netdemo.py | 18 | 8343 | import sys
import win32api
import win32net
import win32netcon
import win32security
import getopt
import traceback
verbose_level = 0
server = None # Run on local machine.
def verbose(msg):
if verbose_level:
print msg
def CreateUser():
"Creates a new test user, then deletes the user"
testName = "P... | apache-2.0 |
y-zeng/grpc | src/python/grpcio_tests/tests/unit/resources.py | 25 | 2145 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
davidjb/sqlalchemy | test/sql/test_returning.py | 22 | 13405 | from sqlalchemy.testing import eq_
from sqlalchemy import testing
from sqlalchemy.testing.schema import Table, Column
from sqlalchemy.types import TypeDecorator
from sqlalchemy.testing import fixtures, AssertsExecutionResults, engines, \
assert_raises_message
from sqlalchemy import exc as sa_exc
from sqlalchemy imp... | mit |
ucb-sejits/opentuner | opentuner/utils/compactdb.py | 5 | 1397 | #!/usr/bin/env python
if __name__ == '__main__':
import adddeps
import argparse
import logging
import sys
import opentuner
from opentuner.resultsdb.models import *
log = logging.getLogger('opentuner.utils.compactdb')
argparser = argparse.ArgumentParser()
argparser.add_argument('database')
argparser.add_argument(... | mit |
ApptuitAI/xcollector | collectors/etc/metric_naming.py | 1 | 1357 | #!/usr/bin/env python
def print_if_apptuit_standard_metric(metric, mapping, timestamp, value, tags=None, tags_str=None):
if metric not in list(mapping["metrics"].keys()):
return
new_metric_name = mapping["metrics"][metric]["standard_name"]
new_metric_tags_str = ""
if tags is not None or tags_st... | lgpl-3.0 |
mikebenfield/scikit-learn | sklearn/neighbors/regression.py | 26 | 10999 | """Nearest Neighbor Regression"""
# Authors: Jake Vanderplas <vanderplas@astro.washington.edu>
# Fabian Pedregosa <fabian.pedregosa@inria.fr>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Sparseness support by Lars Buitinck
# Multi-output support by Arnaud Joly <a.joly@ulg.ac... | bsd-3-clause |
romain-dartigues/ansible | lib/ansible/modules/network/nxos/nxos_vtp_password.py | 50 | 8054 | #!/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 |
pacemkr/secrets | termbox/termbox_c/libtermbox/tools/collect_terminfo.py | 6 | 2070 | #!/usr/bin/env python
import sys, os, subprocess
def escaped(s):
return s.replace("\033", "\\033")
def tput(term, name):
try:
return subprocess.check_output(['tput', '-T%s' % term, name]).decode()
except subprocess.CalledProcessError as e:
return e.output.decode()
def w(s):
if s == None:
return
sys.stdo... | bsd-2-clause |
hogarthj/ansible | lib/ansible/modules/cloud/amazon/ec2_vpc_net.py | 8 | 18132 | #!/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 |
JoshH100/android_kernel_samsung_trlte | scripts/gcc-wrapper.py | 264 | 3486 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2012, The Linux Foundation. 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 th... | gpl-2.0 |
kiyukuta/chainer | chainer/links/connection/n_step_rnn.py | 1 | 10731 | import numpy
import six
from chainer import cuda
from chainer.functions.array import permutate
from chainer.functions.array import transpose_sequence
from chainer.functions.connection import n_step_rnn as rnn
from chainer import link
from chainer.utils import argument
from chainer import variable
def argsort_list_de... | mit |
vierja/hadoop-per-mare | src/examples/python/pyAbacus/JythonAbacus.py | 123 | 2767 | #
# 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 |
asser/django | django/db/backends/mysql/client.py | 520 | 1518 | import subprocess
from django.db.backends.base.client import BaseDatabaseClient
class DatabaseClient(BaseDatabaseClient):
executable_name = 'mysql'
@classmethod
def settings_to_cmd_args(cls, settings_dict):
args = [cls.executable_name]
db = settings_dict['OPTIONS'].get('db', settings_dic... | bsd-3-clause |
spektom/incubator-airflow | airflow/exceptions.py | 4 | 3708 | #
# 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 |
auduny/home-assistant | homeassistant/components/input_select/__init__.py | 10 | 5451 | """Support to select an option from a list."""
import logging
import voluptuous as vol
from homeassistant.const import ATTR_ENTITY_ID, CONF_ICON, CONF_NAME
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.restore_state i... | apache-2.0 |
kubernetes-client/python | kubernetes/client/models/v2beta2_resource_metric_source.py | 1 | 4559 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | apache-2.0 |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/twisted/internet/_producer_helpers.py | 14 | 3788 | # -*- test-case-name: twisted.test.test_producer_helpers -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Helpers for working with producers.
"""
from __future__ import division, absolute_import
from zope.interface import implementer
from twisted.internet.interfaces import IPushProduce... | gpl-2.0 |
nico202/pyNeMo | plugins/images/membrane.py | 1 | 1385 | #Save spiking:
saveSourceImage(output_firings, '.' + general_config_hash + config_hash + '.png')
for neuron in to_save:
stims = []
n = 0
for n in range(0, general_config.steps):
if n in config.step_input:
found = False
for s in config.step_input[n]:
if s[0] ==... | gpl-2.0 |
Ms2ger/servo | tests/wpt/css-tests/tools/pywebsocket/src/test/mock.py | 465 | 6715 | # Copyright 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | mpl-2.0 |
rzambre/servo | tests/wpt/web-platform-tests/tools/wptserve/tests/functional/base.py | 86 | 1917 | from __future__ import print_function
import base64
import logging
import os
import unittest
import urllib
import urllib2
import urlparse
import wptserve
logging.basicConfig()
wptserve.logger.set_logger(logging.getLogger())
here = os.path.split(__file__)[0]
doc_root = os.path.join(here, "docroot")
class Request(u... | mpl-2.0 |
Aravinthu/odoo | doc/_extensions/pyjsparser/pyjsparserdata.py | 36 | 11395 | # The MIT License
#
# Copyright 2014, 2015 Piotr Dabkowski
#
# 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, modif... | agpl-3.0 |
greyhwndz/electron | tools/compile-coffee.py | 143 | 1138 | #!/usr/bin/env python
import os
import subprocess
import sys
SOURCE_ROOT = os.path.dirname(os.path.dirname(__file__))
WINDOWS_NODE_PATHs = os.environ['PATH'].split(os.pathsep) + [
'C:/Program Files (x86)/nodejs',
'C:/Program Files/nodejs',
]
NIX_NODE_PATHs = os.environ['PATH'].split(os.pathsep) + [
'/usr/local... | mit |
danielfrg/ec2hosts | ec2hosts/cli.py | 1 | 1208 | from __future__ import print_function, absolute_import, division
import sys
import click
CONTEXT_SETTINGS = dict(help_option_names=['-h', '--help'])
import ec2hosts
def main():
try:
cli(obj={})
except Exception as e:
import traceback
click.echo(traceback.format_exc(), err=True)
... | apache-2.0 |
nikhilraog/boto | tests/integration/codedeploy/__init__.py | 586 | 1123 | # Copyright (c) 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights ... | mit |
muggot/python-goose | tests/tests.py | 1 | 24622 | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | apache-2.0 |
SciTools/conda-testenv | conda_testenv/tests/integration/test.py | 1 | 2011 | import os
import shutil
import subprocess
import sys
import tempfile
import unittest
class Test_cli(unittest.TestCase):
def setUp(self):
conda = os.path.join(os.path.dirname(sys.executable), 'conda')
self.environ = os.environ.copy()
self.tmpdir = tempfile.mkdtemp('conda_setup')
co... | bsd-3-clause |
VRciF/springy | src/node_modules/node-gyp/gyp/gyptest.py | 1752 | 8019 | #!/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.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... | gpl-3.0 |
BorisJeremic/Real-ESSI-Examples | analytic_solution/test_cases/27NodeBrick/cantilever_irregular_element/shape1/vertical_load/compare_txt.py | 637 | 2094 | #!/usr/bin/python
import h5py
import sys
import numpy as np
import os
import re
import random
# find the path to my own python function:
cur_dir=os.getcwd()
sep='test_cases'
test_DIR=cur_dir.split(sep,1)[0]
scriptDIR=test_DIR+'compare_function'
sys.path.append(scriptDIR)
# import my own function for color and comparat... | cc0-1.0 |
mou4e/zirconium | build/android/pylib/utils/reraiser_thread.py | 51 | 4650 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Thread and ThreadGroup that reraise exceptions on the main thread."""
# pylint: disable=W0212
import logging
import sys
import threading
import traceback... | bsd-3-clause |
Neurita/pelican-plugins | textile_reader/textile_reader.py | 59 | 2145 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function
from pelican import signals
from pelican.readers import BaseReader
from pelican.utils import pelican_open
try:
from textile import textile
except ImportError:
textile = False
class TextileReader(BaseReader):
"""Reader for Te... | agpl-3.0 |
kwilliams-mo/iris | lib/iris/tests/unit/fileformats/pp/test__field_gen.py | 2 | 4019 | # (C) British Crown Copyright 2013, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | gpl-3.0 |
mahak/nova | nova/policies/server_topology.py | 3 | 1646 | #
# 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
# ... | apache-2.0 |
googleapis/googleapis-gen | google/cloud/domains/v1beta1/domains-v1beta1-py/noxfile.py | 1 | 3585 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
gregdek/ansible | lib/ansible/modules/cloud/vultr/vultr_block_storage_facts.py | 28 | 3494 | #!/usr/bin/python
#
# (c) 2018, Yanis Guenane <yanis+ansible@guenane.org>
# 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',
... | gpl-3.0 |
MLWave/auto-sklearn | autosklearn/wrapper_for_SMAC.py | 5 | 3119 | try:
import cPickle as pickle
except:
import pickle
import os
import time
import signal
import sys
import lockfile
from HPOlibConfigSpace import configuration_space
from autosklearn.data.data_manager import DataManager
import autosklearn.models.holdout_evaluator
from autosklearn.models.paramsklearn import g... | bsd-3-clause |
viger/docker | proxy/proxy/code/default/gae_proxy/server/lib/httplib2/__init__.py | 5 | 69728 | from __future__ import generators
"""
httplib2
A caching http interface that supports ETags and gzip
to conserve bandwidth.
Requires Python 2.3 or later
Changelog:
2007-08-18, Rick: Modified so it's able to use a socks proxy if needed.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright... | mit |
popazerty/dvbapp2-gui | lib/python/Screens/InfoBarGenerics.py | 1 | 171496 | # -*- coding: utf-8 -*-
from Screens.ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.ActionMap import NumberActionMap
from Components.Harddisk import harddiskmanager, findMountPoint
from Components.Input impo... | gpl-2.0 |
apache/aurora | src/main/python/apache/aurora/executor/executor_vars.py | 5 | 3087 | #
# 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 ... | apache-2.0 |
badlogicmanpreet/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/rcsetup.py | 69 | 23344 | """
The rcsetup module contains the default values and the validation code for
customization using matplotlib's rc settings.
Each rc setting is assigned a default value and a function used to validate any
attempted changes to that setting. The default values and validation functions
are defined in the rcsetup module, ... | agpl-3.0 |
TRex22/Sick-Beard | lib/hachoir_parser/archive/ace.py | 90 | 9964 | """
ACE parser
From wotsit.org and the SDK header (bitflags)
Partial study of a new block type (5) I've called "new_recovery", as its
syntax is very close to the former one (of type 2).
Status: can only read totally file and header blocks.
Author: Christophe Gisquet <christophe.gisquet@free.fr>
Creation date: 19 jan... | gpl-3.0 |
dmillington/ansible-modules-core | cloud/openstack/_quantum_floating_ip_associate.py | 6 | 8225 | #!/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 |
lubosch/productivity-classifier-linux | Xlib/keysymdef/korean.py | 14 | 2860 | XK_Hangul = 0xff31
XK_Hangul_Start = 0xff32
XK_Hangul_End = 0xff33
XK_Hangul_Hanja = 0xff34
XK_Hangul_Jamo = 0xff35
XK_Hangul_Romaja = 0xff36
XK_Hangul_Codeinput = 0xff37
XK_Hangul_Jeonja = 0xff38
XK_Hangul_Banja = 0xff39
XK_Hangul_PreHanja = 0xff3a
XK_Hangul_PostHanja = 0xff3b
XK_Hangul_SingleCandidate = 0xff3c
XK_Han... | gpl-2.0 |
HiSPARC/station-software | user/python/Lib/lib-tk/Tkinter.py | 1 | 160467 | """Wrapper functions for Tcl/Tk.
Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.
... | gpl-3.0 |
sanghinitin/golismero | thirdparty_libs/django/db/models/fields/related.py | 78 | 64058 | from operator import attrgetter
from django.db import connection, connections, router
from django.db.backends import util
from django.db.models import signals, get_model
from django.db.models.fields import (AutoField, Field, IntegerField,
PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist)
from dja... | gpl-2.0 |
spadgos/sublime-jsdocs | jsdocs.py | 5 | 56128 | """
DocBlockr v2.14.1
by Nick Fisher, and all the great people listed in CONTRIBUTORS.md
https://github.com/spadgos/sublime-jsdocs
*** Please read CONTIBUTING.md before sending pull requests. Thanks! ***
"""
import sublime
import sublime_plugin
import re
import datetime
import time
import imp
from functools import re... | mit |
Dino0631/RedRain-Bot | lib/youtube_dl/extractor/cbsnews.py | 3 | 4180 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .cbs import CBSIE
from ..utils import (
parse_duration,
)
class CBSNewsIE(CBSIE):
IE_NAME = 'cbsnews'
IE_DESC = 'CBS News'
_VALID_URL = r'https?://(?:www\.)?cbsnews\.com/(?:news|videos)/(?P<id>[\da-z_-]+)'
... | gpl-3.0 |
cslzchen/osf.io | admin_tests/banners/test_views.py | 14 | 4951 | import pytest
from admin.banners import views
from datetime import timedelta
from django.utils import timezone
from django.test import RequestFactory
from django.contrib.auth.models import Permission
from django.core.exceptions import PermissionDenied
from osf.models import ScheduledBanner
from osf_tests.factories... | apache-2.0 |
SAM-IT-SA/odoo | addons/point_of_sale/report/pos_details.py | 42 | 9585 | # -*- 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 |
rgacogne/pdns | regression-tests.ixfrdist/test_IXFR.py | 5 | 5588 | import dns
import time
from ixfrdisttests import IXFRDistTest
from xfrserver.xfrserver import AXFRServer
zones = {
1: """
$ORIGIN example.
@ 86400 SOA foo bar 1 2 3 4 5
@ 4242 NS ns1.example.
@ 4242 NS ns2.example.
ns1.example. 4242 A 192.0.2.1
ns2.example. 4... | gpl-2.0 |
weimingtom/python-for-android | python3-alpha/python3-src/Lib/plat-darwin/IN.py | 109 | 13954 | # Generated by h2py from /usr/include/netinet/in.h
# Included from sys/appleapiopts.h
# Included from sys/_types.h
# Included from sys/cdefs.h
def __P(protos): return protos
def __STRING(x): return #x
def __P(protos): return ()
def __STRING(x): return "x"
def __attribute__(x): return
def __COPYRIGHT(s): return ... | apache-2.0 |
GiterLab/goots | doc/ots_python_sdk_2.0.6/ots2/metadata.py | 6 | 3390 | # -*- coding: utf8 -*-
from ots2.error import *
__all__ = [
'INF_MIN',
'INF_MAX',
'TableMeta',
'CapacityUnit',
'ReservedThroughput',
'ReservedThroughputDetails',
'UpdateTableResponse',
'DescribeTableResponse',
'RowDataItem',
'Condition',
'PutRowItem',
'UpdateRowItem',
... | mit |
murrown/cyder | vendor-local/src/django-extensions/build/lib/django_extensions/management/commands/print_settings.py | 16 | 1994 | """
print_settings
==============
Django command similar to 'diffsettings' but shows all active Django settings.
"""
from django.core.management.base import NoArgsCommand
from django.conf import settings
from optparse import make_option
class Command(NoArgsCommand):
"""print_settings command"""
help = "Pri... | bsd-3-clause |
bcarroll/authmgr | python-3.6.2-Win64/Lib/site-packages/psycopg2/tests/test_ipaddress.py | 16 | 4753 | #!/usr/bin/env python
#
# test_ipaddress.py - tests for ipaddress support
#
# Copyright (C) 2016 Daniele Varrazzo <daniele.varrazzo@gmail.com>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundatio... | bsd-3-clause |
brupoon/mustachedNinja | any_lowercase_test.py | 1 | 1080 | #Chapter 9, Exercise 11...any_lowercase tests
def any_lowercase1(s):
for c in s:
if c.islower():
return True
else:
return False
def any_lowercase2(s):
for c in s:
if 'c'.islower():
return 'True'
else:
return 'False'
... | mit |
JerryWong0119/CocosBuilder-3.0-alpha5 | CocosBuilder/libs/cocos2d-iphone/tools/tmx-embeded-2-png.py | 50 | 3840 | #!/usr/bin/python
# ----------------------------------------------------------------------------
# TMX / TSX: embeded images to individual png files
#
# Parses a TMX or TSX file. If it has embeded images, it generates indiviaul .PNG files
# After running this script is suggested that you run the mkatlas.pl script to
# ... | mit |
epitron/youtube-dl | youtube_dl/extractor/cbsinteractive.py | 28 | 4044 | # coding: utf-8
from __future__ import unicode_literals
import re
from .cbs import CBSIE
from ..utils import int_or_none
class CBSInteractiveIE(CBSIE):
_VALID_URL = r'https?://(?:www\.)?(?P<site>cnet|zdnet)\.com/(?:videos|video(?:/share)?)/(?P<id>[^/?]+)'
_TESTS = [{
'url': 'http://www.cnet.com/vide... | unlicense |
mpunkenhofer/irc-telegram-bot | telepot/telepot/aio/__init__.py | 1 | 26958 | import io
import json
import time
import asyncio
import traceback
import collections
from concurrent.futures._base import CancelledError
from . import helper, api
from .. import _BotBase, flavor, _find_first_key, _isstring, _dismantle_message_identifier, _strip, _rectify
# Patch aiohttp for sending unicode filename
fr... | mit |
zengenti/ansible | lib/ansible/modules/cloud/openstack/os_router.py | 12 | 14139 | #!/usr/bin/python
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it ... | gpl-3.0 |
matiasherranz/keyczar | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/compat/__init__.py | 19 | 8831 | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... | apache-2.0 |
coursemdetw/2014cdb | wsgi/static/Brython2.1.3-20140704-213726/Lib/test/support.py | 111 | 67787 | """Supporting definitions for the Python regression tests."""
if __name__ != 'test.support':
raise ImportError('support must be imported from the test package')
import contextlib
import errno
import functools
import gc
import socket
import sys
import os
import platform
import shutil
import warnings
import unittes... | gpl-2.0 |
Semi-global/edx-platform | lms/djangoapps/instructor/offline_gradecalc.py | 73 | 4371 | """
======== Offline calculation of grades =============================================================
Computing grades of a large number of students can take a long time. These routines allow grades to
be computed offline, by a batch process (eg cronjob).
The grades are stored in the OfflineComputedGrade table of... | agpl-3.0 |
amcat/amcat | api/rest/viewsets/coding/codingschemafield.py | 1 | 2536 | ###########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | agpl-3.0 |
ProjectSWGCore/NGECore2 | scripts/conversation/imp_recruiter.py | 2 | 15196 | from resources.common import ConversationOption
from resources.common import OutOfBand
from resources.common import ProsePackage
from resources.common import RadialOptions
from resources.datatables import PvpStatus
from resources.datatables import FactionStatus
from services.sui import SUIWindow
from services.sui.SUIW... | lgpl-3.0 |
kamsuri/vms | vms/pom/pages/basePage.py | 1 | 1809 | class BasePage(object):
"""Base class to initialize the base page that will be called from all pages"""
def __init__(self, driver):
self.driver = driver
def send_value_to_element_id(self, key, value):
self.driver.find_element_by_id(key).send_keys(value)
def send_value_to_xpath(self, k... | gpl-2.0 |
gnieboer/tensorflow | tensorflow/python/debug/wrappers/hooks.py | 32 | 13374 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
zhangjunlei26/servo | tests/wpt/css-tests/tools/webdriver/webdriver/exceptions.py | 263 | 6460 | """Definition of WebDriverException classes."""
def create_webdriver_exception_strict(status_code, message):
"""Create the appropriate WebDriverException given the status_code."""
if status_code in _exceptions_strict:
return _exceptions_strict[status_code](message)
return UnknownStatusCodeException... | mpl-2.0 |
BrittAndrews/martin-june | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py | 2736 | 1804 | # 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.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
class Writer(object):
"""Visual Studio XML tool file writer."""
... | apache-2.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/networkx/algorithms/assortativity/tests/test_mixing.py | 6 | 6591 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx as nx
from base_test import BaseTestAttributeMixing, BaseTestDegreeMixing
class TestDegreeMixingDict(BaseTestDegreeMixing):
def test_degree_mixing_dict_undirected(self):
d = nx.degree_mixing_dict(self.P4)
d_r... | gpl-3.0 |
akashsinghal/Speech-Memorization-App | Python_Backend/env/lib/python3.6/site-packages/pip/_vendor/distlib/markers.py | 1261 | 6282 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Parser for the environment markers micro-language defined in PEP 345."""
import ast
import os
import sys
import platform
from .compa... | apache-2.0 |
TzarIvan/profitpy | profit/session/collection.py | 18 | 4963 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2007 Troy Melhase, Yichun Wei
# Distributed under the terms of the GNU General Public License v2
# Author: Troy Melhase <troy@gci.net>
# Yichun Wei <yichun.wei@gmail.com>
import os
from cPickle import PicklingError, UnpicklingError, dump, load
from P... | gpl-2.0 |
fboers/jumegX | decompose/dimension_selection.py | 2 | 8869 | # Authors: Lukas Breuer <l.breuer@fz-juelich.de>
"""
----------------------------------------------------------------------
--- jumeg.decompose.fourier_ica --------------------------------------
----------------------------------------------------------------------
author : Lukas Breuer
email : l.breuer@fz-... | bsd-3-clause |
DarKnight24/owtf | framework/lib/owtf_process.py | 2 | 1865 | #!/usr/bin/env python
"""
Consists of owtf process class and its manager
"""
from multiprocessing import Process, Queue
from framework.dependency_management.dependency_resolver import BaseComponent
class OWTFProcess(Process, BaseComponent):
"""
Implementing own proxy of Process for better control of process... | bsd-3-clause |
chaen/DIRAC | Core/Workflow/Step.py | 4 | 17267 | """ Implementation of a step
"""
#pylint: disable=unused-wildcard-import,wildcard-import
from __future__ import print_function
import os
import time
import traceback
import sys
from DIRAC.Core.Workflow.Parameter import *
from DIRAC.Core.Workflow.Module import *
from DIRAC import S_OK, S_ERROR
__RCSID__ = "$Id$"
cla... | gpl-3.0 |
anthonysandrin/kafka-utils | tests/acceptance/steps/util.py | 1 | 4458 | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.