code
stringlengths
1
199k
''' THIS PROPERTIES MUST BE REPLACED BY THE CLASSES DEFINED IN control_vars.py THIS FILE MUST DISSAPEAR.''' __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2014 LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" from miscUtils import LogMessages as lmsg import xc_b...
import sys sys.path.append("./m1") import minus sum = minus.minus(7,3) print(sum)
import datetime from django.core.management.base import NoArgsCommand from django.core.urlresolvers import reverse from django.db import connection from django.db.models import Q, F from askbot.models import User, Question, Answer, Tag, QuestionRevision from askbot.models import AnswerRevision, Activity, EmailFeedSetti...
import sympy as sp import pystencils as ps from pystencils_walberla import CodeGeneration, generate_sweep with CodeGeneration() as ctx: # ----- Solving the 2D Poisson equation with rhs -------------------------- dx = sp.Symbol("dx") dy = sp.Symbol("dy") src, dst, rhs = ps.fields("src, src_tmp, rhs: [2D]...
""" This is a simple example which will print out the current weather and temperature for our location. """ import datapoint conn = datapoint.Manager(api_key="aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee") site = conn.get_nearest_forecast_site(51.500728, -0.124626) print(site.name) forecast = conn.get_forecast_for_site(site.lo...
from adapt.intent import IntentBuilder from mycroft.messagebus.message import Message from mycroft.skills.core import MycroftSkill __author__ = 'seanfitz' class NapTimeSkill(MycroftSkill): def __init__(self): super(NapTimeSkill, self).__init__(name="NapTimeSkill") def initialize(self): naptime_i...
WTF_CSRF_ENABLED = True SECRET_KEY = '0d92db404a3726d8e3c9b6f37cff8d81d31a05d879f8a647befd5c44fda7633676ef08de672ab206ace6445ccb0069f80b053751445b1d6370a6925c6b5197c6d51510471831ef9bb01122513eebc1f95ed6d5459d20d0438082821bea313767bf94f92fa9a45a882e4f5e5b241f858a2686bcb48b41cbe87cd8b40f9486c78a889b090d06c9302d0efe8f7f6e...
'''minimal spanning tree.''' Vname = 'ABCDEFG' V = range(7) Ename = 'AB,AC,AD,BC,BE,CE,CF,CD,DF,EF,EG,FG'.split(',') W = (2,5,4,2,7,4,3,1,4,1,5,7) from pymprog import * E = [(Vname.index(e[0]),Vname.index(e[1])) for e in Ename] A = E + [(j,i) for i,j in E] We = dict(zip(E,W)) VA = iprod(V,A) beginModel('MST') x = var('...
from scrapy import signals class LianjiaSpiderMiddleware(object): # Not all methods need to be defined. If a method is not defined, # scrapy acts as if the spider middleware does not modify the # passed objects. @classmethod def from_crawler(cls, crawler): # This method is used by Scrapy to ...
import time import threading import sys import traceback try: if sys.version_info.major >= 3: import http.server as BaseHTTPServer else: # from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer import BaseHTTPServer except: import BaseHTTPServer from os import curdir, sep import...
from collections import OrderedDict import hashlib from urllib.parse import urlparse import requests from django.conf import settings from django.contrib import messages from django.core.cache import cache from django.db import connection from django.shortcuts import redirect, render from crashstats.crashstats.models i...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0001_initial'), ] operations = [ migrations.AddField( model_name='project', name='on_branch', field=models.Ch...
from __future__ import division import logging import operator from math import ceil from celery import chain from django.conf import settings from django.db.models import Q from django.utils.html import strip_tags from django.utils.translation import ugettext_lazy as _ from elasticsearch.helpers import bulk from elast...
__version__ = "0.1.0"
from responsemodule import IModule import lastfmapi import re settings_name_g = u'music' service_g = u'service' api_key_g = u'api_key' class MusicStatus(IModule): def __init__(self): self.settings = {api_key_g: None, service_g: None} self.api = None self....
from openerp.tests.common import TransactionCase class UnitTest(TransactionCase): def setUp(self): super(UnitTest, self).setUp() self.presentation_proxy = self.env['account.invoice.presentation'] # TESTS def test_can_create_a_presentation(self): "Se puede crear una presentacion" ...
from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('seqr', '0061_family_assigned_analyst'), ('seqr', '0061_auto_20190715_1500'), ] operations = [ ]
""" """ import datetime import random import itertools from dateutil.parser import parse as date_parse from django.test import TestCase from django.test.utils import override_settings from mock import Mock, patch import requests from notifier.digest import ( _trunc, THREAD_ITEM_MAXLEN, _get_thread_url, _get_course_...
from openerp import models,fields,api from openerp.tools.translate import _ class product_template(models.Model): _inherit = 'product.template' is_type_frais = fields.Boolean('Type de frais' , help=u'Cocher cette case pour afficher cet article dans les fiches de frais') is_type_frais_hors_km ...
from time import time from threading import Thread, Timer from circuits import Component, handler from ..events.core import broadcast_msg from ..events.game_handlers import start_game, end_game, process_cycle from ..helpers.logger import log from ..helpers.parser import Parser from ..helpers.messages import StartGame, ...
tex_2_wiki_dic = \ { "\\Procedure{" : ("{{algorithm-begin|name=", "}{", "}}\n Input: ", "}"), \ "\\ForAll{" : ("'''For each''' ", "}:", ", '''do'''"), \ "\\For{" : ("'''For'''", "}:", ", '''do'''"), \ "\\EndFor\n" : ("",), \ "\\State" : ("", "\n"), \ "\\Call{" : ("'''Call''' '''", "}{", "'''(", "}...
from django import forms from accueil.models import Colleur, Groupe, Matiere, Destinataire, Message, Classe, Eleve, User, Prof from administrateur.forms import CustomMultipleChoiceField from django.contrib.auth.password_validation import validate_password from django.core.exceptions import ValidationError from django.d...
import models
import os from celery import Celery from ecommerce_worker.configuration import CONFIGURATION_MODULE os.environ.setdefault(CONFIGURATION_MODULE, 'ecommerce_worker.configuration.local') app = Celery('ecommerce_worker') app.config_from_envvar(CONFIGURATION_MODULE)
"""empty message Revision ID: a65bdadbae2f Revises: e1ef93f40d3d Create Date: 2019-01-15 12:19:59.813805 """ from alembic import op import sqlalchemy as sa import sqlalchemy_utils from sqlalchemy.dialects import postgresql import sqlalchemy_utils import uuid revision = "a65bdadbae2f" down_revision = "e1ef93f40d3d" bran...
from odoo import models, fields, api class HrAttendanceBreak(models.Model): _name = "hr.attendance.break" _description = "Attendance break" ########################################################################## # FIELDS # ##########...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('services', '0001_initial'), ] operations = [ migrations.AlterField( model_name='servicesubscription', name='last_paid_for', ...
from rest_framework import routers from adhocracy4.api.routers import CustomRouterMixin class TokenVoteRouterMixin(CustomRouterMixin): prefix_regex = ( r'modules/(?P<module_pk>[\d]+)/contenttypes/' r'(?P<content_type>[\d]+)/{prefix}' ) class TokenVoteDefaultRouter(TokenVoteRouterMixin, routers.D...
import time from django.core import management from ted import tasks from videos.models import Video from subtitles.pipeline import add_subtitles from utils.factories import * from webdriver_testing.webdriver_base import WebdriverTestCase from webdriver_testing import data_helpers from webdriver_testing.data_factories ...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Event.global_event' db.add_column(u'events_event', 'global_event', ...
import json from twitter import Twitter, OAuth2, oauth2_dance, OAuth, TwitterHTTPError from .base import BulkTaskImport, BulkImportException class BulkTaskTwitterImport(BulkTaskImport): importer_id = "twitter" DEFAULT_TWEETS = 200 def __init__(self, consumer_key, consumer_secret, source, ma...
import calendar from datetime import datetime,date from dateutil import relativedelta import json import time from openerp import api from openerp import SUPERUSER_ID from openerp import tools from openerp.osv import fields, osv, orm from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT from openerp.tools import htm...
from django.test import SimpleTestCase from base.forms.search.search_tutor import TutorSearchForm class TestSearchTutor(SimpleTestCase): def test_form_fields(self): FORM_FIELDS = ("name", ) form = TutorSearchForm() self.assertCountEqual(FORM_FIELDS, list(form.fi...
from itertools import chain from itertools import product from itertools import combinations def nonemptysubsets(iterable): s = list(iterable) return chain.from_iterable(combinations(s, r) for r in range(1,len(s) + 1)) def minima ( t ) : """ Clarkson's algorithm. O(nm) where m is the size of the m...
from . import models def post_init(cr, registry): """Import CSV data as it is faster than xml and because we can't use noupdate anymore with csv""" from openerp.tools import convert_file filename = 'data/res.better.zip.csv' convert_file(cr, 'l10n_ch_zip', filename, None, mode='init', noupdate=True, ...
from __future__ import absolute_import, unicode_literals import os from django.conf import settings from django.core.mail import mail_admins from django.views.debug import ExceptionReporter from celery import Celery from celery.signals import task_failure os.environ.setdefault("DJANGO_SETTINGS_MODULE", "helfertool.sett...
import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'AuthenticationEvent' db.create_table('auth2_auth_authenticationevent', ( ('id', self.gf('django.db.models.f...
from openerp import api, models class AccountInvoiceLine(models.Model): _inherit = 'account.invoice.line' @api.one def _compute_price(self): invoice = self.invoice_id price = self.price_unit *\ (1 - (self.discount or 0.0) / 100.0) *\ (1 - (self.discount2 or 0.0) / 100...
from . import fastline
__all__ = ['connect', 'Connection', 'Cursor'] import errno import socket import struct import json from os import environ from . import ql2_pb2 as p pResponse = p.Response.ResponseType pQuery = p.Query.QueryType from . import repl # For the repl connection from .errors import * from .ast import RqlQuery, DB, recursivel...
""" Course Textbooks page. """ import requests from path import Path as path from edxapp_acceptance.pages.common.utils import click_css from edxapp_acceptance.pages.studio.course_page import CoursePage class TextbookUploadPage(CoursePage): """ Course Textbooks page. """ url_path = "textbooks" def is...
import openerp from openerp.osv import fields, osv import openerp.service.model from openerp.tools.translate import _ import time from openerp import tools from openerp import SUPERUSER_ID class audittrail_rule(osv.osv): """ For Auddittrail Rule """ _name = 'audittrail.rule' _description = "Audittra...
""" Delbot Copyright (C) 2017 Shail Deliwala 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...
from openerp.osv import fields, orm from openerp.tools.translate import _ import logging try: # Lib py-asterisk from http://code.google.com/p/py-asterisk/ # -> pip install py-Asterisk from Asterisk import Manager except ImportError: Manager = None _logger = logging.getLogger(__name__) class asterisk_ser...
import logging from odoo import api from odoo.api import split_context _logger = logging.getLogger(__name__) call_kw_org = api.call_kw def call_kw(model, name, args, kwargs): res = call_kw_org(model, name, args, kwargs) user = model.env.user if user.track_user_activity and "user.activity.log" != model._name...
import sys, os, datetime, time, shutil, tempfile, subprocess, string from optparse import OptionParser info = "'rethinkdb restore' loads data into a RethinkDB cluster from an archive" usage = "rethinkdb restore FILE [-c HOST:PORT] [-a AUTH_KEY] [--clients NUM] [--force] [-i (DB | DB.TABLE)]..." def print_restore_help()...
""" Notifications app. This reusable Django application is a simple notifications manager with mailing builtin. """ default_app_config = 'apps.notifications.apps.NotificationsConfig'
import random s = open("scrobbledump.sql", "r") o = open("scrobbles.anonymous.sql", "w") datasection = False usermap = {} for line in s.readlines(): if line.rstrip() == "\.": datasection = False if datasection: data = line.split("\t") uid = data[9] if uid in usermap: data[9] = str(usermap[uid]) else: ...
from openerp.osv import osv, fields, orm import decimal_precision as dp class product_mixin(orm.AbstractModel): _name = 'product.mixin' _columns = { 'uom_id': fields.many2one('product.uom', 'Unit of Measure', required=False,), # TODO required=True 'quantity': fields.float('Quantity', re...
import datetime import logging from django.db.models.signals import post_save from django.dispatch import receiver from course_modes.models import CourseMode from courseware.models import DynamicUpgradeDeadlineConfiguration, CourseDynamicUpgradeDeadlineConfiguration from openedx.core.djangoapps.theming.helpers import g...
from flask_restplus import fields from skf.api.restplus import api sprint = api.model('sprint', { 'sprint_id': fields.Integer(readOnly=True, description='The unique identifier of a sprint item'), 'project_id': fields.Integer(required=True, description='The unique identifier of a sprint project'), 'group_id'...
""" A collection of helper methods """ from django.contrib.auth.models import User def get_users_by_email(domain, is_active): """ Fetch users by domain and by active status """ suffix = '@' + domain users = User.objects.filter( email__endswith=suffix, is_active=is_active, ) r...
from __future__ import unicode_literals import re import StringIO import factory from random import randint from factory.mongoengine import MongoEngineFactory from flask import url_for, Blueprint from udata.models import db from udata.core.metrics import Metric, init_app as init_metrics from udata.frontend import csv f...
from django.conf.urls import url from . import views urlpatterns = [ url( r'^stadt/galleries/add/$', views.Create.as_view(), name='create-gallery'), url( r'^(?P<entity_slug>[\w.@+-]+)/galleries/add/$', views.Create.as_view(), name='create-group-gallery'), ]
""" Test the access control framework """ from __future__ import absolute_import import datetime import itertools import ddt import pytz import six from ccx_keys.locator import CCXLocator from django.contrib.auth.models import User from django.test import TestCase from django.test.client import RequestFactory from djan...
""" Contains integration tests for the cryogen measuring unit .. note:: This suite contains a set of testing parameters in the dictionary ``TESTING_PARAMETERS``. These parameters must be set to their correct values before running the integration test """ import unittest import logging import sys from mr_fre...
from django.conf import settings import django.core.exceptions from django.http import HttpResponseRedirect from django.utils import translation import localeurl from localeurl import utils assert utils.supported_language(settings.LANGUAGE_CODE) is not None, \ "Please ensure that settings.LANGUAGE_CODE is in se...
from openerp import models, fields class PaymentMode(models.Model): _inherit = 'payment.mode' type_sale_payment = fields.Selection( [('00', u'00 - Duplicata'), ('01', u'01 - Cheque'), ('02', u'02 - Promissória'), ('03', u'03 - Recibo'), ('99', u'99 - Outros')], ...
from django.db import models from django.utils.translation import gettext_lazy as _ from wagtail.admin.edit_handlers import MultiFieldPanel, FieldPanel from utils.melos_client import MelosClient class Participant(models.Model): name = models.CharField( help_text=_('This field identifies the participant type...
from . import account from . import account_config from . import res_company from . import statement
class Settings: __setting_dict = {\ 'name':'List Words',\ 'version':'0.1',\ 'debug':False,\ 'file_name':'./data/i\ have\ a\ dream.txt',\ 'mode':'interactive',\ 'word_freq': 0,\ 'dictionary':'ydict',\ 'config_path':'$HOME',\ 'database':'./wordbank.db',\ \ 'word':'test',\ ...
import django.forms as forms from django.forms import ModelForm from django.contrib.admin.widgets import FilteredSelectMultiple from telemeta.models import * from extra_views import CreateWithInlinesView, UpdateWithInlinesView, InlineFormSet from extra_views.generic import GenericInlineFormSet from django.forms.widgets...
from django.shortcuts import render_to_response, HttpResponseRedirect, HttpResponse, get_object_or_404 from django.template import RequestContext from assets.models import Project, Host from assets.models import project_swan, swan_pro, swan_port from django import forms import ast from django.contrib.auth.decorators im...
import time from openerp.osv import fields, osv import openerp.addons.decimal_precision as dp from openerp.tools.translate import _ STATE = [ ('none', 'Non Member'), ('canceled', 'Cancelled Member'), ('old', 'Old Member'), ('waiting', 'Waiting Member'), ('invoiced', 'Invoiced Member'), ('free', ...
from voltcli import utility @VOLT.Command( bundles = VOLT.AdminBundle(), description = 'Update the Log4J configuration.', arguments = ( VOLT.PathArgument('log4j_xml_path', 'the Log4J configuration file', exists=True), ) ) def log4j(runner): log4j_file = utility.File(runner.opts.log4j_xml_pat...
__metaclass__ = type __all__ = [ 'RetryDepwaitTunableLoop', ] import transaction from lp.buildmaster.enums import BuildStatus from lp.registry.interfaces.series import SeriesStatus from lp.registry.model.sourcepackagename import SourcePackageName from lp.services.database.bulk import load_related from lp.servic...
from . import company
from __future__ import absolute_import, division, print_function from astropy.coordinates import frame_transform_graph from .region import Region, PixelRegion, SkyRegion, PhysicalRegion from ..basics.coordinate import PixelCoordinate, SkyCoordinate, PhysicalCoordinate from ..basics.stretch import PixelStretch, SkyStret...
"""Test the start up utility.""" from __future__ import ( absolute_import, print_function, unicode_literals, ) str = None __metaclass__ = type __all__ = [] from lockfile import ( FileLock, LockTimeout, ) from maasserver import start_up from maasserver.components import ( discard_persiste...
import fab.server import fab.postgres import fab.nginx import fab.webapp
"""Definition for website constants.""" import logging from openerp import models, fields _logger = logging.getLogger(__name__) class Website(models.Model): """References for the url of pages.""" _inherit = 'website' directory_menu = '/directory' shop_menu = '/shop/' about_menu = '/contactus/'
app_name = "erpnext" app_title = "ERPNext" app_publisher = "Web Notes Technologies Pvt. Ltd. and Contributors" app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations" app_icon = "icon-th" app_color = "#e74c3c" app_version = "5.0.0-alpha" error_report_email = "support@erpnext.co...
""" ain7/shop/forms.py """ from django import forms from django.forms.util import ValidationError from django.db import models from django.contrib.auth.models import User from django.utils.translation import ugettext as _ from ain7.shop.models import Payment class PaymentMethodForm(forms.ModelForm): class Meta: ...
import os, sys import shutil print "Test python bindings:" my_path = os.path.abspath(__file__) os.stat(my_path) # Assert that we found something. my_dir = os.path.dirname(my_path) sys.path.insert(0, os.path.join(my_dir, '.libs')) from liblicense import * import unittest import StringIO class Tests(unittest.TestCase): ...
import json import logging import re from gosa.backend.objects.filter import ElementFilter import datetime from gosa.common.gjson import loads, dumps class SplitString(ElementFilter): """ splits a string by the given separator =========== =========================== Key Description =========...
import collections class KeyDefaultDict(collections.defaultdict): ''' Provides a default dictionary which lets the default value be based on the key input. keydict = KeyDefaultDict(lambda key: key) Idea taken from stack overflow and cleaned up/reorganized: http://stackoverflow.com/questions/...
import sys from paravistest import datadir, pictureext, get_picture_dir from presentations import CreatePrsForFile, PrsTypeEnum import pvserver as paravis myParavis = paravis.myParavis picturedir = get_picture_dir("DeformedShape/A1") file = datadir + "hexa_28320_ELEM.med" print " --------------------------------- " pri...
import pytest from database import db, get_engine from .model_testing import ModelTest from exceptions import ValidationError from models import Protein, SiteType, func from models import Site def load_regex_support(engine): if engine.name == 'sqlite': engine.raw_connection().enable_load_extension(True) ...
"""SCons.Tool.Packaging.zip The zip SRC packager. """ __revision__ = "src/engine/SCons/Tool/packaging/src_zip.py rel_2.4.0:3365:9259ea1c13d7 2015/09/21 14:03:43 bdbaddog" from SCons.Tool.packaging import putintopackageroot def package(env, target, source, PACKAGEROOT, **kw): bld = env['BUILDERS']['Zip'] bld.set...
import locale import logging import os import leapp.compat def setup_locale(): try: leapp.compat.setlocale(locale.LC_ALL) except locale.Error: logging.getLogger('leapp.i18n').error('Failed to set locale, defaulting to C', exc_info=True) os.environ['LC_ALL'] = 'C' leapp.compat.set...
import CISCO_VOICE_IF_MIB OIDMAP = { '1.3.6.1.4.1.9.9.64': CISCO_VOICE_IF_MIB.ciscoVoiceInterfaceMIB, '1.3.6.1.4.1.9.9.64.1': CISCO_VOICE_IF_MIB.cvIfObjects, '1.3.6.1.4.1.9.9.64.1.1': CISCO_VOICE_IF_MIB.cvIfCfgObjects, '1.3.6.1.4.1.9.9.64.2': CISCO_VOICE_IF_MIB.cvIfConformance, '1.3.6.1.4.1.9.9.64.2.1': CISCO_VOICE_IF_...
import logging import sys from optparse import OptionParser from netort.resource import manager as resource_manager from yandextank.core.consoleworker import ConsoleWorker from yandextank.core.tankcore import LockError from yandextank.validator.validator import ValidationError from yandextank.version import VERSION def...
from logging import DEBUG, getLogger from rbnics.backends.dolfin.wrapping.function_extend_or_restrict import _sub_from_tuple from rbnics.eim.utils.decorators import get_problem_from_parametrized_expression from rbnics.utils.cache import Cache from rbnics.utils.decorators import (exact_problem, get_problem_from_solution...
import sys encoding = sys.getfilesystemencoding() print(encoding) for line in open('file.txt', 'rb'): print(line.decode(encoding), end = '')
from assisipy import bee if __name__ == '__main__': # Connect to the bee walker = bee.Bee(name='Bee-001') # Let the bee run in circles walker.set_vel(0.65,0.8)
""" Copyright 2009-2020 Olivier Belanger This file is part of pyo, a python module to help digital signal processing script creation. pyo is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of ...
FLOAT_TYPE = 1.0 INT_TYPE = 1 STRING_TYPE = " " table_properties = {} for item in context.propertysheets.items(): for property_sheet in item: try: for property in property_sheet.propertyItems(): if property[0] not in ['getcontentlength', 'getcontenttype', 'creationdate',...
class FreeSpaceExtent(): """Helper object for listing free space tree extents. In the free space tree, information about free space can be stored as free space extent item, in which case it has information about a single gap of free space. Alternatively, it can be stored in a compacted format, as free ...
""" xccdf.models.element includes the class Element, the base of the rest of models, getting the common attributes. This module is part of the xccdf library. Author: Rodrigo Núñez <rnunezmujica@icloud.com> """ class Element(object): """ Generic class to implement a XCCDF element. """ def __init__(self, ...
""" Copyright (C) 2012-2017, Leif Theden <leif.theden@gmail.com> This file is part of pytmx. pytmx is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any la...
from __future__ import annotations """ Configuration Schema on etcd ---------------------------- The etcd (v3) itself is a flat key-value storage, but we use its prefix-based filtering by using a directory-like configuration structure. At the root, it contains "/sorna/{namespace}" as the common prefix. In most cases, a...
""" This module contains the splittable tab widget API """ import logging import mimetypes import os import uuid from pyqode.qt import QtCore, QtWidgets, QtGui from pyqode.core.api import utils, CodeEdit, ColorScheme from pyqode.core.dialogs import DlgUnsavedFiles from .tab_bar import TabBar from .code_edits import Gen...
__authors__ = "Martin Sandve Alnæs" __date__ = "2008-08-20 -- 2012-11-30" import pytest from ufl import * from ufl.classes import * @pytest.fixture def f(): element = FiniteElement("Lagrange", triangle, 1) return Coefficient(element) @pytest.fixture def g(): element = FiniteElement("Lagrange", triangle, 1) ...
'''Common functionality (:mod:`~bliss.common.event`, :mod:`~bliss.common.log`, \ :mod:`~bliss.common.axis`, :mod:`~bliss.common.temperature`, etc) This module gathers most common functionality to bliss (from :mod:`~bliss.common.event` to :mod:`~bliss.common.axis`) .. autosummary:: :toctree: axis encoder eve...
import os,random for f in os.listdir('E:\\blog\\article'): linkherf = "article/" + f month = str(random.randint(1,3)) day = str(random.randint(1,28)) day = "0"+day if len(day) <2 else day print( "<li><span>18-{0}-{1})</span><a href=\"#\" class=\"link1\">[CEPH]</a> <a href={2}>{3}</a></li>" ...
import asyncio from collections import defaultdict import functools import io import inspect import itertools import json import logging import numbers import re import time import traceback from typing import ( Any, Union, Awaitable, Callable, Hashable, MutableMapping, Tuple, ) from aiohttp import web ...
import ui import os import sys import glob from PyQt4 import QtGui, QtCore import syntax import pilas MENSAJE_PRESENTACION = u"""Bienvenido al cargador de ejemplos. Selecciona un ejemplo usando el panel de la izquierda y luego verás el código acá. """ class VentanaEjemplos(ui.Ui_Ejemplos): def setupUi(self, main): ...
import cPickle from .. import BaseFeature from vocab.languagemodel import BigramLanguageModel class DescriptionLanguageModel(BaseFeature): """In the preprocessing stage, this feature generates three bigram language models: one from descriptions of Official profiles, one from descriptions of Affiliate profil...
from feedgen.feed import FeedGenerator from pinboard import Pinboard from config import api_token, limit_tags, output from pytz import utc if __name__ == "__main__": # create the feed fg = FeedGenerator() fg.id('pbpodcast123') fg.title('Pinboard RSS') fg.author({'name': 'John Smith', 'email': 'john@...
""" WSGI config for tracker project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` s...