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
tonnrueter/pymca_devel
PyMca/Object3D/Object3DPlugins/Object3DStack.py
1
24743
import os try: import OpenGL.GL as GL import OpenGL.GLU as GLU except ImportError: raise ImportError, "OpenGL must be installed to use these functionalities" import numpy try: from PyMca import spslut except: import spslut try: from PyMca.Object3D import Object3DFileDialogs from PyMca.Objec...
gpl-2.0
kennethgillen/ansible
lib/ansible/modules/files/fetch.py
29
3714
# this is a virtual module that is entirely implemented server side # 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 op...
gpl-3.0
djhaskin987/psutil
test/_sunos.py
45
1345
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Sun OS specific tests. These are implicitly run by test_psutil.py.""" import sys from test_psutil import sh, unittest import p...
bsd-3-clause
agraubert/agutil
agutil/parallel/src/dispatcher.py
1
2555
from .exceptions import _ParallelBackgroundException from .worker import ThreadWorker, ProcessWorker from itertools import zip_longest WORKERTYPE_THREAD = ThreadWorker WORKERTYPE_PROCESS = ProcessWorker class IterDispatcher: def __init__( self, func, *args, maximum=15, wor...
mit
noironetworks/nova
nova/tests/unit/virt/vmwareapi/test_ds_util_datastore_selection.py
42
7367
# # 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
roselleebarle04/django
tests/i18n/patterns/tests.py
256
14326
from __future__ import unicode_literals import os from django.core.exceptions import ImproperlyConfigured from django.core.urlresolvers import clear_url_caches, reverse, translate_url from django.http import HttpResponsePermanentRedirect from django.middleware.locale import LocaleMiddleware from django.template impor...
bsd-3-clause
ageron/tensorflow
tensorflow/python/kernel_tests/svd_op_test.py
5
14092
# 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
Theer108/invenio
invenio/modules/jsonalchemy/bases.py
17
1636
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 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 the # License, or (at your option) any later...
gpl-2.0
juliancantillo/royal-films
config/settings/local.py
1
1950
# -*- coding: utf-8 -*- ''' Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app ''' from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default...
mit
madengr/ham2mon
apps/cursesgui.py
2
20956
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Created on Sun Jul 5 17:16:22 2015 @author: madengr """ import locale locale.setlocale(locale.LC_ALL, '') import curses import time import numpy as np class SpectrumWindow(object): """Curses spectrum display window Args: screen (object): a curses sc...
gpl-3.0
idem2lyon/persomov
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ted.py
17
8529
from __future__ import unicode_literals import json import re from .subtitles import SubtitlesInfoExtractor from ..compat import ( compat_str, ) class TEDIE(SubtitlesInfoExtractor): _VALID_URL = r'''(?x) (?P<proto>https?://) (?P<type>www|embed)(?P<urlmain>\.ted\.com/ ( (...
gpl-3.0
mjjohnson/django-u2f
testproj/testproj/tests.py
1
8549
import json from django.test import TestCase, Client from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model, SESSION_KEY User = get_user_model() class U2FTest(TestCase): def setUp(self): self.client = Client() self.user = User.objects.create_superuser( ...
bsd-2-clause
grimoirelab/GrimoireELK
grimoire_elk/enriched/meetup.py
1
13379
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2019 Bitergia # # 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 ...
gpl-3.0
ver228/tierpsy-tracker
tierpsy/analysis/ske_create/zebrafishAnalysis/zebrafishAnalysis.py
1
17590
# Zebrafish Analysis import math import numpy as np import cv2 from scipy.signal import savgol_filter class ModelConfig: def __init__(self, num_segments, min_angle, max_angle, num_angles, tail_length, tail_detection, prune_retention, test_width, draw_width, auto_detect_tail_length): self.min_angle = m...
mit
andreaso/ansible
lib/ansible/module_utils/openstack.py
57
4600
# 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
EVERROCKET/mobile-data
googleapiclient/discovery_cache/file_cache.py
35
4028
# 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 ...
apache-2.0
DavidNorman/tensorflow
tensorflow/python/ops/parallel_for/gradients_test.py
9
27916
# 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
HackPartners/darwinpush
darwinpush/xb/raw/binding_.py
4
91665
# ./darwinpush/xb/raw/binding_.py # -*- coding: utf-8 -*- # PyXB bindings for NM:0b338ff90207234600b9b9432e9e9a2f47008914 # Generated 2015-04-23 16:42:14.515862 by PyXB version 1.2.4 using Python 3.4.1.final.0 # Namespace http://www.thalesgroup.com/rtti/XmlTimetable/v8 from __future__ import unicode_literals import py...
apache-2.0
cnexus/kernel_d2spr_tw_422
tools/perf/util/setup.py
4998
1330
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
flake123p/ProjectH
Python/Think01_swampy-2.1.5/Sync.py
2
24407
#!/usr/bin/python """This module is part of Swampy, a suite of programs available from allendowney.com/swampy. Copyright 2011 Allen B. Downey Distributed under the GNU General Public License at gnu.org/licenses/gpl.html. """ import optparse import os import copy import random import sys import string import time # ...
gpl-3.0
mavit/ansible
lib/ansible/modules/cloud/google/gce_lb.py
50
11807
#!/usr/bin/python # Copyright 2013 Google Inc. # 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
coxmediagroup/django-threadedcomments
legacy_threadedcomments/templatetags/threadedcommentstags.py
14
18507
import re from django import template from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from threadedcomments.models import ThreadedComment, FreeThreadedComment from thread...
bsd-3-clause
rysson/filmkodi
plugin.video.mrknow/mylib/xbmcplugin.py
4
7203
# coding: utf-8 """ Functions for Kodi plugins """ SORT_METHOD_ALBUM = 13 SORT_METHOD_ALBUM_IGNORE_THE = 14 SORT_METHOD_ARTIST = 11 SORT_METHOD_ARTIST_IGNORE_THE = 12 SORT_METHOD_BITRATE = 40 SORT_METHOD_CHANNEL = 38 SORT_METHOD_COUNTRY = 16 SORT_METHOD_DATE = 3 SORT_METHOD_DATEADDED = 19 SORT_METHOD_DATE_TAKEN = 41 S...
apache-2.0
breznak/nupic
examples/opf/experiments/multistep/hotgym_best_tp_16K/description.py
32
2789
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
nextgis/NextGIS_QGIS_open
tests/src/python/test_qgspallabeling_server.py
6
7614
# -*- coding: utf-8 -*- """QGIS unit tests for QgsPalLabeling: label rendering output via QGIS Server From build dir, run: ctest -R PyQgsPalLabelingServer -V See <qgis-src-dir>/tests/testdata/labeling/README.rst for description. .. note:: This program is free software; you can redistribute it and/or modify it under ...
gpl-2.0
TathagataChakraborti/resource-conflicts
PLANROB-2015/seq-sat-lama/Python-2.5.2/Tools/bgen/bgen/bgenHeapBuffer.py
44
4201
# Buffers allocated on the heap from bgenOutput import * from bgenType import OutputOnlyMixIn from bgenBuffer import FixedInputOutputBufferType class HeapInputOutputBufferType(FixedInputOutputBufferType): """Input-output buffer allocated on the heap -- passed as (inbuffer, outbuffer, size). Instantiate wit...
mit
ratschlab/ASP
applications/msplicer/content_sensors.py
1
2271
# # 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 # (at your option) any later version. # # Written (W) 2006-2007 Soeren Sonnenburg # Written (W) 2007 Gunna...
gpl-2.0
gnu-sandhi/gnuradio
gnuradio-core/src/python/gnuradio/gr/benchmark_filters.py
18
2663
#!/usr/bin/env python # # Copyright 2005,2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your ...
gpl-3.0
prarit/staging-next-unisys
scripts/checkkconfigsymbols.py
216
4661
#!/usr/bin/env python """Find Kconfig identifiers that are referenced but not defined.""" # (c) 2014 Valentin Rothberg <valentinrothberg@gmail.com> # (c) 2014 Stefan Hengelein <stefan.hengelein@fau.de> # # Licensed under the terms of the GNU GPL License version 2 import os import re from subprocess import Popen, PI...
gpl-2.0
bswartz/manila
manila/api/views/share_groups.py
2
3724
# Copyright 2015 Alex Meade # 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 ap...
apache-2.0
hsuantien/scikit-learn
sklearn/metrics/regression.py
23
16771
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
bsd-3-clause
dkodnik/arp
addons/sale_journal/__openerp__.py
119
2670
# -*- 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
sergei-maertens/django
tests/template_tests/syntax_tests/test_if_equal.py
368
9892
from django.test import SimpleTestCase from ..utils import setup class IfEqualTagTests(SimpleTestCase): @setup({'ifequal01': '{% ifequal a b %}yes{% endifequal %}'}) def test_ifequal01(self): output = self.engine.render_to_string('ifequal01', {'a': 1, 'b': 2}) self.assertEqual(output, '') ...
bsd-3-clause
kanagasabapathi/python-for-android
python3-alpha/python3-src/Lib/test/test_unicode.py
46
70367
""" Test script for the Unicode implementation. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. """#" import codecs import struct import sys import unittest import warnings from test import support, string_tests import _string # Error handling (bad decoder retu...
apache-2.0
Stackato-Apps/pinry
pinry/core/migrations/0001_initial.py
3
1615
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import taggit.managers class Migration(migrations.Migration): dependencies = [ ('taggit', '0002_auto_20150616_2121'), ('users', '__first__'), ('django_images', '__first__'), ] ...
bsd-2-clause
bravo-zhang/spark
examples/src/main/python/mllib/sampled_rdds.py
51
3224
# # 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
xinhunbie/NS3-
src/mesh/bindings/callbacks_list.py
16
2441
callback_classes = [ ['void', 'ns3::Mac48Address', 'ns3::Mac48Address', 'unsigned int', 'bool', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'unsigned int', 'ns3::Mac48Address', 'ns3::Mac48Address', 'ns3::dot11s::PeerLink::PeerState', 'ns3::dot11s::PeerLink::PeerState', 'ns3::...
gpl-2.0
swails/mdtraj
mdtraj/tests/test_lprmsd.py
9
3770
from __future__ import print_function import numpy as np import mdtraj as md from mdtraj.testing import eq, get_fn from mdtraj import Trajectory, lprmsd from mdtraj._lprmsd import _munkres from mdtraj.utils import rotation_matrix_from_quaternion, uniform_quaternion random = np.random.RandomState(0) def test_munkres_...
lgpl-2.1
MichaelNedzelsky/intellij-community
python/lib/Lib/site-packages/django/contrib/gis/utils/layermapping.py
157
27065
# LayerMapping -- A Django Model/OGR Layer Mapping Utility """ The LayerMapping class provides a way to map the contents of OGR vector files (e.g. SHP files) to Geographic-enabled Django models. For more information, please consult the GeoDjango documentation: http://geodjango.org/docs/layermapping.html """ impo...
apache-2.0
harmy/kbengine
kbe/res/scripts/common/Lib/sqlite3/__init__.py
7
1041
# pysqlite2/__init__.py: the pysqlite2 package. # # Copyright (C) 2005 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of this ...
lgpl-3.0
isyippee/nova
nova/tests/unit/scheduler/filters/test_core_filters.py
17
4514
# 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
skirsdeda/django
tests/validation/test_unique.py
62
7105
from __future__ import unicode_literals import datetime import unittest from django.apps.registry import Apps from django.core.exceptions import ValidationError from django.db import models from django.test import TestCase from .models import (CustomPKModel, UniqueTogetherModel, UniqueFieldsModel, UniqueForDateM...
bsd-3-clause
BIDXOM/buildroot
support/scripts/gen-manual-lists.py
77
20371
## gen-manual-lists.py ## ## This script generates the following Buildroot manual appendices: ## - the package tables (one for the target, the other for host tools); ## - the deprecated items. ## ## Author(s): ## - Samuel Martin <s.martin49@gmail.com> ## ## Copyright (C) 2013 Samuel Martin ## ## This program is free...
gpl-2.0
disqus/django-old
tests/regressiontests/admin_validation/tests.py
1
9982
from django import forms from django.core.exceptions import ImproperlyConfigured from django.test import TestCase from django.contrib import admin from django.contrib.admin.validation import validate, validate_inline from models import Song, Book, Album, TwoAlbumFKAndAnE, State, City class SongForm(forms.ModelForm):...
bsd-3-clause
rsimba/scrapy-rethinkdb
tests/test_pipeline.py
2
5360
import unittest from mock import Mock, MagicMock, patch from itertools import combinations_with_replacement from scrapy_rethinkdb.pipeline import RethinkDBPipeline, NotConfigured, Item class RethinkDBPipelineTest(unittest.TestCase): def setUp(self): # default pipeline under test self.driver = M...
apache-2.0
yunfeilu/scikit-learn
sklearn/decomposition/tests/test_sparse_pca.py
160
6028
# Author: Vlad Niculae # License: BSD 3 clause import sys import numpy as np from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import SkipTest from sklearn.utils.testing import ass...
bsd-3-clause
rickerc/horizon_audit
openstack_dashboard/dashboards/project/access_and_security/security_groups/tests.py
8
30188
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
apache-2.0
winklerand/pandas
pandas/tests/reshape/test_merge_ordered.py
2
2966
import pandas as pd from pandas import DataFrame, merge_ordered from pandas.util import testing as tm from pandas.util.testing import assert_frame_equal from numpy import nan class TestMergeOrdered(object): def setup_method(self, method): self.left = DataFrame({'key': ['a', 'c', 'e'], ...
bsd-3-clause
FlintHill/SUAS-Competition
env/lib/python3.7/distutils/__init__.py
4
3762
import imp import os import sys import warnings # opcode is not a virtualenv module, so we can use it to find the stdlib # Important! To work on pypy, this must be a module that resides in the # lib-python/modified-x.y.z directory import opcode dirname = os.path.dirname distutils_path = os.path.join(os.path.dirname(...
mit
jamiejackherer/pyFilm
pyfilm/GoogleScraper/database.py
2
9289
# -*- coding: utf-8 -*- """ The database schema of GoogleScraper. There are four entities: ScraperSearch: Represents a call to GoogleScraper. A search job. SearchEngineResultsPage: Represents a SERP result page of a search_engine Link: Represents a LINK on a SERP Proxy: Stores all proxies and their s...
mit
aestheticblasphemy/aestheticBlasphemy
pl_messages/migrations/0002_auto_20200828_2129.py
1
1972
# Generated by Django 3.1 on 2020-08-28 15:59 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('pl_messages', '0001_initia...
gpl-3.0
ZdenekM/ar-table-itable
art_instructions/src/art_instructions/brain/wait_for_user.py
6
1300
from art_instructions.brain import BrainFSM, BrainInstruction from transitions import State import rospy from art_msgs.msg import UserActivity class WaitForUser(BrainInstruction): pass class WaitForUserLearn(WaitForUser): pass class WaitForUserRun(WaitForUser): pass class WaitForUserFSM(BrainFSM): ...
lgpl-2.1
isvaldo/Ola_Bemobenses
tests/Selenium/environment/lib/python3.4/site-packages/pip/_vendor/requests/packages/urllib3/util/url.py
553
5836
from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] class Url(namedtuple('Url', url_attrs)): """ Datastructure for representing an HTTP URL. Used as a return value for :func:`parse_url`. """ s...
cc0-1.0
wileeam/airflow
tests/providers/amazon/aws/operators/test_gcs_to_s3.py
4
8632
# # 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
dmwyatt/disney.api
pages/timepicker.py
1
3504
import datetime import logging import os import time import re import webbrowser from dateutil import parser from selenium import webdriver from selenium.common.exceptions import WebDriverException, NoSuchElementException from selenium.webdriver.support.select import Select from helpers import roundTime, difference_...
mit
tangyiyong/odoo
addons/base_vat/base_vat.py
238
14207
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
tmenjo/cinder-2015.1.0
cinder/volume/drivers/ibm/xiv_ds8k.py
3
8912
# Copyright 2013 IBM Corp. # Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
apache-2.0
idea4bsd/idea4bsd
python/lib/Lib/xml/sax/handler.py
109
14076
""" This module contains the core classes of version 2.0 of SAX for Python. This file provides only default classes with absolutely minimum functionality, from which drivers and applications can be subclassed. Many of these classes are empty and are included only as documentation of the interfaces. $Id: handler.py,v ...
apache-2.0
junhuac/MQUIC
depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/boto/ec2/elb/healthcheck.py
185
3775
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software wi...
mit
jakesyl/fail2ban
fail2ban/protocol.py
1
9025
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation;...
gpl-2.0
matthiasdiener/spack
var/spack/repos/builtin/packages/r-rsolnp/package.py
5
1685
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
wrouesnel/ansible
lib/ansible/modules/network/panos/panos_nat_rule.py
6
16293
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016, techbizdev <techbizdev@paloaltonetworks.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 DOCUMENTATION = ''' --- module: panos_n...
gpl-3.0
cryptobanana/ansible
lib/ansible/modules/cloud/google/gcp_healthcheck.py
49
15554
#!/usr/bin/python # Copyright 2017 Google Inc. # 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
jiangzhixiao/odoo
openerp/report/render/makohtml2html/__init__.py
381
1084
# -*- 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 GNU...
agpl-3.0
ianmabie/uberpy
venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py
374
4053
import calendar import time from email.utils import formatdate, parsedate, parsedate_tz from datetime import datetime, timedelta TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT" def expire_after(delta, date=None): date = date or datetime.now() return date + delta def datetime_to_header(dt): return formatdate(c...
mit
aravindalwan/unyque
unyque/rdimension.py
1
3726
'''Representation of a random variable used in stochastic collocation''' __copyright__ = 'Copyright (C) 2011 Aravind Alwan' __license__ = ''' This file is part of UnyQuE. UnyQuE 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 Softw...
gpl-3.0
trunca/enigma2
lib/python/Components/Renderer/Watchew.py
15
2831
## Now FTA-render ;) import math from Renderer import Renderer from skin import parseColor from enigma import eCanvas, eSize, gRGB, eRect from Components.VariableText import VariableText from Components.config import config class Watchew(Renderer): def __init__(self): Renderer.__init__(self) ...
gpl-2.0
lodemo/CATANA
src/face_recognition/youtube_dl/postprocessor/embedthumbnail.py
41
3499
# coding: utf-8 from __future__ import unicode_literals import os import subprocess from .ffmpeg import FFmpegPostProcessor from ..utils import ( check_executable, encodeArgument, encodeFilename, PostProcessingError, prepend_extension, shell_quote ) class EmbedThumbnailPPError(PostProcessi...
mit
debugger22/sympy
sympy/physics/quantum/operatorordering.py
98
11547
"""Functions for reordering operator expressions.""" import warnings from sympy import Add, Mul, Pow, Integer from sympy.core.compatibility import range from sympy.physics.quantum import Operator, Commutator, AntiCommutator from sympy.physics.quantum.boson import BosonOp from sympy.physics.quantum.fermion import Ferm...
bsd-3-clause
gaddman/ansible
lib/ansible/modules/network/f5/bigiq_regkey_pool.py
3
12432
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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
nomadcube/scikit-learn
examples/bicluster/plot_spectral_coclustering.py
276
1736
""" ============================================== A demo of the Spectral Co-Clustering algorithm ============================================== This example demonstrates how to generate a dataset and bicluster it using the the Spectral Co-Clustering algorithm. The dataset is generated using the ``make_biclusters`` f...
bsd-3-clause
chrisspen/dtree
dtree.py
1
68634
""" 2012.1.24 CKS Algorithms for building and using a decision tree for classification or regression. """ from __future__ import print_function from collections import defaultdict from decimal import Decimal from pprint import pprint import copy import csv import math from math import pi import os import random import...
lgpl-3.0
endlessm/chromium-browser
native_client/pnacl/driver/pnacl-readelf.py
2
3751
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function from driver_env import env from driver_log import Log import driver_tools import filetype ...
bsd-3-clause
kreatorkodi/repository.torrentbr
script.module.urlresolver/lib/urlresolver/plugins/lib/recaptcha_v2.py
1
7299
# -*- coding: utf-8 -*- """ urlresolver XBMC Addon Copyright (C) 2016 tknorris Derived from Shani's LPro Code (https://github.com/Shani-08/ShaniXBMCWork2/blob/master/plugin.video.live.streamspro/unCaptcha.py) This program is free software: you can redistribute it and/or modify it under the terms of...
gpl-2.0
histed/pylibnidaqmxMH
nidaqmx/optparse_options.py
16
8570
import os from optparse import OptionGroup def get_method_arguments(methodname, options, kws=None): args = [] if kws is None: kws = {} for name in dir (options): value = getattr (options, name) if name.startswith(methodname) and value is not None: kws[name[len(methodnam...
bsd-3-clause
compbrain/dexcom_reader
dexcom_reader/database_records.py
2
6109
import crc16 import constants import struct import util import binascii class BaseDatabaseRecord(object): FORMAT = None @classmethod def _CheckFormat(cls): if cls.FORMAT is None or not cls.FORMAT: raise NotImplementedError("Subclasses of %s need to define FORMAT" % cls...
mit
nixcloud/linux-odroid
tools/perf/scripts/python/futex-contention.py
1997
1508
# 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
MA3STR0/python-instagram
instagram/client.py
33
8778
from . import oauth2 from .bind import bind_method from .models import MediaShortcode, Media, User, Location, Tag, Comment, Relationship MEDIA_ACCEPT_PARAMETERS = ["count", "max_id"] SEARCH_ACCEPT_PARAMETERS = ["q", "count"] SUPPORTED_FORMATS = ['json'] class InstagramAPI(oauth2.OAuth2API): host = "api.instagr...
bsd-3-clause
mandiant/ioc_writer
ioc_writer/scripts/iocdump.py
1
2104
# iocdump.py # # Copyright 2016 FireEye # Licensed under the Apache 2.0 license. Developed for Mandiant by William # Gibb. # # Mandiant licenses this file to you 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 Lic...
apache-2.0
ingenioustechie/zamboni
mkt/zadmin/forms.py
19
4020
from django import forms from django.conf import settings import commonware.log import happyforms LOGGER_NAME = 'z.zadmin' log = commonware.log.getLogger(LOGGER_NAME) class DevMailerForm(happyforms.Form): _choices = [('apps', 'Developers of active apps (not add-ons)'), ('free_apps_region_enable...
bsd-3-clause
kidaa/pySDC
examples/fenics_advection_diffusion_1d/TransferClass.py
3
2365
from __future__ import division from pySDC.Transfer import transfer from pySDC.datatype_classes.fenics_mesh import fenics_mesh,rhs_fenics_mesh import dolfin as df class mesh_to_mesh_fenics(transfer): """ Custon transfer class, implements Transfer.py This implementation can restrict and prolong between f...
bsd-2-clause
adamkh/micropython
tests/wipy/time.py
67
2937
import time DAYS_PER_MONTH = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def is_leap(year): return (year % 4) == 0 def test(): seconds = 0 wday = 5 # Jan 1, 2000 was a Saturday for year in range(2000, 2049): print("Testing %d" % year) yday = 1 for month in range(1, ...
mit
txomon/pytest
testing/python/collect.py
1
53514
# -*- coding: utf-8 -*- import os import sys import textwrap import _pytest._code import pytest from _pytest.main import EXIT_NOTESTSCOLLECTED from _pytest.nodes import Collector from _pytest.warnings import SHOW_PYTEST_WARNINGS_ARG class TestModule(object): def test_failing_import(self, testdir): modcol...
mit
nhomar/odoo-mirror
addons/base_report_designer/plugin/openerp_report_designer/bin/script/About.py
293
3815
######################################################################### # # 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 Gene...
agpl-3.0
axbaretto/beam
sdks/python/apache_beam/io/gcp/datastore/v1/datastoreio_test.py
1
12457
# # 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
garbled1/ansible
lib/ansible/modules/network/nxos/nxos_vxlan_vtep_vni.py
22
12128
#!/usr/bin/python # # 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 distribut...
gpl-3.0
tayebzaidi/snova_analysis
Miscellaneous/typ1a_features.py
1
2252
import matplotlib.pyplot as plt import scipy.interpolate as scinterp import numpy as np import peakfinding import peak_original import smoothing import plotter import random import readin import sys import os if __name__== '__main__': Mbdata = [] delM15data = [] path = "/Users/zaidi/Documents/REU/restframe...
gpl-3.0
jwren/intellij-community
python/python-features-trainer/resources/learnProjects/python/PyCharmLearningProject/src/warehouse/warehouse.py
9
1037
from util.util import FRUITS class Warehouse: # Fruit name to amount of it in warehouse entry = {} # Apple, banana, etc... def __init__(self) -> None: for fruit in FRUITS: self.entry[fruit] = 0 # fruit name from util.FRUITS (mango, apple...) def add_fruits(self, fruit_name, ...
apache-2.0
hackers-terabit/portage
bin/check-implicit-pointer-usage.py
6
2942
#!/usr/bin/python -b # Ripped from HP and updated from Debian # Update by Gentoo to support unicode output # # Copyright (c) 2004 Hewlett-Packard Development Company, L.P. # David Mosberger <davidm@hpl.hp.com> # # Scan standard input for GCC warning messages that are likely to # source of real 64-bit problems. In pa...
gpl-2.0
DREAM-ODA-OS/tools
metadata/dimap2eop.py
1
3474
#!/usr/bin/env python #------------------------------------------------------------------------------ # # Extract O&M-EOP metadata document. # # Project: EO Metadata Handling # Authors: Martin Paces <martin.paces@eox.at> # #------------------------------------------------------------------------------- # Copyright (C...
mit
jhawkesworth/ansible
lib/ansible/modules/cloud/univention/udm_user.py
37
18102
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright: (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # 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...
gpl-3.0
jalexvig/tensorflow
tensorflow/python/kernel_tests/matrix_inverse_op_test.py
43
7575
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
billbrod/spatial-frequency-preferences
sfp/image_computable.py
1
6815
#!/usr/bin/python """code to help run the image-computable version of the model we're using this primarily to check the effect of vignetting, but this does make our project image-computable (though it's a linear model and so will fail in some trivial cases) """ import itertools import argparse import numpy as np impo...
mit
ritchyteam/odoo
addons/point_of_sale/wizard/pos_confirm.py
343
2403
# -*- 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
Bysmyyr/chromium-crosswalk
content/test/gpu/gpu_tests/gpu_test_base.py
19
6203
# 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 logging from telemetry import benchmark as benchmark_module from telemetry.page import page as page_module from telemetry.page import page_test from ...
bsd-3-clause
GoogleCloudPlatform/python-compat-runtime
appengine-compat/exported_appengine_sdk/google/appengine/ext/mapreduce/api/map_job/map_job_control.py
10
7129
#!/usr/bin/env python # # Copyright 2007 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 o...
apache-2.0
msabramo/kallithea
kallithea/lib/dbmigrate/versions/010_version_1_5_2.py
2
1491
import logging from sqlalchemy import * from kallithea.lib.dbmigrate.migrate import * from kallithea.lib.dbmigrate.migrate.changeset import * from kallithea.model import meta from kallithea.lib.dbmigrate.versions import _reset_base, notify log = logging.getLogger(__name__) def upgrade(migrate_engine): """ ...
gpl-3.0
flyfei/python-for-android
python-build/python-libs/gdata/build/lib/gdata/spreadsheet/__init__.py
147
17942
#!/usr/bin/python # # Copyright (C) 2007 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 ...
apache-2.0
ProjectQ-Framework/ProjectQ
projectq/meta/_loop.py
1
9774
# -*- coding: utf-8 -*- # Copyright 2017 ProjectQ-Framework (www.projectq.ch) # # 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
Zsailer/epistasis
epistasis/models/nonlinear/minimizer.py
2
3564
import inspect import lmfit from lmfit import Parameter, Parameters from abc import ABC, abstractmethod # ---------------------- Abstract Minimizer class ------------------------- class Minimizer(ABC): """Abstract Base Class for function minimizers. Wraps a function. Fits data using the function. Then, that...
unlicense