text
stringlengths
12
6.59M
# from flask.ext.sqlalchemy import SQLAlchemy from steerclear import db import sqlalchemy.types as types from datetime import datetime """ Model class for the Ride object """ class Ride(db.Model): id = db.Column(db.Integer, primary_key=True) num_passengers = db.Column(db.Integer) start_latitude = db.Column...
# -*- coding: utf-8 -*- """ stemgraphic.alpha. BRAND NEW in V.0.5.0! Stemgraphic provides a complete set of functions to handle everything related to stem-and-leaf plots. alpha is a module of the stemgraphic package to add support for categorical and text variables. The module also adds functionality to handle whol...
from pupa.scrape import Scraper, Legislator from larvae.person import Person from larvae.organization import Organization from utils import lxmlize import re COUNCIL_PAGE = 'http://www.oakville.ca/townhall/council.html' class OakvillePersonScraper(Scraper): def get_people(self): page = lxmlize(COUNCIL_PAGE) ...
########################################################################## # # Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios), # its affiliates and/or its licensors. # # Copyright (c) 2010-2015, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary ...
from sympy import ( Add, Abs, Chi, Ci, CosineTransform, Dict, Ei, Eq, FallingFactorial, FiniteSet, Float, FourierTransform, Function, IndexedBase, Integral, Interval, InverseCosineTransform, InverseFourierTransform, InverseLaplaceTransform, InverseMellinTransform, InverseSineTransform, Lambda, Lapla...
import operator as op from functools import partial from syn.base_utils import feq #------------------------------------------------------------------------------- # Propositional logic def test_implies(): from syn.base_utils import implies assert implies(True, False) is False assert implies(True, True) i...
from collections import defaultdict import json import os import sys import synapseclient import pandas as pd def _open_entity_as_df(syn, entity: str) -> pd.DataFrame: """ Gets a csv or tsv Synapse entity and returns it as a dataframe :param syn: synapse object :param entity: a synapse entity to be e...
"""Nanopore analysis methods for TACA.""" import os import logging import glob import csv import subprocess import shutil import smtplib from datetime import datetime from taca.utils.config import CONFIG from taca.utils.minion_barcodes import BARCODES from taca.utils.transfer import RsyncAgent, RsyncError from taca.ut...
# -*- coding: utf-8 -*- import re import struct import msgpack import threading import tarantool def unpack_long_long(value): return struct.unpack("<q", value)[0] def unpack_long(value): return struct.unpack("<l", value)[0] class Task(object): """ Tarantool queue task wrapper. .. warning:: ...
import logging import time def _compare(expected_result, param, negate): if type(expected_result) is list: if negate: return param in expected_result else: return param not in expected_result if negate: return expected_result == param else: return e...
from datetime import datetime from feedgenerator import Rss201rev2Feed, Atom1Feed from functools import reduce # forward compatibility for Python 3 import operator import re from time import mktime def feed2XML(parsed_feed): 'takes a parsed feed and generates an xml feed' def feedFactory(version): i...
import readchar import subprocess import argparse import getpass import json import os.path from ttrss import TinyTinyRSS if __name__ == "__main__": conn = {} if os.path.isfile('pyttrss.cfg'): with open('pyttrss.cfg', 'r') as cfgfile: conn = json.load(cfgfile) parser = argparse.Argumen...
# Copyright (C) 2018 Adam Gibson (waxwing) # Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php # Derived from https://gist.github.com/AdamISZ/046d05c156aaeb56cc897f85eecb3eb8 import hashlib...
#!/usr/bin/env python import pwd import errno import argparse import fileinput import logging import os import sqlite3 import subprocess import urllib logging.basicConfig(level=logging.DEBUG) ADMIN_USERNAME = "ben" CHROMIUM_PROFILE_URL = "http://skadi.bluejeansnet.com/rpi-dashboard/chromium-pro...
""" wrapper around unstructured netcdf output with various helper functions. mostly just a place to collect relevant bits of code. """ from __future__ import print_function import six import numpy as np import netCDF4 from . import trigrid from . import unstructured_grid import logging log=logging.getLogger('ugrid') ...
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # 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...
# /usr/local/bin/python3 # --*-- coding: utf-8 --*-- # __Author__ = 'Jieer' poem = '''There was a young lady named Bright, Whose speed was far faster than light; She started one day In a relative way, And returned on the previous night.''' print(len(poem)) fout = open('relativity','wt') fout.write(poem) fout.close(...
from ..abstract_tool import AbstractTool from PyQt5.QtWidgets import QMainWindow from .collimOPALgui import Ui_CollimOPAL import numpy as np import string """" A tool for generating collimator code for OPAL. """ class CollimOPAL(AbstractTool): def __init__(self, parent): super(CollimOPAL, self).__init__...
# -*- coding: utf-8 -*- import copy def issymmetric(tecparams): """ Determines if the set of tecparams is symmetric. """ # Iterate over the keys of both sub-dicts to see if they match. # If they don't, the multiplication will eventually up False. sym = True for key in tecparams["Emitter"].keys(): sym = sym ...
import re import requests import dns.resolver import dns.name from errbot import BotPlugin, botcmd, cmdfilter _MHR_API = 'malware.hash.cymru.com' _VTAPI = 'https://www.virustotal.com/vtapi/v2/' def mhr(ahash): '''Lookup a file in the malware hash registry.''' try: answers = dns.resolver.query('%s.%s' % (ahash, _...
# Copyright (C) 2010,2011,2012 Chris Lalancette <clalance@redhat.com> # Copyright (C) 2012,2013 Chris Lalancette <clalancette@gmail.com> # 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;...
"""The stressmodels module contains all the stressmodels that available in Pastas. Supported Stressmodels ---------------------- The following stressmodels are supported and tested: - StressModel - StressModel2 - FactorModel - StepModel All other stressmodels are for research purposes only and are not (yet) fully su...
import re import logging import numpy as np from os.path import join, dirname, isfile from pycqed.utilities.general import suppress_stdout import matplotlib.pyplot as plt from pycqed.analysis.tools.plotting import set_xlabel, set_ylabel from matplotlib.ticker import MaxNLocator import matplotlib.patches as mpatches fro...
import re from errbot import BotPlugin, botcmd, cmdfilter class HashMatch(BotPlugin): ''' ''' def __init__(self, bot): super().__init__(bot) self.pattern = re.compile('([a-zA-Z0-9]{64}|[a-zA-Z0-9]{40}|[a-zA-Z0-9]{32})') def callback_message(self, msg): '''Check the messages if they contain a hash.''' ...
# -*- coding: utf-8 -*- """TcEx Playbook Test Case module""" import traceback from six import string_types from .test_case_playbook_common import TestCasePlaybookCommon class TestCasePlaybook(TestCasePlaybookCommon): """Playbook TestCase Class""" def run(self, args): # pylint: disable=too-many-return-statem...
# -*- coding: UTF-8 -*- from django import forms from django import http from django.conf import settings from django.conf.urls import url, patterns from django.contrib import admin from django.core import urlresolvers from assopy import admin as aadmin from assopy import models as amodels from conference import admin ...
# coding: utf-8 """ The payu interface for the ACCESS coupled climate model ------------------------------------------------------------------------------- Contact: Marshall Ward <marshall.ward@anu.edu.au> ------------------------------------------------------------------------------- Distributed as part of Payu, Copyr...
# Copyright (c) 2010 Resolver Systems Ltd. # All Rights Reserved # from urlparse import urlparse from functionaltest import FunctionalTest, snapshot_on_error, Url import key_codes class Test_2528_CreateEditSheet(FunctionalTest): user_count = 2 def get_editing_cell(self): colrow = self.selenium.get_...
#!/usr/bin/env python import argparse, tempfile, sys, os, re from replace_imports import include_imports from strip_comments import strip_comments from split_file import split_coq_file_contents from split_definitions import split_statements_to_definitions, join_definitions from admit_abstract import transform_abstract_...
from __future__ import unicode_literals """ Some experiments with pdfminer http://www.unixuser.org/~euske/python/pdfminer/programming.html Some help here: http://denis.papathanasiou.org/2010/08/04/extracting-text-images-from-pdf-files """ # TODO Identify multi-column text, for multicolumn text detect per column # TOD...
# # Copyright 2016 The BigDL Authors. # # 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 ...
import numpy as np import matplotlib.pyplot as plt from astropy import constants as c, units as u, table as t from astropy.io import fits import os from scipy.interpolate import interp1d from scipy.optimize import minimize import spec_tools import ssp_lib import manga_tools as m from itertools import izip, product ...
#!/usr/bin/env python from urllib2 import urlopen, Request from urllib import urlencode import datetime import time import logging import os import platform import uuid import pprint import subprocess DEBUG = True #################################################################### def _runningInVM(): """ Retur...
#!/usr/bin/python # Copyright (c) 2009, Purdue University # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list ...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
# -*- coding: utf-8 -*- import regex import phonenumbers def all_caps_text(s, site): s = regex.sub("<[^>]*>", "", s) # remove HTML tags s = regex.sub("&\w+;", "", s) # remove HTML entities if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN...
import collections import json from pecan_swagger import g as g def swagger_build(title, version): swag = collections.OrderedDict() swag['swagger']='2.0' swag['info']=dict(title=title, version=version) swag['paths']={} for p in g.get_paths(): swag['paths'][p[0]] = {k: {} for k in p[1]} ...
from datetime import datetime from django.db import models from django.contrib import admin from django.contrib.contenttypes.models import ContentType from django.utils.timesince import timesince from django.utils.translation import ugettext_lazy as _ from ella.core.models import Category, Author, Source, Listing fr...
# -*- coding: utf-8 -*- import regex import phonenumbers def all_caps_text(s, site): s = regex.sub("<[^>]*>", "", s) # remove HTML tags s = regex.sub("&\w+;", "", s) # remove HTML entities if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN...
from datetime import datetime from django.db import models from django.contrib import admin from django.contrib.contenttypes.models import ContentType from django.utils.timesince import timesince from django.utils.translation import ugettext_lazy as _ from ella.core.models import Category, Author, Source, Listing fr...
""" Tests for Mixin class that handles IO between the Narrative and workspace service. """ import unittest from biokbase.narrative.contents.narrativeio import ( KBaseWSManagerMixin, PermissionsError ) from biokbase.workspace.baseclient import ServerError import biokbase.auth from tornado.web import HTTPError im...
# -*- coding: utf-8 -*- # noinspection PyCompatibility import sys import math import regex from difflib import SequenceMatcher from urllib.parse import urlparse, unquote_plus from itertools import chain from collections import Counter from datetime import datetime import os import os.path as path # noinspection PyPac...
# -*- coding: utf-8 -*- import os import time import flask_mongorest from rq import get_current_job from rq.job import Job from time import sleep from copy import deepcopy from nbformat import v4 as nbf from flask_rq2 import RQ from flask import Blueprint, request, current_app, abort, jsonify from flask_mongorest impo...
from django import template from django.forms.formsets import all_valid from django.contrib.admin import helpers from django.contrib.admin.util import unquote from django.core.exceptions import PermissionDenied from django.db import transaction from django.http import Http404, HttpResponse, HttpResponseRedirect from dj...
""" This module provides filters. Inputs are fed to filters via keywords in the ``run`` method. Outputs are available via the ``out`` attribute. .. moduleauthor:: Michael Markert <markert.michael@googlemail.com> .. moduleauthor:: Pascal Wittmann <mail@pascal-wittmann.de> :copyright: PenchY Developers 2011-2012, s...
# -*- coding: utf-8 -*- import regex import phonenumbers def all_caps_text(s, site): s = regex.sub("<[^>]*>", "", s) # remove HTML tags s = regex.sub("&\w+;", "", s) # remove HTML entities if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN...
#!/usr/bin/env python # Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), e...
""" python muni_contacts.py 'Municipal contact detail - 28 April 2016.xlsx' 'muni.csv' 'persons.csv' """ import csv import pdb import string import sys import traceback import xlrd from urlparse import urlparse, ParseResult expected_headings = [ 'Cat \nCode', 'Locat\nCode', 'Location \nDescription', 'C...
"""Basic listener commands.""" import logging from typing import TYPE_CHECKING, Any, Dict, List, Union from django.conf import settings from django.db import transaction from django.db.models import Sum from django.db.models.functions import Coalesce from django.urls import reverse from django.utils.timezone import no...
from typing import NamedTuple, Dict, List, Iterator from pathlib import Path import fnmatch import json import urllib.parse ModuleName = str DESCRIPTION_FILENAME = 'elm-package.json' STUFF_DIRECTORY = 'elm-stuff' EXACT_DEPS_FILENAME = 'exact-dependencies.json' PACKAGES_DIRECTORY = 'packages' ElmPackageBase = NamedT...
#!/usr/bin/python # -*- coding: utf-8 -*- from apps.webdriver_testing.webdriver_base import WebdriverTestCase from apps.webdriver_testing.pages.site_pages import watch_page from apps.webdriver_testing.pages.site_pages import video_page from apps.webdriver_testing.pages.site_pages import search_results_page from apps.we...
# -*- coding: utf-8 -*- import re import phonenumbers class FindSpam: bad_keywords = ["baba(ji)?", "fifa.*coins?", "fifabay", "Long Path Tool", "brianfo", "nike", "tosterone", "bajotz", "vashi?k[ae]r[ae]n", "sumer", "kolcak" "porn", "molvi", "judi bola"...
import configparser import datetime import errno import json import logging import math import os.path import perf import shlex import shutil import statistics import subprocess import sys import time from urllib.error import HTTPError from urllib.parse import urlencode from urllib.request import urlopen from performa...
# -*- coding: utf-8 -*- # noinspection PyCompatibility import math import regex from difflib import SequenceMatcher from urllib.parse import urlparse from itertools import chain from collections import Counter from datetime import datetime import os.path as path # noinspection PyPackageRequirements import tld # noins...
import csv import json import os import re from configparser import ConfigParser, NoOptionError, NoSectionError from itertools import chain, combinations, permutations from typing import Dict, Iterable, Iterator, List, Tuple from decorator import decorator from logger import logger from perfrunner.helpers.misc import...
from z3 import * import re from mythril.analysis.ops import * from mythril.analysis.report import Issue ''' MODULE DESCRIPTION: Check for invocations of delegatecall(msg.data) in the fallback function. ''' def execute(statespace): issues = [] for call in statespace.calls: if (call.type == "DELEGA...
# -*- coding: utf-8 -*- import regex import phonenumbers def all_caps_text(s, site): s = regex.sub("<[^>]*>", "", s) # remove HTML tags s = regex.sub("&\w+;", "", s) # remove HTML entities if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN...
#!/usr/bin/env python3 # -*-coding:UTF-8 -* """ The Mails Module ====================== This module is consuming the Redis-list created by the Categ module. It apply mail regexes on item content and warn if above a threshold. """ import os import re import sys import redis import time import datetime import dns.r...
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, print_function import glob import os import pkgutil import subprocess import sys from collections import OrderedDict from colors import bold, gree...
# -*- coding: utf-8 -*- # noinspection PyCompatibility import regex from difflib import SequenceMatcher from urllib.parse import urlparse from itertools import chain from collections import Counter from datetime import datetime # noinspection PyPackageRequirements import tld # noinspection PyPackageRequirements from ...
#!/usr/bin/env python # Copyright 2014 Mirantis, 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 require...
#!/usr/bin/env python '''Provides high level wrappers around a Nexson data model blob to let it be treated as if it were a list of OTUs and a list of trees Accessors return either references to part of the NexSON or wrappers around those entities (not copies!) Weakrefs are used, so the more inclusive containers must ...
class Solution(object): def fourSum(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[List[int]] """ if len(nums) < 4: return [] nums.sort() sums = [] for l1 in range(len(nums)-3): if l1 > 0...
# -*- coding: utf-8 -*- import regex import phonenumbers def all_caps_text(s, site): s = regex.sub("<[^>]*>", "", s) # remove HTML tags s = regex.sub("&\w+;", "", s) # remove HTML entities if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Megan Wilhite <mwilhite@saltstack.com>` ''' # Import Python Libs from __future__ import absolute_import import os import random import string # Import Salt Libs from salt.config import cloud_providers_config # Import Salt Testing LIbs import tests.integration as i...
#============================================================================== # Major TODO #============================================================================== # Replace move command with _input2coordinate #============================================================================== # Minor TODO #======...
# -*- coding: utf-8 -*- import regex import phonenumbers def all_caps_text(s, site): s = regex.sub("<[^>]*>", "", s) # remove HTML tags s = regex.sub("&\w+;", "", s) # remove HTML entities if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN...
# Copyright (C) 2015 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # 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 # notic...
# -*- coding: utf-8 -*- import regex import phonenumbers def all_caps_text(s, site): s = regex.sub("<[^>]*>", "", s) # remove HTML tags s = regex.sub("&\w+;", "", s) # remove HTML entities if len(s) <= 150 and regex.compile(ur"SQL|\b(ERROR|PHP|QUERY|ANDROID|CASE|SELECT|HAVING|COUNT|GROUP|ORDER BY|IN...
from .oauth import check_authentication from . import util, data from os import environ from urllib.parse import urljoin from operator import itemgetter, attrgetter from uuid import uuid4 from time import time from jinja2 import Environment, PackageLoader from flask import ( Blueprint, url_for, session, render_te...
# BCOnvert.py v0.1 by Yoshi2 import time import argparse import os import subprocess from re import match from struct import pack, unpack from math import floor, ceil import math def read_vertex(v_data): split = v_data.split("/") #if len(split) == 3: # vnormal = int(split[2]) #else: # vnorm...
# -*- coding: utf-8 -*- """Mock datasets.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import numpy as np import numpy.random as nr from ..ext import six from ..io.experiment import BaseEx...
import bt_server import bt_server_cmds import bt_task_handler import protocol PI_ADDR = "B8:27:EB:FC:55:27" PORT = 3 BACKLOG = 1 EOF = -1 RESTART = 14 SHUTDOWN = 15 GOT_DATA = 1 NO_DATA = 0 def setup_server(): server = bt_server.BT_Server(PI_ADDR, PORT, BACKLOG) print("before accept_connection") server.a...
""" gui/average ~~~~~~~~~~~~~~~~~~~~ Graphical user interface for averaging particles :author: Joerg Schnitzbauer, 2015 :copyright: Copyright (c) 2016 Jungmann Lab, Max Planck Institute of Biochemistry """ import functools import multiprocessing import os.path import sys import time import traceba...
import os import sys from appdirs import user_cache_dir # HACK: avoid resolver.py uses the wrong byte code files. # I hope I can remove this one day. os.environ["PYTHONDONTWRITEBYTECODE"] = "1" # HACK: Prevent invalid shebangs with Homebrew-installed Python: # https://bugs.python.org/issue22490 os.environ.pop("__PYV...
import cv2 import os import numpy as np from PIL import Image def rawRead(path): """ Leer Raw y Normalizar a 16b de profundidad """ datosRaw = open(path, 'rb').read() imagenRaw = Image.fromstring('F', (1280, 960), datosRaw, 'raw', 'F;16') imagenRaw = np.asanyarray(imagenRaw, dtype='uint16') ...
"""Rewrite assertion AST to produce nice error messages""" import ast import collections import itertools import py def rewrite_asserts(mod): """Rewrite the assert statements in mod.""" AssertionRewriter().run(mod) _saferepr = py.io.saferepr _format_explanation = py.code._format_explanation def _format_b...
import numpy as np import theano from theano import tensor #from blocks import initialization from blocks.bricks import Identity, Linear, Tanh, MLP, Softmax from blocks.bricks.lookup import LookupTable from blocks.bricks.recurrent import SimpleRecurrent, Bidirectional, BaseRecurrent from blocks.bricks.parallel import...
import numpy as np import theano from theano import tensor #from blocks import initialization from blocks.bricks import Identity, Linear, Tanh, MLP, Softmax from blocks.bricks.lookup import LookupTable from blocks.bricks.recurrent import SimpleRecurrent, Bidirectional, BaseRecurrent #from blocks.bricks.parallel impor...
""" Peewee integration with pysqlcipher. Project page: https://github.com/leapcode/pysqlcipher/ **WARNING!!! EXPERIMENTAL!!!** * Although this extention's code is short, it has not been propery peer-reviewed yet and may have introduced vulnerabilities. * The code contains minimum values for `passphrase` length and...
## Copyright (C) 2014 Red Hat, Inc. # 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.1 of the License, or any later version. # # This library is distributed in the hope ...
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from __future__ import unicode_literals import swapper from django.db import models from django.utils.encoding import python_2_unicode_compatible from sorl.thumbnail import ImageField from accelerator_abstract.models.accelerator_model import AcceleratorModel @...
# Copyright 2011, VMware, 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...
import requests def user_guide(): r = requests.get("https://karry.terminallycapricio.us/userguide/duplicateguide.html") r.encoding = r.apparent_encoding return r.text, r.status_code def bbcode_guide(): r = requests.get("https://karry.terminallycapricio.us/userguide/bbcodeguide.html") r.encoding ...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
#!/usr/bin/python import asyncio import json import os import re import signal import sys import time from concurrent.futures import ThreadPoolExecutor from datetime import datetime from redis import StrictRedis from sqlalchemy import and_, func from sqlalchemy.orm.exc import NoResultFound from tornado.gen import co...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- """ Newspaper uses much of python-goose's extraction code. View their license: https://github.com/codelucas/newspaper/blob/master/GOOSE-LICENSE.txt Keep all html page extraction code within this file. Abstract any lxml or soup parsing code in the parsers.py file! """ __title__ = 'newspaper' __a...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#! /usr/bin/env python # -*- coding: utf-8 -*- # Newspipe - A web news aggregator. # Copyright (C) 2010-2020 Cédric Bonhomme - https://www.cedricbonhomme.org # # For more information: https://sr.ht/~cedric/newspipe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
import numpy as np import pyther as pt class Flash_TP(object): """ Flash_TP is a Class for to calculate the flash with a temperature T and pressure P for a specified composition zi. In this case, the algorithm used, is a combination between the ideal flash with Ki(T,P) without dependence of the co...
from twisted.internet import defer from twisted.web.xmlrpc import Proxy from elementtree import ElementTree import os, md5 class FlickRPC: def __init__(self, api_key, secret, perms="read"): self.proxy = Proxy("http://api.flickr.com/services/xmlrpc/") self.api_key = api_key self.secret =...
# coding: utf-8 import Queue import threading import socket import os import select import json import collections import os.path import hashlib import traceback from datetime import datetime import sublime import sublime_plugin import dmp_monkey dmp_monkey.monkey_patch() from lib import diff_match_patch as dmp __VER...
#!/usr/bin/python3 from __future__ import print_function import os import subprocess import itertools import atexit import time import argparse DEFAULT = '\x1b[0m' BOLD = '\x1b[1m' REVERSE = '\x1b[7m' CLEAR = "\x1b[1;1H\x1b[2J" parser = argparse.ArgumentParser() parser.add_argument('-p', '--pid', type=int, default=...
from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from pkg_resources import declare_namespace declare_namespace('encviewfuse')
import copy from typing import Text import pytest import rasa.shared.nlu.training_data.loading from rasa.engine.graph import ExecutionContext from rasa.engine.storage.resource import Resource from rasa.engine.storage.storage import ModelStorage from rasa.nlu import registry from rasa.nlu.classifiers.sklearn_intent_cl...
"""Test for singly linked list from link_list.py.""" def test_node_init_data(): """Test that Node constructor works.""" from linked_list import Node temp = Node(2) assert temp.data == 2 def test_node_init_next_none(): """Test that Node constructor works with empty next.""" from linked_list i...
import asyncio import logging from datetime import datetime import pytest from lightbus.config import Config from lightbus.message import EventMessage from lightbus.serializers import ( ByFieldMessageSerializer, ByFieldMessageDeserializer, BlobMessageSerializer, BlobMessageDeserializer, ) from lightbu...
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END """ Test GCP Gateway plugin Prerequisite: This test expects gcp certificates in $FOGLAMP_ROOT/tests/system/python/packages/data/gcp directory. Also export the GOOGLE_APPLICATION_CREDENTIALS variable to the JSON ...