text
stringlengths
6.04k
39.5k
# -*- coding: utf-8 -*- from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * import re import os import logging import unicodedata from datetime import datetime from urllib.parse import urljoin import requests.exceptions from rdflib impor...
#!/usr/bin/env python import math import rospy from tf import transformations from pid import PidController from std_srvs.srv import Empty, EmptyResponse from geometry_msgs.msg import Twist from geometry_msgs.msg import PoseStamped from std_msgs.msg import Float32 from sl_crazyflie_srvs.srv import ChangeTargetPose, Cha...
import os import numpy as np import h5py import fnmatch from .lh5_utils import * from .scalar import Scalar from .struct import Struct from .table import Table from .array import Array from .fixedsizearray import FixedSizeArray from .arrayofequalsizedarrays import ArrayOfEqualSizedArrays from .vectorofvectors import V...
import logging import webapp2 import json import logic from models import Rating, PFuser, ClusterRating, Place, Discount from google.appengine.api import memcache, taskqueue from datetime import datetime def put_user_in_cluster(user): ratings = Rating.get_list({'user': user.key.id()}) rlist = {} fo...
# -*- coding: utf-8 -*- """ Created on Tue Sep 26 17:34:11 2017 @author: Patricio """ import numpy as np import matplotlib.pyplot as plt from scipy import signal from numba import jit,float64,vectorize,int64 #import Wavelets @vectorize([float64(float64)]) def alphan(v): return -0.01*(v+34)/(np.exp(-0.1*(v+34))-1)...
# -*- coding: utf-8 -*- """Created in May, 2018 Pytorch functions for preconditioned SGD @author: <NAME> """ import torch _tiny = 1.2e-38 # to avoid dividing by zero ############################################################################### def update_precond_dense(Q, dxs, dgs, step=0.01): """ update d...
import pygame from pygame.locals import * import math from pygame.locals import K_d, K_RETURN, K_c, K_n, K_MINUS, K_EQUALS, K_LEFTBRACKET, K_RIGHTBRACKET import time from random import uniform, choices from pprint import pprint import json from .car import Car from .car import mate as car_mate from .checkpoint import ...
# # ENVISIoN # # Copyright (c) 2017-2021 <NAME>, <NAME>, <NAME>, <NAME>, # <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> # <NAME>, <NAME>, <NAME>, <NAME>, # <NAME> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the foll...
import os import time from queue import Queue, Empty, Full from threading import Thread import ffmpeg import numpy from .constant import PX_RGB, PX_BGR, DEFAULT_QUALITY, THUMBNAIL_RESOLUTION, SD_RESOLUTION from .image import ENCODE_JPEG, ENCODE_PNG, imwrite from .image import imencode, imdecode from .tool import show...
#!/usr/bin/env python """ Subband Autocorrelation Classification (SAcC) Pitch Tracker feature Based on Matlab code by <NAME> and <NAME> Python port based on SRI Feature template. 2013-08-25 <NAME> <EMAIL> """ import os import numpy as np import scipy.signal import scipy.io import scipy.cluster.vq # For SRI's wavread...
# -*- coding: utf-8 -*- import time import random import logging from multiprocessing import freeze_support from functools import partial from threading import Thread, Event from pizco import Signal, LOGGER, Proxy, Server from pizco.naming import PeerWatcher, ServicesWatcher, Naming from pizco.compat import Queue, E...
""" Wapper SQLAlchemy function to help you create table, insert table, drop table easily. """ import concurrent.futures from copy import deepcopy from datetime import datetime import pandas as pd from sqlalchemy import (MetaData, Table, Column, BigInteger, Integer, Float, NVARCHAR, CHAR, DATETI...
import tensorflow as tf import numpy as np def pairwise_distances(embeddings, euclidian=True, squared=False): """Compute the 2D matrix of distances between all the embeddings. Args: embeddings: tensor of shape (batch_size, embed_dim) euclidian: Boolean. If true, euclidian distance is calculat...
import numpy as np import urllib.request, json, time, os, copy, sys from scipy.optimize import linprog global penguin_url penguin_url = 'https://penguin-stats.io/PenguinStats/api/' class MaterialPlanning(object): def __init__(self, filter_freq=20, filter_stages=[], ...
import time class Joc: """ Clasa care defineste jocul. Se va schimba de la un joc la altul. """ NR_COLOANE = 7 NR_LINII = 6 NR_CONNECT = 4 # cu cate simboluri adiacente se castiga SIMBOLURI_JUC = ['X', '0'] # ['G', 'R'] sau ['X', '0'] JMIN = None # 'R' JMAX = None # 'G' GOL...
# # Copyright 2017-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0. import json import decimal import boto3 import datetime import re from decimal import Decimal import math from boto3.dynamodb.conditions import Key, Attr from botocore.exceptions import ClientError prin...
# The MIT License (MIT) # # Copyright (c) 2018 <NAME> # # 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, me...
''' PyCxClient Python-based all in one Chaoxing learning helper,put to test by mos9527 @ mos9527.tooo.top ''' import json import logging import os import sys import threading import time import coloredlogs import math import io from apis import session,behaviorlogging, captchas, general, mooclearning, regis...
r""" Approximate Discrete Radon Transform (ADRT) see LICENSE """ import numpy as np import matplotlib.pyplot as plt import sys from . import _adrtc def div0(a,b): r""" avoid divide by zero for arrays """ with np.errstate(divide='ignore', invalid='ignore'): c = np.true_divide( a, b ) ...
"""Run inference on test set scans. This consists of comparing both zero-filled recon and DL-recon to fully-sampled scans. All comparisons are done per volume (not per slice). Supported metrics include: - ssim - ssim_center (ssim_50) - psnr - nrmse """ import itertools import os from copy import deepc...
# -*- coding: utf-8 -*- # Copyright 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 or ...
#!/usr/bin/python3 import asyncio import bleak import bleak.utils import logging import random import struct import datetime from bleak import _logger as logger TARGET_ADDRESS = "F1:C8:1A:8D:37:8B" TARGET_LEAF_ADDRESS = "F1:C8:1A:8D:37:8B" #"E2:45:E5:25:22:F0" SERVICE_UUID = "21171523-4740-4AA5-B66B-5D2C6851CC5...
# -*- coding: utf-8 -*- """ Visualize words and topics in a standalone data dashboard. Using the IMDB review data processed in previous steps, render a word map and corresponding topic summary, filterable by review sentiment. Dependencies: pandas == 0.23 bokeh == 2.3 """ __author__ = "<NAME>" import math i...
import copy import warnings from typing import List import numpy as np import pandas as pd import scipy import simdkalman from numpy.fft import irfft, rfft, rfftfreq from scipy.interpolate import interp1d from scipy.ndimage import gaussian_filter1d from tqdm import tqdm from src.postprocess.metric import calc_haversi...
"A linear mixed effects model" from itertools import product import copy import numpy as np from numpy.linalg import LinAlgError from scipy.sparse import csc_matrix, issparse from scipy.sparse import eye as sparseeye from scipy.linalg import inv as scipy_inv from scipy.linalg import pinv from pydigree.stats.mixedmo...
# # Copyright (C) 2018 ETH Zurich and University of Bologna # # 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...
# The MIT License (MIT) # # Copyright (c) 2018-2022 <NAME> # # Use of this source code is governed by The MIT License (MIT) # that can be found in the LICENSE.txt file. """APIs for representing core project maps concepts: goals and arrows.""" import sys import re import datetime import operator import copy from enu...
# -*- coding: utf-8 -*- # Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo # Copyright (C) 2008-2020 German Aerospace Center (DLR) and others. # This program and the accompanying materials are made available under the # terms of the Eclipse Public License 2.0 which is available at # https://www....
#!/usr/bin/env python import os, sys, subprocess, logging, dxpy, json, re, socket, getpass, urlparse, datetime, requests, time, csv import common import dateutil.parser logger = logging.getLogger(__name__) EPILOG = '''Notes: Examples: %(prog)s ''' DEFAULT_APPLET_PROJECT = 'E3 ChIP-seq' def get_args(): import a...
import datetime from random import gauss import numpy as np import tkinter as tk import pyscreenshot as ImageGrab # For Linux from . import config as c class GUI(object): def __init__(self): drawscale = 250.0 width = 3.0 # with 1.5 to each side height = 2.0 gui = tk.Tk() ...
"""This module was provided by Lurz et al. ICLR 2021: GENERALIZATION IN DATA-DRIVEN MODELS OF PRIMARY VISUAL CORTEX.""" import warnings import numpy as np import torch import types import contextlib from csng_invariances._neuralpredictors.measures import corr from csng_invariances._neuralpredictors.training import e...
#!/usr/bin/env python #=============================================================================== # Copyright 2017 Geoscience Australia # # 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...
"""This file is nearly the same as flask.cli except for some modifications.""" import ast import inspect import os import platform import re import sys import traceback from functools import update_wrapper import click import flask from flask.cli import ( locate_app, prepare_import, _called_with_wrong_arg...
""" Module: Sampler The sampler module is provides methods exploring the potential functions. Stochastic Integrators """ import numpy as np import scipy.constants as const from ensembler.samplers._basicSamplers import _samplerCls from ensembler.util.ensemblerTypes import Union, List, Tuple, Number from ensemb...
""" Regex testing: https://regex101.com/ The Telebot link: https://github.com/eternnoir/pyTelegramBotAPI ---------------- """ from time import sleep from flask import request from telebot import types, apihelper import duckduckgo import classes import configparser import getip import os import te...
# -*- coding: utf-8 -*- # @Time : 2019/3/30 9:57 PM # @Author : 章光辉 # @FileName: amap.py # @Software: PyCharm from multiprocessing import Manager from multiprocessing.pool import ThreadPool from time import sleep import logging import requests from requests.adapters import HTTPAdapter from urllib3.util.retry impo...
"""Tests for website generation. """ import os from glob import glob from datetime import datetime import pytest from bs4 import BeautifulSoup from fah_xchem.schema import TimestampedAnalysis from fah_xchem.analysis.website import WebsiteArtifactory from fah_xchem.analysis.website.molecules import get_image_filenam...
# -*- coding: utf-8 -*- """ CIEobs.py Author: SMFSW Copyright (c) 2016-2021 SMFSW Description: CIE observer reference & class """ from refsTools import RefColorSet class RefObserver_xy(object): """ Observer reference dicts & methods https://en.wikipedia.org/wiki/Standard_illuminant """ lfields_variant =...
import numpy as np import cv2 from keras.models import Model, Sequential from keras.layers import Input, Dense, Reshape, Flatten from keras.layers.convolutional import Convolution2D, Conv2DTranspose from keras.layers.normalization import BatchNormalization from keras.layers.advanced_activations import LeakyReLU from ke...
#!/usr/local/bin/python3 -tt import sys import json import re import datetime from json import JSONEncoder # This is really a serious mindfuck. class Field(object): def __init__(self, ident, base_type, **kwargs): self._ident = ident self._base_type = base_type self._required = bool(kwargs.get("required", Fal...
#%% Imports, definitions, etc import os,sys import numpy as np import random import pandas as pd import csv import _pickle as pickle import torch import torchvision.transforms.functional as F import cv2 from PIL import Image import torch from torch.utils import data from torchvision import transforms # add relevan...
""" @ Filename: Cluster.py @ Author: <NAME> @ Create Date: 2019-05-15 @ Update Date: 2019-05-20 @ Description: Implement Cluster """ import sys import numpy as np import preProcess import pickle import random import matplotlib.pyplot as plt class KMeans: def __init__(self, norm_type="Normali...
""" Copyright (c) 2015-present, Philippine-California Advanced Research Institutes- The Village Base Station Project (PCARI-VBTS). All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. """ import os import json from crispy_f...
from __future__ import division import torch import torch.nn.functional as F import numpy as np def xywh2xyxy(x): # Convert bounding box format from [x, y, w, h] to [x1, y1, x2, y2] y = torch.zeros_like(x) if isinstance(x, torch.Tensor) else np.zeros_like(x) y[:, 0] = x[:, 0] - x[:, 2] / 2 y[:, 1] = ...
import os import hashlib from collections import defaultdict from io import StringIO from datetime import datetime from tempfile import TemporaryDirectory from PIL import Image from raybot import config from raybot.model import db from raybot.bot import bot, dp from raybot.util import h, HTML, get_user, forget_user, tr...
import math, copy import numpy as np import gym from gym_minigrid import entities, render_text, encoding class Cell(object): def __init__(self): self.color = 'black' # at the moment, we restrict background color to black self.clear() def clear(self): self.entity = None def __...
# /* # * Copyright (c) 2021 Xilinx Inc. All rights reserved. # * # * Author: # * <NAME> <<EMAIL>> # * # * SPDX-License-Identifier: BSD-3-Clause # */ from collections import OrderedDict nodes = dict() debug = False # Constants MID_PARITY = True # Set parity true for masters APER_PARITY = True # Set parity tru...
#!/usr/bin/env python from __future__ import print_function import subprocess import argparse import json import errno import os import shutil import fnmatch import hashlib ARDUINO_H = """/** * This is a generated file required by the Arduino build system." */ #include "pumbaa.h" """ SIMBA_GEN_C_FMT = """ #incl...
import datajoint as dj import numpy as np from . import experiment, get_schema_name, foraging_analysis from .model.bandit_model_comparison import BanditModelComparison schema = dj.schema(get_schema_name('foraging_model')) @schema class ModelClass(dj.Lookup): definition = """ model_class: varchar(32) # e.g. ...
#!/usr/bin/python3.6 """Calculations for a single TIMD. TIMD stands for Team In Match Data. TIMD calculations include consolidation of (up to) 3 tempTIMDs (temporary TIMDs) into a single TIMD, and the calculation of data points that are reflective of a team's performance in a single match. Consolidation is the proce...
from fontTools import ttLib from fontTools.misc.testTools import getXML, parseXML from fontTools.ttLib.tables.C_O_L_R_ import table_C_O_L_R_ import pytest COLR_V0_DATA = ( b"\x00\x00" # Version (0) b"\x00\x01" # BaseGlyphRecordCount (1) b"\x00\x00\x00\x0e" # Offset to BaseGlyphRecordArray from beginni...
from celery.schedules import crontab from encoder_ui.celery.tasks import celery import docker import os import logging import time import csv import redis from config import settings import requests import traceback import datetime import pytz from pytz import timezone import json from .redis_keys import * DEFAULT_W...
# -*- coding: utf-8 -* # Copyright (c) 2019 BuildGroup Data Services Inc. import re import json from caravaggio_rest_api.dse.backends.utils import DSEPaginator from caravaggio_rest_api.haystack.backends.utils import SolrSearchPaginator from django.db import connections from haystack.utils.app_loading import haystack_...
# Encoder from __future__ import print_function import math import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.modules.utils import _pair, _quadruple class Fire(nn.Module): """ In channel: inplanes Out channel: expand1x1_planes + expand3x3_planes """ def __init__(self, inpl...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import torch import torch.nn as nn import numpy as np import torch.optim as optim import os import six from six.moves import cPickle import pickle bad_endings = ['with','in','on','of','a','...
import glob import numpy as np import scipy import os from sklearn.cluster import KMeans from sklearn.metrics import adjusted_rand_score from joblib import dump import pandas as pd from multiprocessing.pool import ThreadPool from pyhydra.utils import check_symmetric, launch_svc __author__ = "<NAME>" __copyright__ = "C...
""" ============================================================= ~/fn_portal/tests/api/crud_api/test_fn121.py Created: 08 Sep 2020 10:40:55 DESCRIPTION: This file contains a number of unit tests that verify that the api endpoint for FN121 objects works as expected: + sample-list should be available to both lo...
import itertools import logging import math from collections import namedtuple import cv2 import numpy as np import tensorflow as tf from scipy.ndimage import maximum_filter, gaussian_filter import common from common import CocoPairsNetwork, CocoPairs, CocoPart from pythonosc import osc_message_builder from pythonosc...
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed # under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
# Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted.web.woven}. """ from twisted.trial import unittest from twisted.web import server, microdom, domhelpers from twisted.web.test import test_web from twisted.internet import reactor, defer, address from twisted.web...
## @package csnProject # Definition of the Project handling related classes. import csnUtility import csnDependencies import csnProjectPaths import csnInstall import csnCompile import csnTests import inspect import os.path import types import new from csnUtility import MakeValidIdentifier import re globalCurrentConte...
# -*- coding: utf-8 -*- """ bromelia.bromelia ~~~~~~~~~~~~~~~~~ This module contains the orchestrator to allow a seamless Diameter application implementation. :copyright: (c) 2020-present <NAME>. :license: MIT, see LICENSE for more details. """ import logging import multiprocessing import sys...
############################################################################### # Copyright (c) 2019, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory # Written by the Merlin dev team, listed in the CONTRIBUTORS file. # <<EMAIL>> # # LLNL-CODE-797170 # All rights reser...
# -*- coding: utf-8 -*- """Testing :mod:`astropy.cosmology.units`.""" ############################################################################## # IMPORTS import pytest import astropy.cosmology.units as cu import astropy.units as u from astropy.cosmology import Planck13, default_cosmology from astropy.tests.hel...
# Copyright (C) 2002-2007 Python Software Foundation # Contact: <EMAIL> """Email address parsing code. Lifted directly from rfc822.py. This should eventually be rewritten. """ from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolut...
# Copyright 2020 Huawei Technologies Co., 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 applicable law or agreed to...
# -*- coding: utf-8 -*- ''' Utilities to help make requests to virtualbox The virtualbox SDK reference can be found at http://download.virtualbox.org/virtualbox/SDKRef.pdf This code assumes vboxapi.py from VirtualBox distribution being in PYTHONPATH, or installed system-wide ''' # Import python libs from __future__ i...
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np from . import quaternion # works with (w, x, y, z) quaternions from . import se3 from scipy.spatial.transform import Rotation import transforms3d def quat2mat(quat): x, y, z, w = quat[:, 0], quat[:, 1], quat[:, 2], quat[:, 3] B ...
""" Oracle database backend for Django. Requires cx_Oracle: https://oracle.github.io/python-cx_Oracle/ """ import datetime import decimal import os import platform from contextlib import contextmanager from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db import Integ...
from decimal import Decimal from typing import DefaultDict, Dict, List, Optional, Tuple import asyncio import requests import collections import json import logging import os import sys from datetime import datetime import math import aiopubsub import mm_bot.model.order import mm_bot.model.book import mm_bot.model.co...
import itertools import os import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_, assert_almost_equal, assert_array_almost_equal) from pytest import raises as assert_raises import pytest from scipy._lib._testutils import check_free_memory from scipy.interpolat...
import collections import warnings try: import ssl except ImportError: # pragma: no cover ssl = None from . import compat from . import protocols from . import transports from .log import logger def _create_transport_context(server_side, server_hostname): if server_side: raise ValueError('Server...
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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 ...
#!/usr/bin/env python # # Copyright 2009 Facebook # # 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...
import numpy as np from astropy.io import fits from astropy.wcs import WCS import scipy.ndimage as ndimage import scipy.interpolate as interpolate from astropy.coordinates import SkyCoord import matplotlib.pyplot as plt #=================================================== #========== CREATE A MAP FINE FOR TEMPLATE FI...
""" # # File: DataDisplay.py # Author: danIv (<NAME>) # Created: 07/28/2018 # Description: Uses GUI to display either CO2 levels or Temperatures. # """ # -*- coding: utf-8 -*- from tkinter import * import pandas as pd import numpy import os import threading import time pd.opti...
import sys sys.path.insert(0, "..") import crnt4sbml import numpy import sympy import pandas import scipy.integrate as itg import dill from plotnine import ggplot, aes, geom_line, ylim, scale_color_distiller, facet_wrap, theme_bw, geom_path, geom_point, labs, annotate from matplotlib import rc rc('text', usetex=True) ...
#!/usr/bin/env python """Time humanizing functions. These are largely borrowed from Django's `contrib.humanize`. """ import datetime as dt import math from enum import Enum from functools import total_ordering from .i18n import gettext as _ from .i18n import ngettext __all__ = [ "naturaldelta", "naturaltim...
import math from contextlib import suppress from io import BytesIO from typing import List, Optional, Union, Dict, Any from typing_extensions import Literal from .unspent import Unspent from ..constants import SIGHASH, Chain from ..constants import TRANSACTION_VERSION, TRANSACTION_LOCKTIME, TRANSACTION_SEQUENCE, TRAN...
# --------------------------------------------------------------- # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # This work is licensed under the NVIDIA Source Code License # for NVAE. To view a copy of this license, see the LICENSE file. # ------------------------------------------------------------...
import copy import itertools import string import warnings import cupy from cupy import util from cupy.linalg.einsum_opt import _greedy_path from cupy.linalg.einsum_opt import _optimal_path if cupy.cuda.cutensor_enabled: from cupy import cutensor options = { 'sum_ellipsis': False, 'broadcast_diagonal': F...
import code # For development: code.interact(local = dict(globals(), **locals())) import numpy as np import xml.etree.ElementTree as et from scipy.io import netcdf import matplotlib.dates as mdates from datetime import datetime, timedelta import matplotlib.pyplot as plt import math # ===============================...
import xbmc import xbmcgui import kodigui import windowutils from lib import util from lib.util import T import plexnet class Setting(object): type = None ID = None label = None desc = None default = None def translate(self, val): return str(val) def get(self): return u...
import logging import math import time from datetime import date, datetime, timedelta import numpy as np import pandas as pd from analysis.models import StockHistoryDaily, StockStrategyTestLog, StockIndexHistory from analysis.stock_hist import download_hist_data from analysis.utils import (generate_task, get_analysis_...
""" functions to handle data loading TO DO: data augmentation for xyz coordinates data augmentation by adding gaussian noise """ import numpy as np import copy import tensorflow as tf from collections import Counter from numpy.linalg import norm class Data_Loader: input_mean = None input_std = No...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import numpy as np import os import re import sys from argparse import ArgumentParser from datetime import datetime, timedelta from itertools import product from scipy.interpolate import griddata from serial import Serial from time import sleep, time class Pr...
# -*- coding: utf-8 -*- # Coded in Python 3.8.7 64-Bit import random import math import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl mpl.style.use('seaborn') POPULATION_SIZE = 10 GENERATIONS = 300 CROSSOVER_RATE = 0.8 MUTATION_RATE = 0.6 NO_OF_GENES = 10 # This var is overwritten for FITNE...
# This code is part of Qiskit. # # (C) Copyright IBM 2018, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or deriva...
from kolibri.core import notifications from django.db import transaction from django.db.models import Case from django.db.models import Count from django.db.models import F from django.db.models import Sum from django.db.models import When from le_utils.constants import content_kinds from .models import HelpReason fro...
# -*- coding: utf-8 -*- # @Author : # @File : views.py # @Time : 2017/12/7 12:19 from flask import Blueprint, jsonify from flask import redirect, request, render_template, url_for, flash from app.models import * from flask.views import MethodView from flask_login import current_user, login_required from app imp...
# -*- coding: utf-8 -*- # # Copyright (C) 2019 Max-Planck-Gesellschaft zur Förderung der Wissenschaften e.V. (MPG), # acting on behalf of its Max Planck Institute for Intelligent Systems and the # Max Planck Institute for Biological Cybernetics. All rights reserved. # # Max-Planck-Gesellschaft zur Förderung der Wissens...
# Copyright 2019 The RE2 Authors. All Rights Reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """Tests for google3.third_party.re2.python.re2.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function ...
# # Copyright 2016 The BigDL Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
from ShapeDescriptor import * from Plotter import * from LineEstimation import * from VanishPencilsTable import * import matplotlib.pylab as pl from matplotlib.patches import ConnectionPatch import time import cv2 import pickle #from PIL import Image import Image from Scanner import * from MatchingProcessor import * ...
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, 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 3 of the Lic...
#@+leo-ver=5-thin #@+node:peckj.20150428142633.1: * @file python_terminal.py #@@language python #@@tabwidth -4 # this code from http://stackoverflow.com/questions/12431555/enabling-code-completion-in-an-embedded-python-interpreter # with modifications from <NAME> # to do: # styling #@+<< docstring >> #@+node:peckj...
""" Specifies, trains and evaluates (cross-validation) neural fingerprint model. Performs early-stopping on the validation set. The model is specified inside the main() function, which is a demonstration of this code-base """ from __future__ import print_function import time import numpy as np import sklearn.metric...
#=============================================================================== # Copyright 2020 Intel Corporation # # 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.o...
# -*- coding: utf-8 -*- import sys import os.path import tkinter as tk from tkinter import ttk, messagebox from tkinter.filedialog import asksaveasfilename from tkinter.filedialog import askopenfilename from thonny.misc_utils import eqfn, running_on_mac_os from thonny.codeview import CodeView from thonny.globals impor...
# coding: utf-8 # /*########################################################################## # # Copyright (c) 2016-2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...