CombinedText
stringlengths
4
3.42M
import argparse from rasa.cli.arguments.run import add_run_arguments from rasa.cli.arguments.default_arguments import add_domain_param, add_stories_param from rasa.cli.arguments.train import ( add_force_param, add_data_param, add_config_param, add_out_param, ) def set_interactive_args(parser): ad...
# -*-coding:utf-8-*- """ application ~~~~~~~~~~~ Use this model to initialize web application. Usage ===== >>> from karlooper.web import IOModel >>> from karlooper.web.application import Application >>> application = Application(handlers={}, settings={}, port=8080, log_conf="./config.log") >>> application.run(io_mod...
# coding=utf-8 import hashlib import hmac import requests import time from operator import itemgetter from .helpers import date_to_milliseconds, interval_to_milliseconds from .exceptions import BinanceAPIException, BinanceRequestException, BinanceWithdrawException class Client(object): API_URL = 'https://api.bi...
from __future__ import absolute_import from functools import partial from . import idiokit from ._selectloop import cancel as selectloop_cancel, sleep as selectloop_sleep def _cancel(node, _, __): selectloop_cancel(node) def sleep(delay): event = idiokit.Event() node = selectloop_sleep(delay, event.su...
import os import random import re import shutil import subprocess import tempfile import time from assertions import assert_almost_equal, assert_one from cassandra import ConsistencyLevel from cassandra.concurrent import execute_concurrent_with_args from ccmlib.node import NodeError from dtest import Tester, debug fro...
from .forms import PostForm, ProjectPostForm, DebatePostForm, WorkhourPostForm, PlanbookPostForm from .models import Post, DebatePost, ProjectPost, Product from .constants import * MAP_MODEL_POST = { BOARD_ROLE['DEFAULT']:Post, BOARD_ROLE['PROJECT']:ProjectPost, BOARD_ROLE['DEBATE']:DebatePost, BOARD_ROLE['PLANBO...
# Django settings for exampleSettings project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) import os PROJECT_PATH = os.path.realpath(os.path.dirname(__file__)) ### stuff for the celery task queue BROKER_URL = 'django://' CELERY_ALWAYS_EAGER = True #CELERY_RESU...
"""LIF Ensemble Takes an intermediate representation of a LIF ensemble and returns a vertex and appropriate callbacks to load and prepare the ensemble for simulation on SpiNNaker. The build method also manages the partitioning of the ensemble into appropriate sized slices. """ import collections import numpy as np f...
#!/usr/bin/python """ **Fibonacci Sequence** - Enter a number and have the program generate the Fibonacci sequence to that number or to the Nth number. """ def fibonnaciSequence(n): assert n > 0 sequence = [1] # Initialize sequence to 1 while len(sequence) < n: if len(sequence) == 1: ...
class ApiObject: def __init__(self, _type=None, **data): self._type = _type self.data = data def get_or_fail(self, key): value = self.data[key] return self.wrap_api_object(value) def get_or_default(self, key, default=None): value = self.data.get(key, default) ...
# -*- coding: utf-8 -*- import os from datetime import datetime from ChatExchange.chatexchange.client import Client import HTMLParser import md5 import ConfigParser from helpers import environ_or_none import threading class GlobalVars: false_positives = [] whitelisted_users = [] blacklisted_users = [] ...
Revert "make atomic_replace use shutil.copy2 instead of os.rename() so it will work across filesystems". AR function was leaving some tmp files behind, want to revert, will have better implementation soon, this is the old way now. This reverts commit f74a1fa4f0b1a928a85c1316dfceb42637624a2f.
from django.test import TestCase # Create your tests here. removed keywords/tests.py, there should be keyword tests in the main test folder
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt, fmt_money, formatdate, getdate from frappe import msgprint, _ from erpnext.setup.utils impor...
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2009 Edgewall Software # Copyright (C) 2003-2006 Jonas Borgström <jonas@edgewall.com> # Copyright (C) 2006 Matthew Good <trac@matt-good.net> # Copyright (C) 2005-2006 Christian Boos <cboos@edgewall.org> # All rights reserved. # # This software is licensed as described in t...
# -*- coding: utf-8 -*- import datetime import logging from odoo import _, api, models, fields, exceptions from odoo.tools.translate import _ # from ..services.currency_getter import Currency_getter_factory from ..services.update_service_RU_CBRF import RU_CBRF_getter _logger = logging.getLogger(__name__) CURRENCY_D...
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Tests for uvdata object.""" import pytest import os import copy import itertools import h5py import numpy as np from astropy.time import Time from astropy.coordinates import Angle fro...
from django.core.exceptions import ObjectDoesNotExist from corehq.apps.cleanup.management.commands.populate_sql_model_from_couch_model import PopulateSQLCommand from corehq.apps.commtrack.models import ( SQLAlertConfig, SQLActionConfig, SQLConsumptionConfig, SQLStockLevelsConfig, SQLStockRestoreCon...
import collections import contextlib import copy import warnings import numpy import six from chainer import cuda from chainer import initializers from chainer import variable def _is_shape(value): if value is None: return True elif isinstance(value, collections.Sequence): try: r...
import argparse from rasa.cli.arguments.default_arguments import ( add_domain_param, add_stories_param, add_model_param, add_endpoint_param, ) from rasa.cli.arguments.train import ( add_force_param, add_data_param, add_config_param, add_out_param, add_debug_plots_param, add_dump...
from abc import ABCMeta, abstractmethod from firedrake import exp, Interpolator, conditional, Function, \ min_value, max_value __all__ = ["Condensation"] class Physics(object, metaclass=ABCMeta): """ Base class for physics processes for Gusto. :arg state: :class:`.State` object. """ def __...
""" Karr Lab build utilities :Author: Jonathan Karr <karr@mssm.edu> :Date: 2017-08-02 :Copyright: 2016, Karr Lab :License: MIT """ from glob import glob from junit2htmlreport.parser import Junit as JunitParser from nose2unitth.core import Converter as Nose2UnitthConverter import iocapture import os import pysftp impo...
""" Class description of a DNA chain built of base pairs """ from __future__ import division, unicode_literals, print_function import basepair import numpy as np import matplotlib.pyplot as plt import rotations as r from mpl_toolkits.mplot3d import Axes3D # NOQA from copy import deepcopy import rotations as rot BP...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 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/LIC...
class IOStreamWrapperMixin(object): @property def closed(self): return self.stream.closed def seekable(self): return self.stream.seekable() def readable(self): return self.stream.readable() def writable(self): return self.stream.writable() def fileno(self):...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # MIT License ''' A Bookmark attaches a set of Tags and a single Object ('class Filename' in the included example). ''' from sqlalchemy import Table from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import UniqueConstraint from sqlalchemy ...
# pip install neo4j-driver wordcloud matplotlib pillow image import argparse import csv import matplotlib import numpy as np import os import random import wordcloud from neo4j.v1 import GraphDatabase, basic_auth matplotlib.use('Agg') import matplotlib.pyplot import re def grey_color_func(word, font_size, position, ...
""" Simple module to interact with Fieldbook (fieldbook.com) Every function needs 3 standard args, an api key, a book id to work with, and a table to work with. They are the first three args in that order. From there, each function has different args. :function get: Get data from Fieldbook :function update: Change da...
import io import getopt import sys def usage(): print("usage: " + sys.argv[0] + " -d dictionary-file -p postings-file -q file-of-queries -o output-file-of-results") if __name__ == '__main__': dict_file = postings_file = query_file = output_file = None try: opts, args = getopt.getopt(sys.argv[1:], 'd:p:q:o:') ex...
# coding=utf-8 """ The CPUCollector collects CPU utilization metric using /proc/stat. #### Dependencies * /proc/stat """ import diamond.collector import os import time try: import psutil psutil # workaround for pyflakes issue #13 except ImportError: psutil = None class CPUCollector(diamond.collect...
# -*- coding: utf-8 -*- import os from datetime import datetime from chatexchange_extension import Client from html.parser import HTMLParser from html import unescape from hashlib import md5 from configparser import NoOptionError, RawConfigParser from helpers import environ_or_none, log import threading # noinspection...
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
import os.path from datetime import datetime from flask import json from flaskext.sqlalchemy import SQLAlchemy import logging log = logging.getLogger(__name__) log.setLevel(logging.INFO) db = SQLAlchemy() class User(db.Model): id = db.Column(db.Integer, primary_key=True) openid_url = db.Column(db.Text()) ...
Do not mix byte str with unicode type
__version__ = '1.1.8' __build__ = '16352a8-2022-05-09' Bumped version to 1.1.9 - No plan to release it, is a WIP version __version__ = '1.1.9' __build__ = '1acbdb8-2022-05-09'
import numpy as np import SimPEG from SimPEG import Utils, Mesh from . import SrcDC as Src # Pole from . import RxDC as Rx from .SurveyDC import Survey, Survey_ky import matplotlib.pyplot as plt import matplotlib class IO(object): """Input and Output for DC""" # TODO: use properties Alocs = None Bl...
# -*- coding: utf-8 -*- # # Copyright (C) 2003-2009 Edgewall Software # Copyright (C) 2003-2006 Jonas Borgström <jonas@edgewall.com> # Copyright (C) 2006 Matthew Good <trac@matt-good.net> # Copyright (C) 2005-2006 Christian Boos <cboos@edgewall.org> # All rights reserved. # # This software is licensed as described in t...
import os from collections import OrderedDict import torch.nn as nn from torchvision.datasets import MNIST import torchvision.transforms as transforms import torch import torch.nn.functional as F from test_tube import HyperOptArgumentParser from torch import optim from torch.utils.data import DataLoader from torch.util...
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
from __future__ import print_function from datetime import datetime import os import random import socket import sys from .log import error, debug def get_valid_seconds(aws_expiration_date, utcnow): try: credentials_valid_until = datetime.strptime(aws_expiration_date, "%Y-%m-%dT%H:%M:%SZ", ) ret...
#! /usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # 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 # ...
# -*- coding: utf-8 -*- __author__ = 'XESS Corporation' __email__ = 'info@xess.com' from .digikey import get_digikey_price_tiers, get_digikey_part_num, get_digikey_qty_avail, get_digikey_part_html_tree Delete __init__.py
#!/usr/bin/env python # Copyright Red Hat, 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 ...
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from corehq.apps.data_interfaces.models import ( AutomaticUpdateRule, MatchPropertyDefinition, CreateScheduleInstanceActionDefinition, ) from corehq.apps.domain.models import Domain from core...
import logging from typing import List, Dict, Text, Optional, Any, Set, TYPE_CHECKING from tqdm import tqdm import numpy as np import json from rasa.shared.constants import DOCS_URL_RULES import rasa.shared.utils.io from rasa.shared.core.events import FormValidation, UserUttered, ActionExecuted from rasa.core.featuri...
from abc import ABCMeta, abstractmethod from gusto.transport_equation import EmbeddedDGAdvection from gusto.advection import SSPRK3, Recoverer from firedrake import Interpolator, conditional, Function, \ min_value, max_value, as_vector, BrokenElement, FunctionSpace from gusto import thermodynamics __all__ = ["Con...
""" Karr Lab build utilities :Author: Jonathan Karr <karr@mssm.edu> :Date: 2016-08-02 :Copyright: 2016, Karr Lab :License: MIT """ from datetime import datetime from jinja2 import Template from pylint import epylint from sphinx.cmd.build import main as sphinx_build from sphinx.apidoc import main as sphinx_apidoc from...
''' Created on Oct 10, 2012 @author: dstrauss ''' from model import fwd import numpy as np from scipy import sparse import sparseTools as spt from scipy import io as spio def speye(n): return sparse.eye(n,n) class solver(fwd): ''' class to implement the transverse electric mode, rather - the case where we h...
# -*- coding: utf-8 -*- ## ## This file is part of CDS Invenio. ## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN. ## ## CDS 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 versio...
# Based on code Created by Laurens van der Maaten on 20-12-08. # see point #4 import numpy import sys try: import psyco psyco.full() print >> sys.stderr, "psyco is usable!" except: print >> sys.stderr, "No psyco" class TSNE(object): def __init__(self, default_iterations = 1000, perple...
"""Routines related to PyPI, indexes""" # The following comment should be removed at some point in the future. # mypy: strict-optional=False import functools import logging import re from typing import TYPE_CHECKING from pip._vendor.packaging import specifiers from pip._vendor.packaging.utils import canonicalize_nam...
# -*- coding: utf8 -*- import json import urllib from django.test import client from mock import Mock, patch from nose.tools import eq_ from pyquery import PyQuery as pq import test_utils import amo from amo.urlresolvers import reverse from search.tests import SphinxTestCase from search import views from search.clie...
""" Django settings for NTHU_Course 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_DIR, ......
from unittest import TestCase from cqlengine.statements import InsertStatement, StatementException, AssignmentClause class InsertStatementTests(TestCase): def test_where_clause_failure(self): """ tests that where clauses cannot be added to Insert statements """ ist = InsertStatement('table', None...
""" Main module to load the data """ # pylint: disable=C0330 storage = {'parquet': 'STORED AS PARQUET', 'com.databricks.spark.csv': ("ROW FORMAT SERDE" "'org.apache.hadoop.hive.serde2.OpenCSVSerde'\n" "STORED AS TEXTFILE")} de...
# -*- coding: utf-8 -*- from scout.commands import cli from scout.server.extensions import store def test_update_institute(mock_app): """Tests the CLI that updates an institute""" runner = mock_app.test_cli_runner() assert runner # Test CLI base, no arguments provided result = runner.invoke(cli...
import sqlite3 import xbmc import xbmcvfs from lib.libs.addonsettings import settings VERSION = 1 # DEPRECATED short 2017-08-26: `medialabel IS NULL` x2 is only for transitioning from VERSION = 0 # maybe the first check in `_get_version` can go later on class ProcessedItems(object): def __init__(self): ...
""" Implements the EN increasing depth check. """ import EN_spike_and_step_check import numpy as np from collections import Counter import util.main as main import sys def test(p, parameters): """ Runs the quality control check on profile p and returns a numpy array of quality control decisions with False...
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Utilities for requesting information for a gerrit server via https. https://gerrit-review.googlesource.com/Documentation/rest-api.html """ impor...
from __future__ import print_function from collections import OrderedDict, MutableMapping from pprint import pprint from sys import version_info from inspect import ismethod # for debugging def here(item=None): out = 'here' if item != None: out += '({})'.format(item) print(out) class DotMap(MutableMapping, Orde...
# Help visualize histograms for hyperspectral images import os import sys import numpy as np import pandas as pd from plantcv.plantcv._debug import _debug from plantcv.plantcv import fatal_error, params, color_palette from plotnine import ggplot, aes, geom_line, scale_color_manual, theme_classic from plantcv.plantcv.v...
__author__ = 'benjamin.c.yan' __version__ = "0.0.5" beautify code __author__ = 'benjamin.c.yan' __version__ = "0.0.5"
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # MIT License ''' A Bookmark attaches a set of Tags and a single Object ('class Filename' in the included example). ''' from sqlalchemy import Table from sqlalchemy import Column from sqlalchemy import ForeignKey from sqlalchemy import UniqueConstraint from sqlalchemy ...
import sys import functools from importlib import import_module from .exception import DoesNotExist, NotConnected OUTGOING, INCOMING, EITHER = 1, -1, 0 # check origin node is saved and not deleted def check_origin(fn): fn_name = fn.func_name if hasattr(fn, 'func_name') else fn.__name__ @functools.wraps(fn)...
# coding=utf-8 """This module, entity_database.py, contains a database api layer for entity objects.""" from quasar_source_code.database_api import postgresql_api as db_api from quasar_source_code.database_api import database_tables as db_t from quasar_source_code.entities import base_entity as be from quasar_source_...
from whoosh.fields import * from whoosh.index import create_in, open_dir from whoosh.qparser import MultifieldParser from whoosh.query import * import abc import copy import csv import json import os.path import sys # Abstract Search Engine class # TODO: abstract out more functionality here class SearchEngine(object)...
import pandas as pd import networkx as nx from na3x.transformation.transformer import transformer from na3x.utils.converter import Converter from na3x.utils.aggregator import Aggregator from logic.constants import DbConstants, ParamConstants from copy import deepcopy from logic.gantt import Task, Link @transformer de...
import webApp import xmlDatabase import actions import sseListener import callUrl import os import argparse import besthostname import time import json import web import subprocess import imp import threading import cProfile import pstats import myLogger from _version import VERSION import sys reload(sys) sys.setdefau...
# Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file ac...
import os from uuid import uuid1 as uuid from sqlalchemy import create_engine from sqlalchemy import Column, String from sqlalchemy.orm import scoped_session, sessionmaker from sqlalchemy.ext.declarative import declarative_base, declared_attr from flask_sqlalchemy import SQLAlchemy from flask import Flask #engine = c...
Simplify MailResponse class by not implementing smtp.IMessage. We aren't using it as an SMTP message delivery class anywhere, so there's no need to have the extra methods. * REMOVE bridgedb.email.server.MailResponse.lineReceived() * REMOVE bridgedb.email.server.MailResponse.eomReceived() * REMOVE bridgedb.email.s...
import logging import re import socket try: import ssl as _ssl _hush_pyflakes = [_ssl] del _hush_pyflakes except ImportError: _ssl = None # No SSL support from kitnirc.events import NUMERIC_EVENTS from kitnirc.user import User _log = logging.getLogger(__name__) class Channel(object): """Informa...
from django.shortcuts import render from django.http import HttpResponse from django.template import RequestContext, loader ''' from django.contrib.auth.models import Champion, Player, Item from rest_framework import viewsets from tutorial.quickstart.serializers import ChampionSerializer, PlayerSerializer, ItemSerializ...
# # Author : Manuel Bernal Llinares # Project : trackhub-creator # Timestamp : 23-08-2017 14:40 # --- # © 2017 Manuel Bernal Llinares <mbdebian@gmail.com> # All rights reserved. # """ This module models the trackhub registry """ import json import requests # App imports import config_manager import ensembl.ser...
import json from figment import Component from figment.utils import indent from theworldfoundry.modes import ActionMode class Meta(Component): """Enables an entity to use meta commands.""" class Admin(Component): """Enables an entity to use admin commands.""" def __init__(self, aliases={}): self...
from datetime import datetime, timedelta from django.test import TestCase from devilry.apps.core.testhelper import TestHelper from devilry.utils.rest_testclient import RestClient from devilry.apps.core.models import Deadline from devilry.apps.core.models import AssignmentGroup from devilry.utils.restformat import form...
#!/usr/bin/perl import re import sys import copy import argparse from BCBio import GFF import logging logging.basicConfig(level=logging.INFO) log = logging.getLogger(name='blastxml2gff3') __author__ = "Eric Rasche" __version__ = "0.4.0" __maintainer__ = "Eric Rasche" __email__ = "esr@tamu.edu" __doc__ = """ BlastXML ...
try: from xml.etree import cElementTree as ET except ImportError as e: from xml.etree import ElementTree as ET roadtypes = {'motorway', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'minor', 'service' } def roadp(element): if element.tag == 'way': ...
# Standard Library import datetime import logging import requests # Django from django.core.management.base import BaseCommand from django.utils import timezone from django.contrib.auth import get_user_model from django.apps import apps from django.conf import settings from apps.bhs.tasks import update_person_from_me...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2012-2013+ James Shubin # Written by James Shubin <james@shubin.ca> # # 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 vers...
# TODO: code review of whole module from collections import defaultdict from datetime import timedelta from django.db.models import Q, Sum from kitabu.search.utils import Timeline from kitabu.exceptions import ReservationValidationError class Subjects(object): """Searcher for subjects available in certain tim...
# # Copyright (c) 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/permanent/...
from datetime import datetime import logging import time import requests __author__ = "Michaël Hompus" __copyright__ = "Copyright 2018, Michaël Hompus" __license__ = "MIT" __email__ = "michael@hompus.nl" class DarkSkyApi: def __init__(self, api_key): self.api_key = api_key def get_tem...
""" Karr Lab build utilities :Author: Jonathan Karr <karr@mssm.edu> :Date: 2016-08-02 :Copyright: 2016, Karr Lab :License: MIT """ from codeclimate_test_reporter.components.runner import Runner as CodeClimateRunner from datetime import datetime from jinja2 import Template from pylint import epylint from sphinx.cmd.bu...
# Copyright (c) 2015 Nicolas JOUANIN # # See the file license.txt for copying permission. import logging import asyncio from transitions import Machine, MachineError from hbmqtt.session import Session from hbmqtt.mqtt.protocol.broker_handler import BrokerProtocolHandler from hbmqtt.mqtt.connect import ConnectPacket fr...
# -*- coding: utf8 -*- import json import urllib import urlparse from django.http import QueryDict from django.test import client from mock import Mock, patch from nose.tools import eq_ from pyquery import PyQuery as pq import amo import amo.tests from amo.urlresolvers import reverse from applications.models import ...
from typing import List from easypost.easypost_object import EasyPostObject from easypost.error import Error def get_lowest_object_rate( easypost_object: EasyPostObject, carriers: List[str] = None, services: List[str] = None, rates_key: str = "rates", ): """Gets the lowest rate of an EasyPost obj...
# -*- coding: utf-8 -*- import pybayes as pb import numpy as np from qsrrep_pf.probability_density_functions import PredictionPdf, ObservationPdf, UniIntPdf from qsrrep_pf.particle_filter_base import ParticleFilter from collections import OrderedDict from copy import deepcopy import time class ParticleFilterPredicto...
#!/usr/bin/env python # Copyright 2017 The LibYuv 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 contri...
# - coding: utf-8 - # Copyright (C) 2008-2010 Toms Bauģis <toms.baugis at gmail.com> # Dual licensed under the MIT or GPL Version 2 licenses. # See http://github.com/tbaugis/hamster_experiments/blob/master/README.textile import math import datetime as dt import gtk, gobject import pango, cairo import re try: im...
"""Framework for a script to be run from a shell""" from __future__ import print_function import argparse import os import sys from dotsite import __version__ from dotsite.debuggers import DebugExit _versions = [__version__] _exit_ok = os.EX_OK _exit_fail = not _exit_ok def latest_version(): return _versions[...
conf_neutron_conf = """[DEFAULT] # Print more verbose output (set logging level to INFO instead of default WARNING level). verbose = True # =========Start Global Config Option for Distributed L3 Router=============== # Setting the "router_distributed" flag to "True" will default to the creation # of distributed tenant...
"""Define a connection to the SimpliSafe websocket.""" import asyncio from dataclasses import InitVar, dataclass, field from datetime import datetime import logging from typing import Awaitable, Callable, Optional from urllib.parse import urlencode from socketio import AsyncClient from socketio.exceptions import Conne...
import sys import getopt import nltk import math import xml.etree.ElementTree as ET import cPickle as pickle from nltk.corpus import wordnet as wn from nltk.tag import pos_tag QUERY_DESCRIPTION_PREFIX = "Relevant documents will describe" ZONE_WEIGHT_SAME = 0.7 ZONE_WEIGHT_CROSS = 0.3 TOP_N_GROUP = 4 INCREMENT_MULTIPLI...
import asyncio from .compat import PY_350, PY_352 if not PY_350: StopAsyncIteration = None # noqa def create_future(*, loop=None): if loop is None: loop = asyncio.get_event_loop() try: return loop.create_future() except AttributeError: return asyncio.Future(loop=loop) cl...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # IkaLog # ====== # Copyright (C) 2015 Takeshi HASEGAWA # # 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/l...
import csv import json import re from io import StringIO import django_filters from django import forms from django.conf import settings from django.forms.fields import JSONField as _JSONField, InvalidJSONInput from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db.models import ...
######### # Copyright (c) 2013 GigaSpaces Technologies Ltd. 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...
from datetime import datetime from peewee import * # Tell peewee what the database file is # We use capital letters for this variable name according to custom, as it indicates # something that will not change DATABASE = "guestbook.db" DATE = datetime.now().strftime("%H:%M - %d/%m/%y") # Tell peewee to create a sqllite...
''' Image ===== The :class:`Image` widget is used to display an image:: wimg = Image(source='mylogo.png') Asynchronous Loading -------------------- To load an image asynchronously (for example from an external webserver), use the :class:`AsyncImage` subclass:: aimg = AsyncImage(source='http://mywebsite.com...