text
stringlengths
12
6.59M
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import socket BASE_DIR = os.path.dirname(os.path.dirname(__file__)) # openshift is our PAAS for now. ON_PAAS = 'OPENSHIFT_REPO_DIR' in os.environ if ON_PAAS: SECRET_KEY = os.environ['OPENSHIFT_SECRET_TOKEN'] else: # SECURITY W...
# coding=utf8 import os import sys import time import unittest import vk from vk.utils import HandyList, make_handy, HandyDict sys.path.append(os.path.join(os.path.dirname(__file__), '..')) # copy to test_props.py and fill it APP_ID = '' # aka API/Client id APP_SECRET = '' # aka API/Client secret USER_EMAIL = ''...
from kivy.app import App from kivy.clock import Clock from kivy.properties import ( BooleanProperty, NumericProperty, BoundedNumericProperty, ObjectProperty, StringProperty, DictProperty ) from kivy.uix.widget import Widget from kivy.uix.floatlayout import FloatLayout from kivy.uix.textinput imp...
#!/usr/bin/python import subprocess import requests,math from bs4 import BeautifulSoup import sys,re,time try: r = requests.get('http://localhost:9999/requests/status.xml', auth=('', 'aaaa')) soup = BeautifulSoup(r.text) length = float(soup.length.string) percent = float(soup.position.string) position = lengt...
# This file is suitable for sourcing inside POSIX shell, e.g. bash as # well as for importing into Python VERSION = "v0.19.11" # NOQA
""" Django settings for mytodo project. Generated by 'django-admin startproject' using Django 1.9.6. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os # ...
# # Copyright (C) 2018 - 2020 Satoru SATOH <satoru.satoh @ gmmail.com> # SPDX-License-Identifier: MIT # # pylint: disable=invalid-name r"""Functions for value objects represent inputs and outputs. .. versionchanged:: 0.10.1 - simplify inspect_io_obj and make; detect type in make, remove the member opener from ioinf...
from connexion import NoContent from geoalchemy2 import Geometry from sqlalchemy import extract from sqlalchemy import func, Table, engine, update from sqlalchemy import Date, cast import json import traceback import api.models from src.api.i18n import I18n import datetime from datetime import date db_session = api....
# -*- coding: utf-8 -*- """ -------- volt.gen -------- Volt site generator. :copyright: (c) 2012 Wibowo Arindrarto <bow@bow.web.id> :license: BSD """ from __future__ import with_statement import os import shutil import sys from inspect import isclass from volt.config import CONFIG, SessionConfig from volt.engine.c...
""" Vanilla Policy Gradients. For usage, to quickly test, use: python main.py Pendulum-v0 --vf_type nn --do_not_save --render For saving, see the bsah scripts. Successfully tested on: Pendulum-v0 (c) April 2017 by Daniel Seita. This code is built upon starter code from Berkeley CS 294-112. """ import argp...
import json import boto3 import datetime import time import math from elasticsearch import Elasticsearch import warnings warnings.filterwarnings('ignore') print('Loading function') #====================================================================================================================== # Constants #===...
import datetime from mimetypes import guess_type from django import forms from django.contrib import admin, messages from django.contrib.admin.util import unquote from django.contrib.admin.views.main import ChangeList from django.contrib.auth.decorators import permission_required from django.core.exceptions import Val...
#!/usr/bin/python import socket import sys from thread import * import time import json import threading def generate_error(message): print '\033[31m\033[1m%s\033[0m\033[39m' % message try: from gps import * except ImportError: generate_error('GPS not configured properly!') sys.exit(1) gpsd = No...
''' Entry points for the nbdiff package. ''' from __future__ import print_function import argparse from .merge import notebook_merge from .notebook_parser import NotebookParser import sys from .notebook_diff import notebook_diff from .adapter.git_adapter import GitAdapter from .server.local_server import app import thr...
''' Plan: - Run cell - Produces with tab.add_tab(title='hi'): notebook.run_tag('hi') with tab.add_tab(title='hello'): notebook.run_tag('hello') Tab 1: - Each cell execution is a new flexbox carousel box with accordion for: cell source & output ''' from contextlib import contextmanager import ipywidge...
# -*- coding: utf-8 -*- # © 2014-2015 ACSONE SA/NV (<http://acsone.eu>) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). import logging from odoo import api, models _logger = logging.getLogger(__name__) class Report(models.Model): _inherit = "report" @api.model def get_pdf(self, d...
# Author: qiren123 # This file is part of MicroPython MIDI Music # Copyright (c) 2018 qiren123 # # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license.php # DADADADUM = ['r4:2', 'g', 'g', 'g', 'eb:8', 'r:2', 'f', 'f', 'f', 'd:8'] ENTERTAINER = [ 'd4:1', 'd#', 'e', 'c5:2', 'e4:1', 'c...
""" Django settings for the ward councillor project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_...
import argparse from datetime import datetime from string import punctuation import numpy as np import pandas as pd from gurobipy import * table = str.maketrans({key: None for key in punctuation}) def read_input_csv(filename, typ=None): sldf = pd.read_csv(filename, header=0, dtype=typ) sldf.columns = sldf.c...
# -*- coding: utf-8 -*- # Copyright 2012 Rooter Analysis S.L. # # 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...
# Copyright 2013 Rooter Analysis S.L. # # 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 w...
import errno import gobject import logging import re import socket import threading from pykka import ActorDeadError from pykka.actor import ThreadingActor from pykka.registry import ActorRegistry logger = logging.getLogger('mopidy.utils.server') class ShouldRetrySocketCall(Exception): """Indicate that attempted...
""" Base Page for fitting """ import sys import os import wx import numpy import time import copy import math import string from wx.lib.scrolledpanel import ScrolledPanel from sans.guiframe.panel_base import PanelBase from sans.guiframe.utils import format_number, check_float from sans.guiframe.events imp...
from __future__ import division from great_expectations.dataset import Dataset from functools import wraps import inspect from .util import DocInherit, parse_result_format, create_multiple_expectations import sqlalchemy as sa from sqlalchemy.engine import reflection from numbers import Number class MetaSqlAlchem...
# coding=utf-8 """ app_version Get version information from ``setup.py`` via ``pkg_resources``. The concept is taken from this answer http://stackoverflow.com/a/17638236 written by Martijn Pietersp """ __author__ = 'Alisue <lambdalisue@hashnote.net>' __all__ = ('get_string_version', 'get_tuple_version', 'get_versio...
""" TASKS: init: maintain SSH tunnel to conductor listen to Web API open DB connection runtime: maintain DB of inventory histories? generate HTML reports serve reports on request API for conductor: receive_inventory_and_map Dashboard: web interface w...
# encoding: utf-8 """Word completion for IPython. This module is a fork of the rlcompleter module in the Python standard library. The original enhancements made to rlcompleter have been sent upstream and were accepted as of Python 2.3, but we need a lot more functionality specific to IPython, so this module will cont...
# -*- coding: utf-8 -*- """ =============================================================================== InvasionPercolationBasic: Simple IP =============================================================================== """ import scipy as sp import bisect from collections import deque from OpenPNM.Alg...
from __future__ import division from six import PY3, string_types import uuid from functools import wraps import inspect import logging import warnings from datetime import datetime from importlib import import_module import pandas as pd import numpy as np from dateutil.parser import parse from .dataset import Data...
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Appier Framework # Copyright (c) 2008-2017 Hive Solutions Lda. # # This file is part of Hive Appier Framework. # # Hive Appier Framework is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apach...
# 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 u...
# encoding: utf-8 """Classes and functions for kernel related errors and exceptions. Inheritance diagram: .. inheritance-diagram:: IPython.parallel.error :parts: 3 Authors: * Brian Granger * Min RK """ from __future__ import print_function import sys import traceback __docformat__ = "restructuredtext en" # T...
#! /bin/python # To understand how templating is done with Tornado. You can specify a folder # where all templates/html files are store and ask tornado do render them # # # os.path library is used to specify where to look for templates import os.path # bunch of tornado imports import tornado.httpserver import torna...
#!/usr/bin/env python # encoding: utf-8 """ The :class:`~IPython.core.application.Application` object for the command line :command:`ipython` program. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import absolute_import from __future__ import ...
#!/usr/bin/env python # encoding: utf-8 """ The :class:`~IPython.core.application.Application` object for the command line :command:`ipython` program. Authors ------- * Brian Granger * Fernando Perez * Min Ragan-Kelley """ #----------------------------------------------------------------------------- # Copyright (C...
import unittest, time import ocookie class CookieTest(unittest.TestCase): def test_construction(self): cookie = ocookie.Cookie('foo', 'bar', httponly=True) self.assertEquals('foo', cookie.name) self.assertEquals('bar', cookie.value) self.assertTrue(cookie.httponly) self.ass...
# -*- coding: utf-8 -*- # # Copyright (C) 2006-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
# -*- coding: utf-8 -*- """IPython Test Suite Runner. This module provides a main entry point to a user script to test IPython itself from the command line. There are two ways of running this script: 1. With the syntax `iptest all`. This runs our entire test suite by calling this script (with different arguments)...
import sys from django.conf import settings from django.core.management.base import BaseCommand from morango.models import InstanceIDModel import kolibri from kolibri.core.analytics.measurements import get_channels_usage_info from kolibri.core.analytics.measurements import get_db_info from kolibri.core.analytics.meas...
"""Utilities to manipulate JSON objects. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING.txt, distributed as part of this software....
from __future__ import (division, print_function, absolute_import, unicode_literals) from argparse import ArgumentParser import os import re import hashlib import tarfile import zipfile import yaml from binstar_client.utils import get_binstar from binstar_client.errors import NotFound from co...
# Copyright (c) 2010-2012 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/LICENSE-2.0 # # Unless required by applicable law or agree...
# dleyna-control # # Copyright (C) 2012 Intel Corporation. All rights reserved. # # This program is free software; you can redistribute it and/or modify it # under the terms and conditions of the GNU Lesser General Public License, # version 2.1, as published by the Free Software Foundation. # # This program is distribu...
import os from osgeo import ogr import ospybook as pb from ospybook.vectorplotter import VectorPlotter # Set this variable to your osgeopy-data directory so that the following # examples will work without editing. We'll use the os.path.join() function # to combine this directory and the filenames to make a complete p...
from math import sqrt settings = None CENTER_POINT = None def after_settings(): global CENTER_POINT global settings CENTER_POINT = (int(settings.board_size / 2), int(settings.board_size / 2)) def set_settings(s): global settings settings = s after_settings() #################################...
import os import json from flask import Flask, request, Response from flask import render_template, send_from_directory, url_for from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('angular_flask.settings') db = SQLAlchemy(app) session = db.session app.url_map.strict_slashes = Fal...
#!/usr/bin/env python # coding: utf-8 # # Copyright (c) 2015, PAL Team. # All rights reserved. See LICENSE for details.import urllib import xml.etree.ElementTree as ET import requests from pal.services.base_service import Service from pal.services.base_service import wrap_response from config import WA_KEY class ...
""" sentry.models.groupassignee ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import logging import six from collections import defaultdict from django.conf import settings...
""" sentry.runner.commands.exec ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2016 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function import six import sys import click # If this changes, make sure to also update in ...
# Miscellaneous utility functions and classes found here. import collections import dbm import re import shelve import json from io import BytesIO from pickle import Pickler, Unpickler from rs_errors import CommandSyntaxError import argparse class DotDict(dict): """ Custom dictionary format that allows member...
# -*- coding: utf-8 -*- # # llfuse documentation build configuration file, created by # sphinx-quickstart on Sat Oct 16 14:14:40 2010. # # 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 ...
#!/usr/bin/env python # coding=utf-8 from functools import wraps import json import os from pprint import pformat import re import click # dirty hack for locale bug (for docutils) os.environ['LC_CTYPE'] = 'en_US.UTF8' from docutils.core import publish_doctree, publish_from_doctree from docutils.nodes import comment, T...
#!/usr/bin/env python """Checks code blocks in ReStructuredText.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import subprocess import sys import tempfile from docutils import core, nodes, util...
#!/usr/bin/env python # Copyright (C) 2013-2015 Steven Myint # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, mo...
import gettext import os gettext.install('nova') from nova import utils def setup(app): rootdir = os.path.abspath(app.srcdir + '/..') print "**Autodocumenting from %s" % rootdir rv = utils.execute('cd %s && ./generate_autodoc_index.sh' % rootdir) print rv[0]
# Copyright 2018 The TensorFlow 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 applica...
""" TransactionMetaPlugin offers a way of saving key-value data for transations. You can use the plugin in same way as other plugins:: meta_plugin = TransactionMetaPlugin() versioning_manager.plugins.add(meta_plugin) TransactionMetaPlugin creates a simple model called TransactionMeta. This class has three ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import glob, imp, sys, threading, time, urllib, logging from flask import Flask,request import core name = "Mainframe" app = Flask(__name__) restart = 1 threads = [] plugins = [] def import_plugins(): """ Function to import plugins from the /plugins folder. Vali...
import json import traceback class RequestHandler: def __init__(self, categories_db, items_db, users_db): self.__categories_db = categories_db self.__items_db = items_db self.__users_db = users_db # delegates the requests based on request type def handle_request(self, req_type, js...
import json import traceback class RequestHandler: def __init__(self, categories_db, items_db): self.__categories_db = categories_db self.__items_db = items_db # delegates the requests based on request type def handle_request(self, req_type, json_data): json_response = {} ...
# # Copyright (C) 2012 - 2015 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=unused-argument """Abstract implementation of backend modules. .. versionchanged:: 0.2 The methods :meth:`load_impl`, :meth:`dump_impl` are deprecated and replaced with :meth:`load_from_stream` and :meth:`load_from...
# # Copyright (C) 2012 - 2017 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=unused-argument r"""Abstract implementation of backend modules: Backend module must implement a parser class inherits :class:`Parser` or its children classes of this module and override all or some of the methods as need...
"""Support for Enphase Envoy solar energy monitor.""" import logging import voluptuous as vol from homeassistant.helpers.entity import Entity from homeassistant.components.sensor import PLATFORM_SCHEMA import homeassistant.helpers.config_validation as cv from homeassistant.const import ( CONF_IP_ADDRESS, CONF...
"""Consts for the OpenWeatherMap.""" from __future__ import annotations from homeassistant.components.sensor import ( STATE_CLASS_MEASUREMENT, SensorEntityDescription, ) from homeassistant.components.weather import ( ATTR_CONDITION_CLOUDY, ATTR_CONDITION_EXCEPTIONAL, ATTR_CONDITION_FOG, ATTR_CO...
"""Utility meter from sensors providing raw data.""" import logging from decimal import Decimal, DecimalException import homeassistant.util.dt as dt_util from homeassistant.const import ( CONF_NAME, ATTR_UNIT_OF_MEASUREMENT, EVENT_HOMEASSISTANT_START, STATE_UNKNOWN, STATE_UNAVAILABLE) from homeassistant.core ...
""" (c) Stratagem This module provides functions for data retrieval. Set database connection information in file: settings.py """ __author__ = 'riko' import datetime import MySQLdb import pandas as pd import pandas.io.sql as psql import settings as stg ###########################################################...
import os from vial import vfunc, vim from vial.utils import get_var, vimfunction from . import env def python_buffer(buf): vfunc.setbufvar(buf.number, '&omnifunc', 'VialPythonOmni') last_result = None @vimfunction def omnifunc(findstart, base): global last_result if findstart: source, pos = get_...
from datetime import timedelta import environ from kombu import (Exchange, Queue) from treeherder import path env = environ.Env() TREEHERDER_MEMCACHED = env("TREEHERDER_MEMCACHED", default="127.0.0.1:11211") TREEHERDER_MEMCACHED_KEY_PREFIX = env("TREEHERDER_MEMCACHED_KEY_PREFIX", default="treeher...
import django_filters from rest_framework import (filters, pagination, viewsets) from rest_framework.decorators import (detail_route, list_route) from rest_framework.permissions import IsAuthenticated from rest_framework.resp...
import numpy as np from . import config as ttconf from .distribution import Distribution from .utils import clip from .config import FFT_FWHM_GRID_SIZE def _convolution_integrand(t_val, f, g, inverse_time=None, return_log=False): ''' Evaluates int_tau f(t+tau)*g(tau) or int_tau f(t-t...
""" Routes and views for the flask application. """ import hashlib import json import uuid from flask import render_template, send_from_directory, redirect, url_for, session, g, request from FlaskWebProject import app, db, lm, facebook, google, dbSession, auto_logger from flask.ext.login import login_user, logout_user...
from .myqt import QT import pyqtgraph as pg import time import os from collections import OrderedDict import pickle from ..dataio import DataIO from ..datasource import data_source_classes from .tools import get_dict_from_group_param, ParamDialog, open_dialog_methods from ..datasets import datasets_info, download_da...
# pylint: disable=undefined-variable """ Contains base class for tensorflow models """ import os import glob import re import json import threading import numpy as np import tensorflow as tf from ..base import BaseModel from .layers import mip, conv_block from .losses import dice LOSSES = { 'mse': tf.losses.me...
import os import platform import subprocess from string import Template from tempfile import NamedTemporaryFile from subprocess import check_call from .. import exchange class MeshScript: def __init__(self, meshes, script, tmpfile_ext='stl'): self.mesh...
"""Contains the drivers and interface code for pinball machines which use the Multimorphic P3-ROC hardware controllers. Much of this code is from the P-ROC drivers section of the pyprocgame project, written by Adam Preble and Gerry Stellenberg. It was originally released under the MIT license and is released here unde...
#!/usr/bin/env python # # Copyright (c) 2016-2019, Magnus Edenhill # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, thi...
#!/usr/bin/env python3 import fnmatch import os import sys import re import math import platform import xml.etree.ElementTree as ET ################################################################################ # Config # ########################...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 Tuukka Turto # # This file is part of pyHerc. # # pyHerc 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 Licens...
#!/usr/bin/env python # pylama:ignore=C901 import asyncio import urwid from numpy.linalg import inv from numpy import dot, array, insert from opentrons import robot, instruments from opentrons.robot import robot_configs from opentrons.util.calibration_functions import probe_instrument from opentrons.solve import solv...
from trivup import trivup from trivup.apps.KerberosKdcApp import KerberosKdcApp import contextlib import os import socket import time class KafkaBrokerApp (trivup.App): """ Kafka broker app Depends on ZookeeperApp """ def __init__(self, cluster, conf=None, on=None): """ @param cluster...
import logging import time from django.contrib.auth.models import User from django.conf import settings from django.utils import timezone from rest_framework.renderers import JSONRenderer import json from emstrack.tests.util import point2str from login.models import UserProfile, Client, ClientStatus, ClientLog, Clie...
# coding=utf-8 from trnltk.phonetics.alphabet import TurkishAlphabet from trnltk.stem.dictionaryitem import RootAttribute class PhoneticExpectation(object): VowelStart = 'VowelStart' ConsonantStart = 'ConsonantStart' class PhoneticAttributes(object): LastLetterVowel = "LastLetterVowel" LastLetterConso...
import os # os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # os.environ["CUDA_VISIBLE_DEVICES"] = "1" from src.python.consts import * from src.python.preprocess import * from src.python.geneontology import * from src.python.baselines import * from pymongo import MongoClient from tqdm import tqdm import tensorflo...
import os # os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" # os.environ["CUDA_VISIBLE_DEVICES"] = "1" from src.python.consts import * from src.python.preprocess import * from src.python.geneontology import * from src.python.baselines import * from pymongo import MongoClient from tqdm import tqdm import tensorflo...
# -*- coding: utf-8 -*- # libavg - Media Playback Engine. # Copyright (C) 2003-2008 Ulrich von Zadow # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, o...
# -*- coding: utf-8 -*- import os import sys import hashlib import logging import json from functools import wraps, partial from collections import Sequence, Mapping from time import time import click import numpy as np import pandas as pd import dask.dataframe as dd from joblib import Memory from tempfile import mk...
# coding=utf-8 """ © 2013 LinkedIn Corp. 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 agreed ...
from moksha.api.widgets.live import LiveWidget class HelloWorldWidget(LiveWidget): topic = "helloworld" template = """ <b>Hello World Widget</b> <form onsubmit="return send_msg()"> <input name="text" id="text"/> </form> <ul id="data"/> <script> ...
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. import logging from django.conf impor...
import sys from discord import Game from alexis import Command from alexis.base.utils import is_float, is_int class ConfigCmd(Command): def __init__(self, bot): super().__init__(bot) self.name = 'config' self.help = 'Administración de configuración' self.bot_owner_only = True ...
# -*- coding: utf-8 -*- from . import manager from . import utils from . import actions from datetime import datetime from functools import partial class Call(object): def __init__(self, uniqueid): self.uniqueid = uniqueid self.action_id = None self.queue = utils.Queue() self.crea...
""" Classes for scaling refinement engines. Classes are inherited from the dials.refinement engine with a few methods overwritten to use them with scaling code.""" from __future__ import absolute_import, division, print_function import logging from dials.algorithms.refinement.engine import ( SimpleLBFGS, Gaus...
from bs4 import BeautifulSoup from park_api.geodata import GeoData from park_api.util import convert_date, generate_id, get_most_lots_from_known_data import os.path data_url = "https://apps.dresden.de/ords/f?p=1110" data_source = "https://www.dresden.de/parken" city_name = "Dresden" type_map = { "Altmarkt": "Tief...
# Copyright 2013 Locaweb. # 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...
#!/usr/bin/env python import urllib2 import json import os import platform import argparse import datetime def open_browser(url): platform_name = platform.system() if platform_name == 'Darwin': os.system('open ' + url) elif platform_name == 'Windows': os.system('start ' + url) else: ...
# -*- encoding: utf-8 -*- import time import cPickle import numpy as np import utils.logger import tensorflow as tf from skimage.transform import resize from collections import deque from utils import checkpoint_utils from actor_learner import ONE_LIFE_GAMES from utils.decorators import Experimental from utils.fast_ct...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from http import HTTPStatus import json from django.test import TestCase, Client from django.contrib.auth import get_user_model from .models import InvenTreeSetting, WebhookEndpoint, WebhookMessage from .api import WebhookView class SettingsTest(TestCa...
""" Order model definitions """ # -*- coding: utf-8 -*- import os from datetime import datetime from decimal import Decimal from django.db import models, transaction from django.db.models import Q, F, Sum from django.db.models.functions import Coalesce from django.core.validators import MinValueValidator from djang...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin import plugin.models as models import plugin.registry as pl_registry def plugin_update(queryset, new_status: bool): """ General function for bulk changing plugins """ apps_changed = False # Run thr...
""" Mark jobs as completed. Check tasks in a job, and when all are complete mark the job as complete. Initial delay: rand(15 minutes) Periodic delay: 60 minutes """ import logging import random import time from tornado.ioloop import IOLoop logger = logging.getLogger('job_completion') def job_completion(module): ...