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 |
|---|---|---|---|---|---|
ekalosak/boto | boto/cognito/sync/layer1.py | 135 | 21122 | # Copyright (c) 2014 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 |
rsvip/Django | tests/queryset_pickle/tests.py | 42 | 6189 | from __future__ import unicode_literals
import datetime
import pickle
import warnings
from django.test import TestCase
from django.utils.encoding import force_text
from django.utils.version import get_version
from .models import Container, Event, Group, Happening, M2MModel
class PickleabilityTestCase(TestCase):
... | bsd-3-clause |
udrg/kalibr | aslam_nonparametric_estimation/bsplines/interp_rotation/threeManifoldVisual/__init__.py | 5 | 4470 | import visual
import thread
import time
import numpy
class Manifold :
class SceneObject(object) :
def __init__(self, visual):
self._visual = visual
def setOpacity(self, opacity):
self._visual.opacity = opacity
def setRadius(self, radius):
sel... | bsd-3-clause |
evernym/zeno | plenum/test/txn_author_agreement/helper.py | 2 | 8887 | import base64
import json
from _sha256 import sha256
import base58
from indy.ledger import build_txn_author_agreement_request, build_get_txn_author_agreement_request, \
build_get_acceptance_mechanisms_request, build_disable_all_txn_author_agreements_request
from typing import NamedTuple, Dict, Optional
from plenu... | apache-2.0 |
broferek/ansible | test/units/modules/network/fortios/test_fortios_user_domain_controller.py | 21 | 8877 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | gpl-3.0 |
orestkreminskyi/taf | unittests/test_pwsw.py | 2 | 1228 | # Copyright (c) 2011 - 2017, Intel Corporation.
#
# 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 agre... | apache-2.0 |
mouradmourafiq/django-short-urls | short_urls/url_generator.py | 1 | 1921 | # -*- coding: utf-8 -*-
DEFAULT_ALPHABET = 'az7er5tyu1io0pq4sd9fg6hjk8lmw3xcv2bn'
LEGTH_GENERATION = 32
MIN_LENGTH = 6
class URLEncoder(object):
"""
It generates 36**6 = 2176782336 values (6 lowercase letters) which falls between 2**31 = 2147483648 and 2**32 = 4294967296.
It pads the codes that are shorter... | bsd-2-clause |
hujiajie/chromium-crosswalk | tools/perf/measurements/rasterize_and_record_micro_unittest.py | 26 | 4474 | # 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.
import logging
from telemetry import decorators
from telemetry.page import page_test
from telemetry.testing import options_for_unittests
from telemetry.test... | bsd-3-clause |
jaxkodex/odoo | addons/l10n_fr/report/__init__.py | 424 | 1475 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
Voluntarynet/BitmessageKit | BitmessageKit/Vendor/static-python/Lib/fractions.py | 252 | 22390 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Rational, infinite-precision, real numbers."""
from __future__ import division
from decimal import Decimal
import math
import numbers
import operator
import re
__all__ = ['Fraction', 'gcd']
Rational... | mit |
luotao1/Paddle | python/paddle/fluid/tests/unittests/test_elementwise_max_op_npu.py | 2 | 5125 | # Copyright (c) 2021 PaddlePaddle 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 appli... | apache-2.0 |
defionscode/ansible-modules-extras | windows/win_firewall_rule.py | 22 | 3333 | #!/usr/bin/env python
# (c) 2014, Timothy Vandenbrande <timothy.vandenbrande@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 Lic... | gpl-3.0 |
LazyClutch/shadowsocks | shadowsocks/common.py | 945 | 8921 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
makinacorpus/reportlab-ecomobile | tests/test_platypus_xref.py | 1 | 5178 | #Copyright ReportLab Europe Ltd. 2000-2008
#see license.txt for license details
"""Test long documents with indexes, tables and cross-references
"""
__version__='''$Id$'''
from reportlab.lib.testutils import setOutDir,makeSuiteForClasses, outputfile, printLocation
setOutDir(__name__)
import sys, os, time
from string im... | bsd-3-clause |
yrsegal/OneCommandSublimeSyntax | OneCommand/wireutils.py | 5 | 10449 | """
Wire Segal's utility library.
Do whatever with it, I seriously couldn't care less.
Runs 2.6+ onwards.
"""
from __future__ import print_function
import os, json, time, sys, re, traceback, threading
def format(string, **kwargs):
"""
Format strings with **kwargs.
"""
for arg in kwargs:
regex = re.compile(r"\... | mit |
nikcub/Sketch | sketch/debug.py | 1 | 3142 |
import sketch
class CookieTest(sketch.AdminController):
def get(self, arg):
if arg == "/set":
self.redirect('/cookie?set')
if arg == "/clear":
session.invalidate()
self.redirect('/cookie')
else:
if self.session.is_new():
self.session["test"] = 1
else:
self.s... | bsd-2-clause |
guymakam/Kodi-Israel | plugin.video.israelive/resources/lib/myFilmon.py | 1 | 11283 | import re, random, time
import urllib, urllib2, json
import common
AddonID = "plugin.video.israelive"
def GetUrlStream(url, filmonOldStrerams=False, useRtmp=False):
chNum, referrerCh, ChName, filmonMethod = GetUrlParams(url)
if filmonMethod is not None:
filmonOldStrerams = (filmonMethod == 0)
return GetChannelSt... | gpl-2.0 |
sadleader/odoo | addons/resource/faces/observer.py | 433 | 2328 | #@+leo-ver=4
#@+node:@file observer.py
#@@language python
#@<< Copyright >>
#@+node:<< Copyright >>
############################################################################
# Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH
# mreithinger@web.de
#
# This file is part of faces.
# ... | agpl-3.0 |
wisechengyi/pants | src/python/pants/engine/legacy_engine.py | 1 | 1345 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from abc import ABC, abstractmethod
from pants.base.exceptions import TaskError
class Engine(ABC):
"""An engine for running a pants command line."""
def execute(self, context, ... | apache-2.0 |
erik96/Linux-Kernel-3.4 | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/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 |
dya2/python-for-android | python-modules/twisted/twisted/protocols/gps/rockwell.py | 61 | 11638 | # Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""Rockwell Semiconductor Zodiac Serial Protocol
Coded from official protocol specs (Order No. GPS-25, 09/24/1996, Revision 11)
Maintainer: Bob Ippolito
The following Rockwell Zodiac messages are currently understood::
EARTHA\\r\... | apache-2.0 |
hernandito/SickRage | lib/sqlalchemy/testing/suite/test_update_delete.py | 76 | 1578 | from .. import fixtures, config
from ..assertions import eq_
from sqlalchemy import Integer, String
from ..schema import Table, Column
class SimpleUpdateDeleteTest(fixtures.TablesTest):
run_deletes = 'each'
__backend__ = True
@classmethod
def define_tables(cls, metadata):
Table('plain_pk', m... | gpl-3.0 |
grantkinsler/motifproject | motifcompetesim_initialconditions/motifcompetesimtracker_trial.py | 1 | 1653 | from motifcompetesimtracker_cell import Cell
from motifcompetesimtracker_population import Population
import random as rand
from copy import deepcopy
from copy import copy
def motifcompetesim_trial(celllist,elonglist,motiflist,max_strand_nr,maxStrandLength,numCells,numRounds,elong,biaslist):
population = Population(... | mit |
rvalyi/OpenUpgrade | addons/claim_from_delivery/__init__.py | 374 | 1053 | ##############################################################################
#
# 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 Affero General Publ... | agpl-3.0 |
laosiaudi/tensorflow | tensorflow/contrib/learn/python/learn/dataframe/transforms/sparsify.py | 76 | 2727 | # 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 |
2013Commons/HUE-SHARK | desktop/core/src/desktop/management/commands/runspawningserver.py | 2 | 4667 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
theblacklion/pyglet | contrib/scene2d/tests/scene2d/VIEW_SUBWINDOW.py | 29 | 1420 | #!/usr/bin/env python
'''Testing flat map allow_oob enforcement.
Press 0-9 to set the size of the view in the window (1=10%, 0=100%)
Press arrow keys to move view focal point (little ball) around map.
Press "o" to turn allow_oob on and off.
You should see no black border with allow_oob=False.
Press escape or close... | bsd-3-clause |
jrabbit/ubotu-fr | plugins/Format/config.py | 15 | 2357 | ###
# Copyright (c) 2004, Jeremiah Fincher
# 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 conditi... | bsd-3-clause |
dostavro/dotfiles | sublime2/Packages/SublimeCodeIntel/libs/codeintel2/tclcile.py | 2 | 8476 | #!/usr/bin/env python
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (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.mozil... | mit |
ruben-ayrapetyan/coreclr | src/ToolBox/SOS/tests/testutils.py | 43 | 5438 | from __future__ import print_function
import lldb
import re
import inspect
import sys
import os
import importlib
summary_file = ''
fail_flag = ''
failed = False
def assertCommon(passed, fatal):
global failed
with open(summary_file, 'a+') as summary:
print(bool(passed), file=summary)
if (not ... | mit |
sbreen94/Zeus_D2vzw | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/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 |
s40523222/2016fallcp_hw | plugin/liquid_tags/img.py | 26 | 2465 | """
Image Tag
---------
This implements a Liquid-style image tag for Pelican,
based on the octopress image tag [1]_
Syntax
------
{% img [class name(s)] [http[s]:/]/path/to/image [width [height]] [title text | "title text" ["alt text"]] %}
Examples
--------
{% img /images/ninja.png Ninja Attack! %}
{% im... | agpl-3.0 |
naturs/shadowsocks | shadowsocks/crypto/table.py | 1044 | 8108 | # !/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
oeeagle/quantum | neutron/openstack/common/notifier/api.py | 22 | 5734 | # Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
cobalys/django | tests/modeltests/files/models.py | 141 | 1038 | """
42. Storing files according to a custom storage system
``FileField`` and its variations can take a ``storage`` argument to specify how
and where files should be stored.
"""
import random
import tempfile
from django.db import models
from django.core.files.storage import FileSystemStorage
temp_storage_location =... | bsd-3-clause |
cloudcopy/seahub | tools/batch-delete.py | 6 | 1819 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import MySQLdb
import settings
try:
dbname = os.environ['DBNAME']
dbuser = os.environ['DBUSER']
dbpasswd = os.environ['DBPASSWD']
except:
sys.stderr.write('Environment not set! Exit\n')
sys.exit(1)
def check_settings():
if settin... | apache-2.0 |
Bushstar/UFO-Project | share/qt/extract_strings_qt.py | 24 | 2667 | #!/usr/bin/env python3
# Copyright (c) 2012-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by... | mit |
Shekharrajak/mubosym | exa_8_simple_car_sequencer.py | 2 | 6197 | # -*- coding: utf-8 -*-
"""
Created on Tue Apr 14 20:41:09 2015
@author: oliver
"""
import numpy as np
from sympy import symbols, sin
import mubosym as mbs
from interp1d_interface import interp
###############################################################
# general system setup example
myMBS = mbs.MBSworld('simple... | mit |
Paul-Haley/LPTHW_python3 | ex43.py | 1 | 9174 | from sys import exit
from random import randint
class Scene(object):
def enter(self):
print("This scene is not yet configured. Subclass it and implement "\
"enter().")
exit(1) # error numbers beyond 0 typically indicate an error
class Engine(object):
def __init__(self, scene_... | mit |
nicky-ji/edx-nicky | lms/djangoapps/instructor_task/tests/test_views.py | 204 | 17817 |
"""
Test for LMS instructor background task views.
"""
import json
from celery.states import SUCCESS, FAILURE, REVOKED, PENDING
from mock import Mock, patch
from django.utils.datastructures import MultiValueDict
from instructor_task.models import PROGRESS
from instructor_task.tests.test_base import (InstructorTaskT... | agpl-3.0 |
dostavro/dotfiles | sublime2/Packages/Package Control/package_control/downloaders/urllib_downloader.py | 9 | 11280 | import re
import os
import sys
from .. import http
try:
# Python 3
from http.client import HTTPException, BadStatusLine
from urllib.request import ProxyHandler, HTTPPasswordMgrWithDefaultRealm, ProxyBasicAuthHandler, ProxyDigestAuthHandler, build_opener, Request
from urllib.error import HTTPError, URL... | mit |
overra/node-gyp | gyp/test/include_dirs/gyptest-default.py | 102 | 1073 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies use of include_dirs when using the default build target.
"""
import TestGyp
test = TestGyp.TestGyp()
if test.format == 'scon... | mit |
MKV21/glimpse_client | 3rdparty/breakpad/src/tools/gyp/test/generator-output/gyptest-copies.py | 74 | 1802 | #!/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.
"""
Verifies file copies with --generator-output using an explicit build
target of 'all'.
"""
import TestGyp
# Ninja and Android don't sup... | bsd-3-clause |
spallavolu/scikit-learn | sklearn/decomposition/incremental_pca.py | 199 | 10508 | """Incremental Principal Components Analysis."""
# Author: Kyle Kastner <kastnerkyle@gmail.com>
# License: BSD 3 clause
import numpy as np
from scipy import linalg
from .base import _BasePCA
from ..utils import check_array, gen_batches
from ..utils.extmath import svd_flip, _batch_mean_variance_update
class Increme... | bsd-3-clause |
iulian787/spack | var/spack/repos/builtin/packages/squashfs/package.py | 3 | 3214 | # 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)
from spack import *
class Squashfs(MakefilePackage):
"""Squashfs - read only compressed filesystem"""
homepage ... | lgpl-2.1 |
Nesiehr/osf.io | osf_tests/test_eager_queryset.py | 4 | 1107 | import pytest
from osf.models import Node
from osf_tests.factories import NodeFactory
@pytest.mark.django_db
class TestEagerQuerySet:
@pytest.mark.django_assert_num_queries
def test_select_related_does_correct_query(self, django_assert_num_queries):
node = NodeFactory()
node_id = node.id
... | apache-2.0 |
G0retZ/pjproject | pjsip-apps/src/py_pjsua/pjsua_app.py | 33 | 21600 | # $Id$
#
# Sample and simple Python script to make and receive calls, and do
# presence and instant messaging/IM using PJSUA-API binding for Python.
#
# Copyright (C) 2003-2007 Benny Prijono <benny@prijono.org>
#
import py_pjsua
import sys
import thread
#
# Configurations
#
THIS_FILE = "pjsua_app.py"
C_QUIT = 0
C_LOG_... | gpl-2.0 |
wimnat/ansible-modules-extras | network/illumos/flowadm.py | 29 | 15000 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Adam Števko <adam.stevko@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the L... | gpl-3.0 |
mlouhivu/build-recipes | gpaw/examples/sisu-1.3.0/gcc.py | 3 | 2014 | #!/usr/bin/env python
"""Wrapper for the GNU compiler that converts / removes incompatible
compiler options and allows for file-specific tailoring."""
import sys
from subprocess import call
# Default compiler and options
compiler = 'gcc'
args2change = {}
fragile_files = ['c/xc/tpss.c']
# Default optimisation setti... | mit |
valdecdev/odoo | addons/document/std_index.py | 1 | 6502 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from content_index import indexer, cntIndex
from subprocess import Popen, PIPE
import StringIO
import odt2txt
import sys, zipfile, xml.dom.minidom
import logging
_logger = logging.getLogger(__name__)
def _to_unicode(s):... | agpl-3.0 |
Ferluci/MAI-Schedule | parser.py | 1 | 1373 | from requests import get
from bs4 import BeautifulSoup
def _group_parser(target_url):
request = get(target_url)
soup = BeautifulSoup(request.text, "html.parser")
groups = []
for group in soup.find_all('a', class_="sc-group-item"):
group = group.get_text()
groups.append(group)
retur... | mit |
40223148/2015cda_g5 | static/Brython3.1.1-20150328-091302/Lib/opcode.py | 714 | 5442 |
"""
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
"""
__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
"haslocal", "hascompare", "hasfree", "opname", "opmap",
"HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]
... | gpl-3.0 |
TheNotOnly/linux-3.5 | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
frankurcrazy/pydhcpd | dhcp_client.py | 1 | 2797 | #!/usr/bin/env python
import dhcp_packet
import socket
import random
import time
import Queue
import select
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.bind( ("", 68) )
sock.settimeou... | bsd-2-clause |
akhileshmaurya/Starting-With-Python | DistanceUtils.py | 1 | 1659 | import math
import json
def manhatanDistance(x1, y1, x2, y2):
distance = math.abs(x1 - x2) + math.abs(y1 - y2)
return distance
def euclidianDistance(x1, y1, x2, y2):
distance = math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
return distance
data = []
with open('data.txt') as json_data:
data = json.... | gpl-3.0 |
MichaelNedzelsky/intellij-community | python/helpers/pydev/third_party/pep8/lib2to3/lib2to3/fixes/fix_renames.py | 326 | 2218 | """Fix incompatible renames
Fixes:
* sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import
# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain
MAPPING = {"sys": {"maxint" : "maxsize"},
}
LOOKUP = {}
def alternates(members):
re... | apache-2.0 |
pyjs/pyjs | examples/tabpanelwidget/__main__.py | 8 | 1051 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
TARGETS = [
'Tabs.py',
]
PACKAGE = {
'title': 'tabpanelwidget',
'desc': 'Tab Panel example',
}
def setup(targets):
'''Setup example for translation, MUST call util.setup(targets).'''
util.setup(targets)
def translate():
'''Translate example, ... | apache-2.0 |
Immortalin/python-for-android | python3-alpha/extra_modules/gdata/apps/__init__.py | 285 | 21144 | #!/usr/bin/python
#
# Copyright (C) 2007 SIOS Technology, 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 appli... | apache-2.0 |
richardcs/ansible | lib/ansible/modules/windows/win_chocolatey_source.py | 28 | 3512 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... | gpl-3.0 |
gibiansky/tensorflow | tensorflow/python/framework/op_def_library.py | 19 | 30843 | # 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 |
bringingheavendown/numpy | numpy/f2py/diagnose.py | 188 | 5295 | #!/usr/bin/env python
from __future__ import division, absolute_import, print_function
import os
import sys
import tempfile
def run_command(cmd):
print('Running %r:' % (cmd))
os.system(cmd)
print('------')
def run():
_path = os.getcwd()
os.chdir(tempfile.gettempdir())
print('------')
pr... | bsd-3-clause |
gladk/woodem | py/manpage.py | 3 | 3054 | # coding: utf-8
#
# Thanks to logilab for this code.
#
# Copied from the logilab.common.optik_ext module (GPL-licensed) and modified for woo.
#
import optparse,time
class ManHelpFormatter(optparse.HelpFormatter):
"""Format help using man pages ROFF format"""
def __init__(self,indent_increment=0,max_help_position=24... | gpl-2.0 |
TeamFeH/back-end | back_end/back_end/settings.py | 1 | 2221 | """
Django settings for back_end project.
For more information on this file, see
https://docs.djangoproject.com/en/1.7/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.7/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
i... | gpl-2.0 |
sandeepgupta2k4/tensorflow | tensorflow/contrib/distributions/python/kernel_tests/bijectors/exp_test.py | 73 | 2307 | # 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 |
weightedEights/runDBcheck | RADAR_DATA/20170713.001/Source/Shell/setup.py | 5 | 7913 | """
This class holds all the info needed to configure
a given setup from an experiment file
"""
import logging
import os
from pylib.Inifile import Inifile
from pylib.TuFile import TuFile
from pylib.rxclasses import rxConfig
from pylib.txclasses import txConfig
from pylib.beamcodeclasses import beamcodesConfig
from mo... | gpl-3.0 |
tiwillia/openshift-tools | openshift/installer/vendored/openshift-ansible-3.5.5/roles/lib_openshift/src/test/unit/oc_secret.py | 2 | 2783 | #!/usr/bin/env python2
'''
Unit tests for oc secret
'''
# To run:
# ./oc_secret.py
#
# .
# Ran 1 test in 0.002s
#
# OK
import os
import sys
import unittest
import mock
# Removing invalid variable names for tests so that I can
# keep them brief
# pylint: disable=invalid-name,no-name-in-module
# Disable import-error b... | apache-2.0 |
pmarques/ansible | test/units/plugins/become/test_sudo.py | 11 | 1252 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2020 Ansible Project
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import re
from an... | gpl-3.0 |
alansaid/RecipeParser | parseRecipeData.py | 1 | 2285 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Convert JSON data to human-readable form.
Usage:
prettyJSON.py domain team
"""
import sys
import glob
import traceback
def main(args):
authors = {}
userFile = open('parsed/parsedProfiles.tsv', 'r')
userIds = {}
for line in userFile:
userData = line.split("\t")... | gpl-2.0 |
anilmuthineni/tensorflow | tensorflow/python/training/monitored_session.py | 8 | 35656 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
boundlessgeo/QGIS | python/plugins/db_manager/db_plugins/postgis/sql_dictionary.py | 29 | 13470 | # -*- coding: utf-8 -*-
"""
***************************************************************************
sql_dictionary.py
---------------------
Date : April 2012
Copyright : (C) 2012 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
************... | gpl-2.0 |
cvkbtzx/euphorbia | EuphorbiaEditor/exts/euphorbia.py | 1 | 1300 | #-*- coding:utf-8 -*-
## EUPHORBIA - GTK LaTeX Editor
## Module: EuphorbiaEditor.exts.euphorbia
## Copyright (C) 2008-2011 Bzoloid
##
## 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; ... | gpl-2.0 |
georgemarshall/django | django/core/management/commands/compilemessages.py | 33 | 6223 | import codecs
import concurrent.futures
import glob
import os
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import (
find_command, is_ignored_path, popen_wrapper,
)
def has_bom(fn):
with open(fn, 'rb') as f:
sample = f.read(4)
return sample.st... | bsd-3-clause |
mm112287/2015cda-24 | static/Brython3.1.1-20150328-091302/Lib/logging/handlers.py | 736 | 55579 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | gpl-3.0 |
cherusk/ansible | lib/ansible/modules/files/find.py | 27 | 13494 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Ruggero Marchei <ruggero.marchei@daemonzone.net>
# (c) 2015, Brian Coca <bcoca@ansible.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
#... | gpl-3.0 |
fnordahl/nova | nova/tests/unit/api/openstack/compute/test_server_usage.py | 63 | 5369 | # Copyright 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 requ... | apache-2.0 |
julianwang/cinder | cinder/tests/unit/db/test_qos_specs.py | 6 | 9241 | # Copyright (C) 2013 eBay Inc.
# 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/lice... | apache-2.0 |
rthallisey/clapper | dhcp-test/test-pacemaker-networks.py | 2 | 1263 | import sys
from scapy.all import *
import ipaddress
def find_dhcp_servers():
conf.checkIPaddr = False
fam, hw = get_if_raw_hwaddr(conf.iface)
dhcp_discover = (Ether(dst="ff:ff:ff:ff:ff:ff") /
IP(src="0.0.0.0", dst="255.255.255.255") /
UDP(sport=68, dport=67) /
... | apache-2.0 |
ekoeppen/panstamp-python | pyswap/src/swap/protocol/SwapMote.py | 3 | 10123 | #########################################################################
#
# SwapMote
#
# Copyright (c) 2011 panStamp <contact@panstamp.com>
#
# This file is part of the panStamp project.
#
# panStamp is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public Licen... | gpl-2.0 |
myuuuuun/ThinkStats2-Notebook | code/mystery.py | 68 | 1578 | """This file contains code used in "Think Stats",
by Allen B. Downey, available from greenteapress.com
Copyright 2014 Allen B. Downey
License: GNU GPLv3 http://www.gnu.org/licenses/gpl.html
"""
from __future__ import print_function
import random
import numpy as np
import scipy.stats
def write_sample(sample, filena... | gpl-2.0 |
PavanGupta01/aerospike-admin | lib/cluster.py | 1 | 9431 | # Copyright 2013-2014 Aerospike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http:#www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | apache-2.0 |
ridfrustum/lettuce | tests/integration/lib/Django-1.2.5/django/contrib/admin/templatetags/log.py | 310 | 2270 | from django import template
from django.contrib.admin.models import LogEntry
register = template.Library()
class AdminLogNode(template.Node):
def __init__(self, limit, varname, user):
self.limit, self.varname, self.user = limit, varname, user
def __repr__(self):
return "<GetAdminLog Node>"
... | gpl-3.0 |
djordon/queueing-tool | tests/test_network.py | 1 | 18249 | import os
import unittest
try:
import unittest.mock as mock
except ImportError:
import mock
try:
import matplotlib.pyplot as plt
HAS_MATPLOTLIB = True
except ImportError:
HAS_MATPLOTLIB = False
import networkx as nx
import numpy as np
import queueing_tool as qt
TRAVIS_TEST = os.environ.get('TRA... | mit |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/utils.py | 436 | 3267 | from __future__ import absolute_import, division, unicode_literals
from types import ModuleType
from pip._vendor.six import text_type
try:
import xml.etree.cElementTree as default_etree
except ImportError:
import xml.etree.ElementTree as default_etree
__all__ = ["default_etree", "MethodDispatcher", "isSurr... | agpl-3.0 |
gunan/tensorflow | tensorflow/python/debug/examples/v2/debug_mnist_v2.py | 4 | 7614 | # Copyright 2019 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 |
sambler/oiio | testsuite/tiff-depths/run.py | 4 | 2847 | #!/usr/bin/env python
# FIXME -- eventually, we want more (all?) of these to work
imagedir = parent + "/libtiffpic/depth"
files = [
"flower-minisblack-02.tif", # 73x43 2-bit minisblack gray image
"flower-minisblack-04.tif", # 73x43 4-bit minisblack gray image
"flower-minisblack-06.tif", # 73x43 6... | bsd-3-clause |
cydev/cyvk | api/vkapi.py | 1 | 5829 | from __future__ import unicode_literals
import time
from compat import text_type, get_logger, requests, json
from config import MAX_API_RETRY, API_MAXIMUM_RATE, TRANSPORT_ID
from .errors import (api_errors, UnknownError, IncorrectApiResponse, TooManyRequestsPerSecond, AuthenticationException,
Inva... | mit |
NetApp/cinder | cinder/db/sqlalchemy/migrate_repo/versions/062_deleted_type_to_Integer.py | 11 | 1215 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# di... | apache-2.0 |
ivanhorvath/openshift-tools | ansible/roles/lib_oa_openshift/src/ansible/oc_label.py | 84 | 1037 | # pylint: skip-file
# flake8: noqa
def main():
''' ansible oc module for labels '''
module = AnsibleModule(
argument_spec=dict(
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
state=dict(default='present', type='str',
choices=[... | apache-2.0 |
argriffing/scipy | benchmarks/benchmarks/go_benchmark_functions/go_funcs_C.py | 10 | 18425 | # -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import (abs, asarray, cos, exp, floor, pi, sign, sin, sqrt, sum,
size, tril, isnan, atleast_2d, repeat)
from numpy.testing import assert_almost_equal
from .go_benchmark import Benc... | bsd-3-clause |
zakuro9715/lettuce | tests/integration/lib/Django-1.3/tests/modeltests/str/models.py | 92 | 1213 | # -*- coding: utf-8 -*-
"""
2. Adding __str__() or __unicode__() to models
Although it's not a strict requirement, each model should have a
``_str__()`` or ``__unicode__()`` method to return a "human-readable"
representation of the object. Do this not only for your own sanity when dealing
with the interactive prompt, ... | gpl-3.0 |
macbre/mobify | mobify/sources/readthedocs.py | 1 | 2431 | """
Read The Docs materials
https://lasagne.readthedocs.io/en/latest/
"""
import re
from collections import OrderedDict
from mobify.source import MultiChapterSource, MobifySource
def unique(_list):
_dict = OrderedDict()
for item in _list:
_dict[item] = True
return list(_dict.keys())
class Re... | mit |
osrg/ryu | ryu/lib/packet/packet.py | 4 | 6138 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 appli... | apache-2.0 |
zhaochl/python-utils | verify_code/Imaging-1.1.7/PIL/GimpPaletteFile.py | 40 | 1337 | #
# Python Imaging Library
# $Id$
#
# stuff to read GIMP palette files
#
# History:
# 1997-08-23 fl Created
# 2004-09-07 fl Support GIMP 2.0 palette files.
#
# Copyright (c) Secret Labs AB 1997-2004. All rights reserved.
# Copyright (c) Fredrik Lundh 1997-2004.
#
# See the README file for information on usage ... | apache-2.0 |
yetu/repotools | third_party/gsutil/oauth2_plugin/oauth2_client.py | 45 | 22215 | # Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
ewandor/home-assistant | homeassistant/components/media_player/emby.py | 4 | 11094 | """
Support to interface with the Emby API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.emby/
"""
import asyncio
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MEDIA_TYPE_TVSHOW, MEDIA_TY... | apache-2.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/prompt_toolkit/eventloop/asyncio_win32.py | 23 | 2427 | """
Win32 asyncio event loop.
Windows notes:
- Somehow it doesn't seem to work with the 'ProactorEventLoop'.
"""
from __future__ import unicode_literals
from .base import EventLoop, INPUT_TIMEOUT
from ..terminal.win32_input import ConsoleInputReader
from .callbacks import EventLoopCallbacks
from .asyncio_base import ... | bsd-3-clause |
0x27/clusterd | src/platform/railo/deployers/log_injection.py | 5 | 4821 | from src.platform.railo.authenticate import checkAuth
from src.platform.railo.interfaces import RINTERFACES
from src.module.deploy_utils import _serve, waitServe, killServe, parse_war_path
from re import findall
from log import LOG
from hashlib import md5
from time import sleep
from os.path import abspath
from threadin... | mit |
FrederichCheng/incubator-superset | superset/connectors/druid/views.py | 2 | 11262 | from datetime import datetime
import logging
import sqlalchemy as sqla
from flask import Markup, flash, redirect
from flask_appbuilder import CompactCRUDMixin, expose
from flask_appbuilder.models.sqla.interface import SQLAInterface
from flask_babel import lazy_gettext as _
from flask_babel import gettext as __
from... | apache-2.0 |
raphaelmerx/django | tests/model_fields/models.py | 210 | 12155 | import os
import tempfile
import uuid
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.core.files.storage import FileSystemStorage
from django.db import models
from django.db.models.fields.files import Imag... | bsd-3-clause |
jean/sentry | src/sentry/south_migrations/0274_auto__add_index_commit_repository_id_date_added.py | 4 | 87196 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding index on 'Commit', fields ['repository_id', 'date_added']
db.crea... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.