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 |
|---|---|---|---|---|---|
bowenliu16/deepchem | examples/tox21/tox21_tf_progressive.py | 3 | 1049 | """
Script that trains progressive multitask models on Tox21 dataset.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
import shutil
import numpy as np
import deepchem as dc
from tox21_datasets import load_tox21
# Only for debug!
np.random.see... | gpl-3.0 |
acmaheri/sms-tools | software/transformations/stftTransformations.py | 4 | 5645 | # functions that implement transformations using the stft
import numpy as np
import sys, os, math
from scipy.signal import resample
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../models/'))
import dftModel as DFT
def stftFiltering(x, fs, w, N, H, filter):
"""
Apply a filter to a sound... | agpl-3.0 |
igemsoftware/SYSU-Software2013 | project/Python27/Tools/scripts/texi2html.py | 46 | 69824 | #! /usr/bin/env python
# Convert GNU texinfo files into HTML, one file per node.
# Based on Texinfo 2.14.
# Usage: texi2html [-d] [-d] [-c] inputfile outputdirectory
# The input file must be a complete texinfo file, e.g. emacs.texi.
# This creates many files (one per info node) in the output directory,
# overwriting e... | mit |
nox/servo | tests/wpt/harness/wptrunner/browsers/webdriver.py | 194 | 4219 | # 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 errno
import socket
import time
import traceback
import urlparse
import mozprocess
from .base import get_free_p... | mpl-2.0 |
Vingaard/conpot | conpot/protocols/kamstrup/usage_simulator.py | 3 | 4908 | # Copyright (C) 2014 Johnny Vestergaard <jkv@unixcluster.dk>
#
# 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... | gpl-2.0 |
SpectraLogic/samba | third_party/dnspython/tests/resolver.py | 56 | 4279 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-3.0 |
mibanescu/pulp | server/pulp/server/managers/repo/unit_association.py | 4 | 18861 | """
Contains the manager class and exceptions for handling the mappings between
repositories and content units.
"""
from gettext import gettext as _
import logging
import sys
from celery import task
import mongoengine
import pymongo
from pulp.common import error_codes
from pulp.plugins.conduits.unit_import import Imp... | gpl-2.0 |
ratoaq2/deluge | deluge/ui/gtkui/status_tab.py | 1 | 5369 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
from _... | gpl-3.0 |
trilomix/kmappy | blam.py | 1 | 1403 | #!/usr/bin/env python
import wx
from wx import Config
import blam
from blamframe import *
from multiprocessing import freeze_support
class blamapp(wx.App):
def OnInit(self):
## wxConfig *config = new wxConfig(wxT("Karnaugh Map Minimizer"));
##
## wxString lang;
## if ( config->Read(wxT("Language"), &lang) )
##... | mit |
PlayUAV/MissionPlanner | Lib/encodings/cp857.py | 93 | 34858 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.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=... | gpl-3.0 |
saurabh6790/medapp | accounts/doctype/sales_invoice/pos.py | 29 | 1618 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
@webnotes.whitelist()
def get_items(price_list, sales_or_purchase, item=None, item_group=None):
condition = ""
args = {"price_list... | agpl-3.0 |
civato/Note8.0-StormBorn | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
jianwei1216/my-scripts | mytest/argparse/misc.py | 1 | 13565 | #!/usr/bin/python
# -*- conding:UTF-8 -*-
import sys
import os
import ssh
import thread
import time
import argparse
import textwrap
# according ssh get a client for remote exec cmds, close after using
def get_ssh_client(host):
global args
client = ssh.SSHClient()
client.set_missing_host_key_policy(ssh.Aut... | gpl-2.0 |
Unity-Technologies/ml-agents | ml-agents-envs/mlagents_envs/communicator_objects/agent_info_pb2.py | 1 | 5851 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlagents_envs/communicator_objects/agent_info.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from googl... | apache-2.0 |
totallybradical/temp_servo2 | tests/wpt/web-platform-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 |
marcusramberg/dotfiles | bin/.venv-ansible-venv/lib/python2.6/site-packages/paramiko/agent.py | 5 | 11531 | # Copyright (C) 2003-2007 John Rochester <john@jrochester.org>
#
# This file is part of paramiko.
#
# Paramiko 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 2.1 of the License, or (at ... | mit |
davenovak/mtasa-blue | vendor/google-breakpad/src/third_party/protobuf/protobuf/gtest/run_tests.py | 199 | 2336 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | gpl-3.0 |
lancezlin/pyjs | examples/showcase/src/demos_widgets/textArea.py | 6 | 2160 | """
The ``ui.TextArea`` class implements a standard multi-line input field.
The ``setCharacterWidth()`` method sets the width of the input field, in
characters, while ``setVisibleLines()`` sets the height of the field, in lines.
Use the ``getText()`` method to retrieve the field's current text, and
``setText()`` to s... | apache-2.0 |
thundernet8/WRGameVideos-API | venv/lib/python2.7/site-packages/jinja2/utils.py | 323 | 16560 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import errno
from collections import deque
from threading import Lock
from jinja2._compat import text_type, string_types, impl... | gpl-2.0 |
Edu-Glez/Bank_sentiment_analysis | env/lib/python3.6/site-packages/numpy/ma/tests/test_mrecords.py | 35 | 20707 | # pylint: disable-msg=W0611, W0612, W0511,R0201
"""Tests suite for mrecords.
:author: Pierre Gerard-Marchant
:contact: pierregm_at_uga_dot_edu
"""
from __future__ import division, absolute_import, print_function
import warnings
import pickle
import numpy as np
import numpy.ma as ma
from numpy import recarray
from n... | apache-2.0 |
BiaDarkia/scikit-learn | examples/tree/plot_iris.py | 30 | 2062 | """
================================================================
Plot the decision surface of a decision tree on the iris dataset
================================================================
Plot the decision surface of a decision tree trained on pairs
of features of the iris dataset.
See :ref:`decision tree ... | bsd-3-clause |
mupi/tecsaladeaula | accounts/forms.py | 1 | 8712 | # -*- coding: utf-8 -*-
import datetime
import requests
from django.contrib.auth import get_user_model
from django import forms
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.core.mail import send_mail
from django.template.loader import get_template
from django.temp... | agpl-3.0 |
elventear/ansible | lib/ansible/modules/network/cumulus/cl_bond.py | 5 | 15915 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
dnozay/testlink-code | third_party/fckeditor/editor/filemanager/connectors/py/fckcommands.py | 48 | 6335 | #!/usr/bin/env python
"""
FCKeditor - The text editor for Internet - http://www.fckeditor.net
Copyright (C) 2003-2010 Frederico Caldeira Knabben
== BEGIN LICENSE ==
Licensed under the terms of any of the following licenses at your
choice:
- GNU General Public License Version 2 or later (the "GPL")
http://www.gnu.or... | gpl-2.0 |
JFriel/honours_project | venv/lib/python2.7/site-packages/requests/auth.py | 355 | 8175 | # -*- coding: utf-8 -*-
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import os
import re
import time
import hashlib
import threading
from base64 import b64encode
from .compat import urlparse, str
from .cookies import extract_cookies_to_jar
from .utils import pa... | gpl-3.0 |
mropert/conan | conans/server/rest/api_v1.py | 4 | 2145 | from bottle import Bottle
from conans.server.rest.bottle_plugins.http_basic_authentication import HttpBasicAuthentication
from conans.server.rest.bottle_plugins.jwt_authentication import JWTAuthentication
from conans.server.rest.bottle_plugins.return_handler import ReturnHandlerPlugin
from conans.errors import EXCEPTIO... | mit |
feroda/django | tests/gis_tests/gdal_tests/test_ds.py | 21 | 11450 | import os
import unittest
from unittest import skipUnless
from django.contrib.gis.gdal import HAS_GDAL
from ..test_data import TEST_DATA, TestDS, get_ds_file
if HAS_GDAL:
from django.contrib.gis.gdal import DataSource, Envelope, OGRGeometry, GDALException, OGRIndexError, GDAL_VERSION
from django.contrib.gis.... | bsd-3-clause |
persandstrom/home-assistant | homeassistant/monkey_patch.py | 1 | 2319 | """Monkey patch Python to work around issues causing segfaults.
Under heavy threading operations that schedule calls into
the asyncio event loop, Task objects are created. Due to
a bug in Python, GC may have an issue when switching between
the threads and objects with __del__ (which various components
in HASS have).
... | apache-2.0 |
loseblue/vim-ycm-windows-64 | python/ycm/client/base_request.py | 6 | 6840 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | gpl-3.0 |
jbedorf/tensorflow | tensorflow/contrib/boosted_trees/estimator_batch/custom_export_strategy_test.py | 47 | 9513 | # 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 |
alshedivat/tensorflow | tensorflow/python/debug/wrappers/local_cli_wrapper_test.py | 9 | 33763 | # 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 |
kartikp1995/gnuradio | gr-wxgui/python/wxgui/plotter/gltext.py | 37 | 16891 | #!/usr/bin/env python
# -*- coding: utf-8
#
# Provides some text display functions for wx + ogl
# Copyright (C) 2007 Christian Brugger, Stefan Hacker
#
# 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 ... | gpl-3.0 |
saratang/servo | tests/wpt/web-platform-tests/tools/manifest/update.py | 230 | 3336 | #!/usr/bin/env python
import argparse
import imp
import os
import sys
import manifest
import vcs
from log import get_logger
from tree import GitTree, NoVCSTree
here = os.path.dirname(__file__)
localpaths = imp.load_source("localpaths", os.path.abspath(os.path.join(here, os.pardir, "localpaths.py")))
def update(tests... | mpl-2.0 |
jeffery-do/Vizdoombot | doom/lib/python3.5/site-packages/PIL/FpxImagePlugin.py | 7 | 6323 | #
# THIS IS WORK IN PROGRESS
#
# The Python Imaging Library.
# $Id$
#
# FlashPix support for PIL
#
# History:
# 97-01-25 fl Created (reads uncompressed RGB images only)
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1997.
#
# See the README file for information on usage and redistribution.
#
f... | mit |
migueldiascosta/pymatgen | pymatgen/transformations/tests/test_defect_transformations.py | 2 | 4980 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Unit tests for defect transformations
"""
__author__ = "Bharat Medasani"
__copyright__ = "Copyright 2014, The Materials Project"
__version__ = "0.1"
__ma... | mit |
SteveDiamond/cvxpy | cvxpy/atoms/norm1.py | 2 | 3043 | """
Copyright 2013 Steven Diamond
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... | gpl-3.0 |
incaser/odoo-odoo | addons/product_extended/wizard/wizard_price.py | 270 | 3043 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>).
# $Id$
#
# This program is free... | agpl-3.0 |
blueboxgroup/horizon | horizon/utils/units.py | 71 | 4365 | # 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 |
apixandru/intellij-community | python/helpers/py3only/docutils/writers/odf_odt/pygmentsformatter.py | 244 | 4671 | # $Id: pygmentsformatter.py 5853 2009-01-19 21:02:02Z dkuhlman $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Additional support for Pygments formatter.
"""
import pygments
import pygments.formatter
class OdtPygmentsFormatter(pygments.formatter.For... | apache-2.0 |
pranjulkansal/wordbase-solver-master | find.py | 3 | 2554 | #!/usr/bin/env python
import sys
import sqlite3 as db
import codecs
from copy import deepcopy
sy,sx,ty,tx=0,0,0,0
nope, lang, infile = sys.argv[0:3]
if len(sys.argv)>3:
sy, sx = [int(x) for x in sys.argv[3:5]]
if len(sys.argv)>5:
ty, tx = [int(x) for x in sys.argv[5:7]]
conn = db.connect("%s.sqlite" % lang)
c ... | cc0-1.0 |
duniter/duniter-python-api | examples/save_and_load_private_key_file_ewif.py | 2 | 2435 | """
Copyright 2014-2021 Vincent Texier <vit@free.fr>
DuniterPy 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.
DuniterPy is distributed in... | gpl-3.0 |
teamtuga4/teamtuga4ever.repository | script.module.urlresolver/lib/urlresolver/plugins/vidspot.py | 3 | 2377 | '''
Allmyvideos urlresolver plugin
Copyright (C) 2013 Vinnydude
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 i... | gpl-2.0 |
dashea/anaconda | tests/gui/test_reclaim.py | 3 | 2568 | #!/usr/bin/python3
#
# Copyright (C) 2014 Red Hat, Inc.
#
# This program 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 2.1 of the License, or
# (at your option) any later version.
#
# ... | gpl-2.0 |
shepdelacreme/ansible | lib/ansible/parsing/vault/__init__.py | 12 | 52120 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
# (c) 2016, Adrian Likins <alikins@redhat.com>
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
#
# 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, eith... | gpl-3.0 |
cliqz/socorro | alembic/versions/22ec34ad88fc_fixes_bug_963600_add.py | 14 | 1034 | """Fixes bug 963600 - add_new_release() and update_product_versions()
Revision ID: 22ec34ad88fc
Revises: 4bb277899d74
Create Date: 2014-01-24 17:17:06.598669
"""
# revision identifiers, used by Alembic.
revision = '22ec34ad88fc'
down_revision = '4bb277899d74'
from alembic import op
from socorro.lib import citexttyp... | mpl-2.0 |
Javiercerna/MissionPlanner | Lib/site-packages/numpy/doc/broadcasting.py | 95 | 5511 | """
========================
Broadcasting over arrays
========================
The term broadcasting describes how numpy treats arrays with different
shapes during arithmetic operations. Subject to certain constraints,
the smaller array is "broadcast" across the larger array so that they
have compatible shapes. Broadc... | gpl-3.0 |
davidnmurray/iris | lib/iris/experimental/regrid_conservative.py | 3 | 12088 | # (C) British Crown Copyright 2013 - 2015, 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 l... | gpl-3.0 |
LaughingSun/three.js | utils/exporters/blender/addons/io_three/exporter/api/light.py | 104 | 1461 | from bpy import data, types
from .. import utilities, logger
def _lamp(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
"""
if isinstance(name, types.Lamp):
lamp = name
... | mit |
HomeRad/TorCleaner | tests/proxy/rfc2616/test_datedwarn.py | 1 | 4112 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2005-2010 Bastian Kleineidam
"""
"""
import time
from .. import ProxyTest
from wc.http.date import get_date_rfc1123
class test_datedwarn_1old_0cur_0fut(ProxyTest):
def test_datedwarn_1old_0cur_0fut(self):
self.start_test()
def get_response_headers(self, ... | gpl-2.0 |
FHannes/intellij-community | python/testData/MockSdk3.2/Lib/numbers.py | 110 | 10330 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.
TODO: Fill out more detailed documentation on the operators."""
from abc import ABCMeta, abstractmethod, abstractproperty
__all__ = ["Number", "Comp... | apache-2.0 |
Neural-Network/TicTacToe | examples/rl/environments/cartpole/cart_fem.py | 30 | 1688 | #!/usr/bin/env python
#########################################################################
# Reinforcement Learning with FEM on the CartPoleEnvironment
#
# Requirements: pylab (for plotting only). If not available, comment the
# last 3 lines out
####################################################################... | bsd-3-clause |
susansls/zulip | analytics/tests/test_views.py | 9 | 16348 | from __future__ import absolute_import
from django.utils.timezone import get_fixed_timezone, utc
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.timestamp import ceiling_to_hour, ceiling_to_day, \
datetime_to_timestamp
from zerver.models import Realm, UserProfile, Client, get_realm, \
get_use... | apache-2.0 |
carletes/libcloud | libcloud/test/loadbalancer/test_gce.py | 32 | 9055 | # 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 ... | apache-2.0 |
dan1/horizon-proto | openstack_dashboard/contrib/sahara/content/data_processing/nodegroup_templates/tests.py | 12 | 12171 | # 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 |
jindongh/boto | tests/unit/ec2/elb/test_listener.py | 114 | 4478 | #!/usr/bin/env python
import xml.sax
from tests.unit import unittest
import boto.resultset
from boto.ec2.elb.loadbalancer import LoadBalancer
from boto.ec2.elb.listener import Listener
LISTENERS_RESPONSE = b"""<?xml version="1.0" encoding="UTF-8"?>
<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.am... | mit |
tavaresdong/courses | ucb_cs61A/projects/scheme/buffer.py | 3 | 3806 | """The buffer module assists in iterating through lines and tokens."""
import math
class Buffer:
"""A Buffer provides a way of accessing a sequence of tokens across lines.
Its constructor takes an iterator, called "the source", that returns the
next line of tokens as a list each time it is queried, or No... | mit |
dreibh/planetlab-lxc-plcapi | PLC/Timestamp.py | 1 | 5841 | #
# Utilities to handle timestamps / durations from/to integers and strings
#
# datetime.{datetime,timedelta} are powerful tools, but these objects are not
# natively marshalled over xmlrpc
#
import time, calendar
import datetime
from PLC.Faults import *
from PLC.Parameter import Parameter, Mixed
# a dummy class mos... | bsd-3-clause |
mitsuhiko/click | src/click/shell_completion.py | 1 | 16736 | import os
import re
from .core import Argument
from .core import MultiCommand
from .core import Option
from .core import ParameterSource
from .parser import split_arg_string
from .utils import echo
def shell_complete(cli, ctx_args, prog_name, complete_var, instruction):
"""Perform shell completion for the given ... | bsd-3-clause |
luanlv/ResizeImage | node_modules/grunt-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/input.py | 457 | 112827 | # 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... | apache-2.0 |
daizhengy/RDS | trove/tests/unittests/guestagent/test_backups.py | 4 | 18819 | # Copyright 2012 OpenStack Foundation
#
# 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 l... | apache-2.0 |
valexandersaulys/prudential_insurance_kaggle | venv/lib/python2.7/site-packages/numpy/compat/_inspect.py | 114 | 7553 | """Subset of inspect module from upstream python
We use this instead of upstream because upstream inspect is slow to import, and
significanly contributes to numpy import times. Importing this copy has almost
no overhead.
"""
from __future__ import division, absolute_import, print_function
import types
__all__ = ['g... | gpl-2.0 |
erh3cq/hyperspy | hyperspy/_signals/signal1d.py | 2 | 61717 | # -*- coding: utf-8 -*-
# Copyright 2007-2020 The HyperSpy developers
#
# This file is part of HyperSpy.
#
# HyperSpy 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... | gpl-3.0 |
rahushen/ansible | test/units/modules/network/nxos/nxos_module.py | 46 | 3583 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
40423132/2017springcd_hw | local_publishconf.py | 188 | 1674 | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
from __future__ import unicode_literals
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# 因為 publishconf.py 在 pelicanconf.py 之後, 因此若兩處有相同變數的設定, ... | agpl-3.0 |
edquist/autopyfactory | autopyfactory/plugins/batchsubmit/CondorGRAMBatchSubmitPlugin.py | 1 | 3021 | #!/bin/env python
#
# AutoPyfactory batch plugin for Condor
#
from CondorCEBatchSubmitPlugin import CondorCEBatchSubmitPlugin
from autopyfactory import jsd
class CondorGRAMBatchSubmitPlugin(CondorCEBatchSubmitPlugin):
def __init__(self, apfqueue, config=None):
if not config:
qcl = apfqu... | gpl-3.0 |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/lib2to3/btm_matcher.py | 326 | 6834 | """A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes ... | gpl-2.0 |
manishpatell/erpcustomizationssaiimpex123qwe | addons/purchase_requisition/wizard/purchase_requisition_partner.py | 373 | 2320 | # -*- 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 |
noobnl/android_kernel_samsung_d2-jb_2.5.1 | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
lynxis/tunneldigger-testing | test_nose.py | 1 | 1858 | #!/usr/bin/env python3
import logging
import lxc
import os
import tunneldigger
# random hash
CONTEXT = None
# lxc container
SERVER = None
CLIENT = None
# pids of tunneldigger client and server
SERVER_PID = None
CLIENT_PID = None
LOG = logging.getLogger("test_nose")
def setup_module():
global CONTEXT, SERVER, ... | mit |
ganeshgore/myremolab | server/src/weblab/admin/bot/information_retriever.py | 2 | 3812 | #!/usr/bin/env python
#-*-*- encoding: utf-8 -*-*-
#
# Copyright (C) 2005-2009 University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals, ... | bsd-2-clause |
captiosus/treadmill | tests/runtime/linux/finish_test.py | 1 | 29795 | """Unit test for treadmill.runtime.linux._finish.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
import io
import json
import os
import shutil
import tarfile
import tempfile
import time
import uni... | apache-2.0 |
terhorst/psmcpp | smcpp/commands/command.py | 2 | 7728 | # Base class; subclasses will automatically show up as subcommands
import numpy as np
import argparse
import os
import os.path
import sys
from .. import logging, _smcpp
import smcpp.defaults
logger = logging.getLogger(__name__)
def check_positive(value):
ivalue = int(value)
if ivalue <= 0:
raise arg... | gpl-3.0 |
lowandrew/OLCTools | olctools/accessoryFunctions/accessoryFunctions.py | 1 | 43913 | #!/usr/bin/env python3
# noinspection PyProtectedMember
from Bio.Application import _Option, AbstractCommandline, _Switch
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
from Bio import SeqIO
from subprocess import Popen, PIPE, STDOUT
from collections import defaultdict
import subprocess
import datetime
imp... | mit |
firebitsbr/infernal-twin | build/pillow/build/lib.linux-i686-2.7/PIL/SunImagePlugin.py | 26 | 1965 | #
# The Python Imaging Library.
# $Id$
#
# Sun image file handling
#
# History:
# 1995-09-10 fl Created
# 1996-05-28 fl Fixed 32-bit alignment
# 1998-12-29 fl Import ImagePalette module
# 2001-12-18 fl Fixed palette loading (from Jean-Claude Rimbault)
#
# Copyright (c) 1997-2001 by Secret Labs AB
# Copyright (c... | gpl-3.0 |
manazhao/tf_recsys | tensorflow/python/training/proximal_gradient_descent_test.py | 102 | 8096 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
joshowen/django-allauth | allauth/socialaccount/providers/weixin/views.py | 6 | 2451 | import requests
from allauth.account import app_settings
from allauth.compat import reverse
from allauth.socialaccount.providers.oauth2.views import (
OAuth2Adapter,
OAuth2CallbackView,
OAuth2LoginView,
)
from allauth.utils import build_absolute_uri
from .client import WeixinOAuth2Client
from .provider im... | mit |
biospi/seamass-windeps | src/boost_1_57_0/libs/python/test/vector_indexing_suite.py | 46 | 9555 | # Copyright Joel de Guzman 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
'''
#####################################################################
# Check an object that we will use as container element
#####... | apache-2.0 |
memo/tensorflow | third_party/llvm/expand_cmake_vars.py | 168 | 2679 | # 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 |
savoirfairelinux/OpenUpgrade | addons/purchase/wizard/purchase_line_invoice.py | 205 | 5419 | # -*- 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 |
reminisce/mxnet | tools/coreml/converter/utils.py | 46 | 3583 | # 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 u... | apache-2.0 |
mulllhausen/btc-inquisitor | mysql_grunt.py | 1 | 1676 | """module containing some general mysql-related functions"""
import MySQLdb, re
import config_grunt
import email_grunt
import filesystem_grunt
def connect():
"connect and do setup"
global cursor, mysql_db
mysql_params = config_grunt.config_dict["mysql"]
mysql_connection_params = {
"host": mysq... | gpl-2.0 |
mosesfistos1/beetbox | beets/util/hidden.py | 20 | 2824 | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, 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 t... | mit |
SHOAHDAN/-tg-station | bot/Timeconverter.py | 67 | 7310 | #Sources:
# http://wwp.greenwichmeantime.com/time-zone/usa/eastern-time/convert/
# http://www.timeanddate.com/library/abbreviations/timezones/na/
# Times are GMT +- x
# For eq.
# EST = -5
# GMT = 0
# UTC = 0
#Times are in hours,
#2.5 = 2 and half hours
global times
times = {"ADT":-3,"HAA":-3, #Synonyms on the same line... | agpl-3.0 |
Y3K/django | django/contrib/admin/utils.py | 49 | 16855 | from __future__ import unicode_literals
import datetime
import decimal
from collections import defaultdict
from django.contrib.auth import get_permission_codename
from django.core.exceptions import FieldDoesNotExist
from django.core.urlresolvers import NoReverseMatch, reverse
from django.db import models
from django.... | bsd-3-clause |
pombredanne/catawampus | tr/vendor/tornado/tornado/platform/interface.py | 15 | 2092 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# 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 a... | apache-2.0 |
breznak/nupic.biodat | ECG/MIT-BIH-Arrhythmia/model/swarm/permutations.py | 1 | 3870 | ECG_MIN = 850
ECG_MAX = 1311
NCOLS = 2048
NCELLS = 4
HZ=360
AHEAD=1
DATA_FILE=u'file://./inputdata.csv'
ITERATIONS=15000 # or -1 for whole dataset #override for swarming
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, ... | gpl-2.0 |
FireBladeNooT/Medusa_1_6 | lib/tornado/test/util.py | 17 | 3023 | from __future__ import absolute_import, division, print_function, with_statement
import os
import platform
import socket
import sys
import textwrap
from tornado.testing import bind_unused_port
# Encapsulate the choice of unittest or unittest2 here.
# To be used as 'from tornado.test.util import unittest'.
if sys.ver... | gpl-3.0 |
woogers/volatility | volatility/plugins/linux/pkt_queues.py | 44 | 3171 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
NoahFlowa/glowing-spoon | venv/lib/python2.7/site-packages/pip/_vendor/packaging/version.py | 1151 | 11556 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import collections
import itertools
import re
from ._structures import In... | apache-2.0 |
lofar-astron/factor | factor/scripts/combine_skymodels.py | 2 | 1661 | #! /usr/bin/env python
"""
Script to combine two makesourcedb sky models
"""
import argparse
from argparse import RawTextHelpFormatter
import lsmtool
import sys
import os
def main(model1, model2, skymodel):
"""
Combines makesourcedb sky models
Parameters
----------
model1 : str
Filename o... | gpl-2.0 |
google-code-export/pyglet | tests/window/EVENT_KEY.py | 33 | 1087 | #!/usr/bin/env python
'''Test that key press and release events work correctly.
Expected behaviour:
One window will be opened. Type into this window and check the console
output for key press and release events. Check that the correct
key symbol and modifiers are reported.
Close the window or press... | bsd-3-clause |
regul8/pupy | pupy/modules/pyexec.py | 27 | 1118 | # -*- coding: UTF8 -*-
from pupylib.PupyModule import *
import StringIO
import pupylib.utils
__class_name__="PythonExec"
class PythonExec(PupyModule):
""" execute python code on a remote system """
def init_argparse(self):
self.arg_parser = PupyArgumentParser(prog='pyexec', description=self.__doc__)
group=self.... | bsd-3-clause |
sonictk/MARI-Extension-Pack | Scripts/Tools/View/extPack_screenshot_all_channels.py | 1 | 3102 | # ------------------------------------------------------------------------------
# Screenshot All Channels
# ------------------------------------------------------------------------------
# Will do Screenshots of all Channels and export them based on the path provided
# in Screenshot Settings
# ------------------------... | bsd-3-clause |
CeltonMcGrath/TACTIC | src/pyasm/prod/web/asset_info_wdg.py | 6 | 9944 | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... | epl-1.0 |
mx3L/enigma2 | lib/python/Plugins/SystemPlugins/NetworkWizard/NetworkWizard.py | 18 | 13858 | from Screens.Wizard import wizardManager, WizardSummary
from Screens.WizardLanguage import WizardLanguage
from Screens.Rc import Rc
from Screens.MessageBox import MessageBox
from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap
from Components.Sources.Boolean import Boolean
from Components.Network import iNet... | gpl-2.0 |
draugiskisprendimai/odoo | addons/website_crm_partner_assign/controllers/main.py | 271 | 7541 | # -*- coding: utf-8 -*-
import werkzeug
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug, unslug
from openerp.tools.translate import _
class WebsiteCrmPartnerAssign(http.Controller):
_references_... | agpl-3.0 |
trondeau/gnuradio | gr-digital/python/digital/qa_probe_density.py | 57 | 2132 | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | gpl-3.0 |
ferabra/edx-platform | cms/djangoapps/contentstore/tests/utils.py | 56 | 17991 | '''
Utilities for contentstore tests
'''
import json
import textwrap
from mock import Mock
from django.conf import settings
from django.contrib.auth.models import User
from django.test.client import Client
from opaque_keys.edx.locations import SlashSeparatedCourseKey, AssetLocation
from contentstore.utils import reve... | agpl-3.0 |
Lujeni/ansible | lib/ansible/modules/cloud/amazon/rds.py | 13 | 56969 | #!/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 |
mrquim/mrquimrepo | script.module.schism.common/lib/js2py/constructors/jsdate.py | 33 | 10192 | from js2py.base import *
from time_helpers import *
TZ_OFFSET = (time.altzone/3600)
ABS_OFFSET = abs(TZ_OFFSET)
TZ_NAME = time.tzname[1]
ISO_FORMAT = '%s-%s-%sT%s:%s:%s.%sZ'
@Js
def Date(year, month, date, hours, minutes, seconds, ms):
return now().to_string()
Date.Class = 'Date'
def now():
return PyJsDate(i... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.