src
stringlengths
721
1.04M
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009-2012 Zuza Software Foundation # # This file is part of Pootle. # # 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...
# -*- coding: utf-8 -*- from django.test.client import Client from transifex.languages.models import Language from transifex.resources.models import Resource from transifex.txcommon.tests.base import BaseTestCase class StatusCodesTest(BaseTestCase): """Test that all app URLs return correct status code. Moreo...
# -*-: coding utf-8 -*- """ Downloader for Snips assistants. """ import os import shutil from .os_helpers import cmd_exists, is_raspi_os, execute_command, pipe_commands from .. import ASOUNDCONF_DEST_PATH # pylint: disable=too-few-public-methods class MicrophoneSetup: """ Downloader for Snips assistants. """ ...
""" Routines for filling missing data. """ import operator import numpy as np from pandas._libs import algos, lib from pandas.compat._optional import import_optional_dependency from pandas.core.dtypes.cast import infer_dtype_from_array from pandas.core.dtypes.common import ( ensure_float64, is_datetime64_dtype, ...
# -*- coding: utf-8 -*- """@package Reader Módulo que analiza el código fuente @author Arias Emmanuel @date 24/10/2016 """ from Reader import Reader from enum import Enum import string import numpy as np class campoCaracter: def __init__(self): self.mVariable = np.array([['A', 'B', 'C', 'D', 'E', '...
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 conditions and the following d...
"""ACME protocol messages.""" import collections from acme import challenges from acme import errors from acme import fields from acme import jose from acme import util class Error(jose.JSONObjectWithFields, errors.Error): """ACME error. https://tools.ietf.org/html/draft-ietf-appsawg-http-problem-00 :i...
import SRenderLib from asmutils import * def create_mod(util): print '\nSearching for mappings for ASMVillageMarker...' SRenderLib.setup_lib(util) lines = util.readj('World') pos = findOps(lines,0,[['.field','protected',';'],['.field','protected','Z'],['.field','protected',';'],['.field','protected',...
#!/usr/bin/env python import threading import rospy from visualization_msgs.msg import Marker, MarkerArray class Visualizer(object): def __init__(self): self._current_pub_path = [] self.run = False self.t = None self.t = threading.Thread(target=self._startPathPub) self.t....
""" [Amun - low interaction honeypot] Copyright (C) [2014] [Jan Goebel] 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 ...
# # Dalton Burke # # Test correct functionality of the retrieval of level0 files import os import subprocess import datetime import shutil # Set root directory of wrfxpy as working directory script_path = os.path.realpath(__file__) # + 6 gets us to wrfxpy index = script_path.find('wrfxpy/tests') + 6 os.chdir(scrip...
#!/usr/bin/env python import os def application(environ, start_response): ctype = 'text/plain' if environ['PATH_INFO'] == '/health': response_body = "1" elif environ['PATH_INFO'] == '/env': response_body = ['%s: %s' % (key, value) for key, value in sorted(environ.items(...
# Copyright (C) 2012 Equinor ASA, Norway. # # The file 'ert_template.py' is part of ERT - Ensemble based Reservoir Tool. # # ERT 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 Li...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from exam import around, fixture from django.db.models.signals import pre_save, post_save from ..models import Translation from .base import BaseTestCase from .models import BarModel class PostDeleteSignalTest(BaseTestCase): """ Tests Linguis...
################################################################################### # # Copyright (c) 2017-2019 MuK IT GmbH. # # This file is part of MuK Documents Actions # (see https://mukit.at). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU A...
from django.core.management.base import BaseCommand, CommandError from django.core.urlresolvers import reverse from boto1.models import Image, Hit, Result from optparse import make_option import boto import boto.mturk import boto.mturk.connection from .create_hits import get_connection import json import time, d...
# # Copyright 2014-2015 Boundary, 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...
# Copyright 2016, Tresys Technology, LLC # # This file is part of SETools. # # SETools 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 ...
from app import db from app.models.interviews import InterviewSevenDays, InterviewNinetyDays from flask import Blueprint, make_response, jsonify from flask_cors import cross_origin from flask_login import login_required # instantiate the module's blueprint interviews = Blueprint('interviews', __name__, template_folder...
#!/usr/bin/env python # coding: Latin-1 # Load library functions we want import SocketServer import RPi.GPIO as io io.setmode(io.BCM) # Constant values # PWM_MAX = 100 # Disable warning from GPIO io.setwarnings(False) # Here we configure the GPIO settings for the left and right motors spinning dire...
from __future__ import unicode_literals from haystack.forms import FacetedSearchForm from django import forms from django.db import models from django.apps import apps from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ from haystack import connections from haystack.constants...
#!/bin/env python """ tests for SSHComputingElement module """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil import subprocess32 as subprocess import shlex import pytest import DIRAC from DIRAC.Resources.Computing.SSHComputingElem...
from hut import Hut, create_unit from functions import print_bold, print_dotted_line, show_health, \ print_wave_line from knight import Knight from uniterror import HutNotNumberError, HutOutRangeError class OrGame(): """ The Game Class , mainly """ def __init__(self, hut_numbers=5): """ge...
__problem_title__ = "Integer angled Quadrilaterals" __problem_url___ = "https://projecteuler.net/problem=177" __problem_description__ = "Let ABCD be a convex quadrilateral, with diagonals AC and BD. At each " \ "vertex the diagonal makes an angle with each of the two sides, " \ ...
# Copyright (C) 2012~2014 by Yichao Yu # yyc1992@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 option) any later version. # # This pr...
# Copyright (c) The University of Edinburgh 2014 # # 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 agr...
# -*- coding: utf-8 -*- # # Copyright 2015 Simone Campagna # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
#!/usr/bin/env python # # $Id: mask_ip.py 9318 2011-06-10 02:37:10Z nathan_george $ # # Proprietary and confidential. # Copyright $Date:: 2011#$ Perfect Search Corporation. # All rights reserved. import os import shutil import sandbox from common import * _UBER_BUILD_SCRIPT = 'pom.xml' def _remove_with_chmod(path): ...
######################################################### ## ## Prepare command line to run a rendering processing from *.bat ## ## Github repo - https://github.com/Neill3d/MoPlugs ## Licensed under BSD 3-clause ## https://github.com/Neill3d/MoPlugs/blob/master/LICENSE ## ## Author Sergey Solokhin (Neill3d) 2017 ## ...
from __future__ import print_function # http://pyrocko.org - GPLv3 # # The Pyrocko Developers, 21st Century # ---|P------/S----------~Lg---------- import sys import logging import os.path as op from optparse import OptionParser from pyrocko import util, scenario, guts, gf from pyrocko import __version__ logger = lo...
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=3> # Example from pycse 1 # <codecell> # copied from http://kitchingroup.cheme.cmu.edu/blog/tag/events/ from pycse import odelay import matplotlib.pyplot as plt import numpy as np def ode(Y,x): y1, y2 = Y dy1dx = y2 dy2dx = -y1 ...
import tempfile from PIL import Image from django.test import Client, override_settings from django.urls import reverse from test_plus.test import TestCase from bootcamp.articles.models import Article def get_temp_img(): size = (200, 200) color = (255, 0, 0, 0) with tempfile.NamedTemporaryFile(suffix=...
#!/usr/bin/env python ''' Generate a graph with weight using student id with a fix predefined number of edges. Draw a graph with matplotlib. Must have matplotlib and NetworkX for this to work. ''' __author__ = """Rizauddin Saian (rizauddin@perlis.uitm.edu.my)""" try: import matplotlib.pyplot as plt import netw...
#02.05.2015 #Ivan "mrven" Vostrikov bl_info = { "name": "Origin Align", 'author': 'Ivan Vostrikov', 'version': (1, 0, 1), 'blender': (2, 7, 4), 'location': '3d view > Object > Origin Align X/Y/Z', 'description': 'In object mode, sets object origin to selected axis of 3D Cursor', 'wiki_url'...
""" This file is part of the TheLMA (THe Laboratory Management Application) project. See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information. Sample molecule table. """ from sqlalchemy import CheckConstraint from sqlalchemy import Column from sqlalchemy import DateTime from sqlalchemy import Float ...
# -*- coding: utf-8 -*- """Module cwl. Produces simulation calculation and figures for the Cooperate With/Without Looking project. Usage: python cwl.py {recalculate?} Examples: python cwl.py run using pre-calculated saved data python cwl.py recalculate run with freshly calculated data @...
"""Concatenate and resample LTDATA""" import sys sys.path.append("../") from utils.utils import * import os folder=config.features_folder if not os.path.exists(folder): os.makedirs(folder) # Function to read the csv file and converting time def parse_ltdata(filename, dropna=True): df = pd.read_csv(config....
import datetime import logging import ldap3 from celery import Celery from flask import render_template from flask.ext.mail import Message from grumpy_inspect.app import app as flask_app from grumpy_inspect.connectors import process_connectors from grumpy_inspect.models import db, VirtualMachine, Notification from g...
#!/usr/bin/env python # ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ class for handling .bb files Reads a .bb file and obtains its metadata """ # Copyright (C) 2003, 2004 Chris Larson # Copyright (C) 2003, 2004 Phil Blundell # # This program is free softwar...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # flake8: noqa # # django-pyc documentation build configuration file # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration va...
import unittest from six import StringIO from tests.run_command import last_line_of class TestTrashPutIssueMessage(unittest.TestCase): def setUp(self): self.out = StringIO() def test_trash_empty_last_line(self): from trashcli.empty import EmptyCmd from trashcli.fs import FileSystem...
from functools import wraps from hyperspy.component import Component _CLASS_DOC = \ """%s component (created with Expression). .. math:: f(x) = %s """ def _fill_function_args(fn): @wraps(fn) def fn_wrapped(self, x): return fn(x, *[p.value for p in self.parameters]) return fn_wrapped ...
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os import shutil from builtins import object from pants.base.file_system_project_...
import sys import os.path sys.path.append(os.path.abspath(os.path.join(os.pardir,os.pardir))) import disaggregator as da import disaggregator.PecanStreetDatasetAdapter as psda import pylearn2.datasets as ds import pickle import argparse if __name__ == "__main__": parser = argparse.ArgumentParser(description='crea...
# /ciscripts/deploy/conan/deploy.py # # Copy directories into place to prepare for publishing conan project # # See /LICENCE.md for Copyright information """Copy directories into place to prepare for publishing conan project.""" import argparse import json import os from contextlib import contextmanager try: f...
# -*- coding: utf-8 -*- #= DESCRIZIONE ================================================================= # SCRIPT CESTINATO (prototipo delle plants) # mirtilli rossi # semplice progetto d'ecosistema su mirtillo rosso # il DROP in locazioni opportune del seme di mirtillo rosso # origina una sequenza di callLater che ...
import random from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, UserManager from django.db import models, transaction from django.core.mail import send_mail from django.core import validators from django.utils import timezone from django.core.validators import RegexValidator, ValidationError f...
import pandas as pd import pytest import featuretools as ft from featuretools import EntitySet, Relationship, variable_types from featuretools.tests.testing_utils import backward_path, forward_path def test_cannot_re_add_relationships_that_already_exists(es): before_len = len(es.relationships) es.add_relatio...
#! /usr/bin/env python # @author wtie@cisco.com import logging import os import time import itertools import ansible.runner from logging.handlers import SysLogHandler from neutronclient.common.exceptions import NeutronClientException from neutronclient.v2_0 import client LOG = logging.getLogger('neutron-l3-evacuate')...
# -*- coding: utf-8 -*- """ Extension that generates configuration files for Yelp `pre-commit`_. .. _pre-commit: http://pre-commit.com """ from __future__ import absolute_import from ..templates import pre_commit_config from ..api import Extension from ..api import helpers class PreCommit(Extension): """Generat...
#!/usr/bin/env python # -*- coding: utf-8 -*- import gitlab import os import config_parser as CP from datetime import datetime import sys from dmrlogger import Syslogger from dmrlogger import Filelogger from time import sleep import subprocess abs_path = os.path.abspath(__file__) path_list = abs_path.split("/") del ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import keystoneclient import keystoneclient.auth.identity.v3 import keystoneclient.session import keystoneclient.v3.client import novaclient.client import local_settings auth = keystoneclient.auth.identity.v3.Password(auth_url=local_settings.a...
# Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
import os from authomatic.providers import oauth2, oauth1 from application.auth_providers import Eventbrite # Get application base dir. _basedir = os.path.abspath(os.path.dirname(__file__)) STATIC_ROOT = 'static' SQLALCHEMY_DATABASE_URI = os.environ['DATABASE_URL'] SQLALCHEMY_ECHO = False SPARKPOST_API_KEY = os.envir...
import tensorflow as tf import tensorflow.contrib.slim as slim import numpy as np import selu from common import * def discriminator_parameters(parser): group = parser.add_argument_group('Discriminator Network Parameters', description='These parameters control the structure of the discriminator / critic network.'...
""" 1000 Lockers Problem. In an imaginary high school there exist 1000 lockers labelled 1, 2, ..., 1000. All of them are closed. 1000 students are to "toggle" a locker's state. * The first student toggles all of them * The second one toggles every other one (i.e, 2, 4, 6, ...) * The third one toggles the multiples of 3...
#!/usr/bin/env python """ uavsar_insar_download.py : Download UAVSAR InSAR data from ASF through the password protection Usage: .. code-block:: bash $ uavsar_insar_download.py url [options] Parameter --------- url : Any single URL corresponding to the desired UAVSAR data Options ------- para : da...
#! /usr/bin/env python3 #----------------------------------------------------------------------------- # nominatim - [description] #----------------------------------------------------------------------------- # # Indexing tool for the Nominatim database. # # Based on C version by Brian Quinion # # This program is free...
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: gettext import locale, copy, os, re, struct, sys from errno import ENOENT __all__ = ['NullTranslations', 'GNUTranslations', 'Catalog', 'find', 'translation', 'install', 'textdomain', 'bindtextdomain', 'dgettext', 'dngettext', 'gettext', ...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.test_mail_full.tests.common import TestMailFullCommon, TestRecipients class TestSMSComposerComment(TestMailFullCommon, TestRecipients): """ TODO LIST * add test for default_res_model / defaul...
import abc import os import fnmatch import random from typing import Dict from collections import OrderedDict class ImageDirectory(abc.ABC): def __getitem__(self, index: int) -> str: return self.images[index] images: Dict[int, str] def __iter__(self): # yield from self.images.values() ...
import functools import logging from unittest.mock import patch, MagicMock import httpx from vcr.request import Request as VcrRequest from vcr.errors import CannotOverwriteExistingCassetteException _logger = logging.getLogger(__name__) def _transform_headers(httpx_reponse): """ Some headers can appear mult...
from app.models import db, Term, Description from app.bot.rule import Rule, ForceChangeStateException, transition from app.bot.reply_generator import ListTemplate, ButtonTemplate, GenericTemplate STATE_NEW = 'new' STATE_POKEMON_SEARCH = 'STATE_POKEMON_SEARCH' STATE_POKEMON_SEARCH_OK = 'STATE_POKEMON_SEARCH_OK' STATE_...
# 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...
# Copyright 2015: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
# -*- coding: utf-8 -*- # # Antes de executar: # # > pip install requests # # import sys import requests from requests.packages.urllib3.exceptions import InsecureRequestWarning from requests.auth import HTTPBasicAuth import xml.etree.ElementTree as ET CONNECTIONS_HOST = 'https://connections.<company>.com' CONNECTIONS_...
""" Copyright (c) 2019 Ad Schellevis <ad@opnsense.org> 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, ...
## \file merge.py # \brief python package for merging meshes # \author T. Economon, T. Lukaczyk, F. Palacios # \version 7.0.3 "Blackbird" # # SU2 Project Website: https://su2code.github.io # # The SU2 Project is maintained by the SU2 Foundation # (http://su2foundation.org) # # Copyright 2012-2020, SU2 Contributors...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
# -*- coding: utf-8 -*- """Query builder.""" import json import logging import random from collections import UserList from typing import Any, Dict, List, Set, TextIO, Union from .constants import SEED_TYPE_ANNOTATION, SEED_TYPE_INDUCTION, SEED_TYPE_NEIGHBORS, SEED_TYPE_SAMPLE from .selection import get_subgraph fro...
class UserError(RuntimeError): ''' An error that should be reported to the user. ''' class ExistenceError(UserError): ''' Something exists that prevents an operation from occuring, or something does not exist that is required for an operation. ''' class NoSuchFileError(ExistenceError, F...
# # Copyright 2016 Quantopian, 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 wr...
# -*- coding: utf-8 -*- # Copyright 2015 Metaswitch Networks # # 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 sys from collections import OrderedDict import numpy as np import pandas as pd from path_helpers import path from vpr_netfile_parser.VprNetParser import cVprNetFileParser try: profile except NameError: profile = lambda f: f INPUT_DRIVER_PIN = 0 LOGIC_DRIVER_PIN = 4 LOGIC_BLOCK = 0 INPUT_BLOCK = 1 OU...
import warnings import itertools import sys import pytest import numpy as np import numpy.core._umath_tests as umt import numpy.linalg._umath_linalg as uml import numpy.core._operand_flag_tests as opflag_tests import numpy.core._rational_tests as _rational_tests from numpy.testing import ( assert_, assert_equal, ...
import Object3DQt as qt import SceneGLWidget import OpenGL.GL as GL import numpy rasters = numpy.array([ [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00], [0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18], [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,...
#!/usr/bin/env python # -*- coding: utf-8 -*- import calendar from datetime import timedelta from nose.tools import ok_ from py_utilities.time.date_utilities import EPOCH_AS_STRUCT_TIME from py_utilities.time.date_utilities import EPOCH_AS_DATETIME from py_utilities.time.date_utilities import next_day from py_utilitie...
# -*- coding: utf-8 -*- """ Created on Wed Oct 12 11:36:14 2016 @author: Badr Youbi Idrissi """ import pygame import pygame.gfxdraw import numpy as np from pygame.locals import * from individu import Individu from phenotype import Phenotype from population import Population from datadisplay import DataDisplay import ...
import re import json from marshmallow import fields, ValidationError from bson.objectid import ObjectId class JSONStringField(fields.Field): def _serialize(self, value, attr, obj): return value def _deserialize(self, value, attr, data): try: json.loads(value) return ...
""" Yandere Crawler """ from requests import ConnectTimeout, get from file_logger.file_logger import FileLogger from crawler.crawler import Crawler from crawler.selector import Selector from request.request_async import AsyncRequestScheduler from crawler.yandere.handler import QueryPageHandler from crawler.yandere.par...
# -*- Mode: Python; py-indent-offset: 4 -*- # vim: tabstop=4 shiftwidth=4 expandtab import unittest import pytest import gi try: gi.require_foreign('cairo') import cairo has_cairo = True except ImportError: has_cairo = False has_region = has_cairo and hasattr(cairo, "Region") try: from gi.repos...
from flask import abort, request from werkzeug.datastructures import MultiDict def _get_locations(): params = { 'args': None, 'json': None, 'headers': None, 'cookies': None, } if request.args: params['args'] = request.args.copy() if request.get_json(): p...
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + from __future__ import (absolute_import, divi...
# Copyright (C) 2012 Aldo Cortesi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in ...
#!/usr/bin/env python # # The MIT License (MIT) # # Copyright (c) 2014-2021 David Goh <david@goh.id.au> # # 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 withou...
#This file is part of ChiVO, the Chilean Virtual Observatory #A project sponsored by FONDEF (D11I1060) #Copyright (C) 2015 Universidad Tecnica Federico Santa Maria Mauricio Solar # Marcelo Mendoza # Universidad de Chile Die...
from __future__ import absolute_import import functools import inspect import sys __all__ = [ 'apply_ctx', 'sse_event', ] def _sse_encode(k, v): # splitlines() discards the last trailing newline. Append an unambiguous # newline so that the presence or absence of a trailing newline in the # input...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import unittest import erpnext import frappe from dateutil.relativedelta import relativedelta from erpnext.accounts.utils import get_fiscal_year, getdate...
# -*- coding: utf-8 -*- """ application ~~~~~~~~~~~ Main entry point for for rdrei.net. :copyright: 2010, Pascal Hartig <phartig@rdrei.net> :license: GPL v3, see doc/LICENSE for more details. """ from flask import Flask, g, session from rdrei import settings, __version__ app = Flask('rdrei') app.config.from_object(...
""" dialogs for ErMagicBuilder """ # pylint: disable=W0612,C0111,C0103,W0201,C0301 import os import wx import wx.grid import numpy as np from . import drop_down_menus2 as drop_down_menus from . import pmag_widgets as pw from . import magic_grid2 as magic_grid from . import grid_frame2 from . import grid_frame3 from pma...
# coding: utf-8 import base64 from io import BytesIO from unittest import TestCase import xlwt from formpack.constants import KOBO_LOCK_SHEET from formpack.utils.kobo_locking import ( get_kobo_locking_profiles, revert_kobo_lock_structure, strip_kobo_locking_profile, ) from formpack.utils.exceptions impor...
import sat import ptnet import z3 from util import * from encoding import * class MergingEquivalence : def __init__ (self, domain) : self.domain = domain def is_in_domain (self, it) : for x in it : if x not in self.domain : raise LookupError, "'%s' is not in the d...
# Copyright 2017 Battelle Energy Alliance, 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 t...
''' Created on 03/11/2009 @author: Fernando Copyright 2009-2013 Fernando J. V. da Silva This file is part of centering_py. centering_py 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 Fo...
from bike.query.findDefinition import findAllPossibleDefinitionsByCoords from bike.query.findReferences import findReferences from bike.parsing.parserutils import maskStringsAndRemoveComments, linecontinueRE from bike.transformer.undo import getUndoStack from bike.transformer.save import queueFileToSave from parser imp...
"""Provides internationalization for arrow in over 60 languages and dialects.""" import sys from math import trunc from typing import ( Any, ClassVar, Dict, List, Mapping, Optional, Sequence, Tuple, Type, Union, cast, ) if sys.version_info < (3, 8): # pragma: no cover ...
from __future__ import division, print_function import os class HyGroup(object): """ Class for initializing ``HyPath`` container object. :superclass: for ``TrajectoryGroup`` and ``ClusterGroup``. """ def __init__(self, trajectories): """ Initialize ``HyGroup``. Paramet...
""" ============================== OBO Ontology (:mod:`ontology`) ============================== This module provides an interface for parsing, creating and manipulating of `OBO ontologies <http://www.obofoundry.org/>`_. Construct an ontology from scratch with custom terms :: >>> term = OBOObject("Term", id="foo...
from time import clock from math import sqrt #19340598 def timer(function): def wrapper(*args, **kwargs): start = clock() print(function(*args, **kwargs)) print("Solution took: %f seconds." % (clock() - start)) return wrapper @timer def find_answer(): total = 0 maximum = 10 *...
import unittest from mygrations.formats.mysql.file_reader.parsers.type_plain import type_plain class test_type_plain(unittest.TestCase): def test_simple(self): # parse typical insert values parser = type_plain() returned = parser.parse("created date NOT NULL DEFAULT 'bob',") self....