repo_name stringlengths 5 104 | path stringlengths 4 248 | content stringlengths 102 99.9k |
|---|---|---|
SOM-st/PySOM | tests/jit.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Test.
#
import py
from rpython import conftest # pylint: disable=import-error
from rpython.jit.metainterp.test.test_ajit import LLJitMixin # pylint: disable=E
from som.vm.current import current_universe
from som.vm.symbols import symbol_for
from som.vm.universe impor... |
0vercl0k/rp | src/third_party/beaengine/tests/0f3a4a.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 progra... |
dpaiton/OpenPV | projects/LIFLCA/python/basic_test.py | ###############################
## LCA ANALYSIS
## Dylan Paiton
## Will Shainin
##
## TODO:
## Sparse Layers
## - Percent Active
## - Percent Change?
## - Activity Histogram
## Non-Sparse Layers
## - Recon/Input Images
## - Error
## Weight File
## - Plot Weights
##
###############################
... |
Southpaw-TACTIC/TACTIC | src/pyasm/prod/service/base_sthpw_wdg.py | ###########################################################
#
# Copyright (c) 2005, Southpaw Technology
# All Rights Reserved
#
# PROPRIETARY INFORMATION. This software is proprietary to
# Southpaw Technology, and is not to be reproduced, transmitted,
# or disclosed in any way without written permi... |
saisai/guake | src/guake/terminal3.py | """
Copyright (C) 2009-2011 Lincoln de Sousa <lincoln@guake.org>
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.
This program... |
gramps-project/addons-source | RebuildTypes/RebuildTypes.py | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2013 Nick Hall
#
# 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)... |
domino-team/openwrt-cc | package/gli-pub/openwrt-node-packages-master/node/node-v6.9.1/deps/v8_inspector/third_party/markupsafe/markupsafe/tests.py | # -*- coding: utf-8 -*-
import gc
import sys
import unittest
from markupsafe import Markup, escape, escape_silent
from markupsafe._compat import text_type, PY2
class MarkupTestCase(unittest.TestCase):
def test_adding(self):
# adding two strings should escape the unsafe one
unsafe = '<script type=... |
mitya57/debian-buildbot | buildbot/test/unit/test_sourcestamp.py | # 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 eve... |
vsilent/Vision | migrations/versions/4b6647d0a365_.py | """empty message
Revision ID: 4b6647d0a365
Revises: 3988ab56982f
Create Date: 2016-07-01 18:15:00.553566
"""
# revision identifiers, used by Alembic.
revision = '4b6647d0a365'
down_revision = '3988ab56982f'
from sqlalchemy.sql import table, column
from sqlalchemy import String, Integer, Boolean, DateTime, Date
from ... |
evgen-dev/repository.evgen_dev.xbmc-addons | source/plugin.video.filmix.net.dev/core/context.py | # -*- coding: utf-8 -*-
import os, re, sys, json, urllib, hashlib, traceback
import xbmcup.app, xbmcup.db, xbmcup.system, xbmcup.net, xbmcup.parser, xbmcup.gui
import xbmc, cover, xbmcplugin, xbmcgui
from http import HttpData
from auth import Auth
from wmodal import MovieInfo
from common import Render
from defines imp... |
legacysurvey/pipeline | bin/build-cluster-catalog.py | #!/usr/bin/env python
"""Build and write out the NGC-star-clusters.fits catalog.
"""
import os
import numpy as np
import numpy.ma as ma
from astropy.io import ascii
from astropy.table import Table, vstack
from astrometry.util.starutil_numpy import hmsstring2ra, dmsstring2dec
from astrometry.libkd.spherematch import m... |
nirvn/QGIS | python/plugins/processing/algs/qgis/Datasources2Vrt.py | # -*- coding: utf-8 -*-
"""
***************************************************************************
__init__.py
---------------------
Date : May 2015
Copyright : (C) 2015 by Luigi Pirelli
Email : luipir at gmail dot com
*********************************... |
rbbratta/virt-test | tests/iozone_windows.py | import logging, os
from autotest.client import utils
from virttest import postprocess_iozone
from virttest import utils_misc
def run_iozone_windows(test, params, env):
"""
Run IOzone for windows on a windows guest:
1) Log into a guest
2) Execute the IOzone test contained in the winutils.iso
3) Get... |
dinnozap/hebel | hebel/models/neural_net_regression.py | # Copyright (C) 2013 Hannes Bretschneider
# 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.
# This program is distribut... |
SIFTeam/enigma2 | lib/python/SIFTeam/Preferences.py | from Screens.Screen import Screen
from Plugins.Plugin import PluginDescriptor
from Components.SystemInfo import SystemInfo
from Components.ConfigList import ConfigListScreen
from Components.config import getConfigListEntry, config, ConfigBoolean
from Components.ActionMap import ActionMap
from Components.Button import B... |
jsilhan/dnf-plugins-extras | tests/test_rpmconf.py | # Copyright (C) 2016 Maxim Prokhorov
#
# 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 ... |
tardyp/buildbot | master/buildbot/process/factory.py | # 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 eve... |
isslayne/enigma2 | lib/python/Components/FileList.py | import os
import re
from MenuList import MenuList
from Components.Harddisk import harddiskmanager
from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename, fileExists
from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, \
eServiceReference, eServiceCenter, gFont
from Tools.LoadPixmap import LoadPixm... |
dilawar/moogli | moogli/visualization/pipeline/producer.py | from .main import PipelineElement
from .data import SimulationData
class Producer(PipelineElement):
def __init__(self):
PipelineElement.__init__(self)
self.output = None
def connect(self, mediator):
self._sink(mediator)
def disconnect(self, mediator=None):
if mediator is... |
davidmalcolm/gcc-python-plugin | tests/plugin/diagnostics/script.py | # Copyright 2011 David Malcolm <dmalcolm@redhat.com>
# Copyright 2011 Red Hat, Inc.
#
# This 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) a... |
163gal/Time-Line | specs/WxEndToEnd.py | # Copyright (C) 2009, 2010, 2011 Rickard Lindberg, Roger Lindberg
#
# This file is part of Timeline.
#
# Timeline 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... |
nijel/weblate | weblate/trans/models/comment.py | #
# Copyright © 2012–2022 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <https://weblate.org/>
#
# 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 Licens... |
barnone/EigenD | tools/packages/SCons/compat/_scons_hashlib.py | #
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 limitati... |
realsobek/freeipa | ipatests/test_ipalib/test_errors.py | # Authors:
# Jason Gerard DeRose <jderose@redhat.com>
#
# Copyright (C) 2008 Red Hat
# see file 'COPYING' for use and warranty information
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, ei... |
eufarn7sp/egads | egads/thirdparty/nappy/contrib/aircraft/scanFAAM.py | #!/usr/bin/env python
"""
scanFAAM.py
===========
Holds the scanFAAM function that is used to work out the first and last
index of real data (i.e. non-missing data in a load of FAAM flight data).
It is used in conjunction with nappy to reduce the size of output files
by missing out beginning and end periods that hold... |
ccc-ffm/christian | christian.py | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
# twisted.words.protocols.irc not ported to python 3 yet m(
#USAGE: ./christian.py Channel
from time import sleep
#twisted imports
from twisted.internet import reactor, protocol, ssl, endpoints, task
from twisted.application.internet import ClientService
from twisted.na... |
SickGear/SickGear | sickbeard/clients/deluge.py | # coding=utf-8
#
# This file is part of SickGear.
#
# Original author: Mr_Orange <mr_orange@hotmail.it>
#
# SickGear 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 yo... |
mscuthbert/abjad | abjad/tools/test/test_abjad___format__.py | # -*- encoding: utf-8 -*-
import inspect
import pytest
import abjad
from abjad.tools import abjadbooktools
from abjad.tools import documentationtools
from abjad.tools import metertools
from abjad.tools import tonalanalysistools
ignored_classes = (
abjadbooktools.CodeBlock,
abjadbooktools.CodeOutputProxy,
... |
radifar/pyplif | pyplif/pyplif.py | #!/usr/bin/env python
import getopt, sys, os, copy, glob
from openbabel import OBMol, OBConversion
from optparse import OptionParser
from time import time
from tanimoto_coef import *
from ring import *
from interactions import *
if __name__ == "__main__":
x = time()
# Default configuration
config = "config... |
kosgroup/odoo | addons/purchase_requisition/models/purchase_requisition.py | # -*- encoding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
import odoo.addons.decimal_precision as dp
from odoo.exceptions import UserError
class PurchaseRequisitionType(models.Model):
_name = "purchase.requisition.type"
_descr... |
amazinger2013/OpenSesame | libqtopensesame/misc/__init__.py | #-*- coding:utf-8 -*-
"""
This file is part of OpenSesame.
OpenSesame 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.
OpenSesame is distri... |
CrushAndRun/Cloudbot-Tarball | plugins/youtube.py | import re
import time
import isodate
import requests
from cloudbot import hook
from cloudbot.util import timeformat
from cloudbot.util.formatting import pluralize
youtube_re = re.compile(r'(?:youtube.*?(?:v=|/v/)|youtu\.be/|yooouuutuuube.*?id=)([-_a-zA-Z0-9]+)', re.I)
base_url = 'https://www.googleapis.com/youtube... |
gedakc/manuskript | manuskript/ui/editors/locker_ui.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'manuskript/ui/editors/locker_ui.ui'
#
# Created: Tue Jul 7 17:57:16 2015
# by: PyQt5 UI code generator 5.2.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_locker(object):... |
waltervh/BornAgain | Doc/UserManual/fig/ff2/sim_Box.py | """
Plot form factors.
"""
import bornagain as ba
from bornagain import nanometer, degree
import bornplot as bp
det = bp.Detector(200, 0, 5, 0, 5)
n = 4
results = []
for i in range(n):
omega = 90*i/(n-1)
title = r'$\omega=%d^\circ$' % omega
ff = ba.FormFactorBox(18*nanometer, 4.6*nanometer, 3*nanometer)
... |
boland1992/SeisSuite | bin/03_dispersion_curves.py | #!/usr/bin/python -u
"""
[Advice: run this script using python with unbuffered output:
`python -u dispersion_curves.py`]
This script implements the two-step frequency-time analysis
(FTAN) on a set of cross-correlations, as described by Levshin &
Ritzwoller, "Automated detection, extraction, and measurement
of regional... |
davidmalcolm/gcc-python-plugin | generate-tables-of-passes-rst.py | # Copyright 2011 David Malcolm <dmalcolm@redhat.com>
# Copyright 2011 Red Hat, Inc.
#
# This 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) a... |
MediffRobotics/DeepRobotics | DeepLearnMaterials/DDPG/gym_torcs/gym_torcs.py | import gym
from gym import spaces
import numpy as np
# from os import path
import snakeoil3_gym as snakeoil3
import numpy as np
import copy
import collections as col
import os
import time
class TorcsEnv:
terminal_judge_start = 100 # If after 100 timestep still no progress, terminated
termination_limit_progre... |
vineodd/PIMSim | GEM5Simulation/gem5/configs/example/ruby_gpu_random_test.py | # Copyright (c) 2010-2015 Advanced Micro Devices, Inc.
# All rights reserved.
#
# For use for simulation and test purposes only
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must ... |
AmazingCow-Game/Game_Taz | src/splash_scene.py | # coding=utf8
##----------------------------------------------------------------------------##
## █ █ ##
## ████████ ##
## ██ ██ ... |
jelly/calibre | src/calibre/ebooks/hyphenate.py | """ Hyphenation, using Frank Liang's algorithm.
This module provides a single function to hyphenate words. hyphenate_word takes
a string (the word), and returns a list of parts that can be separated by hyphens.
>>> hyphenate_word("hyphenation")
['hy', 'phen', 'ation']
>>> hyphenate_word("supercal... |
andyofmelbourne/crappy-crystals | gui/h5-viewer/make_test_h5.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import h5py
import numpy as np
print('writing to test.h5...')
f = h5py.File('test.h5')
a3d = np.random.random((10,256,256))
a2d = np.random.rand... |
jbenden/ansible | lib/ansible/module_utils/aci.py | # -*- coding: utf-8 -*-
# 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 lic... |
samsath/cpcc_backend | src/website/enquiry/migrations/0004_auto_20170618_2138.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-06-18 21:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('enquiry', '0003_auto_20170618_2137'),
]
operations = [
migrations.RenameField(
... |
Thetoxicarcade/ac | congredi/crypto/vote/vote.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
compute a vote
"""
from __future__ import absolute_import
from __future__ import unicode_literals
from abc import ABCMeta, abstractmethod
import logging
import six
logger = logging.getLogger('congredi')
"""
Design - each of these classes could simply be an inferface or... |
TNT-Samuel/Coding-Projects | DNS Server/Source/Lib/site-packages/dask/dataframe/io/tests/test_parquet.py | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
import dask
import dask.multiprocessing
import dask.dataframe as dd
f... |
zak-k/cis | cis/test/unit/colocate/test_general_gridded_col.py | import unittest
import datetime
from hamcrest import *
import numpy
from cis.exceptions import UserPrintableException
from cis.data_io.gridded_data import GriddedDataList
from cis.data_io.ungridded_data import UngriddedDataList
from cis.collocation.col_implementations import GeneralGriddedCollocator, mean, CubeCellCo... |
fbalak/usmqe-tests | usmqe_tests/web/others/test_import_cluster.py | """
Description: Simple import cluster tests
Author: ltrilety
"""
import pytest
from usmqe.web.tendrl import cluster_work
@pytest.mark.skipif(pytest.config.getini('skip_invalid'),
reason='not valid for ci testing')
@pytest.mark.other
def test_initial_import_cluster(valid_credentials):
"""
... |
garbas/mozilla-releng-services | src/shipit_signoff/tests/test_util.py | # -*- coding: utf-8 -*-
import pytest
from shipit_signoff.util import is_key_present_in_list_of_dicts
@pytest.mark.parametrize('key, list_of_dicts', (
('a_key', [{'a_key': 'a_value'}]),
('a_key', [{'other_key': 'other_value'}, {'a_key': 'some_other_value'}]),
('a_key', [{'other_key': 'other_value'}, {'a_... |
Star2Billing/newfies-dialer | newfies/survey/function_def.py | #
# Newfies-Dialer License
# http://www.newfies-dialer.org
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright (C) 2011-2015 Star2Billing S.L.
#
# The primar... |
glenn124f/treeherder | treeherder/perf/migrations/0019_performancealert_classifier.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('perf', '0018_merge'),
]
operatio... |
KaiRo-at/socorro | socorro/unittest/processor/test_hybrid_processor.py | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import copy
import mock
from nose.tools import eq_, ok_
from datetime import datetime
from configman.dotdict import D... |
pbougue/navitia | source/jormungandr/jormungandr/parking_space_availability/bss/tests/atos_test.py | # encoding: utf-8
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility ... |
jmankiewicz/odooAddons | sale_order_extended/__init__.py | # -*- coding: utf-8 -*-
#
#
# Copyright (c) 2010-2012 Elico Corp. All Rights Reserved.
# Author: Andy Lu <andy.lu@elico-corp.com>
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the te... |
aaronkaplan/intelmq-old | intelmq/lib/utils.py | import logging
import hashlib
def decode(text, encodings=["utf-8", "ISO-8859-15"], force=False):
for encoding in encodings:
try:
return text.decode(encoding)
except ValueError as e:
pass
if force:
for encoding in encodings:
try:
... |
dsnopek/anki-sync-server | tests/test_importer.py |
import os
import shutil
import tempfile
import unittest
import mock
from mock import MagicMock, sentinel
import AnkiServer
from AnkiServer.importer import get_importer_class, import_file
import anki.storage
# TODO: refactor into some kind of utility
def add_note(col, data):
from anki.notes import Note
mod... |
petrjasek/superdesk-core | apps/archive/ingest.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from superde... |
brain-tec/server-tools | base_name_search_improved/tests/test_name_search.py | # Copyright 2016 Daniel Reis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.tests.common import TransactionCase, at_install, post_install
@at_install(False)
@post_install(True)
class NameSearchCase(TransactionCase):
def setUp(self):
super(NameSearchCase, self).setUp()
... |
brain-tec/server-tools | base_view_inheritance_extension/models/ir_ui_view.py | # Copyright 2016 Therp BV <https://therp.nl>
# Copyright 2018 Tecnativa - Sergio Teruel
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from lxml import etree
from odoo import api, models, tools
from odoo.tools.safe_eval import safe_eval
class UnquoteObject(str):
def __getattr__(self, name):
... |
iulian787/spack | lib/spack/spack/build_environment.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""
This module contains all routines related to setting up the package
build environment. All of this is set up by packa... |
pvagner/orca | src/orca/liveregions.py | import bisect
import copy
import pyatspi
import time
from gi.repository import GLib
from . import cmdnames
from . import chnames
from . import keybindings
from . import messages
from . import input_event
from . import orca_state
from . import settings_manager
_settingsManager = settings_manager.getManager()
# define... |
jbaber/bup | cmd/drecurse-cmd.py | #!/usr/bin/env python
from os.path import relpath
from bup import options, drecurse
from bup.helpers import *
optspec = """
bup drecurse <path>
--
x,xdev,one-file-system don't cross filesystem boundaries
exclude= a path to exclude from the backup (can be used more than once)
exclude-from= a file that contains exclu... |
Tendrl/node_agent | tendrl/integrations/gluster/alerts/__init__.py | from tendrl.node_agent.alert import constants
def update_alert_count(alert):
if alert.resource in NS.integrations.gluster.objects.VolumeAlertCounters(
)._defs['relationship'][alert.alert_type.lower()]:
volume = find_volume_with_name(
alert.tags['volume_name'],
alert.tag... |
CSB-at-ZIB/BioPARKIN | src/basics/helpers/sbmlhelpers.py | """
Created on Jun 7, 2010
@author: Moritz Wade
"""
import logging
def findSbmlEntity(id, sbmlMainModel):
"""
Tries to find a SBML entity given a SBMLMainModel
and an ID.
@param id: ID to search for
@type id: str
@param sbmlMainModel: A BioParkin SBMLMainModel
@type sbmlMainModel: SBMLMa... |
aitzkora/txerritegi | python/urwid/button1.py | import urwid
def on_ask_change(edit, new_edit_text):
reply.set_text(('I say', u"Nice to meet you, %s" % new_edit_text))
def on_exit_clicked(button):
raise urwid.ExitMainLoop()
if __name__ == '__main__':
palette = [('I say', 'default, bold', 'default', 'bold')]
ask = urwid.Edit(('I say', u"What is ... |
master-zhuang/SearchMax | toolbox/sphinxapi.py | #
# $Id$
#
# Python version of Sphinx searchd client (Python API)
#
# Copyright (c) 2006, Mike Osadnik
# Copyright (c) 2006-2011, Andrew Aksyonoff
# Copyright (c) 2008-2011, Sphinx Technologies Inc
# All rights reserved
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the... |
Zsailer/epistasis | epistasis/mapping.py | # Mapping Object for epistatic interactions int the epistasis map
#
# Author: Zach Sailer
#
# ----------------------------------------------------------
# Outside imports
# ----------------------------------------------------------
import json
import itertools as it
from functools import wraps
from collections import ... |
mrknow/filmkodi | plugin.video.xbmcfilm/resources/lib/mrknow_Parser.py | # -*- coding: utf-8 -*-
import re, sys, os, cgi
import urllib, urllib2
scriptID = sys.modules[ "__main__" ].scriptID
scriptname = "mrknow Polish films online"
class mrknow_Parser:
def __init__(self):
pass
def getParam(self, params, name):
try:
result = params[name]
... |
geekyJock8/Online-Pharmacy | online_pharmacy/items/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-25 14:20
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='item',... |
dougbenjamin/panda-harvester | pandaharvester/harvestermisc/frontend_utils.py | import time
import jwt
from pandaharvester.harvesterconfig import harvester_config
class HarvesterToken():
"""
Methods of JSON Web Token used in harvester frontend
"""
algorithm = 'HS256'
def __init__(self, **kwarg):
# load secret from file
with open(harvester_config.frontend.se... |
randerzander/wellbook | etl/lib/recordhelper.py | import sys, gc
def log(text): sys.stderr.write(text.strip() + '\n')
def error(text):
log(text)
sys.stdout.write(text.strip() + '\n')
def emit(text): sys.stdout.write('\t' + text.strip() + '\n')
def process_records(process_record, parse_key, key_prefix):
key, rec = '', ''
lines = 0
for line in sys.stdin:
... |
yanchen036/tensorflow | tensorflow/python/saved_model/saved_model_test.py | # 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... |
hmoco/osf.io | api_tests/files/views/test_file_detail.py | from __future__ import unicode_literals
import itsdangerous
import mock
import pytz
from nose.tools import * # flake8: noqa
from addons.github.models import GithubFileNode
from addons.osfstorage import settings as osfstorage_settings
from api.base.settings.defaults import API_BASE
from api_tests import utils as api_... |
stephane-martin/salt-debian-packaging | salt-2016.3.3/tests/unit/files_test.py | # -*- coding: utf-8 -*-
'''
tests.unit.file_test
~~~~~~~~~~~~~~~~~~~~
'''
# Import pytohn libs
from __future__ import absolute_import
import os
import copy
import shutil
import tempfile
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath
ensure_in_syspa... |
USGSDenverPychron/pychron | pychron/pipeline/plot/overlays/subgroup_overlay.py | # ===============================================================================
# Copyright 2021 ross
#
# 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/LICE... |
hartym/bonobo | bonobo/execution/strategies/__init__.py | """
Execution strategies define how an actual job execution will happen. Default and recommended strategy is "threadpool",
for now, which leverage a :obj:`concurrent.futures.ThreadPoolExecutor` to run each node in a separate thread.
In the future, the two strategies that would really benefit bonobo are subprocess and ... |
mikeengland/fireant | fireant/tests/test_formats.py | from datetime import (
date,
datetime,
)
from unittest import TestCase
import numpy as np
from fireant import (
DataType,
Field,
day,
formats,
hour,
month,
quarter,
week,
year,
)
from fireant.dataset.totals import (
DATE_TOTALS,
NUMBER_TOTALS,
TEXT_TOTALS,
)
te... |
persandstrom/home-assistant | homeassistant/components/sensor/lyft.py | """
Support for the Lyft API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.lyft/
"""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers.... |
pantsbuild/pants | src/python/pants/core/util_rules/external_tool_test.py | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import re
import pytest
from pants.core.util_rules.external_tool import (
ExternalTool,
ExternalToolError,
ExternalToolRequest,
TemplatedExternalTool,
... |
mahak/cinder | cinder/tests/unit/backup/drivers/test_backup_posix.py | # Copyright (c) 2015 Red Hat, 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 require... |
iotivity/iotivity | test/test_manager/ite/util.py | '''
/******************************************************************
*
* Copyright 2018 Samsung Electronics 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
*
* htt... |
jessamynsmith/fontbakery | bakery_cli/report/bakery.py | # coding: utf-8
# Copyright 2013 The Font Bakery 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 re... |
splunk/splunk-sdk-python | examples/handlers/handler_debug.py | #!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, 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... |
Jokeren/neon | neon/visualizations/figure.py | # ----------------------------------------------------------------------------
# Copyright 2015-2016 Nervana Systems 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.apa... |
geffzhang/grpc | tools/distrib/python/grpcio_tools/grpc_tools/command.py | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
sixninetynine/pex | tests/test_compatibility.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import pytest
from pex.compatibility import to_bytes, to_unicode, unicode_string
def test_to_bytes():
assert isinstance(to_bytes(''), bytes)
assert isinstance(to_bytes('abc'), bytes... |
Prakhash/security-tools | external/django-DefectDojo-1.2.1/dojo/management/commands/jira_async_updates.py | from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand
from django.utils import timezone
from requests.auth import HTTPBasicAuth
from dojo.models import Finding, JIRA_PKey, JIRA_Issue, Product, Engagement, Alerts, Notes, User, Dojo_User
import dojo.settings as s... |
ehelms/Opus | opus/lib/profile/profilerapp/models.py | ##############################################################################
# Copyright 2010 North Carolina State University #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
# ... |
stdweird/aquilon | tests/broker/test_constraints_cluster.py | #!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2009,2010,2011,2013 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... |
h2oai/h2o-3 | h2o-py/tests/testdir_utils/pyunit_logger.py | from __future__ import print_function
import sys
sys.path.insert(1,"../../")
import logging
from future.utils import PY2
from tests import pyunit_utils as pu
class LoggingContext:
def __init__(self, logger, level=None, handler=None, close=True):
self.logger = logger
self.level = level
self... |
iCHAIT/whats-fresh-api | whats_fresh/whats_fresh_api/tests/views/entry/test_new_story.py | from django.test import TestCase
from django.core.urlresolvers import reverse
from whats_fresh.whats_fresh_api.models import Story, Image, Video
from django.contrib.auth.models import User, Group
class NewStoryTestCase(TestCase):
"""
Test that the New Story page works as expected.
Things tested:
... |
pinterb/st2 | st2actions/tests/unit/test_pythonrunner.py | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... |
nugget/home-assistant | homeassistant/components/tts/__init__.py | """
Provide functionality to TTS.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tts/
"""
import asyncio
import ctypes
import functools as ft
import hashlib
import io
import logging
import mimetypes
import os
import re
from aiohttp import web
import vo... |
bajibabu/merlin | misc/scripts/frontend/utils/normalize_lab_for_merlin.py | import sys,os
import numpy as np
def divide_into_states(st_dur, fn_dur, num_states):
state_dur = np.zeros((2, num_states), np.int64)
state_dur[0][0] = st_dur
state_dur[1][num_states-1] = fn_dur
num_of_frames = (fn_dur-st_dur)/50000
nof_each_state = num_of_frames/num_states
#if nof_each_stat... |
TribeMedia/synapse | synapse/handlers/room_member.py | # -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# 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... |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/servers/http_server_base_unittest.py | # Copyright (C) 2012 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/third_party/apis/servicemanagement/v1/servicemanagement_v1_client.py | """Generated client library for servicemanagement version v1."""
# NOTE: This file is autogenerated and should not be edited by hand.
from apitools.base.py import base_api
from googlecloudsdk.third_party.apis.servicemanagement.v1 import servicemanagement_v1_messages as messages
class ServicemanagementV1(base_api.Base... |
HERA-Team/Monitor_and_Control | hera_mc/tests/test_default_db_schema.py | # -*- mode: python; coding: utf-8 -*-
# Copyright 2016 the HERA Collaboration
# Licensed under the 2-clause BSD license.
"""
Test that default database matches code schema.
"""
from sqlalchemy.orm import sessionmaker
from .. import mc, MCDeclarativeBase
from ..db_check import is_valid_database
def test_default_db_s... |
mblayman/lcp | conductor/planner/migrations/0027_schoolapplication.py | # Generated by Django 2.0.6 on 2018-09-23 02:42
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("planner", "0026_school_ipeds_id")]
operations = [
migrations.CreateModel(
name="SchoolApplication",
... |
teirce/game-valet | app/core/dbi.py | #Interface with the database here.
from .models import User, UsersGames, Games
from app import db
import app.startup.create_games as cg
import datetime
# a collection of miscellaneous database functions
def get_games_for_user(user):
"""Returns a list of games object models for the given user."""
return db.s... |
pierce403/EmpirePanel | lib/modules/management/mailraider/send_mail.py | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-SendMail',
'Author': ['@xorrior'],
'Description': ("Sends emails using a custom or default template to specified target email addresses."),
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.