src
stringlengths
721
1.04M
#!/usr/bin/env python2.7 import sys import os import math # Link parameters link_latency = "10us" link_bandwidth = 10 link_bandwidth_unit = "Gbps" # Convenient math wrappers def floor(x): return int(math.floor(x)) def ceil(x): return int(math.ceil(x)) def pow2(x): return int(math.pow(2,x)) # XML generation funct...
import urlparse from django.core.paginator import EmptyPage, Page, PageNotAnInteger, Paginator from django.http import QueryDict from django.utils.http import urlencode from rest_framework import pagination, serializers class ESPaginator(Paginator): """ A better paginator for search results The normal ...
#!/usr/bin/env python import json import math import re class PManager(object): def __init__(self, pm_data): if isinstance(pm_data, (str, unicode)): self.pm_data = json.loads(pm_data) else: self.pm_data = pm_data self.data = self.pm_data['ks_spaces'] self.k...
### CONFIGURATION ### VERSION = '1.0.1' USERAGEN = '''App: Ultimate Control Version: %s Description: Control Panel for Reddit. Read messages, reply to comments, swap accounts, etc. Known Issues: Possible faults on Mac/Linux Author: /u/Spedwards'''%VERSION ### /CONFIGURATION ### import ctypes,getp...
# Copyright 2012 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...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division import bz2 as _bz2 from numcodecs.abc import Codec from numcodecs.compat import ndarray_copy, ensure_contiguous_ndarray class BZ2(Codec): """Codec providing compression using bzip2 via the Python standard library. Para...
from django_webtest import WebTest from django.contrib.auth.models import User class TestLogInAndGetUserList(WebTest): def testLoginAnGetUsers(self): User.objects.create_user("prairiedogg", **{"password": "my_$pecial_password"}) username_and_password = {"username": "prairiedogg", ...
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2017-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
""" Scrapy crawl commands, wrapped in Luigi tasks. """ import os import os.path import subprocess import luigi class CrawlTask(luigi.Task): """ Crawl a specific city. """ city = luigi.Parameter() def output(self): output_path = os.path.join("data", "{}.jsonl".format(self.city)) return luigi.LocalTarget(...
# Copyright 2018 MLBenchmark Group. 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 applicable l...
""" **************** ISMAGS Algorithm **************** Provides a Python implementation of the ISMAGS algorithm. [1]_ It is capable of finding (subgraph) isomorphisms between two graphs, taking the symmetry of the subgraph into account. In most cases the VF2 algorithm is faster (at least on small graphs) than this im...
import numpy as np import matplotlib.pyplot as plt from astropy.io import fits import aplpy from astropy.wcs import WCS import sys, os from getIQU import IQU from astropy import coordinates as coord from astropy.coordinates import SkyCoord from astropy import units as u from scipy.interpolate import griddata plt.ion() ...
from enum import Enum from typing import Dict, List, Union import bmds from bmds.bmds3.sessions import get_model from bmds.bmds3.types.continuous import ContinuousModelSettings from bmds.bmds3.types.dichotomous import DichotomousModelSettings from bmds.bmds3.types.priors import PriorClass, get_continuous_prior, get_di...
import itertools import numpy as np def flatten_2(data): vector = [] for i in data: for j in i: vector.append(j) return vector def flatten_3(data): return flatten_2(flatten_2(data)) def reshape_2D(vector, rows, cols): data = [] for i in range(0, rows): data.appe...
# -*- coding: utf-8 -*- import mimetypes import os from datetime import datetime, timedelta from unittest.mock import Mock, patch from django.conf import settings from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import NoReverseMatch from django.test.client import RequestFactory from dja...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright 2011 OpenStack LLC. # 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 -*- """ This module implements the Lowess function for nonparametric regression. Functions: lowess Fit a smooth nonparametric regression curve to a scatterplot. For more information, see William S. Cleveland: "Robust locally weighted regression and smoothing scatterplots", Journal of the American St...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from werkzeug import urls from odoo import api, fields, models from odoo.tools.translate import html_translate class RecruitmentSource(models.Model): _inherit = 'hr.recruitment.source' url = fields.Char(compu...
# Copyright (c) 2019 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 ...
import numpy as np from scipy.interpolate import interp1d import warnings from astropy.coordinates import SkyCoord from astropy import __version__ as astropy_version from MulensModel.horizons import Horizons class SatelliteSkyCoord(object): """ An object that gives the *Astropy.SkyCoord* of satellite for a g...
# -*- coding: utf-8 -*- tokens = [ 'LPAREN', 'RPAREN', 'LBRACE', 'RBRACE', 'EQUAL', 'DOUBLE_EQUAL', 'NUMBER', 'COMMA', 'VAR_DEFINITION', 'IF', 'ELSE', 'END', 'ID', 'PRINT' ] t_LPAREN = r"\(" t_RPAREN = r"\)" t_LBRACE = r"\{" t_RBRACE = r"\}" t_EQUAL = r"\=" t_DOU...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2009 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 of t...
import datetime import hashlib import random from cl.users.models import UserProfile from cl.users.utils import emails from django.contrib.sites.models import Site from django.core.mail import send_mail from django.core.management import BaseCommand from django.utils.timezone import now class Command(BaseCommand): ...
__author__ = 'tom' from setuptools import setup # Makes use of the sphinx and sphinx-pypi-upload packages. To build for local development # use 'python setup.py develop'. To upload a version to pypi use 'python setup.py clean sdist upload'. # To build docs use 'python setup.py build_sphinx' and to upload docs to pytho...
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
#!/usr/bin/python # # Copyright 2008 Google 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 by app...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # www.genesilico.pl # #creates ranked 3D models of macromoleular complexes #based on experimental restraints and a whole complex shape. __author__ = "Joanna M. Kasprzak" __copyright__ = "Copyright 2010, The PyRy3D Project" __credits__ = ["Janusz Bujnicki"] __licen...
import re import time import datetime import warnings with warnings.catch_warnings(): warnings.filterwarnings('ignore', '.*compile_mappers.*') import formalchemy from ckan.common import OrderedDict months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'No...
from enum import Enum import owlapy.model class Status(Enum): LEGACY = 0, IN_USE = 1 class BuiltIn(Enum): BUILT_IN = 0, NOT_BUILT_IN = 1 class Namespaces(Enum): OWL2 = ("owl2", "http://www.w3.org/2006/12/owl2#", Status.LEGACY) OWL11XML = ("owl11xml", "http://www.w3.org/2006/12/owl11-xml#"...
''' Description ''' from __future__ import print_function __filename__ = "pgvalidationdefs.py" __date__ = "20170326" __author__ = "Ted Cosart<ted.cosart@umontana.edu>" VERBOSE=False VERY_VERBOSE=False def validateNbAdjustment( s_adjustment, i_highest_cycle_number=1e20 ): ''' 2017_03_08. This def is created to handl...
# -*- coding: utf-8 -*- """ Created on Fri Apr 7 02:30:02 2017 @author: Shabaka """ # ''Load and View Data ''''''''''# # Import pandas import pandas as pd import matplotlib.pyplot as plt # Read the file into a DataFrame: df # df = pd.read_csv('dob_job_application_filings_subset.csv') df = pd.read_csv('fixations....
################################################################################ # Copyright (C) 2016 Advanced Micro Devices, Inc. All rights reserved. # # 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 th...
# -*- coding: utf-8 -*- # vim: set ts=4 # Copyright 2016 Rémi Duraffort # This file is part of ReactOBus. # # ReactOBus 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, ...
################################################################################ # # Copyright 2015-2020 Félix Brezo and Yaiza Rubio # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Softwa...
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, float_or_none, int_or_none, unified_timestamp, ) class FunnyOrDieIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?funnyordie\.com/(?P<type>embed|articles|videos)/(?P<id>[0-9a-f]+)(?:$|[...
from django.test import TestCase from django.shortcuts import resolve_url from django.contrib.auth import get_user_model User = get_user_model() class TestCase(TestCase): def setUp(self): self.user = self.create_user('testuser') def assertStatusCode(self, status_code, fn, urlconf, *args, **kwargs): ...
import arrow from .dialog_manager import DialogManager from .dnd import DoNotDisturbManager from ..functions import Functions from ..skills.predictor import Predictor from ..skills.trello import TrelloManager from ..skills.weather import Weather from ..slack.resource import MsgResource from ..slack.slackbot import...
from sklearn.base import BaseEstimator from collections import Counter import pandas as pd from numpy import sum, nan, isnan from ut.util.uiter import window class NextElementPredictor(BaseEstimator): def predict(self, seqs): preds = self.predict_proba(seqs) return [max(pred, key=lambda key: pr...
# Make an particles.in file import numpy as np from nested_gridforce import Grid # End points of line in grid coordinates (orginal grid) x0, x1 = 148, 148 y0, y1 = 51, 65 # Number of particles along the line Npart = 1000 # Fixed particle depth Z = 5 # Define the grids g = Grid(dict(grid_args=[])) # Original grid ...
#!/usr/bin/env python3 import random import os import torch import unittest import gpytorch from torch import optim from gpytorch.kernels import RBFKernel, AdditiveStructureKernel, GridInterpolationKernel, ScaleKernel from gpytorch.likelihoods import GaussianLikelihood from gpytorch.means import ZeroMean from gpytorc...
############################################################################# ## ## Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). ## Contact: Qt Software Information (qt-info@nokia.com) ## ## This file is part of the Graphics Dojo project on Qt Labs. ## ## This file may be used under the terms of th...
# Copyright IBM Corp. 2015, 2015 All Rights Reserved # Copyright (c) 2010-2016 OpenStack Foundation # # 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/LICEN...
#!/usr/bin/python # -*- encoding: utf-8 -*- import logging import smtplib from email.mime.text import MIMEText from pony_monitor.conf import settings class SMTPConnection(object): """ 以后支持HTML的邮件 """ def __init__(self, host=None, port=None, username=None, password=None, use_tl...
__author__ = 'yuval' import mne from os import chdir #from IPython.display import Image #from mayavi import mlab # mne_bti2fiff.py -p xc,hb,lf,9_34c,rfhp0.1Hz -o idan_raw.fif chdir("/home/yuval/wsMNE/") raw=mne.io.bti.read_raw_bti('xc,hb,lf_c,rfDC') raw.save('idanTest-raw.fif') raw=mne.io.Raw('idanTest-raw.fif') sub...
from time import time from AccessControl import ModuleSecurityInfo, allow_module from bika.lims import logger from bika.lims.browser import BrowserView from DateTime import DateTime from email import Encoders from email.MIMEBase import MIMEBase from plone.memoize import ram from plone.registry.interfaces import IRegist...
import dragonfly import dragonfly.pandahive import bee from bee import connect import math, functools from panda3d.core import NodePath import dragonfly.scene.unbound, dragonfly.scene.bound import dragonfly.std import dragonfly.io import dragonfly.canvas import Spyder # ## random matrix generator from random impor...
# -*- coding: utf-8 -*- # Copyright (c) 2010-2021 OneLogin, Inc. # MIT License import json from os.path import dirname, join, exists import unittest from onelogin.saml2.response import OneLogin_Saml2_Response from onelogin.saml2.settings import OneLogin_Saml2_Settings from onelogin.saml2.utils import OneLogin_Saml2_...
#!/usr/bin/env python2 # Copyright 2015 Dejan D. M. Milosavljevic # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author: zengchunyun """ from twisted.internet import protocol from twisted.internet import reactor class EchoServer(protocol.Protocol): # 创建Protocol的派生类EchoServer def dataReceived(self, data): # 重写父类dataReceived方法,当有接收到客户端发来数据时,会调用此方法,并将用户数据传入 self.tr...
"""Implements a wrapper script for executing a Python program from the command line. The wrapper script works by adding a special directory into the 'PYTHONPATH' environment variable, describing additional Python module search directories, which contains a custom 'sitecustomize' module. When the Python interpreter is ...
from DependencyContainer import DependencyContainer from Deployer import AlreadyDeployed import traceback dc = DependencyContainer() # Step 1 - Check if branch can be deployed def check(branch, server, user, internalCheck=False): checker = dc.getDeploymentChecker(server) result = checker.check(branch) if ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import elements import enums #globals ended = False compteur = 0 map_ = False def init(aMap): global map_ map_ = aMap def robot_init(): global undergroundSensor undergroundSensor = sensor(enums.Level.Underground, 1) global greenActuator greenActuator = actuator...
import os import shutil import subprocess from client_pipeline.mj_preparation import * from pipeline.pipeline_processor import * # setting testing directory test_dir = "d:/test/store_restore" # remove old files workspace = os.path.join(test_dir, "workspace") shutil.rmtree(workspace, ignore_errors=True) # copy file...
# This file has been shamelessly copied (MIT licence) from # https://bitbucket.org/akoha/django-randomfilenamestorage # Conversion to Python 3 by Alexander Nilsson from errno import EEXIST import ntpath import os import posixpath import random import string from warnings import warn from django.conf import settings f...
# -*- coding: utf-8 -*- # Generated by Django 1.11.6 on 2017-11-10 06:40 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('grandprix', '0001_initial'), ] operations = [ ...
from Sire.IO import * from Sire.MM import * from Sire.Mol import * from Sire.CAS import * from Sire.Maths import * from nose.tools import assert_almost_equal rangen = RanGenerator() mol = MoleculeParser.read("../io/ose.top","../io/ose.crd") \ [MolWithResID(ResName("OSE"))].molecule() def _assert_expressions...
from opentuner import MeasurementInterface from opentuner import Result import subprocess, os class ProgramTunerWrapper(MeasurementInterface): def get_qor(self): f = open('results.txt', 'r') while True: line = f.readline() if 'tns' not in line.split(): line = line.rstrip() result...
# -*- coding: utf-8 -*- # Copyright (c) 2016-2017, Thierry Lemeunier <thierry at lemeunier dot net> # 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 reta...
import conf_nodes import libvirt # Established connections connections = {} def connect(node): # Check if connection exists if node in connections: return connections[node] try: print 'connecting with %s' % node conn_str = "qemu+ssh://root@%s/system" % (node) ...
from django.contrib.contenttypes.generic import GenericRelation from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from django.db import models from django.db.models.query import QuerySet from django.db.models.fields.related import ManyToOneRel from django.for...
# Copyright (c) 2015 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
##################################################################### # s01f00.py # # (c) Copyright 2021, Benjamin Parzella. All rights reserved. # # 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 Fou...
import imp import os import sys module_name = 'cloudpassage' here_dir = os.path.dirname(os.path.abspath(__file__)) module_path = os.path.join(here_dir, '../../') sys.path.append(module_path) fp, pathname, description = imp.find_module(module_name) cloudpassage = imp.load_module(module_name, fp, pathname, description)...
#!/usr/bin/env python # # Copyright 2019 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Writes Java module descriptor to srcjar file.""" import argparse import os import sys import zipfile sys.path.append( os.path...
# Copyright 2019-2020 The Wazo Authors (see the AUTHORS file) # SPDX-License-Identifier: GPL-3.0-or-later import json import logging from threading import Thread import websocket from wazo_auth.exceptions import ExternalAuthAlreadyExists from wazo_auth.database.helpers import commit_or_rollback from .helpers import...
from typing import Dict, List, Tuple import pandas._libs.json as json from pandas.io.excel._base import ExcelWriter from pandas.io.excel._util import validate_freeze_panes class _XlsxStyler: # Map from openpyxl-oriented styles to flatter xlsxwriter representation # Ordering necessary for both determinism an...
import sqlite3 def sanitize(x): return x class KDB: def __init__(self,db): self.db = db # def create(self,*keys): for key in keys: key = sanitize(key) self.execute('create table if not exists {} (k primary key) without rowid'.format(key)) def drop(self,*keys): for key in keys: key = sanitize(key) ...
# # The contents of this file are subject to the Apache 2.0 license you may not # use this file except in compliance with the License. # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License # for the specific language gov...
from datetime import date, timedelta from patient import Patient, Prescription # to run these tests, use py.test (http://pytest.org/) class TestPatient: def test_clash_with_no_prescriptions(self): patient = Patient(prescriptions=[]) assert patient.clash([]) == set() def test_clas...
# -*- coding: utf-8 -*- """ dttools ````````````` """ """ Part of DigitizingTools, a QGIS plugin that subsumes different tools neded during digitizing sessions * begin : 2013-02-25 * copyright : (C) 2013 by Bernhard Ströbl * email : bernhard.stroebl@jena.de This program is free ...
from __future__ import division, print_function print(""" Numerical homogenisation based on exact integration, which is described in J. Vondrejc, Improved guaranteed computable bounds on homogenized properties of periodic media by FourierGalerkin method with exact integration, Int. J. Numer. Methods Eng., 2016. This ...
from ommit_words import list_ommited_words from re import sub import operator class _input_list: def __init__(self,list_TITLES): self.list_TITLES = list_TITLES self.list_remove = list_ommited_words() def _word_count(self): # these are all the words that are in t...
#!/usr/bin/env python import os.path import sys from gi.repository import Gtk, Gio, Gdk, GObject from asciiplayback import * from asciimation import * from gtkasciiplayer import * class ASCIIPlaybackGtk(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="ASCIIPlayback") self.set_def...
#!/usr/bin/env python # # Copyright (c) 2014 Rafael Martinez Guerrero (PostgreSQL-es) # rafael@postgresql.org.es / http://www.postgresql.org.es/ # # This file is part of Nmap2db # https://github.com/rafaelma/nmap2db # # Nmap2db is free software: you can redistribute it and/or modify # it under the terms of the GNU Gene...
# This program 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. # # This program is distributed in the hope that it will be usefu...
# show GPS page from datetime import datetime, timedelta import pygame from pygame.locals import * import math from plotSky import plotSky R90 = math.radians(90) # 90 degrees in radians class showGPS(): def getxy(self, alt, azi): # alt, az in radians # thanks to John at Wobbleworks for the algorithm r = (R90 ...
""" Server master: The server is almighty. Every frame, it receives player inputs from clients, executes these inputs to update the game state, and sends the whole game state to all the clients for display. """ from __future__ import division # So to make division be float instead of int from network import Listener...
# Copyright (c) 2011, 2012 by California Institute of Technology # 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...
import os, collections, threading, Queue, time import win32api import win32com.client import pythoncom, pyHook """ MessageName: key down Message: 256 Time: 112416317 Window: 197094 WindowName: Emacs/Python <ruttbe@LAGER> hookit.py Ascii: 120 x Key: X KeyID: 88 ScanCode: 45 Extended: 0 Injected: 0 Alt 0 Transition 0 "...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'findWidget.ui' # # Created by: PyQt5 UI code generator 5.7.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_FindWidget(object): def setupUi(self, FindWidget): FindWi...
# -*- coding: utf-8 -*- """ quickbook3.auth ~~~~~~~~~~~~~ This module contains a quickbook authentication service that implements the OAuth 1.0/a auth flow using rauth.OAuth1Service """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ impor...
# # MAKEPLOTS--A library for making plots for demaniacs # # # from pylab import * import numpy def plotframe(data): """Plot the entire data array returns a figure """ nimg = 10 ywidth = 0.08 xlen = len(data[0]) / nimg for i in range(nimg): yax = 0.90 - ywidth * 1.1 * i ...
# 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...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2018 David Arroyo Menéndez # Author: David Arroyo Menéndez <davidam@gnu.org> # Maintainer: David Arroyo Menéndez <davidam@gnu.org> # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ] operations = [ migrations.CreateModel( name='Invalidation', ...
# Copyright 2016 Google 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 by applicable law or a...
from odoo import models class WizardImportFatturapa(models.TransientModel): _inherit = "wizard.import.fatturapa" def _prepare_generic_line_data(self, line): retLine = {} account_tax_model = self.env['account.tax'] if float(line.AliquotaIVA) == 0.0 and line.Natura.startswith('N6'): ...
# # This file is a part of the normalize python library # # normalize is free software: you can redistribute it and/or modify # it under the terms of the MIT License. # # normalize is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FI...
""" records.assessment.edx.multi_choice_records.py """ from random import shuffle from ..basic.base_records import ItemWithWrongAnswerLOsRecord from ..basic.simple_records import QuestionFilesRecord,\ QuestionTextAndFilesMixin from ..basic.multi_choice_records import MultiChoiceTextQuestionRecord,\ MultiChoice...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
import logging import os import os.path as op import re import uuid from flask.globals import _request_ctx_stack from werkzeug.datastructures import FileStorage from werkzeug.utils import secure_filename from wtforms import ValidationError try: from flask import _app_ctx_stack except ImportError: _app_ctx_sta...
# Lint as: python3 # Copyright 2020 DeepMind Technologies Limited. 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 # # U...
# This file is part of geometriki. # # geometriki 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. # # geometriki is distributed ...
"""This file is part of DING0, the DIstribution Network GeneratOr. DING0 is a tool to generate synthetic medium and low voltage power distribution grids based on open data. It is developed in the project open_eGo: https://openegoproject.wordpress.com DING0 lives at github: https://github.com/openego/ding0/ The docume...
# -*- coding: UTF-8 """ nya.sh html parser Classes ======= Parser -- Parser implementation Attributes ========== NYA_SH_SOURCE_NAME -- Source name constant """ import html from html.parser import HTMLParser from lxml.html import HtmlElement from pyquery import PyQuery from ._base import * __all__ = ['Par...
""" SQLite3 backend for the sqlite3 module in the standard library. """ import decimal import math import re import warnings from sqlite3 import dbapi2 as Database import pytz from django.core.exceptions import ImproperlyConfigured from django.db import utils from django.db.backends import utils as backend_utils from...
from cornice import Service import datetime import hashlib import transaction import convert from models import Action, DBSession, Entity, EntityType, Event, Group, Order, PriceChange, Shares, Transaction, User, \ UserData, ValueChange # ********** Cornice Services ********** # root = Service(name='index', path=...
#!/usr/bin/env python # # Copyright (c) 2001 - 2016 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the right...