text
stringlengths
6.04k
39.5k
# Copyright (c) 2020 Graphcore Ltd. All rights reserved. import os import json import time import logging import tempfile import numpy as np from tqdm import tqdm from functools import partial import tensorflow.compat.v1 as tf from tensorflow.python.ipu import utils, ipu_compiler, scopes, loops from tensorflow.python.i...
from textwrap import TextWrapper presyms = [" 𝑡¹", " "] tw=TextWrapper(width=120, tabsize=2, # initial_indent=presyms[0], subsequent_indent=presyms[1], drop_whitespace=False, ) def implies_iterable_is_str_len1(v): if (v[0] in ("{","[","(") and isinstance(v[0],str) and len(v) > 1 and len(v...
__all__ = ( "make_common_async_setup_entry", "TNSEnergoEntity", "async_refresh_api_data", "async_register_update_delegator", "UpdateDelegatorsDataType", "EntitiesDataType", "SupportedServicesType", ) import asyncio import logging import re from abc import abstractmethod from datetime import...
#!/usr/bin/env python """ util.py contains support functions used in object detection Created 6/14/17. """ __author__ = "<NAME>" __email__ = "<EMAIL>" import numpy as np import tensorflow as tf from functools import reduce from collections import namedtuple from os.path import join, exists from cv2 import rectangle, ...
""" Won't show the details here, but if you are used to it's not that hard, you just need to find the definition of the API, read it, figure out what part of the request you need in the URL and what you need to put in the "payload", figure out how those _inputs_ of the request need to be formated, construct the URL and...
import numpy as np import pandas as pd # Import datasets # ATIS dataset atis_intents = pd.read_csv( 'https://raw.githubusercontent.com/cortmcelmury/chatbots/master/data/atis_intents.csv', header=None) atis_intents_test = pd.read_csv( 'https://raw.githubusercontent.com/cortmcelmury/chatbots/master/data/...
import discord import random import settings import sys import traceback from discord.ext import commands from discord.utils import get from cogs.utils import perms, inserts, querys, exceptions from cogs.utils.classes.weapon.weapons import weapon_dict match_rules = ["unranked", "whip", "ranked", "stake"] weapon_chec...
from __future__ import absolute_import import abc import os import uuid import typing as tp from datetime import datetime from ..__version__ import __version__ from ..utils import general_utils, ABC from . import logger from .agent_connector import AgentConnector from .errors import EyesError, NewTestError, DiffsFoun...
import os from abc import ABC, abstractmethod from typing import Dict, Union, List from ansible.errors import AnsibleParserError, AnsibleUndefinedVariable, AnsibleError from ansible.inventory.manager import InventoryManager from ansible.parsing.dataloader import DataLoader from ansible.parsing.yaml.objects import Ansi...
""" Functions for simple analysis of wells, including querying them using spatial functions (e.g. along a profile line or in a given radius) and calculating values (such as available drawdown) using existing data. """ import json import logging import math from typing import List, Optional, Dict, Union import requests...
""" AppShell provides a GUI application framework. This is an adaption of AppShell.py found in Python and Tkinter Programming by <NAME> which is a streamlined adaptation of GuiAppD.py, originally created by <NAME> (<EMAIL>). """ __all__ = ['AppShell'] from direct.showbase.DirectObject import DirectObject from direct....
# -*- coding=utf-8 -*- import math import torch import torch.nn as nn from utils.parse_config import parse_model_config def bbox_iou(box1, box2, x1y1x2y2=True, GIoU=False, DIoU=False, CIoU=False): # Returns the IoU of box1 to box2. box1 is 4, box2 is nx4 box2 = box2.T # Get the coordinates of bounding b...
"""Platform for sensor integration.""" from __future__ import annotations import logging import homeassistant.helpers.config_validation as cv import homeassistant.helpers.entity_registry as er import voluptuous as vol from homeassistant.components import ( binary_sensor, climate, device_tracker, fan,...
# # Copyright <NAME> 2009 # """ Code that counts the number of sequences for which a gapped PWM has at least one site in (using varying thresholds). """ import logging, sys, pylab as P, numpy as N, hmm, hmm.pssm.logo as L, infpy.roc as roc, cPickle from optparse import OptionParser from hmm.pssm import seq_to_numpy,...
""" Copyright (c) 2018-2021 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.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wri...
from torch.types import Number from util import get_onehot from iou import box3d_iou, get_3d_box import numpy as np import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable class PointEmb(nn.Module): def __init__(self, in_feat, out_feat, bn): super().__init__(...
import sys import os import subprocess import re import time from classes.ffmpeg import FFMpeg, FFProbe from CONFIG import ( CFFMPEG_STREAM, CFFMPEG_HOST, CFFMPEG_PORT, CFFMPEG_LEGLEVEL, CTMP_DIR, CENABLE_BITMAPSUBS ) ALWAYS_TRANSCODE = False ALWAYS_TRANSCODE_AUDIO = ALWAYS_TRANSCODE ALWAYS_TRANSCODE_VIDEO =...
import math import time import json import random from vehicle import Driver from controller import Supervisor from controller import Camera, GPS from controller import Receiver, Lidar, Radar,RadarTarget, Compass, TouchSensor import cv2 import numpy as np import pandas as pd from LaneKeeping import * from haversine imp...
import numpy as np from ...utils import mkvc import discretize import warnings def edge_basis_function(t, a1, l1, h1, a2, l2, h2): """ Edge basis functions """ x1 = a1 + t * l1 x2 = a2 + t * l2 w0 = (1.0 - x1 / h1) * (1.0 - x2 / h2) w1 = (x1 / h1) * (1.0 - x2 / h2) w2 = (1.0 - x1 / h1)...
""" Helpers for creating and interacting with clusters on Docker. """ import inspect import os import socket import subprocess import uuid from ipaddress import IPv4Address from pathlib import Path from shutil import copyfile, copytree, rmtree from tempfile import gettempdir from typing import Any, Dict, List, Optiona...
#!/usr/bin/env python """Configuration input panel for Agile. To do: - Add filter wheel support. - Support downloading every Nth image, or at least skipping images if we get behind. History: 2008-10-24 ROwen preliminary adaptation from DIS 2008-11-06 ROwen Removed unused detector controls; the rest is not yet f...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2019 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) """This module contains algorithms for the empirical interpolation of |Operators|. The main work ...
import pandas as pd import os, warnings, timeit import geopandas as gpd from sqlalchemy import create_engine # read the Intrado extract excel inpath = r'G:\projects\Address_Points\9-1-1_Net' file = 'LANEORX2May2021.xls' #selected_columns = ['ESN', 'STREET', 'CODE', 'LOW', 'HIGH', 'CITY'] selected_columns = ['ESN', 'DI...
#!/usr/bin/python -u ''' Created on Jan 24, 2014 Python script for scheduling GPU jobs. Runs as cron job on each machine separately. At some point in the future a GPU enabled HPC cluster with appropriate job scheduling software make takeover for this method. Script only intended to work in linux. Specify gpu with -...
""" Contains upsampling and resize layers """ import numpy as np import tensorflow.compat.v1 as tf from .layer import Layer, add_as_function from .conv import ConvTranspose from .core import Xip from ..utils import get_shape, get_num_channels, get_spatial_shape class IncreaseDim(Layer): """ Increase dimensional...
# Copyright 2018 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
import argparse import torch import torch.nn.functional as F from tqdm import tqdm import numpy as np import open3d as o3d import os import cv2 from core.homography import get_pixel_grids from core.nn_utils import bin_op_reduce from utils.io_utils import load_cam, load_pfm from utils.preproc import recursive_apply d...
from django.shortcuts import render, get_object_or_404 from joblistings.models import Job from jobapplications.models import JobApplication, Resume, CoverLetter, Education, Experience, Ranking from jobapplications.forms import ApplicationForm, resumeUpload, FilterApplicationForm from django_sendfile import sendfile imp...
# coding=utf-8 # Copyright 2018 Google LLC & <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 o...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.utils.encoding import force_text from django.core import serializers def old_to_new_questions(apps, schema_editor): Question = apps.get_model('editor', 'Question') NewQuestion = apps.get_model('editor'...
""" Module for loading PypeIt files """ import os import warnings import numpy as np from astropy import units from astropy.time import Time from astropy.io import fits from astropy.table import Table from linetools.spectra.xspectrum1d import XSpectrum1D from linetools.spectra.utils import collate import linetools.u...
from datetime import timedelta import math from crispy_forms.helper import FormHelper from django.conf import settings from django.contrib import messages from django.contrib.auth import get_user_model from django.contrib.auth.decorators import login_required, permission_required from django.contrib.auth.forms import ...
#!/usr/bin/env python3 # # Copyright (C)  2022  Intel Corporation.  # # This software and the related documents are Intel copyrighted materials, and your use of them is governed by the express license under which they were provided to you ("License"). Unless the License provides otherwise, you may not use, modify, co...
#!/usr/bin/env python3 ''' Plot the number of Github stars received over time for a user. Steps: 1. Get user's repo names from Github API 2. Get repo's star counts from Github API 3. Plot stars over time ''' import requests import matplotlib.pyplot as plt import matplotlib.dates as mdates import os import numpy as n...
import math import mxnet as mx from mxnext.tvm.decode_bbox import decode_bbox def _bbox_encode(F, ex_rois, gt_rois, means=[0., 0., 0., 0.], stds=[1., 1., 1., 1.]): """ decode bbox inputs: F: symbol or ndarray ex_rois: F, (#img, ..., 4) gt_rois: F, (#img, ..., 4) means: list, (4...
# multiAgents.py # -------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.berkeley.e...
from rest_framework import serializers from django.core.exceptions import ImproperlyConfigured try: from django.contrib.gis.db import models as model_fields from django.contrib.gis.geos import GEOSGeometry except (OSError, ImproperlyConfigured): from django.db import models as model_fields GEOSGeometry ...
""" plugin for signal secure msg Author: belze 0.0.1 initial version with sending support 0.0.2 receiving support via external service and update via JSON call 0.0.3 notification """ """ <plugin key="SignalMessenger" name="Signal Messenger via DBus" author="belze" version="0.0.3" externallink="https://github.co...
""" Manager and Serializer for Library Folders. """ import logging from typing import ( Optional, Union, ) from sqlalchemy.orm.exc import ( MultipleResultsFound, NoResultFound ) from galaxy import util from galaxy.exceptions import ( AuthenticationRequired, InconsistentDatabase, Insufficie...
#!/usr/bin/env python u""" esa_cryosat_ftp.py Written by <NAME> (03/2020) This program syncs Cryosat Elevation products From the ESA Cryosat ftp dissemination server: https://earth.esa.int/web/guest/-/how-to-access-cryosat-data-6842 https://earth.esa.int/web/guest/-/products-overview-6975 INPUTS: CryoSat-2 produc...
# -*- coding: utf-8 -*- from scrapy.spiders import Spider from scrapy.selector import Selector from scrapy import FormRequest from gorden_crawler.items import BaseItem, ImageItem, SkuItem, Color from scrapy import Request from scrapy_redis.spiders import RedisSpider from gorden_crawler.spiders.shiji_base import BaseSp...
import datetime import typing from base64 import b64encode from collections import defaultdict from functools import lru_cache, partial from io import BytesIO from discord_system_observer_bot.gpuinfo import get_gpus from discord_system_observer_bot.gpuinfo import ( _get_gpu_util, _get_gpu_mem_load, _get_gp...
# Copyright The IETF Trust 2011, All Rights Reserved import os import datetime import six from unidecode import unidecode from django.conf import settings import debug # pyflakes:ignore from ietf.doc.models import ( Document, State, DocAlias, DocEvent, SubmissionDocEvent, DocumentAuth...
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions a...
# Copyright 2013 Google Inc. All Rights Reserved. """Contains object representations of the JSON data for components.""" import datetime from googlecloudsdk.core.util import console_io from googlecloudsdk.core.util import platforms class Error(Exception): """Base exception for the schemas module.""" pass cla...
################## Melanoma Discrimator ##################### ### Created by <NAME> on Aug 11th, 2020 ### ### <EMAIL> ### ### Data Source: https://challenge2020.isic-archive.com/ ### ############################################################# # This file serves as th...
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015, 2016, 2017 <NAME> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as p...
from __future__ import division, print_function import numpy as np import sys from scipy.constants import c, pi from joblib import Parallel, delayed from mpi4py.futures import MPIPoolExecutor from mpi4py import MPI from scipy.fftpack import fftshift, fft import os import time as timeit os.system('export FONTCONFIG_PATH...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This file contains the experiments in the active scenario of [Haddenhorst2021]. In order to rerun these, UNCOMMENT in "Part 4" below the corresponding lines and then execute this file. [Haddenhorst2021]: <NAME>, <NAME>, <NAME> and E.Hüllermeier, Testification of Cond...
# Copyright 2009-2015 The TxMongo Developers. All rights reserved. # Use of this source code is governed by the Apache License that can be # found in the LICENSE file. from __future__ import absolute_import, division from bson.codec_options import DEFAULT_CODEC_OPTIONS from pymongo.errors import AutoReconnect, Config...
import discord from discord.ext import commands import auth_token import datetime import re class SurrenderAt20(commands.Cog): """Add or remove keywords to annouce from surrender@20 posts""" def __init__(self, bot): self.bot = bot self.cleanr = re.compile('<.*?>') # who a...
"""Test Api class""" from collections import OrderedDict import json import http import pytest from flask_smorest import Api, Blueprint from flask_smorest import etag as fs_etag from .conftest import AppConfig from .utils import get_responses, get_headers, get_parameters, build_ref class TestAPISpec: """Test A...
import pandas as pd import numpy as np import itertools import os from scipy import interpolate from matplotlib import pyplot as plt import matplotlib.ticker as ticker from mpl_toolkits.mplot3d import Axes3D ''' Get directory ''' dir_config = '/home/hector/ros/ual_ws/src/upat_follower/config/' dir_data = '/home/hector...
import datetime import enum import json import logging import os import pathlib import typing import xml.etree.ElementTree import peewee import playhouse.sqlite_ext as peewee_sqlite import objective_turk.color_logs import mturk CASCADE = "CASCADE" NO_ACTION = "NO ACTION" logger = logging.getLogger(__name__) logger....
# coding: utf-8 import sys, os rootPath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), "../")) sys.path.insert(0, rootPath) import numpy as np import argparse from tools.tfrecord_utils import _process_image_withoutcoder, _convert_to_example_simple import tensorflow as tf def __iter_all_da...
from __future__ import print_function import socket import struct import os import platform import time import sys import select import argparse import IP2Location from re import match from shutil import copyfile ICMP_ECHO = 8 ICMP_V6_ECHO = 128 ICMP_ECHO_REPLY = 0 ICMP_V6_ECHO_REPLY = 129 ICMP_TIME_E...
"""functional.py. Functional programming methods. Generally, functions are named by `verb-noun-qualifier` `verbs` **ignore** - returned function ignores certain elements of the iterator, returning an iterator of the remaining elements. **return** - returns the result of the function, rather than another iterator. *...
import cv2 import os import dill as pickle import copy from detectron2.engine import default_setup, DefaultPredictor from detectron2.config.config import get_cfg from detectron2.engine import default_argument_parser from liuy.utils.reg_dataset import register_a_cityscapes, register_coco_instances, \ register_coco_i...
"""Tuya devices.""" import datetime import logging from typing import Any, List, Optional, Tuple, Union from zigpy.quirks import CustomCluster, CustomDevice import zigpy.types as t from zigpy.zcl import foundation from zigpy.zcl.clusters.general import OnOff, PowerConfiguration from zigpy.zcl.clusters.hvac import Ther...
""" This file defines the global tree interface. """ import networkx as nx import numpy as np from functools import reduce from itertools import combinations from tqdm import tqdm from Bio import Phylo from cStringIO import StringIO from util import tree_cache class Tree(object): def __init__(self, root=None, co...
import os os.environ['TF_CPP_MIN_LOG_LEVEL']='2' import time import spatial_transformer import tensorflow as tf import utils import matplotlib.pyplot as plt import pdb import sys import numpy as np def plotting(entry, namer): #plotting plt.plot(range(len(entry)), entry) plt.ylabel(namer) plt.x...
import codecs import csv import datetime import os import pathlib import re import sqlite3 import sys import simplekml import magic import shutil from pathlib import Path from bs4 import BeautifulSoup class OutputParameters: '''Defines the parameters that are common for ''' # static parameters nl = '\n' ...
import tensorflow as tf from keras import backend as K from keras.models import Model from keras.layers import Conv2D, Dense, Activation, Input, UpSampling2D from keras.layers import concatenate, Flatten, Reshape, Lambda from keras.layers import LeakyReLU, MaxPooling2D import keras def my_conv(x_in, nf, ks=3, strides...
#!/usr/bin/env python from collections import defaultdict from slackclient import SlackClient from opsgenie.swagger_client import AlertApi from opsgenie.swagger_client import configuration from opsgenie.swagger_client.rest import ApiException from opsgenie.swagger_client.models import * from jira import JIRA import js...
#!/usr/bin/env python3 """Run tests in ./tests/platform_tests/tests/*.py and monitor results. This uses the configuration file "tests/platform_tests/config.tsv". Example: tests/platform_tests/run-platform-tests.py """ import argparse import importlib import json import os import subprocess as sp import sys impo...
import ctypes import struct import unittest import logging import time import mock from datetime import datetime from subprocess import Popen from os import path, kill import snap7 from snap7.snap7exceptions import Snap7Exception from snap7.snap7types import S7AreaDB, S7WLByte, S7DataItem from snap7 import util logg...
import datetime import traceback import discord import requests from colorama import Fore , Style # Common imports that can be used by the debugger. import requests import json import gc import datetime import time import traceback import re import io import asyncio import discord import random import subprocess from ...
import urllib.error import urllib.request import time import json from selenium.webdriver import Chrome, ChromeOptions from selenium import webdriver import sqlite3 import jieba from matplotlib import pyplot as plt from wordcloud import WordCloud from PIL import Image import numpy as np import os # 所有函数 # 爬取数据: # ge...
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns from sklearn.datasets import make_friedman1 from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor from statsmodels.formula.api import ols import sys import time sys.path.append('../') plt.style.use('ggplot...
# # Collective Knowledge # # See CK LICENSE.txt for licensing details # See CK COPYRIGHT.txt for copyright details # # Developer: <NAME> # cfg={} # Will be updated by CK (meta description of this module) work={} # Will be updated by CK (temporal data) ck=None # Will be updated by CK (initialized CK kernel) # Local s...
import os.path as osp import time from collections import defaultdict, namedtuple from functools import lru_cache import numpy as np from zqy_utils import Registry, TimeCounter, flat_nested_list, load from .table_renderer import TableRenderer Score_Fp_Precision = namedtuple("Score_Fp_Precision", ...
import torch import torch.nn as nn import torch.nn.functional as F from torch.nn import init from torchvision import models from torch.autograd import Variable from .backbones.resnet import * import numpy as np class WeightedAvgPooling(nn.Module): def __init__(self, num_ftrs=2048): super().__init__() self.num_ft...
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import sys import logging import git import tempfile import requests import contextlib import re from .actions.check_for_spdx_license import check_for_spdx_license from .actions.check_for_download_hash import check_for_download_hash from .actions....
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import pandas as pd import csv from netCDF4 import Dataset import numpy as np import numpy.ma as ma from collections im...
# Advanced Multi-Mission Operations System (AMMOS) Instrument Toolkit (AIT) # Bespoke Link to Instruments and Small Satellites (BLISS) # # Copyright 2009, by the California Institute of Technology. ALL RIGHTS # RESERVED. United States Government Sponsorship acknowledged. Any # commercial use must be negotiated with the...
""" Utility functions ================= """ from __future__ import annotations import logging import multiprocessing as mp import os import shutil import subprocess import sys from queue import Empty from typing import Any, Callable, Dict, List, Optional, Tuple, Union import ansiwrap import sqlalchemy from colorama ...
import mindspore.nn as nn import mindspore.ops as ops from mindspore.common import initializer as init #################################################################### # ------------------------- Discriminators -------------------------- #################################################################### class D...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2021 Huawei Device 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 # ...
from __future__ import division import sys import os sys.path.append(os.path.abspath(".")) sys.dont_write_bytecode = True __author__ = "COSAL" from mos.search.cacher import tfidf_cache from mos.search_store.code_store import CodeStore, ASTDistanceStore, ExecStore from mos.search_store.elastic_store import ContextSto...
import warnings from collections import defaultdict from pathlib import Path import numpy as np from sklearn.preprocessing import robust_scale from tqdm import tqdm import basty.utils.io as io import basty.utils.misc as misc from basty.experiment_processing.experiment_info import ExptRecord from basty.experiment_proc...
#!/usr/bin/env python ''' Parses input/output formats, manages transformations ''' import csv import re import sys from numpy import array import numpy as np import pandas as pd from pandas import * from . import config from . import distance from . import store from . import stats from . import HSIC def wrap_feat...
import uuid import os import io from autoslug import AutoSlugField from django.conf import settings from django.contrib.staticfiles import finders from django.contrib.sites.models import Site from django.core.files.storage import default_storage from django.db import models from django.template.loader import render_to...
#!/usr/bin/env python3 import argparse from collections import Counter import pdb import pickle import re import sys import time import numpy as np import torch import torch.nn as nn from torch.autograd import Variable from torch import optim import torch.nn.functional as F import torch.multiprocessing as mp import ...
"""Implements and manages all sub-problems""" import logging from abc import ABC import numpy as np from pyomo.core import ConcreteModel, Param, RangeSet, Var, ConstraintList, \ Objective, minimize, maximize from pyomo.core.expr.visitor import identify_variables, replace_expressions from pyomo.environ import Bina...
import torch import torch.nn as nn import torch.nn.functional as F from numpy.core.records import array from torch.autograd import Function from torch.nn.parameter import Parameter from torch_geometric.data import Data from torch_geometric.nn import GCNConv from torch_geometric.nn import global_max_pool as gmp from tor...
""" Non-physics convenience and mathematical functions. """ import numpy as np from scipy.interpolate import RegularGridInterpolator def arrays_equal(ndarray_list): """Checks if a list of arrays are all equal. Parameters ---------- ndarray_list : sequence of ndarrays List of arrays to compa...
from django.contrib import admin from import_export import resources from import_export.admin import ImportExportModelAdmin, ImportExportActionModelAdmin from .models import Worker, Job, JobStatus, JobChangeHistory, Game, WorkerAbsence from .models import RLPlannerParameter, WorkerLevel, WorkerSkill from datetime im...
import ldmud, os, subprocess, io, configparser import ldmud_asyncio, asyncio config = configparser.ConfigParser() config['git'] = {} config.read(os.path.expanduser('~/.ldmud-efuns')) gitconfig = config['git'] GIT_DOMAIN = gitconfig.get('domain', 'unitopia.de') def check_fname(path): if not len(path) or "/.." in...
#!/usr/bin/env python3 import adventofcode import functools import re import scipy.optimize def day1(s, n=2020): s = set(map(int, s.split('\n'))) def find(collection, desired_sum): return [x for x in collection if desired_sum - x in collection] for ans in find(s, n), [x for x in s if find(s - {x}, n - x)]: yie...
from builtins import next from itertools import chain from sqlalchemy.ext.compiler import compiles from sqlalchemy.inspection import inspect from sqlalchemy.sql.expression import ( ClauseElement, Executable) from rdflib import Namespace, URIRef, Graph from rdflib.namespace import NamespaceManager from sqla_rdfbri...
""" Dataset Specification Lookup information from the database about the data, particularly which files are contained in a specific dataset (defined by a `run` global flag) and what each correlator input is connected to. Dataspec Format =============== .. deprecated:: pass1 Use `run` global flag instead. A data...
import os import csv import random import cv2 import numpy as np import pandas as pd import matplotlib.pyplot as plt import matplotlib.image as mpimg from sklearn.utils import shuffle from sklearn.model_selection import train_test_split from keras.models import Sequential from keras.layers import Flatten, Dense, Lambda...
# Copyright (C) to <NAME>, <NAME>, <NAME>. All Rights Reserved. import numpy as np import torch from .util import as_tensor from .util import as_numpy _LINPROG_CENTRAL_PATH = [] def _collect_linprog_central_path(step, c, A_ub, b_ub, A_eq, b_eq, x, dx, t): global _LINPROG_CENTRAL_PATH if step == 0: ...
#!/usr/bin/python3 import base64 import hashlib import json import os # import pyudev import re import select import serial import serial.tools.list_ports import socket import struct import ssl import sys import threading import time import logging from barlink.receipts import ReceiptPrinter def readlines(sock, rec...
# newly added libarary, to insert delay to the program. # system python package load. import argparse import logging import os import sys import time import random import subprocess # Maching learning tool chain. import numpy as np import torch import wandb from fedavg_trainer import FedAvgTrainer import config from ...
# Driver for the Anyleaf pH, ORP, RTC, and conductivity modules from dataclasses import dataclass from enum import Enum, auto from typing import Optional, List, Union import struct import adafruit_ads1x15.ads1115 as ADS from adafruit_ads1x15.analog_in import AnalogIn from adafruit_max31865 import MAX31865 from filte...
import os import sys from typing import List, Union import numpy as np from cpylog import get_logger2 from pyNastran.converters.avl.control import Control from pyNastran.converters.avl.surface import Surface from pyNastran.converters.avl.body import Body AVL_KEYWORDS_LONG = [ 'SURFACE', 'COMPONENT', 'YDUPLICATE',...
import sys sys.path.append('../../../') import argparse from configurations import update_config import constants as cnst import tqdm import numpy as np import torch from dataset_loaders import fast_image_reshape from model.stg2_generator import StyledGenerator import os import constants from my_utils.visualize_flame_o...
from skimage import ( color, feature, filters, measure, morphology, segmentation, util ) import os import pandas as pd import numpy as np import skimage.color from scipy.sparse import coo_matrix from scipy.sparse import load_npz, save_npz from skimage.measure import label, regionprops import scanpy as sc import m...
import re import json import itertools import time from json import JSONDecodeError import logging from requests_html import HTMLSession, Element from requests import RequestException from urllib.parse import urljoin from typing import List from facebook_scraper.utils import make_html_element, decode_css_url logge...