src
stringlengths
721
1.04M
# ~*~ coding: utf-8 ~*~ from __future__ import unicode_literals from django.urls import path from .. import views __all__ = ["urlpatterns"] app_name = "ops" urlpatterns = [ # Resource Task url path('task/', views.TaskListView.as_view(), name='task-list'), path('task/<uuid:pk>/', views.TaskDetailView.as_...
"""Ring buffer viewer""" from qcamera.ring_buffer import RingBuffer from PyQt4 import QtGui from guiqwt.builder import make from ui_ring_buffer_viewer import Ui_RingBufferViewer from util import get_image_item, get_rect_item class RingBufferViewer(QtGui.QDialog, Ui_RingBufferViewer): def __init__(self, rbuffer, ...
# Licensed under a 3-clause BSD style license - see LICENSE.rst from __future__ import division, print_function __all__ = ['BaseTransform', 'CompositeTransform'] class BaseTransform(object): """ A transformation object. This is used to construct transformations such as scaling, stretching, and so o...
# Copyright 2018 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. """Thresholds used for hypothesis testing. The "low threshold" is the traditional significance threshold. If the p-value is below the "low threshold", we sa...
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ ...
caracteres = input("Saississez des caractères: ") # Exemple avec aA019éà@#`{ for caractere in caracteres: print("Le caractère {} a pour ordinal {}".format(caractere, ord(caractere))) # Le caractère a a pour ordinal 97 # Le caractère A a pour ordinal 65 # Le caractère 0 a pour ordinal 48 # Le caractère 1 a pour o...
# -*- coding: utf-8 -*- # Source: https://leetcode.com/problems/longest-substring-without-repeating-characters class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ length_of_longest_substr(s) def contract_left(s, left, right, coun...
# -*- coding: utf-8 -*- import re from module.plugins.internal.XFSHoster import XFSHoster, create_getInfo class XFileSharingPro(XFSHoster): __name__ = "XFileSharingPro" __type__ = "hoster" __version__ = "0.48" __pattern__ = r'https?://(?:www\.)?(?:\w+\.)*?(?P<DOMAIN>(?:[\d.]+|[\w\-^_]{3,}(?:\...
#!/usr/bin/env python3 # # # Mike Dvorak # Postdoc # UC Berkeley # Civil and Environmental Engineering # dvorak@berkeley.edu # # Created: 2013-07-09 # Modified: 2016-01-22 # # # Description: Inserts CSV files from Mesowest (mesowest.utah.edu). The CSV files are the type you get when you save # the "CSV" files, which ar...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ setuptools config file """ import sys import pip from pip.req import parse_requirements from setuptools import setup, find_packages import os from zenfig import __version__ as version from zenfig import __author__ as author from zenfig import PKG_URL as pkg_url from z...
#!/usr/bin/env python # Some kind of very project-specific way to remove unwanted components from __future__ import with_statement import os import re import sys from optparse import OptionParser from subprocess import Popen, PIPE, STDOUT TRUE_VALUES = ['yes','ok','true'] FALSE_VALUES = ['no','none','false'] def p...
# coding=utf-8 """Definitions relating to layer keywords.""" from safe.utilities.i18n import tr __copyright__ = "Copyright 2016, The InaSAFE Project" __license__ = "GPL version 3" __email__ = "info@inasafe.org" __revision__ = '$Format:%H$' # Base Metadata Property property_organisation = { 'key': 'property_org...
"""Unit tests for `dom.py`. Todo: * Add class methods to html tag tests * Ul (from_list, from_dict, ) * Ol (from_list, from_dict, ) * Table (from_list, ) * Pass an instance of same class as parameter to ElementHTML class (test) * """ import unittest import os # Allowing to import m...
# -*- coding: utf-8 -*- """ @author: ChernHong Lim """ import numpy as np import copy import os import matplotlib.pyplot as plt import cv2 from scipy import stats from skimage.feature import local_binary_pattern #from skimage import io from sklearn.cluster import KMeans from sklearn.svm import SVC ...
# Copyright 2018-2019 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in t...
import os import subprocess import pipes import btools.pybookmark as pybookmark import btools.common as common from ConfParser import ConfParser class FileMatcher: def __init__(self, bookmark_file = "", rules_file = ""): if rules_file == "": rules_file = common.get_conf_location() c ...
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # 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 # rai...
from django.apps import apps from django.core.exceptions import FieldError from rest_framework.exceptions import NotFound from rest_framework.filters import OrderingFilter from rest_framework_extensions.cache.mixins import CacheResponseMixin from api.codelist.filters import AllDjangoFilterBackend from api.codelist.ser...
# -*- coding: utf-8 -*- from functools import partial from navmazing import NavigateToSibling, NavigateToAttribute from cfme.common import SummaryMixin, Taggable from cfme.fixtures import pytest_selenium as sel from cfme.web_ui import toolbar as tb from cfme.web_ui import Quadicon, match_location, mixins from utils.ap...
import matplotlib.pyplot as plt from numpy import * ###List of variables # r_in [10**10 cm] innder radius # r_out [10**10 cm] outer radius # step [10**10 cm] step of plot # alfa [] parameter of accretion # M_16 [10**16 g.s**(-1)] accretion flow # m_1 [solar mass] mass of compact object # R_hv [10**1...
# PiTimer - Python Hardware Programming Education Project For Raspberry Pi # Copyright (C) 2015 Jason Birch # # 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 ...
""" .. _tut-visualize-evoked: Visualizing Evoked data ======================= This tutorial shows the different visualization methods for `~mne.Evoked` objects. As usual we'll start by importing the modules we need: """ import os import numpy as np import mne #######################################################...
# # Copyright 2011 Vasco Nevoa. # # This file is part of DiffTrike. # # DiffTrike 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 la...
"""4 inch soil temps or moisture""" import datetime import calendar from collections import OrderedDict import pandas as pd from pandas.io.sql import read_sql from pyiem import util from pyiem.plot import figure_axes from pyiem.network import Table as NetworkTable # This is needed. VARS = OrderedDict( ( ...
from __future__ import unicode_literals import re from setuptools import setup, find_packages def get_version(filename): content = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", content)) return metadata['version'] setup( name='Mopidy-Youtube', version=get_version(...
# Copyright 2019, The TensorFlow Federated 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 o...
#!/usr/bin/env python from multiprocessing import Process,Lock import sys,os,time script = sys.argv[0] list = [1000,1200,1400,1600,1800,10000] Proce_num_list = [] def worker(num): try: #print p.name, p.pid, os.getppid() if int(num) == int(list[-1]): print 'Check out automatically exit...
"""SQL io tests The SQL tests are broken down in different classes: - `PandasSQLTest`: base class with common methods for all test classes - Tests for the public API (only tests with sqlite3) - `_TestSQLApi` base class - `TestSQLApi`: test the public API with sqlalchemy engine - `TestSQLiteFallbackApi`: t...
import socket import threading local = threading.local() def handle(conn): local.data = {} while True: message = conn.recv(1024).decode() fields = message.rstrip("\r\n").split(" ") command = fields[0] if command == "QUIT": break if len(fields) < 2: ...
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from collections import Counter fr...
# Copyright 2016 Alethea Katherine Flowers # # 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...
import os import glob import shutil from nose.tools import (assert_equal, assert_true) from qidicom import (reader, writer, meta) from .. import ROOT from ..helpers.logging import logger FIXTURE = os.path.join(ROOT, 'fixtures', 'dicom') """The test fixture.""" RESULTS = os.path.join(ROOT, 'results', 'dicom') """The t...
from math import fabs, ceil from shlex import quote from datetime import timedelta import os import re import shutil import subprocess import tempfile import click class FFmpeg(object): """Class used for video conversions to WebM. Uses the instance variables to generate ffmpeg arguments to run and matches the...
# Copyright (c) 2020 PaddlePaddle 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 appli...
#!/usr/bin/env python # Copyright 2014 Kaspar Emanuel <kaspar.emanuel@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THIS SOFTWARE IS...
# Copyright (C) 2006-2007, Red Hat, Inc. # Copyright (C) 2009 Simon Schampijer # # 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 ...
#!/usr/bin/env python """Module that contains representers for values returned by Python API.""" import ipaddress import os from typing import Dict, Text, List, Optional, Any, Union import humanize import IPython from IPython.lib import pretty from grr_colab import convert from grr_colab._textify import client from g...
# encoding= utf-8 # Copyright 2007-2009 QSpin - www.qspin.be # # This file is part of QTaste framework. # # QTaste is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the...
import os, struct from array import array as pyarray from cvxopt.base import matrix import numpy as np import PIL.Image # FIXME: need actual class names def LABELS(index): ls = labels() if len(ls) > 0: return ls[index] else: return range(1000)[index] def labels(): file = open('networks/ima...
# This file is part of MAMMULT: Metrics And Models for Multilayer Networks # # 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 ver...
#!/usr/bin/python # # Copyright (c) 2018 Yunge Zhu, (@yungezz) # # 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', 'statu...
# ~*~ encoding: utf-8 ~*~ from app.main import main from flask import render_template, request, flash, redirect, url_for from app.main.forms import EngpassForm, ContactForm, ClassifyForm, classified from app.models import Engpass, User, Drug, Producer, Contact, Log from flask_login import login_required, current_user f...
import re from django.shortcuts import render from signup.models import Slot, Signup, GroupMembership def has_group(user): return GroupMembership.objects.filter(watid=user).exists() def find_group(user): return GroupMembership.objects.filter(watid=user).first().group_id if has_group(user) else 'None' def is_...
from panda3d import core import struct import pytest from _pytest.outcomes import Failed # This is the template for the compute shader that is used by run_glsl_test. # It defines an assert() macro that writes failures to a buffer, indexed by # line number. # The reset() function serves to prevent the _triggered varia...
import ArduinoControlClient import time b = ArduinoControlClient.UDPClient('192.168.1.106', 6666) def ping_test(b): for i in range(4): latency = b.ping_test() print 'ping_test', 'PASSED latency=%d'%(latency) if latency else 'FAILED' time.sleep(0.5) def blink_led(b): pin=b.get_pin(2) ...
from django.conf.urls import include, patterns, url from rest_framework.routers import SimpleRouter from rest_framework_nested.routers import NestedSimpleRouter from mkt.extensions.views import (ExtensionSearchView, ExtensionVersionViewSet, ExtensionViewSet, ...
""" :synopsis: Queue Model :copyright: 2014 Nathan Lewis, See LICENSE.txt .. moduleauthor:: Nathan Lewis <natewlew@gmail.com> """ from datetime import datetime from sqlalchemy import Column, Integer, String, DateTime, Boolean from MythTVArchiveServer.controllers.registry import Base from MythTVArchiveServer.ut...
""" tell.py Created By: - CloudBot IRC <https://github.com/ClodbotIRC> Modified By: - Josh Elsasser <https://github.com/jaelsasser> License: GNU General Public License (Version 3) """ import re from datetime import datetime from sqlalchemy import Table, Column, String, Boolean, DateTime from sqlalchemy.s...
from steve.backend.sqlitedb import SDB from steve.item import Item from steve.type import Type from steve.market_group import MarketGroup from steve.planet_schematic import PlanetSchematic class Assets(object): def __init__(self): self._types = {} # { <uid...
#-*- coding: utf8 -*- # fazendo umi # perfil quadrado do espectro # e retornando o as amostras import numpy as n, pylab as p, scikits.audiolab as a duracao=2. # segundo N=int(duracao*44100) #numero de amostras # sequência de 2205 amostras (50 milisegundos em 44100 kHz) # coeficientes espectrais de fourier em mesmo nu...
from mitxmako.shortcuts import render_to_response, render_to_string from django.http import HttpResponse import json from models import PepRegTraining, PepRegInstructor, PepRegStudent from django import db from datetime import datetime, timedelta, date from pytz import UTC from django.contrib.auth.models import User i...
#!/usr/bin/env python3 # Copyright (c) 2013-2017 The nealcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Generate seeds.txt from Pieter's DNS seeder # NSEEDS=512 MAX_SEEDS_PER_ASN=2 MIN_BLOCKS = 337600 ...
import argparse import collections import numpy import sys import bio import config parser = argparse.ArgumentParser(description='Analyze BAM') parser.add_argument('bam', metavar='bam', help='bam file to analyze') parser.add_argument('--buckets', metavar='buckets', type=int, default=10, help='number of buckets') par...
""" Generally useful mixins for tests of any project. This should be open sourced in the future, so it must be project agnostic. """ from django.core.urlresolvers import reverse from myproject.tests.factories import UserFactory class ViewTestsMixin(object): """Mixin that provides commonly tested assertions."""...
#!/usr/bin/python # Copyright (c) 2014 Wladmir J. van der Laan # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. ''' Script to generate list of seed nodes for chainparams.cpp. This script expects two text files in the directory that...
# iterative # time: over time, bug on helper function. ~ 18mins class Solution: """ @param matrix, a list of lists of integers @param target, an integer @return a boolean, indicate whether matrix contains target """ def searchMatrix(self, matrix, target): if matrix is None or matrix == ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Example usage: # python s3trim.py --count 14 --key=AWS_KEY --secret=AWS_SECRET_KEY nmdarchive christest/production import argparse import logging import operator import re import time from collections import OrderedDict as Dict from boto.s3.connection import S3Connection...
# -*- coding: utf-8 -*- from hamcrest import * from utils import * @given('dotfiles home directory contains a file named "{filename}"') def step_impl(context, filename): (dotfiles_home / filename).touch() @given('dotfiles home directory contains a directory named "{dirname}"') def step_impl(context, dirname)...
from whiffle import wikidotapi from util import hook import re import time,threading @hook.command def scp(inp): #this is for WL use, easily adaptable to SCP ".scp <Article #> -- Will return exact match of 'SCP-Article#'" api = wikidotapi.connection() #creates API connection api.Site = "scp-wiki" pages = api.refre...
from django.db import models from django.db.models import Q from datetime import timedelta import operator from msgvis.apps.base.models import MappedValuesQuerySet from msgvis.apps.corpus import models as corpus_models from msgvis.apps.groups import models as groups_models from msgvis.apps.dimensions import registry f...
### # Copyright 2008-2011 Diamond Light Source Ltd. # This file is part of Diffcalc. # # Diffcalc 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 late...
# -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @Daddy_Blamo wrote this file. As long as you retain this notice you # can do whatever you want wi...
# -*- coding: utf-8 -*- ############################################################################################## # This file is deprecated because Python 2.x is deprecated # # A Python 3.x version of this file can be found at: # # ...
import datetime import logging import os import snmpy.module import subprocess LOG = logging.getLogger() class disk_utilization(snmpy.module.TableModule): def __init__(self, conf): conf['table'] = [ {'dev': 'string'}, {'wait': 'integer'}, {'util': 'integer'}, ...
# -*- coding: utf-8 -*- # # SPDX-License-Identifier: AGPL-3.0-or-later # # snippy - software development and maintenance notes manager. # Copyright 2017-2020 Heikki J. Laaksonen <laaksonen.heikki.j@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU ...
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'MakerScienceProfile.authorized_contact' db.add_column(u'm...
import numpy as np import numba from pax.trigger import TriggerPlugin from pax.datastructure import TriggerSignal from pax.dsputils import adc_to_pe # Interrupts thrown by the signal finder # Negative, since positive numbers indicate number of signals found during normal operation SIGNAL_BUFFER_FULL = -1 SAVE_DARK_MON...
import sqlite3 import os.path from .cfa import CallFrameAddress from .files import Files from .framepointers import Framepointers from .function import Functions from .insnset import InsnSet from .lines import Lines from .location import Locations from .types import Types from .variables import Variables from .symbols...
import os import re import nibabel as nib import numpy as np from glob import glob from sys import argv dirname=argv[1] print(dirname) ### COLLECT ALL MNCs all_fls = [] for dirs, things, fls in os.walk(dirname): if len(fls) > 0: for fl in fls: all_fls.append(os.path.join(dirs,fl)) all_mncs = ...
# 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 # distrib...
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
#!/usr/bin/env python """ Sanders ik_comparison test python script This script is written to be ran with the gazebo simulated Baxter It will probably run on the robot live aswel, but is not tested on it """ #import various libraries import argparse import struct import sys import rospy #import library to use time.sl...
from __future__ import print_function from sympy import Symbol, symbols, sin, cos, Rational, expand, simplify, collect from sympy import Rational as Rat from galgebra.printer import Format, Eprint, Get_Program from galgebra.ga import Ga from math import sqrt global n,nbar,I def radius(T): ''' This retrieves ...
#!/usr/bin/env python2.7 # ============================================================================= # IMPORTS # ============================================================================= import praw import MySQLdb import ConfigParser import time import parsedatetime.parsedatetime as pdt import pprint import lo...
"""Contains parts of the main template - head, nav and footer""" #Uses code from this reposatory: #https://github.com/adarsh0806/ud036_StarterCode/blob/master/fresh_tomatoes.py def get_template(): '''Contains main template''' # Styles and scripting for the page main_page_head = ''' <!DOCTYPE html> ...
import os from PyQt4 import QtGui, QtCore class Plugin(object): title = 'Search in Files' location = 'app' # left, bottom, right, app widget = None # The widget for the plugin (set at getWidget) def __init__(self,parent=None): self.parent = parent def load(self): self.btn...
#!/usr/bin/env python import glob import re import sys # base filenames of palette files, e.g. "blues" palettes = set() # output file out = open("palettes.cpp", "w") def die(msg): print "Failed: %s" % msg sys.exit(1) # what variable name should we use for the given base filename def varName(basename): ...
from template import Template from template.test import TestCase, main class DirectiveTest(TestCase): def testDirectives(self): ttobjs = (('tt', Template()), ('pre', Template({ 'PRE_CHOMP': 1 })), ('post', Template({ 'POST_CHOMP': 1 })), ('trim', Template({ 'INCLUDE_PAT...
import demistomock as demisto # noqa: F401 from CommonServerPython import * def main() -> None: ORANGE_HTML_STYLE = "color:#FF9000;font-size:250%;>" GREEN_HTML_STYLE = "color:#00CD33;font-size:275%;>" RED_HTML_STYLE = "color:#FF1744;font-size:275%;>" DIV_HTML_STYLE = "display:block;text-align:center...
import random import time def go(lower_bound, upper_bound, bots): iterations = 1 target = random.randint(lower_bound, upper_bound) print(f"Target number: {'{:,}'.format(target)}") while True: answers = [random.randint(lower_bound, upper_bound) for _ in range(bots)] ...
# -*- coding: utf-8 -*- from rest_framework import serializers from django.utils.translation import ugettext as _ from orgs.mixins.serializers import BulkOrgResourceModelSerializer from ..models import Asset, Node __all__ = [ 'NodeSerializer', "NodeAddChildrenSerializer", "NodeAssetsSerializer", ] class No...
#!/usr/bin/python # Copyright 2015-2017 Christian Panse <cp@fgcz.ethz.ch> # # This file is part of the recmap package on CRAN. # https://github.com/fgcz/maxquant_wrapper/ # # maxquant_wrapper is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by...
from invoke import Task, run from .tools import copy, warn, abort, confirm from . import colors from . import env import os # these are the classes that we will let modules override __all__ = [ "CleanTask", "MostlyCleanTask", "BuildTask", "TestTask", "ArchiveTask", "CloneTask", "LiveTask",...
#!/usr/bin/python # # Copyright (C) 2007-2008 Arnold Krille # # This file is part of FFADO # FFADO = Free Firewire (pro-)audio drivers for linux # # FFADO is based upon FreeBoB. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published b...
import sys def get_file_text(path): """ Returns file text by path""" file_io = open(path, "r") text = file_io.read() file_io.close() return text def get_file_output(encoding="utf-8", path=sys.argv[-1], arg_string=""): """ Returns answer file output :param encoding: to decode output i...
from flask_wtf import FlaskForm from wtforms import PasswordField, StringField, validators, Form, BooleanField, SelectField, RadioField, TextAreaField from wtforms.validators import DataRequired, NumberRange, Optional from wtforms_components import IntegerField class LoginForm(Form): username = StringField('Usern...
# Copyright (c) 2014, Fundacion Dr. Manuel Sadosky # 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 notice, this # list of condit...
import copy import os def jinja2_ord(ch): return ord(ch[0]) def enum_type(t): tmap = {"char": "byte", "uint8": "byte", "int16": "short", "uint16": "ushort", "int32": "int", "uint32": "uint" } return tmap[t["encoding_type"]] def cs...
"""The tests for the geojson platform.""" import datetime from asynctest.mock import patch, MagicMock, call from homeassistant.components import geo_location from homeassistant.components.geo_location import ATTR_SOURCE from homeassistant.components.nsw_rural_fire_service_feed.geo_location import ( ATTR_EXTERNAL_I...
# Main fonction return the centerline of the mifti image fname as a nifti binary file # Centerline is generated using sct_nurbs with nbControl = size/div from sct_nurbs_v2 import * import nibabel import splines_approximation_v2 as spline_app from scipy import ndimage import numpy import commands import linear_fitting...
""" Protein secondary structure and associated tools and data. Constants: - secstruc_alphabet -- Secondary structure alphabet: 'HGIEBbTSC _-L?X' Contains a complete set of secondary structure codes generated by both STRIDE and DSSP - secstruc_ehl_alphabet -- Standard 3 s...
from pymongo import MongoClient import time from bson import ObjectId class DatabaseManager: # DB set-up def __init__(self): client = MongoClient() db = client.flaskr self.entries_col = db.entries # sort by [default] descending/latest order def get_all_entries(self, sort_by=-1)...
# Disk resizing dialog # # Copyright (C) 2012-2013 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. # This program is distributed...
#!/usr/bin/env python # Since M(2**n + 1) = 4**n + 3**n - 2**(n + 1) (empirically), # we find sum_{n=0}^{P} M(2**n + 1) is equal to # (4**(P + 1) - 1)/3 + (3**(P + 1) - 1)/2 + 2*(2**(P + 1) - 1) # = (4*(4**P) - 1)*(3**(-1)) + (3*(3**P) - 1)*(2**(-1)) + 4*(2**P) - 2 # (This is because (r - 1)*(r**P + ... + r + 1) = r**...
""" Implementation of the matern kernel. """ from __future__ import division from __future__ import absolute_import from __future__ import print_function import numpy as np from ..core.domains import POSITIVE from ..utils.misc import rstate from ._core import RealKernel from ._distances import rescale, dist, dist_f...
#!/usr/bin/env python # # Copyright 2011 Authors of PyTask. # # This file is part of PyTask. # # PyTask is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your opt...
#============================================================================= # # Test Module # #============================================================================= """ Test Module =========== A simple module used for testing this package. """ __version__ = '0.0.0' #====================================...
# -*- coding: utf-8 -*- """SQLAlchemy session.""" from __future__ import absolute_import, unicode_literals from kombu.utils.compat import register_after_fork from sqlalchemy import create_engine from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.pool import ...
""" TESTS is a dict with all you tests. Keys for this will be categories' names. Each test is dict with "input" -- input data for user function "answer" -- your right answer "explanation" -- not necessary key, it's using for additional info in animation. """ TESTS = { "Rank_1": [ { ...
# Django settings for duelify project. LOGIN_URL = '/login/' LOGIN_REDIRECT_URL = '/' #LOGIN_ERROR_URL = '/error' SOCIAL_AUTH_COMPLETE_URL_NAME = 'socialauth_complete' SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete' SOCIAL_AUTH_NEW_USER_REDIRECT_URL = '/new-users-invited/' SOCIAL_AUTH_LOGIN_REDIR...