src
stringlengths
721
1.04M
""" Django settings for cleff project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ...
import json import pytz from threading import Thread from django.core.urlresolvers import reverse from django.conf import settings from django.http import HttpResponseRedirect from threading import Thread from django.conf import settings from django.http import HttpResponse from django.utils import timezone, transl...
import os, sys; sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) import pytest from lasio import read from lasio.excel import ExcelConverter from lasio.reader import StringIO test_dir = os.path.dirname(__file__) egfn = lambda fn: os.path.join(os.path.dirname(__file__), "examples", fn) def test_writ...
from django.http import * from django import template from django.template.defaultfilters import stringfilter from django.template import RequestContext from mongoengine import * from profile.models import Profile from posts.models import Post, ImagePost, TextPost, LinkPost from profile.views import * import tweepy ...
# # # Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Google 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: # # 1. Redistributions of source code must retain the above copyright no...
import unittest import ddt from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponse from django.test import TestCase from django.test.client import RequestFactory from django.test.utils import override_settings from mock import Mock, patch from edxmako import ...
# -*- coding: utf-8 -*- """ Created on Fri Oct 31 11:07:20 2014 @author: junz """ import numpy as np import matplotlib.pyplot as plt from matplotlib import cm import matplotlib.colors as col import scipy.ndimage as ni import ImageAnalysis as ia try: import skimage.external.tifffile as tf except ImportError: i...
import argparse from typing import Any import sqlalchemy as sa from drillsrs import db, util from drillsrs.cmd.command_base import CommandBase def _print_single_tag(session: Any, index: int, tag: db.Tag) -> None: tag_usages = ( session.query(sa.func.count(db.CardTag.tag_id)) .filter(db.CardTag.t...
#! /usr/bin/python3 ## Hackish example script to compare some results output by process-discogs-chunks.py ## ## Licensed under the terms of the General Public License version 3 ## ## SPDX-License-Identifier: GPL-3.0 ## ## Copyright 2017-2019 - Armijn Hemel import os import sys import argparse def main(): parser ...
#!/usr/bin/python import argparse from rdflib import URIRef from rdflib.collection import Collection from rdflib.graph import QuotedGraph from sys import stdin import logging logging.getLogger().setLevel(logging.INFO) parser = argparse.ArgumentParser(description='SemPipe Planner: Construct commands to build resource...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
# !/usr/bin/env python # Copyright 2014 Vodkasoft # # 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 agre...
import os import sys import itertools import operator import nltk import numpy as np import matplotlib.pyplot as plt from nltk.util import ngrams from collections import Counter from spell_checker import SpellChecker from sklearn.decomposition import TruncatedSVD from sklearn.pipeline import make_pipeline from skle...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import itertools import os import os.path import sys import argparse import logging def cartesian_product(dicts): return (dict(zip(dicts, x)) for x in itertools.product(*dicts.values())) def summary(configuration): kvs = sorted([(k, v) for k, v in configurati...
# Copyright (C) 2009 Robert Collins <robertc@robertcollins.net> # Licenced under the txaws licence available at /LICENSE in the txaws source. """A GTK client for working with aws.""" from __future__ import absolute_import import gnomekeyring import gobject import gtk # DO NOT IMPORT twisted.internet, or things that ...
#!/usr/bin/python # Copyright 2014 Openstack Foundation # 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 ...
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
# -*- coding: utf-8 -*- # Generated by Django 1.11.5 on 2017-10-17 18:44 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import mezzanine.core.fields class Migration(migrations.Migration): initial = True dependencies = [ ('people', '...
""" Module to check whether TypeIIs end-sites are compatible. Looks for 3bp homology then 2 basepair edge-homology for each input sequence given. Comparisons are made between each element in the list and to the reverse complement of each element. Repeat elements are also validated along with noncanonical basepairs. Ex...
from subprocess import check_call, check_output from blackbelt.handle_github import get_current_branch, run_grunt_in_parallel from blackbelt.messages import post_message def deploy_staging(): branch_name = get_current_branch() post_message("Deploying branch %s to staging" % branch_name, "#deploy-queue") ...
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
#!/usr/bin/python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # import os import errno import re import shutil import subprocess import sys, getopt import platform from time import sleep _RETRIES = 5 _OPT_VERBOSE = None _OPT_DRY_RUN = None _PACKAGE_CACHE='/tmp/cache/' + os.environ['USER'] + '/we...
# # AtHomePowerlineServer - networked server for X10 and WiFi devices # Copyright © 2014, 2020 Dave Hocker (email: AtHomeX10@gmail.com) # # 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, v...
#!/usr/bin/env python # Copyright 2015-2016 Yelp Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth.decorators import login_required from django.core.exceptions import PermissionDenied from django.core.files.base import ContentFile from django.core.paginator import Paginator from django.http import Http404 from django.http.response impo...
#coding=utf-8 import itertools import sys import time def read_distance_matrix(file_name): '''file_name: the name of a file that stores a matrix. Each line is a row and columns are separated by whitespace. Returns a dictionary with the following format {Vertex:{neighbour: distance, neighbour: distance...
""" This module generates a database of all MC and data datasets """ from rootpy.io import root_open, DoesNotExist #from multiprocessing import Pool, cpu_count import sys from operator import itemgetter import logging import re import glob import os import cPickle as pickle import atexit import fnmatch from collectio...
#!/usr/bin/python import sys, os import traceback import requests import hashlib import tweepy import praw, oauthPS2Bot from lxml import etree from datetime import datetime,timedelta def sizeof_fmt(num, suffix='B'): for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']: if abs(num) < 1024.0: ret...
class Twython(): def __init__(self, consumer_key, consumer_secret, oauth_token, oauth_secret): pass def update_status(self, status, media=None): pass def update_status_with_media(self, status, media): pass def get_mentions_timeline(self): return [] class TwythonError(Ex...
#!/usr/bin/env python """ Python script for building documentation. To build the docs you must have all optional dependencies for pandas installed. See the installation instructions for a list of these. Usage ----- $ python make.py clean $ python make.py html $ python make.py latex """ import importlib im...
#!/usr/bin/env python # encoding: utf-8 import datetime import decimal import httpretty import json import unittest # Set the endpoint to http because some library combination # leads to a SSLError when running the test with httpretty. api_endpoint = "http://automatic.fastbill.com/api/1.0/api.php" api_email = "fastb...
"""meme430_test.py - integration tests for meme module This file is part of cMonkey Python. Please see README and LICENSE for more information and licensing details. """ import cmonkey.meme as meme import cmonkey.motif as motif import unittest import cmonkey.util as util import cmonkey.organism as org import cmonkey.d...
#!/usr/bin/env python2 # -*- coding: UTF-8 -*- # --------------------------------------------------------------------------- # ___ __ __ __ ___ # / | \ | \ | \ / Automatic # \__ |__/ |__/ |___| \__ Annotation # \ | | | | ...
import numpy as np import os from six.moves import cPickle class TextLoader(): def __init__(self, data_dir='nietzsche', batch_size=128, seq_length=8): self.data_dir = "data/" + data_dir self.batch_size = batch_size self.seq_length = seq_length self.input_file = os.path.join(self.da...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# Copyright 2020 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- coding: utf-8 -*- """ Created on Wed Aug 30 22:00:31 2017 @author: xjw1001001 """ import numpy as np from IGCexpansion.CodonGeneconFunc import * llpath = '/Users/xjw1001001/Documents/GitHub/IGCexpansion2/test/Ancestral_reconstruction/' path = llpath + 'matrix/sitewise_IGC_statmatrix/' paralog_list = [['YLR406C...
import pyglet from caladbolg.graphics import graphics_context class ScriptedBattle: def __init__(self, background_image, monsters, party): self.background_image = background_image self.monsters = monsters self.party = party def start_battle(self): image = pyglet.image...
#!/usr/bin/env python # # This file is part of pacman-mirrors. # # pacman-mirrors 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. # # p...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function """ design_cleanup """ import glob import os import pathlib import structlog import sarge log = structlog.get_logger() def match_file_pattern(pattern): #cmd = sarge.shell_format('ls {0}', pattern) #files = sarge.get_stdout(...
# -*- coding: utf-8 -*- # Copyright (C) 2010-2012, eskerda <eskerda@gmail.com> # Distributed under the AGPL license, see LICENSE.txt import re import unittest import sys import pybikes try: import keys except ImportError: print("Keys for testing not found, going to use invalid keys") class DumbObject(obje...
# util.py # Copyright (C) 2005, 2006, 2007, 2008 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php import inspect, itertools, new, sets, sys, warnings, weakref import __builtin__ types = __import__('t...
import json from http_api_no_auth.api import api, root from http_api_no_auth.api.decorators import gateway_belong_to_user from userver.object.gateway import Gateway, Location from utils.errors import KeyDuplicateError, PatchError from .forms.form_gateway import AddGatewayForm, PatchGateway from ..http_auth import auth...
#!/usr/bin/env python """Display a cartoon of the focal plane showing: * Instrument nominal center and x and y axes * Boresight position * Object orientation * Spider orientation To do: - modify to use preferences for colors (need 3 colors for 3 axes, also colors for current, target and ?potential? position). - impl...
""" Inlinable list function that may be inlined. """ from pythran.passmanager import ModuleAnalysis from pythran.analyses import Identifiers from pythran.analyses.pure_expressions import PureExpressions import pythran.metadata as metadata import gast as ast import copy class Inlinable(ModuleAnalysis): """ Dete...
# This file consists of the functions that generate random values or # create objects in db for testing import sys sys.path.append('../..') # Libraries # Standard library from random import choice, randint, shuffle from string import ascii_lowercase, ascii_uppercase, digits # Local from lemur import models as m from l...
#!/usr/bin/env python # Copyright 2018 The Kubernetes 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 appli...
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2014 Michael Cook <mcook@mackal.net> # # GPLv3 """ Processes an eqlog file and generates SQL to update factions Should work with a full log, but cleaning up the log will be quicker The file needs at least the zone enter messages, faction ...
from remotefile import S3File, RemoteFile from expects import * from tempfile import TemporaryDirectory, NamedTemporaryFile from unittest.mock import patch, MagicMock import os, re from boto.s3.bucket import Bucket from boto.s3.key import Key with description(S3File): with before.each: self.sample_url = '...
import random from constants import PRICE_TABLE from enums import client class Establishment: """ Class for an establishment in the chain. Attributes: name: (str) name of the establishment stars: (int) establishment category is_rewards: (bool) establishment client participates in...
# -*- coding: utf-8 -*- import numpy as np import pickle import json import copy from .inputparser import InputParser from .knn import KNN from ..converter import Converter from ..pitchdistribution import PitchDistribution class KNNClassifier(InputParser): def __init__(self, step_size=7.5, kernel_width=15.0, fea...
# MIT License # # Copyright (c) 2020-2021 CNRS # # 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, pu...
# -*- coding: utf-8 -*- import tools from osv import fields, osv class reconcile_item(osv.osv_memory): _name = "fg_account.reconcile.item" _columns = { 'ref_doc':fields.reference('单据', selection=[('fg_sale.order','销售订单'),('fg_account.bill','收款单')], size=128, readonl...
""" This file reads the etltest-settings.yml file and loads application settings. Having a settings file in the users home directory overrides the one in the application directory. """ __author__ = 'coty' import logging import pprint import os import yaml from .settings_manager import SettingsManager # ...
""" Client library for using NASAs CMR API for searching and downloading from NASA data holdings """ import os import requests import datetime from dateutil.parser import parse as dateparser from json import dump import logging from requests.packages.urllib3.util.retry import Retry from requests.adapters import HTTPAd...
import pathlib from sympy import Rational as frac from ...helpers import article from .._helpers import T2Scheme, _read, register source = article( authors=["D.A. Dunavant"], title="High Degree Efficient Symmetrical Gaussian Quadrature Rules for the Triangle", journal="Article in International Journal fo...
from django.shortcuts import render, get_object_or_404 from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.views.generic import View from django.urls import reverse from django.contrib import messages from suite.models imp...
# DIALS version numbers are constructed from # 1. a common prefix __dials_version_format = "DIALS %s" # 2. the most recent annotated git tag (or failing that: a default string) __dials_version_default = "3.5" # 3. a dash followed by the number of commits since that tag # 4. a dash followed by a lowercase 'g' and th...
# # Copyright (C) 2013-2019 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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...
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*- # This file is part of Guadalinex # # This software 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, ...
#!/usr/bin/env python3 """ Make your hackerspace a XMPP buddy. """ from configparser import ConfigParser from optparse import OptionParser import logging import requests import sleekxmpp import sys import time import urllib.request import json class HackerspaceApiBot(sleekxmpp.ClientXMPP): """ A SleekXMPP bas...
# coding: utf-8 # pylint: disable=C0103,W0232,C0301,W0703 # Copyright 2015 by Leipzig University Library, http://ub.uni-leipzig.de # The Finc Authors, http://finc.info # Martin Czygan, <martin.czygan@uni-leipzig.de> # # This file is part of some open source application. # # Some ope...
from types import IntType from palm.util import multichoose from palm.state_collection import StateCollectionFactory class SingleDarkState(object): """ A macrostate for a BlinkModel with one dark microstate. The available microstates are `I`, `A`, `D`, and `B`. Attributes ---------- initial_st...
"""Streamlit display.""" import os import json from logging import INFO, basicConfig, getLogger import pandas as pd import i18n from sys import stdout from ..constants import ( CHANGE_DATE, DOCS_URL, EPSILON, FLOAT_INPUT_MIN, FLOAT_INPUT_STEP, VERSION, ) from ..model.parameters import Paramet...
import os import pytest from flask import Flask from flask_sqlalchemy import SQLAlchemy INSTANCE_ROOT = '' app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://lagring:lagring@localhost:5432/lagring_test' app.config['ASSET_STORAGE_ROOT'] = os.path.join(os.getcwd(), 'test/var/assets') app.conf...
from __future__ import absolute_import, division, print_function from sqlalchemy import MetaData, Table, Column, types, create_engine, select from sqlalchemy.sql import and_ from sqlalchemy.dialects import mysql from ..model import Goal, Test class LargePickleType(types.PickleType): def load_dialect_impl(self,...
# encoding: utf-8 from __future__ import unicode_literals try: import urllib.request as urllib_request import urllib.error as urllib_error except ImportError: import urllib2 as urllib_request import urllib2 as urllib_error try: from cStringIO import StringIO except ImportError: from io import ...
### # Copyright (c) 2011, Rodrigo Dias Cruz # 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 of condit...
#!/usr/bin/env python #coding: utf-8 def header(string): """ Display header """ timeInfo = time.strftime("%Y-%m-%d %H:%M") print '\n', timeInfo, "****", string, "****" def info(string): """ Display basic information """ timeInfo = time.strftime("%Y-%m-%d %H:%M") print ...
from splinter import Browser from selenium import webdriver from pyvirtualdisplay import Display import pyvirtualdisplay import pyqrcode import argparse import os import time import urllib import sys # allow for graceful exit try: # file to send file_to_send = '' # file receive code file_receive...
from django.db import models # the following will be required if we want to support south # ---------------------------------------------------------------- # from south.modelsinspector import add_introspection_rules # # add_introspection_rules([], [ # "^wham\.models\.WhamCharField", # "^wham\.models\.WhamText...
from django.shortcuts import render from django.http import HttpResponse from .models import Truck LAT_LONG_FUZZ = 0.005797101448 # approx .4 miles FEET_PER_DEGREE = 364099.0681813498 # Create your views here. def index(request): return render(request, 'hello.html') def trucks(request): trucks = Truck.obje...
# Copyright (c) 2014, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. import stix from stix.common import VocabString, StructuredText import stix.bindings.incident as incident_binding from stix.common.vocabs import LossProperty, LossDuration from stix.common.vocabs import Availabilit...
from __future__ import print_function import msgpack import sys import os from collections import defaultdict from helpers import text_dict_to_term_dict from WikiExtractor import clean, compact import pandas as pd def remove_wikipedia_markup(text): return compact(clean(text.decode('utf8'))) def print_help_and_exi...
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # Author: Kiall Mac Innes <kiall@hp.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/L...
#!/usr/bin/env python # # Copyright (c) 2016 Alexander Lokhman <alex.lokhman@gmail.com> # # 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...
#!/usr/bin/env python import urllib import json import os import os.path import sys from flask import Flask from flask import render_template from flask import request, url_for, make_response import logging import apiai # Flask app should start in global layout app = Flask(__name__, static_url_path='/static') @app....
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# Copyright (C) 2010 Google 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 # notice, this list of conditions and the ...
#!/usr/bin/env python # # Copyright 2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
# Copyright 2013, 2014 Rackspace # 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 ...
# -*- coding: utf-8 -*- """ Setuptools script for the xbee-helper project. """ import os from textwrap import fill, dedent try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages def requir...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
# Copyright 2015 Google 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 law or a...
'''u413 - an open-source BBS/transmit/PI-themed forum Copyright (C) 2012 PiMaster Copyright (C) 2012 EnKrypt This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the Licens...
#!/usr/bin/env python3 # coding=utf-8 from __future__ import print_function import sys import configparser import uuid obj_types = ["actor", "room", "exit", "thing", "scenery", "vehicle", "text", "action", "spell", "topic"] lock_types = ["?", "!", "+", "-", "@", "^", "#", "~"] def new_meta(): return { "title": ...
import logging from xl import event, settings import exaile_parser from server import DaapServer import daapserverprefs logger = logging.getLogger(__file__) # todo support multiple connections? class CollectionWrapper: '''Class to wrap Exaile's collection to make it spydaap compatible''' class TrackWrapper:...
from __future__ import division, print_function import json from collections import Iterable, OrderedDict, namedtuple import numpy as np from six import string_types def isnamedtuple(obj): """Heuristic check if an object is a namedtuple.""" return isinstance(obj, tuple) \ and hasattr(obj, "_field...
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* import time def now(short = True): '''return current date in short or long form (HH:MM:SS or DD.MM.AAAA-HH:MM:SS)''' if short == True: return time.strftime('%H:%M:%S') else: return time.strftime('%d.%m.%Y-%H:%M:%S') def columnLimit(value, limit, begin = True, sep =...
from __future__ import division import numpy as np import pandas as pd from zipline.utils.calendars import get_calendar from zipline.data.bundles import ingest, load, bundles from zipline.testing import test_resource_path from zipline.testing.fixtures import ZiplineTestCase from zipline.testing.predicates import asse...
import json import logging import traceback from discord.colour import Color from sqlalchemy import Column, Boolean, Integer, String, ForeignKey, create_engine, DateTime, Float from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relationship, sessionmaker, scoped_session from libs.db.base...
from circuits import Event class ReceiveInput(Event): """ Some input arrived (fieldcode or other input) """ class StartGame(Event): """ Start a new game. """ class GameInitialized(Event): """ A new game was started. """ class DartStuck(Event): """ A dart is stuck. May be fired many times in a row. "...
## # Copyright 2015-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
from ._config import PluginConfiguration from ._parser import EndpointParser from treq.client import HTTPClient from twisted.internet import reactor, defer from twisted.internet.interfaces import IHalfCloseableProtocol from twisted.python import log from twisted.python.failure import Failure from twisted.web import ser...
# import the necessary packages import numpy as np import math import csv class Searcher: def __init__(self, indexPath): # store our index path self.indexPath = indexPath def search_info(self, results, infoCar): # Get best ID image best_id = [] for (score,image) in results: best_id.append(int(image[:...
from unittest import TestCase, main from collections import Counter from kasiski_examination import * from utilities import removeTextNonLetters, removeBinaryNonLetters class TestKasiskiFactors(TestCase): def setUp(self): self.message = removeTextNonLetters("Ppqca xqvekg ybnkmazu ybngbal jon i tszm jyim. Vrag v...
from projectname.tests import * class TestSampleController(TestController): def test_root_index(self): response = self.app.get('/') assert 'Welcome' in response # Test response... def test_index(self): response = self.app.get(url(controller='sample')) assert 'basic ...
""" Copyright 2007, 2008, 2009 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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 option...
"""Tools to align a reconstruction to GPS and GCP data.""" import logging import math import numpy as np from opensfm import multiview from opensfm import transformations as tf logger = logging.getLogger(__name__) def align_reconstruction(reconstruction, gcp, config): """Align a reconstruction with GPS and GCP...
#!/usr/bin/env python """ Thorium Utils Flags =================== Nuke Knob Flags which can be difficult to access due to Nuke not storing readily available variables for them, forcing the use the integer values as seen below. Any of these flags can now be used with: :: from thorium.utils import flags And then ...