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 |
|---|---|---|---|---|---|
b-carter/numpy | numpy/tests/test_ctypeslib.py | 8 | 4331 | from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.ctypeslib import ndpointer, load_library
from numpy.distutils.misc_util import get_shared_lib_extension
from numpy.testing import run_module_suite, assert_, assert_raises, dec
try:
cdll = None
if hasattr... | bsd-3-clause |
wheeler-microfluidics/open-drop | pavement.py | 1 | 1896 | from collections import OrderedDict
import sys
from importlib import import_module
from paver.easy import task, needs, path, sh, cmdopts, options
from paver.setuputils import setup, find_package_data, install_distutils_tasks
try:
from base_node_rpc.pavement_base import *
except ImportError:
pass
sys.path.inse... | gpl-3.0 |
DiegoCorrea/ouvidoMusical | apps/similarities/Cosine/algorithm/views.py | 1 | 2656 | from .algorithm import CosineSimilarity
from apps.data.songs.models import Song, SongSimilarity
from apps.similarities.Cosine.benchmark.models import BenchCosine_SongTitle
from django.db import transaction
from django.utils import timezone
from multiprocessing.dummy import Pool as ThreadPool
from apps.CONSTANTS import ... | mit |
blackmatrix7/apizen | app/config.py | 1 | 3877 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/5/28 20:50
# @Author : BlackMatrix
# @Sit :
# @File : config.py
# @Software : PyCharm
import os
__author__ = 'blackmatrix'
class BaseConfig:
DEBUG = True
TESTING = False
HOST = '0.0.0.0'
PORT = 8080
WORKS = 5
SITE_NAME = 'ApiZen'... | apache-2.0 |
kochstefan/source | scripts/flashing/jungo-image.py | 758 | 7069 | #!/usr/bin/env python
#
# Copyright 2008, 2009 (C) Jose Vasconcellos <jvasco@verizon.net>
#
# A script that can communicate with jungo-based routers
# (such as MI424-WR, USR8200 and WRV54G) to backup the installed
# firmware and replace the boot loader.
#
# Tested with Python 2.5 on Linux and Windows
#
"""Usage: %s [op... | gpl-2.0 |
NMisko/monkalot | bot/utilities/startgame.py | 1 | 1791 | """Contains functions to control games."""
import time
from bot.utilities.permission import Permission
from bot.utilities.tools import replace_vars
def start_game(bot, user, msg, cmd):
"""Return whether a user can start a game.
Takes off points if a non moderator wants to start a game.
Also makes sure ... | mit |
chdecultot/erpnext | erpnext/shopping_cart/test_shopping_cart.py | 5 | 6730 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest
import frappe
from frappe.utils import nowdate, add_months
from erpnext.shopping_cart.cart import _get_cart_quotation, update_cart, get_... | gpl-3.0 |
flochaz/horizon | openstack_dashboard/dashboards/project/database_backups/tests.py | 11 | 6384 | # Copyright 2013 Mirantis 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 agre... | apache-2.0 |
Acimaz/Google_Apple_Financial_Reporter | Reporter.py | 1 | 5765 | # Reporting tool for querying Sales- and Financial Reports from iTunes Connect and Google Developer Console
#
# This tool can be used to download financial reports from both Google and Apple
# for the app of your choice (of course i assume that you are the owner of this app)
#
# Copyright (c) 2017 Ayhan Sakarya, Kaasa ... | mit |
KyleAMoore/KanjiNani | Android/.buildozer/android/app/Kanji.py | 3 | 6240 | # This file is part of KanjiNani.
#
# KanjiNani 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.
#
# KanjiNani is ... | gpl-3.0 |
openstack/swift | swift/common/middleware/recon.py | 1 | 17726 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
javelinanddart/android_kernel_htc_msm8960 | 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 |
eragonruan/text-detection-ctpn | utils/text_connector/detectors.py | 1 | 2097 | # coding:utf-8
import numpy as np
from utils.bbox.nms import nms
from .text_connect_cfg import Config as TextLineCfg
from .text_proposal_connector import TextProposalConnector
from .text_proposal_connector_oriented import TextProposalConnector as TextProposalConnectorOriented
class TextDetector:
def __init__(sel... | mit |
LumaPictures/rez | src/rez/vendor/progress/counter.py | 510 | 1502 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS P... | lgpl-3.0 |
carlosb1/examples-c14 | gmock-1.7.0/gtest/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | apache-2.0 |
ashleyjsands/machine-learning | benchmark.py | 1 | 1576 | """
This script is used to benchmark neural network performance to determine which optimisations are useful.
"""
from neural_network import *
from data import *
from neural_network import get_index_of_maximum_value
import time
def print_intro():
print "Benchmarking neural network implementation"
def get_neural_n... | mit |
cntnboys/302-project | Webapps/venv/lib/python2.7/site-packages/setuptools/package_index.py | 72 | 38943 | """PyPI and direct package downloading"""
import sys
import os
import re
import shutil
import socket
import base64
import hashlib
from functools import wraps
from pkg_resources import (
CHECKOUT_DIST, Distribution, BINARY_DIST, normalize_path, SOURCE_DIST,
require, Environment, find_distributions, safe_name, s... | apache-2.0 |
jobscore/sync-engine | migrations/versions/050_imap_table_cleanups.py | 3 | 7118 | """imap table cleanups
Revision ID: 29217fad3f46
Revises: 161b88c17615
Create Date: 2014-07-01 18:56:55.962529
"""
# revision identifiers, used by Alembic.
revision = '29217fad3f46'
down_revision = '1b751e8d9cac'
from alembic import op
import sqlalchemy as sa
def upgrade():
from inbox.models.session import se... | agpl-3.0 |
amanmehara/programming-app-data | Python/ScrappingHackerNewsWebsite/ScrappingHackerNewsWebsite.py | 1 | 3141 | '''
Copyright [2020] [Arun Kumar G]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... | apache-2.0 |
ahamilton55/ansible | lib/ansible/plugins/terminal/junos.py | 62 | 1810 | #
# (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 d... | gpl-3.0 |
GregoryBetz/DarkSilk | share/seeds/generate-seeds.py | 2 | 4347 | #!/usr/bin/python
# Copyright (c) 2014-2016 Wladmir J. van der Laan
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the direc... | mit |
sriprasanna/django-1.3.1 | django/contrib/localflavor/at/forms.py | 273 | 2446 | """
AT-specific Form helpers
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Field, RegexField, Select
from django.utils.translation import ugettext_lazy as _
re_ssn = re.compile(r'^\d{4} \d{6}')
class ATZipCodeField(RegexField)... | bsd-3-clause |
behzadnouri/numpy | numpy/distutils/msvccompiler.py | 26 | 1991 | from __future__ import division, absolute_import, print_function
import os
from distutils.msvccompiler import MSVCCompiler as _MSVCCompiler
from .system_info import platform_bits
def _merge(old, new):
"""Concatenate two environment paths avoiding repeats.
Here `old` is the environment string before the bas... | bsd-3-clause |
ppanczyk/ansible | lib/ansible/modules/network/a10/a10_virtual_server.py | 27 | 11170 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2014, Mischa Peters <mpeters@a10networks.com>,
# Eric Chou <ericc@a10networks.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__ = t... | gpl-3.0 |
RobCranfill/weewx | bin/weewx/drivers/vantage.py | 4 | 108947 | #
# Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com>
#
# See the file LICENSE.txt for your full rights.
#
"""Classes and functions for interfacing with a Davis VantagePro, VantagePro2,
or VantageVue weather station"""
from __future__ import with_statement
import datetime
import struct
import sys
import sys... | gpl-3.0 |
boneyao/sentry | src/sentry/migrations/0123_auto__add_groupassignee__add_index_event_group_datetime.py | 36 | 24861 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'GroupAssignee'
db.create_table('sentry_groupasignee', (
('id', self.gf('sentry.d... | bsd-3-clause |
Bezoar/surrender-rides | bp_content/themes/default/handlers/forms.py | 1 | 5264 | # *-* coding: UTF-8 *-*
"""
Created on June 10, 2012
@author: peta15
"""
__author__ = 'coto'
from datetime import datetime
from wtforms import fields
from wtforms import Form
from wtforms import validators, ValidationError
from webapp2_extras.i18n import lazy_gettext as _
from webapp2_extras.i18n import ngettext, gett... | mit |
ant1b/Planets4X | pythonanywhere_app/static/Brython3.0.0-20141104-210332/Lib/threading.py | 730 | 45641 | """Thread module emulating a subset of Java's threading model."""
import sys as _sys
import _thread
from time import sleep as _sleep
try:
from time import monotonic as _time
except ImportError:
from time import time as _time
from traceback import format_exc as _format_exc
from _weakrefset import WeakSet
# No... | mit |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/test/test_exceptions.py | 23 | 26263 | # Python test set -- part 5, built-in exceptions
import os
import sys
import unittest
import pickle, cPickle
from test.test_support import (TESTFN, unlink, run_unittest, captured_output,
check_warnings, cpython_only)
from test.test_pep352 import ignore_deprecation_warnings
# XXX This i... | gpl-2.0 |
tchernomax/ansible | lib/ansible/modules/system/authorized_key.py | 21 | 22236 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Brad Olson <brado@movedbylight.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': '1.1',
... | gpl-3.0 |
jejung/godot | core/make_binders.py | 3 | 8499 | # -*- coding: ibm850 -*-
template_typed = """
#ifdef TYPED_METHOD_BIND
template<class T $ifret ,class R$ $ifargs ,$ $arg, class P@$>
class MethodBind$argc$$ifret R$$ifconst C$ : public MethodBind {
public:
$ifret R$ $ifnoret void$ (T::*method)($arg, P@$) $ifconst const$;
#ifdef DEBUG_METHODS_ENABLED
virtual Varian... | mit |
VasuAgrawal/tartanHacks2015 | site/flask/lib/python2.7/site-packages/jinja2/filters.py | 598 | 29836 | # -*- coding: utf-8 -*-
"""
jinja2.filters
~~~~~~~~~~~~~~
Bundled jinja filters.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import math
from random import choice
from operator import itemgetter
from itertools import groupby
from jinja2.utils... | mit |
jiazichenzhan/Server_Manage_Plugin | ironic-plugin-pike/ironic/tests/unit/drivers/modules/storage/test_cinder.py | 4 | 31687 | # Copyright 2016 Hewlett Packard Enterprise Development Company LP.
# Copyright 2016 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... | apache-2.0 |
rwillmer/django | django/contrib/staticfiles/management/commands/findstatic.py | 463 | 1745 | from __future__ import unicode_literals
import os
from django.contrib.staticfiles import finders
from django.core.management.base import LabelCommand
from django.utils.encoding import force_text
class Command(LabelCommand):
help = "Finds the absolute paths for the given static file(s)."
label = 'static file... | bsd-3-clause |
LakmalCaldera/real-python-test | env/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py | 484 | 1297 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).rese... | gpl-2.0 |
cydcowley/Imperial-Visualizations | visuals_maths/LA-Planes/script/numeric/tools/selenium_links.py | 28 | 1550 | from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
import time
import traceback
import sys
import urllib
import re
url = ""
def test(links,driver):
p=0
f=0
t=0
for k in range(len(links)):
x = links[k]
... | mit |
blckshrk/Weboob | modules/youjizz/pages/index.py | 3 | 2085 | # -*- coding: utf-8 -*-
# Copyright(C) 2010-2012 Roger Philibert
#
# This file is part of weboob.
#
# weboob is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at yo... | agpl-3.0 |
shengqh/ngsperl | lib/GATK/mergeMutect.py | 1 | 4103 | import argparse
import sys
import logging
import os
import errno
import gzip
from asyncore import read
from Mutect import MutectItem, MutectResult
def check_file_exists(file):
if not os.path.exists(file):
raise FileNotFoundError(errno.ENOENT, os.strerror(errno.ENOENT), file)
def readFileMap(fileName):
check_f... | apache-2.0 |
ptoraskar/django | django/core/files/images.py | 429 | 2428 | """
Utility functions for handling images.
Requires Pillow as you might imagine.
"""
import struct
import zlib
from django.core.files import File
class ImageFile(File):
"""
A mixin for use alongside django.core.files.base.File, which provides
additional features for dealing with images.
"""
def ... | bsd-3-clause |
therealpyro/slave | slave/transport.py | 2 | 18111 | # -*- coding: utf-8 -*-
#
# Slave, (c) 2012-2014, see AUTHORS. Licensed under the GNU GPL.
"""The :mod:`slave.transport` module implements the lowest level abstraction
layer of the slave library.
The transport is responsible for sending and receiving raw bytes. It interfaces
with the hardware, but has no knowledge o... | gpl-3.0 |
EdwinChanYi/mysql-server | storage/ndb/memcache/extra/memcached/testsuite/breakdancer/engine_test.py | 183 | 5544 | #!/usr/bin/env python
import breakdancer
from breakdancer import Condition, Effect, Action, Driver
TESTKEY = 'testkey'
######################################################################
# Conditions
######################################################################
class ExistsCondition(Condition):
def... | gpl-2.0 |
jef-n/QGIS | scripts/qgis_fixes/fix_pyqt.py | 58 | 18078 | """Migrate imports of PyQt4 to PyQt wrapper
"""
# Author: Juergen E. Fischer
# Adapted from fix_urllib
# Local imports
from lib2to3.fixes.fix_imports import alternates, FixImports
from lib2to3 import fixer_base
from lib2to3.fixer_util import (Name, Comma, FromImport, Newline,
find_inden... | gpl-2.0 |
emersonsoftware/ansiblefork | lib/ansible/plugins/connection/libvirt_lxc.py | 46 | 7316 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute i... | gpl-3.0 |
zubair-arbi/edx-platform | common/djangoapps/request_cache/__init__.py | 51 | 1910 | """
A cache that is cleared after every request.
This module requires that :class:`request_cache.middleware.RequestCache`
is installed in order to clear the cache after each request.
"""
import logging
from urlparse import urlparse
from django.conf import settings
from django.test.client import RequestFactory
from ... | agpl-3.0 |
kenshay/ImageScript | Script_Runner/PYTHON/Lib/distutils/text_file.py | 55 | 12483 | """text_file
provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""
import sys, io
class TextFile:
"""Provides a file-like object that takes care of all the things you
commonly wa... | gpl-3.0 |
vipul-sharma20/oh-mainline | vendor/packages/twisted/twisted/web/soap.py | 60 | 5179 | # -*- test-case-name: twisted.web.test.test_soap -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
SOAP support for twisted.web.
Requires SOAPpy 0.10.1 or later.
Maintainer: Itamar Shtull-Trauring
Future plans:
SOAPContext support of some kind.
Pluggable method lookup policies.
"""
#... | agpl-3.0 |
Chilledheart/chromium | tools/cygprofile/patch_orderfile_unittest.py | 36 | 6322 | #!/usr/bin/python
# 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.
import unittest
import patch_orderfile
import symbol_extractor
class TestPatchOrderFile(unittest.TestCase):
def testRemoveSuffixes(sel... | bsd-3-clause |
pcaro/jurko-suds | suds/sudsobject.py | 9 | 10893 | # This program is free software; you can redistribute it and/or modify it under
# the terms of the (LGPL) GNU Lesser General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will b... | lgpl-3.0 |
acsone/odoo | addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/functions.py | 292 | 11244 | ##########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... | agpl-3.0 |
shipci/sympy | sympy/logic/inference.py | 14 | 7672 | """Inference in propositional logic"""
from __future__ import print_function, division
from sympy.logic.boolalg import And, Or, Not, Implies, Equivalent, \
conjuncts, to_cnf
from sympy.core.compatibility import ordered
from sympy.core.sympify import sympify
def literal_symbol(literal):
"""
The symbol in ... | bsd-3-clause |
broferek/ansible | lib/ansible/module_utils/network/sros/sros.py | 38 | 4318 | # This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
pletzer/three.js | utils/exporters/blender/addons/io_three/exporter/object.py | 8 | 5906 | from .. import constants, logger
from . import base_classes, api
class Object(base_classes.BaseNode):
"""Class that wraps an object node"""
def __init__(self, node, parent=None, type=None):
logger.debug("Object().__init__(%s)", node)
base_classes.BaseNode.__init__(self, node, parent=parent, ty... | mit |
Andrew-McNab-UK/DIRAC | tests/Integration/ResourceStatusSystem/Test_ResourceManagement.py | 2 | 12495 | ''' This is a test of the chain
ResourceManagementClient -> ResourceManagementHandler -> ResourceManagementDB
It supposes that the DB is present, and that the service is running
The DB is supposed to be empty when the test starts
'''
#pylint: disable=invalid-name,wrong-import-position,missing-docstring
i... | gpl-3.0 |
williamfeng323/py-web | flask/lib/python3.6/site-packages/requests/_internal_utils.py | 414 | 1096 | # -*- coding: utf-8 -*-
"""
requests._internal_utils
~~~~~~~~~~~~~~
Provides utility functions that are consumed internally by Requests
which depend on extremely few external helpers (such as compat)
"""
from .compat import is_py2, builtin_str, str
def to_native_string(string, encoding='ascii'):
"""Given a str... | mit |
ojii/sandlib | lib/lib-python/2.7/test/test_old_mailbox.py | 36 | 4720 | # This set of tests exercises the backward-compatibility class
# in mailbox.py (the ones without write support).
import mailbox
import os
import time
import unittest
from test import test_support
# cleanup earlier tests
try:
os.unlink(test_support.TESTFN)
except os.error:
pass
FROM_ = "From some.body@dummy.d... | bsd-3-clause |
zorroz/microblog | flask/lib/python2.7/site-packages/whoosh/lang/snowball/romanian.py | 22 | 11966 | from .bases import _StandardStemmer
from whoosh.compat import u
class RomanianStemmer(_StandardStemmer):
"""
The Romanian Snowball stemmer.
:cvar __vowels: The Romanian vowels.
:type __vowels: unicode
:cvar __step0_suffixes: Suffixes to be deleted in step 0 of the algorithm.
:type __step0_s... | bsd-3-clause |
gprMax/gprMax | setup.py | 1 | 7984 | # Copyright (C) 2015-2020: The University of Edinburgh
# Authors: Craig Warren and Antonis Giannopoulos
#
# This file is part of gprMax.
#
# gprMax 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 Foundatio... | gpl-3.0 |
mtougeron/python-openstacksdk | openstack/tests/unit/orchestration/test_orchestration_service.py | 3 | 1129 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | apache-2.0 |
wtsi-hgi/hgi-cookie-monster-setup | hgicookiemonster/rules/study_manolis_rule.py | 2 | 1073 | from cookiemonster.common.models import Cookie
from cookiemonster.processor.models import Rule
from hgicommon.data_source import register
from hgicookiemonster.context import HgiContext
from hgicookiemonster.rules._common import STUDY_RULE_PRIORITY
from hgicookiemonster.run import IRODS_UPDATE_ENRICHMENT
from hgicookie... | gpl-3.0 |
bbozhev/flask-test | flask/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/json.py | 10 | 11066 | # postgresql/json.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from __future__ import absolute_import
import json
from .base import ischema_nam... | mit |
gwparikh/cvgui | cfg_compare.py | 2 | 1688 | #!/usr/bin/env python
import os, sys, subprocess
import argparse
import subprocess
import threading
import timeit
from configobj import ConfigObj
from cvguipy import cvconfig
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="compare two configuration files")
parser.add_argument('config1'... | mit |
florian-dacosta/OCB | addons/project/__openerp__.py | 42 | 2865 | # -*- 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 |
ujjwal96/mitmproxy | test/mitmproxy/addons/test_dumper.py | 3 | 5783 | import io
import shutil
import pytest
from unittest import mock
from mitmproxy.test import tflow
from mitmproxy.test import taddons
from mitmproxy.test import tutils
from mitmproxy.addons import dumper
from mitmproxy import exceptions
from mitmproxy import http
def test_configure():
d = dumper.Dumper()
with... | mit |
tgummerer/buck | programs/tracing.py | 24 | 3089 | #!/usr/bin/env python
import errno
import glob
import json
import os
import time
from timing import monotonic_time_nanos
# We need to optionally include some functions for Windows.
import platform
if platform.system() == 'Windows':
import ctypes
def create_symlink(original, symlink):
assert os.path.isfile(o... | apache-2.0 |
lare-team/django-lare | django_lare/models.py | 1 | 2035 | from django_lare import VERSION
class Lare(object):
enabled = False
current_namespace = ""
previous_namespace = ""
version = VERSION
supported_version = "1.0.0"
def __init__(self, request):
super(Lare, self).__init__()
if 'HTTP_X_LARE' in request.META:
if 'HTTP_X_... | mit |
nazo/ansible | lib/ansible/modules/network/panos/panos_loadcfg.py | 78 | 3560 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Ansible module to manage PaloAltoNetworks Firewall
# (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 publish... | gpl-3.0 |
munkiat/libcloud | docs/examples/compute/gce/gce_service_account_scopes.py | 59 | 1062 | # See previous examples for connecting and creating the driver
# ...
driver = None
# Define common example attributes
s = 'n1-standard-1'
i = 'debian-7'
z = 'us-central1-a'
# Service Account Scopes require a list of dictionaries. Each dictionary
# can have an optional 'email' address specifying the Service Account
# ... | apache-2.0 |
previtus/MGR-Project-Code | Downloader/PreprocessData/GenListOfUrls.py | 1 | 1499 | # GenListOfUrls.py
import sys
sys.path.append('..')
def GenListOfUrls(Segments, PIXELS_X, PIXELS_Y, PrependPath='', minimal_length=20, custom=False):
'''
Iterates over the segment list and returns a list of urls needed for download
Outputs list of tripples in [ (<url>, <filename>, <edge id>), ... ]
'''... | mit |
adamncasey/servo | tests/wpt/web-platform-tests/css/tools/html2xhtml.py | 46 | 2059 | #!/usr/bin/python
# This file is licensed under CC Zero
import sys
import html5lib
import re
if len(sys.argv) != 3:
print """! html2xhtml requires two arguments: the filename to read, and the filename to write"""
exit()
#######################################################################
# Parse HTML and out... | mpl-2.0 |
tverlaan/ansible-modules-core | cloud/openstack/_quantum_subnet.py | 129 | 10130 | #!/usr/bin/python
#coding: utf-8 -*-
# (c) 2013, Benno Joy <benno@ansible.com>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ... | gpl-3.0 |
petemoore/git-repo | command.py | 40 | 6999 | #
# Copyright (C) 2008 The Android Open Source Project
#
# 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 la... | apache-2.0 |
digwanderlust/pants | src/python/pants/backend/jvm/tasks/jvm_compile/analysis.py | 7 | 1319 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
class Analysis(obje... | apache-2.0 |
yeleman/snisi | snisi_core/migrations/0005_auto_20150205_1516.py | 1 | 1889 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('snisi_core', '0004_auto_20150114_1650'),
]
operations = [
migrations.CreateModel(
... | mit |
DomBennett/pG-lt | pglt/tools/setup_tools.py | 1 | 16996 | #! /bin/usr/env python
# D.J. Bennett
# 07/11/2014
"""
pglt setup tools
"""
# PACKAGES
import argparse
import sys
import os
import re
import pickle
import csv
import logging
import platform
from datetime import datetime
from reseter_tools import Reseter
from special_tools import clean
from special_tools import stats
f... | gpl-2.0 |
mediafactory/yats | sites/web/web/models.py | 1 | 3394 | # -*- coding: utf-8 -*-
from django.db import models
from django.utils.functional import lazy
from django.core.cache import cache
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from yats.models import tickets
from yats.models import base
import datetime
import base64
import ht... | mit |
apixandru/intellij-community | python/lib/Lib/site-packages/django/utils/log.py | 71 | 3241 | import logging
import sys
from django.core import mail
# Make sure a NullHandler is available
# This was added in Python 2.7/3.2
try:
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
# Make sure that dictConfig is availabl... | apache-2.0 |
rvalyi/OpenUpgrade | addons/l10n_be/__openerp__.py | 16 | 3696 | # -*- 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 |
akipta/autokey | src/lib/qtui/scriptpage.py | 48 | 3012 | #!/usr/bin/env python
# coding=UTF-8
#
# Generated by pykdeuic4 from scriptpage.ui on Sun Mar 4 11:39:40 2012
#
# WARNING! All changes to this file will be lost.
from PyKDE4 import kdecore
from PyKDE4 import kdeui
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
... | gpl-3.0 |
izonder/intellij-community | python/helpers/profiler/thriftpy3/transport/TSSLSocket.py | 44 | 8264 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
hh-italian-group/h-tautau | Production/crab/split_dataset.py | 1 | 2726 | #!/usr/bin/env python
# Create json files to split dataset into several parts.
# This file is part of https://github.com/hh-italian-group/h-tautau.
import argparse
from sets import Set
from FWCore.PythonUtilities.LumiList import LumiList
from dbs.apis.dbsClient import DbsApi
parser = argparse.ArgumentParser(descripti... | gpl-2.0 |
tavendo/AutobahnPython | examples/twisted/wamp/app/subscribe_upon_call/subscribe_upon_call.py | 3 | 1758 | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) Crossbar.io Technologies GmbH
#
# 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 ... | mit |
UPDDI/mps-database-server | assays/forms.py | 1 | 247404 | import datetime
from django import forms
from django.contrib.auth.models import Group
from django.forms.models import (
BaseInlineFormSet,
inlineformset_factory,
BaseModelFormSet,
modelformset_factory,
)
from cellsamples.models import Biosensor
from assays.models import (
AssayStudyConfiguration,
... | mit |
iiman/mytardis | tardis/tardis_portal/ProcessExperiment.py | 2 | 22472 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2010, Monash e-Research Centre
# (Monash University, Australia)
# Copyright (c) 2010, VeRSI Consortium
# (Victorian eResearch Strategic Initiative, Australia)
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are per... | bsd-3-clause |
scw/ansible | v1/ansible/runner/action_plugins/pause.py | 143 | 5575 | # Copyright 2012, Tim Bielawa <tbielawa@redhat.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... | gpl-3.0 |
jonathan-beard/edx-platform | cms/djangoapps/contentstore/tests/test_course_create_rerun.py | 126 | 2423 | """
Test view handler for rerun (and eventually create)
"""
from django.test.client import RequestFactory
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
from student.roles import CourseInstr... | agpl-3.0 |
mulkieran/blivet | blivet/devicelibs/raid.py | 9 | 23705 | #
# raid.py
# representation of RAID levels
#
# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (a... | gpl-2.0 |
amarant/servo | tests/wpt/css-tests/tools/lint/lint.py | 159 | 9915 | import os
import subprocess
import re
import sys
import fnmatch
from collections import defaultdict
from .. import localpaths
from manifest.sourcefile import SourceFile
here = os.path.abspath(os.path.split(__file__)[0])
repo_root = localpaths.repo_root
def git(command, *args):
args = list(args)
proc_kwargs... | mpl-2.0 |
sesuncedu/bitcurator | dfxml/python/deidentify_xml.py | 4 | 3563 | #!/usr/bin/python
#
# deidentify_xml.py:
# Given XML for a disk, remove information that might be personally identifying from filenames.
# remember the mapping so that directory names don't get changed.
#
# 2012-10-27 slg - updated to Python3
private_dirs = ["home/","usr/home","Users"]
ok_top_paths_win = ["program fil... | gpl-3.0 |
shivanikhosa/browserscope | categories/html5/test_set.py | 9 | 4607 | #!/usr/bin/python2.4
#
# Copyright 2009 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 |
invisiblek/python-for-android | python3-alpha/python3-src/Lib/doctest.py | 45 | 99902 | # Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
# Jim Fulton
# Edward Loper
# Provided as-is; use at your own risk; no warranty; no promises; enjoy!
r"""Module doctest -- a framework for running examples in docstrings.
In... | apache-2.0 |
sergiocorato/odoomrp-wip | product_variants_no_automatic_creation/models/pricelist.py | 29 | 7484 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the... | agpl-3.0 |
yewang15215/django | tests/check_framework/tests.py | 6 | 11095 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
from django.apps import apps
from django.core import checks
from django.core.checks import Error, Warning
from django.core.checks.registry import CheckRegistry
from django.core.management import call_command
from django.core.management.base im... | bsd-3-clause |
fafaman/django | django/core/management/commands/squashmigrations.py | 162 | 8767 | from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections, migrations
from django.db.migrations.loader import AmbiguityError, MigrationLoader
from django.db.migrations.migration import SwappableTuple
from django.db.migrations.o... | bsd-3-clause |
ntt-sic/python-keystoneclient | keystoneclient/tests/v3/test_projects.py | 4 | 2286 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 ... | apache-2.0 |
adamrvfisher/TechnicalAnalysisLibrary | Blankrunningslate.py | 1 | 1167 | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 5 20:13:42 2017
@author: AmatVictoriaCuramIII
"""
firsttime = '07/01/1983'
secondtime = '01/01/1995'
thirdtime = '01/01/2006'
fourthtime = '01/01/2010'
lasttime = '01/01/2050'
ticker = '^GSPC'
import pandas as pd
from ChaikinAggMaker import ChaikinAggMaker
... | apache-2.0 |
rgeleta/odoo | addons/l10n_pa/__init__.py | 2120 | 1456 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2011 Cubic ERP - Teradata SAC. (http://cubicerp.com).
#
# WARNING: This program as such is intended to be used by professional
# programmers who take t... | agpl-3.0 |
artefactual/archivematica-history | src/MCPServer/lib/archivematicaMCP.py | 1 | 11965 | #!/usr/bin/python -OO
# This file is part of Archivematica.
#
# Copyright 2010-2012 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, e... | agpl-3.0 |
mistercrunch/panoramix | tests/email_tests.py | 1 | 7013 | # -*- coding: utf-8 -*-
# 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
# "... | apache-2.0 |
stadelmanma/netl-AP_MAP_FLOW | apmapflow/scripts/apm_open_foam_export.py | 2 | 16588 | r"""
Description: Generates a complete OpenFoam simulation from an APM-MODEL
input file and existing OpenFoam files which are used as templates.
For usage information run: ``apm_open_foam_export -h``
| Written By: Matthew stadelman
| Date Written: 2015/07/25
| Last Modfied: 2017/04/23
|
"""
import argparse
from arg... | gpl-3.0 |
google-research/tensor2robot | hooks/async_export_hook_builder_tpu_test.py | 1 | 2533 | # coding=utf-8
# Copyright 2021 The Tensor2Robot 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 ... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.