text
stringlengths
12
6.59M
# data/models/inventory.py: Data models that make up the shopping inventory # # Copyright 2014 Sudaraka Wijesinghe <sudaraka.org/contact> # # 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 Founda...
# -*- coding: utf-8 -*- # Copyright (c) 2010-2013, GEM Foundation. # # OpenQuake 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....
# 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 writing, software # distributed unde...
"""Base Bolt classes.""" from __future__ import absolute_import, print_function, unicode_literals from collections import defaultdict import os import signal import sys import threading import time import warnings from six import iteritems, reraise, PY3 from .base import Component from .ipc import (read_handshake, r...
import bpy import sys argv = sys.argv[sys.argv.index("--") + 1:] print(argv[0]) filepath_input = argv[0] filepath_output = argv[1] thickness = float(argv[2]) cube = bpy.data.objects['Cube'] bpy.context.scene.objects.unlink(cube) bpy.ops.import_scene.x3d(filepath=filepath_input) obj = bpy.data.objects['ShapeIndexe...
#!/usr/bin/env python """Base classes for clients.""" import logging import multiprocessing import time from datetime import datetime import exceptions import functools from configfile import ConfigFile from server_messenger import ServerMessenger, CaptureStatus from checkers.jobs import JobChecker from checkers.term...
#!/usr/bin/env python # -*- coding: utf-8 -*- # region Description """ arp_scan.py: ARP scan local network Author: Vladimir Ivanov License: MIT Copyright 2019, Raw-packet Project """ # endregion # region Import # region Add path with Raw-packet modules from sys import path from os.path import dirname, abspath proje...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2012-2018 GEM Foundation # # OpenQuake 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 Licen...
"""Fetch sample readings from sensorpush API, summarize out-of-limit periods and upload those to StatusDB. Seems to be one reading per minute given by the API, so nr of samples can be seen as the number of minute fetched, for example 1440 samples for 24h. """ import requests import argparse import yaml impor...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Prestapyt is a library for Python to interact with the PrestaShop's Web Service API. Prestapyt is a direct port of the PrestaShop PHP API Client, PSWebServiceLibrary.php :copyright: (c) 2011-2012 Guewen Baconnier :copyright: (c) 2011 Camptocamp SA ...
"""Base class for all the objects in SymPy""" from copy import copy from sympy.core.assumptions import ManagedProperties from sympy.core.cache import cacheit from sympy.core.core import BasicType, C from sympy.core.sympify import _sympify, sympify, SympifyError from sympy.core.compatibility import (callable, reduce, cm...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import, division __version_info__ = (0, 2, 1) __version__ = '.'.join(map(str, __version_info__))
"""functions and classes related to wheels.""" import os import shutil import tempfile import json import re import zipfile import platform import six from six.moves import configparser try: from stashutils.extensions import create_command from libversion import VersionSpecifier except ImportError: create...
from wq.io import BaseIO, XmlNetIO from datetime import datetime, date, timedelta from wq.io.parsers import readers from SOAPpy import SOAPProxy # The following imports are probably not necessary once the IO is working properly from xml.etree import ElementTree as ET import requests # This service can be accessed via ...
#!/usr/bin/env python # coding: utf-8 """ MSP module A Interface with the hardware """ try: # Terminal Class from serial.tools.miniterm import Miniterm from serial.tools.miniterm import CONVERT_CRLF # Terminal macros from serial.tools.list_ports import comports except Exception as erro...
# !/usr/bin/python # -*- coding: cp1252 -*- # ################################################################################## # # This program is part of OSRFramework. You can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation,...
"""SCons.Builder Builder object subsystem. A Builder object is a callable that encapsulates information about how to execute actions to create a target Node (file) from source Nodes (files), and how to create those dependencies for tracking. The main entry point here is the Builder() factory method. This provides a...
#!/usr/bin/python # -*- coding: utf-8 -*- # libavg - Media Playback Engine. # Copyright (C) 2003-2011 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...
# Copyright (c) 2014 Balazs Nemeth # # This file is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This file is distributed in the ho...
import constants import reversion from datetime import datetime from django.db import models from django.db.models.query_utils import Q from django.utils.translation import ugettext as _ from django.contrib.auth.models import User from django.core.urlresolvers import reverse from core.models import BaseModel from pu...
# Copyright 2012-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
""" sentry.processors.base ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from sentry.conf import settings from sentry.utils import InstanceManager __all__ = ('Processor',) class Processor(object): conditions = {} ...
from urllib.request import urlopen from common.funcfun import each, lmap import codecs def download(site): return urlopen(site).read().decode('utf-8') def downloads(sites): return list(map(download, sites)) def savefile(content, path): file = open(path, 'wb') file.write(content.encode('utf-8')) file.close() d...
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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...
from __future__ import absolute_import import os import multiprocessing import time import unittest import percy import threading import platform import flask import requests from selenium import webdriver from selenium.webdriver.chrome.options import Options class IntegrationTests(unittest.TestCase): @classmeth...
#!/usr/bin/env python # -*- coding:utf8 -*- # Copyright 2017, Schuberg Philis BV # # 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...
import zlib from colander import Invalid from pyramid.httpexceptions import HTTPError from pyramid.response import Response from ichnaea.decimaljson import ( dumps, loads, ) from ichnaea.exceptions import BaseJSONError MSG_EMPTY = 'No JSON body was provided.' MSG_GZIP = 'Error decompressing gzip data stream....
# This file is part of the MapProxy project. # Copyright (C) 2010 Omniscale <http://omniscale.de> # # 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 # ...
from pyxb.exceptions_ import * import unittest import pyxb.binding.datatypes as xsd class Test_ENTITY (unittest.TestCase): def testValid (self): valid = [ 'schema', '_Underscore', '_With.Dot', 'With-Hyphen' ] for f in valid: self.assertEqual(f, xsd.ENTITY(f)) def testInvalid (self)...
""" .. module:: stun_client .. role:: red BitPie.NET ``stun_client()`` Automat EVENTS: * :red:`datagram-received` * :red:`found-one-peer` * :red:`peers-not-found` * :red:`start` * :red:`timer-01sec` * :red:`timer-1sec` """ import os import random from logs import lg ...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- from __future__ import absolute_import import sys import time import re import os import io import platform from datetime import timedelta from svtplay_dl.utils import is_py2, filenamify, decode_html_entities, ensure_unicode from ...
# imagecodecs/numcodecs.py # Copyright (c) 2021, Christoph Gohlke # 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, # ...
# Copyright (c) 2014, Menno Smits # Released subject to the New BSD License # Please see http://en.wikipedia.org/wiki/BSD_licenses from __future__ import unicode_literals import imaplib import select import socket import sys import re from datetime import datetime from operator import itemgetter from . import respon...
import wx import numpy as np from FileHandler import ReadXYZ from scipy.signal import butter, filtfilt class Results(): def __init__(self): """EMPTY INITIATION""" def updateAll(self, Data): # Get Specifications self.removeDC = Data.Specs.CheckboxDC.GetValue() ...
# -*- coding: utf-8 -*- from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoAlertPresentException...
# encoding: utf-8 # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- import sublime, sublime_plugin, sys import os, subprocess, string, json, threading, re import base64 from chigi_args import ChigiArgs from check_env import CheckEnvironmentCommandThread class PhpConnectorTextCommand(sublime_plugin.TextCommand): def __init__(self,view): self.view = v...
import sys class Letter: def __init__(self, letter, freq): self.letter = letter self.freq = freq self.bitstring = "" def __repr__(self): return f'{self.letter}:{self.freq}' class TreeNode: def __init__(self, freq, left, right): self.freq = freq self.left =...
# Copyright (c) 2004-2008 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.rpath.com/permane...
# -*- coding: utf-8 -*- """Plotting waveforms.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import numpy as np from vispy import gloo from vispy.gloo import Texture2D from ._panzoom impo...
# # Copyright (c) 2005-2006 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/...
# Copyright 2011 Omniscale (http://omniscale.com) # # 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 o...
# -*- coding: utf-8 -*- import os import re import sys import pygments from pygments.lexers import get_lexer_by_name from pygments.formatters import HtmlFormatter from six.moves import html_entities from . import utils class Macro(object): """Base class for altering slide HTML during presentation generation"""...
# # Copyright (c) 2004-2009 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.rpath.com/perma...
import types import random import json import hashlib import time import string import tarfile import os import mailbox import logging from pytz import utc from datetime import datetime, timedelta from django.db import transaction from inboxen.models import Attachment, Tag, Alias, Domain, Email, Statistic from django....
""" url_notify.py - Phenny module to check websites for updates Rewritten again by Mozai This is free and unencumbered software released into the public domain. """ import httplib, time, re, rfc822, threading, urllib # -- config # global time between checks & min time between alerts # any 'delay' setting in SITES less...
import os import sys import numpy as np from collections import namedtuple from decimal import Decimal from decimal import ROUND_HALF_UP from astropy.time import Time from astropy.table import Table from astropy.wcs import WCS from astropy.modeling import models, fitting from matplotlib.colors import LogNorm import...
# # Copyright (c) 2004-2008 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.rpath.com/perma...
#!/usr/bin/env python3 """Simple module for email notifications when a task is finished. Currently only supports Gmail, over SMTP_SSL. Requires a configuration file (~/.notifyme by default) to specify the email address and password. I recommend using 2-step authentication and an app-specific password (which works pe...
import os import sys import numpy as np from collections import namedtuple from decimal import Decimal from decimal import ROUND_HALF_UP from astropy.time import Time from astropy.table import Table from astropy.wcs import WCS from piaa.utils import postgres as clouddb from pocs.utils.images import fits as fits_uti...
import sh import os import shutil class Shell(object): # @classmethod # def ls(cls, arguments=None): # return cls._execute(sh.ls, arguments) @classmethod def _execute(cls, f, *args, **kwargs): ''' interanl method to execute a command with args and kwargs and pass...
from __future__ import absolute_import import sys import numpy as np import scipy.interpolate as interpolate import datetime import dateutil import csv import copy from itertools import dropwhile from sunpy.net import hek from sunpy.time import parse_time from sunpy.sun import sun import sunpy.lightcurve __all__ = [...
# # Copyright (c) 2004-2005 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/...
#!/usr/bin/env python3 """Simple module for email notifications when a task is finished. Currently only supports Gmail, over SMTP_SSL. Requires a configuration file (~/.notifyme by default) to specify the email address and password. I recommend using 2-step authentication and an app-specific password (which works pe...
import base64 import annotators import bottle import json import hadoopy_hbase import time import uuid import hashlib import mturk_vision import picarus.api import numpy as np import crawlers import re import gipc import picarus_takeout import logging import msgpack # TODO: Abstract these operations from driver import ...
from .connectionpools import ConnectionPool from .cloudvolume import CloudVolume from .provenance import DataLayerProvenance from .skeletonservice import PrecomputedSkeleton, SkeletonEncodeError, SkeletonDecodeError from .storage import Storage from .threaded_queue import ThreadedQueue from .txrx import EmptyVolumeExce...
# Copyright (c) 2013 Steve Milner # 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, this list of conditions...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
""" gui/render ~~~~~~~~~~~~~~~~~~~~ Graphical user interface for rendering localization images :author: Joerg Schnitzbauer, 2016 :copyright: Copyright (c) 2016 Jungmann Lab, Max Planck Institute of Biochemistry """ import sys import os.path import traceback from PyQt4 import QtCore, QtGui import n...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright [2010] [Anso Labs, 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 ...
""" gui/render ~~~~~~~~~~~~~~~~~~~~ Graphical user interface for rendering localization images :author: Joerg Schnitzbauer & Maximilian Strauss, 2017-2018 :copyright: Copyright (c) 2017 Jungmann Lab, MPI of Biochemistry """ import os import os.path import sys import traceback from math import ceil...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# -*- coding: utf-8 -*- """ This is the base class that all picoscope modules use. As much logic as possible is put into this file. At minimum each instrument file requires you to modify the name of the API function call (e.g. ps6000xxxx vs ps4000xxxx). This is to force the authors of the instrument files to actually...
""" Command-line entry point. """ import os import sys import inspect import argparse import json import types import traceback from . import prettyprint class Option(object): def __init__(self, description): self._description = description def __str__(self): return self._description class ...
# -*- coding: utf-8 -*- # This is the base class that all picoscope modules use. As much as possible logic is # put into this file. At minimum each instrument file requires you to modify the name # of the API function call (e.g. ps6000xxxx vs ps4000xxxx). You can find pico-python # at github.com/colinoflynn/pico-pytho...
#! /usr/bin/env python3 import sys, io, asyncio, random, decimal, collections, getpass, pprint from connectrum.client import StratumClient from pycoin.ui import standard_tx_out_script from pycoin.tx.tx_utils import distribute_from_split_pool, sign_tx from pycoin.tx.Tx import Tx from subclasses import MyServerInfo, ...
import logging from datetime import datetime import hashlib import traceback import simplejson from gevent import socket import rawes import gevent from django.conf import settings from dimagi.utils.decorators.memoized import memoized requests_log = logging.getLogger("requests") requests_log.setLevel(logging.ERROR) i...
import logging from datetime import datetime import hashlib import os import traceback from django.core.mail import send_mail import math from requests import ConnectionError from restkit import RequestFailed import simplejson from gevent import socket import rawes import gevent from django.conf import settings from di...
#!/usr/bin/env python # 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 # # Authors: # - Mario Lassnig, mario.lassnig@cern.ch, 2016-2017 # - Daniel Dr...
import os import sys from pip.basecommand import Command from pip.commands.options import * from pip.index import PackageFinder from pip.log import logger from pip.exceptions import CommandError from pip.req import InstallRequirement, RequirementSet, parse_requirements from pip.util import normalize_path from pip.wheel...
from __future__ import (absolute_import, division, print_function, unicode_literals) import os import re import sys import time import glob import random import logging import ccdproc import numpy as np import numpy.ma as ma import matplotlib import math import pandas import scipy import shutil ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ tabutils.process ~~~~~~~~~~~~~~~~ Provides methods for processing `records`, i.e., tabular data. Examples: basic usage:: from tabutils.process import type_cast records = [{'some_value', '1'}, {'some_value', '2'}] ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import unittest from nose.plugins.attrib import attr from socorro.external import DatabaseError from socorro.external.p...
import socket from struct import * import sys import time import binascii def unauthenticated_test_packet(seq): # https://tools.ietf.org/html/rfc4656#section-4.1.2 # Sequence field sequence_number = pack('!I', int(seq)) # Used ! for bits alignment "network" (= big-endian) # Timestamp field localtim...
import logging import subprocess from collections import namedtuple import os import sys import tempfile import uuid import re from django.db.backends.base.creation import TEST_DATABASE_PREFIX def is_testing(): return os.environ.get("CCHQ_TESTING") == "1" class SharedDriveConfiguration(object): def __init_...
#! /usr/bin/env python # sfi -- slice-based facility interface import sys sys.path.append('.') import os, os.path import tempfile import traceback import socket import random import datetime import zlib import codecs import pickle from lxml import etree from StringIO import StringIO from types import StringTypes, Lis...
import collections from typing import Iterator, List, NamedTuple, Tuple import cv2 import numpy as np from data import lazy from data.image import coloring _WHITE = [255, 255, 255] _CROSS = np.array([ [0, 1, 0], [1, 1, 1], [0, 1, 0], ], np.uint8) _BIG_CROSS = np.array([ [0, 0, 1, 0, 0], [0, 0, 1, 0, 0], ...
#! /usr/bin/env python # sfi -- slice-based facility interface import sys sys.path.append('.') import os, os.path import tempfile import traceback import socket from types import StringTypes, ListType from optparse import OptionParser from sfa.trust.certificate import Keypair, Certificate from sfa.trust.credential im...
# -*- coding: utf-8 -*- """ Created on Thu Jul 27 16:39:59 2017 @author: asadm2 """ from __future__ import division, print_function, absolute_import import astropy from glob import glob from astropy.io import fits from astropy.io.fits import getdata import warnings from astropy.utils.exceptions import AstropyUserWarni...
import time import os import atexit try: from multiprocessing import Process, Pipe except ImportError: Process = None import numpy as nm from sfepy.base.base import sfepy_config_dir, ordered_iteritems from sfepy.base.base import output, get_default, set_defaults, Output, Struct from sfepy.base.log_plotter i...
import threading import datetime from .db_proxy_pool import DBProxyPool as DBProxy class ResourceType: def __init__(self, resource_type_dict): """ Initialize resource type name and attributes """ # name self.resource_name = resource_type_dict['resource_name'] # co...
#!/usr/bin/python """script to run the experiment make sure you've already generated and saved the stimuli you want (using stimuli.main). They should be in the order you want for that run. also make sure that you've already set up the monitor you'll be using in PsychoPy's monitor center """ import numpy as np from p...
#!/usr/bin/env python3 # # Copyright (c) 2019-2020 Fastly, Inc., Toru Maesaka, Goro Fuji # # 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 th...
#!/usr/bin/env python TRAJECTORY = 'squared' CONTROLLER = 'pid' # control constants K_X = 0.90 K_Y = 0.90 K_THETA = 0.90 # PID control constants K_P_V = 0.2 K_I_V = 1.905 K_D_V = 0.00 K_P_W = 0.45 K_I_W = 1.25 K_D_W = 0.000 if TRAJECTORY == 'linear': SIMULATION_TIME_IN_SECONDS = 60.0 MAX_V = 0.075 MAX_...
#!/usr/bin/env python from __future__ import print_function from builtins import input from builtins import range import sys import os import numpy import matplotlib if matplotlib.get_backend() != "TKAgg": matplotlib.use("TKAgg") import pmagpy.pmag as pmag import pmagpy.pmagplotlib as pmagplotlib import pmagpy.new...
import sys import getopt from ctl import HavenCtl def print_version(): import pkg_resources # part of setuptools version = pkg_resources.require("havenctl")[0].version print(version) def print_usage(): print """ Usage: havenctl [-a <remote_address> | --address=<remote_address>] [-p <...
from ImsrgDatum import QuantumNumbers # Directories FILES_DIR = '../files' PLOTS_DIR = '../plots' # Printing P_TITLE = '\033[91m' P_HEAD = '\033[95m' P_SUB = '\033[36m' P_BOLD = '\033[1m' P_END = '\033[0m' P_BREAK = '-' * 80 # Plotting PLOT_CMAP = 'gnuplot' LEGEND_MAX_COLS = 6 LEGEND_MAX_SPACE = .5 LEGEND_ROWS_PER_C...
#!/usr/bin/python # -*- coding: utf-8 -*- # # progressbar - Text progress bar library for Python. # Copyright (c) 2005 Nilton Volpato # # 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; ei...
"""Provides interface for constant values.""" # Learning rate for the optimizer. LR = 0.001 # Damping coefficient for momentum. DC = 0.9 # The rows, columns, and channels of the input-image. ROWS = 256 COLS = 256 CHAN = 3 # Color space that the input-image will be converted to. COLOR_SPACE = 'CIELAB' # Provides `encod...
#!/usr/bin/python # -*- coding: utf-8 -*- # # progressbar - Text progress bar library for Python. # Copyright (c) 2005 Nilton Volpato # # 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; ei...
import time import json from os import path VERSION = '16.6' APPNAME = 'tsdesktop' buildinfo = { 'TIME': None, } binfoFile = path.join(path.dirname(__file__), 'buildinfo.json') def writeBuildInfo(): global buildinfo from getpass import getuser buildinfo['TIME'] = time.time() buildinfo['AUTHOR'] =...
from datetime import datetime from pathlib import Path from typing import NamedTuple, TypeAlias import csv import warnings from .config import BankConfig, TransactionFormat # TODO: # * Make accignore a feature of the bank config file # * Make this file also function as a script. # - specify a bank and input path + ...
# -*- coding: utf-8 -*- """ The module's functions operate on message bodies trying to extract original messages (without quoted messages) """ from __future__ import absolute_import import regex as re import logging from copy import deepcopy from lxml import html, etree from talon.utils import (get_delimiter, html_...
# Copyright 2014 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# Django # Third-Party from auth0.v3.management import Auth0 from auth0.v3.management.rest import Auth0Error from django.conf import settings from django.db.models.signals import ( post_save, pre_delete, ) from django.dispatch import receiver # Local from .models import User @receiver(post_save, sender=User...
import csv import os import sys from collections import OrderedDict import luigi import numpy import pandas as pd from rdkit import DataStructs from rdkit.Chem import AllChem as Chem from rdkit.Chem import PandasTools from sklearn.externals import joblib from sklearn.multiclass import OneVsRestClassifier from sklearn.n...
import re from django.contrib.auth.models import User from django.db import models from datetime import datetime import requests from .weather import get_forecast_weather SOIL_TYPES = ( ('clay', 'Clay'), ('sand', 'Sand'), ) DAY_TYPES = ( (None, ''), (False, 'Even'), (True, 'Odd'), ) class Acc...
# -*- coding: utf-8 -*- from odoo import api, fields, models from odoo.tools import float_is_zero from odoo.exceptions import UserError # 状态可选值 TASK_STATES = [ ('todo', u'新建'), ('doing', u'正在进行'), ('done', u'已完成'), ('cancel', u'已取消'), ] AVAILABLE_PRIORITIES = [ ('0', u'一般'), ('1', u'低'), ...
from qqbot import QQBotSlot as qqbotslot, QQBot from tenhoubot import main as starttenhou import threading import re import random import time is_playing = False qq_group = None class BotConnector(object): def __init__(self, qqbot): self.qbot = qqbot self.stop_wait = False self.first_time ...