code stringlengths 2 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int32 2 1.05M |
|---|---|---|---|---|---|
import sys
import os
import pysos
import signal
# these two variables should be changed depending on the test drivers PID
# and the type of message it will be sending, If you are using the generic_test.c
# then it is likely these two values can stay the same
TEST_MODULE = 0x81
MSG_TEST_DATA= 33
ALARM_LEN = 60
START_... | nesl/sos-2x | modules/unit_test/modules/kernel/post_raw/source_trick/reciever/source_trick_reciever.py | Python | bsd-3-clause | 3,085 |
from functools import reduce
from glob import glob
import os
import os.path as op
from shutil import copyfile, copytree
import pytest
import numpy as np
from numpy.testing import (assert_array_almost_equal, assert_allclose,
assert_array_equal)
import mne
from mne.datasets import testing
fro... | rkmaddox/mne-python | mne/tests/test_coreg.py | Python | bsd-3-clause | 12,343 |
#! /usr/bin/env python
'''
Recursively looks for EPD
Writes to STDOUT and STDERR the found library and the found include directory. In this way,
this script can be executed within CMAKE and the Python Libraries and Includes can be set to the STDOUT and STDERR streams
Checks for a minimum version of Python, default 2.... | LAIRLAB/libpyarr | find_epd.py | Python | bsd-3-clause | 2,436 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-06-15 20:21
from __future__ import unicode_literals
from django.db import migrations, models
import posts.models
class Migration(migrations.Migration):
dependencies = [
('posts', '0005_auto_20160615_1249'),
]
operations = [
mig... | DJMedhaug/BizSprint | posts/migrations/0006_auto_20160615_1321.py | Python | bsd-3-clause | 570 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-03-14 22:11
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('olympic', '0006_allow_seeding_and_results'),
]
operations = [
migrations.Add... | mjtamlyn/archery-scoring | olympic/migrations/0007_add_novice_h2h.py | Python | bsd-3-clause | 528 |
from spectrum import CORRELOGRAMPSD, CORRELATION, pcorrelogram, marple_data
from spectrum import data_two_freqs
from pylab import log10, plot, savefig, linspace
from numpy.testing import assert_array_almost_equal, assert_almost_equal
def test_correlog():
psd = CORRELOGRAMPSD(marple_data, marple_data, lag=15)
... | cokelaer/spectrum | test/test_correlog.py | Python | bsd-3-clause | 1,904 |
# proxy module
from __future__ import absolute_import
from envisage.plugins.remote_editor.i_remote_shell import *
| enthought/etsproxy | enthought/plugins/remote_editor/i_remote_shell.py | Python | bsd-3-clause | 114 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('donation', '0002_auto_20190416_2318'),
]
operations = [
migrations.AlterField(
model_name='razorpayplans',
... | PARINetwork/pari | donation/migrations/0003_auto_20201113_1437.py | Python | bsd-3-clause | 469 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-nupages
------------
Tests for `django-nupages` models module.
"""
import os
import shutil
import unittest
from django.utils import timezone
from django.core.urlresolvers import reverse
from django.contrib.sites.models import Site
from nupages import mo... | goldhand/django-nupages | tests/test_models.py | Python | bsd-3-clause | 1,041 |
# ------------------------------------------------------------------------
# coding=utf-8
# ------------------------------------------------------------------------
from __future__ import absolute_import
import os
from django import forms
from django.utils.translation import ugettext_lazy as _
from feincms import s... | pjdelport/feincms | feincms/module/medialibrary/forms.py | Python | bsd-3-clause | 2,901 |
import os
import sys
from copy import copy
from collections import OrderedDict
import traceback
import atexit
import neo
from data_provider import DataProvider
from .. import conversions as convert
class NeoDataProvider(DataProvider):
""" Base class for data providers using NEO"""
# Dictionary of block lis... | rproepp/spykeutils | spykeutils/plugin/data_provider_neo.py | Python | bsd-3-clause | 40,506 |
from __future__ import absolute_import
import operator
from django.db import models
from django.db.models import Q
from django.utils import timezone
from sentry.db.models import Model, sane_repr
from sentry.db.models.fields import FlexibleForeignKey, JSONField
from sentry.ownership.grammar import load_schema
from f... | mvaled/sentry | src/sentry/models/projectownership.py | Python | bsd-3-clause | 5,206 |
from rsqueakvm.util.cells import QuasiConstant
from rsqueakvm.plugins.vmdebugging.model import wrap_oplist, wrap_greenkey, wrap_debug_info
from rpython.rlib.jit import JitHookInterface, Counters
jit_iface_recursion = QuasiConstant(False)
def make_hook(args, func):
import inspect, re
src = "\n".join([
... | HPI-SWA-Lab/RSqueak | rsqueakvm/plugins/vmdebugging/hooks.py | Python | bsd-3-clause | 3,381 |
import email.utils
import collections
import time
import cgi
from .core import py3
if py3:
def parse_return(content):
if isinstance(content, str):
content = content.encode('utf-8', 'xmlcharrefreplace')
if isinstance(content, bytes):
return (content,)
elif isinstanc... | fallingduck/snifter | snifter/utils.py | Python | bsd-3-clause | 2,266 |
#
# File that determines what each URL points to. This uses _Python_ regular
# expressions, not Perl's.
#
# See:
# http://diveintopython.org/regular_expressions/street_addresses.html#re.matching.2.3
#
from django.conf import settings
from django.conf.urls.defaults import *
from django.contrib import admin
from django.... | TaliesinSkye/evennia | wintersoasis-master/web/urls.py | Python | bsd-3-clause | 3,320 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2017-01-10 15:56
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("elections", "0019_auto_20170110_1329")]
operations = [
... | DemocracyClub/EveryElection | every_election/apps/elections/migrations/0020_auto_20170110_1556.py | Python | bsd-3-clause | 823 |
''' A taylor series visualization graph. This example demonstrates
the ability of Bokeh for inputted expressions to reflect on a chart.
'''
import numpy as np
import sympy as sy
from bokeh.core.properties import value
from bokeh.io import curdoc
from bokeh.layouts import column
from bokeh.models import (ColumnDataSou... | bokeh/bokeh | examples/app/taylor.py | Python | bsd-3-clause | 2,238 |
from collections import Sized, OrderedDict
import matplotlib.pyplot as plt
from matplotlib import collections as mc
import numpy as np
import ipywidgets
import IPython.display as ipydisplay
from menpo.image import MaskedImage, Image
from menpo.image.base import _convert_patches_list_to_single_array
from .options imp... | grigorisg9gr/menpowidgets | menpowidgets/base.py | Python | bsd-3-clause | 100,134 |
# Django
from django.core.files.storage import get_storage_class
from django.utils.functional import LazyObject
# Internal
from .settings import (
FILE_STORAGE, FILE_STORAGE_ARGS,
LOGGER_NAME, LOG_FILE, LOG_SIZE, LOGGER_FORMAT, LOG_LEVEL
)
from .utils.loggers import LoggerWithStorage
class Defaul... | YAmikep/django-feedstorage | feedstorage/log.py | Python | bsd-3-clause | 703 |
# -*- coding: utf-8 -*-
import logging
import re
import slumber
from datetime import datetime
from dateutil import parser as dateparser
from queryset_client import client
from urllib import urlencode
from urlparse import urlparse
try:
# try to import django suite
from django.conf import settings
from dja... | nk113/tastypie-rpc-proxy | rpc_proxy/proxies.py | Python | bsd-3-clause | 26,445 |
# Authors: Robert Luke <mail@robertluke.net>
#
# License: BSD (3-clause)
from configparser import ConfigParser, RawConfigParser
import glob as glob
import re as re
import os.path as op
import datetime as dt
import json
import numpy as np
from ..base import BaseRaw
from ..utils import _mult_cal_one
from ..constants i... | rkmaddox/mne-python | mne/io/nirx/nirx.py | Python | bsd-3-clause | 19,728 |
#!/usr/bin/python
# Copyright (c) 2008,2010,2011,2012,2013 Alexander Belchenko
# 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 cop... | mhubig/intelhex | scripts/hex2dump.py | Python | bsd-3-clause | 3,960 |
import time
import re
from django.http import HttpResponseRedirect
from django.core.cache import cache
from django.core.urlresolvers import reverse
from django.conf import settings
# In-memory caches are used since different processes do not necessarily
# exhibit the same response times, even though they may share a ... | praekelt/django-scaler | scaler/middleware.py | Python | bsd-3-clause | 6,116 |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 4.0.2
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info as _swig_python_version_info
if _swig_python_version_info < (2, 7, 0):
raise Runtime... | mfem/PyMFEM | mfem/_par/sparsemat.py | Python | bsd-3-clause | 42,261 |
# -*- coding: utf-8 -*-
# Copyright (c) 2011-2014 Berkeley Model United Nations. All rights reserved.
# Use of this source code is governed by a BSD License (see LICENSE).
import re
from rest_framework.serializers import ValidationError
def name(value):
'''Matches names of people, countries and and other thing... | jmosky12/huxley | huxley/api/validators.py | Python | bsd-3-clause | 1,610 |
# -*- coding: utf-8 -*-
from django.core.mail.backends.base import BaseEmailBackend
from django.core.mail.message import sanitize_address
from django.conf import settings
import requests
import logging
logger = logging.getLogger(__name__)
class Newsletter2GoEmailBackend(BaseEmailBackend):
n2g_api_endpoint = '... | lukasklein/django-newsletter2go | newsletter2go/backends.py | Python | bsd-3-clause | 1,590 |
__author__ = 'Bohdan Mushkevych'
import unittest
from settings import enable_test_mode
enable_test_mode()
from db.model.raw_data import DOMAIN_NAME, TIMEPERIOD
from constants import PROCESS_SITE_YEARLY
from tests import monthly_fixtures
from tests import yearly_fixtures
from tests.test_abstract_worker import Abstract... | eggsandbeer/scheduler | tests/test_site_yearly_aggregator.py | Python | bsd-3-clause | 1,460 |
import datetime
import httplib2
import itertools
from django.conf import settings
from django.db import connection
from django.db.models import Sum, Max
from apiclient.discovery import build
from elasticsearch.helpers import bulk_index
from oauth2client.client import OAuth2Credentials
import olympia.core.logger
from... | harikishen/addons-server | src/olympia/stats/tasks.py | Python | bsd-3-clause | 12,766 |
"""
The :mod:`sklearn.model_selection._search` includes utilities to fine-tune the
parameters of an estimator.
"""
from __future__ import print_function
from __future__ import division
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas... | ClimbsRocks/scikit-learn | sklearn/model_selection/_search.py | Python | bsd-3-clause | 44,853 |
# -*- coding: utf-8 -*-
import sys
import django
from django.utils import six
try:
from django.utils.text import truncate_words
except ImportError:
# django >=1.5
from django.utils.text import Truncator
from django.utils.functional import allow_lazy
def truncate_words(s, num, end_text='...'):
... | lory87/django-filer | filer/utils/compatibility.py | Python | bsd-3-clause | 2,062 |
# -*- coding: utf-8 -*-
#
# © 2012 Scott Reynolds
# Author: Scott Reynolds <scott@scottreynolds.us>
#
"""Redboy: Key representation"""
# @TODO: Really this class is silly. Its really just an __init__ and a
# str(). Seems obtuse and useless.
import uuid
class Key(object):
"""
A key determines how to extract th... | SupermanScott/Redboy | redboy/key.py | Python | bsd-3-clause | 1,232 |
from django import forms
from django.forms.forms import BoundField
from .helpers import LMIForAllClient
from .fields import MultiCharField
class FieldSet(object):
"""
Taken from stackoverflow.com/questions/10366745/django-form-field-grouping
Helper class to group BoundField objects together.
"""
... | lm-tools/situational | situational/apps/sectors/forms.py | Python | bsd-3-clause | 2,817 |
# -*- coding: utf-8 -*-
from flask import request
class View(object):
def __init__(self, core):
self.core = core
def __call__(self, *args, **kwargs):
method = request.method.lower()
handler = getattr(self, method, None)
if callable(handler):
return handler(reque... | ojii/ircbotframework | ircbotframework/app.py | Python | bsd-3-clause | 719 |
from base import Phase
preparation = Phase('Preparation', 'Initializing connections, fetching data etc.')
volume_creation = Phase('Volume creation', 'Creating the volume to bootstrap onto')
volume_preparation = Phase('Volume preparation', 'Formatting the bootstrap volume')
volume_mounting = Phase('Volume mounting', 'M... | brianspeir/Vanilla | vendor/bootstrap-vz/common/phases.py | Python | bsd-3-clause | 1,251 |
import toolz
from toolz.curried import take, first, second, sorted, merge_with
def test_take():
assert list(take(2)([1, 2, 3])) == [1, 2]
def test_first():
assert first is toolz.itertoolz.core.first
def test_merge_with():
assert merge_with(sum)({1: 1}, {1: 2}) == {1: 3}
def test_sorted():
assert... | obmarg/toolz | toolz/tests/test_curried.py | Python | bsd-3-clause | 378 |
#!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import sys
import subprocess
import re
parser = argparse.ArgumentParser(description="""Extract version info from git and
generate a version header file. The working directory is expected to be
the root of Firmware.""")
parser.add_ar... | krbeverx/Firmware | src/lib/version/px_update_git_header.py | Python | bsd-3-clause | 6,103 |
# pylint: disable-msg=W0614,W0401,W0611,W0622
__docformat__ = 'restructuredtext'
from datetime import datetime
import numpy as np
from pandas.version import version as __version__
from pandas.info import __doc__
from pandas.core.api import *
from pandas.io.parsers import parseCSV, parseText, parseExcel
from pandas... | willgrass/pandas | pandas/__init__.py | Python | bsd-3-clause | 1,913 |
__import__("pkg_resources").declare_namespace(__name__)
from infi.clickhouse_orm.database import *
from infi.clickhouse_orm.engines import *
from infi.clickhouse_orm.fields import *
from infi.clickhouse_orm.funcs import *
from infi.clickhouse_orm.migrations import *
from infi.clickhouse_orm.models import *
from infi.c... | Infinidat/infi.clickhouse_orm | src/infi/clickhouse_orm/__init__.py | Python | bsd-3-clause | 490 |
# -*- coding: utf-8 -*-
'''auto ordering call chain test mixins'''
from inspect import ismodule
from twoq.support import port
class ARandomQMixin(object):
def test_choice(self):
self.assertEqual(len(list(self.qclass(1, 2, 3, 4, 5, 6).choice())), 1)
def test_sample(self):
self.assertEqual(l... | lcrees/twoq | twoq/tests/auto/ordering.py | Python | bsd-3-clause | 2,838 |
#-------------------------------------------------------------------------------
#
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions ... | enthought/traitsgui | enthought/pyface/dock/dock_sizer.py | Python | bsd-3-clause | 155,245 |
#!/usr/bin/env python
# Copyright 2019 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.
"""
Unit tests for the contents of cpu_temperature.py
"""
# pylint: disable=unused-argument
import logging
import unittest
from devil... | endlessm/chromium-browser | third_party/catapult/devil/devil/android/cpu_temperature_test.py | Python | bsd-3-clause | 4,988 |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
import ah_bootstrap
from setuptools import setup
#A dirty hack to get around some early import/configurations ambiguities
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin_... | utkbansal/tardis | setup.py | Python | bsd-3-clause | 4,442 |
from django.db.models import Aggregate, CharField
class Sql_GroupConcat(Aggregate):
function = 'GROUP_CONCAT'
allow_distinct = True
def __init__(self, expression, separator, distinct=False, ordering=None, **extra):
self.separator = separator
super(Sql_GroupConcat, self).__init__(expressio... | rackerlabs/django-DefectDojo | dojo/components/sql_group_concat.py | Python | bsd-3-clause | 1,326 |
import sys
__author__ = 'weijia'
import django.dispatch
before_server_start = django.dispatch.Signal(providing_args=[])
before_server_stop = django.dispatch.Signal(providing_args=[])
class ServerSignalTrigger(object):
def trigger_server_start_if_needed(self):
if sys.argv[1] == "runserver":
... | weijia/djangoautoconf | djangoautoconf/auto_conf_signals.py | Python | bsd-3-clause | 523 |
def extractKoreanovelsCom(item):
'''
Parser for 'koreanovels.com'
'''
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol) or "preview" in item['title'].lower():
return None
if item['title'].startswith("Link ") and item['tags'] == ['RSS']:
return buildReleaseMessageW... | fake-name/ReadableWebProxy | WebMirror/management/rss_parser_funcs/feed_parse_extractKoreanovelsCom.py | Python | bsd-3-clause | 933 |
##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... | chippey/gaffer | python/GafferTest/ArrayPlugTest.py | Python | bsd-3-clause | 12,836 |
from maskgen.jpeg import utils
import unittest
from test_support import TestSupport
class TestJpegUtils(TestSupport):
def test_load(self):
self.assertEqual(91,utils.estimate_qf(self.locateFile('tests/images/test_project1.jpg')))
if __name__ == '__main__':
unittest.main()
| rwgdrummer/maskgen | tests/test_utils.py | Python | bsd-3-clause | 288 |
"""autogenerated by genpy from mapping_dlut/Map.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import mapping_dlut.msg
import std_msgs.msg
class Map(genpy.Message):
_md5sum = "e6ab6c8862bf55f4e1b5fd48f03f1a7d"
_type = "mapping_dlut/Map"
_has_h... | WuNL/mylaptop | install/lib/python2.7/dist-packages/mapping_dlut/msg/_Map.py | Python | bsd-3-clause | 10,485 |
"""Utilities for working with data structures.
Version Added:
2.1
"""
from __future__ import unicode_literals
from collections import OrderedDict
from django_evolution.compat import six
def filter_dup_list_items(items):
"""Return list items with duplicates filtered out.
The order of items will be pre... | beanbaginc/django-evolution | django_evolution/utils/datastructures.py | Python | bsd-3-clause | 2,717 |
#!/usr/bin/env python
from build import ninja_common
build = ninja_common.Build('serial/seriald')
build.build_cmd(
'auv-seriald',
[
'main.cpp',
'config.cpp',
'device.cpp',
'device_list.cpp',
'sub_status.cpp',
],
deps=['nanomsg... | cuauv/software | serial/seriald/configure.py | Python | bsd-3-clause | 740 |
# Copyright (c) 2017 pandas-gbq Authors All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""Helper methods for BigQuery schemas"""
import copy
# API may return data types as legacy SQL, so maintain a mapping of aliases
# from standard SQL to ... | pydata/pandas-gbq | pandas_gbq/schema.py | Python | bsd-3-clause | 5,518 |
# Copyright 2014, Sandia Corporation. Under the terms of Contract
# DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains certain
# rights in this software.
from __future__ import absolute_import
from __future__ import division
import toyplot.cairo.png
def render(canvas, fobj=None, width=None, hei... | cmorgan/toyplot | toyplot/png.py | Python | bsd-3-clause | 2,849 |
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.core.exceptions import ObjectDoesNotExist
from django.views.decorators.cache import never_cache
from django.http import HttpResponse, HttpResponseRedirect
from session_csrf import anonymous_csrf
from ..models import ... | mozilla/BanHammer | BanHammer/blacklist/views/zlb.py | Python | bsd-3-clause | 9,627 |
from __future__ import division, print_function, absolute_import
import selfsup
import tensorflow as tf
import os
from .base import Method
from collections import OrderedDict
import deepdish as dd
import numpy as np
import itertools
import selfsup.jigsaw
PERMUTATIONS = selfsup.jigsaw.load_permutations(selfsup.res('ji... | gustavla/self-supervision | selfsup/multi/methods/jigsaw.py | Python | bsd-3-clause | 5,694 |
#!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# 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 retain the above copyright
# notic... | turon/openthread | tools/harness-automation/cases/router_5_5_4.py | Python | bsd-3-clause | 1,877 |
from django.http import HttpResponse
from django.utils import unittest
from django.test.client import Client
from postleware import PostResponseCachebusterMiddleware
class PostResponseMiddleware(unittest.TestCase):
def setUp(self):
self.client = Client()
def test_header_added_when_necessary(self):
... | thurloat/django-postleware | postleware/tests.py | Python | bsd-3-clause | 1,561 |
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | kumar303/rockit | vendor-local/boto/rds/dbsnapshot.py | Python | bsd-3-clause | 2,724 |
#!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you... | kineticadb/kinetica-api-python | gpudb/packages/avro/avro_py3/tool.py | Python | mit | 5,599 |
# orm/persistence.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""private module containing functions used to emit INSERT, UPDATE
and DELETE state... | alex/sqlalchemy | lib/sqlalchemy/orm/persistence.py | Python | mit | 41,002 |
# -*- coding: utf-8 -*-#
__author__ = 'dolacmeo'
| dolaCmeo/quick_flask | flask_site/user/__init__.py | Python | mit | 49 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | reneetrei/agile-bayou-76491 | teams/migrations/0001_initial.py | Python | mit | 1,068 |
# -*- coding: utf-8 -*-
"""Unit tests for functions calling bowtie externally."""
from pathlib2 import Path
import pytest
from imfusion.external import bowtie
class TestBowtieIndex(object):
"""Unit tests for the bowtie_index function."""
def test_call(self, mocker):
"""Tests example call with Path... | NKI-CCB/imfusion | tests/imfusion/external/test_ext_bowtie.py | Python | mit | 579 |
import util
from util.include import *
grid_margin_w = util.input.cfg_w / 6.0
grid_margin_h = util.input.cfg_h / 6.0
cell_w = util.input.cfg_w * 2.0 / 9.0
cell_h = util.input.cfg_h * 2.0 / 9.0
mark_none = []
mark_x = []
mark_o = []
| Max-E/max-opencv-demos | screens/preferences/include.py | Python | mit | 234 |
import caffe
import surgery, score
import numpy as np
import os
import setproctitle
setproctitle.setproctitle(os.path.basename(os.getcwd()))
weights = '../ilsvrc-nets/vgg16-fcn.caffemodel'
# init
caffe.set_device(int(sys.argv[1]))
caffe.set_mode_gpu()
solver = caffe.SGDSolver('solver.prototxt')
solver.net.copy_fro... | wkentaro/fcn | fcn/external/fcn.berkeleyvision.org/nyud-fcn32s-hha/solve.py | Python | mit | 616 |
import pytest
from SMIME_Messaging import Client, sign_email, encrypt_email_body, verify, decrypt_email_body, sign_and_encrypt,\
decode_str
import demistomock as demisto
with open('./test_data/signer_key.pem') as f:
private_key = f.read()
with open('./test_data/signer.pem') as file_:
public_key = file_.r... | demisto/content | Packs/SMIME_Messaging/Integrations/SMIME_Messaging/SMIME_Messaging_test.py | Python | mit | 3,174 |
from __future__ import print_function, division
import matplotlib
import logging
from sys import stdout
matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab!
from neuralnilm import (Net, RealApplianceSource,
BLSTMLayer, DimshuffleLayer,
Bidirectio... | mmottahedi/neuralnilm_prototype | scripts/e438.py | Python | mit | 8,414 |
"""Edit the RWhois data on the account."""
# :license: MIT, see LICENSE for more details.
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import exceptions
import click
@click.command()
@click.option('--abuse', help='Set the abuse email address')
@click.option('--address1', help='Update th... | briancline/softlayer-python | SoftLayer/CLI/rwhois/edit.py | Python | mit | 1,891 |
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
import sys
import json
from twit.models import User, Tweet, Mention, UserMention
from javanlp.models import Sentence, Sentiment
from javanlp.util import AnnotationException, annotate_document_with_sentiment
class Com... | arunchaganty/aeschines | django/twit/management/commands/annotate_features.py | Python | mit | 1,154 |
from django import forms
from selectable.forms import AutoCompleteSelectField
from selectable.forms import AutoCompleteSelectWidget
from opendata.catalog.lookups import CityLookup, CountyLookup
from .models import Request
class SearchForm(forms.Form):
text = forms.CharField(required=False)
class RequestForm(fo... | openrural/open-data-nc | opendata/requests/forms.py | Python | mit | 1,046 |
# -*- coding: utf-8 -*-
# See:
# https://github.com/codeforamerica/pittsburgh-purchasing-suite/blob/master/purchasing_test/unit/util.py
import datetime
from feedback.user.models import User
def create_a_user(email='foo@foo.com'):
return User(email=email, first_name='foo', last_name='foo')
def insert_a_user(emai... | codeforamerica/mdc-feedback | feedback_test/unit/util.py | Python | mit | 402 |
#!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, ServerError, InvalidRequestE... | kbase/narrative_method_store | test/data/test_repo_1/service/GenomeFeatureComparatorServer.py | Python | mit | 25,877 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import copy
import warnings
from itertools import chain
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from haystack import fields as haystack_fields
from haystack.query import EmptySearchQuerySet
... | fladi/drf-haystack | drf_haystack/serializers.py | Python | mit | 10,695 |
import logging
import time
from scrapy.dupefilters import BaseDupeFilter
from scrapy.utils.request import request_fingerprint
from . import defaults
from .connection import get_redis_from_settings
logger = logging.getLogger(__name__)
# TODO: Rename class to RedisDupeFilter.
class RFPDupeFilter(BaseDupeFilter):
... | hanbox/spider_template | spider_template/scrapy_redis/dupefilter.py | Python | mit | 3,992 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-11 03:13
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('administration', '0014_aut... | makyo/honeycomb | administration/migrations/0015_auto_20161111_0313.py | Python | mit | 629 |
"""Animation.
Animation is set of keyframes.
Value of selected attribute changes in time.
Keyframe:
(time, value)
Objects have animation manager which manages animation graph and switching."""
from operator import itemgetter
from eaf import Timer
from xoinvader.utils import Point
class AnimationBoundariesExce... | pankshok/xoinvader | xoinvader/animation.py | Python | mit | 8,490 |
from __future__ import print_function
import sys
import os
import subprocess
path = os.path.abspath(__file__)
modpath = os.path.dirname(path)
base_dir = os.getcwd()
install_mode = 'normal'
plus = False
mon = False
venv = "y"
if len(sys.argv) > 1:
if '-django' in sys.argv:
install_mode = 'django'
elif '... | synw/django-mogo | djangomogo/__main__.py | Python | mit | 2,304 |
# The MIT License (MIT)
# Copyright (c) 2016 HeyItsShuga
# 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,... | kupiakos/LapisMirror | plugins/e621.py | Python | mit | 4,898 |
import os
from fabric.decorators import task
from fabric.api import local, run, cd, env, prefix, hide
from fabric.colors import cyan, red, green, yellow
import app
import git
import virtualenv
@task
def init():
"""Execute init tasks for all components (virtualenv, pip)."""
print(yellow("# Setting up developme... | ronhanson/python-tbx | fabfile/__init__.py | Python | mit | 1,018 |
#!/usr/bin/python3
from messaging.messaging_manager import MessagingManager, MessagingManagerType
from common.monitoring import monitor_event_types as event_types
from common.monitoring.monitor_message import MonitorMessage
from inotify.adapters import Inotify
from inotify import constants as inotify_constants
from th... | AntonPashkowskiy/Tars | Program/monitoring/monitor.py | Python | mit | 5,353 |
import pytest
pytestmark = [pytest.mark.setone, pytest.mark.working]
@pytest.fixture
def data_release_update_1(award, lab):
return{
"schema_version": '1',
"award": award['@id'],
"lab": lab['@id'],
"summary": "Upgrader test.",
"update_tag": "UPGRADERTEST",
"submitted... | 4dn-dcic/fourfront | src/encoded/tests/test_upgrade_data_release_update.py | Python | mit | 3,172 |
# For Capstone Engine. AUTO-GENERATED FILE, DO NOT EDIT [mos65xx_const.py]
MOS65XX_REG_INVALID = 0
MOS65XX_REG_ACC = 1
MOS65XX_REG_X = 2
MOS65XX_REG_Y = 3
MOS65XX_REG_P = 4
MOS65XX_REG_SP = 5
MOS65XX_REG_DP = 6
MOS65XX_REG_B = 7
MOS65XX_REG_K = 8
MOS65XX_REG_ENDING = 9
MOS65XX_AM_NONE = 0
MOS65XX_AM_IMP = 1
MOS65XX_A... | capstone-rust/capstone-rs | capstone-sys/capstone/bindings/python/capstone/mos65xx_const.py | Python | mit | 3,179 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/weapon/shared_reinforcement_core.iff"
result.attribute_te... | anhstudios/swganh | data/scripts/templates/object/tangible/component/weapon/shared_reinforcement_core.py | Python | mit | 484 |
from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.administrator_page),
url(r'^new_jd/$', views.new_jd_page),
url(r'^test_data/refresh/$', views.test_data_refresh),
url(r'^jd/(?P<jd_id>\d+)/delete/', views.delete_jd),
url(r'^jd/(?P<jd_id>\d+)/create/$', views.crea... | v0devil/jltom | ltc/administrator/urls.py | Python | mit | 734 |
"""
Logger classes for the ZAP CLI.
.. moduleauthor:: Daniel Grunwell (grunny)
"""
import logging
import sys
from termcolor import colored
class ColorStreamHandler(logging.StreamHandler):
"""
StreamHandler that prints color. This is used by the console client.
"""
level_map = {
logging.DEB... | Grunny/zap-cli | zapcli/log.py | Python | mit | 1,840 |
from django.conf.urls import url
from waldur_mastermind.booking import views
def register_in(router):
router.register(
r'booking-resources', views.ResourceViewSet, basename='booking-resource'
)
router.register(
r'booking-offerings', views.OfferingViewSet, basename='booking-offering'
)... | opennode/nodeconductor-assembly-waldur | src/waldur_mastermind/booking/urls.py | Python | mit | 466 |
from flask import Flask
app = Flask(__name__)
app.config.from_object('config')
| Akagi201/learning-python | flask/Flask-Script/test1/app/__init__.py | Python | mit | 80 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Examples for Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
"""
from nvd3 imp... | mgx2/python-nvd3 | examples/discreteBarChart.py | Python | mit | 899 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_commoner_old_human_male_02.iff"
result.attribute_templ... | obi-two/Rebelion | data/scripts/templates/object/mobile/shared_dressed_commoner_old_human_male_02.py | Python | mit | 459 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from config.template_middleware import TemplateResponse
from gaecookie.decorator import no_csrf
from gaepermission.decorator import login_not_required
from tekton import router
from tekton.gae.middleware.redirect import RedirectResponse
fr... | rodrigomalk/Novos-Bandeirantes | backend/appengine/routes/criar.py | Python | mit | 1,831 |
from .models import Framework
from .utils import get_json_from_request, json_has_required_keys, \
json_has_matching_id
from .validation import get_validation_errors
def validate_and_return_draft_request(draft_id=0):
json_payload = get_json_from_request()
json_has_required_keys(json_payload, ['services'])
... | mtekel/digitalmarketplace-api | app/draft_utils.py | Python | mit | 1,022 |
#### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Intangible()
result.template = "object/draft_schematic/clothing/shared_clothing_armor_bone_leggings.iff"
result.a... | obi-two/Rebelion | data/scripts/templates/object/draft_schematic/clothing/shared_clothing_armor_bone_leggings.py | Python | mit | 466 |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2013-2017 Alex Forencich
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... | alexforencich/python-ivi | ivi/agilent/agilentBase8590A.py | Python | mit | 2,338 |
import csv
import json
import sys
import traceback
from six.moves import StringIO
import requests
import mock
import gevent
from gevent import wsgi
from locust import web, runners, stats
from locust.runners import LocustRunner
from locust.main import parse_options
from .testcases import LocustTestCase
class TestWebU... | pmdarrow/locust | locust/test/test_web.py | Python | mit | 3,957 |
"""
policy.py
Janbaanz Launde
Apr 1, 2017
"""
class Policy(object):
"""Abstract class for all policies"""
name = 'POLICY'
def __init__(self, contexts):
self.contexts = contexts
def predict_arm(self, contexts=None):
raise NotImplementedError("You need to override this function in chil... | rakshify/News_Recommender | policy/policy.py | Python | mit | 472 |
from toontown.toonbase import ToontownGlobals
from toontown.coghq import DistributedLevelBattleAI
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import State
from direct.fsm import ClassicFSM, State
from toontown.battle.BattleBase import *
import CogDisguiseGlobals
from toontown.toonbase.ToontownBat... | ksmit799/Toontown-Source | toontown/coghq/DistributedMintBattleAI.py | Python | mit | 2,940 |
import numpy as np
import os
import sys
import os.path as op
import matplotlib as mpl
import mpl.pyplot as plt
import palettable.colorbrewer as pal
from datetime import datetime
from cycler import cycler
#plt.rc('axes', prop_cycle=cycler('color', pal.qualitative.Dark2_8.mpl_colors)+
# cycler('marker',['D','o','v','... | OSUmageed/1DSweptCUDA | ResultPlots/ConferencePaper/Parsed/plotit.py | Python | mit | 4,498 |
"""holds locking functionality that works across processes"""
from __future__ import absolute_import, unicode_literals
from contextlib import contextmanager
import py
from filelock import FileLock, Timeout
from tox.reporter import verbosity1
@contextmanager
def hold_lock(lock_file, reporter=verbosity1):
py.pat... | tox-dev/tox | src/tox/util/lock.py | Python | mit | 1,295 |
#/u/Goldensights
import praw
import time
import datetime
'''USER CONFIG'''
USERNAME = ""
#This is the bot's Username. In order to send mail, he must have some amount of Karma.
PASSWORD = ""
#This is the bot's Password.
USERAGENT = ""
#This is a short description of what the bot does. For example "/u/GoldenSights'... | tehp/reddit | MessageArchiveSimple/messagearchivesimple.py | Python | mit | 1,943 |
# encoding: utf-8
from collections import namedtuple
import inspect
import keyword
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
try:
import jedi
has_jedi = True
except ImportError:
has_jedi = False
from bpython import autocomplete
from bpython._py3compat impor... | MarkWh1te/xueqiu_predict | python3_env/lib/python3.4/site-packages/bpython/test/test_autocomplete.py | Python | mit | 16,423 |
"""
"""
import argparse
parser = argparse.ArgumentParser(
prog="portainer",
fromfile_prefix_chars="@"
)
subparsers = parser.add_subparsers()
def subcommand(name, callback=None):
"""A decorator for main functions to add themselves as subcommands."""
def decorator(fn):
subparser = subparser... | duedil-ltd/portainer | portainer/app/__init__.py | Python | mit | 504 |