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 |
|---|---|---|---|---|---|
marcinkwiatkowski/buck | third-party/py/unittest2/unittest2/test/test_skipping.py | 111 | 4936 | from unittest2.test.support import LoggingResult
import unittest2
class Test_TestSkipping(unittest2.TestCase):
def test_skipping(self):
class Foo(unittest2.TestCase):
def test_skip_me(self):
self.skipTest("skip")
events = []
result = LoggingResult(events)
... | apache-2.0 |
codeforamerica/pittsburgh-purchasing-suite | purchasing_test/unit/other/test_notifications.py | 2 | 5070 | # -*- coding: utf-8 -*-
import os
from unittest import TestCase
from mock import patch, Mock, MagicMock
from purchasing.notifications import Notification
class TestNotification(TestCase):
def setUp(self):
os.environ['CONFIG'] = 'purchasing.settings.TestConfig'
@patch('purchasing.notifications.render... | bsd-3-clause |
smart-developerr/my-first-blog | Lib/site-packages/django/contrib/gis/shortcuts.py | 52 | 1231 | import zipfile
from io import BytesIO
from django.conf import settings
from django.http import HttpResponse
from django.template import loader
# NumPy supported?
try:
import numpy
except ImportError:
numpy = False
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."
kmz = Bytes... | gpl-3.0 |
rmyers/clouddb-rpc | dashboard/stashboard/content/database_clusters/forms.py | 2 | 19249 | # Copyright 2015 HP Software, LLC
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
normanjaeckel/OpenSlides | server/tests/integration/motions/test_polls.py | 1 | 53361 | from decimal import Decimal
import pytest
from django.conf import settings
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
from openslides.core.config import config
from openslides.motions.models import Motion, ... | mit |
rholy/dnf | tests/conf/test_read.py | 17 | 1690 | # Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be u... | gpl-2.0 |
Fedik/gramps | gramps/gen/lib/test/serialize_test.py | 7 | 3897 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2013 Doug Blank <doug.blank@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; either version 2 of the License, or
#... | gpl-2.0 |
Ivansek/django-filer | filer/models/filemodels.py | 8 | 9878 | #-*- coding: utf-8 -*-
from django.core import urlresolvers
from django.conf import settings
from django.core.files.base import ContentFile
from django.db import models
from django.utils.translation import ugettext_lazy as _
from filer.fields.multistorage_file import MultiStorageFileField
from filer.models import mixin... | bsd-3-clause |
nmartensen/pandas | pandas/tests/indexing/test_callable.py | 14 | 8721 | # -*- coding: utf-8 -*-
# pylint: disable-msg=W0612,E1101
import numpy as np
import pandas as pd
import pandas.util.testing as tm
class TestIndexingCallable(object):
def test_frame_loc_ix_callable(self):
# GH 11485
df = pd.DataFrame({'A': [1, 2, 3, 4], 'B': list('aabb'),
... | bsd-3-clause |
tswast/google-cloud-python | videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client.py | 1 | 14088 | # -*- coding: utf-8 -*-
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
sergiocorato/knowledge | attachment_preview/model/ir_attachment.py | 9 | 2843 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2014 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of ... | agpl-3.0 |
chalasr/Flask-P2P | venv/lib/python2.7/site-packages/gunicorn/workers/gtornado.py | 45 | 3901 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import os
import sys
try:
import tornado.web
except ImportError:
raise RuntimeError("You need tornado installed to use this worker.")
import tornado.httpserver
from tornado.ioloop imp... | mit |
ClearCorp/odoo-clearcorp | TODO-8.0/hr_payroll_pay_commission/wizard/__init__.py | 3 | 1058 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Original Module by SIESA (<http://www.siesacr.com>)
# Refactored by CLEARCORP S.A. (<http://clearcorp.co.cr>)
#
# This program is free software: you can redis... | agpl-3.0 |
ShawnPengxy/Flask-madeBlog | site-packages/colorama/ansitowin32.py | 167 | 6810 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style
from .winterm import WinTerm, WinColor, WinStyle
from .win32 import windll
if windll is not None:
winterm = WinTerm()
def is_a_tty(stream):
re... | mit |
SnappleCap/oh-mainline | vendor/packages/docutils/test/test_parsers/test_rst/test_comments.py | 19 | 6595 | #! /usr/bin/env python
# $Id: test_comments.py 4564 2006-05-21 20:44:42Z wiemann $
# Author: David Goodger <goodger@python.org>
# Copyright: This module has been placed in the public domain.
"""
Tests for states.py.
"""
from __init__ import DocutilsTestSupport
def suite():
s = DocutilsTestSupport.ParserTestSuit... | agpl-3.0 |
atsnyder/ITK | Wrapping/Generators/Python/Tests/AntiAliasBinaryImageFilter.py | 19 | 2392 | #==========================================================================
#
# Copyright Insight Software Consortium
#
# 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... | apache-2.0 |
justinwp/ParsePy | parse_rest/installation.py | 11 | 2753 | # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will ... | gpl-3.0 |
MARFMS/OwnCloud_NAC | apps/files_videoviewer/mediaelement/src/Builder.py | 15 | 4388 | import sys
import os
import shutil
me_filename = 'mediaelement'
mep_filename = 'mediaelementplayer'
combined_filename = 'mediaelement-and-player'
# BUILD MediaElement (single file)
print('building MediaElement.js')
me_files = []
me_files.append('me-header.js')
me_files.append('me-namespace.js')
me_files.append('me-u... | gpl-2.0 |
b0ttl3z/SickRage | sickbeard/providers/alpharatio.py | 5 | 6983 | # coding=utf-8
# Author: Dustyn Gibson <miigotu@gmail.com>
#
# URL: https://sickrage.github.io
#
# This file is part of SickRage.
#
# SickRage 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 o... | gpl-3.0 |
Jrws/JonnyBot | D-Jonnybot/musicbot/exceptions.py | 14 | 2599 | import shutil
import textwrap
# Base class for exceptions
class MusicbotException(Exception):
def __init__(self, message, *, expire_in=0):
self._message = message
self.expire_in = expire_in
@property
def message(self):
return self._message
@property
def message_no_format(s... | mit |
BeeeOn/server | t/restui/t1007-types-list-detail.py | 1 | 10281 | #! /usr/bin/env python3
import config
config.import_libs()
import unittest
import socket
import json
from rest import GET, POST, PUT, DELETE
class TestTypesListDetail(unittest.TestCase):
"""
Create a session for testing.
"""
def setUp(self):
req = POST(config.ui_host, config.ui_port, "/auth")
req.body(confi... | bsd-3-clause |
fusionbox/django-darkknight | darkknight/forms.py | 1 | 4549 | import re
import os
from django import forms
from django.db import transaction
from django.utils.translation import ugettext as _
from django.forms.formsets import BaseFormSet
from localflavor.us.us_states import US_STATES
from django_countries import countries
from OpenSSL import crypto
from darkknight.models import... | bsd-2-clause |
ahmedaljazzar/edx-platform | lms/djangoapps/verify_student/signals.py | 14 | 1309 | """
Signal handler for setting default course verification dates
"""
from django.core.exceptions import ObjectDoesNotExist
from django.dispatch.dispatcher import receiver
from openedx.core.djangoapps.user_api.accounts.signals import USER_RETIRE_LMS_CRITICAL
from xmodule.modulestore.django import SignalHandler, modules... | agpl-3.0 |
SaranyaKarthikeyan/boto | tests/integration/route53/test_health_check.py | 113 | 10681 | # Copyright (c) 2014 Tellybug, Matt Millar
#
# 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, publis... | mit |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/numpy/core/tests/test_multiarray.py | 6 | 87340 | import tempfile
import sys
import os
import numpy as np
from numpy.testing import *
from numpy.core import *
from numpy.core.multiarray_tests import test_neighborhood_iterator, test_neighborhood_iterator_oob
# Need to test an object that does not fully implement math interface
from datetime import timedelta
from nump... | agpl-3.0 |
mvidalgarcia/indico | indico/modules/events/requests/models/requests.py | 2 | 4715 | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from sqlalchemy.dialects.postgresql import JSONB
from indico.cor... | mit |
sinhrks/scikit-learn | examples/hetero_feature_union.py | 288 | 6236 | """
=============================================
Feature Union with Heterogeneous Data Sources
=============================================
Datasets can often contain components of that require different feature
extraction and processing pipelines. This scenario might occur when:
1. Your dataset consists of hetero... | bsd-3-clause |
arose/three.js | utils/converters/obj/split_obj.py | 369 | 12687 | """Split single OBJ model into mutliple OBJ files by materials
-------------------------------------
How to use
-------------------------------------
python split_obj.py -i infile.obj -o outfile
Will generate:
outfile_000.obj
outfile_001.obj
...
outfile_XXX.obj
-------------------------------------
Parser based ... | mit |
jmartinezchaine/OpenERP | openerp/addons/membership/__openerp__.py | 9 | 2262 | # -*- 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 |
Acehaidrey/incubator-airflow | airflow/providers/google/cloud/example_dags/example_automl_video_intelligence_classification.py | 7 | 3423 | #
# 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... | apache-2.0 |
leasual/nogotofail | nogotofail/mitm/util/ssl2/types/cipher.py | 8 | 1830 | r'''
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | apache-2.0 |
loic/django | django/contrib/gis/feeds.py | 144 | 5976 | from __future__ import unicode_literals
from django.contrib.syndication.views import Feed as BaseFeed
from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed
class GeoFeedMixin(object):
"""
This mixin provides the necessary routines for SyndicationFeed subclasses
to produce simple GeoRSS or W3C ... | bsd-3-clause |
jmighion/ansible | lib/ansible/modules/network/cumulus/_cl_bridge.py | 26 | 12923 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Cumulus Networks <ce-ceng@cumulusnetworks.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_versio... | gpl-3.0 |
thresholdsoftware/asylum | openerp/addons/plugin/plugin_handler.py | 36 | 8526 | '''
Created on 18 oct. 2011
@author: openerp
'''
from openerp.osv import osv
from openerp.tools.translate import _
class plugin_handler(osv.osv_memory):
_name = 'plugin.handler'
def _make_url(self, cr, uid, res_id, model, context=None):
"""
@param res_id: on which document the message is... | agpl-3.0 |
debian789/suescunet | apps/codigos/admin.py | 1 | 1478 | from django.contrib import admin
from models import mdl_codigos
from apps.elementos_comunes.models import mdl_lenguaje,mdl_sistema_operativo
from actions import export_as_csv
## crea el listado de opciones en el administrado !!!
class codigosAdmin(admin.ModelAdmin):
list_display = ('titulo','lenguaje','archivo','i... | gpl-2.0 |
nrc/servo | tests/wpt/web-platform-tests/tools/manifest/utils.py | 12 | 1349 | import os
from six import StringIO
blacklist = ["/", "/tools/", "/resources/", "/common/", "/conformance-checkers/", "_certs"]
def rel_path_to_url(rel_path, url_base="/"):
assert not os.path.isabs(rel_path)
if url_base[0] != "/":
url_base = "/" + url_base
if url_base[-1] != "/":
url_base +... | mpl-2.0 |
mongodb/mongo-python-driver | test/utils.py | 2 | 36192 | # Copyright 2012-present MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | apache-2.0 |
tliron/ronin | ronin/sdl/__init__.py | 1 | 4444 | # Copyright 2016-2018 Tal Liron
#
# 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 writin... | apache-2.0 |
rnikiforova/GuruTubeProject | GuruTube/libraries/django/utils/datetime_safe.py | 179 | 2747 | # Python's datetime strftime doesn't handle dates before 1900.
# These classes override date and datetime to support the formatting of a date
# through its full "proleptic Gregorian" date range.
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was... | bsd-3-clause |
cirosantilli/pyelftools | test/run_examples_test.py | 7 | 2709 | #!/usr/bin/env python
#-------------------------------------------------------------------------------
# test/run_examples_test.py
#
# Run the examples and compare their output to a reference
#
# Eli Bendersky (eliben@gmail.com)
# This code is in the public domain
#------------------------------------------------------... | unlicense |
Nivl/www.melvin.la | nivls_website/lab/migrations/0005_auto__del_unique_tag_slug.py | 2 | 15309 | # -*- 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):
# Removing unique constraint on 'Tag', fields ['slug']
db.delete_unique('lab_tag', ['slug'])
def backw... | gpl-3.0 |
rfguri/vimfiles | bundle/ycm/third_party/ycmd/third_party/requests/requests/packages/chardet/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | mit |
ojengwa/My-Blog | Views/post.py | 2 | 2111 | from static import *
from Models.Users import Users
main = """<div id="main" class="site-main container_16">
<div class="inner">
<div id="primary" class="grid_11 suffix_1">
<article class="single">
<div class="entry-content">
<div class="long-description">
... | gpl-2.0 |
kanpol/eli | 2013/twisted_irc_server.py | 13 | 1345 | #-------------------------------------------------------------------------------
# twisted_irc_server.py
#
# A simple IRC server that flattens out what's happening behind the scenes of
# 'twistd words'. Useful mainly to test clients on localhost.
#
# Eli Bendersky (eliben@gmail.com)
# Last updated: 2013.01.27
# This co... | unlicense |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python2.7/test/test_winsound.py | 35 | 9092 | # Ridiculously simple test of the winsound module for Windows.
import unittest
from test import test_support
test_support.requires('audio')
import time
import os
import subprocess
winsound = test_support.import_module('winsound')
ctypes = test_support.import_module('ctypes')
import _winreg
def has_sound(sound):
... | gpl-2.0 |
jeremiah-c-leary/vhdl-style-guide | vsg/tests/sequential/test_rule_006.py | 1 | 1193 |
import os
import unittest
from vsg.rules import sequential
from vsg import vhdlFile
from vsg.tests import utils
sTestDir = os.path.dirname(__file__)
lFile, eError =vhdlFile.utils.read_vhdlfile(os.path.join(sTestDir,'rule_006_test_input.vhd'))
lExpected = []
lExpected.append('')
utils.read_file(os.path.join(sTestDi... | gpl-3.0 |
3nids/QGIS | python/plugins/processing/algs/gdal/gdaladdo.py | 15 | 6874 | # -*- coding: utf-8 -*-
"""
***************************************************************************
translate.py
---------------------
Date : August 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
*****************************... | gpl-2.0 |
tvotyakov/codeeval | easy/hidden-digits/code.py | 1 | 1115 | #!python3
def hidden_digits(in_str):
'''(string) -> string
Finds all visible and hidden digits in the in_str string
and return them out in order of their appearance as one string.
>>> hidden_digits('abcdefghik')
'012345678'
>>> hidden_digits('Xa,}A#5N}{xOBwYBHIlH,#W')
'05'
>... | gpl-2.0 |
LICEF/edx-platform | common/lib/xmodule/xmodule/modulestore/split_mongo/definition_lazy_loader.py | 19 | 1174 | from opaque_keys.edx.locator import DefinitionLocator
class DefinitionLazyLoader(object):
"""
A placeholder to put into an xblock in place of its definition which
when accessed knows how to get its content. Only useful if the containing
object doesn't force access during init but waits until client wa... | agpl-3.0 |
sighingnow/Spider-Utils | csdn-get-follow/get-follow.py | 1 | 4304 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'He Tao'
'''
CSDN blog spider
================
get-follow.py
-------------
Get the user name list of a specified user are following.
'''
import gzip
import json
import re
import os
from http.client import HTTPConnection
from html.parser import HTMLParse... | mit |
pearlcoin-project/pearlcoin | qa/rpc-tests/p2p-fullblocktest.py | 22 | 52737 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from ... | mit |
acjones617/k-means | lib/exec.py | 1 | 1524 | import normalize as n
import cluster as c
import jsonpickle as j
import argparse
import ast
parser = argparse.ArgumentParser()
parser.add_argument('matrix')
parser.add_argument('options')
args = parser.parse_args()
matrix = ast.literal_eval(args.matrix)
options = ast.literal_eval(args.options)
# steps:
# 1. norma... | mit |
mlperf/training_results_v0.7 | Google/benchmarks/ssd/implementations/ssd-research-TF-tpu-v4-512/ssd_main.py | 1 | 11062 | # Copyright 2018 Google. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
wd5/jangr | _django/contrib/gis/db/backends/postgis/operations.py | 292 | 25840 | import re
from decimal import Decimal
from django.conf import settings
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gi... | bsd-3-clause |
FireBladeNooT/Medusa_1_6 | lib/adba/aniDBfileInfo.py | 27 | 3710 | #!/usr/bin/env python
#
# This file is part of aDBa.
#
# aDBa 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.
#
# aDBa is distributed i... | gpl-3.0 |
vinhlh/bite-project | deps/gdata-python-client/samples/oauth/oauth_on_appengine/appengine_utilities/flash.py | 130 | 4641 | """
Copyright (c) 2008, appengine-utilities project
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 ... | apache-2.0 |
Motaku/ansible | lib/ansible/plugins/lookup/random_choice.py | 253 | 1226 | # (c) 2013, 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 |
thomasrogers03/phantomjs | src/breakpad/src/tools/gyp/tools/pretty_gyp.py | 148 | 4924 | #!/usr/bin/env python
# Copyright (c) 2009 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.
# This file pretty-prints the contents of a GYP file.
import sys
import re
input = []
if len(sys.argv) > 1:
input_f... | bsd-3-clause |
beckastar/django | django/contrib/messages/tests/test_fallback.py | 234 | 7033 | from django.contrib.messages import constants
from django.contrib.messages.storage.fallback import (FallbackStorage,
CookieStorage)
from django.contrib.messages.tests.base import BaseTests
from django.contrib.messages.tests.test_cookie import (set_cookie_data,
stored_cookie_messages_count)
from django.contrib.m... | bsd-3-clause |
openwebcc/ba | maintenance/rawdata/als/hef/071011_hef14_fix_ala.py | 1 | 2755 | #!/usr/bin/python
#
# fix incorrect syntax for echoes in .ala files of 071011_hef14
#
import re
import os
import sys
sys.path.append('/home/institut/rawdata/www/lib')
from Laser.Util import las
if __name__ == '__main__':
""" fix incorrect return number and number of returns for given pulse syntax """
import ... | gpl-3.0 |
dguerri/ansible-modules-core | cloud/digital_ocean/digital_ocean_sshkey.py | 133 | 5134 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
google/retiming | models/networks.py | 1 | 16657 | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/sklearn/model_selection/_validation.py | 4 | 53401 | """
The :mod:`sklearn.model_selection._validation` module includes classes and
functions to validate the model.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Raghav RV <rvraghav93@gma... | mit |
jiahaoliang/group-based-policy | gbpservice/tests/contrib/nfp_service/reference_configurator/api/v1/controllers/__init__.py | 2 | 2180 | # 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 |
gnowledge/ISON | gstudio/search.py | 3 | 6837 | # Copyright (c) 2011, 2012 Free Software Foundation
# 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
# License, or (at your option) any later vers... | agpl-3.0 |
chiefspace/udemy-rest-api | udemy_rest_api_section5/code/env/lib/python3.4/site-packages/click/_bashcomplete.py | 136 | 2423 | import os
import re
from .utils import echo
from .parser import split_arg_string
from .core import MultiCommand, Option
COMPLETION_SCRIPT = '''
%(complete_func)s() {
COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \\
COMP_CWORD=$COMP_CWORD \\
%(autocomplete_var)s=complete $1... | gpl-2.0 |
s-gv/rnicu | ecg/ecg_visualizer_ble_PC/galry/bindingmanager.py | 7 | 6593 | from qtools.qtpy import QtCore, QtGui
from qtools.qtpy.QtCore import Qt
from galry import Manager, ordict
import numpy as np
__all__ = ['BindingManager', 'Bindings']
class BindingManager(Manager):
"""Manager several sets of bindings (or interaction modes) and allows
to switch between several modes.
"""... | agpl-3.0 |
samirelanduk/pygtop | pygtop/targets.py | 1 | 14667 | """Contains target-specific objects and functions."""
from . import gtop
from . import pdb
from .interactions import Interaction, get_interaction_by_id
from .exceptions import NoSuchTargetError, NoSuchTargetFamilyError
from .shared import DatabaseLink, Gene, strip_html
def get_target_by_id(target_id):
"""Returns ... | mit |
ArcherSys/ArcherSys | Lib/site-packages/pyreadline/keysyms/ironpython_keysyms.py | 3 | 7137 | # -*- coding: utf-8 -*-
#*****************************************************************************
# Copyright (C) 2003-2006 Gary Bishop.
# Copyright (C) 2006 Jorgen Stenarson. <jorgen.stenarson@bostream.nu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYIN... | mit |
nickanderson/ansible | v2/ansible/plugins/lookup/fileglob.py | 176 | 1226 | # (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 |
easyw/kicad-3d-models-in-freecad | cadquery/FCAD_script_generator/Fuse/main_generator_SMD.py | 1 | 13644 | # -*- coding: utf8 -*-
#!/usr/bin/python
#
# This is derived from a cadquery script for generating PDIP models in X3D format
#
# from https://bitbucket.org/hyOzd/freecad-macros
# author hyOzd
# This is a
# Dimensions are from Microchips Packaging Specification document:
# DS00000049BY. Body drawing is the same as QFP g... | gpl-2.0 |
drawks/ansible | lib/ansible/modules/network/fortios/fortios_vpn_ipsec_phase2_interface.py | 21 | 21967 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the Lic... | gpl-3.0 |
KDB2/OpenReliability | veusz/setting/controls.py | 2 | 60684 | # -*- coding: utf-8 -*-
# Copyright (C) 2005 Jeremy S. Sanders
# Email: Jeremy Sanders <jeremy@jeremysanders.net>
#
# 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 ... | gpl-2.0 |
secdev/scapy | scapy/contrib/automotive/obd/pid/pids_80_9F.py | 5 | 7374 | # This file is part of Scapy
# See http://www.secdev.org/projects/scapy for more information
# Copyright (C) Andreas Korb <andreas.d.korb@gmail.com>
# Copyright (C) Nils Weiss <nils@we155.de>
# This program is published under a GPLv2 license
# scapy.contrib.status = skip
from scapy.fields import StrFixedLenField, Fla... | gpl-2.0 |
Workday/OpenFrame | third_party/WebKit/LayoutTests/http/tests/fetch/PRESUBMIT.py | 39 | 1307 | # 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.
'''Chromium presubmit script for fetch API layout tests.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts.
'''
import os
import ... | bsd-3-clause |
djangocon/symposion-2014 | symposion/proposals/models.py | 4 | 5441 | import datetime
import os
import uuid
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
import reversion
from markitup.fields import MarkupField
from model_util... | bsd-3-clause |
likecoin-dev/bitcoin | contrib/devtools/fix-copyright-headers.py | 173 | 1484 | #!/usr/bin/env python
'''
Run this script inside of src/ and it will look for all the files
that were changed this year that still have the last year in the
copyright headers, and it will fix the headers on that file using
a perl regex one liner.
For example: if it finds something like this and we're in 2014
// Copyr... | mit |
kalyptorisk/daversy | src/daversy/db/oracle/index.py | 1 | 3580 | from daversy.utils import *
from daversy.db.object import Index, IndexColumn
class IndexColumnBuilder(object):
""" Represents a builder for a column in an index. """
DbClass = IndexColumn
XmlTag = 'index-column'
Query = """
SELECT c.column_name, lower(c.descend) AS sort, i.index_name,
... | gpl-2.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/South-1.0.2/south/tests/inspector.py | 142 | 3896 |
from south.tests import Monkeypatcher, skipUnless
from south.modelsinspector import (convert_on_delete_handler, get_value,
IsDefault, models, value_clean)
from fakeapp.models import HorribleModel, get_sentinel_object
on_delete_is_available = hasattr(models, "PROTECT") # models here is django.db.models
skipUnles... | apache-2.0 |
slayerjain/servo | tests/wpt/web-platform-tests/old-tests/webdriver/command_contexts/window_handle_test.py | 141 | 1067 | import os
import sys
import random
import unittest
sys.path.insert(1, os.path.abspath(os.path.join(__file__, "../..")))
import base_test
repo_root = os.path.abspath(os.path.join(__file__, "../../.."))
sys.path.insert(1, os.path.join(repo_root, "tools", "webdriver"))
from webdriver import exceptions
class WindowHan... | mpl-2.0 |
patrick91/pycon | backend/notifications/aws.py | 1 | 2184 | import typing
from urllib.parse import urljoin
import boto3
from django.conf import settings
from newsletters.exporter import Endpoint
from users.models import User
def _get_client():
return boto3.client("pinpoint", region_name="eu-central-1")
def chunks(l, n):
for i in range(0, len(l), n):
yield l... | mit |
vicky2135/lucious | src/oscar/apps/payment/abstract_models.py | 5 | 11373 | from decimal import Decimal
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from oscar.core.compat import AUTH_USER_MODEL
from oscar.core.utils import get_default_currency
from oscar.models.fields import AutoSlugField
f... | bsd-3-clause |
tonk/ansible | test/support/integration/plugins/modules/selinux.py | 60 | 8292 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Derek Carter<goozbach@friocorte.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_v... | gpl-3.0 |
crafty78/ansible | lib/ansible/modules/monitoring/zabbix_hostmacro.py | 13 | 9010 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013-2014, Epic Games, 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
# (... | gpl-3.0 |
jasongwartz/RataTAT-Tkinter | RataTAT/jglogging.py | 2 | 2252 | #! /usr/bin/python
### CURRENT STATUS AND LOGGER
import csv, time, datetime
import datetime as dt
# DAILYDATA CSV FUNCTIONS
# Creates the blank template of the current status log - only needed for debugging
def create_log():
with open("log.csv", "w+") as blank:
topline = [str(dt.date.today()), 1]
header = ["Ba... | mit |
samfoo/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treewalkers/genshistream.py | 1730 | 2278 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... | mpl-2.0 |
jammerful/buildbot | master/buildbot/db/migrate/versions/044_add_step_hidden.py | 11 | 1119 | # This file is part of Buildbot. Buildbot 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, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even... | gpl-2.0 |
gandrewstone/bitcoinxt | qa/rpc-tests/mempool_resurrect_test.py | 133 | 3412 | #!/usr/bin/env python2
# Copyright (c) 2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework.test... | mit |
jcushman/pywb | pywb/rewrite/cookie_rewriter.py | 1 | 4929 | from Cookie import SimpleCookie, CookieError
#=================================================================
class WbUrlBaseCookieRewriter(object):
""" Base Cookie rewriter for wburl-based requests.
"""
def __init__(self, url_rewriter):
self.url_rewriter = url_rewriter
def rewrite(self, co... | gpl-3.0 |
talkincode/btform | btform/net.py | 11 | 4922 | #!/usr/bin/env python
#coding:utf-8
__all__ = [
"validipaddr", "validipport", "validip", "validaddr",
"urlquote",
"httpdate", "parsehttpdate",
"htmlquote", "htmlunquote", "websafe",
]
import urllib, time
try: import datetime
except ImportError: pass
def validipaddr(address):
"""
Returns True if `add... | mit |
EDUlib/edx-platform | lms/djangoapps/grades/migrations/0018_add_waffle_flag_defaults.py | 5 | 1177 | from django.db import migrations
from lms.djangoapps.grades.config.waffle import (
ENFORCE_FREEZE_GRADE_AFTER_COURSE_END,
REJECTED_EXAM_OVERRIDES_GRADE,
WRITABLE_GRADEBOOK,
waffle_flags,
)
def create_flag(apps, schema_editor):
Flag = apps.get_model('waffle', 'Flag')
# Replacement for flag_und... | agpl-3.0 |
hiteshwadekar/ns-3-dev-ndnSIM | bindings/python/rad_util.py | 212 | 26013 | # Copyright (c) 2007 RADLogic
#
# 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, distribut... | gpl-2.0 |
ibmsoe/tensorflow | tensorflow/contrib/linalg/python/kernel_tests/linear_operator_diag_test.py | 35 | 6264 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
chaffra/sympy | sympy/ntheory/tests/test_egyptian_fraction.py | 51 | 1886 | from sympy.core.numbers import Rational
from sympy.ntheory.egyptian_fraction import egyptian_fraction
from sympy.core.add import Add
from sympy.utilities.pytest import raises
from sympy.utilities.randtest import random_complex_number
def test_egyptian_fraction():
def test_equality(r, alg="Greedy"):
return... | bsd-3-clause |
Technux/linux | 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 |
storm-computers/odoo | addons/point_of_sale/wizard/pos_box.py | 18 | 2207 |
from openerp.osv import osv
from openerp.tools.translate import _
from openerp.exceptions import UserError
from openerp.addons.account.wizard.pos_box import CashBox
class PosBox(CashBox):
_register = False
def run(self, cr, uid, ids, context=None):
if not context:
context = dict()
... | agpl-3.0 |
rsvip/Django | django/contrib/gis/gdal/prototypes/srs.py | 471 | 3513 | from ctypes import POINTER, c_char_p, c_int, c_void_p
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (
const_string_output, double_output, int_output, srs_output, string_output,
void_output,
)
# Shortcut generation for routines with known... | bsd-3-clause |
esi-mineset/spark | python/pyspark/mllib/feature.py | 52 | 25634 | #
# 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 us... | apache-2.0 |
frreiss/tensorflow-fred | tensorflow/python/ops/ragged/ragged_tensor_shape_test.py | 14 | 21695 | # Copyright 2018 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 |
eLBati/odoo | addons/l10n_fr/report/__init__.py | 424 | 1475 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.