text
stringlengths
6.04k
39.5k
''' Build NARM model ''' from __future__ import print_function import pickle from collections import OrderedDict import sys import time import numpy as np import theano from theano import config import theano.tensor as T from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams import data_process data...
#!/usr/bin/python3 # -*- coding:utf-8 -*- # Project: http://cloudedbats.org # Copyright (c) 2016-2018 <NAME> # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). import os import logging import time import wave import pyaudio import wurb_core def default_settings(): """ Available setti...
''' Copyright or © or Copr. This software is a computer program whose purpose is to generate random test case from a template file describing the data model. This software is governed by the CeCILL-B license under French law and abiding by the rules of distribution of free software. You can use, modify and/...
#!/usr/bin/env python3 import sys import math import argparse from functools import lru_cache import matplotlib.pyplot as plt from lab_tsp_insertion import * class TSPSolution(object): def __init__(self, instance:list, tour:list, distance:int, use_cache:bool=True): self.tour = tour self.n_cities =...
import hashlib import json import logging import time import boto.cloudformation from boto.cloudformation.stack import Stack from boto.exception import BotoServerError from copy import deepcopy logger = logging.getLogger('flotilla') DONE_STATES = ('CREATE_COMPLETE', 'ROLLBACK_COMPLETE', ...
# # Copyright 2015 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...
import numpy as np import torch import os from sfw_torch import sfw_seis_torch, run_seis_information, run_seis_information_new def load_data(disease): ''' Loads .mat files provided by Sze as numpy matricies/arrays ''' import scipy as sp import scipy.io import numpy as np if disease == 'tb':...
import sys import os import argparse import yaml import pprint sys.path.append(os.path.join(sys.path[0], "../../..")) # enable package import from parent directory from KicadModTree import * # NOQA class Dimensions(object): def __init__(self, base, variant, cut_pin=False, tab_linked=False): # FROM KL...
from enum import Enum import numpy as np from PuzzleLib.Backend import gpuarray, Blas from PuzzleLib.Backend.Kernels.MatVec import addVecToMat, addVecToMatBatch from PuzzleLib.Variable import Variable from PuzzleLib.Modules.Module import ModuleError, Module class GroupMode(str, Enum): full = "full" one = "one" ...
''' views for pages you can go to in the application ''' import re from django.contrib.auth.decorators import login_required, permission_required from django.contrib.postgres.search import TrigramSimilarity from django.core.paginator import Paginator from django.db.models import Avg, Q from django.http import HttpResp...
#!/usr/bin/env python # MIT License # # Copyright (c) 2019 <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...
from __future__ import annotations import errno import os import os.path from collections.abc import Iterable, AsyncIterable from datetime import datetime from mailbox import Maildir as _Maildir, MaildirMessage from typing import Optional, Union, Final, Literal from pymap.concurrent import Event, ReadWriteLock from ...
import gym import os import numpy as np import pandas as pd import matplotlib.pyplot as plt import time import pickle import warnings warnings.filterwarnings("ignore") global team_name, folder, env_name team_name = 'ml_team # N' # TODO: change your team name folder = 'tetris_race_qlearning' env_name = 'TetrisRace-v0' ...
""" This script will fragment a .smi Example Run: python fragmenter_of_smi_mol.py \ --smi_file autogrow4/source_compounds/PARPi.smi """ import itertools import copy import random import os import argparse import rdkit import rdkit.Chem as Chem from rdkit.Chem.BRICS import BRICSDecompose from rdkit import RDLogger ...
#! /usr/bin/env python # -*- coding: utf-8 -*- """ Tutorial 6: keyboard and mouse """ from __future__ import print_function from OpenGL.GL import * from OpenGL.GL.ARB import * from OpenGL.GLU import * from OpenGL.GLUT import * from OpenGL.GLUT.special import * from OpenGL.GL.shaders import * from glew_wish import * f...
import logging import os import tempfile import time import numpy as np import torch import wandb from weakvtg import iox from weakvtg.classes import get_class from weakvtg.mask import get_synthetic_mask from weakvtg.prettyprint import pp from weakvtg.timeit import get_fancy_eta, get_fancy_time, get_hms, get_delta fr...
import matplotlib.pyplot as plt import pandas as pd import seaborn as sns import numpy as np from itertools import product import subprocess import matplotlib as mpl from glob import glob import os def to_video(listfile, outputfile, fps=3, w=800, h=600, type='png'): """ Simply runs mencoder to ...
from __future__ import print_function from __future__ import absolute_import from __future__ import division import keras import numpy as np import warnings, os, sys from keras.models import Model from keras import initializers, regularizers, constraints from keras.utils import conv_utils from keras.utils.data_utils i...
import operator as op import statistics as st from abc import ABC, abstractmethod import numpy as np from ortools.graph import pywrapgraph as ortg from tqdm import tqdm import mapnames.string def vertex_diff(u, v, string_metric, **kwargs): return string_metric(u.label, v.label, **kwargs) class Vertex: def...
import pandas as pd import numpy as np import pickle import dill import lime from lime import lime_tabular import matplotlib.pyplot as plt from rdkit import Chem from rdkit.Chem import MACCSkeys from rdkit.Chem import AllChem Maccs_keys_dict = { 1:('?','Isotope'), 2:('[#104]','Atomic no 104 -...
#!/usr/bin/env python3 import ssl ssl._create_default_https_context = ssl._create_unverified_context import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) import argparse import json import os import pprint import re import time import requests import yaml from fpdf import FPDF class ...
import cv2 import warnings import numpy as np from tqdm import tqdm from PIL import Image from os import listdir import skimage.io as io import tensorflow as tf import matplotlib.pyplot as plt import matplotlib.image as mpimg from os.path import join as pjoin from skimage.filters import gaussian from skimag...
import pandas as pd # typing from typing import Dict, List, Union # 🤗 Transformers from transformers import PreTrainedTokenizer # 🤗 Datasets from datasets import DatasetDict, Dataset as hfDataset # torch from torch.utils.data import Dataset, DataLoader import time import numpy as np from thesis.datasets.s2orc.m...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This file is part of CbM (https://github.com/ec-jrc/cbm). # Author : <NAME> # Credits : GTCAP Team # Copyright : 2021 European Commission, Joint Research Centre # License : 3-Clause BSD from os.path import join, normpath from ipywidgets import (Text, VBox, HBox...
"""Evaluation of Wigner-d functions and spin-weighted spherical harmonic functions.""" import numpy as np import warnings from numba import njit, prange from scipy.special import binom, factorial from .utils import tri_ravel, tri_base, el_block_size __all__ = [ 'spin_spharm_goldberg', 'DeltaMatrix', 'sp...
import discord from discord.ext import commands, tasks import discord.utils import discord_slash from discord_slash.utils.manage_commands import create_option, create_choice import os, json, asyncio import urllib.request import re import requests from bs4 import BeautifulSoup import datetime, math from dotenv import lo...
from django.shortcuts import render,redirect from adminapp.forms import ConversionInputs, ProjectPricingForm,TaxForm, SingleProjectPricing,ApiRequestForm from coreapp.models import Project,ProjectUser,ProjectDashboard,ProjectPricing,DefaultProjectPricing,ProjectInvoice,Tax,ProjectUser,EndpointMlApi from login.models im...
import colorama from colorama import Fore,Back import mysql.connector as sql import time import sys from os import system import random import threading import itertools '''For Connecting to your DATABASE Change below credentials and run SQL QUERIES which are at end of this code ''' while(1): try: LH=str(...
import numpy as np import torch import torch.nn.functional as F from torch import nn from models import modelutils def inference_labels_full(l1_type_indices, child_type_vecs, scores, extra_label_thres=0.5): label_preds_main = inference_labels(l1_type_indices, child_type_vecs, scores) label_preds = list() ...
#!/usr/bin/env python3 # encoding: utf-8 # This script parse microbench logs and generate .csv for each workload import logging import pandas as pd import re import os import argparse import datetime import statistics def get_max_num_app(): return 10 def get_YEAR(): return datetime.date.today().year def...
from itertools import combinations, product from qaml.qubo import QUBO # Create a "Number" that is fixed point, by default a standard integer. # This number supports operations with other number objects and Python # integers and floats. class Number: def __init__(self, circuit, bit_indices, exponent, signed, const...
"""A musical Note object, with pitch, duration, and metrical information.""" import inspect import logging from fractions import Fraction from typing import Dict, Tuple, Union import music21 import numpy as np import pandas as pd from harmonic_inference.data.corpus_constants import MEASURE_OFFSET, NOTE_ONSET_BEAT fro...
import os import sys import torch import time import shutil import numpy as np import pandas as pd from argparse import Namespace import statsmodels.api as sm from . import classLSTM from . import classDB # from . import classPost from . import funDB from . import kPath def loadOptLSTM(outFolder): optFile = os.p...
# -*- coding: utf-8 -*- # Copyright (c) 2020, Aakvatech and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document import uuid from hms_tz.nhif.api.token import get_claimsservice_token import j...
from __future__ import print_function from __future__ import division import os import sys import time import datetime import argparse import os.path as osp import numpy as np import torch import torch.nn as nn import torch.backends.cudnn as cudnn from torch.utils.data import DataLoader # from torch.optim import lr_s...
from typing import Optional, List, Dict from Core.Diff import Line, FileDiff, LineType, Source, GitDiff class MergeLine: def __init__(self, line: Line, source: Source, left_index: Optional[int], middle_index: Optional[int], right_index: Optional[int]): self.conflicts = False self...
import os import sys import pickle import numpy as np import xml.etree.ElementTree as ET import random import svgwrite from IPython.display import SVG, display import tensorflow as tf def get_bounds( data, factor ): min_x = 0 max_x = 0 min_y = 0 max_y = 0 abs_x = 0 abs_y = 0 for i in range( len( da...
############################################################################### # # # Copyright 2017 - <NAME> # # # # L...
import copy import envi.bits as e_bits from vivisect.const import * from vivisect.symboliks.common import * from vivisect.symboliks.expression import symexp def ismatch(sym,tmp): ''' FIXME - eventually optimize this into one match call against a set of trees.... Given a sym and s "symbolik t...
# mmrw.py import mmap, os, os.path, time, sys, subprocess import chess, chess.polyglot, chess.pgn from spaced_repetition import * from chess_tools import * from bisect import bisect_left class MemoryMappedReaderWriter(chess.polyglot.MemoryMappedReader): '''Extends python-chess's polyglot memory mapped reader to a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Command line interface to the database """ # Global imports import datetime import os import numpy as np from pathlib import Path from prompt_toolkit.shortcuts import prompt from prompt_toolkit.styles import Style from prompt_toolkit.formatted_text import Formatted...
from typing import Optional, List import numpy as np import pygame import random import time import datetime FONT_NAME = 'inconsolata' FONT_SIZE = 15 COLOR_BACKGROUND_0 = pygame.Color(0x1e2320ff) COLOR_BACKGROUND_1 = pygame.Color(0x333333ff) COLOR_BACKGROUND_2 = pygame.Color(0x3f3f3fff) COLOR_FONT_NORMAL = pygame.Col...
import argparse import uuid import json import socket import os try: from urllib import quote # Python 2.X except ImportError: from urllib.parse import quote # Python 3+ import re import shutil import string import base64 from datetime import datetime # non standards, in requirements.txt from flask import Fl...
import numpy as np import ternary from ternary.helpers import simplex_iterator import matplotlib.pyplot as plt import pymatgen as mg import pandas as pd import re from model_eval import predict_interval def BCA_formula_from_str(BCA_str): """ Get chemical formula string from BCA string Args: BCA_st...
import warnings warnings.filterwarnings("ignore") import ftfy import matplotlib.pyplot as plt import nltk import numpy as np import pandas as pd import re from math import exp from numpy import sign from sklearn.metrics import classification_report, confusion_matrix, accuracy_score from gensim.models import KeyedVec...
#! /usr/bin/python3 # -*- coding: utf-8 -*- #-------------------------------------------------------------------------------------------------- # Script to count parallel phrases by the domain # # Usage: # count_para_domain_phrases.py [--data_prefix str] [--keyword str] [--dict str] [--thes str] # [--source_ngram...
# PURPOSE: Check images & report results: read them in, predict their # content (classifier), compare prediction to actual value labels # and output results import argparse from time import time, sleep from os import listdir from classifier import classifier # imoorting to use cnn images # Imports...
from __future__ import absolute_import, unicode_literals import signal import sys import pytest from case import Mock, patch from celery.bin.multi import MultiTool from celery.bin.multi import __doc__ as doc from celery.bin.multi import main from celery.five import WhateverIO class test_MultiTool: def setup(s...
# common.py import numpy as np import pandas as pd import matplotlib.pyplot as plt from matplotlib import ticker import matplotlib.dates as mdates import pathlib import requests import bs4 import re import statsmodels.api as sm import os import time import datetime import scipy.stats as stats from typing import List ...
# Copyright 2019 <NAME> # # 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, softw...
import dash_table from dash_table.Format import Format, Scheme, Symbol from itertools import chain import plotly.express as px import plotly.graph_objects as go from plotly.subplots import make_subplots import dash_daq as daq import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_c...
import os import re import math import threading from input.config_gen_file import * from script.run_steps import adwrap from script.calcu_addr import get_fstin_CHW, get_out_CHW, get_fc_in, find_count, find_type fmain = 0 chipnm = 0 netname = 0 layer_cnts = 0 actbit = wetbit = 0 def send_inoutbinvar(fw,...
# # This file is part of PyFOPPL, an implementation of a First Order Probabilistic Programming Language in Python. # # License: MIT (see LICENSE.txt) # # 20. Feb 2018, <NAME> # 22. Feb 2018, <NAME> # import enum ###########################################################################################################...
#%% from typing import * import numpy as np import matplotlib.pyplot as plt import seaborn as sns #%% import pandas as pd from dataset.our_dataset import * dataset = get_our_dataset() dataframe = pd.DataFrame.from_records([w.to_dict() for w in dataset]) #%% min_framerate = 11025 #%% import librosa import librosa.fea...
from __future__ import annotations import pathlib import tkinter as tk import typing from math import pi from tkinter import ttk from interface import general_functions from interface.material_and_measures import Distance, Force, WireMaterial class Note: """ A single note in an instrument, contains functions an...
from django.contrib import messages from django.contrib.auth.mixins import UserPassesTestMixin from django.db.models import F from django.forms import modelformset_factory from django.shortcuts import redirect from django.shortcuts import render from django.urls import reverse_lazy from django.utils.decorators import m...
"""PyStan-specific conversion code.""" from copy import deepcopy import re import numpy as np import xarray as xr from .inference_data import InferenceData from .base import requires, dict_to_dataset, generate_dims_coords, make_attrs class PyStanConverter: """Encapsulate PyStan specific logic.""" def __ini...
import os import torch import numpy as np from glob import glob import itertools from dataset import data_util import cv2 import util _COLOR_MAP = np.asarray([[0, 0, 0], [204, 0, 0], [76, 153, 0], [204, 204, 0], [51, 51, 255], [204, 0, 204], [0, 255, 255], [255, 204, 204], [102, 51, 0], [255, 0, 0], [102, 204, 0], [...
#!@PYTHON_EXECUTABLE@ # # MIT License # # Copyright (c) 2018, The Regents of the University of California, # through Lawrence Berkeley National Laboratory (subject to receipt of any # required approvals from the U.S. Dept. of Energy). All rights reserved. # # Permission is hereby granted, free of charge, to any person...
import os import sys import gzip import shutil import base64 import logging import optparse import mimetypes import subprocess from tempfile import mkdtemp, mkstemp try: import cssutils except ImportError: cssutils = None try: from urllib.parse import urlparse except ImportError: #python 2 from ur...
# -*- coding: utf-8 -*- import os import scipy.io as sio import numpy as np import time from sklearn import linear_model from sklearn import preprocessing from joblib import Parallel, delayed import statsmodels.formula.api as sm def Ridge_KFold_Sort_Permutation(Subjects_Data, Subjects_Score, Times_IDRange, Fold_Qua...
""" @author: <NAME> This file is the Fourier Neural Operator for 3D problem such as the Navier-Stokes equation discussed in Section 5.3 in the [paper](https://arxiv.org/pdf/2010.08895.pdf), which takes the 2D spatial + 1D temporal equation directly as a 3D problem changed using v1000 dataset """ #%% import paddle imp...
from django.core.management.base import BaseCommand from scoreboard.models import Source, Game, Player, Clan, Trophy, Achievement, Conduct from scoreboard.parsers import XlogParser from django.db import transaction from django.db.models import Sum, Min, Max, Count from tnnt import uniqdeaths import urllib import loggin...
# script that controls the computation procedure # first create the file params_gcc.txt and params.txt, which contain the preprocessor definitions and relevant parameters included in the Python script # then create pre-processed interpretable source files in the given subdir # then execute the Python program import os...
'''This gives a number of useful quick methods for dealing with VCF files. ''' __author__ = "<EMAIL>" __version__ = "PLACEHOLDER" __date__ = "PLACEHOLDER" import os, shutil, logging import pysam import util.file, util.misc log = logging.getLogger(__name__) def make_intervals(i, n, fasta, chr_prefix='', verbose=Fals...
""" todo: 1. put PJON-piper compiled binaries to /pjon_piper_bin/win /pjon_piper_bin/rpi OR maybe require setting PJON_PIPER_PATH ? solution: add binary (required path auto-discovery) but enable path overwriting 2. add "subprocess watchdog" to utils 3. add fakeredis client to utils or sk...
"""Flexp browser is a HTTP server for easier browsing of results of many experiments. Usage: flexp-browser --p <port> flexp-browser (-h | --help) Options: -h --help Show this screen. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals imp...
# ====================================================================================== # # For analyzing model results. # # Author : <NAME>, <EMAIL> # ====================================================================================== # from datetime import datetime from scipy.signal import fftconvolve from scipy...
# Copyright (c) 2017-present, Facebook, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
"""Utilities for unit tests""" import asyncio import functools import inspect import sys import unittest from unittest import mock from typing import (List, Tuple, Iterable, Coroutine, Awaitable, Optional, Type, Any, TypeVar, Generic) from types import TracebackType import aiokatcp import asynctes...
import re import math import pandas as pd import numpy as np import nltk import heapq import pickle import datetime from nltk.corpus import stopwords from operator import itemgetter # Loading the dictionary with open('dictionary.pkl', 'rb') as f: data = pickle.load(f) # Loading the dictionary with term count with...
from math import exp, pi from numpy.linalg import eig from scipy.optimize import fmin_cg from scipy.spatial.transform import Rotation from sklearn.datasets import load_breast_cancer, load_digits, load_iris from sklearn.decomposition import PCA, KernelPCA from sklearn.preprocessing import StandardScaler from sklearn.nei...
from time import perf_counter from os import chdir, getcwd import numpy as np import pandas as pd from plot import * class del_then_inter: def __init__(self, infile: str, has_imu: bool, conv_time: bool, plot_choice): self.df, _ = setup(infile, has_imu, conv_time) self.plot_choice = plot_choice ...
# -*- coding: utf-8 -*- """ This file solves COVID tweet sentiment classification problem. """ import pandas as pd import numpy as np import tensorflow as tf from sklearn.preprocessing import LabelEncoder import nltk import json import requests import re import string class Log: # Log helper class. LOG_LEVE...
import numpy as np import scipy.stats import sys def idx_to_rank_sum(idx, n): """Map from an integer idx to a value in the support of the Wilcoxon test statistic. Specifically, if S is the support of the test statistic, then this is a map from {0, ..., |S| - 1} -> S Parameters ----...
import logging import sys import os.path from uk_covid19 import Cov19API import json import sched import time from datetime import datetime import typing shed = sched.scheduler(time.time, time.sleep) pending_updates = [] #start def log()-> None: ''' Initiates logging with the logging file log.l...
import os,sys import torch,datetime,pickle,glob,yaml import numpy as np from models import ModelPanel from Data import Data import pandas as pd import copy import torch.nn as nn import time def load_c_panel(train_name, iteration, configs_to_update={},del_configs_key=['seq_length']): configs_path = os.path.join('...
from flask import Blueprint, render_template, redirect, url_for, flash from solarvibes import db from solarvibes.farm_settings.forms import FarmForm, FieldForm, PreNewCropForm, PreDateNewCropForm, NewCropForm, PreEditFarmForm, EditFarmForm from solarvibes.models import User, Crop, Farm, Field, Agrimodule from flask_log...
"""" cmd_manip.py a set of commands that NGenMud comes with that allows characters to manipulate various things. These commands are mostly directed towards manipulating objects (e.g. get, put, drop, etc...) but can also affect other things like exits (e.g. open, close) """ from cmd_checks import chk_can_manip import m...
'''1. Write a Rectangle class in Python language, allowing you to build a rectangle with length and width attributes. Create a Perimeter() method to calculate the perimeter of the rectangle and a Area() method to calculate the area of ​​the rectangle. Create a method display() that display the length, width, perimeter ...
import pytest from unittest.mock import patch, MagicMock import open_cp.predictors as testmod import open_cp.data import numpy as np def test_DataTrainer(): test = testmod.DataTrainer() with pytest.raises(TypeError): test.data = "string" test.data = testmod.data.TimedPoints([],[[],[]]) def test...
# pylint: disable=C0413, E1133 from typing import Literal import resource import sys from pathlib import Path import multiprocessing from unittest.mock import AsyncMockMixin import warnings from joblib import Parallel, delayed import numpy as np import numba from numba import prange import torch from scipy.cluster.v...
from subprocess import Popen, PIPE import sys,argparse,re #MIT License #Copyright (c) 2020 <NAME> (aka hyp3rlinx) #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, inc...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function from os.path import basename, abspath, join, exists import json import numpy as np import six import pandas as pd import ubelt as ub from .util import fnameutil from .util import imutil from .util import hashutil from clab import ...
import tensorflow as tf from keras import backend as K from keras.backend.tensorflow_backend import set_session from keras.callbacks import Callback, ReduceLROnPlateau from keras.callbacks import ModelCheckpoint, TensorBoard, CSVLogger from dataset_specific.prostate.generator import DataGenerator from dataset_specific...
#!/usr/bin/python # -*- coding: utf-8 -*- # ====================================================================== # Copyright 2016 <NAME> # # 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 # ...
# -*- coding: utf-8 -*- """Test suite for printing. """ # Standard library imports import os import pkg_resources as pkg import shutil import struct import sys import tempfile import unittest import uuid import warnings if sys.hexversion >= 0x03000000: from unittest.mock import patch from io import BytesIO, St...
import sqlite3 import math conn = sqlite3.connect('data.db') c = conn.cursor() calc = True def add_level(placement, name, creator): c.execute('SELECT placement FROM demons ORDER BY placement DESC') try: lowest_placement = int(c.fetchone()[0]) except: lowest_placement = 0 ...
from typing import List, Dict, Set, Any import logging import tkinter as tk from tkinter.ttk import Progressbar import tkinter.filedialog as tkfd import tkinter.messagebox as tkmb import tkinter.scrolledtext as tkst import pyboard as pyb import serial import serial.tools.list_ports import os import sys from io import S...
""" Generic setup.py file for PyObjC framework wrappers. This file should only be changed in pyobjc-core and then copied to all framework wrappers. """ __all__ = ("setup", "Extension", "Command") import os import pkg_resources import plistlib import shlex import shutil import subprocess import sys import tempfile im...
"""Plot Offline RL.""" import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt plt.style.use('seaborn') import seaborn as sns # Daniel: not sure if needed # https://stackoverflow.com/questions/43080259/ # no-outlines-on-bins-of-matplotlib-histograms-or-seaborn-distplots/43080772 plt.rcParams["patch.for...
""" 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 "License"); you may not use this ...
import os import tensorflow as tf from node import Node from tensor import Tensor # gpu_nodes = dict() dev_num = -1 nodes = [] cpu_nodes = dict() out_dir = './graph/' def _simplify_device_name(device): """/job:localhost/replica:0/task:0/device:CPU:0 -> /cpu:0""" prefix1 = '/job:localhost/replica:0/task:0/dev...
#!/usr/bin/env python # coding:utf-8 # Copyright (c) 2018 speaktech # # This application is released under the MIT License. # http://opensource.org/licenses/mit-license.php """This application translates your articles on Qiita into English ones with googletrans, and upload them to Qiita automatically. ...
# Copyright (c) 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """The request data track. When executed, parses a JSON dump of DevTools messages. """ import bisect import collections import copy import json import ...
import mne import mne_nirs import pandas as pd import numpy as np from mne_nirs.experimental_design import make_first_level_design_matrix from mne_nirs.statistics import run_glm from mne_nirs.channels import (get_long_channels, get_short_channels, pi...
import csv import math import numpy as np import sys import string from importlib import reload import xlsxwriter from Table import Table from clean import ColConverter def writeOnCSV(rows, filename): with open(filename, 'w', newline='') as f: writer = csv.writer(f) writer.writerows(rows) def ...
#!/usr/bin/python ''' Device pipeline for downloading, transforming to JSON and loading device recall data into Elasticsearch. ''' import csv import glob import os import re from os.path import dirname, join from urllib.parse import quote import arrow import luigi import numpy as np import pandas as pd import usa...
""" control_utils.py utility module for manipulating controllers """ # import standard modules import re # import local modules import read_sides import constraint_utils import name_utils # import custom modules from maya_utils import file_utils from maya_utils import object_utils from maya_utils import attribute_uti...
# import pygame as pg import pygame import ChessEngine import AI import tkinter as tk from tkinter import * from tkinter import simpledialog pygame.init() # # WIDTH = HEIGHT = 400 DIMENSION = 8 #8x8 SQ_SIZE = HEIGHT // DIMENSION # MAX_FPS = 15 # only from animation # IMAGES = {} # # def load_images(): pieces = [...