code
stringlengths
1
199k
""" OpenSfM related utils """ import os, shutil, sys, json, argparse import yaml from opendm import io from opendm import log from opendm import system from opendm import context from opendm import camera from opendm.utils import get_depthmap_resolution from opendm.photo import find_largest_photo_dim from opensfm.large...
def search(L, e): def bSearch(L, e, low, high): if high == low: return L[low] == e mid = (low + high) // 2 if L[mid] == e: return True elif L[mid] > e: if low == mid: return False else: return bSearch(L, ...
import INN import datetime import logging import logging.handlers import os import os.path import re import shelve import sys import time import traceback try: from email.utils import parseaddr except ImportError: from email.Utils import parseaddr try: from hashlib import md5 except ImportError: from md...
import re import numpy as np def get_DimX_DimY_from_Filename(FN): res = re.search(r"(\d*)x(\d*)", FN) return (np.int32(res.group(1)), np.int32(res.group(2))) def fromStartToBracket(Str): res = re.search(r"::(.*)\sat", Str) return (res.group(1))
"""Test class for Locations UI""" from fauxfactory import gen_ipaddr, gen_string from nailgun import entities from robottelo.config import settings from robottelo.datafactory import generate_strings_list, invalid_values_list from robottelo.decorators import run_only_on, tier1, tier2 from robottelo.constants import ( ...
"""litchi URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
def solution(n): # Print the arguments print('n = {}'.format(n)) roman_blueprint = [] # List of lists to store format structure: [[<letter>, <count>], ...] result = [] # Store the final roman numeral result # Calculate for roman numerals # Calculate the I's -- 1 numI = n % 5 # Do modulo 5, since we want to...
import os import sys from tadek import models from tadek import teststeps from tadek import testcases from tadek import testsuites from tadek.core import locale from tadek.core.structs import ErrorBox _DIRS_MAP = { "models": models, "teststeps": teststeps, "testcases": testcases, "testsuites": testsuite...
from __future__ import (absolute_import, unicode_literals) from mantidqt.utils.qt import import_qt WorkspaceTreeWidget = import_qt('..._common', 'mantidqt.widgets.workspacewidget', 'WorkspaceTreeWidgetSimple')
from ll1_symbols import * YAML_OUTPUT = """terminals: %s non-terminals: %s eof-marker: %s error-marker: %s start-symbol: %s productions: %s table: %s""" YAML_OUTPUT_NO_TABLE = """terminals: %s non-terminals: %s eof-marker: %s error-marker: %s start-symbol: %s productions: %s""" class YamlGenerator(object): """docstrin...
""" Unit tests over SQLite backend for Crash Database """ from apport.report import Report import os from unittest import TestCase from sqlite import CrashDatabase class CrashDatabaseTestCase(TestCase): def setUp(self): self.crash_base = os.path.sep + 'tmp' self.crash_base_url = 'file://' + self.cra...
from django.test import Client from django.urls import reverse from nmkapp import views from .nmk_unit_test_case import NmkUnitTestCase class ResultsTests(NmkUnitTestCase): def test_anon_user(self): """ Test result view with anonymous user """ self.client = Client() response ...
from pyrser import fmt from pyrser.type_system.signature import * from pyrser.type_system.type_name import * class Val(Signature): """ Describe a value signature for the language """ nvalues = 0 valuniq = dict() def __init__(self, value, tret: str): if not isinstance(value, str): ...
import time from unittest import TestCase from formalign.settings import CHROME_DRIVER, SERVER_URL from selenium import webdriver from selenium.webdriver.common.keys import Keys import pyperclip from helper_funcs.helpers_test import file_to_string class BasicUserTestCaseChrome(TestCase): def setUp(self): se...
import os from os import path import logging import shutil from sqlalchemy import create_engine from . import config from .config import TestBase import taxtastic from taxtastic.taxonomy import Taxonomy, TaxonIntegrityError import taxtastic.ncbi import taxtastic.utils log = logging datadir = config.datadir echo = False...
from ui.navigator.language import LanguageNavigator from ui.screen.screen import Screen, PERCENT_TOP_HEIGHT from ui.menu.languagemenu import LanguageMenu from util.config import LABELS, LANGUAGE class LanguageScreen(Screen): """ Genre Screen. Extends base Screen class """ def __init__(self, util, change_languag...
"""Module defining ``Eigensolver`` classes.""" import numpy as np from gpaw.utilities.blas import axpy from gpaw.eigensolvers.eigensolver import Eigensolver from gpaw import extra_parameters class RMM_DIIS(Eigensolver): """RMM-DIIS eigensolver It is expected that the trial wave functions are orthonormal an...
import sys import locale import urllib import signal signal.signal(signal.SIGINT, signal.SIG_DFL) # ^C exits the application from common import exceptions from common import i18n # This installs _() function from common.i18n import Q_ try: PREFERRED_ENCODING = locale.getpreferredencoding() except Exception: PRE...
import bpy from ... base_types.node import AnimationNode class CombineVectorNode(bpy.types.Node, AnimationNode): bl_idname = "an_CombineVectorNode" bl_label = "Combine Vector" dynamicLabelType = "HIDDEN_ONLY" def create(self): self.newInput("Float", "X", "x") self.newInput("Float", "Y", ...
from os.path import dirname, join, exists, isfile, splitext, basename, isdir, relpath from nose import SkipTest from . import BaseTargQC, info class UnitTests(BaseTargQC): def test_01_simple(self): self._test('simple', [self.samples[0]], bams=[self.bams[0]], bed=self.bed4) def test_02_bed3(self): ...
""" >>> sd = SliceDump() >>> sd[1] 1 >>> sd[2:5] slice(2, 5, None) >>> sd[:2] slice(None, 2, None) >>> sd[7:] slice(7, None, None) >>> sd[:] slice(None, None, None) >>> sd[1:9:3] slice(1, 9, 3) >>> sd[1:9:3, 2:3] (slice(1, 9, 3), slice(2, 3, None)) >>> s =...
print ''' By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6th prime is 13. What is the 10,001st prime number? ''' def problem(): x,limit = 1,0 while limit != 10001: x += 1 if isprime(x): limit += 1 print x problem()
import xbmc, xbmcgui, xbmcaddon import subprocess, os import time, threading import datetime, traceback import sys, re import urllib import urllib2 import fanarttv from Playlist import Playlist from Globals import * from Channel import Channel from ChannelList import ChannelList from FileAccess import FileLock, FileAcc...
'''Created by rj as part of the Pytnam Project''' from analysis.Reportable import Reportable class HighPassFilter(Reportable): def return_as_node(self): pass
import sys, struct data_size = 2*1024*1024 if len(sys.argv) != 3: print 'Using: ./pack_usb.py input.bin output.bin' sys.exit(0) fin = file(sys.argv[1], 'rb') data = fin.read() print 'Size: %d bytes' % len(data) if len(data) > data_size-2: print 'Error: too big' sys.exit(0) data += b'\xa5'*(data_size-2-l...
import os import subprocess def file_name_has_extension(file_name, extension): return file_name.endswith(extension) def file_extension(filename): # index = filename.rfind(os.path.extsep) # if index == -1: # return None # else: # return filename[index:] return os.path.splitext(filenam...
from .stt import ApiRobot from .stt import BingRobot from .stt import WatsonRobot from .stt import WitaiRobot from .stt import GoogleRobot class RobotFactory: @staticmethod def produce(config, speaker, actions): configSTT = config['stt'] if configSTT == 'bing': return BingRobot(config...
import threading import time from lib.Message import Message class Bot(threading.Thread): controller = None username = None message = None status = False event = None counter = 0 def __init__ (self, controller, username): """ """ self.controller =...
""" Module matching %GC compo distribution b/w fg and bg. """ import sys import random from Bio import SeqIO from utils import GC def fg_GC_bins(fg_file): """ Compute G+C content for all sequences in the foreground. It computes the %GC content and store the information in a list. To each G+C percentage ...
import logging from errbot import BotPlugin, botcmd, SeparatorArgParser, ShlexArgParser from errbot.backends.base import RoomNotJoinedError log = logging.getLogger(__name__) class ChatRoom(BotPlugin): connected = False def callback_connect(self): self.log.info('Connecting bot chatrooms') if not ...
import os import gflags from textwrap import dedent import hashlib import zipfile from ..exceptions import UsageError from ..Bunch import Bunch from ..TreeScanner import TreeScanner from ..PakManifest import PakManifest, PakFile, PakFolder def help(): return dedent("""\ Command Usage: pak install pkg_name-1...
""" Runs OCR on a given file. """ from os import system, listdir from PIL import Image from pytesseract import image_to_string import editdistance from constants import DATA_DIR def classify(image, people_class, max_classify_distance=1, min_nonclassify_distance=3): """ Runs an OCR classifier on a given image fi...
"""Radon transform (ray transform) in 2d using skimage.transform.""" from odl.discr import uniform_discr_frompartition, uniform_partition import numpy as np try: from skimage.transform import radon, iradon SCIKIT_IMAGE_AVAILABLE = True except ImportError: SCIKIT_IMAGE_AVAILABLE = False __all__ = ('scikit_ra...
from django.contrib.auth import views as auth def login(request): return auth.login(request, template_name="registration/login.haml") def password_change(request): return auth.password_change(request, template_name="registration/password_change_form.haml") def password_change_done(request): return auth.pass...
import csv __author__ = "Aaron Eppert <aaron.eppert@packetsled.com>" def process(options, results, output_handle): headers = options['select'].split(',') writer = csv.writer(output_handle) writer.writerow(headers) for result in results: row = [] for header in headers: if head...
from django.test.testcases import TestCase from django.urls.base import reverse class Http500Test(TestCase): def test(self): url = reverse("test_http_code_500") self.assertRaises(RuntimeError, self.client.get, url) class IndexViewTest(TestCase): def test(self): response = self.client.get...
import time import gtk.gdk import struct import sys import socket import json import os configuration = { # Target host and port number. 'host': "10.0.14.200", 'port': 8888, # The number of pixels actually attached to the TV. 'size_x': 46, 'size_y': 26, # The number of frames to average together (to stop flashin...
from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('community', '0032_accesslevel'), ] operations = [ migrations.CreateModel( name='ApiAccess', fields=[ ('id', models.AutoF...
import pinutils; info = { 'name' : "RedBear Duo", 'link' : [ "http://www.RedBear.cc/Duo" ], 'default_console' : "EV_SERIAL1", 'variables' : 2250, 'bootloader' : 0, 'binary_name' : 'espruino_%v_redbearduo.bin', 'build' : { 'defines' : [ ] } }; chip = { 'part' : "STM32F205RGT6", 'family' : "STM32F2", '...
import mock from nose.tools import eq_, ok_, assert_raises from collector.unittest.testbase import TestCase from configman import ( class_converter, Namespace, command_line, ConfigFileFutureProxy, ) from configman.dotdict import DotDict from collector.app.socorro_app import ( SocorroApp, Socorro...
import typing from pros.conductor import Project class SystemDevice(object): def upload_project(self, project: Project, **kwargs): raise NotImplementedError def write_program(self, file: typing.BinaryIO, quirk: int = 0, **kwargs): raise NotImplementedError
from django.conf import settings import subprocess import sys import os import logging from website.apps.ts_om.models import Simulation logger = logging.getLogger(__name__) def submit(simulation): logger.debug("dispatcher.submit: simulation id %s" % simulation.id) assert isinstance(simulation, Simulation) b...
from __future__ import unicode_literals from __future__ import division from __future__ import absolute_import from collections import Mapping import os from pyLibrary import dot from pyLibrary.dot import set_default, wrap, unwrap from pyLibrary.parsers import URL DEBUG = False _convert = None _Log = None _Except = Non...
"""A block Davidson solver for finding a fixed number of eigenvalues. Adapted from https://joshuagoings.com/2013/08/23/davidsons-method/ """ import time from typing import Tuple import numpy as np from tqdm import tqdm def davidson(A: np.ndarray, k: int, eig: int) -> Tuple[np.ndarray, np.ndarray]: assert len(A.shap...
import os import re from setuptools import setup, find_packages THIS_DIR = os.path.dirname(os.path.realpath(__name__)) def read(*parts): with open(os.path.join(THIS_DIR, *parts)) as f: return f.read() def get_version(): return re.findall("__version__ = '([\d\.]+)'", read('marionett...
import os from django.test.testcases import TestCase from django.conf import settings import run from website.apps.ts_om.models import Simulation class RunNewTest(TestCase): def test_failure(self): simulation = Simulation.objects.create() simulation.set_input_file("") run.main(simulation.id)...
"""Import an Irish NaPTAN XML file, obtainable from https://data.dublinked.ie/dataset/national-public-transport-nodes/resource/6d997756-4dba-40d8-8526-7385735dc345 """ import warnings import zipfile import xml.etree.cElementTree as ET from django.contrib.gis.geos import Point from django.core.management.base import Bas...
localPrimitiveIndex = { "NIRI": ("primitives_NIRI.py", "NIRIPrimitives"), "NIRI_IMAGE": ("primitives_NIRI_IMAGE.py", "NIRI_IMAGEPrimitives"), }
import wizard
import argparse import sys import traceback from hashlib import md5 import mailchimp_marketing as MailchimpMarketing import requests from consolemsg import step, error, success from erppeek import Client import time import configdb ERP_CLIENT = Client(**configdb.erppeek) MAILCHIMP_CLIENT = MailchimpMarketing.Client( ...
""" The methods here contain factories to create networks of multiple layers for experimenting with grid cell location layer (L6a) """ import copy import json from htmresearch.frameworks.location.path_integration_union_narrowing import ( computeRatModuleParametersFromReadoutResolution, computeRatModuleParametersFro...
from copy import deepcopy, copy from django.contrib import admin from django.contrib.admin.views.main import ChangeList from django.contrib.contenttypes.admin import GenericTabularInline, GenericStackedInline from django.forms import ModelForm, NumberInput from django.db import models class SortableModelAdminBase(objec...
from __future__ import unicode_literals from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('news', '0001_initial'), ] operations = [ migrations.AddField( model_name='person', name='token', field=mo...
from odoo import models, fields, api, _ from odoo.exceptions import UserError, ValidationError from itertools import groupby from operator import itemgetter from collections import defaultdict class WizardValuationStockInventory(models.TransientModel): _name = 'wizard.valuation.stock.inventory' _description = '...
""" This module contains signals related to enterprise. """ import logging import six from django.conf import settings from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.db.models.signals import post_save, pre_save from django.dispatch import receiver from enterp...
from django.core.management.base import BaseCommand, CommandError from mangaki.models import Work, Rating from django.db import connection from django.db.models import Count from collections import Counter import sys class Command(BaseCommand): args = '' help = 'Lookup some work' def handle(self, *args, **o...
""" Settings for Bok Choy tests that are used when running LMS. Bok Choy uses two different settings files: 1. test_static_optimized is used when invoking collectstatic 2. bok_choy is used when running the tests Note: it isn't possible to have a single settings file, because Django doesn't support both generating stati...
from django.contrib.auth.models import User from django.db import models from django.utils import timezone from website.models import Issue class Comment(models.Model): parent = models.ForeignKey('self', null=True, on_delete=models.CASCADE) issue = models.ForeignKey(Issue, on_delete=models.CASCADE, related_name...
from psycopg2 import ProgrammingError from openerp.modules.registry import RegistryManager from openerp.tools import config from openerp.tests.common import TransactionCase, at_install, post_install @at_install(False) @post_install(True) class TestDatabaseCleanup(TransactionCase): def setUp(self): super(Tes...
from flask_wtf import FlaskForm from . import app from wtforms import StringField, PasswordField, SelectField, DateField, IntegerField from wtforms.validators import DataRequired, Length, Email, EqualTo, Optional, NumberRange from wtfrecaptcha.fields import RecaptchaField from flask_wtf.file import FileField, FileAllow...
""" Grades related signals. """ from django.dispatch import Signal PROBLEM_SCORE_CHANGED = Signal( providing_args=[ 'user_id', # Integer User ID 'course_id', # Unicode string representing the course 'usage_id', # Unicode string indicating the courseware instance 'points_earned', ...
import os from djangoappengine.settings_base import * DEBUG = True API_TEST_DEBUG = True if DEBUG else False if DEBUG: STATICFILES_DIRS = ( os.path.join(os.path.dirname(__file__), 'static'), ) else: STATIC_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), 'static') STATIC_URL = '/stati...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('timeblob', '0006_auto_20160820_1908'), ] operations = [ migrations.AddField( model_name='project', name='description', ...
from builtins import str from builtins import object import smtplib import email.utils from biomaj.workflow import Workflow import logging import sys if sys.version < '3': from email.MIMEText import MIMEText else: from email.mime.text import MIMEText class Notify(object): """ Send notifications """ ...
import pytest import time import urllib.request from botocore.exceptions import ClientError from util import list_tables, test_table_name, create_test_table, random_string, freeze from contextlib import contextmanager from urllib.error import URLError from boto3.dynamodb.types import TypeDeserializer stream_types = [ '...
""" .. module:: service_http_transport """ from __future__ import absolute_import from services.local_service import LocalService def create_service(): return HTTPTransportService() class HTTPTransportService(LocalService): service_name = 'service_http_transport' config_path = 'services/http-transport/enabl...
import os def guess_http_host(): hostnames = { 'cloudy': 'objavi.halo.gen.nz', 'vps504': 'objavi.flossmanuals.net', } f = open('/etc/hostname') host = f.read().strip() f.close() try: os.environ['HTTP_HOST'] = hostnames[host] except KeyError: raise RuntimeError...
'''Contains AJAX apps of mother app'''
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('papers', '0001_initial'), ] operations = [ migrations.AlterModelOptions( name='conference', options={'ordering': ['date']}, ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ccx', '0026_auto_20170831_0420'), ('ccx', '0026_auto_20170831_0554'), ] operations = [ ]
import re from django import forms from django.utils.translation import ugettext as _ from identityprovider.widgets import CommaSeparatedWidget class CommaSeparatedField(forms.MultipleChoiceField): widget = CommaSeparatedWidget def clean(self, value): return ','.join(super(CommaSeparatedField, self).cle...
from __future__ import unicode_literals import factory from udata.factories import ModelFactory from .models import Dataset, Resource, Checksum, CommunityResource, License from udata.core.organization.factories import OrganizationFactory from udata.core.spatial.factories import SpatialCoverageFactory class DatasetFacto...
from odoo import models, fields, api, _ from odoo.tools import float_compare from lxml import etree class SaleOrderLineTemplate(models.Model): _name = 'sale.order.line.template' _inherit = 'sale.order.line' product_template = fields.Many2one( 'product.template', string='Product', domain=[('s...
import argparse from twisted.internet import reactor from twisted.web.server import Site from twisted.web.resource import Resource import os from balbec.jsonhandler import JSONHandler from balbec.xmlhandler import XmlHandler ROOT = lambda base : os.path.join(os.path.dirname(__file__), base).replace('\\','/') class Stat...
from django import forms from django.contrib.auth.models import User from harnas.userprofile.models import UserProfile class UserProfileEditForm(forms.ModelForm): class Meta: model = UserProfile fields = ('organization', 'personal_page', 'show_email', 'show_age') class UserFieldsForm(forms.ModelForm...
""" Calculates peak load per load area """ __copyright__ = "Reiner Lemoine Institut, Flensburg University of Applied Sciences, Centre for Sustainable Energy Systems" __license__ = "GNU Affero General Public License Version 3 (AGPL-3.0)" __url__ = "https://github.com/openego/data_processing/blob/master/LICENSE" __au...
player1._position = [5, 6] _world.grid[player1._position[1]][player1._position[0]] = player1 player2._position = [14, 6] _world.grid[player2._position[1]][player2._position[0]] = player2 items = [Item("bread", [0, 2]), Item("mushroom", [11, 9]), Item("scepter", [5, 4]), Item("banana", [17, 3]...
from . import cmis_backend from . import ir_model_fields
""" This script can be used to automatically pull translations from Transifex, commit, push, and merge them to their respective repos. To use, export an environment variable `GITHUB_ACCESS_TOKEN`. The token requires GitHub's "repo" scope. Run the script from the root of this repo. python transifex/pull.py git@githu...
""" URL Patterns for api app """ from django.conf.urls import include, url from django.views.generic.base import RedirectView from drf_yasg.views import get_schema_view from rest_framework.permissions import AllowAny from api.auth import JWTAuthToken, JwtTokenRefresh, JwtTokenVerify from api.router import v1_router, v2...
from dace.processdefinition.processdef import ProcessDefinition from dace.processdefinition.activitydef import ActivityDefinition from dace.processdefinition.gatewaydef import ( ExclusiveGatewayDefinition, ParallelGatewayDefinition) from dace.processdefinition.transitiondef import TransitionDefinition from dace...
""" Tests for utils. """ import collections from datetime import datetime, timedelta from pytz import UTC from django.test import TestCase from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.django_utils import ModuleS...
import logging from odoo import SUPERUSER_ID, api _logger = logging.getLogger(__name__) def pre_init_hook(cr): """Speed up the installation of the module on an existing Odoo instance""" cr.execute( """ SELECT column_name FROM information_schema.columns WHERE table_name='stock_mov...
"""This file contains (or should), all access control logic for the courseware. Ideally, it will be the only place that needs to know about any special settings like DISABLE_START_DATES""" import logging from datetime import datetime, timedelta import pytz from django.conf import settings from django.contrib.auth.model...
from django.db import models import datetime from django.utils.safestring import mark_safe from django.utils.translation import ugettext_lazy as _ from iati_synchroniser.dataset_syncer import DatasetSyncer from iati_synchroniser.codelist_importer import CodeListImporter from iati.parser import Parser from iati_synchron...
import requests import json import re from flask import current_app as app import time import logging from flask import render_template_string from superdesk import get_resource_service from superdesk.utils import config cpi_url = 'CPI/2.50.999901.20.Q' cpi_token = '__CPI__' unemployment_url = 'LF/0.14.3.1599.20.M' une...
from __future__ import division import collections import itertools import operator import numpy from openquake.hazardlib.imt import from_string from openquake.hazardlib.calc import gmf, filters from openquake.hazardlib.site import SiteCollection from openquake.commonlib.readinput import \ get_gsims, get_rupture, g...
from . import models
import test_sale
import os import sys import logging import openerp import openerp.addons.decimal_precision as dp from openerp.osv import fields, osv, expression, orm from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta from openerp import SUPERUSER_ID from openerp import tools from openerp.tools.tr...
import os import pickle import csv import pandas as pd import math from functools import lru_cache, reduce from collections import defaultdict USE_ROME_SLICING_DATASET = False # Rome slicing dataset is not ready yet if USE_ROME_SLICING_DATASET: OGR_ROME_FILE = "rome_slicing_dataset/ogr_rome_mapping.csv" ROME_F...
""" Forms for the project application """ from django import forms from dal import forward from dal.autocomplete import TaggitSelect2 from taggit.forms import TagField from muckrock.core import autocomplete from muckrock.project.models import Project class ProjectCreateForm(forms.ModelForm): """Form for the basic f...
import tempfile import unittest import random import csv import numpy try: import capnp except ImportError: capnp = None if capnp: from nupic.regions.AnomalyLikelihoodRegion_capnp import\ AnomalyLikelihoodRegionProto from nupic.regions.anomaly_likelihood_region import AnomalyLikelihoodRegion from nupic.algori...
""" Resource information of graphite """ def get_name(friendly=False): """Get name of this resource :return: name of this resource :rtype: str """ if friendly: # pragma: no cover return 'Graphite connection' return 'graphite' def get_doc(): # pragma: no cover """Get documentation o...
def migrate(cr, version): if not version: return cr.execute(""" INSERT INTO mobile_app_messages(partner_id) SELECT id FROM res_partner; UPDATE res_partner p SET app_messages = ( SELECT id FROM mobile_app_messages WHERE partner_id = p.id ); ...
import logging from datetime import timedelta, timezone, datetime from flask import current_app as app from werkzeug.exceptions import HTTPException import superdesk from superdesk.activity import ACTIVITY_EVENT, notify_and_add_activity from superdesk.celery_app import celery from superdesk.celery_task_utils import get...
from . import db from .assoc import section_professor class Professor(db.Model): __tablename__ = 'professors' id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('users.id'), unique=True) first_name = db.Column(db.Text, nullable=False) last_name = db.Column(db....
from . import product from . import stock from . import wizard from . import product_price_history from . import account_anglo_saxon_pos from . import purchase
import zmq import threading import logging import logging.handlers import util class Logger(threading.Thread): """logger for all messages and events""" def __init__(self, stop_logging, filename='bus.log'): super(Logger, self).__init__() self.filename = filename self.stop_logging = stop_logging # receiving soc...
from odoo.exceptions import UserError, ValidationError from odoo.tests import common class TestResPartnerIndustry(common.SavepointCase): @classmethod def setUpClass(cls): super(TestResPartnerIndustry, cls).setUpClass() cls.industry_model = cls.env["res.partner.industry"] cls.industry_mai...