text
stringlengths
6.04k
39.5k
import logging import sys import time import sklearn.cluster import cv2 import numpy as np import itertools import random from threading import Thread from config.config import * from sensors.pipeline import Pipeline from utils.functions import overrides, get_class_name, current_time_millis, deprecated from scipy.int...
#!/usr/bin/env python """ Purpose: Handling intersectbed (-wo) report of two bed12 first bed12 is PacBio Iso-seq bed (converted from bam) second bed12 is Gtf bed (converted from gtf or v3.gtf) gtf versionA is FlyBase gtf gtf versionB is updated v3 gtf potential interesting region dmel...
import tensorflow as tf from .homographies import warp_points from .backbones.vgg import vgg_block def detector_head(inputs, **config): params_conv = {'padding': 'SAME', 'data_format': config['data_format'], 'batch_normalization': True, 'training': config['training'], ...
from __future__ import unicode_literals import frappe from frappe import scrub from textwrap import wrap from frappe.utils import add_to_date, nowdate, nowtime from datetime import timedelta from frappe.model.mapper import get_mapped_doc from frappe.utils import flt from frappe import _ # from erpnext.accounts.utils ...
class MainData: class Block: def __init__(self, size): self.size = size self.tuples = [None] * size self.numtuples = 0 def __getitem__(self, idx): return self.tuples[idx] def __setitem__(self, idx, t): self.tuples[idx] = t ...
""" Do a likelihood fit. The class NestedSamplerStatModel is used for fitting applying the bayesian algorithm nestle/multinest """ from __future__ import absolute_import, unicode_literals import datetime import json import os import shutil import tempfile from warnings import warn import corner import matplotlib.pyplo...
import torch from torch.utils.data import Dataset from .collaters import * import json import pickle import os import glob import sys from musa.ops import * from .utils import * import timeit import struct import numpy as np import multiprocessing as mp from sklearn.cluster import KMeans import copy def read_aco_file...
# Copyright (c) 2019 Platform9 Systems 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 ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Script for conversion of Stardict tabfile (<header>\t<definition> # per line) into the OPF file for MobiPocket Dictionary # # For usage of dictionary convert it by: # (wine) mobigen.exe DICTIONARY.opf # or now... # kindlegen DICTIONARY.opf # # MobiPocket Reader at: www...
# -*- coding: utf-8 -*- """ Created on Sat Mar 2 17:02:36 2019 @author: Chandar_S """ #%% from sklearn import model_selection, preprocessing, linear_model, naive_bayes, metrics, svm from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer from sklearn import decomposition, ensemble import pandas,...
import os import subprocess import time from datetime import datetime import math import getpass username = getpass.getuser() file_names = [] file_content_locator = [] file_sizes = [] file_system_name = 'FIUNAMFS' file_system_version = '0.7' volume_tag = 'FIUNAMFS.img' cluster_length = '512' num_of_clusters_dir = '4'...
import pickle import numpy as np import os import scipy.sparse as sp import torch from scipy.sparse import linalg from prettytable import PrettyTable class DataLoader(object): def __init__(self, xs, ys, batch_size, pad_with_last_sample=True): """ :param xs: :param ys: :param batch_...
from enum import Enum from collections import namedtuple import tvm import tvm.te as te import tvm.tg as tg import tvm.tir as tir import numpy as np def pprint_dict(d): import json print(json.dumps(d, indent=2, sort_keys=False)) def get_vector_add(n): """TVM expression for vector add""" A = te.placeholder...
import dataclasses import functools import itertools import logging import os from kubernetes.dynamic.exceptions import ResourceNotFoundError, ConflictError from kluctl.deployment.apply_util import ApplyUtil from kluctl.deployment.images import SeenImages from kluctl.deployment.kustomize_deployment import KustomizeDe...
import sys import requests from requests.exceptions import HTTPError import os import multiprocessing import time import queue from ddsc.core.localstore import HashUtil from ddsc.core.ddsapi import DDS_TOTAL_HEADER from ddsc.core.util import humanize_bytes, transfer_speed_str SWIFT_EXPIRED_STATUS_CODE = 401 S3_EXPIRED...
# coding: utf-8 import operator import enum import threading import wx import wx.lib.sized_controls as sc import more_itertools from collections import namedtuple from itertools import chain from bookworm import config from bookworm.reader import EBookReader from bookworm.document.operations import SearchRequest from ...
# vim: sw=4:ts=4:et:cc=120 # # various utility functions # import collections import datetime import functools import json import logging import os, os.path import re import signal import tempfile import urllib import saq from saq.constants import * import psutil import pytz import requests CIDR_REGEX = re.compile(...
import numpy as np import tensorflow as tf from tensorflow.python.util import nest import tensorflow.contrib.layers as layers import tensorflow.contrib.rnn as rnn import tensorflow.contrib.cudnn_rnn as cudnn_rnn RNN = cudnn_rnn.CudnnGRU GRAD_CLIP_THRESHOLD = 10 # input pipe utils def cut( ts_value_train_slice, ...
import os import sys import random import warnings import math import numpy as np import pylab import scipy.ndimage as ndi from concurrent.futures import ThreadPoolExecutor import PIL from PIL import Image, ImageDraw from tqdm import tqdm def autoinvert(image): assert np.amin(image) >= 0 assert np.amax(imag...
from scrapper import * from scrapper import Scrapper import selenium ## Para el page down en el infinite scroller from selenium.webdriver.common.keys import Keys import datetime ## Las siguientes librerías son para el leído del archivo de Excel en donde estarán las páginas a Scrappear ## No hagan lo que estas personas...
#<NAME> & <NAME> - QuizTime © import tkinter as tk root = tk.Tk() root.title("Python Quiz By <NAME>") root.geometry("1000x500") root.configure(background='gray', borderwidth=2, relief="solid") score = 0 photoplay = tk.PhotoImage(file = r"C:\QuizTime\Play.png") photoimage1 = photoplay.subsample(5, 5) photocredits = tk...
#!/usr/bin/python -S """Utils for hostapd and wpa_supplicant configuration.""" import ctypes import subprocess # pylint: disable=g-bad-import-order import autochannel import experiment import utils crypto = ctypes.CDLL('libcrypto.so') EXPERIMENTS = [ 'NoSwapWifiPrimaryChannel', # checked by hostapd itself ...
## Copyright (c) 2017 <NAME> GmbH ## All rights reserved. ## ## This source code is licensed under the MIT license found in the ## LICENSE file in the root directory of this source tree. import torch import torch.nn as nn import torch.nn.functional as F from torch import optim import numpy as np from torch.nn.utils im...
from player import Player from card import Card from util import Util util = Util() class JamesBond(Player): def __init__(self): # Constants self.c = {} self._generate_constants() # Game data self.name = '<NAME>' self.opponents = {} self.pot_evs = {} ...
import base64 import datetime import errno import os import shutil import pdb import uuid import logging import re import requests import json from django.contrib import auth, messages from django.contrib.sites.shortcuts import get_current_site from django.conf import settings from django.core.exceptions import (Permi...
#!/usr/bin/env python3 import os, logging import pandas as pd from pathlib import Path import numpy as np from scipy.interpolate import interp1d from bins_and_cuts import obs_cent_list, obs_range_list # fully specify numeric data types, including endianness and size, to # ensure consistency across all machines float_...
import random import pyglet import logging import os import glob import math from functions import * from actor import Actor, Hand from stats import StatSystem from animations import HandAnimAttack, HeadBobbing, Pulse from load_config import ConfigSectionMap as load_cfg import abilities ROOT = os.path.dirname(__file__)...
import math import srwlib import numpy as np from srwlib import * def createGsnSrcSRW(sigrW,propLen,pulseE,poltype,phE=10e3,sampFact=15,mx=0,my=0): """ #sigrW: beam size at waist [m] #propLen: propagation length [m] required by SRW to create numerical Gaussian #pulseE: energy per pulse [J] #poltyp...
""" unified file system api """ # py.path.common class NeverRaised(Exception): pass class PathBase(object): """ shared implementation for filesystem path objects.""" def basename(self): """ basename part of path. """ def dirname(self): """ dirname part of path. """ def purebase...
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Modifications copyright (C) 2019 <NAME> # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complia...
import logging import re from dataclasses import replace from typing import Any, List, Mapping, MutableMapping, Optional, Sequence, Tuple from snuba import environment from snuba.clickhouse.escaping import NEGATE_RE from snuba.datasets.dataset import Dataset from snuba.datasets.entities.factory import get_entity from ...
from django.contrib.auth import get_user_model from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpRequest, HttpResponse from django.test import TestCase from swingers.sauth.decorators import crossdomain from swingers.sauth.models import ApplicationLink from swinge...
#!/usr/bin/python # hmmmSimulator.py # # $Id: hmmmSimulator.py,v 1.4 2007/10/08 08:10:12 geoff Exp $ # # <NAME>, 2006 # modified by <NAME>, June 2006 # extensively modified by <NAME>, October 2007 import sys, string, re from binary import * from functools import reduce memory = [0]*256 # 256 words of memory. ...
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
"""Download Adwords reports based on a JSON input and upload directly to either FTP or Titan's blob storage. Request a report per client customer ID via the Adwords API and directly upload to a single file. For more detail, execute the following at the command prompt: adwordsreportdownloader --help """ import date...
import logging import numpy as np import torch from torch import nn from torch.nn import functional as F from typing import Dict, List, Optional, Tuple, Union from detectron2.config import configurable from detectron2.layers import Linear, ShapeSpec, batched_nms_rotated, cat, nonzero_tuple from detectron2.structures i...
#!/usr/bin/env python # coding: utf-8 # # CODI Prevelance Query (PQ) Results Visualization # # # ## Background - PQ algorithm # # [CODI-PQ](https://github.com/NORC-UChicago/CODI-PQ) is a program for weight-status-category prevalence based on BMI, and results can be stratified by age, sex, race and geography. PQViz ...
#!/usr/bin/env python # coding: utf-8 from WeightedBCEDICELoss import WeightedBCEDICE from SegmentationMetric import SegmentationMetric from FocalLoss import FocalLoss import argparse import os from mxnet.gluon import loss as gloss, data as gdata, utils as gutils import sys import time import multiprocessing from mx...
#DCGAN train and generate # 1. train # 2. generate import tifffile import h5py import torch.utils.data from torch import Tensor from os import listdir from os.path import join import numpy as np import torch import torch.nn as nn import torch.nn.parallel import os import random import torch.backends.cudnn as cudnn impo...
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from .utils import GTextToolbar from PyQt5.QtWidgets import QWidget, QHBoxLayout, QVBoxLayout, QFrame, QComboBox, \ QCheckBox, QLineEdit, QPushButton, QLabel, QGridLayout, \ ...
import torch import torch.nn as nn from diff_aug import DiffAugment class MLP(nn.Module): def __init__(self, in_feat, hid_feat=None, out_feat=None, dropout=0.): super().__init__() if not hid_feat: hid_feat = in_feat if not out_feat: out_feat = in_fe...
import os from os import path import sys from sys import stderr, exit import argparse from re import match from weakref import WeakKeyDictionary from hashlib import sha224 from re import sub import importlib import string import pandas import pydot import pypandoc # Descriptors # The base for this (descriptors instea...
""" FRODO: a FRamework for Open/Distributed Optimization Copyright (C) 2008-2013 <NAME>, <NAME> & <NAME> FRODO is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your ...
''' Author: <NAME> Project: deeppop Purpose: Model Builder - should have this component that stores all kinds of candidate models. Improvements needed: (/) - For VAE, try to bring custom loss with KL divergence in ''' from keras import objectives from keras.models import Model, Sequential from keras.layers i...
#!/usr/bin/env python3 # vim: fileencoding=utf-8 expandtab ts=4 nospell # SPDX-FileCopyrightText: 2020-2021 <NAME> <<EMAIL>> # # SPDX-License-Identifier: BSD-2-Clause """ Abstract class and Model implementation for basic Tables in the ORM system. Tables store an array of fields. """ from __future__ import annotatio...
# === Start Python 2/3 compatibility from __future__ import absolute_import, division, print_function, unicode_literals from future.builtins import * # noqa pylint: disable=W0401, W0614 from future.builtins.disabled import * # noqa pylint: disable=W0401, W0614 # === End Python 2/3 compatibility import pytest impo...
from stenway.reliabletxt import * class WsvChar: def isWhitespace(c): return (c == 0x09 or (c >= 0x0B and c <= 0x0D) or c == 0x0020 or c == 0x0085 or c == 0x00A0 or c == 0x1680 or (c >= 0x2000 and c <= 0x200A) or c == 0x2028 or c == 0x2029 or c == 0x202F or c == 0x205F or ...
# Copyright (c) 2013, Analytics Pros # 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 and the ...
# Copyright 2014: Mirantis Inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required b...
import time everything_start_time = time.time() import os import subprocess import json import argparse import cv2 import numpy import SRers parser = argparse.ArgumentParser() # Input/output file parser.add_argument('-i', '--input', # Input file type=str, help='path of vid...
import math import numpy as np import pandas as pd import tqdm from scipy.sparse import coo_matrix from typing import List, Optional import matplotlib from matplotlib import pyplot as plt import matplotlib.patches as patches from matplotlib.path import Path from matplotlib.collections import PathCollection import matp...
""" Validators library """ import re from typing import Any from .ctx import Context class ValidatorMetaclass(type): def __new__(cls, name, bases, classdict): error_code_map = {} error_messages = {} message_values = {} for base in reversed(bases): try: ...
#!/usr/bin/python # Copyright: (c) 2018, <NAME> <<EMAIL>> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: mongodb_replicaset short_description: Initiali...
# stream latches out to the console through TASHA. # Latch format is an (n, C) uint16 numpy ndarray, where n is the number of # latches in the array and C is the number of controllers. The controller order # is set by the controllers list passed to the LatchStreamer constructor. The # list is a list of strings (descri...
#! /usr/bin/env python """ Reads Darknet config and weights and creates Keras model with TF backend. """ import argparse import configparser import io import os from collections import defaultdict import math import numpy as np from keras import backend as K from keras.layers import (Conv2D, Input, ZeroPadding2D, Add...
from __future__ import annotations import argparse import json import typing import attr import requests import tabulate from bs4 import BeautifulSoup from pathlib import Path import tqdm from imdb import ImdbMovieSet, ImdbMovieInfo, normalize_movie_name FIREFOX_USER_AGENT = \ 'Mozilla/5.0 (Macintosh; Intel Mac...
import argparse import multiprocessing from queue import Empty import random import time import os import re import glob import pickle import numpy as np import time import pommerman from pommerman.agents import BaseAgent, SimpleAgent from pommerman import constants from keras.models import Model, load_model, model_f...
from logutils import * import re from subprocess import getstatusoutput import os __author__ = 'jinzhao' def version(): return '1.0.0' def symbolicate_crash(crash_log, finder_func, output_path=None, verbose_mode=False): """ 符号化crash日志 :param crash_log:crash日志文件路径 :param finder_func:查询app符号文件的处理函数...
""" Handlers for video module. StudentViewHandlers are handlers for video module instance. StudioViewHandlers are handlers for video descriptor instance. """ import json import logging import math from django.core.files.base import ContentFile from django.utils.timezone import now from edxval.api import create_exte...
# author: <NAME> from p5 import * import sympy as sym import mpmath as mp import numpy as np from tkinter import Tk from scipy.spatial import distance import PIL from PIL import Image import argparse import os import csv import mimetypes DEBUG = False parser = argparse.ArgumentParser( description='Custom frame an...
#================================================================ # # File name : BipedalWalker-v3_PPO # Author : PyLessons # Created date: 2020-10-18 # Website : https://pylessons.com/ # GitHub : https://github.com/pythonlessons/Reinforcement_Learning # Description : BipedalWalker-v3 PPO co...
import numpy as np import mpmath DECIMALS = 60 mpmath.mp.dps = DECIMALS def jacobi_alpha(n): if n < 0: return 0 half = mpmath.mpf('.5') return (2*n*(n+half)-mpmath.mpf('.25')) / ((2*n+mpmath.mpf('1.5'))*(2*n-half)) def jacobi_beta(n): if n <= 0: return 0 half = mpmath.mpf('.5') ...
import json import os.path import struct from os import path from os.path import join import pathlib import re import numpy parent_dir = pathlib.Path(__file__).parent.resolve() code_dir = parent_dir.parent data_dir = code_dir.parent # collect ecat header maps, this program will not work without these as ECAT data var...
# Copyright 2018 Capital One Services, 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 agreed to in...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence class BiLSTM(nn.Module): def __init__(self, hidden_size, vocab_size, class_num=1, layer_num=3): super(BiLSTM, self).__init__() self.H = hidden_size self...
from .header import * from .base import RetrievalBaseAgent from .dual_bert import BertEmbedding '''Deep Hashing for high-efficient ANN search''' class DualBert(nn.Module): '''dual bert only for inference''' def __init__(self): super(DualBert, self).__init__() self.ctx_encoder = BertE...
# Version: 2020.02.21 # # MIT License # # Copyright (c) 2018 <NAME> and <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 ri...
""" I/O for FLAC3D format. """ import logging import struct import time import numpy from ..__about__ import __version__ as version from .._common import _pick_first_int_data from .._exceptions import ReadError, WriteError from .._files import open_file from .._helpers import register from .._mesh import Mesh meshio...
r""" Functional interface (quantized).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import torch from torch._jit_internal import List as _List from torch.nn.modules.utils import _pair, _triple # Although some of...
""" Platformer Game python -m arcade.examples.platform_tutorial.11_animate_character """ import math import os import arcade # Constants SCREEN_WIDTH = 1000 SCREEN_HEIGHT = 650 SCREEN_TITLE = "Platformer" # Constants used to scale our sprites from their original size TILE_SCALING = 0.5 CHARACTER_SCALING = TILE_SCAL...
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import from math import floor from time import time from zlib import crc32 import codecs import logging import random import six import six.moves.urllib.robotparser as robotparser from frontera.core.components import States, DomainMetadata from f...
# Natural Language Toolkit: Collocations and Association Measures # # Copyright (C) 2001-2015 NLTK Project # Author: <NAME> <<EMAIL>> # URL: <http://nltk.org> # For license information, see LICENSE.TXT # """ Tools to identify collocations --- words that often appear consecutively --- within corpora. They may a...
import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.model_zoo as model_zoo class Inception3(nn.Module): def __init__(self, num_classes=512, aux_logits=True, transform_input=False): super(Inception3, self).__init__() self.aux_logits = aux_logits self.trans...
# Copyright 2018 The TensorFlow Probability 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 o...
# -*- coding: utf-8 -*- # # LibIndex handling # # Copyright (c) Honda Research Institute Europe GmbH # # 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 co...
import random import time from copy import deepcopy from functools import total_ordering from multiprocessing.queues import Queue from queue import PriorityQueue import numpy as np import math from scipy.linalg import cholesky, cho_solve, solve_triangular, LinAlgError from scipy.optimize import linear_sum_assignment f...
import unittest import tempfile import textwrap import six import conan.tools.qbs.qbstoolchain as qbs from conans import tools from conans.errors import ConanException from conans.test.utils.mocks import MockConanfile, MockSettings, MockOptions class RunnerMock(object): class Expectation(object): def _...
# Copyright 2012 OpenStack Foundation # Copyright 2013 IBM Corp. # 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/LIC...
# -*- coding: utf-8 -*- from optparse import OptionParser from xml.parsers import expat import struct _NodeCounter = 0 _NodeRemoveCounter = 0 _NodeVisitCounter = 0 _EmitCounter = 0 _EndOfWord = '$' _DiacriticIndex = { 'a': 'ÁáĂăǍǎÂâÄäȦȧẠạȀȁÀàẢảȂȃĀāĄąÅåḀḁȺⱥÃãǼǽǢǣÆæ', 'b': 'ḂḃḄḅƁɓḆḇɃƀƂƃ', 'c': 'ĆćČčÇçĈĉĊ...
""" Copyright (c) 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 writin...
### Import required python modules import logging from gevent import monkey; monkey.patch_all() import platform import os from os import listdir, stat, makedirs, mkdir, walk, remove, pardir from os.path import isdir, isfile, join, splitext, getmtime, basename, normpath, exists, expanduser, split, dirname, getsize, abs...
"""This script implements the main application logic for Doctrine.""" ##==============================================================# ## DEVELOPED 2015, REVISED 2015, <NAME>. # ##==============================================================# ##====================================================...
""" .. module:: mflike :Synopsis: Definition of simplistic likelihood for Simons Observatory :Authors: <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. """ import os from typing import Optional import numpy as np # from cobaya.conventions import _packages_path _packages_path = 'packages_path' from cobaya.l...
# Authors: <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # License: Simplified BSD import copy import os.path as op import numpy as np from numpy.testing import (assert_array_almost_equal, assert_array_equal, assert_allclose, assert_e...
#!/usr/bin/env python """Code from the paper "A signature-based machine learning model for bipolar disorder and borderline personality disorder". Given a participant of the study, trains the model using all other participants from the cohort in order to test the model with this participant then. This provides ...
#!/usr/bin/env python """ createSubStatsPlot.py migrated from cactusAssemblathonSubErrorPlotter.py 16 March 2011 ( 10 March 2011 ) dent earl, dearl(a) soe ucsc edu """ ############################## # Copyright (C) 2009-2011 by # <NAME> (<EMAIL>, <EMAIL>) # <NAME> (<EMAIL>, <EMAIL>) # <NAME> (<EMAIL>) # ... and other...
import GridCal.Engine as gc from ortools.linear_solver import pywraplp import numpy as np import pandas as pd from scipy.sparse.csc import csc_matrix def lpDot(mat, arr): """ CSC matrix-vector or CSC matrix-matrix dot product (A x b) :param mat: CSC sparse matrix (A) :param arr: dense vector or matrix...
import contextlib import json import os from collections import OrderedDict from sys import float_info from typing import Any, Dict, List, Optional, Set, Union, cast import bpy from bpy.app.translations import pgettext from mathutils import Vector from ..common import deep, vrm_types from ..common.preferences import ...
"""Module to expose resources through HTTP.""" # TODO: In docstring, add description of routing through resource(s) to an operation. import asyncio import base64 import fondat.error import fondat.resource import fondat.types import functools import http import http.cookies import inspect import logging import multid...
#!/usr/bin/env -S python3 -u """ Usage: wayland_proxy.py <executable> [arg1] [arg2].. wayland_proxy.py creates a new unix socket and points WAYLAND_DISPLAY to it before executing <executable> as subprocess. The subprocess will then connect to this socket instead of the original wayland socket. Once a client conne...
# -*- coding: utf-8 -*- """This module defines a player class exposing the Open AI Gym API. """ import asyncio import numpy as np # pyre-ignore import time from abc import ABC, abstractmethod, abstractproperty from queue import Queue from threading import Thread from typing import Any, Callable, List, O...
#!/usr/bin/env python2 """ builtin_process.py - Builtins that deal with processes or modify process state. This is sort of the opposite of builtin_pure.py. """ from __future__ import print_function import signal # for calculating numbers from _devbuild.gen import arg_types from _devbuild.gen.runtime_asdl import ( ...
#!/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 os import time import joblib import tqdm import glob import imageio import copy import numpy as np from typing im...
import calendar import math import pandas as pd import time import twstock import requests from datetime import datetime, timedelta from dateutil import relativedelta from db.Connection import session from enum import Enum from model.StockHistory import StockHistory from sys import float_info from talib import abstract...
"""remote ctypes, a try to a ctypes wrapper that accept a target object for every ready operation Some code is copy-paste, might be userful to rewrite some part later""" import _ctypes import ctypes import ctypes.wintypes import itertools from _ctypes import _SimpleCData # ## Utils ### # def is_pointer(x): retur...
# 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 u...
import sys import string import tensorflow as tf from tensorflow.python.ops import control_flow_ops from aster.core import standard_fields as fields from aster.c_ops import ops def _apply_with_random_selector(x, func, num_cases): """Computes func(x, sel), with sel sampled from [0...num_cases-1]. Args: x: i...
import probability as prb import pprint import random import itertools as it #todo: opening fire, expected value of strategic bombing raid against risk, sub withdrawal, #sub/plane individuation: # sub not hit planes, # chance of taking territory (planes can't take territory) # planes potential targets...
from collections import namedtuple from operator import add, setitem import pickle from random import random import types from toolz import identity, partial, merge import pytest import dask from dask import compute from dask.compatibility import PY2, PY3 from dask.delayed import delayed, to_task_dask, Delayed from d...
#!/usr/bin/env python import rospy import numpy as np import math from geometry_msgs.msg import PoseStamped, TwistStamped from styx_msgs.msg import Lane, Waypoint from std_msgs.msg import Int32 ''' This node will publish waypoints from the car's current position to some `x` distance ahead. As mentioned in the doc, y...