repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
atlassian/dd-agent | tests/checks/mock/test_sqlserver.py | 37 | 2693 | # stdlib
import logging
from types import ListType
import unittest
# 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import get_check
logging.basicConfig()
"""
Run the following on your local SQL Server:
CREATE LOGIN datadog WITH PASSWORD = '340$Uuxwp7Mcxo7Khy';
CREATE USER datadog FOR L... | bsd-3-clause |
sander76/home-assistant | homeassistant/components/knx/binary_sensor.py | 2 | 2174 | """Support for KNX/IP binary sensors."""
from __future__ import annotations
from typing import Any, Callable, Iterable
from xknx.devices import BinarySensor as XknxBinarySensor
from homeassistant.components.binary_sensor import DEVICE_CLASSES, BinarySensorEntity
from homeassistant.core import HomeAssistant
from home... | apache-2.0 |
emreg00/biana | biana/biana_commands.py | 1 | 22175 | """
BIANA: Biologic Interactions and Network Analysis
Copyright (C) 2009 Javier Garcia-Garcia, Emre Guney, Baldo Oliva
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 vers... | gpl-3.0 |
mcrowson/django | tests/test_client/views.py | 109 | 10961 | from xml.dom.minidom import parseString
from django.contrib.auth.decorators import login_required, permission_required
from django.core import mail
from django.forms import fields
from django.forms.forms import Form, ValidationError
from django.forms.formsets import BaseFormSet, formset_factory
from django.http import... | bsd-3-clause |
brian-l/django-1.4.10 | django/contrib/gis/db/models/fields.py | 400 | 11157 | from django.db.models.fields import Field
from django.db.models.sql.expressions import SQLEvaluator
from django.utils.translation import ugettext_lazy as _
from django.contrib.gis import forms
from django.contrib.gis.db.models.proxy import GeometryProxy
from django.contrib.gis.geometry.backend import Geometry, Geometry... | bsd-3-clause |
wkfwkf/statsmodels | statsmodels/sandbox/stats/runs.py | 25 | 19994 | '''runstest
formulas for mean and var of runs taken from SAS manual NPAR tests, also idea
for runstest_1samp and runstest_2samp
Description in NIST handbook and dataplot doesn't explain their expected
values, or variance
Note:
There are (at least) two definitions of runs used in literature. The classical
definition ... | bsd-3-clause |
jschuecker/nest-simulator | pynest/nest/lib/hl_api_nodes.py | 13 | 2471 | # -*- coding: utf-8 -*-
#
# hl_api_nodes.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, o... | gpl-2.0 |
bhargav2408/python-for-android | python3-alpha/python3-src/Lib/fnmatch.py | 51 | 3201 | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | apache-2.0 |
cchamberlain/npm-msys2 | node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py | 1284 | 100329 | # Copyright (c) 2013 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.
import collections
import copy
import hashlib
import json
import multiprocessing
import os.path
import re
import signal
import subprocess
import sys
import gyp
imp... | artistic-2.0 |
barbarubra/Don-t-know-What-i-m-doing. | python/gdata/src/gdata/contacts/__init__.py | 134 | 13897 | #!/usr/bin/python
#
# Copyright (C) 2008 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 |
oritwas/bonzini | scripts/tracetool/backend/simple.py | 57 | 3099 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Simple built-in backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
__em... | gpl-2.0 |
Dhivyap/ansible | test/units/modules/network/check_point/test_cp_mgmt_dynamic_object_facts.py | 19 | 2869 | # Ansible module to manage CheckPoint Firewall (c) 2019
#
# 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 dist... | gpl-3.0 |
quantcast/qfs | webui/chunks.py | 1 | 34806 | #
# $Id$
#
# Copyright 2010-2012,2016 Quantcast Corporation. All rights reserved.
#
# Author: Kate Labeeva
#
# This file is part of Kosmos File System (KFS).
#
# 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 ... | apache-2.0 |
jeroenj/CouchPotatoServer | libs/suds/bindings/binding.py | 191 | 19047 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
hyperized/ansible | lib/ansible/modules/network/cloudengine/ce_snmp_user.py | 12 | 37251 | #!/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 |
edry/edx-platform | common/test/acceptance/setup.py | 206 | 1111 | #!/usr/bin/env python
"""
Install bok-choy page objects for acceptance and end-to-end tests.
"""
import os
from setuptools import setup
VERSION = '0.0.1'
DESCRIPTION = "Bok-choy page objects for edx-platform"
# Pip 1.5 will try to install this package from outside
# the directory containing setup.py, so we need to ... | agpl-3.0 |
sysalexis/kbengine | kbe/res/scripts/common/Lib/email/header.py | 83 | 24163 | # Copyright (C) 2002-2007 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
"""Header encoding and decoding functionality."""
__all__ = [
'Header',
'decode_header',
'make_header',
]
import re
import binascii
import email.quoprimime
import email.base64m... | lgpl-3.0 |
pojdrovic/Miscellaneous_Files | Options_Pricing.py | 1 | 1180 | __author__ = 'Petar Ojdrovic'
import numpy
import scipy.stats
import time
#Options Pricing
"""
S: initial stock price
k: strike price
T: expiration time
sigma: volatility
r: risk-free rate
"""
##What is d1, d2, and pricer? d1 is the first differential of the underlying pr
def d1(S0, K, r, siga, T):
return (... | apache-2.0 |
niboshi/chainer | chainer/distributions/multivariate_normal.py | 6 | 7498 | import math
import numpy
import chainer
from chainer import backend
from chainer.backends import cuda
from chainer import distribution
from chainer.functions.array import broadcast
from chainer.functions.array import diagonal
from chainer.functions.array import expand_dims
from chainer.functions.array import squeeze
... | mit |
samuelhavron/heroku-buildpack-python | Python-3.4.3/Lib/test/test___future__.py | 88 | 2497 | import unittest
from test import support
import __future__
GOOD_SERIALS = ("alpha", "beta", "candidate", "final")
features = __future__.all_feature_names
class FutureTest(unittest.TestCase):
def test_names(self):
# Verify that all_feature_names appears correct.
given_feature_names = features[:]
... | mit |
gerald-yang/ubuntu-iotivity-demo | snappy/grovepi/python-env/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_compat.py | 901 | 1253 | # Copyright 2014 Donald Stufft
#
# 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 |
manjunaths/tensorflow | tensorflow/contrib/distributions/python/ops/quantized_distribution.py | 6 | 17490 | # 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 |
myayo/snatch | plugins/ti.alloy/plugin.py | 1729 | 5251 | import os, sys, subprocess, hashlib
import subprocess
def check_output(*popenargs, **kwargs):
r"""Run command with arguments and return its output as a byte string.
Backported from Python 2.7 as it's implemented as pure python on stdlib.
>>> check_output(['/usr/bin/python', '--version'])
Python 2.6.... | apache-2.0 |
mitocoin-project/mitocoin | qa/rpc-tests/p2p-compactblocks.py | 9 | 43214 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import BitcoinTestFramework
from test... | mit |
jyizheng/goldfish_pasr_lib_x86 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
bright-sparks/chromium-spacewalk | build/android/pylib/perf/test_runner.py | 36 | 9368 | # 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.
"""Runs perf tests.
Our buildbot infrastructure requires each slave to run steps serially.
This is sub-optimal for android, where these steps can run indepe... | bsd-3-clause |
ravenland/ycmWinRepo | third_party/requests/requests/packages/urllib3/_collections.py | 310 | 3111 | # urllib3/_collections.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from collections import MutableMapping
try:
from threading import RLock
except ImportE... | gpl-3.0 |
bva24/sm | mart/fabfile.py | 46 | 16441 | from __future__ import print_function, unicode_literals
from future.builtins import input, open
import os
import re
import sys
from functools import wraps
from getpass import getpass, getuser
from glob import glob
from contextlib import contextmanager
from posixpath import join
from fabric.api import env, cd, prefix,... | bsd-2-clause |
jkthompson/nupic | py/nupic/data/sorter.py | 2 | 9297 | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions... | gpl-3.0 |
goblin/p2pool | fpconst.py | 310 | 5754 | """Utilities for handling IEEE 754 floating point special values
This python module implements constants and functions for working with
IEEE754 double-precision special values. It provides constants for
Not-a-Number (NaN), Positive Infinity (PosInf), and Negative Infinity
(NegInf), as well as functions to test for th... | gpl-3.0 |
prune998/ansible | lib/ansible/plugins/connection/paramiko_ssh.py | 18 | 18754 | # (c) 2012, Michael DeHaan <michael.dehaan@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 License, or
# (at your option) any lat... | gpl-3.0 |
pgrinaway/yank | Yank/utils.py | 1 | 61480 | import os
import re
import sys
import copy
import glob
import json
import shutil
import signal
import pandas
import inspect
import logging
import itertools
import subprocess
import collections
from contextlib import contextmanager
from pkg_resources import resource_filename
import mdtraj
import parmed
import numpy as... | lgpl-3.0 |
evan-rusin/fly-project | api/urls.py | 3 | 2482 | from django.conf.urls import url, include
from api.views import imageupload
from api.views import banned_domain
from api.views import banned_ip
from api.views import banned_word
from api.views import resource_link
from api.views import register
from api.views import login
from api.views import savings_goal
from api.vie... | bsd-2-clause |
abaditsegay/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/win32com/server/policy.py | 17 | 31197 | """Policies
Note that Dispatchers are now implemented in "dispatcher.py", but
are still documented here.
Policies
A policy is an object which manages the interaction between a public
Python object, and COM . In simple terms, the policy object is the
object which is actually called by COM, and it invokes the r... | apache-2.0 |
wdbm/janus | janus.py | 1 | 29568 | ################################################################################
# #
# Janus #
# ... | gpl-3.0 |
wmtprojectsteam/rivercontrolsystem | main.py | 1 | 8464 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# River System Control and Monitoring Software Version 0.9.2
# Copyright (C) 2017-2018 Wimborne Model Town
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3 or,
# at your option, any late... | gpl-3.0 |
nitzmahone/ansible-modules-core | cloud/openstack/os_image_facts.py | 59 | 4642 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# 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 late... | gpl-3.0 |
jeromecc/doctoctocbot | src/moderation/migrations/0002_twitterlist.py | 1 | 1052 | # Generated by Django 2.0.13 on 2019-04-03 01:20
import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('moderation', '0001_auto_20181029_2159'),
]
operations = [
migrations.CreateModel(
n... | mpl-2.0 |
jaguililla/FrameworkBenchmarks | toolset/test_types/plaintext/plaintext.py | 10 | 2631 | from toolset.test_types.verifications import basic_body_verification, verify_headers
from toolset.test_types.abstract_test_type import AbstractTestType
class TestType(AbstractTestType):
def __init__(self, config):
self.plaintext_url = ""
kwargs = {
'name': 'plaintext',
'req... | bsd-3-clause |
rafaelwerneck/kuaa | framework/evaluation.py | 1 | 7280 | #!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
# This file is part of Kuaa.
#
# Kuaa is a framework for the automation of machine learning experiments.
#
# It provides a workflow-based standardized environment for easy evaluation of
# feature d... | gpl-3.0 |
TikhomirovSergey/selenium | py/selenium/webdriver/common/by.py | 61 | 1111 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
blrm/openshift-tools | scripts/monitoring/cron-send-ec2-ebs-volumes-in-stuck-state.py | 6 | 10875 | #!/usr/bin/env python
'''
Send EBS volumes that are stuck in a transition state
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Copyright 2017 Red Hat 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 ... | apache-2.0 |
gajim/python-nbxmpp | nbxmpp/simplexml.py | 1 | 28908 | ## simplexml.py based on Mattew Allum's xmlstream.py
##
## Copyright (C) 2003-2005 Alexey "Snake" Nezhdanov
##
## 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, or (... | gpl-3.0 |
jeffersonmourak/speakerfight | deck/migrations/0009_activity.py | 18 | 2174 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('deck',... | mit |
MissionCriticalCloud/marvin | marvin/cloudstackAPI/updateHostPassword.py | 1 | 1299 | """Update password of a host/pool on management server."""
from baseCmd import *
from baseResponse import *
class updateHostPasswordCmd (baseCmd):
typeInfo = {}
def __init__(self):
self.isAsync = "false"
"""the new password for the host/cluster"""
"""Required"""
self.password ... | apache-2.0 |
flavour/cert | languages/ar.py | 3 | 288116 | # coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'# of International Staff': '# of International Staff',
'# of National ... | mit |
toshywoshy/ansible | lib/ansible/modules/cloud/amazon/sts_session_token.py | 13 | 4981 | #!/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 |
tempbottle/rethinkdb | test/rql_test/connections/http_support/jinja2/_compat.py | 638 | 4042 | # -*- coding: utf-8 -*-
"""
jinja2._compat
~~~~~~~~~~~~~~
Some py2/py3 compatibility support based on a stripped down
version of six so we don't have to depend on a specific version
of it.
:copyright: Copyright 2013 by the Jinja team, see AUTHORS.
:license: BSD, see LICENSE for details.
""... | agpl-3.0 |
rajalokan/keystone | keystone/common/policies/service.py | 2 | 1987 | # 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 |
southpawtech/TACTIC-DEV | src/tactic/ui/examples/panning_scroll_example_wdg.py | 6 | 4053 | ###########################################################
#
# Copyright (c) 2009, 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 |
luzfcb/cookiecutter | tests/test_read_user_choice.py | 1 | 1291 | # -*- coding: utf-8 -*-
"""Tests around prompting for and handling of choice variables."""
import click
import pytest
from cookiecutter.prompt import read_user_choice
OPTIONS = ['hello', 'world', 'foo', 'bar']
EXPECTED_PROMPT = """Select varname:
1 - hello
2 - world
3 - foo
4 - bar
Choose from 1, 2, 3, 4"""
@pyt... | bsd-3-clause |
etianen/py.sh | _pysh/config.py | 1 | 1743 | from itertools import chain
import json
import os
from _pysh.tasks import TaskError, TaskWarning, mark_task
CONFIG_PREFIX = "PYSH_"
class Config:
def __init__(self, value, path):
self._value = value
self._path = []
if not isinstance(value, dict):
raise ValueError("Expected c... | mit |
titusjan/argos | argos/main.py | 1 | 10919 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Argos.
#
# Argos 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.
#... | gpl-3.0 |
RWTH-OS/HermitCore | usr/gdb/hermit/tasks.py | 2 | 9159 | #
# gdb helper commands and functions for HermitCore debugging
#
# task & thread tools
#
# Copyright (c) Siemens AG, 2011-2013
# Copyright (c) RWTH-Aaachen, 2016
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
# Daniel Krebs <github@daniel-krebs.net>
#
# Inspired by prior work of Jan Kiszka and adapted by Daniel ... | bsd-3-clause |
farhi-naz/phantomjs | src/qt/qtwebkit/Tools/QueueStatusServer/model/activeworkitems.py | 140 | 3975 | # Copyright (C) 2010 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 |
OmnInfinity/volatility | volatility/plugins/linux/lsmod.py | 44 | 9599 | # 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 |
zachmullen/boto | boto/ses/__init__.py | 131 | 2013 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Harry Marr http://hmarr.com/
#
# 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
# wit... | mit |
emmuchira/kps_erp | erpnext/healthcare/doctype/lab_test_template/lab_test_template.py | 11 | 3769 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe, json
from frappe.model.document import Document
from frappe import _
class LabTestTemplate(Document):
def on_update(self):
#Item and Price List... | gpl-3.0 |
suneeth51/neutron | neutron/plugins/ml2/drivers/l2pop/rpc_manager/l2population_rpc.py | 41 | 12114 | # Copyright (c) 2013 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... | apache-2.0 |
MikeDacre/python-cluster | tests/run_tests.py | 2 | 2200 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Run all applicable tests.
============================================================================
AUTHOR: Michael D Dacre, mike.dacre@gmail.com
CREATED: 2016-54-22 15:06
Last modified: 2016-12-01 18:03
DESCRIPTION: Run multiple kinds of tests,... | mit |
DeepRNN/image_captioning | utils/coco/pycocoevalcap/eval.py | 3 | 2609 | __author__ = 'tylin'
from tokenizer.ptbtokenizer import PTBTokenizer
from bleu.bleu import Bleu
from meteor.meteor import Meteor
from rouge.rouge import Rouge
from cider.cider import Cider
class COCOEvalCap:
def __init__(self, coco, cocoRes):
self.evalImgs = []
self.eval = {}
self.imgToEval... | mit |
biton-project/moneta-0.10.0 | qa/rpc-tests/keypool.py | 3 | 4257 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
# Exercise the wallet keypool, and interaction with wallet encryption/locking
# Add python-monetarpc to modul... | mit |
Southpaw-TACTIC/TACTIC | src/context/client/tactic-api-python-4.0.api04/Tools/Scripts/methfix.py | 12 | 5634 | #! /usr/bin/env python
# Fix Python source files to avoid using
# def method(self, (arg1, ..., argn)):
# instead of the more rational
# def method(self, arg1, ..., argn):
#
# Command line arguments are files or directories to be processed.
# Directories are searched recursively for files whose name... | epl-1.0 |
Jmainguy/ansible-modules-extras | cloud/centurylink/clc_alert_policy.py | 40 | 18018 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
#
# 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 la... | gpl-3.0 |
ikaee/bfr-attendant | facerecognitionlibrary/jni-build/jni/include/tensorflow/tools/pip_package/setup.py | 8 | 7060 | # 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 |
vhaupert/mitmproxy | mitmproxy/utils/arg_check.py | 1 | 4239 | import sys
DEPRECATED = """
--confdir
-Z
--body-size-limit
--stream
--palette
--palette-transparent
--follow
--order
--no-mouse
--reverse
--http2-priority
--no-http2-priority
--no-websocket
--websocket
--spoof-source-address
--upstream-bind-address
--ciphers-client
--ciphers-server
--client-certs
--no-upstream-cert
--... | mit |
wskplho/sl4a | python/src/Lib/plat-riscos/rourl2path.py | 66 | 2495 | """riscos specific module for conversion between pathnames and URLs.
Based on macurl2path.
Do not import directly, use urllib instead."""
import string
import urllib
__all__ = ["url2pathname","pathname2url"]
__slash_dot = string.maketrans("/.", "./")
def url2pathname(url):
"""OS-specific conversion from a relat... | apache-2.0 |
yhalk/vw_challenge_ECR | src/jetson/keras_frcnn/vgg.py | 4 | 4737 | # -*- coding: utf-8 -*-
"""VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://arxiv.org/abs/1409.1556)
"""
from __future__ import print_function
from __future__ import absolute_import
import warnings
from keras.models import Model
from keras.layers import... | apache-2.0 |
RicterZ/pbox | pbox_backend/models.py | 1 | 3327 | from django.db import models
from django.utils import timezone
from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin
from django.contrib.auth.models import BaseUserManager
FORBIDDEN = 4
GENERAL = 3
MANAGER = 2
OWNER = 1
class PboxUserManager(BaseUserManager):
def _create_user(self, username,... | gpl-2.0 |
P0cL4bs/3vilTwinAttacker | plugins/extension/plugin.py | 4 | 1113 | import logging
from bs4 import BeautifulSoup
from PyQt4.QtCore import QObject,pyqtSignal
from core.utility.collection import SettingsINI
import core.utility.constants as C
class PluginTemplate(QObject):
name = 'plugin master'
version = '1.0'
config = SettingsINI(C.PUMPPROXY_INI)
loggers = {}
send_output = pyq... | gpl-3.0 |
janpipek/pyearcal | pyearcal/flickr_downloader.py | 1 | 1645 | import requests
import random
import os
from .image_sources import SortedImageDirectory
from bs4 import BeautifulSoup
TEMP_DIR = ".flickr-download"
EXTENSION = ".jpg"
class FlickrDownloader(SortedImageDirectory):
"""Image source that downloads random pictures from Flickr.
Based on the article
http:/... | mit |
zalando/turnstile | setup.py | 1 | 3322 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from turnstile.version import version
class PyTest(TestCommand):
def initialize_options(self):
TestCommand.initialize_options(self)
self.c... | apache-2.0 |
vup1120/oq-hazardlib | openquake/hazardlib/gsim/akkar_2014.py | 2 | 45991 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2013-2016 GEM Foundation
#
# OpenQuake 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 Licen... | agpl-3.0 |
jabesq/home-assistant | homeassistant/components/hdmi_cec/switch.py | 7 | 2057 | """Support for HDMI CEC devices as switches."""
import logging
from homeassistant.components.switch import DOMAIN, SwitchDevice
from homeassistant.const import STATE_OFF, STATE_ON, STATE_STANDBY
from . import ATTR_NEW, CecDevice
_LOGGER = logging.getLogger(__name__)
ENTITY_ID_FORMAT = DOMAIN + '.{}'
def setup_pla... | apache-2.0 |
thispc/download-manager | module/plugins/crypter/MegadyskPlFolder.py | 8 | 2573 | # -*- coding: utf-8 -*-
import base64
import re
import urllib
from module.network.RequestFactory import getURL as get_url
from ..internal.misc import json
from ..internal.SimpleCrypter import SimpleCrypter
def xor_decrypt(data, key):
data = base64.b64decode(data)
return "".join(map(lambda x: chr(ord(x[1]) ... | gpl-3.0 |
sdiazb/airflow | airflow/contrib/operators/spark_sql_operator.py | 19 | 3902 | # -*- coding: utf-8 -*-
#
# 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 |
utkbansal/kuma | vendor/packages/lockfile/linklockfile.py | 466 | 2649 | from __future__ import absolute_import
import time
import os
from . import (LockBase, LockFailed, NotLocked, NotMyLock, LockTimeout,
AlreadyLocked)
class LinkLockFile(LockBase):
"""Lock access to a file using atomic property of link(2).
>>> lock = LinkLockFile('somefile')
>>> lock = LinkL... | mpl-2.0 |
DreamLab/contrail-neutron-plugin | neutron_plugin_contrail/plugins/opencontrail/quota/driver.py | 1 | 6933 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
import ConfigParser
from pprint import pformat
try:
from neutron.openstack.common import log as logging
except ImportError:
from oslo_log import log as logging
from neutron.common.config import cfg
from httplib2 import Http
import re
import string
import sys
import... | apache-2.0 |
irwinlove/django | tests/forms_tests/tests/test_media.py | 169 | 45896 | # -*- coding: utf-8 -*-
from django.forms import CharField, Form, Media, MultiWidget, TextInput
from django.template import Context, Template
from django.test import SimpleTestCase, override_settings
from django.utils.encoding import force_text
@override_settings(
STATIC_URL=None,
MEDIA_URL='http://media.exam... | bsd-3-clause |
mhue/scikit-learn | doc/sphinxext/numpy_ext/docscrape.py | 298 | 15441 | """Extract reference documentation from the NumPy source tree.
"""
import inspect
import textwrap
import re
import pydoc
from warnings import warn
# Try Python 2 first, otherwise load from Python 3
try:
from StringIO import StringIO
except:
from io import StringIO
class Reader(object):
"""A line-based s... | bsd-3-clause |
amitay/samba | lib/testtools/doc/conf.py | 15 | 6347 | # -*- coding: utf-8 -*-
#
# testtools documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 28 13:45:40 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | gpl-3.0 |
klqulei/vdc | 3rdparty/SDL2_ttf-2.0.12/external/freetype-2.4.12/src/tools/docmaker/docmaker.py | 463 | 2766 | #!/usr/bin/env python
#
# DocMaker (c) 2002, 2004, 2008 David Turner <david@freetype.org>
#
# This program is a re-write of the original DocMaker took used
# to generate the API Reference of the FreeType font engine
# by converting in-source comments into structured HTML.
#
# This new version is capable of outputting ... | lgpl-3.0 |
SeeSpotRun/rmlint | tests/test_robustness/test_collisions.py | 2 | 1029 | #!/usr/bin/env python3
# encoding: utf-8
from nose.plugins.attrib import attr
from nose import with_setup
from tests.utils import *
# current shredder algorithm does not handle large size-groups at all
# well, due to pre-matching "optimisation"
# https://github.com/SeeSpotRun/rmlint/blob/448cb0c76cbb6178105556ede2bfd... | gpl-3.0 |
shepdelacreme/ansible | test/units/modules/network/f5/test_bigiq_utility_license.py | 5 | 3329 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2017, F5 Networks Inc.
# 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
import os
import json
import sys
from nose.plugins.skip import SkipTest... | gpl-3.0 |
algorhythms/LeetCode | 295 Find Median from Data Stream.py | 1 | 2292 | # -*- coding: utf-8 -*-
"""
Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the
median is the mean of the two middle value.
Examples:
[2,3,4] , the median is 3
[2,3], the median is (2 + 3) / 2 = 2.5
Design a data structure that supports the followi... | mit |
behzadnouri/scipy | scipy/stats/tests/test_rank.py | 44 | 7708 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_equal, \
assert_array_equal, dec
from scipy.stats import rankdata, tiecorrect
class TestTieCorrect(TestCase):
def test_empty(self):
"""An empty array requ... | bsd-3-clause |
etos/django | django/db/migrations/operations/special.py | 107 | 7792 | from django.db import router
from .base import Operation
class SeparateDatabaseAndState(Operation):
"""
Take two lists of operations - ones that will be used for the database,
and ones that will be used for the state change. This allows operations
that don't support state change to have it applied, o... | bsd-3-clause |
quru/django-pagination | setup.py | 13 | 4145 | from setuptools import setup, find_packages
version = '1.0.5'
LONG_DESCRIPTION = """
How to use django-pagination
----------------------------
``django-pagination`` allows for easy Digg-style pagination without modifying
your views.
There are really 5 steps to setting it up with your projects (not including
instal... | bsd-3-clause |
adamrp/qiime | qiime/split_libraries_fastq.py | 15 | 17996 | #!/usr/bin/env python
# File created on 22 Mar 2010
from __future__ import division
__author__ = "Greg Caporaso"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Greg Caporaso", "Jose Antonio Navas Molina", "Daniel McDonald"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Greg Capor... | gpl-2.0 |
8l/beri | cheritest/trunk/tests/fpu/test_raw_fpu_sd_ld.py | 2 | 1754 | #-
# Copyright (c) 2012 Ben Thorner
# Copyright (c) 2013 Colin Rothwell
# All rights reserved.
#
# This software was developed by Ben Thorner as part of his summer internship
# and Colin Rothwell as part of his final year undergraduate project.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open Systems C.I.C. (B... | apache-2.0 |
miquelcampos/GEAR_mc | workgroup/Addons/gear/Application/Plugins/gear_synoptic/tabs/_common/horse_body/logic.py | 1 | 1065 | #
# This file is part of GEAR_mc.
# GEAR_mc is a fork of Jeremie Passerin's GEAR project.
# GEAR 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, o... | lgpl-3.0 |
Icenowy/linux-kernel-u8800-aosc-oses | scripts/rt-tester/rt-tester.py | 1094 | 5362 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/protorpc/protorpc/registry_test.py | 26 | 3873 | #!/usr/bin/env python
#
# Copyright 2010 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 o... | mit |
robovm/robovm-studio | python/helpers/pydev/pydev_ipython/inputhook.py | 52 | 18411 | # coding: utf-8
"""
Inputhook management for GUI event loop integration.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distribu... | apache-2.0 |
40223231/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/posix.py | 603 | 20904 | """This module provides access to operating system functionality that is
standardized by the C Standard and the POSIX standard (a thinly
disguised Unix interface). Refer to the library manual and
corresponding Unix manual entries for more information on calls."""
import datetime
from browser import window
def _rand... | gpl-3.0 |
jamesblunt/scrapy | scrapy/contrib/pipeline/__init__.py | 142 | 1270 | """
Item pipeline
See documentation in docs/item-pipeline.rst
"""
from scrapy.middleware import MiddlewareManager
from scrapy.utils.conf import build_component_list
class ItemPipelineManager(MiddlewareManager):
component_name = 'item pipeline'
@classmethod
def _get_mwlist_from_settings(cls, settings):
... | bsd-3-clause |
rosmo/ansible | lib/ansible/modules/network/avi/avi_certificatemanagementprofile.py | 28 | 3809 | #!/usr/bin/python
#
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
# Copyright: (c) 2017 Gaurav Rastogi, <grastogi@avinetworks.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses... | gpl-3.0 |
ArtsiomCh/tensorflow | tensorflow/contrib/distributions/__init__.py | 4 | 7081 | # 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 |
louisLouL/pair_trading | capstone_env/lib/python3.6/site-packages/matplotlib/backends/backend_pdf.py | 2 | 98412 | # -*- coding: utf-8 -*-
"""
A PDF matplotlib backend
Author: Jouni K Seppänen <jks@iki.fi>
"""
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import codecs
import os
import re
import struct
import sys
import time
import warnings
import zlib
imp... | mit |
jepler/linuxcnc-mirror | configs/apps/gladevcp/by-widget/radio.py | 24 | 2723 | '''
gladevcp radiobutton example
lifted from http://old.nabble.com/glade-and-radio-buttons.-td28793060.html
Michael Haberler 12/2010
'''
import pygtk
import gtk
import pango
debug = 0
class HandlerClass:
def print_radiobutton_state(self, widget):
if widget.get_active():
state = ... | lgpl-2.1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.