src
stringlengths
721
1.04M
# Copyright 2015-2019 Facundo Batista, Nicolás Demarchi # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License version 3, as published # by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but # WIT...
from __future__ import unicode_literals import re import six from moto.core.utils import str_to_rfc_1123_datetime from six.moves.urllib.parse import parse_qs, urlparse import xmltodict from moto.core.responses import _TemplateEnvironmentMixin from moto.s3bucket_path.utils import bucket_name_from_url as bucketpath_...
import pytest from mock import Mock, patch from mcstatus.protocol.connection import ( Connection, TCPSocketConnection, UDPSocketConnection, ) class TestConnection: connection: Connection def setup_method(self): self.connection = Connection() def test_flush(self): self.conne...
try: # Python compat < 3.3 from collections.abc import Set, MutableSet, Hashable, Iterable except ImportError: from collections import Set, MutableSet, Hashable, Iterable from collections import defaultdict from functools import reduce from itertools import chain import operator try: # Python compat < 3.4 f...
from unittest import TestCase import json import time from werkzeug.wrappers import BaseResponse from werkzeug.test import Client from app import ApiApp from rest_api_framework.authentication import ApiKeyAuthentication from rest_api_framework.datastore import PythonListDataStore from rest_api_framework import models...
import pytest # noqa from parglare import GLRParser, Grammar, Parser, SHIFT, REDUCE from parglare.exceptions import SRConflicts grammar = r""" E: E op_sum E {dynamic} | E op_mul E {dynamic} | number; terminals number: /\d+/; op_sum: '+' {dynamic}; op_mul: '*' {dynamic}; """ instr1 = '1 + 2 * 5 + 3' instr2 = '1 * ...
from core import Adapter, AdaptationError, Pass from lib import int_to_bin, bin_to_int, swap_bytes, StringIO from lib import FlagsContainer, HexString #=============================================================================== # exceptions #========================================================================...
import numpy as np import cv2, time, sys, threading, json from constants import * from abstract_thread import * from stereo import Stereo as stereo class ProcessThread(AbstractThread): def __init__(self, cap_thread_R, cap_thread_L, mediator): super(ProcessThread, self).__init__() self.cap_thread...
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import django from django.db import models from django.utils.translation import get_language from .queryset import PageQuerySet class PageManager(models.Manager): def get_select_related_queryset(self): """ Get the ...
# -*- coding: utf-8 -*- # # Docker build configuration file, created by # sphinx-quickstart on Thu Jul 23 09:30:31 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuratio...
""" Functional interface to graph properties. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)\nPieter Swart (swart@lanl.gov)\nDan Schult(dschult@colgate.edu)""" # Copyright (C) 2004-2008 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # Al...
# -*- coding: utf-8 -*- # Copyright 2014, 2015 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
# -*- coding: utf-8 -*- from south.db import db from django.db import models from adm.result.models import * class Migration: def forwards(self, orm): db.delete_index('result_qualifiedapplicant', ['order']) def backwards(self, orm): db.create_index('result_qualifiedapplicant', ['orde...
# encoding: utf-8 '''User configuration. ''' import sys, os, logging, glob, codecs, re import logging.handlers from smisk.util.collections import merge_dict log = logging.getLogger(__name__) __all__ = ['config', 'config_locations', 'Configuration', 'configure_logging', 'LOGGING_FORMAT'] # setup check_dirs ...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Presidentielcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.mininode import * from test_framework.test_framework import Presidentielcoin...
#!/usr/bin/python import RPi.GPIO as GPIO import time import sys,os import serial import socket dir = "./log.txt" port = '/dev/ttyACM0' ser = serial.Serial(port,9600) def getTime(): return time.strftime("%Y;%m;%d;%H;%M;%S") def is_valid_number(number): """In this case numbers higher than 100 will be considered s...
from typing import Union from deepchem.utils.typing import RDKitMol from deepchem.feat.base_classes import MolecularFeaturizer class RawFeaturizer(MolecularFeaturizer): """Encodes a molecule as a SMILES string or RDKit mol. This featurizer can be useful when you're trying to transform a large collection of RD...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ A fetcher for the UniProt metadatabase. Iterates over all database IDs ranging from 1-300 and stores basic information about any valid database id in a python dictionary. """ import requests from ansicolor import red, green from bs4 import BeautifulSoup import json _...
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
""" Test include item connections. """ from gaphor import UML from gaphor.tests import TestCase from gaphor.UML.usecases.include import IncludeItem from gaphor.UML.usecases.usecase import UseCaseItem class IncludeItemTestCase(TestCase): def test_use_case_glue(self): """Test "include" gluing to use cases....
# Copyright 1998-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 __all__ = ["bindbapi", "binarytree"] import portage portage.proxy.lazyimport.lazyimport(globals(), 'portage.checksum:hashfunc_map,perform_multiple_checksums,' + \ 'verify_all,_apply_hash_filter,_hash_filter',...
import sys from collections import defaultdict if __name__ == "__main__": in_path = sys.argv[1] out_path = sys.argv[2] group_count = defaultdict(int) with open(in_path) as in_file: for line in in_file: args = line.strip().split() for arg in args[1:]: gro...
"""Voxel-Based Morphometry on Oasis dataset ======================================== This example uses Voxel-Based Morphometry (VBM) to study the relationship between aging, sex and gray matter density. The data come from the `OASIS <http://www.oasis-brains.org/>`_ project. If you use it, you need to agree with the d...
from netsuite.client import client, passport, app_info from netsuite.utils import ( get_record_by_type, search_records_using ) from netsuite.service import ( Customer, CustomerSearchBasic, SearchStringField ) import uuid def get_customer(internal_id): return get_record_by_type('customer', int...
from __future__ import print_function import logging import pprint import datetime import sys import argparse from ldtools.utils import ( is_valid_url, get_slash_url, get_rdflib_uriref, urllib2, ) from ldtools.helpers import set_colored_logger from ldtools.backends import __version__ from ldtools.ori...
# -*- 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...
# -*- encoding: utf-8 -*- # json_delta: a library for computing deltas between JSON-serializable # structures. # json_delta/_diff.py # # Copyright 2012‒2015 Philip J. Roberts <himself@phil-roberts.name>. # BSD License applies; see the LICENSE file, or # http://opensource.org/licenses/BSD-2-Clause '''Functions for compu...
#!/usr/bin/env python import urllib2,urllib from django.conf import settings from nodegroups import * try: import json except ImportError: import simplejson as json class SaltAPI(object): __token_id = '' def __init__(self): self.__url = settings.SALT_API_URL self.__user = settings.SALT_...
#!/usr/bin/python # -*- coding: utf-8 -*- """ This module defines the entry point for flask_ web server implementation of the Wikimedia User Metrics API. This module is consumable by the Apache web server via WSGI interface via mod_wsgi. An Apache server can be pointed to api.wsgi such that Apache ma...
#!/usr/bin/env python from s3o import S3O from optparse import OptionParser from glob import glob import vertex_cache def recursively_optimize_pieces(piece): optimize_piece(piece) for child in piece.children: recursively_optimize_pieces(child) def chunks(l, n): """ Yield successive n-sized chun...
def menu(): from ftplib import FTP import os import time from pygame import mixer import sched ftp = FTP() choice = '' while(choice!='0'): print('1. Music') print('2. Take a Picture') print('3. Text To Speech') print('0. To Exit') choice = input('Enter Choice : ') if(choice == '1'): print('All...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2018 David Arroyo Menéndez # Author: David Arroyo Menéndez <davidam@gnu.org> # Maintainer: David Arroyo Menéndez <davidam@gnu.org> # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
# # test shuffle_batch - 6b # # generates a pair of files (color+bn) # pending: make the tuple match # print("Loading tensorflow...") import numpy as np import matplotlib.pyplot as plt import tensorflow as tf import os from libs import utils import datetime tf.set_random_seed(1) def create_input_pipeline_yida(f...
#*************************************************************************** #* Copyright (c) 2013 Yorik van Havre <yorik@uncreated.net> * #* Copyright (c) 2020 Travis Apple <travisapple@gmail.com> * #* * #* This pr...
#! /usr/bin/env python # encoding: utf-8 # Avalanche Studios 2009-2011 # Thomas Nagy 2011 """ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this...
# -*- 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...
import os from setuptools import setup LONG_DESCRIPTION = """Logging-Prometheus Exports metrics about the logging of your Python application for Prometheus.io. See https://github.com/korfuri/python-logging-prometheus for usage instructions. """ setup( name="logging-prometheus", version="0.1.0", author="...
#!/usr/bin/python3 # Copyright (C) 2017 Harold Grovesteen # # This file is part of SATK. # # SATK 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 ...
from models.RepPoints.builder import RepPoints as Detector from models.retinanet.builder import MSRAResNet50V1FPN as Backbone from models.RepPoints.builder import RepPointsNeck as Neck from models.RepPoints.builder import RepPointsHead as Head from mxnext.complicate import normalizer_factory def get_config(is_train):...
from Screens.Wizard import WizardSummary from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc from VideoHardware import video_hw from Components.Pixmap import Pixmap, MovingPixmap, MultiPixmap from Components.config import config, ConfigBoolean, configfile from Tools.Directories import resolveF...
#!/usr/bin/env python # -*- coding:utf-8 -*- from lib import verify def check_user_input(user_dict): """ check user input info format @parm user_dict: Dictionary, an user info dictionary @return ok: Boolean , info check pass or not @return info: String, message return to user ...
# Copyright (c) 2015 phrack. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import random import threading from training_protocols.ITrainingProtocol import ITrainingProtocol class ShootDontShoot(ITrainingProtocol): def __init__(self, mai...
# Script to convert CoNLL files with tag+morphology into the simple two-column # format assumed by efselab. # # If only the tag is required, conversion can more easily be done like this: # # cut -f 2,4 file.conll >file.tab """ cat /home/corpora/SUC3.0/corpus/conll/blogs.conll /home/corpora/SUC3.0/corpus/conll/suc-trai...
# # vsmtpd/daemon.py # # Copyright (C) 2011 Damien Churchill <damoxc@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; either version 3, or (at your option) # any later version. # # T...
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
# -*- encoding: utf-8 -*- """Tests for Installer""" from robottelo.decorators import run_only_on, stubbed from robottelo.test import CLITestCase class InstallerTestCase(CLITestCase): """Test class for installer""" # Notes for installer testing: # Perhaps there is a convenient log analyzer library out ther...
import sys import models import model_utils import math import numpy as np import video_level_models import tensorflow as tf import utils import tensorflow.contrib.slim as slim from tensorflow import flags FLAGS = flags.FLAGS class CnnLstmMemoryMultiTaskModel(models.BaseModel): def cnn(self, model_input,...
# entry point for the input form to pass values back to this script def setValues(tH0,tWM,tWV,tz,tmnue,tmnumu,tmnutau,tw,twp,tT0): H0 = tH0 h = H0/100 WM = tWM WV = tWV z = tz WR = 2.477E-5/(h*h) # does not include neutrinos, T0 = 2.72528 WK = 1-WM-WR-WV mnue = tmnue mnumu = tmnumu mnutau = tmnutau...
import requests import os def get_overview(): # Use Github Rest API to get releases: release_dict = requests.get('https://api.github.com/repos/do-mpc/do-mpc/releases').json() text = '' text += '# Release notes' text += '\n' text += 'This content is autogenereated from our Github [release n...
import time import multiprocessing from proxypool.processors.server import app from proxypool.processors.getter import Getter from proxypool.processors.tester import Tester from proxypool.setting import CYCLE_GETTER, CYCLE_TESTER, API_HOST, API_THREADED, API_PORT, ENABLE_SERVER, \ ENABLE_GETTER, ENABLE_TESTER, IS_W...
#!/usr/bin/env python import sys, os ROOT = os.path.abspath('%s/../..' % os.path.abspath(os.path.dirname(__file__))) sys.path.append(ROOT) os.environ['DJANGO_SETTINGS_MODULE'] = 'qurkexp.settings' from django.core.management import setup_environ from django.conf import settings from qurkexp.join.models import * from q...
#|==============================================================|# # Made by IntSPstudio # Project Visual Street # ID: 980004006 # Twitter: @IntSPstudio #|==============================================================|# #SYSTEM import os import sys #import time import turtle import math #ALG #Ympyrän kehän koko def c...
# -*- test-case-name: txdav.who.test.test_xml -*- ## # Copyright (c) 2014 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LI...
from __future__ import absolute_import # Django settings for zulip project. ######################################################################## # Here's how settings for the Zulip project work: # # * settings.py contains non-site-specific and settings configuration # for the Zulip Django app. # * settings.py impor...
class Solution(object): def combinationSum2(self, candidates, target): """ :type candidates: List[int] :type target: int :rtype: List[List[int]] """ candidates.sort() out = [] results = [] combi_sum(candidates, 0, target, out, results) ...
# -*- coding: utf-8 -*- __author__ = 'meanwhile' import ssl import time import socket import sys import logging import vkontakte import ProvaderStorage import Constants import FileWriter import ProccessingResponce import daemon class VkParserDemon(daemon.Daemon): def run(self): #read code for method vk...
from __future__ import absolute_import, unicode_literals from django.core.urlresolvers import reverse from django.test.utils import override_settings from django.utils import timezone from mock import patch from temba.types import Broadcast from tracpro.msgs.models import Message, COHORT_ALL, COHORT_RESPONDENTS, COHOR...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distribu...
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
from typing import Any, List, Mapping, Optional import orjson from django.http import HttpResponse, HttpResponseNotAllowed from django.utils.translation import ugettext as _ from zerver.lib.exceptions import JsonableError class HttpResponseUnauthorized(HttpResponse): status_code = 401 def __init__(self, re...
import inspect import logging from server.common import constants class Logging(object): def __init__(self): logging.basicConfig(filename=constants.LOG_FILE_NAME, level=logging.DEBUG, filemode='a', format='%(asctime)s %(message)s', ...
# -*- coding: utf-8 -*- # Copyright 2007-2011 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
""" Data structures for the Buffer. It holds the text, cursor position, history, etc... """ from __future__ import unicode_literals from .completion import Completer, Completion, CompleteEvent from .document import Document from .enums import IncrementalSearchDirection from .history import History, InMemoryHistory fro...
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2011 Thomas Perl and the gPodder Team # # gPodder 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...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright 2008-2015 MonetDB B.V. """ functions for converting python objects to monetdb SQL format. If you want to ...
#!/usr/bin/env python # encoding: utf-8 from intervaltree import IntervalTree,Interval import json import math import re import six import struct import pfp.errors as errors import pfp.utils as utils import pfp.bitwrap as bitwrap import pfp.functions as functions BIG_ENDIAN = ">" LITTLE_ENDIAN = "<" def true(): re...
# -*- coding: utf-8 -*- from odoo.tests.common import TransactionCase from odoo.exceptions import UserError class TestInventory(TransactionCase): def setUp(self): super(TestInventory, self).setUp() self.env.ref('core.goods_category_1').account_id = self.env.ref( 'finance.account_goods...
import os import sys import better extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', #'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.mathjax', #'sphinx.ext.pngmath', 'sphinx.ext.viewcode', 'numpydoc', ] autosummary_generate = True autodoc_default_flags = [...
#!/usr/bin/env python import os import argparse class StatisticParser(argparse.ArgumentParser): def __init__( self, description = "perform statistical analysis" ): argparse.ArgumentParser.__init__( self, description ) # put arguments here self.add_argument("-f", "--fit...
from utils import current_random, current, timestring import urllib, time class urls(): def __init__(): return None @staticmethod def verify_usr(usr): return "http://login.xunlei.com/check/?u=%s&business_type=108&cachetime=%d&" % (usr, current()) @staticmethod def login(): ...
# # Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you unde...
from .genometric_space import GenometricSpace from .dataset.parser.parser import Parser import pandas as pd import warnings import numpy as np class MultiRefModel: """ GenometricSpace class to represent data that are mapped with multiple references """ def __init__(self): """ Con...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import atexit import json import os import signal import subprocess import sys import time from six.moves import xrange from multiprocessing import Process from tensorflow.python.platform import tf_logging as logging from po...
# This work was funded by Roche and generously donated to the free # and open source cheminformatics community. import warnings warnings.simplefilter('default', DeprecationWarning) warnings.warn("The rdkit.Chem.MCS module is deprecated; please use rdkit.Chem.rdFMCS instead.", DeprecationWarning,stacklevel...
# Copyright 2014 DreamHost, LLC # # Author: DreamHost, 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 applicabl...
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ericsson AB # # 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 ...
import cv2, glob, sys, os, imghdr, datetime, time, json def main(srcdir, destdir, cascade_path): winname = 'searching..' cv2.namedWindow(winname, cv2.WINDOW_AUTOSIZE) if not os.path.exists(destdir): os.mkdir(destdir) lastsaved = datetime.datetime.now() prefix = lastsaved.strftime('%Y%m%d-%H%M%S_') c...
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # from __future__ import absolute_import, division, unicode_literals from unittest import skip f...
# -*- coding: utf-8 -*- from django.utils import timezone from django.utils.translation import gettext as _ import plotly.offline as plotly import plotly.graph_objs as go from reports import utils def feeding_amounts(instances): """ Create a graph showing daily feeding amounts over time. :param instance...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.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 witho...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # radkdict.py # cjktools # """ Based on the radkfile, a dictionary mapping character to bag of radicals. """ import sys from cjktools import maps from cjktools.common import get_stream_context, stream_codec from . import cjkdata from six import text_type def _def...
#!/usr/bin/env python import os import array as ar import hashlib from sys import argv from copy import copy from collections import defaultdict from time import clock ######################## Read/check word list ############################### print if len(argv) != 2: print "Usage: dawg_gen.py [word list path...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 OpenStack LLC. # 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/...
import io from collections import OrderedDict import yaml import yaml.constructor # Courtesy of https://gist.github.com/844388. Thanks! class OrderedDictYAMLLoader(yaml.Loader): """A YAML loader that loads mappings into ordered dictionaries.""" def __init__(self, *args, **kwargs): yaml.Loader.__ini...
# -*- coding: utf-8 -*- # # python-docx documentation build configuration file, created by # sphinx-quickstart on Sat Jun 29 17:34:36 2013. # # This file is execfile()d with the current directory set to its containing # dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
# -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @tantrumdev wrote this file. As long as you retain this notice you # can do whatever you want wit...
# Copyright 2014 Andreas Riegg - t-h-i-n-x.net # # 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...
from __future__ import unicode_literals from __future__ import print_function import base64 import datetime from django.db import models from django.db.models.query import QuerySet from django.core.exceptions import ImproperlyConfigured from django.contrib.contenttypes.models import ContentType from django.contrib.au...
# -*- coding: utf-8 -*- from __future__ import division import unittest import odelab from odelab.scheme.stochastic import * from odelab.system import * from odelab.solver import * from newton import * Solver.catch_runtime = False def Vsin(self,t): return np.sin(t) class Vlin(object): def __init__(self, t0, V0...
"""Base and mixin classes for instance reduction techniques""" # Author: Dayvid Victor <dvro@cin.ufpe.br> # License: BSD Style import warnings from abc import ABCMeta, abstractmethod from sklearn.base import BaseEstimator, ClassifierMixin from sklearn.neighbors.classification import KNeighborsClassifier from sklearn...
#!/usr/bin/python # # Copyright (c) SAS Institute 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...
''' AUDIO CLASSICAL COMPOSER IDENTIFICATION BASED ON: A SPECTRAL BANDWISE FEATURE-BASED SYSTEM ''' import essentia from essentia.standard import * import glob import numpy as np import arff from scipy import stats import collections import cv2 import matplotlib import matplotlib.pyplot as plt #### gabor filters d...
#!usr/bin/python # Created by Sagar Uprety at Bengaluru, India on May 14th, 2016. # This is a simple stopwatch utility implemented as shell. Can be used in absence of a smartphone/smartwatch. # Run this file using the python command and then see the list of commands to proceed. # Any comments/suggestions/feedback is w...
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
#!/usr/bin/env python import sys import os import re import glob import xmltodict import json import yaml import copy import logging from argparse import ArgumentParser from argparse import RawDescriptionHelpFormatter from elasticsearch import Elasticsearch from collections import OrderedDict import datetime import d...
#!/usr/bin/python # -*- coding: utf-8 -*- import os from cachetools import cached from EmeraldAI.Logic.Singleton import Singleton from EmeraldAI.Logic.Modules import Global from EmeraldAI.Config.Config import Config from EmeraldAI.Logic.Logger import FileLogger class SQlite3(object): __metaclass__ = Singleton ...
# This file is part of Beneath a Binary Sky. # Copyright (C) 2016, Aidin Gharibnavaz <aidin@aidinhut.com> # # Beneath a Binary Sky 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 # Lice...
#!/usr/bin/env python3 """ Periscope API for the masses """ import os from dateutil.parser import parse as dt_parse class BroadcastDownloadInfo: """Contains information about the broadcast's download but not about the broadcast itself""" def __init__(self): self.dl_info = dict() self.dl_info...
#!/usr/bin/python # Copyright (C) 2013 Red Hat, Inc # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program i...
''' Code for generating email notifications for users (e.g. email notifications for new activities in your dashboard activity stream) and emailing them to the users. ''' import datetime import re import pylons import ckan.model as model import ckan.logic as logic import ckan.lib.base as base from ckan.common import...