text
stringlengths
12
6.59M
""" Views for Indivo JS UI """ # todo: rm unused from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpRequest from django.contrib.auth.models import User from django.core.exceptions import * from django.core.urlresolvers import reverse from django.core import serializers from django.db import trans...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' urlfetch ~~~~~~~~~~ An easy to use HTTP client based on httplib. :copyright: (c) 2011-2012 Elyes Du. :license: BSD 2-clause License, see LICENSE for details. ''' __version__ = '0.5.1' __author__ = 'Elyes Du <lyxint@gmail.com>' __url__ = 'https://github.com/lyxint/ur...
#! /usr/bin/python """ A simple script demonstrating how to add new users and delete them. Note that this isn't a great script to run on your production system, but it will create a user unlikely to conflict with the ones you have. This is more of sample code than anything else. """ import requests, logging, json, s...
import os from xml.etree import ElementTree import requests from usgs import USGS_API, USGSConnectionError from usgs import soap, xsi TMPFILE = os.path.join("/", "tmp", "usgs") NAMESPACES = { "SOAP-ENV": "http://schemas.xmlsoap.org/soap/envelope/", "ns1": "https://earthexplorer.usgs.gov/inventory/soap" } ...
#!/usr/bin/env python import sys import hashlib import os import argparse import time import ififuncs from ififuncs import make_desktop_logs_dir def hashlib_md5(filename): read_size = 0 last_percent_done = 0 m = hashlib.md5() total_size = os.path.getsize(filename) with open(str(filename), 'rb') as f: ...
#!/usr/bin/env python import sys import hashlib import os import argparse import time import ififuncs from ififuncs import make_desktop_logs_dir def get_input(manifest): if not manifest.endswith(('.txt', '.md5', '.exf' )): print 'Usage: validate.py manifest \nManifests can be a .txt or a .md5 or an ExactF...
#!/usr/bin/env python import sys import hashlib import os import logging import argparse import time import getpass from ififuncs import make_desktop_logs_dir def hashlib_md5(filename): read_size = 0 last_percent_done = 0 m = hashlib.md5() total_size = os.path.getsize(filename) with open(str(filename),...
import json import codecs from pages import ProjectDashboardPage, ProjectFilesPage, ProjectAnalyticsPage, \ ProjectForksPage, ProjectRegistrationsPage, ProjectWikiPage, RegistrationDashboardPage, RegistrationFilesPage, \ RegistrationAnalyticsPage, RegistrationForksPage, RegistrationWikiPage, UserProfilePage, In...
#!/usr/bin/python # Creator: Daniel Wooten # Version 1.0. import os as os import time as time import logging as logging import copy as cp import re as re import sys import json """ This is a collection of commonly used functions in programs created by Daniel Wooten. They should be ( and are ) utilized in other pr...
from keras.models import Model from keras.layers import Input, Masking, Dense, LSTM from keras.layers import Dropout, TimeDistributed, Bidirectional, merge from keras.layers.embeddings import Embedding from keras.utils import np_utils from keras.optimizers import RMSprop import numpy as np import pandas as pd import ...
from math import sqrt from sympl import TendencyComponent, initialize_numpy_arrays_with_properties class BucketSurface(TendencyComponent): """ Calculates the surface energy and the hydrology balance. """ input_properties = { 'downwelling_longwave_flux_in_air': { 'dims': ['*', 'in...
#!/usr/bin/env python import cluster_labeling.optemo_django_models as optemo import subprocess import time import re output_subdir = 'cluster_labeling/cc_boostexter_files/' boostexter_subdir = 'cluster_labeling/BoosTexter2_1/' boosting_fields = [ ('title', 'text'), ('brand', 'text'), ('model', 'text'), ...
#!/usr/bin/env python from __future__ import division import cluster_labeling.optemo_django_models as optemo import subprocess import time import re output_subdir = 'cluster_labeling/cc_boostexter_files/' boostexter_subdir = 'cluster_labeling/BoosTexter2_1/' boosting_fields = [ ('title', 'text'), ('brand', ...
""" This signature containts test to see if the site is running on dotCMS. """ __author__ = "Seth Gottlieb" __copyright__ = "CM Fieldguide" __credits__ = ["Seth Gottlieb", 'Adriaan Bloem'] __license__ = "Unlicense" __version__ = "0.1" __maintainer__ = "Seth Gottlieb" __email__ = "sgottlieb@alumni.duke.edu" __status__ =...
import argparse import logging from math import factorial import codecs import random import sys from itertools import combinations import mkl from gensim.models.word2vec import Word2Vec if __name__ == "__main__": logging.basicConfig(format='%(asctime)s : %(levelname)s : %(message)s', level=logging.INFO) mkl....
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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.or...
import os import json import pytz import uuid import datetime import mimetypes import bson.objectid import tempdir as tempfile import enum as baseEnum MIMETYPES = [ ('.bvec', 'text', 'bvec'), ('.bval', 'text', 'bval'), ('.m', 'text', 'matlab'), ('.sh', 'text', 'shell'), ('.r', 'text', 'r'), ] for m...
# # Copyright (C) 2018 Satoru SATOH <ssato @ redhat.com> # License: MIT # # pylint: disable=unidiomatic-typecheck r"""Abstract processor module. .. versionadded:: 0.9.5 - Add to abstract processors such like Parsers (loaders and dumpers). """ from __future__ import absolute_import import operator import pkg_resou...
# (c) 2009-2016 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Original PyFileServer (c) 2005 Ho Chun Wei. # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ WSGI container, that handles the HTTP requests. This object is passed to the WSGI serve...
from .decorators import raml_optional, raml_simple_parse, raml_tabbed from .RamlParseable import RamlParseable from .RamlBody import RamlBody from .RamlResponse import RamlResponse from .RamlHeader import RamlHeader class RamlMethod(RamlParseable): def __init__(self, yaml): super(RamlMethod, self).__init...
from __future__ import unicode_literals import factory from . import models class LanguageFactory(factory.DjangoModelFactory): FACTORY_FOR = models.Language name = factory.Sequence(lambda n: 'lang {0}'.format(n)) class LibraryFactory(factory.DjangoModelFactory): FACTORY_FOR = models.Library langua...
import numpy as np import os.path import random import string import sys import time import scipy.stats class insert_file_info : def __init__(self, full_file_path, filenumber, boundary, nrows = 1000, ncols = 12800, use_random_seed = True ) : """ filenumber : An array of file number...
import unittest from Naked.toolshed.shell import execute_js, execute, muterun from multiprocessing import Process from test_util import * import time def start_selenium(): muterun("./node_modules/protractor/bin/webdriver-manager start") class JsTests(unittest.TestCase): def setUp(self): execute("npm i...
import json from functools import partial from datetime import datetime from moi import r_client, ctxs, ctx_default, REDIS_KEY_TIMEOUT from moi.group import create_info def _status_change(id, redis, new_status): """Update the status of a job The status associated with the id is updated, an update command is...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from types import LambdaType from apscheduler.schedulers.background import BackgroundScheduler from typing import Optional, List, Dict, Any from typing im...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging import typing from builtins import object from typing import Any from typing import Dict from typing import List from typing import Optional from typing i...
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Backend.Backend import Backend, BackendState from UM.Application import Application from UM.Scene.SceneNode import SceneNode from UM.Preferences import Preferences from UM.Signal import Signal from UM.Logger import ...
import collections import re from rest_framework.reverse import reverse from rest_framework.fields import SkipField from rest_framework import serializers as ser from website import settings from website.util.sanitize import strip_html from website.util import waterbutler_api_url_for from api.base import utils from ...
#!/usr/bin/env python2.7 """Several utilities shared between different modules.""" from email.mime.text import MIMEText from uuid import getnode import os import paho.mqtt.client as paho import pymongo import smtplib import time __PAHO_HOST = "localhost" __PAHO_PORT = 1883 __PAHO_KEEPALIVE = 60 __PAHO_BIND_...
from struct import Struct from time import time from os import listdir, remove from os.path import isfile, join, split from collections import defaultdict from cProfile import Profile from pstats import Stats from io import StringIO import pya class Timer: def __init__(self): self.start, self.current = ti...
""" Copyright 2015, Institute for Systems Biology 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 w...
# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Backend.Backend import Backend from UM.Application import Application from UM.Scene.SceneNode import SceneNode from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator from UM.Preferences import Preferenc...
import re import collections from rest_framework.reverse import reverse from rest_framework.fields import SkipField from rest_framework import serializers as ser from website import settings from website.util.sanitize import strip_html from website.util import waterbutler_api_url_for from api.base import utils from ...
import pymongo import json import re import os from datetime import date from bson.code import Code from bson.objectid import ObjectId from ConfigParser import ConfigParser config = ConfigParser() if os.path.exists(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'api.conf')): ...
#!/usr/bin/env python # # Copyright (C) 2014 Teague Sterling, John Irwin, # Regents of the University of California # # This implementation utilizes code and methods from Riccardo Vianello # as well as code structure and inspiration from geoalchemy2 import contextlib import functools import operator import types impo...
# -*- coding: utf-8 -*- # Copyright(C) 2008-2010 Romain Bignon, Christophe Benz # # 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, version 3 of the License. # # This program is distributed in t...
import sublime import sublime_plugin import codecs import os import re import yaml import SublimeRandomCrap.postmaster as postmaster from collections import OrderedDict NEW_MAIL = '''--- %(header)s--- %(body)s%(signature)s ''' DEFAULT_VARS = { "subject": "", "from": "", "to": "", "cc": "", "bcc": ...
import typing import collections from math import acos, atan2, cos, degrees, hypot, isclose, radians, sin from numbers import Real from collections.abc import Sequence __all__ = 'Vector2', VectorLike = typing.Union[ 'Vector2', typing.List[Real], # TODO: Length 2 typing.Tuple[Real, Real], typing.Dict...
from django.contrib.auth.forms import UserCreationForm from django.contrib.auth import login, authenticate from django.template import RequestContext from django.contrib.auth.decorators import login_required from django.shortcuts import render_to_response from django.http import HttpResponseRedirect, HttpResponse from ...
import logging import numpy as np from .base_recommender import AbstractRecommender from scipy.spatial import distance FLOOR_DISTANCE_ADJUSTMENT = 0.001 CATEGORICAL_FEATURES = ["geo_city", "locale", "os"] CONTINUOUS_FEATURES = ["subsession_length", "bookmark_count", "tab_open_count", "total_uri", "unique_tlds"] S3_B...
""" Extending the RoadRunner object with additional fields. """ from __future__ import print_function, division, absolute_import import os import roadrunner import warnings import copy # --------------------------------------------------------------------- # Extended RoadRunner class # --------------------------------...
# 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 # d...
from framework.exceptions import HTTPError from website.util.client import BaseClient from website.addons.figshare import settings class FigshareClient(BaseClient): def __init__(self, access_token): self.access_token = access_token @classmethod def from_account(cls, account): if accoun...
""" This is a plugin created by ShiN0 Copyright (c) 2018 ShiN0 <https://www.github.com/mgaertne/minqlx-plugin-tests> You are free to modify this plugin to your own one, except for the version related code. This plugin automatically rebalances new-joiners at round start based upon the ratings in the balance plugin. I...
import csv from sqlalchemy import func, desc from models import Scans, OnOffPairs_Scans, OnOffPairs_Stops from api import db GREEN_STATUS = '#76DB55' RED_STATUS = '#DB5555' INBOUND = '1' OUTBOUND = '0' DIRECTION = {'1':'Inbound', '0':'Outbound'} TRAINS = ['190','193','194','200'] QUOTAS = 'data/route_quotas.csv' ...
# This file is 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 # distrib...
import csv import datetime from collections import OrderedDict from django.conf import settings from django.contrib import messages from django.contrib.auth.decorators import login_required from django import forms from django.http import HttpResponseRedirect, Http404, HttpResponse from django.shortcuts import get_obj...
from collections import defaultdict import simplejson as json from django.contrib.auth.decorators import login_required from django.contrib.auth.models import Group from django.core.cache import cache from django.db import transaction from django.db.models import Q, Prefetch from django.http import JsonResponse impor...
from . import support from .manager import Manager from .model import Model from .trainer import Trainer import glob import numpy as np import os import tensorflow as tf class Learner: def __init__(self, config): self.graph = tf.Graph() with self.graph.as_default(): with tf.variable_sc...
from PySide import QtGui, QtCore import sys import time from traits.api import HasTraits, Instance, on_trait_change, Range from traitsui.api import View, Item from mayavi.core.ui.api import MayaviScene, MlabSceneModel, \ SceneEditor # Create the data. from sympy import sympify from predefined_surfaces impor...
# -*- coding: utf-8 -*- import cPickle as pickle import numpy as np from sklearn.cross_validation import train_test_split class DataSet(object): def __init__(self, data, target): assert data.shape[0] == target.shape[0] self._data = data self._target = target self._epochs...
"""Preprocessing - mitosis detection""" import argparse import math import os import shutil from keras.models import load_model import numpy as np from PIL import Image from sklearn.model_selection import train_test_split from train_mitoses import normalize def create_mask(h, w, coords, size): """Create a binary ...
# coding: utf-8 ''' See https://github.com/wheeler-microfluidics/microdrop/issues/216 ''' import bz2 import importlib import itertools as it import logging import json import platform import re import sys import types import conda_helpers as ch import path_helpers as ph import requests import yaml logger = logging.g...
#!/usr/bin/env python __author__ = 'tbeltramelli' import argparse from modules.Utils import * from modules.Filtering import * def main(): images = ["assets/IMG_2560.jpg", "assets/IMG_0258.jpg", "assets/IMG_0257.jpg", "assets/IMG_0256.jpg", "assets/IMG_0253.jpg"] for image_path in images: ...
import logging import netaddr import netifaces as ni from tendrl.commons.utils import cmd_utils LOG = logging.getLogger(__name__) def get_node_network(): """return [{"ipv4": ["ipv4address", ...], "ipv6": ["ipv6address, ..."], "netmask": ["subnet", ...], "subne...
# Copyright (c) 2018, DjaoDjin 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 notice, # this list of conditions and t...
# -*- encoding: utf-8 -*- # Dissemin: open access policy enforcement tool # Copyright (C) 2014 Antonin Delpeuch # # 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 2 # of th...
from __future__ import division import warnings import pandas import numpy from recordlinkage.base import BaseIndexAlgorithm from recordlinkage.utils import DeprecationHelper, listify from recordlinkage.measures import full_index_size from recordlinkage.algorithms.indexing import ( random_pairs_with_replacement,...
# Copyright 2020 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...
from time import gmtime from calendar import timegm from datetime import datetime from dateutil.relativedelta import relativedelta from elasticsearch import Elasticsearch from website import settings share_es = Elasticsearch( settings.SHARE_ELASTIC_URI, request_timeout=settings.ELASTIC_TIMEOUT ) def search...
# Copyright 2019 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...
from tkinter import * class TextEditor(): def __init__(self): self.root = Tk() self.root.wm_title("BrickText") self.editor = Text(self.root) def start(self): self.editor.pack() self.root.mainloop() def get_root(self): return self.root
#!/usr/bin/env python from __future__ import unicode_literals """ @package muframe @file muframe.py @author Edna Donoughe (based on work of James Case) @Brief gunicorn service supporting requests for uframe routes from OOI UI Flask App """ import multiprocessing import gunicorn.app.base, requests from gunicorn.six i...
#!/usr/bin/env python3 from models import Location, Stop, POI, Address from models import TimeAndPlace, Platform, RealtimeTime from models import Trip, Ride, RideSegment, Coordinates, TicketList, TicketData from models import Line, LineType, LineTypes, Way, WayType, WayEvent from datetime import datetime, timedelta imp...
import os, math, string, random, json from base import webqtlConfig from base.trait import GeneralTrait from base.data_set import create_dataset from utility.tools import flat_files, GEMMA_COMMAND, GEMMA_WRAPPER_COMMAND, TEMPDIR, WEBSERVER_MODE import utility.logger logger = utility.logger.getLogger(__name__ ) GEMMA...
#http://legacy.python.org/dev/peps/pep-0440/ version_info = ('0', '3', '2')
import copy import logging import new import os.path import re import sys import spitfire.compiler.analyzer import spitfire.compiler.codegen import spitfire.compiler.optimizer import spitfire.compiler.parser import spitfire.compiler.scanner import spitfire.compiler.xhtml2ast from spitfire import runtime from spitfire...
# coding=utf-8 # Copyright 2018 The TensorFlow Datasets 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 appl...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Basic interface to Amazon MWS # Based on http://code.google.com/p/amazon-mws-python # import urllib import hashlib import hmac import base64 import md5 import utils import re from xml.etree.ElementTree import fromstring try: from xml.etree.ElementTree import ParseE...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :copyright: 2011 – 2013 by OpenSlides team, see AUTHORS. :license: GNU GPL, see LICENSE for more details. """ VERSION = (1, 5, 0, 'alpha', 1) # During development it is the next release RELEASE = False def get_version(version=None, release=None): """ ...
import numpy as np import scipy as sp import pandas as pd import matplotlib from matplotlib import pyplot as plt import seaborn as sbrn import datetime import dateutil import sys, os import xlrd, xlwt dateparse = dateutil.parser.parse csv_file = r'S:\Program Files (x86)\Users\SERVER-MEDIA\Downloads\sale_per_leadsou...
################################################################################ # Copyright (c) 2022 ContinualAI. # # Copyrights licensed under the MIT License. # # See the accompanying LICENSE file for terms. ...
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, publish, ...
import sys import os import subprocess import spotdl.util import pytest @pytest.fixture(scope="module") def directory_fixture(tmpdir_factory): dir_path = os.path.join(str(tmpdir_factory.mktemp("tmpdir")), "filter_this_directory") return dir_path @pytest.mark.parametrize("value", [ 5, "string", ...
# # specparser.py # # Reads in a spec document and generates pretty data structures from it. # # Copyright (C) 2009 Collabora Ltd. # # 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...
import os import traceback import hashlib import random import subprocess from collections import namedtuple # Setup logging import logging logger = logging.getLogger(__name__) def booleanize(*args, **kwargs): # Handle both single value and kwargs to get arg name name = None if args and not kwargs: ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Basic interface to Amazon MWS # Based on http://code.google.com/p/amazon-mws-python # import urllib import hashlib import hmac import base64 import utils import re from xml.etree.ElementTree import fromstring try: from xml.etree.ElementTree import ParseError as XML...
# -*- coding: utf-8 -*- from openerp import models, fields, api class Course(models.Model): _name = 'openacademy.course' name = fields.Char(string="Title", required=True) description = fields.Text()
#!/usr/bin/env python # -*- coding: utf-8 -*- """ :copyright: 2011, 2012 by OpenSlides team, see AUTHORS. :license: GNU GPL, see LICENSE for more details. """ VERSION = (1, 3, 0, 'final', 0) # During development it is the next release RELEASE = True def get_version(version=None, release=None): """ D...
import sys, json import RPi.GPIO as GPIO import time direction = 'none' # simple JSON echo script for line in sys.stdin: print line if line.strip() =='left': direction = 'left' else: direction = 'right' GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.OUT) p=GPIO.PWM(22,100) p.start(5) if direction == 'left':...
import requests import json class BaseForAPIGW(): def __init__(self): self.base_url = 'http://localhost:80' self.api_key_query = '' def get_object_from_request(self, resource): ''' To escape the doubled jsonified text, it converts the response text to the object. ...
import time from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User #from common import log_user_activity, timezonize, username_hash, format_exception, os_shell from django.co...
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz <aahz at pobox.com> # and Tim Peters # This module should be kept in sync with ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC class NodeModel(): """ Node looku...
import sys import shutil, os sys.path.insert(0, os.path.expanduser('/data/mmcauliffe/dev/Montreal-Forced-Aligner')) import time import logging import platform import csv import statistics from datetime import datetime from aligner.command_line.train_and_align import align_corpus, align_corpus_no_dict corpus_dir = '/...
# -*- coding: utf-8 -*- from django.utils import timezone from opps.articles.models import ArticleBox, Article def set_context_data(self, SUPER, **kwargs): context = super(SUPER, self).get_context_data(**kwargs) article = Article.objects.filter( site=self.site, channel_long_slug__in=self.cha...
# -*- coding: utf-8 -*- from django.db import models from django.template.defaultfilters import date, time from .reference import Reference from .equipment import Equipment from .approximate import Approximate from .mixins import SeasonMixin, DescriptionMixin from .time_base import TimeMixin from . import fields cla...
# -*- coding: utf-8 -*- ''' Copyright (c) 2015 by Tobias Houska This file is part of Statistical Parameter Estimation Tool (SPOTPY). :author: Tobias Houska and Alejandro Chamorro-Chavez This class holds the Robust Parameter Estimation (ROPE) algorithm based on Bárdossy and Singh (2008). Bárdossy, A. and Singh, S. K...
import json from twisted.words.protocols import irc from twisted.internet import protocol, task, endpoints from twisted.spread import pb import sys from collections import deque from twisted.python import log class RemoteProtocol(pb.Referenceable): def __init__(self, protocol): self.protocol = protocol ...
""" =============================================================================== Phosphene drawings from Beyeler et al. (2019) =============================================================================== This example shows how to use the Beyeler et al. (2019) dataset. [Beyeler2019]_ asked Argus I/II users to dr...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import getopt import ConfigParser import urllib import dryscrape from datetime import datetime import re import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText do_send_mail=False def usage(): """ Display usage ...
"""Stack Plugin for EasyEngine.""" from cement.core.controller import CementBaseController, expose from cement.core import handler, hook from ee.cli.plugins.site_functions import * from ee.core.variables import EEVariables from ee.core.aptget import EEAptGet from ee.core.download import EEDownload from ee.core.shellex...
""" Photovoltaic thermal panels """ from __future__ import division import geopandas as gpd import numpy as np import pandas as pd import time import fiona import os from math import * import cea.inputlocator from cea.technologies.solar.photovoltaic import calc_properties_PV_db, calc_PV_power, calc_diffuseground_comp...
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ Tests for ``admin.packaging``. """ from glob import glob from subprocess import check_output, CalledProcessError from textwrap import dedent from unittest import skipIf from twisted.python.filepath import FilePath from twisted.python.procutils import wh...
import abc from collections import OrderedDict from itertools import product from functools import partial from time import time import cgen from devito.archinfo import get_simd_reg_size, get_simd_items_per_reg from devito.cgen_utils import ccode from devito.dle.blocking_utils import (BlockDimension, fold_blockable_t...
import requests import re import math import os from datetime import datetime from .extensions import db from .importer import release_parse, parse_github_url, parse_bitbucket_url from .models import ProjectLog, Project github_search_regex = re.compile('github.com/(.*)') github_match_regex = re.compile('((http(s)*://...
from math import log10 import requests from problem.models import UserStatus, TagInfo, Problem from submission.models import Submission from submission.util import SubmissionStatus from utils.permission import is_problem_manager def invalidate_problem(problem: Problem, save=True): query_list = list(problem.submis...
""" Contains the primary optimization and contraction routines. """ from collections import namedtuple from decimal import Decimal import numpy as np from . import backends, blas, helpers, parser, paths, sharing __all__ = ["contract_path", "contract", "format_const_einsum_str", "ContractExpression", "shape_only"] ...
#NSGAII import copy import numpy as np from numpy.random import random import pdb import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import math n_var = 5 n_obj = 3 n_pop = 200 def polynomial_mutation(x,xl,xu,prob_mut,eta_mut): X = copy.deepcopy(x) Y = np.full(X.shape,np.inf) do_mu...
import json from twisted.words.protocols import irc from twisted.internet import protocol, task from twisted.python import log import treq import lxml.html import re import Levenshtein import functools import urlparse import iptools INTERNAL_IPS = iptools.IpRangeList( '127/8', # full range '192.1...