text
stringlengths
12
6.59M
"""Contains all the core ShutIt methods and functionality. """ #The MIT License (MIT) # #Copyright (C) 2014 OpenBet Limited # #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...
# -*- coding: utf-8 -*- """Binary Search Tree Module.""" class Node(object): """Define a node class.""" def __init__(self, value=None, parent=None, left=None, right=None): """Initialize a Node object.""" self.value = value self.parent = parent self.left = left self.rig...
"""Contains all the core ShutIt methods and functionality, and public interface off to internal objects such as shutit_pexpect. """ # The MIT License (MIT) # # Copyright (C) 2014 OpenBet Limited # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documenta...
import unittest import pytest import numpy import cupy from cupy import testing @testing.parameterize( {'variable': None}, {'variable': 'y'}, ) @testing.gpu class TestPoly1dInit(unittest.TestCase): @testing.for_all_dtypes() @testing.numpy_cupy_array_equal() def test_poly1d_numpy_array(self, xp,...
''' group.py - Group reads based on their UMI ========================================= :Author: Tom Smith :Release: $Id$ :Date: |today| :Tags: Python UMI Purpose ------- The purpose of this command is to identify groups of reads based on their genomic coordinate and UMI. It is assumed that the FASTQ files were proc...
from datetime import date import unittest from meetup import meetup_day try: from meetup import MeetupDayException except ImportError: MeetupDayException = Exception class MeetupTest(unittest.TestCase): def test_monteenth_of_may_2013(self): self.assertEqual(date(2013, 5, 13), ...
import calendar from datetime import datetime, date, timedelta import itertools import operator from django import forms from django.contrib.admin.views.decorators import staff_member_required from django.db.models import Max, Min from django.http import HttpResponseRedirect from django.shortcuts import render from dj...
from networkx import DiGraph from shapely.geometry import Point from roadmaptools.road_structures import LinestringEdge def get_node_id(node) -> str: lon = int(node[0] * 10 ** 6) lat = int(node[1] * 10 ** 6) if lon < 0 and lat < 0: return "1" + str(lon)[1:] + str(lat)[1:] elif lon < 0 and lat >= 0: return "2"...
# This file is part of fedmsg. # Copyright (C) 2012-2014 Red Hat, Inc. # # fedmsg 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 2.1 of the License, or (at your option) any later versi...
from django import forms from django.contrib.gis.geos import Point from widgets import AddAnotherWidgetWrapper from django.core.exceptions import ValidationError from .models import (Site, CycleResultSet, Monitor, ProgrammeResources, ProgrammeImage) class SiteForm(forms.ModelForm): latitude ...
# -*- coding: utf-8 -*- """ :codeauthor: Nicole Thomas <nicole@saltstack.com> """ # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals # Create the cloud instance name to be used throughout the tests from tests.integration.cloud.helpers.cloud_test_base import TIMEOUT, Clou...
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import sys import traceback from undebt.cmd import logger from undebt.cmd.logger import log from undebt.cmd.logic import process from undebt.pattern.interface ...
# Copyright 2013-2014 DataStax, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
#------------------------------------------------------------------------------- # Author: amir # Created: 10/25/2015 # # Instructions: # # 1) Make sure to rename the file (studentNetId.py) to your netId. (Do not include your first name, last name ... or any extra character) # 2) To run the program typ...
import os import logging import lzma from binascii import hexlify from io import BytesIO from uuid import UUID from .object import ObjectInfo from .type import TypeMetadata from .utils import BinaryReader class Asset: @classmethod def from_bundle(cls, bundle, buf): ret = cls() ret.bundle = bundle ret.environm...
from contextlib import contextmanager from pprint import pformat import os import subprocess import time import click from dulwich.repo import Repo from dulwich.index import build_index_from_tree from logbook import Logger from tempdir import TempDir from .exc import ReleaseError, InvocationError, PluginError from .g...
import os import subprocess import virtool.utils from virtool.permissions import PERMISSIONS from virtool.users import reconcile_permissions from virtool.history import get_default_isolate from virtool.virusutils import merge_virus def organize_analyses(database): # Make sure all NuVs analysis records reference ...
# 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 https://mozilla.org/MPL/2.0/. from __future__ import absolute_import, print_function from distutils.spawn import find_executable from distutils.vers...
from functools import partial import argparse import itertools import numpy as np from spinn import util # PyTorch import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F import torch.optim as optim from spinn.util.blocks import Embed, to_gpu, MLP from spinn.util.misc i...
# -*- coding: utf-8 -*- import argparse import asyncio import json # import logging import os import sys import time # noqa: F401 from os import _exit from traceback import format_tb # ------------------------------------------------------------------------------ # logging.basicConfig(level=logging.INFO) # ---------...
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
# Copyright (c) 2017 Sony Corporation. 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 applicabl...
import sys if (sys.version_info >= (2,7)): import unittest else: import unittest2 as unittest from pydevtest_common import assertiCmd, assertiCmdFail, getiCmdOutput, create_local_testfile, get_hostname import pydevtest_sessions as s from resource_suite import ResourceSuite, ShortAndSuite from test_chunkydevtest...
############################################ # Copyright (c) 2012 Microsoft Corporation # # Auxiliary scripts for generating Makefiles # and Visual Studio project files. # # Author: Leonardo de Moura (leonardo) ############################################ import sys import os import glob import re import getopt import ...
#!/usr/bin/env python # Copyright (C) 2013-2014 Steven Myint # # 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, mo...
from __future__ import annotations import discord from . import switch, wiiu_support, wiiu_results, ctr_support, ctr_results from discord.ext import commands from typing import Optional, TYPE_CHECKING if TYPE_CHECKING: from kurisu import Kurisu class Results(commands.Cog): """ Parses game console resul...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Functional tests for ZFS filesystem implementation. These tests require the ability to create a new ZFS storage pool (using ``zpool``) and the ability to interact with that pool (using ``zfs``). Further coverage is provided in :module:`flocker.volume.t...
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.45.5" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Peter Mounce <public@neverrunwithscissors.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version...
# version __version__ = '2.0.0' # TODO: torch needs to be imported first # or pybind11 shows `munmap_chunk(): invalid pointer` import torch # submodules from .code_gen import cdiv, next_power_of_2, jit, autotune, heuristics, JITFunction, Config, Autotuner, reinterpret from . import language from . import code_gen from...
from os.path import join import lib.processors as processors from lib.models import FileManager from config import DATA_PATH class Factory: def __init__(self): self.root = DATA_PATH def Difference(self, dest, force=False): return Difference(join(self.root, dest), force) def Identity(sel...
# -*- coding: utf-8 -*- # Tests for the contrib/localflavor/ UK form fields. tests = r""" # UKPostcodeField ############################################################# UKPostcodeField validates that the data is a valid UK postcode. >>> from django.contrib.localflavor.uk.forms import UKPostcodeField >>> f = UKPostco...
""" profilerui """ from __future__ import absolute_import, division, print_function, unicode_literals import logging from PySide import QtGui, QtCore from mcedit2.util import profiler from mcedit2.widgets.layout import Column log = logging.getLogger(__name__) class ProfilerWidget(QtGui.QWidget): def __init...
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python ################################################################################ # Copyright (c) 2011-2019, National Research Foundation (Square Kilometre Array) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may...
from typing import List, Dict, Union from aiohttp.web import Request, Response, HTTPTemporaryRedirect from ._format import JSONResonse, get_match_info_or_error, get_params, HTTPError from .projects import serialise_project_to_json from cogs.db.models import User, Project from cogs.common.constants import JOB_HAZARD_F...
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.44.1" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
#!/usr/bin/python # -*- coding: utf-8 -*- # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'network'} DOCUMENTATION = """ --- module: nxos_interfac...
import numpy as np import scipy.io import os TIMES = ['0000', '0005', '0010', '0020', '0040', '0080', '0160', '0320', '0640', '1280'] CHRS = {k:str(k) for k in range(1, 23)} CHRS[23] = 'X' CHRS[24] = 'Y' CHRS[25] = 'MT' CHRS[-1] = '-1' SPECIALS = (('ENSG00000206310','HSCHR6_MHC_QBL'), ('ENSG0000...
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
#!/usr/bin/env python # -*- coding: utf8 -*- """Build Unihan into datapackage-compatible format.""" from __future__ import (absolute_import, division, print_function, unicode_literals, with_statement) import argparse import fileinput import glob import os import sys import zipfile sys.path.in...
import re from ..utils import open_url class MofLoader(object): def __init__(self, repo, match='', **config): self.repo = repo self.match = match def parse(self, filename): m = re.match(r'^mof(?P<part>\d)_(?P<year>\d{4})' r'_(?P<number>\d+)\.pdf$', filename) ...
# simulate occasional problematic (long blocking) requests within eventlet import eventlet from eventlet.green import socket import random import time NUM_GREEN_THREADS = 5 READ_TIMEOUT = 4 # status codes to indicate whether read succeeded, timed out, or failed STATUS_READ_SUCCESS = 0 STATUS_READ_TIMEOUT = 1 STATU...
# encoding: utf-8 """ bgp.py Created by Thomas Mangin on 2012-07-08. Copyright (c) 2009-2015 Exa Networks. All rights reserved. """ from struct import pack from struct import unpack # =========================================================== RouteDistinguisher # RFC 4364 class RouteDistinguisher (object): __sl...
# -*- coding: utf-8 -*- from __future__ import absolute_import import functools import itertools import lupa from splash.qtrender import RenderScript, stop_on_error from splash.lua import ( table_as_kwargs_method, get_new_runtime, start_main, get_script_source, lua2python, python2lua, ) from s...
#!/usr/bin/env python """ This modele handles file types. """ import os import sys import numpy as np import h5py import six from astropy.coordinates import Angle try: from . import sigproc except: import sigproc # import pdb;# pdb.set_trace() import logging logger = logging.getLogger(__name__) level_log ...
#!/usr/bin/env python """ Wraps a executable to enable that script to be submitted to an SGE cluster engine """ import sys import os.path import argparse from copy import copy import time import subprocess import shutil class SGESubmitter(object): """ This class automates the submission of MPI jobs on a SGE-p...
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Primary container for radio interferometer datasets.""" import os import copy from collections.abc import Iterable import warnings import threading import numpy as np from astropy imp...
#!/usr/bin/env python """ Wraps a executable to enable that script to be submitted to an SGE cluster engine """ import sys import os.path import argparse from copy import copy import time import subprocess import shutil class SGESubmitter(object): """ This class automates the submission of MPI jobs on a SGE-p...
# # spyne - Copyright (C) Spyne contributors. # # This library 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 2.1 of the License, or (at your option) any later version. # # This libra...
# -*- coding: utf-8 -*- # Copyright 2010 Mats Ekberg # # 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...
import numpy as nm import numpy.linalg as nla from sfepy.base.base import find_subclasses, assert_, Struct from sfepy.linalg import combine, insert_strided_axis # Requires fixed vertex numbering! vertex_maps = {3 : [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]...
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Primary container for radio interferometer datasets.""" import os import copy import re import numpy as np import warnings from astropy import constants as const import astropy.units a...
#!/usr/bin/env python """ a release-master multitool """ from __future__ import print_function, unicode_literals import sys from path import path from git import Repo, Commit from git.refs.symbolic import SymbolicReference import argparse from datetime import date, timedelta from dateutil.parser import parse as parse_d...
"""Kytos.core is the module with main classes used in Kytos.""" from kytos.core.controller import Controller from kytos.core.events import KytosEvent from kytos.core.logs import NAppLog from kytos.core.napps import KytosNApp, rest from kytos.core.auth import Authenticated from .metadata import __version__ __all__ = (...
''' inflect.py: correctly generate plurals, ordinals, indefinite articles; convert numbers to words Copyright (C) 2010 Paul Dyson Based upon the Perl module Lingua::EN::Inflect by Damian Conway. This program is free software: you can redistribute it and/or modify it under the terms...
""" `blowdrycss` is a rapid styling tool that compiles DRY CSS from encoded class selectors in your web project files. """ # reference: # http://stackoverflow.com/questions/23164482/created-a-pypi-package-and-it-installs-but-when-run-it-returns-an-import-error#23164865 # ``python setup.py test`` produces 1 failure an...
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
# coding: utf-8 """ Helpful utility functions. """ __all__ = [ "default_lock", "io_lock", "no_value", "rel_path", "law_src_path", "law_home_path", "law_run", "print_err", "abort", "is_number", "try_int", "str_to_int", "colored", "uncolored", "query_choice", "is_pattern", "brace_expand", "multi_match", "i...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from django.contrib.contenttypes.models import ContentType from django.db.models.loading import get_model from django.http import Http404 from haystack.backends import SQ from haystack.query import SearchQuerySet from rest_framework.gen...
#!/usr/bin/env python # # Copyright 2012, Rackspace US, 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 applicab...
import logging import requests import config class Driver(object): def __init__(self, driver_url, name, version, os_type): self._url = driver_url self.name = name self._version = version self.os_type = os_type def get_url(self): url = "{url}/{ver}/{name}_{os}.zip" ...
# Copyright 2020 Google, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import json from utils import is_valid_xml_tag, node from xls2json import print_pyobj_to_json from question_type_dictionary import QUESTION_TYPE_DICT from errors import PyXFormError def _overlay(over, under): if type(under) == dict: result = under.copy() result.update(over) return result ...
__version__ = (2022, 2, 6, '76a59e9e') VERSION = ".".join(map(str, __version__))
#!/usr/bin/env python # encoding: utf-8 """ Modelling with three metallicity groups. """ import argparse from starfisher.pipeline import PipelineBase from androcmd.planes import BasicPhatPlanes from androcmd.phatpipeline import ( ExtendedSolarIsocs, ExtendedSolarLockfile, NoDust, PhatCrowding) from androcmd.p...
"""Contains the code generation logic and helper functions.""" from __future__ import unicode_literals, division, print_function, absolute_import from collections import defaultdict from inspect import ArgSpec from keyword import iskeyword import inspect import sys import re from sqlalchemy import (Enum, ForeignKeyCon...
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_fra...
#!/usr/bin/env python """Sample testing of the Python webscanner client.""" from getpass import getpass import time import sys import urllib.parse import argparse from webscanner_client import WebscannerClient # Change this to the actual URL you want to test against. WEBSCANNER_URL = 'http://localhost:8080' # Relat...
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import os import os.path import json import mwclient import wikidata.client import argparse import time import datetime import pprint parser = argparse.ArgumentParser(description="""Script for testing MediaWiki API""") parser.add_argument("-config",help="""Pat...
from .table import Column, Table class TableTransformer(object): def transform(self, table, *args): """ To be implemented in inherited classes """ return table class TransposeTranformer(TableTransformer): # Fixme: Introduce Dimensions def transform(self, table): "...
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
# -*- coding: utf-8 -*- import time import etcd import json import hashlib import requests from os import environ from argh.decorators import arg, expects_obj from lain_admin_cli.helpers import TwoLevelCommandBase from subprocess import check_output, call from lain_admin_cli.helpers import info, error, sso_login cla...
# -*- coding: utf-8 -*- __author__ = """sloev""" __email__ = 'jgv@trustpilot.com' __version__ = '2.1.0' import json import logging from jsonschema import validate, ValidationError, FormatChecker __validate_kwargs = {"format_checker": FormatChecker()} __required_keys = ["httpMethod"] class Response: """Class...
from base64 import b64decode import time from lampost.di.resource import Injected, module_inject from lampost.db.dbo import KeyDBO, SystemDBO from lampost.db.dbofield import DBOField from lampost.db.exceptions import DataError from lampost.util.encrypt import make_hash, check_password from lampost.util.lputil import C...
import math def _make_brackets_around_atoms(smiles): # first function in the encoder: All atoms are itemized via brackets. # for example: C1=CO1O -> [C]1[=C][O][O]. # Meaning that bond information is treated as part of the atom...
#! /usr/bin/env python """ A class used to create and manage regular square raster grids for 2D numerical models in Landlab. """ import numpy as np import six from six.moves import range from landlab.testing.decorators import track_this_method from landlab.utils import structured_grid as sgrid from landlab.utils impo...
#!/usr/bin/python # @Author: Eddie Ruano # @Date: 2017-05-01 05:14:54 # @Last Modified by: Eddie Ruano # @Last Modified time: 2017-06-04 02:51:29 """ DESI uses two HCSR04 proximity sensors to determine Megan's postition on the treadmill. """ # Libraries import RPi.GPIO as GPIO import time class Voyager(objec...
# The 'normal' cases are tested with test-receive-file.py and test-send-file-provide-immediately.py # This file tests some corner cases import dbus from saluttest import exec_test from file_transfer_helper import ReceiveFileTest, SendFileTest import constants as cs class SendFileNoMetadata(SendFileTest): # this ...
# Copyright (c) 2010-2012, GEM Foundation. # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # OpenQuake is distri...
#!/usr/bin/env python3 """ When doing gene finding with tools like Augustus it's common to take a file of curated genes/transcripts and split these into a set for training and another for evaluation. This script accepts an input GFF3 file and then generates two files, one of genes to use as training and another as ev...
#! /usr/bin/env python import numpy as np import inspect from pylab import show, figure from landlab.field.grouped import FieldError try: import matplotlib.pyplot as plt except ImportError: import warnings warnings.warn('matplotlib not found', ImportWarning) from landlab.grid.raster import RasterModelGrid...
# -*- coding: utf-8 -*- # Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# global x86_64, hostname_id, distro, network_type, virtualization, gui, develop, monitoring, roles # pylama:ignore=E0602 def is_manjaro() -> bool: return distro == "manjaro" # type: ignore def is_x86_64() -> bool: return x86_64 # type: ignore def is_role(name: str) -> bool: return name in roles.spl...
''' -- imports from python libraries -- ''' # import os -- Keep such imports here import json ''' -- imports from installed packages -- ''' from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.http import HttpResponseRedirect from django.http import HttpRespo...
import fnmatch import getpass import glob import gzip import json import yaml try: import pexpect except: print "The pexpect module could not be imported." import os import platform import shutil import socket import tarfile import thread import json import csv import subprocess import commands import signal f...
# # Copyright (C) 2005 Stefan Seefeld # All rights reserved. # Licensed to the public under the terms of the GNU LGPL (>= 2), # see the file COPYING for details. # from Synopsis import AST from Processor import Processor import re class Summarizer(Processor): """Splits comments into summary/detail parts.""" ...
#!/usr/bin/env python # Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # -*- coding: utf-8 -*- import abc import contextlib import copy import csv import json import logging as _logging import os import requests import sys import time from distutils.util import strtobool import numpy as np...
""" mesclan.controllers ~~~~~~~~~~~~~~~~~ """ from functools import wraps from flask import request from ujson import dumps from mesclan import exceptions from mesclan.constants import DEBUG_TOKEN, GET_BOTTLE_FIELDS from mesclan.store import get_bottle def handle_request(func): @wraps(func) def wrapper(*arg...
""" mesclan.controllers ~~~~~~~~~~~~~~~~~ """ from functools import wraps from hashlib import sha256 import logging from urlparse import urljoin from flask import request, Response import requests from sqlalchemy.orm.exc import NoResultFound from ujson import dumps from mesclan import exceptions from mesclan.cache im...
""" I/O for AFLR's UGRID format [1] <http://www.simcenter.msstate.edu/software/downloads/doc/ug_io/3d_grid_file_type_ugrid.html>. Check out [2] <http://www.simcenter.msstate.edu/software/downloads/ug_io/index_simsys_web.php?path=release> for UG_IO C code able to read and convert UGRID files Node ordering described in [...
# Copyright 2012-2015 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agree...
import os import sys BASE_DIR = os.path.dirname(os.path.dirname(__file__)) PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__)) sys.path.insert(0, os.path.join(BASE_DIR, "apps")) ALLOWED_HOSTS = ['*',] SITE_ID = 1 INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.co...
import os as _os import re as _re import errno as _errno import unicodedata as _u import sys as _sys import argparse as _argparse import natsort as _natsort def _doAtomicFileCreation(filePath): """Tries to atomically create the requested file.""" try: _os.close(_os.open(filePath, _os.O_CREAT | _os.O_...
from django.test.client import Client from nose.tools import istest, nottest, assert_true from django.core.urlresolvers import reverse from django.db import transaction from django.conf import settings import re title_re = re.compile("<title>.+?<\/title>",re.I) DEFAULT_SMOKE_TEST_OPTIONS = { 'client' :...
# File: CeParser.py ; This file is part of Twister. # version: 3.002 # Copyright (C) 2012-2014 , Luxoft # Authors: # Andreea Proca <aproca@luxoft.com> # Andrei Costachi <acostachi@luxoft.com> # Cristi Constantin <crconstantin@luxoft.com> # Licensed under the Apache License, Version 2.0 (the "License"); # ...
import numpy as np from ..bath import PseudomodeBath from ..utils import memoized_property from .generic import DynamicalModel, SystemOperator class ZOFESpaceOperator(SystemOperator): def __init__(self, operator, liouv_subspace_map, dynamical_model): """ Parameters ---------- ope...
# tsuserver3, an Attorney Online server # # Copyright (C) 2016 argoneus <argoneuscze@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
from flask import request, jsonify from server import app from os import getenv import json def return_options(x): return {"type": x} @app.route('/homepage', methods=['GET']) def get_homepage(): with open('homepage_options.json') as json_file: data = json.load(json_file) cells = list(map(return_op...
# Copyright 2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...