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 |
|---|---|---|---|---|---|
anryko/ansible | lib/ansible/modules/network/aci/aci_access_port_block_to_access_port.py | 13 | 10878 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Simon Metzger <smnmtzgr@gmail.com>
# 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'... | gpl-3.0 |
recipy/recipy | integration_test/regexps.py | 1 | 4118 | """
recipy-related regexps.
"""
# Copyright (c) 2016 University of Edinburgh.
def get_usage():
"""
Get regular expressions for usage information printed to console.
:returns: regular expressions
:rtype: list of str or unicode
"""
return [r"Usage:\n"]
def get_version():
"""
Get regu... | apache-2.0 |
ClydeSpace-GroundStation/GroundStation | Utilities/Supporting_Libraries/gr-tnc-master/docs/doxygen/doxyxml/__init__.py | 333 | 2474 | #
# Copyright 2010 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 option)
# any later version.
#
#... | mit |
aferr/TemporalPartitioningMemCtl | src/mem/slicc/ast/TypeFieldMemberAST.py | 17 | 2664 | # Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
# Copyright (c) 2009 The Hewlett-Packard Development Company
# 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 co... | bsd-3-clause |
chrishas35/django-travis-ci | tests/regressiontests/builtin_server/tests.py | 91 | 1738 | from StringIO import StringIO
from django.core.servers.basehttp import ServerHandler
from django.utils.unittest import TestCase
#
# Tests for #9659: wsgi.file_wrapper in the builtin server.
# We need to mock a couple of of handlers and keep track of what
# gets called when using a couple kinds of WSGI apps.
#
class ... | bsd-3-clause |
40223114/w16b_test | static/Brython3.1.3-20150514-095342/Lib/base64.py | 733 | 13975 | #! /usr/bin/env python3
"""RFC 3548: Base16, Base32, Base64 Data Encodings"""
# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere
import re
import struct
import binascii
_... | agpl-3.0 |
XTAv2/Enigma2 | lib/python/Plugins/Extensions/CutListEditor/ui.py | 32 | 13078 | from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ServicePosition import ServicePositionGauge
from Components.ActionMap import HelpableActionMap
from Components.MultiContent import MultiContentEntryText
from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase... | gpl-2.0 |
klpdotorg/dubdubdub | apps/ivrs/migrations/0026_auto_20170101_2313.py | 1 | 1139 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
def forwards_func(apps, schema_editor):
State = apps.get_model("ivrs", "State")
User = apps.get_model("users", "User")
states = State.objects.all()
for state in states:
# Trimming the starting 0.... | mit |
rajadhva/servo | tests/wpt/css-tests/css21_dev/xhtml1/support/fonts/makegsubfonts.py | 1616 | 14125 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
MysteryCoin/MysteryCoinHasSecrets | share/qt/extract_strings_qt.py | 2945 | 1844 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
import operator
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by x... | mit |
scifiswapnil/Project-LoCatr | lib/python2.7/site-packages/pip/commands/completion.py | 343 | 2453 | from __future__ import absolute_import
import sys
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
CO... | mit |
umitproject/packet-manipulator | umit/pm/higwidgets/higtoolbars.py | 2 | 14122 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008 Adriano Monteiro Marques
#
# Author: Francesco Piccinno <stack.box@gmail.com>
#
# 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 |
google/starthinker | dags/test_dag.py | 1 | 4439 | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | apache-2.0 |
todaychi/hue | desktop/core/ext-py/lxml-3.3.6/src/lxml/tests/test_relaxng.py | 16 | 5736 | # -*- coding: utf-8 -*-
"""
Test cases related to RelaxNG parsing and validation
"""
import unittest, sys, os.path
this_dir = os.path.dirname(__file__)
if this_dir not in sys.path:
sys.path.insert(0, this_dir) # needed for Py3
from common_imports import etree, BytesIO, _bytes, HelperTestCase, fileInTestDir
from... | apache-2.0 |
mrhanky17/irc3 | tests/test_ctcp.py | 2 | 1186 | # -*- coding: utf-8 -*-
from irc3.testing import BotTestCase
from irc3.plugins.ctcp import CTCP
class TestCTCP(BotTestCase):
config = dict(includes=['irc3.plugins.ctcp'],
ctcp_max_replies=3,
ctcp=dict(foo='bar'))
def test_ctcp(self):
bot = self.callFTU(autojoins=[... | mit |
cancro7/gem5 | tests/configs/memtest-ruby.py | 15 | 4210 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# Copyright (c) 2010 Advanced Micro Devices, 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 co... | bsd-3-clause |
jasonbot/django | tests/postgres_tests/migrations/0002_create_test_models.py | 231 | 8070 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from ..fields import * # NOQA
class Migration(migrations.Migration):
dependencies = [
('postgres_tests', '0001_setup_extensions'),
]
operations = [
migrations.CreateModel(
... | bsd-3-clause |
mezz64/home-assistant | homeassistant/components/ihc/switch.py | 21 | 2427 | """Support for IHC switches."""
from homeassistant.components.switch import SwitchEntity
from . import IHC_CONTROLLER, IHC_INFO
from .const import CONF_OFF_ID, CONF_ON_ID
from .ihcdevice import IHCDevice
from .util import async_pulse, async_set_bool
def setup_platform(hass, config, add_entities, discovery_info=None)... | apache-2.0 |
nikitasingh981/scikit-learn | examples/semi_supervised/plot_label_propagation_versus_svm_iris.py | 50 | 2378 | """
=====================================================================
Decision boundary of label propagation versus SVM on the Iris dataset
=====================================================================
Comparison for decision boundary generated on iris dataset
between Label Propagation and SVM.
This demon... | bsd-3-clause |
DongjunLee/kino-bot | kino/slack/plot.py | 1 | 2684 | from matplotlib import pyplot as plt
import matplotlib.dates as dt
import seaborn
seaborn.set()
import datetime
class Plot(object):
def __init__(self):
pass
def make_bar(
x,
y,
f_name,
title=None,
legend=None,
x_label=None,
y_label=None,
... | mit |
jdreaver/vispy | examples/tutorial/gl/cube.py | 18 | 8370 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2015, Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -------------------------------------------------------------------------... | bsd-3-clause |
sylvchev/mdla | examples/example_benchmark_performance.py | 1 | 6309 | """Benchmarking dictionary learning algorithms on random dataset"""
from multiprocessing import cpu_count
from time import time
import matplotlib.pyplot as plt
import numpy as np
from numpy import array
from numpy.linalg import norm
from numpy.random import permutation, rand, randint, randn
from mdla import MiniBatc... | gpl-3.0 |
nkhuyu/blaze | blaze/compute/core.py | 5 | 14061 | from __future__ import absolute_import, division, print_function
import numbers
from datetime import date, datetime
import toolz
from toolz import first, concat, memoize, unique, assoc
import itertools
from collections import Iterator
from ..compatibility import basestring
from ..expr import Expr, Field, Symbol, symb... | bsd-3-clause |
mattaw/SoCFoundationFlow | admin/waf/waf-1.8.19/build_system_kit/overview/bbdlib.py | 5 | 1115 | #! /usr/bin/env python
import os, sys, imp
from waflib import Context, Options, Configure, Utils, Logs
def start(cwd, version, wafdir):
# simple example, the file main.c is hard-coded
try:
os.stat(cwd + os.sep + 'bbit')
except:
print('call from a folder containing a file named "bbit"')
sys.exit(1)
Logs.ini... | apache-2.0 |
stbka/ansible | lib/ansible/plugins/callback/mail.py | 114 | 4572 | # -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.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 ... | gpl-3.0 |
bguillot/OpenUpgrade | addons/l10n_hn/__openerp__.py | 87 | 2258 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2009-2010 Salvatore J. Trimarchi <salvatore@trimarchi.co.cc>
# (http://salvatoreweb.co.cc)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU G... | agpl-3.0 |
lekkas/c-algorithms | src/thirdparty/gtest/test/gtest_list_tests_unittest.py | 1898 | 6515 | #!/usr/bin/env python
#
# Copyright 2006, 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... | mit |
erinn/ansible | lib/ansible/plugins/lookup/etcd.py | 56 | 2396 | # (c) 2013, Jan-Piet Mens <jpmens(at)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 later ver... | gpl-3.0 |
ujjwalwahi/odoo | addons/purchase/wizard/purchase_line_invoice.py | 177 | 5258 | # -*- 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 |
yangzhongj/vitess | test/update_stream.py | 5 | 13914 | #!/usr/bin/env python
import warnings
# Dropping a table inexplicably produces a warning despite
# the "IF EXISTS" clause. Squelch these warnings.
warnings.simplefilter('ignore')
import logging
import traceback
import threading
import unittest
import environment
import tablet
import utils
from vtdb import dbexceptio... | bsd-3-clause |
wrznr/gramophone | tests/gp/test_alignment.py | 1 | 2132 | # -*- coding: utf-8 -*-
import sys, os, pytest
from distutils import dir_util
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../gramophone')))
from gramophone import gp
@pytest.fixture
def datadir(tmpdir, request):
'''
Fixture responsible for searching a folder with the same n... | lgpl-3.0 |
tferr/ASA | scripting-examples/3D_Analysis_ImageStack.py | 1 | 2179 | #@ImagePlus imp
#@LogService log
'''
This script uses an outdated API. For a modern replacement, have a look at
https://github.com/morphonets/SNT/tree/master/src/main/resources/script_templates/Neuroanatomy
'''
from sholl import Sholl_Analysis
from sholl import Options
from os.path import expanduser
def spa... | gpl-3.0 |
quamilek/django | tests/delete_regress/models.py | 99 | 2930 | from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from django.db import models
class Award(models.Model):
name = models.CharField(max_length=25)
object_id = models.PositiveIntegerField()
content_type = mode... | bsd-3-clause |
jalexvig/tensorflow | tensorflow/contrib/data/python/kernel_tests/interleave_dataset_op_test.py | 11 | 30713 | # 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 |
dymkowsk/mantid | Testing/SystemTests/tests/analysis/SANS2DMultiPeriodAddFiles.py | 3 | 3134 | #pylint: disable=no-init
from __future__ import (absolute_import, division, print_function)
import stresstesting
from mantid.simpleapi import *
from mantid import config
from ISISCommandInterface import *
class SANS2DMultiPeriodAddFiles(stresstesting.MantidStressTest):
def requiredMemoryMB(self):
"""Re... | gpl-3.0 |
anirudhSK/chromium | tools/telemetry/telemetry/core/system_info_unittest.py | 38 | 2149 | # 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 unittest
from telemetry.core import gpu_device
from telemetry.core import gpu_info
from telemetry.core import system_info
class TestSystemInfo(unitte... | bsd-3-clause |
faribas/RMG-Py | rmgpy/__init__.py | 4 | 6169 | #!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2009 Prof. William H. Green (whgreen@mit.edu) and the
# RMG Team (rmg_dev@mit.edu)
#
# Permission is hereby granted, free of charge, t... | mit |
abhattad4/Digi-Menu | digimenu2/tests/forms_tests/tests/test_error_messages.py | 13 | 11628 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.core.files.uploadedfile import SimpleUploadedFile
from django.forms import (
BooleanField, CharField, ChoiceField, DateField, DateTimeField,
DecimalField, EmailField, FileField, FloatField, Form,
GenericIPAddressField, IntegerField... | bsd-3-clause |
jschaul/ComplexNetworkSim | examples/getting started code/first_visualisation.py | 1 | 1471 | '''
Complete code file only from ComplexNetworkSim's "getting started" documentation section, for visualising a simulation. For explanations refer to the documentation page.
Current link: http://complexnetworksim.0sites.net/start.html (documentation hosting may change place - see the PyPi index page.)
@author: Jo... | bsd-2-clause |
andi34/samsung_espresso_kernel | 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 |
jonfoster/pyxb1 | pyxb/__init__.py | 1 | 10123 | """PyXB stands for Python U{W3C XML
Schema<http://www.w3.org/XML/Schema>} Bindings, and is pronounced
"pixbee". It enables translation between XML instance documents and
Python objects following rules specified by an XML Schema document.
This is the top-level entrypoint to the PyXB system. Importing this
gets you al... | apache-2.0 |
DomoControl/domocontrol | script/script.py | 2 | 25283 | #!/usr/bin/python
# -*- coding: utf-8 -*-
##############################################################################
#
# DomoControl Source Management Solution
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU GPLv3 License as
# published by the Fre... | apache-2.0 |
cl4rke/scikit-learn | sklearn/svm/tests/test_sparse.py | 95 | 12156 | from nose.tools import assert_raises, assert_true, assert_false
import numpy as np
from scipy import sparse
from numpy.testing import (assert_array_almost_equal, assert_array_equal,
assert_equal)
from sklearn import datasets, svm, linear_model, base
from sklearn.datasets import make_classif... | bsd-3-clause |
ronenil/net-next | tools/perf/scripts/python/export-to-postgresql.py | 617 | 16128 | # export-to-postgresql.py: export perf data to a postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# Thi... | gpl-2.0 |
rbarlow/pulp | server/pulp/server/webservices/http.py | 14 | 6952 | """
HTTP utilities to help Pulp web services with HTTP using the django framework
"""
import base64
import os
import re
import threading
import urllib
_thread_local = threading.local()
API_HREF = '/pulp/api'
API_V2_HREF = API_HREF + '/v2'
def request_info(key):
"""
Get information from the request.
R... | gpl-2.0 |
endlessm/chromium-browser | third_party/catapult/third_party/gsutil/gslib/vendored/boto/boto/sdb/db/__init__.py | 189 | 1108 | # Copyright (c) 2006,2007,2008 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy,... | bsd-3-clause |
s0930342674/pyload | module/plugins/hooks/BypassCaptcha.py | 14 | 4068 | # -*- coding: utf-8 -*-
import pycurl
from module.network.HTTPRequest import BadHeader
from module.network.RequestFactory import getRequest as get_request
from module.plugins.internal.Hook import Hook, threaded
class BypassCaptchaException(Exception):
def __init__(self, err):
self.err = err
def g... | gpl-3.0 |
Pikecillo/genna | external/4Suite-XML-1.0.2/test/Xml/XPointer/test_parser.py | 1 | 2641 |
#From the spec (and a few more)
pointers = [('xpointer(id("list37")/item)',
'xpointer(id("list37")/child::item)'),
('xpointer(id("list37")/item[1]/range-to(following-sibling::item[2]))',
'xpointer(id("list37")/child::item[1]/range-to(following-sibling::item[2]))'),
('... | gpl-2.0 |
TwinkleChawla/nova | nova/objects/network_request.py | 13 | 2534 | # Copyright 2014 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
lixt/lily2-gem5 | src/cpu/IntrControl.py | 72 | 1821 | # Copyright (c) 2005-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
fhaoquan/kbengine | kbe/src/lib/python/Lib/test/datetimetester.py | 60 | 150828 | """Test date/time type.
See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases
"""
import sys
import pickle
import random
import unittest
from operator import lt, le, gt, ge, eq, ne, truediv, floordiv, mod
from test import support
import datetime as datetime_module
from datetime import MINYEAR, MAXYEAR
from... | lgpl-3.0 |
Southpaw-TACTIC/Team | src/python/Lib/site-packages/PySide/examples/widgets/analogclock.py | 1 | 3131 | #!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2004-2005 Trolltech AS. All rights reserved.
##
## This file is part of the example classes of the Qt Toolkit.
##
## This file may be used under the terms of the GNU General Public
## License version... | epl-1.0 |
habnabit/pip | pip/_vendor/distlib/database.py | 203 | 49199 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2012-2014 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""PEP 376 implementation."""
from __future__ import unicode_literals
import base64
import codecs
import contextlib
import hashlib
import logging
import os
import posixpath
import sys
import z... | mit |
rherault-insa/numpy | numpy/distutils/tests/test_system_info.py | 16 | 6685 | from __future__ import division, print_function
import os
import shutil
from tempfile import mkstemp, mkdtemp
from numpy.distutils import ccompiler
from numpy.testing import TestCase, run_module_suite, assert_, assert_equal
from numpy.testing.decorators import skipif
from numpy.distutils.system_info import system_inf... | bsd-3-clause |
garlandkr/ansible | lib/ansible/runner/action_plugins/template.py | 9 | 5748 | # (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 |
Godiyos/python-for-android | python3-alpha/python3-src/Lib/encodings/unicode_escape.py | 852 | 1184 | """ Python 'unicode-escape' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is inte... | apache-2.0 |
ErikKringen/kafka | tests/kafkatest/tests/client/pluggable_test.py | 23 | 2325 | # 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 |
loic/django | django/core/checks/model_checks.py | 108 | 6273 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import types
from itertools import chain
from django.apps import apps
from django.core.checks import Error, Tags, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
errors = []
if app_configs is Non... | bsd-3-clause |
google/clusterfuzz | src/local/butler/reproduce_tool/android.py | 1 | 3980 | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
ruslanloman/nova | nova/tests/unit/fake_flavor.py | 62 | 1704 | # Copyright 2015 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
lostinplace/filtered-intervaltree | setup.py | 1 | 1509 | from setuptools import setup, find_packages
from codecs import open
from os import path
import os
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'readme.md'), encoding='utf-8') as f:
long_description = f.read()
with open(path.join(here, '.library-version'), encoding='utf-8') as f:
exis... | mit |
SWENG500-Team1/FitnessForSplunk | fitness_for_splunk/bin/pyasn1/debug.py | 161 | 3044 | import time
import logging
from pyasn1.compat.octets import octs2ints
from pyasn1 import error
from pyasn1 import __version__
flagNone = 0x0000
flagEncoder = 0x0001
flagDecoder = 0x0002
flagAll = 0xffff
flagMap = {
'encoder': flagEncoder,
'decoder': flagDecoder,
'all': flagAll
}
class Prin... | mit |
cuilishen/cuilishenMissionPlanner | Lib/site-packages/numpy/f2py/capi_maps.py | 51 | 29016 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
"""
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED... | gpl-3.0 |
lstephen/construi | setup.py | 1 | 1635 | import codecs
import os
from setuptools import find_packages, setup
def read(*parts):
path = os.path.join(os.path.dirname(__file__), *parts)
with codecs.open(path, encoding="utf-8") as fobj:
return fobj.read()
def find_version():
with open("VERSION") as f:
return f.read().strip()
def ... | apache-2.0 |
google-code-export/exposong | lib/exposong/plugins/lyric.py | 3 | 58372 | # -*- coding: utf-8 -*-
# vim: ts=4 sw=4 expandtab ai:
#
# Copyright (C) 2008-2011 Exposong.org
#
# ExpoSong 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... | gpl-3.0 |
willingc/oh-mainline | vendor/packages/twisted/doc/core/examples/ampserver.py | 23 | 1063 | from twisted.protocols import amp
class Sum(amp.Command):
arguments = [('a', amp.Integer()),
('b', amp.Integer())]
response = [('total', amp.Integer())]
class Divide(amp.Command):
arguments = [('numerator', amp.Integer()),
('denominator', amp.Integer())]
response = [... | agpl-3.0 |
zhenglaizhang/python | razzl/0002/0002.py | 38 | 1034 | #!/usr/bin/env python
'''
It can save the contents of the file to the mysql database.
'''
import os
import random
import MySQLdb
#import string
f = open(os.getcwd()+'\\2','w')
for x in range(200):
words = [chr(a) for a in range(65,91)]+[chr(a) for a in range(97,122)]+[str(a) for a in range(0,11)]
# It is equal to... | mit |
stefan-andritoiu/upm | examples/python/ttp223.py | 6 | 1757 | #!/usr/bin/env python
from __future__ import print_function
# Author: Sarah Knepper <sarah.knepper@intel.com>
# Copyright (c) 2015 Intel Corporation.
#
# 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 ... | mit |
david-ragazzi/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/axes.py | 69 | 259904 | from __future__ import division, generators
import math, sys, warnings, datetime, new
import numpy as np
from numpy import ma
import matplotlib
rcParams = matplotlib.rcParams
import matplotlib.artist as martist
import matplotlib.axis as maxis
import matplotlib.cbook as cbook
import matplotlib.collections as mcoll
im... | gpl-3.0 |
vipmike007/virt-test | virttest/utils_libvirtd.py | 10 | 10013 | """
Module to control libvirtd service.
"""
import re
import logging
import aexpect
from virttest import remote, utils_misc
from autotest.client import utils, os_dep
from autotest.client.shared import error
from virttest.staging import service
from virttest.utils_gdb import GDB
try:
os_dep.command("libvirtd")
... | gpl-2.0 |
acshan/odoo | addons/stock/wizard/orderpoint_procurement.py | 326 | 2844 | # -*- 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 |
gojira/tensorflow | tensorflow/contrib/timeseries/python/timeseries/model_utils_test.py | 41 | 1400 | # 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 |
localu/metagoofil | hachoir_parser/audio/midi.py | 84 | 9168 | """
Musical Instrument Digital Interface (MIDI) audio file parser.
Documentation:
- Standard MIDI File Format, Dustin Caldwell (downloaded on wotsit.org)
Author: Victor Stinner
Creation: 27 december 2006
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet, Bits, ParserError,
String, U... | gpl-2.0 |
getmovement/national-voter-file | src/python/national_voter_file/transformers/base.py | 2 | 36982 | import os
import csv
import datetime
from collections import defaultdict
from io import TextIOWrapper
import zipfile
from functools import wraps
import usaddress
DATA_DIR = os.path.join(os.path.abspath(os.getcwd()), 'data')
"""
# Raw voter data -> standardized data frame
## Overview
This file contains a base class... | mit |
doge-search/webdoge | liqian/Caltech/research/research/settings.py | 15 | 3130 | # -*- coding: utf-8 -*-
# Scrapy settings for research project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# http://doc.scrapy.org/en/latest/topics/settings.html
# http://scrapy.readthedocs.org/en/lates... | unlicense |
aleksandra-tarkowska/django | tests/i18n/patterns/tests.py | 12 | 12938 | from __future__ import unicode_literals
import os
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse, clear_url_caches
from django.http import HttpResponsePermanentRedirect
from django.middleware.locale import LocaleMiddleware
from django.test import TestCase, overrid... | bsd-3-clause |
Willyham/tchannel-python | tchannel/tornado/timeout.py | 1 | 1748 | # Copyright (c) 2015 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | mit |
mandeepdhami/netvirt-ctrl | cli/desc/version200/tacacs_run_config.py | 4 | 4102 | #
# Copyright (c) 2013 Big Switch Networks, Inc.
#
# Licensed under the Eclipse Public License, Version 1.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.eclipse.org/legal/epl-v10.html
#
# Unless required by applicable l... | epl-1.0 |
mrinalabrol/magik | env/lib/python3.4/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
hgl888/buck | third-party/py/twitter-commons/src/python/twitter/common/python/orderedset.py | 23 | 2888 | # ==================================================================================================
# Copyright 2013 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | apache-2.0 |
saradbowman/osf.io | osf/migrations/0099_file_version_user_metadata.py | 16 | 1524 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-10 14:19
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
class Migration(migrations.Migration):
dependencies = [
... | apache-2.0 |
jordanemedlock/psychtruths | temboo/core/Library/Twitter/DirectMessages/GetMessageByID.py | 5 | 4855 | # -*- coding: utf-8 -*-
###############################################################################
#
# GetMessageByID
# Retrieves a single direct message, specified by an id.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you... | apache-2.0 |
Kpler/scrapy-logentries-extension | scrapylogentries/extension.py | 1 | 1989 | import logging
import os
from scrapy import signals
from scrapy.exceptions import NotConfigured
from logentries import LogentriesHandler
from logentriesadapter import LogentriesAdapter, ScrapingHubFilter
logger = logging.getLogger(__name__)
class LogentriesExtension(object):
def __init__(self, token):
... | mit |
TinLe/Diamond | src/collectors/mongodb/test/testmongodb.py | 26 | 10487 | #!/usr/bin/python
# coding=utf-8
################################################################################
from test import CollectorTestCase
from test import get_collector_config
from test import unittest
from test import run_only
from mock import MagicMock
from mock import patch
from mock import call
from di... | mit |
tobes/py3status | setup.py | 2 | 1942 | """
py3status
"""
from setuptools import find_packages, setup
import fastentrypoints # noqa f401
import os
import sys
module_path = os.path.join(
os.path.dirname(os.path.realpath(__file__)), 'py3status')
sys.path.insert(0, module_path)
from version import version # noqa e402
sys.path.remove(module_path)
# Uti... | bsd-3-clause |
flh/odoo | addons/website_gengo/controllers/main.py | 24 | 1783 | # -*- coding: utf-8 -*-
import openerp
from openerp import http
from openerp.http import request
import time
GENGO_DEFAULT_LIMIT = 20
class website_gengo(http.Controller):
@http.route('/website/get_translated_length', type='json', auth='user', website=True)
def get_translated_length(self, translated_ids, la... | agpl-3.0 |
hcsturix74/django | tests/select_related_onetoone/tests.py | 301 | 10516 | from __future__ import unicode_literals
import unittest
from django.core.exceptions import FieldError
from django.test import SimpleTestCase, TestCase
from .models import (
AdvancedUserStat, Child1, Child2, Child3, Child4, Image, Parent1, Parent2,
Product, StatDetails, User, UserProfile, UserStat, UserStatRe... | bsd-3-clause |
metashell/metashell | 3rd/templight/llvm/utils/lit/tests/shtest-run-at-line.py | 11 | 2227 | # Check that -vv makes the line number of the failing RUN command clear.
# (-v is actually sufficient in the case of the internal shell.)
#
# RUN: not %{lit} -j 1 -vv %{inputs}/shtest-run-at-line > %t.out
# RUN: FileCheck --input-file %t.out %s
#
# END.
# CHECK: Testing: 4 tests
# In the case of the external shell,... | gpl-3.0 |
rbatist/HPN-Scripting | cfgsave.py | 2 | 2690 | # This script is provided with no support or guarantees.
#
# Purpose of this script is to save configuration to remote FTP server
# File is automatically generate in form of sysname_timestamp.cfg
#
# Usage:
# ftpsave.py -s <serverIP> -u <FTPusername> -p <FTPpassword> -d (to delete file after transfer)
# If you run scri... | mit |
SoteriousIdaofevil/xmlstar | libxml2-2.9.1/python/tests/pushSAXhtml.py | 35 | 1612 | #!/usr/bin/python -u
import sys
import libxml2
# Memory debug specific
libxml2.debugMemory(1)
log = ""
class callback:
def startDocument(self):
global log
log = log + "startDocument:"
def endDocument(self):
global log
log = log + "endDocument:"
def startElement(self, tag... | mit |
JuudeDemos/Mosquitto | test/lib/08-ssl-connect-no-auth.py | 19 | 2175 | #!/usr/bin/env python
# Test whether a client produces a correct connect and subsequent disconnect when using SSL.
# The client should connect to port 1888 with keepalive=60, clean session set,
# and client id 08-ssl-connect-no-auth
# It should use the CA certificate ssl/test-ca.crt for verifying the server.
# The te... | bsd-3-clause |
rdo-management/neutron | neutron/plugins/nec/drivers/__init__.py | 2 | 1528 | # Copyright 2012 NEC Corporation. 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 ... | apache-2.0 |
efiring/numpy-work | numpy/random/info.py | 102 | 5072 | """
========================
Random Number Generation
========================
==================== =========================================================
Utility functions
==============================================================================
random Uniformly distributed values of a given sha... | bsd-3-clause |
clobrano/personfinder | app/admin_dashboard.py | 5 | 4577 | #!/usr/bin/python2.7
# Copyright 2011 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 or ... | apache-2.0 |
cbertinato/pandas | pandas/tests/frame/test_duplicates.py | 1 | 14578 | import numpy as np
import pytest
from pandas import DataFrame, Series
import pandas.util.testing as tm
@pytest.mark.parametrize('subset', ['a', ['a'], ['a', 'B']])
def test_duplicated_with_misspelled_column_name(subset):
# GH 19730
df = DataFrame({'A': [0, 0, 1],
'B': [0, 0, 1],
... | bsd-3-clause |
xzzz9097/android_external_skia | platform_tools/android/gyp_gen/generate_user_config.py | 67 | 3795 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Function for generating the SkUserConfig file, customized for Android."""
import os
import shutil
AUTOGEN_WARNING = (
"""
///////////////////////////////////////... | bsd-3-clause |
Wolfium/pyjwt | tests/test_algorithms.py | 4 | 14038 | import base64
from jwt.algorithms import Algorithm, HMACAlgorithm, NoneAlgorithm
from jwt.exceptions import InvalidKeyError
from jwt.utils import base64url_decode
import pytest
from .keys import load_hmac_key
from .utils import ensure_bytes, ensure_unicode, key_path
try:
from jwt.algorithms import RSAAlgorithm,... | mit |
hackatbrown/2015.hackatbrown.org | hack-at-brown-2015/cssutils/stylesheets/stylesheet.py | 9 | 5474 | """StyleSheet implements DOM Level 2 Style Sheets StyleSheet."""
__all__ = ['StyleSheet']
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import cssutils
import urlparse
class StyleSheet(cssutils.util.Base2):
"""
The StyleSheet interface is the abstract base interface
for any type of style sheet. ... | mit |
stumoodie/VisualLanguageToolkit | lib/antlr-3.4/runtime/Python/antlr3/debug.py | 19 | 33705 | # begin[licence]
#
# [The "BSD licence"]
# Copyright (c) 2005-2009 Terence Parr
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above co... | apache-2.0 |
fabioticconi/scikit-learn | benchmarks/bench_plot_lasso_path.py | 301 | 4003 | """Benchmarks of Lasso regularization path computation using Lars and CD
The input data is mostly low rank but is a fat infinite tail.
"""
from __future__ import print_function
from collections import defaultdict
import gc
import sys
from time import time
import numpy as np
from sklearn.linear_model import lars_pat... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.