src
stringlengths
721
1.04M
import xbmc,xbmcgui,xbmcaddon,os,sys,main,re,time,calendar from datetime import datetime addon_id = 'plugin.video.movie25' selfAddon = xbmcaddon.Addon(id=addon_id) def tosec(m): if m.group(1) == '-': pos = 1 else: pos = -1 sec = 0 sec += int(m.group(2)) * 3600 sec += int(m.group(3)) sec = sec ...
# -*- coding: utf-8 -*- # Copyright 2016 OpenMarket Ltd # # 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 la...
# -*- coding: utf-8 -*- from django.core.management.base import BaseCommand from django.contrib.sites.models import Site from cadastro.models import Cidade, Bairro from rh.models import Funcionario, PeriodoTrabalhado, Cargo, Departamento from account.models import User from optparse import make_option import os, cs...
from unittest import TestCase import numpy as np from alias.src.intrinsic_surface import xi, dxy_dxi, ddxy_ddxi class TestISM(TestCase): def setUp(self): self.qm = 8 self.qu = 5 self.n_waves = 2 * self.qm + 1 self.coeff = np.ones(self.n_waves ** 2) * 0.5 self.dim = [10.,...
import wx from os.path import expanduser import logging import threading from configobj import ConfigObj config = ConfigObj("default.conf", unrepr=True) lock = threading.Lock() class OrganizerView(wx.Frame): def __init__(self, parent, title): super(OrganizerView, self).__init__(parent, title=title, size=(4...
#! /usr/bin/env python """ Framework per il monitoraggio della rete Modulo per la scansione multithread della rete """ from threading import Thread from addresses import get_network_address from scan import host_discovery from host import Host from time import sleep from sys import argv, exit # classe che rappresen...
from fontTools.misc.py23 import bytesjoin from fontTools.misc import sstruct from fontTools.misc.textTools import safeEval, readHex from . import DefaultTable import sys import array GPKGFormat = """ > # big endian version: H flags: H numGMAPs: H numGlyplets: H """ # psFontName is a byte string which follo...
from functools import wraps from typing import Callable from ._scope import Scope class Injector(Callable): """ class decorator to inject dependencies into a callable decorated function """ def __init__(self, dependencies: dict, fun: Callable): self.dependencies = dependencies se...
"""General, basic commands that are common for Discord bots""" import inspect import discord from discord.ext.commands import BadArgument, cooldown, BucketType, Group, has_permissions from ._utils import * from .. import db class General(Cog): """General commands common to all Discord bots.""" @command() ...
""" Django settings for dblog project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os ...
# This file is part of PlexPy. # # PlexPy 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. # # PlexPy is distributed in the hope t...
# Copyright 2020, Aiven, https://aiven.io/ # # This file is under the Apache License, Version 2.0. # See the file `LICENSE` for details. try: from functools import cached_property except ImportError: cached_property = None from aiven.client.argx import arg, CommandLineTool class TestCLI(CommandLineTool): ...
################################################################################ # 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Perform syntax highlighting on Scribe logs. """ import sys, os, re import time import errno import instabot # Hard-coded ANSI escape sequences for coloring. COLORS = {None: '\033[0m', 'bold': '\033[1m', 'black': '\033[30m', 'red': '\033[31m', 'green': '\033[32m...
#!/usr/bin/env python # encoding: utf-8 from __future__ import unicode_literals, print_function import logging import os import re from blinker import signal from pelican import signals from pelican.utils import mkdir_p from bs4 import BeautifulSoup logger = logging.getLogger(__name__) try: from PIL import I...
# -*- coding: utf-8 -*- from itertools import repeat import six from django.db import models, connections from django.db.models.query import QuerySet from django.utils.encoding import smart_text from djorm_pgfulltext.utils import adapt # Compatibility import and fixes section. try: from django.db.transaction im...
from driver import Driver # from robot.output import LOGGER import logging, time, sys from ConfigParser import SafeConfigParser # log_path = '/home/m/repo/db/created_suites.log' # logging.basicConfig(filename=log_path, format='%(message)s\n', level=logging.DEBUG) def get_plan_name(path): '''Returns directory name of...
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
from ossos.pipeline import mk_mopheader, mkpsf, step1, slow from ossos import util, storage import logging import sys import os import shutil util.config_logging(logging.INFO) version='p' force=False dry_run=False prefix='' lines = open(sys.argv[1]).readlines() basedir=os.getcwd() for line in lines: expnum =...
#!/usr/bin/python # -*- coding: utf-8 -*- # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium # Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # mo...
## # Copyright (c) 2005-2017 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
"""Exceptions raised from the Cihai library.""" class CihaiException(Exception): """Base Cihai Exception class.""" class ImportStringError(ImportError, CihaiException): """ Provides information about a failed :func:`import_string` attempt. Notes ----- This is from werkzeug.utils c769200 on ...
import os from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from .factories import UserFactory class RegisterTest(TestCase): def setUp(self): self.url = reverse('registration_regis...
""" MIT License Copyright (c) 2018 Claude SIMON (https://q37.info/s/rmnmqd49) 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, ...
# -*- coding: utf-8 -*- """ * Purpose : Dokument- und Projektverwaltung Schnittstelle * Creation Date : 19-11-2014 * Last Modified : Di 24 Feb 2015 15:46:51 CET * Author : mattis * Coauthors : christian, ingo, Kirill * Sprintnumber : 2, 5 * Backlog entry : TEK1, 3ED9, DOK8, DO14, KOL1 """ import os from djang...
# =============================================================================== # Copyright 2014 Jake Ross # # 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...
#!/usr/bin/env python3 """ Reads in a vocabulary file from Gabriel containing referring ability (RA) scores and counts for each word and then writes it as a LaTeX tabular environment. The first column is the word, second is the count and third is the RA. """ __author__ = "Todd Shore <errantlinguist+github@gmail.co...
import simplejson import urllib2 from random import randint from secrets import * from tumblpy import * # previously used content is logged to a file, read that file published_file = 'published.json' json_data=open(published_file) published = simplejson.load(json_data) # read the json feed for Rocket Launches - see ...
import datetime import sys from os.path import isdir from unittest import mock from unittest.mock import patch import click import hypothesis.strategies as st import pytest from dateutil.tz import tzlocal from freezegun import freeze_time from hypothesis import given from todoman.cli import cli, exceptions from todom...
""" Hangman Game (v1.0) Name: samuel armstrong Date: """ import random count=0 def load_file(filename): """ Function to return a word list from a plain text file; Note: You will need to open the file, read and append each line to an array (or list), close the file and then ret...
############################################################################### # # Copyright (C) 2017-2018 Andrew Muzikin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
#!/usr/bin/python # # linearize-data.py: Construct a linear, no-fork version of the chain. # # Copyright (c) 2013-2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # from __future__ import print_func...
from collections import defaultdict, Counter import numpy as np class MarkovModel: def __init__(self, order=3): self.order = order self.states = defaultdict(Counter) def gen(self, history): """ Based on a history, generate a prediction for next step :param history: ...
import asyncio from asyncio import Future import rx from rx import operators as ops from rx.scheduler.eventloop import AsyncIOScheduler from rx.core import Observable def to_async_generator(sentinel=None): loop = asyncio.get_event_loop() future = Future() notifications = [] def _to_async_generator(s...
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, 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 ...
# -*- coding: utf-8 -*- # Preprocesses ENCOW14 version for COW16 transformation. import argparse import os.path import sys import gzip import re CHUNK_TAGS = set(['<adjc>', '</adjc>', '<advc>', '</advc>', '<conjc>', '</conjc>', '<intj>', '</intj>', '<lst>', '</lst>', '<nc>', '</nc>', '<pc>', '</pc>', '<prt>', '</prt...
# -*- coding: utf-8 -*- ################################################################################ # LOTO ################################################################################ def loto(phrase,the,chance,fin): table1 = [(random.randint(1,49)), (random.randint(1,49)), (random.randint(1,49)), (random...
__author__ = 'amentis' from RxAPI.RxGUI import * class Login(Screen): """ Login form for users to enter REXI """ def __init__(self): Screen.__init__(self, "REXI Login") self.window = Window(self, "Login window") self.window.set_size('800px', '600px') self.title = Labe...
# Copyright 2021 The FedLearner 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ---------------------------------------------------------------- # test_colonFormat.py # # test for colonFormat rule # ---------------------------------------------------------------- # copyright (c) 2014 - Domen Ipavec # Distributed under The MIT License, see LICENSE #...
import numpy as np import pytest from pandas import DataFrame, Series import pandas.util.testing as tm @pytest.mark.parametrize('subset', ['a', ['a'], ['a', 'B']]) def test_duplicated_with_misspelled_column_name(subset): # GH 19730 df = DataFrame({'A': [0, 0, 1], 'B': [0, 0, 1], ...
#!/bin/env python # # AutoPyfactory batch plugin for Condor # # # At init # - confirm bosco local exists # - get paths for auth tokens #At submit # -check if cluster is added to bosco # -if not, # get lock # cp files # add cluster # test bosco # - do submit # 1) create ~/.ssh/bosco_key.rsa ~/.ssh/bosco_k...
# # Copyright (c) 2012, 2013 NORDUnet A/S # 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 li...
#!/usr/bin/env python #The MIT License (MIT) #Copyright (c) 2016 Massimiliano Patacchiola # #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF #MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ...
# Copyright 2014-2018 The PySCF Developers. 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 appl...
#!/usr/bin/env python import os import unittest import sys from test_common import TestCommon sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'library')) from fastly_service import FastlyConfiguration class TestFastlyResponseObject(TestCommon): @TestCommon.vcr.use_cassette() def test_fastly_re...
from __future__ import absolute_import, division, print_function import os import sys import timeit import numpy as np from scipy import misc from scipy.ndimage.filters import convolve from .dataset import Dataset from ..ssim import ssim FR_MET_BASEPATH = 'FR_met/' FR_MET_SUBPATH_LIVE = 'LIVE/LIVE IQA DB/' FR_MET_S...
# Copyright 2020 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...
from typing import Tuple from dash.utils import chunks, is_dict_equal from dash.utils.sync import BaseSyncer, SyncOutcome, sync_local_to_changes, sync_local_to_set from django.utils.timezone import now from casepro.contacts.models import Contact, Field, Group from casepro.msgs.models import Label, Message, Outgoing ...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2006 ACYSOS S.L. (http://acysos.com) All Rights Reserved. # Pedro Tarrafeta <pedro@acysos.com> # Copyright (c) 2008 Pablo Roc...
import json import urllib, urllib2 import keys # Add your BING_API_KEY BING_API_KEY = keys.BING_API_KEY def main(): # The main function should ask a user for a query (from the command line) query = raw_input("Please enter a search query: ") # and then issue the query to the BING API via the run_query method res...
import time import glob import atexit # Once we get a DB set up, we'll activate this # import mysql.connector # To save data locally in the event we can't post or need to recover/reset data import logging import requests import json import threading import datetime import RPi.GPIO as GPIO # from socketIO_client import...
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License. import os import shutil import tempfile import zipfile from datetime import datetime, timedelta import azurelinuxagent.common.logger as logger from azurelinuxagent.common.utils import fileutil from azurelinuxagent.common.u...
# -*- coding: utf-8 -*- """ This module contains classes and methods related to Minimal Recursion Semantics [MRS]_. In addition to MRS, there are the related formalisms Robust Minimal Recursion Semantics [RMRS]_, Elementary Dependency Structures [EDS]_, and Dependency Minimal Recursion Semantics [DMRS]_. As a convenie...
"""Helper routines for processing data received from an IOTile device.""" import struct from iotile.core.exceptions import HardwareError class ControlStructure: """A shared memory control structure allowing bidirectional communication with an IOTile device.""" # The control structure in RAM is 16 bytes lon...
#!/usr/bin/env python # This file is part of nexdatas - Tango Server for NeXus data writer # # Copyright (C) 2012-2017 DESY, Jan Kotanski <jkotan@mail.desy.de> # # nexdatas is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the ...
RPCVER = '2.0' import hmac import hashlib import httplib import urllib import urllib2 import datetime # Different versions of Python have a different name for the JSON library. try: import simplejson as json except ImportError: import json def json_serial(obj): """JSON serializer for objects not seriali...
#! /usr/bin/python ## pysieved - Python managesieve server ## Copyright (C) 2007 Neale Pickett ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or (at ## you...
import logging from io import BytesIO from PIL import Image, ExifTags from followthemoney import model from ingestors.ingestor import Ingestor from ingestors.support.ocr import OCRSupport from ingestors.support.timestamp import TimestampSupport from ingestors.exc import ProcessingException log = logging.getLogger(__n...
import datetime import pprint __author__ = 'michaell' import pymongo from tornado.options import options class ProjectHoursMongoDriver(object): """ Project hours mongo driver implementation """ @staticmethod def get_month_data(month, year, user): """ Get results from database ...
# cython: language_level=3 import re class Mreplace: def __init__(self, mydict): self._mydict = mydict self._rx = re.compile('|'.join(map(re.escape, self._mydict))) def replace(self, text): return self._rx.sub(lambda x: self._mydict[x.group(0)], text) class Mmatch: def __init__(s...
# python # This file is generated by a program (mib2py). Any edits will be lost. from pycopia.aid import Enum import pycopia.SMI.Basetypes Range = pycopia.SMI.Basetypes.Range Ranges = pycopia.SMI.Basetypes.Ranges from pycopia.SMI.Objects import ColumnObject, MacroObject, NotificationObject, RowObject, ScalarObject, N...
# -*- coding: utf-8 -*- import unittest from collections import OrderedDict from attrdict import AttrDict try: # py3 from unittest.mock import Mock, MagicMock, patch, call, PropertyMock except ImportError: # py2 from mock import Mock, MagicMock, patch, call, PropertyMock from six import u from ambry...
from datetime import datetime from urllib.parse import urljoin from constants import REDIS_HOST, REDIS_PORT, REDIS_PASS, get_environment, URL, TITLE, SENTENCES, BODY, DATE_FOUND, \ HACKER_NEWS_ID from flask import Flask, render_template, request import redis from utils import get_stories from werkzeug.contrib.atom ...
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. # Pgen imports from __future__ import print_function from . import grammar, token, tokenize class PgenGrammar(grammar.Grammar): pass class ParserGenerator(object): def __init__(self, filenam...
# -*- coding: utf-8 -*- __author__ = 'eso' import sys sys.path.append('../../') import re import pywikibot def add_zeros(number, digits): number_str = str(number) if number < 10: for members in range(digits-1): number_str = "0" + number_str elif number < 100: for members in rang...
import gdb import re ################################################################################################# ##### Type pretty printers ################################################################################################# class NimTypePrinter(gdb.types.TypePrinter): "Nim type printer, one pr...
''' Complete code file only from ComplexNetworkSim's "getting started" documentation section, for visualising a simulation. For explanations refer to the documentation page. Current link: http://complexnetworksim.0sites.net/start.html (documentation hosting may change place - see the PyPi index page.) @author: Jo...
from django.utils import unittest try: import yaml # NOQA PYYAML_AVAILABLE = True except ImportError: PYYAML_AVAILABLE = False from django.core import serializers from django.test import TestCase from django.db.models.query_utils import DeferredAttribute from .test_models import AngryBigCat, Animal, BigC...
import errno import mock import os import pickle from . import DATA_DIR from django.conf import settings from django.core.urlresolvers import reverse from .base import TestCase from graphite.whitelist.views import load_whitelist, save_whitelist class WhitelistTester(TestCase): settings.WHITELIST_FILE = os.path....
#! /usr/bin/env python # # This script is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2015. It is licensed under # the three-clause BSD license; see LICENSE. # Contact: khmer-project@idyll.org # # pylint: disable=invalid-name,missing-docstring """ Split up pa...
# -*- test-case-name: twisted.test.test_tcp -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Various asynchronous TCP/IP classes. End users shouldn't use this module directly - use the reactor APIs instead. """ from __future__ import division, absolute_import # System Imports import t...
# This file is part of the GOsa framework. # # http://gosa-project.org # # Copyright: # (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de # # See the LICENSE file in the project's top-level directory for details. class ACLException(Exception): pass class CommandInvalid(Exception): """ Exception which ...
# code from https://github.com/BBarbosa/tflearn-image-recognition-toolkit/blob/4a0528dcfb206b1e45997f2fbc097aafacfa0fa0/scripts/html_link_parser.py import re import argparse from PIL import Image from io import BytesIO from bs4 import BeautifulSoup from skimage import io as skio from urllib.request import urlopen imp...
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
""" Functions which support creating dicts (mappings) with interesting structures and simplify getting or setting values which may be nested deeply within the object. """ from __future__ import absolute_import # stdlib import collections def query_json_struct_from_path(json_struct, path): """ Query the json...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2014, 2015 Martin Raspaud # Author(s): # Martin Raspaud <martin.raspaud@smhi.se> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundatio...
"""Config flow for SenseME.""" import ipaddress import voluptuous as vol from aiosenseme import async_get_device_by_ip_address, discover_all from homeassistant import config_entries from homeassistant.const import CONF_HOST from .const import CONF_HOST_MANUAL, CONF_INFO, DOMAIN DISCOVER_TIMEOUT = 5 class SensemeFl...
import datetime import json from urllib.parse import unquote from urllib.request import urlopen from flask import jsonify, Response from peewee import CharField, DateTimeField, IntegerField, Model import config #------------------------------------------------------------------------------- # Constants #------------...
""" An example demonstrating a stand-alone "notebook". Copyright (c) Jupyter Development Team. Distributed under the terms of the Modified BSD License. Example ------- To run the example, see the instructions in the README to build it. Then run ``python main.py``. """ import os import json from jupyterlab_server i...
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Jakub Beranek # # This file is part of Devi. # # Devi 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, version 3 of the License, or # (at yo...
# -*- coding: utf-8 -*- 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 'UserProfile' db.create_table('main_userprofile', ( ('id', self.gf('django.db.mod...
#!/usr/bin/env python # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All c...
#!/usr/bin/env python # This file is part of VoltDB. # Copyright (C) 2008-2013 VoltDB Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitati...
#!/usr/bin/env python # -*- coding: UTF-8 -*- from flask import jsonify from flask import current_app from influxdb import InfluxDBClient from app.base import ApiResource class InfluxResource(ApiResource): endpoint = 'influxdb' url_prefix = '/influxdb' url_rules = { 'index': { 'rule...
# -*- coding: utf-8 -*- # This file is part of tofbot, a friendly IRC bot. # You may redistribute it under the Simplified BSD License. # If we meet some day, and you think this stuff is worth it, # you can buy us a beer in return. # # Copyright (c) 2015 Christophe-Marie Duquesne <chmd@chmd.fr> "See PluginLag" from tof...
import re from billy.scrape.actions import Rule, BaseCategorizer # These are regex patterns that map to action categories. _categorizer_rules = ( # Capture some groups. Rule(r'Senators (?P<legislators>.+) a committee of conference'), Rule(r"(?P<version>Printer's No. \d+)"), Rule(r'(?i)introduced', 'b...
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
""" GCode T0 and T1 Select currently used extruder tool Author: Mathieu Monney email: zittix(at)xwaves(dot)net Website: http://www.xwaves.net License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/ """ from GCodeCommand import GCodeCommand import logging class ToolChange(GCodeCommand): def execute(self...
# The MIT License # Copyright (c) 2012 ObjectLabs Corporation # 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...
# This file holds physical constants and reads atomic weights. import sys import re import os import inspect ############### # Physical Constants PHYSICAL_CONSTANTS = { 'h' : 6.626070E-34, # Planck's constants in J * s 'c' : 2.997925E+10, # speed of light in units of cm/s 'Eh' : 4.359745E-18, # energy o...
"""This module implements a loader and dumper for the svmlight format This format is a text-based format, with one sample per line. It does not store zero valued features hence is suitable for sparse dataset. The first element of each line can be used to store a target variable to predict. This format is used as the...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2010, 2011 CERN. ## ## Invenio is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your opt...
# -*- coding: utf-8 -*- # © 2016 1200 WebDevelopment <1200wd.com> # © 2017 Therp BV <http://therp.nl> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). import logging from openerp import models, fields, api _logger = logging.getLogger(__name__) class AccountInvoice(models.Model): _inherit = "...
# Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
# -*- coding: utf-8 -*- r''' =========================== Manage the Windows registry =========================== Many python developers think of registry keys as if they were python keys in a dictionary which is not the case. The windows registry is broken down into the following components: ----- Hives ----- This is...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import datetime import json import pycountry import pytz import six import time from celery.app.task import Task from decimal import Decimal from django.conf import settings from django.contrib.auth.models import User, Group from djang...
# (c) 2015, Ansible Inc, # # This file is part of Ansible # # Ansible 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. # # Ansible is di...
from __future__ import absolute_import from django.forms.extras.widgets import SelectDateWidget from django.forms.fields import DateField from django.utils.translation import ugettext_lazy as _ from fobi.base import FormFieldPlugin, get_theme from . import UID from .forms import DateDropDownInputForm __title__ = 'f...