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 |
|---|---|---|---|---|---|
scotthartbti/android_external_chromium_org | tools/json_comment_eater/json_comment_eater.py | 86 | 2063 | #!/usr/bin/env python
# Copyright (c) 2012 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.
'''Utility to remove comments from JSON files so that they can be parsed by
json.loads.
'''
import sys
def _Rcount(string, chars... | bsd-3-clause |
ProfessorX/Config | .PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdecore/KEncodingDetector.py | 1 | 2735 | # encoding: utf-8
# module PyKDE4.kdecore
# from /usr/lib/python2.7/dist-packages/PyKDE4/kdecore.so
# by generator 1.135
# no doc
# imports
import PyQt4.QtCore as __PyQt4_QtCore
import PyQt4.QtNetwork as __PyQt4_QtNetwork
class KEncodingDetector(): # skipped bases: <type 'sip.wrapper'>
# no doc
def analyze(s... | gpl-2.0 |
muhkuh-sys/org.muhkuh.tests-ramtest | jonchki/dulwich/objects.py | 4 | 45599 | # objects.py -- Access to base git objects
# Copyright (C) 2007 James Westby <jw+debian@jameswestby.net>
# Copyright (C) 2008-2013 Jelmer Vernooij <jelmer@jelmer.uk>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version... | gpl-2.0 |
Amechi101/concepteur-market-app | venv/lib/python2.7/site-packages/django/contrib/gis/maps/google/__init__.py | 603 | 2648 | """
This module houses the GoogleMap object, used for generating
the needed javascript to embed Google Maps in a Web page.
Google(R) is a registered trademark of Google, Inc. of Mountain View, California.
Example:
* In the view:
return render_to_response('template.html', {'google' : GoogleMap(key="... | mit |
tamland/wimpy | docs/conf.py | 1 | 7997 | # -*- coding: utf-8 -*-
#
# complexity documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# 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.
#
... | lgpl-3.0 |
mph-/lcapy | lcapy/nexpr.py | 1 | 7914 | """This module provides the DiscreteTimeDomainExpression class to
represent discrete-time expressions.
Copyright 2020--2021 Michael Hayes, UCECE
"""
from __future__ import division
from .domains import DiscreteTimeDomain
from .sequence import Sequence
from .functions import exp
from .sym import j, oo, pi, fsym, oo
f... | lgpl-2.1 |
gurneyalex/server-tools | __unported__/cron_run_manually/model/ir_cron.py | 12 | 3161 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Therp BV (<http://therp.nl>)
# Code snippets from openobject-server copyright (C) 2004-2013 OpenERP S.A.
#
# This program is fr... | agpl-3.0 |
gibil5/openhealth | travis/run_pylint.py | 4 | 4202 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import click
import pylint.lint
import getaddons
CLICK_DIR = click.Path(exists=True, dir_okay=True, resolve_path=True)
def get_count_fails(linter_stats, msgs_no_count=None):
"""Verify the dictionary stati... | agpl-3.0 |
fast90/youtube-dl | youtube_dl/extractor/macgamestore.py | 142 | 1275 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import ExtractorError
class MacGameStoreIE(InfoExtractor):
IE_NAME = 'macgamestore'
IE_DESC = 'MacGameStore trailers'
_VALID_URL = r'https?://www\.macgamestore\.com/mediaviewer\.php\?trailer=(?P<id>\d+)'
_TEST = {... | unlicense |
FrodeSolheim/fs-uae-launcher | fsgamesys/GameDatabase.py | 3 | 7945 | import json
import os
import sqlite3
import zlib
from binascii import hexlify, unhexlify
from .BaseDatabase import BaseDatabase
VERSION = 19
RESET_VERSION = 19
DUMMY_UUID = b"'\\x8b\\xbb\\x00Y\\x8bqM\\x15\\x972\\xa8-t_\\xb2\\xfd'"
class IncompleteGameException(Exception):
pass
class GameDatabase(BaseDatabase)... | gpl-2.0 |
bottompawn/kbengine | kbe/src/lib/python/Doc/tools/sphinxext/suspicious.py | 37 | 9428 | """
Try to detect suspicious constructs, resembling markup
that has leaked into the final output.
Suspicious lines are reported in a comma-separated-file,
``suspicious.csv``, located in the output directory.
The file is utf-8 encoded, and each line contains four fields:
* document name (normalized)
* line number i... | lgpl-3.0 |
vmax-feihu/hue | desktop/core/ext-py/Django-1.6.10/tests/indexes/tests.py | 40 | 1585 | from django.core.management.color import no_style
from django.db import connection, connections, DEFAULT_DB_ALIAS
from django.test import TestCase
from django.utils.unittest import skipUnless
from .models import Article
class IndexesTests(TestCase):
def test_index_together(self):
connection = connections... | apache-2.0 |
onestarshang/flask_super_config | venv/lib/python2.7/site-packages/jinja2/ext.py | 603 | 25078 | # -*- coding: utf-8 -*-
"""
jinja2.ext
~~~~~~~~~~
Jinja extensions allow to add custom tags similar to the way django custom
tags work. By default two example extensions exist: an i18n and a cache
extension.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from jinja2 import nod... | gpl-2.0 |
TathagataChakraborti/resource-conflicts | PLANROB-2015/seq-sat-lama/Python-2.5.2/Lib/test/test_httplib.py | 22 | 5580 | import httplib
import StringIO
import sys
from unittest import TestCase
from test import test_support
class FakeSocket:
def __init__(self, text, fileclass=StringIO.StringIO):
self.text = text
self.fileclass = fileclass
def sendall(self, data):
self.data = data
def makefile(self,... | mit |
ProfessionalIT/maxigenios-website | sdk/google_appengine/lib/django-1.4/django/core/management/commands/compilemessages.py | 373 | 2824 | import codecs
import os
import sys
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
def has_bom(fn):
f = open(fn, 'r')
sample = f.read(4)
return sample[:3] == '\xef\xbb\xbf' or \
sample.startswith(codecs.BOM_UTF16_LE) or \
sample.sta... | mit |
ubirch/aws-tools | virtual-env/lib/python2.7/site-packages/pip/_vendor/packaging/version.py | 439 | 11949 | # 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 |
AOSPU/external_chromium_org_tools_gyp | test/win/gyptest-link-defrelink.py | 210 | 1683 | #!/usr/bin/env python
# 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.
"""
Make sure a relink is performed when a .def file is touched.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestG... | bsd-3-clause |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_09_01/aio/operations/_default_security_rules_operations.py | 1 | 8844 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
jralls/gramps | gramps/gen/plug/menu/_family.py | 11 | 1787 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2007-2008 Brian G. Matherly
# Copyright (C) 2008 Gary Burton
#
# 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 v... | gpl-2.0 |
idiap/rgbd | Processing/Processor.py | 1 | 3672 | """
Copyright (c) 2014 Idiap Research Institute, http://www.idiap.ch/
Written by Kenneth Funes <kenneth.funes@idiap.ch>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the ... | lgpl-3.0 |
tcr3dr/ardupilot-releases | Tools/LogAnalyzer/tests/TestDupeLogData.py | 273 | 2651 | from LogAnalyzer import Test,TestResult
import DataflashLog
class TestDupeLogData(Test):
'''test for duplicated data in log, which has been happening on PX4/Pixhawk'''
def __init__(self):
Test.__init__(self)
self.name = "Dupe Log Data"
def __matchSample(self, sample, sampleStartIndex, logdata):
'''return... | gpl-3.0 |
urumican/linux-3.8.8 | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
jhartnett/ipCounter | src/ipCounter.py | 1 | 1779 | #!/bin/python
#/**************************************************************************
#* File: ipCounter.py
#*
#* This is a basic program to count the total number of IPs
#* in a given range. Input is a txt formatted file similar
#* to the sample provided
#*
#* This updated version uses Python to make it more a... | apache-2.0 |
aregee/moksaya | userena/migrations/0001_initial.py | 7 | 5639 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from userena.utils import user_model_label
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'UserenaSignup'
db.create_table('userena_userenasignup',... | mit |
JSkernel/G_pro2_msm8974_JSKernel | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Core.py | 11088 | 3246 | # Core.py - Python extension for perf script, core functions
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
from collections import defaultdict
def aut... | gpl-2.0 |
dunkhong/grr | grr/test_lib/db_test_lib.py | 1 | 2046 | #!/usr/bin/env python
"""Test utilities for RELDB-related testing."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import functools
import sys
import mock
from grr_response_core.lib.util import compatibility
from grr_response_server import data_store
... | apache-2.0 |
npdoty/pywikibot | scripts/editarticle.py | 3 | 4128 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Edit a Wikipedia article with your favourite editor.
TODO: - non existing pages
- edit conflicts
- minor edits
- watch/unwatch
- ...
The following parameters are supported:
-r Edit redirect pages without following them
--edit_r... | mit |
fja05680/pinkfish | examples/310.cryptocurrencies/strategy.py | 1 | 6833 | """
The SMA-ROC-portfolio stategy.
This is SMA-ROC strategy applied to a portfolio.
SMA-ROC is a rate of change calculation smoothed by
a moving average.
This module allows us to examine this strategy and try different
period, stop loss percent, margin, and whether to use a regime filter
or not. We split up the tota... | mit |
codemac/servo | python/mozlog/mozlog/structured/formatters/xunit.py | 46 | 3804 | import types
from xml.etree import ElementTree
import base
def format_test_id(test_id):
"""Take a test id and return something that looks a bit like
a class path"""
if type(test_id) not in types.StringTypes:
#Not sure how to deal with reftests yet
raise NotImplementedError
#Turn a pat... | mpl-2.0 |
daenamkim/ansible | lib/ansible/modules/cloud/amazon/ec2_group_facts.py | 48 | 5042 | #!/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': ['preview'],
... | gpl-3.0 |
Fusion-Rom/android_external_chromium_org_third_party_WebKit | Tools/Scripts/webkitpy/style/checkers/test_expectations_unittest.py | 45 | 4347 | # 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 |
incaser/odoo-odoo | addons/stock/procurement.py | 227 | 22183 | # -*- 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 |
rajalokan/nova | nova/objects/volume_usage.py | 41 | 2570 | # 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
# d... | apache-2.0 |
kingbryan/fractional | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py | 388 | 91069 | # 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... | mit |
tasoc/photometry | notes/halo_shift.py | 1 | 2629 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
.. codeauthor:: Rasmus Handberg <rasmush@phys.au.dk>
"""
import numpy as np
import matplotlib.pyplot as plt
from astropy.io import fits
import sqlite3
import os.path
#------------------------------------------------------------------------------
def mag2flux(mag):
... | gpl-3.0 |
roadmapper/ansible | test/units/modules/network/vyos/test_vyos_ping.py | 52 | 4225 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
mrrrgn/olympia | lib/constants.py | 37 | 6488 | # -*- coding: utf8 -*-
from tower import ugettext_lazy as _lazy
ALL_CURRENCIES = {
'AED': _lazy(u'United Arab Emirates Dirham'),
'AFN': _lazy(u'Afghanistan Afghani'),
'ALL': _lazy(u'Albania Lek'),
'AMD': _lazy(u'Armenia Dram'),
'ANG': _lazy(u'Netherlands Antilles Guilder'),
'AOA': _lazy(u'Angol... | bsd-3-clause |
CacaoMovil/guia-de-cacao-django | cacao_app/config/common.py | 1 | 11423 | # -*- coding: utf-8 -*-
"""
Django settings for cacao_app project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.p... | bsd-3-clause |
rizvve/pmip6ns3.13new | src/mesh/bindings/modulegen__gcc_ILP32.py | 14 | 686373 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
AlanZatarain/django-photologue | photologue/management/commands/plcache.py | 25 | 1406 | from django.core.management.base import BaseCommand, CommandError
from optparse import make_option
from photologue.models import PhotoSize, ImageModel
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option('--reset', '-r', action='store_true', dest='reset', help='Reset phot... | bsd-3-clause |
SergeyKubrak/django-rosetta | rosetta/polib.py | 1 | 59163 | # -* coding: utf-8 -*-
#
# License: MIT (see LICENSE file provided)
# vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4:
"""
**polib** allows you to manipulate, create, modify gettext files (pot, po and
mo files). You can load existing files, iterate through it's entries, add,
modify entries, comments or metada... | mit |
grace-/opencv-3.0.0-cvpr | opencv/platforms/android/service/test_native.py | 5 | 1233 | #!/usr/bin/python
import os
import sys
DEVICE_NAME = ""
DEVICE_STR = ""
DEVICE_ARCH = "armeabi"
LOCAL_LOG_PATH = os.path.join(os.getcwd(), "logs")
DEVICE_LOG_PATH = "/sdcard/OpenCVEngineLogs"
DEVICE_BIN_PATH = "/data/data/EngineTest"
def RunTestApp(AppName):
TestLog = os.path.join(DEVICE_LOG_PATH, AppName + "_"... | bsd-3-clause |
hernandito/SickRage | lib/unidecode/x074.py | 252 | 4696 | data = (
'Han ', # 0x00
'Xuan ', # 0x01
'Yan ', # 0x02
'Qiu ', # 0x03
'Quan ', # 0x04
'Lang ', # 0x05
'Li ', # 0x06
'Xiu ', # 0x07
'Fu ', # 0x08
'Liu ', # 0x09
'Ye ', # 0x0a
'Xi ', # 0x0b
'Ling ', # 0x0c
'Li ', # 0x0d
'Jin ', # 0x0e
'Lian ', # 0x0f
'Suo ', # 0x10
'Chii... | gpl-3.0 |
ROM-Jeremy/android_kernel_lge_msm8226 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
joshblum/django-with-audit | tests/regressiontests/utils/termcolors.py | 138 | 7367 | from django.utils import unittest
from django.utils.termcolors import parse_color_setting, PALETTES, DEFAULT_PALETTE, LIGHT_PALETTE, DARK_PALETTE, NOCOLOR_PALETTE
class TermColorTests(unittest.TestCase):
def test_empty_string(self):
self.assertEqual(parse_color_setting(''), PALETTES[DEFAULT_PALETTE])
... | bsd-3-clause |
Edraak/edraak-platform | lms/djangoapps/courseware/tests/test_middleware.py | 19 | 1491 | """
Tests for courseware middleware
"""
from django.http import Http404
from django.test.client import RequestFactory
from nose.plugins.attrib import attr
from lms.djangoapps.courseware.exceptions import Redirect
from lms.djangoapps.courseware.middleware import RedirectMiddleware
from xmodule.modulestore.tests.django... | agpl-3.0 |
mosbasik/buzhug | javasrc/lib/Jython/Lib/distutils/dir_util.py | 7 | 8084 | """distutils.dir_util
Utility functions for manipulating directories and directory trees."""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
import os, sys
from types import *
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache fo... | bsd-3-clause |
modulexcite/catapult | dashboard/dashboard/edit_config_handler.py | 5 | 8814 | # Copyright 2015 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.
"""A common base class for pages that are used to edit configs."""
from google.appengine.api import taskqueue
from dashboard import list_tests
from dashboa... | bsd-3-clause |
DerTeufel/dualboot_recovery | tools/ota/convert-to-bmp.py | 32 | 2607 | #!/usr/bin/python2.4
"""A simple script to convert asset images to BMP files, that supports
RGBA image."""
import struct
import Image
import sys
infile = sys.argv[1]
outfile = sys.argv[2]
if not outfile.endswith(".bmp"):
print >> sys.stderr, "Warning: I'm expecting to write BMP files."
im = Image.open(infile)
if... | bsd-2-clause |
jagguli/intellij-community | python/lib/Lib/rfc822.py | 89 | 33167 | """RFC 2822 message manipulation.
Note: This is only a very rough sketch of a full RFC-822 parser; in particular
the tokenizing of addresses does not adhere to all the quoting rules.
Note: RFC 2822 is a long awaited update to RFC 822. This module should
conform to RFC 2822, and is thus mis-named (it's not worth rena... | apache-2.0 |
chirilo/ana-ka-todo-app | node_modules/laravel-elixir/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 292 | 114315 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
VladimirShe/in100gram | in100gram/in100gram/settings.py | 1 | 2137 | """
Django settings for in100gram 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, ...)
... | apache-2.0 |
yujikato/DIRAC | src/DIRAC/DataManagementSystem/Client/test/mock_DM.py | 2 | 1432 | """ A mock of the DataManager, used for testing purposes
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=protected-access, missing-docstring, invalid-name, line-too-long
from mock import MagicMock
from DIRAC import S_OK
dm_mock = Mag... | gpl-3.0 |
gopal1cloud/neutron | neutron/tests/unit/ml2/drivers/cisco/apic/test_cisco_apic_client.py | 8 | 12242 | # Copyright (c) 2014 Cisco Systems
# 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 require... | apache-2.0 |
joaormatos/anaconda | Anaconda/pyglet/image/codecs/gdkpixbuf2.py | 9 | 5863 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | gpl-3.0 |
ytflzq/laravel-learn-demo | vendor/mockery/mockery/docs/conf.py | 468 | 8442 | # -*- coding: utf-8 -*-
#
# Mockery Docs documentation build configuration file, created by
# sphinx-quickstart on Mon Mar 3 14:04:26 2014.
#
# 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.
... | mit |
mtdx/ml-algorithms | neural-networks/cnn.py | 1 | 2621 | import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("/tmp/data/", one_hot=True)
n_classes = 10
batch_size = 128
x = tf.placeholder('float', [None, 784])
y = tf.placeholder('float')
keep_rate = 0.8
keep_prob = tf.placeholder(tf.float32)
def conv2d(x,... | mit |
petecummings/NewsBlur | vendor/tweepy/utils.py | 32 | 1355 | # Tweepy
# Copyright 2010 Joshua Roesslein
# See LICENSE for details.
from datetime import datetime
import time
import htmlentitydefs
import re
import locale
from urllib import quote
from email.utils import parsedate
def parse_datetime(string):
return datetime(*(parsedate(string)[:6]))
def parse_html_value(htm... | mit |
eckardm/archivematica | src/MCPClient/lib/clientScripts/createEvent.py | 2 | 2433 | #!/usr/bin/env python2
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica 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, ... | agpl-3.0 |
snazy/cassandra-dtest | cassandra-thrift/v11/ttypes.py | 11 | 123631 | #
# Autogenerated by Thrift Compiler (0.8.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from thrift.Thrift import TType, TMessageType, TException
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol, TProtocol
try:
from thrift.protoc... | apache-2.0 |
m4sth0/sauventory | tests/test_ranktransform.py | 1 | 4574 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2016
# Author(s):
# Thomas Leppelt <thomas.leppelt@dwd.de>
# This file is part of sauventory.
# Spatial Autocorrelated Uncertainty of Inventories
# sauventory is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gener... | gpl-3.0 |
petabricks/petabricks | scripts/misc/graphgen.py | 2 | 3272 | #!/usr/bin/python
import csv,optparse,os,sys
import pbutil
import storagedirs
import candidatetester
from candidatetester import Candidate, CandidateTester
from sgatuner import mainname
from configtool import ConfigFile
from traininginfo import TrainingInfo
import tunerwarnings
import warnings
options=None
def main... | mit |
0Chencc/CTFCrackTools | Lib/test/test_macostools.py | 91 | 2956 | # Copyright (C) 2003 Python Software Foundation
import unittest
import os
import sys
from test import test_support
MacOS = test_support.import_module('MacOS')
#The following modules should exist if MacOS exists.
import Carbon.File
import macostools
TESTFN2 = test_support.TESTFN + '2'
class TestMacostools(unittest.T... | gpl-3.0 |
T2DREAM/t2dream-portal | src/encoded/upgrade/file.py | 1 | 22524 | from snovault import upgrade_step
from pyramid.traversal import find_root
from datetime import datetime, time
@upgrade_step('file', '', '2')
def file_0_2(value, system):
# http://redmine.encodedcc.org/issues/1295
# http://redmine.encodedcc.org/issues/1307
if 'status' in value:
value['status'] = va... | mit |
vineodd/PIMSim | GEM5Simulation/gem5/src/arch/arm/ArmNativeTrace.py | 42 | 1917 | # Copyright (c) 2009 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 list ... | gpl-3.0 |
Brocade-OpenSource/OpenStack-DNRM-Nova | nova/virt/hyperv/vmops.py | 3 | 14493 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Cloud.com, Inc
# Copyright 2012 Cloudbase Solutions Srl
# 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 ... | apache-2.0 |
tensorflow/ranking | tensorflow_ranking/python/keras/canned/dnn.py | 1 | 5354 | # Copyright 2021 The TensorFlow Ranking Authors.
#
# 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 ag... | apache-2.0 |
Intel-Corporation/tensorflow | tensorflow/python/tools/saved_model_cli_test.py | 41 | 22291 | # 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 |
fraga/gnucash | src/optional/python-bindings/example_scripts/quotes_historic.py | 13 | 2473 | #!/usr/bin/env python
# quotes_historic.py -- Example Script to read historic quote data into gnucash
#
## @file
# @brief Example Script to read historic stock data into gnucash
# @author Peter Holtermann
# @date January 2011
# @ingroup python_bindings_examples
#
# Call the perl-script @code
# ./get_... | gpl-2.0 |
berjc/aus-senate-audit | aus_senate_audit/audits/bayesian_audit.py | 1 | 5902 | # -*- coding: utf-8 -*-
""" Implements the Bayesian Audit. """
from collections import Counter
from itertools import chain
from random import gammavariate
from random import seed as set_seed
from time import time
def get_new_ballot_weights(election, r):
""" Returns new ballot weights for the given election.
... | apache-2.0 |
nemomobile-graveyard/mcompositor | tests/functional/test14.py | 4 | 1543 | #!/usr/bin/python
# Check that removal of _NET_WM_STATE_FULLSCREEN in _NET_WM_STATE is respected.
#* Test steps
# * show a fullscreen application window
# * verify that the window has fullscreen size
# * request removal of _NET_WM_STATE_FULLSCREEN for the window
#* Post-conditions
# * verify that the window now h... | lgpl-2.1 |
labordoc/labordoc-next | modules/bibindex/lib/bibindex_engine_unit_tests.py | 2 | 6760 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2004, 2005, 2006, 2007, 2008, 2010, 2011 CERN.
##
## Invenio 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 t... | gpl-2.0 |
zarboz/Evita_UL_422-JB | tools/perf/scripts/python/net_dropmonitor.py | 4235 | 1554 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
thaumos/ansible | test/sanity/validate-modules/utils.py | 15 | 5660 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 Matt Martz <matt@sivel.net>
# Copyright (C) 2015 Rackspace US, 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 ... | gpl-3.0 |
nwiizo/workspace_2017 | ansible-modules-core/cloud/rackspace/rax_cdb.py | 13 | 8278 | #!/usr/bin/python -tt
# 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 distrib... | mit |
ksrajkumar/openerp-6.1 | openerp/tools/amount_to_text.py | 15 | 7742 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... | agpl-3.0 |
markkerzner/nn_kove | hadoop/src/contrib/hod/hodlib/Common/xmlrpc.py | 182 | 2374 | #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 thi... | apache-2.0 |
Affirm/moto | moto/dynamodb2/comparisons.py | 3 | 15123 | from __future__ import unicode_literals
import re
import six
# TODO add tests for all of these
EQ_FUNCTION = lambda item_value, test_value: item_value == test_value # flake8: noqa
NE_FUNCTION = lambda item_value, test_value: item_value != test_value # flake8: noqa
LE_FUNCTION = lambda item_value, test_value: item_va... | apache-2.0 |
petricm/DIRAC | FrameworkSystem/scripts/dirac-proxy-destroy.py | 7 | 4939 | #!/usr/bin/env python
"""
command line tool to remove local and remote proxies
"""
import sys
import os
import DIRAC
from DIRAC import gLogger, S_OK
from DIRAC.Core.Security import Locations
from DIRAC.Core.Base import Script
from DIRAC.Core.DISET.RPCClient import RPCClient
from DIRAC.FrameworkSystem.Client.ProxyMa... | gpl-3.0 |
snakeleon/YouCompleteMe-x86 | third_party/ycmd/third_party/JediHTTP/vendor/jedi/jedi/refactoring.py | 49 | 7033 | """
Introduce some basic refactoring functions to |jedi|. This module is still in a
very early development stage and needs much testing and improvement.
.. warning:: I won't do too much here, but if anyone wants to step in, please
do. Refactoring is none of my priorities
It uses the |jedi| `API <plugin-a... | gpl-3.0 |
ofayans/freeipa | ipatests/test_xmlrpc/test_privilege_plugin.py | 8 | 14607 | # Authors:
# Rob Crittenden <rcritten@redhat.com>
#
# Copyright (C) 2010 Red Hat
# see file 'COPYING' for use and warranty information
#
# 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... | gpl-3.0 |
zenofewords/zenofewords | tests/utils.py | 1 | 1705 | from copy import copy
from django.conf import settings
from django.urls import reverse
def get_permissions(response_mapping, custom_mapping):
"""
Build permission mappings.
:param response_mapping: usually a predefined permission template (FORBIDDEN, NOT_FOUND, etc.)
:type response_mapping: dict
... | mit |
yelongyu/chihu | venv/lib/python2.7/site-packages/alembic/autogenerate/api.py | 26 | 14714 | """Provide the 'autogenerate' feature which can produce migration operations
automatically."""
from ..operations import ops
from . import render
from . import compare
from .. import util
from sqlalchemy.engine.reflection import Inspector
import contextlib
def compare_metadata(context, metadata):
"""Compare a dat... | gpl-3.0 |
benthomasson/ansible | lib/ansible/modules/windows/win_firewall_rule.py | 37 | 3713 | #!/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 |
romain-dartigues/ansible | lib/ansible/modules/windows/win_say.py | 28 | 4090 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# this is a windows documentation stub. actual code lives in the .ps1
# file of the same name
ANSIBLE... | gpl-3.0 |
Plain-Andy-legacy/android_external_chromium_org | tools/telemetry/telemetry/timeline/async_slice.py | 45 | 1147 | # Copyright 2014 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 telemetry.timeline.event as event
class AsyncSlice(event.TimelineEvent):
''' A AsyncSlice represents an interval of time during which an
asynchr... | bsd-3-clause |
lmazuel/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/application_health_state_filter.py | 1 | 6307 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
efortuna/AndroidSDKClone | ndk_experimental/prebuilt/linux-x86_64/lib/python2.7/test/test_cmath.py | 84 | 18637 | from test.test_support import run_unittest
from test.test_math import parse_testfile, test_file
import unittest
import cmath, math
from cmath import phase, polar, rect, pi
INF = float('inf')
NAN = float('nan')
complex_zeros = [complex(x, y) for x in [0.0, -0.0] for y in [0.0, -0.0]]
complex_infinities = [complex(x, y... | apache-2.0 |
gamesbrewer/kegger | kegger/myapp/libs/webob/datetime_utils.py | 60 | 2552 | import calendar
from datetime import (
date,
datetime,
timedelta,
tzinfo,
)
from email.utils import (
formatdate,
mktime_tz,
parsedate_tz,
)
import time
from webob.compat import (
integer_types,
long,
native_,
text_type,
)
__all__ = [
'UTC', 'timedelta_to... | cc0-1.0 |
guillaume-philippon/aquilon | lib/aquilon/worker/formats/chassis.py | 1 | 1715 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2013,2014,2016 Contributor
#
# 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 |
lenovor/bosen | app/dnn/script/predict.py | 13 | 1559 | #!/usr/bin/env python
"""
This script starts a process locally, using <client-id> <hostfile> as inputs.
"""
import os
from os.path import dirname
from os.path import join
import time
import sys
if len(sys.argv) != 3:
print "usage: %s <client-id> <hostfile>" % sys.argv[0]
sys.exit(1)
# Please set the FULL app di... | bsd-3-clause |
aurusov/rdo_studio | scripts/python/utils.py | 4 | 1404 | ###############################################################################
# Copyright (c) 2013 Evgeny Proydakov <lord.tiran@gmail.com>
###############################################################################
# -*- coding: utf-8 -*-
##########################################################################... | mit |
bcarr092/CAHAL | test/test_driver.py | 1 | 1595 | try:
import threading as _threading
except ImportError:
import dummy_threading as _threading
import cahal_tests
import unittest
import sys
... | apache-2.0 |
nguyentran/openviber | tools/scons-local/scons-local-2.0.1/SCons/Tool/hplink.py | 61 | 2390 | """SCons.Tool.hplink
Tool-specific initialization for the HP linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foun... | mit |
redhat-openstack/nova | nova/api/openstack/compute/plugins/v3/access_ips.py | 23 | 4161 | # Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 |
mlperf/training_results_v0.5 | v0.5.0/nvidia/submission/code/rnn_translator/pytorch/seq2seq/data/sampler.py | 1 | 5047 | import logging
import torch
from torch.utils.data.sampler import Sampler
from mlperf_compliance import mlperf_log
from seq2seq.utils import gnmt_print
from seq2seq.utils import get_world_size, get_rank
class BucketingSampler(Sampler):
"""
Distributed data sampler supporting bucketing by sequence length.
... | apache-2.0 |
pwendell/mesos | third_party/boto-2.0b2/boto/ec2/spotinstancerequest.py | 8 | 3747 | # Copyright (c) 2006-2009 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, modi... | apache-2.0 |
Corsol/server | dep/ACE_wrappers/bin/svn_props.py | 95 | 1292 | #!/usr/bin/python
import sys
import re
import os
import string
print """WARNING: this script is dumb. I mean, really, really dumb. Every file is treated
as a text file, so if you are checking in any binary files, YOU MUST set a non-text
MIME type by hand, otherwise it WILL be corrupted by the checkout process.
A b... | gpl-2.0 |
kjc88/sl4a | python/src/Demo/rpc/mountclient.py | 42 | 6632 | # Mount RPC client -- RFC 1094 (NFS), Appendix A
# This module demonstrates how to write your own RPC client in Python.
# When this example was written, there was no RPC compiler for
# Python. Without such a compiler, you must first create classes
# derived from Packer and Unpacker to handle the data types for the
# s... | apache-2.0 |
ubirch/aws-tools | virtual-env/lib/python2.7/site-packages/boto/file/__init__.py | 153 | 1258 | # Copyright 2010 Google 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, publish, dis-
# trib... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.