text
stringlengths
3.07k
22.1k
import os import param import logging import cartopy.crs as ccrs from holoviews import Path from geoviews import Path as GeoPath from genesis.model import Model from genesis.util import Projection from .mesh import AdhMesh import holoviews.plotting.bokeh import geoviews.plotting.bokeh log = logging.getLogger('AdhMod...
import pystan import pickle as pickle from numpy import * from matplotlib import use use("PDF") import matplotlib.pyplot as plt from astropy.io import fits import argparse from scipy.interpolate import interp1d import time import astropy.io.ascii as ascii import subprocess def radectoxyz(RAdeg, Decdeg): x = cos(D...
#MIT License # #Copyright (c) 2017 <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, merge, publish, di...
# Copyright (c) 2014, <NAME> # Licensed under the BSD 3-clause license (see LICENSE.txt) import numpy from numpy.lib.function_base import vectorize from .lists_and_dicts import IntArrayDict from functools import reduce from .transformations import Transformation def extract_properties_to_index(index, props): prop...
import numpy as np import math import time import heapq import pandas as pd from random import * import matplotlib.pyplot as plt from sklearn import decomposition from sklearn.metrics import confusion_matrix from statistics import mode from tqdm import tqdm from matplotlib.patches import Rectangle from sklearn.model_...
from methods import * """This stub server developed under Flask (Python) allows you to respond to the various events raised by the SmartLib. It also offers the possibility of providing VAST / VMAP that can be published via API: - API '/vast/static/<id>': VAST / VMAP publication in XML format, specific and identified ...
import logging import warnings from docpie.element import Unit, Option, Required try: from io import StringIO except ImportError: try: from StringIO import cStringIO as StringIO except ImportError: from StringIO import StringIO __version__ = '0.0.1' logger = logging.getLogger('docpie.comp...
# -*- coding: utf-8 -*- from duckietown_utils import DuckietownConstants from duckietown_utils import get_list_of_packages_in_catkin_ws from duckietown_utils import on_circle, on_laptop from duckietown_utils import on_duckiebot from .checks import * # @UnusedWildImport from .entry import Diagnosis, Entry, SeeDocs fro...
from time import time from urllib2 import HTTPError import threading import os from pycoin.encoding import double_sha256 from coloredcoinlib.store import DataStore, DataStoreConnection, PersistentDictStore, unwrap1 from ngcccbase.services.blockchain import BlockchainInfoInterface from txcons import RawTxSpec from blo...
import sys import numpy import multiprocessing import csb.test as test import csb.bio.utils as cbu import csb.io X1 = numpy.array([ [ 0., 0., 0.], [ 1., 0., 0.], [ 0., 1., 0.]]) X2 = numpy.array([ [ 0., 0., 0.], [ 1., 2., 0.], [-2., -1., 0.]]) X3 = numpy.array([ [ 0., 0., ...
#!/usr/bin/env python3 import configparser from sources.Prerequisites import cPlusPlusPrerequisites, pythonPrerequisites, cPrerequisites, haskellPrerequisites, \ noPrerequisites from sources.CodingStyle import cStyle, haskellStyle, noStyle from sources.ApiLoader.ApiLoader import ApiLoader from configparser import ...
'''Create a COVID-19 safe desk use schedule for Cornell CS''' from collections import defaultdict, namedtuple from csv import DictReader, DictWriter from itertools import product from json import load as load_json from math import floor, sqrt from fire import Fire # type: ignore from yaml import FullLoader from yaml...
import discord from discord.ext import tasks from discord.ext.commands import Bot import re import json import asyncio from os import listdir from os.path import isfile, join from insta import * from operator import itemgetter from pprint import pprint browser, s = login() with open('swearsies.json', 'r') as f: s...
import math from copy import deepcopy import numpy as np from box import Box from numba import njit from deepdrive_zero.constants import CACHE_NUMBA, MAX_STEER_CHANGE_PER_SECOND, \ MAX_ACCEL_CHANGE_PER_SECOND, VEHICLE_WIDTH from deepdrive_zero.physics.bike_model import bike_with_friction_step @njit(cache=CACHE_N...
import pickle import hashlib import sys from torch.utils.data import Dataset import torch import copy from torch.utils.data import DataLoader import math from collections import Counter from datetime import datetime from kitanaqa.augment.term_replacement import * from kitanaqa import get_logger logger = get_logger() ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/10/23 20:18 # @Author : ganliang # @File : tf_perceptron.py # @Desc : 感知机y import os import numpy as np import pandas import tensorflow as tf import tensorflow.contrib.layers as layers from matplotlib import pyplot as plt from sklearn import datase...
# -*- coding: utf-8 -*- import types import unittest MAX_ITER = 10000000 class UnitTestTemplateGenerator(object): """ A class for generating barebones unit tests (templates to fill in), given a module """ DEFAULT_IGNORE_NAMES = ('__class__','__builtins__', '__doc__', '__file__', '__name__', '__p...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from...
# Copyright 2020 <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, software...
from panda3d.core import * from panda3d.direct import * from direct.fsm.FSM import FSM from direct.interval.IntervalGlobal import * from direct.distributed.DistributedObject import DistributedObject class Fixture(NodePath, FSM): def __init__(self, id, parent, pos, hpr, fov): NodePath.__init__(self, 'cam-%s...
import logging from fonduer.candidates.models import Candidate from fonduer.supervision.models import GoldLabelKey, Label, LabelKey from fonduer.utils.udf import UDF, UDFRunner from fonduer.utils.utils_udf import ( ALL_SPLITS, add_keys, batch_upsert_records, get_cands_list_from_split, get_docs_from...
import itertools import os from dbt.task.base import BaseTask from dbt.config import RuntimeConfig from dbt.adapters.factory import get_adapter from dbt.logger import GLOBAL_LOGGER as logger from dbt.clients import system from dbt.exceptions import RuntimeException _UNQUOTE_RENAME_COLUMNS = ( ('valid_from', 'db...
#!/usr/bin/env python u""" merra_smb_cumulative.py Written by <NAME> (01/2017) Calculates cumulative anomalies of MERRA-2 surface mass balance products INPUTS: SMB: Surface Mass Balance PRECIP: Total Precipitation RUNOFF: Meltwater Runoff COMMAND LINE OPTIONS: --help: list the command line options ...
import argparse import os from data import CIFAR10Dataset, Imagenet32Dataset from models.embedders import BERTEncoder, OneHotClassEmbedding, UnconditionalClassEmbedding import torch from models.pixelcnnpp import ConditionalPixelCNNpp from utils.utils import sample_image, load_model, sample_images_full from torch.optim ...
import tensorflow as tf import numpy as np import argparse import time from tqdm import tqdm import sys import os # Hacky way to include function from parent scripts this_code_path = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0,f'{this_code_path}/../../') from measure_end_to_end import log_e2e_perf d...
# BSD-3-Clause License # # Copyright 2017 Orange # # 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 the followi...
from unittest import mock import pytest from detect_secrets.core.secrets_collection import SecretsCollection from detect_secrets.settings import get_settings from detect_secrets.settings import transient_settings from testing.factories import potential_secret_factory @pytest.fixture(autouse=True) def configure_plug...
"""***************************************************************************************** MIT License Copyright (c) 2019 <NAME>, <NAME>, <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 So...
''' # Author: <NAME> # Data: 7/12/2021 Data retreiver for various charts Handles the MongoDB queries ''' #import pygal import requests # python3 -m pip install --user numpy pandas #import pandas as pd from pprint import pprint ''' Helper file to get data for temperature charting ''' import json from datetime import ...
import pandas as pd import numpy as np import datetime as dt from . import constants as constant from . import utils as util import logging from . import retrieve_data as rd import os import json from sklearn.model_selection import GridSearchCV from sklearn import linear_model from sklearn.linear_model import Logist...
import math import random import pdb #export MPLBACKEND=TKAgg import matplotlib #matplotlib.use('TkAgg') import matplotlib.pyplot as plt import numpy as np from tqdm import tqdm_notebook #from celluloid import Camera import phyre import csv import os import imageio def data_pic(tasks,simulator): for task_index...
import operator class InputDisabled(Exception): def __init__(self): super().__init__( "Input is disabled; cannot request user input without a default" ) class Log: """ Manage logging output driven by verbosity flags. """ DEBUG = 2 DEEP_DEBUG = 3 def __init__(...
""" Copyright: Intel Corp. 2018 Author: <NAME> Email: <EMAIL> Created Date: May 9th 2018 Updated Date: May 9th 2018 virtual file is an abstraction of a file or a collection of ordered frames """ from pathlib import Path from io import SEEK_END, BytesIO from PIL import Image import numpy as np from ..Util.Utility impo...
import sqlite3, secrets, string from passlib.hash import pbkdf2_sha256 from PIL import Image from twilio.rest import Client import os import piexif with open('twilio_key.txt', 'r') as keyfile: twilio_key = keyfile.read().replace('\n', '') with open('twilio_id.txt', 'r') as idfile: twilio_id = idfile.read...
import sys from collections import Counter from copy import deepcopy from logging import getLogger from typing import Optional, Dict, Any, Tuple, List, Set, Iterable import numpy as np import scipy.sparse as sp import sklearn logger = getLogger(__name__) class GcmcDataset(object): def __init__(self, ...
from __future__ import print_function from builtins import range import numpy as np from sklearn.base import BaseEstimator, clone from sklearn.utils.validation import check_X_y, check_array, check_is_fitted # from scipy.spatial.distance import cdist from sklearn.metrics.pairwise import pairwise_distances as cdist from...
"""empty message Revision ID: 7b6db31373a3 Revises: Create Date: 2017-04-25 13:12:54.741194 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '7b6db31373a3' down_revision = None branch_labels = None depends_on = None def upgrade(): # ### commands auto gene...
# Copyright 2022 The jax3d 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 wr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 25 17:48:00 2019 @author: usingh """ import os from pyrpipe.runnable import Runnable from pyrpipe import pyrpipe_utils as pu from pyrpipe import pyrpipe_engine as pe from pyrpipe import valid_args from pyrpipe import _dryrun from pyrpipe import _thr...
from __future__ import print_function """ pie - Python Interactive Executor Enables a user to execute predefined tasks that may accept parameters and options from the command line without any other required packages. Great for bootstrapping a development environment, and then interacting with it. """ __VERSION__='0.1.3...
import os import os import pickle import sys import numpy as np import torch import torchvision from PIL import Image from torchvision.datasets import VisionDataset from torchvision.datasets.utils import check_integrity, download_and_extract_archive class Cifar100(VisionDataset): base_folder = 'cifar-100-python'...
#!/usr/bin/env python # # Copyright (c) 2021, insigh.io # # 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 Ap...
# 2018-11-08 # prim-jarnik mst algorithm for undirected connected graph class PJVertex: def __init__(self, curr_id): self.curr_id = curr_id def getID(self): return self.curr_id class PJEdge: def __init__(self, v_o, v_d, weight): self.v_o = v_o self.v_d = v_d self.weight = weight def getOri...
#! /usr/bin/env python # -*- coding: utf-8 from __future__ import print_function import tensorflow as tf import numpy as np from pprint import pprint from param_collection import ParamCollection # Helper functions. def weight_variable(shape, stddev=0.1, initial=None): if initial is None: initial = tf.trunc...
"""Webserver module for mod_wsgi in Apache (e.g.) To use, create a virtualenv with precomputed-tif installed. Create a json file containing a list of sources to serve. Each source should have a "name" key, a "directory" key and a "format" key, e.g.: [ { "name": "expt1-dapi", "directory": "/data/expt1/...
import numpy from . import base from .engine import Literal from .iotools import save_map, load_map from nbodykit.lab import FieldMesh class Observable(base.Observable): def __init__(self, mapp, d, s, mapp2=None): self.mapp = mapp self.s = s self.d = d self.mapp2 = mapp2 def s...
import torch import time import numpy as np from timm.models.vision_transformer import trunc_normal_ from timm.models.registry import register_model from mmcv_custom import load_checkpoint from mmdet.utils import get_root_logger from ..builder import BACKBONES import math FLOPS_COUNTER = 0 class Conv2d_BN(torch.nn....
""" The GripNet is an efficient framework to learn node representations on heterogeneous graphs for the downstream link prediction, node classification, and visualization. The code is based on the `GripNet <https://github.com/NYXFLOWER/GripNet>`_ source repo. """ import torch import torch.nn.functional as F from torch...
import time import scipy.misc import numpy as np from math import floor, log import torch import torch.nn as nn from torch.nn import init from torch.autograd import Variable from torch.nn.functional import upsample import sys sys.path.append('flownet2-pytorch/networks') try: from submodules import * except Module...
from typing import Tuple import numpy as np import torch from torch import embedding, nn from deepspeed.pipe import PipelineModule, LayerSpec from transformers.models.gpt2.modeling_gpt2 import GPT2Block from transformers.models.gptj.modeling_gptj import GPTJBlock from transformers.models.gpt_neo.modeling_gpt_neo impo...
"""Wrappers around optimizers and utility functions for partially-specified optimization tasks. """ import abc import numpy as np import cma import scipy.optimize as spo def floatify(spec): """Takes a dictionary and tries to convert strings to a float """ for k in spec.iterkeys(): try: ...
import sys import numpy as np from scipy.linalg import expm np.set_printoptions(threshold=sys.maxsize,linewidth=1024) import itertools from colored import fg, bg, attr from qiskit.opflow import I, X, Z, Plus, Minus, H, Zero, One, MatrixOp from qiskit.compiler import transpile from qiskit import QuantumRegister, Quant...
# -*- coding: utf-8 -*- """Provide unified interfaces for optimization solutions for concentrations. Based on solution implementations in :mod:`cobra.core.solution` """ from cobra.util.solver import check_solver_status from numpy import array, exp, nan from optlang.interface import OPTIMAL from pandas import DataFra...
import os import errno import numpy as np import pdb from copy import deepcopy from miscc.config import cfg from torch.nn import init import torch import torch.nn as nn import torchvision.utils as vutils import torch.nn.functional as F from torch.autograd import Variable import re, inspect from torch import optim #...
import argparse import os import sys import time import sqlite3 from getpass import getpass from requests import RequestException from nautapy.exceptions import NautaException from nautapy.nauta_api import NautaClient, NautaProtocol from nautapy import utils from nautapy.__about__ import __cli__ as prog_name, __versi...
import logging import re from contextlib import contextmanager from pathlib import Path from typing import Iterator, List, Optional from filelock import FileLock from git import Actor, GitError, Repo from pygitops._util import checkout_pull_branch as _checkout_pull_branch from pygitops._util import get_lockfile_path ...
# coding=utf-8 from abc import ABCMeta, abstractmethod, abstractproperty from collections import namedtuple from flask import current_app, flash, redirect, request, session, url_for from flask.ext.security import login_user as flask_login_user from flask.ext.security.decorators import anonymous_user_required from fla...
import numpy as np import pandas as pd import csv import os from datetime import datetime class Console_export(object): def __init__(self, path): self.path = path + "_sim_summary.txt" def printLog(self, *args, **kwargs): print(*args, **kwargs) with open(self.path,'a') as file...
from unittest.mock import MagicMock, patch, PropertyMock from collections import Counter import pytest import numpy as np from xarray import DataArray from PyQt5.QtCore import Qt from PyQt5.QtTest import QTest from foamlight import mkQApp from foamlight.apps.camera_view import ( CameraView, CameraViewProcessor, ...
import os import json import sqlite3 from ..common import consts, error_message, file_read, file_write from ..server_classes import AdminTask, Group from .builder import on_created, init_task_attr from jam.db.db_modules import SQLITE, get_db_module import jam.langs as langs def create_items(task): info = file_rea...
#!python3 import numpy as np from typing import Tuple, List, Any try: import matlab.engine except ImportError: raise ImportError('Refer to magLabUtilities/docs/setupMatlabEngine to configure matlab.engine') from magLabUtilities.signalutilities.hysteresis import HysteresisSignalBundle from magLabUtilit...
import uuid from django.contrib.auth.models import Group from django.db import models from encrypted_model_fields.fields import EncryptedCharField from katka.auditedmodel import AuditedModel from katka.constants import ( PIPELINE_STATUS_CHOICES, PIPELINE_STATUS_INITIALIZING, RELEASE_STATUS_CHOICES, RE...
from .tools import __data_path__ from .tools import dd_format from scipy import interpolate import lmdb import pickle import matplotlib.pyplot as plt class DD: # Direct Detection measurements def __init__(self, limit_id=None, pattern=None, arxiv=None): self._data = None self._env = lmdb.open(...
# # Collaborative filtering with private preferences # # Model: # # - $V$: value # - $u_i$: user (row) vector # - $v_j$: item (row) vector # # $$V_{ij} = a_i + b_j + u_i v_j^T + x_i y_j^T + \epsilon$$ # # where $x_i^T y_j$ is the private information known to the user. # # At each time $t$, we select a random user $i$ a...
# coding: utf-8 # # Assignment 2 # # Before working on this assignment please read these instructions fully. In the submission area, you will notice that you can click the link to **Preview the Grading** for each step of the assignment. This is the criteria that will be used for peer grading. Please familiarize your...
from __future__ import division, print_function, absolute_import from warnings import warn import numpy as np from dipy.reconst.dti import fractional_anisotropy, color_fa from scipy.ndimage.filters import median_filter try: from skimage.filters import threshold_otsu as otsu except: from dipy.segment.thresho...
# Copyright 2022 DeChainers # # 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, so...
import numpy as np from bisect import bisect_left import argparse import pandas as pd from bokeh.io import output_file, output_notebook from bokeh.plotting import figure, show from bokeh.models import ColumnDataSource, Plot, LinearAxis, Grid, HoverTool, Legend, LegendItem, GlyphRenderer, Select, Slider from bokeh.mode...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Helper functions for the manual spike sorting GUI based on the t-sne of spikes Author: <NAME> <george dimitriadis uk> Version: 0.2.0 """ import numpy as np import scipy.interpolate as interpolate import os.path as op from six import exec_ im...
"""Work with the Q Learning processing.""" import numpy as np from PIL import Image import cv2 import matplotlib.pyplot as plt from matplotlib import style from typing import Collection, Union class QAgent: """Agent in the enviroment.""" def __init__(self, x: int, y: int): """Create a new agent at po...
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2007 <NAME> <<EMAIL>> # Copyright (C) 2007-2010 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://bitten.edgewall....
#!/usr/bin/env python3 """Ankdown: Convert Markdown files into anki decks. This is a hacky script that I wrote because I wanted to use aesthetically pleasing editing tools to make anki cards, instead of the (somewhat annoying, imo) card editor in the anki desktop app. The math support is via MathJax, which is more fu...
import Box2D from Box2D.b2 import (edgeShape, circleShape, fixtureDef, polygonShape, revoluteJointDef, contactListener) from copy import copy from teachDRL.gym_flowers.envs.utils.custom_user_data import CustomUserDataObjectTypes import numpy as np class WaterDynamics(object): def __init__(self, gravity, drag_mod=0...
#!//opt/bin/lv_micropython -i """SSD1351 demo (shapes).""" import lvgl as lv import display_driver from utime import sleep from math import cos, sin, pi, radians, floor from lv_colors import lv_colors,LV_COLOR_MAKE disp = lv.scr_act().get_disp() CANVAS_WIDTH = disp.driver.hor_res CANVAS_HEIGHT = disp.driver.ver_res p...
# -*- coding: utf-8 -*- # @Author:FelixFu # @Date: 2021.12.17 # @GitHub:https://github.com/felixfu520 # @Copy From: https://github.com/xiahaifeng1995/PaDiM-Anomaly-Detection-Localization-master/blob/main/main.py import os import pickle import random from random import sample from tqdm import tqdm from collections impo...
import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.data import Dataset, DataLoader import torchvision.models as torch_models import os.path as osp import os import time from datetime import datetime from collections import defaultdict as dd import utils impo...
# std lib from functools import partial from typing import Union # 3rd-party try: import cupy except ImportError: class cupy(object): ndarray = False import dask.array as da from numba import cuda import numpy as np import xarray as xr # local modules from xrspatial.utils import cuda_args from xrsp...
import copy import glob import os import time import pickle from collections import deque import gym import gym_compete import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from a2c_ppo_acktr import algo, utils from a2c_ppo_acktr.algo import gail from a2c_p...
# # Copyright 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
import pandas as pd import numpy as np import matplotlib.pyplot as plt import argparse def _3d_series_electrons(): """Returns first transition period / 3d series data: curves points, elements symbol, Z range, principal quantum number, annotation coordinates. Returns ------- tuple curves ...
# -*- encoding: utf-8 -*- from openerp.osv import fields,osv from openpyxl.reader.excel import load_workbook from openerp import tools import os import re class product_tmalljd(osv.osv): _name = "product.tmalljd" #_inherits = {'product.product': 'product_id'} def _get_ean13(self, cr, uid, ids, field_name...
from gensim.models.keyedvectors import KeyedVectors from gensim.test.utils import get_tmpfile from gensim.scripts.glove2word2vec import glove2word2vec from gensim.models import FastText import tensorflow as tf from tensorflow.contrib import rnn import numpy as np def get_dataset(input_x, input_y, FLAGS): dataset =...
import sys from mpi4py import MPI from model_checking import * def sim_ET_EW_Prqing(d): sching_m['threshold'] = d sim_m = sim(sinfo_m, mapping_m, sching_m, "N{}_C{}".format(N, Cap) ) # blog(sim_m=sim_m) return sim_m['responsetime_mean'], sim_m['waittime_mean'], sim_m['frac_jobs_waited_inq'] def plot_ET_wrt_d...
#!/usr/bin/env python import contextlib import re, os from zipfile import ZipFile from configparser import ConfigParser from .befundparser import getOtherAlleles from .coordinates import getCoordinates from .enaemailparser import parse_embl_response from .imgt_text_generator import make_imgt_text from .errors import ...
""" Reserve slots for teams. This module reserve slots for teams that have several competitors in the same brackets. In order to keep track of already existing team pairings it uses a dictionary: team_pairing_count. Is a dictionary of ordered tuples (min, max), with the count of times that...
from __future__ import print_function, division from collections import defaultdict import json import os import random import gensim import h5py import numpy as np import torch from torch.utils.data import DataLoader, Dataset, RandomSampler from torchvision import transforms from loader.transform import Lowercase, ...
import operator import numpy as np from refnx.analysis import GlobalObjective, Objective from refnx.analysis.parameter import ( constraint_tree, build_constraint_from_tree, Constant, ) from refnx._lib import flatten import refnx _imports = f"""#!/usr/bin/env python ''' Script exported by refnx for analy...
import json import datetime import pytz import sys import random import hashlib from io import StringIO from django.shortcuts import render, get_object_or_404 from django.http import HttpResponseRedirect, HttpResponse from django.conf import settings from django import forms from django.utils import timezone from dj...
from rsttace.controller import IRstInput from rsttace.core import RstTree, RstType, RstNode from rsttace.core.rsttree import MonoNucRelation, MultiNucRelation, Span from errno import ENOENT from os import strerror from os.path import isfile import xml.etree.ElementTree as et from collections import defaultdict class...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Based on https://github.com/qetza/vsts-replacetokens-task - Copyright (c) 2016 <NAME> import argparse import fileinput import sys, os import re import codecs import shutil import tempfile import logging from pathlib import Path import locale parser = argparse.ArgumentPa...
''' Copyright © 2019 <NAME> Darkcity ''' import sys try: import pygame except: print("pygame is not installed. run pip install pygame") import math from random import randint, random from pygame import draw import time from pygame import gfxdraw import drawtile from drawtile import drawBuilding, ...
# Copyright 2016 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
import tensorflow as tf from .core import TFFMCore from sklearn.base import BaseEstimator from abc import ABCMeta, abstractmethod import six from tqdm import tqdm import numpy as np import os def batcher(X_, y_=None, batch_size=-1): """Split data to mini-batches. Parameters ---------- X_ : {numpy.arr...
#!/usr/bin/python3 #coding: utf8 import discord import youtube_dl import time import asyncio import typing import os from discord.ext import commands from googleapiclient.discovery import build TEMP_BANLIST = dict() ADMIN_ROLE = int(os.environ.get('ADMIN_ROLE')) youtube = build('youtube', 'v3', developerKey=os.envir...
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: victor # @Date: 2014-01-12 # @Last Modified by: victor # @Last Modified time: 2014-06-05 # @Copyright: # # This file is part of the AppVulnMS project. # # # Copyright (c) 2014 <NAME> <info AAET dornea DOT nu> # # Permission is hereby granted, free of...
# -*- coding: utf-8 -*- """A library to make psychrometric charts and overlay information in them.""" import json import logging import os from pathlib import Path from time import time from typing import Callable, Dict, List, Optional, Tuple, Union import numpy as np NUM_ITERS_MAX = 100 path_styles = Path(__file__)...
""" _ __ ___b o u n c e___ __ _ a Pong knock off by <NAME>. project started March 16th, 2018. """ # ~ ~ ~ ~ MODULES & SET UP ~ ~ ~ ~ ~# import sys, pygame as game, get_image_size as image, random from functions import * from menu_screen import game_mode game.init() graphics_pat...
import typing class OPERATION: OP_EQ = "=" OP_NE = "!=" OP_GE = ">=" OP_GT = ">" OP_LE = "<=" OP_LT = "<" OP_IN = "in" OP_NOT_IN = "not in" OP_LIKE = "like" OP_NOT_LIKE = "not like" OP_PREFIX = "prefix" OP_NOT_PREFIX = "not prefix" OP_SUFFIX = "suffix" OP_NOT_SU...
"""" """ from __future__ import print_function import datetime import os import random import sys import time from byteblowerll.byteblower import ByteBlower, DeviceStatus, ConfigError from byteblowerll.byteblower import NetworkInterfaceType configuration = { # Address (IP or FQDN) of the ByteBlower server to ...
#Tarea 3 #Lenguaje Python 3.7 import random class Process: PID=str() t=0 t_A=0 def __init__(self,PID,tiempo_req): self.PID=PID self.t=tiempo_req def getPID(self): return self.PID def getT(self): return self.t def tpp(self): self.t_A+=1 def isCompl...